1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-12-23 17:51:08 +02:00

qi-split-board-specific-in-steppingstone.patch

Signed-off-by: Andy Green <andy@openmoko.com>
This commit is contained in:
Andy Green 2008-11-28 10:16:42 +00:00 committed by Andy Green
parent 56841f9f5d
commit b4ac8b9dc9
9 changed files with 168 additions and 152 deletions

View File

@ -74,6 +74,7 @@ struct board_api {
unsigned long linux_tag_placement;
const struct board_variant const * (*get_board_variant)(void);
int (*is_this_board)(void);
void (*early_port_init)(void);
void (*port_init)(void);
void (*putc)(char);
void (*close)(void);

View File

@ -96,8 +96,6 @@ extern ulong virt_to_phy_smdk2416(ulong addr);
extern void test_hsmmc (uint width, uint test, uint start_blk, uint blknum);
/* external variables */
extern struct movi_offset_t ofsinfo;
//#include <asm/hardware.h>
@ -107,7 +105,7 @@ typedef enum {
S3C64XX_UART2,
} S3C64XX_UARTS_NR;
#define __REG(x) (*((unsigned int *)(x)))
#define __REG(x) (*((volatile unsigned int *)(x)))
//#include <s3c64x0.h>
#endif

View File

@ -0,0 +1,76 @@
#include <qi.h>
#include <neo_gta03.h>
#include <s3c6410.h>
#include <serial-s3c64xx.h>
#define GTA03_DEBUG_UART 3
/* out of steppingstone */
extern const struct board_variant const * get_board_variant_gta03(void);
extern void port_init_gta03(void);
int is_this_board_gta03(void)
{
/* FIXME: find something gta03 specific */
return 1;
}
static void putc_gta03(char c)
{
serial_putc_s3c64xx(GTA03_DEBUG_UART, c);
}
int sd_card_init_gta03(void)
{
extern int s3c6410_mmc_init(int verbose);
return s3c6410_mmc_init(1);
}
int sd_card_block_read_gta03(unsigned char * buf, unsigned long start512,
int blocks512)
{
unsigned long s3c6410_mmc_bread(int dev_num, unsigned long blknr, unsigned long blkcnt,
void *dst);
return s3c6410_mmc_bread(0, start512, blocks512, buf);
}
/*
* our API for bootloader on this machine
*/
const struct board_api board_api_gta03 = {
.name = "GTA03",
.linux_machine_id = 1866,
.linux_mem_start = 0x50000000,
.linux_mem_size = (128 * 1024 * 1024),
.linux_tag_placement = 0x50000000 + 0x100,
.get_board_variant = get_board_variant_gta03,
.is_this_board = is_this_board_gta03,
.port_init = port_init_gta03,
.putc = putc_gta03,
.kernel_source = {
[0] = {
.name = "SD Card rootfs",
.block_read = sd_card_block_read_gta03,
.filesystem = FS_EXT2,
.partition_index = 2,
.filepath = "boot/uImage.bin",
.initramfs_filepath = "boot/initramfs.gz",
.commandline = "console=ttySAC3,115200 " \
"loglevel=8 init=/bin/sh " \
"root=/dev/ram ramdisk_size=6000000"
},
[1] = {
.name = "SD Card backup rootfs",
.block_read = sd_card_block_read_gta03,
.filesystem = FS_EXT2,
.partition_index = 3,
.filepath = "boot/uImage.bin",
.initramfs_filepath = "boot/initramfs.gz",
.commandline = "console=ttySAC3,115200 " \
"loglevel=8 init=/bin/sh "
}, },
};

View File

@ -5,8 +5,6 @@
#include <i2c-bitbang-s3c6410.h>
#include <pcf50633.h>
#define GTA03_DEBUG_UART 3
#define PCF50633_I2C_ADS 0x73
const struct pcf50633_init gta03_pcf50633_init[] = {
@ -795,67 +793,3 @@ const struct board_variant const * get_board_variant_gta03(void)
return &board_variants[gta03_get_pcb_revision()];
}
int is_this_board_gta03(void)
{
/* FIXME: find something gta03 specific */
return 1;
}
static __attribute__ (( section (".steppingstone") )) void putc_gta03(char c)
{
serial_putc_s3c64xx(GTA03_DEBUG_UART, c);
}
int sd_card_init_gta03(void)
{
extern int s3c6410_mmc_init(int verbose);
return s3c6410_mmc_init(1);
}
int sd_card_block_read_gta03(unsigned char * buf, unsigned long start512,
int blocks512)
{
unsigned long s3c6410_mmc_bread(int dev_num, unsigned long blknr, unsigned long blkcnt,
void *dst);
return s3c6410_mmc_bread(0, start512, blocks512, buf);
}
/*
* our API for bootloader on this machine
*/
const struct board_api board_api_gta03 = {
.name = "GTA03",
.linux_machine_id = 1866,
.linux_mem_start = 0x50000000,
.linux_mem_size = (128 * 1024 * 1024),
.linux_tag_placement = 0x50000000 + 0x100,
.get_board_variant = get_board_variant_gta03,
.is_this_board = is_this_board_gta03,
.port_init = port_init_gta03,
.putc = putc_gta03,
.kernel_source = {
[0] = {
.name = "SD Card rootfs",
.block_read = sd_card_block_read_gta03,
.filesystem = FS_EXT2,
.partition_index = 2,
.filepath = "boot/uImage.bin",
.initramfs_filepath = "boot/initramfs.gz",
.commandline = "console=ttySAC3,115200 " \
"loglevel=8 init=/bin/sh " \
"root=/dev/ram ramdisk_size=6000000"
},
[1] = {
.name = "SD Card backup rootfs",
.block_read = sd_card_block_read_gta03,
.filesystem = FS_EXT2,
.partition_index = 3,
.filepath = "boot/uImage.bin",
.initramfs_filepath = "boot/initramfs.gz",
.commandline = "console=ttySAC3,115200 " \
"loglevel=8 init=/bin/sh "
}, },
};

View File

@ -45,12 +45,12 @@ SECTIONS
src/cpu/s3c6410/start.o (.text .rodata* .data .bss)
src/cpu/s3c6410/start_qi.o (.text .rodata* .data .bss)
src/cpu/s3c6410/serial-s3c64xx.o (.text .rodata* .data .bss)
src/cpu/s3c6410/gta03.o (.text .rodata* .data .bss)
src/cpu/s3c6410/smdk6410.o (.text .rodata* .data .bss)
src/cpu/s3c6410/gta03-steppingstone.o (.text .rodata* .data .bss)
src/cpu/s3c6410/smdk6410-steppingstone.o (.text .rodata* .data .bss)
src/cpu/s3c6410/hs_mmc.o (.text .rodata* .data .bss)
src/utils.o (.text .rodata* .data .bss)
src/memory-test.o (.text .rodata* .data .bss)
src/ctype.o (.text .rodata* .data .bss)
/* src/ctype.o (.text .rodata* .data .bss) */
* (.steppingstone)
}

View File

@ -0,0 +1,71 @@
#include <qi.h>
#include <neo_smdk6410.h>
#include <serial-s3c64xx.h>
#define SMDK6410_DEBUG_UART 0
extern const struct board_variant const * get_board_variant_smdk6410(void);
int is_this_board_smdk6410(void)
{
/* FIXME: find something smdk6410 specific */
return 1;
}
static void putc_smdk6410(char c)
{
serial_putc_s3c64xx(SMDK6410_DEBUG_UART, c);
}
int sd_card_init_smdk6410(void)
{
extern int s3c6410_mmc_init(int verbose);
return s3c6410_mmc_init(1);
}
int sd_card_block_read_smdk6410(unsigned char * buf, unsigned long start512,
int blocks512)
{
unsigned long s3c6410_mmc_bread(int dev_num, unsigned long blknr,
unsigned long blkcnt, void *dst);
return s3c6410_mmc_bread(0, start512, blocks512, buf);
}
/*
* our API for bootloader on this machine
*/
const struct board_api board_api_smdk6410 = {
.name = "SMDK6410",
.linux_machine_id = 1866 /* 1626 */,
.linux_mem_start = 0x50000000,
.linux_mem_size = (128 * 1024 * 1024),
.linux_tag_placement = 0x50000000 + 0x100,
.get_board_variant = get_board_variant_smdk6410,
.is_this_board = is_this_board_smdk6410,
.putc = putc_smdk6410,
.kernel_source = {
[0] = {
.name = "SD Card rootfs",
.block_read = sd_card_block_read_smdk6410,
.filesystem = FS_EXT2,
.partition_index = 2,
.filepath = "boot/uImage.bin",
.initramfs_filepath = "boot/initramfs.gz",
.commandline = "console=ttySAC0,115200 " \
"loglevel=8 init=/bin/sh " \
" root=/dev/ram ramdisk_size=6000000"
},
[1] = {
.name = "SD Card backup rootfs",
.block_read = sd_card_block_read_smdk6410,
.filesystem = FS_EXT2,
.partition_index = 3,
.filepath = "boot/uImage.bin",
.initramfs_filepath = "boot/initramfs.gz",
.commandline = "console=ttySAC0,115200 " \
"loglevel=8 init=/bin/sh "
}, },
};

View File

@ -2,9 +2,6 @@
#include <neo_smdk6410.h>
#include <serial-s3c64xx.h>
#define SMDK6410_DEBUG_UART 0
static const struct board_variant board_variants[] = {
[0] = {
.name = "SMDK",
@ -12,11 +9,6 @@ static const struct board_variant board_variants[] = {
},
};
void port_init_smdk6410(void)
{
}
/**
* returns PCB revision information in b0, d8, d9
* SMDK6410 EVB returns 0x000
@ -33,67 +25,3 @@ const struct board_variant const * get_board_variant_smdk6410(void)
return &board_variants[smdk6410_get_pcb_revision()];
}
int is_this_board_smdk6410(void)
{
/* FIXME: find something smdk6410 specific */
return 1;
}
static __attribute__ (( section (".steppingstone") )) void putc_smdk6410(char c)
{
serial_putc_s3c64xx(SMDK6410_DEBUG_UART, c);
}
int sd_card_init_smdk6410(void)
{
extern int s3c6410_mmc_init(int verbose);
return s3c6410_mmc_init(1);
}
int sd_card_block_read_smdk6410(unsigned char * buf, unsigned long start512,
int blocks512)
{
unsigned long s3c6410_mmc_bread(int dev_num, unsigned long blknr, unsigned long blkcnt,
void *dst);
return s3c6410_mmc_bread(0, start512, blocks512, buf);
}
/*
* our API for bootloader on this machine
*/
const struct board_api board_api_smdk6410 = {
.name = "SMDK6410",
.linux_machine_id = 1626,
.linux_mem_start = 0x50000000,
.linux_mem_size = (128 * 1024 * 1024),
.linux_tag_placement = 0x50000000 + 0x100,
.get_board_variant = get_board_variant_smdk6410,
.is_this_board = is_this_board_smdk6410,
.port_init = port_init_smdk6410,
.putc = putc_smdk6410,
.kernel_source = {
[0] = {
.name = "SD Card rootfs",
.block_read = sd_card_block_read_smdk6410,
.filesystem = FS_EXT2,
.partition_index = 2,
.filepath = "boot/uImage.bin",
.initramfs_filepath = "boot/initramfs.gz",
.commandline = "console=ttySAC0,115200 " \
"loglevel=8 init=/bin/sh " \
" root=/dev/ram ramdisk_size=6000000"
},
[1] = {
.name = "SD Card backup rootfs",
.block_read = sd_card_block_read_smdk6410,
.filesystem = FS_EXT2,
.partition_index = 3,
.filepath = "boot/uImage.bin",
.initramfs_filepath = "boot/initramfs.gz",
.commandline = "console=ttySAC0,115200 " \
"loglevel=8 init=/bin/sh "
}, },
};

View File

@ -421,6 +421,8 @@ start_code:
ldr r1, =0x1FFF
str r1, [r0, #UDIVSLOT_OFFSET]
ldr r1, =0x55
str r1, [r0, #UTXH_OFFSET] @'U'
/* >> CFG_VIDEO_LOGO_MAX_SIZE */
#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */

View File

@ -80,7 +80,9 @@ void start_qi(void)
/* okay, do the critical port and serial init for our board */
this_board->port_init();
if (this_board->early_port_init)
this_board->early_port_init();
set_putc_func(this_board->putc);
/* stick some hello messages on debug console */
@ -90,13 +92,7 @@ void start_qi(void)
stringify2(BUILD_VERSION)" "
"\n");
puts(stringify2(BUILD_DATE) " Copyright (C) 2008 Openmoko, Inc.\n");
puts("\n Detected: ");
puts(this_board->name);
puts(", ");
puts((this_board->get_board_variant)()->name);
puts("\n");
puts(stringify2(BUILD_DATE) " Copyright (C) 2008 Openmoko, Inc.\n\n");
if (!is_jtag) {
/*
@ -122,6 +118,16 @@ void start_qi(void)
256 * 2, (u8 *)0x53000000);
}
/* all of Qi is in memory now, stuff outside steppingstone too */
if (this_board->port_init)
this_board->port_init();
puts("\n Detected: ");
puts(this_board->name);
puts(", ");
puts((this_board->get_board_variant)()->name);
puts("\n");
/*
* jump to bootloader_second_phase() running from DRAM copy