209
162
{ 0x0f, 0x10, 0x12, 0x14, 0x22, 0x16, 0x24, 0x25, -1 , -1 , -1 },
210
163
{ 0x3c, 0x11, 0x1f, 0x21, 0x2f, 0x23, 0x32, 0x26, -1 , 0x36, -1 },
211
164
{ 0x3b, 0x1e, 0x20, 0x2e, 0x30, 0x31, 0x34, -1 , 0x1c, 0x2a, -1 },
212
{ 0x44, 0x2c, 0x2d, 0x0c, 0x39, 0x33, -1 , 0x48, -1 , -1 , 0x38 },
213
{ 0x37, 0x3d, -1 , 0x45, 0x57, 0x58, 0x4b, 0x50, 0x4d, -1 , -1 },
165
{ 0x44, 0x2c, 0x2d, 0x0c, 0x39, 0x33, -1 , 0x48, -1 , -1 , 0x3d },
166
{ 0x37, 0x38, -1 , 0x45, 0x57, 0x58, 0x4b, 0x50, 0x4d, -1 , -1 },
214
167
{ 0x52, 0x43, 0x01, 0x47, 0x49, -1 , -1 , -1 , -1 , -1 , -1 },
255
206
if (!(s->sense_state & (1 << i)))
256
qemu_irq_raise(s->sense[i]);
207
pxa2xx_gpio_set(s->cpu->gpio, spitz_gpio_key_sense[i], 1);
257
208
} else if (s->sense_state & (1 << i))
258
qemu_irq_lower(s->sense[i]);
209
pxa2xx_gpio_set(s->cpu->gpio, spitz_gpio_key_sense[i], 0);
261
212
s->sense_state = sense;
264
static void spitz_keyboard_strobe(void *opaque, int line, int level)
215
static void spitz_keyboard_strobe(int line, int level,
216
struct spitz_keyboard_s *s)
266
struct spitz_keyboard_s *s = (struct spitz_keyboard_s *) opaque;
219
for (i = 0; i < SPITZ_KEY_STROBE_NUM; i ++)
220
if (spitz_gpio_key_strobe[i] == line) {
222
s->strobe_state |= 1 << i;
224
s->strobe_state &= ~(1 << i);
269
s->strobe_state |= 1 << line;
271
s->strobe_state &= ~(1 << line);
272
spitz_keyboard_sense_update(s);
226
spitz_keyboard_sense_update(s);
275
231
static void spitz_keyboard_keydown(struct spitz_keyboard_s *s, int keycode)
501
423
if (spitz_keymap[i][j] != -1)
502
424
s->keymap[spitz_keymap[i][j]] = (i << 4) | j;
504
for (i = 0; i < SPITZ_KEY_SENSE_NUM; i ++)
505
s->sense[i] = pxa2xx_gpio_in_get(cpu->gpio)[spitz_gpio_key_sense[i]];
507
for (i = 0; i < 5; i ++)
508
s->gpiomap[i] = pxa2xx_gpio_in_get(cpu->gpio)[spitz_gpiomap[i]];
510
s->strobe = qemu_allocate_irqs(spitz_keyboard_strobe, s,
511
SPITZ_KEY_STROBE_NUM);
512
426
for (i = 0; i < SPITZ_KEY_STROBE_NUM; i ++)
513
pxa2xx_gpio_out_set(cpu->gpio, spitz_gpio_key_strobe[i], s->strobe[i]);
427
pxa2xx_gpio_handler_set(cpu->gpio, spitz_gpio_key_strobe[i],
428
(gpio_handler_t) spitz_keyboard_strobe, s);
515
430
spitz_keyboard_pre_map(s);
516
431
qemu_add_kbd_event_handler((QEMUPutKBDEvent *) spitz_keyboard_handler, s);
518
register_savevm("spitz_keyboard", 0, 0,
519
spitz_keyboard_save, spitz_keyboard_load, s);
436
struct scoop_info_s {
437
target_phys_addr_t target_base;
457
#define SCOOP_MCR 0x00
458
#define SCOOP_CDR 0x04
459
#define SCOOP_CSR 0x08
460
#define SCOOP_CPR 0x0c
461
#define SCOOP_CCR 0x10
462
#define SCOOP_IRR_IRM 0x14
463
#define SCOOP_IMR 0x18
464
#define SCOOP_ISR 0x1c
465
#define SCOOP_GPCR 0x20
466
#define SCOOP_GPWR 0x24
467
#define SCOOP_GPRR 0x28
469
static inline void scoop_gpio_handler_update(struct scoop_info_s *s) {
470
uint32_t level, diff;
472
level = s->gpio_level & s->gpio_dir;
474
for (diff = s->prev_level ^ level; diff; diff ^= 1 << bit) {
476
if (s->handler[bit].fn)
477
s->handler[bit].fn(bit, (level >> bit) & 1,
478
s->handler[bit].opaque);
481
s->prev_level = level;
484
static uint32_t scoop_readb(void *opaque, target_phys_addr_t addr)
486
struct scoop_info_s *s = (struct scoop_info_s *) opaque;
487
addr -= s->target_base;
509
return s->gpio_level;
513
spitz_printf("Bad register offset " REG_FMT "\n", addr);
519
static void scoop_writeb(void *opaque, target_phys_addr_t addr, uint32_t value)
521
struct scoop_info_s *s = (struct scoop_info_s *) opaque;
522
addr -= s->target_base;
551
scoop_gpio_handler_update(s);
554
s->gpio_level = value & s->gpio_dir;
555
scoop_gpio_handler_update(s);
561
spitz_printf("Bad register offset " REG_FMT "\n", addr);
565
CPUReadMemoryFunc *scoop_readfn[] = {
570
CPUWriteMemoryFunc *scoop_writefn[] = {
576
static inline void scoop_gpio_set(struct scoop_info_s *s, int line, int level)
579
spitz_printf("No GPIO pin %i\n", line);
584
s->gpio_level |= (1 << line);
586
s->gpio_level &= ~(1 << line);
589
static inline void scoop_gpio_handler_set(struct scoop_info_s *s, int line,
590
gpio_handler_t handler, void *opaque) {
592
spitz_printf("No GPIO pin %i\n", line);
596
s->handler[line].fn = handler;
597
s->handler[line].opaque = opaque;
600
static struct scoop_info_s *spitz_scoop_init(struct pxa2xx_state_s *cpu,
603
struct scoop_info_s *s;
605
s = (struct scoop_info_s *)
606
qemu_mallocz(sizeof(struct scoop_info_s) * 2);
607
memset(s, 0, sizeof(struct scoop_info_s) * count);
608
s[0].target_base = 0x10800000;
609
s[1].target_base = 0x08800040;
615
iomemtype = cpu_register_io_memory(0, scoop_readfn,
616
scoop_writefn, &s[0]);
617
cpu_register_physical_memory(s[0].target_base, 0xfff, iomemtype);
622
iomemtype = cpu_register_io_memory(0, scoop_readfn,
623
scoop_writefn, &s[1]);
624
cpu_register_physical_memory(s[1].target_base, 0xfff, iomemtype);
522
629
/* LCD backlight controller */
655
757
max111x_set_input(max1111, MAX1111_BATT_TEMP, 0);
658
static void spitz_ssp_save(QEMUFile *f, void *opaque)
660
qemu_put_be32(f, lcd_en);
661
qemu_put_be32(f, ads_en);
662
qemu_put_be32(f, max_en);
663
qemu_put_be32(f, bl_intensity);
664
qemu_put_be32(f, bl_power);
667
static int spitz_ssp_load(QEMUFile *f, void *opaque, int version_id)
669
lcd_en = qemu_get_be32(f);
670
ads_en = qemu_get_be32(f);
671
max_en = qemu_get_be32(f);
672
bl_intensity = qemu_get_be32(f);
673
bl_power = qemu_get_be32(f);
760
static void spitz_pendown_set(void *opaque, int line, int level)
762
struct pxa2xx_state_s *cpu = (struct pxa2xx_state_s *) opaque;
763
pxa2xx_gpio_set(cpu->gpio, SPITZ_GPIO_TP_INT, level);
678
766
static void spitz_ssp_attach(struct pxa2xx_state_s *cpu)
680
qemu_irq *chipselects;
682
768
lcd_en = ads_en = max_en = 0;
684
ads7846 = ads7846_init(pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_TP_INT]);
770
ads7846 = ads7846_init(qemu_allocate_irqs(spitz_pendown_set, cpu, 1)[0]);
686
772
max1111 = max1111_init(0);
687
773
max111x_set_input(max1111, MAX1111_BATT_VOLT, SPITZ_BATTERY_VOLT);
691
777
pxa2xx_ssp_attach(cpu->ssp[CORGI_SSP_PORT - 1], corgi_ssp_read,
692
778
corgi_ssp_write, cpu);
694
chipselects = qemu_allocate_irqs(corgi_ssp_gpio_cs, cpu, 3);
695
pxa2xx_gpio_out_set(cpu->gpio, SPITZ_GPIO_LCDCON_CS, chipselects[0]);
696
pxa2xx_gpio_out_set(cpu->gpio, SPITZ_GPIO_ADS7846_CS, chipselects[1]);
697
pxa2xx_gpio_out_set(cpu->gpio, SPITZ_GPIO_MAX1111_CS, chipselects[2]);
780
pxa2xx_gpio_handler_set(cpu->gpio, SPITZ_GPIO_LCDCON_CS,
781
(gpio_handler_t) corgi_ssp_gpio_cs, cpu);
782
pxa2xx_gpio_handler_set(cpu->gpio, SPITZ_GPIO_ADS7846_CS,
783
(gpio_handler_t) corgi_ssp_gpio_cs, cpu);
784
pxa2xx_gpio_handler_set(cpu->gpio, SPITZ_GPIO_MAX1111_CS,
785
(gpio_handler_t) corgi_ssp_gpio_cs, cpu);
699
787
bl_intensity = 0x20;
702
register_savevm("spitz_ssp", 0, 0, spitz_ssp_save, spitz_ssp_load, cpu);
705
791
/* CF Microdrive */
707
793
static void spitz_microdrive_attach(struct pxa2xx_state_s *cpu)
709
795
struct pcmcia_card_s *md;
711
BlockDriverState *bs;
796
BlockDriverState *bs = bs_table[0];
713
index = drive_get_index(IF_IDE, 0, 0);
716
bs = drives_table[index].bdrv;
717
if (bdrv_is_inserted(bs) && !bdrv_is_removable(bs)) {
798
if (bs && bdrv_is_inserted(bs) && !bdrv_is_removable(bs)) {
718
799
md = dscm1xxxx_init(bs);
719
pxa2xx_pcmcia_attach(cpu->pcmcia[1], md);
800
pxa2xx_pcmcia_attach(cpu->pcmcia[0], md);
723
/* Wm8750 and Max7310 on I2C */
725
#define AKITA_MAX_ADDR 0x18
726
#define SPITZ_WM_ADDRL 0x1b
727
#define SPITZ_WM_ADDRH 0x1a
729
#define SPITZ_GPIO_WM 5
732
static void spitz_wm8750_addr(void *opaque, int line, int level)
734
i2c_slave *wm = (i2c_slave *) opaque;
736
i2c_set_slave_address(wm, SPITZ_WM_ADDRH);
738
i2c_set_slave_address(wm, SPITZ_WM_ADDRL);
742
static void spitz_i2c_setup(struct pxa2xx_state_s *cpu)
744
/* Attach the CPU on one end of our I2C bus. */
745
i2c_bus *bus = pxa2xx_i2c_bus(cpu->i2c[0]);
754
/* Attach a WM8750 to the bus */
755
wm = wm8750_init(bus, audio);
757
spitz_wm8750_addr(wm, 0, 0);
758
pxa2xx_gpio_out_set(cpu->gpio, SPITZ_GPIO_WM,
759
qemu_allocate_irqs(spitz_wm8750_addr, wm, 1)[0]);
760
/* .. and to the sound interface. */
761
cpu->i2s->opaque = wm;
762
cpu->i2s->codec_out = wm8750_dac_dat;
763
cpu->i2s->codec_in = wm8750_adc_dat;
764
wm8750_data_req_set(wm, cpu->i2s->data_req, cpu->i2s);
768
static void spitz_akita_i2c_setup(struct pxa2xx_state_s *cpu)
770
/* Attach a Max7310 to Akita I2C bus. */
771
i2c_set_slave_address(max7310_init(pxa2xx_i2c_bus(cpu->i2c[0])),
775
804
/* Other peripherals */
777
static void spitz_out_switch(void *opaque, int line, int level)
781
zaurus_printf("Charging %s.\n", level ? "off" : "on");
784
zaurus_printf("Discharging %s.\n", level ? "on" : "off");
787
zaurus_printf("Green LED %s.\n", level ? "on" : "off");
790
zaurus_printf("Orange LED %s.\n", level ? "on" : "off");
793
spitz_bl_bit5(opaque, line, level);
796
spitz_bl_power(opaque, line, level);
799
spitz_adc_temp_on(opaque, line, level);
806
static void spitz_charge_switch(int line, int level, void *opaque)
808
spitz_printf("Charging %s.\n", level ? "off" : "on");
811
static void spitz_discharge_switch(int line, int level, void *opaque)
813
spitz_printf("Discharging %s.\n", level ? "on" : "off");
816
static void spitz_greenled_switch(int line, int level, void *opaque)
818
spitz_printf("Green LED %s.\n", level ? "on" : "off");
821
static void spitz_orangeled_switch(int line, int level, void *opaque)
823
spitz_printf("Orange LED %s.\n", level ? "on" : "off");
804
826
#define SPITZ_SCP_LED_GREEN 1
817
839
#define SPITZ_SCP2_MIC_BIAS 9
819
841
static void spitz_scoop_gpio_setup(struct pxa2xx_state_s *cpu,
820
struct scoop_info_s *scp0, struct scoop_info_s *scp1)
842
struct scoop_info_s *scp, int num)
822
qemu_irq *outsignals = qemu_allocate_irqs(spitz_out_switch, cpu, 8);
824
scoop_gpio_out_set(scp0, SPITZ_SCP_CHRG_ON, outsignals[0]);
825
scoop_gpio_out_set(scp0, SPITZ_SCP_JK_B, outsignals[1]);
826
scoop_gpio_out_set(scp0, SPITZ_SCP_LED_GREEN, outsignals[2]);
827
scoop_gpio_out_set(scp0, SPITZ_SCP_LED_ORANGE, outsignals[3]);
830
scoop_gpio_out_set(scp1, SPITZ_SCP2_BACKLIGHT_CONT, outsignals[4]);
831
scoop_gpio_out_set(scp1, SPITZ_SCP2_BACKLIGHT_ON, outsignals[5]);
844
scoop_gpio_handler_set(&scp[0], SPITZ_SCP_CHRG_ON,
845
spitz_charge_switch, cpu);
846
scoop_gpio_handler_set(&scp[0], SPITZ_SCP_JK_B,
847
spitz_discharge_switch, cpu);
848
scoop_gpio_handler_set(&scp[0], SPITZ_SCP_LED_GREEN,
849
spitz_greenled_switch, cpu);
850
scoop_gpio_handler_set(&scp[0], SPITZ_SCP_LED_ORANGE,
851
spitz_orangeled_switch, cpu);
854
scoop_gpio_handler_set(&scp[1], SPITZ_SCP2_BACKLIGHT_CONT,
856
scoop_gpio_handler_set(&scp[1], SPITZ_SCP2_BACKLIGHT_ON,
857
spitz_bl_power, cpu);
834
scoop_gpio_out_set(scp0, SPITZ_SCP_ADC_TEMP_ON, outsignals[6]);
860
scoop_gpio_handler_set(&scp[0], SPITZ_SCP_ADC_TEMP_ON,
861
spitz_adc_temp_on, cpu);
837
864
#define SPITZ_GPIO_HSYNC 22
844
871
#define SPITZ_GPIO_CF2_IRQ 106
845
872
#define SPITZ_GPIO_CF2_CD 93
847
static int spitz_hsync;
849
static void spitz_lcd_hsync_handler(void *opaque, int line, int level)
876
static void spitz_lcd_hsync_handler(void *opaque)
851
878
struct pxa2xx_state_s *cpu = (struct pxa2xx_state_s *) opaque;
852
qemu_set_irq(pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_HSYNC], spitz_hsync);
879
pxa2xx_gpio_set(cpu->gpio, SPITZ_GPIO_HSYNC, spitz_hsync);
853
880
spitz_hsync ^= 1;
883
static void spitz_mmc_coverswitch_change(void *opaque, int in)
885
struct pxa2xx_state_s *cpu = (struct pxa2xx_state_s *) opaque;
886
pxa2xx_gpio_set(cpu->gpio, SPITZ_GPIO_SD_DETECT, in);
889
static void spitz_mmc_writeprotect_change(void *opaque, int wp)
891
struct pxa2xx_state_s *cpu = (struct pxa2xx_state_s *) opaque;
892
pxa2xx_gpio_set(cpu->gpio, SPITZ_GPIO_SD_WP, wp);
895
static void spitz_pcmcia_cb(void *opaque, int line, int level)
897
struct pxa2xx_state_s *cpu = (struct pxa2xx_state_s *) opaque;
898
static const int gpio_map[] = {
899
SPITZ_GPIO_CF1_IRQ, SPITZ_GPIO_CF1_CD,
900
SPITZ_GPIO_CF2_IRQ, SPITZ_GPIO_CF2_CD,
902
pxa2xx_gpio_set(cpu->gpio, gpio_map[line], level);
856
905
static void spitz_gpio_setup(struct pxa2xx_state_s *cpu, int slots)
860
909
* Bad hack: We toggle the LCD hsync GPIO on every GPIO status
861
910
* read to satisfy broken guests that poll-wait for hsync.
863
912
* wouldn't guarantee that a guest ever exits the loop.
866
lcd_hsync = qemu_allocate_irqs(spitz_lcd_hsync_handler, cpu, 1)[0];
867
pxa2xx_gpio_read_notifier(cpu->gpio, lcd_hsync);
868
pxa2xx_lcd_vsync_notifier(cpu->lcd, lcd_hsync);
915
pxa2xx_gpio_read_notifier(cpu->gpio, spitz_lcd_hsync_handler, cpu);
916
pxa2xx_lcd_vsync_cb(cpu->lcd, spitz_lcd_hsync_handler, cpu);
870
918
/* MMC/SD host */
871
pxa2xx_mmci_handlers(cpu->mmc,
872
pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_SD_WP],
873
pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_SD_DETECT]);
919
pxa2xx_mmci_handlers(cpu->mmc, cpu, spitz_mmc_writeprotect_change,
920
spitz_mmc_coverswitch_change);
875
922
/* Battery lock always closed */
876
qemu_irq_raise(pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_BAT_COVER]);
923
pxa2xx_gpio_set(cpu->gpio, SPITZ_GPIO_BAT_COVER, 1);
878
925
/* Handle reset */
879
pxa2xx_gpio_out_set(cpu->gpio, SPITZ_GPIO_ON_RESET, cpu->reset);
926
pxa2xx_gpio_handler_set(cpu->gpio, SPITZ_GPIO_ON_RESET, pxa2xx_reset, cpu);
881
928
/* PCMCIA signals: card's IRQ and Card-Detect */
929
pcmcia_cb = qemu_allocate_irqs(spitz_pcmcia_cb, cpu, slots * 2);
883
pxa2xx_pcmcia_set_irq_cb(cpu->pcmcia[0],
884
pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_CF1_IRQ],
885
pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_CF1_CD]);
931
pxa2xx_pcmcia_set_irq_cb(cpu->pcmcia[0], pcmcia_cb[0], pcmcia_cb[1]);
887
pxa2xx_pcmcia_set_irq_cb(cpu->pcmcia[1],
888
pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_CF2_IRQ],
889
pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_CF2_CD]);
933
pxa2xx_pcmcia_set_irq_cb(cpu->pcmcia[1], pcmcia_cb[2], pcmcia_cb[3]);
891
935
/* Initialise the screen rotation related signals */
892
936
spitz_gpio_invert[3] = 0; /* Always open */
895
939
} else { /* Portrait mode */
896
940
spitz_gpio_invert[4] = 1;
898
qemu_set_irq(pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_SWA],
899
spitz_gpio_invert[3]);
900
qemu_set_irq(pxa2xx_gpio_in_get(cpu->gpio)[SPITZ_GPIO_SWB],
901
spitz_gpio_invert[4]);
942
pxa2xx_gpio_set(cpu->gpio, SPITZ_GPIO_SWA, spitz_gpio_invert[3]);
943
pxa2xx_gpio_set(cpu->gpio, SPITZ_GPIO_SWB, spitz_gpio_invert[4]);
946
/* Write the bootloader parameters memory area. */
948
#define MAGIC_CHG(a, b, c, d) ((d << 24) | (c << 16) | (b << 8) | a)
950
struct __attribute__ ((__packed__)) sl_param_info {
951
uint32_t comadj_keyword;
954
uint32_t uuid_keyword;
957
uint32_t touch_keyword;
963
uint32_t adadj_keyword;
966
uint32_t phad_keyword;
968
} spitz_bootparam = {
969
.comadj_keyword = MAGIC_CHG('C', 'M', 'A', 'D'),
971
.uuid_keyword = MAGIC_CHG('U', 'U', 'I', 'D'),
973
.touch_keyword = MAGIC_CHG('T', 'U', 'C', 'H'),
975
.adadj_keyword = MAGIC_CHG('B', 'V', 'A', 'D'),
977
.phad_keyword = MAGIC_CHG('P', 'H', 'A', 'D'),
981
static void sl_bootparam_write(uint32_t ptr)
983
memcpy(phys_ram_base + ptr, &spitz_bootparam,
984
sizeof(struct sl_param_info));
987
#define SL_PXA_PARAM_BASE 0xa0000a00
904
989
/* Board init. */
905
990
enum spitz_model_e { spitz, akita, borzoi, terrier };
907
#define SPITZ_RAM 0x04000000
908
#define SPITZ_ROM 0x00800000
910
static struct arm_boot_info spitz_binfo = {
911
.loader_start = PXA2XX_SDRAM_BASE,
912
.ram_size = 0x04000000,
915
static void spitz_common_init(ram_addr_t ram_size, int vga_ram_size,
992
static void spitz_common_init(int ram_size, int vga_ram_size,
916
993
DisplayState *ds, const char *kernel_filename,
917
994
const char *kernel_cmdline, const char *initrd_filename,
918
995
const char *cpu_model, enum spitz_model_e model, int arm_id)
997
uint32_t spitz_ram = 0x04000000;
998
uint32_t spitz_rom = 0x00800000;
920
999
struct pxa2xx_state_s *cpu;
921
struct scoop_info_s *scp0, *scp1 = NULL;
1000
struct scoop_info_s *scp;
924
1003
cpu_model = (model == terrier) ? "pxa270-c5" : "pxa270-c0";
1004
cpu = pxa270_init(ds, cpu_model);
926
/* Setup CPU & memory */
927
if (ram_size < SPITZ_RAM + SPITZ_ROM + PXA2XX_INTERNAL_SIZE) {
1007
if (ram_size < spitz_ram + spitz_rom) {
928
1008
fprintf(stderr, "This platform requires %i bytes of memory\n",
929
SPITZ_RAM + SPITZ_ROM + PXA2XX_INTERNAL_SIZE);
1009
spitz_ram + spitz_rom);
932
cpu = pxa270_init(spitz_binfo.ram_size, ds, cpu_model);
1012
cpu_register_physical_memory(PXA2XX_RAM_BASE, spitz_ram, IO_MEM_RAM);
934
1014
sl_flash_register(cpu, (model == spitz) ? FLASH_128M : FLASH_1024M);
936
cpu_register_physical_memory(0, SPITZ_ROM,
937
qemu_ram_alloc(SPITZ_ROM) | IO_MEM_ROM);
1016
cpu_register_physical_memory(0, spitz_rom, spitz_ram | IO_MEM_ROM);
939
1018
/* Setup peripherals */
940
1019
spitz_keyboard_register(cpu);
942
1021
spitz_ssp_attach(cpu);
944
scp0 = scoop_init(cpu, 0, 0x10800000);
945
if (model != akita) {
946
scp1 = scoop_init(cpu, 1, 0x08800040);
1023
scp = spitz_scoop_init(cpu, (model == akita) ? 1 : 2);
949
spitz_scoop_gpio_setup(cpu, scp0, scp1);
1025
spitz_scoop_gpio_setup(cpu, scp, (model == akita) ? 1 : 2);
951
1027
spitz_gpio_setup(cpu, (model == akita) ? 1 : 2);
953
spitz_i2c_setup(cpu);
956
spitz_akita_i2c_setup(cpu);
958
1029
if (model == terrier)
959
/* A 6.0 GB microdrive is permanently sitting in CF slot 1. */
1030
/* A 6.0 GB microdrive is permanently sitting in CF slot 0. */
960
1031
spitz_microdrive_attach(cpu);
961
1032
else if (model != akita)
962
/* A 4.0 GB microdrive is permanently sitting in CF slot 1. */
1033
/* A 4.0 GB microdrive is permanently sitting in CF slot 0. */
963
1034
spitz_microdrive_attach(cpu);
965
1036
/* Setup initial (reset) machine state */
966
cpu->env->regs[15] = spitz_binfo.loader_start;
1037
cpu->env->regs[15] = PXA2XX_RAM_BASE;
968
spitz_binfo.kernel_filename = kernel_filename;
969
spitz_binfo.kernel_cmdline = kernel_cmdline;
970
spitz_binfo.initrd_filename = initrd_filename;
971
spitz_binfo.board_id = arm_id;
972
arm_load_kernel(cpu->env, &spitz_binfo);
973
sl_bootparam_write(SL_PXA_PARAM_BASE - PXA2XX_SDRAM_BASE);
1039
arm_load_kernel(cpu->env, ram_size, kernel_filename, kernel_cmdline,
1040
initrd_filename, arm_id, PXA2XX_RAM_BASE);
1041
sl_bootparam_write(SL_PXA_PARAM_BASE - PXA2XX_RAM_BASE);
976
static void spitz_init(ram_addr_t ram_size, int vga_ram_size,
977
const char *boot_device, DisplayState *ds,
1044
static void spitz_init(int ram_size, int vga_ram_size, int boot_device,
1045
DisplayState *ds, const char **fd_filename, int snapshot,
978
1046
const char *kernel_filename, const char *kernel_cmdline,
979
1047
const char *initrd_filename, const char *cpu_model)