rPi MMU: Fixes to hrev44189
* I had the wrong addresses, 0x20 was the physical address not a mapped one. * Attempt to map uart in mmu post mmu_init.
This commit is contained in:
@@ -36,10 +36,9 @@
|
|||||||
* - BCM2835-ARM-Peripherals.pdf
|
* - BCM2835-ARM-Peripherals.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 1.2.2 notes that peripherals are remapped from 0x7e to 0x20
|
// Section 1.2.2
|
||||||
#define BCM2708_SDRAM_BASE 0x00000000
|
#define BCM2708_SDRAM_BASE 0x00000000
|
||||||
#define BCM2708_DEVICEHW_BASE 0x7E000000 // Real Hardware Base
|
#define BCM2708_PERIPHERAL_BASE 0x20000000
|
||||||
#define BCM2708_DEVICEFW_BASE 0x20000000 // Firmware Mapped Base
|
|
||||||
|
|
||||||
#define ST_BASE 0x3000
|
#define ST_BASE 0x3000
|
||||||
// System Timer, sec 12.0, page 172
|
// System Timer, sec 12.0, page 172
|
||||||
@@ -77,11 +76,11 @@
|
|||||||
#define ARM_CTRL_0_SBM_BASE (ARM_BASE + 0x800)
|
#define ARM_CTRL_0_SBM_BASE (ARM_BASE + 0x800)
|
||||||
// ARM Semaphores, Doorbells, and Mailboxes
|
// ARM Semaphores, Doorbells, and Mailboxes
|
||||||
|
|
||||||
#define VECT_BASE 0xffff0000
|
#define VECT_BASE 0xFFFF0000
|
||||||
#define VECT_SIZE SIZE_4K
|
#define VECT_SIZE SIZE_4K
|
||||||
|
|
||||||
#define DEVICE_BASE BCM2708_DEVICEHW_BASE
|
#define PERIPHERAL_BASE BCM2708_PERIPHERAL_BASE
|
||||||
#define DEVICE_SIZE 0x1000000
|
#define PERIPHERAL_SIZE 0xFFFFFF
|
||||||
|
|
||||||
#define SDRAM_BASE BCM2708_SDRAM_BASE
|
#define SDRAM_BASE BCM2708_SDRAM_BASE
|
||||||
#define SDRAM_SIZE 0x4000000
|
#define SDRAM_SIZE 0x4000000
|
||||||
|
|||||||
@@ -62,12 +62,16 @@ struct memblock {
|
|||||||
static struct memblock LOADER_MEMORYMAP[] = {
|
static struct memblock LOADER_MEMORYMAP[] = {
|
||||||
{
|
{
|
||||||
"devices",
|
"devices",
|
||||||
DEVICE_BASE,
|
PERIPHERAL_BASE,
|
||||||
DEVICE_BASE + DEVICE_SIZE - 1,
|
PERIPHERAL_BASE + PERIPHERAL_SIZE,
|
||||||
MMU_L2_FLAG_B,
|
MMU_L2_FLAG_B,
|
||||||
},
|
},
|
||||||
|
// Device memory between 0x0 and 0x10000000
|
||||||
|
// (0x0) Ram / Video ram (0x10000000) (256MB)
|
||||||
|
// We don't detect the split yet, se we have to be
|
||||||
|
// careful not to run into video ram.
|
||||||
{
|
{
|
||||||
"RAM_loader", // 1MB loader
|
"RAM_loader", // 1MB for the loader
|
||||||
SDRAM_BASE + 0,
|
SDRAM_BASE + 0,
|
||||||
SDRAM_BASE + 0x0fffff,
|
SDRAM_BASE + 0x0fffff,
|
||||||
MMU_L2_FLAG_C,
|
MMU_L2_FLAG_C,
|
||||||
@@ -84,7 +88,6 @@ static struct memblock LOADER_MEMORYMAP[] = {
|
|||||||
SDRAM_BASE + 0x11FFFFF,
|
SDRAM_BASE + 0x11FFFFF,
|
||||||
MMU_L2_FLAG_C,
|
MMU_L2_FLAG_C,
|
||||||
},
|
},
|
||||||
#if 0
|
|
||||||
{
|
{
|
||||||
"RAM_stack", // stack
|
"RAM_stack", // stack
|
||||||
SDRAM_BASE + 0x1200000,
|
SDRAM_BASE + 0x1200000,
|
||||||
@@ -97,7 +100,7 @@ static struct memblock LOADER_MEMORYMAP[] = {
|
|||||||
SDRAM_BASE + 0x2500000,
|
SDRAM_BASE + 0x2500000,
|
||||||
MMU_L2_FLAG_C,
|
MMU_L2_FLAG_C,
|
||||||
},
|
},
|
||||||
|
// (0x2500000 ~37MB)
|
||||||
#ifdef FB_BASE
|
#ifdef FB_BASE
|
||||||
{
|
{
|
||||||
"framebuffer", // 2MB framebuffer ram
|
"framebuffer", // 2MB framebuffer ram
|
||||||
@@ -106,7 +109,6 @@ static struct memblock LOADER_MEMORYMAP[] = {
|
|||||||
MMU_L2_FLAG_AP_RW|MMU_L2_FLAG_C,
|
MMU_L2_FLAG_AP_RW|MMU_L2_FLAG_C,
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -585,7 +587,7 @@ mmu_init(void)
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
mmu_write_C1(mmu_read_C1() & ~((1<<29)|(1<<28)|(1<<0)));
|
mmu_write_C1(mmu_read_C1() & ~((1 << 29) | (1 << 28) | (1 << 0)));
|
||||||
// access flag disabled, TEX remap disabled, mmu disabled
|
// access flag disabled, TEX remap disabled, mmu disabled
|
||||||
|
|
||||||
uint32 highestRAMAddress = SDRAM_BASE;
|
uint32 highestRAMAddress = SDRAM_BASE;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <boot/platform.h>
|
#include <boot/platform.h>
|
||||||
#include <arch/cpu.h>
|
#include <arch/cpu.h>
|
||||||
#include <boot/stage2.h>
|
#include <boot/stage2.h>
|
||||||
|
#include "mmu.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -87,7 +88,10 @@ serial_cleanup(void)
|
|||||||
extern "C" void
|
extern "C" void
|
||||||
serial_init(void)
|
serial_init(void)
|
||||||
{
|
{
|
||||||
gUART = arch_get_uart_pl011(BOARD_UART_DEBUG, BOARD_UART_CLOCK);
|
addr_t uart0 = mmu_map_physical_memory(PERIPHERAL_BASE + BOARD_UART_DEBUG,
|
||||||
|
0x00004000, kDefaultPageFlags);
|
||||||
|
|
||||||
|
gUART = arch_get_uart_pl011(uart0, BOARD_UART_CLOCK);
|
||||||
gUART->InitEarly();
|
gUART->InitEarly();
|
||||||
gUART->InitPort(9600);
|
gUART->InitPort(9600);
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ pi_start(void)
|
|||||||
gpio_init();
|
gpio_init();
|
||||||
|
|
||||||
// Flick on "OK" led, use pre-mmu firmware base
|
// Flick on "OK" led, use pre-mmu firmware base
|
||||||
gpio_write(BCM2708_DEVICEFW_BASE + GPIO_BASE, 16, 0);
|
gpio_write(PERIPHERAL_BASE + GPIO_BASE, 16, 0);
|
||||||
|
|
||||||
mmu_init();
|
mmu_init();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user