From patchwork Mon Apr 7 22:14:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 337549 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id CCCBD1400C6 for ; Tue, 8 Apr 2014 08:15:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D2CBA4B666; Tue, 8 Apr 2014 00:15:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6UAmyVlOt23I; Tue, 8 Apr 2014 00:15:16 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E48794B662; Tue, 8 Apr 2014 00:15:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E4E0C4B662 for ; Tue, 8 Apr 2014 00:15:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NU8B1NHhjz6T for ; Tue, 8 Apr 2014 00:15:03 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bk0-f49.google.com (mail-bk0-f49.google.com [209.85.214.49]) by theia.denx.de (Postfix) with ESMTPS id C1D3C4B661 for ; Tue, 8 Apr 2014 00:14:59 +0200 (CEST) Received: by mail-bk0-f49.google.com with SMTP id my13so27810bkb.36 for ; Mon, 07 Apr 2014 15:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=efu8XcP9H3vlHtcGXG4xSk2IgaNi6yDpHZBCJe6z/AY=; b=ulXaQeiltwGe60rcdCYCBzkfHvtWPI6oUlZ3TXVjPLAhHnbYZSJ+Dc+kC2TyRRjwg7 al8rXZCbfakJ++pOfx8tnE6i+/hHtvE0JiYYrESNOMmnUj7knxX13ezxVNIIkyBaBGzT 3WwYlaeV/Ymnc6dyp7O0Xc2RTW2FfifPBBMfnBFFIzIqMfRDZBprACPkQDqAk4O6a5DH yV97dYwHZPoJGuNPYhkg+lxUkO/9dopJX0uGzNdXP4tq0hlAJ2YeIVeTIrpq9WXEH0kg hmoDpMZaCtGHOX3Zly74nmfk5UA2enhmj8RBDHEirY1XIaTsekhRkAKQE8lJ6KHRYsdM u7bw== X-Received: by 10.204.165.207 with SMTP id j15mr34390bky.45.1396908897163; Mon, 07 Apr 2014 15:14:57 -0700 (PDT) Received: from workstation.zombienet.local (p57A86DBF.dip0.t-ipconnect.de. [87.168.109.191]) by mx.google.com with ESMTPSA id ew15sm449499bkb.1.2014.04.07.15.14.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Apr 2014 15:14:56 -0700 (PDT) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Tue, 8 Apr 2014 00:14:53 +0200 Message-Id: <1396908893-12011-1-git-send-email-daniel.schwierzeck@gmail.com> X-Mailer: git-send-email 1.8.3.2 Subject: [U-Boot] [RFC PATCH] MIPS: incaip: move board specific code out of generic code X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This is required to switch MIPS platform to generic board. Cc: Wolfgang Denk Signed-off-by: Daniel Schwierzeck --- Wolfgang, I would rather remove this board. It is obviously dead and no one ever cared about it since you have added it. The code does not conform to current coding style. Also it needs a lot of cleanup if we switch to driver model eventually. --- arch/mips/include/asm/inca-ip.h | 3 +++ arch/mips/include/asm/u-boot-mips.h | 2 -- arch/mips/lib/board.c | 3 --- board/incaip/incaip.c | 7 +++++-- include/common.h | 3 --- include/configs/incaip.h | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/mips/include/asm/inca-ip.h b/arch/mips/include/asm/inca-ip.h index 5f03e2a..dcaa3e7 100644 --- a/arch/mips/include/asm/inca-ip.h +++ b/arch/mips/include/asm/inca-ip.h @@ -2428,3 +2428,6 @@ If set and clear bit are written concurrently with 1, the associated bit is not #define INCA_IP_ICU_ICU_EICR_EII2 (value) (((( 1 << 3) - 1) & (value)) << 8) #define INCA_IP_ICU_ICU_EICR_EII1 (value) (((( 1 << 3) - 1) & (value)) << 4) #define INCA_IP_ICU_ICU_EICR_EII0 (value) (((( 1 << 3) - 1) & (value)) << 0) + +unsigned int incaip_get_cpuclk(void); +int incaip_set_cpuclk(void); diff --git a/arch/mips/include/asm/u-boot-mips.h b/arch/mips/include/asm/u-boot-mips.h index 9f3cce9..a5b2fc0 100644 --- a/arch/mips/include/asm/u-boot-mips.h +++ b/arch/mips/include/asm/u-boot-mips.h @@ -21,5 +21,3 @@ static inline unsigned long image_copy_end(void) extern char __image_copy_end[]; return (unsigned long) &__image_copy_end; } - -extern int incaip_set_cpuclk(void); diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index 317c825..3200d87 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -103,9 +103,6 @@ init_fnc_t *init_sequence[] = { board_early_init_f, timer_init, env_init, /* initialize environment */ -#ifdef CONFIG_INCA_IP - incaip_set_cpuclk, /* set cpu clock according to env. variable */ -#endif init_baudrate, /* initialize baudrate settings */ serial_init, /* serial communications setup */ console_init_f, diff --git a/board/incaip/incaip.c b/board/incaip/incaip.c index 217b8af..5abd2b8 100644 --- a/board/incaip/incaip.c +++ b/board/incaip/incaip.c @@ -13,8 +13,6 @@ #include #include -extern uint incaip_get_cpuclk(void); - void _machine_restart(void) { *INCA_IP_WDT_RST_REQ = 0x3f; @@ -74,6 +72,11 @@ phys_size_t initdram(int board_type) return max_size; } +int board_early_init_f(void) +{ + return incaip_set_cpuclk(); +} + int checkboard (void) { unsigned long chipid = *INCA_IP_WDT_CHIPID; diff --git a/include/common.h b/include/common.h index cbd3c9e..f77273e 100644 --- a/include/common.h +++ b/include/common.h @@ -692,9 +692,6 @@ ulong get_UCLK (void); #if defined(CONFIG_LH7A40X) ulong get_PLLCLK (void); #endif -#if defined CONFIG_INCA_IP -uint incaip_get_cpuclk (void); -#endif #if defined(CONFIG_IMX) ulong get_systemPLLCLK(void); ulong get_FCLK(void); diff --git a/include/configs/incaip.h b/include/configs/incaip.h index e11d184..2c4893d 100644 --- a/include/configs/incaip.h +++ b/include/configs/incaip.h @@ -103,7 +103,7 @@ #define CONFIG_SYS_BOOTPARAMS_LEN 128*1024 -#define CONFIG_SYS_MIPS_TIMER_FREQ (incaip_get_cpuclk() / 2) +#define CONFIG_SYS_MIPS_TIMER_FREQ (CONFIG_CPU_CLOCK_RATE / 2) #define CONFIG_SYS_SDRAM_BASE 0x80000000