mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2025-04-21 12:27:27 +03:00
qi-move-cpu-specific-drivers-into-cpu-dir.patch
Signed-off-by: Andy Green <andy@openmoko.com>
This commit is contained in:
@@ -29,29 +29,35 @@ SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
|
||||
/* this is intended to take the first 4KBytes of stuff initially.
|
||||
* We have to make sure we have .rodata* in there for everything
|
||||
* because we do not compile PIC.
|
||||
/* this text section is magically pulled from the SD Card
|
||||
* and stored by the iRom at 0x0c000000, then it is jumped into
|
||||
* by the iRom. So we arrange our early parts needed at 0 in the
|
||||
* output file, but set to run at 0x0c000000+
|
||||
*/
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
.text 0x0c000000 : AT ( 0 )
|
||||
{
|
||||
src/cpu/s3c6410/start.o (.text .rodata* .data)
|
||||
src/lowlevel_init.o (.text .rodata* .data)
|
||||
src/cpu/s3c6410/start_qi.o (.text .rodata* .data)
|
||||
src/blink_led.o (.text .rodata* .data)
|
||||
src/cpu/s3c6410/start.o (.text .rodata* .data)
|
||||
src/cpu/s3c6410/start_qi.o (.text .rodata* .data)
|
||||
src/cpu/s3c6410/serial-s3c64xx.o (.text .rodata* .data)
|
||||
src/cpu/s3c6410/tla01.o (.text .rodata* .data)
|
||||
src/ctype.o (.text .rodata* .data)
|
||||
src/phase2.o (.text .rodata* .data)
|
||||
src/utils.o (.text .rodata* .data)
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
/* . = ALIGN(4);
|
||||
.everything_else ADDR (.text) + SIZEOF (.text) + 0x53000000 :
|
||||
AT ( ADDR (.text) + SIZEOF (.text) ) { *(.text .rodata* .data) }
|
||||
|
||||
*/
|
||||
. = 0x53800000 ;
|
||||
/* . = 0x0c001900 ; */
|
||||
__bss_start = .;
|
||||
.bss_6410 (NOLOAD) :
|
||||
{
|
||||
* (.bss)
|
||||
}
|
||||
|
||||
_end = .;
|
||||
}
|
||||
|
||||
47
qiboot/src/cpu/s3c6410/serial-s3c64xx.c
Normal file
47
qiboot/src/cpu/s3c6410/serial-s3c64xx.c
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* (C) Copyright 2007 OpenMoko, Inc.
|
||||
* Author: xiangfu liu <xiangfu@openmoko.org>
|
||||
*
|
||||
* Configuation settings for the FIC Neo GTA02 Linux GSM phone
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <qi.h>
|
||||
#include <s3c6410.h>
|
||||
|
||||
/*
|
||||
* Output a single byte to the serial port.
|
||||
*/
|
||||
void serial_putc_s3c64xx(const int uart, const char c)
|
||||
{
|
||||
switch(uart)
|
||||
{
|
||||
case 0:
|
||||
while (!( UTRSTAT0_REG & 0x2 ))
|
||||
;
|
||||
UTXH0_REG = c;
|
||||
break;
|
||||
case 1:
|
||||
while (!( UTRSTAT1_REG & 0x2))
|
||||
;
|
||||
UTXH1_REG = c;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -141,11 +141,6 @@ _start_armboot:
|
||||
_TEXT_BASE:
|
||||
.word TEXT_BASE
|
||||
|
||||
processor_id:
|
||||
.word 0
|
||||
.word 0x41129200 /* s3c2442 ID */
|
||||
.word 0x410fb760 /* s3c6410 ID */
|
||||
|
||||
/*
|
||||
* These are defined in the board-specific linker script.
|
||||
*/
|
||||
@@ -311,12 +306,12 @@ start_code:
|
||||
mov r1, #0x0
|
||||
str r1, [r0, #INDEX_DMC_MEMC_CMD]
|
||||
|
||||
check_dmc1_ready:
|
||||
1:
|
||||
ldr r1, [r0, #INDEX_DMC_MEMC_STATUS]
|
||||
mov r2, #0x3
|
||||
and r1, r1, r2
|
||||
cmp r1, #0x1
|
||||
bne check_dmc1_ready
|
||||
bne 1b
|
||||
nop
|
||||
|
||||
ldr r0, =ELFIN_CLOCK_POWER_BASE @0x7e00f000
|
||||
@@ -336,12 +331,12 @@ check_dmc1_ready:
|
||||
orr r1, r1, r2
|
||||
str r1, [r0, #OTHERS_OFFSET]
|
||||
|
||||
check_syncack:
|
||||
2:
|
||||
ldr r1, [r0, #OTHERS_OFFSET]
|
||||
ldr r2, =0xf00
|
||||
and r1, r1, r2
|
||||
cmp r1, #0xf00
|
||||
bne check_syncack
|
||||
bne 2b
|
||||
|
||||
mov r1, #0xff00
|
||||
orr r1, r1, #0xff
|
||||
@@ -385,8 +380,8 @@ check_syncack:
|
||||
|
||||
/* wait at least 200us to stablize all clock */
|
||||
mov r1, #0x10000
|
||||
1: subs r1, r1, #1
|
||||
bne 1b
|
||||
3: subs r1, r1, #1
|
||||
bne 3b
|
||||
|
||||
ldr r1, [r0, #OTHERS_OFFSET]
|
||||
orr r1, r1, #0x20
|
||||
@@ -417,121 +412,14 @@ check_syncack:
|
||||
ldr r1, =0x1FFF
|
||||
str r1, [r0, #UDIVSLOT_OFFSET]
|
||||
|
||||
ldr r1, =0x4f4f4f4f
|
||||
str r1, [r0, #UTXH_OFFSET] @'O'
|
||||
|
||||
/* send out a char to say hello */
|
||||
ldr r1, =0x55
|
||||
str r1, [r0, #UTXH_OFFSET]
|
||||
|
||||
|
||||
#if 0
|
||||
/* Below code is for ARM926EJS and ARM1026EJS */
|
||||
.globl cleanDCache
|
||||
cleanDCache:
|
||||
mrc p15, 0, pc, c7, c10, 3 /* test/clean D-Cache */
|
||||
bne cleanDCache
|
||||
mov pc, lr
|
||||
|
||||
.globl cleanFlushDCache
|
||||
cleanFlushDCache:
|
||||
mrc p15, 0, pc, c7, c14, 3 /* test/cleanflush D-Cache */
|
||||
bne cleanFlushDCache
|
||||
mov pc, lr
|
||||
|
||||
.globl cleanFlushCache
|
||||
cleanFlushCache:
|
||||
mrc p15, 0, pc, c7, c14, 3 /* test/cleanflush D-Cache */
|
||||
bne cleanFlushCache
|
||||
mcr p15, 0, r0, c7, c5, 0 /* flush I-Cache */
|
||||
mov pc, lr
|
||||
|
||||
.ltorg
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
/* enable only CPU peripheral block clocks we actually use */
|
||||
ldr r0, =0x4c00000c /* clkcon */
|
||||
ldr r1, =0x3f10 /* uart, pwm, gpio, nand, sdi clocks on */
|
||||
str r1, [r0]
|
||||
|
||||
/* gpio UART2 init, H port */
|
||||
ldr r0, =0x56000070
|
||||
ldr r1, =0x001AAAAA
|
||||
str r1, [r0]
|
||||
|
||||
/* enable KEEPACT(GPJ8) to make sure PMU keeps us alive */
|
||||
ldr r0, =0x56000000 /* GPJ base */
|
||||
ldr r1, [r0, #0xd0] /* GPJCON */
|
||||
orr r1, r1, #(1 << 16)
|
||||
str r1, [r0, #0xd0]
|
||||
|
||||
ldr r1, [r0, #0xd4] /* GPJDAT */
|
||||
orr r1, r1, #(1 << 8)
|
||||
str r1, [r0, #0xd4]
|
||||
|
||||
|
||||
|
||||
/* take sdram out of power down */
|
||||
ldr r0, =0x56000080 /* misccr */
|
||||
ldr r1, [ r0 ]
|
||||
bic r1, r1, #(S3C2410_MISCCR_nEN_SCLK0 | S3C2410_MISCCR_nEN_SCLK1 | S3C2410_MISCCR_nEN_SCLKE)
|
||||
str r1, [ r0 ]
|
||||
|
||||
/* ensure signals stabalise */
|
||||
mov r1, #128
|
||||
1: subs r1, r1, #1
|
||||
bpl 1b
|
||||
|
||||
bl cpu_init_crit
|
||||
|
||||
/* ensure some refresh has happened */
|
||||
ldr r1, =0xfffff
|
||||
1: subs r1, r1, #1
|
||||
bpl 1b
|
||||
|
||||
/* capture full EINT situation into gstatus 4 */
|
||||
|
||||
ldr r0, =0x4A000000 /* SRCPND */
|
||||
ldr r1, [ r0 ]
|
||||
and r1, r1, #0xf
|
||||
|
||||
ldr r0, =0x560000BC /* gstatus4 */
|
||||
str r1, [ r0 ]
|
||||
|
||||
ldr r0, =0x560000A8 /* EINTPEND */
|
||||
ldr r1, [ r0 ]
|
||||
ldr r0, =0xfff0
|
||||
and r1, r1, r0
|
||||
ldr r0, =0x560000BC /* gstatus4 */
|
||||
ldr r0, [ r0 ]
|
||||
orr r1, r1, r0
|
||||
ldr r0, =0x560000BC /* gstatus4 */
|
||||
str r1, [ r0 ]
|
||||
|
||||
/* test for resume */
|
||||
|
||||
ldr r1, =0x560000B4 /* gstatus2 */
|
||||
ldr r0, [ r1 ]
|
||||
tst r0, #0x02 /* is this resume from power down */
|
||||
/* well, if it was, we are going to jump to
|
||||
* whatever address we stashed in gstatus3,
|
||||
* and gstatus4 will hold the wake interrupt
|
||||
* source for the OS to look at
|
||||
*/
|
||||
ldrne pc, [r1, #4]
|
||||
|
||||
#endif
|
||||
|
||||
/* >> CFG_VIDEO_LOGO_MAX_SIZE */
|
||||
#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
|
||||
|
||||
stack_setup:
|
||||
|
||||
ldr r0, _TEXT_BASE /* upper 128 KiB: relocated uboot */
|
||||
sub r0, r0, #CFG_GBL_DATA_SIZE /* bdinfo */
|
||||
sub sp, r0, #12 /* leave 3 words for abort-stack */
|
||||
|
||||
clear_bss:
|
||||
ldr r0, _bss_start /* find start of bss segment */
|
||||
ldr r1, _bss_end /* stop here */
|
||||
@@ -543,6 +431,14 @@ clbss_l:
|
||||
cmp r0, r1
|
||||
ble clbss_l
|
||||
|
||||
/* we are going to jump into the C part of the init now */
|
||||
spin:
|
||||
#if 0
|
||||
ldr r0, =ELFIN_UART_CONSOLE_BASE
|
||||
ldr r1, =0x55
|
||||
push {r1}
|
||||
pop {r1}
|
||||
str r1, [r0, #UTXH_OFFSET] @'U'
|
||||
#endif
|
||||
b _steppingstone_done
|
||||
|
||||
4:
|
||||
b 4b
|
||||
|
||||
@@ -37,6 +37,8 @@ const struct board_api *boards[] = {
|
||||
struct board_api const * this_board;
|
||||
extern int is_jtag;
|
||||
|
||||
#include <serial-s3c64xx.h>
|
||||
|
||||
void start_qi(void)
|
||||
{
|
||||
int flag = 0;
|
||||
@@ -97,9 +99,8 @@ void start_qi(void)
|
||||
* jump to bootloader_second_phase() running from DRAM copy
|
||||
*/
|
||||
bootloader_second_phase();
|
||||
#if 0
|
||||
unhappy:
|
||||
|
||||
while(1)
|
||||
;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
#include <qi.h>
|
||||
#include <neo_tla01.h>
|
||||
#include <serial-s3c24xx.h>
|
||||
#include <ports-s3c24xx.h>
|
||||
#include <i2c-bitbang-s3c24xx.h>
|
||||
#include <serial-s3c64xx.h>
|
||||
//#include <ports-s3c24xx.h>
|
||||
//#include <i2c-bitbang-s3c24xx.h>
|
||||
#include <pcf50633.h>
|
||||
|
||||
#define GTA03_DEBUG_UART 2
|
||||
#define GTA03_DEBUG_UART 0
|
||||
|
||||
#define PCF50633_I2C_ADS 0x73
|
||||
|
||||
|
||||
static const struct board_variant board_variants[] = {
|
||||
[0] = {
|
||||
.name = "TLA01",
|
||||
.name = "SMDK",
|
||||
.machine_revision = 0x010,
|
||||
},
|
||||
};
|
||||
|
||||
void port_init_tla01(void)
|
||||
{
|
||||
#if 0
|
||||
unsigned int * MPLLCON = (unsigned int *)0x4c000004;
|
||||
unsigned int * UPLLCON = (unsigned int *)0x4c000008;
|
||||
unsigned int * CLKDIVN = (unsigned int *)0x4c000014;
|
||||
@@ -135,28 +136,7 @@ void port_init_tla01(void)
|
||||
/* push DOWN1 (CPU Core rail) to 1.7V, allowing 533MHz */
|
||||
i2c_write_sync(&bb_s3c24xx, PCF50633_I2C_ADS, PCF50633_REG_DOWN1OUT,
|
||||
0x2b);
|
||||
|
||||
/* change CPU clocking to 533MHz 1:4:8 */
|
||||
|
||||
/* clock divide 1:4:8 - do it first */
|
||||
*CLKDIVN = 5;
|
||||
/* configure UPLL */
|
||||
*UPLLCON = ((88 << 12) + (4 << 4) + 2);
|
||||
/* Magic delay: Page 7-19, seven nops between UPLL and MPLL */
|
||||
asm __volatile__ (
|
||||
"nop\n"\
|
||||
"nop\n"\
|
||||
"nop\n"\
|
||||
"nop\n"\
|
||||
"nop\n"\
|
||||
"nop\n"\
|
||||
"nop\n"\
|
||||
);
|
||||
/* configure MPLL */
|
||||
*MPLLCON = ((169 << 12) + (2 << 4) + 1);
|
||||
|
||||
|
||||
serial_init_115200_s3c24xx(GTA03_DEBUG_UART, 66 /*MHz PCLK */);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,36 +147,7 @@ void port_init_tla01(void)
|
||||
|
||||
int tla01_get_pcb_revision(void)
|
||||
{
|
||||
int n;
|
||||
u32 u;
|
||||
|
||||
/* make B0 inputs */
|
||||
rGPBCON &= ~0x00000003;
|
||||
/* D8 and D9 inputs */
|
||||
rGPDCON &= ~0x000f0000;
|
||||
|
||||
/* delay after changing pulldowns */
|
||||
u = rGPBDAT;
|
||||
u = rGPDDAT;
|
||||
|
||||
/* read the version info */
|
||||
u = rGPBDAT;
|
||||
n = (u >> (0 - 0))& 0x001;
|
||||
u = rGPDDAT;
|
||||
n |= (u >> (8 -1)) & 0x002;
|
||||
n |= (u >> (9 - 2)) & 0x004;
|
||||
|
||||
/*
|
||||
* when not being interrogated, all of the revision GPIO
|
||||
* are set to output
|
||||
*/
|
||||
/* make B0 high ouput */
|
||||
rGPBCON |= 0x00000001;
|
||||
/* D8 and D9 high ouputs */
|
||||
rGPDCON |= 0x00050000;
|
||||
|
||||
return n;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct board_variant const * get_board_variant_tla01(void)
|
||||
@@ -212,7 +163,7 @@ int is_this_board_tla01(void)
|
||||
|
||||
static void putc_tla01(char c)
|
||||
{
|
||||
serial_putc_s3c24xx(GTA03_DEBUG_UART, c);
|
||||
serial_putc_s3c64xx(GTA03_DEBUG_UART, c);
|
||||
}
|
||||
|
||||
|
||||
@@ -222,9 +173,9 @@ static void putc_tla01(char c)
|
||||
const struct board_api board_api_tla01 = {
|
||||
.name = "TLA01",
|
||||
.linux_machine_id = 1866,
|
||||
.linux_mem_start = 0x30000000,
|
||||
.linux_mem_start = 0x50000000,
|
||||
.linux_mem_size = (128 * 1024 * 1024),
|
||||
.linux_tag_placement = 0x30000000 + 0x100,
|
||||
.linux_tag_placement = 0x50000000 + 0x100,
|
||||
.get_board_variant = get_board_variant_tla01,
|
||||
.is_this_board = is_this_board_tla01,
|
||||
.port_init = port_init_tla01,
|
||||
|
||||
Reference in New Issue
Block a user