Skip to contentSkip to conversation

riscv: mpfs-icicle-kit: Increase SYS_MALLOC_F_LEN

PATCH New Bin Meng 2 participants 7 messages Mar 31, 2021 – Apr 6, 2021

Subsystems (2)
lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/3 riscv: mpfs-icicle-kit: Increase SYS_MALLOC_F_LEN

The RISC-V architecture default value of CONFIG_SYS_MALLOC_F_LEN (0x1000) would not provide enough memory for devices like mpfs clock and ns16550 serial to bind well before relocation.

---

 configs/microchip_mpfs_icicle_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/microchip_mpfs_icicle_defconfig +1 -0
index 0c15c3bd38..1cb29201b4 100644
@@ -1,4 +1,5 @@
 CONFIG_RISCV=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="microchip-mpfs-icicle-kit"
 CONFIG_TARGET_MICROCHIP_ICICLE=y
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/3 riscv: mpfs-icicle-kit: Increase SYS_MALLOC_F_LEN

Quoted 11 lines · Bin Meng

The RISC-V architecture default value of CONFIG_SYS_MALLOC_F_LEN (0x1000) would not provide enough memory for devices like mpfs clock and ns16550 serial to bind well before relocation.

---

 configs/microchip_mpfs_icicle_defconfig | 1 +
 1 file changed, 1 insertion(+)

Ping for this series?

author
#2 lore raw

PATCH 2/3 clk: mpfs_clk: Enable DM_FLAG_PRE_RELOC flag

In reply to Bin Meng

This driver is needed in the pre-relocation phase as the serial driver depends on it.

---

 drivers/clk/microchip/mpfs_clk.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/microchip/mpfs_clk.c +1 -0
index 722c79b7c0..05d7647206 100644
@@ -120,4 +120,5 @@ U_BOOT_DRIVER(mpfs_clk) = {
 	.ops = &mpfs_clk_ops,
 	.probe = mpfs_clk_probe,
 	.priv_auto = sizeof(struct clk),
+	.flags = DM_FLAG_PRE_RELOC,
 };
Signature · 1 line
2.25.1
#3 lore raw

PATCH 2/3 clk: mpfs_clk: Enable DM_FLAG_PRE_RELOC flag

Quoted 21 lines · Bin Meng

This driver is needed in the pre-relocation phase as the serial driver depends on it.

---

 drivers/clk/microchip/mpfs_clk.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/microchip/mpfs_clk.c +1 -1
index 722c79b7c0..05d7647206 100644
@@ -120,4 +120,5 @@ U_BOOT_DRIVER(mpfs_clk) = {
        .ops = &mpfs_clk_ops,
        .probe = mpfs_clk_probe,
        .priv_auto = sizeof(struct clk),
+       .flags = DM_FLAG_PRE_RELOC,
 };
--
Quoted 3 lines

2.25.1

author
#4 lore raw

PATCH 3/3 riscv: dts: mpfs-icicle-kit: Drop 'clock-frequency' in the uart nodes

In reply to Bin Meng

The uart nodes already provide <clocks> property for the driver to dynamically calculate the correct clock frequency. There is no need to keep the hard-coded <clock-frequency> property.

---

 arch/riscv/dts/microchip-mpfs-icicle-kit.dts | 4 ----
 1 file changed, 4 deletions(-)
arch/riscv/dts/microchip-mpfs-icicle-kit.dts +0 -4
index e2b9decc94..89c4cf5fb2 100644
@@ -232,7 +232,6 @@
 			reg-shift = <2>;
 			interrupt-parent = <&plic>;
 			interrupts = <90>;
-			clock-frequency = <150000000>;
 			clocks = <&clkcfg CLK_MMUART0>;
 			status = "okay";
 		};
@@ -294,7 +293,6 @@
 			reg-shift = <2>;
 			interrupt-parent = <&plic>;
 			interrupts = <91>;
-			clock-frequency = <150000000>;
 			clocks = <&clkcfg CLK_MMUART1>;
 			status = "okay";
 		};
@@ -305,7 +303,6 @@
 			reg-shift = <2>;
 			interrupt-parent = <&plic>;
 			interrupts = <92>;
-			clock-frequency = <150000000>;
 			clocks = <&clkcfg CLK_MMUART2>;
 			status = "okay";
 		};
@@ -316,7 +313,6 @@
 			reg-shift = <2>;
 			interrupt-parent = <&plic>;
 			interrupts = <93>;
-			clock-frequency = <150000000>;
 			clocks = <&clkcfg CLK_MMUART3>;
 			status = "okay";
 		};
Signature · 1 line
2.25.1
#5 lore raw

PATCH 3/3 riscv: dts: mpfs-icicle-kit: Drop 'clock-frequency' in the uart nodes

Quoted 48 lines · Bin Meng

The uart nodes already provide <clocks> property for the driver to dynamically calculate the correct clock frequency. There is no need to keep the hard-coded <clock-frequency> property.

---

 arch/riscv/dts/microchip-mpfs-icicle-kit.dts | 4 ----
 1 file changed, 4 deletions(-)
arch/riscv/dts/microchip-mpfs-icicle-kit.dts +0 -5
index e2b9decc94..89c4cf5fb2 100644
@@ -232,7 +232,6 @@
                        reg-shift = <2>;
                        interrupt-parent = <&plic>;
                        interrupts = <90>;
-                       clock-frequency = <150000000>;
                        clocks = <&clkcfg CLK_MMUART0>;
                        status = "okay";
                };
@@ -294,7 +293,6 @@
                        reg-shift = <2>;
                        interrupt-parent = <&plic>;
                        interrupts = <91>;
-                       clock-frequency = <150000000>;
                        clocks = <&clkcfg CLK_MMUART1>;
                        status = "okay";
                };
@@ -305,7 +303,6 @@
                        reg-shift = <2>;
                        interrupt-parent = <&plic>;
                        interrupts = <92>;
-                       clock-frequency = <150000000>;
                        clocks = <&clkcfg CLK_MMUART2>;
                        status = "okay";
                };
@@ -316,7 +313,6 @@
                        reg-shift = <2>;
                        interrupt-parent = <&plic>;
                        interrupts = <93>;
-                       clock-frequency = <150000000>;
                        clocks = <&clkcfg CLK_MMUART3>;
                        status = "okay";
                };
--
Quoted 3 lines

2.25.1

#6 lore raw

PATCH 1/3 riscv: mpfs-icicle-kit: Increase SYS_MALLOC_F_LEN

In reply to Bin Meng
Quoted 22 lines · Bin Meng

The RISC-V architecture default value of CONFIG_SYS_MALLOC_F_LEN (0x1000) would not provide enough memory for devices like mpfs clock and ns16550 serial to bind well before relocation.

---

 configs/microchip_mpfs_icicle_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/microchip_mpfs_icicle_defconfig +1 -1
index 0c15c3bd38..1cb29201b4 100644
@@ -1,4 +1,5 @@
 CONFIG_RISCV=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="microchip-mpfs-icicle-kit"
 CONFIG_TARGET_MICROCHIP_ICICLE=y
--
Quoted 3 lines

2.25.1