From patchwork Thu Jun 9 14:45:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlo Caione X-Patchwork-Id: 633046 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 3rQWzl564gz9sDX for ; Fri, 10 Jun 2016 03:11:15 +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=qIjX/ppe; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9C51DB3832; Thu, 9 Jun 2016 19:10:53 +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 2scASny1Tncr; Thu, 9 Jun 2016 19:10:53 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D8B84A75B6; Thu, 9 Jun 2016 19:10:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 47C2CA7532 for ; Thu, 9 Jun 2016 16:45:55 +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 jHxTYQjn4NID for ; Thu, 9 Jun 2016 16:45:55 +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-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by theia.denx.de (Postfix) with ESMTPS id 1DD78A7517 for ; Thu, 9 Jun 2016 16:45:52 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id k184so11250749wme.2 for ; Thu, 09 Jun 2016 07:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=xEzBEPoNI5bQ7/WhkDJtJ9Mg8m+S7/4Q0rk9uQoJ3Dc=; b=qIjX/ppepJxvGQMr3Zaf66PUjUtTm8xcBNyZh/KxJ/U1RoBtGr6Y6WMAUiGy6ndzNI cS3lAcdQFEMXUodxl+Jffx43W4sapSbqGnPjnGnvjNnMjZClrY/iIlM0HN4BscIppJS6 qon9XwTE46fY9s1jLfaJom6lu21w9AbIFWrR5yDkB71GoZfQ4ac9lPPDw1dcFjm+IUdP vOYgfMqSSyOEI2oqb6F2laDnoTHh3aIENsBYSIgKAU7acetcx/OHFetNdTF7uOctoEJl E515v/hUMUJqL93vDdy5OFxVAMlSIrMOKZa6+MwKQkwlXSk7Zm4PrFbQPKmMvVUKddne z47w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=xEzBEPoNI5bQ7/WhkDJtJ9Mg8m+S7/4Q0rk9uQoJ3Dc=; b=kUN74n/ZWfxRMWyB4P42LkwOgmkPP9/IRXz06Hi+dperVBQzbhctBmt00Bz2J4LcLE DeWukY+ZfEA4/ccearc8xGorjHj9lLWWZKY/6P9gtf7aLPde8SKBanot6T9eSTuZDaWj UxbzDwJeZ3dpdXGnxtQVAx9quFLvsmalZ1BhbQk+W5awdURWZw1alWW118ruLT+Ng1c3 SoaSRrkSzIwkBtKPcU7AWxPECYxzJ5hIH5xWdfOtRvXHe2X/ctOHcewa7P/ck5um4xEn wo7CsQSPebqJQEmxcEPpKTfggtzwNM6sg/PHlPb6FoFZXgwqHxQFU0vxUzUXrS5TlUFD eX4w== X-Gm-Message-State: ALyK8tIShZDeYMcJ9qyiz0ozGoSdHxJrRDoqDRY45/J8uV0EZpqCYH/g7OV2qlw4We8kWA== X-Received: by 10.194.205.105 with SMTP id lf9mr9927449wjc.25.1465483551860; Thu, 09 Jun 2016 07:45:51 -0700 (PDT) Received: from localhost.localdomain (2-238-57-164.ip242.fastwebnet.it. [2.238.57.164]) by smtp.gmail.com with ESMTPSA id uq7sm7434153wjc.19.2016.06.09.07.45.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jun 2016 07:45:51 -0700 (PDT) From: Carlo Caione To: u-boot@lists.denx.de, b.galvani@gmail.com, sjg@chromium.org, albert.u.boot@aribaud.net, trini@konsulko.com, linux-amlogic@lists.infradead.org Date: Thu, 9 Jun 2016 16:45:43 +0200 Message-Id: <1465483543-2240-3-git-send-email-carlo@caione.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1465483543-2240-1-git-send-email-carlo@caione.org> References: <1465483543-2240-1-git-send-email-carlo@caione.org> X-Mailman-Approved-At: Thu, 09 Jun 2016 19:10:34 +0200 Cc: Carlo Caione Subject: [U-Boot] [PATCH 2/2] board: amlogic: Rename folder for Amlogic boards 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" From: Carlo Caione s/hardkernel/amlogic/ to have a single place for all the amlogic-based boards. Signed-off-by: Carlo Caione Reviewed-by: Simon Glass --- arch/arm/mach-meson/Kconfig | 2 +- board/amlogic/odroid-c2/Kconfig | 12 ++++++ board/amlogic/odroid-c2/MAINTAINERS | 6 +++ board/amlogic/odroid-c2/Makefile | 7 ++++ board/amlogic/odroid-c2/README | 60 ++++++++++++++++++++++++++++++ board/amlogic/odroid-c2/odroid-c2.c | 67 ++++++++++++++++++++++++++++++++++ board/hardkernel/odroid-c2/Kconfig | 12 ------ board/hardkernel/odroid-c2/MAINTAINERS | 6 --- board/hardkernel/odroid-c2/Makefile | 7 ---- board/hardkernel/odroid-c2/README | 60 ------------------------------ board/hardkernel/odroid-c2/odroid-c2.c | 67 ---------------------------------- 11 files changed, 153 insertions(+), 153 deletions(-) create mode 100644 board/amlogic/odroid-c2/Kconfig create mode 100644 board/amlogic/odroid-c2/MAINTAINERS create mode 100644 board/amlogic/odroid-c2/Makefile create mode 100644 board/amlogic/odroid-c2/README create mode 100644 board/amlogic/odroid-c2/odroid-c2.c delete mode 100644 board/hardkernel/odroid-c2/Kconfig delete mode 100644 board/hardkernel/odroid-c2/MAINTAINERS delete mode 100644 board/hardkernel/odroid-c2/Makefile delete mode 100644 board/hardkernel/odroid-c2/README delete mode 100644 board/hardkernel/odroid-c2/odroid-c2.c diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig index 77d3cfe..af3be59 100644 --- a/arch/arm/mach-meson/Kconfig +++ b/arch/arm/mach-meson/Kconfig @@ -26,6 +26,6 @@ config SYS_SOC config SYS_MALLOC_F_LEN default 0x1000 -source "board/hardkernel/odroid-c2/Kconfig" +source "board/amlogic/odroid-c2/Kconfig" endif diff --git a/board/amlogic/odroid-c2/Kconfig b/board/amlogic/odroid-c2/Kconfig new file mode 100644 index 0000000..2b16889 --- /dev/null +++ b/board/amlogic/odroid-c2/Kconfig @@ -0,0 +1,12 @@ +if TARGET_ODROID_C2 + +config SYS_BOARD + default "odroid-c2" + +config SYS_VENDOR + default "amlogic" + +config SYS_CONFIG_NAME + default "odroid-c2" + +endif diff --git a/board/amlogic/odroid-c2/MAINTAINERS b/board/amlogic/odroid-c2/MAINTAINERS new file mode 100644 index 0000000..699850f --- /dev/null +++ b/board/amlogic/odroid-c2/MAINTAINERS @@ -0,0 +1,6 @@ +ODROID-C2 +M: Beniamino Galvani +S: Maintained +F: board/amlogic/odroid-c2/ +F: include/configs/odroid-c2.h +F: configs/odroid-c2_defconfig diff --git a/board/amlogic/odroid-c2/Makefile b/board/amlogic/odroid-c2/Makefile new file mode 100644 index 0000000..571044b --- /dev/null +++ b/board/amlogic/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/amlogic/odroid-c2/README b/board/amlogic/odroid-c2/README new file mode 100644 index 0000000..d6d266a --- /dev/null +++ b/board/amlogic/odroid-c2/README @@ -0,0 +1,60 @@ +U-Boot for ODROID-C2 +==================== + +ODROID-C2 is a single board computer manufactured by Hardkernel +Co. Ltd with the following specifications: + + - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 2GHz + - ARM Mali 450 GPU + - 2GB DDR3 SDRAM + - Gigabit Ethernet + - HDMI 2.0 4K/60Hz display + - 40-pin GPIO header + - 4 x USB 2.0 Host, 1 x USB OTG + - eMMC, microSD + - Infrared receiver + +Schematics are available on the manufacturer website. + +Currently the u-boot port supports the following devices: + - serial + - Ethernet + +u-boot compilation +================== + + > export ARCH=arm + > export CROSS_COMPILE=aarch64-none-elf- + > make odroid-c2_defconfig + > make + +Image creation +============== + +Amlogic doesn't provide sources for the firmware and for tools needed +to create the bootloader image, so it is necessary to obtain them from +the git tree published by the board vendor: + + > 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 + +and then write the image to SD with: + + > 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/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c new file mode 100644 index 0000000..bd72100 --- /dev/null +++ b/board/amlogic/odroid-c2/odroid-c2.c @@ -0,0 +1,67 @@ +/* + * (C) Copyright 2016 Beniamino Galvani + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include +#include +#include +#include + +#define EFUSE_SN_OFFSET 20 +#define EFUSE_SN_SIZE 16 +#define EFUSE_MAC_OFFSET 52 +#define EFUSE_MAC_SIZE 6 + +int board_init(void) +{ + return 0; +} + +static const struct eth_pdata gxbb_eth_pdata = { + .iobase = GXBB_ETH_BASE, + .phy_interface = PHY_INTERFACE_MODE_RGMII, +}; + +U_BOOT_DEVICE(meson_eth) = { + .name = "eth_designware", + .platdata = &gxbb_eth_pdata, +}; + +int misc_init_r(void) +{ + u8 mac_addr[EFUSE_MAC_SIZE]; + ssize_t len; + + /* Select Ethernet function */ + setbits_le32(GXBB_PINMUX(6), 0x3fff); + + /* Set RGMII mode */ + setbits_le32(GXBB_ETH_REG_0, GXBB_ETH_REG_0_PHY_INTF | + GXBB_ETH_REG_0_TX_PHASE(1) | + GXBB_ETH_REG_0_TX_RATIO(4) | + GXBB_ETH_REG_0_PHY_CLK_EN | + GXBB_ETH_REG_0_CLK_EN); + + /* Enable power and clock gate */ + setbits_le32(GXBB_GCLK_MPEG_1, GXBB_GCLK_MPEG_1_ETH); + clrbits_le32(GXBB_MEM_PD_REG_0, GXBB_MEM_PD_REG_0_ETH_MASK); + + /* Reset PHY on GPIOZ_14 */ + clrbits_le32(GXBB_GPIO_EN(3), BIT(14)); + clrbits_le32(GXBB_GPIO_OUT(3), BIT(14)); + mdelay(10); + setbits_le32(GXBB_GPIO_OUT(3), BIT(14)); + + if (!eth_getenv_enetaddr("ethaddr", mac_addr)) { + len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, + mac_addr, EFUSE_MAC_SIZE); + if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) + eth_setenv_enetaddr("ethaddr", mac_addr); + } + + return 0; +} diff --git a/board/hardkernel/odroid-c2/Kconfig b/board/hardkernel/odroid-c2/Kconfig deleted file mode 100644 index 687d9c6..0000000 --- a/board/hardkernel/odroid-c2/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 23ae1e7..0000000 --- a/board/hardkernel/odroid-c2/MAINTAINERS +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index 571044b..0000000 --- a/board/hardkernel/odroid-c2/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -# (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 deleted file mode 100644 index d6d266a..0000000 --- a/board/hardkernel/odroid-c2/README +++ /dev/null @@ -1,60 +0,0 @@ -U-Boot for ODROID-C2 -==================== - -ODROID-C2 is a single board computer manufactured by Hardkernel -Co. Ltd with the following specifications: - - - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 2GHz - - ARM Mali 450 GPU - - 2GB DDR3 SDRAM - - Gigabit Ethernet - - HDMI 2.0 4K/60Hz display - - 40-pin GPIO header - - 4 x USB 2.0 Host, 1 x USB OTG - - eMMC, microSD - - Infrared receiver - -Schematics are available on the manufacturer website. - -Currently the u-boot port supports the following devices: - - serial - - Ethernet - -u-boot compilation -================== - - > export ARCH=arm - > export CROSS_COMPILE=aarch64-none-elf- - > make odroid-c2_defconfig - > make - -Image creation -============== - -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: - - > 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 - -and then write the image to SD with: - - > 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 deleted file mode 100644 index bd72100..0000000 --- a/board/hardkernel/odroid-c2/odroid-c2.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * (C) Copyright 2016 Beniamino Galvani - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include -#include -#include -#include - -#define EFUSE_SN_OFFSET 20 -#define EFUSE_SN_SIZE 16 -#define EFUSE_MAC_OFFSET 52 -#define EFUSE_MAC_SIZE 6 - -int board_init(void) -{ - return 0; -} - -static const struct eth_pdata gxbb_eth_pdata = { - .iobase = GXBB_ETH_BASE, - .phy_interface = PHY_INTERFACE_MODE_RGMII, -}; - -U_BOOT_DEVICE(meson_eth) = { - .name = "eth_designware", - .platdata = &gxbb_eth_pdata, -}; - -int misc_init_r(void) -{ - u8 mac_addr[EFUSE_MAC_SIZE]; - ssize_t len; - - /* Select Ethernet function */ - setbits_le32(GXBB_PINMUX(6), 0x3fff); - - /* Set RGMII mode */ - setbits_le32(GXBB_ETH_REG_0, GXBB_ETH_REG_0_PHY_INTF | - GXBB_ETH_REG_0_TX_PHASE(1) | - GXBB_ETH_REG_0_TX_RATIO(4) | - GXBB_ETH_REG_0_PHY_CLK_EN | - GXBB_ETH_REG_0_CLK_EN); - - /* Enable power and clock gate */ - setbits_le32(GXBB_GCLK_MPEG_1, GXBB_GCLK_MPEG_1_ETH); - clrbits_le32(GXBB_MEM_PD_REG_0, GXBB_MEM_PD_REG_0_ETH_MASK); - - /* Reset PHY on GPIOZ_14 */ - clrbits_le32(GXBB_GPIO_EN(3), BIT(14)); - clrbits_le32(GXBB_GPIO_OUT(3), BIT(14)); - mdelay(10); - setbits_le32(GXBB_GPIO_OUT(3), BIT(14)); - - if (!eth_getenv_enetaddr("ethaddr", mac_addr)) { - len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, - mac_addr, EFUSE_MAC_SIZE); - if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); - } - - return 0; -}