2 * Beagle board emulation. http://beagleboard.org/
4 * Original code Copyright (C) 2008 yajin(yajin@vm-kernel.org)
5 * Rewrite Copyright (C) 2009 Nokia Corporation
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 or
10 * (at your option) version 3 of the License.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 #include "qemu-common.h"
33 #define BEAGLE_NAND_CS 0
34 #define BEAGLE_SMC_CS 1
35 #define BEAGLE_NAND_PAGESIZE 0x800
36 #define BEAGLE_SDRAM_SIZE (128 * 1024 * 1024) /* 128MB */
38 /* Beagle board support */
40 struct omap_mpu_state_s *cpu;
43 struct omap3_lcd_panel_s *lcd_panel;
48 static void beagle_init(ram_addr_t ram_size,
49 const char *boot_device,
50 const char *kernel_filename,
51 const char *kernel_cmdline,
52 const char *initrd_filename,
53 const char *cpu_model)
55 struct beagle_s *s = (struct beagle_s *) qemu_mallocz(sizeof(*s));
56 int sdindex = drive_get_index(IF_SD, 0, 0);
60 fprintf(stderr, "%s: missing SecureDigital device\n", __FUNCTION__);
63 s->cpu = omap3530_mpu_init(ram_size, NULL, NULL, serial_hds[0]);
65 s->nand = nand_init(NAND_MFR_MICRON, 0xba); /* MT29F2G16ABC */
66 nand_setpins(s->nand, 0, 0, 0, 1, 0); /* no write-protect */
67 omap_gpmc_attach(s->cpu->gpmc, BEAGLE_NAND_CS, 0, NULL, NULL, s->nand, 2);
68 omap3_mmc_attach(s->cpu->omap3_mmc[0], drives_table[sdindex].bdrv);
70 s->i2c = omap_i2c_bus(s->cpu->i2c[0]);
71 s->twl4030 = twl4030_init(s->i2c, s->cpu->irq[0][OMAP_INT_3XXX_SYS_NIRQ]);
72 opaque = smc91c111_init_lite(&nd_table[0], /*0x08000000,*/
73 omap2_gpio_in_get(s->cpu->gpif, 54)[0]);
74 omap_gpmc_attach(s->cpu->gpmc, BEAGLE_SMC_CS, smc91c111_iomemtype(opaque),
75 NULL, NULL, opaque, 0);
77 s->lcd_panel = omap3_lcd_panel_init();
78 omap3_lcd_panel_attach(s->cpu->dss, 0, s->lcd_panel);
80 omap3_boot_rom_emu(s->cpu);
83 QEMUMachine beagle_machine = {
85 .desc = "Beagle board (OMAP3530)",
89 static void beagle_machine_init(void)
91 qemu_register_machine(&beagle_machine);
94 machine_init(beagle_machine_init);