mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Commit FS#6929 - Gigabeat bootloader improvements by Barry Wardell and myself. This build fixes the problems seen with the latest builds on the Gigabeat X. Added View IO Ports under the Debug menu for the Gigabeat. Make sure you grab the latest bootloader from the Wiki as the old bootloader will not work properly with new builds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13225 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dd0f1c7db1
commit
8a1fd8c686
13 changed files with 154 additions and 233 deletions
|
|
@ -52,8 +52,8 @@ void ata_enable(bool on)
|
|||
else
|
||||
USB_ATA_ENABLE;
|
||||
|
||||
GPBCON=( GPGCON&~(1<<11) ) | (1<<10); /* Make the pin an output */
|
||||
// GPBUP|=1<<5; /* Disable pullup in SOC as we are now driving */
|
||||
GPBCON=( GPBCON&~(1<<11) ) | (1<<10); /* Make the pin an output */
|
||||
GPBUP|=1<<5; /* Disable pullup in SOC as we are now driving */
|
||||
}
|
||||
|
||||
bool ata_is_coldstart(void)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,23 @@ unsigned int LCDBASEL(unsigned int address)
|
|||
/* LCD init */
|
||||
void lcd_init_device(void)
|
||||
{
|
||||
#ifdef BOOTLOADER
|
||||
/* When the Rockbox bootloader starts, we are changing framebuffer address,
|
||||
but we don't want what's shown on the LCD to change until we do an
|
||||
lcd_update(), so copy the data from the old framebuffer to the new one */
|
||||
int i;
|
||||
unsigned short *buf = (unsigned short*)FRAME;
|
||||
|
||||
memcpy(FRAME, (short *)((LCDSADDR1)<<1), 320*240*2);
|
||||
|
||||
/* The Rockbox bootloader is transitioning from RGB555I to RGB565 mode
|
||||
so convert the frambuffer data accordingly */
|
||||
for(i=0; i< 320*240; i++){
|
||||
*buf = ((*buf>>1) & 0x1F) | (*buf & 0xffc0);
|
||||
buf++;
|
||||
}
|
||||
#endif
|
||||
|
||||
LCDSADDR1 = (LCDBANK((unsigned)FRAME) << 21) | (LCDBASEU((unsigned)FRAME));
|
||||
LCDSADDR2 = LCDBASEL((unsigned)FRAME);
|
||||
LCDSADDR3 = 0x000000F0;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include "mmu-meg-fx.h"
|
||||
#include "panic.h"
|
||||
|
||||
void map_memory(void);
|
||||
static void enable_mmu(void);
|
||||
static void set_ttb(void);
|
||||
static void set_page_tables(void);
|
||||
|
|
@ -15,7 +14,7 @@ static void map_section(unsigned int pa, unsigned int va, int mb, int cache_flag
|
|||
#define BUFFERED (1 << 2)
|
||||
#define MB (1 << 20)
|
||||
|
||||
void map_memory(void) {
|
||||
void memory_init(void) {
|
||||
set_ttb();
|
||||
set_page_tables();
|
||||
enable_mmu();
|
||||
|
|
@ -69,6 +68,20 @@ void map_section(unsigned int pa, unsigned int va, int mb, int cache_flags) {
|
|||
}
|
||||
|
||||
static void enable_mmu(void) {
|
||||
int regread;
|
||||
|
||||
asm volatile(
|
||||
"MRC p15, 0, %r0, c1, c0, 0\n" /* Read reg1, control register */
|
||||
: /* outputs */
|
||||
"=r"(regread)
|
||||
: /* inputs */
|
||||
: /* clobbers */
|
||||
"r0"
|
||||
);
|
||||
|
||||
if ( !(regread & 0x04) || !(regread & 0x00001000) ) /* Was the ICache or DCache Enabled? */
|
||||
clean_dcache(); /* If so we need to clean the DCache before invalidating below */
|
||||
|
||||
asm volatile("mov r0, #0\n"
|
||||
"mcr p15, 0, r0, c8, c7, 0\n" /* invalidate TLB */
|
||||
|
||||
|
|
|
|||
|
|
@ -32,4 +32,4 @@ void dump_dcache_range(const void *base, unsigned int size);
|
|||
/* Cleans entire DCache */
|
||||
void clean_dcache(void);
|
||||
|
||||
|
||||
void memory_init(void);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "kernel.h"
|
||||
#include "system.h"
|
||||
#include "panic.h"
|
||||
#include "mmu-meg-fx.h"
|
||||
|
||||
#include "lcd.h"
|
||||
#include <stdio.h>
|
||||
|
|
@ -11,6 +12,7 @@ const int DMA0_MASK = (1 << 17);
|
|||
const int DMA1_MASK = (1 << 18);
|
||||
const int DMA2_MASK = (1 << 19);
|
||||
const int DMA3_MASK = (1 << 20);
|
||||
const int ALARM_MASK = (1 << 30);
|
||||
|
||||
int system_memory_guard(int newmode)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ inline bool usb_detect(void)
|
|||
void usb_init_device(void)
|
||||
{
|
||||
/* Input is the default configuration, only pullups need to be disabled */
|
||||
GPFUP|=0x02;
|
||||
/* GPFUP|=0x02; */
|
||||
|
||||
USB_VPLUS_PWR_ASSERT;
|
||||
GPBCON=( GPBCON&~(1<<13) ) | (1 << 12);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue