From patchwork Wed Dec 13 03:16:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 753509 Delivered-To: patch@linaro.org Received: by 2002:adf:e406:0:b0:336:3749:476e with SMTP id g6csp240752wrm; Tue, 12 Dec 2023 19:19:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYocnsVPKJAjFYqd+AJlN7cyMCJSJTrZ6+Te3GtEt4/W+1COs0Y2gL97RMBjW5c1WQl2fu X-Received: by 2002:a05:651c:b23:b0:2cb:efcd:6352 with SMTP id b35-20020a05651c0b2300b002cbefcd6352mr2993136ljr.1.1702437568948; Tue, 12 Dec 2023 19:19:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702437568; cv=none; d=google.com; s=arc-20160816; b=a7nAZ2SXjKR2UetoV6SvgNLd2kaa7lGzZysLN391WAvmDRoX42ZxHOUjq5QQO3Jdz8 obJCRsjHXVk6gHK6apknrzhc+5y8MDOwWMNkbyUJaxdpLN1ZbfgJSyAiH/oV3eumUwGv cfy6Wq8unAPUwXB70haNj9Qm/LU6fbEukINwO1s6rxKO6iENVeCyr7vo0PdUvjGbb0I1 eDgX43VVarIqpeL6kWFSNP2Omg+81eBS8FmAIdkIKkaqd8TVUM82aXwVDNMlDUew3aOm VeVv5gjAcKeThb1kFrTrNl4Hk17eU9gwNnAnTgZclBtjC2POIHiDTO3+/ZcOb6b6PvFe d5Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wCKfxk7RxxuQybzuaeY5DVICR5kE7xn8ldimDxWoUtQ=; fh=i3GCrODwsJq1Muv9k3S5+Rfq06zGsCgdpsCPDR990YA=; b=BWKYikF9O1V3bgPG7QPLOzIi9YHHZZhk9td62kBpg8bmCwbNKrvRqq2mhD2sl7/PGV 4sBYN4zHCsy6ghDimLMCZvFjX7BH6b91caFi/kx23QulpQtWTBgGPKLCFoq6bPHhFU9Z iO4+ZRAHWxDmHpvaWFxf0reC3NJJfxEtAaIsYGDuD3++exwZ5fZey5RxXpzkO6E6OKv9 UIHqp2CKM5mEoWzzMJORGyPbS/GoXs2ohxWIibFnsJo0AisTrBpy1RbRp5/GJUZbhnTW o/n6OdVyYOljbxF68I71A/FanRLqmxqdfmqpD5rHhH9WKUzuoNlg1YK/uScSR6ixegxL ideQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KYU0e5U5; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id j18-20020a2e3c12000000b002c9ff045803si3492383lja.42.2023.12.12.19.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 19:19:28 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KYU0e5U5; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0D6F2871F0; Wed, 13 Dec 2023 04:17:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="KYU0e5U5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D83BB877EC; Wed, 13 Dec 2023 04:17:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9F42987822 for ; Wed, 13 Dec 2023 04:17:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6d9d84019c5so4850789a34.3 for ; Tue, 12 Dec 2023 19:17:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702437419; x=1703042219; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wCKfxk7RxxuQybzuaeY5DVICR5kE7xn8ldimDxWoUtQ=; b=KYU0e5U5p/hhfhYncN4MIFbUSPjueRe0j06XeSpKIflf4MIE53GBlmOH8kvWTGfgui lX9DEMT47mk7n3AdWOsbvTH6RfCW361FNiXAwT31+OvbJtz4qwVUvIa06VkQR9F+82o8 RNXDoIdw5Q4JqIeXER9yNOQygYzff0xlvkL1W7+ZLa34GUWNC+2tfrdwHe8Cgpl0JD03 ExeTetoMeZ2ur1sjy/my3dvTCzk2PtMl69zkvPV+AzUPiDqtWbkL8P7CNLbSJK+hZAZ6 0z1ZFSdUAOi+zfhrPdKx8SId/QU7YqbjAOVTOKmP3mETmrISsRu+Z+WUC0fynwu0lNVq i+lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702437419; x=1703042219; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wCKfxk7RxxuQybzuaeY5DVICR5kE7xn8ldimDxWoUtQ=; b=YqolVIRwJ3U+m6/U5ZlGCnFIXxU5u06nQiC0CcP9craeDXEI5j78xQGjSMYXRwxxEA 34ixIQnNEi8zbP6E8uKwk8V4BrJr2fFaROk7ckXFY3Bcj0tL1P5/WDJapx+JV5hxfkav +rMr0mp9Aie+b/YzIYYhhtKKFkRqKAwWw/BQBdiqA1nG+riP5yzEqxB90waUAYHtVPVn fiz43U+EhHm+pC1Ev9qWAUxliLyb0znoSR2ZEVfuLdngOw6vtDmuyA2OcVuMn6OLz98R YqwPO1QXjkdsyPC0ieT/uZB4ThuNp2sE9wRTvKSDPBYRtuQaORFP55QGwm0B2ChiVh7e z/0A== X-Gm-Message-State: AOJu0YyVGBYOLrTk1MWc2Fuua8oofZgcc3Ue/c/keaxc4wQdJPVLKfva BIJZPNbp4ufeGoD+gKvXaV6fSw== X-Received: by 2002:a9d:7a89:0:b0:6d8:74e2:8a51 with SMTP id l9-20020a9d7a89000000b006d874e28a51mr7152227otn.48.1702437418859; Tue, 12 Dec 2023 19:16:58 -0800 (PST) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id cm11-20020a056830650b00b006d99d363723sm1642853otb.63.2023.12.12.19.16.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 19:16:58 -0800 (PST) From: Sam Protsenko To: Minkyu Kang , Tom Rini , Lukasz Majewski , Sean Anderson Cc: Simon Glass , Heinrich Schuchardt , u-boot@lists.denx.de Subject: [PATCH 12/13] board: samsung: Add support for E850-96 board Date: Tue, 12 Dec 2023 21:16:45 -0600 Message-Id: <20231213031646.28828-13-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231213031646.28828-1-semen.protsenko@linaro.org> References: <20231213031646.28828-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add support for WinLink E850-96 board [1]. It's based on Exynos850 SoC and follows 96boards specification, so it's compatible with 96boards mezzanine boards [2]. This patch enables next features: * Serial console * USI * PMU (muxing AP UART path) * Pinctrl * Clocks * Timer (ARMv8 architected) * Reset control It's quite a minimal enablement. Features like MMC, USB and Ethernet will be enabled later. The rationale for config values is as follows: * TEXT_BASE = 0xf8800000 That's where BL2 loads the U-Boot payload, so TEXT_BASE must be exactly this value. Overall the memory map is designed in a way to keep the bootloader in the upper 128 MiB area of RAM, which is 0xf8000000..0xffffffff. That includes bootloader's code, stack, data, heap, MMU tables, etc. All the memory below that 128 MiB chunk can be used for storing boot images (0x80000000..0xf8000000). * CUSTOM_SYS_INIT_SP_ADDR = 0xf8c00000 Just 4 MiB above the TEXT_BASE address, to leave enough space for U-Boot code and stack itself (grows downwards). * SYS_LOAD_ADDR = 0x80000000 The beginning of RAM. That's where Linux kernel image must be loaded. * SYS_MALLOC_LEN = 0x81f000 8 MiB for malloc() + ENV_SIZE (128 KiB) * SYS_MALLOC_F_LEN = 0x4000 Increase malloc() pool size available before relocation from 8 KiB (default) to 16 KiB. Otherwise "alloc space exhausted" message appears in U-Boot log during board_init_f() stage. There are next reasons for doing so: 1. Having "bootph-all" flags in some dts nodes leads to binding those during pre-relocation stage, and binding (DM) uses dynamic memory allocation 2. clk-exynos850 driver uses CCF clocks, which in turn use dynamic memory allocation Device tree file was imported from Linux kernel. All nodes and boot phase flags added in exynos850-e850-96-u-boot.dtsi are only needed to enable serial console: * oscclk -> cmu_top -> cmu_peri: generate UART/USI clocks * pinctrl_alive and uart1_pins: needed to mux UART pins * pmu_system_controller: configures AP UART path to uart1_pins * usi_uart: configures USI block to operate as a UART protocol * serial_0: enables serial console (UART) [1] https://www.96boards.org/product/e850-96b/ [2] https://www.96boards.org/products/mezzanine/ Signed-off-by: Sam Protsenko --- arch/arm/dts/Makefile | 1 + arch/arm/dts/exynos850-e850-96-u-boot.dtsi | 37 + arch/arm/dts/exynos850-e850-96.dts | 273 ++++ arch/arm/mach-exynos/Kconfig | 19 +- board/samsung/e850-96/Kconfig | 16 + board/samsung/e850-96/MAINTAINERS | 9 + board/samsung/e850-96/Makefile | 6 + board/samsung/e850-96/e850-96.c | 22 + configs/e850-96_defconfig | 21 + doc/board/samsung/e850-96.rst | 87 ++ .../img/exynos850-boot-architecture.svg | 1283 +++++++++++++++++ doc/board/samsung/index.rst | 1 + include/configs/e850-96.h | 12 + 13 files changed, 1786 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/exynos850-e850-96-u-boot.dtsi create mode 100644 arch/arm/dts/exynos850-e850-96.dts create mode 100644 board/samsung/e850-96/Kconfig create mode 100644 board/samsung/e850-96/MAINTAINERS create mode 100644 board/samsung/e850-96/Makefile create mode 100644 board/samsung/e850-96/e850-96.c create mode 100644 configs/e850-96_defconfig create mode 100644 doc/board/samsung/e850-96.rst create mode 100644 doc/board/samsung/img/exynos850-boot-architecture.svg create mode 100644 include/configs/e850-96.h diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 5fc888680b39..7d949a6798ee 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -31,6 +31,7 @@ dtb-$(CONFIG_EXYNOS7420) += exynos7420-espresso7420.dtb dtb-$(CONFIG_TARGET_A5Y17LTE) += exynos78x0-axy17lte.dtb dtb-$(CONFIG_TARGET_A3Y17LTE) += exynos78x0-axy17lte.dtb dtb-$(CONFIG_TARGET_A7Y17LTE) += exynos78x0-axy17lte.dtb +dtb-$(CONFIG_TARGET_E850_96) += exynos850-e850-96.dtb dtb-$(CONFIG_ARCH_APPLE) += \ t8103-j274.dtb \ diff --git a/arch/arm/dts/exynos850-e850-96-u-boot.dtsi b/arch/arm/dts/exynos850-e850-96-u-boot.dtsi new file mode 100644 index 000000000000..7ad11e9faab2 --- /dev/null +++ b/arch/arm/dts/exynos850-e850-96-u-boot.dtsi @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2023 Linaro Ltd. + */ + +&cmu_top { + bootph-all; +}; + +&cmu_peri { + bootph-all; +}; + +&oscclk { + bootph-all; +}; + +&pinctrl_alive { + bootph-all; +}; + +&pmu_system_controller { + bootph-all; + samsung,uart-debug-1; +}; + +&serial_0 { + bootph-all; +}; + +&uart1_pins { + bootph-all; +}; + +&usi_uart { + bootph-all; +}; diff --git a/arch/arm/dts/exynos850-e850-96.dts b/arch/arm/dts/exynos850-e850-96.dts new file mode 100644 index 000000000000..f074df8982b3 --- /dev/null +++ b/arch/arm/dts/exynos850-e850-96.dts @@ -0,0 +1,273 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * WinLink E850-96 board device tree source + * + * Copyright (C) 2018 Samsung Electronics Co., Ltd. + * Copyright (C) 2021 Linaro Ltd. + * + * Device tree source file for WinLink's E850-96 board which is based on + * Samsung Exynos850 SoC. + */ + +/dts-v1/; + +#include "exynos850.dtsi" +#include +#include +#include + +/ { + model = "WinLink E850-96 board"; + compatible = "winlink,e850-96", "samsung,exynos850"; + + aliases { + mmc0 = &mmc_0; + serial0 = &serial_0; + }; + + chosen { + stdout-path = &serial_0; + }; + + connector { + compatible = "gpio-usb-b-connector", "usb-b-connector"; + label = "micro-USB"; + type = "micro"; + vbus-supply = <®_usb_host_vbus>; + id-gpios = <&gpa0 0 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <µ_usb_det_pins>; + + port { + usb_dr_connector: endpoint { + remote-endpoint = <&usb1_drd_sw>; + }; + }; + }; + + /* + * RAM: 4 GiB (eMCP): + * - 2 GiB at 0x80000000 + * - 2 GiB at 0x880000000 + * + * 0xbab00000..0xbfffffff: secure memory (85 MiB). + */ + memory@80000000 { + device_type = "memory"; + reg = <0x0 0x80000000 0x3ab00000>, + <0x0 0xc0000000 0x40000000>, + <0x8 0x80000000 0x80000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&key_voldown_pins &key_volup_pins>; + + volume-down-key { + label = "Volume Down"; + linux,code = ; + gpios = <&gpa1 0 GPIO_ACTIVE_LOW>; + }; + + volume-up-key { + label = "Volume Up"; + linux,code = ; + gpios = <&gpa0 7 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + /* HEART_BEAT_LED */ + user_led1: led-1 { + label = "yellow:user1"; + gpios = <&gpg2 2 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_HEARTBEAT; + linux,default-trigger = "heartbeat"; + }; + + /* eMMC_LED */ + user_led2: led-2 { + label = "yellow:user2"; + gpios = <&gpg2 3 GPIO_ACTIVE_HIGH>; + color = ; + linux,default-trigger = "mmc0"; + }; + + /* SD_LED */ + user_led3: led-3 { + label = "white:user3"; + gpios = <&gpg2 4 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_SD; + linux,default-trigger = "mmc2"; + }; + + /* WIFI_LED */ + wlan_active_led: led-4 { + label = "yellow:wlan"; + gpios = <&gpg2 6 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_WLAN; + linux,default-trigger = "phy0tx"; + default-state = "off"; + }; + + /* BLUETOOTH_LED */ + bt_active_led: led-5 { + label = "blue:bt"; + gpios = <&gpg2 7 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_BLUETOOTH; + linux,default-trigger = "hci0-power"; + default-state = "off"; + }; + }; + + /* TODO: Remove this once PMIC is implemented */ + reg_dummy: regulator-0 { + compatible = "regulator-fixed"; + regulator-name = "dummy_reg"; + }; + + reg_usb_host_vbus: regulator-1 { + compatible = "regulator-fixed"; + regulator-name = "usb_host_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpa3 5 GPIO_ACTIVE_LOW>; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <1>; + ranges; + + ramoops@f0000000 { + compatible = "ramoops"; + reg = <0x0 0xf0000000 0x200000>; + record-size = <0x20000>; + console-size = <0x20000>; + ftrace-size = <0x100000>; + pmsg-size = <0x20000>; + }; + }; + + /* + * RTC clock (XrtcXTI); external, must be 32.768 kHz. + * + * TODO: Remove this once RTC clock is implemented properly as part of + * PMIC driver. + */ + rtcclk: clock-rtcclk { + compatible = "fixed-clock"; + clock-output-names = "rtcclk"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; +}; + +&cmu_hsi { + clocks = <&oscclk>, <&rtcclk>, + <&cmu_top CLK_DOUT_HSI_BUS>, + <&cmu_top CLK_DOUT_HSI_MMC_CARD>, + <&cmu_top CLK_DOUT_HSI_USB20DRD>; + clock-names = "oscclk", "rtcclk", "dout_hsi_bus", + "dout_hsi_mmc_card", "dout_hsi_usb20drd"; +}; + +&mmc_0 { + status = "okay"; + mmc-hs200-1_8v; + mmc-hs400-1_8v; + cap-mmc-highspeed; + non-removable; + mmc-hs400-enhanced-strobe; + card-detect-delay = <200>; + clock-frequency = <800000000>; + bus-width = <8>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <0 4>; + samsung,dw-mshc-ddr-timing = <2 4>; + samsung,dw-mshc-hs400-timing = <0 2>; + + pinctrl-names = "default"; + pinctrl-0 = <&sd0_clk_pins &sd0_cmd_pins &sd0_rdqs_pins &sd0_nreset_pins + &sd0_bus1_pins &sd0_bus4_pins &sd0_bus8_pins>; +}; + +&oscclk { + clock-frequency = <26000000>; +}; + +&pinctrl_alive { + key_voldown_pins: key-voldown-pins { + samsung,pins = "gpa1-0"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + + key_volup_pins: key-volup-pins { + samsung,pins = "gpa0-7"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + + micro_usb_det_pins: micro-usb-det-pins { + samsung,pins = "gpa0-0"; + samsung,pin-function = ; + samsung,pin-pud = ; + }; +}; + +&rtc { + status = "okay"; + clocks = <&cmu_apm CLK_GOUT_RTC_PCLK>, <&rtcclk>; + clock-names = "rtc", "rtc_src"; +}; + +&serial_0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; +}; + +&usbdrd { + status = "okay"; + vdd10-supply = <®_dummy>; + vdd33-supply = <®_dummy>; +}; + +&usbdrd_dwc3 { + dr_mode = "otg"; + usb-role-switch; + role-switch-default-mode = "host"; + + port { + usb1_drd_sw: endpoint { + remote-endpoint = <&usb_dr_connector>; + }; + }; +}; + +&usbdrd_phy { + status = "okay"; +}; + +&usi_uart { + samsung,clkreq-on; /* needed for UART mode */ + status = "okay"; +}; + +&watchdog_cl0 { + status = "okay"; +}; + +&watchdog_cl1 { + status = "okay"; +}; diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 45fc6bb024b0..af00ee1db07a 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -2,7 +2,7 @@ if ARCH_EXYNOS config BOARD_COMMON def_bool y - depends on !TARGET_SMDKV310 && !TARGET_ARNDALE + depends on !TARGET_SMDKV310 && !TARGET_ARNDALE && !TARGET_E850_96 config SPI_BOOTING bool @@ -237,6 +237,22 @@ config TARGET_A3Y17LTE endchoice endif +if ARCH_EXYNOS9 + +choice + prompt "EXYNOS9 board select" + +config TARGET_E850_96 + bool "WinLink E850-96 board" + select ARM64 + select CLK_EXYNOS + select OF_CONTROL + select PINCTRL + select PINCTRL_EXYNOS850 + +endchoice +endif + config SYS_SOC default "exynos" @@ -261,5 +277,6 @@ source "board/samsung/smdk5250/Kconfig" source "board/samsung/smdk5420/Kconfig" source "board/samsung/espresso7420/Kconfig" source "board/samsung/axy17lte/Kconfig" +source "board/samsung/e850-96/Kconfig" endif diff --git a/board/samsung/e850-96/Kconfig b/board/samsung/e850-96/Kconfig new file mode 100644 index 000000000000..f891a906959b --- /dev/null +++ b/board/samsung/e850-96/Kconfig @@ -0,0 +1,16 @@ +if TARGET_E850_96 + +config EXYNOS850 + bool "Exynos850 SoC support" + default y + +config SYS_BOARD + default "e850-96" + +config SYS_VENDOR + default "samsung" + +config SYS_CONFIG_NAME + default "e850-96" + +endif diff --git a/board/samsung/e850-96/MAINTAINERS b/board/samsung/e850-96/MAINTAINERS new file mode 100644 index 000000000000..e8b9365eea85 --- /dev/null +++ b/board/samsung/e850-96/MAINTAINERS @@ -0,0 +1,9 @@ +WINLINK E850-96 BOARD +M: Sam Protsenko +S: Maintained +F: arch/arm/dts/exynos850-e850-96-u-boot.dtsi +F: arch/arm/dts/exynos850-e850-96.dts +F: board/samsung/e850-96/ +F: configs/e850-96_defconfig +F: doc/board/samsung/e850-96.rst +F: include/configs/e850-96.h diff --git a/board/samsung/e850-96/Makefile b/board/samsung/e850-96/Makefile new file mode 100644 index 000000000000..301c22337119 --- /dev/null +++ b/board/samsung/e850-96/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2020, Linaro Limited +# Sam Protsenko + +obj-y := e850-96.o diff --git a/board/samsung/e850-96/e850-96.c b/board/samsung/e850-96/e850-96.c new file mode 100644 index 000000000000..a00d81b5d4c3 --- /dev/null +++ b/board/samsung/e850-96/e850-96.c @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2020, Linaro Limited + * Sam Protsenko + */ + +#include + +int dram_init(void) +{ + return fdtdec_setup_mem_size_base(); +} + +int dram_init_banksize(void) +{ + return fdtdec_setup_memory_banksize(); +} + +int board_init(void) +{ + return 0; +} diff --git a/configs/e850-96_defconfig b/configs/e850-96_defconfig new file mode 100644 index 000000000000..bb41635ff784 --- /dev/null +++ b/configs/e850-96_defconfig @@ -0,0 +1,21 @@ +CONFIG_ARM=y +CONFIG_ARCH_CPU_INIT=y +CONFIG_ARCH_EXYNOS=y +CONFIG_TEXT_BASE=0xf8800000 +CONFIG_SYS_MALLOC_LEN=0x81f000 +CONFIG_SYS_MALLOC_F_LEN=0x4000 +CONFIG_ARCH_EXYNOS9=y +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xf8c00000 +CONFIG_DEFAULT_DEVICE_TREE="exynos850-e850-96" +CONFIG_SYS_LOAD_ADDR=0x80000000 +# CONFIG_AUTOBOOT is not set +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_NET is not set +CONFIG_CLK_EXYNOS850=y +# CONFIG_MMC is not set +CONFIG_SOC_SAMSUNG=y +CONFIG_EXYNOS_PMU=y +CONFIG_EXYNOS_USI=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_SYSCON=y diff --git a/doc/board/samsung/e850-96.rst b/doc/board/samsung/e850-96.rst new file mode 100644 index 000000000000..0cb95473e536 --- /dev/null +++ b/doc/board/samsung/e850-96.rst @@ -0,0 +1,87 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. sectionauthor:: Sam Protsenko + +WinLink E850-96 board +===================== + +Overview +-------- + +WinLink's E850-96 board [1]_ is based on Samsung Exynos850 SoC and follows +96Boards Consumer Edition specification [2]_. That makes it possible to use +96Boards mezzanine boards [3]_ along with it. It's an open-hardware board and +the hardware design files [4]_ were published, along with the supported +software [5]_ and related documentation. + +U-Boot can be used on E850-96 instead of the original Samsung LittleKernel based +bootloader [6]_. Because FWBL1 [7]_ doesn't verify bootloader's signature, there +is no need to sign a U-Boot binary. That means U-Boot binary can be flashed into +``bootloader`` partition (instead of LittleKernel bootloader) and it will just +work. + +Because BL2 bootloader already sets up DRAM and runs the final bootloader +(U-Boot) from DRAM, there is no need in U-Boot SPL. It's enough to have only +U-Boot proper (``u-boot.bin``). + +Boot Flow +--------- + +The boot path for Exynos850 is shown on the figure below. + +.. image:: img/exynos850-boot-architecture.svg + :alt: Exynos850 SoC boot flow + +Legend: + +* ``BL0``: Boot ROM code +* ``BL1``: Software part of Boot ROM +* ``EPBL``: Exynos Primary Boot Loader +* ``BL2``: Initializes CMU and DRAM and runs the final bootloader +* ``Bootloader``: Final bootloader (e.g. U-Boot); also called BL33 in terms of + ARM boot flow +* ``EL3_MON``: EL3 monitor (trusted firmware, handles SMC calls); also called + BL31 in terms of ARM boot flow +* ``LDFW``: Loadable Firmware + +Build Procedure +--------------- + +.. warning:: + At the moment both eMMC and USB features are not enabled in U-Boot. Flashing + U-Boot binary **WILL** effectively brick your board. The ``dltool`` [8]_ can + be used then to perform USB boot and flash LittleKernel bootloader binary [7]_ + to unbrick and revive the board. Flashing U-Boot binary might be helpful for + developers or anybody who want to check current state of U-Boot enablement on + E850-96 (which is mostly serial console and related blocks). + +Build U-Boot binary from source code (using AArch64 baremetal GCC toolchain): + +.. prompt:: bash $ + + export PATH=/bin:$PATH + export CROSS_COMPILE= + make e850-96_defconfig + make + +Boot E850-96 board into fastboot mode as described in board software doc [9]_, +and flash U-Boot binary into ``bootloader`` eMMC partition: + +.. prompt:: bash $ + + fastboot flash bootloader u-boot.bin + fastboot reboot + +U-Boot will boot up to the shell. + +References +---------- + +.. [1] https://www.96boards.org/product/e850-96b/ +.. [2] https://www.96boards.org/products/ce/ +.. [3] https://www.96boards.org/products/mezzanine/ +.. [4] https://www.96boards.org/documentation/consumer/e850-96b/hardware-docs/ +.. [5] https://gitlab.com/Linaro/96boards/e850-96/ +.. [6] https://gitlab.com/Linaro/96boards/e850-96/lk +.. [7] https://gitlab.com/Linaro/96boards/e850-96/images +.. [8] https://gitlab.com/Linaro/96boards/e850-96/tools/dltool +.. [9] https://gitlab.com/Linaro/96boards/e850-96/doc diff --git a/doc/board/samsung/img/exynos850-boot-architecture.svg b/doc/board/samsung/img/exynos850-boot-architecture.svg new file mode 100644 index 000000000000..c6e850407b4a --- /dev/null +++ b/doc/board/samsung/img/exynos850-boot-architecture.svg @@ -0,0 +1,1283 @@ + + + + + + + + + + + + + + + Secure World + + + + Secure World + + + + + + + + + + + + + + + Non-Secure World + + + + Non-SecureWorld + + + + + + + + + +Booting Period + + + + Booting Period + + + + + + + + + + + BL0 + + + + BL0 + + + + + + + + + + + BL1 + + + + BL1 + + + + + + + + + + + + + EPBL + + + + EPBL + + + + + + + + + + + + + BL2 + + + + BL2 + + + + + + + + + + + + + Bootloader + + + + Bootloader + + + + + + + + + + + + + EL3_MON + + + + EL3_MON + + + + + + + + + + + Linux + + + + Linux + + + + + + + + + + Android + + + + + Android + + + + + + + + + Secure App + + + + Secure App + + + + + + + + + + + Secure OS + + + + Secure OS + + + + + + + + + LDFW + + + + LDFW + + + + + + + + + + iROM + + + + + iROM + + + + + + + + + + iRAM + + + + + iRAM + + + + + + + + + + DRAM + + + + + DRAM + + + + + + + + + + + + EL0 + + + + EL0 + + + + + + + + + EL1 + + + + EL1 + + + + + + + + + EL3 + + + + EL3 + + + + + + + Text is not SVG - cannot display + + + diff --git a/doc/board/samsung/index.rst b/doc/board/samsung/index.rst index 971805e20169..a1c9636b0507 100644 --- a/doc/board/samsung/index.rst +++ b/doc/board/samsung/index.rst @@ -7,3 +7,4 @@ Samsung :maxdepth: 2 axy17lte + e850-96 diff --git a/include/configs/e850-96.h b/include/configs/e850-96.h new file mode 100644 index 000000000000..4607b3089b21 --- /dev/null +++ b/include/configs/e850-96.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2020, Linaro Limited + * Sam Protsenko + * + * Configuration for E850-96 board. + */ + +#ifndef __E850_96_H +#define __E850_96_H + +#endif /* __E850_96_H */