From patchwork Fri May 4 17:27:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandeep Sheriker X-Patchwork-Id: 908912 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=microchip.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Jqwlg7dj"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40czbH30Mtz9s4t for ; Sat, 5 May 2018 03:31:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-ID:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=UEoRml0TGtaB/lOlPGkuUG5aqNbnb+Mxxv0OolHKBgc=; b=Jqwlg7djvbR26OJwog/0VfU+lI qjOeBb0sU/Xudq+s68S2hoxvX+EVsJRV1YFZFlxV2t19dmWXPImsUGnQBfgA5JT34ws7K15sRI0Jv WUofVudXWv6iR7UXKUg18FqbzZm5s38D5rQ+8be8u+RuhbGBiLl8UVmYhOBO7FyIgBygI9MGciOMc 1iYEpoLUosQCP+CPmgKKQG8mH4w8dqkiYpMfOCAcy04zc9FTzk8fcDVGPV7JHTFP31S+2wdpnJSlx 0fkglAZ5xwWEsAg5Zjf0CRpxG1nWc3+6znwFI+JgbEfrUlJQmCD15CqDbzD7Nf+WR4LAv6CG/J1Bj 8mpon49Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEeYh-0007jp-PJ; Fri, 04 May 2018 17:31:51 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEeVd-00052D-KL for lede-dev@lists.infradead.org; Fri, 04 May 2018 17:28:45 +0000 X-IronPort-AV: E=Sophos;i="5.49,363,1520924400"; d="scan'208";a="13889261" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 May 2018 10:28:27 -0700 Received: from sandeep-office.microchip.com (10.10.76.4) by chn-sv-exch02.mchp-main.com (10.10.76.38) with Microsoft SMTP Server id 14.3.352.0; Fri, 4 May 2018 10:28:26 -0700 From: Sandeep Sheriker Mallikarjun To: Date: Fri, 4 May 2018 10:27:51 -0700 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180504_102841_892053_74471343 X-CRM114-Status: GOOD ( 11.85 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [68.232.153.233 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record Subject: [LEDE-DEV] [PATCH v2 09/10] at91: Add SAMA5D2 PTC EK board X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add target device as at91-sama5d2_ptc_ek in SAMA5D2 subtarget and build images for SAMA5D2 PTC Ek board. Signed-off-by: Sandeep Sheriker Mallikarjun --- package/boot/at91bootstrap/Makefile | 16 +- package/boot/uboot-at91/Makefile | 18 +- target/linux/at91/base-files/lib/at91.sh | 3 + target/linux/at91/image/sama5d2.mk | 8 + ...105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch | 442 +++++++++++++++++++++ 5 files changed, 484 insertions(+), 3 deletions(-) create mode 100644 target/linux/at91/patches-4.9/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile index b350555..22afd1e 100644 --- a/package/boot/at91bootstrap/Makefile +++ b/package/boot/at91bootstrap/Makefile @@ -94,6 +94,18 @@ define AT91Bootstrap/sama5d27_som1_ekqspi_uboot BUILD_DEVICES:=at91-sama5d27_som1_ek endef +define AT91Bootstrap/sama5d2_ptc_eknf_uboot + TITLE:=AT91Bootstrap for SAMA5D2 PTC EK (Nand Flash) + BUILD_SUBTARGET:=sama5d2 + BUILD_DEVICES:=at91-sama5d2_ptc_ek +endef + +define AT91Bootstrap/sama5d2_ptc_eksd_uboot + TITLE:=AT91Bootstrap for SAMA5D2 PTC EK (SDCard) + BUILD_SUBTARGET:=sama5d2 + BUILD_DEVICES:=at91-sama5d2_ptc_ek +endef + AT91BOOTSTRAP_TARGETS := \ sama5d2_xplaineddf_uboot \ sama5d2_xplaineddf_qspi_uboot \ @@ -104,7 +116,9 @@ AT91BOOTSTRAP_TARGETS := \ sama5d4_xplaineddf_uboot_secure \ sama5d4_xplainedsd_uboot_secure \ sama5d27_som1_eksd_uboot \ - sama5d27_som1_ekqspi_uboot + sama5d27_som1_ekqspi_uboot \ + sama5d2_ptc_eknf_uboot \ + sama5d2_ptc_eksd_uboot define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile index fd58b90..f0a4ba5 100644 --- a/package/boot/uboot-at91/Makefile +++ b/package/boot/uboot-at91/Makefile @@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/kernel.mk define U-Boot/Default BUILD_TARGET:=at91 HIDDEN:=1 - UBOOT_IMAGE:=u-boot.bin boot.bin + UBOOT_IMAGE:=u-boot.bin endef define U-Boot/at91sam9m10g45ek_nandflash @@ -92,6 +92,18 @@ define U-Boot/sama5d27_som1_ek_spiflash BUILD_DEVICES:=at91-sama5d27_som1_ek endef +define U-Boot/sama5d2_ptc_ek_nandflash + NAME:=SAMA5D2 PTC Ek (Nand Flash) + BUILD_SUBTARGET:=sama5d2 + BUILD_DEVICES:=at91-sama5d2_ptc_ek +endef + +define U-Boot/sama5d2_ptc_ek_mmc + NAME:=SAMA5D2 PTC Ek (SDCard) + BUILD_SUBTARGET:=sama5d2 + BUILD_DEVICES:=at91-sama5d2_ptc_ek +endef + UBOOT_TARGETS := \ at91sam9m10g45ek_nandflash \ at91sam9x5ek_nandflash \ @@ -103,7 +115,9 @@ UBOOT_TARGETS := \ sama5d4_xplained_spiflash \ sama5d4_xplained_nandflash\ sama5d27_som1_ek_mmc \ - sama5d27_som1_ek_spiflash + sama5d27_som1_ek_spiflash \ + sama5d2_ptc_ek_nandflash \ + sama5d2_ptc_ek_mmc define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ diff --git a/target/linux/at91/base-files/lib/at91.sh b/target/linux/at91/base-files/lib/at91.sh index 5d31b67..ea38925 100755 --- a/target/linux/at91/base-files/lib/at91.sh +++ b/target/linux/at91/base-files/lib/at91.sh @@ -46,6 +46,9 @@ at91_board_detect() { *"Atmel SAMA5D27 SOM1 EK") name="sama5d27_som1_ek" ;; + *"Atmel SAMA5D2 PTC EK") + name="sama5d2_ptc_ek" + ;; *"SAMA5D2 Xplained") name="sama5d2_xplained" ;; diff --git a/target/linux/at91/image/sama5d2.mk b/target/linux/at91/image/sama5d2.mk index 28a6f93..b841448 100644 --- a/target/linux/at91/image/sama5d2.mk +++ b/target/linux/at91/image/sama5d2.mk @@ -21,3 +21,11 @@ define Device/at91-sama5d27_som1_ek $(Device/evaluation-sdimage) endef TARGET_DEVICES += at91-sama5d27_som1_ek + +define Device/at91-sama5d2_ptc_ek + $(Device/evaluation-dtb) + DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 PTC Ek + KERNEL_SIZE := 6144k + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d2_ptc_ek diff --git a/target/linux/at91/patches-4.9/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch b/target/linux/at91/patches-4.9/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch new file mode 100644 index 0000000..3da9955 --- /dev/null +++ b/target/linux/at91/patches-4.9/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch @@ -0,0 +1,442 @@ +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index c88e426..cb47e80 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -49,6 +49,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ + wb45n.dtb + dtb-$(CONFIG_SOC_SAM_V7) += \ + at91-kizbox2.dtb \ ++ at91-sama5d2_ptc_ek.dtb \ + at91-sama5d27_som1_ek.dtb \ + at91-sama5d2_xplained.dtb \ + at91-sama5d3_xplained.dtb \ +diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts +new file mode 100644 +index 0000000..257eaac +--- /dev/null ++++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts +@@ -0,0 +1,422 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR X11) ++/* ++ * at91-sama5d2_ptc_ek.dts - Device Tree file for SAMA5D2 PTC EK board ++ * ++ * Copyright (C) 2017 Microchip/Atmel, ++ * 2017 Wenyou Yang ++ * 2017 Ludovic Desroches ++ */ ++/dts-v1/; ++#include "sama5d2.dtsi" ++#include "sama5d2-pinfunc.h" ++#include ++#include ++#include ++ ++/ { ++ model = "Atmel SAMA5D2 PTC EK"; ++ compatible = "atmel,sama5d2-ptc_ek", "atmel,sama5d2", "atmel,sama5"; ++ ++ aliases { ++ serial0 = &uart0; ++ i2c0 = &i2c0; ++ i2c1 = &i2c1; ++ i2c2 = &i2c2; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory { ++ reg = <0x20000000 0x80000>; ++ }; ++ ++ clocks { ++ slow_xtal { ++ clock-frequency = <32768>; ++ }; ++ ++ main_xtal { ++ clock-frequency = <24000000>; ++ }; ++ }; ++ ++ ahb { ++ usb0: gadget@00300000 { ++ atmel,vbus-gpio = <&pioA PIN_PB11 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_usba_vbus>; ++ status = "okay"; ++ }; ++ ++ usb1: ohci@00400000 { ++ num-ports = <3>; ++ atmel,vbus-gpio = <0 ++ &pioA PIN_PB12 GPIO_ACTIVE_HIGH ++ 0 ++ >; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_usb_default>; ++ status = "okay"; ++ }; ++ ++ usb2: ehci@00500000 { ++ status = "okay"; ++ }; ++ ++ nand0: nand@80000000 { ++ nand-bus-width = <8>; ++ nand-ecc-mode = "hw"; ++ nand-on-flash-bbt; ++ atmel,has-pmecc; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_nand_default>; ++ status = "okay"; /* conflicts with sdmmc1 and qspi0 */ ++ ++ at91bootstrap@0 { ++ label = "bootstrap"; ++ reg = <0x0 0x40000>; ++ }; ++ ++ bootloader@40000 { ++ label = "bootloader"; ++ reg = <0x40000 0xc0000>; ++ }; ++ ++ bootloaderenv@0x100000 { ++ label = "bootloader env"; ++ reg = <0x100000 0x40000>; ++ }; ++ ++ bootloaderenvred@0x140000 { ++ label = "bootloader env redundant"; ++ reg = <0x140000 0x40000>; ++ }; ++ ++ dtb@180000 { ++ label = "device tree"; ++ reg = <0x180000 0x80000>; ++ }; ++ ++ kernel@200000 { ++ label = "kernel"; ++ reg = <0x200000 0x600000>; ++ }; ++ ++ rootfs@800000 { ++ label = "rootfs"; ++ reg = <0x800000 0x1f800000>; ++ }; ++ }; ++ ++ sdmmc0: sdio-host@a0000000 { ++ bus-width = <8>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_sdmmc0_default>; ++ status = "okay"; ++ }; ++ ++ apb { ++ pmc: pmc@f0014000 { ++ pmc_fast_restart { ++ compatible = "atmel,sama5d2-pmc-fast-startup"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ atmel,wakeup-rtc-timer; ++ ++ wkpin: input@0 { ++ reg = <0>; ++ }; ++ ++ gmac_wol: input@10 { ++ reg = <10>; ++ atmel,wakeup-active-high; ++ }; ++ }; ++ }; ++ ++ spi0: spi@f8000000 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_spi0_default>; ++ status = "okay"; ++ ++ /* ++ m25p80@0 { ++ compatible = "atmel,at25df321a"; ++ reg = <0>; ++ spi-max-frequency = <50000000>; ++ }; ++ */ ++ }; ++ ++ macb0: ethernet@f8008000 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_macb0_default &pinctrl_macb0_phy_irq>; ++ phy-mode = "rmii"; ++ status = "okay"; ++ ++ ethernet-phy@1 { ++ reg = <0x1>; ++ interrupt-parent = <&pioA>; ++ interrupts = <56 IRQ_TYPE_LEVEL_LOW>; ++ }; ++ }; ++ ++ uart0: serial@f801c000 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_uart0_default>; ++ atmel,use-dma-rx; ++ atmel,use-dma-tx; ++ status = "okay"; ++ }; ++ ++ uart2: serial@f8024000 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_uart2_default>; ++ atmel,use-dma-rx; ++ atmel,use-dma-tx; ++ status = "okay"; ++ }; ++ ++ i2c0: i2c@f8028000 { ++ dmas = <0>, <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_i2c0_default>; ++ i2c-sda-hold-time-ns = <350>; ++ status = "okay"; ++ }; ++ ++ flx0: flexcom@f8034000 { ++ atmel,flexcom-mode = ; ++ status = "okay"; ++ ++ i2c2: i2c@600 { ++ compatible = "atmel,sama5d2-i2c"; ++ reg = <0x600 0x200>; ++ interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>; ++ dmas = <0>, <0>; ++ dma-names = "tx", "rx"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ clocks = <&flx0_clk>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_flx0_default>; ++ atmel,fifo-size = <16>; ++ status = "okay"; ++ }; ++ }; ++ ++ shdwc@f8048010 { ++ atmel,shdwc-debouncer = <976>; ++ ++ input@0 { ++ reg = <0>; ++ atmel,wakeup-type = "low"; ++ }; ++ }; ++ ++ watchdog@f8048040 { ++ status = "okay"; ++ }; ++ ++ spi1: spi@fc000000 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_spi1_default>; ++ status = "okay"; ++ }; ++ ++ i2c1: i2c@fc028000 { ++ dmas = <0>, <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_i2c1_default>; ++ status = "okay"; ++ ++ at24@50 { ++ compatible = "24c02"; ++ reg = <0x50>; ++ pagesize = <8>; ++ }; ++ }; ++ ++ pinctrl@fc038000 { ++ pinctrl_flx0_default: flx0_default { ++ pinmux = , ++ ; ++ bias-disable; ++ }; ++ ++ pinctrl_i2c0_default: i2c0_default { ++ pinmux = , ++ ; ++ bias-disable; ++ }; ++ ++ pinctrl_i2c1_default: i2c1_default { ++ pinmux = , ++ ; ++ bias-disable; ++ }; ++ ++ pinctrl_key_gpio_default: key_gpio_default { ++ pinmux = ; ++ bias-pull-up; ++ }; ++ ++ pinctrl_led_gpio_default: led_gpio_default { ++ pinmux = , ++ , ++ ; ++ bias-pull-up; ++ }; ++ ++ pinctrl_macb0_default: macb0_default { ++ pinmux = , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ ; ++ bias-disable; ++ }; ++ ++ pinctrl_macb0_phy_irq: macb0_phy_irq { ++ pinmux = ; ++ bias-disable; ++ }; ++ ++ pinctrl_nand_default: nand_default { ++ re_we_data { ++ pinmux = , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ ; ++ bias-pull-up; ++ drive-strength = ; ++ }; ++ ++ ale_cle_rdy_cs { ++ pinmux = , ++ , ++ , ++ ; ++ bias-pull-up; ++ }; ++ }; ++ ++ pinctrl_sdmmc0_default: sdmmc0_default { ++ cmd_data { ++ pinmux = , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ ; ++ bias-pull-up; ++ }; ++ ++ ck_cd_vddsel { ++ pinmux = , ++ , ++ ; ++ bias-disable; ++ }; ++ }; ++ ++ pinctrl_spi0_default: spi0_default { ++ pinmux = , ++ , ++ , ++ ; ++ bias-disable; ++ }; ++ ++ pinctrl_spi1_default: spi1_default { ++ pinmux = , ++ , ++ , ++ ; ++ bias-disable; ++ }; ++ ++ pinctrl_uart0_default: uart0_default { ++ pinmux = , ++ ; ++ bias-disable; ++ }; ++ ++ pinctrl_uart2_default: uart2_default { ++ pinmux = , ++ ; ++ bias-disable; ++ }; ++ ++ pinctrl_usb_default: usb_default { ++ pinmux = ; ++ bias-disable; ++ }; ++ ++ pinctrl_usba_vbus: usba_vbus { ++ pinmux = ; ++ bias-disable; ++ }; ++ ++ }; ++ ++ ptc@fc060000 { ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ gpio_keys { ++ compatible = "gpio-keys"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_key_gpio_default>; ++ ++ bp1 { ++ label = "PB_USER"; ++ gpios = <&pioA PIN_PA10 GPIO_ACTIVE_LOW>; ++ linux,code = <0x104>; ++ wakeup-source; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_led_gpio_default>; ++ status = "okay"; ++ ++ red { ++ label = "red"; ++ gpios = <&pioA PIN_PB10 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ green { ++ label = "green"; ++ gpios = <&pioA PIN_PB8 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ blue { ++ label = "blue"; ++ gpios = <&pioA PIN_PB6 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++}; +-- +2.7.4