Basic support for Amlogic GXBaby and ODROID-C2
Subsystems (3)
cover Basic support for Amlogic GXBaby and ODROID-C2
Hi,
this series adds a very basic support for Amlogic S905 SoC (GXBaby) and for the ODROID-C2 board [1], and is based on u-boot sources available from the board vendor [2].
Mainline kernel support is still in early stages [3] and the plan is to add more features to u-boot (mmc, ethernet, ...) as soon as they are available in the kernel; this submission only includes definition of platform, board and UART support.
Beniamino
[1] http://www.hardkernel.com/main/products/prdt_info.php?g_code=G145457216438
[2] https://github.com/hardkernel/u-boot/tree/odroidc2-v2015.01
[3] https://lkml.org/lkml/2016/3/1/1401
Beniamino Galvani (5):
arm: add initial support for Amlogic Meson and ODROID-C2
arm: dts: import Meson files
serial: add support for Amlogic Meson UART
arm: meson: use device tree
meson: odroid-c2: enable serial
arch/arm/Kconfig | 5 + arch/arm/Makefile | 1 + arch/arm/dts/Makefile | 2 + arch/arm/dts/meson-gxbb-odroidc2.dts | 65 ++++++++++ arch/arm/dts/meson-gxbb.dtsi | 211 +++++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-meson/gxbb.h | 10 ++ arch/arm/mach-meson/Kconfig | 31 +++++ arch/arm/mach-meson/Makefile | 7 ++ arch/arm/mach-meson/board.c | 69 +++++++++++ board/hardkernel/odroid-c2/Kconfig | 12 ++ board/hardkernel/odroid-c2/MAINTAINERS | 6 + board/hardkernel/odroid-c2/Makefile | 7 ++ board/hardkernel/odroid-c2/README | 34 ++++++ board/hardkernel/odroid-c2/odroid-c2.c | 7 ++ configs/odroid-c2_defconfig | 18 +++ drivers/serial/Kconfig | 14 +++ drivers/serial/Makefile | 1 + drivers/serial/serial_meson.c | 162 +++++++++++++++++++++++++ include/configs/odroid-c2.h | 55 +++++++++ 19 files changed, 717 insertions(+) create mode 100644 arch/arm/dts/meson-gxbb-odroidc2.dts create mode 100644 arch/arm/dts/meson-gxbb.dtsi create mode 100644 arch/arm/include/asm/arch-meson/gxbb.h create mode 100644 arch/arm/mach-meson/Kconfig create mode 100644 arch/arm/mach-meson/Makefile create mode 100644 arch/arm/mach-meson/board.c create mode 100644 board/hardkernel/odroid-c2/Kconfig create mode 100644 board/hardkernel/odroid-c2/MAINTAINERS create mode 100644 board/hardkernel/odroid-c2/Makefile create mode 100644 board/hardkernel/odroid-c2/README create mode 100644 board/hardkernel/odroid-c2/odroid-c2.c create mode 100644 configs/odroid-c2_defconfig create mode 100644 drivers/serial/serial_meson.c create mode 100644 include/configs/odroid-c2.h
Signature · 1 line
2.4.3
PATCH 1/5 arm: add initial support for Amlogic Meson and ODROID-C2
Support the Amlogic Meson GXBaby platform.
--- arch/arm/Kconfig | 5 ++++ arch/arm/Makefile | 1 + arch/arm/include/asm/arch-meson/gxbb.h | 10 +++++++ arch/arm/mach-meson/Kconfig | 31 +++++++++++++++++++ arch/arm/mach-meson/Makefile | 7 +++++ arch/arm/mach-meson/board.c | 45 ++++++++++++++++++++++++++++ board/hardkernel/odroid-c2/Kconfig | 12 ++++++++ board/hardkernel/odroid-c2/MAINTAINERS | 6 ++++ board/hardkernel/odroid-c2/Makefile | 7 +++++ board/hardkernel/odroid-c2/README | 34 +++++++++++++++++++++ board/hardkernel/odroid-c2/odroid-c2.c | 7 +++++ configs/odroid-c2_defconfig | 11 +++++++ include/configs/odroid-c2.h | 55 ++++++++++++++++++++++++++++++++++ 13 files changed, 231 insertions(+) create mode 100644 arch/arm/include/asm/arch-meson/gxbb.h create mode 100644 arch/arm/mach-meson/Kconfig create mode 100644 arch/arm/mach-meson/Makefile create mode 100644 arch/arm/mach-meson/board.c create mode 100644 board/hardkernel/odroid-c2/Kconfig create mode 100644 board/hardkernel/odroid-c2/MAINTAINERS create mode 100644 board/hardkernel/odroid-c2/Makefile create mode 100644 board/hardkernel/odroid-c2/README create mode 100644 board/hardkernel/odroid-c2/odroid-c2.c create mode 100644 configs/odroid-c2_defconfig create mode 100644 include/configs/odroid-c2.h
arch/arm/Kconfig +5 -0
@@ -452,6 +452,9 @@ config ARCH_KEYSTONE select SUPPORT_SPL select CMD_POWEROFF +config ARCH_MESON + bool "Amlogic Meson" + config ARCH_MX7 bool "Freescale MX7" select CPU_V7
@@ -762,6 +765,8 @@ source "arch/arm/mach-orion5x/Kconfig" source "arch/arm/cpu/armv7/rmobile/Kconfig" +source "arch/arm/mach-meson/Kconfig" + source "arch/arm/mach-rockchip/Kconfig" source "arch/arm/mach-s5pc1xx/Kconfig"
arch/arm/Makefile +1 -0
@@ -49,6 +49,7 @@ machine-$(CONFIG_ARCH_HIGHBANK) += highbank machine-$(CONFIG_ARCH_KEYSTONE) += keystone # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD machine-$(CONFIG_KIRKWOOD) += kirkwood +machine-$(CONFIG_ARCH_MESON) += meson machine-$(CONFIG_ARCH_MVEBU) += mvebu # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA # TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X
arch/arm/include/asm/arch-meson/gxbb.h new file +10 -0
@@ -0,0 +1,10 @@ +/* +* (C) Copyright 2016 - Beniamino Galvani <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __GXBB_H__ +#define __GXBB_H__ + +#endif /* __GXBB_H__ */
arch/arm/mach-meson/Kconfig new file +31 -0
@@ -0,0 +1,31 @@ +if ARCH_MESON + +config MESON_GXBB + bool "Support Meson GXBaby" + select ARM64 + select DM + select DM_SERIAL + help + The Amlogic Meson GXBaby (S905) is an ARM SoC with a + quad-core Cortex-A53 CPU and a Mali-450 GPU. + +if MESON_GXBB + +config TARGET_ODROID_C2 + bool "ODROID-C2" + 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. + +endif + +config SYS_SOC + default "meson" + +config SYS_MALLOC_F_LEN + default 0x1000 + +source "board/hardkernel/odroid-c2/Kconfig" + +endif
arch/arm/mach-meson/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Copyright (c) 2016 Beniamino Galvani <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += board.o
arch/arm/mach-meson/board.c new file +45 -0
45 lines not on this page · raw message
board/hardkernel/odroid-c2/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_ODROID_C2 + +config SYS_BOARD + default "odroid-c2" + +config SYS_VENDOR + default "hardkernel" + +config SYS_CONFIG_NAME + default "odroid-c2" + +endif
board/hardkernel/odroid-c2/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +ODROID-C2 +M: Beniamino Galvani <[email protected]> +S: Maintained +F: board/hardkernel/odroid-c2 +F: include/configs/odroid-c2.h +F: configs/odroid-c2_defconfig
board/hardkernel/odroid-c2/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# (C) Copyright 2016 Beniamino Galvani <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := odroid-c2.o
board/hardkernel/odroid-c2/README new file +34 -0
@@ -0,0 +1,34 @@ +* U-Boot for ODROID-C2: quick guide + +** Compile u-boot + + > export ARCH=arm + > export CROSS_COMPILE=aarch64-none-elf- + > make odroid-c2_defconfig + > make + +** Create the image + + > DIR=odroid-c2 + > git clone --depth 1 \ + https://github.com/hardkernel/u-boot.git -b odroidc2-v2015.01 \ + $DIR + > $DIR/fip/fip_create --bl30 $DIR/fip/gxb/bl30.bin \ + --bl301 $DIR/fip/gxb/bl301.bin \ + --bl31 $DIR/fip/gxb/bl31.bin \ + --bl33 u-boot.bin \ + $DIR/fip.bin + > $DIR/fip/fip_create --dump $DIR/fip.bin + > cat $DIR/fip/gxb/bl2.package $DIR/fip.bin > $DIR/boot_new.bin + > $DIR/fip/gxb/aml_encrypt_gxb --bootsig \ + --input $DIR/boot_new.bin \ + --output $DIR/u-boot.img + > dd if=$DIR/u-boot.img of=$DIR/u-boot.gxbb bs=512 skip=96 + +** Write u-boot to a SD card + + > DEV=/dev/your_sd_device + > BL1=$DIR/sd_fuse/bl1.bin.hardkernel + > dd if=$BL1 of=$DEV conv=fsync bs=1 count=442 + > dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1 + > dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97
board/hardkernel/odroid-c2/odroid-c2.c new file +7 -0
@@ -0,0 +1,7 @@ +/* +* (C) Copyright 2016 Beniamino Galvani <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h>
configs/odroid-c2_defconfig new file +11 -0
@@ -0,0 +1,11 @@ +CONFIG_ARM=y +CONFIG_ARCH_MESON=y +CONFIG_MESON_GXBB=y +CONFIG_TARGET_ODROID_C2=y +# CONFIG_CMD_BDI is not set +# CONFIG_CMD_IMI is not set +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_LOADS is not set +# CONFIG_CMD_FPGA is not set +# CONFIG_CMD_SOURCE is not set +# CONFIG_CMD_SETEXPR is not set
include/configs/odroid-c2.h new file +55 -0
55 lines not on this page · raw message
Signature · 1 line
2.4.3
PATCH 2/5 arm: dts: import Meson files
In reply to Beniamino GalvaniImport the device tree file for Meson GXBB from linux kernel and the one for ODROID-C2 posted to the arm-kernel list [1].
[1] http://thread.gmane.org/gmane.linux.ports.arm.kernel/487948
--- arch/arm/dts/Makefile | 2 + arch/arm/dts/meson-gxbb-odroidc2.dts | 65 +++++++++++ arch/arm/dts/meson-gxbb.dtsi | 211 +++++++++++++++++++++++++++++++++++ 3 files changed, 278 insertions(+) create mode 100644 arch/arm/dts/meson-gxbb-odroidc2.dts create mode 100644 arch/arm/dts/meson-gxbb.dtsi
arch/arm/dts/Makefile +2 -0
@@ -24,6 +24,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \ rk3288-jerry.dtb \ rk3288-rock2-square.dtb \ rk3036-sdk.dtb +dtb-$(CONFIG_ARCH_MESON) += \ + meson-gxbb-odroidc2.dtb dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ tegra20-paz00.dtb \
arch/arm/dts/meson-gxbb-odroidc2.dts new file +65 -0
65 lines not on this page · raw message
arch/arm/dts/meson-gxbb.dtsi new file +211 -0
211 lines not on this page · raw message
Signature · 1 line
2.4.3
PATCH 3/5 serial: add support for Amlogic Meson UART
In reply to Beniamino GalvaniImplement a driver for the UART adapter available in Meson SoCs.
--- drivers/serial/Kconfig | 14 ++++ drivers/serial/Makefile | 1 + drivers/serial/serial_meson.c | 162 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 177 insertions(+) create mode 100644 drivers/serial/serial_meson.c
drivers/serial/Kconfig +14 -0
@@ -112,6 +112,14 @@ config DEBUG_UART_S5P will need to provide parameters to make this work. The driver will be available until the real driver-model serial is running. +config DEBUG_UART_MESON + bool "Amlogic Meson" + depends on MESON_SERIAL + help + Select this to enable a debug UART using the serial_meson driver. You + will need to provide parameters to make this work. The driver will + be available until the real driver-model serial is running. + config DEBUG_UART_UARTLITE bool "Xilinx Uartlite" help
@@ -320,4 +328,10 @@ config XILINX_UARTLITE If you have a Xilinx based board and want to use the uartlite serial ports, say Y to this option. If unsure, say N. +config MESON_SERIAL + bool "Support for Amlogic Meson UART" + depends on DM_SERIAL && ARCH_MESON + help + If you have an Amlogic Meson based board and want to use the on-chip + serial ports, say Y to this option. If unsure, say N. endmenu
drivers/serial/Makefile +1 -0
@@ -26,6 +26,7 @@ obj-$(CONFIG_SYS_NS16550) += ns16550.o obj-$(CONFIG_S5P) += serial_s5p.o obj-$(CONFIG_MXC_UART) += serial_mxc.o obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o +obj-$(CONFIG_MESON_SERIAL) += serial_meson.o obj-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o obj-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o obj-$(CONFIG_SANDBOX_SERIAL) += sandbox.o
drivers/serial/serial_meson.c new file +162 -0
162 lines not on this page · raw message
Signature · 1 line
2.4.3
PATCH 4/5 arm: meson: use device tree
In reply to Beniamino GalvaniConvert the board and config files to the use of device tree.
--- arch/arm/mach-meson/board.c | 24 ++++++++++++++++++++++++ configs/odroid-c2_defconfig | 2 ++ 2 files changed, 26 insertions(+)
arch/arm/mach-meson/board.c +24 -0
@@ -5,6 +5,8 @@*/ #include <common.h> +#include <libfdt.h> +#include <linux/err.h> #include <asm/arch/gxbb.h> #include <asm/armv8/mmu.h>
@@ -17,9 +19,31 @@ int board_init(void)int dram_init (void ) { +const fdt32_t *val; +int offset; +int len; + + offset =fdt_path_offset (gd->fdt_blob,"/memory" ); +if (offset <0 ) +return -EINVAL ; + + val =fdt_getprop (gd->fdt_blob, offset,"reg" , &len); +if (len <sizeof (*val) *4 ) +return -EINVAL ; + +/* Don't use fdt64_t to avoid unaligned access */ + gd->ram_size = (uint64_t )fdt32_to_cpu (val[2 ]) <<32 ; + gd->ram_size |=fdt32_to_cpu (val[3 ]); +return 0 ; } +void dram_init_banksize (void ) +{ + gd->bd->bi_dram[0 ].start =CONFIG_SYS_SDRAM_BASE ; + gd->bd->bi_dram[0 ].size = gd->ram_size; +} +void reset_cpu (ulong addr) { }
configs/odroid-c2_defconfig +2 -0
@@ -2,6 +2,8 @@ CONFIG_ARM=y CONFIG_ARCH_MESON=y CONFIG_MESON_GXBB=y CONFIG_TARGET_ODROID_C2=y +CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2" +CONFIG_OF_CONTROL=y # CONFIG_CMD_BDI is not set # CONFIG_CMD_IMI is not set # CONFIG_CMD_IMLS is not set
Signature · 1 line
2.4.3
PATCH 5/5 meson: odroid-c2: enable serial
In reply to Beniamino GalvaniEnable serial support in the ODROID-C2 configuration.
--- configs/odroid-c2_defconfig | 5 +++++ 1 file changed, 5 insertions(+)
configs/odroid-c2_defconfig +5 -0
@@ -4,6 +4,11 @@ CONFIG_MESON_GXBB=y CONFIG_TARGET_ODROID_C2=y CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2" CONFIG_OF_CONTROL=y +CONFIG_MESON_SERIAL=y +CONFIG_DEBUG_UART_MESON=y +GONFIG_DEBUG_UART_BASE=0xc81004c0 +CONFIG_DEBUG_UART_ANNOUNCE=y +CONFIG_DEBUG_UART_SKIP_INIT=y # CONFIG_CMD_BDI is not set # CONFIG_CMD_IMI is not set # CONFIG_CMD_IMLS is not set
Signature · 1 line
2.4.3
PATCH 5/5 meson: odroid-c2: enable serial
Quoted 12 lines · Beniamino Galvani
Enable serial support in the ODROID-C2 configuration.
Signed-off-by Beniamino Galvani <[email protected]>--- configs/odroid-c2_defconfig | 5 +++++ 1 file changed, 5 insertions(+)configs/odroid-c2_defconfig +0
-0
configs/odroid-c2_defconfig CONFIG_MESON_GXBB=y · line 9
Quoted 6 lines
configs/odroid-c2_defconfig +3
-0@@ -4,6 +4,11 @@ CONFIG_MESON_GXBB=y CONFIG_TARGET_ODROID_C2=y CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2" CONFIG_OF_CONTROL=y +CONFIG_MESON_SERIAL=y +CONFIG_DEBUG_UART_MESON=y +GONFIG_DEBUG_UART_BASE=0xc81004c0
s/GONFIG/CONFIG/
Quoted 7 lines
configs/odroid-c2_defconfig +2
-1+CONFIG_DEBUG_UART_ANNOUNCE=y +CONFIG_DEBUG_UART_SKIP_INIT=y # CONFIG_CMD_BDI is not set # CONFIG_CMD_IMI is not set # CONFIG_CMD_IMLS is not set --2.4.3
Signature · 1 line
Carlo Caione | +39.340.80.30.096 | Endless
PATCH 5/5 meson: odroid-c2: enable serial
Quoted 22 lines · Carlo Caione
Quoted 12 lines · Beniamino Galvani
Enable serial support in the ODROID-C2 configuration.
Signed-off-by Beniamino Galvani <[email protected]>--- configs/odroid-c2_defconfig | 5 +++++ 1 file changed, 5 insertions(+)configs/odroid-c2_defconfig +0
-0configs/odroid-c2_defconfig CONFIG_MESON_GXBB=y · line 9
Quoted 6 lines
configs/odroid-c2_defconfig +3
-0@@ -4,6 +4,11 @@ CONFIG_MESON_GXBB=y CONFIG_TARGET_ODROID_C2=y CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2" CONFIG_OF_CONTROL=y +CONFIG_MESON_SERIAL=y +CONFIG_DEBUG_UART_MESON=y +GONFIG_DEBUG_UART_BASE=0xc81004c0s/GONFIG/CONFIG/
Quoted 5 lines
configs/odroid-c2_defconfig CONFIG_MESON_GXBB=y · line 14
Quoted 5 lines
configs/odroid-c2_defconfig +2
-0+CONFIG_DEBUG_UART_ANNOUNCE=y +CONFIG_DEBUG_UART_SKIP_INIT=y # CONFIG_CMD_BDI is not set # CONFIG_CMD_IMI is not set # CONFIG_CMD_IMLS is not set
... and do a 'make savedefconfig' and copy the defconfig file to configs/odroid-c2_defconfig next time :)
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160329/48043425/attachment.sig>
PATCH 5/5 meson: odroid-c2: enable serial
Quoted 2 lines · Tom Rini
... and do a 'make savedefconfig' and copy the defconfig file to configs/odroid-c2_defconfig next time :)
Good to know, thanks!
Beniamino
PATCH 5/5 meson: odroid-c2: enable serial
In reply to Carlo CaioneQuoted 8 lines · Carlo Caione
Quoted 7 lines · Beniamino Galvani
Enable serial support in the ODROID-C2 configuration.
Signed-off-by Beniamino Galvani <[email protected]>--- configs/odroid-c2_defconfig | 5 +++++ 1 file changed, 5 insertions(+)
Quoted 13 lines
configs/odroid-c2_defconfig CONFIG_MESON_GXBB=y · line 9
Quoted 11 lines
configs/odroid-c2_defconfig +3
-0@@ -4,6 +4,11 @@ CONFIG_MESON_GXBB=y CONFIG_TARGET_ODROID_C2=y CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2" CONFIG_OF_CONTROL=y +CONFIG_MESON_SERIAL=y +CONFIG_DEBUG_UART_MESON=y +GONFIG_DEBUG_UART_BASE=0xc81004c0s/GONFIG/CONFIG/
Yeah, I guess it's because C and G are next to each other on the keyboard :)
Beniamino
cover Basic support for Amlogic GXBaby and ODROID-C2
In reply to Beniamino GalvaniQuoted 10 lines · Beniamino Galvani
Hi,
this series adds a very basic support for Amlogic S905 SoC (GXBaby) and for the ODROID-C2 board [1], and is based on u-boot sources available from the board vendor [2].
Mainline kernel support is still in early stages [3] and the plan is to add more features to u-boot (mmc, ethernet, ...) as soon as they are available in the kernel; this submission only includes definition of platform, board and UART support.
Thank you Beniamino for this. Could you please keep linux-meson at googlegroups.com in CC for the next submissions?
Cheers,
Signature · 1 line
Carlo Caione
cover Basic support for Amlogic GXBaby and ODROID-C2
Quoted 2 lines
Thank you Beniamino for this. Could you please keep linux-meson at googlegroups.com in CC for the next submissions?
I will surely do, thanks for testing.
Beniamino