Path: blob/master/arch/arm/mach-gemini/include/mach/global_reg.h
10820 views
/*1* This file contains the hardware definitions for Gemini.2*3* Copyright (C) 2009 Paulius Zaleckas <[email protected]>4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*/10#ifndef __MACH_GLOBAL_REG_H11#define __MACH_GLOBAL_REG_H1213/* Global Word ID Register*/14#define GLOBAL_ID 0x001516#define CHIP_ID(reg) ((reg) >> 8)17#define CHIP_REVISION(reg) ((reg) & 0xFF)1819/* Global Status Register */20#define GLOBAL_STATUS 0x042122#define CPU_BIG_ENDIAN (1 << 31)23#define PLL_OSC_30M (1 << 30) /* else 60MHz */2425#define OPERATION_MODE_MASK (0xF << 26)26#define OPM_IDDQ (0xF << 26)27#define OPM_NAND (0xE << 26)28#define OPM_RING (0xD << 26)29#define OPM_DIRECT_BOOT (0xC << 26)30#define OPM_USB1_PHY_TEST (0xB << 26)31#define OPM_USB0_PHY_TEST (0xA << 26)32#define OPM_SATA1_PHY_TEST (0x9 << 26)33#define OPM_SATA0_PHY_TEST (0x8 << 26)34#define OPM_ICE_ARM (0x7 << 26)35#define OPM_ICE_FARADAY (0x6 << 26)36#define OPM_PLL_BYPASS (0x5 << 26)37#define OPM_DEBUG (0x4 << 26)38#define OPM_BURN_IN (0x3 << 26)39#define OPM_MBIST (0x2 << 26)40#define OPM_SCAN (0x1 << 26)41#define OPM_REAL (0x0 << 26)4243#define FLASH_TYPE_MASK (0x3 << 24)44#define FLASH_TYPE_NAND_2K (0x3 << 24)45#define FLASH_TYPE_NAND_512 (0x2 << 24)46#define FLASH_TYPE_PARALLEL (0x1 << 24)47#define FLASH_TYPE_SERIAL (0x0 << 24)48/* if parallel */49#define FLASH_WIDTH_16BIT (1 << 23) /* else 8 bit */50/* if serial */51#define FLASH_ATMEL (1 << 23) /* else STM */5253#define FLASH_SIZE_MASK (0x3 << 21)54#define NAND_256M (0x3 << 21) /* and more */55#define NAND_128M (0x2 << 21)56#define NAND_64M (0x1 << 21)57#define NAND_32M (0x0 << 21)58#define ATMEL_16M (0x3 << 21) /* and more */59#define ATMEL_8M (0x2 << 21)60#define ATMEL_4M_2M (0x1 << 21)61#define ATMEL_1M (0x0 << 21) /* and less */62#define STM_32M (1 << 22) /* and more */63#define STM_16M (0 << 22) /* and less */6465#define FLASH_PARALLEL_HIGH_PIN_CNT (1 << 20) /* else low pin cnt */6667#define CPU_AHB_RATIO_MASK (0x3 << 18)68#define CPU_AHB_1_1 (0x0 << 18)69#define CPU_AHB_3_2 (0x1 << 18)70#define CPU_AHB_24_13 (0x2 << 18)71#define CPU_AHB_2_1 (0x3 << 18)7273#define REG_TO_AHB_SPEED(reg) ((((reg) >> 15) & 0x7) * 10 + 130)74#define AHB_SPEED_TO_REG(x) ((((x - 130)) / 10) << 15)7576/* it is posible to override some settings, use >> OVERRIDE_xxxx_SHIFT */77#define OVERRIDE_FLASH_TYPE_SHIFT 1678#define OVERRIDE_FLASH_WIDTH_SHIFT 1679#define OVERRIDE_FLASH_SIZE_SHIFT 1680#define OVERRIDE_CPU_AHB_RATIO_SHIFT 1581#define OVERRIDE_AHB_SPEED_SHIFT 158283/* Global PLL Control Register */84#define GLOBAL_PLL_CTRL 0x088586#define PLL_BYPASS (1 << 31)87#define PLL_POWER_DOWN (1 << 8)88#define PLL_CONTROL_Q (0x1F << 0)8990/* Global Soft Reset Control Register */91#define GLOBAL_RESET 0x0C9293#define RESET_GLOBAL (1 << 31)94#define RESET_CPU1 (1 << 30)95#define RESET_TVE (1 << 28)96#define RESET_SATA1 (1 << 27)97#define RESET_SATA0 (1 << 26)98#define RESET_CIR (1 << 25)99#define RESET_EXT_DEV (1 << 24)100#define RESET_WD (1 << 23)101#define RESET_GPIO2 (1 << 22)102#define RESET_GPIO1 (1 << 21)103#define RESET_GPIO0 (1 << 20)104#define RESET_SSP (1 << 19)105#define RESET_UART (1 << 18)106#define RESET_TIMER (1 << 17)107#define RESET_RTC (1 << 16)108#define RESET_INT1 (1 << 15)109#define RESET_INT0 (1 << 14)110#define RESET_LCD (1 << 13)111#define RESET_LPC (1 << 12)112#define RESET_APB (1 << 11)113#define RESET_DMA (1 << 10)114#define RESET_USB1 (1 << 9)115#define RESET_USB0 (1 << 8)116#define RESET_PCI (1 << 7)117#define RESET_GMAC1 (1 << 6)118#define RESET_GMAC0 (1 << 5)119#define RESET_SECURITY (1 << 4)120#define RESET_RAID (1 << 3)121#define RESET_IDE (1 << 2)122#define RESET_FLASH (1 << 1)123#define RESET_DRAM (1 << 0)124125/* Global IO Pad Driving Capability Control Register */126#define GLOBAL_IO_DRIVING_CTRL 0x10127128#define DRIVING_CURRENT_MASK 0x3129130/* here 00-4mA, 01-8mA, 10-12mA, 11-16mA */131#define GPIO1_PADS_31_28_SHIFT 28132#define GPIO0_PADS_31_16_SHIFT 26133#define GPIO0_PADS_15_0_SHIFT 24134#define PCI_AND_EXT_RESET_PADS_SHIFT 22135#define IDE_PADS_SHIFT 20136#define GMAC1_PADS_SHIFT 18137#define GMAC0_PADS_SHIFT 16138/* DRAM is not in mA and poorly documented */139#define DRAM_CLOCK_PADS_SHIFT 8140#define DRAM_DATA_PADS_SHIFT 4141#define DRAM_CONTROL_PADS_SHIFT 0142143/* Global IO Pad Slew Rate Control Register */144#define GLOBAL_IO_SLEW_RATE_CTRL 0x14145146#define GPIO1_PADS_31_28_SLOW (1 << 10)147#define GPIO0_PADS_31_16_SLOW (1 << 9)148#define GPIO0_PADS_15_0_SLOW (1 << 8)149#define PCI_PADS_SLOW (1 << 7)150#define IDE_PADS_SLOW (1 << 6)151#define GMAC1_PADS_SLOW (1 << 5)152#define GMAC0_PADS_SLOW (1 << 4)153#define DRAM_CLOCK_PADS_SLOW (1 << 1)154#define DRAM_IO_PADS_SLOW (1 << 0)155156/*157* General skew control defines158* 16 steps, each step is around 0.2ns159*/160#define SKEW_MASK 0xF161162/* Global IDE PAD Skew Control Register */163#define GLOBAL_IDE_SKEW_CTRL 0x18164165#define IDE1_HOST_STROBE_DELAY_SHIFT 28166#define IDE1_DEVICE_STROBE_DELAY_SHIFT 24167#define IDE1_OUTPUT_IO_SKEW_SHIFT 20168#define IDE1_INPUT_IO_SKEW_SHIFT 16169#define IDE0_HOST_STROBE_DELAY_SHIFT 12170#define IDE0_DEVICE_STROBE_DELAY_SHIFT 8171#define IDE0_OUTPUT_IO_SKEW_SHIFT 4172#define IDE0_INPUT_IO_SKEW_SHIFT 0173174/* Global GMAC Control Pad Skew Control Register */175#define GLOBAL_GMAC_CTRL_SKEW_CTRL 0x1C176177#define GMAC1_TXC_SKEW_SHIFT 28178#define GMAC1_TXEN_SKEW_SHIFT 24179#define GMAC1_RXC_SKEW_SHIFT 20180#define GMAC1_RXDV_SKEW_SHIFT 16181#define GMAC0_TXC_SKEW_SHIFT 12182#define GMAC0_TXEN_SKEW_SHIFT 8183#define GMAC0_RXC_SKEW_SHIFT 4184#define GMAC0_RXDV_SKEW_SHIFT 0185186/* Global GMAC0 Data PAD Skew Control Register */187#define GLOBAL_GMAC0_DATA_SKEW_CTRL 0x20188/* Global GMAC1 Data PAD Skew Control Register */189#define GLOBAL_GMAC1_DATA_SKEW_CTRL 0x24190191#define GMAC_TXD_SKEW_SHIFT(x) (((x) * 4) + 16)192#define GMAC_RXD_SKEW_SHIFT(x) ((x) * 4)193194/* CPU has two AHB busses. */195196/* Global Arbitration0 Control Register */197#define GLOBAL_ARBITRATION0_CTRL 0x28198199#define BOOT_CONTROLLER_HIGH_PRIO (1 << 3)200#define DMA_BUS1_HIGH_PRIO (1 << 2)201#define CPU0_HIGH_PRIO (1 << 0)202203/* Global Arbitration1 Control Register */204#define GLOBAL_ARBITRATION1_CTRL 0x2C205206#define TVE_HIGH_PRIO (1 << 9)207#define PCI_HIGH_PRIO (1 << 8)208#define USB1_HIGH_PRIO (1 << 7)209#define USB0_HIGH_PRIO (1 << 6)210#define GMAC1_HIGH_PRIO (1 << 5)211#define GMAC0_HIGH_PRIO (1 << 4)212#define SECURITY_HIGH_PRIO (1 << 3)213#define RAID_HIGH_PRIO (1 << 2)214#define IDE_HIGH_PRIO (1 << 1)215#define DMA_BUS2_HIGH_PRIO (1 << 0)216217/* Common bits for both arbitration registers */218#define BURST_LENGTH_SHIFT 16219#define BURST_LENGTH_MASK (0x3F << 16)220221/* Miscellaneous Control Register */222#define GLOBAL_MISC_CTRL 0x30223224#define MEMORY_SPACE_SWAP (1 << 31)225#define USB1_PLUG_MINIB (1 << 30) /* else plug is mini-A */226#define USB0_PLUG_MINIB (1 << 29)227#define GMAC_GMII (1 << 28)228#define GMAC_1_ENABLE (1 << 27)229/* TODO: define ATA/SATA bits */230#define USB1_VBUS_ON (1 << 23)231#define USB0_VBUS_ON (1 << 22)232#define APB_CLKOUT_ENABLE (1 << 21)233#define TVC_CLKOUT_ENABLE (1 << 20)234#define EXT_CLKIN_ENABLE (1 << 19)235#define PCI_66MHZ (1 << 18) /* else 33 MHz */236#define PCI_CLKOUT_ENABLE (1 << 17)237#define LPC_CLKOUT_ENABLE (1 << 16)238#define USB1_WAKEUP_ON (1 << 15)239#define USB0_WAKEUP_ON (1 << 14)240/* TODO: define PCI idle detect bits */241#define TVC_PADS_ENABLE (1 << 9)242#define SSP_PADS_ENABLE (1 << 8)243#define LCD_PADS_ENABLE (1 << 7)244#define LPC_PADS_ENABLE (1 << 6)245#define PCI_PADS_ENABLE (1 << 5)246#define IDE_PADS_ENABLE (1 << 4)247#define DRAM_PADS_POWER_DOWN (1 << 3)248#define NAND_PADS_DISABLE (1 << 2)249#define PFLASH_PADS_DISABLE (1 << 1)250#define SFLASH_PADS_DISABLE (1 << 0)251252/* Global Clock Control Register */253#define GLOBAL_CLOCK_CTRL 0x34254255#define POWER_STATE_G0 (1 << 31)256#define POWER_STATE_S1 (1 << 30) /* else it is S3/S4 state */257#define SECURITY_APB_AHB (1 << 29)258/* else Security APB clk will be 0.75xAHB */259/* TODO: TVC clock divider */260#define PCI_CLKRUN_ENABLE (1 << 16)261#define BOOT_CLK_DISABLE (1 << 13)262#define TVC_CLK_DISABLE (1 << 12)263#define FLASH_CLK_DISABLE (1 << 11)264#define DDR_CLK_DISABLE (1 << 10)265#define PCI_CLK_DISABLE (1 << 9)266#define IDE_CLK_DISABLE (1 << 8)267#define USB1_CLK_DISABLE (1 << 7)268#define USB0_CLK_DISABLE (1 << 6)269#define SATA1_CLK_DISABLE (1 << 5)270#define SATA0_CLK_DISABLE (1 << 4)271#define GMAC1_CLK_DISABLE (1 << 3)272#define GMAC0_CLK_DISABLE (1 << 2)273#define SECURITY_CLK_DISABLE (1 << 1)274275/* TODO: other registers definitions if needed */276277#endif /* __MACH_GLOBAL_REG_H */278279280