ARM: rework amlogic configuration
authorJerome Brunet <jbrunet@baylibre.com>
Thu, 25 Oct 2018 14:41:37 +0000 (16:41 +0200)
committerNeil Armstrong <narmstrong@baylibre.com>
Mon, 26 Nov 2018 13:40:52 +0000 (14:40 +0100)
Rework the board SYS_BOARD, SYS_VENDOR and SYS_CONFIG_NAME setup by moving
the board Kconfig into the mach-meson Kconfig to make it easier to add
new boards for a SoC architecture and add a custom config header or custom
board handler for a platform.

This drops the board CONFIGs and the duplicate boards configs headers in
favor of a single meson64.h config header.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
18 files changed:
arch/arm/mach-meson/Kconfig
board/amlogic/odroid-c2/Kconfig [deleted file]
board/amlogic/p212/Kconfig [deleted file]
board/amlogic/q200/Kconfig [deleted file]
configs/khadas-vim2_defconfig
configs/khadas-vim_defconfig
configs/libretech-cc_defconfig
configs/nanopi-k2_defconfig
configs/odroid-c2_defconfig
configs/p212_defconfig
include/configs/khadas-vim.h [deleted file]
include/configs/libretech-cc.h [deleted file]
include/configs/meson-gx-common.h [deleted file]
include/configs/meson64.h [new file with mode: 0644]
include/configs/nanopi-k2.h [deleted file]
include/configs/odroid-c2.h [deleted file]
include/configs/p212.h [deleted file]
include/configs/q200.h [deleted file]

index d86b1bed78186f3c45e4d0c9be7dff7c3a08bcb2..6f60167c8cfb775d85673de85dc85e5a4698c7b7 100644 (file)
@@ -8,49 +8,27 @@ config MESON64_COMMON
        select DM_SERIAL
        imply CMD_DM
 
+choice
+       prompt "Platform select"
+       default MESON_GXBB
+
 config MESON_GXBB
-       bool
+       bool "GXBB"
        select MESON64_COMMON
+       help
+         Select this if your SoC is an S905
 
 config MESON_GXL
-       bool
+       bool "GXL"
        select MESON64_COMMON
+       help
+         Select this if your SoC is an S905X/D or S805X
 
 config MESON_GXM
-       bool
+       bool "GXM"
        select MESON64_COMMON
-
-choice
-       prompt "Platform select"
-       default TARGET_ODROID_C2
-
-config TARGET_ODROID_C2
-       bool "ODROID-C2"
-       select MESON_GXBB
        help
-         ODROID-C2 is a single board computer based on Meson GXBaby
-         with 2 GiB of RAM, Gigabit Ethernet, HDMI, 4 USB, micro-SD
-         slot, eMMC, IR receiver and a 40-pin GPIO header.
-         You should also select this TARGET if you have an nanopi-k2
-
-config TARGET_P212
-       bool "P212"
-       select MESON_GXL
-       help
-         P212 is a reference dessign board based on Meson GXL S905X SoC
-         with 2 GiB of RAM, Ethernet, HDMI, 2 USB, micro-SD slot,
-         eMMC, IR receiver, CVBS+Audio jack and a SDIO WiFi module.
-         You should also select this TARGET if you have Khadas Vim or
-         a libretech aml-s905x-cc
-
-config TARGET_Q200
-       bool "KHADAS-VIM2"
-       select MESON_GXM
-       help
-         Q200 is a reference dessign board based on Meson GXM
-         with 2/3 GiB of RAM, Ethernet, HDMI, 4 USB, micro-SD slot,
-         eMMC, IR receiver.
-         You should also select this TARGET if you have Khadas Vim2.
+         Select this if your SoC is an S912
 
 endchoice
 
@@ -60,10 +38,31 @@ config SYS_SOC
 config SYS_MALLOC_F_LEN
        default 0x1000
 
-source "board/amlogic/odroid-c2/Kconfig"
+config SYS_VENDOR
+       string "Vendor name"
+       default "amlogic"
+       help
+         This option contains information about board name.
+         Based on this option board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD> will
+         be used.
 
-source "board/amlogic/p212/Kconfig"
+config SYS_BOARD
+       string "Board name"
+       default "odroid-c2" if MESON_GXBB
+       default "p212" if MESON_GXL
+       default "q200" if MESON_GXM
+       default ""
+       help
+         This option contains information about board name.
+         Based on this option board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD> will
+         be used.
 
-source "board/amlogic/q200/Kconfig"
+config SYS_CONFIG_NAME
+       string "Board configuration name"
+       default "meson64"
+       help
+         This option contains information about board configuration name.
+         Based on this option include/configs/<CONFIG_SYS_CONFIG_NAME>.h header
+         will be used for board configuration.
 
 endif
diff --git a/board/amlogic/odroid-c2/Kconfig b/board/amlogic/odroid-c2/Kconfig
deleted file mode 100644 (file)
index 2b16889..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_ODROID_C2
-
-config SYS_BOARD
-       default "odroid-c2"
-
-config SYS_VENDOR
-       default "amlogic"
-
-config SYS_CONFIG_NAME
-       default "odroid-c2"
-
-endif
diff --git a/board/amlogic/p212/Kconfig b/board/amlogic/p212/Kconfig
deleted file mode 100644 (file)
index 720c92b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_P212
-
-config SYS_BOARD
-       default "p212"
-
-config SYS_VENDOR
-       default "amlogic"
-
-config SYS_CONFIG_NAME
-       default "p212"
-
-endif
diff --git a/board/amlogic/q200/Kconfig b/board/amlogic/q200/Kconfig
deleted file mode 100644 (file)
index cfaf379..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_Q200
-
-config SYS_BOARD
-       default "q200"
-
-config SYS_VENDOR
-       default "amlogic"
-
-config SYS_CONFIG_NAME
-       default "q200"
-
-endif
index 49b8104960d1c2d878b2c1481d88337a62db17d6..6fe861c0e5336d2b3cc9add2589be60e40ad928f 100644 (file)
@@ -2,7 +2,6 @@ CONFIG_ARM=y
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
 CONFIG_MESON_GXM=y
-CONFIG_TARGET_Q200=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" khadas-vim2"
index af30113760ccf2e310348dc2766635af43ef5a5d..6e855dd6eb6237ee25f518e53052d63e48edc677 100644 (file)
@@ -2,7 +2,6 @@ CONFIG_ARM=y
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
 CONFIG_MESON_GXL=y
-CONFIG_TARGET_P212=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" khadas-vim"
index 75265160607dccbe56f4cb274f4ee53d4673a60a..c2f985fcfbbb7c536f07cca7b0ac3da708012d73 100644 (file)
@@ -2,7 +2,6 @@ CONFIG_ARM=y
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
 CONFIG_MESON_GXL=y
-CONFIG_TARGET_P212=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" libretech-cc"
index 01196d6655a5d2fbaa341ce2ccf3d0363a8e948f..8bbf48f41f7dd922fbe0c410a75be5b7c2c0fabb 100644 (file)
@@ -1,8 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
-CONFIG_MESON_GXBB=y
-CONFIG_TARGET_ODROID_C2=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" nanopi-k2"
index 19196b35852a24fc62effe95585d885074a18301..68554ba74533df5984a5034ef2c4f82c06ce0c3b 100644 (file)
@@ -2,7 +2,6 @@ CONFIG_ARM=y
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
 CONFIG_MESON_GXBB=y
-CONFIG_TARGET_ODROID_C2=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" odroid-c2"
index 9e3b1d6bfb836820e22934a61c137d1ded28e531..a15064da81f52f641f084cbd7f1836e9f4ca9feb 100644 (file)
@@ -2,7 +2,6 @@ CONFIG_ARM=y
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
 CONFIG_MESON_GXL=y
-CONFIG_TARGET_P212=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" p212"
diff --git a/include/configs/khadas-vim.h b/include/configs/khadas-vim.h
deleted file mode 100644 (file)
index ff87c02..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Configuration for Khadas VIM
- *
- * Copyright (C) 2017 Baylibre, SAS
- * Author: Neil Armstrong <narmstrong@baylibre.com>
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/meson-gx-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/libretech-cc.h b/include/configs/libretech-cc.h
deleted file mode 100644 (file)
index 95e0f34..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Configuration for LibreTech CC
- *
- * Copyright (C) 2017 Baylibre, SAS
- * Author: Neil Armstrong <narmstrong@baylibre.com>
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/meson-gx-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/meson-gx-common.h b/include/configs/meson-gx-common.h
deleted file mode 100644 (file)
index c436976..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Configuration for Amlogic Meson GX SoCs
- * (C) Copyright 2016 Beniamino Galvani <b.galvani@gmail.com>
- */
-
-#ifndef __MESON_GX_COMMON_CONFIG_H
-#define __MESON_GX_COMMON_CONFIG_H
-
-#define CONFIG_CPU_ARMV8
-#define CONFIG_REMAKE_ELF
-#define CONFIG_ENV_SIZE                        0x2000
-#define CONFIG_SYS_MAXARGS             32
-#define CONFIG_SYS_MALLOC_LEN          (32 << 20)
-#define CONFIG_SYS_CBSIZE              1024
-
-#define CONFIG_SYS_SDRAM_BASE          0
-#define CONFIG_SYS_INIT_SP_ADDR                0x20000000
-#define CONFIG_SYS_LOAD_ADDR           CONFIG_SYS_TEXT_BASE
-
-/* Generic Interrupt Controller Definitions */
-#define GICD_BASE                      0xc4301000
-#define GICC_BASE                      0xc4302000
-
-#ifdef CONFIG_CMD_USB
-#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
-#else
-#define BOOT_TARGET_DEVICES_USB(func)
-#endif
-
-#define BOOT_TARGET_DEVICES(func) \
-       func(MMC, mmc, 0) \
-       func(MMC, mmc, 1) \
-       func(MMC, mmc, 2) \
-       BOOT_TARGET_DEVICES_USB(func) \
-       func(PXE, pxe, na) \
-       func(DHCP, dhcp, na)
-
-#include <config_distro_bootcmd.h>
-
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       "fdt_addr_r=0x01000000\0" \
-       "scriptaddr=0x1f000000\0" \
-       "kernel_addr_r=0x01080000\0" \
-       "pxefile_addr_r=0x01080000\0" \
-       "ramdisk_addr_r=0x13000000\0" \
-       "fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
-       BOOTENV
-
-#define CONFIG_SYS_BOOTM_LEN    (64 << 20)      /* 64 MiB */
-
-#endif /* __MESON_GX_COMMON_CONFIG_H */
diff --git a/include/configs/meson64.h b/include/configs/meson64.h
new file mode 100644 (file)
index 0000000..1929a3e
--- /dev/null
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Configuration for Amlogic Meson 64bits SoCs
+ * (C) Copyright 2016 Beniamino Galvani <b.galvani@gmail.com>
+ */
+
+#ifndef __MESON64_CONFIG_H
+#define __MESON64_CONFIG_H
+
+/* Generic Interrupt Controller Definitions */
+#define GICD_BASE                      0xc4301000
+#define GICC_BASE                      0xc4302000
+
+#define CONFIG_CPU_ARMV8
+#define CONFIG_REMAKE_ELF
+#define CONFIG_ENV_SIZE                        0x2000
+#define CONFIG_SYS_MAXARGS             32
+#define CONFIG_SYS_MALLOC_LEN          (32 << 20)
+#define CONFIG_SYS_CBSIZE              1024
+
+#define CONFIG_SYS_SDRAM_BASE          0
+#define CONFIG_SYS_INIT_SP_ADDR                0x20000000
+#define CONFIG_SYS_LOAD_ADDR           CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_BOOTM_LEN           (64 << 20) /* 64 MiB */
+
+#ifdef CONFIG_CMD_USB
+#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
+#else
+#define BOOT_TARGET_DEVICES_USB(func)
+#endif
+
+#ifndef BOOT_TARGET_DEVICES
+#define BOOT_TARGET_DEVICES(func) \
+       func(MMC, mmc, 0) \
+       func(MMC, mmc, 1) \
+       func(MMC, mmc, 2) \
+       BOOT_TARGET_DEVICES_USB(func) \
+       func(PXE, pxe, na) \
+       func(DHCP, dhcp, na)
+#endif
+
+#ifndef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "fdt_addr_r=0x01000000\0" \
+       "scriptaddr=0x1f000000\0" \
+       "kernel_addr_r=0x01080000\0" \
+       "pxefile_addr_r=0x01080000\0" \
+       "ramdisk_addr_r=0x13000000\0" \
+       "fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
+       BOOTENV
+#endif
+
+#include <config_distro_bootcmd.h>
+
+#endif /* __MESON64_CONFIG_H */
diff --git a/include/configs/nanopi-k2.h b/include/configs/nanopi-k2.h
deleted file mode 100644 (file)
index 3fd6e8f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Configuration for NANOPI-K2
- * (C) Copyright 2018 Thomas McKahan
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/meson-gx-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/odroid-c2.h b/include/configs/odroid-c2.h
deleted file mode 100644 (file)
index 87e3ddb..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Configuration for ODROID-C2
- * (C) Copyright 2016 Beniamino Galvani <b.galvani@gmail.com>
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/meson-gx-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/p212.h b/include/configs/p212.h
deleted file mode 100644 (file)
index 4414293..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Configuration for Amlogic P212
- *
- * Copyright (C) 2017 Baylibre, SAS
- * Author: Neil Armstrong <narmstrong@baylibre.com>
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/meson-gx-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/q200.h b/include/configs/q200.h
deleted file mode 100644 (file)
index 7ef8f42..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Configuration for Khadas VIM2
- *
- * Copyright (C) 2017 Baylibre, SAS
- * Author: Neil Armstrong <narmstrong@baylibre.com>
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#define CONFIG_MISC_INIT_R
-
-#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxm-khadas-vim2.dtb\0"
-
-#include <configs/meson-gx-common.h>
-
-#endif /* __CONFIG_H */