xref: /rk3399_rockchip-uboot/board/freescale/mpc8641hpcn/law.c (revision 326ea986ac150acdc7656d57fca647db80b50158)
14933b91fSBecky Bruce /*
21b77ca8aSKumar Gala  * Copyright 2008,2010-2011 Freescale Semiconductor, Inc.
34933b91fSBecky Bruce  *
44933b91fSBecky Bruce  * (C) Copyright 2000
54933b91fSBecky Bruce  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
64933b91fSBecky Bruce  *
7*1a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
84933b91fSBecky Bruce  */
94933b91fSBecky Bruce 
104933b91fSBecky Bruce #include <common.h>
114933b91fSBecky Bruce #include <asm/fsl_law.h>
124933b91fSBecky Bruce #include <asm/mmu.h>
134933b91fSBecky Bruce 
144933b91fSBecky Bruce /*
154933b91fSBecky Bruce  * LAW(Local Access Window) configuration:
164933b91fSBecky Bruce  *
174933b91fSBecky Bruce  * 0x0000_0000     0x7fff_ffff     DDR                     2G
183111d32cSBecky Bruce  * if PCI (prepend 0xc_0000_0000 if CONFIG_PHYS_64BIT)
1946f3e385SKumar Gala  * 0x8000_0000     0x9fff_ffff     PCIE1 MEM                512M
2046f3e385SKumar Gala  * 0xa000_0000     0xbfff_ffff     PCIE2 MEM                512M
213111d32cSBecky Bruce  * else if RIO (prepend 0xc_0000_0000 if CONFIG_PHYS_64BIT)
22c759a01aSBecky Bruce  * 0x8000_0000     0x9fff_ffff     RapidIO                 512M
23c759a01aSBecky Bruce  * endif
243111d32cSBecky Bruce  * (prepend 0xf_0000_0000 if CONFIG_PHYS_64BIT)
2546f3e385SKumar Gala  * 0xffc0_0000     0xffc0_ffff     PCIE1 IO                 64K
2646f3e385SKumar Gala  * 0xffc1_0000     0xffc1_ffff     PCIE2 IO                 64K
27c759a01aSBecky Bruce  * 0xffe0_0000     0xffef_ffff     CCSRBAR                 1M
28c759a01aSBecky Bruce  * 0xffdf_0000     0xffe0_0000     PIXIS, CF               64K
29c759a01aSBecky Bruce  * 0xef80_0000     0xefff_ffff     FLASH (boot bank)       8M
304933b91fSBecky Bruce  *
314933b91fSBecky Bruce  * Notes:
32c759a01aSBecky Bruce  *    CCSRBAR doesn't need a configured Local Access Window.
334933b91fSBecky Bruce  *    If flash is 8M at default position (last 8M), no LAW needed.
344933b91fSBecky Bruce  */
354933b91fSBecky Bruce 
364933b91fSBecky Bruce struct law_entry law_table[] = {
374933b91fSBecky Bruce #if !defined(CONFIG_SPD_EEPROM)
386d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_LAW(CONFIG_SYS_DDR_SDRAM_BASE, LAW_SIZE_256M, LAW_TRGT_IF_DDR_1),
394933b91fSBecky Bruce #endif
403111d32cSBecky Bruce 	SET_LAW(PIXIS_BASE_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_LBC),
413111d32cSBecky Bruce 	SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_8M, LAW_TRGT_IF_LBC),
424933b91fSBecky Bruce };
434933b91fSBecky Bruce 
444933b91fSBecky Bruce int num_law_entries = ARRAY_SIZE(law_table);
45