Skip to content

Commit

Permalink
rk322x-box: rewrite u-boot patches against v2024.07-rc5
Browse files Browse the repository at this point in the history
  • Loading branch information
rpardini authored and igorpecovnik committed Jul 8, 2024
1 parent d399fb9 commit 07084b6
Show file tree
Hide file tree
Showing 11 changed files with 235 additions and 117 deletions.
32 changes: 16 additions & 16 deletions patch/u-boot/v2024.07/board_rk322x-box/rk3228-hdmi-clk-fixes.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
From 497b401b7ec7f0fa52efa4765b8421e21b8840ff Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paolo Sabatino <[email protected]>
Date: Mon, 29 Apr 2024 16:18:46 +0200
Subject: [PATCH 4/4] clock entries to accomodate rk3228 HDMI features
Subject: clock entries to accomodate rk3228 HDMI features

---
.../include/asm/arch-rockchip/cru_rk322x.h | 14 ++
drivers/clk/rockchip/clk_rk322x.c | 133 +++++++++++++++++-
2 files changed, 144 insertions(+), 3 deletions(-)
arch/arm/include/asm/arch-rockchip/cru_rk322x.h | 14 +
drivers/clk/rockchip/clk_rk322x.c | 129 +++++++++-
2 files changed, 140 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/arch-rockchip/cru_rk322x.h b/arch/arm/include/asm/arch-rockchip/cru_rk322x.h
index cfbc7e92f7..de3c4bf310 100644
index 111111111111..222222222222 100644
--- a/arch/arm/include/asm/arch-rockchip/cru_rk322x.h
+++ b/arch/arm/include/asm/arch-rockchip/cru_rk322x.h
@@ -194,6 +194,10 @@ enum {
@@ -193,6 +193,10 @@ enum {
/* CRU_CLKSEL27_CON */
VOP_DCLK_DIV_SHIFT = 8,
VOP_DCLK_DIV_MASK = 0xff << VOP_DCLK_DIV_SHIFT,
Expand All @@ -23,7 +23,7 @@ index cfbc7e92f7..de3c4bf310 100644
VOP_PLL_SEL_SHIFT = 1,
VOP_PLL_SEL_MASK = 1 << VOP_PLL_SEL_SHIFT,

@@ -201,6 +205,16 @@ enum {
@@ -200,6 +204,16 @@ enum {
GMAC_CLK_SRC_SHIFT = 12,
GMAC_CLK_SRC_MASK = 1 << GMAC_CLK_SRC_SHIFT,

Expand All @@ -41,10 +41,10 @@ index cfbc7e92f7..de3c4bf310 100644
DDRCTRL_PSRST_SHIFT = 11,
DDRCTRL_SRST_SHIFT = 10,
diff --git a/drivers/clk/rockchip/clk_rk322x.c b/drivers/clk/rockchip/clk_rk322x.c
index 44b5778589..418164e63b 100644
index 111111111111..222222222222 100644
--- a/drivers/clk/rockchip/clk_rk322x.c
+++ b/drivers/clk/rockchip/clk_rk322x.c
@@ -371,6 +371,14 @@ static ulong rk322x_clk_get_rate(struct clk *clk)
@@ -367,6 +367,14 @@ static ulong rk322x_clk_get_rate(struct clk *clk)
case SCLK_SDMMC:
rate = rockchip_mmc_get_clk(priv->cru, gclk_rate, clk->id);
break;
Expand All @@ -59,7 +59,7 @@ index 44b5778589..418164e63b 100644
default:
return -ENOENT;
}
@@ -378,6 +386,68 @@ static ulong rk322x_clk_get_rate(struct clk *clk)
@@ -374,6 +382,68 @@ static ulong rk322x_clk_get_rate(struct clk *clk)
return rate;
}

Expand Down Expand Up @@ -128,7 +128,7 @@ index 44b5778589..418164e63b 100644
static ulong rk322x_clk_set_rate(struct clk *clk, ulong rate)
{
struct rk322x_clk_priv *priv = dev_get_priv(clk->dev);
@@ -400,7 +470,29 @@ static ulong rk322x_clk_set_rate(struct clk *clk, ulong rate)
@@ -395,7 +465,29 @@ static ulong rk322x_clk_set_rate(struct clk *clk, ulong rate)
new_rate = rk322x_mac_set_clk(priv->cru, rate);
break;
case PLL_GPLL:
Expand Down Expand Up @@ -159,7 +159,7 @@ index 44b5778589..418164e63b 100644
default:
return -ENOENT;
}
@@ -461,13 +553,44 @@ static int rk322x_gmac_extclk_set_parent(struct clk *clk, struct clk *parent)
@@ -456,13 +548,44 @@ static int rk322x_gmac_extclk_set_parent(struct clk *clk, struct clk *parent)
return -EINVAL;
}

Expand Down Expand Up @@ -204,7 +204,7 @@ index 44b5778589..418164e63b 100644
}

debug("%s: unsupported clk %ld\n", __func__, clk->id);
@@ -646,7 +773,7 @@ static int rk322x_clk_bind(struct udevice *dev)
@@ -520,7 +643,7 @@ static int rk322x_clk_bind(struct udevice *dev)
debug("Warning: software reset driver bind failed\n");
#endif

Expand All @@ -213,7 +213,7 @@ index 44b5778589..418164e63b 100644
}

static const struct udevice_id rk322x_clk_ids[] = {
@@ -655,7 +782,7 @@ static const struct udevice_id rk322x_clk_ids[] = {
@@ -529,7 +652,7 @@ static const struct udevice_id rk322x_clk_ids[] = {
};

U_BOOT_DRIVER(rockchip_rk322x_cru) = {
Expand All @@ -223,5 +223,5 @@ index 44b5778589..418164e63b 100644
.of_match = rk322x_clk_ids,
.priv_auto = sizeof(struct rk322x_clk_priv),
--
2.34.1
Armbian

13 changes: 6 additions & 7 deletions patch/u-boot/v2024.07/board_rk322x-box/rk3228-hdmi-driver.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
From 98792aa8f196df9f771c52e5bcac2c34a2937cd2 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paolo Sabatino <[email protected]>
Date: Sun, 30 Jun 2024 17:37:39 +0200
Subject: [PATCH] rk3228 hdmi driver
Subject: rk3228 hdmi driver

---
drivers/video/rockchip/Makefile | 1 +
drivers/video/rockchip/rk3228_hdmi.c | 168 +++++++++++++++++++++++++++
drivers/video/rockchip/rk3228_hdmi.c | 168 ++++++++++
2 files changed, 169 insertions(+)
create mode 100644 drivers/video/rockchip/rk3228_hdmi.c

diff --git a/drivers/video/rockchip/Makefile b/drivers/video/rockchip/Makefile
index f55beceebf..ac55864a33 100644
index 111111111111..222222222222 100644
--- a/drivers/video/rockchip/Makefile
+++ b/drivers/video/rockchip/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_ROCKCHIP_RK3328) += rk3328_vop.o
Expand All @@ -23,7 +22,7 @@ index f55beceebf..ac55864a33 100644
obj-hdmi-$(CONFIG_ROCKCHIP_RK3399) += rk3399_hdmi.o
diff --git a/drivers/video/rockchip/rk3228_hdmi.c b/drivers/video/rockchip/rk3228_hdmi.c
new file mode 100644
index 0000000000..3a95fcf0d8
index 000000000000..111111111111
--- /dev/null
+++ b/drivers/video/rockchip/rk3228_hdmi.c
@@ -0,0 +1,168 @@
Expand Down Expand Up @@ -196,5 +195,5 @@ index 0000000000..3a95fcf0d8
+ .flags = DM_FLAG_OS_PREPARE
+};
--
2.34.1
Armbian

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 3f6e2571e3bc164fceacc2057476fdf0724f1131 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paolo Sabatino <[email protected]>
Date: Sun, 30 Jun 2024 17:18:22 +0200
Subject: [PATCH] add rk3228 support to inno hdmi driver
Subject: add rk3228 support to inno hdmi driver

---
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 379 ++++++++++++++++++
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 379 ++++++++++
1 file changed, 379 insertions(+)

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
index 604e2703da..e41428be22 100644
index 111111111111..222222222222 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
@@ -19,6 +19,110 @@
Expand Down Expand Up @@ -489,5 +489,5 @@ index 604e2703da..e41428be22 100644
.compatible = "rockchip,rk3328-hdmi-phy",
.data = (ulong)&rk3328_inno_hdmi_phy_drv_data,
--
2.34.1
Armbian

13 changes: 6 additions & 7 deletions patch/u-boot/v2024.07/board_rk322x-box/rk3228-vop-driver.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
From 87c948b811c99b0a9004016099152a406b8db903 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paolo Sabatino <[email protected]>
Date: Sun, 30 Jun 2024 17:41:01 +0200
Subject: [PATCH] rk3228 vop driver
Subject: rk3228 vop driver

---
drivers/video/rockchip/Makefile | 1 +
drivers/video/rockchip/rk3228_vop.c | 107 ++++++++++++++++++++++++++++
drivers/video/rockchip/rk3228_vop.c | 107 ++++++++++
2 files changed, 108 insertions(+)
create mode 100644 drivers/video/rockchip/rk3228_vop.c

diff --git a/drivers/video/rockchip/Makefile b/drivers/video/rockchip/Makefile
index ac55864a33..28ac47a81b 100644
index 111111111111..222222222222 100644
--- a/drivers/video/rockchip/Makefile
+++ b/drivers/video/rockchip/Makefile
@@ -5,6 +5,7 @@
Expand All @@ -23,7 +22,7 @@ index ac55864a33..28ac47a81b 100644
obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399_vop.o
diff --git a/drivers/video/rockchip/rk3228_vop.c b/drivers/video/rockchip/rk3228_vop.c
new file mode 100644
index 0000000000..ec558078a0
index 000000000000..111111111111
--- /dev/null
+++ b/drivers/video/rockchip/rk3228_vop.c
@@ -0,0 +1,107 @@
Expand Down Expand Up @@ -135,5 +134,5 @@ index 0000000000..ec558078a0
+ .flags = DM_FLAG_OS_PREPARE
+};
--
2.34.1
Armbian

Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
From 908176615a6aa710563883715da75e50e7305179 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paolo Sabatino <[email protected]>
Date: Sat, 4 May 2024 15:07:27 +0200
Subject: [PATCH] add reset properties for usb otg/ehci
Subject: add reset properties for usb otg/ehci

---
arch/arm/dts/rk322x.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
arch/arm/dts/rk322x.dtsi | 8 ++++++++
drivers/usb/host/dwc2.c | 5 ++++-
drivers/usb/host/ehci-generic.c | 6 +++---
3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/arch/arm/dts/rk322x.dtsi b/arch/arm/dts/rk322x.dtsi
index 8eed9e3a92..ffe503e5db 100644
index 111111111111..222222222222 100644
--- a/arch/arm/dts/rk322x.dtsi
+++ b/arch/arm/dts/rk322x.dtsi
@@ -799,6 +799,8 @@
Expand Down Expand Up @@ -46,12 +48,12 @@ index 8eed9e3a92..ffe503e5db 100644
+ reset-names = "ehci";
status = "disabled";
};

diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 936e30438d..09d3805e78 100644
index 111111111111..222222222222 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -1436,7 +1438,10 @@ static int dwc2_usb_remove(struct udevice *dev)
@@ -1438,7 +1438,10 @@ static int dwc2_usb_remove(struct udevice *dev)

dwc2_uninit_common(priv->regs);

Expand All @@ -64,7 +66,7 @@ index 936e30438d..09d3805e78 100644
clk_release_bulk(&priv->clks);

diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index 936e30438d..09d3805e78 100644
index 111111111111..222222222222 100644
--- a/drivers/usb/host/ehci-generic.c
+++ b/drivers/usb/host/ehci-generic.c
@@ -148,9 +148,9 @@ static int ehci_usb_remove(struct udevice *dev)
Expand All @@ -81,7 +83,5 @@ index 936e30438d..09d3805e78 100644
return clk_release_bulk(&priv->clocks);
}
--
2.34.1


Armbian

Original file line number Diff line number Diff line change
@@ -1,6 +1,76 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paolo <[email protected]>
Date: Fri, 19 Jun 2020 17:27:27 +0200
Subject: [ARCHEOLOGY] Introducing Rockchip RK322X SoC support (#2032)

> X-Git-Archeology: > recovered message: > * Introducing Rockchip rk322x SoC support
> X-Git-Archeology: > recovered message: > Main features:
> X-Git-Archeology: > recovered message: > - Legacy kernel flavour based upon stable v2.x rk3288 Rockchip branch (https://github.com/rockchip-linux/kernel/tree/stable-4.4-rk3288-linux-v2.x)
> X-Git-Archeology: > recovered message: > - Current kernel flavour based on mainline 5.6.y kernel
> X-Git-Archeology: > recovered message: > - Mainline u-boot (v2020.04)
> X-Git-Archeology: > recovered message: > - Single generic tv box target (rk322x-box) which boots on all the known tv boxes
> X-Git-Archeology: > recovered message: > - Hardware devices (eMMC/NAND, led wiring configuration, SoC variant selection) modulation done by user at runtime via device tree overlays - a script (rk322x-config) is provided for autodetection and simple configuration by inexperienced users;
> X-Git-Archeology: > recovered message: > - Bits added to armbian-hardware-optimization to set affinity for irq handlers
> X-Git-Archeology: > recovered message: > - rk322x-box targets already added to targets.conf for automatic image creation
> X-Git-Archeology: > recovered message: > * Removed disabled patches
> X-Git-Archeology: > recovered message: > * Restored mysteriously removed comment character
> X-Git-Archeology: - Revision 23604e8a0dcdf81ec6c28ccd4b2a64b90816d8e7: https://github.com/armbian/build/commit/23604e8a0dcdf81ec6c28ccd4b2a64b90816d8e7
> X-Git-Archeology: Date: Fri, 19 Jun 2020 17:27:27 +0200
> X-Git-Archeology: From: Paolo <[email protected]>
> X-Git-Archeology: Subject: Introducing Rockchip RK322X SoC support (#2032)
> X-Git-Archeology:
> X-Git-Archeology: - Revision 3e7409eb1aa98c339cf35a03e305ec635e4c6292: https://github.com/armbian/build/commit/3e7409eb1aa98c339cf35a03e305ec635e4c6292
> X-Git-Archeology: Date: Sat, 10 Oct 2020 07:07:59 +0000
> X-Git-Archeology: From: paolo <[email protected]>
> X-Git-Archeology: Subject: Moving rk322x to u-boot v2020.10, using static FIT image source file instead of now removed fit_spl_optee.sh script
> X-Git-Archeology:
> X-Git-Archeology: - Revision 95425c27b9d3bbb96e7936cc531638c9150538f9: https://github.com/armbian/build/commit/95425c27b9d3bbb96e7936cc531638c9150538f9
> X-Git-Archeology: Date: Fri, 12 Mar 2021 20:20:12 +0000
> X-Git-Archeology: From: Paolo Sabatino <[email protected]>
> X-Git-Archeology: Subject: Changes and fixes to rk322x uboot and kernel config
> X-Git-Archeology:
> X-Git-Archeology: - Revision e4d895607e5ac380b186e523ce28c6f9c36289cb: https://github.com/armbian/build/commit/e4d895607e5ac380b186e523ce28c6f9c36289cb
> X-Git-Archeology: Date: Sun, 04 Apr 2021 15:52:22 +0000
> X-Git-Archeology: From: Paolo Sabatino <[email protected]>
> X-Git-Archeology: Subject: rk322x: uboot: upgrade to v2021.04-rc5
> X-Git-Archeology:
> X-Git-Archeology: - Revision 71d6e7db63d6d85b7b1374b37432e0e8dcd3a73a: https://github.com/armbian/build/commit/71d6e7db63d6d85b7b1374b37432e0e8dcd3a73a
> X-Git-Archeology: Date: Fri, 18 Mar 2022 17:26:46 +0100
> X-Git-Archeology: From: Paolo Sabatino <[email protected]>
> X-Git-Archeology: Subject: rk322x: bump to u-boot v2022.01
> X-Git-Archeology:
> X-Git-Archeology: - Revision 0777be9e754c8bd24cff0297226b5158564bbc96: https://github.com/armbian/build/commit/0777be9e754c8bd24cff0297226b5158564bbc96
> X-Git-Archeology: Date: Sun, 10 Apr 2022 16:45:06 +0200
> X-Git-Archeology: From: Paolo Sabatino <[email protected]>
> X-Git-Archeology: Subject: rk322x: move edge flavour to kernel 5.17, adapt patches were necessary
> X-Git-Archeology:
> X-Git-Archeology: - Revision 97c34489831f2146940f52915428263b7edfcbe1: https://github.com/armbian/build/commit/97c34489831f2146940f52915428263b7edfcbe1
> X-Git-Archeology: Date: Fri, 24 Mar 2023 23:13:42 +0100
> X-Git-Archeology: From: Paolo Sabatino <[email protected]>
> X-Git-Archeology: Subject: rockchip: put all rockchip 32 bit into uboot/v2022.04 directory
> X-Git-Archeology:
> X-Git-Archeology: - Revision fb7484f3f9f50bbbae033c251978e00fa59fd080: https://github.com/armbian/build/commit/fb7484f3f9f50bbbae033c251978e00fa59fd080
> X-Git-Archeology: Date: Wed, 01 May 2024 08:29:03 +0100
> X-Git-Archeology: From: Paolo Sabatino <[email protected]>
> X-Git-Archeology: Subject: rockchip: bump rk322x u-boot to v2024.01
> X-Git-Archeology:
> X-Git-Archeology: - Revision 5657ec0798045ad9cff0df0033ff1c963dfcdd66: https://github.com/armbian/build/commit/5657ec0798045ad9cff0df0033ff1c963dfcdd66
> X-Git-Archeology: Date: Mon, 06 May 2024 15:50:14 +0100
> X-Git-Archeology: From: Paolo Sabatino <[email protected]>
> X-Git-Archeology: Subject: rockchip: add reset props for usb on rk322x
> X-Git-Archeology:
> X-Git-Archeology: - Revision 7876017d0b77bbfefbb3d112045b32d9b50db928: https://github.com/armbian/build/commit/7876017d0b77bbfefbb3d112045b32d9b50db928
> X-Git-Archeology: Date: Tue, 02 Jul 2024 23:31:50 +0000
> X-Git-Archeology: From: Paolo <[email protected]>
> X-Git-Archeology: Subject: Bump rk322x-box and rk3318-box to u-boot v2024.07-rc5 (#6855)
> X-Git-Archeology:
---
configs/rk322x-box_defconfig | 128 ++++++++++
1 file changed, 128 insertions(+)

diff --git a/configs/rk322x-box_defconfig b/configs/rk322x-box_defconfig
new file mode 100644
index 0000000000..cd93614c51
index 000000000000..111111111111
--- /dev/null
+++ b/configs/rk322x-box_defconfig
@@ -0,0 +1,128 @@
Expand Down Expand Up @@ -132,3 +202,6 @@ index 0000000000..cd93614c51
+CONFIG_SPL_CRC32=y
+CONFIG_ERRNO_STR=y
+CONFIG_BOOTM_OPTEE=y
--
Armbian

Loading

0 comments on commit 07084b6

Please sign in to comment.