From patchwork Sun Apr 3 07:18:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Beniamino Galvani X-Patchwork-Id: 605523 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3qd61K3Z0cz9t3Z for ; Sun, 3 Apr 2016 17:19:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ks09dvFN; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D57BBA763F; Sun, 3 Apr 2016 09:18:57 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N6dJ8NJEMxO9; Sun, 3 Apr 2016 09:18:57 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 520F9A7639; Sun, 3 Apr 2016 09:18:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6961BA7521 for ; Sun, 3 Apr 2016 09:18:46 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wL9odQjTD6LH for ; Sun, 3 Apr 2016 09:18:46 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by theia.denx.de (Postfix) with ESMTPS id 1B461A750E for ; Sun, 3 Apr 2016 09:18:42 +0200 (CEST) Received: by mail-lf0-f66.google.com with SMTP id r62so4392195lfd.0 for ; Sun, 03 Apr 2016 00:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NYGx9yet+YdWkabeRuubKmB+NWxrlNQtqLvk50CqEHY=; b=ks09dvFNBlhyAOCeNzGike8v6Wj09WZRERtWEfPXop2ivOAMlWiMdmIjjVfUodBwVm PuV5EABvuhUUEcvMOSlGeIrDzD3HJrtePUNjHwkLi2lkf3as4it8JI9Penn3kWx4asWh xilRtLZ0zrp0f6+UfLXaVZcWIvD5t8I3cZ87tgWf/EYF4GjuTf8pz8sevGU5/nueTsDE i73fBqLAanX9ZQ3xhjRiYzkQnwUZ2y+0QLiJv9hNP9i7q7PXjWdsQ8ruX/BSNtLWjaOc vvAYdsPvhH88tEKSAQNhd738iIgW6gn2FWk2tA3TC/ILt620hjEFjKFCsJveEnqsNgPj 7guQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NYGx9yet+YdWkabeRuubKmB+NWxrlNQtqLvk50CqEHY=; b=IBkcoD/TLL9x1afWm97p39ZWWdKtp4Hh4tsOSM4JFKAWjmMG0t7sbinhhdqaWq6xyR y2LncmzOLwiIfuPfLbp7hPd6Z3M3nbwMfzoOBj3Sfxx96Q5gpvoG6Dvg/WG953vjhlkV WuJdDvK+iJgrU2nIwujgSmqvj3QNEPJsBIx4XBinzZRESvTNNzCemNLJBBMoHAUWjvay FMG9Obj/FEG/ntA4BK/BEvaKXGx2Owiw4i2QpRAWGLmKQqte6WV8FkX5V9M98E63lCWa KweaxWdp1opENcTYoZKfX44E6+6//Z4LHR+n9AevUtfmvmXdFRxv3X50DCKyQEXqe1U1 sPUw== X-Gm-Message-State: AD7BkJIIA3JYPEAdMq6W7341gL8IccbVAwUiuy0HC1r226QufFv3aakwh7Hiq3h1n/WCDw== X-Received: by 10.194.60.165 with SMTP id i5mr13564462wjr.178.1459667922290; Sun, 03 Apr 2016 00:18:42 -0700 (PDT) Received: from shire.fritz.box (host202-96-dynamic.51-79-r.retail.telecomitalia.it. [79.51.96.202]) by smtp.gmail.com with ESMTPSA id 138sm7282447wmf.13.2016.04.03.00.18.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Apr 2016 00:18:41 -0700 (PDT) From: Beniamino Galvani To: u-boot@lists.denx.de Date: Sun, 3 Apr 2016 09:18:09 +0200 Message-Id: <1459667897-2824-2-git-send-email-b.galvani@gmail.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1459667897-2824-1-git-send-email-b.galvani@gmail.com> References: <1459667897-2824-1-git-send-email-b.galvani@gmail.com> Cc: Tom Rini , linux-meson@googlegroups.com, Joe Hershberger , Carlo Caione Subject: [U-Boot] [PATCH v2 1/9] arm: add initial support for Amlogic Meson and ODROID-C2 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Support the Amlogic Meson GXBaby platform. Signed-off-by: Beniamino Galvani --- 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 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index b82ec18..c768ab4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -456,6 +456,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 @@ -770,6 +773,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" diff --git a/arch/arm/Makefile b/arch/arm/Makefile index ce006ae..4df4e7a 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -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 diff --git a/arch/arm/include/asm/arch-meson/gxbb.h b/arch/arm/include/asm/arch-meson/gxbb.h new file mode 100644 index 0000000..0eec270 --- /dev/null +++ b/arch/arm/include/asm/arch-meson/gxbb.h @@ -0,0 +1,10 @@ +/* + * (C) Copyright 2016 - Beniamino Galvani + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __GXBB_H__ +#define __GXBB_H__ + +#endif /* __GXBB_H__ */ diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig new file mode 100644 index 0000000..77d3cfe --- /dev/null +++ b/arch/arm/mach-meson/Kconfig @@ -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 diff --git a/arch/arm/mach-meson/Makefile b/arch/arm/mach-meson/Makefile new file mode 100644 index 0000000..44e3d63 --- /dev/null +++ b/arch/arm/mach-meson/Makefile @@ -0,0 +1,7 @@ +# +# Copyright (c) 2016 Beniamino Galvani +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += board.o diff --git a/arch/arm/mach-meson/board.c b/arch/arm/mach-meson/board.c new file mode 100644 index 0000000..346a2c2 --- /dev/null +++ b/arch/arm/mach-meson/board.c @@ -0,0 +1,45 @@ +/* + * (C) Copyright 2016 Beniamino Galvani + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int board_init(void) +{ + return 0; +} + +int dram_init(void) +{ + return 0; +} + +void reset_cpu(ulong addr) +{ +} + +static struct mm_region gxbb_mem_map[] = { + { + .base = 0x0UL, + .size = 0x80000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | + PTE_BLOCK_INNER_SHARE + }, { + .base = 0x80000000UL, + .size = 0x80000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | + PTE_BLOCK_NON_SHARE | + PTE_BLOCK_PXN | PTE_BLOCK_UXN + }, { + /* List terminator */ + 0, + } +}; + +struct mm_region *mem_map = gxbb_mem_map; diff --git a/board/hardkernel/odroid-c2/Kconfig b/board/hardkernel/odroid-c2/Kconfig new file mode 100644 index 0000000..687d9c6 --- /dev/null +++ b/board/hardkernel/odroid-c2/Kconfig @@ -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 diff --git a/board/hardkernel/odroid-c2/MAINTAINERS b/board/hardkernel/odroid-c2/MAINTAINERS new file mode 100644 index 0000000..23ae1e7 --- /dev/null +++ b/board/hardkernel/odroid-c2/MAINTAINERS @@ -0,0 +1,6 @@ +ODROID-C2 +M: Beniamino Galvani +S: Maintained +F: board/hardkernel/odroid-c2/ +F: include/configs/odroid-c2.h +F: configs/odroid-c2_defconfig diff --git a/board/hardkernel/odroid-c2/Makefile b/board/hardkernel/odroid-c2/Makefile new file mode 100644 index 0000000..571044b --- /dev/null +++ b/board/hardkernel/odroid-c2/Makefile @@ -0,0 +1,7 @@ +# +# (C) Copyright 2016 Beniamino Galvani +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := odroid-c2.o diff --git a/board/hardkernel/odroid-c2/README b/board/hardkernel/odroid-c2/README new file mode 100644 index 0000000..b900694 --- /dev/null +++ b/board/hardkernel/odroid-c2/README @@ -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 diff --git a/board/hardkernel/odroid-c2/odroid-c2.c b/board/hardkernel/odroid-c2/odroid-c2.c new file mode 100644 index 0000000..6a1485f --- /dev/null +++ b/board/hardkernel/odroid-c2/odroid-c2.c @@ -0,0 +1,7 @@ +/* + * (C) Copyright 2016 Beniamino Galvani + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig new file mode 100644 index 0000000..8e6df12 --- /dev/null +++ b/configs/odroid-c2_defconfig @@ -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 diff --git a/include/configs/odroid-c2.h b/include/configs/odroid-c2.h new file mode 100644 index 0000000..0e9ad1c --- /dev/null +++ b/include/configs/odroid-c2.h @@ -0,0 +1,55 @@ +/* + * Configuration for ODROID-C2 + * (C) Copyright 2016 Beniamino Galvani + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CONFIG_CPU_ARMV8 +#define CONFIG_REMAKE_ELF +#define CONFIG_SYS_CACHELINE_SIZE 64 +#define CONFIG_SYS_NO_FLASH +#define CONFIG_NR_DRAM_BANKS 1 +#define CONFIG_ENV_IS_NOWHERE 1 +#define CONFIG_ENV_SIZE 0x2000 +#define CONFIG_SYS_MAXARGS 32 +#define CONFIG_SYS_MALLOC_LEN (32 << 20) +#define CONFIG_SYS_CBSIZE 1024 +#define CONFIG_DISPLAY_BOARDINFO + +#define CONFIG_SYS_SDRAM_BASE 0 +#define CONFIG_SYS_TEXT_BASE 0x01000000 +#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 + +#if !defined(CONFIG_IDENT_STRING) +# define CONFIG_IDENT_STRING " odroid-c2" +#endif + +/* Serial setup */ +#define CONFIG_CONS_INDEX 0 +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE \ + { 4800, 9600, 19200, 38400, 57600, 115200 } + +#define CONFIG_CMD_ENV + +/* Monitor Command Prompt */ +/* Console I/O Buffer Size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_SYS_HUSH_PARSER +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE +#define CONFIG_SYS_LONGHELP +#define CONFIG_CMDLINE_EDITING + +#include + +#endif /* __CONFIG_H */