Skip to contentSkip to conversation

EXYNOS5250: FDT: Add device tree support for console

PATCH Superseded Rajeshwari Shinde 3 participants 9 messages Jun 24, 2013

Subsystems (3)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover EXYNOS5250: FDT: Add device tree support for console

Enabled fdt support for default console on EXYNOS5250.

Changes in V2:
- Changed the compatible string to "samsung,exynos4210-uart"
Changes in V3:
- Rebased the patchset on latest u-boot-samsung branch.
- Added a alias console as we will support one at any point of time.
- Moved driver config structure to data section.
- Changed silent_console to silent-console.
- Did put a check for base address before doing fdt decoding.
Changes in V4:
- Rebased the patchset on latest u-boot-samsung branch.
- Changed to COMPAT_SAMSUNG_EXYNOS5_SERIAL to COMPAT_SAMSUNG_EXYNOS_SERIAL
Changes in V5:
- Added serial device node for Snow board.
Changes in V6:
- Rebased the patchset on latest u-boot-samsung branch.
- Changed the if..else condition to a switch statement.
- Moved compatible strings up with all other samsung strings.

Rajeshwari Shinde (4):
EXYNOS5: FDT: Add compatible strings for Serial
EXYNOS5: FDT: Add serial device node values
S5P: Serial: Add fdt support to driver
CONFIG: EXYNOS5: Enable silent console

 arch/arm/dts/exynos5250.dtsi              |   28 ++++++++++
 board/samsung/dts/exynos5250-smdk5250.dts |    2 +
 board/samsung/dts/exynos5250-snow.dts     |    2 +
 drivers/serial/serial_s5p.c               |   78 +++++++++++++++++++++++++++++
 include/configs/exynos5250-dt.h           |    2 +-
 include/fdtdec.h                          |    1 +
 lib/fdtdec.c                              |    1 +
 7 files changed, 113 insertions(+), 1 deletions(-)
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH v6 1/4 EXYNOS5: FDT: Add compatible strings for Serial

Add required compatible information for s5p serial driver

---
Changes in V2:
- Changed the compatible string to "samsung,exynos4210-uart"
Changes in V3:
- Rebased on latest u-boot-samsung
Changes in V4:
- Rebased on latest u-boot-samsung
- Changed to COMPAT_SAMSUNG_EXYNOS5_SERIAL to COMPAT_SAMSUNG_EXYNOS_SERIAL
Changes in V5:
- None
Changes in V6:
- Moved compatible strings up with all other samsung strings.

 include/fdtdec.h |    1 +
 lib/fdtdec.c     |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
include/fdtdec.h +1 -0
index bc3b89b..bea326e 100644
@@ -90,6 +90,7 @@ enum fdt_compat_id {
 	COMPAT_SAMSUNG_EXYNOS_FIMD,	/* Exynos Display controller */
 	COMPAT_SAMSUNG_EXYNOS5_DP,	/* Exynos Display port controller */
 	COMPAT_SAMSUNG_EXYNOS5_DWMMC,	/* Exynos5 DWMMC controller */
+	COMPAT_SAMSUNG_EXYNOS_SERIAL,	/* Exynos UART */
 	COMPAT_MAXIM_MAX77686_PMIC,	/* MAX77686 PMIC */
 	COMPAT_GENERIC_SPI_FLASH,	/* Generic SPI Flash chip */
 	COMPAT_MAXIM_98095_CODEC,	/* MAX98095 Codec */
lib/fdtdec.c +1 -0
index e3142cb..d1acc35 100644
@@ -63,6 +63,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(SAMSUNG_EXYNOS_FIMD, "samsung,exynos-fimd"),
 	COMPAT(SAMSUNG_EXYNOS5_DP, "samsung,exynos5-dp"),
 	COMPAT(SAMSUNG_EXYNOS5_DWMMC, "samsung,exynos5250-dwmmc"),
+	COMPAT(SAMSUNG_EXYNOS_SERIAL, "samsung,exynos4210-uart"),
 	COMPAT(MAXIM_MAX77686_PMIC, "maxim,max77686_pmic"),
 	COMPAT(GENERIC_SPI_FLASH, "spi-flash"),
 	COMPAT(MAXIM_98095_CODEC, "maxim,max98095-codec"),
Signature · 1 line
1.7.4.4
#2 lore raw

PATCH v6 1/4 EXYNOS5: FDT: Add compatible strings for Serial

Quoted 37 lines · Rajeshwari Shinde

Add required compatible information for s5p serial driver

---
Changes in V2:
- Changed the compatible string to "samsung,exynos4210-uart"
Changes in V3:
- Rebased on latest u-boot-samsung
Changes in V4:
- Rebased on latest u-boot-samsung
- Changed to COMPAT_SAMSUNG_EXYNOS5_SERIAL to COMPAT_SAMSUNG_EXYNOS_SERIAL
Changes in V5:
- None
Changes in V6:
- Moved compatible strings up with all other samsung strings.

 include/fdtdec.h |    1 +
 lib/fdtdec.c     |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
include/fdtdec.h +1 -0
index bc3b89b..bea326e 100644
@@ -90,6 +90,7 @@ enum fdt_compat_id {
 	COMPAT_SAMSUNG_EXYNOS_FIMD,	/* Exynos Display controller */
 	COMPAT_SAMSUNG_EXYNOS5_DP,	/* Exynos Display port controller */
 	COMPAT_SAMSUNG_EXYNOS5_DWMMC,	/* Exynos5 DWMMC controller */
+	COMPAT_SAMSUNG_EXYNOS_SERIAL,	/* Exynos UART */
 	COMPAT_MAXIM_MAX77686_PMIC,	/* MAX77686 PMIC */
 	COMPAT_GENERIC_SPI_FLASH,	/* Generic SPI Flash chip */
 	COMPAT_MAXIM_98095_CODEC,	/* MAX98095 Codec */
lib/fdtdec.c +0 -0
index e3142cb..d1acc35 100644

lib/fdtdec.c static const char * const compat_names[COMPAT_COUNT] = { · line 66

Quoted 4 lines
lib/fdtdec.c +1 -0
@@ -63,6 +63,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(SAMSUNG_EXYNOS_FIMD, "samsung,exynos-fimd"),
 	COMPAT(SAMSUNG_EXYNOS5_DP, "samsung,exynos5-dp"),
 	COMPAT(SAMSUNG_EXYNOS5_DWMMC, "samsung,exynos5250-dwmmc"),
+	COMPAT(SAMSUNG_EXYNOS_SERIAL, "samsung,exynos4210-uart"),

Is it exynos4210 specific?
If not, how about exynos-uart?

lib/fdtdec.c static const char * const compat_names[COMPAT_COUNT] = { · line 69

Quoted 4 lines
lib/fdtdec.c +0 -0
 	COMPAT(MAXIM_MAX77686_PMIC, "maxim,max77686_pmic"),
 	COMPAT(GENERIC_SPI_FLASH, "spi-flash"),
 	COMPAT(MAXIM_98095_CODEC, "maxim,max98095-codec"),

Thanks,
Minkyu Kang.

#3 lore raw

PATCH v6 1/4 EXYNOS5: FDT: Add compatible strings for Serial

Hi Minkyu,

Please do find the answer to your commnet.

Quoted 37 lines · Minkyu Kang
Quoted 36 lines · Rajeshwari Shinde

Add required compatible information for s5p serial driver

---
Changes in V2:
- Changed the compatible string to "samsung,exynos4210-uart"
Changes in V3:
- Rebased on latest u-boot-samsung
Changes in V4:
- Rebased on latest u-boot-samsung
- Changed to COMPAT_SAMSUNG_EXYNOS5_SERIAL to COMPAT_SAMSUNG_EXYNOS_SERIAL
Changes in V5:
- None
Changes in V6:
- Moved compatible strings up with all other samsung strings.

 include/fdtdec.h |    1 +
 lib/fdtdec.c     |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
include/fdtdec.h +1 -0
index bc3b89b..bea326e 100644
@@ -90,6 +90,7 @@ enum fdt_compat_id {
      COMPAT_SAMSUNG_EXYNOS_FIMD,     /* Exynos Display controller */
      COMPAT_SAMSUNG_EXYNOS5_DP,      /* Exynos Display port controller */
      COMPAT_SAMSUNG_EXYNOS5_DWMMC,   /* Exynos5 DWMMC controller */
+     COMPAT_SAMSUNG_EXYNOS_SERIAL,   /* Exynos UART */
      COMPAT_MAXIM_MAX77686_PMIC,     /* MAX77686 PMIC */
      COMPAT_GENERIC_SPI_FLASH,       /* Generic SPI Flash chip */
      COMPAT_MAXIM_98095_CODEC,       /* MAX98095 Codec */
lib/fdtdec.c +0 -0
index e3142cb..d1acc35 100644
Quoted 8 lines

lib/fdtdec.c static const char * const compat_names[COMPAT_COUNT] = { · line 66

Quoted 5 lines
lib/fdtdec.c +1 -0
@@ -63,6 +63,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
      COMPAT(SAMSUNG_EXYNOS_FIMD, "samsung,exynos-fimd"),
      COMPAT(SAMSUNG_EXYNOS5_DP, "samsung,exynos5-dp"),
      COMPAT(SAMSUNG_EXYNOS5_DWMMC, "samsung,exynos5250-dwmmc"),
+     COMPAT(SAMSUNG_EXYNOS_SERIAL, "samsung,exynos4210-uart"),

Is it exynos4210 specific?
If not, how about exynos-uart?

We use "samsung,exynos4210-uart" to keep it same as it is in kernel. This was changed after a commnet from Simon
http://lists.denx.de/pipermail/u-boot/2013-March/148095.html

Quoted 13 lines

lib/fdtdec.c static const char * const compat_names[COMPAT_COUNT] = { · line 69

Quoted 5 lines
lib/fdtdec.c +0 -0
      COMPAT(MAXIM_MAX77686_PMIC, "maxim,max77686_pmic"),
      COMPAT(GENERIC_SPI_FLASH, "spi-flash"),
      COMPAT(MAXIM_98095_CODEC, "maxim,max98095-codec"),

Thanks,
Minkyu Kang.

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 2 lines
Regards,
Rajeshwari Shinde
#4 lore raw

PATCH v6 2/4 EXYNOS5: FDT: Add serial device node values

In reply to Rajeshwari Shinde

This patch adds the device node required for serial driver

---
Changes in V2:
- Changed the compatible string to "samsung,exynos4210-uart"
Changes in V3:
- Added a alias console as we will support one at any point of time.
Changes in V4:
- Rebased on latest u-boot-samsung tree.
Changes in V5:
- Added device node for Snow board.
Changes in V6:
- Rebased on latest u-boot-samsung branch.

 arch/arm/dts/exynos5250.dtsi              |   28 ++++++++++++++++++++++++++++
 board/samsung/dts/exynos5250-smdk5250.dts |    2 ++
 board/samsung/dts/exynos5250-snow.dts     |    2 ++
 3 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/dts/exynos5250.dtsi +28 -0
index cee4fe8..1e14154 100644
@@ -202,4 +202,32 @@
 		interrupts = <0 78 0>;
 	};
 
+
+	serial at 12C00000 {
+		compatible = "samsung,exynos4210-uart";
+		reg = <0x12C00000 0x100>;
+		interrupts = <0 51 0>;
+		id = <0>;
+	};
+
+	serial at 12C10000 {
+		compatible = "samsung,exynos4210-uart";
+		reg = <0x12C10000 0x100>;
+		interrupts = <0 52 0>;
+		id = <1>;
+	};
+
+	serial at 12C20000 {
+		compatible = "samsung,exynos4210-uart";
+		reg = <0x12C20000 0x100>;
+		interrupts = <0 53 0>;
+		id = <2>;
+	};
+
+	serial at 12C30000 {
+		compatible = "samsung,exynos4210-uart";
+		reg = <0x12C30000 0x100>;
+		interrupts = <0 54 0>;
+		id = <3>;
+	};
 };
board/samsung/dts/exynos5250-smdk5250.dts +2 -0
index 93375a6..80ffe30 100644
@@ -34,6 +34,8 @@
 		mmc1 = "/mmc at 12210000";
 		mmc2 = "/mmc at 12220000";
 		mmc3 = "/mmc at 12230000";
+		serial0 = "/serial at 12C30000";
+		console = "/serial at 12C30000";
 	};
 
 	sromc at 12250000 {
board/samsung/dts/exynos5250-snow.dts +2 -0
index d167df9..fdc047a 100644
@@ -34,6 +34,8 @@
 		mmc1 = "/mmc at 12210000";
 		mmc2 = "/mmc at 12220000";
 		mmc3 = "/mmc at 12230000";
+		serial0 = "/serial at 12C30000";
+		console = "/serial at 12C30000";
 	};
 
 	sound at 12d60000 {
Signature · 1 line
1.7.4.4
#5 lore raw

PATCH v6 2/4 EXYNOS5: FDT: Add serial device node values

Quoted 25 lines · Rajeshwari Shinde

This patch adds the device node required for serial driver

---
Changes in V2:
- Changed the compatible string to "samsung,exynos4210-uart"
Changes in V3:
- Added a alias console as we will support one at any point of time.
Changes in V4:
- Rebased on latest u-boot-samsung tree.
Changes in V5:
- Added device node for Snow board.
Changes in V6:
- Rebased on latest u-boot-samsung branch.

 arch/arm/dts/exynos5250.dtsi              |   28 ++++++++++++++++++++++++++++
 board/samsung/dts/exynos5250-smdk5250.dts |    2 ++
 board/samsung/dts/exynos5250-snow.dts     |    2 ++
 3 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/dts/exynos5250.dtsi +0 -0
index cee4fe8..1e14154 100644

arch/arm/dts/exynos5250.dtsi line 205

Quoted 4 lines
arch/arm/dts/exynos5250.dtsi +1 -0
@@ -202,4 +202,32 @@
 		interrupts = <0 78 0>;
 	};
 
+

please remove this extra line.

Quoted 47 lines
arch/arm/dts/exynos5250.dtsi +27 -0
+	serial at 12C00000 {
+		compatible = "samsung,exynos4210-uart";
+		reg = <0x12C00000 0x100>;
+		interrupts = <0 51 0>;
+		id = <0>;
+	};
+
+	serial at 12C10000 {
+		compatible = "samsung,exynos4210-uart";
+		reg = <0x12C10000 0x100>;
+		interrupts = <0 52 0>;
+		id = <1>;
+	};
+
+	serial at 12C20000 {
+		compatible = "samsung,exynos4210-uart";
+		reg = <0x12C20000 0x100>;
+		interrupts = <0 53 0>;
+		id = <2>;
+	};
+
+	serial at 12C30000 {
+		compatible = "samsung,exynos4210-uart";
+		reg = <0x12C30000 0x100>;
+		interrupts = <0 54 0>;
+		id = <3>;
+	};
 };
board/samsung/dts/exynos5250-smdk5250.dts +2 -0
index 93375a6..80ffe30 100644
@@ -34,6 +34,8 @@
 		mmc1 = "/mmc at 12210000";
 		mmc2 = "/mmc at 12220000";
 		mmc3 = "/mmc at 12230000";
+		serial0 = "/serial at 12C30000";
+		console = "/serial at 12C30000";
 	};
 
 	sromc at 12250000 {
board/samsung/dts/exynos5250-snow.dts +0 -0
index d167df9..fdc047a 100644

board/samsung/dts/exynos5250-snow.dts line 41

Quoted 8 lines
board/samsung/dts/exynos5250-snow.dts +2 -0
@@ -34,6 +34,8 @@
 		mmc1 = "/mmc at 12210000";
 		mmc2 = "/mmc at 12220000";
 		mmc3 = "/mmc at 12230000";
+		serial0 = "/serial at 12C30000";
+		console = "/serial at 12C30000";
 	};
 
 	sound at 12d60000 {

Thanks,
Minkyu Kang.

#6 lore raw

PATCH v6 2/4 EXYNOS5: FDT: Add serial device node values

Hi Minkyu Kang,

Thank you for comment

Quoted 29 lines · Minkyu Kang
Quoted 28 lines · Rajeshwari Shinde

This patch adds the device node required for serial driver

---
Changes in V2:
- Changed the compatible string to "samsung,exynos4210-uart"
Changes in V3:
- Added a alias console as we will support one at any point of time.
Changes in V4:
- Rebased on latest u-boot-samsung tree.
Changes in V5:
- Added device node for Snow board.
Changes in V6:
- Rebased on latest u-boot-samsung branch.

 arch/arm/dts/exynos5250.dtsi              |   28 ++++++++++++++++++++++++++++
 board/samsung/dts/exynos5250-smdk5250.dts |    2 ++
 board/samsung/dts/exynos5250-snow.dts     |    2 ++
 3 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/dts/exynos5250.dtsi +0 -0
index cee4fe8..1e14154 100644
@@ -202,4 +202,32 @@
              interrupts = <0 78 0>;
      };
 
Quoted 4 lines

arch/arm/dts/exynos5250.dtsi line 205

Quoted 1 line
arch/arm/dts/exynos5250.dtsi +1 -0
+

please remove this extra line.

Will correct this and send a new patchset.

Quoted 62 lines
Quoted 47 lines
arch/arm/dts/exynos5250.dtsi +27 -0
+     serial at 12C00000 {
+             compatible = "samsung,exynos4210-uart";
+             reg = <0x12C00000 0x100>;
+             interrupts = <0 51 0>;
+             id = <0>;
+     };
+
+     serial at 12C10000 {
+             compatible = "samsung,exynos4210-uart";
+             reg = <0x12C10000 0x100>;
+             interrupts = <0 52 0>;
+             id = <1>;
+     };
+
+     serial at 12C20000 {
+             compatible = "samsung,exynos4210-uart";
+             reg = <0x12C20000 0x100>;
+             interrupts = <0 53 0>;
+             id = <2>;
+     };
+
+     serial at 12C30000 {
+             compatible = "samsung,exynos4210-uart";
+             reg = <0x12C30000 0x100>;
+             interrupts = <0 54 0>;
+             id = <3>;
+     };
 };
board/samsung/dts/exynos5250-smdk5250.dts +2 -0
index 93375a6..80ffe30 100644
@@ -34,6 +34,8 @@
              mmc1 = "/mmc at 12210000";
              mmc2 = "/mmc at 12220000";
              mmc3 = "/mmc at 12230000";
+             serial0 = "/serial at 12C30000";
+             console = "/serial at 12C30000";
      };
 
      sromc at 12250000 {
board/samsung/dts/exynos5250-snow.dts +0 -0
index d167df9..fdc047a 100644

board/samsung/dts/exynos5250-snow.dts line 41

Quoted 8 lines
board/samsung/dts/exynos5250-snow.dts +2 -0
@@ -34,6 +34,8 @@
              mmc1 = "/mmc at 12210000";
              mmc2 = "/mmc at 12220000";
              mmc3 = "/mmc at 12230000";
+             serial0 = "/serial at 12C30000";
+             console = "/serial at 12C30000";
      };
 
      sound at 12d60000 {

Thanks,
Minkyu Kang.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 2 lines
Regards,
Rajeshwari Shinde
#7 lore raw

PATCH v6 3/4 S5P: Serial: Add fdt support to driver

In reply to Rajeshwari Shinde

This patch adds FDT support to the serial s5p driver.
At present disabling the serial console (from the device tree) crashes U-Boot. Add checks for this case, so that execution can continue without a serial console.
It also enables the serial_s5p driver recognize the silent_console option.

---
Changes in V2:
- None
Changes in V3:
- Moved driver config structure to data section.
- Changed silent_console to silent-console.
- Did put a check for base address before doing fdt decoding.
Changes in V4:
- None
Changes in V5:
- None
Changes in V6:
- Changed the if..else condition to a switch statement.

 drivers/serial/serial_s5p.c |   78 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 78 insertions(+), 0 deletions(-)
drivers/serial/serial_s5p.c +78 -0
index e65125c..6836c7a 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <fdtdec.h>
 #include <linux/compiler.h>
 #include <asm/io.h>
 #include <asm/arch/uart.h>
@@ -34,10 +35,21 @@ DECLARE_GLOBAL_DATA_PTR;
 #define RX_FIFO_FULL_MASK	(1 << 8)
 #define TX_FIFO_FULL_MASK	(1 << 24)
 
+/* Information about a serial port */
+struct fdt_serial {
+	u32 base_addr;  /* address of registers in physical memory */
+	u8 port_id;     /* uart port number */
+	u8 enabled;     /* 1 if enabled, 0 if disabled */
+} config __attribute__ ((section(".data")));
+
 static inline struct s5p_uart *s5p_get_base_uart(int dev_index)
 {
+#ifdef CONFIG_OF_CONTROL
+	return (struct s5p_uart *)(config.base_addr);
+#else
 	u32 offset = dev_index * sizeof(struct s5p_uart);
 	return (struct s5p_uart *)(samsung_get_base_uart() + offset);
+#endif
 }
 
 /*
@@ -73,6 +85,16 @@ void serial_setbrg_dev(const int dev_index)
 	u32 baudrate = gd->baudrate;
 	u32 val;
 
+#if defined(CONFIG_SILENT_CONSOLE) && \
+		defined(CONFIG_OF_CONTROL) && \
+		!defined(CONFIG_SPL_BUILD)
+	if (fdtdec_get_config_int(gd->fdt_blob, "silent_console", 0))
+		gd->flags |= GD_FLG_SILENT;
+#endif
+
+	if (!config.enabled)
+		return;
+
 	val = uclk / baudrate;
 
 	writel(val / 16 - 1, &uart->ubrdiv);
@@ -133,6 +155,9 @@ int serial_getc_dev(const int dev_index)
 {
 	struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
 
+	if (!config.enabled)
+		return 0;
+
 	/* wait for character to arrive */
 	while (!(readl(&uart->ufstat) & (RX_FIFO_COUNT_MASK |
 					 RX_FIFO_FULL_MASK))) {
@@ -150,6 +175,9 @@ void serial_putc_dev(const char c, const int dev_index)
 {
 	struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
 
+	if (!config.enabled)
+		return;
+
 	/* wait for room in the tx FIFO */
 	while ((readl(&uart->ufstat) & TX_FIFO_FULL_MASK)) {
 		if (serial_err_check(dev_index, 1))
@@ -170,6 +198,9 @@ int serial_tstc_dev(const int dev_index)
 {
 	struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
 
+	if (!config.enabled)
+		return 0;
+
 	return (int)(readl(&uart->utrstat) & 0x1);
 }
 
@@ -212,8 +243,54 @@ DECLARE_S5P_SERIAL_FUNCTIONS(3);
 struct serial_device s5p_serial3_device =
 	INIT_S5P_SERIAL_STRUCTURE(3, "s5pser3");
 
+#ifdef CONFIG_OF_CONTROL
+int fdtdec_decode_console(int *index, struct fdt_serial *uart)
+{
+	const void *blob = gd->fdt_blob;
+	int node;
+
+	node = fdt_path_offset(blob, "console");
+	if (node < 0)
+		return node;
+
+	uart->base_addr = fdtdec_get_addr(blob, node, "reg");
+	if (uart->base_addr == FDT_ADDR_T_NONE)
+		return -FDT_ERR_NOTFOUND;
+
+	uart->port_id = fdtdec_get_int(blob, node, "id", -1);
+	uart->enabled = fdtdec_get_is_enabled(blob, node);
+
+	return 0;
+}
+#endif
+
 __weak struct serial_device *default_serial_console(void)
 {
+#ifdef CONFIG_OF_CONTROL
+	int index = 0;
+
+	if ((!config.base_addr) && (fdtdec_decode_console(&index, &config))) {
+		debug("Cannot decode default console node\n");
+		return NULL;
+	}
+
+	switch (config.port_id) {
+	case 0:
+		return &s5p_serial0_device;
+	case 1:
+		return &s5p_serial1_device;
+	case 2:
+		return &s5p_serial2_device;
+	case 3:
+		return &s5p_serial3_device;
+	default:
+		debug("Unknown config.port_id: %d", config.port_id);
+		break;
+	}
+
+	return NULL;
+#else
+	config.enabled = 1;
 #if defined(CONFIG_SERIAL0)
 	return &s5p_serial0_device;
 #elif defined(CONFIG_SERIAL1)
@@ -225,6 +302,7 @@ __weak struct serial_device *default_serial_console(void)
 #else
 #error "CONFIG_SERIAL? missing."
 #endif
+#endif
 }
 
 void s5p_serial_initialize(void)
Signature · 1 line
1.7.4.4
#8 lore raw

PATCH v6 4/4 CONFIG: EXYNOS5: Enable silent console

In reply to Rajeshwari Shinde

This patch enables CONFIG_SILENT_CONSOLE for EXYNOS5. This patch also removes the hardcoding of UART port from exynos5250 config.

---
Changes in V2:
- None
Changes in V3:
- None
Changes in V4:
- None
Changes in V5:
- None
Chnages in V6:
- Removed CONFIG_SERIAL3 as it is decoded from device tree

 include/configs/exynos5250-dt.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/configs/exynos5250-dt.h +1 -1
index 9b97d4f..1c9eca2 100644
@@ -78,9 +78,9 @@
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (4 << 20))
 
 /* select serial console configuration */
-#define CONFIG_SERIAL3			/* use SERIAL 3 */
 #define CONFIG_BAUDRATE			115200
 #define EXYNOS5_DEFAULT_UART_OFFSET	0x010000
+#define CONFIG_SILENT_CONSOLE
 
 /* Console configuration */
 #define CONFIG_CONSOLE_MUX
Signature · 1 line
1.7.4.4