From patchwork Mon Jul 22 12:02:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1135029 X-Patchwork-Delegate: ykai007@gmail.com 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.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tn1msZYy"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45smLC5Tpfz9sDQ for ; Tue, 23 Jul 2019 01:51:15 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 54A98C21E7E; Mon, 22 Jul 2019 15:51:14 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 43D46C21EBD; Mon, 22 Jul 2019 12:08:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4047AC21FD1; Mon, 22 Jul 2019 12:08:27 +0000 (UTC) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by lists.denx.de (Postfix) with ESMTPS id D7E84C21EBD for ; Mon, 22 Jul 2019 12:02:43 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id u14so17289205pfn.2 for ; Mon, 22 Jul 2019 05:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=P96izLWt0K60Jmo2BCsVYw2NfOmLPAWDwFWZVJdXDoU=; b=tn1msZYy1sLeKkWZxesextvh76nEfZeq5pskkmZ69Tk5w0cEvZ4RJGlLpCoJn9HGpg SjaYn1lV/uJYjkK2iu/G/ICOG9k8DjbjeQllo7SHlaC4lYNrqDC25jE0JVoTJrYkCyu0 bxqnMQ6geato7zd4plpE7VqdD9vQ0bJR1qN3AYSBdm3Lls0bw/TV7ExnWCuDBWtq1Buy ntt9W0n/akvrSvsqh/bvI8PWttlwJMV2UYytyxeWqO0xqw3P8h03buFPJaa6GuYeGxZi /Qfm1iqefG9bk/xZ27QB+kMo2Fx/CWNqLMwZ3Hj4gQoCz2NH5LdnXsmNowbzqzE0AIJC XNQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=P96izLWt0K60Jmo2BCsVYw2NfOmLPAWDwFWZVJdXDoU=; b=omvEClCp7gtMPSjYm3VthJVgB8L4R/60N373HiWbtTa4spQZAs8wWqDPX00QZiJjdN 2y8StwFLoDdYWRnCMqPvOAEqZHVnl2nkvP+nbOaI8WmWukV6kJ2sN9GQ3ZbEnUmrsuOX oItnyjG0UUs4FgU90ANUQPLovg/SsAXGRJLndybHrw8z6qoPcy9eTlaV6zhTcyphMEcJ ZT+jDu7b606TTWRWHazWEbS95zKUhdzHNCV7ErQ0wIvJPVz1rRurZKo1+tKoGPCY8Ae5 IXLHltQ/QF6FxKWV9WFfQbFZQYRYZVD4hZAbAkHbDC2lBon48bs4/ODwMkLqf7Gg+0LV vfYA== X-Gm-Message-State: APjAAAUOMhpx267YMJZvwbGte2qe1kKRxEdjs4B4axtoeA1LQ+X6DY3/ bGiwYsLenhpvZO2IcCOgUcIsrxSw X-Google-Smtp-Source: APXvYqxNpinfqNrPO3RSi7sIGN+WrPjuWH3bPbTdplVz7JVANeyv1mPOAoL0wx71FkXkMiFM7z+tFw== X-Received: by 2002:a63:f048:: with SMTP id s8mr43358969pgj.26.1563796962431; Mon, 22 Jul 2019 05:02:42 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id a25sm13121969pfo.60.2019.07.22.05.02.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:02:42 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 20:02:04 +0800 Message-Id: <20190722120221.25468-8-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722120221.25468-1-kever.yang@rock-chips.com> References: <20190722120221.25468-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 07/24] rockchip: rk3036: Migrate to use common board file 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" Use common board file for board_init() and board_late_init(), for Rockchip SoCs have very similar process. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/Makefile | 1 - arch/arm/mach-rockchip/rk3036-board.c | 88 --------------------------- 3 files changed, 1 insertion(+), 89 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3036-board.c diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 4d983f8fce..74e37eeb2a 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -7,6 +7,7 @@ config ROCKCHIP_RK3036 select SPL imply USB_FUNCTION_ROCKUSB imply CMD_ROCKUSB + imply ROCKCHIP_COMMON_BOARD help The Rockchip RK3036 is a ARM-based SoC with a dual-core Cortex-A7 including NEON and GPU, Mali-400 graphics, several DDR3 options diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 7d2a227794..e7f9a11a97 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -26,7 +26,6 @@ obj-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board.o obj-$(CONFIG_ROCKCHIP_RK3128) += rk3128-board.o obj-$(CONFIG_ROCKCHIP_RK322X) += rk322x-board.o obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board.o -obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board.o obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board.o obj-$(CONFIG_ROCKCHIP_RV1108) += rv1108-board.o endif diff --git a/arch/arm/mach-rockchip/rk3036-board.c b/arch/arm/mach-rockchip/rk3036-board.c deleted file mode 100644 index 40f5e0aa3d..0000000000 --- a/arch/arm/mach-rockchip/rk3036-board.c +++ /dev/null @@ -1,88 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2015 Rockchip Electronics Co., Ltd - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -__weak int rk_board_late_init(void) -{ - return 0; -} - -int board_late_init(void) -{ - setup_boot_mode(); - - return rk_board_late_init(); -} - -int board_init(void) -{ - return 0; -} - -#if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) -void enable_caches(void) -{ - /* Enable D-cache. I-cache is already enabled in start.S */ - dcache_enable(); -} -#endif - -#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG) -#include -#include - -static struct dwc2_plat_otg_data otg_data = { - .rx_fifo_sz = 512, - .np_tx_fifo_sz = 16, - .tx_fifo_sz = 128, -}; - -int board_usb_init(int index, enum usb_init_type init) -{ - int node; - const char *mode; - bool matched = false; - const void *blob = gd->fdt_blob; - - /* find the usb_otg node */ - node = fdt_node_offset_by_compatible(blob, -1, - "snps,dwc2"); - - while (node > 0) { - mode = fdt_getprop(blob, node, "dr_mode", NULL); - if (mode && strcmp(mode, "otg") == 0) { - matched = true; - break; - } - - node = fdt_node_offset_by_compatible(blob, node, - "snps,dwc2"); - } - if (!matched) { - debug("Not found usb_otg device\n"); - return -ENODEV; - } - otg_data.regs_otg = fdtdec_get_addr(blob, node, "reg"); - - return dwc2_udc_probe(&otg_data); -} - -int board_usb_cleanup(int index, enum usb_init_type init) -{ - return 0; -} -#endif