📄 kilauea.h
字号:
/* * Copyright (c) 2008 Nuovation System Designs, LLC * Grant Erickson <gerickson@nuovations.com> * * (C) Copyright 2007 * Stefan Roese, DENX Software Engineering, sr@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 *//************************************************************************ * kilauea.h - configuration for AMCC Kilauea (405EX) ***********************************************************************/#ifndef __CONFIG_H#define __CONFIG_H/*----------------------------------------------------------------------- * High Level Configuration Options *----------------------------------------------------------------------*/#define CONFIG_KILAUEA 1 /* Board is Kilauea */#define CONFIG_4xx 1 /* ... PPC4xx family */#define CONFIG_405EX 1 /* Specifc 405EX support*/#define CONFIG_SYS_CLK_FREQ 33333333 /* ext frequency to pll *//* * Include common defines/options for all AMCC eval boards */#define CONFIG_HOSTNAME kilauea#include "amcc-common.h"#define CONFIG_BOARD_EARLY_INIT_F 1 /* Call board_early_init_f */#define CONFIG_MISC_INIT_R 1 /* Call misc_init_r */#define CONFIG_BOARD_EMAC_COUNT/*----------------------------------------------------------------------- * Base addresses -- Note these are effective addresses where the * actual resources get mapped (not physical addresses) *----------------------------------------------------------------------*/#define CFG_FLASH_BASE 0xFC000000#define CFG_NAND_ADDR 0xF8000000#define CFG_FPGA_BASE 0xF0000000#define CFG_PERIPHERAL_BASE 0xEF600000 /* internal peripherals*//*----------------------------------------------------------------------- * Initial RAM & Stack Pointer Configuration Options * * There are traditionally three options for the primordial * (i.e. initial) stack usage on the 405-series: * * 1) On-chip Memory (OCM) (i.e. SRAM) * 2) Data cache * 3) SDRAM * * For the 405EX(r), there is no OCM, so we are left with (2) or (3) * the latter of which is less than desireable since it requires * setting up the SDRAM and ECC in assembly code. * * To use (2), define 'CFG_INIT_DCACHE_CS' to be an unused chip * select on the External Bus Controller (EBC) and then select a * value for 'CFG_INIT_RAM_ADDR' outside of the range of valid, * physical SDRAM. Otherwise, undefine 'CFG_INIT_DCACHE_CS' and * select a value for 'CFG_INIT_RAM_ADDR' within the range of valid, * physical SDRAM to use (3). *-----------------------------------------------------------------------*/#define CFG_INIT_DCACHE_CS 4#if defined(CFG_INIT_DCACHE_CS)#define CFG_INIT_RAM_ADDR (CFG_SDRAM_BASE + ( 1 << 30)) /* 1 GiB */#else#define CFG_INIT_RAM_ADDR (CFG_SDRAM_BASE + (32 << 20)) /* 32 MiB */#endif /* defined(CFG_INIT_DCACHE_CS) */#define CFG_INIT_RAM_END (4 << 10) /* 4 KiB */#define CFG_GBL_DATA_SIZE 256 /* num bytes initial data */#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)/* * If the data cache is being used for the primordial stack and global * data area, the POST word must be placed somewhere else. The General * Purpose Timer (GPT) is unused by u-boot and the kernel and preserves * its compare and mask register contents across reset, so it is used * for the POST word. */#if defined(CFG_INIT_DCACHE_CS)# define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET# define CFG_POST_ALT_WORD_ADDR (CFG_PERIPHERAL_BASE + GPT0_COMP6)#else# define CFG_INIT_EXTRA_SIZE 16# define CFG_INIT_SP_OFFSET (CFG_GBL_DATA_OFFSET - CFG_INIT_EXTRA_SIZE)# define CFG_POST_WORD_ADDR (CFG_GBL_DATA_OFFSET - 4)# define CFG_OCM_DATA_ADDR CFG_INIT_RAM_ADDR#endif /* defined(CFG_INIT_DCACHE_CS) *//*----------------------------------------------------------------------- * Serial Port *----------------------------------------------------------------------*/#define CFG_EXT_SERIAL_CLOCK 11059200 /* ext. 11.059MHz clk *//* define this if you want console on UART1 */#undef CONFIG_UART1_CONSOLE/*----------------------------------------------------------------------- * Environment *----------------------------------------------------------------------*/#if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)#define CFG_ENV_IS_IN_FLASH 1 /* use FLASH for environment vars */#else#define CFG_ENV_IS_IN_NAND 1 /* use NAND for environment vars */#define CFG_ENV_IS_EMBEDDED 1 /* use embedded environment */#endif/*----------------------------------------------------------------------- * FLASH related *----------------------------------------------------------------------*/#define CFG_FLASH_CFI /* The flash is CFI compatible */#define CFG_FLASH_CFI_DRIVER /* Use common CFI driver */#define CFG_FLASH_BANKS_LIST {CFG_FLASH_BASE}#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */#define CFG_MAX_FLASH_SECT 512 /* max number of sectors on one chip */#define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */#define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */#define CFG_FLASH_USE_BUFFER_WRITE 1 /* use buffered writes (20x faster) */#define CFG_FLASH_EMPTY_INFO /* print 'E' for empty sector on flinfo */#ifdef CFG_ENV_IS_IN_FLASH#define CFG_ENV_SECT_SIZE 0x20000 /* size of one complete sector */#define CFG_ENV_ADDR (CFG_MONITOR_BASE-CFG_ENV_SECT_SIZE)#define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector *//* Address and size of Redundant Environment Sector */#define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR-CFG_ENV_SECT_SIZE)#define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)#endif /* CFG_ENV_IS_IN_FLASH *//* * IPL (Initial Program Loader, integrated inside CPU) * Will load first 4k from NAND (SPL) into cache and execute it from there. * * SPL (Secondary Program Loader) * Will load special U-Boot version (NUB) from NAND and execute it. This SPL * has to fit into 4kByte. It sets up the CPU and configures the SDRAM * controller and the NAND controller so that the special U-Boot image can be * loaded from NAND to SDRAM. * * NUB (NAND U-Boot) * This NAND U-Boot (NUB) is a special U-Boot version which can be started * from RAM. Therefore it mustn't (re-)configure the SDRAM controller. * * On 405EX the SPL is copied to SDRAM before the NAND controller is * set up. While still running from location 0xfffff000...0xffffffff the * NAND controller cannot be accessed since it is attached to CS0 too. */#define CFG_NAND_BOOT_SPL_SRC 0xfffff000 /* SPL location */#define CFG_NAND_BOOT_SPL_SIZE (4 << 10) /* SPL size */#define CFG_NAND_BOOT_SPL_DST 0x00800000 /* Copy SPL here */#define CFG_NAND_U_BOOT_DST 0x01000000 /* Load NUB to this addr */#define CFG_NAND_U_BOOT_START CFG_NAND_U_BOOT_DST /* Start NUB from this addr */#define CFG_NAND_BOOT_SPL_DELTA (CFG_NAND_BOOT_SPL_SRC - CFG_NAND_BOOT_SPL_DST)/* * Define the partitioning of the NAND chip (only RAM U-Boot is needed here) */#define CFG_NAND_U_BOOT_OFFS (16 << 10) /* Offset to RAM U-Boot image */#define CFG_NAND_U_BOOT_SIZE (384 << 10) /* Size of RAM U-Boot image *//* * Now the NAND chip has to be defined (no autodetection used!) */#define CFG_NAND_PAGE_SIZE 512 /* NAND chip page size */#define CFG_NAND_BLOCK_SIZE (16 << 10) /* NAND chip block size */#define CFG_NAND_PAGE_COUNT 32 /* NAND chip page count */#define CFG_NAND_BAD_BLOCK_POS 5 /* Location of bad block marker */#define CFG_NAND_4_ADDR_CYCLE 1 /* Fourth addr used (>32MB) */#define CFG_NAND_ECCSIZE 256#define CFG_NAND_ECCBYTES 3#define CFG_NAND_ECCSTEPS (CFG_NAND_PAGE_SIZE / CFG_NAND_ECCSIZE)#define CFG_NAND_OOBSIZE 16#define CFG_NAND_ECCTOTAL (CFG_NAND_ECCBYTES * CFG_NAND_ECCSTEPS)#define CFG_NAND_ECCPOS {0, 1, 2, 3, 6, 7}#ifdef CFG_ENV_IS_IN_NAND/* * For NAND booting the environment is embedded in the U-Boot image. Please take * look at the file board/amcc/sequoia/u-boot-nand.lds for details. */#define CFG_ENV_SIZE CFG_NAND_BLOCK_SIZE#define CFG_ENV_OFFSET (CFG_NAND_U_BOOT_OFFS + CFG_ENV_SIZE)#define CFG_ENV_OFFSET_REDUND (CFG_ENV_OFFSET + CFG_ENV_SIZE)#endif/*----------------------------------------------------------------------- * NAND FLASH *----------------------------------------------------------------------*/#define CFG_MAX_NAND_DEVICE 1#define NAND_MAX_CHIPS 1#define CFG_NAND_BASE (CFG_NAND_ADDR + CFG_NAND_CS)#define CFG_NAND_SELECT_DEVICE 1 /* nand driver supports mutipl. chips *//*----------------------------------------------------------------------- * DDR SDRAM *----------------------------------------------------------------------*/#define CFG_MBYTES_SDRAM (256) /* 256MB */#define CFG_SDRAM0_MB0CF_BASE (( 0 << 20) + CFG_SDRAM_BASE)/* DDR1/2 SDRAM Device Control Register Data Values */#define CFG_SDRAM0_MB0CF ((CFG_SDRAM0_MB0CF_BASE >> 3) | \ SDRAM_RXBAS_SDSZ_256MB | \ SDRAM_RXBAS_SDAM_MODE7 | \ SDRAM_RXBAS_SDBE_ENABLE)#define CFG_SDRAM0_MB1CF SDRAM_RXBAS_SDBE_DISABLE#define CFG_SDRAM0_MB2CF SDRAM_RXBAS_SDBE_DISABLE#define CFG_SDRAM0_MB3CF SDRAM_RXBAS_SDBE_DISABLE#define CFG_SDRAM0_MCOPT1 0x04322000#define CFG_SDRAM0_MCOPT2 0x00000000#define CFG_SDRAM0_MODT0 0x01800000#define CFG_SDRAM0_MODT1 0x00000000#define CFG_SDRAM0_CODT 0x0080f837#define CFG_SDRAM0_RTR 0x06180000
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -