aboutsummaryrefslogtreecommitdiff
path: root/arch/avr32/boards/atstk1000/setup.c
blob: 191ab85de9a36bfe66f71bb36ed4d2fc0c676abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * ATSTK1000 board-specific setup code.
 *
 * Copyright (C) 2005-2006 Atmel Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#include <linux/bootmem.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/linkage.h>

#include <asm/setup.h>

#include <asm/arch/board.h>

/* Initialized by bootloader-specific startup code. */
struct tag *bootloader_tags __initdata;

struct lcdc_platform_data __initdata atstk1000_fb0_data;

asmlinkage void __init board_early_init(void)
{
	extern void sdram_init(void);

#ifdef CONFIG_LOADER_STANDALONE
	sdram_init();
#endif
}

void __init board_setup_fbmem(unsigned long fbmem_start,
			      unsigned long fbmem_size)
{
	if (!fbmem_size)
		return;

	if (!fbmem_start) {
		void *fbmem;

		fbmem = alloc_bootmem_low_pages(fbmem_size);
		fbmem_start = __pa(fbmem);
	} else {
		pg_data_t *pgdat;

		for_each_online_pgdat(pgdat) {
			if (fbmem_start >= pgdat->bdata->node_boot_start
			    && fbmem_start <= pgdat->bdata->node_low_pfn)
				reserve_bootmem_node(pgdat, fbmem_start,
						     fbmem_size);
		}
	}

	printk("%luKiB framebuffer memory at address 0x%08lx\n",
	       fbmem_size >> 10, fbmem_start);
	atstk1000_fb0_data.fbmem_start = fbmem_start;
	atstk1000_fb0_data.fbmem_size = fbmem_size;
}