soc/intel: Remove blank lines before '}' and after '{'
[coreboot2.git] / src / mainboard / emulation / qemu-armv7 / mainboard.c
bloba5e9183f3e3336e3a5e953be184cc88ddd53a456
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <device/device.h>
5 #include <halt.h>
6 #include <device/mmio.h>
7 #include <ramdetect.h>
8 #include <symbols.h>
9 #include <framebuffer_info.h>
11 static void init_gfx(void)
13 uint32_t *pl111;
14 /* width is at most 4096 */
15 /* height is at most 1024 */
16 int width = 800, height = 600;
17 uint32_t framebuffer = 0x4c000000;
18 pl111 = (uint32_t *)0x10020000;
19 write32(pl111, (width / 4) - 4);
20 write32(pl111 + 1, height - 1);
21 /* registers 2, 3 and 5 are ignored by qemu. Set them correctly if
22 we ever go for real hw. */
23 /* framebuffer address offset. Has to be in vram. */
24 write32(pl111 + 4, framebuffer);
25 write32(pl111 + 7, 0);
26 write32(pl111 + 10, 0xff);
27 write32(pl111 + 6, (5 << 1) | 0x801);
29 fb_add_framebuffer_info(framebuffer, width, height, 4 * width, 32);
32 static void mainboard_enable(struct device *dev)
34 int discovered;
35 if (!dev) {
36 printk(BIOS_EMERG, "No dev0; die\n");
37 halt();
40 discovered = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
41 printk(BIOS_DEBUG, "%d MiB of RAM discovered\n", discovered);
42 ram_range(dev, 0, 0x60000000, discovered * MiB);
43 init_gfx();
46 struct chip_operations mainboard_ops = {
47 .enable_dev = mainboard_enable,