CS452 - Real-Time Programming - Fall 2011
Lecture 31 - Power On II
Public Service Annoucements
- Acceleration/Deceleration: pdf
- Second train control demo: 24 November, 2011.
- Final demo: Tuesday, 6 December, 2011; Wednesday, 7 December, 2011
- Final exam: 10.30, Friday, 9 December, 2011 to 13.30, Saturday, 10
December, 2011.
Power On
When you turn on the power or press the reset button, what happens before
you see the RedBoot> prompt?
- Power on asserts the reset input to the CPU
This is not determined by the instruction set architecture (ISA).
- The ISA guarantees only that the CPU will (at some future time) set the
pc to 0x00000000 and start executing instructions.
What happens before that, and what appears at 0x00000000 is determined by
the design of the system surrounding the CPU on the chip.
- Cirrus provides this, not ARM.
- What Cirrus provides is pretty generic: the steps are the same on
others SoCs, but the details differ.
There are two pretty hard resets that can occur.
- Turning on the power
- Pressing the reset button
- Power-on, but with memory refresh running continuously.
(Jumping to 0x00000000 is a much softer reset.)
Asserting the reset input of the SoC, asserts the reset output of the
SoC.
- The output reset goes everywhere and resets everything with a power on
reset.
Negating the reset input starts the boot sequence, with the SoC in its
reset state. Ten hardware inputs determine how the SoC boots
- internal/external
- pre-boot source
- watchdog state
- bus width of pre-boot and pre-pre-boot
These inputs allow the designer of the board hosting the SoC to determine
enough characteristics of the boot state that it can be used for many
applications
TS-7200 is set up for internal pre-boot with source from the flash on the
32-bit AHB
The AHB bus has all the important high-speed components
- memory (program and graphics)
- ethernet controller
- USB controller, and
- 16Kbytes of mask-programmed ROM at
0x80090000
Initial state
- DRAM controller(s) not initialized
- Flash controller(s) not initialized
- MMU flat on power up, but might be screwed up on reset
In the AHB registers is a 16K block of ROM from 0x80090000 to
0x80093fff
- Initially, it is mapped to the entire memory space at 16K
intervals.
- Chip select, and how addressing occurs.
- Chip select of this block is 0x8009[00XXb]XXX
- Chip select has two parts
- AHB chip select: 0x800XXXXX
- The first instruction executed is the one that you find at
0x80090000
- How much code is there
- 4K words, but code repeated 4 times
- 1K words of unique code, but only half is unique executable
code
There is almost no context
Pre-pre-boot Sequence
- Jump to
0x80090018.
- Turn on LEDs
- Disable watchdog timer
- Make the CPU completely vanilla. E.g.,
- caches, MMU, branch prediction, alignment checking, all
disabled
- write buffer enabled
- 32-bit addressing
- little-endian
- normal exception vectors
- predictable cache replacement
- Acquire boot state (for bus width) to set up 6 static memory
controllers
- Acquire boot state (for bus width) to set up 4 dynamic memory
controllers
- Clear boot mode `memory map'
- Acquire configuration inputs
- These are input pins on the EP9302, the state of which is
determined by the TS7200.
- A couple are user-controllable via jumpers
- They are the only thing the EP9302 knows about the outside
world
- Switch
- Serial boot on UART1
- Output ">"
- Read 2048 bytes starting with CRUS to the ethernet buffer
- Jump to the start of the ethernet buffer
- Boot from ROM outside SoC
- Assert ROM chip selects looking for CRUS
- When found read 2048 bytes from the ROM to ethernet buffer
- Jump to the start of the ethernet buffer
- Boot from flash
- Look for CRUS at possible flash start locations
- When found jump to start location plus
0x4
- In the first two cases the 2048 bytes contains a memory test followed
by a loader.
Pre-boot Sequence
This code knows all about the EP9302, and all about the TS7200.
- Sets up a stack in the ethernet buffer
- Sets the CPSR to a vanilla state: no interrupts, svc mode
- Set up stack pointer in Mac FIFO
- Copies 260 words of code from flash to Mac FIFO
- Initializes memory controllers for the memory it has
- Configures GPIO.
- Turns off the watchdog timer
- Sets up the appropriate serial port for a monitor
Return to: