Amlogic Meson cleanup for AXG SoC support
Subsystems (8)
v2 cover Amlogic Meson cleanup for AXG SoC support
This patchset will refactor the Amlogic Meson SoC support in order to easily add support for the Amlogic AXg SoC family, and later the G12x SoCs.
In order :
- Cleanup the mach-meson configs
- Move board support to reference design common boards
- Move board Kconfig into mach-meson
- Add AXG pinctrl & clock support
- Add AXG device tree and mach-meson support
- Add support for S400 reference design
- Do a final factorization of the code
- Add USB boot support in U-boot
At the end of the patches, the board code is lighter and we maintain only the reference designs, where each board will differ in the defconfig.
It will be simpler to add custom board support for future boards with more changes against the reference designs.
The complete AXG support depends on the :
- mmc: meson-gx: Add AXG compatible
- net: designware: add meson meson axg compatible
patches submitted to the U-Boot mailing list.
Changes since v1:
- Fixed AXG pinctrl request and AO pin count
- Fixed tabs/spaces issues on s400 README
Jerome Brunet (12):
ARM: meson: clean-up platform selection
configs: meson: remove unnecessary MESON_FDTFILE_SETTING
board: amlogic: remove p212 derivatives
board: amlogic: factorise gxbb boards
ARM: rework amlogic configuration
configs: meson: change default load addresses
pinctrl: meson: rework gx pmx function
pinctrl: meson: select generic pinctrl
pinctrl: meson: add axg support
clk: meson: silence debug print
ARM: meson: rework soc arch file to prepare for new SoC
ARM: meson: factorize common code out amlogic's boards
Neil Armstrong (7):
board: amlogic: move khadas-vim2 as q200 ref board
clk: meson: add static to meson_gates table
ARM: meson: Add support for AXG family
ARM: dts: Sync Amlogic Meson AXG DT from Linux 4.20-rc1
clk: Add clock driver for AXG
board: amlogic: add support for S400 board
ARM: meson: Add boot device discovery
arch/arm/dts/Makefile | 3 +-
arch/arm/dts/meson-axg-s400.dts | 554 ++++++
arch/arm/dts/meson-axg.dtsi | 1589 +++++++++++++++++
arch/arm/include/asm/arch-meson/axg.h | 52 +
arch/arm/include/asm/arch-meson/boot.h | 20 +
arch/arm/include/asm/arch-meson/clock-axg.h | 104 ++
.../asm/arch-meson/{clock.h => clock-gx.h} | 4 +-
arch/arm/include/asm/arch-meson/eth.h | 6 +-
arch/arm/include/asm/arch-meson/gx.h | 1 +
arch/arm/include/asm/arch-meson/mem.h | 3 +-
arch/arm/mach-meson/Kconfig | 132 +-
arch/arm/mach-meson/Makefile | 4 +-
arch/arm/mach-meson/board-axg.c | 118 ++
arch/arm/mach-meson/board-common.c | 117 ++
arch/arm/mach-meson/{board.c => board-gx.c} | 106 +-
arch/arm/mach-meson/eth.c | 53 -
arch/arm/mach-meson/sm.c | 1 -
board/amlogic/khadas-vim/Kconfig | 12 -
board/amlogic/khadas-vim/MAINTAINERS | 6 -
board/amlogic/khadas-vim/khadas-vim.c | 57 -
board/amlogic/khadas-vim2/Kconfig | 12 -
board/amlogic/libretech-cc/Kconfig | 12 -
board/amlogic/libretech-cc/MAINTAINERS | 6 -
board/amlogic/libretech-cc/Makefile | 6 -
board/amlogic/libretech-cc/libretech-cc.c | 57 -
board/amlogic/nanopi-k2/Kconfig | 12 -
board/amlogic/nanopi-k2/MAINTAINERS | 6 -
board/amlogic/nanopi-k2/Makefile | 7 -
board/amlogic/nanopi-k2/nanopi-k2.c | 55 -
board/amlogic/odroid-c2/Kconfig | 12 -
board/amlogic/odroid-c2/MAINTAINERS | 1 +
.../README => odroid-c2/README.nanopi-k2} | 0
.../odroid-c2/{README => README.odroid-c2} | 0
board/amlogic/odroid-c2/odroid-c2.c | 16 +-
board/amlogic/p212/Kconfig | 12 -
.../README => p212/README.khadas-vim} | 0
.../README => p212/README.libretech-cc} | 0
board/amlogic/p212/{README => README.p212} | 0
board/amlogic/p212/p212.c | 16 +-
.../amlogic/{khadas-vim2 => q200}/MAINTAINERS | 6 +-
board/amlogic/{khadas-vim => q200}/Makefile | 2 +-
.../README => q200/README.khadas-vim2} | 0
board/amlogic/q200/README.q200 | 102 ++
.../khadas-vim2.c => q200/q200.c} | 14 +-
board/amlogic/s400/MAINTAINERS | 6 +
board/amlogic/{khadas-vim2 => s400}/Makefile | 2 +-
board/amlogic/s400/README | 110 ++
board/amlogic/s400/s400.c | 21 +
configs/khadas-vim2_defconfig | 1 -
configs/khadas-vim_defconfig | 1 -
configs/libretech-cc_defconfig | 1 -
configs/nanopi-k2_defconfig | 2 -
configs/odroid-c2_defconfig | 1 -
configs/p212_defconfig | 1 -
configs/s400_defconfig | 38 +
drivers/clk/Makefile | 2 +-
drivers/clk/clk_meson.c | 6 +-
drivers/clk/clk_meson_axg.c | 316 ++++
drivers/pinctrl/meson/Kconfig | 18 +-
drivers/pinctrl/meson/Makefile | 3 +
drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c | 125 ++
drivers/pinctrl/meson/pinctrl-meson-axg.c | 979 ++++++++++
drivers/pinctrl/meson/pinctrl-meson-axg.h | 66 +
drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c | 97 +
drivers/pinctrl/meson/pinctrl-meson-gx.h | 48 +
drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 6 +-
drivers/pinctrl/meson/pinctrl-meson-gxl.c | 6 +-
drivers/pinctrl/meson/pinctrl-meson.c | 109 +-
drivers/pinctrl/meson/pinctrl-meson.h | 37 +-
include/configs/khadas-vim.h | 16 -
include/configs/khadas-vim2.h | 18 -
include/configs/libretech-cc.h | 16 -
.../configs/{meson-gx-common.h => meson64.h} | 49 +-
include/configs/nanopi-k2.h | 16 -
include/configs/odroid-c2.h | 16 -
include/configs/p212.h | 18 -
include/dt-bindings/clock/axg-aoclkc.h | 26 +
include/dt-bindings/clock/axg-audio-clkc.h | 94 +
include/dt-bindings/clock/axg-clkc.h | 76 +
include/dt-bindings/gpio/meson-axg-gpio.h | 116 ++
.../reset/amlogic,meson-axg-audio-arb.h | 17 +
.../reset/amlogic,meson-axg-reset.h | 124 ++
include/dt-bindings/reset/axg-aoclkc.h | 20 +
83 files changed, 5166 insertions(+), 754 deletions(-)
create mode 100644 arch/arm/dts/meson-axg-s400.dts
create mode 100644 arch/arm/dts/meson-axg.dtsi
create mode 100644 arch/arm/include/asm/arch-meson/axg.h
create mode 100644 arch/arm/include/asm/arch-meson/boot.h
create mode 100644 arch/arm/include/asm/arch-meson/clock-axg.h
rename arch/arm/include/asm/arch-meson/{clock.h => clock-gx.h} (98%)
create mode 100644 arch/arm/mach-meson/board-axg.c
create mode 100644 arch/arm/mach-meson/board-common.c
rename arch/arm/mach-meson/{board.c => board-gx.c} (59%)
delete mode 100644 arch/arm/mach-meson/eth.c
delete mode 100644 board/amlogic/khadas-vim/Kconfig
delete mode 100644 board/amlogic/khadas-vim/MAINTAINERS
delete mode 100644 board/amlogic/khadas-vim/khadas-vim.c
delete mode 100644 board/amlogic/khadas-vim2/Kconfig
delete mode 100644 board/amlogic/libretech-cc/Kconfig
delete mode 100644 board/amlogic/libretech-cc/MAINTAINERS
delete mode 100644 board/amlogic/libretech-cc/Makefile
delete mode 100644 board/amlogic/libretech-cc/libretech-cc.c
delete mode 100644 board/amlogic/nanopi-k2/Kconfig
delete mode 100644 board/amlogic/nanopi-k2/MAINTAINERS
delete mode 100644 board/amlogic/nanopi-k2/Makefile
delete mode 100644 board/amlogic/nanopi-k2/nanopi-k2.c
delete mode 100644 board/amlogic/odroid-c2/Kconfig
rename board/amlogic/{nanopi-k2/README => odroid-c2/README.nanopi-k2} (100%)
rename board/amlogic/odroid-c2/{README => README.odroid-c2} (100%)
delete mode 100644 board/amlogic/p212/Kconfig
rename board/amlogic/{khadas-vim/README => p212/README.khadas-vim} (100%)
rename board/amlogic/{libretech-cc/README => p212/README.libretech-cc} (100%)
rename board/amlogic/p212/{README => README.p212} (100%)
rename board/amlogic/{khadas-vim2 => q200}/MAINTAINERS (54%)
rename board/amlogic/{khadas-vim => q200}/Makefile (85%)
rename board/amlogic/{khadas-vim2/README => q200/README.khadas-vim2} (100%)
create mode 100644 board/amlogic/q200/README.q200
rename board/amlogic/{khadas-vim2/khadas-vim2.c => q200/q200.c} (85%)
create mode 100644 board/amlogic/s400/MAINTAINERS
rename board/amlogic/{khadas-vim2 => s400}/Makefile (84%)
create mode 100644 board/amlogic/s400/README
create mode 100644 board/amlogic/s400/s400.c
create mode 100644 configs/s400_defconfig
create mode 100644 drivers/clk/clk_meson_axg.c
create mode 100644 drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c
create mode 100644 drivers/pinctrl/meson/pinctrl-meson-axg.c
create mode 100644 drivers/pinctrl/meson/pinctrl-meson-axg.h
create mode 100644 drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c
create mode 100644 drivers/pinctrl/meson/pinctrl-meson-gx.h
delete mode 100644 include/configs/khadas-vim.h
delete mode 100644 include/configs/khadas-vim2.h
delete mode 100644 include/configs/libretech-cc.h
rename include/configs/{meson-gx-common.h => meson64.h} (51%)
delete mode 100644 include/configs/nanopi-k2.h
delete mode 100644 include/configs/odroid-c2.h
delete mode 100644 include/configs/p212.h
create mode 100644 include/dt-bindings/clock/axg-aoclkc.h
create mode 100644 include/dt-bindings/clock/axg-audio-clkc.h
create mode 100644 include/dt-bindings/clock/axg-clkc.h
create mode 100644 include/dt-bindings/gpio/meson-axg-gpio.h
create mode 100644 include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h
create mode 100644 include/dt-bindings/reset/amlogic,meson-axg-reset.h
create mode 100644 include/dt-bindings/reset/axg-aoclkc.hSignature · 1 line
2.19.1
PATCH v2 1/19 ARM: meson: clean-up platform selection
From: Jerome Brunet <[email protected]>
Even if multiple board are selected through Kconfig, u-boot will only compile one. This makes sense since compiling these targets will export global symbols, such as board_init()
The change rework amlogic Kconfig so only one board may be selected at a time
--- arch/arm/mach-meson/Kconfig | 51 +++++++++++++++---------------------- 1 file changed, 20 insertions(+), 31 deletions(-)
arch/arm/mach-meson/Kconfig +20 -31
@@ -1,41 +1,32 @@ if ARCH_MESON -config MESON_GXBB - bool "Support Meson GXBaby" +config MESON64_COMMON + bool select ARM64 select CLK select DM select DM_SERIAL imply CMD_DM - help - The Amlogic Meson GXBaby (S905) is an ARM SoC with a - quad-core Cortex-A53 CPU and a Mali-450 GPU. + +config MESON_GXBB + bool + select MESON64_COMMON config MESON_GXL - bool "Support Meson GXL" - select ARM64 - select CLK - select DM - select DM_SERIAL - imply CMD_DM - help - The Amlogic Meson GXL (S905X and S905D) is an ARM SoC with a - quad-core Cortex-A53 CPU and a Mali-450 GPU. + bool + select MESON64_COMMON config MESON_GXM - bool "Support Meson GXM" - select ARM64 - select CLK - select DM - select DM_SERIAL - help - The Amlogic Meson GXM (S912) is an ARM SoC with an - octo-core Cortex-A53 CPU and a Mali-T860 GPU. + bool + select MESON64_COMMON -if MESON_GXBB +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
@@ -43,16 +34,15 @@ config TARGET_ODROID_C2 config TARGET_NANOPI_K2 bool "NANOPI_K2" + select MESON_GXBB help NANOPI_K2 is a single board computer based on Meson GXBaby with 2 GiB of RAM, Gigabit Ethernet,AP6212 Wifi, HDMI, 4 USB, micro-SD slot, eMMC, IR receiver and a 40-pin GPIO header. -endif - -if MESON_GXL 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,
@@ -60,6 +50,7 @@ config TARGET_P212 config TARGET_LIBRETECH_CC bool "LIBRETECH-CC" + select MESON_GXL help LibreTech CC is a single board computer based on Meson GXL with 2 GiB of RAM, Ethernet, HDMI, 4 USB, micro-SD slot,
@@ -67,23 +58,21 @@ config TARGET_LIBRETECH_CC config TARGET_KHADAS_VIM bool "KHADAS-VIM" + select MESON_GXL help Khadas VIM is a single board computer based on Meson GXL with 2 GiB of RAM, Ethernet, HDMI, 4 USB, micro-SD slot, eMMC, IR receiver and a 40-pin GPIO header. -endif - -if MESON_GXM - config TARGET_KHADAS_VIM2 bool "KHADAS-VIM2" + select MESON_GXM help Khadas VIM2 is a single board computer based on Meson GXM with 2/3 GiB of RAM, Ethernet, HDMI, 4 USB, micro-SD slot, eMMC, IR receiver and a 40-pin GPIO header. -endif +endchoice config SYS_SOC default "meson"
Signature · 1 line
2.19.1
PATCH v2 2/19 configs: meson: remove unnecessary MESON_FDTFILE_SETTING
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
MESON_FDTFILE_SETTING is used to define the default name of the fdt file in u-boot environment. We can easily derive it from CONFIG_DEFAULT_DEVICE_TREE instead. This will help factorize the code a bit
--- include/configs/khadas-vim.h | 2 -- include/configs/libretech-cc.h | 2 -- include/configs/meson-gx-common.h | 2 +- include/configs/nanopi-k2.h | 4 ---- include/configs/odroid-c2.h | 4 ---- include/configs/p212.h | 4 ---- 6 files changed, 1 insertion(+), 17 deletions(-)
include/configs/khadas-vim.h +0 -2
@@ -9,8 +9,6 @@#ifndef __CONFIG_H#define __CONFIG_H -#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxl-s905x-khadas-vim.dtb\0" -#include <configs/meson-gx-common.h> #endif /* __CONFIG_H */
include/configs/libretech-cc.h +0 -2
@@ -9,8 +9,6 @@#ifndef __CONFIG_H#define __CONFIG_H -#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxl-s905x-libretech-cc.dtb\0" -#include <configs/meson-gx-common.h> #endif /* __CONFIG_H */
include/configs/meson-gx-common.h +1 -1
@@ -44,7 +44,7 @@"kernel_addr_r=0x01080000\0" \"pxefile_addr_r=0x01080000\0" \"ramdisk_addr_r=0x13000000\0" \ -MESON_FDTFILE_SETTING \ +"fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \BOOTENV #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* 64 MiB */
include/configs/nanopi-k2.h +0 -4
@@ -7,10 +7,6 @@#ifndef __CONFIG_H#define __CONFIG_H -/* Serial setup */ - -#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxbb-nanopi-k2.dtb\0" -#include <configs/meson-gx-common.h> #endif /* __CONFIG_H */
include/configs/odroid-c2.h +0 -4
@@ -7,10 +7,6 @@#ifndef __CONFIG_H#define __CONFIG_H -/* Serial setup */ - -#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxbb-odroidc2.dtb\0" -#include <configs/meson-gx-common.h> #endif /* __CONFIG_H */
include/configs/p212.h +0 -4
@@ -9,10 +9,6 @@#ifndef __CONFIG_H#define __CONFIG_H -/* Serial setup */ - -#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxl-s905x-p212.dtb\0" -#include <configs/meson-gx-common.h> #endif /* __CONFIG_H */
Signature · 1 line
2.19.1
PATCH v2 3/19 board: amlogic: remove p212 derivatives
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
The Khadas vim and the libretech aml-s905x-cc (aka Potato) derive from amlogic s905x reference design (P212).
All the code in these board is a copy/paste from the p212, which is tedious to maintain. This change use p212 u-boot board for all these boards, while keeping a dedicated defconfig to customize the names and device tree.
---
arch/arm/mach-meson/Kconfig | 22 +------
board/amlogic/khadas-vim/Kconfig | 12 ----
board/amlogic/khadas-vim/MAINTAINERS | 6 --
board/amlogic/khadas-vim/Makefile | 6 --
board/amlogic/khadas-vim/khadas-vim.c | 57 -------------------
board/amlogic/libretech-cc/Kconfig | 12 ----
board/amlogic/libretech-cc/MAINTAINERS | 6 --
board/amlogic/libretech-cc/Makefile | 6 --
board/amlogic/libretech-cc/libretech-cc.c | 57 -------------------
.../README => p212/README.khadas-vim} | 0
.../README => p212/README.libretech-cc} | 0
board/amlogic/p212/{README => README.p212} | 0
configs/khadas-vim_defconfig | 2 +-
configs/libretech-cc_defconfig | 2 +-
14 files changed, 4 insertions(+), 184 deletions(-)
delete mode 100644 board/amlogic/khadas-vim/Kconfig
delete mode 100644 board/amlogic/khadas-vim/MAINTAINERS
delete mode 100644 board/amlogic/khadas-vim/Makefile
delete mode 100644 board/amlogic/khadas-vim/khadas-vim.c
delete mode 100644 board/amlogic/libretech-cc/Kconfig
delete mode 100644 board/amlogic/libretech-cc/MAINTAINERS
delete mode 100644 board/amlogic/libretech-cc/Makefile
delete mode 100644 board/amlogic/libretech-cc/libretech-cc.c
rename board/amlogic/{khadas-vim/README => p212/README.khadas-vim} (100%)
rename board/amlogic/{libretech-cc/README => p212/README.libretech-cc} (100%)
rename board/amlogic/p212/{README => README.p212} (100%)arch/arm/mach-meson/Kconfig +2 -20
@@ -47,22 +47,8 @@ config TARGET_P212 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. - -config TARGET_LIBRETECH_CC - bool "LIBRETECH-CC" - select MESON_GXL - help - LibreTech CC is a single board computer based on Meson GXL - with 2 GiB of RAM, Ethernet, HDMI, 4 USB, micro-SD slot, - eMMC, IR receiver and a 40-pin GPIO header. - -config TARGET_KHADAS_VIM - bool "KHADAS-VIM" - select MESON_GXL - help - Khadas VIM is a single board computer based on Meson GXL - with 2 GiB of RAM, 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 Khadas Vim or + a libretech aml-s905x-cc config TARGET_KHADAS_VIM2 bool "KHADAS-VIM2"
@@ -86,10 +72,6 @@ source "board/amlogic/nanopi-k2/Kconfig" source "board/amlogic/p212/Kconfig" -source "board/amlogic/libretech-cc/Kconfig" - -source "board/amlogic/khadas-vim/Kconfig" - source "board/amlogic/khadas-vim2/Kconfig" endif
board/amlogic/khadas-vim/Kconfig deleted +0 -12
@@ -1,12 +0,0 @@ -if TARGET_KHADAS_VIM - -config SYS_BOARD - default "khadas-vim" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "khadas-vim" - -endif
board/amlogic/khadas-vim/MAINTAINERS deleted +0 -6
@@ -1,6 +0,0 @@ -KHADAS-VIM -M: Neil Armstrong <[email protected]> -S: Maintained -F: board/amlogic/khadas-vim/ -F: include/configs/khadas-vim.h -F: configs/khadas-vim_defconfig
board/amlogic/khadas-vim/Makefile deleted +0 -6
@@ -1,6 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0+ -# -# (C) Copyright 2016 BayLibre, SAS -# Author: Neil Armstrong <[email protected]> - -obj-y := khadas-vim.o
board/amlogic/khadas-vim/khadas-vim.c deleted +0 -57
57 lines not on this page · raw message
board/amlogic/libretech-cc/Kconfig deleted +0 -12
@@ -1,12 +0,0 @@ -if TARGET_LIBRETECH_CC - -config SYS_BOARD - default "libretech-cc" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "libretech-cc" - -endif
board/amlogic/libretech-cc/MAINTAINERS deleted +0 -6
@@ -1,6 +0,0 @@ -LIBRETECH-CC -M: Neil Armstrong <[email protected]> -S: Maintained -F: board/amlogic/libretech-cc/ -F: include/configs/libretech-cc.h -F: configs/libretech-cc_defconfig
board/amlogic/libretech-cc/Makefile deleted +0 -6
@@ -1,6 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0+ -# -# (C) Copyright 2016 BayLibre, SAS -# Author: Neil Armstrong <[email protected]> - -obj-y := libretech-cc.o
board/amlogic/libretech-cc/libretech-cc.c deleted +0 -57
57 lines not on this page · raw message
board/amlogic/p212/README.khadas-vim renamed from board/amlogic/khadas-vim/README +0 -0
board/amlogic/p212/README.libretech-cc renamed from board/amlogic/libretech-cc/README +0 -0
board/amlogic/p212/README.p212 renamed from board/amlogic/p212/README +0 -0
configs/khadas-vim_defconfig +1 -1
@@ -2,7 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_MESON=y CONFIG_SYS_TEXT_BASE=0x01000000 CONFIG_MESON_GXL=y -CONFIG_TARGET_KHADAS_VIM=y +CONFIG_TARGET_P212=y CONFIG_DEBUG_UART_BASE=0xc81004c0 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_IDENT_STRING=" khadas-vim"
configs/libretech-cc_defconfig +1 -1
@@ -2,7 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_MESON=y CONFIG_SYS_TEXT_BASE=0x01000000 CONFIG_MESON_GXL=y -CONFIG_TARGET_LIBRETECH_CC=y +CONFIG_TARGET_P212=y CONFIG_DEBUG_UART_BASE=0xc81004c0 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_IDENT_STRING=" libretech-cc"
Signature · 1 line
2.19.1
PATCH v2 4/19 board: amlogic: move khadas-vim2 as q200 ref board
In reply to Neil ArmstrongThe Khadas vim2 derive from amlogic s912 reference design (Q200).
This patch moves the khadas-vim2 board support to a generic Q200 board, while keeping a dedicated defconfig to customize the names and device tree.
---
arch/arm/mach-meson/Kconfig | 9 +-
board/amlogic/{khadas-vim2 => q200}/Kconfig | 6 +-
.../amlogic/{khadas-vim2 => q200}/MAINTAINERS | 6 +-
board/amlogic/{khadas-vim2 => q200}/Makefile | 2 +-
.../README => q200/README.khadas-vim2} | 0
board/amlogic/q200/README.q200 | 102 ++++++++++++++++++
.../khadas-vim2.c => q200/q200.c} | 0
configs/khadas-vim2_defconfig | 2 +-
include/configs/{khadas-vim2.h => q200.h} | 0
9 files changed, 115 insertions(+), 12 deletions(-)
rename board/amlogic/{khadas-vim2 => q200}/Kconfig (56%)
rename board/amlogic/{khadas-vim2 => q200}/MAINTAINERS (54%)
rename board/amlogic/{khadas-vim2 => q200}/Makefile (84%)
rename board/amlogic/{khadas-vim2/README => q200/README.khadas-vim2} (100%)
create mode 100644 board/amlogic/q200/README.q200
rename board/amlogic/{khadas-vim2/khadas-vim2.c => q200/q200.c} (100%)
rename include/configs/{khadas-vim2.h => q200.h} (100%)arch/arm/mach-meson/Kconfig +5 -4
@@ -50,13 +50,14 @@ config TARGET_P212 You should also select this TARGET if you have Khadas Vim or a libretech aml-s905x-cc -config TARGET_KHADAS_VIM2 +config TARGET_Q200 bool "KHADAS-VIM2" select MESON_GXM help - Khadas VIM2 is a single board computer based on Meson GXM + 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 and a 40-pin GPIO header. + eMMC, IR receiver. + You should also select this TARGET if you have Khadas Vim2. endchoice
@@ -72,6 +73,6 @@ source "board/amlogic/nanopi-k2/Kconfig" source "board/amlogic/p212/Kconfig" -source "board/amlogic/khadas-vim2/Kconfig" +source "board/amlogic/q200/Kconfig" endif
board/amlogic/q200/Kconfig renamed from board/amlogic/khadas-vim2/Kconfig +3 -3
@@ -1,12 +1,12 @@ -if TARGET_KHADAS_VIM2 +if TARGET_Q200 config SYS_BOARD - default "khadas-vim2" + default "q200" config SYS_VENDOR default "amlogic" config SYS_CONFIG_NAME - default "khadas-vim2" + default "q200" endif
board/amlogic/q200/MAINTAINERS renamed from board/amlogic/khadas-vim2/MAINTAINERS +3 -3
@@ -1,6 +1,6 @@ -KHADAS-VIM2 +Q200 M: Neil Armstrong <[email protected]> S: Maintained -F: board/amlogic/khadas-vim2/ -F: include/configs/khadas-vim2.h +F: board/amlogic/q200/ +F: include/configs/q200.h F: configs/khadas-vim2_defconfig
board/amlogic/q200/Makefile renamed from board/amlogic/khadas-vim2/Makefile +1 -1
@@ -3,4 +3,4 @@ # (C) Copyright 2016 BayLibre, SAS # Author: Neil Armstrong <[email protected]> -obj-y := khadas-vim2.o +obj-y := q200.o
board/amlogic/q200/README.khadas-vim2 renamed from board/amlogic/khadas-vim2/README +0 -0
board/amlogic/q200/README.q200 new file +102 -0
102 lines not on this page · raw message
board/amlogic/q200/q200.c renamed from board/amlogic/khadas-vim2/khadas-vim2.c +0 -0
configs/khadas-vim2_defconfig +1 -1
@@ -2,7 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_MESON=y CONFIG_SYS_TEXT_BASE=0x01000000 CONFIG_MESON_GXM=y -CONFIG_TARGET_KHADAS_VIM2=y +CONFIG_TARGET_Q200=y CONFIG_DEBUG_UART_BASE=0xc81004c0 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_IDENT_STRING=" khadas-vim2"
include/configs/q200.h renamed from include/configs/khadas-vim2.h +0 -0
Signature · 1 line
2.19.1
PATCH v2 5/19 board: amlogic: factorise gxbb boards
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
The nanopi-k2 and the odroid-c2 are similar enough to be supported by the same u-boot board. This change use odroid-c2 u-boot board for the nanopi-k2 as well. Dedicated defconfig are kept to customize the names and device tree.
---
arch/arm/mach-meson/Kconfig | 11 +---
board/amlogic/nanopi-k2/Kconfig | 12 ----
board/amlogic/nanopi-k2/MAINTAINERS | 6 --
board/amlogic/nanopi-k2/Makefile | 7 ---
board/amlogic/nanopi-k2/nanopi-k2.c | 55 -------------------
board/amlogic/odroid-c2/MAINTAINERS | 1 +
.../README => odroid-c2/README.nanopi-k2} | 0
.../odroid-c2/{README => README.odroid-c2} | 0
configs/nanopi-k2_defconfig | 2 +-
9 files changed, 3 insertions(+), 91 deletions(-)
delete mode 100644 board/amlogic/nanopi-k2/Kconfig
delete mode 100644 board/amlogic/nanopi-k2/MAINTAINERS
delete mode 100644 board/amlogic/nanopi-k2/Makefile
delete mode 100644 board/amlogic/nanopi-k2/nanopi-k2.c
rename board/amlogic/{nanopi-k2/README => odroid-c2/README.nanopi-k2} (100%)
rename board/amlogic/odroid-c2/{README => README.odroid-c2} (100%)arch/arm/mach-meson/Kconfig +1 -10
@@ -31,14 +31,7 @@ config TARGET_ODROID_C2 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. - -config TARGET_NANOPI_K2 - bool "NANOPI_K2" - select MESON_GXBB - help - NANOPI_K2 is a single board computer based on Meson GXBaby - with 2 GiB of RAM, Gigabit Ethernet,AP6212 Wifi, 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"
@@ -69,8 +62,6 @@ config SYS_MALLOC_F_LEN source "board/amlogic/odroid-c2/Kconfig" -source "board/amlogic/nanopi-k2/Kconfig" - source "board/amlogic/p212/Kconfig" source "board/amlogic/q200/Kconfig"
board/amlogic/nanopi-k2/Kconfig deleted +0 -12
@@ -1,12 +0,0 @@ -if TARGET_NANOPI_K2 - -config SYS_BOARD - default "nanopi-k2" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "nanopi-k2" - -endif
board/amlogic/nanopi-k2/MAINTAINERS deleted +0 -6
@@ -1,6 +0,0 @@ -NANOPI-K2 -M: Neil Armstrong <[email protected]> -S: Maintained -F: board/amlogic/nanopi-k2/ -F: include/configs/nanopi-k2.h -F: configs/nanopi-k2_defconfig
board/amlogic/nanopi-k2/Makefile deleted +0 -7
@@ -1,7 +0,0 @@ -# -# (C) Copyright 2018 Thomas McKahan -# -# SPDX-License-Identifier: GPL-2.0+ -# - -obj-y := nanopi-k2.o
board/amlogic/nanopi-k2/nanopi-k2.c deleted +0 -55
55 lines not on this page · raw message
board/amlogic/odroid-c2/MAINTAINERS +1 -0
@@ -1,5 +1,6 @@ ODROID-C2 M: Beniamino Galvani <[email protected]> +M: Neil Armstrong <[email protected]> S: Maintained F: board/amlogic/odroid-c2/ F: include/configs/odroid-c2.h
board/amlogic/odroid-c2/README.nanopi-k2 renamed from board/amlogic/nanopi-k2/README +0 -0
board/amlogic/odroid-c2/README.odroid-c2 renamed from board/amlogic/odroid-c2/README +0 -0
configs/nanopi-k2_defconfig +1 -1
@@ -2,7 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_MESON=y CONFIG_SYS_TEXT_BASE=0x01000000 CONFIG_MESON_GXBB=y -CONFIG_TARGET_NANOPI_K2=y +CONFIG_TARGET_ODROID_C2=y CONFIG_DEBUG_UART_BASE=0xc81004c0 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_IDENT_STRING=" nanopi-k2"
Signature · 1 line
2.19.1
PATCH v2 6/19 ARM: rework amlogic configuration
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
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.
---
arch/arm/mach-meson/Kconfig | 73 +++++++++----------
board/amlogic/odroid-c2/Kconfig | 12 ---
board/amlogic/p212/Kconfig | 12 ---
board/amlogic/q200/Kconfig | 12 ---
configs/khadas-vim2_defconfig | 1 -
configs/khadas-vim_defconfig | 1 -
configs/libretech-cc_defconfig | 1 -
configs/nanopi-k2_defconfig | 2 -
configs/odroid-c2_defconfig | 1 -
configs/p212_defconfig | 1 -
include/configs/khadas-vim.h | 14 ----
include/configs/libretech-cc.h | 14 ----
.../configs/{meson-gx-common.h => meson64.h} | 25 ++++---
include/configs/nanopi-k2.h | 12 ---
include/configs/odroid-c2.h | 12 ---
include/configs/p212.h | 14 ----
include/configs/q200.h | 18 -----
17 files changed, 50 insertions(+), 175 deletions(-)
delete mode 100644 board/amlogic/odroid-c2/Kconfig
delete mode 100644 board/amlogic/p212/Kconfig
delete mode 100644 board/amlogic/q200/Kconfig
delete mode 100644 include/configs/khadas-vim.h
delete mode 100644 include/configs/libretech-cc.h
rename include/configs/{meson-gx-common.h => meson64.h} (81%)
delete mode 100644 include/configs/nanopi-k2.h
delete mode 100644 include/configs/odroid-c2.h
delete mode 100644 include/configs/p212.h
delete mode 100644 include/configs/q200.harch/arm/mach-meson/Kconfig +36 -37
@@ -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
board/amlogic/odroid-c2/Kconfig deleted +0 -12
@@ -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
board/amlogic/p212/Kconfig deleted +0 -12
@@ -1,12 +0,0 @@ -if TARGET_P212 - -config SYS_BOARD - default "p212" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "p212" - -endif
board/amlogic/q200/Kconfig deleted +0 -12
@@ -1,12 +0,0 @@ -if TARGET_Q200 - -config SYS_BOARD - default "q200" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "q200" - -endif
configs/khadas-vim2_defconfig +0 -1
@@ -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"
configs/khadas-vim_defconfig +0 -1
@@ -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"
configs/libretech-cc_defconfig +0 -1
@@ -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"
configs/nanopi-k2_defconfig +0 -2
@@ -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"
configs/odroid-c2_defconfig +0 -1
@@ -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"
configs/p212_defconfig +0 -1
@@ -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"
include/configs/khadas-vim.h deleted +0 -14
@@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* Configuration for Khadas VIM -* -* Copyright (C) 2017 Baylibre, SAS -* Author: Neil Armstrong <[email protected]> -*/ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include <configs/meson-gx-common.h> - -#endif /* __CONFIG_H */
include/configs/libretech-cc.h deleted +0 -14
@@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* Configuration for LibreTech CC -* -* Copyright (C) 2017 Baylibre, SAS -* Author: Neil Armstrong <[email protected]> -*/ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include <configs/meson-gx-common.h> - -#endif /* __CONFIG_H */
include/configs/meson64.h renamed from include/configs/meson-gx-common.h +14 -11
@@ -1,11 +1,15 @@/* SPDX-License-Identifier: GPL-2.0+ */ /* -* Configuration for Amlogic Meson GX SoCs +* Configuration for Amlogic Meson 64bits SoCs * (C) Copyright 2016 Beniamino Galvani <[email protected]> */ -#ifndef __MESON_GX_COMMON_CONFIG_H -#define __MESON_GX_COMMON_CONFIG_H +#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
@@ -17,10 +21,7 @@#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 +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* 64 MiB */ #ifdef CONFIG_CMD_USB #define BOOT_TARGET_DEVICES_USB (func) func(USB, usb, 0)
@@ -28,6 +29,7 @@#define BOOT_TARGET_DEVICES_USB (func)#endif +#ifndef BOOT_TARGET_DEVICES #define BOOT_TARGET_DEVICES (func) \ func(MMC, mmc, 0) \ func(MMC, mmc, 1) \
@@ -35,9 +37,9 @@ BOOT_TARGET_DEVICES_USB(func) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na) +#endif -#include <config_distro_bootcmd.h> - +#ifndef CONFIG_EXTRA_ENV_SETTINGS #define CONFIG_EXTRA_ENV_SETTINGS \ "fdt_addr_r=0x01000000\0" \ "scriptaddr=0x1f000000\0" \
@@ -46,7 +48,8 @@"ramdisk_addr_r=0x13000000\0" \"fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ BOOTENV +#endif -#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* 64 MiB */ +#include <config_distro_bootcmd.h> -#endif /* __MESON_GX_COMMON_CONFIG_H */ +#endif /* __MESON64_CONFIG_H */
include/configs/nanopi-k2.h deleted +0 -12
@@ -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 */
include/configs/odroid-c2.h deleted +0 -12
@@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* Configuration for ODROID-C2 -* (C) Copyright 2016 Beniamino Galvani <[email protected]> -*/ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include <configs/meson-gx-common.h> - -#endif /* __CONFIG_H */
include/configs/p212.h deleted +0 -14
@@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* Configuration for Amlogic P212 -* -* Copyright (C) 2017 Baylibre, SAS -* Author: Neil Armstrong <[email protected]> -*/ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include <configs/meson-gx-common.h> - -#endif /* __CONFIG_H */
include/configs/q200.h deleted +0 -18
@@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* Configuration for Khadas VIM2 -* -* Copyright (C) 2017 Baylibre, SAS -* Author: Neil Armstrong <[email protected]> -*/ - -#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 */
Signature · 1 line
2.19.1
PATCH v2 7/19 configs: meson: change default load addresses
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
The original chosen addresses conflict with the BL2 initialisation. So far there was no issue with them but if we preload binaries in RAM (ROMUSB boot) before running the BL2 they get corrupted by the execution of BL2 init.
If we load them around 0x08000000, there is no such issue.
--- include/configs/meson64.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/configs/meson64.h +3 -3
@@ -41,9 +41,9 @@#ifndef CONFIG_EXTRA_ENV_SETTINGS #define CONFIG_EXTRA_ENV_SETTINGS \ - "fdt_addr_r=0x01000000\0" \ - "scriptaddr=0x1f000000\0" \ - "kernel_addr_r=0x01080000\0" \ + "fdt_addr_r=0x08008000\0" \ + "scriptaddr=0x08000000\0" \ + "kernel_addr_r=0x08080000\0" \ "pxefile_addr_r=0x01080000\0" \ "ramdisk_addr_r=0x13000000\0" \ "fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
Signature · 1 line
2.19.1
PATCH v2 8/19 pinctrl: meson: rework gx pmx function
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
In preparation of supporting the new Amlogix AGX SoCs, we need to move the Amlogic GX pinmux functions out of the common code to be able to add a different set of SoC specific pinmux functions for AXG.
--- drivers/pinctrl/meson/Kconfig | 8 +- drivers/pinctrl/meson/Makefile | 1 + drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c | 97 +++++++++++++++++ drivers/pinctrl/meson/pinctrl-meson-gx.h | 48 ++++++++ drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 6 +- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 6 +- drivers/pinctrl/meson/pinctrl-meson.c | 109 +++---------------- drivers/pinctrl/meson/pinctrl-meson.h | 37 +++---- 8 files changed, 191 insertions(+), 121 deletions(-) create mode 100644 drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c create mode 100644 drivers/pinctrl/meson/pinctrl-meson-gx.h
drivers/pinctrl/meson/Kconfig +6 -2
@@ -4,12 +4,16 @@ config PINCTRL_MESON depends on PINCTRL_GENERIC bool +config PINCTRL_MESON_GX_PMX + select PINCTRL_MESON + bool + config PINCTRL_MESON_GXBB bool "Amlogic Meson GXBB SoC pinctrl driver" - select PINCTRL_MESON + select PINCTRL_MESON_GX_PMX config PINCTRL_MESON_GXL bool "Amlogic Meson GXL SoC pinctrl driver" - select PINCTRL_MESON + select PINCTRL_MESON_GX_PMX endif
drivers/pinctrl/meson/Makefile +1 -0
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ obj-y += pinctrl-meson.o +obj-$(CONFIG_PINCTRL_MESON_GX_PMX) += pinctrl-meson-gx-pmx.o obj-$(CONFIG_PINCTRL_MESON_GXBB) += pinctrl-meson-gxbb.o obj-$(CONFIG_PINCTRL_MESON_GXL) += pinctrl-meson-gxl.o
drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c new file +97 -0
97 lines not on this page · raw message
drivers/pinctrl/meson/pinctrl-meson-gx.h new file +48 -0
48 lines not on this page · raw message
drivers/pinctrl/meson/pinctrl-meson-gxbb.c +4 -2
@@ -11,7 +11,7 @@#include <dm/pinctrl.h> #include <dt-bindings/gpio/meson-gxbb-gpio.h> -#include "pinctrl-meson.h" +#include "pinctrl-meson-gx.h" #define EE_OFF 15
@@ -417,6 +417,7 @@ struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_gxbb_periphs_groups), .num_funcs = ARRAY_SIZE(meson_gxbb_periphs_functions), .num_banks = ARRAY_SIZE(meson_gxbb_periphs_banks), + .gpio_driver = &meson_gx_gpio_driver, };struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = {
@@ -429,6 +430,7 @@ struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_gxbb_aobus_groups), .num_funcs = ARRAY_SIZE(meson_gxbb_aobus_functions), .num_banks = ARRAY_SIZE(meson_gxbb_aobus_banks), + .gpio_driver = &meson_gx_gpio_driver, };static const struct udevice_id meson_gxbb_pinctrl_match[] = {
@@ -449,5 +451,5 @@ U_BOOT_DRIVER(meson_gxbb_pinctrl) = { .of_match = of_match_ptr(meson_gxbb_pinctrl_match), .probe = meson_pinctrl_probe, .priv_auto_alloc_size = sizeof(struct meson_pinctrl), - .ops = &meson_pinctrl_ops, + .ops = &meson_gx_pinctrl_ops, };
drivers/pinctrl/meson/pinctrl-meson-gxl.c +4 -2
@@ -11,7 +11,7 @@#include <dm/pinctrl.h> #include <dt-bindings/gpio/meson-gxl-gpio.h> -#include "pinctrl-meson.h" +#include "pinctrl-meson-gx.h" #define EE_OFF 11
@@ -699,6 +699,7 @@ struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_gxl_periphs_groups), .num_funcs = ARRAY_SIZE(meson_gxl_periphs_functions), .num_banks = ARRAY_SIZE(meson_gxl_periphs_banks), + .gpio_driver = &meson_gx_gpio_driver, };struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = {
@@ -711,6 +712,7 @@ struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_gxl_aobus_groups), .num_funcs = ARRAY_SIZE(meson_gxl_aobus_functions), .num_banks = ARRAY_SIZE(meson_gxl_aobus_banks), + .gpio_driver = &meson_gx_gpio_driver, };static const struct udevice_id meson_gxl_pinctrl_match[] = {
@@ -731,5 +733,5 @@ U_BOOT_DRIVER(meson_gxl_pinctrl) = { .of_match = of_match_ptr(meson_gxl_pinctrl_match), .probe = meson_pinctrl_probe, .priv_auto_alloc_size = sizeof(struct meson_pinctrl), - .ops = &meson_pinctrl_ops, + .ops = &meson_gx_pinctrl_ops, };
drivers/pinctrl/meson/pinctrl-meson.c +14 -95
187 lines not on this page · raw message
drivers/pinctrl/meson/pinctrl-meson.h +17 -20
@@ -12,9 +12,7 @@ struct meson_pmx_group {const char *name;const unsigned int *pins;unsigned int num_pins; -bool is_gpio; -unsigned int reg; -unsigned int bit; +const void *data; };struct meson_pmx_func {
@@ -33,6 +31,8 @@ struct meson_pinctrl_data {unsigned int num_groups;unsigned int num_funcs;unsigned int num_banks; +const struct driver *gpio_driver; +void *pmx_data; };struct meson_pinctrl {
@@ -89,23 +89,6 @@ struct meson_bank {#define PIN (x, b) (b + x) -#define GROUP (grp, r, b) \ - { \ - .name = #grp, \ - .pins = grp ## _pins, \ - .num_pins = ARRAY_SIZE(grp ## _pins), \ - .reg = r, \ - .bit = b, \ - } - -#define GPIO_GROUP (gpio, b) \ - { \ - .name = #gpio, \ - .pins = (const unsigned int[]){ PIN(gpio, b) }, \ - .num_pins = 1, \ - .is_gpio = true, \ - } -#define FUNCTION (fn) \ { \ .name = #fn, \
@@ -131,6 +114,20 @@ struct meson_bank {extern const struct pinctrl_ops meson_pinctrl_ops; +int meson_pinctrl_get_groups_count (struct udevice *dev); +const char *meson_pinctrl_get_group_name (struct udevice *dev, +unsigned int selector); +int meson_pinmux_get_functions_count (struct udevice *dev); +const char *meson_pinmux_get_function_name (struct udevice *dev, +unsigned int selector);int meson_pinctrl_probe (struct udevice *dev); +int meson_gpio_get (struct udevice *dev,unsigned int offset); +int meson_gpio_set (struct udevice *dev,unsigned int offset,int value); +int meson_gpio_get_direction (struct udevice *dev,unsigned int offset); +int meson_gpio_direction_input (struct udevice *dev,unsigned int offset); +int meson_gpio_direction_output (struct udevice *dev,unsigned int offset, +int value); +int meson_gpio_probe (struct udevice *dev); +#endif /* __PINCTRL_MESON_H__ */
Signature · 1 line
2.19.1
PATCH v2 9/19 pinctrl: meson: select generic pinctrl
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
Meson pinctrl needs generic pinctrl, rather than depending on it select it
--- drivers/pinctrl/meson/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/meson/Kconfig +1 -1
@@ -1,7 +1,7 @@ if ARCH_MESON config PINCTRL_MESON - depends on PINCTRL_GENERIC + select PINCTRL_GENERIC bool config PINCTRL_MESON_GX_PMX
Signature · 1 line
2.19.1
PATCH v2 10/19 pinctrl: meson: add axg support
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
This adds support for the Amlogic AXG SoC pinctrl and GPIO controller using a specific set of pinctrl functions which differs from the GX SoCs.
--- drivers/pinctrl/meson/Kconfig | 8 + drivers/pinctrl/meson/Makefile | 2 + drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c | 125 +++ drivers/pinctrl/meson/pinctrl-meson-axg.c | 979 ++++++++++++++++++ drivers/pinctrl/meson/pinctrl-meson-axg.h | 66 ++ 5 files changed, 1180 insertions(+) create mode 100644 drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c create mode 100644 drivers/pinctrl/meson/pinctrl-meson-axg.c create mode 100644 drivers/pinctrl/meson/pinctrl-meson-axg.h
drivers/pinctrl/meson/Kconfig +8 -0
@@ -8,6 +8,10 @@ config PINCTRL_MESON_GX_PMX select PINCTRL_MESON bool +config PINCTRL_MESON_AXG_PMX + select PINCTRL_MESON + bool + config PINCTRL_MESON_GXBB bool "Amlogic Meson GXBB SoC pinctrl driver" select PINCTRL_MESON_GX_PMX
@@ -16,4 +20,8 @@ config PINCTRL_MESON_GXL bool "Amlogic Meson GXL SoC pinctrl driver" select PINCTRL_MESON_GX_PMX +config PINCTRL_MESON_AXG + bool "Amlogic Meson AXG SoC pinctrl driver" + select PINCTRL_MESON_AXG_PMX + endif
drivers/pinctrl/meson/Makefile +2 -0
@@ -2,5 +2,7 @@ obj-y += pinctrl-meson.o obj-$(CONFIG_PINCTRL_MESON_GX_PMX) += pinctrl-meson-gx-pmx.o +obj-$(CONFIG_PINCTRL_MESON_AXG_PMX) += pinctrl-meson-axg-pmx.o obj-$(CONFIG_PINCTRL_MESON_GXBB) += pinctrl-meson-gxbb.o obj-$(CONFIG_PINCTRL_MESON_GXL) += pinctrl-meson-gxl.o +obj-$(CONFIG_PINCTRL_MESON_AXG) += pinctrl-meson-axg.o
drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c new file +125 -0
125 lines not on this page · raw message
drivers/pinctrl/meson/pinctrl-meson-axg.c new file +979 -0
979 lines not on this page · raw message
drivers/pinctrl/meson/pinctrl-meson-axg.h new file +66 -0
66 lines not on this page · raw message
Signature · 1 line
2.19.1
PATCH v2 11/19 clk: meson: add static to meson_gates table
In reply to Neil ArmstrongThe meson_gates table should be set static in the clk_meson driver.
--- drivers/clk/clk_meson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk_meson.c +1 -1
@@ -79,7 +79,7 @@ static ulong meson_clk_set_rate_by_id(struct clk *clk, unsigned long id,static ulong meson_mux_get_parent (struct clk *clk,unsigned long id);static ulong meson_clk_get_rate_by_id (struct clk *clk,unsigned long id); -struct meson_gate gates[] = { +static struct meson_gate gates[] = {/* Everything Else (EE) domain gates */ MESON_GATE (CLKID_DDR ,HHI_GCLK_MPEG0 ,0 ),MESON_GATE (CLKID_DOS ,HHI_GCLK_MPEG0 ,1 ),
Signature · 1 line
2.19.1
PATCH v2 12/19 clk: meson: silence debug print
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
This debug print was not designed to be active in non-debug mode.
--- drivers/clk/clk_meson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk_meson.c +1 -1
@@ -791,7 +791,7 @@ static ulong meson_clk_get_rate_by_id(struct clk *clk, unsigned long id)return -ENOENT ; } -printf ("clock %lu has rate %lu\n" , id, rate); +debug ("clock %lu has rate %lu\n" , id, rate);return rate; }
Signature · 1 line
2.19.1
PATCH v2 13/19 ARM: meson: rework soc arch file to prepare for new SoC
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
We are about to add support for the Amlogic AXG SoC. While very close to the Gx SoC family, we will need to handle a few thing which are different in this SoC. Rework the meson arch directory to prepare for this.
---
.../asm/arch-meson/{clock.h => clock-gx.h} | 4 +-
arch/arm/include/asm/arch-meson/eth.h | 6 +-
arch/arm/include/asm/arch-meson/mem.h | 3 +-
arch/arm/mach-meson/Kconfig | 10 +-
arch/arm/mach-meson/Makefile | 3 +-
arch/arm/mach-meson/board-common.c | 55 +++++++++
arch/arm/mach-meson/{board.c => board-gx.c} | 106 +++++++++---------
arch/arm/mach-meson/eth.c | 53 ---------
arch/arm/mach-meson/sm.c | 1 -
board/amlogic/odroid-c2/odroid-c2.c | 6 +-
board/amlogic/p212/p212.c | 6 +-
board/amlogic/q200/q200.c | 4 +-
drivers/clk/clk_meson.c | 2 +-
13 files changed, 134 insertions(+), 125 deletions(-)
rename arch/arm/include/asm/arch-meson/{clock.h => clock-gx.h} (98%)
create mode 100644 arch/arm/mach-meson/board-common.c
rename arch/arm/mach-meson/{board.c => board-gx.c} (61%)
delete mode 100644 arch/arm/mach-meson/eth.carch/arm/include/asm/arch-meson/clock-gx.h renamed from arch/arm/include/asm/arch-meson/clock.h +2 -2
@@ -3,8 +3,8 @@* Copyright 2016 - AmLogic, Inc. * Copyright 2018 - Beniamino Galvani <[email protected]> */ -#ifndef _ARCH_MESON_CLOCK_H_ -#define _ARCH_MESON_CLOCK_H_ +#ifndef _ARCH_MESON_CLOCK_GX_H_ +#define _ARCH_MESON_CLOCK_GX_H_/* * Clock controller register offsets
arch/arm/include/asm/arch-meson/eth.h +3 -3
@@ -10,13 +10,13 @@#include <phy.h> enum { -/* Use GXL Internal RMII PHY */ -MESON_GXL_USE_INTERNAL_RMII_PHY =1 , +/* Use Internal RMII PHY */ +MESON_USE_INTERNAL_RMII_PHY =1 , };/* Configure the Ethernet MAC with the requested interface mode * with some optional flags. */ -void meson_gx_eth_init (phy_interface_t mode,unsigned int flags); +void meson_eth_init (phy_interface_t mode,unsigned int flags);#endif /* __MESON_ETH_H__ */
arch/arm/include/asm/arch-meson/mem.h +2 -1
@@ -10,6 +10,7 @@/* Configure the reserved memory zones exported by the secure registers * into EFI and DTB reserved memory entries. */ -void meson_gx_init_reserved_memory (void *fdt); +void meson_board_add_reserved_memory (void *fdt,u64 start,u64 size); +void meson_init_reserved_memory (void *fdt);#endif /* __MESON_MEM_H__ */
arch/arm/mach-meson/Kconfig +7 -3
@@ -8,25 +8,29 @@ config MESON64_COMMON select DM_SERIAL imply CMD_DM +config MESON_GX + bool + select MESON64_COMMON + choice prompt "Platform select" default MESON_GXBB config MESON_GXBB bool "GXBB" - select MESON64_COMMON + select MESON_GX help Select this if your SoC is an S905 config MESON_GXL bool "GXL" - select MESON64_COMMON + select MESON_GX help Select this if your SoC is an S905X/D or S805X config MESON_GXM bool "GXM" - select MESON64_COMMON + select MESON_GX help Select this if your SoC is an S912
arch/arm/mach-meson/Makefile +2 -1
@@ -2,4 +2,5 @@ # # Copyright (c) 2016 Beniamino Galvani <[email protected]> -obj-y += board.o sm.o eth.o +obj-y += board-common.o sm.o +obj-$(CONFIG_MESON_GX) += board-gx.o
arch/arm/mach-meson/board-common.c new file +55 -0
55 lines not on this page · raw message
arch/arm/mach-meson/board-gx.c renamed from arch/arm/mach-meson/board.c +54 -52
137 lines not on this page · raw message
arch/arm/mach-meson/eth.c deleted +0 -53
53 lines not on this page · raw message
arch/arm/mach-meson/sm.c +0 -1
@@ -6,7 +6,6 @@*/ #include <common.h> -#include <asm/arch/gx.h> #include <linux/kernel.h> #define FN_GET_SHARE_MEM_INPUT_BASE 0x82000020
board/amlogic/odroid-c2/odroid-c2.c +3 -3
@@ -28,7 +28,7 @@ int misc_init_r(void)char serial[EFUSE_SN_SIZE ];ssize_t len; -meson_gx_eth_init (PHY_INTERFACE_MODE_RGMII ,0 ); +meson_eth_init (PHY_INTERFACE_MODE_RGMII ,0 );if (!eth_env_get_enetaddr ("ethaddr" , mac_addr)) { len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
@@ -40,7 +40,7 @@ int misc_init_r(void)if (!env_get ("serial#" )) { len =meson_sm_read_efuse (EFUSE_SN_OFFSET , serial,EFUSE_SN_SIZE ); -if (len ==EFUSE_SN_SIZE ) +if (len ==EFUSE_SN_SIZE )env_set ("serial#" , serial); }
@@ -49,7 +49,7 @@ int misc_init_r(void)int ft_board_setup (void *blob,bd_t *bd) { -meson_gx_init_reserved_memory (blob); +meson_init_reserved_memory (blob);return 0 ; }
board/amlogic/p212/p212.c +3 -3
@@ -29,8 +29,8 @@ int misc_init_r(void)char serial[EFUSE_SN_SIZE ];ssize_t len; -meson_gx_eth_init (PHY_INTERFACE_MODE_RMII , -MESON_GXL_USE_INTERNAL_RMII_PHY ); +meson_eth_init (PHY_INTERFACE_MODE_RMII , +MESON_USE_INTERNAL_RMII_PHY );if (!eth_env_get_enetaddr ("ethaddr" , mac_addr)) { len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
@@ -51,7 +51,7 @@ int misc_init_r(void)int ft_board_setup (void *blob,bd_t *bd) { -meson_gx_init_reserved_memory (blob); +meson_init_reserved_memory (blob);return 0 ; }
board/amlogic/q200/q200.c +2 -2
@@ -29,7 +29,7 @@ int misc_init_r(void)char serial[EFUSE_SN_SIZE ];ssize_t len; -meson_gx_eth_init (PHY_INTERFACE_MODE_RGMII ,0 ); +meson_eth_init (PHY_INTERFACE_MODE_RGMII ,0 );/* Reset PHY on GPIOZ_14 */ clrbits_le32 (GX_GPIO_EN (3 ),BIT (14 ));
@@ -56,7 +56,7 @@ int misc_init_r(void)int ft_board_setup (void *blob,bd_t *bd) { -meson_gx_init_reserved_memory (blob); +meson_init_reserved_memory (blob);return 0 ; }
drivers/clk/clk_meson.c +1 -1
@@ -6,7 +6,7 @@*/ #include <common.h> -#include <asm/arch/clock.h> +#include <asm/arch/clock-gx.h> #include <asm/io.h> #include <clk-uclass.h> #include <div64.h>
Signature · 1 line
2.19.1
PATCH v2 14/19 ARM: meson: Add support for AXG family
In reply to Neil ArmstrongThis patch adds support for the Amlogic AXG SoC, which is very close from the Amlogic GXL SoCs with :
- Same 4xCortex-A53 CPUs but clocked at 1.2GHZ max
- DDR Interface limited to DDR4 16bit
- The whole physical register address space has been moved to 0xfxxxxxxx
- The pinctrl setup has changed
- The clock tree is different enough to use a different driver
--- arch/arm/include/asm/arch-meson/axg.h | 51 ++++++++++++ arch/arm/mach-meson/Kconfig | 8 ++ arch/arm/mach-meson/Makefile | 1 + arch/arm/mach-meson/board-axg.c | 112 ++++++++++++++++++++++++++ include/configs/meson64.h | 5 ++ 5 files changed, 177 insertions(+) create mode 100644 arch/arm/include/asm/arch-meson/axg.h create mode 100644 arch/arm/mach-meson/board-axg.c
arch/arm/include/asm/arch-meson/axg.h new file +51 -0
@@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2018 BayLibre, SAS +* Author: Neil Armstrong <[email protected]> +*/ + +#ifndef __AXG_H__ +#define __AXG_H__ + +#define AXG_AOBUS_BASE 0xff800000 +#define AXG_PERIPHS_BASE 0xff634400 +#define AXG_HIU_BASE 0xff63c000 +#define AXG_ETH_BASE 0xff3f0000 + +/* Always-On Peripherals registers */ +#define AXG_AO_ADDR (off) (AXG_AOBUS_BASE + ((off) << 2)) + +#define AXG_AO_SEC_GP_CFG0 AXG_AO_ADDR(0x90) +#define AXG_AO_SEC_GP_CFG3 AXG_AO_ADDR(0x93) +#define AXG_AO_SEC_GP_CFG4 AXG_AO_ADDR(0x94) +#define AXG_AO_SEC_GP_CFG5 AXG_AO_ADDR(0x95) + +#define AXG_AO_MEM_SIZE_MASK 0xFFFF0000 +#define AXG_AO_MEM_SIZE_SHIFT 16 +#define AXG_AO_BL31_RSVMEM_SIZE_MASK 0xFFFF0000 +#define AXG_AO_BL31_RSVMEM_SIZE_SHIFT 16 +#define AXG_AO_BL32_RSVMEM_SIZE_MASK 0xFFFF + +/* Peripherals registers */ +#define AXG_PERIPHS_ADDR (off) (AXG_PERIPHS_BASE + ((off) << 2)) + +#define AXG_ETH_REG_0 AXG_PERIPHS_ADDR(0x50) +#define AXG_ETH_REG_1 AXG_PERIPHS_ADDR(0x51) + +#define AXG_ETH_REG_0_PHY_INTF_RGMII BIT(0) +#define AXG_ETH_REG_0_PHY_INTF_RMII BIT(2) +#define AXG_ETH_REG_0_TX_PHASE (x) (((x) & 3) << 5) +#define AXG_ETH_REG_0_TX_RATIO (x) (((x) & 7) << 7) +#define AXG_ETH_REG_0_PHY_CLK_EN BIT(10) +#define AXG_ETH_REG_0_INVERT_RMII_CLK BIT(11) +#define AXG_ETH_REG_0_CLK_EN BIT(12) + +/* HIU registers */ +#define AXG_HIU_ADDR (off) (AXG_HIU_BASE + ((off) << 2)) + +#define AXG_MEM_PD_REG_0 AXG_HIU_ADDR(0x40) + +/* Ethernet memory power domain */ +#define AXG_MEM_PD_REG_0_ETH_MASK (BIT(2) | BIT(3)) + +#endif /* __AXG_H__ */
arch/arm/mach-meson/Kconfig +8 -0
@@ -6,6 +6,8 @@ config MESON64_COMMON select CLK select DM select DM_SERIAL + select SYSCON + select REGMAP imply CMD_DM config MESON_GX
@@ -34,6 +36,12 @@ config MESON_GXM help Select this if your SoC is an S912 +config MESON_AXG + bool "AXG" + select MESON64_COMMON + help + Select this if your SoC is an A113X/D + endchoice config SYS_SOC
arch/arm/mach-meson/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-y += board-common.o sm.o obj-$(CONFIG_MESON_GX) += board-gx.o +obj-$(CONFIG_MESON_AXG) += board-axg.o
arch/arm/mach-meson/board-axg.c new file +112 -0
112 lines not on this page · raw message
include/configs/meson64.h +5 -0
@@ -8,8 +8,13 @@#define __MESON64_CONFIG_H/* Generic Interrupt Controller Definitions */ +#if defined(CONFIG_MESON_AXG ) +#define GICD_BASE 0xffc01000 +#define GICC_BASE 0xffc02000 +#else /* MESON GXL and GXBB */ #define GICD_BASE 0xc4301000#define GICC_BASE 0xc4302000 +#endif #define CONFIG_CPU_ARMV8 #define CONFIG_REMAKE_ELF
Signature · 1 line
2.19.1
PATCH v2 15/19 ARM: dts: Sync Amlogic Meson AXG DT from Linux 4.20-rc1
In reply to Neil ArmstrongSynchronize the Amlogic AXG Device Tree files and bindings include from the recent Linux 4.20-rc1, because it includes patches fixing support for U-boot.
--- arch/arm/dts/Makefile | 3 +- arch/arm/dts/meson-axg-s400.dts | 554 ++++++ arch/arm/dts/meson-axg.dtsi | 1589 +++++++++++++++++ include/dt-bindings/clock/axg-aoclkc.h | 26 + include/dt-bindings/clock/axg-audio-clkc.h | 94 + include/dt-bindings/clock/axg-clkc.h | 76 + include/dt-bindings/gpio/meson-axg-gpio.h | 116 ++ .../reset/amlogic,meson-axg-audio-arb.h | 17 + .../reset/amlogic,meson-axg-reset.h | 124 ++ include/dt-bindings/reset/axg-aoclkc.h | 20 + 10 files changed, 2618 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/meson-axg-s400.dts create mode 100644 arch/arm/dts/meson-axg.dtsi create mode 100644 include/dt-bindings/clock/axg-aoclkc.h create mode 100644 include/dt-bindings/clock/axg-audio-clkc.h create mode 100644 include/dt-bindings/clock/axg-clkc.h create mode 100644 include/dt-bindings/gpio/meson-axg-gpio.h create mode 100644 include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h create mode 100644 include/dt-bindings/reset/amlogic,meson-axg-reset.h create mode 100644 include/dt-bindings/reset/axg-aoclkc.h
arch/arm/dts/Makefile +2 -1
@@ -59,7 +59,8 @@ dtb-$(CONFIG_ARCH_MESON) += \ meson-gxl-s905x-p212.dtb \ meson-gxl-s905x-libretech-cc.dtb \ meson-gxl-s905x-khadas-vim.dtb \ - meson-gxm-khadas-vim2.dtb + meson-gxm-khadas-vim2.dtb \ + meson-axg-s400.dtb dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ tegra20-paz00.dtb \
arch/arm/dts/meson-axg-s400.dts new file +554 -0
554 lines not on this page · raw message
arch/arm/dts/meson-axg.dtsi new file +1589 -0
1,589 lines not on this page · raw message
include/dt-bindings/clock/axg-aoclkc.h new file +26 -0
@@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ +/* +* Copyright (c) 2016 BayLibre, SAS +* Author: Neil Armstrong <[email protected]> +* +* Copyright (c) 2018 Amlogic, inc. +* Author: Qiufang Dai <[email protected]> +*/ + +#ifndef DT_BINDINGS_CLOCK_AMLOGIC_MESON_AXG_AOCLK +#define DT_BINDINGS_CLOCK_AMLOGIC_MESON_AXG_AOCLK + +#define CLKID_AO_REMOTE 0 +#define CLKID_AO_I2C_MASTER 1 +#define CLKID_AO_I2C_SLAVE 2 +#define CLKID_AO_UART1 3 +#define CLKID_AO_UART2 4 +#define CLKID_AO_IR_BLASTER 5 +#define CLKID_AO_SAR_ADC 6 +#define CLKID_AO_CLK81 7 +#define CLKID_AO_SAR_ADC_SEL 8 +#define CLKID_AO_SAR_ADC_DIV 9 +#define CLKID_AO_SAR_ADC_CLK 10 +#define CLKID_AO_ALT_XTAL 11 + +#endif
include/dt-bindings/clock/axg-audio-clkc.h new file +94 -0
94 lines not on this page · raw message
include/dt-bindings/clock/axg-clkc.h new file +76 -0
76 lines not on this page · raw message
include/dt-bindings/gpio/meson-axg-gpio.h new file +116 -0
116 lines not on this page · raw message
include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) +* +* Copyright (c) 2018 Baylibre SAS. +* Author: Jerome Brunet <[email protected]> +*/ + +#ifndef _DT_BINDINGS_AMLOGIC_MESON_AXG_AUDIO_ARB_H +#define _DT_BINDINGS_AMLOGIC_MESON_AXG_AUDIO_ARB_H + +#define AXG_ARB_TODDR_A 0 +#define AXG_ARB_TODDR_B 1 +#define AXG_ARB_TODDR_C 2 +#define AXG_ARB_FRDDR_A 3 +#define AXG_ARB_FRDDR_B 4 +#define AXG_ARB_FRDDR_C 5 + +#endif /* _DT_BINDINGS_AMLOGIC_MESON_AXG_AUDIO_ARB_H */
include/dt-bindings/reset/amlogic,meson-axg-reset.h new file +124 -0
124 lines not on this page · raw message
include/dt-bindings/reset/axg-aoclkc.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ +/* +* Copyright (c) 2016 BayLibre, SAS +* Author: Neil Armstrong <[email protected]> +* +* Copyright (c) 2018 Amlogic, inc. +* Author: Qiufang Dai <[email protected]> +*/ + +#ifndef DT_BINDINGS_RESET_AMLOGIC_MESON_AXG_AOCLK +#define DT_BINDINGS_RESET_AMLOGIC_MESON_AXG_AOCLK + +#define RESET_AO_REMOTE 0 +#define RESET_AO_I2C_MASTER 1 +#define RESET_AO_I2C_SLAVE 2 +#define RESET_AO_UART1 3 +#define RESET_AO_UART2 4 +#define RESET_AO_IR_BLASTER 5 + +#endif
Signature · 1 line
2.19.1
PATCH v2 16/19 clk: Add clock driver for AXG
In reply to Neil ArmstrongThis patch adds a minimal clock driver for the Amlogic AXG SoC to handle the basic gates and PLLs.
--- arch/arm/include/asm/arch-meson/clock-axg.h | 104 +++++++ drivers/clk/Makefile | 2 +- drivers/clk/clk_meson_axg.c | 316 ++++++++++++++++++++ 3 files changed, 421 insertions(+), 1 deletion(-) create mode 100644 arch/arm/include/asm/arch-meson/clock-axg.h create mode 100644 drivers/clk/clk_meson_axg.c
arch/arm/include/asm/arch-meson/clock-axg.h new file +104 -0
@@ -0,0 +1,104 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright 2016 - AmLogic, Inc. +* Copyright 2018 - Beniamino Galvani <[email protected]> +* Copyright 2018 - BayLibre, SAS +* Author: Neil Armstrong <[email protected]> +*/ +#ifndef _ARCH_MESON_CLOCK_AXG_H_ +#define _ARCH_MESON_CLOCK_AXG_H_ + +/* +* Clock controller register offsets +* +* Register offsets from the data sheet are listed in comment blocks below. +* Those offsets must be multiplied by 4 before adding them to the base address +* to get the right value +*/ +#define HHI_GP0_PLL_CNTL 0x40 +#define HHI_GP0_PLL_CNTL2 0x44 +#define HHI_GP0_PLL_CNTL3 0x48 +#define HHI_GP0_PLL_CNTL4 0x4c +#define HHI_GP0_PLL_CNTL5 0x50 +#define HHI_GP0_PLL_STS 0x54 +#define HHI_GP0_PLL_CNTL1 0x58 +#define HHI_HIFI_PLL_CNTL 0x80 +#define HHI_HIFI_PLL_CNTL2 0x84 +#define HHI_HIFI_PLL_CNTL3 0x88 +#define HHI_HIFI_PLL_CNTL4 0x8C +#define HHI_HIFI_PLL_CNTL5 0x90 +#define HHI_HIFI_PLL_STS 0x94 +#define HHI_HIFI_PLL_CNTL1 0x98 + +#define HHI_XTAL_DIVN_CNTL 0xbc +#define HHI_GCLK2_MPEG0 0xc0 +#define HHI_GCLK2_MPEG1 0xc4 +#define HHI_GCLK2_MPEG2 0xc8 +#define HHI_GCLK2_OTHER 0xd0 +#define HHI_GCLK2_AO 0xd4 +#define HHI_PCIE_PLL_CNTL 0xd8 +#define HHI_PCIE_PLL_CNTL1 0xdC +#define HHI_PCIE_PLL_CNTL2 0xe0 +#define HHI_PCIE_PLL_CNTL3 0xe4 +#define HHI_PCIE_PLL_CNTL4 0xe8 +#define HHI_PCIE_PLL_CNTL5 0xec +#define HHI_PCIE_PLL_CNTL6 0xf0 +#define HHI_PCIE_PLL_STS 0xf4 + +#define HHI_MEM_PD_REG0 0x100 +#define HHI_VPU_MEM_PD_REG0 0x104 +#define HHI_VIID_CLK_DIV 0x128 +#define HHI_VIID_CLK_CNTL 0x12c + +#define HHI_GCLK_MPEG0 0x140 +#define HHI_GCLK_MPEG1 0x144 +#define HHI_GCLK_MPEG2 0x148 +#define HHI_GCLK_OTHER 0x150 +#define HHI_GCLK_AO 0x154 +#define HHI_SYS_CPU_CLK_CNTL1 0x15c +#define HHI_SYS_CPU_RESET_CNTL 0x160 +#define HHI_VID_CLK_DIV 0x164 +#define HHI_SPICC_HCLK_CNTL 0x168 + +#define HHI_MPEG_CLK_CNTL 0x174 +#define HHI_VID_CLK_CNTL 0x17c +#define HHI_TS_CLK_CNTL 0x190 +#define HHI_VID_CLK_CNTL2 0x194 +#define HHI_SYS_CPU_CLK_CNTL0 0x19c +#define HHI_VID_PLL_CLK_DIV 0x1a0 +#define HHI_VPU_CLK_CNTL 0x1bC + +#define HHI_VAPBCLK_CNTL 0x1F4 + +#define HHI_GEN_CLK_CNTL 0x228 + +#define HHI_VDIN_MEAS_CLK_CNTL 0x250 +#define HHI_NAND_CLK_CNTL 0x25C +#define HHI_SD_EMMC_CLK_CNTL 0x264 + +#define HHI_MPLL_CNTL 0x280 +#define HHI_MPLL_CNTL2 0x284 +#define HHI_MPLL_CNTL3 0x288 +#define HHI_MPLL_CNTL4 0x28C +#define HHI_MPLL_CNTL5 0x290 +#define HHI_MPLL_CNTL6 0x294 +#define HHI_MPLL_CNTL7 0x298 +#define HHI_MPLL_CNTL8 0x29C +#define HHI_MPLL_CNTL9 0x2A0 +#define HHI_MPLL_CNTL10 0x2A4 + +#define HHI_MPLL3_CNTL0 0x2E0 +#define HHI_MPLL3_CNTL1 0x2E4 +#define HHI_PLL_TOP_MISC 0x2E8 + +#define HHI_SYS_PLL_CNTL1 0x2FC +#define HHI_SYS_PLL_CNTL 0x300 +#define HHI_SYS_PLL_CNTL2 0x304 +#define HHI_SYS_PLL_CNTL3 0x308 +#define HHI_SYS_PLL_CNTL4 0x30c +#define HHI_SYS_PLL_CNTL5 0x310 +#define HHI_SYS_PLL_STS 0x314 +#define HHI_DPLL_TOP_I 0x318 +#define HHI_DPLL_TOP2_I 0x31C + +#endif
drivers/clk/Makefile +1 -1
@@ -9,7 +9,7 @@ obj-$(CONFIG_$(SPL_TPL_)CLK) += clk-uclass.o clk_fixed_rate.o obj-y += imx/ obj-y += tegra/ obj-$(CONFIG_ARCH_ASPEED) += aspeed/ -obj-$(CONFIG_ARCH_MESON) += clk_meson.o +obj-$(CONFIG_ARCH_MESON) += clk_meson.o clk_meson_axg.o obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ obj-$(CONFIG_ARCH_SOCFPGA) += altera/ obj-$(CONFIG_CLK_AT91) += at91/
drivers/clk/clk_meson_axg.c new file +316 -0
316 lines not on this page · raw message
Signature · 1 line
2.19.1
PATCH v2 17/19 board: amlogic: add support for S400 board
In reply to Neil ArmstrongThe S400 board is the Amlogic AXG SoC reference board including :
- Amlogic A113DX ARM Cortex-A53 quad-core SoC @ 1.2GHz
- 1GB DDR4 SDRAM
- 10/100 Ethernet
- 2 x USB 2.0 Host
- eMMC
- Infrared receiver
- SDIO WiFi Module
- MIPI DSI Connector
- Audio HAT Connector
- PCI-E M.2 Connectors
--- arch/arm/mach-meson/Kconfig | 1 + board/amlogic/s400/MAINTAINERS | 6 ++ board/amlogic/s400/Makefile | 6 ++ board/amlogic/s400/README | 110 +++++++++++++++++++++++++++++++++ board/amlogic/s400/s400.c | 33 ++++++++++ configs/s400_defconfig | 38 ++++++++++++ 6 files changed, 194 insertions(+) create mode 100644 board/amlogic/s400/MAINTAINERS create mode 100644 board/amlogic/s400/Makefile create mode 100644 board/amlogic/s400/README create mode 100644 board/amlogic/s400/s400.c create mode 100644 configs/s400_defconfig
arch/arm/mach-meson/Kconfig +1 -0
@@ -63,6 +63,7 @@ config SYS_BOARD default "odroid-c2" if MESON_GXBB default "p212" if MESON_GXL default "q200" if MESON_GXM + default "s400" if MESON_AXG default "" help This option contains information about board name.
board/amlogic/s400/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +S400 +M: Neil Armstrong <[email protected]> +S: Maintained +F: board/amlogic/s400/ +F: include/configs/s400.h +F: configs/s400_defconfig
board/amlogic/s400/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2016 BayLibre, SAS +# Author: Neil Armstrong <[email protected]> + +obj-y := s400.o
board/amlogic/s400/README new file +110 -0
110 lines not on this page · raw message
board/amlogic/s400/s400.c new file +33 -0
@@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2016 BayLibre, SAS +* Author: Neil Armstrong <[email protected]> +*/ + +#include <common.h> +#include <dm.h> +#include <environment.h> +#include <asm/io.h> +#include <asm/arch/axg.h> +#include <asm/arch/sm.h> +#include <asm/arch/eth.h> +#include <asm/arch/mem.h> + +int board_init (void ) +{ +return 0 ; +} + +int misc_init_r (void ) +{ +meson_eth_init (PHY_INTERFACE_MODE_RGMII ,0 ); + +return 0 ; +} + +int ft_board_setup (void *blob,bd_t *bd) +{ +meson_init_reserved_memory (blob); + +return 0 ; +}
configs/s400_defconfig new file +38 -0
@@ -0,0 +1,38 @@ +CONFIG_ARM=y +CONFIG_ARCH_MESON=y +CONFIG_SYS_TEXT_BASE=0x01000000 +CONFIG_MESON_AXG=y +CONFIG_DEBUG_UART_BASE=0xff803000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_IDENT_STRING=" s400" +CONFIG_DEBUG_UART=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_OF_BOARD_SETUP=y +CONFIG_MISC_INIT_R=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +# CONFIG_CMD_BDI is not set +# CONFIG_CMD_IMI is not set +CONFIG_CMD_GPIO=y +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_REGULATOR=y +CONFIG_OF_CONTROL=y +CONFIG_DEFAULT_DEVICE_TREE="meson-axg-s400" +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_DM_GPIO=y +CONFIG_DM_MMC=y +CONFIG_MMC_MESON_GX=y +CONFIG_DM_ETH=y +CONFIG_ETH_DESIGNWARE=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_MESON_AXG=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_RESET=y +CONFIG_DEBUG_UART_MESON=y +CONFIG_DEBUG_UART_ANNOUNCE=y +CONFIG_DEBUG_UART_SKIP_INIT=y +CONFIG_MESON_SERIAL=y +CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.19.1
PATCH v2 18/19 ARM: meson: factorize common code out amlogic's boards
In reply to Neil ArmstrongFrom: Jerome Brunet <[email protected]>
Now we have moved all the Amlogic board support to common generic board code, we can move the identical board_init() and ft_board_setup() functions to weak functions into the board-common mach-meson file.
--- arch/arm/mach-meson/board-common.c | 17 +++++++++++++++++ board/amlogic/odroid-c2/odroid-c2.c | 12 ------------ board/amlogic/p212/p212.c | 12 ------------ board/amlogic/q200/q200.c | 12 ------------ board/amlogic/s400/s400.c | 12 ------------ 5 files changed, 17 insertions(+), 48 deletions(-)
arch/arm/mach-meson/board-common.c +17 -0
@@ -14,6 +14,11 @@DECLARE_GLOBAL_DATA_PTR ; +__weak int board_init (void ) +{ +return 0 ; +} +int dram_init (void ) {const fdt64_t *val;
@@ -34,6 +39,18 @@ int dram_init(void)return 0 ; } +__weak int meson_ft_board_setup (void *blob,bd_t *bd) +{ +return 0 ; +} + +int ft_board_setup (void *blob,bd_t *bd) +{ +meson_init_reserved_memory (blob); + +return meson_ft_board_setup (blob, bd); +} +void meson_board_add_reserved_memory (void *fdt,u64 start,u64 size) {int ret;
board/amlogic/odroid-c2/odroid-c2.c +0 -12
@@ -17,11 +17,6 @@#define EFUSE_MAC_OFFSET 52#define EFUSE_MAC_SIZE 6 -int board_init (void ) -{ -return 0 ; -} -int misc_init_r (void ) {u8 mac_addr[EFUSE_MAC_SIZE ];
@@ -46,10 +41,3 @@ int misc_init_r(void)return 0 ; } - -int ft_board_setup (void *blob,bd_t *bd) -{ -meson_init_reserved_memory (blob); - -return 0 ; -}
board/amlogic/p212/p212.c +0 -12
@@ -18,11 +18,6 @@#define EFUSE_MAC_OFFSET 52#define EFUSE_MAC_SIZE 6 -int board_init (void ) -{ -return 0 ; -} -int misc_init_r (void ) {u8 mac_addr[EFUSE_MAC_SIZE ];
@@ -48,10 +43,3 @@ int misc_init_r(void)return 0 ; } - -int ft_board_setup (void *blob,bd_t *bd) -{ -meson_init_reserved_memory (blob); - -return 0 ; -}
board/amlogic/q200/q200.c +0 -12
@@ -18,11 +18,6 @@#define EFUSE_MAC_OFFSET 52#define EFUSE_MAC_SIZE 6 -int board_init (void ) -{ -return 0 ; -} -int misc_init_r (void ) {u8 mac_addr[EFUSE_MAC_SIZE ];
@@ -53,10 +48,3 @@ int misc_init_r(void)return 0 ; } - -int ft_board_setup (void *blob,bd_t *bd) -{ -meson_init_reserved_memory (blob); - -return 0 ; -}
board/amlogic/s400/s400.c +0 -12
@@ -13,21 +13,9 @@#include <asm/arch/eth.h> #include <asm/arch/mem.h> -int board_init (void ) -{ -return 0 ; -} -int misc_init_r (void ) {meson_eth_init (PHY_INTERFACE_MODE_RGMII ,0 );return 0 ; } - -int ft_board_setup (void *blob,bd_t *bd) -{ -meson_init_reserved_memory (blob); - -return 0 ; -}
Signature · 1 line
2.19.1
PATCH v2 19/19 ARM: meson: Add boot device discovery
In reply to Neil ArmstrongThe Amlogic Meson SoCs ROM supports a boot over USB with a custom protocol.
When no other boot medium are available (or by forcing the USB mode), the ROM sets the primary USB port as device mode and waits for a Host to enumerate.
When enumerated, a custom protocol described at [1] permits writing to memory and execute some specific FIP init code to run the loaded Arm Trusted Firmware BL2 and BL3 stages before running the BL33 stage.
In this mode, we can load different binaries that can be used by U-boot like a script image file.
This adds support for a custom USB boot stage only available when the boot mode is USB and the script file at a pre-defined address is valid. This support was heavily copied from the Sunxi Allwinner FEL U-Boot support.
The tool pyamlboot described at [2], permits using this boot mode on boards exposing the first USB port, either as OTG or Host port.
[1] https://github.com/superna9999/pyamlboot/blob/master/PROTOCOL.md
[2] https://github.com/superna9999/pyamlboot/blob/master/README.md
--- arch/arm/include/asm/arch-meson/axg.h | 1 + arch/arm/include/asm/arch-meson/boot.h | 20 ++++++++++++ arch/arm/include/asm/arch-meson/gx.h | 1 + arch/arm/mach-meson/Kconfig | 1 + arch/arm/mach-meson/board-axg.c | 6 ++++ arch/arm/mach-meson/board-common.c | 45 ++++++++++++++++++++++++++ arch/arm/mach-meson/board-gx.c | 6 ++++ include/configs/meson64.h | 13 ++++++++ 8 files changed, 93 insertions(+) create mode 100644 arch/arm/include/asm/arch-meson/boot.h
arch/arm/include/asm/arch-meson/axg.h +1 -0
@@ -20,6 +20,7 @@#define AXG_AO_SEC_GP_CFG4 AXG_AO_ADDR(0x94)#define AXG_AO_SEC_GP_CFG5 AXG_AO_ADDR(0x95) +#define AXG_AO_BOOT_DEVICE 0xF#define AXG_AO_MEM_SIZE_MASK 0xFFFF0000#define AXG_AO_MEM_SIZE_SHIFT 16#define AXG_AO_BL31_RSVMEM_SIZE_MASK 0xFFFF0000
arch/arm/include/asm/arch-meson/boot.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2016 BayLibre, SAS +* Author: Neil Armstrong <[email protected]> +*/ + +#ifndef __MESON_BOOT_H__ +#define __MESON_BOOT_H__ + +/* Boot device */ +#define BOOT_DEVICE_RESERVED 0 +#define BOOT_DEVICE_EMMC 1 +#define BOOT_DEVICE_NAND 2 +#define BOOT_DEVICE_SPI 3 +#define BOOT_DEVICE_SD 4 +#define BOOT_DEVICE_USB 5 + +int meson_get_boot_device (void ); + +#endif /* __MESON_BOOT_H__ */
arch/arm/include/asm/arch-meson/gx.h +1 -0
@@ -21,6 +21,7 @@#define GX_AO_SEC_GP_CFG4 GX_AO_ADDR(0x94)#define GX_AO_SEC_GP_CFG5 GX_AO_ADDR(0x95) +#define GX_AO_BOOT_DEVICE 0xF#define GX_AO_MEM_SIZE_MASK 0xFFFF0000#define GX_AO_MEM_SIZE_SHIFT 16#define GX_AO_BL31_RSVMEM_SIZE_MASK 0xFFFF0000
arch/arm/mach-meson/Kconfig +1 -0
@@ -8,6 +8,7 @@ config MESON64_COMMON select DM_SERIAL select SYSCON select REGMAP + select BOARD_LATE_INIT imply CMD_DM config MESON_GX
arch/arm/mach-meson/board-axg.c +6 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <asm/arch/boot.h> #include <asm/arch/eth.h> #include <asm/arch/axg.h> #include <asm/arch/mem.h>
@@ -15,6 +16,11 @@DECLARE_GLOBAL_DATA_PTR ; +int meson_get_boot_device (void ) +{ +return readl (AXG_AO_SEC_GP_CFG0 ) &AXG_AO_BOOT_DEVICE ; +} +/* Configure the reserved memory zones exported by the secure registers * into EFI and DTB reserved memory entries. */
arch/arm/mach-meson/board-common.c +45 -0
57 lines not on this page · raw message
arch/arm/mach-meson/board-gx.c +6 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <asm/arch/boot.h> #include <asm/arch/eth.h> #include <asm/arch/gx.h> #include <asm/arch/mem.h>
@@ -15,6 +16,11 @@DECLARE_GLOBAL_DATA_PTR ; +int meson_get_boot_device (void ) +{ +return readl (GX_AO_SEC_GP_CFG0 ) &GX_AO_BOOT_DEVICE ; +} +/* Configure the reserved memory zones exported by the secure registers * into EFI and DTB reserved memory entries. */
include/configs/meson64.h +13 -0
@@ -28,6 +28,18 @@#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_TEXT_BASE#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* 64 MiB */ +/* ROM USB boot support, auto-execute boot.scr@scriptaddr */ +#define BOOTENV_DEV_ROMUSB (devtypeu, devtypel, instance) \ + "bootcmd_romusb=" \ + "if test \"${boot_source}\" = \"usb\" && " \ + "test -n \"${scriptaddr}\"; then " \ + "echo '(ROM USB boot)'; " \ + "source ${scriptaddr}; " \ + "fi\0" + +#define BOOTENV_DEV_NAME_ROMUSB (devtypeu, devtypel, instance) \ + "romusb " +#ifdef CONFIG_CMD_USB #define BOOT_TARGET_DEVICES_USB (func) func(USB, usb, 0)#else
@@ -36,6 +48,7 @@#ifndef BOOT_TARGET_DEVICES #define BOOT_TARGET_DEVICES (func) \ + func(ROMUSB, romusb, na) \ func(MMC, mmc, 0) \ func(MMC, mmc, 1) \ func(MMC, mmc, 2) \
Signature · 1 line
2.19.1
v2 cover Amlogic Meson cleanup for AXG SoC support
In reply to Neil ArmstrongHi Tom,
Quoted 16 lines · Neil Armstrong
This patchset will refactor the Amlogic Meson SoC support in order to easily add support for the Amlogic AXg SoC family, and later the G12x SoCs.
In order :
- Cleanup the mach-meson configs
- Move board support to reference design common boards
- Move boardKconfiginto mach-meson
- Add AXG pinctrl & clock support
- Add AXG device tree and mach-meson support
- Add support for S400 reference design
- Do a final factorization of the code
- Add USB boot support in U-bootAt the end of the patches, the board code is lighter and we maintain only the reference designs, where each board will differ in the defconfig.
Quoted 7 lines
It will be simpler to add custom board support for future boards with more changes against the reference designs.
The complete AXG support depends on the :
- mmc: meson-gx: Add AXG compatible
- net: designware: add meson meson axg compatible
patches submitted to the U-Boot mailing list.Hi
Would it be simpler if I send you a pull-request with this patchset and all dependencies ?
Tell me if you have any comments on the patchset and the 2 dependencies !
Thanks,
Neil
Quoted 172 lines
Changes since v1:
- Fixed AXG pinctrl request and AO pin count
- Fixed tabs/spaces issues on s400 READMEJerome Brunet (12):
ARM: meson: clean-up platform selection
configs: meson: remove unnecessaryMESON_FDTFILE_SETTING
board: amlogic: remove p212 derivatives
board: amlogic: factorise gxbb boards
ARM: rework amlogic configuration
configs: meson: change default load addresses
pinctrl: meson: rework gx pmx function
pinctrl: meson: select generic pinctrl
pinctrl: meson: add axg support
clk: meson: silence debug print
ARM: meson: rework soc arch file to prepare for new SoC
ARM: meson: factorize common code out amlogic's boardsNeil Armstrong (7):
board: amlogic: move khadas-vim2 as q200 ref board
clk: meson: add static tomeson_gatestable
ARM: meson: Add support for AXG family
ARM: dts: Sync Amlogic Meson AXG DT from Linux 4.20-rc1
clk: Add clock driver for AXG
board: amlogic: add support for S400 board
ARM: meson: Add boot device discoveryarch/arm/dts/Makefile | 3 +- arch/arm/dts/meson-axg-s400.dts | 554 ++++++ arch/arm/dts/meson-axg.dtsi | 1589 +++++++++++++++++ arch/arm/include/asm/arch-meson/axg.h | 52 + arch/arm/include/asm/arch-meson/boot.h | 20 + arch/arm/include/asm/arch-meson/clock-axg.h | 104 ++ .../asm/arch-meson/{clock.h => clock-gx.h} | 4 +- arch/arm/include/asm/arch-meson/eth.h | 6 +- arch/arm/include/asm/arch-meson/gx.h | 1 + arch/arm/include/asm/arch-meson/mem.h | 3 +- arch/arm/mach-meson/Kconfig | 132 +- arch/arm/mach-meson/Makefile | 4 +- arch/arm/mach-meson/board-axg.c | 118 ++ arch/arm/mach-meson/board-common.c | 117 ++ arch/arm/mach-meson/{board.c => board-gx.c} | 106 +- arch/arm/mach-meson/eth.c | 53 - arch/arm/mach-meson/sm.c | 1 - board/amlogic/khadas-vim/Kconfig | 12 - board/amlogic/khadas-vim/MAINTAINERS | 6 - board/amlogic/khadas-vim/khadas-vim.c | 57 - board/amlogic/khadas-vim2/Kconfig | 12 - board/amlogic/libretech-cc/Kconfig | 12 - board/amlogic/libretech-cc/MAINTAINERS | 6 - board/amlogic/libretech-cc/Makefile | 6 - board/amlogic/libretech-cc/libretech-cc.c | 57 - board/amlogic/nanopi-k2/Kconfig | 12 - board/amlogic/nanopi-k2/MAINTAINERS | 6 - board/amlogic/nanopi-k2/Makefile | 7 - board/amlogic/nanopi-k2/nanopi-k2.c | 55 - board/amlogic/odroid-c2/Kconfig | 12 - board/amlogic/odroid-c2/MAINTAINERS | 1 + .../README => odroid-c2/README.nanopi-k2} | 0 .../odroid-c2/{README => README.odroid-c2} | 0 board/amlogic/odroid-c2/odroid-c2.c | 16 +- board/amlogic/p212/Kconfig | 12 - .../README => p212/README.khadas-vim} | 0 .../README => p212/README.libretech-cc} | 0 board/amlogic/p212/{README => README.p212} | 0 board/amlogic/p212/p212.c | 16 +- .../amlogic/{khadas-vim2 => q200}/MAINTAINERS | 6 +- board/amlogic/{khadas-vim => q200}/Makefile | 2 +- .../README => q200/README.khadas-vim2} | 0 board/amlogic/q200/README.q200 | 102 ++ .../khadas-vim2.c => q200/q200.c} | 14 +- board/amlogic/s400/MAINTAINERS | 6 + board/amlogic/{khadas-vim2 => s400}/Makefile | 2 +- board/amlogic/s400/README | 110 ++ board/amlogic/s400/s400.c | 21 + configs/khadas-vim2_defconfig | 1 - configs/khadas-vim_defconfig | 1 - configs/libretech-cc_defconfig | 1 - configs/nanopi-k2_defconfig | 2 - configs/odroid-c2_defconfig | 1 - configs/p212_defconfig | 1 - configs/s400_defconfig | 38 + drivers/clk/Makefile | 2 +- drivers/clk/clk_meson.c | 6 +- drivers/clk/clk_meson_axg.c | 316 ++++ drivers/pinctrl/meson/Kconfig | 18 +- drivers/pinctrl/meson/Makefile | 3 + drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c | 125 ++ drivers/pinctrl/meson/pinctrl-meson-axg.c | 979 ++++++++++ drivers/pinctrl/meson/pinctrl-meson-axg.h | 66 + drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c | 97 + drivers/pinctrl/meson/pinctrl-meson-gx.h | 48 + drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 6 +- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 6 +- drivers/pinctrl/meson/pinctrl-meson.c | 109 +- drivers/pinctrl/meson/pinctrl-meson.h | 37 +- include/configs/khadas-vim.h | 16 - include/configs/khadas-vim2.h | 18 - include/configs/libretech-cc.h | 16 - .../configs/{meson-gx-common.h => meson64.h} | 49 +- include/configs/nanopi-k2.h | 16 - include/configs/odroid-c2.h | 16 - include/configs/p212.h | 18 - include/dt-bindings/clock/axg-aoclkc.h | 26 + include/dt-bindings/clock/axg-audio-clkc.h | 94 + include/dt-bindings/clock/axg-clkc.h | 76 + include/dt-bindings/gpio/meson-axg-gpio.h | 116 ++ .../reset/amlogic,meson-axg-audio-arb.h | 17 + .../reset/amlogic,meson-axg-reset.h | 124 ++ include/dt-bindings/reset/axg-aoclkc.h | 20 + 83 files changed, 5166 insertions(+), 754 deletions(-) create mode 100644 arch/arm/dts/meson-axg-s400.dts create mode 100644 arch/arm/dts/meson-axg.dtsi create mode 100644 arch/arm/include/asm/arch-meson/axg.h create mode 100644 arch/arm/include/asm/arch-meson/boot.h create mode 100644 arch/arm/include/asm/arch-meson/clock-axg.h rename arch/arm/include/asm/arch-meson/{clock.h => clock-gx.h} (98%) create mode 100644 arch/arm/mach-meson/board-axg.c create mode 100644 arch/arm/mach-meson/board-common.c rename arch/arm/mach-meson/{board.c => board-gx.c} (59%) delete mode 100644 arch/arm/mach-meson/eth.c delete mode 100644 board/amlogic/khadas-vim/Kconfig delete mode 100644 board/amlogic/khadas-vim/MAINTAINERS delete mode 100644 board/amlogic/khadas-vim/khadas-vim.c delete mode 100644 board/amlogic/khadas-vim2/Kconfig delete mode 100644 board/amlogic/libretech-cc/Kconfig delete mode 100644 board/amlogic/libretech-cc/MAINTAINERS delete mode 100644 board/amlogic/libretech-cc/Makefile delete mode 100644 board/amlogic/libretech-cc/libretech-cc.c delete mode 100644 board/amlogic/nanopi-k2/Kconfig delete mode 100644 board/amlogic/nanopi-k2/MAINTAINERS delete mode 100644 board/amlogic/nanopi-k2/Makefile delete mode 100644 board/amlogic/nanopi-k2/nanopi-k2.c delete mode 100644 board/amlogic/odroid-c2/Kconfig rename board/amlogic/{nanopi-k2/README => odroid-c2/README.nanopi-k2} (100%) rename board/amlogic/odroid-c2/{README => README.odroid-c2} (100%) delete mode 100644 board/amlogic/p212/Kconfig rename board/amlogic/{khadas-vim/README => p212/README.khadas-vim} (100%) rename board/amlogic/{libretech-cc/README => p212/README.libretech-cc} (100%) rename board/amlogic/p212/{README => README.p212} (100%) rename board/amlogic/{khadas-vim2 => q200}/MAINTAINERS (54%) rename board/amlogic/{khadas-vim => q200}/Makefile (85%) rename board/amlogic/{khadas-vim2/README => q200/README.khadas-vim2} (100%) create mode 100644 board/amlogic/q200/README.q200 rename board/amlogic/{khadas-vim2/khadas-vim2.c => q200/q200.c} (85%) create mode 100644 board/amlogic/s400/MAINTAINERS rename board/amlogic/{khadas-vim2 => s400}/Makefile (84%) create mode 100644 board/amlogic/s400/README create mode 100644 board/amlogic/s400/s400.c create mode 100644 configs/s400_defconfig create mode 100644 drivers/clk/clk_meson_axg.c create mode 100644 drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c create mode 100644 drivers/pinctrl/meson/pinctrl-meson-axg.c create mode 100644 drivers/pinctrl/meson/pinctrl-meson-axg.h create mode 100644 drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c create mode 100644 drivers/pinctrl/meson/pinctrl-meson-gx.h delete mode 100644 include/configs/khadas-vim.h delete mode 100644 include/configs/khadas-vim2.h delete mode 100644 include/configs/libretech-cc.h rename include/configs/{meson-gx-common.h => meson64.h} (51%) delete mode 100644 include/configs/nanopi-k2.h delete mode 100644 include/configs/odroid-c2.h delete mode 100644 include/configs/p212.h create mode 100644 include/dt-bindings/clock/axg-aoclkc.h create mode 100644 include/dt-bindings/clock/axg-audio-clkc.h create mode 100644 include/dt-bindings/clock/axg-clkc.h create mode 100644 include/dt-bindings/gpio/meson-axg-gpio.h create mode 100644 include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h create mode 100644 include/dt-bindings/reset/amlogic,meson-axg-reset.h create mode 100644 include/dt-bindings/reset/axg-aoclkc.h
v2 cover Amlogic Meson cleanup for AXG SoC support
Quoted 27 lines · Neil Armstrong
Hi Tom,
Quoted 16 lines · Neil Armstrong
This patchset will refactor the Amlogic Meson SoC support in order to easily add support for the Amlogic AXg SoC family, and later the G12x SoCs.
In order :
- Cleanup the mach-meson configs
- Move board support to reference design common boards
- Move boardKconfiginto mach-meson
- Add AXG pinctrl & clock support
- Add AXG device tree and mach-meson support
- Add support for S400 reference design
- Do a final factorization of the code
- Add USB boot support in U-bootAt the end of the patches, the board code is lighter and we maintain only the reference designs, where each board will differ in the defconfig.
Quoted 7 lines
It will be simpler to add custom board support for future boards with more changes against the reference designs.
The complete AXG support depends on the :
- mmc: meson-gx: Add AXG compatible
- net: designware: add meson meson axg compatible
patches submitted to the U-Boot mailing list.Hi
Quoted 5 lines
Would it be simpler if I send you a pull-request with this patchset and all dependencies ?
Tell me if you have any comments on the patchset and the 2 dependencies !
Sure, lets try that. Do you want to get a tree setup on git.denx.de or will you use github/etc? Traditionally we host things on git.denx.de but at least Alex has been doing the EFI and RPi stuff from his github instead, and I'm fine taking a signed tag to pull from either. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-amlogic/attachments/20181126/96bab64e/attachment.sig>
v2 cover Amlogic Meson cleanup for AXG SoC support
Hi Tom,
Quoted 31 lines · Tom Rini
Quoted 30 lines · Neil Armstrong
Hi Tom,
Quoted 16 lines · Neil Armstrong
This patchset will refactor the Amlogic Meson SoC support in order to easily add support for the Amlogic AXg SoC family, and later the G12x SoCs.
In order :
- Cleanup the mach-meson configs
- Move board support to reference design common boards
- Move boardKconfiginto mach-meson
- Add AXG pinctrl & clock support
- Add AXG device tree and mach-meson support
- Add support for S400 reference design
- Do a final factorization of the code
- Add USB boot support in U-bootAt the end of the patches, the board code is lighter and we maintain only the reference designs, where each board will differ in the defconfig.
Quoted 7 lines
It will be simpler to add custom board support for future boards with more changes against the reference designs.
The complete AXG support depends on the :
- mmc: meson-gx: Add AXG compatible
- net: designware: add meson meson axg compatible
patches submitted to the U-Boot mailing list.HiWould it be simpler if I send you a pull-request with this patchset and all dependencies ?
Quoted 8 lines
Quoted 2 lines
Tell me if you have any comments on the patchset and the 2 dependencies !
Sure, lets try that. Do you want to get a tree setup on git.denx.de or will you use github/etc? Traditionally we host things on git.denx.de but at least Alex has been doing the EFI and RPi stuff from his github instead, and I'm fine taking a signed tag to pull from either. Thanks!
I'll be happy to have a tree on git.denx.de if it's the best way to go, but until it's done I can do a PR from github if it's ok for you !
Neil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-amlogic/attachments/20181126/0356499c/attachment.sig>