diff mbox series

[v2,18/38] ppc: qemu: Switch over to use DM serial

Message ID 1613663886-83811-19-git-send-email-bmeng.cn@gmail.com
State Superseded
Delegated to: Priyanka Jain
Headers show
Series ppc: qemu: Convert qemu-ppce500 to driver model and enable additional driver support | expand

Commit Message

Bin Meng Feb. 18, 2021, 3:57 p.m. UTC
The QEMU ppce500 target integrates 2 NS16550 serial ports. Switch
over to use the DM version of the driver by:

- drop unnecessary ad-hoc config macros
- add get_serial_clock() in the board codes

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 board/freescale/qemu-ppce500/qemu-ppce500.c |  6 ++++++
 configs/qemu-ppce500_defconfig              |  1 +
 include/configs/qemu-ppce500.h              | 10 ----------
 3 files changed, 7 insertions(+), 10 deletions(-)

Comments

Priyanka Jain Feb. 22, 2021, 9:05 a.m. UTC | #1
>-----Original Message-----
>From: Bin Meng <bmeng.cn@gmail.com>
>Sent: Thursday, February 18, 2021 9:28 PM
>To: Simon Glass <sjg@chromium.org>; Alexander Graf <agraf@csgraf.de>;
>Priyanka Jain <priyanka.jain@nxp.com>
>Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Tom Rini
><trini@konsulko.com>
>Subject: [PATCH v2 18/38] ppc: qemu: Switch over to use DM serial
>
>The QEMU ppce500 target integrates 2 NS16550 serial ports. Switch over to
>use the DM version of the driver by:
>
>- drop unnecessary ad-hoc config macros
>- add get_serial_clock() in the board codes
>
>Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>Reviewed-by: Simon Glass <sjg@chromium.org>
>---
>
>(no changes since v1)
>
> board/freescale/qemu-ppce500/qemu-ppce500.c |  6 ++++++
> configs/qemu-ppce500_defconfig              |  1 +
> include/configs/qemu-ppce500.h              | 10 ----------
> 3 files changed, 7 insertions(+), 10 deletions(-)
>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
diff mbox series

Patch

diff --git a/board/freescale/qemu-ppce500/qemu-ppce500.c b/board/freescale/qemu-ppce500/qemu-ppce500.c
index 50167d5..db13582 100644
--- a/board/freescale/qemu-ppce500/qemu-ppce500.c
+++ b/board/freescale/qemu-ppce500/qemu-ppce500.c
@@ -374,3 +374,9 @@  void *board_fdt_blob_setup(void)
 {
 	return get_fdt_virt();
 }
+
+/* See CONFIG_SYS_NS16550_CLK in arch/powerpc/include/asm/config.h */
+int get_serial_clock(void)
+{
+	return get_bus_freq(0);
+}
diff --git a/configs/qemu-ppce500_defconfig b/configs/qemu-ppce500_defconfig
index f2a8b83..c528a68 100644
--- a/configs/qemu-ppce500_defconfig
+++ b/configs/qemu-ppce500_defconfig
@@ -30,6 +30,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_E1000=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_ADDR_MAP=y
 CONFIG_PANIC_HANG=y
diff --git a/include/configs/qemu-ppce500.h b/include/configs/qemu-ppce500.h
index f13e4ea..feac6ef 100644
--- a/include/configs/qemu-ppce500.h
+++ b/include/configs/qemu-ppce500.h
@@ -73,16 +73,6 @@  extern unsigned long long get_phys_ccsrbar_addr_early(void);
 #define CONFIG_SYS_MONITOR_LEN		(512 * 1024)
 #define CONFIG_SYS_MALLOC_LEN		(4 * 1024 * 1024)
 
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE	1
-#define CONFIG_SYS_NS16550_CLK		(get_bus_freq(0))
-
-#define CONFIG_SYS_BAUDRATE_TABLE	\
-	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
-
-#define CONFIG_SYS_NS16550_COM1	(CONFIG_SYS_CCSRBAR+0x4500)
-#define CONFIG_SYS_NS16550_COM2	(CONFIG_SYS_CCSRBAR+0x4600)
-
 /*
  * General PCI
  * Memory space is mapped 1-1, but I/O space must start from 0.