wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2003 |
Albert ARIBAUD | fa82f87 | 2011-08-04 18:45:45 +0200 | [diff] [blame] | 3 | * David Müller ELSOFT AG Switzerland. d.mueller@elsoft.ch |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
wdenk | 13f9bf1 | 2002-07-15 06:49:56 +0000 | [diff] [blame] | 8 | /************************************************ |
| 9 | * NAME : s3c2400.h |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 10 | * Version : 31.3.2003 |
wdenk | 13f9bf1 | 2002-07-15 06:49:56 +0000 | [diff] [blame] | 11 | * |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 12 | * Based on S3C2400X User's manual Rev 1.1 |
wdenk | 13f9bf1 | 2002-07-15 06:49:56 +0000 | [diff] [blame] | 13 | ************************************************/ |
| 14 | |
| 15 | #ifndef __S3C2400_H__ |
| 16 | #define __S3C2400_H__ |
| 17 | |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 18 | #define S3C24X0_UART_CHANNELS 2 |
| 19 | #define S3C24X0_SPI_CHANNELS 1 |
| 20 | #define PALETTE (0x14A00400) /* SJS */ |
| 21 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 22 | enum s3c24x0_uarts_nr { |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 23 | S3C24X0_UART0, |
| 24 | S3C24X0_UART1, |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 25 | }; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 26 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 27 | /*S3C2400 device base addresses */ |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 28 | #define S3C24X0_MEMCTL_BASE 0x14000000 |
| 29 | #define S3C24X0_USB_HOST_BASE 0x14200000 |
| 30 | #define S3C24X0_INTERRUPT_BASE 0x14400000 |
| 31 | #define S3C24X0_DMA_BASE 0x14600000 |
| 32 | #define S3C24X0_CLOCK_POWER_BASE 0x14800000 |
| 33 | #define S3C24X0_LCD_BASE 0x14A00000 |
| 34 | #define S3C24X0_UART_BASE 0x15000000 |
| 35 | #define S3C24X0_TIMER_BASE 0x15100000 |
| 36 | #define S3C24X0_USB_DEVICE_BASE 0x15200140 |
| 37 | #define S3C24X0_WATCHDOG_BASE 0x15300000 |
| 38 | #define S3C24X0_I2C_BASE 0x15400000 |
| 39 | #define S3C24X0_I2S_BASE 0x15508000 |
| 40 | #define S3C24X0_GPIO_BASE 0x15600000 |
| 41 | #define S3C24X0_RTC_BASE 0x15700000 |
| 42 | #define S3C24X0_ADC_BASE 0x15800000 |
| 43 | #define S3C24X0_SPI_BASE 0x15900000 |
| 44 | #define S3C2400_MMC_BASE 0x15A00000 |
| 45 | |
| 46 | /* include common stuff */ |
kevin.morfitt@fearnside-systems.co.uk | 492fb1f | 2009-11-03 18:08:41 +0900 | [diff] [blame] | 47 | #include <asm/arch/s3c24x0.h> |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 48 | |
| 49 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 50 | static inline struct s3c24x0_memctl *s3c24x0_get_base_memctl(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 51 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 52 | return (struct s3c24x0_memctl *)S3C24X0_MEMCTL_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 53 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 54 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 55 | static inline struct s3c24x0_usb_host *s3c24x0_get_base_usb_host(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 56 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 57 | return (struct s3c24x0_usb_host *)S3C24X0_USB_HOST_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 58 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 59 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 60 | static inline struct s3c24x0_interrupt *s3c24x0_get_base_interrupt(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 61 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 62 | return (struct s3c24x0_interrupt *)S3C24X0_INTERRUPT_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 63 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 64 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 65 | static inline struct s3c24x0_dmas *s3c24x0_get_base_dmas(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 66 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 67 | return (struct s3c24x0_dmas *)S3C24X0_DMA_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 68 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 69 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 70 | static inline struct s3c24x0_clock_power *s3c24x0_get_base_clock_power(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 71 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 72 | return (struct s3c24x0_clock_power *)S3C24X0_CLOCK_POWER_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 73 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 74 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 75 | static inline struct s3c24x0_lcd *s3c24x0_get_base_lcd(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 76 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 77 | return (struct s3c24x0_lcd *)S3C24X0_LCD_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 78 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 79 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 80 | static inline struct s3c24x0_uart |
| 81 | *s3c24x0_get_base_uart(enum s3c24x0_uarts_nr n) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 82 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 83 | return (struct s3c24x0_uart *)(S3C24X0_UART_BASE + (n * 0x4000)); |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 84 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 85 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 86 | static inline struct s3c24x0_timers *s3c24x0_get_base_timers(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 87 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 88 | return (struct s3c24x0_timers *)S3C24X0_TIMER_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 89 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 90 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 91 | static inline struct s3c24x0_usb_device *s3c24x0_get_base_usb_device(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 92 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 93 | return (struct s3c24x0_usb_device *)S3C24X0_USB_DEVICE_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 94 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 95 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 96 | static inline struct s3c24x0_watchdog *s3c24x0_get_base_watchdog(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 97 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 98 | return (struct s3c24x0_watchdog *)S3C24X0_WATCHDOG_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 99 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 100 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 101 | static inline struct s3c24x0_i2c *s3c24x0_get_base_i2c(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 102 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 103 | return (struct s3c24x0_i2c *)S3C24X0_I2C_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 104 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 105 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 106 | static inline struct s3c24x0_i2s *s3c24x0_get_base_i2s(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 107 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 108 | return (struct s3c24x0_i2s *)S3C24X0_I2S_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 109 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 110 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 111 | static inline struct s3c24x0_gpio *s3c24x0_get_base_gpio(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 112 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 113 | return (struct s3c24x0_gpio *)S3C24X0_GPIO_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 114 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 115 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 116 | static inline struct s3c24x0_rtc *s3c24x0_get_base_rtc(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 117 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 118 | return (struct s3c24x0_rtc *)S3C24X0_RTC_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 119 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 120 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 121 | static inline struct s3c2400_adc *s3c2400_get_base_adc(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 122 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 123 | return (struct s3c2400_adc *)S3C24X0_ADC_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 124 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 125 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 126 | static inline struct s3c24x0_spi *s3c24x0_get_base_spi(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 127 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 128 | return (struct s3c24x0_spi *)S3C24X0_SPI_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 129 | } |
kevin.morfitt@fearnside-systems.co.uk | 9ebfdc2 | 2009-11-04 17:49:31 +0900 | [diff] [blame] | 130 | |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 131 | static inline struct s3c2400_mmc *s3c2400_get_base_mmc(void) |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 132 | { |
kevin.morfitt@fearnside-systems.co.uk | 8250d0b | 2009-10-10 13:32:01 +0900 | [diff] [blame] | 133 | return (struct s3c2400_mmc *)S3C2400_MMC_BASE; |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 134 | } |
| 135 | |
wdenk | 13f9bf1 | 2002-07-15 06:49:56 +0000 | [diff] [blame] | 136 | #endif /*__S3C2400_H__*/ |