From patchwork Tue Oct 29 07:23:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 21260 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8E03420354 for ; Tue, 29 Oct 2013 07:22:10 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf22063862yhz.3 for ; Tue, 29 Oct 2013 00:22:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:dlp-filter:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=pM5lKJT2jau5F2CVuCARuMITmhOlXJSxubbsBOamQok=; b=iNSpl/QCC2OZrDwgEXcF3PvCrLo1G4w8p/AXUhD+t2/NN85h9AVbh5smat2m8Yujp3 KTrOuZHGOGnLKrr6sujH9u2tj/Rop0qayJroBd6rcbRoyIDQeO5voNMIP/USDEo/Ygss BUx4NKBFiuwn5/YATzVXiGZ3oxSdvZuZACwLm/KRSmWyPcmaU4HVZuR6qOT7KOjt+hzO yeR4sDZOrL5fHeNoHbVtsbZg1USoLXSvm98TsNQaHa3D08173gbmQOZlg0lP6OrrgS9n ZkzKSGq7FhG9BoEEs60cV2ZeZnU18qJJSfsOIhwg9inC1SdZROY1dBrgXlFNjMY6UaI9 BSTQ== X-Gm-Message-State: ALoCoQkZAYCd/n3DgahUWlU/lIa7qjXCONsXLr2RAhSDDg/raWGQCDrMWCgPr8/a+ryMeGAUkHj9 X-Received: by 10.224.128.131 with SMTP id k3mr27967205qas.0.1383031330364; Tue, 29 Oct 2013 00:22:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.133 with SMTP id h5ls2320331qej.54.gmail; Tue, 29 Oct 2013 00:22:10 -0700 (PDT) X-Received: by 10.52.244.15 with SMTP id xc15mr6363vdc.52.1383031330265; Tue, 29 Oct 2013 00:22:10 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id sc5si6634689vdc.152.2013.10.29.00.22.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Oct 2013 00:22:10 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id jx11so5585068veb.7 for ; Tue, 29 Oct 2013 00:22:10 -0700 (PDT) X-Received: by 10.52.33.44 with SMTP id o12mr13626649vdi.7.1383031330145; Tue, 29 Oct 2013 00:22:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp181033vcz; Tue, 29 Oct 2013 00:22:09 -0700 (PDT) X-Received: by 10.68.220.36 with SMTP id pt4mr2412792pbc.30.1383031327917; Tue, 29 Oct 2013 00:22:07 -0700 (PDT) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id l8si14117657pbi.31.2013.10.29.00.22.07 for ; Tue, 29 Oct 2013 00:22:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.34 as permitted sender) client-ip=203.254.224.34; Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MVF00E7S5RTKV80@mailout4.samsung.com>; Tue, 29 Oct 2013 16:22:06 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 6E.F3.07052.E126F625; Tue, 29 Oct 2013 16:22:06 +0900 (KST) X-AuditID: cbfee691-b7f866d000001b8c-fa-526f621e4440 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 5C.05.09687.D126F625; Tue, 29 Oct 2013 16:22:06 +0900 (KST) Received: from localhost.localdomain.com ([107.108.73.95]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MVF00H2J5SC3W70@mmp2.samsung.com>; Tue, 29 Oct 2013 16:22:05 +0900 (KST) From: Rajeshwari S Shinde To: u-boot@lists.denx.de Cc: patches@linaro.org, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org, u-boot-review@google.com, panto@antoniou-consulting.com, alim.akhtar@samsung.com, trini@ti.com Subject: [PATCH 06/10 V6] Exynos5420: Add base patch for SMDK5420 Date: Tue, 29 Oct 2013 12:53:09 +0530 Message-id: <1383031393-6093-7-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.11.7 In-reply-to: <1383031393-6093-1-git-send-email-rajeshwari.s@samsung.com> References: <1383031393-6093-1-git-send-email-rajeshwari.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkkeLIzCtJLcpLzFFi42JZI2JSpSuXlB9k8Po+j8WDedvYLB6uv8li 0XGkhdFi1+3JLBZTDn9hsfi2ZRujxeTF85ktlr/eyG7xdm8nuwOnx7yfE5k8ZjdcZPFYsKnU 4861PWweZ+/sYPTo27KK0eP4je1MAexRXDYpqTmZZalF+nYJXBkHus6yFdwIqeh5f525gXG/ TRcjJ4eEgInEj4fT2SFsMYkL99azdTFycQgJLGWUOP9qOytMUcefiywgtpDAdEa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ecn7uJkZwrD2T2sG4ssHiEKMAB6MSD+8D5vwgIdbEsuLK3EOM EhzMSiK8O4KBQrwpiZVVqUX58UWlOanFhxiTga6ayCwlmpwPTAN5JfGGxibmpsamliYWJmaW pAkrifMeaLUOFBJITyxJzU5NLUgtgtnCxMEp1cC4aQazz41X5TKrVS8tMap9OGOmuqMaz9Tl 9ZMNNWoYrr6vK574a0/ayk9fZ6akxhSmPGZUb7llsyvBWlUiZNs9/1rLr7P1Ssuq/3ALu66d J/tuE2OeRsU7sWJREcE3CyZGNa74Upb8yn316fjNO65qKjMLn3N1D7+ysmBe0T9b1qc3Vk95 yfBXiaU4I9FQi7moOBEAWaea/PkCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rajeshwari.s@samsung.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Adding the base patch for Exynos based SMDK5420. This shall enable compilation and basic boot support for SMDK5420. Signed-off-by: Rajeshwari S Shinde Signed-off-by: Akshay Saraswat Acked-by: Simon Glass --- Changes in V2: - None Changes in V3: - None Changes in V4: - Rebased on latest u-boot-samsung tree. Changes in V5: - Removed functions board_eth_init and board_mmc_init as they were moved to common/board.c Changes in V6: - None board/samsung/common/board.c | 2 + board/samsung/smdk5420/Makefile | 34 ++++++++ board/samsung/smdk5420/smdk5420.c | 159 ++++++++++++++++++++++++++++++++++ board/samsung/smdk5420/smdk5420_spl.c | 52 +++++++++++ boards.cfg | 1 + tools/Makefile | 2 + 6 files changed, 250 insertions(+) create mode 100644 board/samsung/smdk5420/Makefile create mode 100644 board/samsung/smdk5420/smdk5420.c create mode 100644 board/samsung/smdk5420/smdk5420_spl.c diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index 9ebfc42..2512a59 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -143,6 +143,7 @@ struct cros_ec_dev *board_get_cros_ec_dev(void) return local.cros_ec_dev; } +#ifdef CONFIG_CROS_EC static int board_init_cros_ec_devices(const void *blob) { local.cros_ec_err = cros_ec_init(blob, &local.cros_ec_dev); @@ -151,6 +152,7 @@ static int board_init_cros_ec_devices(const void *blob) return 0; } +#endif #if defined(CONFIG_POWER) #ifdef CONFIG_POWER_MAX77686 diff --git a/board/samsung/smdk5420/Makefile b/board/samsung/smdk5420/Makefile new file mode 100644 index 0000000..be538ec --- /dev/null +++ b/board/samsung/smdk5420/Makefile @@ -0,0 +1,34 @@ +# +# Copyright (C) 2013 Samsung Electronics +# +# SPDX-License-Identifier: GPL-2.0+ +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS += smdk5420_spl.o + +ifndef CONFIG_SPL_BUILD +COBJS += smdk5420.o +endif + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS)) + +ALL := $(obj).depend $(LIB) + +all: $(ALL) + +$(LIB): $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/samsung/smdk5420/smdk5420.c b/board/samsung/smdk5420/smdk5420.c new file mode 100644 index 0000000..d85b953 --- /dev/null +++ b/board/samsung/smdk5420/smdk5420.c @@ -0,0 +1,159 @@ +/* + * Copyright (C) 2013 Samsung Electronics + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +#ifdef CONFIG_USB_EHCI_EXYNOS +static int board_usb_vbus_init(void) +{ + struct exynos5_gpio_part1 *gpio1 = (struct exynos5_gpio_part1 *) + samsung_get_base_gpio_part1(); + + /* Enable VBUS power switch */ + s5p_gpio_direction_output(&gpio1->x2, 6, 1); + + /* VBUS turn ON time */ + mdelay(3); + + return 0; +} +#endif + +int exynos_init(void) +{ +#ifdef CONFIG_USB_EHCI_EXYNOS + board_usb_vbus_init(); +#endif + return 0; +} + +#ifdef CONFIG_LCD +void cfg_lcd_gpio(void) +{ + struct exynos5_gpio_part1 *gpio1 = + (struct exynos5_gpio_part1 *)samsung_get_base_gpio_part1(); + + /* For Backlight */ + s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT); + s5p_gpio_set_value(&gpio1->b2, 0, 1); + + /* LCD power on */ + s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT); + s5p_gpio_set_value(&gpio1->x1, 5, 1); + + /* Set Hotplug detect for DP */ + s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3)); +} + +vidinfo_t panel_info = { + .vl_freq = 60, + .vl_col = 2560, + .vl_row = 1600, + .vl_width = 2560, + .vl_height = 1600, + .vl_clkp = CONFIG_SYS_LOW, + .vl_hsp = CONFIG_SYS_LOW, + .vl_vsp = CONFIG_SYS_LOW, + .vl_dp = CONFIG_SYS_LOW, + .vl_bpix = 4, /* LCD_BPP = 2^4, for output conosle on LCD */ + + /* wDP panel timing infomation */ + .vl_hspw = 32, + .vl_hbpd = 80, + .vl_hfpd = 48, + + .vl_vspw = 6, + .vl_vbpd = 37, + .vl_vfpd = 3, + .vl_cmd_allow_len = 0xf, + + .win_id = 3, + .cfg_gpio = cfg_lcd_gpio, + .backlight_on = NULL, + .lcd_power_on = NULL, + .reset_lcd = NULL, + .dual_lcd_enabled = 0, + + .init_delay = 0, + .power_on_delay = 0, + .reset_delay = 0, + .interface_mode = FIMD_RGB_INTERFACE, + .dp_enabled = 1, +}; + +static struct edp_device_info edp_info = { + .disp_info = { + .h_res = 2560, + .h_sync_width = 32, + .h_back_porch = 80, + .h_front_porch = 48, + .v_res = 1600, + .v_sync_width = 6, + .v_back_porch = 37, + .v_front_porch = 3, + .v_sync_rate = 60, + }, + .lt_info = { + .lt_status = DP_LT_NONE, + }, + .video_info = { + .master_mode = 0, + .bist_mode = DP_DISABLE, + .bist_pattern = NO_PATTERN, + .h_sync_polarity = 0, + .v_sync_polarity = 0, + .interlaced = 0, + .color_space = COLOR_RGB, + .dynamic_range = VESA, + .ycbcr_coeff = COLOR_YCBCR601, + .color_depth = COLOR_8, + }, +}; + +static struct exynos_dp_platform_data dp_platform_data = { + .phy_enable = set_dp_phy_ctrl, + .edp_dev_info = &edp_info, +}; + +void init_panel_info(vidinfo_t *vid) +{ + vid->rgb_mode = MODE_RGB_P, + + exynos_set_dp_platform_data(&dp_platform_data); +} +#endif + +int board_get_revision(void) +{ + return 0; +} + +#ifdef CONFIG_DISPLAY_BOARDINFO +int checkboard(void) +{ + const char *board_name; + + board_name = fdt_getprop(gd->fdt_blob, 0, "model", NULL); + if (board_name == NULL) + printf("\nUnknown Board\n"); + else + printf("\nBoard: %s\n", board_name); + + return 0; +} +#endif diff --git a/board/samsung/smdk5420/smdk5420_spl.c b/board/samsung/smdk5420/smdk5420_spl.c new file mode 100644 index 0000000..73359f7 --- /dev/null +++ b/board/samsung/smdk5420/smdk5420_spl.c @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2013 The Chromium OS Authors. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include +#include + +#define SIGNATURE 0xdeadbeef + +/* Parameters of early board initialization in SPL */ +static struct spl_machine_param machine_param + __attribute__((section(".machine_param"))) = { + .signature = SIGNATURE, + .version = 1, + .params = "vmubfasirM", + .size = sizeof(machine_param), + + .mem_iv_size = 0x1f, + .mem_type = DDR_MODE_DDR3, + + /* + * Set uboot_size to 0x100000 bytes. + * + * This is an overly conservative value chosen to accommodate all + * possible U-Boot image. You are advised to set this value to a + * smaller realistic size via scripts that modifies the .machine_param + * section of output U-Boot image. + */ + .uboot_size = 0x100000, + + .boot_source = BOOT_MODE_OM, + .frequency_mhz = 800, + .arm_freq_mhz = 900, + .serial_base = 0x12c30000, + .i2c_base = 0x12c60000, + .mem_manuf = MEM_MANUF_SAMSUNG, +}; + +struct spl_machine_param *spl_get_machine_params(void) +{ + if (machine_param.signature != SIGNATURE) { + /* Will hang if SIGNATURE dont match */ + while (1) + ; + } + + return &machine_param; +} diff --git a/boards.cfg b/boards.cfg index aa2ee64..e476ebc 100644 --- a/boards.cfg +++ b/boards.cfg @@ -272,6 +272,7 @@ Active arm armv7 exynos samsung arndale Active arm armv7 exynos samsung origen origen - Chander Kashyap Active arm armv7 exynos samsung smdk5250 smdk5250 - Chander Kashyap Active arm armv7 exynos samsung smdk5250 snow - Rajeshwari Shinde +Active arm armv7 exynos samsung smdk5420 smdk5420 - Rajeshwari Shinde Active arm armv7 exynos samsung smdkv310 smdkv310 - Chander Kashyap Active arm armv7 exynos samsung trats trats - Lukasz Majewski Active arm armv7 exynos samsung trats2 trats2 - Piotr Wilczek diff --git a/tools/Makefile b/tools/Makefile index ca76f94..fcff6be 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -53,6 +53,7 @@ BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX) BIN_FILES-y += mkenvimage$(SFX) BIN_FILES-y += mkimage$(SFX) BIN_FILES-$(CONFIG_EXYNOS5250) += mk$(BOARD)spl$(SFX) +BIN_FILES-$(CONFIG_EXYNOS5420) += mk$(BOARD)spl$(SFX) BIN_FILES-$(CONFIG_MX23) += mxsboot$(SFX) BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX) BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX) @@ -88,6 +89,7 @@ OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc.o OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o OBJ_FILES-$(CONFIG_EXYNOS5250) += mkexynosspl.o +OBJ_FILES-$(CONFIG_EXYNOS5420) += mkexynosspl.o OBJ_FILES-$(CONFIG_KIRKWOOD) += kwboot.o OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o OBJ_FILES-$(CONFIG_MX23) += mxsboot.o