Compare commits

...

10 Commits

Author SHA1 Message Date
Heinrich Toews
959f2cab00 defconfig: rockchip: add SHT3x
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2025-07-03 11:12:58 +00:00
Feng Zhang
50e5e9c47b drm/bridge: dw-mipi-dsi: Enable hsclk when sending lp cmds
Cherry-pick from linux-5.10-gen-rkr4.1

Source: https://redmine.rock-chips.com/issues/420744

Signed-off-by: Feng Zhang <feng@radxa.com>
Signed-off-by: Jiali Chen <chenjiali@radxa.com>
2025-06-25 18:33:52 +08:00
Feng Zhang
339d6b3968 phy/rockchip: fix usb wake-up for rk356x u2phy0_host
Signed-off-by: Feng Zhang <feng@radxa.com>
2025-06-24 07:05:32 +00:00
Stephen Chen
c95b42d917 phy: rockchip: inno-usb2: fix system cannot suspend due to bvalid interrupt
Here disable bvalid interrupt before usb2 phy enters suspend mode
to avoid waking up the system. Re-enable bvalid interrupt when
usb2 phy resumes, used to detect usb device connection.

Signed-off-by: Stephen Chen <stephen@radxa.com>
2025-06-24 07:03:37 +00:00
nascs
eceb10ecdd arm64: dts: rockchip: rk3568-linux: add the fiq_debugger label
Signed-off-by: Nascs Fang <nascs@radxa.com>
2025-06-14 22:57:21 +08:00
Jiali Chen
a188c3e141 arm64: dts: rockchip: radxa-rock3: add rockchip,dis-u2-susphy; to u2phy0_otg
When the USB gadget is enabled, if the USB host is not online
at that time, subsequent hot-plugging will not be possible.

Signed-off-by: Jiali Chen <chenjiali@radxa.com>
2025-06-14 22:55:05 +08:00
Mitchell Ma
b2ba475b99 arm64: rockchip_linux_defconfig: enable IMX214
Signed-off-by: Mitchell Ma <machuang@radxa.com>
2025-05-29 19:36:57 +08:00
SongJun Li
214cd83941 arm64: dts: radxa-rk3576: add usb2 wakeup support
Signed-off-by: SongJun Li <lisongjun@radxa.com>
2025-05-23 19:06:02 +08:00
William Wu
61641e401c rk3576: usb2: Support wakeup system by linestate irq
Change-Id: Ied6d70fe86be83645850a63732ea25836925fe98
Signed-off-by: William Wu <william.wu@rock-chips.com>
2025-05-23 19:06:02 +08:00
Ken Wang
4fc13601af arm64: dts: radxa-rk3576: add vop plane configuration
Fix cursor blinking issue.

Signed-off-by: Ken Wang <ken@radxa.com>
2025-05-23 19:04:10 +08:00
13 changed files with 1152 additions and 13 deletions

@ -492,6 +492,7 @@ &u2phy0_host {
};
&u2phy0_otg {
rockchip,dis-u2-susphy;
status = "okay";
};
@ -543,10 +544,6 @@ &usbhost30 {
status = "okay";
};
&u2phy0_otg {
status = "okay";
};
&usbdrd_dwc3 {
status = "okay";
};

@ -685,6 +685,7 @@ &u2phy0_host {
};
&u2phy0_otg {
rockchip,dis-u2-susphy;
vbus-supply = <&vcc5v0_otg>;
status = "okay";
};

@ -16,7 +16,7 @@ chosen: chosen {
bootargs = "earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 root=PARTUUID=614e0000-0000 rw rootwait";
};
fiq-debugger {
fiq_debugger: fiq-debugger {
compatible = "rockchip,fiq-debugger";
rockchip,serial-id = <2>;
rockchip,wake-irq = <0>;

@ -119,6 +119,7 @@ &u2phy0_host {
};
&u2phy0_otg {
rockchip,dis-u2-susphy;
vbus-supply = <&vcc5v0_usb>;
status = "okay";
};

@ -154,6 +154,7 @@ &u2phy0_host {
};
&u2phy0_otg {
rockchip,dis-u2-susphy;
vbus-supply = <&vcc5v0_usb>;
status = "okay";
};

@ -204,6 +204,18 @@ &rockchip_suspend {
rockchip,regulator-on-before-mem = <&vdd_npu_s0>;
};
&vdd_logic_s0 {
regulator-state-mem {
regulator-on-in-suspend;
};
};
&vcca_1v8_s0 {
regulator-state-mem {
regulator-on-in-suspend;
};
};
&saradc {
status = "okay";
vref-supply = <&vcca_1v8_s0>;
@ -267,6 +279,24 @@ &route_hdmi {
connect = <&vp0_out_hdmi>;
};
&vp0 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER0 | 1 << ROCKCHIP_VOP2_ESMART0)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER0>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART0>;
};
&vp1 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER1 | 1 << ROCKCHIP_VOP2_ESMART1)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER1>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART1>;
};
&vp2 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER2 | 1 << ROCKCHIP_VOP2_ESMART2)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER2>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART2>;
};
&gmac0 {
/* Use rgmii-rxid mode to disable rx delay inside Soc */
phy-mode = "rgmii-rxid";

@ -187,6 +187,18 @@ &rockchip_suspend {
rockchip,regulator-on-before-mem = <&vdd_npu_s0>;
};
&vdd_logic_s0 {
regulator-state-mem {
regulator-on-in-suspend;
};
};
&vcca_1v8_s0 {
regulator-state-mem {
regulator-on-in-suspend;
};
};
&saradc {
status = "okay";
vref-supply = <&vcca_1v8_s0>;
@ -249,6 +261,24 @@ &route_hdmi {
connect = <&vp0_out_hdmi>;
};
&vp0 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER0 | 1 << ROCKCHIP_VOP2_ESMART0)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER0>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART0>;
};
&vp1 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER1 | 1 << ROCKCHIP_VOP2_ESMART1)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER1>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART1>;
};
&vp2 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER2 | 1 << ROCKCHIP_VOP2_ESMART2)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER2>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART2>;
};
&gmac0 {
/* Use rgmii-rxid mode to disable rx delay inside Soc */
phy-mode = "rgmii-rxid";

@ -306,6 +306,18 @@ &rockchip_suspend {
rockchip,regulator-on-before-mem = <&vdd_npu_s0>;
};
&vdd_logic_s0 {
regulator-state-mem {
regulator-on-in-suspend;
};
};
&vcca_1v8_s0 {
regulator-state-mem {
regulator-on-in-suspend;
};
};
&saradc {
status = "okay";
vref-supply = <&vcca_1v8_s0>;
@ -391,6 +403,24 @@ &route_hdmi {
connect = <&vp0_out_hdmi>;
};
&vp0 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER0 | 1 << ROCKCHIP_VOP2_ESMART0)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER0>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART0>;
};
&vp1 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER1 | 1 << ROCKCHIP_VOP2_ESMART1)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER1>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART1>;
};
&vp2 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER2 | 1 << ROCKCHIP_VOP2_ESMART2)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER2>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART2>;
};
&gmac0 {
/* Use rgmii-rxid mode to disable rx delay inside Soc */
phy-mode = "rgmii-rxid";

@ -1404,14 +1404,13 @@ rockchip_suspend: rockchip-suspend {
(0
| RKPM_SLP_ARMOFF_LOGOFF
| RKPM_SLP_PMU_PMUALIVE_32K
| RKPM_SLP_PMU_DIS_OSC
| RKPM_SLP_PMIC_LP
| RKPM_SLP_32K_EXT
)
>;
rockchip,wakeup-config = <
(0
| RKPM_GPIO_WKUP_EN
| RKPM_USB_WKUP_EN
)
>;
rockchip,sleep-io-ret-config = <

File diff suppressed because it is too large Load Diff

@ -778,6 +778,7 @@ CONFIG_CHARGER_BQ25700=y
CONFIG_BATTERY_RK817=y
CONFIG_CHARGER_RK817=y
CONFIG_SENSORS_PWM_FAN=y
CONFIG_SENSORS_SHT3x=y
CONFIG_SENSORS_EMC2305=m
CONFIG_THERMAL_WRITABLE_TRIPS=y
CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR=y
@ -829,6 +830,7 @@ CONFIG_VIDEO_ROCKCHIP_VPSS=y
CONFIG_VIDEO_GC2053=y
CONFIG_VIDEO_GC2093=y
CONFIG_VIDEO_GC8034=y
CONFIG_VIDEO_IMX214=y
CONFIG_VIDEO_IMX219=y
CONFIG_VIDEO_IMX415=y
CONFIG_VIDEO_IMX464=y

@ -402,7 +402,7 @@ static void dw_mipi_message_config(struct dw_mipi_dsi *dsi,
ctrl = dsi_read(dsi, DSI_LPCLK_CTRL);
if (lpm) {
val |= ENABLE_LOW_POWER_CMD;
ctrl &= ~PHY_TXREQUESTCLKHS;
ctrl |= PHY_TXREQUESTCLKHS;
} else {
val &= ~ENABLE_LOW_POWER_CMD;
ctrl |= PHY_TXREQUESTCLKHS;

@ -166,6 +166,7 @@ struct rockchip_chg_det_reg {
*/
struct rockchip_usb2phy_port_cfg {
struct usb2phy_reg phy_sus;
struct usb2phy_reg phy_sus_host_port;
struct usb2phy_reg pipe_phystatus;
struct usb2phy_reg bvalid_det_en;
struct usb2phy_reg bvalid_det_st;
@ -215,11 +216,13 @@ struct rockchip_usb2phy_port_cfg {
* @clkout_ctl_phy: keep on/turn off output clk of phy via phy inner
* debug register.
* @ls_filter_con: set linestate filter time.
* @port_cfgs: usb-phy port configurations.
* @ls_filter_con: set linestate filter time.
* @refclk_fsel: reference clock frequency select,
* true - select 24 MHz
* false - select 26 MHz
* @detclk_sel: usb phy grf reference clock select,
* true - select OSC clock
* false - select pclk
* @port_cfgs: usb-phy port configurations.
* @chg_det: charger detection registers.
*/
struct rockchip_usb2phy_cfg {
@ -233,6 +236,7 @@ struct rockchip_usb2phy_cfg {
struct usb2phy_reg clkout_ctl_phy;
struct usb2phy_reg ls_filter_con;
struct usb2phy_reg refclk_fsel;
struct usb2phy_reg detclk_sel;
const struct rockchip_usb2phy_port_cfg port_cfgs[USB2PHY_NUM_PORTS];
const struct rockchip_chg_det_reg chg_det;
};
@ -3261,6 +3265,7 @@ static int rockchip_usb2phy_pm_suspend(struct device *dev)
unsigned int index;
int ret = 0;
bool wakeup_enable = false;
struct regmap *base = get_reg_base(rphy);
if (device_may_wakeup(rphy->dev))
wakeup_enable = true;
@ -3308,8 +3313,21 @@ static int rockchip_usb2phy_pm_suspend(struct device *dev)
rport->bvalid_irq > 0)
enable_irq_wake(rport->bvalid_irq);
/* activate the linestate to detect the next interrupt. */
if (rport->port_id == USB2PHY_PORT_OTG) {
rockchip_usb2phy_enable_vbus_irq(rphy, rport, false);
dev_err(rphy->dev, "disable usb vbus irq\n");
}
mutex_lock(&rport->mutex);
/* because if suspend host-post can prevent suspend, so may changed phy_sus in suspend. */
if (rphy->phy_cfg->reg == 0xfe8a0000 && rport->port_id == USB2PHY_PORT_HOST) {
ret = property_enable(base, &rport->port_cfg->phy_sus_host_port, true);
if (ret) {
dev_err(rphy->dev, "failed to enable suspend host port\n");
return ret;
}
}
/* activate the linestate to detect the next interrupt. */
ret = rockchip_usb2phy_enable_line_irq(rphy, rport, true);
mutex_unlock(&rport->mutex);
if (ret) {
@ -3327,6 +3345,13 @@ static int rockchip_usb2phy_pm_suspend(struct device *dev)
if (wakeup_enable && rphy->irq > 0)
enable_irq_wake(rphy->irq);
/*
* Select the usb2 phy interrupt logic clock from OSC clock
* to support interrupt detection if VD_LOGIC is powerdown.
*/
if (phy_cfg->detclk_sel.enable)
property_enable(rphy->grf, &phy_cfg->detclk_sel, true);
return ret;
}
@ -3361,6 +3386,9 @@ static int rockchip_usb2phy_pm_resume(struct device *dev)
dev_err(rphy->dev, "failed to set ls filter %d\n", ret);
}
if (phy_cfg->detclk_sel.enable)
property_enable(rphy->grf, &phy_cfg->detclk_sel, false);
for (index = 0; index < phy_cfg->num_ports; index++) {
rport = &rphy->ports[index];
if (!rport->phy)
@ -3437,6 +3465,11 @@ static int rockchip_usb2phy_pm_resume(struct device *dev)
rport->bvalid_irq > 0)
disable_irq_wake(rport->bvalid_irq);
if (rport->port_id == USB2PHY_PORT_OTG) {
rockchip_usb2phy_enable_vbus_irq(rphy, rport, true);
dev_err(rphy->dev, "enable usb vbus irq\n");
}
if (wakeup_enable && rport->ls_irq > 0)
disable_irq_wake(rport->ls_irq);
@ -4219,6 +4252,7 @@ static const struct rockchip_usb2phy_cfg rk3568_phy_cfgs[] = {
[USB2PHY_PORT_HOST] = {
/* Select suspend control from controller */
.phy_sus = { 0x0004, 8, 0, 0x1d2, 0x1d2 },
.phy_sus_host_port = { 0x0004, 8, 0, 0x1d2, 0x1d1 },
.ls_det_en = { 0x0080, 1, 1, 0, 1 },
.ls_det_st = { 0x0084, 1, 1, 0, 1 },
.ls_det_clr = { 0x0088, 1, 1, 0, 1 },
@ -4273,8 +4307,9 @@ static const struct rockchip_usb2phy_cfg rk3576_phy_cfgs[] = {
.num_ports = 1,
.phy_tuning = rk3576_usb2phy_tuning,
.clkout_ctl = { 0x0008, 0, 0, 1, 0 },
.ls_filter_con = { 0x0020, 19, 0, 0x30100, 0x00020 },
.ls_filter_con = { 0x0020, 19, 0, 0x30100, 0x06020 },
.refclk_fsel = { 0x0004, 2, 0, 0x6, 0x2 },
.detclk_sel = { 0x00d0, 0, 0, 0, 1 },
.port_cfgs = {
[USB2PHY_PORT_OTG] = {
.phy_sus = { 0x0000, 8, 0, 0, 0x1d1 },
@ -4328,8 +4363,9 @@ static const struct rockchip_usb2phy_cfg rk3576_phy_cfgs[] = {
.num_ports = 1,
.phy_tuning = rk3576_usb2phy_tuning,
.clkout_ctl = { 0x2008, 0, 0, 1, 0 },
.ls_filter_con = { 0x2020, 19, 0, 0x30100, 0x00020 },
.ls_filter_con = { 0x2020, 19, 0, 0x30100, 0x06020 },
.refclk_fsel = { 0x2004, 2, 0, 0x6, 0x2 },
.detclk_sel = { 0x20d0, 0, 0, 0, 1 },
.port_cfgs = {
[USB2PHY_PORT_OTG] = {
.phy_sus = { 0x2000, 8, 0, 0, 0x1d1 },