|
|
|
|
@@ -2,44 +2,8 @@
|
|
|
|
|
#ifndef __JZ4730_HH__
|
|
|
|
|
#define __JZ4730_HH__
|
|
|
|
|
|
|
|
|
|
#include <iris.h>
|
|
|
|
|
|
|
|
|
|
#define JZ_EXTAL 3686400
|
|
|
|
|
|
|
|
|
|
// Base addresses are the place where the pages are mapped.
|
|
|
|
|
#define HARB_BASE 0x00000000
|
|
|
|
|
#define EMC_BASE 0x00001000
|
|
|
|
|
#define DMAC_BASE 0x00002000
|
|
|
|
|
#define UHC_BASE 0x00003000
|
|
|
|
|
#define UDC_BASE 0x00004000
|
|
|
|
|
#define LCD_BASE 0x00005000
|
|
|
|
|
#define CIM_BASE 0x00006000
|
|
|
|
|
#define ETH_BASE 0x00007000
|
|
|
|
|
#define NBM_BASE 0x00008000
|
|
|
|
|
#define CPM_BASE 0x00009000
|
|
|
|
|
#define INTC_BASE 0x0000a000
|
|
|
|
|
#define OST_BASE 0x0000b000
|
|
|
|
|
#define RTC_BASE 0x0000c000
|
|
|
|
|
#define WDT_BASE 0x0000d000
|
|
|
|
|
#define GPIO_BASE 0x0000e000
|
|
|
|
|
#define AIC_BASE 0x0000f000
|
|
|
|
|
#define MSC_BASE 0x00010000
|
|
|
|
|
#define UART0_BASE 0x00011000
|
|
|
|
|
#define UART1_BASE 0x00012000
|
|
|
|
|
#define UART2_BASE 0x00013000
|
|
|
|
|
#define UART3_BASE 0x00014000
|
|
|
|
|
#define FIR_BASE 0x00015000
|
|
|
|
|
#define SCC_BASE 0x00016000
|
|
|
|
|
#define SCC0_BASE 0x00017000
|
|
|
|
|
#define I2C_BASE 0x00018000
|
|
|
|
|
#define SSI_BASE 0x00019000
|
|
|
|
|
#define SCC1_BASE 0x0001a000
|
|
|
|
|
#define PWM0_BASE 0x0001b000
|
|
|
|
|
#define PWM1_BASE 0x0001c000
|
|
|
|
|
#define DES_BASE 0x0001d000
|
|
|
|
|
#define UPRT_BASE 0x0001e000
|
|
|
|
|
#define KBC_BASE 0x0001f000
|
|
|
|
|
|
|
|
|
|
// Physical addresses are where they really are.
|
|
|
|
|
// (In kernel space you need to add 0xa0000000 to see them unmapped uncached in kseg2.)
|
|
|
|
|
#define HARB_PHYSICAL 0x13000000
|
|
|
|
|
@@ -75,6 +39,76 @@
|
|
|
|
|
#define UPRT_PHYSICAL 0x10061000
|
|
|
|
|
#define KBC_PHYSICAL 0x10062000
|
|
|
|
|
|
|
|
|
|
#ifdef __KERNEL
|
|
|
|
|
#define HARB_BASE (HARB_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define EMC_BASE (EMC_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define DMAC_BASE (DMAC_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define UHC_BASE (UHC_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define UDC_BASE (UDC_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define LCD_BASE (LCD_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define CIM_BASE (CIM_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define ETH_BASE (ETH_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define NBM_BASE (NBM_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define CPM_BASE (CPM_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define INTC_BASE (INTC_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define OST_BASE (OST_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define RTC_BASE (RTC_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define WDT_BASE (WDT_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define GPIO_BASE (GPIO_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define AIC_BASE (AIC_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define MSC_BASE (MSC_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define UART0_BASE (UART0_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define UART1_BASE (UART1_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define UART2_BASE (UART2_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define UART3_BASE (UART3_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define FIR_BASE (FIR_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define SCC_BASE (SCC_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define SCC0_BASE (SCC0_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define I2C_BASE (I2C_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define SSI_BASE (SSI_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define SCC1_BASE (SCC1_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define PWM0_BASE (PWM0_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define PWM1_BASE (PWM1_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define DES_BASE (DES_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define UPRT_BASE (UPRT_PHYSICAL + 0xa0000000)
|
|
|
|
|
#define KBC_BASE (KBC_PHYSICAL + 0xa0000000)
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
#include <iris.h>
|
|
|
|
|
// Base addresses are the place where the pages are mapped.
|
|
|
|
|
#define HARB_BASE 0x00000000
|
|
|
|
|
#define EMC_BASE 0x00001000
|
|
|
|
|
#define DMAC_BASE 0x00002000
|
|
|
|
|
#define UHC_BASE 0x00003000
|
|
|
|
|
#define UDC_BASE 0x00004000
|
|
|
|
|
#define LCD_BASE 0x00005000
|
|
|
|
|
#define CIM_BASE 0x00006000
|
|
|
|
|
#define ETH_BASE 0x00007000
|
|
|
|
|
#define NBM_BASE 0x00008000
|
|
|
|
|
#define CPM_BASE 0x00009000
|
|
|
|
|
#define INTC_BASE 0x0000a000
|
|
|
|
|
#define OST_BASE 0x0000b000
|
|
|
|
|
#define RTC_BASE 0x0000c000
|
|
|
|
|
#define WDT_BASE 0x0000d000
|
|
|
|
|
#define GPIO_BASE 0x0000e000
|
|
|
|
|
#define AIC_BASE 0x0000f000
|
|
|
|
|
#define MSC_BASE 0x00010000
|
|
|
|
|
#define UART0_BASE 0x00011000
|
|
|
|
|
#define UART1_BASE 0x00012000
|
|
|
|
|
#define UART2_BASE 0x00013000
|
|
|
|
|
#define UART3_BASE 0x00014000
|
|
|
|
|
#define FIR_BASE 0x00015000
|
|
|
|
|
#define SCC_BASE 0x00016000
|
|
|
|
|
#define SCC0_BASE 0x00017000
|
|
|
|
|
#define I2C_BASE 0x00018000
|
|
|
|
|
#define SSI_BASE 0x00019000
|
|
|
|
|
#define SCC1_BASE 0x0001a000
|
|
|
|
|
#define PWM0_BASE 0x0001b000
|
|
|
|
|
#define PWM1_BASE 0x0001c000
|
|
|
|
|
#define DES_BASE 0x0001d000
|
|
|
|
|
#define UPRT_BASE 0x0001e000
|
|
|
|
|
#define KBC_BASE 0x0001f000
|
|
|
|
|
|
|
|
|
|
// Map IO memory (requires a priviledged __my_thread capability).
|
|
|
|
|
static void __map_io (unsigned physical, unsigned mapping):
|
|
|
|
|
Capability page = memory_create_page (__my_memory)
|
|
|
|
|
@@ -83,6 +117,7 @@ static void __map_io (unsigned physical, unsigned mapping):
|
|
|
|
|
// 1 means writable.
|
|
|
|
|
memory_map (__my_memory, page, mapping, 1)
|
|
|
|
|
//drop (page)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// Physical addresses are where they really are.
|
|
|
|
|
#define map_harb() do { __map_io (HARB_PHYSICAL, HARB_BASE); } while (0)
|