From patchwork Wed Nov 7 15:05:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 150407 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5278495ljp; Wed, 7 Nov 2018 07:07:10 -0800 (PST) X-Google-Smtp-Source: AJdET5fd9jTmrrARD9r3TkUlgNnBB48Mvmxk07T1dYxeJkCj/yNmPq1F/eiPZYKRXmYxQ2dFrlKD X-Received: by 2002:a50:e185:: with SMTP id k5-v6mr455394edl.195.1541603230420; Wed, 07 Nov 2018 07:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541603230; cv=none; d=google.com; s=arc-20160816; b=r940lMXDhD2lYWM/qpoRa0UuqqPmQNuDwgivq4dqU7rzP8ROcDettBYSGQ3nmYjfe2 WNvjRfeM3A+bJJJUucYWi/3dnZCjjv1ykluJoaLM+WcnC+dw3hUPzNYrYXS71o9kkCNv fS/eaJawB6KqcUMlx9xbSEGP6xNythc2K7y/xSazWDtNDo2BUtyedlstm43Y0vhVfGBZ KQroWpdvsJ4JcUF7zww+p3HknDUsnm3N3OrY0dR7fGGzq5reLBTBicrVGAf6rAg/imX0 g8FoiFsQ5I+Vocac33L9/ib/vKruu+lX5yFKKjh96qLDe9v3o802L5qigxHajU+YcizW aP8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:cms-type:in-reply-to :message-id:date:to:from:dkim-signature:dkim-filter; bh=Hh3GAInxQP/67JyUn5lmNhluWuiGqtYExAuDmCuR6gg=; b=xWx1WOlzwCLfV9nmg0xho6vWC27Akx/qCMMooZZdPx+MqbSXua/LBX8m43OUtnz5IF yDhlpp+VgLtDEIpkouT9uFbK7tT1GTzZd90d0W9FeY7n1tmy3pPy8uzxCuPMnIrGJ0XG Zx5Vi3oFOTVyLq451W33qDQ7NEfOCaIAwbhKG8GiJaZpuvVrSCUh4dhzaL1SkeiqQLYh c9pPH/WVxj5F1NGc5v4oqJidrqbvKkyUYL+LG+8Oyl+auGHLUxHHB6okiYjqriPNRRDT LuN5wKZbamXTXjSiXOEm2MN/cA1MsB7oOaskjDZHbxmdYvpbNrrwTsKjkMzn981EonFK KlKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=SURzb5QY; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id o58-v6si648829edc.152.2018.11.07.07.07.10; Wed, 07 Nov 2018 07:07:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=SURzb5QY; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: by lists.denx.de (Postfix, from userid 105) id EADE7C224C3; Wed, 7 Nov 2018 15:06:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=LOTS_OF_MONEY, SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 98AABC224C8; Wed, 7 Nov 2018 15:06:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 56E43C224D2; Wed, 7 Nov 2018 15:05:21 +0000 (UTC) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lists.denx.de (Postfix) with ESMTPS id B0CE8C224C3 for ; Wed, 7 Nov 2018 15:05:21 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181107150521euoutp0246a45c3c40473ac60ae6ae398561518e~k398E1Npd0680406804euoutp02Q; Wed, 7 Nov 2018 15:05:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181107150521euoutp0246a45c3c40473ac60ae6ae398561518e~k398E1Npd0680406804euoutp02Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1541603121; bh=7SrAByG6v33x0eNue7d+wNznZX7YUeVjiGODi+NP2/8=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=SURzb5QYYiQkhDk30ByG+CX6JKTdM4P7ylZlrPZxlgx+UyZsFyW1hd+Io5pg/4KeH unlqcUb3yDyLJFwp7RceWBWp6KO87k6ZH7TZhGPG4nmHZ6PG6UX7evjPBzSKaUqXTL GUoI1w4JoxvVWHLvxXUuCini71ks7y6FbKIy59d0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181107150521eucas1p205224d4f235a65cc7f15787e1d85f1c9~k397r2V3U2787127871eucas1p2X; Wed, 7 Nov 2018 15:05:20 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 9A.2C.04441.03FF2EB5; Wed, 7 Nov 2018 15:05:20 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181107150520eucas1p21ea47acca16615028ce92c21f3000de9~k3960Mw8l2787127871eucas1p2W; Wed, 7 Nov 2018 15:05:20 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-fb-5be2ff3060f8 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 21.55.04128.F2FF2EB5; Wed, 7 Nov 2018 15:05:19 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PHT00FB3WKS2810@eusync4.samsung.com>; Wed, 07 Nov 2018 15:05:19 +0000 (GMT) From: Marek Szyprowski To: u-boot@lists.denx.de Date: Wed, 07 Nov 2018 16:05:14 +0100 Message-id: <20181107150514.23479-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181107150105.23165-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJIsWRmVeSWpSXmKPExsWy7djPc7oG/x9FGxw6r22xccZ6Vosbv9pY LZ6/u8xksfbIXXaLjiMtjBZv93ayO7B5zJt1gsXj7J0djB59W1YxBjBHcdmkpOZklqUW6dsl cGXs3X6WteBZdMWV+R9ZGhi3+XQxcnJICJhIPPl5i6WLkYtDSGAFo8SPvafYIZzPjBLPNp8A ynCAVbX9N4eIL2OUmNTzlhWkW0iggUnix0FPEJtNwFCi620XG4gtIiAh8av/KiOIzSxwjVFi 1nZFEFtYwENiyqL9TCAzWQRUJVrWloOEeQVsJS5+XcYGcZC8xOoNB5hBbE4BO4nunslgx0kI /GSVuLBkEdQ9LhKnPidB1AtLvDq+hR3ClpG4PLkbqr6ZUaJ9xix2CKeHUWLrnB1QG6wlDh+/ yApxHJ/EpG3TmSGG8kp0tAlBlHhIdH6eDw2IiYwSt1o72SYwSi5gZFjFKJ5aWpybnlpsmJda rlecmFtcmpeul5yfu4kRGGGn/x3/tIPx66WkQ4wCHIxKPLwXtj6MFmJNLCuuzD3EKMHBrCTC 27v6UbQQb0piZVVqUX58UWlOavEhRmkOFiVx3mqGB9FCAumJJanZqakFqUUwWSYOTqkGRjbN MAtJpyqpd9tMrmonMiU0yf/Yvuzl72U738xf9nDnktSEvac3ipo2rHKyvT6P+eZJTVe16422 +eZVd/P3lam+OnvBsU1+gjhP241K5jhJsXXLCjbLJDusmnk+PniTUeQ0y/XJU3+sVTzy7sFe ve7dB485H73ts6HyxBfuz4lnKy7/23e21kOJpTgj0VCLuag4EQDxcE4ErAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBJMWRmVeSWpSXmKPExsVy+t/xa7r6/x9FG5w4Y22xccZ6Vosbv9pY LZ6/u8xksfbIXXaLjiMtjBZv93ayO7B5zJt1gsXj7J0djB59W1YxBjBHcdmkpOZklqUW6dsl cGXs3X6WteBZdMWV+R9ZGhi3+XQxcnBICJhItP0372Lk4hASWMIosWfXThYIp4lJ4vXa/6xd jJwcbAKGEl1vu9hAbBEBCYlf/VcZQYqYBW4wStw5/5MdJCEs4CExZdF+JpCpLAKqEi1ry0HC vAK2Ehe/LgPrlRCQl1i94QAziM0pYCfR3TOZBcQWAqp5ePU84wRGngWMDKsYRVJLi3PTc4uN 9IoTc4tL89L1kvNzNzECw2PbsZ9bdjB2vQs+xCjAwajEw6ux42G0EGtiWXFl7iFGCQ5mJRHe 3tWPooV4UxIrq1KL8uOLSnNSiw8xSnOwKInznjeojBISSE8sSc1OTS1ILYLJMnFwSjUwznwz c+vLc/tFm515jm04b/ToY+ktJoP9fFnur5YpHFjANoebW+QA8y894brsotNzXl59+KD3oiw3 g4BDzUkRj5NLDy5ljLY+tV249tblxQX8uRcvHHrv9eHE5LDv2UIr+dU+7ti6dPYe9T/z7MWE tR/usH/zXF75xIOPYSxLbrVNYT352TQr64ASS3FGoqEWc1FxIgDPqL+wCwIAAA== X-CMS-MailID: 20181107150520eucas1p21ea47acca16615028ce92c21f3000de9 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181107150520eucas1p21ea47acca16615028ce92c21f3000de9 References: <20181107150105.23165-1-m.szyprowski@samsung.com> Cc: Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [U-Boot] [PATCH 9/9] ARM: Exynos: Add Exynos5433 based TM2 board support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" This patch adds support for Exynos5433 based TM2 and TM2e boards. u-boot is used to load and decompress kernel image or alternatively (when 'volume down' button is pressed during boot) provide THOR download USB feature for flashing kernel and rootfs images. Based on earlier work done by Lukasz Majewski . Signed-off-by: Marek Szyprowski --- arch/arm/dts/Makefile | 3 + arch/arm/dts/exynos5433-tm2.dts | 37 ++++++++++ arch/arm/mach-exynos/Kconfig | 14 ++++ board/samsung/tm2/Kconfig | 14 ++++ board/samsung/tm2/Makefile | 8 ++ board/samsung/tm2/tm2.c | 127 ++++++++++++++++++++++++++++++++ configs/tm2_defconfig | 52 +++++++++++++ include/configs/tm2.h | 60 +++++++++++++++ 8 files changed, 315 insertions(+) create mode 100644 arch/arm/dts/exynos5433-tm2.dts create mode 100644 board/samsung/tm2/Kconfig create mode 100644 board/samsung/tm2/Makefile create mode 100644 board/samsung/tm2/tm2.c create mode 100644 configs/tm2_defconfig create mode 100644 include/configs/tm2.h diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index d36447d18d..f8c671589a 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -25,6 +25,9 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ exynos5800-peach-pi.dtb \ exynos5422-odroidxu3.dtb dtb-$(CONFIG_EXYNOS7420) += exynos7420-espresso7420.dtb + +dtb-$(CONFIG_TARGET_TM2) += exynos5433-tm2.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += \ rk3036-sdk.dtb \ rk3128-evb.dtb \ diff --git a/arch/arm/dts/exynos5433-tm2.dts b/arch/arm/dts/exynos5433-tm2.dts new file mode 100644 index 0000000000..c9b178efdc --- /dev/null +++ b/arch/arm/dts/exynos5433-tm2.dts @@ -0,0 +1,37 @@ +/* + * TM2 device tree source + * + * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; +#include "exynos5433.dtsi" + +/ { + model = "TM2 based on EXYNOS5433"; + compatible = "samsung,tm2", "samsung,exynos5433"; + + aliases { + serial0 = &serial_1; + console = &serial_1; + i2c0 = &i2c; + }; + + i2c: i2c { + compatible = "i2c-gpio"; + gpios = <&gpb0 0 0>, /* sda */ + <&gpb0 1 0>; /* scl */ + i2c-gpio,delay-us = <2>; /* ~100 kHz */ + }; +}; + +&mmc_0 { + status = "okay"; +}; + +&serial_1 { + status = "okay"; +}; diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 4a49c8dcc2..cf3bed57f3 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -137,6 +137,19 @@ config TARGET_PEACH_PIT endchoice endif +if ARCH_EXYNOS5433 + +choice + prompt "EXYNOS5433 board select" + +config TARGET_TM2 + bool "TM2 board" + select ARM64 + select OF_CONTROL + +endchoice +endif + if ARCH_EXYNOS7 choice @@ -168,6 +181,7 @@ source "board/samsung/odroid/Kconfig" source "board/samsung/arndale/Kconfig" source "board/samsung/smdk5250/Kconfig" source "board/samsung/smdk5420/Kconfig" +source "board/samsung/tm2/Kconfig" source "board/samsung/espresso7420/Kconfig" config SPL_LDSCRIPT diff --git a/board/samsung/tm2/Kconfig b/board/samsung/tm2/Kconfig new file mode 100644 index 0000000000..745faf6a95 --- /dev/null +++ b/board/samsung/tm2/Kconfig @@ -0,0 +1,14 @@ +if TARGET_TM2 + +config SYS_BOARD + default "tm2" + help + TM2 is Exynos5433 SoC based board, Tizen reference board. + +config SYS_VENDOR + default "samsung" + +config SYS_CONFIG_NAME + default "tm2" + +endif diff --git a/board/samsung/tm2/Makefile b/board/samsung/tm2/Makefile new file mode 100644 index 0000000000..53621774dd --- /dev/null +++ b/board/samsung/tm2/Makefile @@ -0,0 +1,8 @@ +# +# Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved. +# Lukasz Majewski +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := tm2.o diff --git a/board/samsung/tm2/tm2.c b/board/samsung/tm2/tm2.c new file mode 100644 index 0000000000..31ec8f5641 --- /dev/null +++ b/board/samsung/tm2/tm2.c @@ -0,0 +1,127 @@ +/* + * (C) Copyright 2018 Samsung + * + * SPDX-License-Identifier: GPL-2.0+ + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int board_init(void) +{ + /* start Multi Core Timer to get ARM Architected Timers working */ + writel(1 << 8, 0x101c0240); + return 0; +} + +int dram_init(void) +{ + gd->ram_size = PHYS_SDRAM_1_SIZE; + return 0; +} + +int dram_init_banksize(void) +{ + gd->bd->bi_dram[0].start = PHYS_SDRAM_1; + gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + return 0; +} + +unsigned long get_uart_clk(int id) +{ + return 200000000; +} + +unsigned long get_mmc_clk(int id) +{ + return 100000000; +} + +unsigned long set_mmc_clk(int id, int div) +{ + return 0; +} + +unsigned long get_i2c_clk(int id) +{ + return 66666667; +} + +#ifdef CONFIG_USB_DWC3 +static struct dwc3_device dwc3_device_data = { + .maximum_speed = USB_SPEED_SUPER, + .base = 0x15400000, + .dr_mode = USB_DR_MODE_PERIPHERAL, + .index = 0, +}; + +int usb_gadget_handle_interrupts(void) +{ + dwc3_uboot_handle_interrupt(0); + return 0; +} + +int board_usb_init(int index, enum usb_init_type init) +{ + void *base = (void *)0x15500000; /* Exynos5433 DRD PHY */ + + /* CMU TOP: set SCLK_USBDRD30_RATIO divider to 1 */ + writel(0x0007770b, (void *)0x10030634); + + /* CMU FSYS: set PHYCLK_USBDRD30_UDRD30_PHYCLOCK and + PHYCLK_USBDRD30_UDRD30_PIPE_PCLK muxes to 1 */ + writel(0x00000011, (void *)0x156e0208); + + /* CMU FSYS: enable MUX_SCLK_USBDRD30_USER gate and + keep other gates enabled */ + writel(0x01101001, (void *)0x156e0204); + + /* CMU: TOP: set MUX_SCLK_USBDRD30 mux source to pll */ + writel(0x00000101, (void *)0x10030234); + + /* PMU: bypass USB DEV PHY isolation */ + writel(0x00000001, (void *)0x105c0704); + + /* copied from Linux kernel register dump */ + writel(0x0, base + 0x14); + writel(0x0, base + 0x34); + writel(0x8000040, base + 0x4); + writel(0x24d466e4, base + 0x1c); + writel(0x4, base + 0x30); + writel(0x24d466e4, base + 0x1c); + writel(0x3fff81c, base + 0x20); + writel(0x40, base + 0x8); + writel(0x0, base + 0x28); + writel(0xc41805bf, base + 0x10); + udelay(10); + writel(0xc41805bd, base + 0x10); + writel(0x3fff81c, base + 0x20); + writel(0x0, base + 0x28); + writel(0xc41b40bf, base + 0x10); + udelay(10); + writel(0xc41b40bd, base + 0x10); + + return dwc3_uboot_init(&dwc3_device_data); +} +#endif + +int checkboard(void) +{ + const char *board_info; + + board_info = fdt_getprop(gd->fdt_blob, 0, "model", NULL); + printf("Board: %s\n", board_info ? board_info : "unknown"); + + return 0; +} diff --git a/configs/tm2_defconfig b/configs/tm2_defconfig new file mode 100644 index 0000000000..4080366c97 --- /dev/null +++ b/configs/tm2_defconfig @@ -0,0 +1,52 @@ +CONFIG_ARM=y +# CONFIG_ARM64_SUPPORT_AARCH32 is not set +CONFIG_ARCH_EXYNOS=y +CONFIG_SYS_TEXT_BASE=0x20080000 +CONFIG_ARCH_EXYNOS5433=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_IDENT_STRING="\nSamsung Exynos5433 TM2" +CONFIG_FIT=y +CONFIG_BOOTDELAY=-2 +CONFIG_SYS_CONSOLE_INFO_QUIET=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_HUSH_PARSER=y +# CONFIG_CMD_CONSOLE is not set +# CONFIG_CMD_ELF is not set +# CONFIG_CMD_GO is not set +CONFIG_CMD_THOR_DOWNLOAD=y +# CONFIG_CMD_EXPORTENV is not set +# CONFIG_CMD_IMPORTENV is not set +# CONFIG_CMD_EDITENV is not set +# CONFIG_CMD_SAVEENV is not set +# CONFIG_CMD_ENV_EXISTS is not set +# CONFIG_CMD_DM is not set +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +# CONFIG_RANDOM_UUID is not set +CONFIG_CMD_I2C=y +# CONFIG_CMD_LOADB is not set +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_PART=y +# CONFIG_CMD_SOURCE is not set +# CONFIG_CMD_SETEXPR is not set +# CONFIG_CMD_NET is not set +CONFIG_CMD_FS_GENERIC=y +CONFIG_DEFAULT_DEVICE_TREE="exynos5433-tm2" +# CONFIG_DM_DEVICE_REMOVE is not set +CONFIG_DFU_MMC=y +CONFIG_DM_I2C_GPIO=y +CONFIG_DM_MMC=y +CONFIG_MMC_DW=y +CONFIG_USB=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GADGET=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x04e8 +CONFIG_USB_GADGET_PRODUCT_NUM=0x685D +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_USB_FUNCTION_MASS_STORAGE=y +CONFIG_USB_FUNCTION_THOR=y +# CONFIG_SYS_WHITE_ON_BLACK is not set +# CONFIG_EFI_LOADER is not set diff --git a/include/configs/tm2.h b/include/configs/tm2.h new file mode 100644 index 0000000000..ce656b494a --- /dev/null +++ b/include/configs/tm2.h @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2018 Samsung Electronics + * Marek Szyprowski + * + * Configuation settings for the Exynos5433 TM2 board. + */ + +#ifndef __SAMSUNG_TM2_H +#define __SAMSUNG_TM2_H + +#include +#include + +/* High Level Configuration Options */ +#define CONFIG_SAMSUNG /* in a SAMSUNG core */ +#define CONFIG_EXYNOS5433 /* Exynos5433 Family */ +#define CONFIG_S5P + +/* Timer input clock frequency */ +#define COUNTER_FREQUENCY 24000000 + +/* SD/MMC configuration */ +#define CONFIG_BOUNCE_BUFFER + +/* THOR */ +#define CONFIG_G_DNL_THOR_VENDOR_NUM CONFIG_USB_GADGET_VENDOR_NUM +#define CONFIG_G_DNL_THOR_PRODUCT_NUM 0x685D + +/* required to avoid build break */ +#define CONFIG_G_DNL_UMS_VENDOR_NUM CONFIG_USB_GADGET_VENDOR_NUM +#define CONFIG_G_DNL_UMS_PRODUCT_NUM 0xA4A5 + +#define PHYS_SDRAM_1 0x20000000 +#define PHYS_SDRAM_1_SIZE 0xbf700000 + +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x7fff0) +#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x80000) + +/* Size of malloc() pool */ +#define CONFIG_SYS_MALLOC_LEN (80 << 20) +#define CONFIG_SYS_BOOTM_LEN (130 << 20) + +/* Initial environment variables */ +#define CONFIG_BOOTCOMMAND "run modedetect" +#define CONFIG_EXTRA_ENV_SETTINGS "dfu_alt_info=kernel part 0 9 offset 0x400;rootfs part 0 18;system-data part 0 19;user part 0 21\0" \ + "modedetect=if gpio input gpa21 || itest.l *0x105c080c == 0x12345671; then run download; else run bootkernel; fi; reset\0" \ + "fdt_high=0xffffffffffffffff\0" \ + "bootargs=console=ttySAC1,115200 earlycon=exynos4210,0x14C20000 ess_setup=0x26000000 loglevel=7 root=/dev/mmcblk0p18 rootfstype=ext4 rootwait\0" \ + "bootkernel=echo Booting kernel; run boarddetect; run loadkernel; bootm 0x30080000#$board\0" \ + "boarddetect=if itest.l *0x138000b4 == 0x0063f9ff; then setenv board tm2e; elif itest.l *0x138000b4 == 0x0059f9ff; then setenv board tm2; else setenv board unknown; fi; echo Detected $board board\0" \ + "loadkernel=part start mmc 0 9 kernel_sect; part size mmc 0 9 kernel_size; mmc read 0x30000000 $kernel_sect $kernel_size\0" \ + "muicsetusb=i2c dev 0; i2c mw 25 c 9; i2c mw 25 d 3b; i2c mw 25 e 05; i2c mw 25 16 10\0" \ + "displayimg=unzip 200d0000 67000000; mw.l 138000b4 0059f9ff; mw.l 138001a0 67e10000; mw.l 13800200 00001680; mw.l 13801410 1; mw.l 13802040 e0000018; sleep 1; mw.l 13802040 e0000008\0" \ + "download=echo Thor mode enabled; run muicsetusb; run displayimg; mw.l 0x105c080c 0; thor 0 mmc 0\0" + +#define CONFIG_ENV_SIZE 0x1000 + +#endif /* __SAMSUNG_TM2_H */