From 2e7eb12e5c81dedaff12b0cea2341dc681d8c726 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Tue, 17 May 2016 07:43:27 +0100 Subject: malta: Tidy up UART address selection The address of the UART differs based upon the system controller because it's actually within the I/O port region, which is in a different location for each system controller. Rather than handling this as 2 UARTs with the correct one selected at runtime, use I/O port accessors for the UART such that access to it gets translated into the I/O port region automatically. Signed-off-by: Paul Burton Reviewed-by: Daniel Schwierzeck --- include/configs/malta.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/configs/malta.h b/include/configs/malta.h index 04dca710366..1c3c83c25eb 100644 --- a/include/configs/malta.h +++ b/include/configs/malta.h @@ -67,10 +67,10 @@ #define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_PORT_MAPPED #define CONFIG_SYS_NS16550_REG_SIZE 1 #define CONFIG_SYS_NS16550_CLK (115200 * 16) -#define CONFIG_SYS_NS16550_COM1 0xb80003f8 -#define CONFIG_SYS_NS16550_COM2 0xbb0003f8 +#define CONFIG_SYS_NS16550_COM1 0x3f8 #define CONFIG_CONS_INDEX 1 /* -- cgit v1.3.1 From 6242aa137427f6da6ca47e7a8c9a9f78ad63e00d Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Tue, 17 May 2016 07:43:28 +0100 Subject: malta: Use device model & tree for UART Make use of device model & device tree to probe the UART driver. This is the initial step in bringing Malta up to date with driver model, and allows for cleaner handling of the different I/O addresses for different system controllers by specifying the ISA bus address instead of a translated memory address. Signed-off-by: Paul Burton Reviewed-by: Daniel Schwierzeck --- arch/mips/Kconfig | 4 ++++ arch/mips/dts/Makefile | 1 + arch/mips/dts/mti,malta.dts | 32 ++++++++++++++++++++++++++++++++ configs/malta_defconfig | 2 ++ configs/maltael_defconfig | 2 ++ include/configs/malta.h | 6 ------ 6 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 arch/mips/dts/mti,malta.dts (limited to 'include') diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index dc34c18258c..53363e38fe4 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -23,7 +23,11 @@ config TARGET_QEMU_MIPS config TARGET_MALTA bool "Support malta" + select DM + select DM_SERIAL select DYNAMIC_IO_PORT_BASE + select OF_CONTROL + select OF_ISA_BUS select SUPPORTS_BIG_ENDIAN select SUPPORTS_LITTLE_ENDIAN select SUPPORTS_CPU_MIPS32_R1 diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile index a94b7455507..2f04d73b83f 100644 --- a/arch/mips/dts/Makefile +++ b/arch/mips/dts/Makefile @@ -4,6 +4,7 @@ dtb-$(CONFIG_TARGET_AP121) += ap121.dtb dtb-$(CONFIG_TARGET_AP143) += ap143.dtb +dtb-$(CONFIG_TARGET_MALTA) += mti,malta.dtb dtb-$(CONFIG_TARGET_PIC32MZDASK) += pic32mzda_sk.dtb dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb diff --git a/arch/mips/dts/mti,malta.dts b/arch/mips/dts/mti,malta.dts new file mode 100644 index 00000000000..d339229c2a8 --- /dev/null +++ b/arch/mips/dts/mti,malta.dts @@ -0,0 +1,32 @@ +/dts-v1/; + +/memreserve/ 0x00000000 0x00001000; /* Exception vectors */ +/memreserve/ 0x000f0000 0x00010000; /* PIIX4 ISA memory */ + +/ { + #address-cells = <1>; + #size-cells = <1>; + compatible = "mti,malta"; + + chosen { + stdout-path = &uart0; + }; + + isa@0 { + compatible = "isa"; + #address-cells = <2>; + #size-cells = <1>; + ranges = <1 0 0 0x1000>; + + uart0: serial@3f8 { + compatible = "ns16550a"; + + reg = <1 0x3f8 0x40>; + reg-shift = <0>; + + clock-frequency = <1843200>; + + u-boot,dm-pre-reloc; + }; + }; +}; diff --git a/configs/malta_defconfig b/configs/malta_defconfig index a16f10be6a0..3c3bb165224 100644 --- a/configs/malta_defconfig +++ b/configs/malta_defconfig @@ -1,5 +1,6 @@ CONFIG_MIPS=y CONFIG_TARGET_MALTA=y +CONFIG_DEFAULT_DEVICE_TREE="mti,malta" CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="malta # " # CONFIG_CMD_LOADB is not set @@ -9,5 +10,6 @@ CONFIG_SYS_PROMPT="malta # " CONFIG_CMD_DHCP=y # CONFIG_CMD_NFS is not set CONFIG_CMD_PING=y +CONFIG_OF_EMBED=y CONFIG_SYS_NS16550=y CONFIG_USE_PRIVATE_LIBGCC=y diff --git a/configs/maltael_defconfig b/configs/maltael_defconfig index 52897977487..b245d915ef7 100644 --- a/configs/maltael_defconfig +++ b/configs/maltael_defconfig @@ -1,6 +1,7 @@ CONFIG_MIPS=y CONFIG_TARGET_MALTA=y CONFIG_SYS_LITTLE_ENDIAN=y +CONFIG_DEFAULT_DEVICE_TREE="mti,malta" CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="maltael # " # CONFIG_CMD_LOADB is not set @@ -10,5 +11,6 @@ CONFIG_SYS_PROMPT="maltael # " CONFIG_CMD_DHCP=y # CONFIG_CMD_NFS is not set CONFIG_CMD_PING=y +CONFIG_OF_EMBED=y CONFIG_SYS_NS16550=y CONFIG_USE_PRIVATE_LIBGCC=y diff --git a/include/configs/malta.h b/include/configs/malta.h index 1c3c83c25eb..e03935b5732 100644 --- a/include/configs/malta.h +++ b/include/configs/malta.h @@ -65,13 +65,7 @@ * Serial driver */ #define CONFIG_BAUDRATE 115200 - -#define CONFIG_SYS_NS16550_SERIAL #define CONFIG_SYS_NS16550_PORT_MAPPED -#define CONFIG_SYS_NS16550_REG_SIZE 1 -#define CONFIG_SYS_NS16550_CLK (115200 * 16) -#define CONFIG_SYS_NS16550_COM1 0x3f8 -#define CONFIG_CONS_INDEX 1 /* * Flash configuration -- cgit v1.3.1 From ec35e12331512cf5ed0f22005d7b6fb4ccc35969 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Tue, 17 May 2016 11:56:39 +0100 Subject: MIPS: Move CONFIG_SYS_TEXT_BASE to Kconfig Move CONFIG_SYS_TEXT_BASE to Kconfig, and add default values in board Kconfig files matching what was present in their config headers. This will make it cleaner to conditionalise the value for Malta based on 32 vs 64 bit builds. Signed-off-by: Paul Burton --- Kconfig | 2 +- board/dbau1x00/Kconfig | 3 +++ board/imgtec/malta/Kconfig | 3 +++ board/microchip/pic32mzda/Kconfig | 3 +++ board/micronas/vct/Kconfig | 3 +++ board/pb1x00/Kconfig | 3 +++ board/qca/ap121/Kconfig | 3 +++ board/qca/ap143/Kconfig | 3 +++ board/qemu-mips/Kconfig | 4 ++++ board/tplink/wdr4300/Kconfig | 3 +++ include/configs/ap121.h | 2 -- include/configs/ap143.h | 2 -- include/configs/dbau1x00.h | 6 ------ include/configs/malta.h | 1 - include/configs/pb1x00.h | 6 ------ include/configs/pic32mzdask.h | 1 - include/configs/qemu-mips.h | 1 - include/configs/qemu-mips64.h | 1 - include/configs/tplink_wdr4300.h | 2 -- include/configs/vct.h | 1 - 20 files changed, 29 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/Kconfig b/Kconfig index f53759a48e1..4b462166656 100644 --- a/Kconfig +++ b/Kconfig @@ -268,7 +268,7 @@ config SYS_EXTRA_OPTIONS config SYS_TEXT_BASE depends on SPARC || ARC || X86 || ARCH_UNIPHIER || ARCH_ZYNQMP || \ - (M68K && !TARGET_ASTRO_MCF5373L) || MICROBLAZE + (M68K && !TARGET_ASTRO_MCF5373L) || MICROBLAZE || MIPS depends on !EFI_APP hex "Text Base" help diff --git a/board/dbau1x00/Kconfig b/board/dbau1x00/Kconfig index b813adb840d..342ec59cb73 100644 --- a/board/dbau1x00/Kconfig +++ b/board/dbau1x00/Kconfig @@ -9,6 +9,9 @@ config SYS_SOC config SYS_CONFIG_NAME default "dbau1x00" +config SYS_TEXT_BASE + default 0xbfc00000 + menu "dbau1x00 board options" choice diff --git a/board/imgtec/malta/Kconfig b/board/imgtec/malta/Kconfig index 4c06d0c0d80..2bb8e8be16e 100644 --- a/board/imgtec/malta/Kconfig +++ b/board/imgtec/malta/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "malta" +config SYS_TEXT_BASE + default 0xbe000000 + endif diff --git a/board/microchip/pic32mzda/Kconfig b/board/microchip/pic32mzda/Kconfig index 8acb3933698..4f08e98b97a 100644 --- a/board/microchip/pic32mzda/Kconfig +++ b/board/microchip/pic32mzda/Kconfig @@ -10,4 +10,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "pic32mzdask" +config SYS_TEXT_BASE + default 0x9d004000 + endif diff --git a/board/micronas/vct/Kconfig b/board/micronas/vct/Kconfig index c518079efac..535a77b2a32 100644 --- a/board/micronas/vct/Kconfig +++ b/board/micronas/vct/Kconfig @@ -9,6 +9,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "vct" +config SYS_TEXT_BASE + default 0x87000000 + menu "vct board options" choice diff --git a/board/pb1x00/Kconfig b/board/pb1x00/Kconfig index 251db6ab637..236a4108bfc 100644 --- a/board/pb1x00/Kconfig +++ b/board/pb1x00/Kconfig @@ -9,4 +9,7 @@ config SYS_SOC config SYS_CONFIG_NAME default "pb1x00" +config SYS_TEXT_BASE + default 0x83800000 + endif diff --git a/board/qca/ap121/Kconfig b/board/qca/ap121/Kconfig index f7e768ad586..c3ecc8f62ff 100644 --- a/board/qca/ap121/Kconfig +++ b/board/qca/ap121/Kconfig @@ -9,4 +9,7 @@ config SYS_BOARD config SYS_CONFIG_NAME default "ap121" +config SYS_TEXT_BASE + default 0x9f000000 + endif diff --git a/board/qca/ap143/Kconfig b/board/qca/ap143/Kconfig index 4cdac0d06d0..5ea5d6fbb02 100644 --- a/board/qca/ap143/Kconfig +++ b/board/qca/ap143/Kconfig @@ -9,4 +9,7 @@ config SYS_BOARD config SYS_CONFIG_NAME default "ap143" +config SYS_TEXT_BASE + default 0x9f000000 + endif diff --git a/board/qemu-mips/Kconfig b/board/qemu-mips/Kconfig index 18d78b51008..3de1f44a3da 100644 --- a/board/qemu-mips/Kconfig +++ b/board/qemu-mips/Kconfig @@ -7,4 +7,8 @@ config SYS_CONFIG_NAME default "qemu-mips" if 32BIT default "qemu-mips64" if 64BIT +config SYS_TEXT_BASE + default 0xbfc00000 if 32BIT + default 0xffffffffbfc00000 if 64BIT + endif diff --git a/board/tplink/wdr4300/Kconfig b/board/tplink/wdr4300/Kconfig index 902abf560d1..65785bdb9c7 100644 --- a/board/tplink/wdr4300/Kconfig +++ b/board/tplink/wdr4300/Kconfig @@ -12,4 +12,7 @@ config SYS_BOARD config SYS_CONFIG_NAME default "tplink_wdr4300" +config SYS_TEXT_BASE + default 0xa1000000 + endif diff --git a/include/configs/ap121.h b/include/configs/ap121.h index 2beffa4805b..6f69f31503c 100644 --- a/include/configs/ap121.h +++ b/include/configs/ap121.h @@ -7,8 +7,6 @@ #ifndef __CONFIG_H #define __CONFIG_H -#define CONFIG_SYS_TEXT_BASE 0x9f000000 - #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO #define CONFIG_BOARD_EARLY_INIT_F diff --git a/include/configs/ap143.h b/include/configs/ap143.h index 7b69e10be44..f907c02af92 100644 --- a/include/configs/ap143.h +++ b/include/configs/ap143.h @@ -7,8 +7,6 @@ #ifndef __CONFIG_H #define __CONFIG_H -#define CONFIG_SYS_TEXT_BASE 0x9f000000 - #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO #define CONFIG_BOARD_EARLY_INIT_F diff --git a/include/configs/dbau1x00.h b/include/configs/dbau1x00.h index eb0a87cd592..68d9e36b19c 100644 --- a/include/configs/dbau1x00.h +++ b/include/configs/dbau1x00.h @@ -139,12 +139,6 @@ #define CONFIG_SYS_FLASH_CFI 1 #define CONFIG_FLASH_CFI_DRIVER 1 -/* The following #defines are needed to get flash environment right */ -/* ROM version */ -#define CONFIG_SYS_TEXT_BASE 0xbfc00000 -/* RAM version */ -/* #define CONFIG_SYS_TEXT_BASE 0x80100000 */ - #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_MONITOR_LEN (192 << 10) diff --git a/include/configs/malta.h b/include/configs/malta.h index e03935b5732..a36967848c5 100644 --- a/include/configs/malta.h +++ b/include/configs/malta.h @@ -37,7 +37,6 @@ /* * Memory map */ -#define CONFIG_SYS_TEXT_BASE 0xbe000000 /* Rom version */ #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_SDRAM_BASE 0x80000000 /* Cached addr */ diff --git a/include/configs/pb1x00.h b/include/configs/pb1x00.h index caf75a6b262..869768add05 100644 --- a/include/configs/pb1x00.h +++ b/include/configs/pb1x00.h @@ -80,12 +80,6 @@ #define PHYS_FLASH_1 0xbec00000 /* Flash Bank #1 */ #define PHYS_FLASH_2 0xbfc00000 /* Flash Bank #2 */ -/* The following #defines are needed to get flash environment right */ -/* ROM version */ -/* #define CONFIG_SYS_TEXT_BASE 0xbfc00000 */ -/* SDRAM version */ -#define CONFIG_SYS_TEXT_BASE 0x83800000 - #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_MONITOR_LEN (192 << 10) diff --git a/include/configs/pic32mzdask.h b/include/configs/pic32mzdask.h index 108c6a2d62f..fb2e41fd92e 100644 --- a/include/configs/pic32mzdask.h +++ b/include/configs/pic32mzdask.h @@ -10,7 +10,6 @@ #define __PIC32MZDASK_CONFIG_H /* System Configuration */ -#define CONFIG_SYS_TEXT_BASE 0x9d004000 /* .text */ #define CONFIG_DISPLAY_BOARDINFO /*-------------------------------------------- diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index 702967c4e8e..246ee0173a7 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h @@ -107,7 +107,6 @@ * FLASH and environment organization */ /* The following #defines are needed to get flash environment right */ -#define CONFIG_SYS_TEXT_BASE 0xbfc00000 /* Rom version */ #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_MONITOR_LEN (192 << 10) diff --git a/include/configs/qemu-mips64.h b/include/configs/qemu-mips64.h index 239454984ae..60a3a71fbdc 100644 --- a/include/configs/qemu-mips64.h +++ b/include/configs/qemu-mips64.h @@ -107,7 +107,6 @@ * FLASH and environment organization */ /* The following #defines are needed to get flash environment right */ -#define CONFIG_SYS_TEXT_BASE 0xffffffffbfc00000 /* Rom version */ #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_MONITOR_LEN (192 << 10) diff --git a/include/configs/tplink_wdr4300.h b/include/configs/tplink_wdr4300.h index 2b9e92ed2b1..09a69fec09d 100644 --- a/include/configs/tplink_wdr4300.h +++ b/include/configs/tplink_wdr4300.h @@ -7,8 +7,6 @@ #ifndef __CONFIG_H #define __CONFIG_H -#define CONFIG_SYS_TEXT_BASE 0xa1000000 - #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO #define CONFIG_BOARD_EARLY_INIT_F diff --git a/include/configs/vct.h b/include/configs/vct.h index 6489e08173c..68eb0893948 100644 --- a/include/configs/vct.h +++ b/include/configs/vct.h @@ -32,7 +32,6 @@ #define CONFIG_SKIP_LOWLEVEL_INIT /* SDRAM is initialized by the bootstrap code */ -#define CONFIG_SYS_TEXT_BASE 0x87000000 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_MONITOR_LEN (256 << 10) #define CONFIG_SYS_MALLOC_LEN (1 << 20) -- cgit v1.3.1