[7be6ad9] | 1 | /* |
---|
| 2 | * bsp.h -- contain BSP API definition. |
---|
| 3 | * |
---|
| 4 | * Copyright (C) 1999 Eric Valette. valette@crf.canon.fr |
---|
| 5 | * |
---|
| 6 | * The license and distribution terms for this file may be |
---|
| 7 | * found in found in the file LICENSE in this distribution or at |
---|
[f8e0327] | 8 | * http://www.rtems.com/license/LICENSE. |
---|
[7be6ad9] | 9 | * |
---|
[ee732739] | 10 | * S. Kate Feng 2003-2007 : Modified it to support the mvme5500 BSP. |
---|
[7be6ad9] | 11 | * |
---|
| 12 | */ |
---|
| 13 | |
---|
[34c4852] | 14 | #ifndef _BSP_H |
---|
| 15 | #define _BSP_H |
---|
[7be6ad9] | 16 | |
---|
| 17 | #include <bspopts.h> |
---|
| 18 | |
---|
| 19 | #include <rtems.h> |
---|
[f4a59e33] | 20 | #include <rtems/console.h> |
---|
| 21 | #include <rtems/clockdrv.h> |
---|
[7be6ad9] | 22 | #include <libcpu/io.h> |
---|
| 23 | #include <bsp/vectors.h> |
---|
| 24 | |
---|
| 25 | #include <bsp/bspMvme5500.h> |
---|
| 26 | |
---|
| 27 | /* fundamental addresses for this BSP (PREPxxx are from libcpu/io.h) */ |
---|
[c4423933] | 28 | #define _IO_BASE GT64260_REG_BASE |
---|
[7be6ad9] | 29 | |
---|
| 30 | /* PCI0 Domain I/O space */ |
---|
| 31 | #define PCI0_IO_BASE 0xf0000000 |
---|
| 32 | #define PCI1_IO_BASE 0xf0800000 |
---|
| 33 | |
---|
| 34 | /* PCI 0 memory space as seen from the CPU */ |
---|
| 35 | #define PCI0_MEM_BASE 0x80000000 |
---|
| 36 | #define PCI_MEM_BASE 0 /* glue for vmeUniverse */ |
---|
[4406c2f] | 37 | #define PCI_MEM_BASE_ADJUSTMENT 0 |
---|
[7be6ad9] | 38 | |
---|
| 39 | /* address of our ram on the PCI bus */ |
---|
| 40 | #define PCI_DRAM_OFFSET 0 |
---|
| 41 | |
---|
| 42 | /* PCI 1 memory space as seen from the CPU */ |
---|
| 43 | #define PCI1_MEM_BASE 0xe0000000 |
---|
| 44 | #define PCI1_MEM_SIZE 0x10000000 |
---|
| 45 | |
---|
[54cb48f] | 46 | /* Needed for hot adding via PMCspan on the PCI0 local bus. |
---|
| 47 | * This is board dependent, only because mvme5500 |
---|
| 48 | * supports hot adding and has more than one local PCI |
---|
| 49 | * bus. |
---|
| 50 | */ |
---|
| 51 | #define BSP_MAX_PCI_BUS_ON_PCI0 8 |
---|
| 52 | #define BSP_MAX_PCI_BUS_ON_PCI1 2 |
---|
| 53 | #define BSP_MAX_PCI_BUS (BSP_MAX_PCI_BUS_ON_PCI0+BSP_MAX_PCI_BUS_ON_PCI1) |
---|
| 54 | |
---|
| 55 | |
---|
[ee732739] | 56 | /* The glues to Till's vmeUniverse, although the name does not |
---|
| 57 | * actually reflect the relevant architect of the MVME5500. |
---|
| 58 | * Till TODO ? : BSP_PCI_DO_EOI instead ? |
---|
| 59 | * BSP_EXT_IRQ0 instead of BSP_PCI_IRQ0 ? |
---|
| 60 | * |
---|
| 61 | */ |
---|
| 62 | #define BSP_PIC_DO_EOI inl(0xc34) /* PCI IACK */ |
---|
[7be6ad9] | 63 | #define BSP_PCI_IRQ0 BSP_GPP_IRQ_LOWEST_OFFSET |
---|
| 64 | |
---|
| 65 | /* |
---|
| 66 | * confdefs.h overrides for this BSP: |
---|
| 67 | * - termios serial ports (defaults to 1) |
---|
| 68 | * - Interrupt stack space is not minimum if defined. |
---|
| 69 | */ |
---|
| 70 | |
---|
| 71 | #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 |
---|
| 72 | |
---|
| 73 | /* uart.c uses out_8 instead of outb */ |
---|
| 74 | #define BSP_UART_IOBASE_COM1 GT64260_DEV1_BASE + 0x20000 |
---|
| 75 | #define BSP_UART_IOBASE_COM2 GT64260_DEV1_BASE + 0x21000 |
---|
| 76 | |
---|
| 77 | #define BSP_CONSOLE_PORT BSP_UART_COM1 /* console */ |
---|
| 78 | #define BSP_UART_BAUD_BASE 115200 |
---|
| 79 | |
---|
| 80 | /* |
---|
| 81 | * Vital Board data Start using DATA RESIDUAL |
---|
| 82 | */ |
---|
| 83 | /* |
---|
| 84 | * Total memory using RESIDUAL DATA |
---|
| 85 | */ |
---|
| 86 | extern unsigned int BSP_mem_size; |
---|
| 87 | /* |
---|
| 88 | * PCI Bus Frequency |
---|
| 89 | */ |
---|
| 90 | extern unsigned int BSP_bus_frequency; |
---|
| 91 | /* |
---|
| 92 | * processor clock frequency |
---|
| 93 | */ |
---|
| 94 | extern unsigned int BSP_processor_frequency; |
---|
| 95 | /* |
---|
| 96 | * Time base divisior (how many tick for 1 second). |
---|
| 97 | */ |
---|
| 98 | extern unsigned int BSP_time_base_divisor; |
---|
| 99 | |
---|
| 100 | #define BSP_Convert_decrementer( _value ) \ |
---|
| 101 | ((unsigned long long) ((((unsigned long long)BSP_time_base_divisor) * 1000000ULL) /((unsigned long long) BSP_bus_frequency)) * ((unsigned long long) (_value))) |
---|
| 102 | |
---|
| 103 | extern void BSP_panic(char *s); |
---|
[83e392b4] | 104 | extern void bsp_reset(void); |
---|
[7be6ad9] | 105 | /* extern int printk(const char *, ...) __attribute__((format(printf, 1, 2))); */ |
---|
| 106 | extern int BSP_disconnect_clock_handler (void); |
---|
| 107 | extern int BSP_connect_clock_handler (void); |
---|
| 108 | |
---|
| 109 | extern unsigned long _BSP_clear_hostbridge_errors(); |
---|
| 110 | |
---|
[ee732739] | 111 | extern unsigned int BSP_heap_start; |
---|
| 112 | |
---|
| 113 | #if 0 |
---|
[7be6ad9] | 114 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "gt1" |
---|
| 115 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_GT64260eth_driver_attach |
---|
[ee732739] | 116 | #else |
---|
| 117 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "wmG1" |
---|
| 118 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_i82544EI_driver_attach |
---|
| 119 | #endif |
---|
[7be6ad9] | 120 | |
---|
| 121 | extern int |
---|
| 122 | RTEMS_BSP_NETWORK_DRIVER_ATTACH(/* struct rtems_bsdnet_ifconfig * */); |
---|
| 123 | |
---|
[b5e7018] | 124 | /* |
---|
| 125 | * BSP Configuration Default Overrides |
---|
| 126 | */ |
---|
| 127 | #define BSP_ZERO_WORKSPACE_AUTOMATICALLY TRUE |
---|
| 128 | |
---|
[ee732739] | 129 | /* As per Linux, This should be in the ppc/system.h */ |
---|
| 130 | |
---|
| 131 | static inline void memBar() |
---|
| 132 | { |
---|
| 133 | asm volatile("sync":::"memory"); |
---|
| 134 | } |
---|
| 135 | |
---|
| 136 | static inline void ioBar() |
---|
| 137 | { |
---|
| 138 | asm volatile("eieio"); |
---|
| 139 | } |
---|
[7be6ad9] | 140 | |
---|
| 141 | #endif |
---|