OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [platform/] [pba8/] [platform.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * EB platform-specific initialisation and setup
3
 *
4
 * Copyright (C) 2009 B Labs Ltd.
5
 */
6
#include <l4/generic/platform.h>
7
#include <l4/generic/bootmem.h>
8
#include INC_PLAT(offsets.h)
9
#include INC_ARCH(io.h)
10
#include <l4/generic/space.h>
11
#include <l4/generic/irq.h>
12
#include <l4/generic/cap-types.h>
13
#include INC_PLAT(platform.h)
14
#include INC_PLAT(irq.h)
15
#include INC_GLUE(mapping.h)
16
 
17
/*
18
 * The devices that are used by the kernel are mapped
19
 * independent of these capabilities, but these provide a
20
 * concise description of what is used by the kernel.
21
 */
22
int platform_setup_device_caps(struct kernel_resources *kres)
23
{
24
#if 0
25
        struct capability *uart[4], *timer[4];
26
 
27
        /* Setup capabilities for userspace uarts and timers */
28
        uart[1] =  alloc_bootmem(sizeof(*uart[1]), 0);
29
        uart[1]->start = __pfn(PLATFORM_UART1_BASE);
30
        uart[1]->end = uart[1]->start + 1;
31
        uart[1]->size = uart[1]->end - uart[1]->start;
32
        cap_set_devtype(uart[1], CAP_DEVTYPE_UART);
33
        cap_set_devnum(uart[1], 1);
34
        link_init(&uart[1]->list);
35
        cap_list_insert(uart[1], &kres->devmem_free);
36
 
37
        uart[2] =  alloc_bootmem(sizeof(*uart[2]), 0);
38
        uart[2]->start = __pfn(PLATFORM_UART2_BASE);
39
        uart[2]->end = uart[2]->start + 1;
40
        uart[2]->size = uart[2]->end - uart[2]->start;
41
        cap_set_devtype(uart[2], CAP_DEVTYPE_UART);
42
        cap_set_devnum(uart[2], 2);
43
        link_init(&uart[2]->list);
44
        cap_list_insert(uart[2], &kres->devmem_free);
45
 
46
        uart[3] =  alloc_bootmem(sizeof(*uart[3]), 0);
47
        uart[3]->start = __pfn(PLATFORM_UART3_BASE);
48
        uart[3]->end = uart[3]->start + 1;
49
        uart[3]->size = uart[3]->end - uart[3]->start;
50
        cap_set_devtype(uart[3], CAP_DEVTYPE_UART);
51
        cap_set_devnum(uart[3], 3);
52
        link_init(&uart[3]->list);
53
        cap_list_insert(uart[3], &kres->devmem_free);
54
 
55
        /* Setup timer1 capability as free */
56
        timer[1] =  alloc_bootmem(sizeof(*timer[1]), 0);
57
        timer[1]->start = __pfn(PLATFORM_TIMER1_BASE);
58
        timer[1]->end = timer[1]->start + 1;
59
        timer[1]->size = timer[1]->end - timer[1]->start;
60
        cap_set_devtype(timer[1], CAP_DEVTYPE_TIMER);
61
        cap_set_devnum(timer[1], 1);
62
        link_init(&timer[1]->list);
63
        cap_list_insert(timer[1], &kres->devmem_free);
64
#endif
65
        return 0;
66
}
67
 
68
void init_platform_irq_controller()
69
{
70
#if 0
71
        unsigned int sysctrl = PLATFORM_SYSCTRL_VBASE;
72
        write(SYSCTRL_UNLOCK, sysctrl + SYS_LOCK);
73
        write(PLD_CTRL1_INTMOD_WITHOUT_DCC, sysctrl+SYS_PLDCTL1);
74
        write(SYSCTRL_LOCK, sysctrl + SYS_LOCK);                /* Lock again */
75
#ifdef CONFIG_CPU_ARM11MPCORE
76
        /* TODO: we need to map 64KB ?*/
77
        add_boot_mapping(ARM11MP_PRIVATE_MEM_BASE, EB_MPCORE_PRIV_MEM_VBASE,
78
                         PAGE_SIZE*2, MAP_IO_DEFAULT);
79
 
80
        gic_dist_init(0, GIC0_DIST_VBASE);
81
        gic_cpu_init(0, GIC0_CPU_VBASE);
82
 
83
#endif
84
        add_boot_mapping(PLATFORM_GIC1_BASE, PLATFORM_GIC1_VBASE, PAGE_SIZE*2,
85
                         MAP_IO_DEFAULT);
86
 
87
        gic_dist_init(1, GIC1_DIST_VBASE);
88
        gic_cpu_init(1, PLATFORM_GIC1_VBASE);
89
 
90
        irq_controllers_init();
91
#endif
92
}
93
 
94
void init_platform_devices()
95
{
96
 
97
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.