Path: blob/master/arch/arm/mach-h720x/include/mach/hardware.h
17602 views
/*1* arch/arm/mach-h720x/include/mach/hardware.h2*3* Copyright (C) 2000 Jungjun Kim, Hynix Semiconductor Inc.4* (C) 2003 Thomas Gleixner <[email protected]>5* (C) 2003 Robert Schwebel <[email protected]>6*7* This file contains the hardware definitions of the h720x processors8*9* This program is free software; you can redistribute it and/or modify10* it under the terms of the GNU General Public License version 2 as11* published by the Free Software Foundation.12*13* Do not add implementations specific defines here. This files contains14* only defines of the onchip peripherals. Add those defines to boards.h,15* which is included by this file.16*/1718#ifndef __ASM_ARCH_HARDWARE_H19#define __ASM_ARCH_HARDWARE_H2021#define IOCLK (3686400L)2223/* Onchip peripherals */2425#define IO_VIRT 0xf0000000 /* IO peripherals */26#define IO_PHYS 0x8000000027#define IO_SIZE 0x000500002829#ifdef CONFIG_CPU_H720230#include "h7202-regs.h"31#elif defined CONFIG_CPU_H720132#include "h7201-regs.h"33#else34#error machine definition mismatch35#endif3637/* Macro to access the CPU IO */38#define CPU_IO(x) (*(volatile u32*)(x))3940/* Macro to access general purpose regs (base, offset) */41#define CPU_REG(x,y) CPU_IO(x+y)4243/* Macro to access irq related regs */44#define IRQ_REG(x) CPU_REG(IRQC_VIRT,x)4546/* CPU registers */47/* general purpose I/O */48#define GPIO_VIRT(x) (IO_VIRT + 0x23000 + ((x)<<5))49#define GPIO_A_VIRT (GPIO_VIRT(0))50#define GPIO_B_VIRT (GPIO_VIRT(1))51#define GPIO_C_VIRT (GPIO_VIRT(2))52#define GPIO_D_VIRT (GPIO_VIRT(3))53#define GPIO_E_VIRT (GPIO_VIRT(4))54#define GPIO_AMULSEL (GPIO_VIRT(0) + 0xA4)5556#define AMULSEL_USIN2 (1<<5)57#define AMULSEL_USOUT2 (1<<6)58#define AMULSEL_USIN3 (1<<13)59#define AMULSEL_USOUT3 (1<<14)60#define AMULSEL_IRDIN (1<<15)61#define AMULSEL_IRDOUT (1<<7)6263/* Register offsets general purpose I/O */64#define GPIO_DATA 0x0065#define GPIO_DIR 0x0466#define GPIO_MASK 0x0867#define GPIO_STAT 0x0C68#define GPIO_EDGE 0x1069#define GPIO_CLR 0x1470#define GPIO_POL 0x1871#define GPIO_EN 0x1C7273/*interrupt controller */74#define IRQC_VIRT (IO_VIRT + 0x24000)75/* register offset interrupt controller */76#define IRQC_IER 0x0077#define IRQC_ISR 0x047879/* timer unit */80#define TIMER_VIRT (IO_VIRT + 0x25000)81/* Register offsets timer unit */82#define TM0_PERIOD 0x0083#define TM0_COUNT 0x0884#define TM0_CTRL 0x1085#define TM1_PERIOD 0x2086#define TM1_COUNT 0x2887#define TM1_CTRL 0x3088#define TM2_PERIOD 0x4089#define TM2_COUNT 0x4890#define TM2_CTRL 0x5091#define TIMER_TOPCTRL 0x6092#define TIMER_TOPSTAT 0x6493#define T64_COUNTL 0x8094#define T64_COUNTH 0x8495#define T64_CTRL 0x8896#define T64_BASEL 0x9497#define T64_BASEH 0x9898/* Bitmaks timer unit TOPSTAT reg */99#define TSTAT_T0INT 0x1100#define TSTAT_T1INT 0x2101#define TSTAT_T2INT 0x4102#define TSTAT_T3INT 0x8103/* Bit description of TMx_CTRL register */104#define TM_START 0x1105#define TM_REPEAT 0x2106#define TM_RESET 0x4107/* Bit description of TIMER_CTRL register */108#define ENABLE_TM0_INTR 0x1109#define ENABLE_TM1_INTR 0x2110#define ENABLE_TM2_INTR 0x4111#define TIMER_ENABLE_BIT 0x8112#define ENABLE_TIMER64 0x10113#define ENABLE_TIMER64_INT 0x20114115/* PMU & PLL */116#define PMU_BASE (IO_VIRT + 0x1000)117#define PMU_MODE 0x00118#define PMU_STAT 0x20119#define PMU_PLL_CTRL 0x28120121/* PMU Mode bits */122#define PMU_MODE_SLOW 0x00123#define PMU_MODE_RUN 0x01124#define PMU_MODE_IDLE 0x02125#define PMU_MODE_SLEEP 0x03126#define PMU_MODE_INIT 0x04127#define PMU_MODE_DEEPSLEEP 0x07128#define PMU_MODE_WAKEUP 0x08129130/* PMU ... */131#define PLL_2_EN 0x8000132#define PLL_1_EN 0x4000133#define PLL_3_MUTE 0x0080134135/* Control bits for PMU/ PLL */136#define PMU_WARMRESET 0x00010000137#define PLL_CTRL_MASK23 0x000080ff138139/* LCD Controller */140#define LCD_BASE (IO_VIRT + 0x10000)141#define LCD_CTRL 0x00142#define LCD_STATUS 0x04143#define LCD_STATUS_M 0x08144#define LCD_INTERRUPT 0x0C145#define LCD_DBAR 0x10146#define LCD_DCAR 0x14147#define LCD_TIMING0 0x20148#define LCD_TIMING1 0x24149#define LCD_TIMING2 0x28150#define LCD_TEST 0x40151152/* LCD Control Bits */153#define LCD_CTRL_LCD_ENABLE 0x00000001154/* Bits per pixel */155#define LCD_CTRL_LCD_BPP_MASK 0x00000006156#define LCD_CTRL_LCD_4BPP 0x00000000157#define LCD_CTRL_LCD_8BPP 0x00000002158#define LCD_CTRL_LCD_16BPP 0x00000004159#define LCD_CTRL_LCD_BW 0x00000008160#define LCD_CTRL_LCD_TFT 0x00000010161#define LCD_CTRL_BGR 0x00001000162#define LCD_CTRL_LCD_VCOMP 0x00080000163#define LCD_CTRL_LCD_MONO8 0x00200000164#define LCD_CTRL_LCD_PWR 0x00400000165#define LCD_CTRL_LCD_BLE 0x00800000166#define LCD_CTRL_LDBUSEN 0x01000000167168/* Palette */169#define LCD_PALETTE_BASE (IO_VIRT + 0x10400)170171/* Serial ports */172#define SERIAL0_OFS 0x20000173#define SERIAL0_VIRT (IO_VIRT + SERIAL0_OFS)174#define SERIAL0_BASE (IO_PHYS + SERIAL0_OFS)175176#define SERIAL1_OFS 0x21000177#define SERIAL1_VIRT (IO_VIRT + SERIAL1_OFS)178#define SERIAL1_BASE (IO_PHYS + SERIAL1_OFS)179180#define SERIAL_ENABLE 0x30181#define SERIAL_ENABLE_EN (1<<0)182183/* General defines to pacify gcc */184185#define __ASM_ARCH_HARDWARE_INCMACH_H186#include "boards.h"187#undef __ASM_ARCH_HARDWARE_INCMACH_H188189#endif /* __ASM_ARCH_HARDWARE_H */190191192