From patchwork Fri Feb 17 12:05:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SRICHARAN R X-Patchwork-Id: 141801 X-Patchwork-Delegate: trini@ti.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 9D3E2B6F99 for ; Fri, 17 Feb 2012 23:07:13 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8175928091; Fri, 17 Feb 2012 13:06:42 +0100 (CET) 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 DmvZkHOgxqwH; Fri, 17 Feb 2012 13:06:42 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0045F280CD; Fri, 17 Feb 2012 13:05:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D015E28097 for ; Fri, 17 Feb 2012 13:05:45 +0100 (CET) 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 VXcbGNMQJEtb for ; Fri, 17 Feb 2012 13:05:45 +0100 (CET) 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 devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by theia.denx.de (Postfix) with ESMTPS id 7603728098 for ; Fri, 17 Feb 2012 13:05:40 +0100 (CET) Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q1HC5awS012658 for ; Fri, 17 Feb 2012 06:05:37 -0600 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q1HC5a3U009640 for ; Fri, 17 Feb 2012 17:35:36 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Fri, 17 Feb 2012 17:35:35 +0530 Received: from ula0393807.apr.dhcp.ti.com (ula0393807-172024136145.apr.dhcp.ti.com [172.24.136.145]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id q1HC5XMD021801; Fri, 17 Feb 2012 17:35:35 +0530 (IST) From: R Sricharan To: Date: Fri, 17 Feb 2012 17:35:25 +0530 Message-ID: <1329480333-18353-10-git-send-email-r.sricharan@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1329480333-18353-1-git-send-email-r.sricharan@ti.com> References: <1329480333-18353-1-git-send-email-r.sricharan@ti.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 09/17] OMAP4/5: Make the sysctrl structure common 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Make the sysctrl structure common, so that it can be used in generic functions across socs. Also change the base address of the system control module, to include all the registers and not simply the io regs. Signed-off-by: R Sricharan --- arch/arm/cpu/armv7/omap4/hwinit.c | 4 ++-- arch/arm/cpu/armv7/omap5/hwinit.c | 4 ++-- arch/arm/include/asm/arch-omap4/omap.h | 10 ++++++---- arch/arm/include/asm/arch-omap5/omap.h | 13 +++++++------ drivers/mmc/omap_hsmmc.c | 4 ++-- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/arch/arm/cpu/armv7/omap4/hwinit.c b/arch/arm/cpu/armv7/omap4/hwinit.c index afa5484..187e938 100644 --- a/arch/arm/cpu/armv7/omap4/hwinit.c +++ b/arch/arm/cpu/armv7/omap4/hwinit.c @@ -59,8 +59,8 @@ void do_io_settings(void) u32 lpddr2io; struct control_lpddr2io_regs *lpddr2io_regs = (struct control_lpddr2io_regs *)LPDDR2_IO_REGS_BASE; - struct omap4_sys_ctrl_regs *const ctrl = - (struct omap4_sys_ctrl_regs *)SYSCTRL_GENERAL_CORE_BASE; + struct omap_sys_ctrl_regs *const ctrl = + (struct omap_sys_ctrl_regs *)SYSCTRL_GENERAL_CORE_BASE; u32 omap4_rev = omap_revision(); diff --git a/arch/arm/cpu/armv7/omap5/hwinit.c b/arch/arm/cpu/armv7/omap5/hwinit.c index 84b3830..7da7075 100644 --- a/arch/arm/cpu/armv7/omap5/hwinit.c +++ b/arch/arm/cpu/armv7/omap5/hwinit.c @@ -58,8 +58,8 @@ const struct gpio_bank *const omap_gpio_bank = gpio_bank_54xx; void do_io_settings(void) { u32 io_settings = 0, mask = 0; - struct omap5_sys_ctrl_regs *ioregs_base = - (struct omap5_sys_ctrl_regs *) OMAP5_IOREGS_BASE; + struct omap_sys_ctrl_regs *ioregs_base = + (struct omap_sys_ctrl_regs *) SYSCTRL_GENERAL_CORE_BASE; /* Impedance settings EMMC, C2C 1,2, hsi2 */ mask = (ds_mask << 2) | (ds_mask << 8) | diff --git a/arch/arm/include/asm/arch-omap4/omap.h b/arch/arm/include/asm/arch-omap4/omap.h index 416c6de..5fd692f 100644 --- a/arch/arm/include/asm/arch-omap4/omap.h +++ b/arch/arm/include/asm/arch-omap4/omap.h @@ -139,18 +139,20 @@ struct s32ktimer { unsigned int s32k_cr; /* 0x10 */ }; -struct omap4_sys_ctrl_regs { +struct omap_sys_ctrl_regs { unsigned int pad1[129]; unsigned int control_id_code; /* 0x4A002204 */ unsigned int pad11[22]; unsigned int control_std_fuse_opp_bgap; /* 0x4a002260 */ - unsigned int pad2[47]; + unsigned int pad2[24]; /* 0x4a002264 */ + unsigned int control_status; /* 0x4a0022c4 */ + unsigned int pad3[22]; /* 0x4a0022c8 */ unsigned int control_ldosram_iva_voltage_ctrl; /* 0x4A002320 */ unsigned int control_ldosram_mpu_voltage_ctrl; /* 0x4A002324 */ unsigned int control_ldosram_core_voltage_ctrl; /* 0x4A002328 */ - unsigned int pad3[260277]; + unsigned int pad4[260277]; unsigned int control_pbiaslite; /* 0x4A100600 */ - unsigned int pad4[63]; + unsigned int pad5[63]; unsigned int control_efuse_1; /* 0x4A100700 */ unsigned int control_efuse_2; /* 0x4A100704 */ }; diff --git a/arch/arm/include/asm/arch-omap5/omap.h b/arch/arm/include/asm/arch-omap5/omap.h index 10a973c..7e17c76 100644 --- a/arch/arm/include/asm/arch-omap5/omap.h +++ b/arch/arm/include/asm/arch-omap5/omap.h @@ -136,9 +136,10 @@ struct s32ktimer { unsigned int s32k_cr; /* 0x10 */ }; -#define OMAP5_IOREGS_BASE 0x4A002DA0 - -struct omap5_sys_ctrl_regs { +struct omap_sys_ctrl_regs { + u32 pad0[77]; /* 0x4A002000 */ + u32 control_status; /* 0x4A002134 */ + u32 pad1[794]; /* 0x4A002138 */ u32 control_paconf_global; /* 0x4A002DA0 */ u32 control_paconf_mode; /* 0x4A002DA4 */ u32 control_smart1io_padconf_0; /* 0x4A002DA8 */ @@ -149,7 +150,7 @@ struct omap5_sys_ctrl_regs { u32 control_smart2io_padconf_2; /* 0x4A002DBC */ u32 control_smart3io_padconf_0; /* 0x4A002DC0 */ u32 control_smart3io_padconf_1; /* 0x4A002DC4 */ - u32 pad1[14]; + u32 pad2[14]; u32 control_pbias; /* 0x4A002E00 */ u32 control_i2c_0; /* 0x4A002E04 */ u32 control_camera_rx; /* 0x4A002E08 */ @@ -160,7 +161,7 @@ struct omap5_sys_ctrl_regs { u32 control_usb2phycore; /* 0x4A002E1C */ u32 control_hdmi_1; /*0x4A002E20*/ u32 control_hsi; /*0x4A002E24*/ - u32 pad2[2]; + u32 pad3[2]; u32 control_ddr3ch1_0; /*0x4A002E30*/ u32 control_ddr3ch2_0; /*0x4A002E34*/ u32 control_ddrch1_0; /*0x4A002E38*/ @@ -183,7 +184,7 @@ struct omap5_sys_ctrl_regs { u32 control_srcomp_east_side; /*0x4A002E7C*/ u32 control_srcomp_west_side; /*0x4A002E80*/ u32 control_srcomp_code_latch; /*0x4A002E84*/ - u32 pad3[3680198]; + u32 pad4[3680198]; u32 control_smart1nopmio_padconf_0; /* 0x4AE0CDA0 */ u32 control_smart1nopmio_padconf_1; /* 0x4AE0CDA4 */ u32 control_padconf_mode; /* 0x4AE0CDA8 */ diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index ef64e37..afd3266 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -45,8 +45,8 @@ static struct mmc hsmmc_dev[2]; static void omap4_vmmc_pbias_config(struct mmc *mmc) { u32 value = 0; - struct omap4_sys_ctrl_regs *const ctrl = - (struct omap4_sys_ctrl_regs *)SYSCTRL_GENERAL_CORE_BASE; + struct omap_sys_ctrl_regs *const ctrl = + (struct omap_sys_ctrl_regs *) SYSCTRL_GENERAL_CORE_BASE; value = readl(&ctrl->control_pbiaslite);