Path: blob/master/arch/arm/mach-pxa/include/mach/hardware.h
10820 views
/*1* arch/arm/mach-pxa/include/mach/hardware.h2*3* Author: Nicolas Pitre4* Created: Jun 15, 20015* Copyright: MontaVista Software Inc.6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*/1112#ifndef __ASM_ARCH_HARDWARE_H13#define __ASM_ARCH_HARDWARE_H1415#include <mach/addr-map.h>1617/*18* Workarounds for at least 2 errata so far require this.19* The mapping is set in mach-pxa/generic.c.20*/21#define UNCACHED_PHYS_0 0xff00000022#define UNCACHED_ADDR UNCACHED_PHYS_02324/*25* Intel PXA2xx internal register mapping:26*27* 0x40000000 - 0x41ffffff <--> 0xf2000000 - 0xf3ffffff28* 0x44000000 - 0x45ffffff <--> 0xf4000000 - 0xf5ffffff29* 0x48000000 - 0x49ffffff <--> 0xf6000000 - 0xf7ffffff30* 0x4c000000 - 0x4dffffff <--> 0xf8000000 - 0xf9ffffff31* 0x50000000 - 0x51ffffff <--> 0xfa000000 - 0xfbffffff32* 0x54000000 - 0x55ffffff <--> 0xfc000000 - 0xfdffffff33* 0x58000000 - 0x59ffffff <--> 0xfe000000 - 0xffffffff34*35* Note that not all PXA2xx chips implement all those addresses, and the36* kernel only maps the minimum needed range of this mapping.37*/38#define io_p2v(x) (0xf2000000 + ((x) & 0x01ffffff) + (((x) & 0x1c000000) >> 1))39#define io_v2p(x) (0x3c000000 + ((x) & 0x01ffffff) + (((x) & 0x0e000000) << 1))4041#ifndef __ASSEMBLY__4243# define __REG(x) (*((volatile u32 *)io_p2v(x)))4445/* With indexed regs we don't want to feed the index through io_p2v()46especially if it is a variable, otherwise horrible code will result. */47# define __REG2(x,y) \48(*(volatile u32 *)((u32)&__REG(x) + (y)))4950# define __PREG(x) (io_v2p((u32)&(x)))5152#else5354# define __REG(x) io_p2v(x)55# define __PREG(x) io_v2p(x)5657#endif5859#ifndef __ASSEMBLY__6061#include <asm/cputype.h>6263/*64* CPU Stepping CPU_ID JTAG_ID65*66* PXA210 B0 0x69052922 0x2926C01367* PXA210 B1 0x69052923 0x3926C01368* PXA210 B2 0x69052924 0x4926C01369* PXA210 C0 0x69052D25 0x5926C01370*71* PXA250 A0 0x69052100 0x0926401372* PXA250 A1 0x69052101 0x1926401373* PXA250 B0 0x69052902 0x2926401374* PXA250 B1 0x69052903 0x3926401375* PXA250 B2 0x69052904 0x4926401376* PXA250 C0 0x69052D05 0x5926401377*78* PXA255 A0 0x69052D06 0x6926401379*80* PXA26x A0 0x69052903 0x3926401381* PXA26x B0 0x69052D05 0x5926401382*83* PXA27x A0 0x69054110 0x0926501384* PXA27x A1 0x69054111 0x1926501385* PXA27x B0 0x69054112 0x2926501386* PXA27x B1 0x69054113 0x3926501387* PXA27x C0 0x69054114 0x4926501388* PXA27x C5 0x69054117 0x7926501389*90* PXA30x A0 0x69056880 0x0E64801391* PXA30x A1 0x69056881 0x1E64801392* PXA31x A0 0x69056890 0x0E64901393* PXA31x A1 0x69056891 0x1E64901394* PXA31x A2 0x69056892 0x2E64901395* PXA32x B1 0x69056825 0x5E64201396* PXA32x B2 0x69056826 0x6E64201397*98* PXA930 B0 0x69056835 0x5E64301399* PXA930 B1 0x69056837 0x7E643013100* PXA930 B2 0x69056838 0x8E643013101*102* PXA935 A0 0x56056931 0x1E653013103* PXA935 B0 0x56056936 0x6E653013104* PXA935 B1 0x56056938 0x8E653013105*/106#ifdef CONFIG_PXA25x107#define __cpu_is_pxa210(id) \108({ \109unsigned int _id = (id) & 0xf3f0; \110_id == 0x2120; \111})112113#define __cpu_is_pxa250(id) \114({ \115unsigned int _id = (id) & 0xf3ff; \116_id <= 0x2105; \117})118119#define __cpu_is_pxa255(id) \120({ \121unsigned int _id = (id) & 0xffff; \122_id == 0x2d06; \123})124125#define __cpu_is_pxa25x(id) \126({ \127unsigned int _id = (id) & 0xf300; \128_id == 0x2100; \129})130#else131#define __cpu_is_pxa210(id) (0)132#define __cpu_is_pxa250(id) (0)133#define __cpu_is_pxa255(id) (0)134#define __cpu_is_pxa25x(id) (0)135#endif136137#ifdef CONFIG_PXA27x138#define __cpu_is_pxa27x(id) \139({ \140unsigned int _id = (id) >> 4 & 0xfff; \141_id == 0x411; \142})143#else144#define __cpu_is_pxa27x(id) (0)145#endif146147#ifdef CONFIG_CPU_PXA300148#define __cpu_is_pxa300(id) \149({ \150unsigned int _id = (id) >> 4 & 0xfff; \151_id == 0x688; \152})153#else154#define __cpu_is_pxa300(id) (0)155#endif156157#ifdef CONFIG_CPU_PXA310158#define __cpu_is_pxa310(id) \159({ \160unsigned int _id = (id) >> 4 & 0xfff; \161_id == 0x689; \162})163#else164#define __cpu_is_pxa310(id) (0)165#endif166167#ifdef CONFIG_CPU_PXA320168#define __cpu_is_pxa320(id) \169({ \170unsigned int _id = (id) >> 4 & 0xfff; \171_id == 0x603 || _id == 0x682; \172})173#else174#define __cpu_is_pxa320(id) (0)175#endif176177#ifdef CONFIG_CPU_PXA930178#define __cpu_is_pxa930(id) \179({ \180unsigned int _id = (id) >> 4 & 0xfff; \181_id == 0x683; \182})183#else184#define __cpu_is_pxa930(id) (0)185#endif186187#ifdef CONFIG_CPU_PXA935188#define __cpu_is_pxa935(id) \189({ \190unsigned int _id = (id) >> 4 & 0xfff; \191_id == 0x693; \192})193#else194#define __cpu_is_pxa935(id) (0)195#endif196197#ifdef CONFIG_CPU_PXA955198#define __cpu_is_pxa955(id) \199({ \200unsigned int _id = (id) >> 4 & 0xfff; \201_id == 0x581 || _id == 0xc08 \202|| _id == 0xb76; \203})204#else205#define __cpu_is_pxa955(id) (0)206#endif207208#define cpu_is_pxa210() \209({ \210__cpu_is_pxa210(read_cpuid_id()); \211})212213#define cpu_is_pxa250() \214({ \215__cpu_is_pxa250(read_cpuid_id()); \216})217218#define cpu_is_pxa255() \219({ \220__cpu_is_pxa255(read_cpuid_id()); \221})222223#define cpu_is_pxa25x() \224({ \225__cpu_is_pxa25x(read_cpuid_id()); \226})227228#define cpu_is_pxa27x() \229({ \230__cpu_is_pxa27x(read_cpuid_id()); \231})232233#define cpu_is_pxa300() \234({ \235__cpu_is_pxa300(read_cpuid_id()); \236})237238#define cpu_is_pxa310() \239({ \240__cpu_is_pxa310(read_cpuid_id()); \241})242243#define cpu_is_pxa320() \244({ \245__cpu_is_pxa320(read_cpuid_id()); \246})247248#define cpu_is_pxa930() \249({ \250__cpu_is_pxa930(read_cpuid_id()); \251})252253#define cpu_is_pxa935() \254({ \255__cpu_is_pxa935(read_cpuid_id()); \256})257258#define cpu_is_pxa955() \259({ \260__cpu_is_pxa955(read_cpuid_id()); \261})262263264/*265* CPUID Core Generation Bit266* <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x267*/268#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)269#define __cpu_is_pxa2xx(id) \270({ \271unsigned int _id = (id) >> 13 & 0x7; \272_id <= 0x2; \273})274#else275#define __cpu_is_pxa2xx(id) (0)276#endif277278#ifdef CONFIG_PXA3xx279#define __cpu_is_pxa3xx(id) \280({ \281__cpu_is_pxa300(id) \282|| __cpu_is_pxa310(id) \283|| __cpu_is_pxa320(id) \284|| __cpu_is_pxa93x(id); \285})286#else287#define __cpu_is_pxa3xx(id) (0)288#endif289290#if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935)291#define __cpu_is_pxa93x(id) \292({ \293__cpu_is_pxa930(id) \294|| __cpu_is_pxa935(id); \295})296#else297#define __cpu_is_pxa93x(id) (0)298#endif299300#ifdef CONFIG_PXA95x301#define __cpu_is_pxa95x(id) \302({ \303__cpu_is_pxa955(id); \304})305#else306#define __cpu_is_pxa95x(id) (0)307#endif308309#define cpu_is_pxa2xx() \310({ \311__cpu_is_pxa2xx(read_cpuid_id()); \312})313314#define cpu_is_pxa3xx() \315({ \316__cpu_is_pxa3xx(read_cpuid_id()); \317})318319#define cpu_is_pxa93x() \320({ \321__cpu_is_pxa93x(read_cpuid_id()); \322})323324#define cpu_is_pxa95x() \325({ \326__cpu_is_pxa95x(read_cpuid_id()); \327})328329/*330* return current memory and LCD clock frequency in units of 10kHz331*/332extern unsigned int get_memclk_frequency_10khz(void);333334/* return the clock tick rate of the OS timer */335extern unsigned long get_clock_tick_rate(void);336#endif337338#if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)339#define PCIBIOS_MIN_IO 0340#define PCIBIOS_MIN_MEM 0341#define pcibios_assign_all_busses() 1342#define ARCH_HAS_DMA_SET_COHERENT_MASK343#endif344345#endif /* _ASM_ARCH_HARDWARE_H */346347348