mirror of
git://projects.qi-hardware.com/iris.git
synced 2025-04-21 12:27:27 +03:00
add partial nand and sd/mmc drivers
This commit is contained in:
@@ -27,9 +27,9 @@ LDFLAGS = --omagic -Ttext $(load)
|
||||
|
||||
arch_iris_sources = mips/interrupts.cc mips/arch.cc
|
||||
boot_sources = mips/init.cc mips/nanonote/board.cc
|
||||
arch_headers = mips/arch.hh mips/nanonote/jz4740.hh mips/nanonote/board.hh devices.hh
|
||||
arch_headers = mips/arch.hh mips/nanonote/jz4740.hh mips/nanonote/board.hh
|
||||
boot_threads = bootinit udc
|
||||
programs = init gpio lcd bsquare ball buzzer metronome elfrun alarm gui
|
||||
programs = init gpio lcd bsquare ball buzzer metronome elfrun alarm gui nand sd+mmc
|
||||
|
||||
all: test
|
||||
|
||||
|
||||
@@ -46,6 +46,13 @@ void board_init ():
|
||||
// Use some gpio pins for lcd.
|
||||
gpio_as_gpio (2, (1 << 21) | (1 << 22) | (1 << 23))
|
||||
gpio_as_output (2, (1 << 21) | (1 << 22) | (1 << 23))
|
||||
// And some for sd/mmc.
|
||||
gpio_as_gpio (3, (1 << 0) | (1 << 2))
|
||||
gpio_as_output (3, 1 << 2)
|
||||
gpio_as_input (3, 1 << 0)
|
||||
gpio_disable_pull (3, (1 << 0) | (1 << 2))
|
||||
// Disable power to sd/mmc by default.
|
||||
gpio_set (3, 1 << 2)
|
||||
// Set up keyboard: this breaks uart receive.
|
||||
gpio_as_gpio (3, 0x05fc0000)
|
||||
// Set up timed interrupts.
|
||||
|
||||
@@ -120,6 +120,7 @@ static void __map_io (unsigned physical, unsigned mapping):
|
||||
#define map_rtc() do { __map_io (RTC_PHYSICAL, RTC_BASE); } while (1)
|
||||
#define map_gpio() do { __map_io (GPIO_PHYSICAL, GPIO_BASE); } while (0)
|
||||
#define map_aic() do { __map_io (AIC_PHYSICAL, AIC_BASE); } while (0)
|
||||
#define map_msc() do { __map_io (MSC_PHYSICAL, MSC_BASE); } while (0)
|
||||
#define map_uart0() do { __map_io (UART0_PHYSICAL, UART0_BASE); } while (0)
|
||||
#define map_i2c() do { __map_io (I2C_PHYSICAL, I2C_BASE); } while (0)
|
||||
#define map_ssi() do { __map_io (SSI_PHYSICAL, SSI_BASE); } while (0)
|
||||
@@ -3140,14 +3141,8 @@ static void msc_set_cmdat_res_format(unsigned r):
|
||||
#define msc_rd_rxfifo() ( MSC_RXFIFO )
|
||||
#define msc_wr_txfifo(v) ( MSC_TXFIFO = v )
|
||||
|
||||
static void msc_reset():
|
||||
MSC_STRPCL = MSC_STRPCL_RESET
|
||||
while MSC_STAT & MSC_STAT_IS_RESETTING:
|
||||
|
||||
#define msc_start_clk() (MSC_STRPCL = MSC_STRPCL_CLOCK_CONTROL_START)
|
||||
|
||||
#define msc_stop_clk() (MSC_STRPCL = MSC_STRPCL_CLOCK_CONTROL_STOP)
|
||||
|
||||
#define MMC_CLK 19169200
|
||||
#define SD_CLK 24576000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user