1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2025-04-21 12:27:27 +03:00

new directory organization

This commit is contained in:
Bas Wijnen
2013-05-14 18:30:50 -04:00
parent b06e011a07
commit fa021a80f0
62 changed files with 133 additions and 2572 deletions

View File

@@ -23,9 +23,21 @@
void board_init ():
pll_init ()
cpm_start_all ()
// Timer interrupts and buzzer.
cpm_start_tcu ()
// Stop all clocks, except the RTC and timer interrupt source.
CPM_CLKGR = 0x7fff & ~(CPM_CLKGR_RTC | CPM_CLKGR_TCU)
// Make sure the rtc is able to boot the device.
while !rtc_write_ready ():
rtc_enabled ()
while !rtc_write_ready ():
// Set wakeup assertion time, so it actually wakes up.
rtc_set_hrcr_val (0xfe0)
while !rtc_write_ready ():
// Set glitch detection to a low value.
rtc_set_hwfcr_val (0x1e0)
while !rtc_write_ready ():
// Allow rtc alarm to wake up device.
rtc_enable_alarm_wakeup ()
while !rtc_write_ready ():
// sdram memory.
gpio_as_sdram_16bit ()
// flash memory.
@@ -86,26 +98,13 @@ void arch_reboot ():
while true:
void arch_poweroff ():
// Power off.
// First enable interrupts, so it can be awoken.
// Disable all interrupts which shouldn't wake it (only an issue while powering down, really).
INTC_IMSR = ~0
intc_unmask_irq (IRQ_RTC)
intc_unmask_irq (IRQ_GPIO3)
GPIO_PXIMS (3) = ~0
gpio_unmask_irq (3, 29)
// Clear interrupt flags.
gpio_ack_irq (3, 29)
intc_ack_irq (IRQ_GPIO3)
intc_ack_irq (IRQ_RTC)
// Clear pending interrupts and enable interrupts.
cp0_set (CP0_STATUS, 0x1000ff01)
// Make sure the rtc is running.
// Make sure the rtc is running; it wakes the device up.
cpm_start_rtc ()
while !rtc_write_ready ():
rtc_enabled ()
while !rtc_write_ready ():
rtc_set_hwfcr_val (0x1e0)
while !rtc_write_ready ():
rtc_set_hrcr_val (0x7f)
while !rtc_write_ready ():
kdebug ("Power down.\n")