Skip to contentSkip to conversation

serial: Replace CONFIG_ with CONFIG_IS_ENABLED

PATCH New Marek Vasut 1 participant 4 messages Feb 16, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 serial: Replace CONFIG_ with CONFIG_IS_ENABLED

Cosmetic change, replace CONFIG_* with CONFIG_IS_ENABLED(*) .

Cc Nobuhiro Iwamatsu <[email protected]>
---
 drivers/serial/serial_sh.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/serial/serial_sh.c +2 -2
index c07ddc70dc..a17698f90e 100644
@@ -149,7 +149,7 @@ static int sh_serial_getc_generic(struct uart_port *port)
 	return ch;
 }
 
-#ifdef CONFIG_DM_SERIAL
+#if CONFIG_IS_ENABLED(DM_SERIAL)
 
 static int sh_serial_pending(struct udevice *dev, bool input)
 {
@@ -204,7 +204,7 @@ static const struct dm_serial_ops sh_serial_ops = {
 	.setbrg = sh_serial_setbrg,
 };
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct udevice_id sh_serial_id[] ={
 	{.compatible = "renesas,sci", .data = PORT_SCI},
 	{.compatible = "renesas,scif", .data = PORT_SCIF},
Signature · 1 line
2.15.1
#1 lore raw

PATCH 2/4 ARM: dts: rmobile: Make scif0 available before reloc on Porter

Make the SCIF available before relocation and in SPL on R8A7791 Porter.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 arch/arm/dts/r8a7791-porter.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/r8a7791-porter.dts +1 -0
index bc93bb24e4..3d47daa08b 100644
@@ -214,6 +214,7 @@
 &scif0 {
 	pinctrl-0 = <&scif0_pins>;
 	pinctrl-names = "default";
+	u-boot,dm-pre-reloc;
 
 	status = "okay";
 };
Signature · 1 line
2.15.1
#2 lore raw

PATCH 3/4 ARM: dts: rmobile: Make PFC and RST available before reloc

In reply to Marek Vasut

Those two nodes are needed to configure pinmux before relocation and to configure clock before relocation, since CPG/MSSR needs access to RST node. This is not noticable on Gen3, but on Gen2 this causes problems in SPL if they are not available early.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 arch/arm/dts/r8a779x-u-boot.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/dts/r8a779x-u-boot.dtsi +8 -0
index 0baac1d2c5..f34cb942ed 100644
@@ -20,6 +20,14 @@
 	u-boot,dm-pre-reloc;
 };
 
+&pfc {
+	u-boot,dm-pre-reloc;
+};
+
 &prr {
 	u-boot,dm-pre-reloc;
 };
+
+&rst {
+	u-boot,dm-pre-reloc;
+};
Signature · 1 line
2.15.1
#3 lore raw

PATCH 4/4 ARM: rmobile: Convert Porter to SPL

In reply to Marek Vasut

Due to size limitations of the MERAM, switch U-Boot to SPL. The SPL is loaded by the SPI_LOADER into MERAM and then loads U-Boot proper into DRAM. This way U-Boot can freely grow in size in DRAM, as there is plenty of it.

Cc Nobuhiro Iwamatsu <[email protected]>

---
NOTE: To update U-Boot, first install u-boot.img to 0x140000 in SPI NOR,
then use the Minimon to flash u-boot-spl.srec using ls,2,e6304000. To generate u-boot-spl.srec, use objcopy:
arm-linux-gnueabi-objcopy -O srec spl/u-boot-spl u-boot-spl.srec

---
 arch/arm/mach-rmobile/Kconfig.32 |  2 ++
 board/renesas/porter/porter.c    | 22 ++++++++++++++++++++++
 configs/porter_defconfig         | 20 +++++++++++++++++++-
 include/configs/porter.h         | 15 +++++++++------
 4 files changed, 52 insertions(+), 7 deletions(-)
arch/arm/mach-rmobile/Kconfig.32 +2 -0
index ab05966d15..a96938c01e 100644
@@ -70,6 +70,8 @@ config TARGET_PORTER
 	bool "Porter board"
 	select DM
 	select DM_SERIAL
+	select SUPPORT_SPL
+	select SPL_DM if SPL
 
 config TARGET_STOUT
 	bool "Stout board"
board/renesas/porter/porter.c +22 -0
index 86dea8bfa7..bd0080d210 100644
@@ -115,3 +115,25 @@ void reset_cpu(ulong addr)
 	val |= 0x02;
 	i2c_write(CONFIG_SYS_I2C_POWERIC_ADDR, 0x13, 1, &val, 1);
 }
+
+#ifdef CONFIG_SPL_BUILD
+#include <spl.h>
+void board_init_f(ulong dummy)
+{
+	board_early_init_f();
+}
+
+void spl_board_init(void)
+{
+	/* UART clocks enabled and gd valid - init serial console */
+	preloader_console_init();
+}
+
+void board_boot_order(u32 *spl_boot_list)
+{
+	/* Boot from SPI NOR with YMODEM UART fallback. */
+	spl_boot_list[0] = BOOT_DEVICE_SPI;
+	spl_boot_list[1] = BOOT_DEVICE_UART;
+	spl_boot_list[2] = BOOT_DEVICE_NONE;
+}
+#endif
configs/porter_defconfig +19 -1
index 38501d0bf1..0fa308b584 100644
@@ -1,12 +1,22 @@
 CONFIG_ARM=y
 CONFIG_ARCH_RMOBILE=y
-CONFIG_SYS_TEXT_BASE=0xE6304000
+CONFIG_SYS_TEXT_BASE=0x50000000
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_R8A7791=y
 CONFIG_TARGET_PORTER=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a7791-porter-u-boot"
 CONFIG_BOOTDELAY=3
 CONFIG_VERSION_VARIABLE=y
+CONFIG_SPL=y
+CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_XIMG is not set
@@ -26,8 +36,14 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_EMBED=y
+CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas power-domains"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_CLK=y
+CONFIG_SPL_CLK=y
 CONFIG_CLK_RENESAS=y
 CONFIG_DM_GPIO=y
 CONFIG_RCAR_GPIO=y
@@ -44,6 +60,7 @@ CONFIG_DM_PCI=y
 CONFIG_PCI_RCAR_GEN2=y
 CONFIG_PINCTRL=y
 CONFIG_PINCONF=y
+CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_PFC=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
@@ -55,3 +72,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_PCI=y
 CONFIG_USB_STORAGE=y
+CONFIG_SPL_FRAMEWORK=y
include/configs/porter.h +9 -6
index b4a317f724..758ed21c15 100644
@@ -16,12 +16,8 @@
 
 #include "rcar-gen2-common.h"
 
-#if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT)
-#define CONFIG_SYS_INIT_SP_ADDR		0x7023FFFC
-#else
-#define CONFIG_SYS_INIT_SP_ADDR		0xE633fffC
-#endif
-#define STACK_AREA_SIZE			0xC000
+#define CONFIG_SYS_INIT_SP_ADDR		0x4f000000
+#define STACK_AREA_SIZE			0x00100000
 #define LOW_LEVEL_MERAM_STACK \
 		(CONFIG_SYS_INIT_SP_ADDR + STACK_AREA_SIZE - 4)
 
@@ -67,4 +63,11 @@
 
 #define CONFIG_SYS_I2C_POWERIC_ADDR	0x58 /* da9063 */
 
+/* SPL support */
+#define CONFIG_SPL_TEXT_BASE		0xe6304000
+#define CONFIG_SPL_STACK		0xe6340000
+#define CONFIG_SPL_MAX_SIZE		0x40000
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x140000
+
 #endif /* __PORTER_H */
Signature · 1 line
2.15.1