From patchwork Fri Aug 7 05:28:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Dubov X-Patchwork-Id: 71670 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from diddl.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id C20D6832E416 for ; Fri, 7 Aug 2009 07:30:02 +0200 (CEST) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by diddl.denx.de (Postfix) with ESMTP id B2113C9601BF for ; Fri, 7 Aug 2009 07:30:02 +0200 (CEST) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.8) for (single-drop); Fri, 07 Aug 2009 07:30:02 +0200 (CEST) Received: from murder (svr19.m-online.net [192.168.3.147]) by backend2 (Cyrus v2.2.12) with LMTPA; Fri, 07 Aug 2009 07:32:15 +0200 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend3.pop.m-online.net (Cyrus v2.2.13) with LMTPA; Fri, 07 Aug 2009 07:29:58 +0200 Received: from scanner-2.m-online.net (unknown [192.168.8.166]) by mail.m-online.net (Postfix) with ESMTP id B4559200093; Fri, 7 Aug 2009 07:29:58 +0200 (CEST) Received: from mxin-1.m-online.net ([192.168.2.222]) by scanner-2.m-online.net (scanner-2.m-online.net [192.168.8.166]) (amavisd-new, port 10026) with ESMTP id 00418-04; Fri, 7 Aug 2009 07:31:17 +0200 (CEST) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-1.m-online.net (Postfix) with ESMTP id 9B06246E1F2; Fri, 7 Aug 2009 07:29:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 80997280CF; Fri, 7 Aug 2009 07:29:20 +0200 (CEST) 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 RuM64awnqOx0; Fri, 7 Aug 2009 07:29:20 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AD4E1280AB; Fri, 7 Aug 2009 07:29:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 549832808D for ; Fri, 7 Aug 2009 07:29:04 +0200 (CEST) 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 jOmStG54--PE for ; Fri, 7 Aug 2009 07:29:03 +0200 (CEST) Received: from nschwmtas01p.mx.bigpond.com (nschwmtas01p.mx.bigpond.com [61.9.189.137]) by theia.denx.de (Postfix) with ESMTP id 048DF28088 for ; Fri, 7 Aug 2009 07:28:56 +0200 (CEST) Received: from nschwotgx02p.mx.bigpond.com ([203.45.25.144]) by nschwmtas01p.mx.bigpond.com with ESMTP id <20090807052854.TZEO26885.nschwmtas01p.mx.bigpond.com@nschwotgx02p.mx.bigpond.com>; Fri, 7 Aug 2009 05:28:54 +0000 Received: from mail.starintellect.com.au ([203.45.25.144]) by nschwotgx02p.mx.bigpond.com with ESMTP id <20090807052854.FUCK13014.nschwotgx02p.mx.bigpond.com@mail.starintellect.com.au>; Fri, 7 Aug 2009 05:28:54 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.starintellect.com (Postfix) with ESMTP id C9103760232; Fri, 7 Aug 2009 15:28:53 +1000 (EST) Received: from mail.starintellect.com.au ([127.0.0.1]) by localhost (mail.starintellect.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mT5MG+Ox7L9Z; Fri, 7 Aug 2009 15:28:44 +1000 (EST) Received: from localhost.localdomain (sunapp.starintellect.com [192.168.1.14]) by mail.starintellect.com (Postfix) with ESMTP id E6687760230; Fri, 7 Aug 2009 15:28:43 +1000 (EST) From: oakad@yahoo.com To: u-boot@lists.denx.de Date: Fri, 7 Aug 2009 15:28:33 +1000 Message-Id: <1249622915-1473-3-git-send-email-oakad@yahoo.com> X-Mailer: git-send-email 1.5.6.4 In-Reply-To: <1249622915-1473-2-git-send-email-oakad@yahoo.com> References: <1249622915-1473-1-git-send-email-oakad@yahoo.com> <1249622915-1473-2-git-send-email-oakad@yahoo.com> X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150201.4A7BBB96.00C9,ss=1,fgs=0 Cc: Alex Dubov Subject: [U-Boot] [PATCH 2/4] stx: factor out LAW settings common for all STx boards X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 X-Virus-Scanned: by amavisd-new at m-online.net From: Alex Dubov All STx boards follow common convention for LAW region assignment. Signed-off-by: Alex Dubov --- board/stx/common/Makefile | 54 +++++++++++++++++++++++++++++++++ board/stx/{stxssa => common}/law.c | 22 ++++++++----- board/stx/stxgp3/Makefile | 1 - board/stx/stxgp3/law.c | 58 ------------------------------------ board/stx/stxssa/Makefile | 1 - include/configs/stxgp3.h | 3 +- 6 files changed, 69 insertions(+), 70 deletions(-) create mode 100644 board/stx/common/Makefile rename board/stx/{stxssa => common}/law.c (81%) delete mode 100644 board/stx/stxgp3/law.c diff --git a/board/stx/common/Makefile b/board/stx/common/Makefile new file mode 100644 index 0000000..73c6e46 --- /dev/null +++ b/board/stx/common/Makefile @@ -0,0 +1,54 @@ +# +# (C) Copyright 2006 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +ifneq ($(OBJTREE),$(SRCTREE)) +$(shell mkdir -p $(obj)board/$(VENDOR)/common) +endif + +LIB = $(obj)lib$(VENDOR).a + +COBJS-${CONFIG_MPC85xx} += law.o + +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/stx/stxssa/law.c b/board/stx/common/law.c similarity index 81% rename from board/stx/stxssa/law.c rename to board/stx/common/law.c index 55dde66..4c2f97a 100644 --- a/board/stx/stxssa/law.c +++ b/board/stx/common/law.c @@ -33,28 +33,32 @@ * 0x0000_0000 0x7fff_ffff DDR 2G * 0x8000_0000 0x9fff_ffff PCI1 MEM 512M * 0xa000_0000 0xbfff_ffff PCI2 MEM 512M + * 0xc000_0000 0xdfff_ffff RapidIO 512M * 0xe000_0000 0xe000_ffff CCSR 1M * 0xe200_0000 0xe2ff_ffff PCI1 IO 16M * 0xe300_0000 0xe3ff_ffff PCI2 IO 16M - * 0xf000_0000 0xfaff_ffff Local bus 128M - * 0xfb00_0000 0xfb00_ffff Config Latch 64K - * 0xfc00_0000 0xffff_ffff FLASH (boot bank) 64M + * 0xf000_0000 0xffff_ffff LBC options + FLASH 256M * * Notes: * CCSRBAR and L2-as-SRAM don't need a configured Local Access Window. * If flash is 8M at default position (last 8M), no LAW needed. + * + * LAW 0 is reserved for boot mapping */ struct law_entry law_table[] = { -#ifndef CONFIG_SPD_EEPROM - SET_LAW(CONFIG_SYS_DDR_SDRAM_BASE, LAW_SIZE_128M, LAW_TRGT_IF_DDR), +#ifdef CONFIG_SYS_PCI1_MEM_PHYS + SET_LAW(CONFIG_SYS_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI), + SET_LAW(CONFIG_SYS_PCI1_IO_PHYS, LAW_SIZE_16M, LAW_TRGT_IF_PCI), #endif - SET_LAW(CONFIG_SYS_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_1), +#ifdef CONFIG_SYS_PCI2_MEM_PHYS SET_LAW(CONFIG_SYS_PCI2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2), - SET_LAW(CONFIG_SYS_PCI1_IO_PHYS, LAW_SIZE_16M, LAW_TRGT_IF_PCI_1), SET_LAW(CONFIG_SYS_PCI2_IO_PHYS, LAW_SIZE_16M, LAW_TRGT_IF_PCI_2), - /* Map the whole localbus, including flash and reset latch. */ - SET_LAW(CONFIG_SYS_LBC_OPTION_BASE, LAWAR_SIZE_256M, LAW_TRGT_IF_LBC), +#endif +#ifdef CONFIG_SYS_RIO_MEM_PHYS + SET_LAW(CONFIG_SYS_RIO_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_RIO), +#endif + SET_LAW(CONFIG_SYS_LBC_OPTION_BASE, LAWAR_SIZE_256M, LAW_TRGT_IF_LBC) }; int num_law_entries = ARRAY_SIZE(law_table); diff --git a/board/stx/stxgp3/Makefile b/board/stx/stxgp3/Makefile index 5a68f11..0aae375 100644 --- a/board/stx/stxgp3/Makefile +++ b/board/stx/stxgp3/Makefile @@ -26,7 +26,6 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a COBJS-y += $(BOARD).o -COBJS-y += law.o COBJS-y += tlb.o COBJS-y += flash.o COBJS-$(CONFIG_FSL_DDR1) += ddr.o diff --git a/board/stx/stxgp3/law.c b/board/stx/stxgp3/law.c deleted file mode 100644 index ba89f0e..0000000 --- a/board/stx/stxgp3/law.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2008 Freescale Semiconductor, Inc. - * - * (C) Copyright 2000 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -#include -#include -#include - -/* - * LAW(Local Access Window) configuration: - * - * 0x0000_0000 0x7fff_ffff DDR 2G - * 0x8000_0000 0x9fff_ffff PCI1 MEM 512M - * 0xc000_0000 0xdfff_ffff RapidIO 512M - * 0xe000_0000 0xe000_ffff CCSR 1M - * 0xe200_0000 0xe2ff_ffff PCI1 IO 16M - * 0xf000_0000 0xf7ff_ffff SDRAM 128M - * 0xfc00_0000 0xfc00_ffff Config Latch 64K - * 0xff00_0000 0xffff_ffff FLASH (boot bank) 16M - * - * Notes: - * CCSRBAR and L2-as-SRAM don't need a configured Local Access Window. - * If flash is 8M at default position (last 8M), no LAW needed. - */ - -struct law_entry law_table[] = { -#ifndef CONFIG_SPD_EEPROM - SET_LAW(CONFIG_SYS_DDR_SDRAM_BASE, LAW_SIZE_128M, LAW_TRGT_IF_DDR), -#endif - SET_LAW(CONFIG_SYS_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI), - /* This is not so much the SDRAM map as it is the whole localbus map. */ - SET_LAW(CONFIG_SYS_LBC_SDRAM_BASE, LAW_SIZE_256M, LAW_TRGT_IF_LBC), - SET_LAW(CONFIG_SYS_PCI1_IO_PHYS, LAW_SIZE_16M, LAW_TRGT_IF_PCI), - SET_LAW(CONFIG_SYS_RIO_MEM_BASE, LAWAR_SIZE_512M, LAW_TRGT_IF_RIO), -}; - -int num_law_entries = ARRAY_SIZE(law_table); diff --git a/board/stx/stxssa/Makefile b/board/stx/stxssa/Makefile index 9ab41ec..432d4b4 100644 --- a/board/stx/stxssa/Makefile +++ b/board/stx/stxssa/Makefile @@ -26,7 +26,6 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a COBJS-y += $(BOARD).o -COBJS-y += law.o COBJS-y += tlb.o COBJS-$(CONFIG_FSL_DDR1) += ddr.o diff --git a/include/configs/stxgp3.h b/include/configs/stxgp3.h index 0424e29..7954d8f 100644 --- a/include/configs/stxgp3.h +++ b/include/configs/stxgp3.h @@ -76,7 +76,8 @@ * This address, however, is used to configure a 256M local bus * window that includes the Config latch below. */ -#define CONFIG_SYS_LBC_SDRAM_BASE 0xf0000000 /* Localbus SDRAM */ +#define CONFIG_SYS_LBC_OPTION_BASE 0xf0000000 +#define CONFIG_SYS_LBC_SDRAM_BASE CONFIG_SYS_LBC_OPTION_BASE /* Localbus SDRAM */ #define CONFIG_SYS_LBC_SDRAM_SIZE 256 /* LBC SDRAM is 64MB */ #define CONFIG_SYS_FLASH_BASE 0xff000000 /* start of FLASH 16M */