mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
rockchip: kernel 6.12: add rk3576 soc support
This commit is contained in:
parent
37330800b4
commit
f0424787f1
@ -0,0 +1,31 @@
|
||||
From af20b3384e8723077cc6484160b0cf4e9be321de Mon Sep 17 00:00:00 2001
|
||||
From: Tianling Shen <cnsztl@gmail.com>
|
||||
Date: Mon, 7 Jun 2021 15:45:37 +0800
|
||||
Subject: [PATCH] arm64: dts: rockchip: add EEPROM node for NanoPi R4S
|
||||
|
||||
NanoPi R4S has a EEPROM attached to the 2nd I2C bus (U92), which
|
||||
stores the MAC address.
|
||||
|
||||
Signed-off-by: Tianling Shen <cnsztl@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
|
||||
@@ -68,6 +68,15 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+&i2c2 {
|
||||
+ eeprom@51 {
|
||||
+ compatible = "microchip,24c02", "atmel,24c02";
|
||||
+ reg = <0x51>;
|
||||
+ pagesize = <16>;
|
||||
+ read-only; /* This holds our MAC */
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&i2c4 {
|
||||
status = "disabled";
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,119 @@
|
||||
From 86e2ed4e9a9680013ec9ab7c0428c9b8c5108efe Mon Sep 17 00:00:00 2001
|
||||
From: Frank Wang <frank.wang@rock-chips.com>
|
||||
Date: Wed, 16 Oct 2024 15:37:10 +0800
|
||||
Subject: [PATCH] phy: rockchip: inno-usb2: convert clock management to bulk
|
||||
|
||||
Since some Rockchip SoCs (e.g RK3576) have more than one clock,
|
||||
this converts the clock management from single to bulk method to
|
||||
make the driver more flexible.
|
||||
|
||||
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
|
||||
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
|
||||
Link: https://lore.kernel.org/r/20241016073713.14133-1-frawang.cn@gmail.com
|
||||
Signed-off-by: Vinod Koul <vkoul@kernel.org>
|
||||
---
|
||||
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 45 +++++++++++++++----
|
||||
1 file changed, 37 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
|
||||
@@ -229,9 +229,10 @@ struct rockchip_usb2phy_port {
|
||||
* @dev: pointer to device.
|
||||
* @grf: General Register Files regmap.
|
||||
* @usbgrf: USB General Register Files regmap.
|
||||
- * @clk: clock struct of phy input clk.
|
||||
+ * @clks: array of phy input clocks.
|
||||
* @clk480m: clock struct of phy output clk.
|
||||
* @clk480m_hw: clock struct of phy output clk management.
|
||||
+ * @num_clks: number of phy input clocks.
|
||||
* @phy_reset: phy reset control.
|
||||
* @chg_state: states involved in USB charger detection.
|
||||
* @chg_type: USB charger types.
|
||||
@@ -246,9 +247,10 @@ struct rockchip_usb2phy {
|
||||
struct device *dev;
|
||||
struct regmap *grf;
|
||||
struct regmap *usbgrf;
|
||||
- struct clk *clk;
|
||||
+ struct clk_bulk_data *clks;
|
||||
struct clk *clk480m;
|
||||
struct clk_hw clk480m_hw;
|
||||
+ int num_clks;
|
||||
struct reset_control *phy_reset;
|
||||
enum usb_chg_state chg_state;
|
||||
enum power_supply_type chg_type;
|
||||
@@ -310,6 +312,13 @@ static int rockchip_usb2phy_reset(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void rockchip_usb2phy_clk_bulk_disable(void *data)
|
||||
+{
|
||||
+ struct rockchip_usb2phy *rphy = data;
|
||||
+
|
||||
+ clk_bulk_disable_unprepare(rphy->num_clks, rphy->clks);
|
||||
+}
|
||||
+
|
||||
static int rockchip_usb2phy_clk480m_prepare(struct clk_hw *hw)
|
||||
{
|
||||
struct rockchip_usb2phy *rphy =
|
||||
@@ -376,7 +385,9 @@ rockchip_usb2phy_clk480m_register(struct
|
||||
{
|
||||
struct device_node *node = rphy->dev->of_node;
|
||||
struct clk_init_data init;
|
||||
+ struct clk *refclk = NULL;
|
||||
const char *clk_name;
|
||||
+ int i;
|
||||
int ret = 0;
|
||||
|
||||
init.flags = 0;
|
||||
@@ -386,8 +397,15 @@ rockchip_usb2phy_clk480m_register(struct
|
||||
/* optional override of the clockname */
|
||||
of_property_read_string(node, "clock-output-names", &init.name);
|
||||
|
||||
- if (rphy->clk) {
|
||||
- clk_name = __clk_get_name(rphy->clk);
|
||||
+ for (i = 0; i < rphy->num_clks; i++) {
|
||||
+ if (!strncmp(rphy->clks[i].id, "phyclk", 6)) {
|
||||
+ refclk = rphy->clks[i].clk;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!IS_ERR(refclk)) {
|
||||
+ clk_name = __clk_get_name(refclk);
|
||||
init.parent_names = &clk_name;
|
||||
init.num_parents = 1;
|
||||
} else {
|
||||
@@ -1406,11 +1424,13 @@ static int rockchip_usb2phy_probe(struct
|
||||
if (IS_ERR(rphy->phy_reset))
|
||||
return PTR_ERR(rphy->phy_reset);
|
||||
|
||||
- rphy->clk = devm_clk_get_optional_enabled(dev, "phyclk");
|
||||
- if (IS_ERR(rphy->clk)) {
|
||||
- return dev_err_probe(&pdev->dev, PTR_ERR(rphy->clk),
|
||||
- "failed to get phyclk\n");
|
||||
- }
|
||||
+ ret = devm_clk_bulk_get_all(dev, &rphy->clks);
|
||||
+ if (ret == -EPROBE_DEFER)
|
||||
+ return dev_err_probe(&pdev->dev, -EPROBE_DEFER,
|
||||
+ "failed to get phy clock\n");
|
||||
+
|
||||
+ /* Clocks are optional */
|
||||
+ rphy->num_clks = ret < 0 ? 0 : ret;
|
||||
|
||||
ret = rockchip_usb2phy_clk480m_register(rphy);
|
||||
if (ret) {
|
||||
@@ -1418,6 +1438,14 @@ static int rockchip_usb2phy_probe(struct
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ ret = clk_bulk_prepare_enable(rphy->num_clks, rphy->clks);
|
||||
+ if (ret)
|
||||
+ return dev_err_probe(dev, ret, "failed to enable phy clock\n");
|
||||
+
|
||||
+ ret = devm_add_action_or_reset(dev, rockchip_usb2phy_clk_bulk_disable, rphy);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
if (rphy->phy_cfg->phy_tuning) {
|
||||
ret = rphy->phy_cfg->phy_tuning(rphy);
|
||||
if (ret)
|
@ -0,0 +1,143 @@
|
||||
From 3d7de6e870ece5a32153382df9df6fb87613335e Mon Sep 17 00:00:00 2001
|
||||
From: William Wu <william.wu@rock-chips.com>
|
||||
Date: Wed, 16 Oct 2024 15:37:13 +0800
|
||||
Subject: [PATCH] phy: rockchip: inno-usb2: Add usb2 phys support for rk3576
|
||||
|
||||
The RK3576 SoC has two independent USB2.0 PHYs, and each PHY has
|
||||
one port. This adds device specific data for it.
|
||||
|
||||
Signed-off-by: William Wu <william.wu@rock-chips.com>
|
||||
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
|
||||
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
|
||||
Link: https://lore.kernel.org/r/20241016073713.14133-4-frawang.cn@gmail.com
|
||||
Signed-off-by: Vinod Koul <vkoul@kernel.org>
|
||||
---
|
||||
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 103 ++++++++++++++++++
|
||||
1 file changed, 103 insertions(+)
|
||||
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
|
||||
@@ -1523,6 +1523,30 @@ static int rk3128_usb2phy_tuning(struct
|
||||
BIT(2) << BIT_WRITEABLE_SHIFT | 0);
|
||||
}
|
||||
|
||||
+static int rk3576_usb2phy_tuning(struct rockchip_usb2phy *rphy)
|
||||
+{
|
||||
+ int ret;
|
||||
+ u32 reg = rphy->phy_cfg->reg;
|
||||
+
|
||||
+ /* Deassert SIDDQ to power on analog block */
|
||||
+ ret = regmap_write(rphy->grf, reg + 0x0010, GENMASK(29, 29) | 0x0000);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* Do reset after exit IDDQ mode */
|
||||
+ ret = rockchip_usb2phy_reset(rphy);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* HS DC Voltage Level Adjustment 4'b1001 : +5.89% */
|
||||
+ ret |= regmap_write(rphy->grf, reg + 0x000c, GENMASK(27, 24) | 0x0900);
|
||||
+
|
||||
+ /* HS Transmitter Pre-Emphasis Current Control 2'b10 : 2x */
|
||||
+ ret |= regmap_write(rphy->grf, reg + 0x0010, GENMASK(20, 19) | 0x0010);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static int rk3588_usb2phy_tuning(struct rockchip_usb2phy *rphy)
|
||||
{
|
||||
int ret;
|
||||
@@ -1951,6 +1975,84 @@ static const struct rockchip_usb2phy_cfg
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
+static const struct rockchip_usb2phy_cfg rk3576_phy_cfgs[] = {
|
||||
+ {
|
||||
+ .reg = 0x0,
|
||||
+ .num_ports = 1,
|
||||
+ .phy_tuning = rk3576_usb2phy_tuning,
|
||||
+ .clkout_ctl = { 0x0008, 0, 0, 1, 0 },
|
||||
+ .port_cfgs = {
|
||||
+ [USB2PHY_PORT_OTG] = {
|
||||
+ .phy_sus = { 0x0000, 8, 0, 0, 0x1d1 },
|
||||
+ .bvalid_det_en = { 0x00c0, 1, 1, 0, 1 },
|
||||
+ .bvalid_det_st = { 0x00c4, 1, 1, 0, 1 },
|
||||
+ .bvalid_det_clr = { 0x00c8, 1, 1, 0, 1 },
|
||||
+ .ls_det_en = { 0x00c0, 0, 0, 0, 1 },
|
||||
+ .ls_det_st = { 0x00c4, 0, 0, 0, 1 },
|
||||
+ .ls_det_clr = { 0x00c8, 0, 0, 0, 1 },
|
||||
+ .disfall_en = { 0x00c0, 6, 6, 0, 1 },
|
||||
+ .disfall_st = { 0x00c4, 6, 6, 0, 1 },
|
||||
+ .disfall_clr = { 0x00c8, 6, 6, 0, 1 },
|
||||
+ .disrise_en = { 0x00c0, 5, 5, 0, 1 },
|
||||
+ .disrise_st = { 0x00c4, 5, 5, 0, 1 },
|
||||
+ .disrise_clr = { 0x00c8, 5, 5, 0, 1 },
|
||||
+ .utmi_avalid = { 0x0080, 1, 1, 0, 1 },
|
||||
+ .utmi_bvalid = { 0x0080, 0, 0, 0, 1 },
|
||||
+ .utmi_ls = { 0x0080, 5, 4, 0, 1 },
|
||||
+ }
|
||||
+ },
|
||||
+ .chg_det = {
|
||||
+ .cp_det = { 0x0080, 8, 8, 0, 1 },
|
||||
+ .dcp_det = { 0x0080, 8, 8, 0, 1 },
|
||||
+ .dp_det = { 0x0080, 9, 9, 1, 0 },
|
||||
+ .idm_sink_en = { 0x0010, 5, 5, 1, 0 },
|
||||
+ .idp_sink_en = { 0x0010, 5, 5, 0, 1 },
|
||||
+ .idp_src_en = { 0x0010, 14, 14, 0, 1 },
|
||||
+ .rdm_pdwn_en = { 0x0010, 14, 14, 0, 1 },
|
||||
+ .vdm_src_en = { 0x0010, 7, 6, 0, 3 },
|
||||
+ .vdp_src_en = { 0x0010, 7, 6, 0, 3 },
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ .reg = 0x2000,
|
||||
+ .num_ports = 1,
|
||||
+ .phy_tuning = rk3576_usb2phy_tuning,
|
||||
+ .clkout_ctl = { 0x2008, 0, 0, 1, 0 },
|
||||
+ .port_cfgs = {
|
||||
+ [USB2PHY_PORT_OTG] = {
|
||||
+ .phy_sus = { 0x2000, 8, 0, 0, 0x1d1 },
|
||||
+ .bvalid_det_en = { 0x20c0, 1, 1, 0, 1 },
|
||||
+ .bvalid_det_st = { 0x20c4, 1, 1, 0, 1 },
|
||||
+ .bvalid_det_clr = { 0x20c8, 1, 1, 0, 1 },
|
||||
+ .ls_det_en = { 0x20c0, 0, 0, 0, 1 },
|
||||
+ .ls_det_st = { 0x20c4, 0, 0, 0, 1 },
|
||||
+ .ls_det_clr = { 0x20c8, 0, 0, 0, 1 },
|
||||
+ .disfall_en = { 0x20c0, 6, 6, 0, 1 },
|
||||
+ .disfall_st = { 0x20c4, 6, 6, 0, 1 },
|
||||
+ .disfall_clr = { 0x20c8, 6, 6, 0, 1 },
|
||||
+ .disrise_en = { 0x20c0, 5, 5, 0, 1 },
|
||||
+ .disrise_st = { 0x20c4, 5, 5, 0, 1 },
|
||||
+ .disrise_clr = { 0x20c8, 5, 5, 0, 1 },
|
||||
+ .utmi_avalid = { 0x2080, 1, 1, 0, 1 },
|
||||
+ .utmi_bvalid = { 0x2080, 0, 0, 0, 1 },
|
||||
+ .utmi_ls = { 0x2080, 5, 4, 0, 1 },
|
||||
+ }
|
||||
+ },
|
||||
+ .chg_det = {
|
||||
+ .cp_det = { 0x2080, 8, 8, 0, 1 },
|
||||
+ .dcp_det = { 0x2080, 8, 8, 0, 1 },
|
||||
+ .dp_det = { 0x2080, 9, 9, 1, 0 },
|
||||
+ .idm_sink_en = { 0x2010, 5, 5, 1, 0 },
|
||||
+ .idp_sink_en = { 0x2010, 5, 5, 0, 1 },
|
||||
+ .idp_src_en = { 0x2010, 14, 14, 0, 1 },
|
||||
+ .rdm_pdwn_en = { 0x2010, 14, 14, 0, 1 },
|
||||
+ .vdm_src_en = { 0x2010, 7, 6, 0, 3 },
|
||||
+ .vdp_src_en = { 0x2010, 7, 6, 0, 3 },
|
||||
+ },
|
||||
+ },
|
||||
+ { /* sentinel */ }
|
||||
+};
|
||||
+
|
||||
static const struct rockchip_usb2phy_cfg rk3588_phy_cfgs[] = {
|
||||
{
|
||||
.reg = 0x0000,
|
||||
@@ -2122,6 +2224,7 @@ static const struct of_device_id rockchi
|
||||
{ .compatible = "rockchip,rk3366-usb2phy", .data = &rk3366_phy_cfgs },
|
||||
{ .compatible = "rockchip,rk3399-usb2phy", .data = &rk3399_phy_cfgs },
|
||||
{ .compatible = "rockchip,rk3568-usb2phy", .data = &rk3568_phy_cfgs },
|
||||
+ { .compatible = "rockchip,rk3576-usb2phy", .data = &rk3576_phy_cfgs },
|
||||
{ .compatible = "rockchip,rk3588-usb2phy", .data = &rk3588_phy_cfgs },
|
||||
{ .compatible = "rockchip,rv1108-usb2phy", .data = &rv1108_phy_cfgs },
|
||||
{}
|
@ -0,0 +1,73 @@
|
||||
From a76de028c619dd18f89786805bcc7bb4d379ea9f Mon Sep 17 00:00:00 2001
|
||||
From: Frank Wang <frank.wang@rock-chips.com>
|
||||
Date: Mon, 14 Oct 2024 10:03:42 +0800
|
||||
Subject: [PATCH] phy: rockchip: usbdp: add rk3576 device match data
|
||||
|
||||
This adds RK3576 device match data support.
|
||||
|
||||
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
|
||||
Acked-by: Dragan Simic <dsimic@manjaro.org>
|
||||
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
|
||||
Link: https://lore.kernel.org/r/20241014020342.15974-2-frawang.cn@gmail.com
|
||||
Signed-off-by: Vinod Koul <vkoul@kernel.org>
|
||||
---
|
||||
drivers/phy/rockchip/phy-rockchip-usbdp.c | 41 +++++++++++++++++++++++
|
||||
1 file changed, 41 insertions(+)
|
||||
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
|
||||
@@ -1538,6 +1538,43 @@ static const char * const rk_udphy_rst_l
|
||||
"init", "cmn", "lane", "pcs_apb", "pma_apb"
|
||||
};
|
||||
|
||||
+static const struct rk_udphy_cfg rk3576_udphy_cfgs = {
|
||||
+ .num_phys = 1,
|
||||
+ .phy_ids = { 0x2b010000 },
|
||||
+ .num_rsts = ARRAY_SIZE(rk_udphy_rst_list),
|
||||
+ .rst_list = rk_udphy_rst_list,
|
||||
+ .grfcfg = {
|
||||
+ /* u2phy-grf */
|
||||
+ .bvalid_phy_con = RK_UDPHY_GEN_GRF_REG(0x0010, 1, 0, 0x2, 0x3),
|
||||
+ .bvalid_grf_con = RK_UDPHY_GEN_GRF_REG(0x0000, 15, 14, 0x1, 0x3),
|
||||
+
|
||||
+ /* usb-grf */
|
||||
+ .usb3otg0_cfg = RK_UDPHY_GEN_GRF_REG(0x0030, 15, 0, 0x1100, 0x0188),
|
||||
+
|
||||
+ /* usbdpphy-grf */
|
||||
+ .low_pwrn = RK_UDPHY_GEN_GRF_REG(0x0004, 13, 13, 0, 1),
|
||||
+ .rx_lfps = RK_UDPHY_GEN_GRF_REG(0x0004, 14, 14, 0, 1),
|
||||
+ },
|
||||
+ .vogrfcfg = {
|
||||
+ {
|
||||
+ .hpd_trigger = RK_UDPHY_GEN_GRF_REG(0x0000, 11, 10, 1, 3),
|
||||
+ .dp_lane_reg = 0x0000,
|
||||
+ },
|
||||
+ },
|
||||
+ .dp_tx_ctrl_cfg = {
|
||||
+ rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
|
||||
+ rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
|
||||
+ rk3588_dp_tx_drv_ctrl_hbr2,
|
||||
+ rk3588_dp_tx_drv_ctrl_hbr3,
|
||||
+ },
|
||||
+ .dp_tx_ctrl_cfg_typec = {
|
||||
+ rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
|
||||
+ rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
|
||||
+ rk3588_dp_tx_drv_ctrl_hbr2,
|
||||
+ rk3588_dp_tx_drv_ctrl_hbr3,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
static const struct rk_udphy_cfg rk3588_udphy_cfgs = {
|
||||
.num_phys = 2,
|
||||
.phy_ids = {
|
||||
@@ -1585,6 +1622,10 @@ static const struct rk_udphy_cfg rk3588_
|
||||
|
||||
static const struct of_device_id rk_udphy_dt_match[] = {
|
||||
{
|
||||
+ .compatible = "rockchip,rk3576-usbdp-phy",
|
||||
+ .data = &rk3576_udphy_cfgs
|
||||
+ },
|
||||
+ {
|
||||
.compatible = "rockchip,rk3588-usbdp-phy",
|
||||
.data = &rk3588_udphy_cfgs
|
||||
},
|
@ -0,0 +1,37 @@
|
||||
From 591ae6bed250e4067db926313ff7279d23a1c7d1 Mon Sep 17 00:00:00 2001
|
||||
From: Ye Zhang <ye.zhang@rock-chips.com>
|
||||
Date: Tue, 12 Nov 2024 09:54:05 +0800
|
||||
Subject: [PATCH] gpio: rockchip: explan the format of the GPIO version ID
|
||||
|
||||
Remove redundant comments and provide a detailed explanation of the
|
||||
GPIO version ID.
|
||||
|
||||
Signed-off-by: Ye Zhang <ye.zhang@rock-chips.com>
|
||||
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Link: https://lore.kernel.org/r/20241112015408.3139996-2-ye.zhang@rock-chips.com
|
||||
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
|
||||
---
|
||||
drivers/gpio/gpio-rockchip.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/gpio/gpio-rockchip.c
|
||||
+++ b/drivers/gpio/gpio-rockchip.c
|
||||
@@ -26,9 +26,15 @@
|
||||
#include "../pinctrl/core.h"
|
||||
#include "../pinctrl/pinctrl-rockchip.h"
|
||||
|
||||
+/*
|
||||
+ * Version ID Register
|
||||
+ * Bits [31:24] - Major Version
|
||||
+ * Bits [23:16] - Minor Version
|
||||
+ * Bits [15:0] - Revision Number
|
||||
+ */
|
||||
#define GPIO_TYPE_V1 (0) /* GPIO Version ID reserved */
|
||||
-#define GPIO_TYPE_V2 (0x01000C2B) /* GPIO Version ID 0x01000C2B */
|
||||
-#define GPIO_TYPE_V2_1 (0x0101157C) /* GPIO Version ID 0x0101157C */
|
||||
+#define GPIO_TYPE_V2 (0x01000C2B)
|
||||
+#define GPIO_TYPE_V2_1 (0x0101157C)
|
||||
|
||||
static const struct rockchip_gpio_regs gpio_regs_v1 = {
|
||||
.port_dr = 0x00,
|
@ -0,0 +1,46 @@
|
||||
From 41209307cad7f14c387c68375a93b50e54261a53 Mon Sep 17 00:00:00 2001
|
||||
From: Ye Zhang <ye.zhang@rock-chips.com>
|
||||
Date: Tue, 12 Nov 2024 09:54:06 +0800
|
||||
Subject: [PATCH] gpio: rockchip: change the GPIO version judgment logic
|
||||
|
||||
Have a list of valid IDs and default to -ENODEV.
|
||||
|
||||
Signed-off-by: Ye Zhang <ye.zhang@rock-chips.com>
|
||||
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Link: https://lore.kernel.org/r/20241112015408.3139996-3-ye.zhang@rock-chips.com
|
||||
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
|
||||
---
|
||||
drivers/gpio/gpio-rockchip.c | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/gpio/gpio-rockchip.c
|
||||
+++ b/drivers/gpio/gpio-rockchip.c
|
||||
@@ -667,8 +667,9 @@ static int rockchip_get_bank_data(struct
|
||||
clk_prepare_enable(bank->clk);
|
||||
id = readl(bank->reg_base + gpio_regs_v2.version_id);
|
||||
|
||||
- /* If not gpio v2, that is default to v1. */
|
||||
- if (id == GPIO_TYPE_V2 || id == GPIO_TYPE_V2_1) {
|
||||
+ switch (id) {
|
||||
+ case GPIO_TYPE_V2:
|
||||
+ case GPIO_TYPE_V2_1:
|
||||
bank->gpio_regs = &gpio_regs_v2;
|
||||
bank->gpio_type = GPIO_TYPE_V2;
|
||||
bank->db_clk = of_clk_get(bank->of_node, 1);
|
||||
@@ -677,9 +678,14 @@ static int rockchip_get_bank_data(struct
|
||||
clk_disable_unprepare(bank->clk);
|
||||
return -EINVAL;
|
||||
}
|
||||
- } else {
|
||||
+ break;
|
||||
+ case GPIO_TYPE_V1:
|
||||
bank->gpio_regs = &gpio_regs_v1;
|
||||
bank->gpio_type = GPIO_TYPE_V1;
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_err(bank->dev, "unsupported version ID: 0x%08x\n", id);
|
||||
+ return -ENODEV;
|
||||
}
|
||||
|
||||
return 0;
|
@ -0,0 +1,34 @@
|
||||
From 8bcbd0379c05c66ce2e842c7e8901aa317cdf04e Mon Sep 17 00:00:00 2001
|
||||
From: Ye Zhang <ye.zhang@rock-chips.com>
|
||||
Date: Tue, 12 Nov 2024 09:54:07 +0800
|
||||
Subject: [PATCH] gpio: rockchip: support new version GPIO
|
||||
|
||||
Support the next version GPIO controller on SoCs like rk3576.
|
||||
|
||||
Signed-off-by: Ye Zhang <ye.zhang@rock-chips.com>
|
||||
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Link: https://lore.kernel.org/r/20241112015408.3139996-4-ye.zhang@rock-chips.com
|
||||
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
|
||||
---
|
||||
drivers/gpio/gpio-rockchip.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/gpio/gpio-rockchip.c
|
||||
+++ b/drivers/gpio/gpio-rockchip.c
|
||||
@@ -35,6 +35,7 @@
|
||||
#define GPIO_TYPE_V1 (0) /* GPIO Version ID reserved */
|
||||
#define GPIO_TYPE_V2 (0x01000C2B)
|
||||
#define GPIO_TYPE_V2_1 (0x0101157C)
|
||||
+#define GPIO_TYPE_V2_2 (0x010219C8)
|
||||
|
||||
static const struct rockchip_gpio_regs gpio_regs_v1 = {
|
||||
.port_dr = 0x00,
|
||||
@@ -670,6 +671,7 @@ static int rockchip_get_bank_data(struct
|
||||
switch (id) {
|
||||
case GPIO_TYPE_V2:
|
||||
case GPIO_TYPE_V2_1:
|
||||
+ case GPIO_TYPE_V2_2:
|
||||
bank->gpio_regs = &gpio_regs_v2;
|
||||
bank->gpio_type = GPIO_TYPE_V2;
|
||||
bank->db_clk = of_clk_get(bank->of_node, 1);
|
@ -0,0 +1,40 @@
|
||||
From d2166e3b3680bd2b206aebf1e1ce4c0d346f3c50 Mon Sep 17 00:00:00 2001
|
||||
From: Tianling Shen <cnsztl@gmail.com>
|
||||
Date: Fri, 19 May 2023 12:10:52 +0800
|
||||
Subject: [PATCH] arm64: dts: rockchip: Update LED properties for Orange Pi R1
|
||||
Plus
|
||||
|
||||
Add OpenWrt's LED aliases for showing system status.
|
||||
|
||||
Signed-off-by: Tianling Shen <cnsztl@gmail.com>
|
||||
---
|
||||
.../dts/rockchip/rk3328-orangepi-r1-plus.dts | 17 +++++++++--------
|
||||
1 file changed, 9 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts
|
||||
@@ -18,6 +18,11 @@
|
||||
ethernet0 = &gmac2io;
|
||||
ethernet1 = &rtl8153;
|
||||
mmc0 = &sdmmc;
|
||||
+
|
||||
+ led-boot = &status_led;
|
||||
+ led-failsafe = &status_led;
|
||||
+ led-running = &status_led;
|
||||
+ led-upgrade = &status_led;
|
||||
};
|
||||
|
||||
chosen {
|
||||
@@ -42,11 +47,10 @@
|
||||
gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
- led-1 {
|
||||
+ status_led: led-1 {
|
||||
function = LED_FUNCTION_STATUS;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
|
||||
- linux,default-trigger = "heartbeat";
|
||||
};
|
||||
|
||||
led-2 {
|
@ -0,0 +1,24 @@
|
||||
From b46a530d12ada422b9d5b2b97059e0d3ed950b40 Mon Sep 17 00:00:00 2001
|
||||
From: Tianling Shen <cnsztl@gmail.com>
|
||||
Date: Fri, 19 May 2023 12:38:04 +0800
|
||||
Subject: [PATCH] arm64: dts: rockchip: add LED configuration to Orange Pi R1
|
||||
Plus
|
||||
|
||||
Add the correct value for the RTL8153 LED configuration register to
|
||||
match the blink behavior of the other port on the device.
|
||||
|
||||
Signed-off-by: Tianling Shen <cnsztl@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts
|
||||
@@ -366,6 +366,7 @@
|
||||
rtl8153: device@2 {
|
||||
compatible = "usbbda,8153";
|
||||
reg = <2>;
|
||||
+ realtek,led-data = <0x87>;
|
||||
};
|
||||
};
|
||||
|
@ -0,0 +1,43 @@
|
||||
From 04202df5cb497b1934c95211cf43784ef62245a4 Mon Sep 17 00:00:00 2001
|
||||
From: Tianling Shen <cnsztl@immortalwrt.org>
|
||||
Date: Mon, 18 Oct 2021 12:47:30 +0800
|
||||
Subject: [PATCH] rockchip: rk3399: overclock to 2.2/1.8 GHz
|
||||
|
||||
It's stable enough to overclock cpu frequency to 2.2/1.8 GHz,
|
||||
and for better performance.
|
||||
|
||||
Co-development-by: gzelvis <gzelvis@gmail.com>
|
||||
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi
|
||||
@@ -0,0 +1,26 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+/*
|
||||
+ * Copyright (c) 2016-2017 Fuzhou Rockchip Electronics Co., Ltd
|
||||
+ */
|
||||
+
|
||||
+#include "rk3399-op1.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ cluster0_opp: opp-table-0 {
|
||||
+ opp07 {
|
||||
+ opp-hz = /bits/ 64 <1608000000>;
|
||||
+ opp-microvolt = <1225000 1225000 1225000>;
|
||||
+ };
|
||||
+ opp08 {
|
||||
+ opp-hz = /bits/ 64 <1800000000>;
|
||||
+ opp-microvolt = <1275000 1275000 1275000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ cluster1_opp: opp-table-1 {
|
||||
+ opp09 {
|
||||
+ opp-hz = /bits/ 64 <2208000000>;
|
||||
+ opp-microvolt = <1325000 1325000 1325000>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
Loading…
Reference in New Issue
Block a user