📄 sdk7a400_board.h
字号:
/***********************************************************************
* $Workfile: sdk7a400_board.h $
* $Revision: 1.2 $
* $Author: WellsK $
* $Date: Aug 12 2003 14:25:28 $
*
* Project: LogicPD SDK7A400 board definitions
*
* Description:
* This file contains board specific information such as the
* chip select wait states, and other board specific information.
*
* Revision History:
* $Log: //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/csps/lh7a400/bsps/sdk7a400/include/sdk7a400_board.h-arc $
*
* Rev 1.2 Aug 12 2003 14:25:28 WellsK
* Corrected bitfields and polarity on some CPLD registers.
* Added 64MByte SDRAM support and changed CAS latency
* to 3 clocks from 2 clocks.
*
* Rev 1.1 Jul 02 2003 17:55:34 WellsK
* Removed lots of unused defines not applicable to this board.
*
* Rev 1.0 Jun 19 2003 11:04:14 WellsK
* Initial revision.
*
*
***********************************************************************
* SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
* OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
* AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES,
* SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
*
* SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY
* FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A
* SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
* FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
*
* COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
* CAMAS, WA
**********************************************************************/
#ifndef SDK7A400_BOARD_H
#define SDK7A400_BOARD_H
#include "abl_types.h"
#include "lh7a400_smc.h"
#include "lh7a400_sdramc.h"
#include "lh7a400_chip.h"
/***********************************************************************
* Chip select configurations (per LogicPD)
**********************************************************************/
/* Static Memory Controller chip select 0 load value for FLASH */
#define SMC_BCR0_INIT (SMC_BCR_MW32 | SMC_BCR_WST2(31) | \
SMC_BCR_WST1(31) | SMC_BCR_IDCY(1))
/* Static Memory Controller chip selects 1, 2, and 3 are not used */
/* Static Memory Controller chip selects 4 through 5 are used for
the SDK7A400 PC Card slots */
/* Static Memory Controller chip select 6 load value for slow CPLD
peripherals */
#define SMC_BCR6_INIT (SMC_BCR_MW16 | SMC_BCR_WST2(31)| \
SMC_BCR_WST1(31) | SMC_BCR_IDCY(1))
/* Static Memory Controller chip select 7 load value for fast CPLD
peripherals */
#define SMC_BCR7_INIT (SMC_BCR_MW16 | SMC_BCR_WST2(31) | \
SMC_BCR_WST1(31)| SMC_BCR_IDCY(1))
/***********************************************************************
* CPLD register addresses - slow CPLD base
**********************************************************************/
/* Base address of slow CPLD registers and remapping selects */
#define CPLD_SLOW_BASE SMC_CS6_BASE
/* CompactFlash (memory mode)(chip select) device base address */
#define CF_BASE (CPLD_SLOW_BASE + 0x00200000)
/* ISA/EISA IO (chip select) base address */
#define EISA_BASE (CPLD_SLOW_BASE + 0x00400000)
/***********************************************************************
* CPLD register addresses - fast CPLD base
**********************************************************************/
/* Base address of fast CPLD registers and remapping selects */
#define CPLD_FAST_BASE SMC_CS7_BASE
/* LAN device (chip select) base address */
#define LAN_BASE (CPLD_FAST_BASE + 0x00000000)
/***********************************************************************
* Card engine general control register and bits
* Bit 0 = read/write
* 0 = LAN power enabled
* 1 = LAN power disabled
* Bit 1 = read/write
* 0 = Set LCD_VEEEN to 0
* 1 = Set LCD_VEEEN to 1
**********************************************************************/
/* Card engine general control register address */
#define CARDE_REG_BASE (CPLD_FAST_BASE + 0x00200000)
/* Card engine LAN power disable bit */
#define CARDE_LAN_PWR_DISABLE 0x0001
/* Card engine LCD_VEEEN enable bit */
#define CARDE_VEEEN_ENABLE 0x0002
/***********************************************************************
* SPI data register and bits
* Bits 0..7 = read/write of SPI data
**********************************************************************/
/* SPI data register address */
#define SPIDAT_REG_BASE (CPLD_FAST_BASE + 0x00600000)
/* SPI data register load macro */
#define SPIDAT_DATA(n) ((n) & 0x00FF)
/***********************************************************************
* SPI control register and bits
* Bit 0 = read/write (not used on SDK7A400)
* 0 = Deselect CODEC for SPI
* 1 = Select CODEC for SPI
* Bit 1 = read/write
* 0 = Deselect touchscreen for SPI
* 1 = Select touchscreen for SPI
* Bit 2 = read/write
* 0 = Write SPI data
* 1 = Read SPI data
* Bit 3 = read only
* 0 = SPI access NOT done
* 1 = SPI access complete
* Bit 4 = read/write
* 0 = Don't load SPI register and reset shift count
* 1 = Ready to load SPI register and reset shift count
* Bit 5 = read only
* 0 = SPI register has not been loaded
* 1 = SPI register has been loaded
**********************************************************************/
/* SPI control register address */
#define SPICON_REG_BASE (CPLD_FAST_BASE + 0x00800000)
/* SPI control register CODEC selection bit (not used) */
#define SPICON_CODEC_SEL 0x0001
/* SPI control register touchscreen selection bit */
#define SPICON_TOUCH_SEL 0x0002
/* SPI control register read/write selection bit */
#define SPICON_READ_SEL 0x0004
/* SPI control register access complete selection bit */
#define SPICON_ACCESS_DONE 0x0008
/* SPI control register start load selection bit */
#define SPICON_START 0x0010
/* SPI control register load complete selection bit */
#define SPICON_LOAD_DONE 0x0020
/***********************************************************************
* EEPROM SPI register and bits
* Bit 0 = read only of SPI data bit (RX)
* Bit 1 = read/write of SPI data (TX)
* Bit 2 = read/write of SPI clock
* Bit 3 = read/write of EEPROM chip select
**********************************************************************/
/* EEPROM SPI register address */
#define EE2SPI_REG_BASE (CPLD_FAST_BASE + 0x00A00000)
/* EEPROM SPI RX data bit */
#define EE2SPI_RXDAT 0x0001
/* EEPROM SPI TX data bit */
#define EE2SPI_TXDAT 0x0002
/* EEPROM SPI clock data bit */
#define EE2SPI_CLK 0x0004
/* EEPROM SPI chip select data bit */
#define EE2SPI_CS 0x0008
/***********************************************************************
* Interrupt/mask register and bits
* Bit 0 = read only
* 0 = LAN interrupt pending
* 1 = LAN interrupt NOT pending
* Bit 1 = read only
* 0 = Touchscreen interrupt pending
* 1 = Touchscreen interrupt NOT pending
* Bit 2 = read/write
* 0 = LAN interrupt is enabled
* 1 = LAN interrupt is masked
* Bit 3 = read/write
* 0 = Touchscreen interrupt is enabled
* 1 = Touchscreen interrupt is masked
* Bit 4 = read/write
* 0 = Pen interrupt is output
* 1 = Pen interrupt is input
**********************************************************************/
/* Interrupt/mask register address */
#define INTMSK_REG_BASE (CPLD_FAST_BASE + 0x00C00000)
/* Interrupt/mask LAN interrupt pending bit */
#define INTMSK_LAN_PENDING 0x0001
/* Interrupt/mask Touchscreen interrupt pending bit */
#define INTMSK_TS_PENDING 0x0002
/* Interrupt/mask LAN interrupt disable bit */
#define INTMSK_LAN_DISABLE 0x0004
/* Interrupt/mask Touchscreen interrupt disable bit */
#define INTMSK_TS_DISABLE 0x0008
/* PEN interrupt configured as input bit */
#define INTMSK_PENIRQ_IN 0x0010
/***********************************************************************
* Mode register and bits
* Bits 0..1 = read only
* 01 = 8-bit boot bus width
* 10 = 16-bit boot bus width
* 11 = 32-bit boot bus width
* Bit 2 = read only (ignored on the LH7A400, little endian only)
* 0 = Big endian operation
* 1 = Little endian operation
* Bit 3 = read only
* 0 = Boot device was an external device
* 1 = Boot device was an internal device
**********************************************************************/
/* Mode register address */
#define MODE_REG_BASE (CPLD_FAST_BASE + 0x00E00000)
/* Mode register, bus width is 8-bits value */
#define MODE_BUS_8_WIDTH 0x0001
/* Mode register, bus width is 16-bits value */
#define MODE_BUS_16_WIDTH 0x0002
/* Mode register, bus width is 32-bits value */
#define MODE_BUS_32_WIDTH 0x0003
/* Mode register, bus width value mask */
#define MODE_BUS_WIDTH_MASK 0x0003
/* Mode register little endian mask bit */
#define MODE_LITTLE_ENDIAN 0x0004
/* Mode register boot device internal mask bit */
#define MODE_BOOTDEV_INT 0x0008
/***********************************************************************
* Flash register and bits
* Bit 0 = read/write
* 0 = Normal FLASH operation
* 1 = Allow FLASH programming
* Bit 1 = read only
* Returns state of FLASH_STS1 signal
* Bit 2 = read only
* Returns state of FLASH_STS2 signal
* Bit 3 = read/write
* 0 = FLASH populated
* 1 = No FLASH populated
**********************************************************************/
/* Flash register address */
#define FLASH_REG_BASE (CPLD_FAST_BASE + 0x01000000)
/* Flash register enable programming bit */
#define FLASH_PROG_ENABLE 0x0001
/* Flash register STS1 mask bit */
#define FLASH_STS1_MASK 0x0002
/* Flash register STS2 mask bit */
#define FLASH_STS2_MASK 0x0004
/* Flash register populated bit */
#define FLASH_POP_BIT 0x0008
/***********************************************************************
* Power management register and bits
* Bit 2 = read only returns state of suspend signal
**********************************************************************/
/* Power management register address */
#define PWMAN_REG_BASE (CPLD_FAST_BASE + 0x01200000)
/* Power management register suspend signal bit mask */
#define PWMAN_SUSPEND_BIT 0x0004
/***********************************************************************
* CPLD revision register and bits
* Bits 0..7 = read only returns 8-bit CPLD revision code
**********************************************************************/
/* CPLD revision register address */
#define CPREV_REG_BASE (CPLD_FAST_BASE + 0x01400000)
/***********************************************************************
* LED register and bits
* Bit 0 = read/write
* 0 = Turn GPIO app board LED on
* 1 = Turn GPIO app board LED off
* Bit 1 = read/write
* 0 = Turn status2 app board LED on
* 1 = Turn status2 app board LED off
**********************************************************************/
/* LED register address */
#define LED_REG_BASE (CPLD_FAST_BASE + 0x01600000)
/* LED register GPIO app board LED disable bit */
#define LED_GPIO_DISABLE 0x0001
/* LED register GPIO app board LED disable bit */
#define LED_STATUS2_DISABLE 0x0002
/***********************************************************************
* GPIO data register and bits
* Bits 0..7 = read/write of GPIO data value
**********************************************************************/
/* GPIO data register address - reading this 8-bit register returns the
value of signals CPLD_GPIO_2 through CPLD_GPIO_9 */
#define GPDAT_REG_BASE (CPLD_FAST_BASE + 0x01800000)
/***********************************************************************
* GPIO data direction register and bits
* Bit 0 = read/write
* 0 = GPIO data register is an input
* 1 = GPIO data register is an output
**********************************************************************/
/* GPIO data direction register address */
#define GPDIR_REG_BASE (CPLD_FAST_BASE + 0x01A00000)
/* GPIO data register bits 2 and 3 are inputs */
#define GPDIR_INPUT_CPLD2_3_SEL 0x0001
/* GPIO data register bits 4 and 5 are inputs */
#define GPDIR_INPUT_CPLD4_5_SEL 0x0002
/* GPIO data register bits 6 and 7 are inputs */
#define GPDIR_INPUT_CPLD6_7_SEL 0x0004
/* GPIO data register bits 8 and 9 are inputs */
#define GPDIR_INPUT_CPLD8_9_SEL 0x0008
/***********************************************************************
* SDRAM interface specific defines
**********************************************************************/
#define SDRAM1_SEG1_ADDR 0xC0000000 /* SDRAM 1 segment 1 address */
#define SDRAM1_SEG2_ADDR 0xC1000000 /* SDRAM 1 segment 2 address */
#define SDRAM1_SEG3_ADDR 0xC4000000 /* SDRAM 1 segment 3 address */
#define SDRAM1_SEG4_ADDR 0xC5000000 /* SDRAM 1 segment 4 address */
#define SDRAM1_SEG5_ADDR 0xC8000000 /* SDRAM 1 segment 5 address */
#define SDRAM1_SEG6_ADDR 0xC9000000 /* SDRAM 1 segment 6 address */
#define SDRAM1_SEG7_ADDR 0xCC000000 /* SDRAM 1 segment 7 address */
#define SDRAM1_SEG8_ADDR 0xCD000000 /* SDRAM 1 segment 8 address */
/* The following SDRAM segments are only available on 64MByte card
engines */
#define SDRAM2_SEG1_ADDR 0xD0000000 /* SDRAM 2 segment 1 address */
#define SDRAM2_SEG2_ADDR 0xD1000000 /* SDRAM 2 segment 2 address */
#define SDRAM2_SEG3_ADDR 0xD4000000 /* SDRAM 2 segment 3 address */
#define SDRAM2_SEG4_ADDR 0xD5000000 /* SDRAM 2 segment 4 address */
#define SDRAM2_SEG5_ADDR 0xD8000000 /* SDRAM 2 segment 5 address */
#define SDRAM2_SEG6_ADDR 0xD9000000 /* SDRAM 2 segment 6 address */
#define SDRAM2_SEG7_ADDR 0xDC000000 /* SDRAM 2 segment 7 address */
#define SDRAM2_SEG8_ADDR 0xDD000000 /* SDRAM 2 segment 8 address */
/* Size of sn SDRAM segment, 16 segments total */
#define SDRAM_SEG_SIZE (4 * 1024 * 1024)
/* SDRAM chip select 0/1 configuration values */
#define SDRAM_CS_CONFIG (SDRAM_NSDCS_RASTOCAS_RASL2 | \
SDRAM_NSDCS_CASLAT3 | SDRAM_NSDCS_BANKCOUNT4 | SDRAM_NSDCS_EBW32)
/* SDRAM mode word for burst size of 4 words, non-interleaved, CAS3 */
#define SDRAM_MODE_WORD 0x32
/* Refresh interval reciprocal value used to determine optimal refresh
value (64000 = 1 / 15.625uS) */
#define SDRAM_REFRESH_INTERVAL 64000
#endif /* SDK7A400_BOARD_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -