Vipul Kumar [Thu, 10 Jan 2019 07:04:15 +0000 (12:34 +0530)]
usb: typec: Separate the definitions for data and power roles
As per 'commit
ceeb162500c3 ("usb: typec: Separate the definitions for
data and power roles")', make changes to fix the compilation warnings.
drivers/usb/typec/tcpm.c: In function ‘tcpm_qos_handling’:
drivers/usb/typec/tcpm.c:892:28: warning: comparison between ‘enum typec_port_type’ and ‘enum typec_port_data’ [-Wenum-compare]
if (port->typec_caps.type == TYPEC_PORT_UFP)
^~
drivers/usb/typec/tcpm.c:894:33: warning: comparison between ‘enum typec_port_type’ and ‘enum typec_port_data’ [-Wenum-compare]
else if (port->typec_caps.type == TYPEC_PORT_DFP)
^~
drivers/usb/typec/tcpci.c: In function ‘tcpci_parse_config’:
drivers/usb/typec/tcpci.c:701:17: warning: comparison between ‘enum typec_port_type’ and ‘enum typec_port_data’ [-Wenum-compare]
if (tcfg->type == TYPEC_PORT_UFP)
^~
drivers/usb/typec/tcpci.c:726:17: warning: comparison between ‘enum typec_port_type’ and ‘enum typec_port_data’ [-Wenum-compare]
if (tcfg->type == TYPEC_PORT_DFP)
^~
drivers/usb/typec/tcpci.c:816:15: warning: comparison between ‘enum typec_port_type’ and ‘enum typec_port_data’ [-Wenum-compare]
tcfg->type == TYPEC_PORT_UFP)
^~
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 10:20:23 +0000 (15:50 +0530)]
MLK-18744 usb: typec: tcpm: qos handling fix
Commit
661b7ec2359e ("MLK-17921-2 staging: typec: tcpm: add qos for
PD transfer") introduce qos for tcpm transfer between typec controller
and CPU, but the request and remove are not balanced well, the initial
request should be moved to tcpm_port_register as tcpm_init will be called
for every hard reset, and also move qos hold&release to where port state
changes.
Fixes:
661b7ec2359e ("MLK-17921-2 staging: typec: tcpm: add qos for PD transfer")
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 10:13:25 +0000 (15:43 +0530)]
MLK-17921-2 usb: typec: tcpm: add qos for PD transfer
TCPCI based typec port controller needs very strict low latency
on i2c transfer, this patch is to improve this by adding qos and
high bus handling in tcpm during PD session setup.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 10:01:47 +0000 (15:31 +0530)]
MLK-18531 usb: typec: don't do vbus source disable for dead battery
In PTN5110 design, DisableSourceVBUS command also disables the sink
enable signal because the EN_SNK can be used to source higher voltage,
and, there is only one TCPC command to disable sourcing voltage without
telling whether to disable 5V or the high voltage, and to keep the
design simple they designed the PTN5110 to disable both. with this
fact, we use the flag drive_vbus to check if the source vbus enable was
issued, if yes we then do vbus source disable, in dead battery case,
we never did vbus source enable, so will not issue vbus source disable
command.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 09:59:41 +0000 (15:29 +0530)]
MLK-17108-4 usb: typec: tcpci: correct read data msg length
Per tcpci spec, the TCPC_RX_BYTE_CNT is the number of bytes in the
RX_BUFFER_DATA_OBJECTS plus three (for the RX_BUF_FRAME_TYPE and
RX_BUF_HEADER), so after read out the header, we should only read
TCPC_RX_BYTE_CNT-3 bytes for data if this is a data message.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 09:56:13 +0000 (15:26 +0530)]
MLK-17108-3 usb: typec: tcpci: don't do force discharge if enable vbus sink
We use vbus force discharge to have a quick vbus off for power role swap,
which works like this: enable vbus force discharge and wait the vbus fall
below vbus low threshold, when reaches, an alarm generated and tcpm can go
forward. but current code do vbus force discharge in any disable source
vbus case, in enable vbus charge case, we firstly disable source vbus and
then turn on vbus sink, in between, vbus force discharge should not be
enabled.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Jun Li [Wed, 9 Jan 2019 09:52:23 +0000 (15:22 +0530)]
MLK-17108-2 usb: typec: support dead battery charging
If the vbus is aready on and remote cc state is Rp while typec init, we
think it's a dead battery case, this needs the PD session already setup
by bootloader, so kernel can negotiate a new power session by soft reset,
this patch use the exsiting flag vbus_never_low as boot from dead battery
flag, but update the condition of setting it: not only check vbus, also
the cc status to make sure remote is a power source, if yes, bypass the
vbus sink disable. If the vbus is from local, we will still disable vbus
charge so original code intention is kept.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 09:22:14 +0000 (14:52 +0530)]
MLK-17217 usb: typec: tcpci: system wakeup source support
As GPIO normally can be system wakeup source, so enable typec events
as system wakeup source if user requested.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Vipul: Fixes for 4.19 kernel.
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Thu, 14 Dec 2017 16:09:25 +0000 (00:09 +0800)]
MLK-17128-1 dt-bindings: typec: add max_snk_mw property
Add max_snk_mw property for power sink to know the max power.
Because the max mw may be smaller than the max ma multiplied by
max mv:
max-mw <= max-mv*max-ma
After the power sink decides the PDO from source, it needs
to check the power to see if the provided power of this PDO
can match its requirement, which needs consider max_snk_mw to
know the max current it can have based on selected voltage.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 09:14:42 +0000 (14:44 +0530)]
MLK-17092 usb: typec: enable vbus voltage low alarm
We use vbus low voltage alarm to start vbus discharge to meet
timing requirement on turning off vbus for power swap from
source to sink, per type-C port controller spec(tcpci), the
Voltage Alarms Power status reporting is disabled by default,
so we need enable it at tcpci init.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 09:11:51 +0000 (14:41 +0530)]
MLK-17077 usb: typec: clear vbus change event in irq handler
For vbus change event, we need read the vbus status to clear
the alert. Current code do this in queue work, this has problem
on single core running, the queue work of vbus change may have
no chance to be scheduled as we continue receive the vbus change
event in threaded irq.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Tue, 28 Nov 2017 11:17:20 +0000 (19:17 +0800)]
MLK-16820-4 dt-bindings: typec: add basic typec properties
port-type is required for any typec port; default-role is only required
for drp; power source capable needs src-pdos; power sink capable needs
snk-pdos, max-snk-mv, max-snk-ma, op-snk-mw.
Signed-off-by: Li Jun <jun.li@nxp.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 09:02:42 +0000 (14:32 +0530)]
MLK-16776 usb: typec: tcpci: use vbus from partner for EXTCON_USB
Change to use the vbus from partner to notify EXTCON_USB.
This is to work around the case of source only typec port
connecting to Host PC via a Rp fixed cable.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 08:57:23 +0000 (14:27 +0530)]
MLK-16697 usb: typec: tcpci: add notfication for device attach
Some usb device driver can't know the connect and disconnect to host
if the vbus is always on, if use typec we can rely on cc line status
to know that, so add a notification to let controller driver know
device attach and detach from host.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Peter Chen [Wed, 9 Jan 2019 08:52:08 +0000 (14:22 +0530)]
MLK-16285-2 usb: typec: tcpci: add optional reset pin support
Some USB3 differential channel switch chips need to do reset before
functional, we add this support here.
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Peter Chen [Wed, 9 Jan 2019 07:44:27 +0000 (13:14 +0530)]
MLK-16285-1 usb: typec: tcpci: move request interrupt to the end of probe
The tcpci_irq may visit tcpci->port if unexpected interrupt occurs
(eg, board design issue causes GPIO status is incorrect) and cause
NULL pointer dereference issue.
Besides, delete clear TCPC_ALERT and TCPC_ALERT_MASK code which are
already done at tcpci_init.
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 07:34:03 +0000 (13:04 +0530)]
MLK-16298-1 usb: typec: make super speed signal mux select configurable
Instead of fixed pull up super speed mux selection gpio for cc1, use
GPIO_ACTIVE_HIGH/LOW to map the CC1/CC2 orientation via gpiod api, So
for ss-sel-gpios:
GPIO_ACTIVE_HIGH: CC1 <--> GPIO high
GPIO_ACTIVE_LOW : CC1 <--> GPIO low
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 07:29:18 +0000 (12:59 +0530)]
MLK-16013-44 usb: typec: tcpm: set data role after src detach
As the default data role is device mode if the port is not host,
so set the port data role to be device mode after src detach, this
is to fix the issue of port data role still kept to be host while
the port is open.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 07:27:41 +0000 (12:57 +0530)]
MLK-16013-43 usb: typec: tcpci: add extcon for data role switch
Use extcon device for dual role switch on typec port.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 07:19:26 +0000 (12:49 +0530)]
MLK-16013-37 usb: typec: Power swap force discharge for source
VBus off only means the vbus falls to be below 4v, we can use vbus
force discharge and vbus low alarm to go forward.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 07:16:13 +0000 (12:46 +0530)]
MLK-16013-36 usb: typec: wait for cc change on ERROR_RECOVERY
We should wait at least tErrorRecovery before move to unattached state.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 07:14:21 +0000 (12:44 +0530)]
MLK-16013-34 usb: typec: Support cc changes on RP pull-up value
CC line changes on souce side RP value is permitted per standard, in
this case we should move to SNK_ATTACH_WAIT.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 07:11:29 +0000 (12:41 +0530)]
MLK-16013-33 usb: typec: Do not switch to unattached state for BIST
If we received unsupported BIST command, we should by pass it and ready
to accept following command for test, not unconditionly to set the port
to be unattached state and terminate the test.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 07:09:10 +0000 (12:39 +0530)]
MLK-16013-32 usb: typec: refine source to sink swap handling
To early start sink power after source turn off vbus, move the set power
role after vbus is turned off in PR_SWAP_SRC_SNK_SOURCE_OFF, also per
spec, we should do error recovery if the sink side does not turn on
vbus in PD_T_PS_SOURCE_ON.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 07:07:13 +0000 (12:37 +0530)]
MLK-16013-31 usb: typec: Set to unattached state if souce disconnected
In SNK_HARD_RESET_SINK_ON, if the source disconnected, we should set
state to be unattached state intead of startup sink.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 07:00:39 +0000 (12:30 +0530)]
MLK-16013-30 usb: typec: Reset hard_reset_count to be 0 after send source cap
Per standard, we should clear the hard reset count to be 0 after souce
sent the source cap.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 06:58:35 +0000 (12:28 +0530)]
MLK-16013-29 usb: typec: tcpm: Don't reset message id after soft reset
If the power source sent soft reset and the other end accepted, we should
not reset the message id as it was already updated by pd_transmit when
handling the soft reset.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Vipul Kumar [Thu, 10 Jan 2019 05:46:29 +0000 (11:16 +0530)]
usb: typec: add max_snk_mv/ma/mw
This patch add max_snk_mv/ma/mw to fix the below
compilation error.
drivers/usb/typec/tcpci.c:707:15: error: ‘struct tcpc_config’ has no member named ‘max_snk_mv’
&tcfg->max_snk_mv) ||
^~
drivers/usb/typec/tcpci.c:709:13: error: ‘struct tcpc_config’ has no member named ‘max_snk_ma’
&tcfg->max_snk_ma) ||
^~
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 11:27:21 +0000 (16:57 +0530)]
MLK-16013-9 usb: typec: add interface to get port type and role
Add interface to get typec port type and default power role from
dt. To validate a correct setting is specified, add TYPEC_PORT_TYPE_UNKNOWN
and TYPEC_ROLE_UNKNOWN for typec_port_type and typec_role enum.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
During 4.14 rebase renamed to typec_port_types_dt to avoid conflict with
sysfs values.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Rebase it on v4.19
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 06:44:00 +0000 (12:14 +0530)]
MLK-16013-27 usb: typec: add super speed signal mux selection
According to the polarity of cc line, we need to do USB3 signal mux
selection if it's controlled by software.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 06:31:50 +0000 (12:01 +0530)]
MLK-16013-26 usb: typec: tcpm: update PD timing
This patch is to update several PD timings for PD compliance, all
those timing definitions should be configurable via user config,
this can be improved later, for now I just update its values in PD
spec defined range.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 06:28:55 +0000 (11:58 +0530)]
MLK-16013-25 usb: typec: tcpm: correct the PD_T_SENDER_RESPONSE value
Per PD spec, the sender response should be in a small range 24~30ms, so
correct the PD_T_SENDER_RESPONSE to be 25.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 06:26:46 +0000 (11:56 +0530)]
MLK-16013-24 usb: typec: tcpm: use hrtimer for send response
As the sender response timer have very small margin(25~30ms), so
use a hrtimer to handle it.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
Li Jun [Wed, 9 Jan 2019 06:14:38 +0000 (11:44 +0530)]
MLK-16013-23 usb: typec: tcpm: Do soft reset for unexpected get sink cap
A source or sink should receive the get_sink_cap message when in SRC_RDY or
SNK_RDY, if the port receives a get sink capability request before ready,
which means there is message sync error, we should do soft reset to recover
from it, instead of sending a reject message.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 06:12:22 +0000 (11:42 +0530)]
MLK-16013-22 usb: typec: tcpm: split operations of power swap from sink to source
Add one more state:PR_SWAP_SNK_SRC_ASSERT_RP, as the next state of
PR_SWAP_SNK_SRC_SINK_OFF, it will turn on vbus and wait the vbus
is really on and then send the PS_RDY to the other side.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 06:07:36 +0000 (11:37 +0530)]
MLK-16013-21 usb: typec: tcpm: handle pd message send failure
If the PD message send failed, we need to do soft reset, further if
soft reset failed, we have to start a hard reset.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 05:57:08 +0000 (11:27 +0530)]
MLK-16013-20 usb: typec: Add bist test mode support
BIST(Built In Self-Test – Power Delivery testing mechanism for
the PHY Layer), see PD 3.0 spec 5.9 Built in Self-Test (BIST), is
added to support BIST message handling in PD compliance test.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 05:50:31 +0000 (11:20 +0530)]
MLK-16013-18 usb: typec: handle unexpected vbus from sink
Power source detected the attachment of sink, will firstly check
the vbus level to make sure power sink isn't sourcing vbus(< 600mv)
before going forward, otherwise it will terminate the session and
go to SRC_UNATTACHED state, this is required by PD compliance.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Vipul Kumar [Thu, 10 Jan 2019 05:24:10 +0000 (10:54 +0530)]
usb: typec: tcpm: Fix compilation error
As per 'commit
8e04b3721cc8 ("typec: tcpm: add starting value for drp
toggling")', make changes to fix the below compilation error.
drivers/usb/typec/tcpm.c: In function ‘tcpm_src_attach’:
drivers/usb/typec/tcpm.c:2625:2: error: too few arguments to function ‘tcpm_start_drp_toggling’
tcpm_start_drp_toggling(port);
^~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/tcpm.c:2537:13: note: declared here
static bool tcpm_start_drp_toggling(struct tcpm_port *port,
^~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/tcpm.c: In function ‘tcpm_snk_attach’:
drivers/usb/typec/tcpm.c:2749:2: error: too few arguments to function ‘tcpm_start_drp_toggling’
tcpm_start_drp_toggling(port);
^~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/tcpm.c:2537:13: note: declared here
static bool tcpm_start_drp_toggling(struct tcpm_port *port,
^~~~~~~~~~~~~~~~~~~~~~~
scripts/Makefile.build:303: recipe for target 'drivers/usb/typec/tcpm.o' failed
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 05:41:51 +0000 (11:11 +0530)]
MLK-16013-17 usb: typec: tcpm: optimise cc toggling for drp port
We should only enable drp auto toggling when unattached, so add one
more parameter; when attached, we set the cc line state according to
the other end cc status.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 05:24:57 +0000 (10:54 +0530)]
MLK-16013-16: usb: typec: tcpm: tcpm init sequence update
Force an error recovery is not a good way to handle all cases and may
break the case of power up with typec already connected. Also the tcpc
init should start after tcpm init setup is done, as tcpc init will
turn on HW event alert so may generate events immediately and drive
tcpm state machine go forward, so move it at the end of tcpm_init.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 05:18:11 +0000 (10:48 +0530)]
MLK-16013-15: usb: typec: tcpci: Enable vbus force discharge
Enable vbus low voltage alert and do force discharge, this can aid turn
off vbus quickly.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 05:07:25 +0000 (10:37 +0530)]
MLK-16013-14: usb: typec: tcpci: handle fault event
We need clear any fault alerts to make tcpci controller to recover
from fault.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 05:03:36 +0000 (10:33 +0530)]
MLK-16013-13: usb: typec: tcpci: handle rx buffer overflow event
Add rx buffer overflow event handling.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 05:01:01 +0000 (10:31 +0530)]
MLK-16013-12: usb: typec: tcpci: clear pending events before request irq
Clear all possible pending events before request irq.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 04:38:03 +0000 (10:08 +0530)]
MLK-16013-11 usb: typec: only clear alert events for enabled irq
Uncondtionaly clear all events may impact the typec controller state
machine, so save the enabled irq and only clear alert events for enabled
irq.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Li Jun [Wed, 9 Jan 2019 04:30:46 +0000 (10:00 +0530)]
MLK-16013-10 usb: typec: add vbus detection for power sink
Typec port controller may need enable vbus detection to detect
the vbus from power source.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Zidan Wang [Fri, 31 Jul 2015 09:02:48 +0000 (17:02 +0800)]
MLK-11305 radio-si476x: support set V4L2_CID_AUDIO_MUTE CTRL
By using gstreamer plugin v4l2radio, it will call VIDIOC_S_CTRL with
V4L2_CID_AUDIO_MUTE, but return failed.
So add V4L2_CID_AUDIO_MUTE CTRL support for radio-si476x.
Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit
c18520adfd6de40dcc0659ddd778b0a2bd383cd4)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Thomas Gleixner [Thu, 30 Aug 2018 15:05:19 +0000 (17:05 +0200)]
MLK-19455 tick/nohz: Prevent bogus softirq pending warning
Commit
0a0e0829f990 ("nohz: Fix missing tick reprogram when interrupting an
inline softirq") got backported to stable trees and now causes the NOHZ
softirq pending warning to trigger. It's not an upstream issue as the NOHZ
update logic has been changed there.
The problem is when a softirq disabled section gets interrupted and on
return from interrupt the tick/nohz state is evaluated, which then can
observe pending soft interrupts. These soft interrupts are legitimately
pending because they cannot be processed as long as soft interrupts are
disabled and the interrupted code will correctly process them when soft
interrupts are reenabled.
Add a check for softirqs disabled to the pending check to prevent the
warning.
Reported-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reported-by: John Crispin <john@phrozen.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Grygorii Strashko <grygorii.strashko@ti.com>
Tested-by: John Crispin <john@phrozen.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Jason Liu <Jason.hui.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Frank Li [Thu, 17 May 2018 17:26:48 +0000 (12:26 -0500)]
MLK-18338-2 perf: ddr: added axid filter support
perf stat -a -e ddr0/axid-read,axi_id=MMMMDDDD/ cmd
MMMM AXI_MASKING
DDDD AXI_ID
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Dong Aisheng [Thu, 30 Nov 2017 09:32:08 +0000 (17:32 +0800)]
MLK-17074-3 PM / Domains: use default state 0 to enter for multi states domains
If no valid state idx specified by governor, we use the default state_idx
0 to enter in case the domain has multi low power states.
Reviewed-by: Frank Li <frank.li@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Dong Aisheng [Mon, 27 Nov 2017 09:33:47 +0000 (17:33 +0800)]
MLK-17074-2 PM / Domains: choose the deepest state to enter if no devices using it
For a domain belongs to no devices anymore, let's choose the deepest state
to enter to save power.
Reviewed-by: Frank Li <frank.li@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Dong Aisheng [Fri, 24 Nov 2017 08:31:32 +0000 (16:31 +0800)]
MLK-17074-1 PM / Domains: support enter deepest state for multiple states domains
Currently the generic power domain suspend code pm_genpd_suspend_noirq
will try to power off a domain used by devices in genpd_sync_poweroff
if its status is not GPD_STATE_ACTIVE.
However, for power domains supporting multiple low power states, it may
already enter an intermediate low power state by runtime PM before system
suspend and the status is already GPD_STATE_POWER_OFF which results in
then the power domain stay at an intermediate low power state during
system suspend.
Let's give the power domain a chance to switch to the deepest state in
case it's already off but in an intermediate low power state.
Due to power domain is alway off, so no need to check device wakeup
case anymore.
Reviewed-by: Frank Li <frank.li@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Frank Li [Wed, 28 Jun 2017 16:36:57 +0000 (11:36 -0500)]
MLK-15300-1 perf: fixed crash when irq have not assigned in dts file
[ 28.061044] perf[2494]: PC Alignment exception: pc=
0000000072656d69 sp=
ffff800032f2bd30
[ 28.069061] Internal error: Oops - SP/PC alignment exception:
8a000000 1 PREEMPT SMP
[ 28.077066] Modules linked in:
[ 28.080128] CPU: 2 PID: 2494 Comm: perf Not tainted
4.9.11-02540-g3ebe22c #52
[ 28.087263] Hardware name: Freescale i.MX8QXP LPDDR4 ARM2 (DT)
[ 28.093093] task:
ffff80002e097080 task.stack:
ffff800032f28000
[ 28.099011] PC is at 0x72656d69
[ 28.102163] LR is at perf_try_init_event+0x98/0xb0
[ 28.106950] pc : [<
0000000072656d69>] lr : [<
ffff0000081594e0>] pstate:
60000145
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Tiberiu Breana [Wed, 14 Jun 2017 14:50:11 +0000 (17:50 +0300)]
MLK-13855-3: perf: ddr-perf: Add counter overflow handling
Added support for counter overflow interrupts.
When the cycles counter overflows, update all local event data,
then reset it and let it continue counting.
Signed-off-by: Tiberiu Breana <andrei-tiberiu.breana@nxp.com>
[Arul: fsl-imx8qm.dtsi changes shall be added separately]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Tiberiu Breana [Mon, 19 Jun 2017 08:21:52 +0000 (11:21 +0300)]
MLK-13855-2: perf: ddr-perf: Always enable the cycles counter
Always enable cycles counter 0, regardless if it is explicitly
selected by the user or not. The cycles counter generates overflow
interrupts that will be used to update other counters.
Signed-off-by: Tiberiu Breana <andrei-tiberiu.breana@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Tiberiu Breana [Wed, 14 Jun 2017 14:45:47 +0000 (17:45 +0300)]
MLK-13855-1: perf: ddr-perf: Clean up driver
- repurpose e2c_map array to a perf_event* array
- add ddr_perf_event_enable function
- tidy up indenting
Signed-off-by: Tiberiu Breana <andrei-tiberiu.breana@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Bai Ping [Tue, 21 Mar 2017 03:16:18 +0000 (11:16 +0800)]
MLK-14238-02: dt-bindings: pwm: Add NXP TPM PWM
Add binding doc for tpm pwm module.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Frank Li [Wed, 5 Oct 2016 19:54:42 +0000 (14:54 -0500)]
MLK-14379: drivers: perf: Add DDR perf count support
perf stat -a -e ddr0/cycles/,ddr0/read-bytes/,ddr0/write-bytes/,ddr1/cycles/,d
dr1/read-bytes/,ddr1/write-bytes/ dd if=/dev/zero of=/dev/null bs=10M count=1
1+0 records in
1+0 records out
Performance counter stats for 'system wide':
7236174 ddr0/cycles/ (99.97%)
8573 ddr0/read-bytes/ (99.99%)
163628 ddr0/write-bytes/
7256543 ddr1/cycles/ (99.99%)
9308 ddr1/read-bytes/ (100.00%)
165039 ddr1/write-bytes/
0.
008990125 seconds time elapsed
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Tiberiu Breana <andrei-tiberiu.breana@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Jason Liu [Wed, 23 Nov 2016 07:42:54 +0000 (15:42 +0800)]
of: of_reserved_mem: Ensure cma reserved region not cross the low/high memory
Need ensure the cma reserved region not cross the low/high memory boundary
when using the dynamic allocation methond through device-tree, otherwise,
kernel will fail to boot up when cma reserved region cross how/high mem.
Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Antoine Bouyer [Fri, 4 May 2018 09:48:09 +0000 (11:48 +0200)]
MLK-18261 irqchip: imx-irqsteer: fix idx calculation for mask callback
Fixes:
a2e6a7833495 (MLK-16136-9 irqchip: imx-irqsteer: adjust irq config
via 'endian')
This patch fixes mask register offset calculation, when endian is not
default value 0 (i.e imx8mq).
Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fugang Duan [Thu, 21 Dec 2017 01:03:57 +0000 (09:03 +0800)]
MLK-17290-01 irqchip: imx-irqsteer: add runtime pm support
Add runtime pm to manage irqsteer clock and its power domain in system
idle and suspend status to save power.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Tested-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fugang Duan [Mon, 20 Nov 2017 07:55:40 +0000 (15:55 +0800)]
MLK-16909 irqchip: imx-irqsteer: restore registers after power off
Once irqsteer controller is power off during suspend, the registers
are lost, it should restore the registers after resume back.
BuildInfo:
- SCFW
a479ff78, IMX-MKIMAGE
ff9860c5, ATF
923651a
- U-Boot
2017.03-00691-g96cf020
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Tested-by: Pandy.gao <pandy.gao@nxp.com>
Acked-by: Pandy.gao <pandy.gao@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Seb Laveze [Wed, 23 Aug 2017 08:55:00 +0000 (10:55 +0200)]
MLK-16473 irqchip: imx-irqsteer: change irqsteer type to level
Irqsteer block only supports level interrupts.
(BuildInfo: SCFW
3e70523d, IMX-MKIMAGE 0, ATF 0)
Signed-off-by: Seb Laveze <sebastien.laveze@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Shengjiu Wang [Tue, 5 Sep 2017 08:22:45 +0000 (16:22 +0800)]
MLK-16368: irqchip: intmux: fix address definition of register
Fix the offset of CHANIPR register address. Document is KL28Z
reference manual
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fancy Fang [Fri, 4 Aug 2017 10:33:44 +0000 (18:33 +0800)]
MLK-16136-9 irqchip: imx-irqsteer: adjust irq config via 'endian'.
Change the irq configurations with adding endianness
determination for different platforms which may choose
different kinds of endianess.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fancy Fang [Fri, 4 Aug 2017 06:32:46 +0000 (14:32 +0800)]
MLK-16136-7 irqchip: imx-irqsteer: correct registers macro defitions
Correct several macro definitions related with irqsteer
to avoid incorrect expression calculation due to operators
priority.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Shengjiu Wang [Mon, 24 Jul 2017 06:09:57 +0000 (14:09 +0800)]
MLK-16077-1: irqchip: intmux: add interrupt multiplexing support
The intmux module is used to output internal interrupt in subsystem
to system with 32-to-8 configuration. It has several multiplex
channels depends on system. intmux is introduced in KL28Z reference
manual.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Peng Fan [Mon, 5 Jun 2017 11:47:17 +0000 (19:47 +0800)]
MLK-15009 irqchip: imx-irqsteer: correct type of irqstat
The type of irqstat in irqsteer_irqchip_data unsigned long, actually
it needs to be 32bits width, so use unsigned int.
And use sizeof(irqsteer_data->irqstat[0]), instead of 4 when alloc
memory for irqsteer_data.
for_each_set_bit needs the second param type is unsigned long *, so
cast the irqsteer_data->irqstat to unsigned long *, this is safe here.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fugang Duan [Mon, 5 Jun 2017 03:31:10 +0000 (11:31 +0800)]
MLK-15005-03 irqchip: irqsteer: add ipg clock support
Some subsystems have lpcg sw_bit to control the ipg_clk to LIS,
so add the ipg clock for the module.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fugang Duan [Sat, 13 May 2017 11:19:29 +0000 (19:19 +0800)]
MLK-14978 irqchip: irqsteer: add NXP imx8 irq steer controller support
The IrqSteer module redirects/steers the incoming interrupts to output
interrupts of a selected/designated channel as specified by a set of
configuration registers.
NXP i.MX8x chips integrate IrqSteer controller for some DSC to share irq
line for all modules in the subsystem which can reduce the IRQ lines
connected to the parent interrupt controller GIC, so IrqSteer irqchip
acts as the second irq domain in the system.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fugang Duan [Thu, 8 Mar 2018 10:43:10 +0000 (18:43 +0800)]
MLK-17740 ARM: imx_v7_defconfig: enable wireless HOSTAP
Add wireless HOSTAP config enable for i.MX7ULP Murata 1PJ (Qca9377-3).
Reviewed-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Andy Duan [Fri, 11 May 2018 02:26:51 +0000 (10:26 +0800)]
MLK-18276-01 ARM: imx_v7_defconfig: add regulatory rules t database config
Enable regulatory rules database config:
CONFIG_CFG80211_INTERNAL_REGDB
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Lo-Hsiang Lo [Fri, 21 Sep 2018 06:37:41 +0000 (14:37 +0800)]
MLK-18993 brcmfmac: configure wowl parameters only if firmware support wowl
Configure wowl parameters only if firmware support wowl.
Tested-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
ceccd33fb63e49cb816a827c0dfcb8abf7059e7f)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Saravanan Shanmugham [Wed, 13 Sep 2017 05:04:14 +0000 (14:04 +0900)]
MLK-19517-18 brcmfmac: map 802.1d priority to precedence level based on AP WMM params
In WLAN, priority among various access categories of traffic is
always set by the AP using WMM parameters and this may not always
follow the standard 802.1d priority.
In this change, priority is adjusted based on the AP WMM params
received as part of the Assoc Response and the same is later used
to map the priority of all incoming traffic.
This change should fix the following 802.11n certification tests:
* 5.2.31 ACM Bit Conformance test
* 5.2.32 AC Parameter Modification test
Signed-off-by: Saravanan Shanmugham <sasm@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
62657fc5931db1c1d48c3181f2f4effebf37a74b)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Chi-Hsien Lin [Tue, 12 Jun 2018 09:41:43 +0000 (04:41 -0500)]
MLK-19517-17 brcmfmac: 4373 save-restore support
Use sr_eng_en bit to check 4373 sr support.
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
af0f9024b058dbbf529dcb2dedae9ae3919ebe8b)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Chung-Hsien Hsu [Mon, 11 Jun 2018 09:32:21 +0000 (17:32 +0800)]
MLK-19517-16 brcmfmac: fix full timeout waiting for action frame on-channel tx
The driver sends an action frame down and waits for a completion signal
triggered by the received BRCMF_E_ACTION_FRAME_OFF_CHAN_COMPLETE event
to continue the process. However, the action frame could be transmitted
either on the current channel or on an off channel. For the on-channel
case, only BRCMF_E_ACTION_FRAME_COMPLETE event will be received when
the frame is transmitted, which make the driver always wait a full
timeout duration. This patch has the completion signal be triggered by
receiving the BRCMF_E_ACTION_FRAME_COMPLETE event for the on-channel
case.
Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
3758e8288d6feb7b5dc125a4b8107a4f7e5963ab)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Chung-Hsien Hsu [Fri, 8 Jun 2018 09:34:33 +0000 (17:34 +0800)]
MLK-19517-15 brcmfmac: reduce timeout for action frame scan
Finding a common channel to send an action frame out is required for
some action types. Since a loop with several scan retry is used to find
the channel, a short wait time could be considered for each attempt.
This patch reduces the wait time from 1500 to 450 msec for each action
frame scan.
Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
4435f37332bd39026028a81b6e442bbe3105e790)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Madhan Mohan R [Thu, 24 May 2018 08:49:00 +0000 (14:19 +0530)]
MLK-19517-14 brcmfmac: increase max hanger slots from 1K to 3K in fws layer
Will enable FMAC to push more packets to bus tx queue and help
improve throughput when fws queuing is enabled. This change is
required to tune the throughput for passing WMM CERT tests.
Signed-off-by: Madhan Mohan R <MadhanMohan.R@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
48195bf1b7dea8c6030dfce45900dda60f2d0ea4)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Double Lo [Wed, 6 Jun 2018 02:39:58 +0000 (21:39 -0500)]
MLK-19517-13 brcmfmac: disable command decode in sdio_aos for 4354
Transaction between AOS and SDIOD is not protected, and if cmd 52
received in AOS and in the middle of response state changed from AOS to
SDIOD, response is corrupted and it causes to SDIO Host controller to
hang.
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
50ad46dcdb5f23514f81567e7b0ac7f3ec9dc281)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Chi-Hsien Lin [Fri, 1 Jun 2018 10:22:05 +0000 (05:22 -0500)]
MLK-19517-12 brcmfmac: only generate random p2p address when needed
P2p spec mentioned that the p2p device address should be the globally
administered address with locally administered bit set. Therefore,
follow this guideline by default.
When the primary interface is set to a locally administered address, the
locally administered bit cannot be set again. Generate a random locally
administered address for this case.
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
930ac6e9230a48a775e55ee6cb31c4dffe5d5dcc)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Madhan Mohan R [Wed, 23 May 2018 11:52:44 +0000 (17:22 +0530)]
MLK-19517-11 brcmfmac: P2P CERT 6.1.9-Support GOUT handling P2P Presence Request
Send P2P Presence Response from the p2p interface address instead
of the p2p device address.
Signed-off-by: Madhan Mohan R <MadhanMohan.R@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
1ce946c329e68457fd8e72da33d17251a7f2377c)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Wright Feng [Thu, 31 May 2018 02:11:20 +0000 (21:11 -0500)]
MLK-19517-09 brcmfmac: disable command decode in sdio_aos for 4339/4345
Transaction between AOS and SDIOD is not protected, and if cmd 52
received in AOS and in the middle of response state changed from AOS to
SDIOD, response is corrupted and it causes to SDIO Host controller to
hang.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
166eee38c42e1dad00b05c52f9c3a8d6b5c8853f)
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Wright Feng [Tue, 29 May 2018 07:52:58 +0000 (02:52 -0500)]
MLK-19517-08 brcmfmac: fix unused variable building warning message
The variable "wq_flags" is not used anymore. Remove it.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
453591909a747bede4ff3fabe1d4073370f920f4)
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Wright Feng [Fri, 25 May 2018 07:02:04 +0000 (02:02 -0500)]
MLK-19517-07 brcmfmac: remove "arp_hostip_clear" from "brcmf_netdev_stop"
The firmware does not respond ARP request and causes ping failed with
following steps.
1. Bring up interface
ifconfig wlan0 up or start wpa_supplicant
2. Set the IP address
ifconfig wlan0 192.168.100.10
3. Bring down interface or
ifconfig wlan0 down or kill wpa_supplicant
4. Bring up interface again and set the same IP address
5. Connect to AP(192.168.100.1) and ping to AP will be failed.
FMAC clears arp_hostip when bringing down the interface, but not set it
back if setting the same IP address. We are able to see the IP address
in interface info(inconfig wlan0) but the ping still cannot work because
the firmware ARP offload does not respond the ARP request.
Because of that, we remove "arp_hostip_clear" from function
"brcmf_netdev_stop"
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
840f43680465c41ab40be3758f9dc91a91175d98)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Chung-Hsien Hsu [Thu, 24 May 2018 03:15:09 +0000 (11:15 +0800)]
MLK-19517-06 brcmfmac: add 4-way handshake offload detection for FT-802.1X
Add 4-way handshake offload detection for FT with EAP authentication.
Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
e25e421d61441199b50e4c13f50a27416f00c65c)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Wright Feng [Wed, 18 Apr 2018 02:33:21 +0000 (21:33 -0500)]
MLK-19517-05 brcmfmac: add credit map updating support
The credit numbers are static and tunable per chip in firmware side.
However the credit number may be changed that is based on packet pool
length and will send BRCMF_E_FIFO_CREDIT_MAP event to ask host driver
updating the credit numbers during interface up.
The purpose of this patch is making host driver has ability of updating
the credit numbers when receiving the BRCMF_E_FIFO_CREDIT_MAP event.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
b26faa8fe2a6cc7e8b2acceb35254b9fad5bd461)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Wright Feng [Mon, 26 Mar 2018 02:53:42 +0000 (21:53 -0500)]
MLK-19517-04 brcmfmac: make setting SDIO workqueue WQ_HIGHPRI a module parameter
With setting sdio_wq_highpri=1 in module parameters, tasks submitted to
SDIO workqueue will put at the head of the queue and run immediately.
This parameter is for getting higher TX/RX throughput with SDIO bus.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
7c2b310299f051be555c6928f0f858fdbac35abb)
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Wright Feng [Thu, 26 Apr 2018 06:35:53 +0000 (01:35 -0500)]
MLK-19517-03 revert: brcmfmac: add a module parameter to set scheduling priority of sdio_dpc
will use WQ_HIGHPRI instead.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
2925b73171942933311e87ab51747a055cfd8abf)
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Chung-Hsien Hsu [Tue, 8 May 2018 07:29:35 +0000 (15:29 +0800)]
MLK-19517-02 brcmfmac: handle compressed tx status signal
Firmware inform the driver about tx status by normal tx status signal
or compressed tx status signal. This patch adds support to handle the
compressed tx status signal.
Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
480bdeffb48904468ca5591721b148a736e03d68)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Saint Chuang [Fri, 4 May 2018 08:49:53 +0000 (03:49 -0500)]
MLK-19517-01 brcmfmac: add CYW89342 PCIE device
CYW89342 is a 2x2 MIMO,802.11a/b/g/n/ac,SDIO 3.0 and PCIe 3.0 for WLAN.
It is an automotive wireless chip.
Signed-off-by: Saint Chuang <jiac@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
53fda4df73934276239dc5b43cceecf2d9f62c52)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Andy Duan [Thu, 13 Sep 2018 09:23:37 +0000 (17:23 +0800)]
MLK-19091 cfg80211: make phy index match after wiphy dev is released
During insmod/rmmod test, the phy index increases that cause troube
for test case. To make global variable wiphy_counter match between
creat and free wiphy device, it needs to decrease the atomic counter
when wiphy device is freed.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Double Lo [Thu, 6 Sep 2018 05:49:41 +0000 (00:49 -0500)]
MLK-19516 brcmfmac: fix 4339 CRC error under SDIO 3.0 SDR104 mode
This patch fixes 4339 CRC error while running Tput test with
suspend/resume test script. Update F2 Watermark to 48 to avoid
CRC error.
The continuous failure messages before system crash:
brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84
brcmfmac: brcmf_sdio_rxglom: glom read of 25600 bytes failed: -5
brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame
brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84
brcmfmac: brcmf_sdio_rxglom: glom read of 24576 bytes failed: -5
brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame
Tested-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Double Lo [Tue, 13 Mar 2018 08:22:20 +0000 (03:22 -0500)]
MLK-18675-21 brcmfmac: Remove WOWL configuration in disconnect state
Set wowl configuration in disconnect state is redundant.
Remove it to fix no scan result issue after resume.
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Double Lo [Tue, 6 Feb 2018 11:07:05 +0000 (05:07 -0600)]
MLK-18675-20 brcmfmac: Support wake on ping packet
FMAC driver need to provide a dummy wowlan filter for kernel and
provided the well configured wowlan stack. So the system will
keep driver in connected state in suspend mode and can be wake
up by ping packet.
Enable unicast packet filter before system suspend and
disable it after resume.
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Wright Feng [Fri, 2 Mar 2018 06:45:32 +0000 (00:45 -0600)]
MLK-18675-19 brcmfmac: make firmware eap_restrict a module parameter
When eap_restrict is enabled, firmware will toss non-802.1x frames from
tx/rx data path if station not yet authorized.
Internal firmware eap_restrict is disabled by default. This patch makes
it possible to enable firmware eap_restrict by specifying
eap_restrict=1 as module parameter.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Wright Feng [Fri, 2 Mar 2018 02:41:21 +0000 (20:41 -0600)]
MLK-18675-18 brcmfmac: add a module parameter to set scheduling priority of sdio_dpc
To enhance RX throughput, we add a module parameter "sdio_dpc_prio" to let
user can set scheduling priority for sdio_dpc. It can improve RX
throughput by reducing the receiving time in sdio_dpc.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Double Lo [Mon, 5 Feb 2018 10:33:49 +0000 (04:33 -0600)]
MLK-18675-17 brcmfmac: fix system warning message during wowl suspend
There is a system warning message, warn_slowpath-fmt, during suspend
while using supplicant join AP and enable wowl feature by IW command.
It's cuased by brcmf_pno_remove_request path can't find the reqid.
This fix will not go to remove pno request function if there is no
pno scan.
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Naveen [Tue, 6 Feb 2018 06:22:58 +0000 (11:52 +0530)]
MLK-18675-16 brcmfmac: do not print ulp_sdioctrl get error
Don't print ulp_sdioctrl get error as errors are expected for non ulp
cases.
Signed-off-by: Naveen Gupta <nagu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Wright Feng [Wed, 31 Jan 2018 10:07:12 +0000 (04:07 -0600)]
MLK-18675-15 brcmfmac: support AP isolation
Hostap daemon has a parameter "ap_isolate which is used to prevent
low-level bridging of frames between associated stations in the BSS.
For driver side, we add cfg80211 ops method change_bss to support
setting AP isolation from user space.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>