Root/qiboot/src/cpu/s3c6410/om_3d7k-steppingstone.c

1#include <qi.h>
2#include <neo_om_3d7k.h>
3#include <s3c6410.h>
4#include <serial-s3c64xx.h>
5
6#define OM_3D7K_DEBUG_UART 3
7
8/* out of steppingstone */
9extern const struct board_variant const * get_board_variant_om_3d7k(void);
10extern void port_init_om_3d7k(void);
11
12
13int is_this_board_om_3d7k(void)
14{
15    /* FIXME: find something om_3d7k specific */
16    return 1;
17}
18
19static void putc_om_3d7k(char c)
20{
21    serial_putc_s3c64xx(OM_3D7K_DEBUG_UART, c);
22}
23
24int sd_card_init_om_3d7k(void)
25{
26    extern int s3c6410_mmc_init(int verbose);
27
28    return s3c6410_mmc_init(1);
29}
30
31int sd_card_block_read_om_3d7k(unsigned char * buf, unsigned long start512,
32                                   int blocks512)
33{
34unsigned long s3c6410_mmc_bread(int dev_num, unsigned long blknr, unsigned long blkcnt,
35                                     void *dst);
36
37    return s3c6410_mmc_bread(0, start512, blocks512, buf);
38}
39
40/*
41 * our API for bootloader on this machine
42 */
43
44/* for initrd:
45 * .initramfs_filepath = "boot/initramfs.gz",
46 * and
47 * "root=/dev/ram ramdisk_size=6000000"
48 */
49
50static u8 get_ui_keys_om_3d7k(void)
51{
52    u8 keys;
53    u8 ret;
54    static u8 old_keys = 0; /* previous state for debounce */
55    static u8 old_ret = 0; /* previous debounced output for edge detect */
56
57    /* GPN1 is MINUS on OM_3D7K, map to UI_ACTION_ADD_DEBUG, down = 1 */
58    keys = !!(__REG(GPMDAT) & (1 << 1));
59
60    if (keys == old_keys)
61        ret = keys;
62    else
63        ret = old_keys;
64
65    /* edge action */
66    if ((ret & 1) && !(old_ret & 1))
67        ret |= UI_ACTION_SKIPKERNEL;
68
69    old_keys = keys;
70    old_ret = ret;
71
72    return ret;
73}
74
75const struct board_api board_api_om_3d7k = {
76    .name = "OM_3D7K",
77    .linux_machine_id = 2120,
78    .linux_mem_start = 0x50000000,
79    .linux_mem_size = (128 * 1024 * 1024),
80    .linux_tag_placement = 0x50000000 + 0x100,
81    .get_board_variant = get_board_variant_om_3d7k,
82    .is_this_board = is_this_board_om_3d7k,
83    .port_init = port_init_om_3d7k,
84    .putc = putc_om_3d7k,
85    .noboot = "boot/noboot-OM_3D7K",
86    .append = "boot/append-OM_3D7K",
87    .get_ui_keys = get_ui_keys_om_3d7k,
88    .commandline_board = "console=tty0 "
89                 "console=ttySAC3,115200 "
90                 "init=/sbin/init "
91                 "loglevel=8 "
92                 "rootdelay=1 no_console_suspend "
93                 "ro ",
94    .commandline_board_debug = " loglevel=8",
95    .kernel_source = {
96        [0] = {
97            .name = "SD Card rootfs",
98            .block_read = sd_card_block_read_om_3d7k,
99            .filesystem = FS_EXT2,
100            .partition_index = 2,
101            .filepath = "boot/uImage-OM_3D7K.bin",
102            .commandline_append = "root=/dev/mmcblk0p2 ",
103        },
104        [1] = {
105            .name = "SD Card backup rootfs",
106            .block_read = sd_card_block_read_om_3d7k,
107            .filesystem = FS_EXT2,
108            .partition_index = 3,
109            .filepath = "boot/uImage-OM_3D7K.bin",
110            .commandline_append = "root=/dev/mmcblk0p3 ",
111        },
112    },
113};
114
115

Archive Download this file



interactive