mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 09:41:54 +09:00
Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/macintosh/adbhid.c
This commit is contained in:
@@ -486,6 +486,8 @@
|
||||
#define ACPI_FUNCTION_NAME(name)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_FUNC_TRACE
|
||||
|
||||
#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
|
||||
acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
|
||||
#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
|
||||
@@ -563,6 +565,27 @@
|
||||
|
||||
#endif /* ACPI_SIMPLE_RETURN_MACROS */
|
||||
|
||||
#else /* !DEBUG_FUNC_TRACE */
|
||||
|
||||
#define ACPI_FUNCTION_TRACE(a)
|
||||
#define ACPI_FUNCTION_TRACE_PTR(a,b)
|
||||
#define ACPI_FUNCTION_TRACE_U32(a,b)
|
||||
#define ACPI_FUNCTION_TRACE_STR(a,b)
|
||||
#define ACPI_FUNCTION_EXIT
|
||||
#define ACPI_FUNCTION_STATUS_EXIT(s)
|
||||
#define ACPI_FUNCTION_VALUE_EXIT(s)
|
||||
#define ACPI_FUNCTION_TRACE(a)
|
||||
#define ACPI_FUNCTION_ENTRY()
|
||||
|
||||
#define return_VOID return
|
||||
#define return_ACPI_STATUS(s) return(s)
|
||||
#define return_VALUE(s) return(s)
|
||||
#define return_UINT8(s) return(s)
|
||||
#define return_UINT32(s) return(s)
|
||||
#define return_PTR(s) return(s)
|
||||
|
||||
#endif /* DEBUG_FUNC_TRACE */
|
||||
|
||||
/* Conditional execution */
|
||||
|
||||
#define ACPI_DEBUG_EXEC(a) a
|
||||
@@ -599,26 +622,26 @@
|
||||
#define ACPI_DEBUG_EXEC(a)
|
||||
#define ACPI_NORMAL_EXEC(a) a;
|
||||
|
||||
#define ACPI_DEBUG_DEFINE(a)
|
||||
#define ACPI_DEBUG_ONLY_MEMBERS(a)
|
||||
#define ACPI_FUNCTION_NAME(a)
|
||||
#define ACPI_FUNCTION_TRACE(a)
|
||||
#define ACPI_FUNCTION_TRACE_PTR(a,b)
|
||||
#define ACPI_FUNCTION_TRACE_U32(a,b)
|
||||
#define ACPI_FUNCTION_TRACE_STR(a,b)
|
||||
#define ACPI_FUNCTION_EXIT
|
||||
#define ACPI_FUNCTION_STATUS_EXIT(s)
|
||||
#define ACPI_FUNCTION_VALUE_EXIT(s)
|
||||
#define ACPI_FUNCTION_ENTRY()
|
||||
#define ACPI_DUMP_STACK_ENTRY(a)
|
||||
#define ACPI_DUMP_OPERANDS(a,b,c,d,e)
|
||||
#define ACPI_DUMP_ENTRY(a,b)
|
||||
#define ACPI_DUMP_TABLES(a,b)
|
||||
#define ACPI_DUMP_PATHNAME(a,b,c,d)
|
||||
#define ACPI_DUMP_RESOURCE_LIST(a)
|
||||
#define ACPI_DUMP_BUFFER(a,b)
|
||||
#define ACPI_DEBUG_PRINT(pl)
|
||||
#define ACPI_DEBUG_PRINT_RAW(pl)
|
||||
#define ACPI_DEBUG_DEFINE(a) do { } while(0)
|
||||
#define ACPI_DEBUG_ONLY_MEMBERS(a) do { } while(0)
|
||||
#define ACPI_FUNCTION_NAME(a) do { } while(0)
|
||||
#define ACPI_FUNCTION_TRACE(a) do { } while(0)
|
||||
#define ACPI_FUNCTION_TRACE_PTR(a,b) do { } while(0)
|
||||
#define ACPI_FUNCTION_TRACE_U32(a,b) do { } while(0)
|
||||
#define ACPI_FUNCTION_TRACE_STR(a,b) do { } while(0)
|
||||
#define ACPI_FUNCTION_EXIT do { } while(0)
|
||||
#define ACPI_FUNCTION_STATUS_EXIT(s) do { } while(0)
|
||||
#define ACPI_FUNCTION_VALUE_EXIT(s) do { } while(0)
|
||||
#define ACPI_FUNCTION_ENTRY() do { } while(0)
|
||||
#define ACPI_DUMP_STACK_ENTRY(a) do { } while(0)
|
||||
#define ACPI_DUMP_OPERANDS(a,b,c,d,e) do { } while(0)
|
||||
#define ACPI_DUMP_ENTRY(a,b) do { } while(0)
|
||||
#define ACPI_DUMP_TABLES(a,b) do { } while(0)
|
||||
#define ACPI_DUMP_PATHNAME(a,b,c,d) do { } while(0)
|
||||
#define ACPI_DUMP_RESOURCE_LIST(a) do { } while(0)
|
||||
#define ACPI_DUMP_BUFFER(a,b) do { } while(0)
|
||||
#define ACPI_DEBUG_PRINT(pl) do { } while(0)
|
||||
#define ACPI_DEBUG_PRINT_RAW(pl) do { } while(0)
|
||||
|
||||
#define return_VOID return
|
||||
#define return_ACPI_STATUS(s) return(s)
|
||||
|
||||
@@ -178,8 +178,8 @@
|
||||
|
||||
/* Defaults for debug_level, debug and normal */
|
||||
|
||||
#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT)
|
||||
#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT)
|
||||
#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR)
|
||||
#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR)
|
||||
#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
|
||||
|
||||
#endif /* __ACOUTPUT_H__ */
|
||||
|
||||
@@ -131,7 +131,7 @@ struct acpi_device_ops {
|
||||
struct acpi_driver {
|
||||
char name[80];
|
||||
char class[80];
|
||||
char *ids; /* Supported Hardware IDs */
|
||||
const struct acpi_device_id *ids; /* Supported Hardware IDs */
|
||||
struct acpi_device_ops ops;
|
||||
struct device_driver drv;
|
||||
struct module *owner;
|
||||
@@ -321,7 +321,7 @@ struct acpi_bus_event {
|
||||
};
|
||||
|
||||
extern struct kset acpi_subsys;
|
||||
|
||||
extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
|
||||
/*
|
||||
* External Functions
|
||||
*/
|
||||
@@ -331,8 +331,13 @@ void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context);
|
||||
int acpi_bus_get_status(struct acpi_device *device);
|
||||
int acpi_bus_get_power(acpi_handle handle, int *state);
|
||||
int acpi_bus_set_power(acpi_handle handle, int state);
|
||||
int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data);
|
||||
#ifdef CONFIG_ACPI_PROC_EVENT
|
||||
int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
|
||||
int acpi_bus_receive_event(struct acpi_bus_event *event);
|
||||
#else
|
||||
static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
|
||||
{ return 0; }
|
||||
#endif
|
||||
int acpi_bus_register_driver(struct acpi_driver *driver);
|
||||
void acpi_bus_unregister_driver(struct acpi_driver *driver);
|
||||
int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
|
||||
@@ -340,7 +345,8 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
|
||||
int acpi_bus_trim(struct acpi_device *start, int rmdevice);
|
||||
int acpi_bus_start(struct acpi_device *device);
|
||||
acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
|
||||
int acpi_match_ids(struct acpi_device *device, char *ids);
|
||||
int acpi_match_device_ids(struct acpi_device *device,
|
||||
const struct acpi_device_id *ids);
|
||||
int acpi_create_dir(struct acpi_device *);
|
||||
void acpi_remove_dir(struct acpi_device *);
|
||||
|
||||
@@ -364,6 +370,17 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer);
|
||||
acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
|
||||
#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
int acpi_pm_device_sleep_state(struct device *, int, int *);
|
||||
#else /* !CONFIG_PM_SLEEP */
|
||||
static inline int acpi_pm_device_sleep_state(struct device *d, int w, int *p)
|
||||
{
|
||||
if (p)
|
||||
*p = ACPI_STATE_D0;
|
||||
return ACPI_STATE_D3;
|
||||
}
|
||||
#endif /* !CONFIG_PM_SLEEP */
|
||||
|
||||
#endif /* CONFIG_ACPI */
|
||||
|
||||
#endif /*__ACPI_BUS_H__*/
|
||||
|
||||
@@ -34,16 +34,21 @@
|
||||
#define ACPI_BUS_COMPONENT 0x00010000
|
||||
#define ACPI_SYSTEM_COMPONENT 0x02000000
|
||||
|
||||
/* _HID definitions */
|
||||
/*
|
||||
* _HID definitions
|
||||
* HIDs must conform to ACPI spec(6.1.4)
|
||||
* Linux specific HIDs do not apply to this and begin with LNX:
|
||||
*/
|
||||
|
||||
#define ACPI_POWER_HID "power_resource"
|
||||
#define ACPI_POWER_HID "LNXPOWER"
|
||||
#define ACPI_PROCESSOR_HID "ACPI0007"
|
||||
#define ACPI_SYSTEM_HID "acpi_system"
|
||||
#define ACPI_THERMAL_HID "thermal"
|
||||
#define ACPI_BUTTON_HID_POWERF "button_power"
|
||||
#define ACPI_BUTTON_HID_SLEEPF "button_sleep"
|
||||
#define ACPI_VIDEO_HID "video"
|
||||
#define ACPI_BAY_HID "bay"
|
||||
#define ACPI_SYSTEM_HID "LNXSYSTM"
|
||||
#define ACPI_THERMAL_HID "LNXTHERM"
|
||||
#define ACPI_BUTTON_HID_POWERF "LNXPWRBN"
|
||||
#define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN"
|
||||
#define ACPI_VIDEO_HID "LNXVIDEO"
|
||||
#define ACPI_BAY_HID "LNXIOBAY"
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
PCI
|
||||
-------------------------------------------------------------------------- */
|
||||
@@ -142,10 +147,6 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle)
|
||||
/*--------------------------------------------------------------------------
|
||||
Suspend/Resume
|
||||
-------------------------------------------------------------------------- */
|
||||
#ifdef CONFIG_ACPI_SLEEP
|
||||
extern int acpi_sleep_init(void);
|
||||
#else
|
||||
#define acpi_sleep_init() do {} while (0)
|
||||
#endif
|
||||
|
||||
#endif /*__ACPI_DRIVERS_H__*/
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
extern int pxm_to_node(int);
|
||||
extern int node_to_pxm(int);
|
||||
extern void __acpi_map_pxm_to_node(int, int);
|
||||
extern int acpi_map_pxm_to_node(int);
|
||||
extern void __cpuinit acpi_unmap_pxm_to_node(int);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ acpi_walk_namespace(acpi_object_type type,
|
||||
void *context, void **return_value);
|
||||
|
||||
acpi_status
|
||||
acpi_get_devices(char *HID,
|
||||
acpi_get_devices(const char *HID,
|
||||
acpi_walk_callback user_function,
|
||||
void *context, void **return_value);
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ struct acpi_init_walk_info {
|
||||
struct acpi_get_devices_info {
|
||||
acpi_walk_callback user_function;
|
||||
void *context;
|
||||
char *hid;
|
||||
const char *hid;
|
||||
};
|
||||
|
||||
union acpi_aml_operands {
|
||||
|
||||
@@ -809,7 +809,7 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle,
|
||||
|
||||
/* Common string version of device HIDs and UIDs */
|
||||
|
||||
struct acpi_device_id {
|
||||
struct acpica_device_id {
|
||||
char value[ACPI_DEVICE_ID_LENGTH];
|
||||
};
|
||||
|
||||
@@ -859,8 +859,8 @@ struct acpi_device_info {
|
||||
u32 valid; /* Indicates which fields below are valid */
|
||||
u32 current_status; /* _STA value */
|
||||
acpi_integer address; /* _ADR value if any */
|
||||
struct acpi_device_id hardware_id; /* _HID value if any */
|
||||
struct acpi_device_id unique_id; /* _UID value if any */
|
||||
struct acpica_device_id hardware_id; /* _HID value if any */
|
||||
struct acpica_device_id unique_id; /* _UID value if any */
|
||||
u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
|
||||
struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */
|
||||
};
|
||||
|
||||
@@ -354,7 +354,7 @@ acpi_ut_evaluate_numeric_object(char *object_name,
|
||||
|
||||
acpi_status
|
||||
acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
|
||||
struct acpi_device_id *hid);
|
||||
struct acpica_device_id *hid);
|
||||
|
||||
acpi_status
|
||||
acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
|
||||
@@ -366,7 +366,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node,
|
||||
|
||||
acpi_status
|
||||
acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
|
||||
struct acpi_device_id *uid);
|
||||
struct acpica_device_id *uid);
|
||||
|
||||
acpi_status
|
||||
acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest);
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
/*! [Begin] no source code translation */
|
||||
|
||||
#if defined(__linux__)
|
||||
#if defined(_LINUX) || defined(__linux__)
|
||||
#include "aclinux.h"
|
||||
|
||||
#elif defined(_AED_EFI)
|
||||
|
||||
@@ -91,7 +91,10 @@
|
||||
#define ACPI_USE_NATIVE_DIVIDE
|
||||
#endif
|
||||
|
||||
#ifndef __cdecl
|
||||
#define __cdecl
|
||||
#endif
|
||||
|
||||
#define ACPI_FLUSH_CPU_CACHE()
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#define ACPI_PSD_REV0_REVISION 0 /* Support for _PSD as in ACPI 3.0 */
|
||||
#define ACPI_PSD_REV0_ENTRIES 5
|
||||
|
||||
#define ACPI_TSD_REV0_REVISION 0 /* Support for _PSD as in ACPI 3.0 */
|
||||
#define ACPI_TSD_REV0_ENTRIES 5
|
||||
/*
|
||||
* Types of coordination defined in ACPI 3.0. Same macros can be used across
|
||||
* P, C and T states
|
||||
@@ -125,17 +127,53 @@ struct acpi_processor_performance {
|
||||
|
||||
/* Throttling Control */
|
||||
|
||||
struct acpi_tsd_package {
|
||||
acpi_integer num_entries;
|
||||
acpi_integer revision;
|
||||
acpi_integer domain;
|
||||
acpi_integer coord_type;
|
||||
acpi_integer num_processors;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_ptc_register {
|
||||
u8 descriptor;
|
||||
u16 length;
|
||||
u8 space_id;
|
||||
u8 bit_width;
|
||||
u8 bit_offset;
|
||||
u8 reserved;
|
||||
u64 address;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_processor_tx_tss {
|
||||
acpi_integer freqpercentage; /* */
|
||||
acpi_integer power; /* milliWatts */
|
||||
acpi_integer transition_latency; /* microseconds */
|
||||
acpi_integer control; /* control value */
|
||||
acpi_integer status; /* success indicator */
|
||||
};
|
||||
struct acpi_processor_tx {
|
||||
u16 power;
|
||||
u16 performance;
|
||||
};
|
||||
|
||||
struct acpi_processor;
|
||||
struct acpi_processor_throttling {
|
||||
int state;
|
||||
unsigned int state;
|
||||
unsigned int platform_limit;
|
||||
struct acpi_pct_register control_register;
|
||||
struct acpi_pct_register status_register;
|
||||
unsigned int state_count;
|
||||
struct acpi_processor_tx_tss *states_tss;
|
||||
struct acpi_tsd_package domain_info;
|
||||
cpumask_t shared_cpu_map;
|
||||
int (*acpi_processor_get_throttling) (struct acpi_processor * pr);
|
||||
int (*acpi_processor_set_throttling) (struct acpi_processor * pr,
|
||||
int state);
|
||||
|
||||
u32 address;
|
||||
u8 duty_offset;
|
||||
u8 duty_width;
|
||||
int state_count;
|
||||
struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING];
|
||||
};
|
||||
|
||||
@@ -169,6 +207,9 @@ struct acpi_processor {
|
||||
u32 id;
|
||||
u32 pblk;
|
||||
int performance_platform_limit;
|
||||
int throttling_platform_limit;
|
||||
/* 0 - states 0..n-th state available */
|
||||
|
||||
struct acpi_processor_flags flags;
|
||||
struct acpi_processor_power power;
|
||||
struct acpi_processor_performance *performance;
|
||||
@@ -191,7 +232,7 @@ struct acpi_processor_errata {
|
||||
|
||||
extern int acpi_processor_preregister_performance(struct
|
||||
acpi_processor_performance
|
||||
**performance);
|
||||
*performance);
|
||||
|
||||
extern int acpi_processor_register_performance(struct acpi_processor_performance
|
||||
*performance, unsigned int cpu);
|
||||
@@ -270,7 +311,7 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
|
||||
|
||||
/* in processor_throttling.c */
|
||||
int acpi_processor_get_throttling_info(struct acpi_processor *pr);
|
||||
int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
|
||||
extern int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
|
||||
extern struct file_operations acpi_processor_throttling_fops;
|
||||
|
||||
/* in processor_idle.c */
|
||||
@@ -279,6 +320,8 @@ int acpi_processor_power_init(struct acpi_processor *pr,
|
||||
int acpi_processor_cst_has_changed(struct acpi_processor *pr);
|
||||
int acpi_processor_power_exit(struct acpi_processor *pr,
|
||||
struct acpi_device *device);
|
||||
int acpi_processor_suspend(struct acpi_device * device, pm_message_t state);
|
||||
int acpi_processor_resume(struct acpi_device * device);
|
||||
|
||||
/* in processor_thermal.c */
|
||||
int acpi_processor_get_limit_info(struct acpi_processor *pr);
|
||||
|
||||
@@ -101,6 +101,8 @@ struct exec
|
||||
#define STACK_TOP \
|
||||
(current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
|
||||
|
||||
#define STACK_TOP_MAX 0x00120000000UL
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __A_OUT_GNU_H__ */
|
||||
|
||||
@@ -324,7 +324,7 @@ static inline int fls64(unsigned long x)
|
||||
{
|
||||
unsigned long t, a, r;
|
||||
|
||||
t = __kernel_cmpbge (x, 0x0101010101010101);
|
||||
t = __kernel_cmpbge (x, 0x0101010101010101UL);
|
||||
a = __flsm1_tab[t];
|
||||
t = __kernel_extbl (x, a);
|
||||
r = a*8 + __flsm1_tab[t] + (x != 0);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#define O_LARGEFILE 0400000 /* will be set by the kernel on every open */
|
||||
#define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */
|
||||
#define O_NOATIME 04000000
|
||||
#define O_CLOEXEC 010000000 /* set close_on_exec */
|
||||
|
||||
#define F_GETLK 7
|
||||
#define F_SETLK 8
|
||||
|
||||
@@ -85,10 +85,6 @@ static __inline__ int irq_canonicalize(int irq)
|
||||
return ((irq == 2) ? 9 : irq);
|
||||
}
|
||||
|
||||
extern void disable_irq(unsigned int);
|
||||
extern void disable_irq_nosync(unsigned int);
|
||||
extern void enable_irq(unsigned int);
|
||||
|
||||
struct pt_regs;
|
||||
extern void (*perf_irq)(unsigned long, struct pt_regs *);
|
||||
|
||||
|
||||
@@ -139,16 +139,6 @@ extern void halt(void) __attribute__((noreturn));
|
||||
struct task_struct;
|
||||
extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*);
|
||||
|
||||
/*
|
||||
* On SMP systems, when the scheduler does migration-cost autodetection,
|
||||
* it needs a way to flush as much of the CPU's caches as possible.
|
||||
*
|
||||
* TODO: fill this in!
|
||||
*/
|
||||
static inline void sched_cacheflush(void)
|
||||
{
|
||||
}
|
||||
|
||||
#define imb() \
|
||||
__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
|
||||
|
||||
|
||||
@@ -67,28 +67,24 @@ register struct thread_info *__current_thread_info __asm__("$8");
|
||||
* TIF_SYSCALL_TRACE is known to be 0 via blbs.
|
||||
*/
|
||||
#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
|
||||
#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
|
||||
#define TIF_SIGPENDING 2 /* signal pending */
|
||||
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
|
||||
#define TIF_POLLING_NRFLAG 4 /* poll_idle is polling NEED_RESCHED */
|
||||
#define TIF_DIE_IF_KERNEL 5 /* dik recursion lock */
|
||||
#define TIF_UAC_NOPRINT 6 /* see sysinfo.h */
|
||||
#define TIF_UAC_NOFIX 7
|
||||
#define TIF_UAC_SIGBUS 8
|
||||
#define TIF_MEMDIE 9
|
||||
#define TIF_RESTORE_SIGMASK 10 /* restore signal mask in do_signal */
|
||||
#define TIF_SIGPENDING 1 /* signal pending */
|
||||
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
|
||||
#define TIF_POLLING_NRFLAG 3 /* poll_idle is polling NEED_RESCHED */
|
||||
#define TIF_DIE_IF_KERNEL 4 /* dik recursion lock */
|
||||
#define TIF_UAC_NOPRINT 5 /* see sysinfo.h */
|
||||
#define TIF_UAC_NOFIX 6
|
||||
#define TIF_UAC_SIGBUS 7
|
||||
#define TIF_MEMDIE 8
|
||||
#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
|
||||
|
||||
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
|
||||
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
|
||||
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
|
||||
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
|
||||
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
|
||||
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
|
||||
|
||||
/* Work to do on interrupt/exception return. */
|
||||
#define _TIF_WORK_MASK (_TIF_NOTIFY_RESUME \
|
||||
| _TIF_SIGPENDING \
|
||||
| _TIF_NEED_RESCHED)
|
||||
#define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
|
||||
|
||||
/* Work to do on any return to userspace. */
|
||||
#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \
|
||||
|
||||
@@ -30,6 +30,7 @@ struct exec
|
||||
#ifdef __KERNEL__
|
||||
#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \
|
||||
TASK_SIZE : TASK_SIZE_26)
|
||||
#define STACK_TOP_MAX TASK_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef LIBRARY_START_TEXT
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
#define AT91_MCI_MR 0x04 /* Mode Register */
|
||||
#define AT91_MCI_CLKDIV (0xff << 0) /* Clock Divider */
|
||||
#define AT91_MCI_PWSDIV (7 << 8) /* Power Saving Divider */
|
||||
#define AT91_MCI_RDPROOF (1 << 11) /* Read Proof Enable [SAM926[03] only] */
|
||||
#define AT91_MCI_WRPROOF (1 << 12) /* Write Proof Enable [SAM926[03] only] */
|
||||
#define AT91_MCI_PDCFBYTE (1 << 13) /* PDC Force Byte Transfer [SAM926[03] only] */
|
||||
#define AT91_MCI_PDCPADV (1 << 14) /* PDC Padding Value */
|
||||
#define AT91_MCI_PDCMODE (1 << 15) /* PDC-orientated Mode */
|
||||
#define AT91_MCI_BLKLEN (0xfff << 18) /* Data Block Length */
|
||||
|
||||
@@ -42,4 +42,7 @@
|
||||
*/
|
||||
#define NR_IRQS (NR_AIC_IRQS + (5 * 32))
|
||||
|
||||
/* FIQ is AIC source 0. */
|
||||
#define FIQ_START AT91_ID_FIQ
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
|
||||
#include <linux/mmc/host.h>
|
||||
|
||||
struct device;
|
||||
|
||||
struct imxmmc_platform_data {
|
||||
int (*card_present)(void);
|
||||
int (*card_present)(struct device *);
|
||||
int (*get_ro)(struct device *);
|
||||
};
|
||||
|
||||
extern void imx_set_mmc_info(struct imxmmc_platform_data *info);
|
||||
|
||||
@@ -19,6 +19,39 @@ static inline int iop13xx_cpu_id(void)
|
||||
return id;
|
||||
}
|
||||
|
||||
/* WDTCR CP6 R7 Page 9 */
|
||||
static inline u32 read_wdtcr(void)
|
||||
{
|
||||
u32 val;
|
||||
asm volatile("mrc p6, 0, %0, c7, c9, 0":"=r" (val));
|
||||
return val;
|
||||
}
|
||||
static inline void write_wdtcr(u32 val)
|
||||
{
|
||||
asm volatile("mcr p6, 0, %0, c7, c9, 0"::"r" (val));
|
||||
}
|
||||
|
||||
/* WDTSR CP6 R8 Page 9 */
|
||||
static inline u32 read_wdtsr(void)
|
||||
{
|
||||
u32 val;
|
||||
asm volatile("mrc p6, 0, %0, c8, c9, 0":"=r" (val));
|
||||
return val;
|
||||
}
|
||||
static inline void write_wdtsr(u32 val)
|
||||
{
|
||||
asm volatile("mcr p6, 0, %0, c8, c9, 0"::"r" (val));
|
||||
}
|
||||
|
||||
/* RCSR - Reset Cause Status Register */
|
||||
static inline u32 read_rcsr(void)
|
||||
{
|
||||
u32 val;
|
||||
asm volatile("mrc p6, 0, %0, c0, c1, 0":"=r" (val));
|
||||
return val;
|
||||
}
|
||||
|
||||
extern unsigned long get_iop_tick_rate(void);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -480,4 +513,14 @@ static inline int iop13xx_cpu_id(void)
|
||||
#define IOP13XX_PBI_LR1 IOP13XX_PBI_OFFSET(0x14)
|
||||
|
||||
#define IOP13XX_PROCESSOR_FREQ IOP13XX_REG_ADDR32(0x2180)
|
||||
|
||||
/* Watchdog timer definitions */
|
||||
#define IOP_WDTCR_EN_ARM 0x1e1e1e1e
|
||||
#define IOP_WDTCR_EN 0xe1e1e1e1
|
||||
#define IOP_WDTCR_DIS_ARM 0x1f1f1f1f
|
||||
#define IOP_WDTCR_DIS 0xf1f1f1f1
|
||||
#define IOP_RCSR_WDT (1 << 5) /* reset caused by watchdog timer */
|
||||
#define IOP13XX_WDTSR_WRITE_EN (1 << 31) /* used to speed up reset requests */
|
||||
#define IOP13XX_WDTCR_IB_RESET (1 << 0)
|
||||
|
||||
#endif /* _IOP13XX_HW_H_ */
|
||||
|
||||
@@ -13,43 +13,13 @@ static inline void arch_idle(void)
|
||||
cpu_do_idle();
|
||||
}
|
||||
|
||||
/* WDTCR CP6 R7 Page 9 */
|
||||
static inline u32 read_wdtcr(void)
|
||||
{
|
||||
u32 val;
|
||||
asm volatile("mrc p6, 0, %0, c7, c9, 0":"=r" (val));
|
||||
return val;
|
||||
}
|
||||
static inline void write_wdtcr(u32 val)
|
||||
{
|
||||
asm volatile("mcr p6, 0, %0, c7, c9, 0"::"r" (val));
|
||||
}
|
||||
|
||||
/* WDTSR CP6 R8 Page 9 */
|
||||
static inline u32 read_wdtsr(void)
|
||||
{
|
||||
u32 val;
|
||||
asm volatile("mrc p6, 0, %0, c8, c9, 0":"=r" (val));
|
||||
return val;
|
||||
}
|
||||
static inline void write_wdtsr(u32 val)
|
||||
{
|
||||
asm volatile("mcr p6, 0, %0, c8, c9, 0"::"r" (val));
|
||||
}
|
||||
|
||||
#define IOP13XX_WDTCR_EN_ARM 0x1e1e1e1e
|
||||
#define IOP13XX_WDTCR_EN 0xe1e1e1e1
|
||||
#define IOP13XX_WDTCR_DIS_ARM 0x1f1f1f1f
|
||||
#define IOP13XX_WDTCR_DIS 0xf1f1f1f1
|
||||
#define IOP13XX_WDTSR_WRITE_EN (1 << 31)
|
||||
#define IOP13XX_WDTCR_IB_RESET (1 << 0)
|
||||
static inline void arch_reset(char mode)
|
||||
{
|
||||
/*
|
||||
* Reset the internal bus (warning both cores are reset)
|
||||
*/
|
||||
write_wdtcr(IOP13XX_WDTCR_EN_ARM);
|
||||
write_wdtcr(IOP13XX_WDTCR_EN);
|
||||
write_wdtcr(IOP_WDTCR_EN_ARM);
|
||||
write_wdtcr(IOP_WDTCR_EN);
|
||||
write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET);
|
||||
write_wdtcr(0x1000);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include <asm/types.h>
|
||||
#include <linux/serial_reg.h>
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
#define UART_BASE ((volatile u32 *)IOP13XX_UART1_PHYS)
|
||||
#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
|
||||
@@ -9,7 +8,7 @@
|
||||
static inline void putc(char c)
|
||||
{
|
||||
while ((UART_BASE[UART_LSR] & TX_DONE) != TX_DONE)
|
||||
cpu_relax();
|
||||
barrier();
|
||||
UART_BASE[UART_TX] = c;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
|
||||
{
|
||||
if (machine_is_iq80321())
|
||||
uart_base = (volatile u8 *)IQ80321_UART;
|
||||
else if (machine_is_iq31244())
|
||||
else if (machine_is_iq31244() || machine_is_em7210())
|
||||
uart_base = (volatile u8 *)IQ31244_UART;
|
||||
else
|
||||
uart_base = (volatile u8 *)0xfe800000;
|
||||
|
||||
142
include/asm-arm/arch-mxc/board-mx31ads.h
Normal file
142
include/asm-arm/arch-mxc/board-mx31ads.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__
|
||||
#define __ASM_ARCH_MXC_BOARD_MX31ADS_H__
|
||||
|
||||
/*!
|
||||
* @name PBC Controller parameters
|
||||
*/
|
||||
/*! @{ */
|
||||
/*!
|
||||
* Base address of PBC controller
|
||||
*/
|
||||
#define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR)
|
||||
/* Offsets for the PBC Controller register */
|
||||
/*!
|
||||
* PBC Board status register offset
|
||||
*/
|
||||
#define PBC_BSTAT 0x000002
|
||||
/*!
|
||||
* PBC Board control register 1 set address.
|
||||
*/
|
||||
#define PBC_BCTRL1_SET 0x000004
|
||||
/*!
|
||||
* PBC Board control register 1 clear address.
|
||||
*/
|
||||
#define PBC_BCTRL1_CLEAR 0x000006
|
||||
/*!
|
||||
* PBC Board control register 2 set address.
|
||||
*/
|
||||
#define PBC_BCTRL2_SET 0x000008
|
||||
/*!
|
||||
* PBC Board control register 2 clear address.
|
||||
*/
|
||||
#define PBC_BCTRL2_CLEAR 0x00000A
|
||||
/*!
|
||||
* PBC Board control register 3 set address.
|
||||
*/
|
||||
#define PBC_BCTRL3_SET 0x00000C
|
||||
/*!
|
||||
* PBC Board control register 3 clear address.
|
||||
*/
|
||||
#define PBC_BCTRL3_CLEAR 0x00000E
|
||||
/*!
|
||||
* PBC Board control register 4 set address.
|
||||
*/
|
||||
#define PBC_BCTRL4_SET 0x000010
|
||||
/*!
|
||||
* PBC Board control register 4 clear address.
|
||||
*/
|
||||
#define PBC_BCTRL4_CLEAR 0x000012
|
||||
/*!
|
||||
* PBC Board status register 1.
|
||||
*/
|
||||
#define PBC_BSTAT1 0x000014
|
||||
/*!
|
||||
* PBC Board interrupt status register.
|
||||
*/
|
||||
#define PBC_INTSTATUS 0x000016
|
||||
/*!
|
||||
* PBC Board interrupt current status register.
|
||||
*/
|
||||
#define PBC_INTCURR_STATUS 0x000018
|
||||
/*!
|
||||
* PBC Interrupt mask register set address.
|
||||
*/
|
||||
#define PBC_INTMASK_SET 0x00001A
|
||||
/*!
|
||||
* PBC Interrupt mask register clear address.
|
||||
*/
|
||||
#define PBC_INTMASK_CLEAR 0x00001C
|
||||
|
||||
/*!
|
||||
* External UART A.
|
||||
*/
|
||||
#define PBC_SC16C652_UARTA 0x010000
|
||||
/*!
|
||||
* External UART B.
|
||||
*/
|
||||
#define PBC_SC16C652_UARTB 0x010010
|
||||
/*!
|
||||
* Ethernet Controller IO base address.
|
||||
*/
|
||||
#define PBC_CS8900A_IOBASE 0x020000
|
||||
/*!
|
||||
* Ethernet Controller Memory base address.
|
||||
*/
|
||||
#define PBC_CS8900A_MEMBASE 0x021000
|
||||
/*!
|
||||
* Ethernet Controller DMA base address.
|
||||
*/
|
||||
#define PBC_CS8900A_DMABASE 0x022000
|
||||
/*!
|
||||
* External chip select 0.
|
||||
*/
|
||||
#define PBC_XCS0 0x040000
|
||||
/*!
|
||||
* LCD Display enable.
|
||||
*/
|
||||
#define PBC_LCD_EN_B 0x060000
|
||||
/*!
|
||||
* Code test debug enable.
|
||||
*/
|
||||
#define PBC_CODE_B 0x070000
|
||||
/*!
|
||||
* PSRAM memory select.
|
||||
*/
|
||||
#define PBC_PSRAM_B 0x5000000
|
||||
|
||||
#define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS)
|
||||
#define PBC_INTCURR_STATUS_REG (PBC_INTCURR_STATUS + PBC_BASE_ADDRESS)
|
||||
#define PBC_INTMASK_SET_REG (PBC_INTMASK_SET + PBC_BASE_ADDRESS)
|
||||
#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS)
|
||||
#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4)
|
||||
|
||||
#define EXPIO_INT_LOW_BAT (MXC_EXP_IO_BASE + 0)
|
||||
#define EXPIO_INT_PB_IRQ (MXC_EXP_IO_BASE + 1)
|
||||
#define EXPIO_INT_OTG_FS_OVR (MXC_EXP_IO_BASE + 2)
|
||||
#define EXPIO_INT_FSH_OVR (MXC_EXP_IO_BASE + 3)
|
||||
#define EXPIO_INT_RES4 (MXC_EXP_IO_BASE + 4)
|
||||
#define EXPIO_INT_RES5 (MXC_EXP_IO_BASE + 5)
|
||||
#define EXPIO_INT_RES6 (MXC_EXP_IO_BASE + 6)
|
||||
#define EXPIO_INT_RES7 (MXC_EXP_IO_BASE + 7)
|
||||
#define EXPIO_INT_ENET_INT (MXC_EXP_IO_BASE + 8)
|
||||
#define EXPIO_INT_OTG_FS_INT (MXC_EXP_IO_BASE + 9)
|
||||
#define EXPIO_INT_XUART_INTA (MXC_EXP_IO_BASE + 10)
|
||||
#define EXPIO_INT_XUART_INTB (MXC_EXP_IO_BASE + 11)
|
||||
#define EXPIO_INT_SYNTH_IRQ (MXC_EXP_IO_BASE + 12)
|
||||
#define EXPIO_INT_CE_INT1 (MXC_EXP_IO_BASE + 13)
|
||||
#define EXPIO_INT_CE_INT2 (MXC_EXP_IO_BASE + 14)
|
||||
#define EXPIO_INT_RES15 (MXC_EXP_IO_BASE + 15)
|
||||
|
||||
#define MXC_MAX_EXP_IO_LINES 16
|
||||
|
||||
#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */
|
||||
20
include/asm-arm/arch-mxc/common.h
Normal file
20
include/asm-arm/arch-mxc/common.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_COMMON_H__
|
||||
#define __ASM_ARCH_MXC_COMMON_H__
|
||||
|
||||
struct sys_timer;
|
||||
|
||||
extern void mxc_map_io(void);
|
||||
extern void mxc_init_irq(void);
|
||||
extern struct sys_timer mxc_timer;
|
||||
|
||||
#endif
|
||||
21
include/asm-arm/arch-mxc/dma.h
Normal file
21
include/asm-arm/arch-mxc/dma.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_DMA_H__
|
||||
#define __ASM_ARCH_MXC_DMA_H__
|
||||
|
||||
/*!
|
||||
* @file dma.h
|
||||
* @brief This file contains Unified DMA API for all MXC platforms.
|
||||
* The API is platform independent.
|
||||
*
|
||||
* @ingroup SDMA
|
||||
*/
|
||||
#endif
|
||||
39
include/asm-arm/arch-mxc/entry-macro.S
Normal file
39
include/asm-arm/arch-mxc/entry-macro.S
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
@ this macro disables fast irq (not implemented)
|
||||
.macro disable_fiq
|
||||
.endm
|
||||
|
||||
.macro get_irqnr_preamble, base, tmp
|
||||
.endm
|
||||
|
||||
.macro arch_ret_to_user, tmp1, tmp2
|
||||
.endm
|
||||
|
||||
@ this macro checks which interrupt occured
|
||||
@ and returns its number in irqnr
|
||||
@ and returns if an interrupt occured in irqstat
|
||||
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp
|
||||
ldr \base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR)
|
||||
@ Load offset & priority of the highest priority
|
||||
@ interrupt pending from AVIC_NIVECSR
|
||||
ldr \irqstat, [\base, #0x40]
|
||||
@ Shift to get the decoded IRQ number, using ASR so
|
||||
@ 'no interrupt pending' becomes 0xffffffff
|
||||
mov \irqnr, \irqstat, asr #16
|
||||
@ set zero flag if IRQ + 1 == 0
|
||||
adds \tmp, \irqnr, #1
|
||||
.endm
|
||||
|
||||
@ irq priority table (not used)
|
||||
.macro irq_prio_table
|
||||
.endm
|
||||
52
include/asm-arm/arch-mxc/hardware.h
Normal file
52
include/asm-arm/arch-mxc/hardware.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @file hardware.h
|
||||
* @brief This file contains the hardware definitions of the board.
|
||||
*
|
||||
* @ingroup System
|
||||
*/
|
||||
#ifndef __ASM_ARCH_MXC_HARDWARE_H__
|
||||
#define __ASM_ARCH_MXC_HARDWARE_H__
|
||||
|
||||
#include <asm/sizes.h>
|
||||
|
||||
#include <asm/arch/mx31.h>
|
||||
|
||||
#include <asm/arch/mxc.h>
|
||||
|
||||
#define MXC_MAX_GPIO_LINES (GPIO_NUM_PIN * GPIO_PORT_NUM)
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------------------
|
||||
* Board specific defines
|
||||
* ---------------------------------------------------------------------------
|
||||
*/
|
||||
#define MXC_EXP_IO_BASE (MXC_GPIO_INT_BASE + MXC_MAX_GPIO_LINES)
|
||||
|
||||
#include <asm/arch/board-mx31ads.h>
|
||||
|
||||
#ifndef MXC_MAX_EXP_IO_LINES
|
||||
#define MXC_MAX_EXP_IO_LINES 0
|
||||
#endif
|
||||
|
||||
#define MXC_MAX_VIRTUAL_INTS 16
|
||||
#define MXC_VIRTUAL_INTS_BASE (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES)
|
||||
#define MXC_SDIO1_CARD_IRQ MXC_VIRTUAL_INTS_BASE
|
||||
#define MXC_SDIO2_CARD_IRQ (MXC_VIRTUAL_INTS_BASE + 1)
|
||||
#define MXC_SDIO3_CARD_IRQ (MXC_VIRTUAL_INTS_BASE + 2)
|
||||
|
||||
#define MXC_MAX_INTS (MXC_MAX_INT_LINES + \
|
||||
MXC_MAX_GPIO_LINES + \
|
||||
MXC_MAX_EXP_IO_LINES + \
|
||||
MXC_MAX_VIRTUAL_INTS)
|
||||
|
||||
#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
|
||||
33
include/asm-arm/arch-mxc/io.h
Normal file
33
include/asm-arm/arch-mxc/io.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @file io.h
|
||||
* @brief This file contains some memory mapping macros.
|
||||
* @note There is no real ISA or PCI buses. But have to define these macros
|
||||
* for some drivers to compile.
|
||||
*
|
||||
* @ingroup System
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_IO_H__
|
||||
#define __ASM_ARCH_MXC_IO_H__
|
||||
|
||||
/*! Allow IO space to be anywhere in the memory */
|
||||
#define IO_SPACE_LIMIT 0xffffffff
|
||||
|
||||
/*!
|
||||
* io address mapping macro
|
||||
*/
|
||||
#define __io(a) ((void __iomem *)(a))
|
||||
|
||||
#define __mem_pci(a) (a)
|
||||
|
||||
#endif
|
||||
38
include/asm-arm/arch-mxc/irqs.h
Normal file
38
include/asm-arm/arch-mxc/irqs.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_IRQS_H__
|
||||
#define __ASM_ARCH_MXC_IRQS_H__
|
||||
|
||||
#include <asm/hardware.h>
|
||||
|
||||
/*!
|
||||
* @file irqs.h
|
||||
* @brief This file defines the number of normal interrupts and fast interrupts
|
||||
*
|
||||
* @ingroup Interrupt
|
||||
*/
|
||||
|
||||
#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)
|
||||
|
||||
#define MXC_IRQ_TO_GPIO(irq) ((irq) - MXC_GPIO_INT_BASE)
|
||||
#define MXC_GPIO_TO_IRQ(x) (MXC_GPIO_INT_BASE + x)
|
||||
|
||||
/*!
|
||||
* Number of normal interrupts
|
||||
*/
|
||||
#define NR_IRQS MXC_MAX_INTS
|
||||
|
||||
/*!
|
||||
* Number of fast interrupts
|
||||
*/
|
||||
#define NR_FIQS MXC_MAX_INTS
|
||||
|
||||
#endif /* __ASM_ARCH_MXC_IRQS_H__ */
|
||||
36
include/asm-arm/arch-mxc/memory.h
Normal file
36
include/asm-arm/arch-mxc/memory.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_MEMORY_H__
|
||||
#define __ASM_ARCH_MXC_MEMORY_H__
|
||||
|
||||
#include <asm/hardware.h>
|
||||
|
||||
/*!
|
||||
* @file memory.h
|
||||
* @brief This file contains macros needed by the Linux kernel and drivers.
|
||||
*
|
||||
* @ingroup Memory
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Virtual view <-> DMA view memory address translations
|
||||
* This macro is used to translate the virtual address to an address
|
||||
* suitable to be passed to set_dma_addr()
|
||||
*/
|
||||
#define __virt_to_bus(a) __virt_to_phys(a)
|
||||
|
||||
/*!
|
||||
* Used to convert an address for DMA operations to an address that the
|
||||
* kernel can use.
|
||||
*/
|
||||
#define __bus_to_virt(a) __phys_to_virt(a)
|
||||
|
||||
#endif /* __ASM_ARCH_MXC_MEMORY_H__ */
|
||||
335
include/asm-arm/arch-mxc/mx31.h
Normal file
335
include/asm-arm/arch-mxc/mx31.h
Normal file
@@ -0,0 +1,335 @@
|
||||
/*
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_MX31_H__
|
||||
#define __ASM_ARCH_MXC_MX31_H__
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_HARDWARE_H__
|
||||
#error "Do not include directly."
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* defines the hardware clock tick rate
|
||||
*/
|
||||
#define CLOCK_TICK_RATE 16625000
|
||||
|
||||
/*
|
||||
* MX31 memory map:
|
||||
*
|
||||
* Virt Phys Size What
|
||||
* ---------------------------------------------------------------------------
|
||||
* F8000000 1FFC0000 16K IRAM
|
||||
* F9000000 30000000 256M L2CC
|
||||
* FC000000 43F00000 1M AIPS 1
|
||||
* FC100000 50000000 1M SPBA
|
||||
* FC200000 53F00000 1M AIPS 2
|
||||
* FC500000 60000000 128M ROMPATCH
|
||||
* FC400000 68000000 128M AVIC
|
||||
* 70000000 256M IPU (MAX M2)
|
||||
* 80000000 256M CSD0 SDRAM/DDR
|
||||
* 90000000 256M CSD1 SDRAM/DDR
|
||||
* A0000000 128M CS0 Flash
|
||||
* A8000000 128M CS1 Flash
|
||||
* B0000000 32M CS2
|
||||
* B2000000 32M CS3
|
||||
* F4000000 B4000000 32M CS4
|
||||
* B6000000 32M CS5
|
||||
* FC320000 B8000000 64K NAND, SDRAM, WEIM, M3IF, EMI controllers
|
||||
* C0000000 64M PCMCIA/CF
|
||||
*/
|
||||
|
||||
#define CS0_BASE_ADDR 0xA0000000
|
||||
#define CS1_BASE_ADDR 0xA8000000
|
||||
#define CS2_BASE_ADDR 0xB0000000
|
||||
#define CS3_BASE_ADDR 0xB2000000
|
||||
|
||||
#define CS4_BASE_ADDR 0xB4000000
|
||||
#define CS4_BASE_ADDR_VIRT 0xF4000000
|
||||
#define CS4_SIZE SZ_32M
|
||||
|
||||
#define CS5_BASE_ADDR 0xB6000000
|
||||
#define PCMCIA_MEM_BASE_ADDR 0xBC000000
|
||||
|
||||
/*
|
||||
* IRAM
|
||||
*/
|
||||
#define IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */
|
||||
#define IRAM_BASE_ADDR_VIRT 0xF8000000
|
||||
#define IRAM_SIZE SZ_16K
|
||||
|
||||
/*
|
||||
* L2CC
|
||||
*/
|
||||
#define L2CC_BASE_ADDR 0x30000000
|
||||
#define L2CC_BASE_ADDR_VIRT 0xF9000000
|
||||
#define L2CC_SIZE SZ_1M
|
||||
|
||||
/*
|
||||
* AIPS 1
|
||||
*/
|
||||
#define AIPS1_BASE_ADDR 0x43F00000
|
||||
#define AIPS1_BASE_ADDR_VIRT 0xFC000000
|
||||
#define AIPS1_SIZE SZ_1M
|
||||
|
||||
#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000)
|
||||
#define EVTMON_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000)
|
||||
#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000)
|
||||
#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000)
|
||||
#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000)
|
||||
#define ECT_CTIO_BASE_ADDR (AIPS1_BASE_ADDR + 0x00018000)
|
||||
#define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000)
|
||||
#define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000)
|
||||
#define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000)
|
||||
#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000)
|
||||
#define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000)
|
||||
#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000)
|
||||
#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000)
|
||||
#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000)
|
||||
#define SSI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000)
|
||||
#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000)
|
||||
#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000)
|
||||
#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000)
|
||||
#define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000)
|
||||
#define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000)
|
||||
#define ECT_IP1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000)
|
||||
#define ECT_IP2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000)
|
||||
|
||||
/*
|
||||
* SPBA global module enabled #0
|
||||
*/
|
||||
#define SPBA0_BASE_ADDR 0x50000000
|
||||
#define SPBA0_BASE_ADDR_VIRT 0xFC100000
|
||||
#define SPBA0_SIZE SZ_1M
|
||||
|
||||
#define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000)
|
||||
#define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000)
|
||||
#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000)
|
||||
#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000)
|
||||
#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000)
|
||||
#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000)
|
||||
#define IIM_BASE_ADDR (SPBA0_BASE_ADDR + 0x0001C000)
|
||||
#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000)
|
||||
#define MSHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
|
||||
#define MSHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
|
||||
#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000)
|
||||
|
||||
/*
|
||||
* AIPS 2
|
||||
*/
|
||||
#define AIPS2_BASE_ADDR 0x53F00000
|
||||
#define AIPS2_BASE_ADDR_VIRT 0xFC200000
|
||||
#define AIPS2_SIZE SZ_1M
|
||||
#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000)
|
||||
#define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000)
|
||||
#define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000)
|
||||
#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000)
|
||||
#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000)
|
||||
#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000)
|
||||
#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000)
|
||||
#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000)
|
||||
#define SCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AE000)
|
||||
#define SMN_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AF000)
|
||||
#define RNGA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000)
|
||||
#define IPU_CTRL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000)
|
||||
#define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000)
|
||||
#define MPEG4_ENC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000)
|
||||
#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000)
|
||||
#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000)
|
||||
#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000)
|
||||
#define RTC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000)
|
||||
#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000)
|
||||
#define PWM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000)
|
||||
#define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000)
|
||||
|
||||
/*
|
||||
* ROMP and AVIC
|
||||
*/
|
||||
#define ROMP_BASE_ADDR 0x60000000
|
||||
#define ROMP_BASE_ADDR_VIRT 0xFC500000
|
||||
#define ROMP_SIZE SZ_1M
|
||||
|
||||
#define AVIC_BASE_ADDR 0x68000000
|
||||
#define AVIC_BASE_ADDR_VIRT 0xFC400000
|
||||
#define AVIC_SIZE SZ_1M
|
||||
|
||||
/*
|
||||
* NAND, SDRAM, WEIM, M3IF, EMI controllers
|
||||
*/
|
||||
#define X_MEMC_BASE_ADDR 0xB8000000
|
||||
#define X_MEMC_BASE_ADDR_VIRT 0xFC320000
|
||||
#define X_MEMC_SIZE SZ_64K
|
||||
|
||||
#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000)
|
||||
#define ESDCTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000)
|
||||
#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000)
|
||||
#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000)
|
||||
#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000)
|
||||
#define PCMCIA_CTL_BASE_ADDR EMI_CTL_BASE_ADDR
|
||||
|
||||
/*
|
||||
* Memory regions and CS
|
||||
*/
|
||||
#define IPU_MEM_BASE_ADDR 0x70000000
|
||||
#define CSD0_BASE_ADDR 0x80000000
|
||||
#define CSD1_BASE_ADDR 0x90000000
|
||||
#define CS0_BASE_ADDR 0xA0000000
|
||||
#define CS1_BASE_ADDR 0xA8000000
|
||||
#define CS2_BASE_ADDR 0xB0000000
|
||||
#define CS3_BASE_ADDR 0xB2000000
|
||||
|
||||
#define CS4_BASE_ADDR 0xB4000000
|
||||
#define CS4_BASE_ADDR_VIRT 0xF4000000
|
||||
#define CS4_SIZE SZ_32M
|
||||
|
||||
#define CS5_BASE_ADDR 0xB6000000
|
||||
#define PCMCIA_MEM_BASE_ADDR 0xBC000000
|
||||
|
||||
/*!
|
||||
* This macro defines the physical to virtual address mapping for all the
|
||||
* peripheral modules. It is used by passing in the physical address as x
|
||||
* and returning the virtual address. If the physical address is not mapped,
|
||||
* it returns 0xDEADBEEF
|
||||
*/
|
||||
#define IO_ADDRESS(x) \
|
||||
(((x >= IRAM_BASE_ADDR) && (x < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x):\
|
||||
((x >= L2CC_BASE_ADDR) && (x < (L2CC_BASE_ADDR + L2CC_SIZE))) ? L2CC_IO_ADDRESS(x):\
|
||||
((x >= AIPS1_BASE_ADDR) && (x < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x):\
|
||||
((x >= SPBA0_BASE_ADDR) && (x < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x):\
|
||||
((x >= AIPS2_BASE_ADDR) && (x < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x):\
|
||||
((x >= ROMP_BASE_ADDR) && (x < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x):\
|
||||
((x >= AVIC_BASE_ADDR) && (x < (AVIC_BASE_ADDR + AVIC_SIZE))) ? AVIC_IO_ADDRESS(x):\
|
||||
((x >= CS4_BASE_ADDR) && (x < (CS4_BASE_ADDR + CS4_SIZE))) ? CS4_IO_ADDRESS(x):\
|
||||
((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x):\
|
||||
0xDEADBEEF)
|
||||
|
||||
/*
|
||||
* define the address mapping macros: in physical address order
|
||||
*/
|
||||
|
||||
#define IRAM_IO_ADDRESS(x) \
|
||||
(((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT)
|
||||
|
||||
#define L2CC_IO_ADDRESS(x) \
|
||||
(((x) - L2CC_BASE_ADDR) + L2CC_BASE_ADDR_VIRT)
|
||||
|
||||
#define AIPS1_IO_ADDRESS(x) \
|
||||
(((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT)
|
||||
|
||||
#define SPBA0_IO_ADDRESS(x) \
|
||||
(((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT)
|
||||
|
||||
#define AIPS2_IO_ADDRESS(x) \
|
||||
(((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT)
|
||||
|
||||
#define ROMP_IO_ADDRESS(x) \
|
||||
(((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT)
|
||||
|
||||
#define AVIC_IO_ADDRESS(x) \
|
||||
(((x) - AVIC_BASE_ADDR) + AVIC_BASE_ADDR_VIRT)
|
||||
|
||||
#define CS4_IO_ADDRESS(x) \
|
||||
(((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT)
|
||||
|
||||
#define X_MEMC_IO_ADDRESS(x) \
|
||||
(((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
|
||||
|
||||
#define PCMCIA_IO_ADDRESS(x) \
|
||||
(((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
|
||||
|
||||
/* Start of physical RAM - On many MX31 platforms, this is the first SDRAM bank (CSD0) */
|
||||
#define PHYS_OFFSET CSD0_BASE_ADDR
|
||||
|
||||
/*
|
||||
* Interrupt numbers
|
||||
*/
|
||||
#define MXC_INT_PEN_ADS7843 0
|
||||
#define MXC_INT_RESV1 1
|
||||
#define MXC_INT_CS8900A 2
|
||||
#define MXC_INT_I2C3 3
|
||||
#define MXC_INT_I2C2 4
|
||||
#define MXC_INT_MPEG4_ENCODER 5
|
||||
#define MXC_INT_RTIC 6
|
||||
#define MXC_INT_FIRI 7
|
||||
#define MXC_INT_MMC_SDHC2 8
|
||||
#define MXC_INT_MMC_SDHC1 9
|
||||
#define MXC_INT_I2C 10
|
||||
#define MXC_INT_SSI2 11
|
||||
#define MXC_INT_SSI1 12
|
||||
#define MXC_INT_CSPI2 13
|
||||
#define MXC_INT_CSPI1 14
|
||||
#define MXC_INT_ATA 15
|
||||
#define MXC_INT_MBX 16
|
||||
#define MXC_INT_CSPI3 17
|
||||
#define MXC_INT_UART3 18
|
||||
#define MXC_INT_IIM 19
|
||||
#define MXC_INT_SIM2 20
|
||||
#define MXC_INT_SIM1 21
|
||||
#define MXC_INT_RNGA 22
|
||||
#define MXC_INT_EVTMON 23
|
||||
#define MXC_INT_KPP 24
|
||||
#define MXC_INT_RTC 25
|
||||
#define MXC_INT_PWM 26
|
||||
#define MXC_INT_EPIT2 27
|
||||
#define MXC_INT_EPIT1 28
|
||||
#define MXC_INT_GPT 29
|
||||
#define MXC_INT_RESV30 30
|
||||
#define MXC_INT_RESV31 31
|
||||
#define MXC_INT_UART2 32
|
||||
#define MXC_INT_NANDFC 33
|
||||
#define MXC_INT_SDMA 34
|
||||
#define MXC_INT_USB1 35
|
||||
#define MXC_INT_USB2 36
|
||||
#define MXC_INT_USB3 37
|
||||
#define MXC_INT_USB4 38
|
||||
#define MXC_INT_MSHC1 39
|
||||
#define MXC_INT_MSHC2 40
|
||||
#define MXC_INT_IPU_ERR 41
|
||||
#define MXC_INT_IPU_SYN 42
|
||||
#define MXC_INT_RESV43 43
|
||||
#define MXC_INT_RESV44 44
|
||||
#define MXC_INT_UART1 45
|
||||
#define MXC_INT_UART4 46
|
||||
#define MXC_INT_UART5 47
|
||||
#define MXC_INT_ECT 48
|
||||
#define MXC_INT_SCC_SCM 49
|
||||
#define MXC_INT_SCC_SMN 50
|
||||
#define MXC_INT_GPIO2 51
|
||||
#define MXC_INT_GPIO1 52
|
||||
#define MXC_INT_CCM 53
|
||||
#define MXC_INT_PCMCIA 54
|
||||
#define MXC_INT_WDOG 55
|
||||
#define MXC_INT_GPIO3 56
|
||||
#define MXC_INT_RESV57 57
|
||||
#define MXC_INT_EXT_POWER 58
|
||||
#define MXC_INT_EXT_TEMPER 59
|
||||
#define MXC_INT_EXT_SENSOR60 60
|
||||
#define MXC_INT_EXT_SENSOR61 61
|
||||
#define MXC_INT_EXT_WDOG 62
|
||||
#define MXC_INT_EXT_TV 63
|
||||
|
||||
#define MXC_MAX_INT_LINES 64
|
||||
|
||||
#define MXC_GPIO_INT_BASE MXC_MAX_INT_LINES
|
||||
|
||||
/*!
|
||||
* Number of GPIO port as defined in the IC Spec
|
||||
*/
|
||||
#define GPIO_PORT_NUM 3
|
||||
/*!
|
||||
* Number of GPIO pins per port
|
||||
*/
|
||||
#define GPIO_NUM_PIN 32
|
||||
|
||||
#define PROD_SIGNATURE 0x1 /* For MX31 */
|
||||
|
||||
#define SYSTEM_REV_MIN CHIP_REV_1_0
|
||||
#define SYSTEM_REV_NUM 3
|
||||
|
||||
#endif /* __ASM_ARCH_MXC_MX31_H__ */
|
||||
149
include/asm-arm/arch-mxc/mxc.h
Normal file
149
include/asm-arm/arch-mxc/mxc.h
Normal file
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_H__
|
||||
#define __ASM_ARCH_MXC_H__
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_HARDWARE_H__
|
||||
#error "Do not include directly."
|
||||
#endif
|
||||
|
||||
/*
|
||||
*****************************************
|
||||
* GPT Register definitions *
|
||||
*****************************************
|
||||
*/
|
||||
#define MXC_GPT_GPTCR IO_ADDRESS(GPT1_BASE_ADDR + 0x00)
|
||||
#define MXC_GPT_GPTPR IO_ADDRESS(GPT1_BASE_ADDR + 0x04)
|
||||
#define MXC_GPT_GPTSR IO_ADDRESS(GPT1_BASE_ADDR + 0x08)
|
||||
#define MXC_GPT_GPTIR IO_ADDRESS(GPT1_BASE_ADDR + 0x0C)
|
||||
#define MXC_GPT_GPTOCR1 IO_ADDRESS(GPT1_BASE_ADDR + 0x10)
|
||||
#define MXC_GPT_GPTOCR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x14)
|
||||
#define MXC_GPT_GPTOCR3 IO_ADDRESS(GPT1_BASE_ADDR + 0x18)
|
||||
#define MXC_GPT_GPTICR1 IO_ADDRESS(GPT1_BASE_ADDR + 0x1C)
|
||||
#define MXC_GPT_GPTICR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x20)
|
||||
#define MXC_GPT_GPTCNT IO_ADDRESS(GPT1_BASE_ADDR + 0x24)
|
||||
|
||||
/*!
|
||||
* GPT Control register bit definitions
|
||||
*/
|
||||
#define GPTCR_FO3 (1 << 31)
|
||||
#define GPTCR_FO2 (1 << 30)
|
||||
#define GPTCR_FO1 (1 << 29)
|
||||
|
||||
#define GPTCR_OM3_SHIFT 26
|
||||
#define GPTCR_OM3_MASK (7 << GPTCR_OM3_SHIFT)
|
||||
#define GPTCR_OM3_DISCONNECTED (0 << GPTCR_OM3_SHIFT)
|
||||
#define GPTCR_OM3_TOGGLE (1 << GPTCR_OM3_SHIFT)
|
||||
#define GPTCR_OM3_CLEAR (2 << GPTCR_OM3_SHIFT)
|
||||
#define GPTCR_OM3_SET (3 << GPTCR_OM3_SHIFT)
|
||||
#define GPTCR_OM3_GENERATE_LOW (7 << GPTCR_OM3_SHIFT)
|
||||
|
||||
#define GPTCR_OM2_SHIFT 23
|
||||
#define GPTCR_OM2_MASK (7 << GPTCR_OM2_SHIFT)
|
||||
#define GPTCR_OM2_DISCONNECTED (0 << GPTCR_OM2_SHIFT)
|
||||
#define GPTCR_OM2_TOGGLE (1 << GPTCR_OM2_SHIFT)
|
||||
#define GPTCR_OM2_CLEAR (2 << GPTCR_OM2_SHIFT)
|
||||
#define GPTCR_OM2_SET (3 << GPTCR_OM2_SHIFT)
|
||||
#define GPTCR_OM2_GENERATE_LOW (7 << GPTCR_OM2_SHIFT)
|
||||
|
||||
#define GPTCR_OM1_SHIFT 20
|
||||
#define GPTCR_OM1_MASK (7 << GPTCR_OM1_SHIFT)
|
||||
#define GPTCR_OM1_DISCONNECTED (0 << GPTCR_OM1_SHIFT)
|
||||
#define GPTCR_OM1_TOGGLE (1 << GPTCR_OM1_SHIFT)
|
||||
#define GPTCR_OM1_CLEAR (2 << GPTCR_OM1_SHIFT)
|
||||
#define GPTCR_OM1_SET (3 << GPTCR_OM1_SHIFT)
|
||||
#define GPTCR_OM1_GENERATE_LOW (7 << GPTCR_OM1_SHIFT)
|
||||
|
||||
#define GPTCR_IM2_SHIFT 18
|
||||
#define GPTCR_IM2_MASK (3 << GPTCR_IM2_SHIFT)
|
||||
#define GPTCR_IM2_CAPTURE_DISABLE (0 << GPTCR_IM2_SHIFT)
|
||||
#define GPTCR_IM2_CAPTURE_RISING (1 << GPTCR_IM2_SHIFT)
|
||||
#define GPTCR_IM2_CAPTURE_FALLING (2 << GPTCR_IM2_SHIFT)
|
||||
#define GPTCR_IM2_CAPTURE_BOTH (3 << GPTCR_IM2_SHIFT)
|
||||
|
||||
#define GPTCR_IM1_SHIFT 16
|
||||
#define GPTCR_IM1_MASK (3 << GPTCR_IM1_SHIFT)
|
||||
#define GPTCR_IM1_CAPTURE_DISABLE (0 << GPTCR_IM1_SHIFT)
|
||||
#define GPTCR_IM1_CAPTURE_RISING (1 << GPTCR_IM1_SHIFT)
|
||||
#define GPTCR_IM1_CAPTURE_FALLING (2 << GPTCR_IM1_SHIFT)
|
||||
#define GPTCR_IM1_CAPTURE_BOTH (3 << GPTCR_IM1_SHIFT)
|
||||
|
||||
#define GPTCR_SWR (1 << 15)
|
||||
#define GPTCR_FRR (1 << 9)
|
||||
|
||||
#define GPTCR_CLKSRC_SHIFT 6
|
||||
#define GPTCR_CLKSRC_MASK (7 << GPTCR_CLKSRC_SHIFT)
|
||||
#define GPTCR_CLKSRC_NOCLOCK (0 << GPTCR_CLKSRC_SHIFT)
|
||||
#define GPTCR_CLKSRC_HIGHFREQ (2 << GPTCR_CLKSRC_SHIFT)
|
||||
#define GPTCR_CLKSRC_CLKIN (3 << GPTCR_CLKSRC_SHIFT)
|
||||
#define GPTCR_CLKSRC_CLK32K (7 << GPTCR_CLKSRC_SHIFT)
|
||||
|
||||
#define GPTCR_STOPEN (1 << 5)
|
||||
#define GPTCR_DOZEN (1 << 4)
|
||||
#define GPTCR_WAITEN (1 << 3)
|
||||
#define GPTCR_DBGEN (1 << 2)
|
||||
|
||||
#define GPTCR_ENMOD (1 << 1)
|
||||
#define GPTCR_ENABLE (1 << 0)
|
||||
|
||||
#define GPTSR_OF1 (1 << 0)
|
||||
#define GPTSR_OF2 (1 << 1)
|
||||
#define GPTSR_OF3 (1 << 2)
|
||||
#define GPTSR_IF1 (1 << 3)
|
||||
#define GPTSR_IF2 (1 << 4)
|
||||
#define GPTSR_ROV (1 << 5)
|
||||
|
||||
#define GPTIR_OF1IE GPTSR_OF1
|
||||
#define GPTIR_OF2IE GPTSR_OF2
|
||||
#define GPTIR_OF3IE GPTSR_OF3
|
||||
#define GPTIR_IF1IE GPTSR_IF1
|
||||
#define GPTIR_IF2IE GPTSR_IF2
|
||||
#define GPTIR_ROVIE GPTSR_ROV
|
||||
|
||||
/*
|
||||
*****************************************
|
||||
* AVIC Registers *
|
||||
*****************************************
|
||||
*/
|
||||
#define AVIC_BASE IO_ADDRESS(AVIC_BASE_ADDR)
|
||||
#define AVIC_INTCNTL (AVIC_BASE + 0x00) /* int control reg */
|
||||
#define AVIC_NIMASK (AVIC_BASE + 0x04) /* int mask reg */
|
||||
#define AVIC_INTENNUM (AVIC_BASE + 0x08) /* int enable number reg */
|
||||
#define AVIC_INTDISNUM (AVIC_BASE + 0x0C) /* int disable number reg */
|
||||
#define AVIC_INTENABLEH (AVIC_BASE + 0x10) /* int enable reg high */
|
||||
#define AVIC_INTENABLEL (AVIC_BASE + 0x14) /* int enable reg low */
|
||||
#define AVIC_INTTYPEH (AVIC_BASE + 0x18) /* int type reg high */
|
||||
#define AVIC_INTTYPEL (AVIC_BASE + 0x1C) /* int type reg low */
|
||||
#define AVIC_NIPRIORITY7 (AVIC_BASE + 0x20) /* norm int priority lvl7 */
|
||||
#define AVIC_NIPRIORITY6 (AVIC_BASE + 0x24) /* norm int priority lvl6 */
|
||||
#define AVIC_NIPRIORITY5 (AVIC_BASE + 0x28) /* norm int priority lvl5 */
|
||||
#define AVIC_NIPRIORITY4 (AVIC_BASE + 0x2C) /* norm int priority lvl4 */
|
||||
#define AVIC_NIPRIORITY3 (AVIC_BASE + 0x30) /* norm int priority lvl3 */
|
||||
#define AVIC_NIPRIORITY2 (AVIC_BASE + 0x34) /* norm int priority lvl2 */
|
||||
#define AVIC_NIPRIORITY1 (AVIC_BASE + 0x38) /* norm int priority lvl1 */
|
||||
#define AVIC_NIPRIORITY0 (AVIC_BASE + 0x3C) /* norm int priority lvl0 */
|
||||
#define AVIC_NIVECSR (AVIC_BASE + 0x40) /* norm int vector/status */
|
||||
#define AVIC_FIVECSR (AVIC_BASE + 0x44) /* fast int vector/status */
|
||||
#define AVIC_INTSRCH (AVIC_BASE + 0x48) /* int source reg high */
|
||||
#define AVIC_INTSRCL (AVIC_BASE + 0x4C) /* int source reg low */
|
||||
#define AVIC_INTFRCH (AVIC_BASE + 0x50) /* int force reg high */
|
||||
#define AVIC_INTFRCL (AVIC_BASE + 0x54) /* int force reg low */
|
||||
#define AVIC_NIPNDH (AVIC_BASE + 0x58) /* norm int pending high */
|
||||
#define AVIC_NIPNDL (AVIC_BASE + 0x5C) /* norm int pending low */
|
||||
#define AVIC_FIPNDH (AVIC_BASE + 0x60) /* fast int pending high */
|
||||
#define AVIC_FIPNDL (AVIC_BASE + 0x64) /* fast int pending low */
|
||||
|
||||
#define SYSTEM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20)
|
||||
#define SYSTEM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24)
|
||||
#define IIM_PROD_REV_SH 3
|
||||
#define IIM_PROD_REV_LEN 5
|
||||
|
||||
#endif /* __ASM_ARCH_MXC_H__ */
|
||||
50
include/asm-arm/arch-mxc/system.h
Normal file
50
include/asm-arm/arch-mxc/system.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 1999 ARM Limited
|
||||
* Copyright (C) 2000 Deep Blue Solutions Ltd
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_SYSTEM_H__
|
||||
#define __ASM_ARCH_MXC_SYSTEM_H__
|
||||
|
||||
/*!
|
||||
* @file system.h
|
||||
* @brief This file contains idle and reset functions.
|
||||
*
|
||||
* @ingroup System
|
||||
*/
|
||||
|
||||
/*!
|
||||
* This function puts the CPU into idle mode. It is called by default_idle()
|
||||
* in process.c file.
|
||||
*/
|
||||
static inline void arch_idle(void)
|
||||
{
|
||||
cpu_do_idle();
|
||||
}
|
||||
|
||||
/*
|
||||
* This function resets the system. It is called by machine_restart().
|
||||
*
|
||||
* @param mode indicates different kinds of resets
|
||||
*/
|
||||
static inline void arch_reset(char mode)
|
||||
{
|
||||
cpu_reset(0);
|
||||
}
|
||||
|
||||
#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */
|
||||
25
include/asm-arm/arch-mxc/timex.h
Normal file
25
include/asm-arm/arch-mxc/timex.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 1999 ARM Limited
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_TIMEX_H__
|
||||
#define __ASM_ARCH_MXC_TIMEX_H__
|
||||
|
||||
#include <asm/hardware.h> /* for CLOCK_TICK_RATE */
|
||||
|
||||
#endif /* __ASM_ARCH_MXC_TIMEX_H__ */
|
||||
78
include/asm-arm/arch-mxc/uncompress.h
Normal file
78
include/asm-arm/arch-mxc/uncompress.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* include/asm-arm/arch-mxc/uncompress.h
|
||||
*
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999 ARM Limited
|
||||
* Copyright (C) Shane Nay (shane@minirl.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __ASM_ARCH_MXC_UNCOMPRESS_H__
|
||||
#define __ASM_ARCH_MXC_UNCOMPRESS_H__
|
||||
|
||||
#define __MXC_BOOT_UNCOMPRESS
|
||||
|
||||
#include <asm/hardware.h>
|
||||
|
||||
#define UART(x) (*(volatile unsigned long *)(serial_port + (x)))
|
||||
|
||||
#define USR2 0x98
|
||||
#define USR2_TXFE (1<<14)
|
||||
#define TXR 0x40
|
||||
#define UCR1 0x80
|
||||
#define UCR1_UARTEN 1
|
||||
|
||||
/*
|
||||
* The following code assumes the serial port has already been
|
||||
* initialized by the bootloader. We search for the first enabled
|
||||
* port in the most probable order. If you didn't setup a port in
|
||||
* your bootloader then nothing will appear (which might be desired).
|
||||
*
|
||||
* This does not append a newline
|
||||
*/
|
||||
|
||||
static void putc(int ch)
|
||||
{
|
||||
static unsigned long serial_port = 0;
|
||||
|
||||
if (unlikely(serial_port == 0)) {
|
||||
do {
|
||||
serial_port = UART1_BASE_ADDR;
|
||||
if (UART(UCR1) & UCR1_UARTEN)
|
||||
break;
|
||||
serial_port = UART2_BASE_ADDR;
|
||||
if (UART(UCR1) & UCR1_UARTEN)
|
||||
break;
|
||||
return;
|
||||
} while (0);
|
||||
}
|
||||
|
||||
while (!(UART(USR2) & USR2_TXFE))
|
||||
barrier();
|
||||
|
||||
UART(TXR) = ch;
|
||||
}
|
||||
|
||||
#define flush() do { } while (0)
|
||||
|
||||
/*
|
||||
* nothing to do
|
||||
*/
|
||||
#define arch_decomp_setup()
|
||||
|
||||
#define arch_decomp_wdog()
|
||||
|
||||
#endif /* __ASM_ARCH_MXC_UNCOMPRESS_H__ */
|
||||
36
include/asm-arm/arch-mxc/vmalloc.h
Normal file
36
include/asm-arm/arch-mxc/vmalloc.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2000 Russell King.
|
||||
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_VMALLOC_H__
|
||||
#define __ASM_ARCH_MXC_VMALLOC_H__
|
||||
|
||||
/*!
|
||||
* @file vmalloc.h
|
||||
*
|
||||
* @brief This file contains platform specific macros for vmalloc.
|
||||
*
|
||||
* @ingroup System
|
||||
*/
|
||||
|
||||
/*!
|
||||
* vmalloc ending address
|
||||
*/
|
||||
#define VMALLOC_END 0xF4000000
|
||||
|
||||
#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
|
||||
@@ -15,7 +15,31 @@
|
||||
|
||||
/* BBus Utility */
|
||||
|
||||
/* GPIO Configuration Register */
|
||||
#define BBU_GC(x) __REG2(0x9060000c, (x))
|
||||
/* GPIO Configuration Registers block 1 */
|
||||
/* NOTE: the HRM starts counting at 1 for the GPIO registers, here the start is
|
||||
* at 0 for each block. That is, BBU_GCONFb1(0) is GPIO Configuration Register
|
||||
* #1, BBU_GCONFb2(0) is GPIO Configuration Register #8. */
|
||||
#define BBU_GCONFb1(x) __REG2(0x90600010, (x))
|
||||
#define BBU_GCONFb2(x) __REG2(0x90600100, (x))
|
||||
|
||||
#define BBU_GCONFx_DIR(m) __REGBIT(3 + (((m) & 7) << 2))
|
||||
#define BBU_GCONFx_DIR_INPUT(m) __REGVAL(BBU_GCONFx_DIR(m), 0)
|
||||
#define BBU_GCONFx_DIR_OUTPUT(m) __REGVAL(BBU_GCONFx_DIR(m), 1)
|
||||
#define BBU_GCONFx_INV(m) __REGBIT(2 + (((m) & 7) << 2))
|
||||
#define BBU_GCONFx_INV_NO(m) __REGVAL(BBU_GCONFx_INV(m), 0)
|
||||
#define BBU_GCONFx_INV_YES(m) __REGVAL(BBU_GCONFx_INV(m), 1)
|
||||
#define BBU_GCONFx_FUNC(m) __REGBITS(1 + (((m) & 7) << 2), ((m) & 7) << 2)
|
||||
#define BBU_GCONFx_FUNC_0(m) __REGVAL(BBU_GCONFx_FUNC(m), 0)
|
||||
#define BBU_GCONFx_FUNC_1(m) __REGVAL(BBU_GCONFx_FUNC(m), 1)
|
||||
#define BBU_GCONFx_FUNC_2(m) __REGVAL(BBU_GCONFx_FUNC(m), 2)
|
||||
#define BBU_GCONFx_FUNC_3(m) __REGVAL(BBU_GCONFx_FUNC(m), 3)
|
||||
|
||||
#define BBU_GCTRL1 __REG(0x90600030)
|
||||
#define BBU_GCTRL2 __REG(0x90600034)
|
||||
#define BBU_GCTRL3 __REG(0x90600120)
|
||||
|
||||
#define BBU_GSTAT1 __REG(0x90600040)
|
||||
#define BBU_GSTAT2 __REG(0x90600044)
|
||||
#define BBU_GSTAT3 __REG(0x90600130)
|
||||
|
||||
#endif /* ifndef __ASM_ARCH_REGSBBU_H */
|
||||
|
||||
@@ -79,9 +79,9 @@
|
||||
#define MEM_SMC(x) __REG2(0xa0700200, (x) << 3)
|
||||
|
||||
/* Static Memory Configuration Register x: Write protect */
|
||||
#define MEM_SMC_WSMC __REGBIT(20)
|
||||
#define MEM_SMC_WSMC_OFF __REGVAL(MEM_SMC_WSMC, 0)
|
||||
#define MEM_SMC_WSMC_ON __REGVAL(MEM_SMC_WSMC, 1)
|
||||
#define MEM_SMC_PSMC __REGBIT(20)
|
||||
#define MEM_SMC_PSMC_OFF __REGVAL(MEM_SMC_PSMC, 0)
|
||||
#define MEM_SMC_PSMC_ON __REGVAL(MEM_SMC_PSMC, 1)
|
||||
|
||||
/* Static Memory Configuration Register x: Buffer enable */
|
||||
#define MEM_SMC_BSMC __REGBIT(19)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
/* Timer x Control register: Timer enable */
|
||||
#define SYS_TCx_TEN __REGBIT(15)
|
||||
#define SYS_TCx_TEN_DIS __REGVAL(SYS_TCx_TEN, 1)
|
||||
#define SYS_TCx_TEN_DIS __REGVAL(SYS_TCx_TEN, 0)
|
||||
#define SYS_TCx_TEN_EN __REGVAL(SYS_TCx_TEN, 1)
|
||||
|
||||
/* Timer x Control register: CPU debug mode */
|
||||
|
||||
@@ -31,6 +31,7 @@ struct omap_irda_config {
|
||||
unsigned long src_start;
|
||||
int tx_trigger;
|
||||
int rx_trigger;
|
||||
int mode;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -37,7 +37,7 @@ struct omap_mbox_ops {
|
||||
|
||||
struct omap_mbox_queue {
|
||||
spinlock_t lock;
|
||||
request_queue_t *queue;
|
||||
struct request_queue *queue;
|
||||
struct work_struct work;
|
||||
int (*callback)(void *);
|
||||
struct omap_mbox *mbox;
|
||||
|
||||
@@ -7,5 +7,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
extern int pxa_pm_prepare(suspend_state_t state);
|
||||
struct pxa_cpu_pm_fns {
|
||||
int save_size;
|
||||
void (*save)(unsigned long *);
|
||||
void (*restore)(unsigned long *);
|
||||
int (*valid)(suspend_state_t state);
|
||||
void (*enter)(suspend_state_t state);
|
||||
};
|
||||
|
||||
extern struct pxa_cpu_pm_fns *pxa_cpu_pm_fns;
|
||||
|
||||
/* sleep.S */
|
||||
extern void pxa25x_cpu_suspend(unsigned int);
|
||||
extern void pxa27x_cpu_suspend(unsigned int);
|
||||
extern void pxa_cpu_resume(void);
|
||||
|
||||
extern int pxa_pm_enter(suspend_state_t state);
|
||||
|
||||
@@ -25,12 +25,6 @@ struct corgits_machinfo {
|
||||
/*
|
||||
* SharpSL Backlight
|
||||
*/
|
||||
struct corgibl_machinfo {
|
||||
int max_intensity;
|
||||
int default_intensity;
|
||||
int limit_mask;
|
||||
void (*set_bl_intensity)(int intensity);
|
||||
};
|
||||
extern void corgibl_limit_intensity(int limit);
|
||||
|
||||
|
||||
|
||||
66
include/asm-arm/arch-s3c2400/map.h
Normal file
66
include/asm-arm/arch-s3c2400/map.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* linux/include/asm-arm/arch-s3c2400/map.h
|
||||
*
|
||||
* Copyright 2003,2007 Simtec Electronics
|
||||
* http://armlinux.simtec.co.uk/
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* Copyright 2003, Lucas Correia Villa Real
|
||||
*
|
||||
* S3C2400 - Memory map definitions
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#define S3C2400_PA_MEMCTRL (0x14000000)
|
||||
#define S3C2400_PA_USBHOST (0x14200000)
|
||||
#define S3C2400_PA_IRQ (0x14400000)
|
||||
#define S3C2400_PA_DMA (0x14600000)
|
||||
#define S3C2400_PA_CLKPWR (0x14800000)
|
||||
#define S3C2400_PA_LCD (0x14A00000)
|
||||
#define S3C2400_PA_UART (0x15000000)
|
||||
#define S3C2400_PA_TIMER (0x15100000)
|
||||
#define S3C2400_PA_USBDEV (0x15200140)
|
||||
#define S3C2400_PA_WATCHDOG (0x15300000)
|
||||
#define S3C2400_PA_IIC (0x15400000)
|
||||
#define S3C2400_PA_IIS (0x15508000)
|
||||
#define S3C2400_PA_GPIO (0x15600000)
|
||||
#define S3C2400_PA_RTC (0x15700040)
|
||||
#define S3C2400_PA_ADC (0x15800000)
|
||||
#define S3C2400_PA_SPI (0x15900000)
|
||||
|
||||
#define S3C2400_PA_MMC (0x15A00000)
|
||||
#define S3C2400_SZ_MMC SZ_1M
|
||||
|
||||
/* physical addresses of all the chip-select areas */
|
||||
|
||||
#define S3C2400_CS0 (0x00000000)
|
||||
#define S3C2400_CS1 (0x02000000)
|
||||
#define S3C2400_CS2 (0x04000000)
|
||||
#define S3C2400_CS3 (0x06000000)
|
||||
#define S3C2400_CS4 (0x08000000)
|
||||
#define S3C2400_CS5 (0x0A000000)
|
||||
#define S3C2400_CS6 (0x0C000000)
|
||||
#define S3C2400_CS7 (0x0E000000)
|
||||
|
||||
#define S3C2400_SDRAM_PA (S3C2400_CS6)
|
||||
|
||||
/* Use a single interface for common resources between S3C24XX cpus */
|
||||
|
||||
#define S3C24XX_PA_IRQ S3C2400_PA_IRQ
|
||||
#define S3C24XX_PA_MEMCTRL S3C2400_PA_MEMCTRL
|
||||
#define S3C24XX_PA_USBHOST S3C2400_PA_USBHOST
|
||||
#define S3C24XX_PA_DMA S3C2400_PA_DMA
|
||||
#define S3C24XX_PA_CLKPWR S3C2400_PA_CLKPWR
|
||||
#define S3C24XX_PA_LCD S3C2400_PA_LCD
|
||||
#define S3C24XX_PA_UART S3C2400_PA_UART
|
||||
#define S3C24XX_PA_TIMER S3C2400_PA_TIMER
|
||||
#define S3C24XX_PA_USBDEV S3C2400_PA_USBDEV
|
||||
#define S3C24XX_PA_WATCHDOG S3C2400_PA_WATCHDOG
|
||||
#define S3C24XX_PA_IIC S3C2400_PA_IIC
|
||||
#define S3C24XX_PA_IIS S3C2400_PA_IIS
|
||||
#define S3C24XX_PA_GPIO S3C2400_PA_GPIO
|
||||
#define S3C24XX_PA_RTC S3C2400_PA_RTC
|
||||
#define S3C24XX_PA_ADC S3C2400_PA_ADC
|
||||
#define S3C24XX_PA_SPI S3C2400_PA_SPI
|
||||
23
include/asm-arm/arch-s3c2400/memory.h
Normal file
23
include/asm-arm/arch-s3c2400/memory.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* linux/include/asm-arm/arch-s3c2400/memory.h
|
||||
* from linux/include/asm-arm/arch-rpc/memory.h
|
||||
*
|
||||
* Copyright 2007 Simtec Electronics
|
||||
* http://armlinux.simtec.co.uk/
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* Copyright (C) 1996,1997,1998 Russell King.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MEMORY_H
|
||||
#define __ASM_ARCH_MEMORY_H
|
||||
|
||||
#define PHYS_OFFSET UL(0x0C000000)
|
||||
|
||||
#define __virt_to_bus(x) __virt_to_phys(x)
|
||||
#define __bus_to_virt(x) __phys_to_virt(x)
|
||||
|
||||
#endif
|
||||
@@ -13,32 +13,23 @@
|
||||
*/
|
||||
|
||||
#include <asm/arch/map.h>
|
||||
#include <asm/arch/regs-serial.h>
|
||||
#include <asm/arch/regs-gpio.h>
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
|
||||
#define S3C2410_UART1_OFF (0x4000)
|
||||
#define SHIFT_2440TXF (14-9)
|
||||
|
||||
.macro addruart, rx
|
||||
.macro addruart, rx
|
||||
mrc p15, 0, \rx, c1, c0
|
||||
tst \rx, #1
|
||||
ldreq \rx, = S3C24XX_PA_UART
|
||||
ldrne \rx, = S3C24XX_VA_UART
|
||||
#if CONFIG_DEBUG_S3C2410_UART != 0
|
||||
add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART)
|
||||
#if CONFIG_DEBUG_S3C_UART != 0
|
||||
add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
|
||||
#endif
|
||||
.endm
|
||||
.endm
|
||||
|
||||
.macro senduart,rd,rx
|
||||
strb \rd, [\rx, # S3C2410_UTXH ]
|
||||
.endm
|
||||
|
||||
.macro busyuart, rd, rx
|
||||
ldr \rd, [ \rx, # S3C2410_UFCON ]
|
||||
tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
|
||||
beq 1001f @
|
||||
@ FIFO enabled...
|
||||
1003:
|
||||
.macro fifo_full_s3c24xx rd, rx
|
||||
@ check for arm920 vs arm926. currently assume all arm926
|
||||
@ devices have an 64 byte FIFO identical to the s3c2440
|
||||
mrc p15, 0, \rd, c0, c0
|
||||
@@ -57,25 +48,22 @@
|
||||
ldr \rd, [ \rx, # S3C2410_UFSTAT ]
|
||||
moveq \rd, \rd, lsr #SHIFT_2440TXF
|
||||
tst \rd, #S3C2410_UFSTAT_TXFULL
|
||||
bne 1003b
|
||||
b 1002f
|
||||
.endm
|
||||
|
||||
1001:
|
||||
@ busy waiting for non fifo
|
||||
ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
|
||||
tst \rd, #S3C2410_UTRSTAT_TXFE
|
||||
beq 1001b
|
||||
.macro fifo_full_s3c2410 rd, rx
|
||||
ldr \rd, [ \rx, # S3C2410_UFSTAT ]
|
||||
tst \rd, #S3C2410_UFSTAT_TXFULL
|
||||
.endm
|
||||
|
||||
1002: @ exit busyuart
|
||||
.endm
|
||||
/* fifo level reading */
|
||||
|
||||
.macro waituart,rd,rx
|
||||
|
||||
ldr \rd, [ \rx, # S3C2410_UFCON ]
|
||||
tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
|
||||
beq 1001f @
|
||||
@ FIFO enabled...
|
||||
1003:
|
||||
.macro fifo_level_s3c24xx rd, rx
|
||||
@ check for arm920 vs arm926. currently assume all arm926
|
||||
@ devices have an 64 byte FIFO identical to the s3c2440
|
||||
mrc p15, 0, \rd, c0, c0
|
||||
and \rd, \rd, #0xff0
|
||||
teq \rd, #0x260
|
||||
beq 10000f
|
||||
mrc p15, 0, \rd, c1, c0
|
||||
tst \rd, #1
|
||||
addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
|
||||
@@ -85,18 +73,32 @@
|
||||
and \rd, \rd, #0x00ff0000
|
||||
teq \rd, #0x00440000 @ is it 2440?
|
||||
|
||||
10000:
|
||||
ldr \rd, [ \rx, # S3C2410_UFSTAT ]
|
||||
andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
|
||||
andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
|
||||
teq \rd, #0
|
||||
bne 1003b
|
||||
b 1002f
|
||||
.endm
|
||||
|
||||
1001:
|
||||
@ idle waiting for non fifo
|
||||
ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
|
||||
tst \rd, #S3C2410_UTRSTAT_TXFE
|
||||
beq 1001b
|
||||
.macro fifo_level_s3c2410 rd, rx
|
||||
ldr \rd, [ \rx, # S3C2410_UFSTAT ]
|
||||
and \rd, \rd, #S3C2410_UFSTAT_TXMASK
|
||||
.endm
|
||||
|
||||
1002: @ exit busyuart
|
||||
.endm
|
||||
/* Select the correct implementation depending on the configuration. The
|
||||
* S3C2440 will get selected by default, as these are the most widely
|
||||
* used variants of these
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_CPU_LLSERIAL_S3C2410_ONLY)
|
||||
#define fifo_full fifo_full_s3c2410
|
||||
#define fifo_level fifo_level_s3c2410
|
||||
#warning 2410only
|
||||
#elif !defined(CONFIG_CPU_LLSERIAL_S3C2440_ONLY)
|
||||
#define fifo_full fifo_full_s3c24xx
|
||||
#define fifo_level fifo_level_s3c24xx
|
||||
#warning generic
|
||||
#endif
|
||||
|
||||
/* include the reset of the code which will do the work */
|
||||
|
||||
#include <asm/plat-s3c/debug-macro.S>
|
||||
|
||||
@@ -13,58 +13,36 @@
|
||||
#ifndef __ASM_ARCH_MAP_H
|
||||
#define __ASM_ARCH_MAP_H
|
||||
|
||||
/* we have a bit of a tight squeeze to fit all our registers from
|
||||
* 0xF00000000 upwards, since we use all of the nGCS space in some
|
||||
* capacity, and also need to fit the S3C2410 registers in as well...
|
||||
*
|
||||
* we try to ensure stuff like the IRQ registers are available for
|
||||
* an single MOVS instruction (ie, only 8 bits of set data)
|
||||
*
|
||||
* Note, we are trying to remove some of these from the implementation
|
||||
* as they are only useful to certain drivers...
|
||||
*/
|
||||
#include <asm/plat-s3c/map.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#define S3C2410_ADDR(x) ((void __iomem __force *)0xF0000000 + (x))
|
||||
#else
|
||||
#define S3C2410_ADDR(x) (0xF0000000 + (x))
|
||||
#endif
|
||||
|
||||
#define S3C2400_ADDR(x) S3C2410_ADDR(x)
|
||||
#define S3C2410_ADDR(x) S3C_ADDR(x)
|
||||
|
||||
/* interrupt controller is the first thing we put in, to make
|
||||
* the assembly code for the irq detection easier
|
||||
*/
|
||||
#define S3C24XX_VA_IRQ S3C2410_ADDR(0x00000000)
|
||||
#define S3C2400_PA_IRQ (0x14400000)
|
||||
#define S3C24XX_VA_IRQ S3C_VA_IRQ
|
||||
#define S3C2410_PA_IRQ (0x4A000000)
|
||||
#define S3C24XX_SZ_IRQ SZ_1M
|
||||
|
||||
/* memory controller registers */
|
||||
#define S3C24XX_VA_MEMCTRL S3C2410_ADDR(0x00100000)
|
||||
#define S3C2400_PA_MEMCTRL (0x14000000)
|
||||
#define S3C24XX_VA_MEMCTRL S3C_VA_MEM
|
||||
#define S3C2410_PA_MEMCTRL (0x48000000)
|
||||
#define S3C24XX_SZ_MEMCTRL SZ_1M
|
||||
|
||||
/* USB host controller */
|
||||
#define S3C2400_PA_USBHOST (0x14200000)
|
||||
#define S3C2410_PA_USBHOST (0x49000000)
|
||||
#define S3C24XX_SZ_USBHOST SZ_1M
|
||||
|
||||
/* DMA controller */
|
||||
#define S3C2400_PA_DMA (0x14600000)
|
||||
#define S3C2410_PA_DMA (0x4B000000)
|
||||
#define S3C24XX_SZ_DMA SZ_1M
|
||||
|
||||
/* Clock and Power management */
|
||||
#define S3C24XX_VA_CLKPWR S3C2410_ADDR(0x00200000)
|
||||
#define S3C2400_PA_CLKPWR (0x14800000)
|
||||
#define S3C24XX_VA_CLKPWR S3C_VA_SYS
|
||||
#define S3C2410_PA_CLKPWR (0x4C000000)
|
||||
#define S3C24XX_SZ_CLKPWR SZ_1M
|
||||
|
||||
/* LCD controller */
|
||||
#define S3C24XX_VA_LCD S3C2410_ADDR(0x00300000)
|
||||
#define S3C2400_PA_LCD (0x14A00000)
|
||||
#define S3C2410_PA_LCD (0x4D000000)
|
||||
#define S3C24XX_SZ_LCD SZ_1M
|
||||
|
||||
@@ -72,41 +50,30 @@
|
||||
#define S3C2410_PA_NAND (0x4E000000)
|
||||
#define S3C24XX_SZ_NAND SZ_1M
|
||||
|
||||
/* MMC controller - available on the S3C2400 */
|
||||
#define S3C2400_PA_MMC (0x15A00000)
|
||||
#define S3C2400_SZ_MMC SZ_1M
|
||||
|
||||
/* UARTs */
|
||||
#define S3C24XX_VA_UART S3C2410_ADDR(0x00400000)
|
||||
#define S3C2400_PA_UART (0x15000000)
|
||||
#define S3C24XX_VA_UART S3C_VA_UART
|
||||
#define S3C2410_PA_UART (0x50000000)
|
||||
#define S3C24XX_SZ_UART SZ_1M
|
||||
|
||||
/* Timers */
|
||||
#define S3C24XX_VA_TIMER S3C2410_ADDR(0x00500000)
|
||||
#define S3C2400_PA_TIMER (0x15100000)
|
||||
#define S3C24XX_VA_TIMER S3C_VA_TIMER
|
||||
#define S3C2410_PA_TIMER (0x51000000)
|
||||
#define S3C24XX_SZ_TIMER SZ_1M
|
||||
|
||||
/* USB Device port */
|
||||
#define S3C24XX_VA_USBDEV S3C2410_ADDR(0x00600000)
|
||||
#define S3C2400_PA_USBDEV (0x15200140)
|
||||
#define S3C2410_PA_USBDEV (0x52000000)
|
||||
#define S3C24XX_SZ_USBDEV SZ_1M
|
||||
|
||||
/* Watchdog */
|
||||
#define S3C24XX_VA_WATCHDOG S3C2410_ADDR(0x00700000)
|
||||
#define S3C2400_PA_WATCHDOG (0x15300000)
|
||||
#define S3C24XX_VA_WATCHDOG S3C_VA_WATCHDOG
|
||||
#define S3C2410_PA_WATCHDOG (0x53000000)
|
||||
#define S3C24XX_SZ_WATCHDOG SZ_1M
|
||||
|
||||
/* IIC hardware controller */
|
||||
#define S3C2400_PA_IIC (0x15400000)
|
||||
#define S3C2410_PA_IIC (0x54000000)
|
||||
#define S3C24XX_SZ_IIC SZ_1M
|
||||
|
||||
/* IIS controller */
|
||||
#define S3C2400_PA_IIS (0x15508000)
|
||||
#define S3C2410_PA_IIS (0x55000000)
|
||||
#define S3C24XX_SZ_IIS SZ_1M
|
||||
|
||||
@@ -116,27 +83,23 @@
|
||||
* it is the same distance apart from the UART in the
|
||||
* phsyical address space, as the initial mapping for the IO
|
||||
* is done as a 1:1 maping. This puts it (currently) at
|
||||
* 0xF6800000, which is not in the way of any current mapping
|
||||
* 0xFA800000, which is not in the way of any current mapping
|
||||
* by the base system.
|
||||
*/
|
||||
|
||||
#define S3C2400_PA_GPIO (0x15600000)
|
||||
#define S3C2410_PA_GPIO (0x56000000)
|
||||
#define S3C24XX_VA_GPIO ((S3C2410_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART)
|
||||
#define S3C24XX_SZ_GPIO SZ_1M
|
||||
|
||||
/* RTC */
|
||||
#define S3C2400_PA_RTC (0x15700040)
|
||||
#define S3C2410_PA_RTC (0x57000000)
|
||||
#define S3C24XX_SZ_RTC SZ_1M
|
||||
|
||||
/* ADC */
|
||||
#define S3C2400_PA_ADC (0x15800000)
|
||||
#define S3C2410_PA_ADC (0x58000000)
|
||||
#define S3C24XX_SZ_ADC SZ_1M
|
||||
|
||||
/* SPI */
|
||||
#define S3C2400_PA_SPI (0x15900000)
|
||||
#define S3C2410_PA_SPI (0x59000000)
|
||||
#define S3C24XX_SZ_SPI SZ_1M
|
||||
|
||||
@@ -177,37 +140,8 @@
|
||||
|
||||
#define S3C2410_SDRAM_PA (S3C2410_CS6)
|
||||
|
||||
#define S3C2400_CS0 (0x00000000)
|
||||
#define S3C2400_CS1 (0x02000000)
|
||||
#define S3C2400_CS2 (0x04000000)
|
||||
#define S3C2400_CS3 (0x06000000)
|
||||
#define S3C2400_CS4 (0x08000000)
|
||||
#define S3C2400_CS5 (0x0A000000)
|
||||
#define S3C2400_CS6 (0x0C000000)
|
||||
#define S3C2400_CS7 (0x0E000000)
|
||||
|
||||
#define S3C2400_SDRAM_PA (S3C2400_CS6)
|
||||
|
||||
/* Use a single interface for common resources between S3C24XX cpus */
|
||||
|
||||
#ifdef CONFIG_CPU_S3C2400
|
||||
#define S3C24XX_PA_IRQ S3C2400_PA_IRQ
|
||||
#define S3C24XX_PA_MEMCTRL S3C2400_PA_MEMCTRL
|
||||
#define S3C24XX_PA_USBHOST S3C2400_PA_USBHOST
|
||||
#define S3C24XX_PA_DMA S3C2400_PA_DMA
|
||||
#define S3C24XX_PA_CLKPWR S3C2400_PA_CLKPWR
|
||||
#define S3C24XX_PA_LCD S3C2400_PA_LCD
|
||||
#define S3C24XX_PA_UART S3C2400_PA_UART
|
||||
#define S3C24XX_PA_TIMER S3C2400_PA_TIMER
|
||||
#define S3C24XX_PA_USBDEV S3C2400_PA_USBDEV
|
||||
#define S3C24XX_PA_WATCHDOG S3C2400_PA_WATCHDOG
|
||||
#define S3C24XX_PA_IIC S3C2400_PA_IIC
|
||||
#define S3C24XX_PA_IIS S3C2400_PA_IIS
|
||||
#define S3C24XX_PA_GPIO S3C2400_PA_GPIO
|
||||
#define S3C24XX_PA_RTC S3C2400_PA_RTC
|
||||
#define S3C24XX_PA_ADC S3C2400_PA_ADC
|
||||
#define S3C24XX_PA_SPI S3C2400_PA_SPI
|
||||
#else
|
||||
#define S3C24XX_PA_IRQ S3C2410_PA_IRQ
|
||||
#define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL
|
||||
#define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST
|
||||
@@ -224,7 +158,6 @@
|
||||
#define S3C24XX_PA_RTC S3C2410_PA_RTC
|
||||
#define S3C24XX_PA_ADC S3C2410_PA_ADC
|
||||
#define S3C24XX_PA_SPI S3C2410_PA_SPI
|
||||
#endif
|
||||
|
||||
/* deal with the registers that move under the 2412/2413 */
|
||||
|
||||
|
||||
@@ -11,20 +11,7 @@
|
||||
#ifndef __ASM_ARCH_MEMORY_H
|
||||
#define __ASM_ARCH_MEMORY_H
|
||||
|
||||
/*
|
||||
* DRAM starts at 0x30000000 for S3C2410/S3C2440
|
||||
* and at 0x0C000000 for S3C2400
|
||||
*/
|
||||
#ifdef CONFIG_CPU_S3C2400
|
||||
#define PHYS_OFFSET UL(0x0C000000)
|
||||
#else
|
||||
#define PHYS_OFFSET UL(0x30000000)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These are exactly the same on the S3C2410 as the
|
||||
* physical memory view.
|
||||
*/
|
||||
|
||||
#define __virt_to_bus(x) __virt_to_phys(x)
|
||||
#define __bus_to_virt(x) __phys_to_virt(x)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifndef ___ASM_ARCH_REGS_LCD_H
|
||||
#define ___ASM_ARCH_REGS_LCD_H "$Id: lcd.h,v 1.3 2003/06/26 13:25:06 ben Exp $"
|
||||
|
||||
#define S3C2410_LCDREG(x) ((x) + S3C24XX_VA_LCD)
|
||||
#define S3C2410_LCDREG(x) (x)
|
||||
|
||||
/* LCD control registers */
|
||||
#define S3C2410_LCDCON1 S3C2410_LCDREG(0x00)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <asm/arch/idle.h>
|
||||
#include <asm/arch/reset.h>
|
||||
|
||||
#include <asm/arch/regs-watchdog.h>
|
||||
#include <asm/plat-s3c/regs-watchdog.h>
|
||||
#include <asm/arch/regs-clock.h>
|
||||
|
||||
void (*s3c24xx_idle)(void);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* linux/include/asm-arm/arch-s3c2410/uncompress.h
|
||||
*
|
||||
* Copyright (c) 2003 Simtec Electronics
|
||||
* Copyright (c) 2003, 2007 Simtec Electronics
|
||||
* http://armlinux.simtec.co.uk/
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* S3C2410 - uncompress code
|
||||
@@ -13,153 +14,39 @@
|
||||
#ifndef __ASM_ARCH_UNCOMPRESS_H
|
||||
#define __ASM_ARCH_UNCOMPRESS_H
|
||||
|
||||
typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
|
||||
|
||||
/* defines for UART registers */
|
||||
#include "asm/arch/regs-serial.h"
|
||||
#include "asm/arch/regs-gpio.h"
|
||||
#include "asm/arch/regs-watchdog.h"
|
||||
|
||||
#include <asm/arch/regs-gpio.h>
|
||||
#include <asm/arch/map.h>
|
||||
|
||||
/* working in physical space... */
|
||||
#undef S3C2410_GPIOREG
|
||||
#undef S3C2410_WDOGREG
|
||||
|
||||
#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
|
||||
#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
|
||||
|
||||
/* how many bytes we allow into the FIFO at a time in FIFO mode */
|
||||
#define FIFO_MAX (14)
|
||||
#include <asm/plat-s3c/uncompress.h>
|
||||
|
||||
#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT)
|
||||
|
||||
static __inline__ void
|
||||
uart_wr(unsigned int reg, unsigned int val)
|
||||
static inline int is_arm926(void)
|
||||
{
|
||||
volatile unsigned int *ptr;
|
||||
unsigned int cpuid;
|
||||
|
||||
ptr = (volatile unsigned int *)(reg + uart_base);
|
||||
*ptr = val;
|
||||
asm volatile ("mrc p15, 0, %0, c1, c0, 0" : "=r" (cpuid));
|
||||
|
||||
return ((cpuid & 0xff0) == 0x260);
|
||||
}
|
||||
|
||||
static __inline__ unsigned int
|
||||
uart_rd(unsigned int reg)
|
||||
static void arch_detect_cpu(void)
|
||||
{
|
||||
volatile unsigned int *ptr;
|
||||
unsigned int cpuid;
|
||||
|
||||
ptr = (volatile unsigned int *)(reg + uart_base);
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
|
||||
/* we can deal with the case the UARTs are being run
|
||||
* in FIFO mode, so that we don't hold up our execution
|
||||
* waiting for tx to happen...
|
||||
*/
|
||||
|
||||
static void putc(int ch)
|
||||
{
|
||||
int cpuid = S3C2410_GSTATUS1_2410;
|
||||
|
||||
#ifndef CONFIG_CPU_S3C2400
|
||||
cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
|
||||
cpuid &= S3C2410_GSTATUS1_IDMASK;
|
||||
#endif
|
||||
|
||||
if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
|
||||
int level;
|
||||
|
||||
while (1) {
|
||||
level = uart_rd(S3C2410_UFSTAT);
|
||||
|
||||
if (cpuid == S3C2410_GSTATUS1_2440 ||
|
||||
cpuid == S3C2410_GSTATUS1_2442) {
|
||||
level &= S3C2440_UFSTAT_TXMASK;
|
||||
level >>= S3C2440_UFSTAT_TXSHIFT;
|
||||
} else {
|
||||
level &= S3C2410_UFSTAT_TXMASK;
|
||||
level >>= S3C2410_UFSTAT_TXSHIFT;
|
||||
}
|
||||
|
||||
if (level < FIFO_MAX)
|
||||
break;
|
||||
}
|
||||
|
||||
if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 ||
|
||||
cpuid == S3C2410_GSTATUS1_2442) {
|
||||
fifo_mask = S3C2440_UFSTAT_TXMASK;
|
||||
fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
|
||||
} else {
|
||||
/* not using fifos */
|
||||
|
||||
while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE)
|
||||
barrier();
|
||||
fifo_mask = S3C2410_UFSTAT_TXMASK;
|
||||
fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT;
|
||||
}
|
||||
|
||||
/* write byte to transmission register */
|
||||
uart_wr(S3C2410_UTXH, ch);
|
||||
}
|
||||
|
||||
static inline void flush(void)
|
||||
{
|
||||
}
|
||||
|
||||
#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0)
|
||||
|
||||
/* CONFIG_S3C2410_BOOT_WATCHDOG
|
||||
*
|
||||
* Simple boot-time watchdog setup, to reboot the system if there is
|
||||
* any problem with the boot process
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_S3C2410_BOOT_WATCHDOG
|
||||
|
||||
#define WDOG_COUNT (0xff00)
|
||||
|
||||
static inline void arch_decomp_wdog(void)
|
||||
{
|
||||
__raw_writel(WDOG_COUNT, S3C2410_WTCNT);
|
||||
}
|
||||
|
||||
static void arch_decomp_wdog_start(void)
|
||||
{
|
||||
__raw_writel(WDOG_COUNT, S3C2410_WTDAT);
|
||||
__raw_writel(WDOG_COUNT, S3C2410_WTCNT);
|
||||
__raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
|
||||
}
|
||||
|
||||
#else
|
||||
#define arch_decomp_wdog_start()
|
||||
#define arch_decomp_wdog()
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_S3C2410_BOOT_ERROR_RESET
|
||||
|
||||
static void arch_decomp_error(const char *x)
|
||||
{
|
||||
putstr("\n\n");
|
||||
putstr(x);
|
||||
putstr("\n\n -- System resetting\n");
|
||||
|
||||
__raw_writel(0x4000, S3C2410_WTDAT);
|
||||
__raw_writel(0x4000, S3C2410_WTCNT);
|
||||
__raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
|
||||
|
||||
while(1);
|
||||
}
|
||||
|
||||
#define arch_error arch_decomp_error
|
||||
#endif
|
||||
|
||||
static void error(char *err);
|
||||
|
||||
static void
|
||||
arch_decomp_setup(void)
|
||||
{
|
||||
/* we may need to setup the uart(s) here if we are not running
|
||||
* on an BAST... the BAST will have left the uarts configured
|
||||
* after calling linux.
|
||||
*/
|
||||
|
||||
arch_decomp_wdog_start();
|
||||
}
|
||||
|
||||
|
||||
#endif /* __ASM_ARCH_UNCOMPRESS_H */
|
||||
|
||||
27
include/asm-arm/arch-sa1100/jornada720.h
Normal file
27
include/asm-arm/arch-sa1100/jornada720.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* include/asm-arm/arch-sa1100/jornada720.h
|
||||
*
|
||||
* This file contains SSP/MCU communication definitions for HP Jornada 710/720/728
|
||||
*
|
||||
* Copyright (C) 2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
|
||||
* Copyright (C) 2000 John Ankcorn <jca@lcs.mit.edu>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
/* HP Jornada 7xx microprocessor commands */
|
||||
#define GETBATTERYDATA 0xc0
|
||||
#define GETSCANKEYCODE 0x90
|
||||
#define GETTOUCHSAMPLES 0xa0
|
||||
#define GETCONTRAST 0xD0
|
||||
#define SETCONTRAST 0xD1
|
||||
#define GETBRIGHTNESS 0xD2
|
||||
#define SETBRIGHTNESS 0xD3
|
||||
#define CONTRASTOFF 0xD8
|
||||
#define BRIGHTNESSOFF 0xD9
|
||||
#define PWMOFF 0xDF
|
||||
#define TXDUMMY 0x11
|
||||
#define ERRORCODE 0x00
|
||||
@@ -426,6 +426,13 @@ static inline void flush_anon_page(struct vm_area_struct *vma,
|
||||
*/
|
||||
#define flush_icache_page(vma,page) do { } while (0)
|
||||
|
||||
static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt,
|
||||
unsigned offset, size_t size)
|
||||
{
|
||||
const void *start = (void __force *)virt + offset;
|
||||
dmac_inv_range(start, start + size);
|
||||
}
|
||||
|
||||
#define __cacheid_present(val) (val != read_cpuid(CPUID_ID))
|
||||
#define __cacheid_type_v7(val) ((val & (7 << 29)) == (4 << 29))
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#ifndef __ASMARM_ELF_H
|
||||
#define __ASMARM_ELF_H
|
||||
|
||||
#include <asm/hwcap.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/*
|
||||
* ELF register definitions..
|
||||
*/
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/user.h>
|
||||
#include <asm/hwcap.h>
|
||||
|
||||
typedef unsigned long elf_greg_t;
|
||||
typedef unsigned long elf_freg_t[3];
|
||||
|
||||
@@ -30,15 +30,21 @@
|
||||
#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
|
||||
#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
|
||||
|
||||
static inline int fd_dma_setup(void *data, unsigned int length,
|
||||
unsigned int mode, unsigned long addr)
|
||||
{
|
||||
set_dma_mode(DMA_FLOPPY, mode);
|
||||
__set_dma_addr(DMA_FLOPPY, data);
|
||||
set_dma_count(DMA_FLOPPY, length);
|
||||
virtual_dma_port = addr;
|
||||
enable_dma(DMA_FLOPPY);
|
||||
return 0;
|
||||
}
|
||||
#define fd_dma_setup fd_dma_setup
|
||||
|
||||
#define fd_request_dma() request_dma(DMA_FLOPPY,"floppy")
|
||||
#define fd_free_dma() free_dma(DMA_FLOPPY)
|
||||
#define fd_disable_dma() disable_dma(DMA_FLOPPY)
|
||||
#define fd_enable_dma() enable_dma(DMA_FLOPPY)
|
||||
#define fd_clear_dma_ff() clear_dma_ff(DMA_FLOPPY)
|
||||
#define fd_set_dma_mode(mode) set_dma_mode(DMA_FLOPPY, (mode))
|
||||
#define fd_set_dma_addr(addr) set_dma_addr(DMA_FLOPPY, virt_to_bus((addr)))
|
||||
#define fd_set_dma_count(len) set_dma_count(DMA_FLOPPY, (len))
|
||||
#define fd_cacheflush(addr,sz)
|
||||
|
||||
/* need to clean up dma.h */
|
||||
#define DMA_FLOPPYDISK DMA_FLOPPY
|
||||
|
||||
@@ -194,6 +194,13 @@ extern int init_atu;
|
||||
#define IOP_TMR_PRIVILEGED 0x08
|
||||
#define IOP_TMR_RATIO_1_1 0x00
|
||||
|
||||
/* Watchdog timer definitions */
|
||||
#define IOP_WDTCR_EN_ARM 0x1e1e1e1e
|
||||
#define IOP_WDTCR_EN 0xe1e1e1e1
|
||||
/* iop3xx does not support stopping the watchdog, so we just re-arm */
|
||||
#define IOP_WDTCR_DIS_ARM (IOP_WDTCR_EN_ARM)
|
||||
#define IOP_WDTCR_DIS (IOP_WDTCR_EN)
|
||||
|
||||
/* Application accelerator unit */
|
||||
#define IOP3XX_AAU_PHYS_BASE (IOP3XX_PERIPHERAL_PHYS_BASE + 0x800)
|
||||
#define IOP3XX_AAU_UPPER_PA (IOP3XX_AAU_PHYS_BASE + 0xa7)
|
||||
@@ -274,6 +281,32 @@ static inline void write_tisr(u32 val)
|
||||
asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (val));
|
||||
}
|
||||
|
||||
static inline u32 read_wdtcr(void)
|
||||
{
|
||||
u32 val;
|
||||
asm volatile("mrc p6, 0, %0, c7, c1, 0":"=r" (val));
|
||||
return val;
|
||||
}
|
||||
static inline void write_wdtcr(u32 val)
|
||||
{
|
||||
asm volatile("mcr p6, 0, %0, c7, c1, 0"::"r" (val));
|
||||
}
|
||||
|
||||
extern unsigned long get_iop_tick_rate(void);
|
||||
|
||||
/* only iop13xx has these registers, we define these to present a
|
||||
* common register interface for the iop_wdt driver.
|
||||
*/
|
||||
#define IOP_RCSR_WDT (0)
|
||||
static inline u32 read_rcsr(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void write_wdtsr(u32 val)
|
||||
{
|
||||
do { } while (0);
|
||||
}
|
||||
|
||||
extern struct platform_device iop3xx_dma_0_channel;
|
||||
extern struct platform_device iop3xx_dma_1_channel;
|
||||
extern struct platform_device iop3xx_aau_channel;
|
||||
|
||||
@@ -74,7 +74,6 @@ static inline int pte_file(pte_t pte) { return 0; }
|
||||
* These would be in other places but having them here reduces the diffs.
|
||||
*/
|
||||
extern unsigned int kobjsize(const void *objp);
|
||||
extern int is_in_rom(unsigned long);
|
||||
|
||||
/*
|
||||
* No page table caches to initialise.
|
||||
@@ -102,7 +101,8 @@ extern int is_in_rom(unsigned long);
|
||||
#define v4_tlb_fns (0)
|
||||
#define v4wb_tlb_fns (0)
|
||||
#define v4wbi_tlb_fns (0)
|
||||
#define v6_tlb_fns (0)
|
||||
#define v6wbi_tlb_fns (0)
|
||||
#define v7wbi_tlb_fns (0)
|
||||
|
||||
#define v3_user_fns (0)
|
||||
#define v4_user_fns (0)
|
||||
|
||||
75
include/asm-arm/plat-s3c/debug-macro.S
Normal file
75
include/asm-arm/plat-s3c/debug-macro.S
Normal file
@@ -0,0 +1,75 @@
|
||||
/* linux/include/asm-arm/plat-s3c/debug-macro.S
|
||||
*
|
||||
* Copyright 2005, 2007 Simtec Electronics
|
||||
* http://armlinux.simtec.co.uk/
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
|
||||
/* The S3C2440 implementations are used by default as they are the
|
||||
* most widely re-used */
|
||||
|
||||
.macro fifo_level_s3c2440 rd, rx
|
||||
ldr \rd, [ \rx, # S3C2410_UFSTAT ]
|
||||
and \rd, \rd, #S3C2440_UFSTAT_TXMASK
|
||||
.endm
|
||||
|
||||
#ifndef fifo_level
|
||||
#define fifo_level fifo_level_s3c2410
|
||||
#endif
|
||||
|
||||
.macro fifo_full_s3c2440 rd, rx
|
||||
ldr \rd, [ \rx, # S3C2410_UFSTAT ]
|
||||
tst \rd, #S3C2440_UFSTAT_TXFULL
|
||||
.endm
|
||||
|
||||
#ifndef fifo_full
|
||||
#define fifo_full fifo_full_s3c2440
|
||||
#endif
|
||||
|
||||
.macro senduart,rd,rx
|
||||
strb \rd, [\rx, # S3C2410_UTXH ]
|
||||
.endm
|
||||
|
||||
.macro busyuart, rd, rx
|
||||
ldr \rd, [ \rx, # S3C2410_UFCON ]
|
||||
tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
|
||||
beq 1001f @
|
||||
@ FIFO enabled...
|
||||
1003:
|
||||
fifo_full \rd, \rx
|
||||
bne 1003b
|
||||
b 1002f
|
||||
|
||||
1001:
|
||||
@ busy waiting for non fifo
|
||||
ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
|
||||
tst \rd, #S3C2410_UTRSTAT_TXFE
|
||||
beq 1001b
|
||||
|
||||
1002: @ exit busyuart
|
||||
.endm
|
||||
|
||||
.macro waituart,rd,rx
|
||||
ldr \rd, [ \rx, # S3C2410_UFCON ]
|
||||
tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
|
||||
beq 1001f @
|
||||
@ FIFO enabled...
|
||||
1003:
|
||||
fifo_level \rd, \rx
|
||||
teq \rd, #0
|
||||
bne 1003b
|
||||
b 1002f
|
||||
1001:
|
||||
@ idle waiting for non fifo
|
||||
ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
|
||||
tst \rd, #S3C2410_UTRSTAT_TXFE
|
||||
beq 1001b
|
||||
|
||||
1002: @ exit busyuart
|
||||
.endm
|
||||
40
include/asm-arm/plat-s3c/map.h
Normal file
40
include/asm-arm/plat-s3c/map.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/* linux/include/asm-arm/plat-s3c/map.h
|
||||
*
|
||||
* Copyright 2003, 2007 Simtec Electronics
|
||||
* http://armlinux.simtec.co.uk/
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* S3C - Memory map definitions (virtual addresses)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_PLAT_MAP_H
|
||||
#define __ASM_PLAT_MAP_H __FILE__
|
||||
|
||||
/* Fit all our registers in at 0xF4000000 upwards, trying to use as
|
||||
* little of the VA space as possible so vmalloc and friends have a
|
||||
* better chance of getting memory.
|
||||
*
|
||||
* we try to ensure stuff like the IRQ registers are available for
|
||||
* an single MOVS instruction (ie, only 8 bits of set data)
|
||||
*/
|
||||
|
||||
#define S3C_ADDR_BASE (0xF4000000)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x))
|
||||
#else
|
||||
#define S3C_ADDR(x) (S3C_ADDR_BASE + (x))
|
||||
#endif
|
||||
|
||||
#define S3C_VA_IRQ S3C_ADDR(0x00000000) /* irq controller(s) */
|
||||
#define S3C_VA_SYS S3C_ADDR(0x00100000) /* system control */
|
||||
#define S3C_VA_MEM S3C_ADDR(0x00200000) /* system control */
|
||||
#define S3C_VA_TIMER S3C_ADDR(0x00300000) /* timer block */
|
||||
#define S3C_VA_WATCHDOG S3C_ADDR(0x00400000) /* watchdog */
|
||||
#define S3C_VA_UART S3C_ADDR(0x01000000) /* UART */
|
||||
|
||||
#endif /* __ASM_PLAT_MAP_H */
|
||||
@@ -32,10 +32,10 @@
|
||||
#ifndef __ASM_ARM_REGS_SERIAL_H
|
||||
#define __ASM_ARM_REGS_SERIAL_H
|
||||
|
||||
#define S3C24XX_VA_UART0 (S3C24XX_VA_UART)
|
||||
#define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 )
|
||||
#define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 )
|
||||
#define S3C24XX_VA_UART3 (S3C24XX_VA_UART + 0xC000 )
|
||||
#define S3C24XX_VA_UART0 (S3C_VA_UART)
|
||||
#define S3C24XX_VA_UART1 (S3C_VA_UART + 0x4000 )
|
||||
#define S3C24XX_VA_UART2 (S3C_VA_UART + 0x8000 )
|
||||
#define S3C24XX_VA_UART3 (S3C_VA_UART + 0xC000 )
|
||||
|
||||
#define S3C2410_PA_UART0 (S3C24XX_PA_UART)
|
||||
#define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 )
|
||||
@@ -14,12 +14,12 @@
|
||||
#ifndef __ASM_ARCH_REGS_TIMER_H
|
||||
#define __ASM_ARCH_REGS_TIMER_H "$Id: timer.h,v 1.4 2003/05/06 19:30:50 ben Exp $"
|
||||
|
||||
#define S3C2410_TIMERREG(x) (S3C24XX_VA_TIMER + (x))
|
||||
#define S3C2410_TIMERREG2(tmr,reg) S3C2410_TIMERREG((reg)+0x0c+((tmr)*0x0c))
|
||||
#define S3C_TIMERREG(x) (S3C_VA_TIMER + (x))
|
||||
#define S3C_TIMERREG2(tmr,reg) S3C_TIMERREG((reg)+0x0c+((tmr)*0x0c))
|
||||
|
||||
#define S3C2410_TCFG0 S3C2410_TIMERREG(0x00)
|
||||
#define S3C2410_TCFG1 S3C2410_TIMERREG(0x04)
|
||||
#define S3C2410_TCON S3C2410_TIMERREG(0x08)
|
||||
#define S3C2410_TCFG0 S3C_TIMERREG(0x00)
|
||||
#define S3C2410_TCFG1 S3C_TIMERREG(0x04)
|
||||
#define S3C2410_TCON S3C_TIMERREG(0x08)
|
||||
|
||||
#define S3C2410_TCFG_PRESCALER0_MASK (255<<0)
|
||||
#define S3C2410_TCFG_PRESCALER1_MASK (255<<8)
|
||||
@@ -71,9 +71,9 @@
|
||||
|
||||
/* WARNING - timer 4 has no buffer reg, and it's observation is at +4 */
|
||||
|
||||
#define S3C2410_TCNTB(tmr) S3C2410_TIMERREG2(tmr, 0x00)
|
||||
#define S3C2410_TCMPB(tmr) S3C2410_TIMERREG2(tmr, 0x04)
|
||||
#define S3C2410_TCNTO(tmr) S3C2410_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08))
|
||||
#define S3C2410_TCNTB(tmr) S3C_TIMERREG2(tmr, 0x00)
|
||||
#define S3C2410_TCMPB(tmr) S3C_TIMERREG2(tmr, 0x04)
|
||||
#define S3C2410_TCNTO(tmr) S3C_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08))
|
||||
|
||||
#define S3C2410_TCON_T4RELOAD (1<<22)
|
||||
#define S3C2410_TCON_T4MANUALUPD (1<<21)
|
||||
@@ -14,11 +14,11 @@
|
||||
#ifndef __ASM_ARCH_REGS_WATCHDOG_H
|
||||
#define __ASM_ARCH_REGS_WATCHDOG_H "$Id: watchdog.h,v 1.2 2003/04/29 13:31:09 ben Exp $"
|
||||
|
||||
#define S3C2410_WDOGREG(x) ((x) + S3C24XX_VA_WATCHDOG)
|
||||
#define S3C_WDOGREG(x) ((x) + S3C_VA_WATCHDOG)
|
||||
|
||||
#define S3C2410_WTCON S3C2410_WDOGREG(0x00)
|
||||
#define S3C2410_WTDAT S3C2410_WDOGREG(0x04)
|
||||
#define S3C2410_WTCNT S3C2410_WDOGREG(0x08)
|
||||
#define S3C2410_WTCON S3C_WDOGREG(0x00)
|
||||
#define S3C2410_WTDAT S3C_WDOGREG(0x04)
|
||||
#define S3C2410_WTCNT S3C_WDOGREG(0x08)
|
||||
|
||||
/* the watchdog can either generate a reset pulse, or an
|
||||
* interrupt.
|
||||
155
include/asm-arm/plat-s3c/uncompress.h
Normal file
155
include/asm-arm/plat-s3c/uncompress.h
Normal file
@@ -0,0 +1,155 @@
|
||||
/* linux/include/asm-arm/plat-s3c/uncompress.h
|
||||
*
|
||||
* Copyright 2003, 2007 Simtec Electronics
|
||||
* http://armlinux.simtec.co.uk/
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* S3C - uncompress code
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_PLAT_UNCOMPRESS_H
|
||||
#define __ASM_PLAT_UNCOMPRESS_H
|
||||
|
||||
typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
|
||||
|
||||
/* uart setup */
|
||||
|
||||
static unsigned int fifo_mask;
|
||||
static unsigned int fifo_max;
|
||||
|
||||
/* forward declerations */
|
||||
|
||||
static void arch_detect_cpu(void);
|
||||
|
||||
/* defines for UART registers */
|
||||
|
||||
#include "asm/plat-s3c/regs-serial.h"
|
||||
#include "asm/plat-s3c/regs-watchdog.h"
|
||||
|
||||
/* working in physical space... */
|
||||
#undef S3C2410_WDOGREG
|
||||
#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
|
||||
|
||||
/* how many bytes we allow into the FIFO at a time in FIFO mode */
|
||||
#define FIFO_MAX (14)
|
||||
|
||||
#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C_LOWLEVEL_UART_PORT)
|
||||
|
||||
static __inline__ void
|
||||
uart_wr(unsigned int reg, unsigned int val)
|
||||
{
|
||||
volatile unsigned int *ptr;
|
||||
|
||||
ptr = (volatile unsigned int *)(reg + uart_base);
|
||||
*ptr = val;
|
||||
}
|
||||
|
||||
static __inline__ unsigned int
|
||||
uart_rd(unsigned int reg)
|
||||
{
|
||||
volatile unsigned int *ptr;
|
||||
|
||||
ptr = (volatile unsigned int *)(reg + uart_base);
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
/* we can deal with the case the UARTs are being run
|
||||
* in FIFO mode, so that we don't hold up our execution
|
||||
* waiting for tx to happen...
|
||||
*/
|
||||
|
||||
static void putc(int ch)
|
||||
{
|
||||
if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
|
||||
int level;
|
||||
|
||||
while (1) {
|
||||
level = uart_rd(S3C2410_UFSTAT);
|
||||
level &= fifo_mask;
|
||||
|
||||
if (level < fifo_max)
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
/* not using fifos */
|
||||
|
||||
while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE)
|
||||
barrier();
|
||||
}
|
||||
|
||||
/* write byte to transmission register */
|
||||
uart_wr(S3C2410_UTXH, ch);
|
||||
}
|
||||
|
||||
static inline void flush(void)
|
||||
{
|
||||
}
|
||||
|
||||
#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0)
|
||||
|
||||
/* CONFIG_S3C_BOOT_WATCHDOG
|
||||
*
|
||||
* Simple boot-time watchdog setup, to reboot the system if there is
|
||||
* any problem with the boot process
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_S3C_BOOT_WATCHDOG
|
||||
|
||||
#define WDOG_COUNT (0xff00)
|
||||
|
||||
static inline void arch_decomp_wdog(void)
|
||||
{
|
||||
__raw_writel(WDOG_COUNT, S3C2410_WTCNT);
|
||||
}
|
||||
|
||||
static void arch_decomp_wdog_start(void)
|
||||
{
|
||||
__raw_writel(WDOG_COUNT, S3C2410_WTDAT);
|
||||
__raw_writel(WDOG_COUNT, S3C2410_WTCNT);
|
||||
__raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
|
||||
}
|
||||
|
||||
#else
|
||||
#define arch_decomp_wdog_start()
|
||||
#define arch_decomp_wdog()
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_S3C_BOOT_ERROR_RESET
|
||||
|
||||
static void arch_decomp_error(const char *x)
|
||||
{
|
||||
putstr("\n\n");
|
||||
putstr(x);
|
||||
putstr("\n\n -- System resetting\n");
|
||||
|
||||
__raw_writel(0x4000, S3C2410_WTDAT);
|
||||
__raw_writel(0x4000, S3C2410_WTCNT);
|
||||
__raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
|
||||
|
||||
while(1);
|
||||
}
|
||||
|
||||
#define arch_error arch_decomp_error
|
||||
#endif
|
||||
|
||||
static void error(char *err);
|
||||
|
||||
static void
|
||||
arch_decomp_setup(void)
|
||||
{
|
||||
/* we may need to setup the uart(s) here if we are not running
|
||||
* on an BAST... the BAST will have left the uarts configured
|
||||
* after calling linux.
|
||||
*/
|
||||
|
||||
arch_detect_cpu();
|
||||
arch_decomp_wdog_start();
|
||||
}
|
||||
|
||||
|
||||
#endif /* __ASM_PLAT_UNCOMPRESS_H */
|
||||
@@ -254,16 +254,6 @@ do { \
|
||||
last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* On SMP systems, when the scheduler does migration-cost autodetection,
|
||||
* it needs a way to flush as much of the CPU's caches as possible.
|
||||
*
|
||||
* TODO: fill this in!
|
||||
*/
|
||||
static inline void sched_cacheflush(void)
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
|
||||
/*
|
||||
* On the StrongARM, "swp" is terminally broken since it bypasses the
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
struct task_struct;
|
||||
struct exec_domain;
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/types.h>
|
||||
#include <asm/domain.h>
|
||||
|
||||
@@ -135,22 +134,19 @@ extern void iwmmxt_task_switch(struct thread_info *);
|
||||
/*
|
||||
* thread information flags:
|
||||
* TIF_SYSCALL_TRACE - syscall trace active
|
||||
* TIF_NOTIFY_RESUME - resumption notification requested
|
||||
* TIF_SIGPENDING - signal pending
|
||||
* TIF_NEED_RESCHED - rescheduling necessary
|
||||
* TIF_USEDFPU - FPU was used by this task this quantum (SMP)
|
||||
* TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED
|
||||
*/
|
||||
#define TIF_NOTIFY_RESUME 0
|
||||
#define TIF_SIGPENDING 1
|
||||
#define TIF_NEED_RESCHED 2
|
||||
#define TIF_SIGPENDING 0
|
||||
#define TIF_NEED_RESCHED 1
|
||||
#define TIF_SYSCALL_TRACE 8
|
||||
#define TIF_POLLING_NRFLAG 16
|
||||
#define TIF_USING_IWMMXT 17
|
||||
#define TIF_MEMDIE 18
|
||||
#define TIF_FREEZE 19
|
||||
|
||||
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
|
||||
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
|
||||
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
|
||||
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
|
||||
|
||||
@@ -60,24 +60,24 @@ extern int __bug_unaligned_x(const void *ptr);
|
||||
__get_unaligned_4_be((__p+4)))
|
||||
|
||||
#define __get_unaligned_le(ptr) \
|
||||
({ \
|
||||
((__force typeof(*(ptr)))({ \
|
||||
const __u8 *__p = (const __u8 *)(ptr); \
|
||||
__builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \
|
||||
__builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_le(__p), \
|
||||
__builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_le(__p), \
|
||||
__builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_le(__p), \
|
||||
(void)__bug_unaligned_x(__p))))); \
|
||||
})
|
||||
}))
|
||||
|
||||
#define __get_unaligned_be(ptr) \
|
||||
({ \
|
||||
((__force typeof(*(ptr)))({ \
|
||||
const __u8 *__p = (const __u8 *)(ptr); \
|
||||
__builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \
|
||||
__builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_be(__p), \
|
||||
__builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_be(__p), \
|
||||
__builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_be(__p), \
|
||||
(void)__bug_unaligned_x(__p))))); \
|
||||
})
|
||||
}))
|
||||
|
||||
|
||||
static inline void __put_unaligned_2_le(__u32 __v, register __u8 *__p)
|
||||
@@ -131,15 +131,16 @@ static inline void __put_unaligned_8_be(const unsigned long long __v, register _
|
||||
*/
|
||||
#define __put_unaligned_le(val,ptr) \
|
||||
({ \
|
||||
(void)sizeof(*(ptr) = (val)); \
|
||||
switch (sizeof(*(ptr))) { \
|
||||
case 1: \
|
||||
*(ptr) = (val); \
|
||||
break; \
|
||||
case 2: __put_unaligned_2_le((val),(__u8 *)(ptr)); \
|
||||
case 2: __put_unaligned_2_le((__force u16)(val),(__u8 *)(ptr)); \
|
||||
break; \
|
||||
case 4: __put_unaligned_4_le((val),(__u8 *)(ptr)); \
|
||||
case 4: __put_unaligned_4_le((__force u32)(val),(__u8 *)(ptr)); \
|
||||
break; \
|
||||
case 8: __put_unaligned_8_le((val),(__u8 *)(ptr)); \
|
||||
case 8: __put_unaligned_8_le((__force u64)(val),(__u8 *)(ptr)); \
|
||||
break; \
|
||||
default: __bug_unaligned_x(ptr); \
|
||||
break; \
|
||||
@@ -149,15 +150,16 @@ static inline void __put_unaligned_8_be(const unsigned long long __v, register _
|
||||
|
||||
#define __put_unaligned_be(val,ptr) \
|
||||
({ \
|
||||
(void)sizeof(*(ptr) = (val)); \
|
||||
switch (sizeof(*(ptr))) { \
|
||||
case 1: \
|
||||
*(ptr) = (val); \
|
||||
break; \
|
||||
case 2: __put_unaligned_2_be((val),(__u8 *)(ptr)); \
|
||||
case 2: __put_unaligned_2_be((__force u16)(val),(__u8 *)(ptr)); \
|
||||
break; \
|
||||
case 4: __put_unaligned_4_be((val),(__u8 *)(ptr)); \
|
||||
case 4: __put_unaligned_4_be((__force u32)(val),(__u8 *)(ptr)); \
|
||||
break; \
|
||||
case 8: __put_unaligned_8_be((val),(__u8 *)(ptr)); \
|
||||
case 8: __put_unaligned_8_be((__force u64)(val),(__u8 *)(ptr)); \
|
||||
break; \
|
||||
default: __bug_unaligned_x(ptr); \
|
||||
break; \
|
||||
|
||||
@@ -441,7 +441,6 @@
|
||||
/*
|
||||
* Unimplemented (or alternatively implemented) syscalls
|
||||
*/
|
||||
#define __IGNORE_sync_file_range 1
|
||||
#define __IGNORE_fadvise64_64 1
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
#define FPSID_REV_MASK (0xF << FPSID_REV_BIT)
|
||||
|
||||
/* FPEXC bits */
|
||||
#define FPEXC_EXCEPTION (1<<31)
|
||||
#define FPEXC_ENABLE (1<<30)
|
||||
#define FPEXC_EX (1 << 31)
|
||||
#define FPEXC_EN (1 << 30)
|
||||
|
||||
/* FPSCR bits */
|
||||
#define FPSCR_DEFAULT_NAN (1<<25)
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#ifndef __ARM_A_OUT_H__
|
||||
#define __ARM_A_OUT_H__
|
||||
|
||||
#include <linux/personality.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
struct exec
|
||||
{
|
||||
__u32 a_info; /* Use macros N_MAGIC, etc for access */
|
||||
__u32 a_text; /* length of text, in bytes */
|
||||
__u32 a_data; /* length of data, in bytes */
|
||||
__u32 a_bss; /* length of uninitialized data area for file, in bytes */
|
||||
__u32 a_syms; /* length of symbol table data in file, in bytes */
|
||||
__u32 a_entry; /* start address */
|
||||
__u32 a_trsize; /* length of relocation info for text, in bytes */
|
||||
__u32 a_drsize; /* length of relocation info for data, in bytes */
|
||||
};
|
||||
|
||||
/*
|
||||
* This is always the same
|
||||
*/
|
||||
#define N_TXTADDR(a) (0x00008000)
|
||||
|
||||
#define N_TRSIZE(a) ((a).a_trsize)
|
||||
#define N_DRSIZE(a) ((a).a_drsize)
|
||||
#define N_SYMSIZE(a) ((a).a_syms)
|
||||
|
||||
#define M_ARM 103
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define STACK_TOP TASK_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef LIBRARY_START_TEXT
|
||||
#define LIBRARY_START_TEXT (0x00c00000)
|
||||
#endif
|
||||
|
||||
#endif /* __A_OUT_GNU_H__ */
|
||||
@@ -1,106 +0,0 @@
|
||||
/*
|
||||
* linux/include/asm-arm26/assembler.h
|
||||
*
|
||||
* This file contains arm architecture specific defines
|
||||
* for the different processors.
|
||||
*
|
||||
* Do not include any C declarations in this file - it is included by
|
||||
* assembler source.
|
||||
*/
|
||||
#ifndef __ASSEMBLY__
|
||||
#error "Only include this from assembly code"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Endian independent macros for shifting bytes within registers.
|
||||
*/
|
||||
#define pull lsr
|
||||
#define push lsl
|
||||
#define byte(x) (x*8)
|
||||
|
||||
#ifdef __STDC__
|
||||
#define LOADREGS(cond, base, reglist...)\
|
||||
ldm##cond base,reglist^
|
||||
|
||||
#define RETINSTR(instr, regs...)\
|
||||
instr##s regs
|
||||
#else
|
||||
#define LOADREGS(cond, base, reglist...)\
|
||||
ldm/**/cond base,reglist^
|
||||
|
||||
#define RETINSTR(instr, regs...)\
|
||||
instr/**/s regs
|
||||
#endif
|
||||
|
||||
#define MODENOP\
|
||||
mov r0, r0
|
||||
|
||||
#define MODE(savereg,tmpreg,mode) \
|
||||
mov savereg, pc; \
|
||||
bic tmpreg, savereg, $0x0c000003; \
|
||||
orr tmpreg, tmpreg, $mode; \
|
||||
teqp tmpreg, $0
|
||||
|
||||
#define RESTOREMODE(savereg) \
|
||||
teqp savereg, $0
|
||||
|
||||
#define SAVEIRQS(tmpreg)
|
||||
|
||||
#define RESTOREIRQS(tmpreg)
|
||||
|
||||
#define DISABLEIRQS(tmpreg)\
|
||||
teqp pc, $0x08000003
|
||||
|
||||
#define ENABLEIRQS(tmpreg)\
|
||||
teqp pc, $0x00000003
|
||||
|
||||
#define USERMODE(tmpreg)\
|
||||
teqp pc, $0x00000000;\
|
||||
mov r0, r0
|
||||
|
||||
#define SVCMODE(tmpreg)\
|
||||
teqp pc, $0x00000003;\
|
||||
mov r0, r0
|
||||
|
||||
|
||||
/*
|
||||
* Save the current IRQ state and disable IRQs
|
||||
* Note that this macro assumes FIQs are enabled, and
|
||||
* that the processor is in SVC mode.
|
||||
*/
|
||||
.macro save_and_disable_irqs, oldcpsr, temp
|
||||
mov \oldcpsr, pc
|
||||
orr \temp, \oldcpsr, #0x08000000
|
||||
teqp \temp, #0
|
||||
.endm
|
||||
|
||||
/*
|
||||
* Restore interrupt state previously stored in
|
||||
* a register
|
||||
* ** Actually do nothing on Arc - hope that the caller uses a MOVS PC soon
|
||||
* after!
|
||||
*/
|
||||
.macro restore_irqs, oldcpsr
|
||||
@ This be restore_irqs
|
||||
.endm
|
||||
|
||||
/*
|
||||
* These two are used to save LR/restore PC over a user-based access.
|
||||
* The old 26-bit architecture requires that we save lr (R14)
|
||||
*/
|
||||
.macro save_lr
|
||||
str lr, [sp, #-4]!
|
||||
.endm
|
||||
|
||||
.macro restore_pc
|
||||
ldmfd sp!, {pc}^
|
||||
.endm
|
||||
|
||||
#define USER(x...) \
|
||||
9999: x; \
|
||||
.section __ex_table,"a"; \
|
||||
.align 3; \
|
||||
.long 9999b,9001f; \
|
||||
.previous
|
||||
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* linux/include/asm-arm26/atomic.h
|
||||
*
|
||||
* Copyright (c) 1996 Russell King.
|
||||
* Modified for arm26 by Ian Molton
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Changelog:
|
||||
* 25-11-2004 IM Updated for 2.6.9
|
||||
* 27-06-1996 RMK Created
|
||||
* 13-04-1997 RMK Made functions atomic!
|
||||
* 07-12-1997 RMK Upgraded for v2.1.
|
||||
* 26-08-1998 PJB Added #ifdef __KERNEL__
|
||||
*
|
||||
* FIXME - its probably worth seeing what these compile into...
|
||||
*/
|
||||
#ifndef __ASM_ARM_ATOMIC_H
|
||||
#define __ASM_ARM_ATOMIC_H
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#error SMP is NOT supported
|
||||
#endif
|
||||
|
||||
typedef struct { volatile int counter; } atomic_t;
|
||||
|
||||
#define ATOMIC_INIT(i) { (i) }
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/system.h>
|
||||
|
||||
#define atomic_read(v) ((v)->counter)
|
||||
#define atomic_set(v,i) (((v)->counter) = (i))
|
||||
|
||||
static inline int atomic_add_return(int i, atomic_t *v)
|
||||
{
|
||||
unsigned long flags;
|
||||
int val;
|
||||
|
||||
local_irq_save(flags);
|
||||
val = v->counter;
|
||||
v->counter = val += i;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline int atomic_sub_return(int i, atomic_t *v)
|
||||
{
|
||||
unsigned long flags;
|
||||
int val;
|
||||
|
||||
local_irq_save(flags);
|
||||
val = v->counter;
|
||||
v->counter = val -= i;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
|
||||
{
|
||||
int ret;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
ret = v->counter;
|
||||
if (likely(ret == old))
|
||||
v->counter = new;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
|
||||
|
||||
static inline int atomic_add_unless(atomic_t *v, int a, int u)
|
||||
{
|
||||
int ret;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
ret = v->counter;
|
||||
if (ret != u)
|
||||
v->counter += a;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return ret != u;
|
||||
}
|
||||
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
|
||||
|
||||
static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
*addr &= ~mask;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
#define atomic_add(i, v) (void) atomic_add_return(i, v)
|
||||
#define atomic_inc(v) (void) atomic_add_return(1, v)
|
||||
#define atomic_sub(i, v) (void) atomic_sub_return(i, v)
|
||||
#define atomic_dec(v) (void) atomic_sub_return(1, v)
|
||||
|
||||
#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0)
|
||||
#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
|
||||
#define atomic_inc_return(v) (atomic_add_return(1, v))
|
||||
#define atomic_dec_return(v) (atomic_sub_return(1, v))
|
||||
|
||||
#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
|
||||
|
||||
/* Atomic operations are already serializing on ARM26 */
|
||||
#define smp_mb__before_atomic_dec() barrier()
|
||||
#define smp_mb__after_atomic_dec() barrier()
|
||||
#define smp_mb__before_atomic_inc() barrier()
|
||||
#define smp_mb__after_atomic_inc() barrier()
|
||||
|
||||
#include <asm-generic/atomic.h>
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,4 +0,0 @@
|
||||
#ifndef __ASMARM_AUXVEC_H
|
||||
#define __ASMARM_AUXVEC_H
|
||||
|
||||
#endif
|
||||
@@ -1,207 +0,0 @@
|
||||
/*
|
||||
* Copyright 1995, Russell King.
|
||||
*
|
||||
* Based on the arm32 version by RMK (and others). Their copyrights apply to
|
||||
* Those parts.
|
||||
* Modified for arm26 by Ian Molton on 25/11/04
|
||||
*
|
||||
* bit 0 is the LSB of an "unsigned long" quantity.
|
||||
*
|
||||
* Please note that the code in this file should never be included
|
||||
* from user space. Many of these are not implemented in assembler
|
||||
* since they would be too costly. Also, they require privileged
|
||||
* instructions (which are not available from user mode) to ensure
|
||||
* that they are atomic.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARM_BITOPS_H
|
||||
#define __ASM_ARM_BITOPS_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
#define smp_mb__before_clear_bit() do { } while (0)
|
||||
#define smp_mb__after_clear_bit() do { } while (0)
|
||||
|
||||
/*
|
||||
* These functions are the basis of our bit ops.
|
||||
*
|
||||
* First, the atomic bitops. These use native endian.
|
||||
*/
|
||||
static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
local_irq_save(flags);
|
||||
*p |= mask;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
local_irq_save(flags);
|
||||
*p &= ~mask;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
local_irq_save(flags);
|
||||
*p ^= mask;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static inline int
|
||||
____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned int res;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
local_irq_save(flags);
|
||||
res = *p;
|
||||
*p = res | mask;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return res & mask;
|
||||
}
|
||||
|
||||
static inline int
|
||||
____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned int res;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
local_irq_save(flags);
|
||||
res = *p;
|
||||
*p = res & ~mask;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return res & mask;
|
||||
}
|
||||
|
||||
static inline int
|
||||
____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned int res;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
local_irq_save(flags);
|
||||
res = *p;
|
||||
*p = res ^ mask;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return res & mask;
|
||||
}
|
||||
|
||||
#include <asm-generic/bitops/non-atomic.h>
|
||||
|
||||
/*
|
||||
* Little endian assembly bitops. nr = 0 -> byte 0 bit 0.
|
||||
*/
|
||||
extern void _set_bit_le(int nr, volatile unsigned long * p);
|
||||
extern void _clear_bit_le(int nr, volatile unsigned long * p);
|
||||
extern void _change_bit_le(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_set_bit_le(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_change_bit_le(int nr, volatile unsigned long * p);
|
||||
extern int _find_first_zero_bit_le(const unsigned long * p, unsigned size);
|
||||
extern int _find_next_zero_bit_le(void * p, int size, int offset);
|
||||
extern int _find_first_bit_le(const unsigned long *p, unsigned size);
|
||||
extern int _find_next_bit_le(const unsigned long *p, int size, int offset);
|
||||
|
||||
/*
|
||||
* The __* form of bitops are non-atomic and may be reordered.
|
||||
*/
|
||||
#define ATOMIC_BITOP_LE(name,nr,p) \
|
||||
(__builtin_constant_p(nr) ? \
|
||||
____atomic_##name(nr, p) : \
|
||||
_##name##_le(nr,p))
|
||||
|
||||
#define NONATOMIC_BITOP(name,nr,p) \
|
||||
(____nonatomic_##name(nr, p))
|
||||
|
||||
/*
|
||||
* These are the little endian, atomic definitions.
|
||||
*/
|
||||
#define set_bit(nr,p) ATOMIC_BITOP_LE(set_bit,nr,p)
|
||||
#define clear_bit(nr,p) ATOMIC_BITOP_LE(clear_bit,nr,p)
|
||||
#define change_bit(nr,p) ATOMIC_BITOP_LE(change_bit,nr,p)
|
||||
#define test_and_set_bit(nr,p) ATOMIC_BITOP_LE(test_and_set_bit,nr,p)
|
||||
#define test_and_clear_bit(nr,p) ATOMIC_BITOP_LE(test_and_clear_bit,nr,p)
|
||||
#define test_and_change_bit(nr,p) ATOMIC_BITOP_LE(test_and_change_bit,nr,p)
|
||||
#define find_first_zero_bit(p,sz) _find_first_zero_bit_le(p,sz)
|
||||
#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_le(p,sz,off)
|
||||
#define find_first_bit(p,sz) _find_first_bit_le(p,sz)
|
||||
#define find_next_bit(p,sz,off) _find_next_bit_le(p,sz,off)
|
||||
|
||||
#define WORD_BITOFF_TO_LE(x) ((x))
|
||||
|
||||
#include <asm-generic/bitops/ffz.h>
|
||||
#include <asm-generic/bitops/__ffs.h>
|
||||
#include <asm-generic/bitops/fls.h>
|
||||
#include <asm-generic/bitops/fls64.h>
|
||||
#include <asm-generic/bitops/ffs.h>
|
||||
#include <asm-generic/bitops/sched.h>
|
||||
#include <asm-generic/bitops/hweight.h>
|
||||
|
||||
/*
|
||||
* Ext2 is defined to use little-endian byte ordering.
|
||||
* These do not need to be atomic.
|
||||
*/
|
||||
#define ext2_set_bit(nr,p) \
|
||||
__test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
|
||||
#define ext2_set_bit_atomic(lock,nr,p) \
|
||||
test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
|
||||
#define ext2_clear_bit(nr,p) \
|
||||
__test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
|
||||
#define ext2_clear_bit_atomic(lock,nr,p) \
|
||||
test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
|
||||
#define ext2_test_bit(nr,p) \
|
||||
test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
|
||||
#define ext2_find_first_zero_bit(p,sz) \
|
||||
_find_first_zero_bit_le(p,sz)
|
||||
#define ext2_find_next_zero_bit(p,sz,off) \
|
||||
_find_next_zero_bit_le(p,sz,off)
|
||||
|
||||
/*
|
||||
* Minix is defined to use little-endian byte ordering.
|
||||
* These do not need to be atomic.
|
||||
*/
|
||||
#define minix_set_bit(nr,p) \
|
||||
__set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
|
||||
#define minix_test_bit(nr,p) \
|
||||
test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
|
||||
#define minix_test_and_set_bit(nr,p) \
|
||||
__test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
|
||||
#define minix_test_and_clear_bit(nr,p) \
|
||||
__test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
|
||||
#define minix_find_first_zero_bit(p,sz) \
|
||||
_find_first_zero_bit_le((unsigned long *)(p),sz)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _ARM_BITOPS_H */
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef _ASMARM_BUG_H
|
||||
#define _ASMARM_BUG_H
|
||||
|
||||
|
||||
#ifdef CONFIG_BUG
|
||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||
extern volatile void __bug(const char *file, int line, void *data);
|
||||
/* give file/line information */
|
||||
#define BUG() __bug(__FILE__, __LINE__, NULL)
|
||||
#else
|
||||
#define BUG() (*(int *)0 = 0)
|
||||
#endif
|
||||
|
||||
#define HAVE_ARCH_BUG
|
||||
#endif
|
||||
|
||||
#include <asm-generic/bug.h>
|
||||
|
||||
#endif
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* linux/include/asm-arm26/bugs.h
|
||||
*
|
||||
* Copyright (C) 1995 Russell King
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __ASM_BUGS_H
|
||||
#define __ASM_BUGS_H
|
||||
|
||||
#define check_bugs() cpu_check_bugs()
|
||||
|
||||
#endif
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* linux/include/asm-arm/byteorder.h
|
||||
*
|
||||
* ARM Endian-ness. In little endian mode, the data bus is connected such
|
||||
* that byte accesses appear as:
|
||||
* 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
|
||||
* and word accesses (data or instruction) appear as:
|
||||
* d0...d31
|
||||
*
|
||||
*/
|
||||
#ifndef __ASM_ARM_BYTEORDER_H
|
||||
#define __ASM_ARM_BYTEORDER_H
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
|
||||
# define __BYTEORDER_HAS_U64__
|
||||
# define __SWAB_64_THRU_32__
|
||||
#endif
|
||||
|
||||
#include <linux/byteorder/little_endian.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
* linux/include/asm-arm26/cache.h
|
||||
*/
|
||||
#ifndef __ASMARM_CACHE_H
|
||||
#define __ASMARM_CACHE_H
|
||||
|
||||
#define L1_CACHE_SHIFT 5
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
|
||||
#define SMP_CACHE_BYTES L1_CACHE_BYTES
|
||||
|
||||
#endif
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* linux/include/asm-arm/cacheflush.h
|
||||
*
|
||||
* Copyright (C) 2000-2002 Russell King
|
||||
* Copyright (C) 2003 Ian Molton
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* ARM26 cache 'functions'
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ASMARM_CACHEFLUSH_H
|
||||
#define _ASMARM_CACHEFLUSH_H
|
||||
|
||||
#if 1 //FIXME - BAD INCLUDES!!!
|
||||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#endif
|
||||
|
||||
#define flush_cache_all() do { } while (0)
|
||||
#define flush_cache_mm(mm) do { } while (0)
|
||||
#define flush_cache_dup_mm(mm) do { } while (0)
|
||||
#define flush_cache_range(vma,start,end) do { } while (0)
|
||||
#define flush_cache_page(vma,vmaddr,pfn) do { } while (0)
|
||||
#define flush_cache_vmap(start, end) do { } while (0)
|
||||
#define flush_cache_vunmap(start, end) do { } while (0)
|
||||
|
||||
#define invalidate_dcache_range(start,end) do { } while (0)
|
||||
#define clean_dcache_range(start,end) do { } while (0)
|
||||
#define flush_dcache_range(start,end) do { } while (0)
|
||||
#define flush_dcache_page(page) do { } while (0)
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
#define clean_dcache_entry(_s) do { } while (0)
|
||||
#define clean_cache_entry(_start) do { } while (0)
|
||||
|
||||
#define flush_icache_user_range(start,end, bob, fred) do { } while (0)
|
||||
#define flush_icache_range(start,end) do { } while (0)
|
||||
#define flush_icache_page(vma,page) do { } while (0)
|
||||
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
|
||||
/* DAG: ARM3 will flush cache on MEMC updates anyway? so don't bother */
|
||||
/* IM : Yes, it will, but only if setup to do so (we do this). */
|
||||
#define clean_cache_area(_start,_size) do { } while (0)
|
||||
|
||||
#endif
|
||||
@@ -1,151 +0,0 @@
|
||||
/*
|
||||
* linux/include/asm-arm/checksum.h
|
||||
*
|
||||
* IP checksum routines
|
||||
*
|
||||
* Copyright (C) Original authors of ../asm-i386/checksum.h
|
||||
* Copyright (C) 1996-1999 Russell King
|
||||
*/
|
||||
#ifndef __ASM_ARM_CHECKSUM_H
|
||||
#define __ASM_ARM_CHECKSUM_H
|
||||
|
||||
#include <linux/in6.h>
|
||||
|
||||
/*
|
||||
* computes the checksum of a memory block at buff, length len,
|
||||
* and adds in "sum" (32-bit)
|
||||
*
|
||||
* returns a 32-bit number suitable for feeding into itself
|
||||
* or csum_tcpudp_magic
|
||||
*
|
||||
* this function must be called with even lengths, except
|
||||
* for the last fragment, which may be odd
|
||||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
* checksums, and handles user-space pointer exceptions correctly, when needed.
|
||||
*
|
||||
* here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
__wsum
|
||||
csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
|
||||
|
||||
__wsum
|
||||
csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr);
|
||||
|
||||
/*
|
||||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*/
|
||||
static inline __sum16
|
||||
ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int sum, tmp1;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"ldr %0, [%1], #4 @ ip_fast_csum \n\
|
||||
ldr %3, [%1], #4 \n\
|
||||
sub %2, %2, #5 \n\
|
||||
adds %0, %0, %3 \n\
|
||||
ldr %3, [%1], #4 \n\
|
||||
adcs %0, %0, %3 \n\
|
||||
ldr %3, [%1], #4 \n\
|
||||
1: adcs %0, %0, %3 \n\
|
||||
ldr %3, [%1], #4 \n\
|
||||
tst %2, #15 @ do this carefully \n\
|
||||
subne %2, %2, #1 @ without destroying \n\
|
||||
bne 1b @ the carry flag \n\
|
||||
adcs %0, %0, %3 \n\
|
||||
adc %0, %0, #0 \n\
|
||||
adds %0, %0, %0, lsl #16 \n\
|
||||
addcs %0, %0, #0x10000 \n\
|
||||
mvn %0, %0 \n\
|
||||
mov %0, %0, lsr #16"
|
||||
: "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
|
||||
: "1" (iph), "2" (ihl)
|
||||
: "cc");
|
||||
return (__force __sum16)sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fold a partial checksum without adding pseudo headers
|
||||
*/
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"adds %0, %1, %1, lsl #16 @ csum_fold \n\
|
||||
addcs %0, %0, #0x10000"
|
||||
: "=r" (sum)
|
||||
: "r" (sum)
|
||||
: "cc");
|
||||
return (__force __sum16)(~(__force u32)sum >> 16);
|
||||
}
|
||||
|
||||
static inline __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"adds %0, %1, %2 @ csum_tcpudp_nofold \n\
|
||||
adcs %0, %0, %3 \n\
|
||||
adcs %0, %0, %4 \n\
|
||||
adcs %0, %0, %5 \n\
|
||||
adc %0, %0, #0"
|
||||
: "=&r"(sum)
|
||||
: "r" (sum), "r" (daddr), "r" (saddr), "r" (htons(len)), "Ir" (htons(proto))
|
||||
: "cc");
|
||||
return sum;
|
||||
}
|
||||
/*
|
||||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static inline __sum16
|
||||
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"adds %0, %1, %2 @ csum_tcpudp_magic \n\
|
||||
adcs %0, %0, %3 \n\
|
||||
adcs %0, %0, %4 \n\
|
||||
adcs %0, %0, %5 \n\
|
||||
adc %0, %0, #0 \n\
|
||||
adds %0, %0, %0, lsl #16 \n\
|
||||
addcs %0, %0, #0x10000 \n\
|
||||
mvn %0, %0"
|
||||
: "=&r"(sum)
|
||||
: "r" (sum), "r" (daddr), "r" (saddr), "r" (htons(len)), "Ir" (htons(proto))
|
||||
: "cc");
|
||||
return (__force __sum16)((__force u32)sum >> 16);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* this routine is used for miscellaneous IP-like checksums, mainly
|
||||
* in icmp.c
|
||||
*/
|
||||
static inline __sum16
|
||||
ip_compute_csum(const void *buff, int len)
|
||||
{
|
||||
return csum_fold(csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
extern __wsum
|
||||
__csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __be32 len,
|
||||
__be32 proto, __wsum sum);
|
||||
|
||||
static inline __sum16
|
||||
csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len),
|
||||
htonl(proto), sum));
|
||||
}
|
||||
#endif
|
||||
@@ -1,28 +0,0 @@
|
||||
#ifndef __ASM_OFFSETS_H__
|
||||
#define __ASM_OFFSETS_H__
|
||||
/*
|
||||
* DO NOT MODIFY.
|
||||
*
|
||||
* This file was generated by arch/arm26/Makefile
|
||||
*
|
||||
*/
|
||||
|
||||
#define TSK_ACTIVE_MM 96 /* offsetof(struct task_struct, active_mm) */
|
||||
|
||||
#define VMA_VM_MM 0 /* offsetof(struct vm_area_struct, vm_mm) */
|
||||
#define VMA_VM_FLAGS 20 /* offsetof(struct vm_area_struct, vm_flags) */
|
||||
|
||||
#define VM_EXEC 4 /* VM_EXEC */
|
||||
|
||||
|
||||
#define PAGE_PRESENT 1 /* L_PTE_PRESENT */
|
||||
#define PAGE_READONLY 95 /* PAGE_READONLY */
|
||||
#define PAGE_NOT_USER 3 /* PAGE_NONE */
|
||||
#define PAGE_OLD 3 /* PAGE_NONE */
|
||||
#define PAGE_CLEAN 128 /* L_PTE_DIRTY */
|
||||
|
||||
#define PAGE_SZ 32768 /* PAGE_SIZE */
|
||||
|
||||
#define SYS_ERROR0 10420224 /* 0x9f0000 */
|
||||
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __ARM26_CPUTIME_H
|
||||
#define __ARM26_CPUTIME_H
|
||||
|
||||
#include <asm-generic/cputime.h>
|
||||
|
||||
#endif /* __ARM26_CPUTIME_H */
|
||||
@@ -1,15 +0,0 @@
|
||||
#ifndef _ASMARM_CURRENT_H
|
||||
#define _ASMARM_CURRENT_H
|
||||
|
||||
#include <linux/thread_info.h>
|
||||
|
||||
static inline struct task_struct *get_current(void) __attribute_const__;
|
||||
|
||||
static inline struct task_struct *get_current(void)
|
||||
{
|
||||
return current_thread_info()->task;
|
||||
}
|
||||
|
||||
#define current (get_current())
|
||||
|
||||
#endif /* _ASMARM_CURRENT_H */
|
||||
@@ -1,34 +0,0 @@
|
||||
#ifndef __ASM_ARM_DELAY_H
|
||||
#define __ASM_ARM_DELAY_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995 Russell King
|
||||
*
|
||||
* Delay routines, using a pre-computed "loops_per_second" value.
|
||||
*/
|
||||
|
||||
extern void __delay(int loops);
|
||||
|
||||
/*
|
||||
* division by multiplication: you don't have to worry about
|
||||
* loss of precision.
|
||||
*
|
||||
* Use only for very small delays ( < 1 msec). Should probably use a
|
||||
* lookup table, really, as the multiplications take much too long with
|
||||
* short delays. This is a "reasonable" implementation, though (and the
|
||||
* first constant multiplications gets optimized away if the delay is
|
||||
* a constant)
|
||||
*
|
||||
* FIXME - lets improve it then...
|
||||
*/
|
||||
extern void udelay(unsigned long usecs);
|
||||
|
||||
static inline unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
|
||||
{
|
||||
return a * b / c;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* defined(_ARM_DELAY_H) */
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
#ifndef __ASM_ARM_DMA_H
|
||||
#define __ASM_ARM_DMA_H
|
||||
|
||||
typedef unsigned int dmach_t;
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/memory.h>
|
||||
#include <asm/scatterlist.h>
|
||||
|
||||
// FIXME - do we really need this? arm26 cant do 'proper' DMA
|
||||
|
||||
typedef struct dma_struct dma_t;
|
||||
typedef unsigned int dmamode_t;
|
||||
|
||||
struct dma_ops {
|
||||
int (*request)(dmach_t, dma_t *); /* optional */
|
||||
void (*free)(dmach_t, dma_t *); /* optional */
|
||||
void (*enable)(dmach_t, dma_t *); /* mandatory */
|
||||
void (*disable)(dmach_t, dma_t *); /* mandatory */
|
||||
int (*residue)(dmach_t, dma_t *); /* optional */
|
||||
int (*setspeed)(dmach_t, dma_t *, int); /* optional */
|
||||
char *type;
|
||||
};
|
||||
|
||||
struct dma_struct {
|
||||
struct scatterlist buf; /* single DMA */
|
||||
int sgcount; /* number of DMA SG */
|
||||
struct scatterlist *sg; /* DMA Scatter-Gather List */
|
||||
|
||||
unsigned int active:1; /* Transfer active */
|
||||
unsigned int invalid:1; /* Address/Count changed */
|
||||
unsigned int using_sg:1; /* using scatter list? */
|
||||
dmamode_t dma_mode; /* DMA mode */
|
||||
int speed; /* DMA speed */
|
||||
|
||||
unsigned int lock; /* Device is allocated */
|
||||
const char *device_id; /* Device name */
|
||||
|
||||
unsigned int dma_base; /* Controller base address */
|
||||
int dma_irq; /* Controller IRQ */
|
||||
int state; /* Controller state */
|
||||
struct scatterlist cur_sg; /* Current controller buffer */
|
||||
|
||||
struct dma_ops *d_ops;
|
||||
};
|
||||
|
||||
/* Prototype: void arch_dma_init(dma)
|
||||
* Purpose : Initialise architecture specific DMA
|
||||
* Params : dma - pointer to array of DMA structures
|
||||
*/
|
||||
extern void arch_dma_init(dma_t *dma);
|
||||
|
||||
extern void isa_init_dma(dma_t *dma);
|
||||
|
||||
|
||||
#define MAX_DMA_ADDRESS 0x03000000
|
||||
#define MAX_DMA_CHANNELS 3
|
||||
|
||||
/* ARC */
|
||||
#define DMA_VIRTUAL_FLOPPY0 0
|
||||
#define DMA_VIRTUAL_FLOPPY1 1
|
||||
#define DMA_VIRTUAL_SOUND 2
|
||||
|
||||
/* A5K */
|
||||
#define DMA_FLOPPY 0
|
||||
|
||||
/*
|
||||
* DMA modes
|
||||
*/
|
||||
#define DMA_MODE_MASK 3
|
||||
|
||||
#define DMA_MODE_READ 0
|
||||
#define DMA_MODE_WRITE 1
|
||||
#define DMA_MODE_CASCADE 2
|
||||
#define DMA_AUTOINIT 4
|
||||
|
||||
extern spinlock_t dma_spin_lock;
|
||||
|
||||
static inline unsigned long claim_dma_lock(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
spin_lock_irqsave(&dma_spin_lock, flags);
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline void release_dma_lock(unsigned long flags)
|
||||
{
|
||||
spin_unlock_irqrestore(&dma_spin_lock, flags);
|
||||
}
|
||||
|
||||
/* Clear the 'DMA Pointer Flip Flop'.
|
||||
* Write 0 for LSB/MSB, 1 for MSB/LSB access.
|
||||
*/
|
||||
#define clear_dma_ff(channel)
|
||||
|
||||
/* Set only the page register bits of the transfer address.
|
||||
*
|
||||
* NOTE: This is an architecture specific function, and should
|
||||
* be hidden from the drivers
|
||||
*/
|
||||
extern void set_dma_page(dmach_t channel, char pagenr);
|
||||
|
||||
/* Request a DMA channel
|
||||
*
|
||||
* Some architectures may need to do allocate an interrupt
|
||||
*/
|
||||
extern int request_dma(dmach_t channel, const char * device_id);
|
||||
|
||||
/* Free a DMA channel
|
||||
*
|
||||
* Some architectures may need to do free an interrupt
|
||||
*/
|
||||
extern void free_dma(dmach_t channel);
|
||||
|
||||
/* Enable DMA for this channel
|
||||
*
|
||||
* On some architectures, this may have other side effects like
|
||||
* enabling an interrupt and setting the DMA registers.
|
||||
*/
|
||||
extern void enable_dma(dmach_t channel);
|
||||
|
||||
/* Disable DMA for this channel
|
||||
*
|
||||
* On some architectures, this may have other side effects like
|
||||
* disabling an interrupt or whatever.
|
||||
*/
|
||||
extern void disable_dma(dmach_t channel);
|
||||
|
||||
/* Test whether the specified channel has an active DMA transfer
|
||||
*/
|
||||
extern int dma_channel_active(dmach_t channel);
|
||||
|
||||
/* Set the DMA scatter gather list for this channel
|
||||
*
|
||||
* This should not be called if a DMA channel is enabled,
|
||||
* especially since some DMA architectures don't update the
|
||||
* DMA address immediately, but defer it to the enable_dma().
|
||||
*/
|
||||
extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg);
|
||||
|
||||
/* Set the DMA address for this channel
|
||||
*
|
||||
* This should not be called if a DMA channel is enabled,
|
||||
* especially since some DMA architectures don't update the
|
||||
* DMA address immediately, but defer it to the enable_dma().
|
||||
*/
|
||||
extern void set_dma_addr(dmach_t channel, unsigned long physaddr);
|
||||
|
||||
/* Set the DMA byte count for this channel
|
||||
*
|
||||
* This should not be called if a DMA channel is enabled,
|
||||
* especially since some DMA architectures don't update the
|
||||
* DMA count immediately, but defer it to the enable_dma().
|
||||
*/
|
||||
extern void set_dma_count(dmach_t channel, unsigned long count);
|
||||
|
||||
/* Set the transfer direction for this channel
|
||||
*
|
||||
* This should not be called if a DMA channel is enabled,
|
||||
* especially since some DMA architectures don't update the
|
||||
* DMA transfer direction immediately, but defer it to the
|
||||
* enable_dma().
|
||||
*/
|
||||
extern void set_dma_mode(dmach_t channel, dmamode_t mode);
|
||||
|
||||
/* Set the transfer speed for this channel
|
||||
*/
|
||||
extern void set_dma_speed(dmach_t channel, int cycle_ns);
|
||||
|
||||
/* Get DMA residue count. After a DMA transfer, this
|
||||
* should return zero. Reading this while a DMA transfer is
|
||||
* still in progress will return unpredictable results.
|
||||
* If called before the channel has been used, it may return 1.
|
||||
* Otherwise, it returns the number of _bytes_ left to transfer.
|
||||
*/
|
||||
extern int get_dma_residue(dmach_t channel);
|
||||
|
||||
#ifndef NO_DMA
|
||||
#define NO_DMA 255
|
||||
#endif
|
||||
|
||||
#endif /* _ARM_DMA_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user