Changeset f6f22cdb in mainline for boot/arch/sparc32/include
- Timestamp:
- 2013-12-27T18:45:56Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 32e8cd1
- Parents:
- e47ed05
- Location:
- boot/arch/sparc32/include
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc32/include/ambapp.h
re47ed05 rf6f22cdb 37 37 #define BOOT_sparc32_AMBAPP_H 38 38 39 #define AMBAPP_MAX_DEVICES6440 #define AMBAPP_AHBMASTER_AREA0xfffff00041 #define AMBAPP_AHBSLAVE_AREA0xfffff80042 #define AMBAPP_CONF_AREA0xff00039 #define AMBAPP_MAX_DEVICES 64 40 #define AMBAPP_AHBMASTER_AREA 0xfffff000 41 #define AMBAPP_AHBSLAVE_AREA 0xfffff800 42 #define AMBAPP_CONF_AREA 0xff000 43 43 44 44 typedef enum { 45 GAISLER = 1,46 ESA = 445 GAISLER = 1, 46 ESA = 4 47 47 } amba_vendor_id_t; 48 48 49 49 typedef enum { 50 GAISLER_LEON3 = 0x003,51 GAISLER_LEON3DSU = 0x004,52 GAISLER_ETHAHB = 0x005,53 GAISLER_APBMST = 0x006,54 GAISLER_AHBUART = 0x007,55 GAISLER_SRCTRL = 0x008,56 GAISLER_SDCTRL = 0x009,57 GAISLER_APBUART = 0x00C,58 GAISLER_IRQMP = 0x00D,59 GAISLER_AHBRAM = 0x00E,60 GAISLER_GPTIMER = 0x011,61 GAISLER_PCITRG = 0x012,62 GAISLER_PCISBRG = 0x013,63 GAISLER_PCIFBRG = 0x014,64 GAISLER_PCITRACE = 0x015,65 GAISLER_PCIDMA = 0x016,66 GAISLER_AHBTRACE = 0x017,67 GAISLER_ETHDSU = 0x018,68 GAISLER_PIOPORT = 0x01A,69 GAISLER_AHBJTAG = 0x01c,70 GAISLER_SPW = 0x01f,71 GAISLER_ATACTRL = 0x024,72 GAISLER_VGA = 0x061,73 GAISLER_KBD = 0x060,74 GAISLER_ETHMAC = 0x01D,75 GAISLER_DDRSPA = 0x025,76 GAISLER_EHCI = 0x026,77 GAISLER_UHCI = 0x027,78 GAISLER_SPW2 = 0x029,79 GAISLER_DDR2SPA = 0x02E,80 GAISLER_AHBSTAT = 0x052,81 GAISLER_FTMCTRL = 0x054,82 ESA_MCTRL = 0x00F,50 GAISLER_LEON3 = 0x003, 51 GAISLER_LEON3DSU = 0x004, 52 GAISLER_ETHAHB = 0x005, 53 GAISLER_APBMST = 0x006, 54 GAISLER_AHBUART = 0x007, 55 GAISLER_SRCTRL = 0x008, 56 GAISLER_SDCTRL = 0x009, 57 GAISLER_APBUART = 0x00c, 58 GAISLER_IRQMP = 0x00d, 59 GAISLER_AHBRAM = 0x00e, 60 GAISLER_GPTIMER = 0x011, 61 GAISLER_PCITRG = 0x012, 62 GAISLER_PCISBRG = 0x013, 63 GAISLER_PCIFBRG = 0x014, 64 GAISLER_PCITRACE = 0x015, 65 GAISLER_PCIDMA = 0x016, 66 GAISLER_AHBTRACE = 0x017, 67 GAISLER_ETHDSU = 0x018, 68 GAISLER_PIOPORT = 0x01a, 69 GAISLER_AHBJTAG = 0x01c, 70 GAISLER_SPW = 0x01f, 71 GAISLER_ATACTRL = 0x024, 72 GAISLER_VGA = 0x061, 73 GAISLER_KBD = 0x060, 74 GAISLER_ETHMAC = 0x01d, 75 GAISLER_DDRSPA = 0x025, 76 GAISLER_EHCI = 0x026, 77 GAISLER_UHCI = 0x027, 78 GAISLER_SPW2 = 0x029, 79 GAISLER_DDR2SPA = 0x02e, 80 GAISLER_AHBSTAT = 0x052, 81 GAISLER_FTMCTRL = 0x054, 82 ESA_MCTRL = 0x00f, 83 83 } amba_device_id_t; 84 84 … … 109 109 110 110 typedef struct { 111 unsigned int addr : 12;112 unsigned int reserved : 2;113 unsigned int prefetchable : 1;114 unsigned int cacheable : 1;115 unsigned int mask : 12;116 unsigned int type : 4;111 unsigned int addr : 12; 112 unsigned int reserved : 2; 113 unsigned int prefetchable : 1; 114 unsigned int cacheable : 1; 115 unsigned int mask : 12; 116 unsigned int type : 4; 117 117 } __attribute__((packed)) ambapp_bar_t; 118 118 119 119 typedef struct { 120 unsigned int vendor_id : 8;121 unsigned int device_id : 24;122 unsigned int reserved : 2;123 unsigned int version : 5;124 unsigned int irq : 5;120 unsigned int vendor_id : 8; 121 unsigned int device_id : 24; 122 unsigned int reserved : 2; 123 unsigned int version : 5; 124 unsigned int irq : 5; 125 125 uint32_t user_defined[3]; 126 126 ambapp_bar_t bar[4]; … … 128 128 129 129 typedef struct { 130 unsigned int ram_read_ws : 1;131 unsigned int ram_write_ws : 1;132 unsigned int ram_width : 2;133 unsigned int rmw : 1;134 unsigned int rbrdy : 1;130 unsigned int ram_read_ws : 1; 131 unsigned int ram_write_ws : 1; 132 unsigned int ram_width : 2; 133 unsigned int rmw : 1; 134 unsigned int rbrdy : 1; 135 135 unsigned int : 1; 136 unsigned int bank_size : 4;137 unsigned int si : 1;138 unsigned int se : 1;136 unsigned int bank_size : 4; 137 unsigned int si : 1; 138 unsigned int se : 1; 139 139 unsigned int : 1; 140 unsigned int ms : 1;140 unsigned int ms : 1; 141 141 unsigned int : 1; 142 unsigned int d64 : 1;143 unsigned int sdram_cmd : 2;144 unsigned int sdram_colsz : 2;145 unsigned int sdram_banksz : 3;146 unsigned int tcas : 1;147 unsigned int trfc : 3;148 unsigned int trp : 1;149 unsigned int sdrf : 1;142 unsigned int d64 : 1; 143 unsigned int sdram_cmd : 2; 144 unsigned int sdram_colsz : 2; 145 unsigned int sdram_banksz : 3; 146 unsigned int tcas : 1; 147 unsigned int trfc : 3; 148 unsigned int trp : 1; 149 unsigned int sdrf : 1; 150 150 } __attribute__((packed)) mctrl_mcfg2_t; 151 151 152 amba_device_t amba_devices[AMBAPP_MAX_DEVICES];153 int amba_devices_found;154 bool amba_fake;155 uintptr_t amba_uart_base;152 extern amba_device_t amba_devices[AMBAPP_MAX_DEVICES]; 153 extern int amba_devices_found; 154 extern bool amba_fake; 155 extern uintptr_t amba_uart_base; 156 156 157 void ambapp_scan(void);158 bool ambapp_fake(void);159 void ambapp_qemu_fake_scan(void);160 void ambapp_print_devices(void);161 amba_device_t *ambapp_lookup_first(amba_vendor_id_t, amba_device_id_t);157 extern void ambapp_scan(void); 158 extern bool ambapp_fake(void); 159 extern void ambapp_qemu_fake_scan(void); 160 extern void ambapp_print_devices(void); 161 extern amba_device_t *ambapp_lookup_first(amba_vendor_id_t, amba_device_id_t); 162 162 163 163 #endif -
boot/arch/sparc32/include/arch.h
re47ed05 rf6f22cdb 30 30 #define BOOT_sparc32_ARCH_H 31 31 32 #define PTL0_ENTRIES25633 #define PTL0_SHIFT2434 #define PTL0_SIZE(1 << 24)35 #define PTL0_ENTRY_SIZE432 #define PTL0_ENTRIES 256 33 #define PTL0_SHIFT 24 34 #define PTL0_SIZE (1 << 24) 35 #define PTL0_ENTRY_SIZE 4 36 36 37 37 /* ASI assignments: */ 38 #define ASI_CACHEMISS0x0139 #define ASI_CACHECTRL0x0240 #define ASI_MMUREGS0x1941 #define ASI_MMUBYPASS0x1c38 #define ASI_CACHEMISS 0x01 39 #define ASI_CACHECTRL 0x02 40 #define ASI_MMUREGS 0x19 41 #define ASI_MMUBYPASS 0x1c 42 42 43 43 /* 44 * Address where the boot stage image starts (beginning of usable physical45 * memory).44 * Address where the boot stage image starts 45 * (beginning of usable physical memory). 46 46 */ 47 #define BOOT_BASE 0x4000000048 #define BOOT_OFFSET (BOOT_BASE + 0xa00000)49 47 50 #define PA_OFFSET 0x40000000 48 #define BOOT_BASE 0x40000000 49 #define BOOT_OFFSET (BOOT_BASE + 0xa00000) 50 51 #define PA_OFFSET 0x40000000 51 52 52 53 #ifndef __ASM__ … … 56 57 #endif 57 58 58 59 59 #endif 60 60 -
boot/arch/sparc32/include/asm.h
re47ed05 rf6f22cdb 32 32 #include <typedefs.h> 33 33 34 static inline uint32_t asi_u32_read(int asi, uintptr_t va) 34 extern uintptr_t boot_ctx_table; 35 36 static inline uint32_t asi_u32_read(unsigned int asi, uintptr_t va) 35 37 { 36 38 uint32_t v; 37 39 38 40 asm volatile ( 39 41 "lda [%[va]] %[asi], %[v]\n" 40 42 : [v] "=r" (v) 41 43 : [va] "r" (va), 42 [asi] "i" ( (unsigned int)asi)44 [asi] "i" (asi) 43 45 ); 44 46 … … 46 48 } 47 49 48 static inline void asi_u32_write( int asi, uintptr_t va, uint32_t v)50 static inline void asi_u32_write(unsigned int asi, uintptr_t va, uint32_t v) 49 51 { 50 52 asm volatile ( … … 52 54 :: [v] "r" (v), 53 55 [va] "r" (va), 54 [asi] "i" ( (unsigned int)asi)56 [asi] "i" (asi) 55 57 : "memory" 56 58 ); 57 59 } 58 60 59 extern void jump_to_kernel(void * entry, bootinfo_t *bootinfo);61 extern void jump_to_kernel(void *, bootinfo_t *); 60 62 61 63 #endif -
boot/arch/sparc32/include/main.h
re47ed05 rf6f22cdb 35 35 36 36 #ifndef BOOT_sparc32_MAIN_H 37 #define BOOT_sparc 2_MAIN_H37 #define BOOT_sparc32_MAIN_H 38 38 39 39 /** Address where characters to be printed are expected. */ 40 #define APBUART_SCONS_THR0x8000010041 #define APBUART_SCONS_THR_MMU0xb000010040 #define APBUART_SCONS_THR 0x80000100 41 #define APBUART_SCONS_THR_MMU 0xb0000100 42 42 43 43 extern void bootstrap(void); -
boot/arch/sparc32/include/mm.h
re47ed05 rf6f22cdb 39 39 */ 40 40 41 #ifndef BOOT_sparc32_ _MM_H42 #define BOOT_sparc32_ _MM_H41 #ifndef BOOT_sparc32_MM_H 42 #define BOOT_sparc32_MM_H 43 43 44 44 #include <typedefs.h> 45 45 46 #define PAGE_SIZE(1 << 12)46 #define PAGE_SIZE (1 << 12) 47 47 48 48 typedef struct { … … 54 54 55 55 typedef struct { 56 unsigned int ppn : 24;57 unsigned int cacheable : 1;58 unsigned int modified : 1;59 unsigned int referenced : 1;60 unsigned int acc : 3;61 unsigned int et : 2;56 unsigned int ppn : 24; 57 unsigned int cacheable : 1; 58 unsigned int modified : 1; 59 unsigned int referenced : 1; 60 unsigned int acc : 3; 61 unsigned int et : 2; 62 62 } __attribute__((packed)) pte_t; 63 63 64 64 extern pte_t boot_pt[PTL0_ENTRIES]; 65 65 66 void mmu_init(void);66 extern void mmu_init(void); 67 67 68 #define PTE_ET_DESCRIPTOR169 #define PTE_ET_ENTRY270 #define PTE_ACC_RWX371 #define MMU_CONTROL_EN(1 << 0)68 #define PTE_ET_DESCRIPTOR 1 69 #define PTE_ET_ENTRY 2 70 #define PTE_ACC_RWX 3 71 #define MMU_CONTROL_EN (1 << 0) 72 72 73 73 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
