Merge branches 'at91', 'cache', 'cup', 'ep93xx', 'ixp4xx', 'nuc', 'pending-dma-streaming', 'u300' and 'umc' into devel
This commit is contained in:
parent
c9a8fdd8b3
2ef7f3dbd7
2725898fc9
1587a373f0
e00d9d4b17
6d636c68e9
2ffe2da3e7
cd71f8f48e
ae1402022e
commit
3560adf620
963 changed files with 28260 additions and 8148 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -37,6 +37,7 @@ modules.builtin
|
||||||
tags
|
tags
|
||||||
TAGS
|
TAGS
|
||||||
vmlinux
|
vmlinux
|
||||||
|
vmlinuz
|
||||||
System.map
|
System.map
|
||||||
Module.markers
|
Module.markers
|
||||||
Module.symvers
|
Module.symvers
|
||||||
|
|
|
@ -88,12 +88,12 @@ changes occur:
|
||||||
This is used primarily during fault processing.
|
This is used primarily during fault processing.
|
||||||
|
|
||||||
5) void update_mmu_cache(struct vm_area_struct *vma,
|
5) void update_mmu_cache(struct vm_area_struct *vma,
|
||||||
unsigned long address, pte_t pte)
|
unsigned long address, pte_t *ptep)
|
||||||
|
|
||||||
At the end of every page fault, this routine is invoked to
|
At the end of every page fault, this routine is invoked to
|
||||||
tell the architecture specific code that a translation
|
tell the architecture specific code that a translation
|
||||||
described by "pte" now exists at virtual address "address"
|
now exists at virtual address "address" for address space
|
||||||
for address space "vma->vm_mm", in the software page tables.
|
"vma->vm_mm", in the software page tables.
|
||||||
|
|
||||||
A port may use this information in any way it so chooses.
|
A port may use this information in any way it so chooses.
|
||||||
For example, it could use this event to pre-load TLB
|
For example, it could use this event to pre-load TLB
|
||||||
|
|
|
@ -493,3 +493,52 @@ Why: These two features use non-standard interfaces. There are the
|
||||||
Who: Corentin Chary <corentin.chary@gmail.com>
|
Who: Corentin Chary <corentin.chary@gmail.com>
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
|
What: usbvideo quickcam_messenger driver
|
||||||
|
When: 2.6.35
|
||||||
|
Files: drivers/media/video/usbvideo/quickcam_messenger.[ch]
|
||||||
|
Why: obsolete v4l1 driver replaced by gspca_stv06xx
|
||||||
|
Who: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
What: ov511 v4l1 driver
|
||||||
|
When: 2.6.35
|
||||||
|
Files: drivers/media/video/ov511.[ch]
|
||||||
|
Why: obsolete v4l1 driver replaced by gspca_ov519
|
||||||
|
Who: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
What: w9968cf v4l1 driver
|
||||||
|
When: 2.6.35
|
||||||
|
Files: drivers/media/video/w9968cf*.[ch]
|
||||||
|
Why: obsolete v4l1 driver replaced by gspca_ov519
|
||||||
|
Who: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
What: ovcamchip sensor framework
|
||||||
|
When: 2.6.35
|
||||||
|
Files: drivers/media/video/ovcamchip/*
|
||||||
|
Why: Only used by obsoleted v4l1 drivers
|
||||||
|
Who: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
What: stv680 v4l1 driver
|
||||||
|
When: 2.6.35
|
||||||
|
Files: drivers/media/video/stv680.[ch]
|
||||||
|
Why: obsolete v4l1 driver replaced by gspca_stv0680
|
||||||
|
Who: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
What: zc0301 v4l driver
|
||||||
|
When: 2.6.35
|
||||||
|
Files: drivers/media/video/zc0301/*
|
||||||
|
Why: Duplicate functionality with the gspca_zc3xx driver, zc0301 only
|
||||||
|
supports 2 USB-ID's (because it only supports a limited set of
|
||||||
|
sensors) wich are also supported by the gspca_zc3xx driver
|
||||||
|
(which supports 53 USB-ID's in total)
|
||||||
|
Who: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
|
|
@ -177,7 +177,6 @@ read the file /proc/PID/status:
|
||||||
CapBnd: ffffffffffffffff
|
CapBnd: ffffffffffffffff
|
||||||
voluntary_ctxt_switches: 0
|
voluntary_ctxt_switches: 0
|
||||||
nonvoluntary_ctxt_switches: 1
|
nonvoluntary_ctxt_switches: 1
|
||||||
Stack usage: 12 kB
|
|
||||||
|
|
||||||
This shows you nearly the same information you would get if you viewed it with
|
This shows you nearly the same information you would get if you viewed it with
|
||||||
the ps command. In fact, ps uses the proc file system to obtain its
|
the ps command. In fact, ps uses the proc file system to obtain its
|
||||||
|
@ -231,7 +230,6 @@ Table 1-2: Contents of the statm files (as of 2.6.30-rc7)
|
||||||
Mems_allowed_list Same as previous, but in "list format"
|
Mems_allowed_list Same as previous, but in "list format"
|
||||||
voluntary_ctxt_switches number of voluntary context switches
|
voluntary_ctxt_switches number of voluntary context switches
|
||||||
nonvoluntary_ctxt_switches number of non voluntary context switches
|
nonvoluntary_ctxt_switches number of non voluntary context switches
|
||||||
Stack usage: stack usage high water mark (round up to page size)
|
|
||||||
..............................................................................
|
..............................................................................
|
||||||
|
|
||||||
Table 1-3: Contents of the statm files (as of 2.6.8-rc3)
|
Table 1-3: Contents of the statm files (as of 2.6.8-rc3)
|
||||||
|
|
102
Documentation/hwmon/amc6821
Normal file
102
Documentation/hwmon/amc6821
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
Kernel driver amc6821
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Supported chips:
|
||||||
|
Texas Instruments AMC6821
|
||||||
|
Prefix: 'amc6821'
|
||||||
|
Addresses scanned: 0x18, 0x19, 0x1a, 0x2c, 0x2d, 0x2e, 0x4c, 0x4d, 0x4e
|
||||||
|
Datasheet: http://focus.ti.com/docs/prod/folders/print/amc6821.html
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
Tomaz Mertelj <tomaz.mertelj@guest.arnes.si>
|
||||||
|
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
This driver implements support for the Texas Instruments amc6821 chip.
|
||||||
|
The chip has one on-chip and one remote temperature sensor and one pwm fan
|
||||||
|
regulator.
|
||||||
|
The pwm can be controlled either from software or automatically.
|
||||||
|
|
||||||
|
The driver provides the following sensor accesses in sysfs:
|
||||||
|
|
||||||
|
temp1_input ro on-chip temperature
|
||||||
|
temp1_min rw "
|
||||||
|
temp1_max rw "
|
||||||
|
temp1_crit rw "
|
||||||
|
temp1_min_alarm ro "
|
||||||
|
temp1_max_alarm ro "
|
||||||
|
temp1_crit_alarm ro "
|
||||||
|
|
||||||
|
temp2_input ro remote temperature
|
||||||
|
temp2_min rw "
|
||||||
|
temp2_max rw "
|
||||||
|
temp2_crit rw "
|
||||||
|
temp2_min_alarm ro "
|
||||||
|
temp2_max_alarm ro "
|
||||||
|
temp2_crit_alarm ro "
|
||||||
|
temp2_fault ro "
|
||||||
|
|
||||||
|
fan1_input ro tachometer speed
|
||||||
|
fan1_min rw "
|
||||||
|
fan1_max rw "
|
||||||
|
fan1_fault ro "
|
||||||
|
fan1_div rw Fan divisor can be either 2 or 4.
|
||||||
|
|
||||||
|
pwm1 rw pwm1
|
||||||
|
pwm1_enable rw regulator mode, 1=open loop, 2=fan controlled
|
||||||
|
by remote temperature, 3=fan controlled by
|
||||||
|
combination of the on-chip temperature and
|
||||||
|
remote-sensor temperature,
|
||||||
|
pwm1_auto_channels_temp ro 1 if pwm_enable==2, 3 if pwm_enable==3
|
||||||
|
pwm1_auto_point1_pwm ro Hardwired to 0, shared for both
|
||||||
|
temperature channels.
|
||||||
|
pwm1_auto_point2_pwm rw This value is shared for both temperature
|
||||||
|
channels.
|
||||||
|
pwm1_auto_point3_pwm rw Hardwired to 255, shared for both
|
||||||
|
temperature channels.
|
||||||
|
|
||||||
|
temp1_auto_point1_temp ro Hardwired to temp2_auto_point1_temp
|
||||||
|
which is rw. Below this temperature fan stops.
|
||||||
|
temp1_auto_point2_temp rw The low-temperature limit of the proportional
|
||||||
|
range. Below this temperature
|
||||||
|
pwm1 = pwm1_auto_point2_pwm. It can go from
|
||||||
|
0 degree C to 124 degree C in steps of
|
||||||
|
4 degree C. Read it out after writing to get
|
||||||
|
the actual value.
|
||||||
|
temp1_auto_point3_temp rw Above this temperature fan runs at maximum
|
||||||
|
speed. It can go from temp1_auto_point2_temp.
|
||||||
|
It can only have certain discrete values
|
||||||
|
which depend on temp1_auto_point2_temp and
|
||||||
|
pwm1_auto_point2_pwm. Read it out after
|
||||||
|
writing to get the actual value.
|
||||||
|
|
||||||
|
temp2_auto_point1_temp rw Must be between 0 degree C and 63 degree C and
|
||||||
|
it defines the passive cooling temperature.
|
||||||
|
Below this temperature the fan stops in
|
||||||
|
the closed loop mode.
|
||||||
|
temp2_auto_point2_temp rw The low-temperature limit of the proportional
|
||||||
|
range. Below this temperature
|
||||||
|
pwm1 = pwm1_auto_point2_pwm. It can go from
|
||||||
|
0 degree C to 124 degree C in steps
|
||||||
|
of 4 degree C.
|
||||||
|
|
||||||
|
temp2_auto_point3_temp rw Above this temperature fan runs at maximum
|
||||||
|
speed. It can only have certain discrete
|
||||||
|
values which depend on temp2_auto_point2_temp
|
||||||
|
and pwm1_auto_point2_pwm. Read it out after
|
||||||
|
writing to get actual value.
|
||||||
|
|
||||||
|
|
||||||
|
Module parameters
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
If your board has a BIOS that initializes the amc6821 correctly, you should
|
||||||
|
load the module with: init=0.
|
||||||
|
|
||||||
|
If your board BIOS doesn't initialize the chip, or you want
|
||||||
|
different settings, you can set the following parameters:
|
||||||
|
init=1,
|
||||||
|
pwminv: 0 default pwm output, 1 inverts pwm output.
|
||||||
|
|
|
@ -3,8 +3,8 @@ Kernel driver k10temp
|
||||||
|
|
||||||
Supported chips:
|
Supported chips:
|
||||||
* AMD Family 10h processors:
|
* AMD Family 10h processors:
|
||||||
Socket F: Quad-Core/Six-Core/Embedded Opteron
|
Socket F: Quad-Core/Six-Core/Embedded Opteron (but see below)
|
||||||
Socket AM2+: Opteron, Phenom (II) X3/X4
|
Socket AM2+: Quad-Core Opteron, Phenom (II) X3/X4, Athlon X2 (but see below)
|
||||||
Socket AM3: Quad-Core Opteron, Athlon/Phenom II X2/X3/X4, Sempron II
|
Socket AM3: Quad-Core Opteron, Athlon/Phenom II X2/X3/X4, Sempron II
|
||||||
Socket S1G3: Athlon II, Sempron, Turion II
|
Socket S1G3: Athlon II, Sempron, Turion II
|
||||||
* AMD Family 11h processors:
|
* AMD Family 11h processors:
|
||||||
|
@ -36,10 +36,15 @@ Description
|
||||||
This driver permits reading of the internal temperature sensor of AMD
|
This driver permits reading of the internal temperature sensor of AMD
|
||||||
Family 10h and 11h processors.
|
Family 10h and 11h processors.
|
||||||
|
|
||||||
All these processors have a sensor, but on older revisions of Family 10h
|
All these processors have a sensor, but on those for Socket F or AM2+,
|
||||||
processors, the sensor may return inconsistent values (erratum 319). The
|
the sensor may return inconsistent values (erratum 319). The driver
|
||||||
driver will refuse to load on these revisions unless you specify the
|
will refuse to load on these revisions unless you specify the "force=1"
|
||||||
"force=1" module parameter.
|
module parameter.
|
||||||
|
|
||||||
|
Due to technical reasons, the driver can detect only the mainboard's
|
||||||
|
socket type, not the processor's actual capabilities. Therefore, if you
|
||||||
|
are using an AM3 processor on an AM2+ mainboard, you can safely use the
|
||||||
|
"force=1" parameter.
|
||||||
|
|
||||||
There is one temperature measurement value, available as temp1_input in
|
There is one temperature measurement value, available as temp1_input in
|
||||||
sysfs. It is measured in degrees Celsius with a resolution of 1/8th degree.
|
sysfs. It is measured in degrees Celsius with a resolution of 1/8th degree.
|
||||||
|
|
|
@ -56,10 +56,11 @@ Following this convention is good because:
|
||||||
(5) When following the convention, the driver code can use generic
|
(5) When following the convention, the driver code can use generic
|
||||||
code to copy the parameters between user and kernel space.
|
code to copy the parameters between user and kernel space.
|
||||||
|
|
||||||
This table lists ioctls visible from user land for Linux/i386. It contains
|
This table lists ioctls visible from user land for Linux/x86. It contains
|
||||||
most drivers up to 2.3.14, but I know I am missing some.
|
most drivers up to 2.6.31, but I know I am missing some. There has been
|
||||||
|
no attempt to list non-X86 architectures or ioctls from drivers/staging/.
|
||||||
|
|
||||||
Code Seq# Include File Comments
|
Code Seq#(hex) Include File Comments
|
||||||
========================================================
|
========================================================
|
||||||
0x00 00-1F linux/fs.h conflict!
|
0x00 00-1F linux/fs.h conflict!
|
||||||
0x00 00-1F scsi/scsi_ioctl.h conflict!
|
0x00 00-1F scsi/scsi_ioctl.h conflict!
|
||||||
|
@ -69,119 +70,228 @@ Code Seq# Include File Comments
|
||||||
0x03 all linux/hdreg.h
|
0x03 all linux/hdreg.h
|
||||||
0x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these.
|
0x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these.
|
||||||
0x06 all linux/lp.h
|
0x06 all linux/lp.h
|
||||||
0x09 all linux/md.h
|
0x09 all linux/raid/md_u.h
|
||||||
|
0x10 00-0F drivers/char/s390/vmcp.h
|
||||||
0x12 all linux/fs.h
|
0x12 all linux/fs.h
|
||||||
linux/blkpg.h
|
linux/blkpg.h
|
||||||
0x1b all InfiniBand Subsystem <http://www.openib.org/>
|
0x1b all InfiniBand Subsystem <http://www.openib.org/>
|
||||||
0x20 all drivers/cdrom/cm206.h
|
0x20 all drivers/cdrom/cm206.h
|
||||||
0x22 all scsi/sg.h
|
0x22 all scsi/sg.h
|
||||||
'#' 00-3F IEEE 1394 Subsystem Block for the entire subsystem
|
'#' 00-3F IEEE 1394 Subsystem Block for the entire subsystem
|
||||||
|
'$' 00-0F linux/perf_counter.h, linux/perf_event.h
|
||||||
'1' 00-1F <linux/timepps.h> PPS kit from Ulrich Windl
|
'1' 00-1F <linux/timepps.h> PPS kit from Ulrich Windl
|
||||||
<ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
|
<ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
|
||||||
|
'2' 01-04 linux/i2o.h
|
||||||
|
'3' 00-0F drivers/s390/char/raw3270.h conflict!
|
||||||
|
'3' 00-1F linux/suspend_ioctls.h conflict!
|
||||||
|
and kernel/power/user.c
|
||||||
'8' all SNP8023 advanced NIC card
|
'8' all SNP8023 advanced NIC card
|
||||||
<mailto:mcr@solidum.com>
|
<mailto:mcr@solidum.com>
|
||||||
'A' 00-1F linux/apm_bios.h
|
'@' 00-0F linux/radeonfb.h conflict!
|
||||||
|
'@' 00-0F drivers/video/aty/aty128fb.c conflict!
|
||||||
|
'A' 00-1F linux/apm_bios.h conflict!
|
||||||
|
'A' 00-0F linux/agpgart.h conflict!
|
||||||
|
and drivers/char/agp/compat_ioctl.h
|
||||||
|
'A' 00-7F sound/asound.h conflict!
|
||||||
|
'B' 00-1F linux/cciss_ioctl.h conflict!
|
||||||
|
'B' 00-0F include/linux/pmu.h conflict!
|
||||||
'B' C0-FF advanced bbus
|
'B' C0-FF advanced bbus
|
||||||
<mailto:maassen@uni-freiburg.de>
|
<mailto:maassen@uni-freiburg.de>
|
||||||
'C' all linux/soundcard.h
|
'C' all linux/soundcard.h conflict!
|
||||||
|
'C' 01-2F linux/capi.h conflict!
|
||||||
|
'C' F0-FF drivers/net/wan/cosa.h conflict!
|
||||||
'D' all arch/s390/include/asm/dasd.h
|
'D' all arch/s390/include/asm/dasd.h
|
||||||
'E' all linux/input.h
|
'D' 40-5F drivers/scsi/dpt/dtpi_ioctl.h
|
||||||
'F' all linux/fb.h
|
'D' 05 drivers/scsi/pmcraid.h
|
||||||
'H' all linux/hiddev.h
|
'E' all linux/input.h conflict!
|
||||||
'I' all linux/isdn.h
|
'E' 00-0F xen/evtchn.h conflict!
|
||||||
|
'F' all linux/fb.h conflict!
|
||||||
|
'F' 01-02 drivers/scsi/pmcraid.h conflict!
|
||||||
|
'F' 20 drivers/video/fsl-diu-fb.h conflict!
|
||||||
|
'F' 20 drivers/video/intelfb/intelfb.h conflict!
|
||||||
|
'F' 20 linux/ivtvfb.h conflict!
|
||||||
|
'F' 20 linux/matroxfb.h conflict!
|
||||||
|
'F' 20 drivers/video/aty/atyfb_base.c conflict!
|
||||||
|
'F' 00-0F video/da8xx-fb.h conflict!
|
||||||
|
'F' 80-8F linux/arcfb.h conflict!
|
||||||
|
'F' DD video/sstfb.h conflict!
|
||||||
|
'G' 00-3F drivers/misc/sgi-gru/grulib.h conflict!
|
||||||
|
'G' 00-0F linux/gigaset_dev.h conflict!
|
||||||
|
'H' 00-7F linux/hiddev.h conflict!
|
||||||
|
'H' 00-0F linux/hidraw.h conflict!
|
||||||
|
'H' 00-0F sound/asound.h conflict!
|
||||||
|
'H' 20-40 sound/asound_fm.h conflict!
|
||||||
|
'H' 80-8F sound/sfnt_info.h conflict!
|
||||||
|
'H' 10-8F sound/emu10k1.h conflict!
|
||||||
|
'H' 10-1F sound/sb16_csp.h conflict!
|
||||||
|
'H' 10-1F sound/hda_hwdep.h conflict!
|
||||||
|
'H' 40-4F sound/hdspm.h conflict!
|
||||||
|
'H' 40-4F sound/hdsp.h conflict!
|
||||||
|
'H' 90 sound/usb/usx2y/usb_stream.h
|
||||||
|
'H' C0-F0 net/bluetooth/hci.h conflict!
|
||||||
|
'H' C0-DF net/bluetooth/hidp/hidp.h conflict!
|
||||||
|
'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict!
|
||||||
|
'H' C0-DF net/bluetooth/bnep/bnep.h conflict!
|
||||||
|
'I' all linux/isdn.h conflict!
|
||||||
|
'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict!
|
||||||
|
'I' 40-4F linux/mISDNif.h conflict!
|
||||||
'J' 00-1F drivers/scsi/gdth_ioctl.h
|
'J' 00-1F drivers/scsi/gdth_ioctl.h
|
||||||
'K' all linux/kd.h
|
'K' all linux/kd.h
|
||||||
'L' 00-1F linux/loop.h
|
'L' 00-1F linux/loop.h conflict!
|
||||||
'L' 20-2F driver/usb/misc/vstusb.h
|
'L' 10-1F drivers/scsi/mpt2sas/mpt2sas_ctl.h conflict!
|
||||||
|
'L' 20-2F linux/usb/vstusb.h
|
||||||
'L' E0-FF linux/ppdd.h encrypted disk device driver
|
'L' E0-FF linux/ppdd.h encrypted disk device driver
|
||||||
<http://linux01.gwdg.de/~alatham/ppdd.html>
|
<http://linux01.gwdg.de/~alatham/ppdd.html>
|
||||||
'M' all linux/soundcard.h
|
'M' all linux/soundcard.h conflict!
|
||||||
|
'M' 01-16 mtd/mtd-abi.h conflict!
|
||||||
|
and drivers/mtd/mtdchar.c
|
||||||
|
'M' 01-03 drivers/scsi/megaraid/megaraid_sas.h
|
||||||
|
'M' 00-0F drivers/video/fsl-diu-fb.h conflict!
|
||||||
'N' 00-1F drivers/usb/scanner.h
|
'N' 00-1F drivers/usb/scanner.h
|
||||||
'O' 00-02 include/mtd/ubi-user.h UBI
|
'O' 00-06 mtd/ubi-user.h UBI
|
||||||
'P' all linux/soundcard.h
|
'P' all linux/soundcard.h conflict!
|
||||||
|
'P' 60-6F sound/sscape_ioctl.h conflict!
|
||||||
|
'P' 00-0F drivers/usb/class/usblp.c conflict!
|
||||||
'Q' all linux/soundcard.h
|
'Q' all linux/soundcard.h
|
||||||
'R' 00-1F linux/random.h
|
'R' 00-1F linux/random.h conflict!
|
||||||
|
'R' 01 linux/rfkill.h conflict!
|
||||||
|
'R' 01-0F media/rds.h conflict!
|
||||||
|
'R' C0-DF net/bluetooth/rfcomm.h
|
||||||
'S' all linux/cdrom.h conflict!
|
'S' all linux/cdrom.h conflict!
|
||||||
'S' 80-81 scsi/scsi_ioctl.h conflict!
|
'S' 80-81 scsi/scsi_ioctl.h conflict!
|
||||||
'S' 82-FF scsi/scsi.h conflict!
|
'S' 82-FF scsi/scsi.h conflict!
|
||||||
|
'S' 00-7F sound/asequencer.h conflict!
|
||||||
'T' all linux/soundcard.h conflict!
|
'T' all linux/soundcard.h conflict!
|
||||||
|
'T' 00-AF sound/asound.h conflict!
|
||||||
'T' all arch/x86/include/asm/ioctls.h conflict!
|
'T' all arch/x86/include/asm/ioctls.h conflict!
|
||||||
'U' 00-EF linux/drivers/usb/usb.h
|
'T' C0-DF linux/if_tun.h conflict!
|
||||||
'V' all linux/vt.h
|
'U' all sound/asound.h conflict!
|
||||||
|
'U' 00-0F drivers/media/video/uvc/uvcvideo.h conflict!
|
||||||
|
'U' 00-CF linux/uinput.h conflict!
|
||||||
|
'U' 00-EF linux/usbdevice_fs.h
|
||||||
|
'U' C0-CF drivers/bluetooth/hci_uart.h
|
||||||
|
'V' all linux/vt.h conflict!
|
||||||
|
'V' all linux/videodev2.h conflict!
|
||||||
|
'V' C0 linux/ivtvfb.h conflict!
|
||||||
|
'V' C0 linux/ivtv.h conflict!
|
||||||
|
'V' C0 media/davinci/vpfe_capture.h conflict!
|
||||||
|
'V' C0 media/si4713.h conflict!
|
||||||
|
'V' C0-CF drivers/media/video/mxb.h conflict!
|
||||||
'W' 00-1F linux/watchdog.h conflict!
|
'W' 00-1F linux/watchdog.h conflict!
|
||||||
'W' 00-1F linux/wanrouter.h conflict!
|
'W' 00-1F linux/wanrouter.h conflict!
|
||||||
'X' all linux/xfs_fs.h
|
'W' 00-3F sound/asound.h conflict!
|
||||||
|
'X' all fs/xfs/xfs_fs.h conflict!
|
||||||
|
and fs/xfs/linux-2.6/xfs_ioctl32.h
|
||||||
|
and include/linux/falloc.h
|
||||||
|
and linux/fs.h
|
||||||
|
'X' all fs/ocfs2/ocfs_fs.h conflict!
|
||||||
|
'X' 01 linux/pktcdvd.h conflict!
|
||||||
'Y' all linux/cyclades.h
|
'Y' all linux/cyclades.h
|
||||||
'[' 00-07 linux/usb/usbtmc.h USB Test and Measurement Devices
|
'Z' 14-15 drivers/message/fusion/mptctl.h
|
||||||
|
'[' 00-07 linux/usb/tmc.h USB Test and Measurement Devices
|
||||||
<mailto:gregkh@suse.de>
|
<mailto:gregkh@suse.de>
|
||||||
'a' all ATM on linux
|
'a' all linux/atm*.h, linux/sonet.h ATM on linux
|
||||||
<http://lrcwww.epfl.ch/linux-atm/magic.html>
|
<http://lrcwww.epfl.ch/linux-atm/magic.html>
|
||||||
'b' 00-FF bit3 vme host bridge
|
'b' 00-FF conflict! bit3 vme host bridge
|
||||||
<mailto:natalia@nikhefk.nikhef.nl>
|
<mailto:natalia@nikhefk.nikhef.nl>
|
||||||
|
'b' 00-0F media/bt819.h conflict!
|
||||||
|
'c' all linux/cm4000_cs.h conflict!
|
||||||
'c' 00-7F linux/comstats.h conflict!
|
'c' 00-7F linux/comstats.h conflict!
|
||||||
'c' 00-7F linux/coda.h conflict!
|
'c' 00-7F linux/coda.h conflict!
|
||||||
'c' 80-9F arch/s390/include/asm/chsc.h
|
'c' 00-1F linux/chio.h conflict!
|
||||||
'c' A0-AF arch/x86/include/asm/msr.h
|
'c' 80-9F arch/s390/include/asm/chsc.h conflict!
|
||||||
|
'c' A0-AF arch/x86/include/asm/msr.h conflict!
|
||||||
'd' 00-FF linux/char/drm/drm/h conflict!
|
'd' 00-FF linux/char/drm/drm/h conflict!
|
||||||
|
'd' 02-40 pcmcia/ds.h conflict!
|
||||||
|
'd' 10-3F drivers/media/video/dabusb.h conflict!
|
||||||
|
'd' C0-CF drivers/media/video/saa7191.h conflict!
|
||||||
'd' F0-FF linux/digi1.h
|
'd' F0-FF linux/digi1.h
|
||||||
'e' all linux/digi1.h conflict!
|
'e' all linux/digi1.h conflict!
|
||||||
'e' 00-1F net/irda/irtty.h conflict!
|
'e' 00-1F drivers/net/irda/irtty-sir.h conflict!
|
||||||
'f' 00-1F linux/ext2_fs.h
|
'f' 00-1F linux/ext2_fs.h conflict!
|
||||||
'h' 00-7F Charon filesystem
|
'f' 00-1F linux/ext3_fs.h conflict!
|
||||||
|
'f' 00-0F fs/jfs/jfs_dinode.h conflict!
|
||||||
|
'f' 00-0F fs/ext4/ext4.h conflict!
|
||||||
|
'f' 00-0F linux/fs.h conflict!
|
||||||
|
'f' 00-0F fs/ocfs2/ocfs2_fs.h conflict!
|
||||||
|
'g' 00-0F linux/usb/gadgetfs.h
|
||||||
|
'g' 20-2F linux/usb/g_printer.h
|
||||||
|
'h' 00-7F conflict! Charon filesystem
|
||||||
<mailto:zapman@interlan.net>
|
<mailto:zapman@interlan.net>
|
||||||
'i' 00-3F linux/i2o.h
|
'h' 00-1F linux/hpet.h conflict!
|
||||||
|
'i' 00-3F linux/i2o-dev.h conflict!
|
||||||
|
'i' 0B-1F linux/ipmi.h conflict!
|
||||||
|
'i' 80-8F linux/i8k.h
|
||||||
'j' 00-3F linux/joystick.h
|
'j' 00-3F linux/joystick.h
|
||||||
|
'k' 00-0F linux/spi/spidev.h conflict!
|
||||||
|
'k' 00-05 video/kyro.h conflict!
|
||||||
'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system
|
'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system
|
||||||
<http://mikonos.dia.unisa.it/tcfs>
|
<http://mikonos.dia.unisa.it/tcfs>
|
||||||
'l' 40-7F linux/udf_fs_i.h in development:
|
'l' 40-7F linux/udf_fs_i.h in development:
|
||||||
<http://sourceforge.net/projects/linux-udf/>
|
<http://sourceforge.net/projects/linux-udf/>
|
||||||
'm' 00-09 linux/mmtimer.h
|
'm' 00-09 linux/mmtimer.h conflict!
|
||||||
'm' all linux/mtio.h conflict!
|
'm' all linux/mtio.h conflict!
|
||||||
'm' all linux/soundcard.h conflict!
|
'm' all linux/soundcard.h conflict!
|
||||||
'm' all linux/synclink.h conflict!
|
'm' all linux/synclink.h conflict!
|
||||||
|
'm' 00-19 drivers/message/fusion/mptctl.h conflict!
|
||||||
|
'm' 00 drivers/scsi/megaraid/megaraid_ioctl.h conflict!
|
||||||
'm' 00-1F net/irda/irmod.h conflict!
|
'm' 00-1F net/irda/irmod.h conflict!
|
||||||
'n' 00-7F linux/ncp_fs.h
|
'n' 00-7F linux/ncp_fs.h and fs/ncpfs/ioctl.c
|
||||||
'n' 80-8F linux/nilfs2_fs.h NILFS2
|
'n' 80-8F linux/nilfs2_fs.h NILFS2
|
||||||
'n' E0-FF video/matrox.h matroxfb
|
'n' E0-FF linux/matroxfb.h matroxfb
|
||||||
'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2
|
'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2
|
||||||
'o' 00-03 include/mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps)
|
'o' 00-03 mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps)
|
||||||
'o' 40-41 include/mtd/ubi-user.h UBI
|
'o' 40-41 mtd/ubi-user.h UBI
|
||||||
'o' 01-A1 include/linux/dvb/*.h DVB
|
'o' 01-A1 linux/dvb/*.h DVB
|
||||||
'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this)
|
'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this)
|
||||||
|
'p' 00-1F linux/rtc.h conflict!
|
||||||
'p' 00-3F linux/mc146818rtc.h conflict!
|
'p' 00-3F linux/mc146818rtc.h conflict!
|
||||||
'p' 40-7F linux/nvram.h
|
'p' 40-7F linux/nvram.h
|
||||||
'p' 80-9F user-space parport
|
'p' 80-9F linux/ppdev.h user-space parport
|
||||||
<mailto:tim@cyberelk.net>
|
<mailto:tim@cyberelk.net>
|
||||||
'p' a1-a4 linux/pps.h LinuxPPS
|
'p' A1-A4 linux/pps.h LinuxPPS
|
||||||
<mailto:giometti@linux.it>
|
<mailto:giometti@linux.it>
|
||||||
'q' 00-1F linux/serio.h
|
'q' 00-1F linux/serio.h
|
||||||
'q' 80-FF Internet PhoneJACK, Internet LineJACK
|
'q' 80-FF linux/telephony.h Internet PhoneJACK, Internet LineJACK
|
||||||
<http://www.quicknet.net>
|
linux/ixjuser.h <http://www.quicknet.net>
|
||||||
'r' 00-1F linux/msdos_fs.h
|
'r' 00-1F linux/msdos_fs.h and fs/fat/dir.c
|
||||||
's' all linux/cdk.h
|
's' all linux/cdk.h
|
||||||
't' 00-7F linux/if_ppp.h
|
't' 00-7F linux/if_ppp.h
|
||||||
't' 80-8F linux/isdn_ppp.h
|
't' 80-8F linux/isdn_ppp.h
|
||||||
|
't' 90 linux/toshiba.h
|
||||||
'u' 00-1F linux/smb_fs.h
|
'u' 00-1F linux/smb_fs.h
|
||||||
'v' 00-1F linux/ext2_fs.h conflict!
|
|
||||||
'v' all linux/videodev.h conflict!
|
'v' all linux/videodev.h conflict!
|
||||||
|
'v' 00-1F linux/ext2_fs.h conflict!
|
||||||
|
'v' 00-1F linux/fs.h conflict!
|
||||||
|
'v' 00-0F linux/sonypi.h conflict!
|
||||||
|
'v' C0-CF drivers/media/video/ov511.h conflict!
|
||||||
|
'v' C0-DF media/pwc-ioctl.h conflict!
|
||||||
|
'v' C0-FF linux/meye.h conflict!
|
||||||
|
'v' C0-CF drivers/media/video/zoran/zoran.h conflict!
|
||||||
|
'v' D0-DF drivers/media/video/cpia2/cpia2dev.h conflict!
|
||||||
'w' all CERN SCI driver
|
'w' all CERN SCI driver
|
||||||
'y' 00-1F packet based user level communications
|
'y' 00-1F packet based user level communications
|
||||||
<mailto:zapman@interlan.net>
|
<mailto:zapman@interlan.net>
|
||||||
'z' 00-3F CAN bus card
|
'z' 00-3F CAN bus card conflict!
|
||||||
<mailto:hdstich@connectu.ulm.circular.de>
|
<mailto:hdstich@connectu.ulm.circular.de>
|
||||||
'z' 40-7F CAN bus card
|
'z' 40-7F CAN bus card conflict!
|
||||||
<mailto:oe@port.de>
|
<mailto:oe@port.de>
|
||||||
|
'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
|
||||||
0x80 00-1F linux/fb.h
|
0x80 00-1F linux/fb.h
|
||||||
0x81 00-1F linux/videotext.h
|
0x81 00-1F linux/videotext.h
|
||||||
|
0x88 00-3F media/ovcamchip.h
|
||||||
0x89 00-06 arch/x86/include/asm/sockios.h
|
0x89 00-06 arch/x86/include/asm/sockios.h
|
||||||
0x89 0B-DF linux/sockios.h
|
0x89 0B-DF linux/sockios.h
|
||||||
0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
|
0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
|
||||||
|
0x89 E0-EF linux/dn.h PROTOPRIVATE range
|
||||||
0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range
|
0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range
|
||||||
0x8B all linux/wireless.h
|
0x8B all linux/wireless.h
|
||||||
0x8C 00-3F WiNRADiO driver
|
0x8C 00-3F WiNRADiO driver
|
||||||
<http://www.proximity.com.au/~brian/winradio/>
|
<http://www.proximity.com.au/~brian/winradio/>
|
||||||
0x90 00 drivers/cdrom/sbpcd.h
|
0x90 00 drivers/cdrom/sbpcd.h
|
||||||
|
0x92 00-0F drivers/usb/mon/mon_bin.c
|
||||||
0x93 60-7F linux/auto_fs.h
|
0x93 60-7F linux/auto_fs.h
|
||||||
|
0x94 all fs/btrfs/ioctl.h
|
||||||
0x99 00-0F 537-Addinboard driver
|
0x99 00-0F 537-Addinboard driver
|
||||||
<mailto:buk@buks.ipn.de>
|
<mailto:buk@buks.ipn.de>
|
||||||
0xA0 all linux/sdp/sdp.h Industrial Device Project
|
0xA0 all linux/sdp/sdp.h Industrial Device Project
|
||||||
|
@ -192,17 +302,22 @@ Code Seq# Include File Comments
|
||||||
0xAB 00-1F linux/nbd.h
|
0xAB 00-1F linux/nbd.h
|
||||||
0xAC 00-1F linux/raw.h
|
0xAC 00-1F linux/raw.h
|
||||||
0xAD 00 Netfilter device in development:
|
0xAD 00 Netfilter device in development:
|
||||||
<mailto:rusty@rustcorp.com.au>
|
<mailto:rusty@rustcorp.com.au>
|
||||||
0xAE all linux/kvm.h Kernel-based Virtual Machine
|
0xAE all linux/kvm.h Kernel-based Virtual Machine
|
||||||
<mailto:kvm@vger.kernel.org>
|
<mailto:kvm@vger.kernel.org>
|
||||||
0xB0 all RATIO devices in development:
|
0xB0 all RATIO devices in development:
|
||||||
<mailto:vgo@ratio.de>
|
<mailto:vgo@ratio.de>
|
||||||
0xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca>
|
0xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca>
|
||||||
|
0xC0 00-0F linux/usb/iowarrior.h
|
||||||
0xCB 00-1F CBM serial IEC bus in development:
|
0xCB 00-1F CBM serial IEC bus in development:
|
||||||
<mailto:michael.klein@puffin.lb.shuttle.de>
|
<mailto:michael.klein@puffin.lb.shuttle.de>
|
||||||
|
0xCD 01 linux/reiserfs_fs.h
|
||||||
|
0xCF 02 fs/cifs/ioctl.c
|
||||||
|
0xDB 00-0F drivers/char/mwave/mwavepub.h
|
||||||
0xDD 00-3F ZFCP device driver see drivers/s390/scsi/
|
0xDD 00-3F ZFCP device driver see drivers/s390/scsi/
|
||||||
<mailto:aherrman@de.ibm.com>
|
<mailto:aherrman@de.ibm.com>
|
||||||
0xF3 00-3F video/sisfb.h sisfb (in development)
|
0xF3 00-3F drivers/usb/misc/sisusbvga/sisusb.h sisfb (in development)
|
||||||
<mailto:thomas@winischhofer.net>
|
<mailto:thomas@winischhofer.net>
|
||||||
0xF4 00-1F video/mbxfb.h mbxfb
|
0xF4 00-1F video/mbxfb.h mbxfb
|
||||||
<mailto:raph@8d.com>
|
<mailto:raph@8d.com>
|
||||||
|
0xFD all linux/dm-ioctl.h
|
||||||
|
|
|
@ -214,11 +214,13 @@ The format of the block comment is like this:
|
||||||
* (section header: (section description)? )*
|
* (section header: (section description)? )*
|
||||||
(*)?*/
|
(*)?*/
|
||||||
|
|
||||||
The short function description ***cannot be multiline***, but the other
|
All "description" text can span multiple lines, although the
|
||||||
descriptions can be (and they can contain blank lines). If you continue
|
function_name & its short description are traditionally on a single line.
|
||||||
that initial short description onto a second line, that second line will
|
Description text may also contain blank lines (i.e., lines that contain
|
||||||
appear further down at the beginning of the description section, which is
|
only a "*").
|
||||||
almost certainly not what you had in mind.
|
|
||||||
|
"section header:" names must be unique per function (or struct,
|
||||||
|
union, typedef, enum).
|
||||||
|
|
||||||
Avoid putting a spurious blank line after the function name, or else the
|
Avoid putting a spurious blank line after the function name, or else the
|
||||||
description will be repeated!
|
description will be repeated!
|
||||||
|
|
|
@ -48,11 +48,11 @@ for LILO parameters for doing this:
|
||||||
This configures the first found 3c509 card for IRQ 10, base I/O 0x310, and
|
This configures the first found 3c509 card for IRQ 10, base I/O 0x310, and
|
||||||
transceiver type 3 (10base2). The flag "0x3c509" must be set to avoid conflicts
|
transceiver type 3 (10base2). The flag "0x3c509" must be set to avoid conflicts
|
||||||
with other card types when overriding the I/O address. When the driver is
|
with other card types when overriding the I/O address. When the driver is
|
||||||
loaded as a module, only the IRQ and transceiver setting may be overridden.
|
loaded as a module, only the IRQ may be overridden. For example,
|
||||||
For example, setting two cards to 10base2/IRQ10 and AUI/IRQ11 is done by using
|
setting two cards to IRQ10 and IRQ11 is done by using the irq module
|
||||||
the xcvr and irq module options:
|
option:
|
||||||
|
|
||||||
options 3c509 xcvr=3,1 irq=10,11
|
options 3c509 irq=10,11
|
||||||
|
|
||||||
|
|
||||||
(2) Full-duplex mode
|
(2) Full-duplex mode
|
||||||
|
@ -77,6 +77,8 @@ operation.
|
||||||
itself full-duplex capable. This is almost certainly one of two things: a full-
|
itself full-duplex capable. This is almost certainly one of two things: a full-
|
||||||
duplex-capable Ethernet switch (*not* a hub), or a full-duplex-capable NIC on
|
duplex-capable Ethernet switch (*not* a hub), or a full-duplex-capable NIC on
|
||||||
another system that's connected directly to the 3c509B via a crossover cable.
|
another system that's connected directly to the 3c509B via a crossover cable.
|
||||||
|
|
||||||
|
Full-duplex mode can be enabled using 'ethtool'.
|
||||||
|
|
||||||
/////Extremely important caution concerning full-duplex mode/////
|
/////Extremely important caution concerning full-duplex mode/////
|
||||||
Understand that the 3c509B's hardware's full-duplex support is much more
|
Understand that the 3c509B's hardware's full-duplex support is much more
|
||||||
|
@ -113,6 +115,8 @@ This insured that merely upgrading the driver from an earlier version would
|
||||||
never automatically enable full-duplex mode in an existing installation;
|
never automatically enable full-duplex mode in an existing installation;
|
||||||
it must always be explicitly enabled via one of these code in order to be
|
it must always be explicitly enabled via one of these code in order to be
|
||||||
activated.
|
activated.
|
||||||
|
|
||||||
|
The transceiver type can be changed using 'ethtool'.
|
||||||
|
|
||||||
|
|
||||||
(4a) Interpretation of error messages and common problems
|
(4a) Interpretation of error messages and common problems
|
||||||
|
|
|
@ -33,9 +33,9 @@ head_page - a pointer to the page that the reader will use next
|
||||||
|
|
||||||
tail_page - a pointer to the page that will be written to next
|
tail_page - a pointer to the page that will be written to next
|
||||||
|
|
||||||
commit_page - a pointer to the page with the last finished non nested write.
|
commit_page - a pointer to the page with the last finished non-nested write.
|
||||||
|
|
||||||
cmpxchg - hardware assisted atomic transaction that performs the following:
|
cmpxchg - hardware-assisted atomic transaction that performs the following:
|
||||||
|
|
||||||
A = B iff previous A == C
|
A = B iff previous A == C
|
||||||
|
|
||||||
|
@ -52,15 +52,15 @@ The Generic Ring Buffer
|
||||||
The ring buffer can be used in either an overwrite mode or in
|
The ring buffer can be used in either an overwrite mode or in
|
||||||
producer/consumer mode.
|
producer/consumer mode.
|
||||||
|
|
||||||
Producer/consumer mode is where the producer were to fill up the
|
Producer/consumer mode is where if the producer were to fill up the
|
||||||
buffer before the consumer could free up anything, the producer
|
buffer before the consumer could free up anything, the producer
|
||||||
will stop writing to the buffer. This will lose most recent events.
|
will stop writing to the buffer. This will lose most recent events.
|
||||||
|
|
||||||
Overwrite mode is where the produce were to fill up the buffer
|
Overwrite mode is where if the producer were to fill up the buffer
|
||||||
before the consumer could free up anything, the producer will
|
before the consumer could free up anything, the producer will
|
||||||
overwrite the older data. This will lose the oldest events.
|
overwrite the older data. This will lose the oldest events.
|
||||||
|
|
||||||
No two writers can write at the same time (on the same per cpu buffer),
|
No two writers can write at the same time (on the same per-cpu buffer),
|
||||||
but a writer may interrupt another writer, but it must finish writing
|
but a writer may interrupt another writer, but it must finish writing
|
||||||
before the previous writer may continue. This is very important to the
|
before the previous writer may continue. This is very important to the
|
||||||
algorithm. The writers act like a "stack". The way interrupts works
|
algorithm. The writers act like a "stack". The way interrupts works
|
||||||
|
@ -79,16 +79,16 @@ the interrupt doing a write as well.
|
||||||
|
|
||||||
Readers can happen at any time. But no two readers may run at the
|
Readers can happen at any time. But no two readers may run at the
|
||||||
same time, nor can a reader preempt/interrupt another reader. A reader
|
same time, nor can a reader preempt/interrupt another reader. A reader
|
||||||
can not preempt/interrupt a writer, but it may read/consume from the
|
cannot preempt/interrupt a writer, but it may read/consume from the
|
||||||
buffer at the same time as a writer is writing, but the reader must be
|
buffer at the same time as a writer is writing, but the reader must be
|
||||||
on another processor to do so. A reader may read on its own processor
|
on another processor to do so. A reader may read on its own processor
|
||||||
and can be preempted by a writer.
|
and can be preempted by a writer.
|
||||||
|
|
||||||
A writer can preempt a reader, but a reader can not preempt a writer.
|
A writer can preempt a reader, but a reader cannot preempt a writer.
|
||||||
But a reader can read the buffer at the same time (on another processor)
|
But a reader can read the buffer at the same time (on another processor)
|
||||||
as a writer.
|
as a writer.
|
||||||
|
|
||||||
The ring buffer is made up of a list of pages held together by a link list.
|
The ring buffer is made up of a list of pages held together by a linked list.
|
||||||
|
|
||||||
At initialization a reader page is allocated for the reader that is not
|
At initialization a reader page is allocated for the reader that is not
|
||||||
part of the ring buffer.
|
part of the ring buffer.
|
||||||
|
@ -102,7 +102,7 @@ the head page.
|
||||||
|
|
||||||
The reader has its own page to use. At start up time, this page is
|
The reader has its own page to use. At start up time, this page is
|
||||||
allocated but is not attached to the list. When the reader wants
|
allocated but is not attached to the list. When the reader wants
|
||||||
to read from the buffer, if its page is empty (like it is on start up)
|
to read from the buffer, if its page is empty (like it is on start-up),
|
||||||
it will swap its page with the head_page. The old reader page will
|
it will swap its page with the head_page. The old reader page will
|
||||||
become part of the ring buffer and the head_page will be removed.
|
become part of the ring buffer and the head_page will be removed.
|
||||||
The page after the inserted page (old reader_page) will become the
|
The page after the inserted page (old reader_page) will become the
|
||||||
|
@ -206,7 +206,7 @@ The main pointers:
|
||||||
|
|
||||||
commit page - the page that last finished a write.
|
commit page - the page that last finished a write.
|
||||||
|
|
||||||
The commit page only is updated by the outer most writer in the
|
The commit page only is updated by the outermost writer in the
|
||||||
writer stack. A writer that preempts another writer will not move the
|
writer stack. A writer that preempts another writer will not move the
|
||||||
commit page.
|
commit page.
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ with the previous write.
|
||||||
The commit pointer points to the last write location that was
|
The commit pointer points to the last write location that was
|
||||||
committed without preempting another write. When a write that
|
committed without preempting another write. When a write that
|
||||||
preempted another write is committed, it only becomes a pending commit
|
preempted another write is committed, it only becomes a pending commit
|
||||||
and will not be a full commit till all writes have been committed.
|
and will not be a full commit until all writes have been committed.
|
||||||
|
|
||||||
The commit page points to the page that has the last full commit.
|
The commit page points to the page that has the last full commit.
|
||||||
The tail page points to the page with the last write (before
|
The tail page points to the page with the last write (before
|
||||||
|
@ -292,7 +292,7 @@ be several pages ahead. If the tail page catches up to the commit
|
||||||
page then no more writes may take place (regardless of the mode
|
page then no more writes may take place (regardless of the mode
|
||||||
of the ring buffer: overwrite and produce/consumer).
|
of the ring buffer: overwrite and produce/consumer).
|
||||||
|
|
||||||
The order of pages are:
|
The order of pages is:
|
||||||
|
|
||||||
head page
|
head page
|
||||||
commit page
|
commit page
|
||||||
|
@ -311,7 +311,7 @@ Possible scenario:
|
||||||
There is a special case that the head page is after either the commit page
|
There is a special case that the head page is after either the commit page
|
||||||
and possibly the tail page. That is when the commit (and tail) page has been
|
and possibly the tail page. That is when the commit (and tail) page has been
|
||||||
swapped with the reader page. This is because the head page is always
|
swapped with the reader page. This is because the head page is always
|
||||||
part of the ring buffer, but the reader page is not. When ever there
|
part of the ring buffer, but the reader page is not. Whenever there
|
||||||
has been less than a full page that has been committed inside the ring buffer,
|
has been less than a full page that has been committed inside the ring buffer,
|
||||||
and a reader swaps out a page, it will be swapping out the commit page.
|
and a reader swaps out a page, it will be swapping out the commit page.
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ and a reader swaps out a page, it will be swapping out the commit page.
|
||||||
In this case, the head page will not move when the tail and commit
|
In this case, the head page will not move when the tail and commit
|
||||||
move back into the ring buffer.
|
move back into the ring buffer.
|
||||||
|
|
||||||
The reader can not swap a page into the ring buffer if the commit page
|
The reader cannot swap a page into the ring buffer if the commit page
|
||||||
is still on that page. If the read meets the last commit (real commit
|
is still on that page. If the read meets the last commit (real commit
|
||||||
not pending or reserved), then there is nothing more to read.
|
not pending or reserved), then there is nothing more to read.
|
||||||
The buffer is considered empty until another full commit finishes.
|
The buffer is considered empty until another full commit finishes.
|
||||||
|
@ -395,7 +395,7 @@ The main idea behind the lockless algorithm is to combine the moving
|
||||||
of the head_page pointer with the swapping of pages with the reader.
|
of the head_page pointer with the swapping of pages with the reader.
|
||||||
State flags are placed inside the pointer to the page. To do this,
|
State flags are placed inside the pointer to the page. To do this,
|
||||||
each page must be aligned in memory by 4 bytes. This will allow the 2
|
each page must be aligned in memory by 4 bytes. This will allow the 2
|
||||||
least significant bits of the address to be used as flags. Since
|
least significant bits of the address to be used as flags, since
|
||||||
they will always be zero for the address. To get the address,
|
they will always be zero for the address. To get the address,
|
||||||
simply mask out the flags.
|
simply mask out the flags.
|
||||||
|
|
||||||
|
@ -460,7 +460,7 @@ When the reader tries to swap the page with the ring buffer, it
|
||||||
will also use cmpxchg. If the flag bit in the pointer to the
|
will also use cmpxchg. If the flag bit in the pointer to the
|
||||||
head page does not have the HEADER flag set, the compare will fail
|
head page does not have the HEADER flag set, the compare will fail
|
||||||
and the reader will need to look for the new head page and try again.
|
and the reader will need to look for the new head page and try again.
|
||||||
Note, the flag UPDATE and HEADER are never set at the same time.
|
Note, the flags UPDATE and HEADER are never set at the same time.
|
||||||
|
|
||||||
The reader swaps the reader page as follows:
|
The reader swaps the reader page as follows:
|
||||||
|
|
||||||
|
@ -539,7 +539,7 @@ updated to the reader page.
|
||||||
| +-----------------------------+ |
|
| +-----------------------------+ |
|
||||||
+------------------------------------+
|
+------------------------------------+
|
||||||
|
|
||||||
Another important point. The page that the reader page points back to
|
Another important point: The page that the reader page points back to
|
||||||
by its previous pointer (the one that now points to the new head page)
|
by its previous pointer (the one that now points to the new head page)
|
||||||
never points back to the reader page. That is because the reader page is
|
never points back to the reader page. That is because the reader page is
|
||||||
not part of the ring buffer. Traversing the ring buffer via the next pointers
|
not part of the ring buffer. Traversing the ring buffer via the next pointers
|
||||||
|
@ -572,7 +572,7 @@ not be able to swap the head page from the buffer, nor will it be able to
|
||||||
move the head page, until the writer is finished with the move.
|
move the head page, until the writer is finished with the move.
|
||||||
|
|
||||||
This eliminates any races that the reader can have on the writer. The reader
|
This eliminates any races that the reader can have on the writer. The reader
|
||||||
must spin, and this is why the reader can not preempt the writer.
|
must spin, and this is why the reader cannot preempt the writer.
|
||||||
|
|
||||||
tail page
|
tail page
|
||||||
|
|
|
|
||||||
|
@ -659,9 +659,9 @@ before pushing the head page. If it is, then it can be assumed that the
|
||||||
tail page wrapped the buffer, and we must drop new writes.
|
tail page wrapped the buffer, and we must drop new writes.
|
||||||
|
|
||||||
This is not a race condition, because the commit page can only be moved
|
This is not a race condition, because the commit page can only be moved
|
||||||
by the outter most writer (the writer that was preempted).
|
by the outermost writer (the writer that was preempted).
|
||||||
This means that the commit will not move while a writer is moving the
|
This means that the commit will not move while a writer is moving the
|
||||||
tail page. The reader can not swap the reader page if it is also being
|
tail page. The reader cannot swap the reader page if it is also being
|
||||||
used as the commit page. The reader can simply check that the commit
|
used as the commit page. The reader can simply check that the commit
|
||||||
is off the reader page. Once the commit page leaves the reader page
|
is off the reader page. Once the commit page leaves the reader page
|
||||||
it will never go back on it unless a reader does another swap with the
|
it will never go back on it unless a reader does another swap with the
|
||||||
|
@ -733,7 +733,7 @@ The write converts the head page pointer to UPDATE.
|
||||||
--->| |<---| |<---| |<---| |<---
|
--->| |<---| |<---| |<---| |<---
|
||||||
+---+ +---+ +---+ +---+
|
+---+ +---+ +---+ +---+
|
||||||
|
|
||||||
But if a nested writer preempts here. It will see that the next
|
But if a nested writer preempts here, it will see that the next
|
||||||
page is a head page, but it is also nested. It will detect that
|
page is a head page, but it is also nested. It will detect that
|
||||||
it is nested and will save that information. The detection is the
|
it is nested and will save that information. The detection is the
|
||||||
fact that it sees the UPDATE flag instead of a HEADER or NORMAL
|
fact that it sees the UPDATE flag instead of a HEADER or NORMAL
|
||||||
|
@ -761,7 +761,7 @@ to NORMAL.
|
||||||
--->| |<---| |<---| |<---| |<---
|
--->| |<---| |<---| |<---| |<---
|
||||||
+---+ +---+ +---+ +---+
|
+---+ +---+ +---+ +---+
|
||||||
|
|
||||||
After the nested writer finishes, the outer most writer will convert
|
After the nested writer finishes, the outermost writer will convert
|
||||||
the UPDATE pointer to NORMAL.
|
the UPDATE pointer to NORMAL.
|
||||||
|
|
||||||
|
|
||||||
|
@ -812,7 +812,7 @@ head page.
|
||||||
+---+ +---+ +---+ +---+
|
+---+ +---+ +---+ +---+
|
||||||
|
|
||||||
The nested writer moves the tail page forward. But does not set the old
|
The nested writer moves the tail page forward. But does not set the old
|
||||||
update page to NORMAL because it is not the outer most writer.
|
update page to NORMAL because it is not the outermost writer.
|
||||||
|
|
||||||
tail page
|
tail page
|
||||||
|
|
|
|
||||||
|
@ -892,7 +892,7 @@ It will return to the first writer.
|
||||||
--->| |<---| |<---| |<---| |<---
|
--->| |<---| |<---| |<---| |<---
|
||||||
+---+ +---+ +---+ +---+
|
+---+ +---+ +---+ +---+
|
||||||
|
|
||||||
The first writer can not know atomically test if the tail page moved
|
The first writer cannot know atomically if the tail page moved
|
||||||
while it updates the HEAD page. It will then update the head page to
|
while it updates the HEAD page. It will then update the head page to
|
||||||
what it thinks is the new head page.
|
what it thinks is the new head page.
|
||||||
|
|
||||||
|
@ -923,9 +923,9 @@ if the tail page is either where it use to be or on the next page:
|
||||||
--->| |<---| |<---| |<---| |<---
|
--->| |<---| |<---| |<---| |<---
|
||||||
+---+ +---+ +---+ +---+
|
+---+ +---+ +---+ +---+
|
||||||
|
|
||||||
If tail page != A and tail page does not equal B, then it must reset the
|
If tail page != A and tail page != B, then it must reset the pointer
|
||||||
pointer back to NORMAL. The fact that it only needs to worry about
|
back to NORMAL. The fact that it only needs to worry about nested
|
||||||
nested writers, it only needs to check this after setting the HEAD page.
|
writers means that it only needs to check this after setting the HEAD page.
|
||||||
|
|
||||||
|
|
||||||
(first writer)
|
(first writer)
|
||||||
|
@ -939,7 +939,7 @@ nested writers, it only needs to check this after setting the HEAD page.
|
||||||
+---+ +---+ +---+ +---+
|
+---+ +---+ +---+ +---+
|
||||||
|
|
||||||
Now the writer can update the head page. This is also why the head page must
|
Now the writer can update the head page. This is also why the head page must
|
||||||
remain in UPDATE and only reset by the outer most writer. This prevents
|
remain in UPDATE and only reset by the outermost writer. This prevents
|
||||||
the reader from seeing the incorrect head page.
|
the reader from seeing the incorrect head page.
|
||||||
|
|
||||||
|
|
||||||
|
|
27
MAINTAINERS
27
MAINTAINERS
|
@ -410,9 +410,8 @@ F: drivers/i2c/busses/i2c-ali1563.c
|
||||||
|
|
||||||
ALPHA PORT
|
ALPHA PORT
|
||||||
M: Richard Henderson <rth@twiddle.net>
|
M: Richard Henderson <rth@twiddle.net>
|
||||||
S: Odd Fixes for 2.4; Maintained for 2.6.
|
|
||||||
M: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
|
M: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
|
||||||
S: Maintained for 2.4; PCI support for 2.6.
|
M: Matt Turner <mattst88@gmail.com>
|
||||||
L: linux-alpha@vger.kernel.org
|
L: linux-alpha@vger.kernel.org
|
||||||
F: arch/alpha/
|
F: arch/alpha/
|
||||||
|
|
||||||
|
@ -1638,9 +1637,8 @@ S: Maintained
|
||||||
F: sound/pci/cs5535audio/
|
F: sound/pci/cs5535audio/
|
||||||
|
|
||||||
CX18 VIDEO4LINUX DRIVER
|
CX18 VIDEO4LINUX DRIVER
|
||||||
M: Hans Verkuil <hverkuil@xs4all.nl>
|
|
||||||
M: Andy Walls <awalls@radix.net>
|
M: Andy Walls <awalls@radix.net>
|
||||||
L: ivtv-devel@ivtvdriver.org
|
L: ivtv-devel@ivtvdriver.org (moderated for non-subscribers)
|
||||||
L: linux-media@vger.kernel.org
|
L: linux-media@vger.kernel.org
|
||||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
|
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
|
||||||
W: http://linuxtv.org
|
W: http://linuxtv.org
|
||||||
|
@ -3012,8 +3010,8 @@ S: Maintained
|
||||||
F: drivers/isdn/hardware/eicon/
|
F: drivers/isdn/hardware/eicon/
|
||||||
|
|
||||||
IVTV VIDEO4LINUX DRIVER
|
IVTV VIDEO4LINUX DRIVER
|
||||||
M: Hans Verkuil <hverkuil@xs4all.nl>
|
M: Andy Walls <awalls@radix.net>
|
||||||
L: ivtv-devel@ivtvdriver.org
|
L: ivtv-devel@ivtvdriver.org (moderated for non-subscribers)
|
||||||
L: linux-media@vger.kernel.org
|
L: linux-media@vger.kernel.org
|
||||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
|
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
|
||||||
W: http://www.ivtvdriver.org
|
W: http://www.ivtvdriver.org
|
||||||
|
@ -3940,29 +3938,20 @@ S: Maintained
|
||||||
F: sound/soc/omap/
|
F: sound/soc/omap/
|
||||||
|
|
||||||
OMAP FRAMEBUFFER SUPPORT
|
OMAP FRAMEBUFFER SUPPORT
|
||||||
M: Imre Deak <imre.deak@nokia.com>
|
M: Tomi Valkeinen <tomi.valkeinen@nokia.com>
|
||||||
L: linux-fbdev@vger.kernel.org
|
L: linux-fbdev@vger.kernel.org
|
||||||
L: linux-omap@vger.kernel.org
|
L: linux-omap@vger.kernel.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
F: drivers/video/omap/
|
F: drivers/video/omap/
|
||||||
|
|
||||||
OMAP DISPLAY SUBSYSTEM SUPPORT (DSS2)
|
OMAP DISPLAY SUBSYSTEM and FRAMEBUFFER SUPPORT (DSS2)
|
||||||
M: Tomi Valkeinen <tomi.valkeinen@nokia.com>
|
M: Tomi Valkeinen <tomi.valkeinen@nokia.com>
|
||||||
L: linux-omap@vger.kernel.org
|
L: linux-omap@vger.kernel.org
|
||||||
L: linux-fbdev@vger.kernel.org (moderated for non-subscribers)
|
L: linux-fbdev@vger.kernel.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
F: drivers/video/omap2/dss/
|
F: drivers/video/omap2/
|
||||||
F: drivers/video/omap2/vrfb.c
|
|
||||||
F: drivers/video/omap2/vram.c
|
|
||||||
F: Documentation/arm/OMAP/DSS
|
F: Documentation/arm/OMAP/DSS
|
||||||
|
|
||||||
OMAP FRAMEBUFFER SUPPORT (FOR DSS2)
|
|
||||||
M: Tomi Valkeinen <tomi.valkeinen@nokia.com>
|
|
||||||
L: linux-omap@vger.kernel.org
|
|
||||||
L: linux-fbdev@vger.kernel.org (moderated for non-subscribers)
|
|
||||||
S: Maintained
|
|
||||||
F: drivers/video/omap2/omapfb/
|
|
||||||
|
|
||||||
OMAP MMC SUPPORT
|
OMAP MMC SUPPORT
|
||||||
M: Jarkko Lavinen <jarkko.lavinen@nokia.com>
|
M: Jarkko Lavinen <jarkko.lavinen@nokia.com>
|
||||||
L: linux-omap@vger.kernel.org
|
L: linux-omap@vger.kernel.org
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -1,7 +1,7 @@
|
||||||
VERSION = 2
|
VERSION = 2
|
||||||
PATCHLEVEL = 6
|
PATCHLEVEL = 6
|
||||||
SUBLEVEL = 33
|
SUBLEVEL = 33
|
||||||
EXTRAVERSION = -rc3
|
EXTRAVERSION = -rc4
|
||||||
NAME = Man-Eating Seals of Antiquity
|
NAME = Man-Eating Seals of Antiquity
|
||||||
|
|
||||||
# *DOCUMENTATION*
|
# *DOCUMENTATION*
|
||||||
|
@ -18,10 +18,9 @@ MAKEFLAGS += -rR --no-print-directory
|
||||||
|
|
||||||
# Avoid funny character set dependencies
|
# Avoid funny character set dependencies
|
||||||
unexport LC_ALL
|
unexport LC_ALL
|
||||||
LC_CTYPE=C
|
|
||||||
LC_COLLATE=C
|
LC_COLLATE=C
|
||||||
LC_NUMERIC=C
|
LC_NUMERIC=C
|
||||||
export LC_CTYPE LC_COLLATE LC_NUMERIC
|
export LC_COLLATE LC_NUMERIC
|
||||||
|
|
||||||
# We are using a recursive build, so we need to do a little thinking
|
# We are using a recursive build, so we need to do a little thinking
|
||||||
# to get the ordering right.
|
# to get the ordering right.
|
||||||
|
|
|
@ -329,7 +329,7 @@ extern pgd_t swapper_pg_dir[1024];
|
||||||
* tables contain all the necessary information.
|
* tables contain all the necessary information.
|
||||||
*/
|
*/
|
||||||
extern inline void update_mmu_cache(struct vm_area_struct * vma,
|
extern inline void update_mmu_cache(struct vm_area_struct * vma,
|
||||||
unsigned long address, pte_t pte)
|
unsigned long address, pte_t *ptep)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,9 @@ static const struct cpumask *cpumask_of_node(int node)
|
||||||
{
|
{
|
||||||
int cpu;
|
int cpu;
|
||||||
|
|
||||||
|
if (node == -1)
|
||||||
|
return cpu_all_mask;
|
||||||
|
|
||||||
cpumask_clear(&node_to_cpumask_map[node]);
|
cpumask_clear(&node_to_cpumask_map[node]);
|
||||||
|
|
||||||
for_each_online_cpu(cpu) {
|
for_each_online_cpu(cpu) {
|
||||||
|
|
|
@ -18,6 +18,8 @@ config ARM
|
||||||
select HAVE_KRETPROBES if (HAVE_KPROBES)
|
select HAVE_KRETPROBES if (HAVE_KPROBES)
|
||||||
select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
|
select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
|
||||||
select HAVE_GENERIC_DMA_COHERENT
|
select HAVE_GENERIC_DMA_COHERENT
|
||||||
|
select HAVE_KERNEL_GZIP
|
||||||
|
select HAVE_KERNEL_LZO
|
||||||
help
|
help
|
||||||
The ARM series is a line of low-power-consumption RISC chip designs
|
The ARM series is a line of low-power-consumption RISC chip designs
|
||||||
licensed by ARM Ltd and targeted at embedded applications and
|
licensed by ARM Ltd and targeted at embedded applications and
|
||||||
|
@ -548,6 +550,15 @@ config ARCH_W90X900
|
||||||
<http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/
|
<http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/
|
||||||
ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller>
|
ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller>
|
||||||
|
|
||||||
|
config ARCH_NUC93X
|
||||||
|
bool "Nuvoton NUC93X CPU"
|
||||||
|
select CPU_ARM926T
|
||||||
|
select HAVE_CLK
|
||||||
|
select COMMON_CLKDEV
|
||||||
|
help
|
||||||
|
Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a
|
||||||
|
low-power and high performance MPEG-4/JPEG multimedia controller chip.
|
||||||
|
|
||||||
config ARCH_PNX4008
|
config ARCH_PNX4008
|
||||||
bool "Philips Nexperia PNX4008 Mobile"
|
bool "Philips Nexperia PNX4008 Mobile"
|
||||||
select CPU_ARM926T
|
select CPU_ARM926T
|
||||||
|
@ -688,6 +699,7 @@ config ARCH_DAVINCI
|
||||||
select HAVE_IDE
|
select HAVE_IDE
|
||||||
select COMMON_CLKDEV
|
select COMMON_CLKDEV
|
||||||
select GENERIC_ALLOCATOR
|
select GENERIC_ALLOCATOR
|
||||||
|
select ARCH_HAS_HOLES_MEMORYMODEL
|
||||||
help
|
help
|
||||||
Support for TI's DaVinci platform.
|
Support for TI's DaVinci platform.
|
||||||
|
|
||||||
|
@ -757,6 +769,8 @@ source "arch/arm/plat-pxa/Kconfig"
|
||||||
|
|
||||||
source "arch/arm/mach-mmp/Kconfig"
|
source "arch/arm/mach-mmp/Kconfig"
|
||||||
|
|
||||||
|
source "arch/arm/mach-nuc93x/Kconfig"
|
||||||
|
|
||||||
source "arch/arm/mach-sa1100/Kconfig"
|
source "arch/arm/mach-sa1100/Kconfig"
|
||||||
|
|
||||||
source "arch/arm/plat-omap/Kconfig"
|
source "arch/arm/plat-omap/Kconfig"
|
||||||
|
|
|
@ -170,6 +170,7 @@ machine-$(CONFIG_ARCH_U300) := u300
|
||||||
machine-$(CONFIG_ARCH_U8500) := ux500
|
machine-$(CONFIG_ARCH_U8500) := ux500
|
||||||
machine-$(CONFIG_ARCH_VERSATILE) := versatile
|
machine-$(CONFIG_ARCH_VERSATILE) := versatile
|
||||||
machine-$(CONFIG_ARCH_W90X900) := w90x900
|
machine-$(CONFIG_ARCH_W90X900) := w90x900
|
||||||
|
machine-$(CONFIG_ARCH_NUC93X) := nuc93x
|
||||||
machine-$(CONFIG_FOOTBRIDGE) := footbridge
|
machine-$(CONFIG_FOOTBRIDGE) := footbridge
|
||||||
machine-$(CONFIG_ARCH_MXC91231) := mxc91231
|
machine-$(CONFIG_ARCH_MXC91231) := mxc91231
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,12 @@ endif
|
||||||
|
|
||||||
SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
|
SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
|
||||||
|
|
||||||
targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \
|
suffix_$(CONFIG_KERNEL_GZIP) = gzip
|
||||||
head.o misc.o $(OBJS)
|
suffix_$(CONFIG_KERNEL_LZO) = lzo
|
||||||
|
|
||||||
|
targets := vmlinux vmlinux.lds \
|
||||||
|
piggy.$(suffix_y) piggy.$(suffix_y).o \
|
||||||
|
font.o font.c head.o misc.o $(OBJS)
|
||||||
|
|
||||||
ifeq ($(CONFIG_FUNCTION_TRACER),y)
|
ifeq ($(CONFIG_FUNCTION_TRACER),y)
|
||||||
ORIG_CFLAGS := $(KBUILD_CFLAGS)
|
ORIG_CFLAGS := $(KBUILD_CFLAGS)
|
||||||
|
@ -87,22 +91,34 @@ endif
|
||||||
ifneq ($(PARAMS_PHYS),)
|
ifneq ($(PARAMS_PHYS),)
|
||||||
LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS)
|
LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS)
|
||||||
endif
|
endif
|
||||||
LDFLAGS_vmlinux += -p --no-undefined -X \
|
# ?
|
||||||
$(shell $(CC) $(KBUILD_CFLAGS) --print-libgcc-file-name) -T
|
LDFLAGS_vmlinux += -p
|
||||||
|
# Report unresolved symbol references
|
||||||
|
LDFLAGS_vmlinux += --no-undefined
|
||||||
|
# Delete all temporary local symbols
|
||||||
|
LDFLAGS_vmlinux += -X
|
||||||
|
# Next argument is a linker script
|
||||||
|
LDFLAGS_vmlinux += -T
|
||||||
|
|
||||||
|
# For __aeabi_uidivmod
|
||||||
|
lib1funcs = $(obj)/lib1funcs.o
|
||||||
|
|
||||||
|
$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
|
||||||
|
$(call cmd,shipped)
|
||||||
|
|
||||||
# Don't allow any static data in misc.o, which
|
# Don't allow any static data in misc.o, which
|
||||||
# would otherwise mess up our GOT table
|
# would otherwise mess up our GOT table
|
||||||
CFLAGS_misc.o := -Dstatic=
|
CFLAGS_misc.o := -Dstatic=
|
||||||
|
|
||||||
$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
|
$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
|
||||||
$(addprefix $(obj)/, $(OBJS)) FORCE
|
$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
|
||||||
$(call if_changed,ld)
|
$(call if_changed,ld)
|
||||||
@:
|
@:
|
||||||
|
|
||||||
$(obj)/piggy.gz: $(obj)/../Image FORCE
|
$(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE
|
||||||
$(call if_changed,gzip)
|
$(call if_changed,$(suffix_y))
|
||||||
|
|
||||||
$(obj)/piggy.o: $(obj)/piggy.gz FORCE
|
$(obj)/piggy.$(suffix_y).o: $(obj)/piggy.$(suffix_y) FORCE
|
||||||
|
|
||||||
CFLAGS_font.o := -Dstatic=
|
CFLAGS_font.o := -Dstatic=
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,15 @@
|
||||||
|
|
||||||
unsigned int __machine_arch_type;
|
unsigned int __machine_arch_type;
|
||||||
|
|
||||||
|
#define _LINUX_STRING_H_
|
||||||
|
|
||||||
#include <linux/compiler.h> /* for inline */
|
#include <linux/compiler.h> /* for inline */
|
||||||
#include <linux/types.h> /* for size_t */
|
#include <linux/types.h> /* for size_t */
|
||||||
#include <linux/stddef.h> /* for NULL */
|
#include <linux/stddef.h> /* for NULL */
|
||||||
#include <asm/string.h>
|
#include <asm/string.h>
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
|
#include <asm/unaligned.h>
|
||||||
|
|
||||||
#ifdef STANDALONE_DEBUG
|
#ifdef STANDALONE_DEBUG
|
||||||
#define putstr printf
|
#define putstr printf
|
||||||
|
@ -188,34 +193,8 @@ static inline __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src,
|
||||||
/*
|
/*
|
||||||
* gzip delarations
|
* gzip delarations
|
||||||
*/
|
*/
|
||||||
#define OF(args) args
|
|
||||||
#define STATIC static
|
#define STATIC static
|
||||||
|
|
||||||
typedef unsigned char uch;
|
|
||||||
typedef unsigned short ush;
|
|
||||||
typedef unsigned long ulg;
|
|
||||||
|
|
||||||
#define WSIZE 0x8000 /* Window size must be at least 32k, */
|
|
||||||
/* and a power of two */
|
|
||||||
|
|
||||||
static uch *inbuf; /* input buffer */
|
|
||||||
static uch window[WSIZE]; /* Sliding window buffer */
|
|
||||||
|
|
||||||
static unsigned insize; /* valid bytes in inbuf */
|
|
||||||
static unsigned inptr; /* index of next byte to be processed in inbuf */
|
|
||||||
static unsigned outcnt; /* bytes in output buffer */
|
|
||||||
|
|
||||||
/* gzip flag byte */
|
|
||||||
#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
|
|
||||||
#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
|
|
||||||
#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
|
|
||||||
#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
|
|
||||||
#define COMMENT 0x10 /* bit 4 set: file comment present */
|
|
||||||
#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
|
|
||||||
#define RESERVED 0xC0 /* bit 6,7: reserved */
|
|
||||||
|
|
||||||
#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())
|
|
||||||
|
|
||||||
/* Diagnostic functions */
|
/* Diagnostic functions */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
# define Assert(cond,msg) {if(!(cond)) error(msg);}
|
# define Assert(cond,msg) {if(!(cond)) error(msg);}
|
||||||
|
@ -233,24 +212,20 @@ static unsigned outcnt; /* bytes in output buffer */
|
||||||
# define Tracecv(c,x)
|
# define Tracecv(c,x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int fill_inbuf(void);
|
|
||||||
static void flush_window(void);
|
|
||||||
static void error(char *m);
|
static void error(char *m);
|
||||||
|
|
||||||
extern char input_data[];
|
extern char input_data[];
|
||||||
extern char input_data_end[];
|
extern char input_data_end[];
|
||||||
|
|
||||||
static uch *output_data;
|
static unsigned char *output_data;
|
||||||
static ulg output_ptr;
|
static unsigned long output_ptr;
|
||||||
static ulg bytes_out;
|
|
||||||
|
|
||||||
static void error(char *m);
|
static void error(char *m);
|
||||||
|
|
||||||
static void putstr(const char *);
|
static void putstr(const char *);
|
||||||
|
|
||||||
extern int end;
|
static unsigned long free_mem_ptr;
|
||||||
static ulg free_mem_ptr;
|
static unsigned long free_mem_end_ptr;
|
||||||
static ulg free_mem_end_ptr;
|
|
||||||
|
|
||||||
#ifdef STANDALONE_DEBUG
|
#ifdef STANDALONE_DEBUG
|
||||||
#define NO_INFLATE_MALLOC
|
#define NO_INFLATE_MALLOC
|
||||||
|
@ -258,46 +233,13 @@ static ulg free_mem_end_ptr;
|
||||||
|
|
||||||
#define ARCH_HAS_DECOMP_WDOG
|
#define ARCH_HAS_DECOMP_WDOG
|
||||||
|
|
||||||
#include "../../../../lib/inflate.c"
|
#ifdef CONFIG_KERNEL_GZIP
|
||||||
|
#include "../../../../lib/decompress_inflate.c"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ===========================================================================
|
#ifdef CONFIG_KERNEL_LZO
|
||||||
* Fill the input buffer. This is called only when the buffer is empty
|
#include "../../../../lib/decompress_unlzo.c"
|
||||||
* and at least one byte is really needed.
|
#endif
|
||||||
*/
|
|
||||||
int fill_inbuf(void)
|
|
||||||
{
|
|
||||||
if (insize != 0)
|
|
||||||
error("ran out of input data");
|
|
||||||
|
|
||||||
inbuf = input_data;
|
|
||||||
insize = &input_data_end[0] - &input_data[0];
|
|
||||||
|
|
||||||
inptr = 1;
|
|
||||||
return inbuf[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ===========================================================================
|
|
||||||
* Write the output window window[0..outcnt-1] and update crc and bytes_out.
|
|
||||||
* (Used for the decompressed data only.)
|
|
||||||
*/
|
|
||||||
void flush_window(void)
|
|
||||||
{
|
|
||||||
ulg c = crc;
|
|
||||||
unsigned n;
|
|
||||||
uch *in, *out, ch;
|
|
||||||
|
|
||||||
in = window;
|
|
||||||
out = &output_data[output_ptr];
|
|
||||||
for (n = 0; n < outcnt; n++) {
|
|
||||||
ch = *out++ = *in++;
|
|
||||||
c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
|
|
||||||
}
|
|
||||||
crc = c;
|
|
||||||
bytes_out += (ulg)outcnt;
|
|
||||||
output_ptr += (ulg)outcnt;
|
|
||||||
outcnt = 0;
|
|
||||||
putstr(".");
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef arch_error
|
#ifndef arch_error
|
||||||
#define arch_error(x)
|
#define arch_error(x)
|
||||||
|
@ -314,22 +256,33 @@ static void error(char *x)
|
||||||
while(1); /* Halt */
|
while(1); /* Halt */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
asmlinkage void __div0(void)
|
||||||
|
{
|
||||||
|
error("Attempting division by 0!");
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef STANDALONE_DEBUG
|
#ifndef STANDALONE_DEBUG
|
||||||
|
|
||||||
ulg
|
unsigned long
|
||||||
decompress_kernel(ulg output_start, ulg free_mem_ptr_p, ulg free_mem_ptr_end_p,
|
decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
|
||||||
int arch_id)
|
unsigned long free_mem_ptr_end_p,
|
||||||
|
int arch_id)
|
||||||
{
|
{
|
||||||
output_data = (uch *)output_start; /* Points to kernel start */
|
unsigned char *tmp;
|
||||||
|
|
||||||
|
output_data = (unsigned char *)output_start;
|
||||||
free_mem_ptr = free_mem_ptr_p;
|
free_mem_ptr = free_mem_ptr_p;
|
||||||
free_mem_end_ptr = free_mem_ptr_end_p;
|
free_mem_end_ptr = free_mem_ptr_end_p;
|
||||||
__machine_arch_type = arch_id;
|
__machine_arch_type = arch_id;
|
||||||
|
|
||||||
arch_decomp_setup();
|
arch_decomp_setup();
|
||||||
|
|
||||||
makecrc();
|
tmp = (unsigned char *) (((unsigned long)input_data_end) - 4);
|
||||||
|
output_ptr = get_unaligned_le32(tmp);
|
||||||
|
|
||||||
putstr("Uncompressing Linux...");
|
putstr("Uncompressing Linux...");
|
||||||
gunzip();
|
decompress(input_data, input_data_end - input_data,
|
||||||
|
NULL, NULL, output_data, NULL, error);
|
||||||
putstr(" done, booting the kernel.\n");
|
putstr(" done, booting the kernel.\n");
|
||||||
return output_ptr;
|
return output_ptr;
|
||||||
}
|
}
|
||||||
|
@ -341,11 +294,10 @@ int main()
|
||||||
{
|
{
|
||||||
output_data = output_buffer;
|
output_data = output_buffer;
|
||||||
|
|
||||||
makecrc();
|
|
||||||
putstr("Uncompressing Linux...");
|
putstr("Uncompressing Linux...");
|
||||||
gunzip();
|
decompress(input_data, input_data_end - input_data,
|
||||||
|
NULL, NULL, output_data, NULL, error);
|
||||||
putstr("done.\n");
|
putstr("done.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
6
arch/arm/boot/compressed/piggy.gzip.S
Normal file
6
arch/arm/boot/compressed/piggy.gzip.S
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.section .piggydata,#alloc
|
||||||
|
.globl input_data
|
||||||
|
input_data:
|
||||||
|
.incbin "arch/arm/boot/compressed/piggy.gzip"
|
||||||
|
.globl input_data_end
|
||||||
|
input_data_end:
|
|
@ -1,6 +1,6 @@
|
||||||
.section .piggydata,#alloc
|
.section .piggydata,#alloc
|
||||||
.globl input_data
|
.globl input_data
|
||||||
input_data:
|
input_data:
|
||||||
.incbin "arch/arm/boot/compressed/piggy.gz"
|
.incbin "arch/arm/boot/compressed/piggy.lzo"
|
||||||
.globl input_data_end
|
.globl input_data_end
|
||||||
input_data_end:
|
input_data_end:
|
|
@ -277,7 +277,7 @@ static inline dma_addr_t map_single(struct device *dev, void *ptr, size_t size,
|
||||||
* We don't need to sync the DMA buffer since
|
* We don't need to sync the DMA buffer since
|
||||||
* it was allocated via the coherent allocators.
|
* it was allocated via the coherent allocators.
|
||||||
*/
|
*/
|
||||||
dma_cache_maint(ptr, size, dir);
|
__dma_single_cpu_to_dev(ptr, size, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dma_addr;
|
return dma_addr;
|
||||||
|
@ -315,6 +315,8 @@ static inline void unmap_single(struct device *dev, dma_addr_t dma_addr,
|
||||||
__cpuc_flush_dcache_area(ptr, size);
|
__cpuc_flush_dcache_area(ptr, size);
|
||||||
}
|
}
|
||||||
free_safe_buffer(dev->archdata.dmabounce, buf);
|
free_safe_buffer(dev->archdata.dmabounce, buf);
|
||||||
|
} else {
|
||||||
|
__dma_single_dev_to_cpu(dma_to_virt(dev, dma_addr), size, dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
|
@ -28,48 +29,6 @@
|
||||||
#include <asm/mach/irq.h>
|
#include <asm/mach/irq.h>
|
||||||
#include <asm/hardware/vic.h>
|
#include <asm/hardware/vic.h>
|
||||||
|
|
||||||
static void vic_ack_irq(unsigned int irq)
|
|
||||||
{
|
|
||||||
void __iomem *base = get_irq_chip_data(irq);
|
|
||||||
irq &= 31;
|
|
||||||
writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
|
|
||||||
/* moreover, clear the soft-triggered, in case it was the reason */
|
|
||||||
writel(1 << irq, base + VIC_INT_SOFT_CLEAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void vic_mask_irq(unsigned int irq)
|
|
||||||
{
|
|
||||||
void __iomem *base = get_irq_chip_data(irq);
|
|
||||||
irq &= 31;
|
|
||||||
writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void vic_unmask_irq(unsigned int irq)
|
|
||||||
{
|
|
||||||
void __iomem *base = get_irq_chip_data(irq);
|
|
||||||
irq &= 31;
|
|
||||||
writel(1 << irq, base + VIC_INT_ENABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* vic_init2 - common initialisation code
|
|
||||||
* @base: Base of the VIC.
|
|
||||||
*
|
|
||||||
* Common initialisation code for registeration
|
|
||||||
* and resume.
|
|
||||||
*/
|
|
||||||
static void vic_init2(void __iomem *base)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 16; i++) {
|
|
||||||
void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
|
|
||||||
writel(VIC_VECT_CNTL_ENABLE | i, reg);
|
|
||||||
}
|
|
||||||
|
|
||||||
writel(32, base + VIC_PL190_DEF_VECT_ADDR);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(CONFIG_PM)
|
#if defined(CONFIG_PM)
|
||||||
/**
|
/**
|
||||||
* struct vic_device - VIC PM device
|
* struct vic_device - VIC PM device
|
||||||
|
@ -99,13 +58,34 @@ struct vic_device {
|
||||||
/* we cannot allocate memory when VICs are initially registered */
|
/* we cannot allocate memory when VICs are initially registered */
|
||||||
static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];
|
static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];
|
||||||
|
|
||||||
|
static int vic_id;
|
||||||
|
|
||||||
static inline struct vic_device *to_vic(struct sys_device *sys)
|
static inline struct vic_device *to_vic(struct sys_device *sys)
|
||||||
{
|
{
|
||||||
return container_of(sys, struct vic_device, sysdev);
|
return container_of(sys, struct vic_device, sysdev);
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
static int vic_id;
|
/**
|
||||||
|
* vic_init2 - common initialisation code
|
||||||
|
* @base: Base of the VIC.
|
||||||
|
*
|
||||||
|
* Common initialisation code for registeration
|
||||||
|
* and resume.
|
||||||
|
*/
|
||||||
|
static void vic_init2(void __iomem *base)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 16; i++) {
|
||||||
|
void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
|
||||||
|
writel(VIC_VECT_CNTL_ENABLE | i, reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
writel(32, base + VIC_PL190_DEF_VECT_ADDR);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_PM)
|
||||||
static int vic_class_resume(struct sys_device *dev)
|
static int vic_class_resume(struct sys_device *dev)
|
||||||
{
|
{
|
||||||
struct vic_device *vic = to_vic(dev);
|
struct vic_device *vic = to_vic(dev);
|
||||||
|
@ -158,31 +138,6 @@ struct sysdev_class vic_class = {
|
||||||
.resume = vic_class_resume,
|
.resume = vic_class_resume,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* vic_pm_register - Register a VIC for later power management control
|
|
||||||
* @base: The base address of the VIC.
|
|
||||||
* @irq: The base IRQ for the VIC.
|
|
||||||
* @resume_sources: bitmask of interrupts allowed for resume sources.
|
|
||||||
*
|
|
||||||
* Register the VIC with the system device tree so that it can be notified
|
|
||||||
* of suspend and resume requests and ensure that the correct actions are
|
|
||||||
* taken to re-instate the settings on resume.
|
|
||||||
*/
|
|
||||||
static void __init vic_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources)
|
|
||||||
{
|
|
||||||
struct vic_device *v;
|
|
||||||
|
|
||||||
if (vic_id >= ARRAY_SIZE(vic_devices))
|
|
||||||
printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
|
|
||||||
else {
|
|
||||||
v = &vic_devices[vic_id];
|
|
||||||
v->base = base;
|
|
||||||
v->resume_sources = resume_sources;
|
|
||||||
v->irq = irq;
|
|
||||||
vic_id++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vic_pm_init - initicall to register VIC pm
|
* vic_pm_init - initicall to register VIC pm
|
||||||
*
|
*
|
||||||
|
@ -219,9 +174,60 @@ static int __init vic_pm_init(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
late_initcall(vic_pm_init);
|
late_initcall(vic_pm_init);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* vic_pm_register - Register a VIC for later power management control
|
||||||
|
* @base: The base address of the VIC.
|
||||||
|
* @irq: The base IRQ for the VIC.
|
||||||
|
* @resume_sources: bitmask of interrupts allowed for resume sources.
|
||||||
|
*
|
||||||
|
* Register the VIC with the system device tree so that it can be notified
|
||||||
|
* of suspend and resume requests and ensure that the correct actions are
|
||||||
|
* taken to re-instate the settings on resume.
|
||||||
|
*/
|
||||||
|
static void __init vic_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources)
|
||||||
|
{
|
||||||
|
struct vic_device *v;
|
||||||
|
|
||||||
|
if (vic_id >= ARRAY_SIZE(vic_devices))
|
||||||
|
printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
|
||||||
|
else {
|
||||||
|
v = &vic_devices[vic_id];
|
||||||
|
v->base = base;
|
||||||
|
v->resume_sources = resume_sources;
|
||||||
|
v->irq = irq;
|
||||||
|
vic_id++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { }
|
||||||
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
|
static void vic_ack_irq(unsigned int irq)
|
||||||
|
{
|
||||||
|
void __iomem *base = get_irq_chip_data(irq);
|
||||||
|
irq &= 31;
|
||||||
|
writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
|
||||||
|
/* moreover, clear the soft-triggered, in case it was the reason */
|
||||||
|
writel(1 << irq, base + VIC_INT_SOFT_CLEAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void vic_mask_irq(unsigned int irq)
|
||||||
|
{
|
||||||
|
void __iomem *base = get_irq_chip_data(irq);
|
||||||
|
irq &= 31;
|
||||||
|
writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void vic_unmask_irq(unsigned int irq)
|
||||||
|
{
|
||||||
|
void __iomem *base = get_irq_chip_data(irq);
|
||||||
|
irq &= 31;
|
||||||
|
writel(1 << irq, base + VIC_INT_ENABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_PM)
|
||||||
static struct vic_device *vic_from_irq(unsigned int irq)
|
static struct vic_device *vic_from_irq(unsigned int irq)
|
||||||
{
|
{
|
||||||
struct vic_device *v = vic_devices;
|
struct vic_device *v = vic_devices;
|
||||||
|
@ -255,10 +261,7 @@ static int vic_set_wake(unsigned int irq, unsigned int on)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { }
|
|
||||||
|
|
||||||
#define vic_set_wake NULL
|
#define vic_set_wake NULL
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
|
@ -270,80 +273,6 @@ static struct irq_chip vic_chip = {
|
||||||
.set_wake = vic_set_wake,
|
.set_wake = vic_set_wake,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The PL190 cell from ARM has been modified by ST, so handle both here */
|
|
||||||
static void vik_init_st(void __iomem *base, unsigned int irq_start,
|
|
||||||
u32 vic_sources);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* vic_init - initialise a vectored interrupt controller
|
|
||||||
* @base: iomem base address
|
|
||||||
* @irq_start: starting interrupt number, must be muliple of 32
|
|
||||||
* @vic_sources: bitmask of interrupt sources to allow
|
|
||||||
* @resume_sources: bitmask of interrupt sources to allow for resume
|
|
||||||
*/
|
|
||||||
void __init vic_init(void __iomem *base, unsigned int irq_start,
|
|
||||||
u32 vic_sources, u32 resume_sources)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
u32 cellid = 0;
|
|
||||||
enum amba_vendor vendor;
|
|
||||||
|
|
||||||
/* Identify which VIC cell this one is, by reading the ID */
|
|
||||||
for (i = 0; i < 4; i++) {
|
|
||||||
u32 addr = ((u32)base & PAGE_MASK) + 0xfe0 + (i * 4);
|
|
||||||
cellid |= (readl(addr) & 0xff) << (8 * i);
|
|
||||||
}
|
|
||||||
vendor = (cellid >> 12) & 0xff;
|
|
||||||
printk(KERN_INFO "VIC @%p: id 0x%08x, vendor 0x%02x\n",
|
|
||||||
base, cellid, vendor);
|
|
||||||
|
|
||||||
switch(vendor) {
|
|
||||||
case AMBA_VENDOR_ST:
|
|
||||||
vik_init_st(base, irq_start, vic_sources);
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n");
|
|
||||||
/* fall through */
|
|
||||||
case AMBA_VENDOR_ARM:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Disable all interrupts initially. */
|
|
||||||
|
|
||||||
writel(0, base + VIC_INT_SELECT);
|
|
||||||
writel(0, base + VIC_INT_ENABLE);
|
|
||||||
writel(~0, base + VIC_INT_ENABLE_CLEAR);
|
|
||||||
writel(0, base + VIC_IRQ_STATUS);
|
|
||||||
writel(0, base + VIC_ITCR);
|
|
||||||
writel(~0, base + VIC_INT_SOFT_CLEAR);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Make sure we clear all existing interrupts
|
|
||||||
*/
|
|
||||||
writel(0, base + VIC_PL190_VECT_ADDR);
|
|
||||||
for (i = 0; i < 19; i++) {
|
|
||||||
unsigned int value;
|
|
||||||
|
|
||||||
value = readl(base + VIC_PL190_VECT_ADDR);
|
|
||||||
writel(value, base + VIC_PL190_VECT_ADDR);
|
|
||||||
}
|
|
||||||
|
|
||||||
vic_init2(base);
|
|
||||||
|
|
||||||
for (i = 0; i < 32; i++) {
|
|
||||||
if (vic_sources & (1 << i)) {
|
|
||||||
unsigned int irq = irq_start + i;
|
|
||||||
|
|
||||||
set_irq_chip(irq, &vic_chip);
|
|
||||||
set_irq_chip_data(irq, base);
|
|
||||||
set_irq_handler(irq, handle_level_irq);
|
|
||||||
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vic_pm_register(base, irq_start, resume_sources);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The PL190 cell from ARM has been modified by ST to handle 64 interrupts.
|
* The PL190 cell from ARM has been modified by ST to handle 64 interrupts.
|
||||||
* The original cell has 32 interrupts, while the modified one has 64,
|
* The original cell has 32 interrupts, while the modified one has 64,
|
||||||
|
@ -351,7 +280,7 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
|
||||||
* the probe function is called twice, with base set to offset 000
|
* the probe function is called twice, with base set to offset 000
|
||||||
* and 020 within the page. We call this "second block".
|
* and 020 within the page. We call this "second block".
|
||||||
*/
|
*/
|
||||||
static void __init vik_init_st(void __iomem *base, unsigned int irq_start,
|
static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
|
||||||
u32 vic_sources)
|
u32 vic_sources)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
@ -400,3 +329,73 @@ static void __init vik_init_st(void __iomem *base, unsigned int irq_start,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* vic_init - initialise a vectored interrupt controller
|
||||||
|
* @base: iomem base address
|
||||||
|
* @irq_start: starting interrupt number, must be muliple of 32
|
||||||
|
* @vic_sources: bitmask of interrupt sources to allow
|
||||||
|
* @resume_sources: bitmask of interrupt sources to allow for resume
|
||||||
|
*/
|
||||||
|
void __init vic_init(void __iomem *base, unsigned int irq_start,
|
||||||
|
u32 vic_sources, u32 resume_sources)
|
||||||
|
{
|
||||||
|
unsigned int i;
|
||||||
|
u32 cellid = 0;
|
||||||
|
enum amba_vendor vendor;
|
||||||
|
|
||||||
|
/* Identify which VIC cell this one is, by reading the ID */
|
||||||
|
for (i = 0; i < 4; i++) {
|
||||||
|
u32 addr = ((u32)base & PAGE_MASK) + 0xfe0 + (i * 4);
|
||||||
|
cellid |= (readl(addr) & 0xff) << (8 * i);
|
||||||
|
}
|
||||||
|
vendor = (cellid >> 12) & 0xff;
|
||||||
|
printk(KERN_INFO "VIC @%p: id 0x%08x, vendor 0x%02x\n",
|
||||||
|
base, cellid, vendor);
|
||||||
|
|
||||||
|
switch(vendor) {
|
||||||
|
case AMBA_VENDOR_ST:
|
||||||
|
vic_init_st(base, irq_start, vic_sources);
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n");
|
||||||
|
/* fall through */
|
||||||
|
case AMBA_VENDOR_ARM:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Disable all interrupts initially. */
|
||||||
|
|
||||||
|
writel(0, base + VIC_INT_SELECT);
|
||||||
|
writel(0, base + VIC_INT_ENABLE);
|
||||||
|
writel(~0, base + VIC_INT_ENABLE_CLEAR);
|
||||||
|
writel(0, base + VIC_IRQ_STATUS);
|
||||||
|
writel(0, base + VIC_ITCR);
|
||||||
|
writel(~0, base + VIC_INT_SOFT_CLEAR);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make sure we clear all existing interrupts
|
||||||
|
*/
|
||||||
|
writel(0, base + VIC_PL190_VECT_ADDR);
|
||||||
|
for (i = 0; i < 19; i++) {
|
||||||
|
unsigned int value;
|
||||||
|
|
||||||
|
value = readl(base + VIC_PL190_VECT_ADDR);
|
||||||
|
writel(value, base + VIC_PL190_VECT_ADDR);
|
||||||
|
}
|
||||||
|
|
||||||
|
vic_init2(base);
|
||||||
|
|
||||||
|
for (i = 0; i < 32; i++) {
|
||||||
|
if (vic_sources & (1 << i)) {
|
||||||
|
unsigned int irq = irq_start + i;
|
||||||
|
|
||||||
|
set_irq_chip(irq, &vic_chip);
|
||||||
|
set_irq_chip_data(irq, base);
|
||||||
|
set_irq_handler(irq, handle_level_irq);
|
||||||
|
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vic_pm_register(base, irq_start, resume_sources);
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#
|
#
|
||||||
# Automatically generated make config: don't edit
|
# Automatically generated make config: don't edit
|
||||||
# Linux kernel version: 2.6.32-rc5
|
# Linux kernel version: 2.6.33-rc2
|
||||||
# Sat Oct 17 23:32:24 2009
|
# Wed Jan 6 00:01:36 2010
|
||||||
#
|
#
|
||||||
CONFIG_ARM=y
|
CONFIG_ARM=y
|
||||||
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
|
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
|
||||||
|
@ -46,6 +46,7 @@ CONFIG_SYSVIPC_SYSCTL=y
|
||||||
#
|
#
|
||||||
CONFIG_TREE_RCU=y
|
CONFIG_TREE_RCU=y
|
||||||
# CONFIG_TREE_PREEMPT_RCU is not set
|
# CONFIG_TREE_PREEMPT_RCU is not set
|
||||||
|
# CONFIG_TINY_RCU is not set
|
||||||
# CONFIG_RCU_TRACE is not set
|
# CONFIG_RCU_TRACE is not set
|
||||||
CONFIG_RCU_FANOUT=32
|
CONFIG_RCU_FANOUT=32
|
||||||
# CONFIG_RCU_FANOUT_EXACT is not set
|
# CONFIG_RCU_FANOUT_EXACT is not set
|
||||||
|
@ -119,14 +120,41 @@ CONFIG_BLOCK=y
|
||||||
# IO Schedulers
|
# IO Schedulers
|
||||||
#
|
#
|
||||||
CONFIG_IOSCHED_NOOP=y
|
CONFIG_IOSCHED_NOOP=y
|
||||||
# CONFIG_IOSCHED_AS is not set
|
|
||||||
CONFIG_IOSCHED_DEADLINE=y
|
CONFIG_IOSCHED_DEADLINE=y
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
# CONFIG_IOSCHED_CFQ is not set
|
||||||
# CONFIG_DEFAULT_AS is not set
|
|
||||||
CONFIG_DEFAULT_DEADLINE=y
|
CONFIG_DEFAULT_DEADLINE=y
|
||||||
# CONFIG_DEFAULT_CFQ is not set
|
# CONFIG_DEFAULT_CFQ is not set
|
||||||
# CONFIG_DEFAULT_NOOP is not set
|
# CONFIG_DEFAULT_NOOP is not set
|
||||||
CONFIG_DEFAULT_IOSCHED="deadline"
|
CONFIG_DEFAULT_IOSCHED="deadline"
|
||||||
|
# CONFIG_INLINE_SPIN_TRYLOCK is not set
|
||||||
|
# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
|
||||||
|
# CONFIG_INLINE_SPIN_LOCK is not set
|
||||||
|
# CONFIG_INLINE_SPIN_LOCK_BH is not set
|
||||||
|
# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
|
||||||
|
# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
|
||||||
|
# CONFIG_INLINE_SPIN_UNLOCK is not set
|
||||||
|
# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
|
||||||
|
# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
|
||||||
|
# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
|
||||||
|
# CONFIG_INLINE_READ_TRYLOCK is not set
|
||||||
|
# CONFIG_INLINE_READ_LOCK is not set
|
||||||
|
# CONFIG_INLINE_READ_LOCK_BH is not set
|
||||||
|
# CONFIG_INLINE_READ_LOCK_IRQ is not set
|
||||||
|
# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
|
||||||
|
# CONFIG_INLINE_READ_UNLOCK is not set
|
||||||
|
# CONFIG_INLINE_READ_UNLOCK_BH is not set
|
||||||
|
# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
|
||||||
|
# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
|
||||||
|
# CONFIG_INLINE_WRITE_TRYLOCK is not set
|
||||||
|
# CONFIG_INLINE_WRITE_LOCK is not set
|
||||||
|
# CONFIG_INLINE_WRITE_LOCK_BH is not set
|
||||||
|
# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
|
||||||
|
# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
|
||||||
|
# CONFIG_INLINE_WRITE_UNLOCK is not set
|
||||||
|
# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
|
||||||
|
# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
|
||||||
|
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
|
||||||
|
# CONFIG_MUTEX_SPIN_ON_OWNER is not set
|
||||||
# CONFIG_FREEZER is not set
|
# CONFIG_FREEZER is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -155,6 +183,7 @@ CONFIG_MMU=y
|
||||||
# CONFIG_ARCH_IXP2000 is not set
|
# CONFIG_ARCH_IXP2000 is not set
|
||||||
# CONFIG_ARCH_IXP4XX is not set
|
# CONFIG_ARCH_IXP4XX is not set
|
||||||
# CONFIG_ARCH_L7200 is not set
|
# CONFIG_ARCH_L7200 is not set
|
||||||
|
# CONFIG_ARCH_DOVE is not set
|
||||||
# CONFIG_ARCH_KIRKWOOD is not set
|
# CONFIG_ARCH_KIRKWOOD is not set
|
||||||
# CONFIG_ARCH_LOKI is not set
|
# CONFIG_ARCH_LOKI is not set
|
||||||
# CONFIG_ARCH_MV78XX0 is not set
|
# CONFIG_ARCH_MV78XX0 is not set
|
||||||
|
@ -177,6 +206,7 @@ CONFIG_ARCH_U300=y
|
||||||
# CONFIG_ARCH_DAVINCI is not set
|
# CONFIG_ARCH_DAVINCI is not set
|
||||||
# CONFIG_ARCH_OMAP is not set
|
# CONFIG_ARCH_OMAP is not set
|
||||||
# CONFIG_ARCH_BCMRING is not set
|
# CONFIG_ARCH_BCMRING is not set
|
||||||
|
# CONFIG_ARCH_U8500 is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
# ST-Ericsson AB U300/U330/U335/U365 Platform
|
# ST-Ericsson AB U300/U330/U335/U365 Platform
|
||||||
|
@ -265,12 +295,10 @@ CONFIG_FLATMEM_MANUAL=y
|
||||||
CONFIG_FLATMEM=y
|
CONFIG_FLATMEM=y
|
||||||
CONFIG_FLAT_NODE_MEM_MAP=y
|
CONFIG_FLAT_NODE_MEM_MAP=y
|
||||||
CONFIG_PAGEFLAGS_EXTENDED=y
|
CONFIG_PAGEFLAGS_EXTENDED=y
|
||||||
CONFIG_SPLIT_PTLOCK_CPUS=4096
|
CONFIG_SPLIT_PTLOCK_CPUS=999999
|
||||||
# CONFIG_PHYS_ADDR_T_64BIT is not set
|
# CONFIG_PHYS_ADDR_T_64BIT is not set
|
||||||
CONFIG_ZONE_DMA_FLAG=0
|
CONFIG_ZONE_DMA_FLAG=0
|
||||||
CONFIG_VIRT_TO_BUS=y
|
CONFIG_VIRT_TO_BUS=y
|
||||||
CONFIG_HAVE_MLOCK=y
|
|
||||||
CONFIG_HAVE_MLOCKED_PAGE_BIT=y
|
|
||||||
# CONFIG_KSM is not set
|
# CONFIG_KSM is not set
|
||||||
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
|
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
|
||||||
CONFIG_ALIGNMENT_TRAP=y
|
CONFIG_ALIGNMENT_TRAP=y
|
||||||
|
@ -499,14 +527,21 @@ CONFIG_MTD_NAND_IDS=y
|
||||||
CONFIG_BLK_DEV=y
|
CONFIG_BLK_DEV=y
|
||||||
# CONFIG_BLK_DEV_COW_COMMON is not set
|
# CONFIG_BLK_DEV_COW_COMMON is not set
|
||||||
# CONFIG_BLK_DEV_LOOP is not set
|
# CONFIG_BLK_DEV_LOOP is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
|
||||||
|
#
|
||||||
# CONFIG_BLK_DEV_NBD is not set
|
# CONFIG_BLK_DEV_NBD is not set
|
||||||
# CONFIG_BLK_DEV_RAM is not set
|
# CONFIG_BLK_DEV_RAM is not set
|
||||||
# CONFIG_CDROM_PKTCDVD is not set
|
# CONFIG_CDROM_PKTCDVD is not set
|
||||||
# CONFIG_ATA_OVER_ETH is not set
|
# CONFIG_ATA_OVER_ETH is not set
|
||||||
CONFIG_MISC_DEVICES=y
|
CONFIG_MISC_DEVICES=y
|
||||||
|
# CONFIG_AD525X_DPOT is not set
|
||||||
# CONFIG_ICS932S401 is not set
|
# CONFIG_ICS932S401 is not set
|
||||||
# CONFIG_ENCLOSURE_SERVICES is not set
|
# CONFIG_ENCLOSURE_SERVICES is not set
|
||||||
# CONFIG_ISL29003 is not set
|
# CONFIG_ISL29003 is not set
|
||||||
|
# CONFIG_DS1682 is not set
|
||||||
|
# CONFIG_TI_DAC7512 is not set
|
||||||
# CONFIG_C2PORT is not set
|
# CONFIG_C2PORT is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -517,6 +552,7 @@ CONFIG_MISC_DEVICES=y
|
||||||
# CONFIG_EEPROM_LEGACY is not set
|
# CONFIG_EEPROM_LEGACY is not set
|
||||||
# CONFIG_EEPROM_MAX6875 is not set
|
# CONFIG_EEPROM_MAX6875 is not set
|
||||||
# CONFIG_EEPROM_93CX6 is not set
|
# CONFIG_EEPROM_93CX6 is not set
|
||||||
|
# CONFIG_IWMC3200TOP is not set
|
||||||
CONFIG_HAVE_IDE=y
|
CONFIG_HAVE_IDE=y
|
||||||
# CONFIG_IDE is not set
|
# CONFIG_IDE is not set
|
||||||
|
|
||||||
|
@ -539,6 +575,7 @@ CONFIG_HAVE_IDE=y
|
||||||
CONFIG_INPUT=y
|
CONFIG_INPUT=y
|
||||||
# CONFIG_INPUT_FF_MEMLESS is not set
|
# CONFIG_INPUT_FF_MEMLESS is not set
|
||||||
# CONFIG_INPUT_POLLDEV is not set
|
# CONFIG_INPUT_POLLDEV is not set
|
||||||
|
# CONFIG_INPUT_SPARSEKMAP is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
# Userland interfaces
|
# Userland interfaces
|
||||||
|
@ -645,7 +682,6 @@ CONFIG_I2C_STU300=y
|
||||||
#
|
#
|
||||||
# Miscellaneous I2C Chip support
|
# Miscellaneous I2C Chip support
|
||||||
#
|
#
|
||||||
# CONFIG_DS1682 is not set
|
|
||||||
# CONFIG_SENSORS_TSL2550 is not set
|
# CONFIG_SENSORS_TSL2550 is not set
|
||||||
# CONFIG_I2C_DEBUG_CORE is not set
|
# CONFIG_I2C_DEBUG_CORE is not set
|
||||||
# CONFIG_I2C_DEBUG_ALGO is not set
|
# CONFIG_I2C_DEBUG_ALGO is not set
|
||||||
|
@ -661,6 +697,8 @@ CONFIG_SPI_MASTER=y
|
||||||
# CONFIG_SPI_BITBANG is not set
|
# CONFIG_SPI_BITBANG is not set
|
||||||
# CONFIG_SPI_GPIO is not set
|
# CONFIG_SPI_GPIO is not set
|
||||||
CONFIG_SPI_PL022=y
|
CONFIG_SPI_PL022=y
|
||||||
|
# CONFIG_SPI_XILINX is not set
|
||||||
|
# CONFIG_SPI_DESIGNWARE is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
# SPI Protocol Masters
|
# SPI Protocol Masters
|
||||||
|
@ -708,6 +746,7 @@ CONFIG_SSB_POSSIBLE=y
|
||||||
# CONFIG_MFD_T7L66XB is not set
|
# CONFIG_MFD_T7L66XB is not set
|
||||||
# CONFIG_MFD_TC6387XB is not set
|
# CONFIG_MFD_TC6387XB is not set
|
||||||
# CONFIG_PMIC_DA903X is not set
|
# CONFIG_PMIC_DA903X is not set
|
||||||
|
# CONFIG_PMIC_ADP5520 is not set
|
||||||
# CONFIG_MFD_WM8400 is not set
|
# CONFIG_MFD_WM8400 is not set
|
||||||
# CONFIG_MFD_WM831X is not set
|
# CONFIG_MFD_WM831X is not set
|
||||||
# CONFIG_MFD_WM8350_I2C is not set
|
# CONFIG_MFD_WM8350_I2C is not set
|
||||||
|
@ -716,6 +755,8 @@ CONFIG_SSB_POSSIBLE=y
|
||||||
CONFIG_AB3100_CORE=y
|
CONFIG_AB3100_CORE=y
|
||||||
CONFIG_AB3100_OTP=y
|
CONFIG_AB3100_OTP=y
|
||||||
# CONFIG_EZX_PCAP is not set
|
# CONFIG_EZX_PCAP is not set
|
||||||
|
# CONFIG_MFD_88PM8607 is not set
|
||||||
|
# CONFIG_AB4500_CORE is not set
|
||||||
CONFIG_REGULATOR=y
|
CONFIG_REGULATOR=y
|
||||||
# CONFIG_REGULATOR_DEBUG is not set
|
# CONFIG_REGULATOR_DEBUG is not set
|
||||||
# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
|
# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
|
||||||
|
@ -723,6 +764,7 @@ CONFIG_REGULATOR=y
|
||||||
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
|
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
|
||||||
# CONFIG_REGULATOR_BQ24022 is not set
|
# CONFIG_REGULATOR_BQ24022 is not set
|
||||||
# CONFIG_REGULATOR_MAX1586 is not set
|
# CONFIG_REGULATOR_MAX1586 is not set
|
||||||
|
# CONFIG_REGULATOR_MAX8660 is not set
|
||||||
# CONFIG_REGULATOR_LP3971 is not set
|
# CONFIG_REGULATOR_LP3971 is not set
|
||||||
CONFIG_REGULATOR_AB3100=y
|
CONFIG_REGULATOR_AB3100=y
|
||||||
# CONFIG_REGULATOR_TPS65023 is not set
|
# CONFIG_REGULATOR_TPS65023 is not set
|
||||||
|
@ -840,7 +882,9 @@ CONFIG_LEDS_CLASS=y
|
||||||
# CONFIG_LEDS_LP3944 is not set
|
# CONFIG_LEDS_LP3944 is not set
|
||||||
# CONFIG_LEDS_PCA955X is not set
|
# CONFIG_LEDS_PCA955X is not set
|
||||||
# CONFIG_LEDS_DAC124S085 is not set
|
# CONFIG_LEDS_DAC124S085 is not set
|
||||||
|
# CONFIG_LEDS_REGULATOR is not set
|
||||||
# CONFIG_LEDS_BD2802 is not set
|
# CONFIG_LEDS_BD2802 is not set
|
||||||
|
# CONFIG_LEDS_LT3593 is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
# LED Triggers
|
# LED Triggers
|
||||||
|
@ -882,6 +926,7 @@ CONFIG_RTC_INTF_DEV=y
|
||||||
# CONFIG_RTC_DRV_PCF8563 is not set
|
# CONFIG_RTC_DRV_PCF8563 is not set
|
||||||
# CONFIG_RTC_DRV_PCF8583 is not set
|
# CONFIG_RTC_DRV_PCF8583 is not set
|
||||||
# CONFIG_RTC_DRV_M41T80 is not set
|
# CONFIG_RTC_DRV_M41T80 is not set
|
||||||
|
# CONFIG_RTC_DRV_BQ32K is not set
|
||||||
# CONFIG_RTC_DRV_S35390A is not set
|
# CONFIG_RTC_DRV_S35390A is not set
|
||||||
# CONFIG_RTC_DRV_FM3130 is not set
|
# CONFIG_RTC_DRV_FM3130 is not set
|
||||||
# CONFIG_RTC_DRV_RX8581 is not set
|
# CONFIG_RTC_DRV_RX8581 is not set
|
||||||
|
@ -911,7 +956,9 @@ CONFIG_RTC_INTF_DEV=y
|
||||||
# CONFIG_RTC_DRV_M48T86 is not set
|
# CONFIG_RTC_DRV_M48T86 is not set
|
||||||
# CONFIG_RTC_DRV_M48T35 is not set
|
# CONFIG_RTC_DRV_M48T35 is not set
|
||||||
# CONFIG_RTC_DRV_M48T59 is not set
|
# CONFIG_RTC_DRV_M48T59 is not set
|
||||||
|
# CONFIG_RTC_DRV_MSM6242 is not set
|
||||||
# CONFIG_RTC_DRV_BQ4802 is not set
|
# CONFIG_RTC_DRV_BQ4802 is not set
|
||||||
|
# CONFIG_RTC_DRV_RP5C01 is not set
|
||||||
# CONFIG_RTC_DRV_V3020 is not set
|
# CONFIG_RTC_DRV_V3020 is not set
|
||||||
CONFIG_RTC_DRV_AB3100=y
|
CONFIG_RTC_DRV_AB3100=y
|
||||||
|
|
||||||
|
@ -926,6 +973,15 @@ CONFIG_DMADEVICES=y
|
||||||
#
|
#
|
||||||
# DMA Devices
|
# DMA Devices
|
||||||
#
|
#
|
||||||
|
CONFIG_COH901318=y
|
||||||
|
CONFIG_DMA_ENGINE=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# DMA Clients
|
||||||
|
#
|
||||||
|
# CONFIG_NET_DMA is not set
|
||||||
|
# CONFIG_ASYNC_TX_DMA is not set
|
||||||
|
# CONFIG_DMATEST is not set
|
||||||
# CONFIG_AUXDISPLAY is not set
|
# CONFIG_AUXDISPLAY is not set
|
||||||
# CONFIG_UIO is not set
|
# CONFIG_UIO is not set
|
||||||
|
|
||||||
|
@ -1018,7 +1074,7 @@ CONFIG_MISC_FILESYSTEMS=y
|
||||||
CONFIG_MSDOS_PARTITION=y
|
CONFIG_MSDOS_PARTITION=y
|
||||||
CONFIG_NLS=y
|
CONFIG_NLS=y
|
||||||
CONFIG_NLS_DEFAULT="iso8859-1"
|
CONFIG_NLS_DEFAULT="iso8859-1"
|
||||||
# CONFIG_NLS_CODEPAGE_437 is not set
|
CONFIG_NLS_CODEPAGE_437=y
|
||||||
# CONFIG_NLS_CODEPAGE_737 is not set
|
# CONFIG_NLS_CODEPAGE_737 is not set
|
||||||
# CONFIG_NLS_CODEPAGE_775 is not set
|
# CONFIG_NLS_CODEPAGE_775 is not set
|
||||||
# CONFIG_NLS_CODEPAGE_850 is not set
|
# CONFIG_NLS_CODEPAGE_850 is not set
|
||||||
|
@ -1135,6 +1191,7 @@ CONFIG_ARM_UNWIND=y
|
||||||
# CONFIG_DEBUG_ERRORS is not set
|
# CONFIG_DEBUG_ERRORS is not set
|
||||||
# CONFIG_DEBUG_STACK_USAGE is not set
|
# CONFIG_DEBUG_STACK_USAGE is not set
|
||||||
# CONFIG_DEBUG_LL is not set
|
# CONFIG_DEBUG_LL is not set
|
||||||
|
# CONFIG_OC_ETM is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
# Security options
|
# Security options
|
||||||
|
@ -1142,7 +1199,11 @@ CONFIG_ARM_UNWIND=y
|
||||||
# CONFIG_KEYS is not set
|
# CONFIG_KEYS is not set
|
||||||
# CONFIG_SECURITY is not set
|
# CONFIG_SECURITY is not set
|
||||||
# CONFIG_SECURITYFS is not set
|
# CONFIG_SECURITYFS is not set
|
||||||
# CONFIG_SECURITY_FILE_CAPABILITIES is not set
|
# CONFIG_DEFAULT_SECURITY_SELINUX is not set
|
||||||
|
# CONFIG_DEFAULT_SECURITY_SMACK is not set
|
||||||
|
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
|
||||||
|
CONFIG_DEFAULT_SECURITY_DAC=y
|
||||||
|
CONFIG_DEFAULT_SECURITY=""
|
||||||
# CONFIG_CRYPTO is not set
|
# CONFIG_CRYPTO is not set
|
||||||
# CONFIG_BINARY_PRINTF is not set
|
# CONFIG_BINARY_PRINTF is not set
|
||||||
|
|
||||||
|
|
|
@ -182,21 +182,6 @@
|
||||||
* DMA Cache Coherency
|
* DMA Cache Coherency
|
||||||
* ===================
|
* ===================
|
||||||
*
|
*
|
||||||
* dma_inv_range(start, end)
|
|
||||||
*
|
|
||||||
* Invalidate (discard) the specified virtual address range.
|
|
||||||
* May not write back any entries. If 'start' or 'end'
|
|
||||||
* are not cache line aligned, those lines must be written
|
|
||||||
* back.
|
|
||||||
* - start - virtual start address
|
|
||||||
* - end - virtual end address
|
|
||||||
*
|
|
||||||
* dma_clean_range(start, end)
|
|
||||||
*
|
|
||||||
* Clean (write back) the specified virtual address range.
|
|
||||||
* - start - virtual start address
|
|
||||||
* - end - virtual end address
|
|
||||||
*
|
|
||||||
* dma_flush_range(start, end)
|
* dma_flush_range(start, end)
|
||||||
*
|
*
|
||||||
* Clean and invalidate the specified virtual address range.
|
* Clean and invalidate the specified virtual address range.
|
||||||
|
@ -213,8 +198,9 @@ struct cpu_cache_fns {
|
||||||
void (*coherent_user_range)(unsigned long, unsigned long);
|
void (*coherent_user_range)(unsigned long, unsigned long);
|
||||||
void (*flush_kern_dcache_area)(void *, size_t);
|
void (*flush_kern_dcache_area)(void *, size_t);
|
||||||
|
|
||||||
void (*dma_inv_range)(const void *, const void *);
|
void (*dma_map_area)(const void *, size_t, int);
|
||||||
void (*dma_clean_range)(const void *, const void *);
|
void (*dma_unmap_area)(const void *, size_t, int);
|
||||||
|
|
||||||
void (*dma_flush_range)(const void *, const void *);
|
void (*dma_flush_range)(const void *, const void *);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -244,8 +230,8 @@ extern struct cpu_cache_fns cpu_cache;
|
||||||
* is visible to DMA, or data written by DMA to system memory is
|
* is visible to DMA, or data written by DMA to system memory is
|
||||||
* visible to the CPU.
|
* visible to the CPU.
|
||||||
*/
|
*/
|
||||||
#define dmac_inv_range cpu_cache.dma_inv_range
|
#define dmac_map_area cpu_cache.dma_map_area
|
||||||
#define dmac_clean_range cpu_cache.dma_clean_range
|
#define dmac_unmap_area cpu_cache.dma_unmap_area
|
||||||
#define dmac_flush_range cpu_cache.dma_flush_range
|
#define dmac_flush_range cpu_cache.dma_flush_range
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -270,12 +256,12 @@ extern void __cpuc_flush_dcache_area(void *, size_t);
|
||||||
* is visible to DMA, or data written by DMA to system memory is
|
* is visible to DMA, or data written by DMA to system memory is
|
||||||
* visible to the CPU.
|
* visible to the CPU.
|
||||||
*/
|
*/
|
||||||
#define dmac_inv_range __glue(_CACHE,_dma_inv_range)
|
#define dmac_map_area __glue(_CACHE,_dma_map_area)
|
||||||
#define dmac_clean_range __glue(_CACHE,_dma_clean_range)
|
#define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
|
||||||
#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
|
#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
|
||||||
|
|
||||||
extern void dmac_inv_range(const void *, const void *);
|
extern void dmac_map_area(const void *, size_t, int);
|
||||||
extern void dmac_clean_range(const void *, const void *);
|
extern void dmac_unmap_area(const void *, size_t, int);
|
||||||
extern void dmac_flush_range(const void *, const void *);
|
extern void dmac_flush_range(const void *, const void *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -316,12 +302,8 @@ static inline void outer_flush_range(unsigned long start, unsigned long end)
|
||||||
* processes address space. Really, we want to allow our "user
|
* processes address space. Really, we want to allow our "user
|
||||||
* space" model to handle this.
|
* space" model to handle this.
|
||||||
*/
|
*/
|
||||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
extern void copy_to_user_page(struct vm_area_struct *, struct page *,
|
||||||
do { \
|
unsigned long, void *, const void *, unsigned long);
|
||||||
memcpy(dst, src, len); \
|
|
||||||
flush_ptrace_access(vma, page, vaddr, dst, len, 1);\
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||||
do { \
|
do { \
|
||||||
memcpy(dst, src, len); \
|
memcpy(dst, src, len); \
|
||||||
|
@ -355,17 +337,6 @@ vivt_flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
|
||||||
vivt_flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
|
|
||||||
unsigned long uaddr, void *kaddr,
|
|
||||||
unsigned long len, int write)
|
|
||||||
{
|
|
||||||
if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) {
|
|
||||||
unsigned long addr = (unsigned long)kaddr;
|
|
||||||
__cpuc_coherent_kern_range(addr, addr + len);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef CONFIG_CPU_CACHE_VIPT
|
#ifndef CONFIG_CPU_CACHE_VIPT
|
||||||
#define flush_cache_mm(mm) \
|
#define flush_cache_mm(mm) \
|
||||||
vivt_flush_cache_mm(mm)
|
vivt_flush_cache_mm(mm)
|
||||||
|
@ -373,15 +344,10 @@ vivt_flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
|
||||||
vivt_flush_cache_range(vma,start,end)
|
vivt_flush_cache_range(vma,start,end)
|
||||||
#define flush_cache_page(vma,addr,pfn) \
|
#define flush_cache_page(vma,addr,pfn) \
|
||||||
vivt_flush_cache_page(vma,addr,pfn)
|
vivt_flush_cache_page(vma,addr,pfn)
|
||||||
#define flush_ptrace_access(vma,page,ua,ka,len,write) \
|
|
||||||
vivt_flush_ptrace_access(vma,page,ua,ka,len,write)
|
|
||||||
#else
|
#else
|
||||||
extern void flush_cache_mm(struct mm_struct *mm);
|
extern void flush_cache_mm(struct mm_struct *mm);
|
||||||
extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
|
extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
|
||||||
extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn);
|
extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn);
|
||||||
extern void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
|
|
||||||
unsigned long uaddr, void *kaddr,
|
|
||||||
unsigned long len, int write);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
|
#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#define __ASM_ARM_CPU_H
|
#define __ASM_ARM_CPU_H
|
||||||
|
|
||||||
#include <linux/percpu.h>
|
#include <linux/percpu.h>
|
||||||
|
#include <linux/cpu.h>
|
||||||
|
|
||||||
struct cpuinfo_arm {
|
struct cpuinfo_arm {
|
||||||
struct cpu cpu;
|
struct cpu cpu;
|
||||||
|
|
|
@ -57,18 +57,58 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DMA-consistent mapping functions. These allocate/free a region of
|
* The DMA API is built upon the notion of "buffer ownership". A buffer
|
||||||
* uncached, unwrite-buffered mapped memory space for use with DMA
|
* is either exclusively owned by the CPU (and therefore may be accessed
|
||||||
* devices. This is the "generic" version. The PCI specific version
|
* by it) or exclusively owned by the DMA device. These helper functions
|
||||||
* is in pci.h
|
* represent the transitions between these two ownership states.
|
||||||
*
|
*
|
||||||
* Note: Drivers should NOT use this function directly, as it will break
|
* Note, however, that on later ARMs, this notion does not work due to
|
||||||
* platforms with CONFIG_DMABOUNCE.
|
* speculative prefetches. We model our approach on the assumption that
|
||||||
* Use the driver DMA support - see dma-mapping.h (dma_sync_*)
|
* the CPU does do speculative prefetches, which means we clean caches
|
||||||
|
* before transfers and delay cache invalidation until transfer completion.
|
||||||
|
*
|
||||||
|
* Private support functions: these are not part of the API and are
|
||||||
|
* liable to change. Drivers must not use these.
|
||||||
*/
|
*/
|
||||||
extern void dma_cache_maint(const void *kaddr, size_t size, int rw);
|
static inline void __dma_single_cpu_to_dev(const void *kaddr, size_t size,
|
||||||
extern void dma_cache_maint_page(struct page *page, unsigned long offset,
|
enum dma_data_direction dir)
|
||||||
size_t size, int rw);
|
{
|
||||||
|
extern void ___dma_single_cpu_to_dev(const void *, size_t,
|
||||||
|
enum dma_data_direction);
|
||||||
|
|
||||||
|
if (!arch_is_coherent())
|
||||||
|
___dma_single_cpu_to_dev(kaddr, size, dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void __dma_single_dev_to_cpu(const void *kaddr, size_t size,
|
||||||
|
enum dma_data_direction dir)
|
||||||
|
{
|
||||||
|
extern void ___dma_single_dev_to_cpu(const void *, size_t,
|
||||||
|
enum dma_data_direction);
|
||||||
|
|
||||||
|
if (!arch_is_coherent())
|
||||||
|
___dma_single_dev_to_cpu(kaddr, size, dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void __dma_page_cpu_to_dev(struct page *page, unsigned long off,
|
||||||
|
size_t size, enum dma_data_direction dir)
|
||||||
|
{
|
||||||
|
extern void ___dma_page_cpu_to_dev(struct page *, unsigned long,
|
||||||
|
size_t, enum dma_data_direction);
|
||||||
|
|
||||||
|
if (!arch_is_coherent())
|
||||||
|
___dma_page_cpu_to_dev(page, off, size, dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void __dma_page_dev_to_cpu(struct page *page, unsigned long off,
|
||||||
|
size_t size, enum dma_data_direction dir)
|
||||||
|
{
|
||||||
|
extern void ___dma_page_dev_to_cpu(struct page *, unsigned long,
|
||||||
|
size_t, enum dma_data_direction);
|
||||||
|
|
||||||
|
if (!arch_is_coherent())
|
||||||
|
___dma_page_dev_to_cpu(page, off, size, dir);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return whether the given device DMA address mask can be supported
|
* Return whether the given device DMA address mask can be supported
|
||||||
|
@ -304,8 +344,7 @@ static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
|
||||||
{
|
{
|
||||||
BUG_ON(!valid_dma_direction(dir));
|
BUG_ON(!valid_dma_direction(dir));
|
||||||
|
|
||||||
if (!arch_is_coherent())
|
__dma_single_cpu_to_dev(cpu_addr, size, dir);
|
||||||
dma_cache_maint(cpu_addr, size, dir);
|
|
||||||
|
|
||||||
return virt_to_dma(dev, cpu_addr);
|
return virt_to_dma(dev, cpu_addr);
|
||||||
}
|
}
|
||||||
|
@ -329,8 +368,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
|
||||||
{
|
{
|
||||||
BUG_ON(!valid_dma_direction(dir));
|
BUG_ON(!valid_dma_direction(dir));
|
||||||
|
|
||||||
if (!arch_is_coherent())
|
__dma_page_cpu_to_dev(page, offset, size, dir);
|
||||||
dma_cache_maint_page(page, offset, size, dir);
|
|
||||||
|
|
||||||
return page_to_dma(dev, page) + offset;
|
return page_to_dma(dev, page) + offset;
|
||||||
}
|
}
|
||||||
|
@ -352,7 +390,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
|
||||||
static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
|
static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
|
||||||
size_t size, enum dma_data_direction dir)
|
size_t size, enum dma_data_direction dir)
|
||||||
{
|
{
|
||||||
/* nothing to do */
|
__dma_single_dev_to_cpu(dma_to_virt(dev, handle), size, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -372,7 +410,8 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
|
||||||
static inline void dma_unmap_page(struct device *dev, dma_addr_t handle,
|
static inline void dma_unmap_page(struct device *dev, dma_addr_t handle,
|
||||||
size_t size, enum dma_data_direction dir)
|
size_t size, enum dma_data_direction dir)
|
||||||
{
|
{
|
||||||
/* nothing to do */
|
__dma_page_dev_to_cpu(dma_to_page(dev, handle), handle & ~PAGE_MASK,
|
||||||
|
size, dir);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DMABOUNCE */
|
#endif /* CONFIG_DMABOUNCE */
|
||||||
|
|
||||||
|
@ -400,7 +439,10 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
|
||||||
{
|
{
|
||||||
BUG_ON(!valid_dma_direction(dir));
|
BUG_ON(!valid_dma_direction(dir));
|
||||||
|
|
||||||
dmabounce_sync_for_cpu(dev, handle, offset, size, dir);
|
if (!dmabounce_sync_for_cpu(dev, handle, offset, size, dir))
|
||||||
|
return;
|
||||||
|
|
||||||
|
__dma_single_dev_to_cpu(dma_to_virt(dev, handle) + offset, size, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void dma_sync_single_range_for_device(struct device *dev,
|
static inline void dma_sync_single_range_for_device(struct device *dev,
|
||||||
|
@ -412,8 +454,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
|
||||||
if (!dmabounce_sync_for_device(dev, handle, offset, size, dir))
|
if (!dmabounce_sync_for_device(dev, handle, offset, size, dir))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!arch_is_coherent())
|
__dma_single_cpu_to_dev(dma_to_virt(dev, handle) + offset, size, dir);
|
||||||
dma_cache_maint(dma_to_virt(dev, handle) + offset, size, dir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void dma_sync_single_for_cpu(struct device *dev,
|
static inline void dma_sync_single_for_cpu(struct device *dev,
|
||||||
|
|
|
@ -138,12 +138,12 @@ extern int get_dma_residue(unsigned int chan);
|
||||||
#define NO_DMA 255
|
#define NO_DMA 255
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* CONFIG_ISA_DMA_API */
|
||||||
|
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
extern int isa_dma_bridge_buggy;
|
extern int isa_dma_bridge_buggy;
|
||||||
#else
|
#else
|
||||||
#define isa_dma_bridge_buggy (0)
|
#define isa_dma_bridge_buggy (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_ISA_DMA_API */
|
|
||||||
|
|
||||||
#endif /* __ASM_ARM_DMA_H */
|
#endif /* __ASM_ARM_DMA_H */
|
||||||
|
|
|
@ -117,11 +117,12 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct page;
|
struct page;
|
||||||
|
struct vm_area_struct;
|
||||||
|
|
||||||
struct cpu_user_fns {
|
struct cpu_user_fns {
|
||||||
void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr);
|
void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr);
|
||||||
void (*cpu_copy_user_highpage)(struct page *to, struct page *from,
|
void (*cpu_copy_user_highpage)(struct page *to, struct page *from,
|
||||||
unsigned long vaddr);
|
unsigned long vaddr, struct vm_area_struct *vma);
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef MULTI_USER
|
#ifdef MULTI_USER
|
||||||
|
@ -137,7 +138,7 @@ extern struct cpu_user_fns cpu_user;
|
||||||
|
|
||||||
extern void __cpu_clear_user_highpage(struct page *page, unsigned long vaddr);
|
extern void __cpu_clear_user_highpage(struct page *page, unsigned long vaddr);
|
||||||
extern void __cpu_copy_user_highpage(struct page *to, struct page *from,
|
extern void __cpu_copy_user_highpage(struct page *to, struct page *from,
|
||||||
unsigned long vaddr);
|
unsigned long vaddr, struct vm_area_struct *vma);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define clear_user_highpage(page,vaddr) \
|
#define clear_user_highpage(page,vaddr) \
|
||||||
|
@ -145,7 +146,7 @@ extern void __cpu_copy_user_highpage(struct page *to, struct page *from,
|
||||||
|
|
||||||
#define __HAVE_ARCH_COPY_USER_HIGHPAGE
|
#define __HAVE_ARCH_COPY_USER_HIGHPAGE
|
||||||
#define copy_user_highpage(to,from,vaddr,vma) \
|
#define copy_user_highpage(to,from,vaddr,vma) \
|
||||||
__cpu_copy_user_highpage(to, from, vaddr)
|
__cpu_copy_user_highpage(to, from, vaddr, vma)
|
||||||
|
|
||||||
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
|
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
|
||||||
extern void copy_page(void *to, const void *from);
|
extern void copy_page(void *to, const void *from);
|
||||||
|
|
|
@ -97,9 +97,15 @@
|
||||||
* stack during a system call. Note that sizeof(struct pt_regs)
|
* stack during a system call. Note that sizeof(struct pt_regs)
|
||||||
* has to be a multiple of 8.
|
* has to be a multiple of 8.
|
||||||
*/
|
*/
|
||||||
|
#ifndef __KERNEL__
|
||||||
struct pt_regs {
|
struct pt_regs {
|
||||||
long uregs[18];
|
long uregs[18];
|
||||||
};
|
};
|
||||||
|
#else /* __KERNEL__ */
|
||||||
|
struct pt_regs {
|
||||||
|
unsigned long uregs[18];
|
||||||
|
};
|
||||||
|
#endif /* __KERNEL__ */
|
||||||
|
|
||||||
#define ARM_cpsr uregs[16]
|
#define ARM_cpsr uregs[16]
|
||||||
#define ARM_pc uregs[15]
|
#define ARM_pc uregs[15]
|
||||||
|
|
|
@ -13,4 +13,9 @@ static inline int tlb_ops_need_broadcast(void)
|
||||||
return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2;
|
return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int cache_ops_need_broadcast(void)
|
||||||
|
{
|
||||||
|
return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 1;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -529,7 +529,8 @@ extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
|
||||||
* cache entries for the kernels virtual memory range are written
|
* cache entries for the kernels virtual memory range are written
|
||||||
* back to the page.
|
* back to the page.
|
||||||
*/
|
*/
|
||||||
extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte);
|
extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
|
||||||
|
pte_t *ptep);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -391,6 +391,7 @@
|
||||||
#define __NR_pwritev (__NR_SYSCALL_BASE+362)
|
#define __NR_pwritev (__NR_SYSCALL_BASE+362)
|
||||||
#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363)
|
#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363)
|
||||||
#define __NR_perf_event_open (__NR_SYSCALL_BASE+364)
|
#define __NR_perf_event_open (__NR_SYSCALL_BASE+364)
|
||||||
|
#define __NR_recvmmsg (__NR_SYSCALL_BASE+365)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following SWIs are ARM private.
|
* The following SWIs are ARM private.
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
*/
|
*/
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
|
#include <linux/dma-mapping.h>
|
||||||
#include <asm/mach/arch.h>
|
#include <asm/mach/arch.h>
|
||||||
#include <asm/thread_info.h>
|
#include <asm/thread_info.h>
|
||||||
#include <asm/memory.h>
|
#include <asm/memory.h>
|
||||||
|
@ -112,5 +113,9 @@ int main(void)
|
||||||
#ifdef MULTI_PABORT
|
#ifdef MULTI_PABORT
|
||||||
DEFINE(PROCESSOR_PABT_FUNC, offsetof(struct processor, _prefetch_abort));
|
DEFINE(PROCESSOR_PABT_FUNC, offsetof(struct processor, _prefetch_abort));
|
||||||
#endif
|
#endif
|
||||||
|
BLANK();
|
||||||
|
DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL);
|
||||||
|
DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE);
|
||||||
|
DEFINE(DMA_FROM_DEVICE, DMA_FROM_DEVICE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -957,9 +957,7 @@ kuser_cmpxchg_fixup:
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
smp_dmb
|
||||||
mcr p15, 0, r0, c7, c10, 5 @ dmb
|
|
||||||
#endif
|
|
||||||
1: ldrex r3, [r2]
|
1: ldrex r3, [r2]
|
||||||
subs r3, r3, r0
|
subs r3, r3, r0
|
||||||
strexeq r3, r1, [r2]
|
strexeq r3, r1, [r2]
|
||||||
|
|
|
@ -212,7 +212,8 @@ void __show_regs(struct pt_regs *regs)
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
printk("CPU: %d %s (%s %.*s)\n",
|
printk("CPU: %d %s (%s %.*s)\n",
|
||||||
smp_processor_id(), print_tainted(), init_utsname()->release,
|
raw_smp_processor_id(), print_tainted(),
|
||||||
|
init_utsname()->release,
|
||||||
(int)strcspn(init_utsname()->version, " "),
|
(int)strcspn(init_utsname()->version, " "),
|
||||||
init_utsname()->version);
|
init_utsname()->version);
|
||||||
print_symbol("PC is at %s\n", instruction_pointer(regs));
|
print_symbol("PC is at %s\n", instruction_pointer(regs));
|
||||||
|
|
|
@ -236,6 +236,7 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = {
|
||||||
|
|
||||||
static struct vpfe_config vpfe_cfg = {
|
static struct vpfe_config vpfe_cfg = {
|
||||||
.num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
|
.num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
|
||||||
|
.i2c_adapter_id = 1,
|
||||||
.sub_devs = vpfe_sub_devs,
|
.sub_devs = vpfe_sub_devs,
|
||||||
.card_name = "DM355 EVM",
|
.card_name = "DM355 EVM",
|
||||||
.ccdc = "DM355 CCDC",
|
.ccdc = "DM355 CCDC",
|
||||||
|
|
|
@ -192,7 +192,11 @@ static struct davinci_i2c_platform_data i2c_pdata = {
|
||||||
.bus_delay = 0 /* usec */,
|
.bus_delay = 0 /* usec */,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_KEYBOARD_DAVINCI
|
static int dm365evm_keyscan_enable(struct device *dev)
|
||||||
|
{
|
||||||
|
return davinci_cfg_reg(DM365_KEYSCAN);
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned short dm365evm_keymap[] = {
|
static unsigned short dm365evm_keymap[] = {
|
||||||
KEY_KP2,
|
KEY_KP2,
|
||||||
KEY_LEFT,
|
KEY_LEFT,
|
||||||
|
@ -214,6 +218,7 @@ static unsigned short dm365evm_keymap[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct davinci_ks_platform_data dm365evm_ks_data = {
|
static struct davinci_ks_platform_data dm365evm_ks_data = {
|
||||||
|
.device_enable = dm365evm_keyscan_enable,
|
||||||
.keymap = dm365evm_keymap,
|
.keymap = dm365evm_keymap,
|
||||||
.keymapsize = ARRAY_SIZE(dm365evm_keymap),
|
.keymapsize = ARRAY_SIZE(dm365evm_keymap),
|
||||||
.rep = 1,
|
.rep = 1,
|
||||||
|
@ -222,7 +227,6 @@ static struct davinci_ks_platform_data dm365evm_ks_data = {
|
||||||
.interval = 0x2,
|
.interval = 0x2,
|
||||||
.matrix_type = DAVINCI_KEYSCAN_MATRIX_4X4,
|
.matrix_type = DAVINCI_KEYSCAN_MATRIX_4X4,
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static int cpld_mmc_get_cd(int module)
|
static int cpld_mmc_get_cd(int module)
|
||||||
{
|
{
|
||||||
|
@ -511,10 +515,7 @@ static __init void dm365_evm_init(void)
|
||||||
|
|
||||||
dm365_init_asp(&dm365_evm_snd_data);
|
dm365_init_asp(&dm365_evm_snd_data);
|
||||||
dm365_init_rtc();
|
dm365_init_rtc();
|
||||||
|
|
||||||
#ifdef CONFIG_KEYBOARD_DAVINCI
|
|
||||||
dm365_init_ks(&dm365evm_ks_data);
|
dm365_init_ks(&dm365evm_ks_data);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __init void dm365_evm_irq_init(void)
|
static __init void dm365_evm_irq_init(void)
|
||||||
|
|
|
@ -247,6 +247,7 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = {
|
||||||
|
|
||||||
static struct vpfe_config vpfe_cfg = {
|
static struct vpfe_config vpfe_cfg = {
|
||||||
.num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
|
.num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
|
||||||
|
.i2c_adapter_id = 1,
|
||||||
.sub_devs = vpfe_sub_devs,
|
.sub_devs = vpfe_sub_devs,
|
||||||
.card_name = "DM6446 EVM",
|
.card_name = "DM6446 EVM",
|
||||||
.ccdc = "DM6446 CCDC",
|
.ccdc = "DM6446 CCDC",
|
||||||
|
|
|
@ -81,12 +81,23 @@ static int cp_intc_set_irq_type(unsigned int irq, unsigned int flow_type)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Faking this allows us to to work with suspend functions of
|
||||||
|
* generic drivers which call {enable|disable}_irq_wake for
|
||||||
|
* wake up interrupt sources (eg RTC on DA850).
|
||||||
|
*/
|
||||||
|
static int cp_intc_set_wake(unsigned int irq, unsigned int on)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static struct irq_chip cp_intc_irq_chip = {
|
static struct irq_chip cp_intc_irq_chip = {
|
||||||
.name = "cp_intc",
|
.name = "cp_intc",
|
||||||
.ack = cp_intc_ack_irq,
|
.ack = cp_intc_ack_irq,
|
||||||
.mask = cp_intc_mask_irq,
|
.mask = cp_intc_mask_irq,
|
||||||
.unmask = cp_intc_unmask_irq,
|
.unmask = cp_intc_unmask_irq,
|
||||||
.set_type = cp_intc_set_irq_type,
|
.set_type = cp_intc_set_irq_type,
|
||||||
|
.set_wake = cp_intc_set_wake,
|
||||||
};
|
};
|
||||||
|
|
||||||
void __init cp_intc_init(void __iomem *base, unsigned short num_irq,
|
void __init cp_intc_init(void __iomem *base, unsigned short num_irq,
|
||||||
|
|
|
@ -481,11 +481,18 @@ static struct platform_device da8xx_rtc_device = {
|
||||||
|
|
||||||
int da8xx_register_rtc(void)
|
int da8xx_register_rtc(void)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Unlock the rtc's registers */
|
/* Unlock the rtc's registers */
|
||||||
__raw_writel(0x83e70b13, IO_ADDRESS(DA8XX_RTC_BASE + 0x6c));
|
__raw_writel(0x83e70b13, IO_ADDRESS(DA8XX_RTC_BASE + 0x6c));
|
||||||
__raw_writel(0x95a4f1e0, IO_ADDRESS(DA8XX_RTC_BASE + 0x70));
|
__raw_writel(0x95a4f1e0, IO_ADDRESS(DA8XX_RTC_BASE + 0x70));
|
||||||
|
|
||||||
return platform_device_register(&da8xx_rtc_device);
|
ret = platform_device_register(&da8xx_rtc_device);
|
||||||
|
if (!ret)
|
||||||
|
/* Atleast on DA850, RTC is a wakeup source */
|
||||||
|
device_init_wakeup(&da8xx_rtc_device.dev, true);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct resource da8xx_cpuidle_resources[] = {
|
static struct resource da8xx_cpuidle_resources[] = {
|
||||||
|
|
|
@ -993,7 +993,6 @@ void __init dm365_init_asp(struct snd_platform_data *pdata)
|
||||||
|
|
||||||
void __init dm365_init_ks(struct davinci_ks_platform_data *pdata)
|
void __init dm365_init_ks(struct davinci_ks_platform_data *pdata)
|
||||||
{
|
{
|
||||||
davinci_cfg_reg(DM365_KEYSCAN);
|
|
||||||
dm365_ks_device.dev.platform_data = pdata;
|
dm365_ks_device.dev.platform_data = pdata;
|
||||||
platform_device_register(&dm365_ks_device);
|
platform_device_register(&dm365_ks_device);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ enum davinci_matrix_types {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct davinci_ks_platform_data {
|
struct davinci_ks_platform_data {
|
||||||
|
int (*device_enable)(struct device *dev);
|
||||||
unsigned short *keymap;
|
unsigned short *keymap;
|
||||||
u32 keymapsize;
|
u32 keymapsize;
|
||||||
u8 rep:1;
|
u8 rep:1;
|
||||||
|
|
|
@ -161,6 +161,20 @@ config MACH_MICRO9S
|
||||||
Say 'Y' here if you want your kernel to support the
|
Say 'Y' here if you want your kernel to support the
|
||||||
Contec Micro9-Slim board.
|
Contec Micro9-Slim board.
|
||||||
|
|
||||||
|
config MACH_SIM_ONE
|
||||||
|
bool "Support Simplemachines Sim.One board"
|
||||||
|
depends on EP93XX_SDCE0_PHYS_OFFSET
|
||||||
|
help
|
||||||
|
Say 'Y' here if you want your kernel to support the
|
||||||
|
Simplemachines Sim.One board.
|
||||||
|
|
||||||
|
config MACH_SNAPPER_CL15
|
||||||
|
bool "Support Bluewater Systems Snapper CL15 Module"
|
||||||
|
depends on EP93XX_SDCE0_PHYS_OFFSET
|
||||||
|
help
|
||||||
|
Say 'Y' here if you want your kernel to support the Bluewater
|
||||||
|
Systems Snapper CL15 Module.
|
||||||
|
|
||||||
config MACH_TS72XX
|
config MACH_TS72XX
|
||||||
bool "Support Technologic Systems TS-72xx SBC"
|
bool "Support Technologic Systems TS-72xx SBC"
|
||||||
depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
|
depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
|
||||||
|
|
|
@ -10,4 +10,6 @@ obj-$(CONFIG_MACH_ADSSPHERE) += adssphere.o
|
||||||
obj-$(CONFIG_MACH_EDB93XX) += edb93xx.o
|
obj-$(CONFIG_MACH_EDB93XX) += edb93xx.o
|
||||||
obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o
|
obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o
|
||||||
obj-$(CONFIG_MACH_MICRO9) += micro9.o
|
obj-$(CONFIG_MACH_MICRO9) += micro9.o
|
||||||
|
obj-$(CONFIG_MACH_SIM_ONE) += simone.o
|
||||||
|
obj-$(CONFIG_MACH_SNAPPER_CL15) += snappercl15.o
|
||||||
obj-$(CONFIG_MACH_TS72XX) += ts72xx.o
|
obj-$(CONFIG_MACH_TS72XX) += ts72xx.o
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
* your option) any later version.
|
* your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
|
@ -447,30 +449,34 @@ static int __init ep93xx_clock_init(void)
|
||||||
u32 value;
|
u32 value;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
value = __raw_readl(EP93XX_SYSCON_CLOCK_SET1);
|
/* Determine the bootloader configured pll1 rate */
|
||||||
if (!(value & 0x00800000)) { /* PLL1 bypassed? */
|
value = __raw_readl(EP93XX_SYSCON_CLKSET1);
|
||||||
|
if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
|
||||||
clk_pll1.rate = clk_xtali.rate;
|
clk_pll1.rate = clk_xtali.rate;
|
||||||
} else {
|
else
|
||||||
clk_pll1.rate = calc_pll_rate(value);
|
clk_pll1.rate = calc_pll_rate(value);
|
||||||
}
|
|
||||||
|
/* Initialize the pll1 derived clocks */
|
||||||
clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7];
|
clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7];
|
||||||
clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7];
|
clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7];
|
||||||
clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3];
|
clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3];
|
||||||
ep93xx_dma_clock_init();
|
ep93xx_dma_clock_init();
|
||||||
|
|
||||||
value = __raw_readl(EP93XX_SYSCON_CLOCK_SET2);
|
/* Determine the bootloader configured pll2 rate */
|
||||||
if (!(value & 0x00080000)) { /* PLL2 bypassed? */
|
value = __raw_readl(EP93XX_SYSCON_CLKSET2);
|
||||||
|
if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
|
||||||
clk_pll2.rate = clk_xtali.rate;
|
clk_pll2.rate = clk_xtali.rate;
|
||||||
} else if (value & 0x00040000) { /* PLL2 enabled? */
|
else if (value & EP93XX_SYSCON_CLKSET2_PLL2_EN)
|
||||||
clk_pll2.rate = calc_pll_rate(value);
|
clk_pll2.rate = calc_pll_rate(value);
|
||||||
} else {
|
else
|
||||||
clk_pll2.rate = 0;
|
clk_pll2.rate = 0;
|
||||||
}
|
|
||||||
|
/* Initialize the pll2 derived clocks */
|
||||||
clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1);
|
clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1);
|
||||||
|
|
||||||
printk(KERN_INFO "ep93xx: PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
|
pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
|
||||||
clk_pll1.rate / 1000000, clk_pll2.rate / 1000000);
|
clk_pll1.rate / 1000000, clk_pll2.rate / 1000000);
|
||||||
printk(KERN_INFO "ep93xx: FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
|
pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
|
||||||
clk_f.rate / 1000000, clk_h.rate / 1000000,
|
clk_f.rate / 1000000, clk_h.rate / 1000000,
|
||||||
clk_p.rate / 1000000);
|
clk_p.rate / 1000000);
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,15 @@
|
||||||
* your option) any later version.
|
* your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/dma-mapping.h>
|
#include <linux/dma-mapping.h>
|
||||||
#include <linux/timex.h>
|
#include <linux/timex.h>
|
||||||
|
#include <linux/irq.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <linux/leds.h>
|
#include <linux/leds.h>
|
||||||
|
@ -35,7 +38,6 @@
|
||||||
|
|
||||||
#include <asm/mach/map.h>
|
#include <asm/mach/map.h>
|
||||||
#include <asm/mach/time.h>
|
#include <asm/mach/time.h>
|
||||||
#include <asm/mach/irq.h>
|
|
||||||
|
|
||||||
#include <asm/hardware/vic.h>
|
#include <asm/hardware/vic.h>
|
||||||
|
|
||||||
|
@ -82,13 +84,40 @@ void __init ep93xx_map_io(void)
|
||||||
* to use this timer for something else. We also use timer 4 for keeping
|
* to use this timer for something else. We also use timer 4 for keeping
|
||||||
* track of lost jiffies.
|
* track of lost jiffies.
|
||||||
*/
|
*/
|
||||||
static unsigned int last_jiffy_time;
|
#define EP93XX_TIMER_REG(x) (EP93XX_TIMER_BASE + (x))
|
||||||
|
#define EP93XX_TIMER1_LOAD EP93XX_TIMER_REG(0x00)
|
||||||
|
#define EP93XX_TIMER1_VALUE EP93XX_TIMER_REG(0x04)
|
||||||
|
#define EP93XX_TIMER1_CONTROL EP93XX_TIMER_REG(0x08)
|
||||||
|
#define EP93XX_TIMER123_CONTROL_ENABLE (1 << 7)
|
||||||
|
#define EP93XX_TIMER123_CONTROL_MODE (1 << 6)
|
||||||
|
#define EP93XX_TIMER123_CONTROL_CLKSEL (1 << 3)
|
||||||
|
#define EP93XX_TIMER1_CLEAR EP93XX_TIMER_REG(0x0c)
|
||||||
|
#define EP93XX_TIMER2_LOAD EP93XX_TIMER_REG(0x20)
|
||||||
|
#define EP93XX_TIMER2_VALUE EP93XX_TIMER_REG(0x24)
|
||||||
|
#define EP93XX_TIMER2_CONTROL EP93XX_TIMER_REG(0x28)
|
||||||
|
#define EP93XX_TIMER2_CLEAR EP93XX_TIMER_REG(0x2c)
|
||||||
|
#define EP93XX_TIMER4_VALUE_LOW EP93XX_TIMER_REG(0x60)
|
||||||
|
#define EP93XX_TIMER4_VALUE_HIGH EP93XX_TIMER_REG(0x64)
|
||||||
|
#define EP93XX_TIMER4_VALUE_HIGH_ENABLE (1 << 8)
|
||||||
|
#define EP93XX_TIMER3_LOAD EP93XX_TIMER_REG(0x80)
|
||||||
|
#define EP93XX_TIMER3_VALUE EP93XX_TIMER_REG(0x84)
|
||||||
|
#define EP93XX_TIMER3_CONTROL EP93XX_TIMER_REG(0x88)
|
||||||
|
#define EP93XX_TIMER3_CLEAR EP93XX_TIMER_REG(0x8c)
|
||||||
|
|
||||||
|
#define EP93XX_TIMER123_CLOCK 508469
|
||||||
|
#define EP93XX_TIMER4_CLOCK 983040
|
||||||
|
|
||||||
|
#define TIMER1_RELOAD ((EP93XX_TIMER123_CLOCK / HZ) - 1)
|
||||||
#define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(CLOCK_TICK_RATE, HZ)
|
#define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(CLOCK_TICK_RATE, HZ)
|
||||||
|
|
||||||
|
static unsigned int last_jiffy_time;
|
||||||
|
|
||||||
static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id)
|
static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id)
|
||||||
{
|
{
|
||||||
|
/* Writing any value clears the timer interrupt */
|
||||||
__raw_writel(1, EP93XX_TIMER1_CLEAR);
|
__raw_writel(1, EP93XX_TIMER1_CLEAR);
|
||||||
|
|
||||||
|
/* Recover lost jiffies */
|
||||||
while ((signed long)
|
while ((signed long)
|
||||||
(__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time)
|
(__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time)
|
||||||
>= TIMER4_TICKS_PER_JIFFY) {
|
>= TIMER4_TICKS_PER_JIFFY) {
|
||||||
|
@ -107,13 +136,18 @@ static struct irqaction ep93xx_timer_irq = {
|
||||||
|
|
||||||
static void __init ep93xx_timer_init(void)
|
static void __init ep93xx_timer_init(void)
|
||||||
{
|
{
|
||||||
|
u32 tmode = EP93XX_TIMER123_CONTROL_MODE |
|
||||||
|
EP93XX_TIMER123_CONTROL_CLKSEL;
|
||||||
|
|
||||||
/* Enable periodic HZ timer. */
|
/* Enable periodic HZ timer. */
|
||||||
__raw_writel(0x48, EP93XX_TIMER1_CONTROL);
|
__raw_writel(tmode, EP93XX_TIMER1_CONTROL);
|
||||||
__raw_writel((508469 / HZ) - 1, EP93XX_TIMER1_LOAD);
|
__raw_writel(TIMER1_RELOAD, EP93XX_TIMER1_LOAD);
|
||||||
__raw_writel(0xc8, EP93XX_TIMER1_CONTROL);
|
__raw_writel(tmode | EP93XX_TIMER123_CONTROL_ENABLE,
|
||||||
|
EP93XX_TIMER1_CONTROL);
|
||||||
|
|
||||||
/* Enable lost jiffy timer. */
|
/* Enable lost jiffy timer. */
|
||||||
__raw_writel(0x100, EP93XX_TIMER4_VALUE_HIGH);
|
__raw_writel(EP93XX_TIMER4_VALUE_HIGH_ENABLE,
|
||||||
|
EP93XX_TIMER4_VALUE_HIGH);
|
||||||
|
|
||||||
setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq);
|
setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq);
|
||||||
}
|
}
|
||||||
|
@ -134,238 +168,17 @@ struct sys_timer ep93xx_timer = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
* GPIO handling for EP93xx
|
|
||||||
*************************************************************************/
|
|
||||||
static unsigned char gpio_int_unmasked[3];
|
|
||||||
static unsigned char gpio_int_enabled[3];
|
|
||||||
static unsigned char gpio_int_type1[3];
|
|
||||||
static unsigned char gpio_int_type2[3];
|
|
||||||
static unsigned char gpio_int_debounce[3];
|
|
||||||
|
|
||||||
/* Port ordering is: A B F */
|
|
||||||
static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c };
|
|
||||||
static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 };
|
|
||||||
static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 };
|
|
||||||
static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 };
|
|
||||||
static const u8 int_debounce_register_offset[3] = { 0xa8, 0xc4, 0x64 };
|
|
||||||
|
|
||||||
void ep93xx_gpio_update_int_params(unsigned port)
|
|
||||||
{
|
|
||||||
BUG_ON(port > 2);
|
|
||||||
|
|
||||||
__raw_writeb(0, EP93XX_GPIO_REG(int_en_register_offset[port]));
|
|
||||||
|
|
||||||
__raw_writeb(gpio_int_type2[port],
|
|
||||||
EP93XX_GPIO_REG(int_type2_register_offset[port]));
|
|
||||||
|
|
||||||
__raw_writeb(gpio_int_type1[port],
|
|
||||||
EP93XX_GPIO_REG(int_type1_register_offset[port]));
|
|
||||||
|
|
||||||
__raw_writeb(gpio_int_unmasked[port] & gpio_int_enabled[port],
|
|
||||||
EP93XX_GPIO_REG(int_en_register_offset[port]));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ep93xx_gpio_int_mask(unsigned line)
|
|
||||||
{
|
|
||||||
gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ep93xx_gpio_int_debounce(unsigned int irq, int enable)
|
|
||||||
{
|
|
||||||
int line = irq_to_gpio(irq);
|
|
||||||
int port = line >> 3;
|
|
||||||
int port_mask = 1 << (line & 7);
|
|
||||||
|
|
||||||
if (enable)
|
|
||||||
gpio_int_debounce[port] |= port_mask;
|
|
||||||
else
|
|
||||||
gpio_int_debounce[port] &= ~port_mask;
|
|
||||||
|
|
||||||
__raw_writeb(gpio_int_debounce[port],
|
|
||||||
EP93XX_GPIO_REG(int_debounce_register_offset[port]));
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(ep93xx_gpio_int_debounce);
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* EP93xx IRQ handling
|
* EP93xx IRQ handling
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc)
|
extern void ep93xx_gpio_init_irq(void);
|
||||||
{
|
|
||||||
unsigned char status;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
status = __raw_readb(EP93XX_GPIO_A_INT_STATUS);
|
|
||||||
for (i = 0; i < 8; i++) {
|
|
||||||
if (status & (1 << i)) {
|
|
||||||
int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_A(0)) + i;
|
|
||||||
generic_handle_irq(gpio_irq);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
status = __raw_readb(EP93XX_GPIO_B_INT_STATUS);
|
|
||||||
for (i = 0; i < 8; i++) {
|
|
||||||
if (status & (1 << i)) {
|
|
||||||
int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i;
|
|
||||||
generic_handle_irq(gpio_irq);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ep93xx_gpio_f_irq_handler(unsigned int irq, struct irq_desc *desc)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* map discontiguous hw irq range to continous sw irq range:
|
|
||||||
*
|
|
||||||
* IRQ_EP93XX_GPIO{0..7}MUX -> gpio_to_irq(EP93XX_GPIO_LINE_F({0..7})
|
|
||||||
*/
|
|
||||||
int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */
|
|
||||||
int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_F(0)) + port_f_idx;
|
|
||||||
|
|
||||||
generic_handle_irq(gpio_irq);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ep93xx_gpio_irq_ack(unsigned int irq)
|
|
||||||
{
|
|
||||||
int line = irq_to_gpio(irq);
|
|
||||||
int port = line >> 3;
|
|
||||||
int port_mask = 1 << (line & 7);
|
|
||||||
|
|
||||||
if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
|
|
||||||
gpio_int_type2[port] ^= port_mask; /* switch edge direction */
|
|
||||||
ep93xx_gpio_update_int_params(port);
|
|
||||||
}
|
|
||||||
|
|
||||||
__raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ep93xx_gpio_irq_mask_ack(unsigned int irq)
|
|
||||||
{
|
|
||||||
int line = irq_to_gpio(irq);
|
|
||||||
int port = line >> 3;
|
|
||||||
int port_mask = 1 << (line & 7);
|
|
||||||
|
|
||||||
if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
|
|
||||||
gpio_int_type2[port] ^= port_mask; /* switch edge direction */
|
|
||||||
|
|
||||||
gpio_int_unmasked[port] &= ~port_mask;
|
|
||||||
ep93xx_gpio_update_int_params(port);
|
|
||||||
|
|
||||||
__raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ep93xx_gpio_irq_mask(unsigned int irq)
|
|
||||||
{
|
|
||||||
int line = irq_to_gpio(irq);
|
|
||||||
int port = line >> 3;
|
|
||||||
|
|
||||||
gpio_int_unmasked[port] &= ~(1 << (line & 7));
|
|
||||||
ep93xx_gpio_update_int_params(port);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ep93xx_gpio_irq_unmask(unsigned int irq)
|
|
||||||
{
|
|
||||||
int line = irq_to_gpio(irq);
|
|
||||||
int port = line >> 3;
|
|
||||||
|
|
||||||
gpio_int_unmasked[port] |= 1 << (line & 7);
|
|
||||||
ep93xx_gpio_update_int_params(port);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* gpio_int_type1 controls whether the interrupt is level (0) or
|
|
||||||
* edge (1) triggered, while gpio_int_type2 controls whether it
|
|
||||||
* triggers on low/falling (0) or high/rising (1).
|
|
||||||
*/
|
|
||||||
static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
|
|
||||||
{
|
|
||||||
struct irq_desc *desc = irq_desc + irq;
|
|
||||||
const int gpio = irq_to_gpio(irq);
|
|
||||||
const int port = gpio >> 3;
|
|
||||||
const int port_mask = 1 << (gpio & 7);
|
|
||||||
|
|
||||||
gpio_direction_input(gpio);
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case IRQ_TYPE_EDGE_RISING:
|
|
||||||
gpio_int_type1[port] |= port_mask;
|
|
||||||
gpio_int_type2[port] |= port_mask;
|
|
||||||
desc->handle_irq = handle_edge_irq;
|
|
||||||
break;
|
|
||||||
case IRQ_TYPE_EDGE_FALLING:
|
|
||||||
gpio_int_type1[port] |= port_mask;
|
|
||||||
gpio_int_type2[port] &= ~port_mask;
|
|
||||||
desc->handle_irq = handle_edge_irq;
|
|
||||||
break;
|
|
||||||
case IRQ_TYPE_LEVEL_HIGH:
|
|
||||||
gpio_int_type1[port] &= ~port_mask;
|
|
||||||
gpio_int_type2[port] |= port_mask;
|
|
||||||
desc->handle_irq = handle_level_irq;
|
|
||||||
break;
|
|
||||||
case IRQ_TYPE_LEVEL_LOW:
|
|
||||||
gpio_int_type1[port] &= ~port_mask;
|
|
||||||
gpio_int_type2[port] &= ~port_mask;
|
|
||||||
desc->handle_irq = handle_level_irq;
|
|
||||||
break;
|
|
||||||
case IRQ_TYPE_EDGE_BOTH:
|
|
||||||
gpio_int_type1[port] |= port_mask;
|
|
||||||
/* set initial polarity based on current input level */
|
|
||||||
if (gpio_get_value(gpio))
|
|
||||||
gpio_int_type2[port] &= ~port_mask; /* falling */
|
|
||||||
else
|
|
||||||
gpio_int_type2[port] |= port_mask; /* rising */
|
|
||||||
desc->handle_irq = handle_edge_irq;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
pr_err("ep93xx: failed to set irq type %d for gpio %d\n",
|
|
||||||
type, gpio);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
gpio_int_enabled[port] |= port_mask;
|
|
||||||
|
|
||||||
desc->status &= ~IRQ_TYPE_SENSE_MASK;
|
|
||||||
desc->status |= type & IRQ_TYPE_SENSE_MASK;
|
|
||||||
|
|
||||||
ep93xx_gpio_update_int_params(port);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct irq_chip ep93xx_gpio_irq_chip = {
|
|
||||||
.name = "GPIO",
|
|
||||||
.ack = ep93xx_gpio_irq_ack,
|
|
||||||
.mask_ack = ep93xx_gpio_irq_mask_ack,
|
|
||||||
.mask = ep93xx_gpio_irq_mask,
|
|
||||||
.unmask = ep93xx_gpio_irq_unmask,
|
|
||||||
.set_type = ep93xx_gpio_irq_type,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void __init ep93xx_init_irq(void)
|
void __init ep93xx_init_irq(void)
|
||||||
{
|
{
|
||||||
int gpio_irq;
|
|
||||||
|
|
||||||
vic_init(EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0);
|
vic_init(EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0);
|
||||||
vic_init(EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0);
|
vic_init(EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0);
|
||||||
|
|
||||||
for (gpio_irq = gpio_to_irq(0);
|
ep93xx_gpio_init_irq();
|
||||||
gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) {
|
|
||||||
set_irq_chip(gpio_irq, &ep93xx_gpio_irq_chip);
|
|
||||||
set_irq_handler(gpio_irq, handle_level_irq);
|
|
||||||
set_irq_flags(gpio_irq, IRQF_VALID);
|
|
||||||
}
|
|
||||||
|
|
||||||
set_irq_chained_handler(IRQ_EP93XX_GPIO_AB, ep93xx_gpio_ab_irq_handler);
|
|
||||||
set_irq_chained_handler(IRQ_EP93XX_GPIO0MUX, ep93xx_gpio_f_irq_handler);
|
|
||||||
set_irq_chained_handler(IRQ_EP93XX_GPIO1MUX, ep93xx_gpio_f_irq_handler);
|
|
||||||
set_irq_chained_handler(IRQ_EP93XX_GPIO2MUX, ep93xx_gpio_f_irq_handler);
|
|
||||||
set_irq_chained_handler(IRQ_EP93XX_GPIO3MUX, ep93xx_gpio_f_irq_handler);
|
|
||||||
set_irq_chained_handler(IRQ_EP93XX_GPIO4MUX, ep93xx_gpio_f_irq_handler);
|
|
||||||
set_irq_chained_handler(IRQ_EP93XX_GPIO5MUX, ep93xx_gpio_f_irq_handler);
|
|
||||||
set_irq_chained_handler(IRQ_EP93XX_GPIO6MUX, ep93xx_gpio_f_irq_handler);
|
|
||||||
set_irq_chained_handler(IRQ_EP93XX_GPIO7MUX, ep93xx_gpio_f_irq_handler);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -572,9 +385,9 @@ void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
|
||||||
* CMOS driver.
|
* CMOS driver.
|
||||||
*/
|
*/
|
||||||
if (data->sda_is_open_drain && data->sda_pin != EP93XX_GPIO_LINE_EEDAT)
|
if (data->sda_is_open_drain && data->sda_pin != EP93XX_GPIO_LINE_EEDAT)
|
||||||
pr_warning("ep93xx: sda != EEDAT, open drain has no effect\n");
|
pr_warning("sda != EEDAT, open drain has no effect\n");
|
||||||
if (data->scl_is_open_drain && data->scl_pin != EP93XX_GPIO_LINE_EECLK)
|
if (data->scl_is_open_drain && data->scl_pin != EP93XX_GPIO_LINE_EECLK)
|
||||||
pr_warning("ep93xx: scl != EECLK, open drain has no effect\n");
|
pr_warning("scl != EECLK, open drain has no effect\n");
|
||||||
|
|
||||||
__raw_writel((data->sda_is_open_drain << 1) |
|
__raw_writel((data->sda_is_open_drain << 1) |
|
||||||
(data->scl_is_open_drain << 0),
|
(data->scl_is_open_drain << 0),
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
* with this implementation.
|
* with this implementation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
|
@ -173,7 +175,7 @@ static irqreturn_t m2p_irq(int irq, void *dev_id)
|
||||||
|
|
||||||
switch (m2p_channel_state(ch)) {
|
switch (m2p_channel_state(ch)) {
|
||||||
case STATE_IDLE:
|
case STATE_IDLE:
|
||||||
pr_crit("m2p_irq: dma interrupt without a dma buffer\n");
|
pr_crit("dma interrupt without a dma buffer\n");
|
||||||
BUG();
|
BUG();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -197,7 +199,7 @@ static irqreturn_t m2p_irq(int irq, void *dev_id)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_NEXT:
|
case STATE_NEXT:
|
||||||
pr_crit("m2p_irq: dma interrupt while next\n");
|
pr_crit("dma interrupt while next\n");
|
||||||
BUG();
|
BUG();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,12 +118,33 @@ static void __init edb93xx_register_i2c(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* EDB93xx pwm
|
||||||
|
*************************************************************************/
|
||||||
|
static void __init edb93xx_register_pwm(void)
|
||||||
|
{
|
||||||
|
if (machine_is_edb9301() ||
|
||||||
|
machine_is_edb9302() || machine_is_edb9302a()) {
|
||||||
|
/* EP9301 and EP9302 only have pwm.1 (EGPIO14) */
|
||||||
|
ep93xx_register_pwm(0, 1);
|
||||||
|
} else if (machine_is_edb9307() || machine_is_edb9307a()) {
|
||||||
|
/* EP9307 only has pwm.0 (PWMOUT) */
|
||||||
|
ep93xx_register_pwm(1, 0);
|
||||||
|
} else {
|
||||||
|
/* EP9312 and EP9315 have both */
|
||||||
|
ep93xx_register_pwm(1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void __init edb93xx_init_machine(void)
|
static void __init edb93xx_init_machine(void)
|
||||||
{
|
{
|
||||||
ep93xx_init_devices();
|
ep93xx_init_devices();
|
||||||
edb93xx_register_flash();
|
edb93xx_register_flash();
|
||||||
ep93xx_register_eth(&edb93xx_eth_data, 1);
|
ep93xx_register_eth(&edb93xx_eth_data, 1);
|
||||||
edb93xx_register_i2c();
|
edb93xx_register_i2c();
|
||||||
|
edb93xx_register_pwm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
* published by the Free Software Foundation.
|
* published by the Free Software Foundation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
|
@ -22,6 +24,235 @@
|
||||||
|
|
||||||
#include <mach/hardware.h>
|
#include <mach/hardware.h>
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* GPIO handling for EP93xx
|
||||||
|
*************************************************************************/
|
||||||
|
static unsigned char gpio_int_unmasked[3];
|
||||||
|
static unsigned char gpio_int_enabled[3];
|
||||||
|
static unsigned char gpio_int_type1[3];
|
||||||
|
static unsigned char gpio_int_type2[3];
|
||||||
|
static unsigned char gpio_int_debounce[3];
|
||||||
|
|
||||||
|
/* Port ordering is: A B F */
|
||||||
|
static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c };
|
||||||
|
static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 };
|
||||||
|
static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 };
|
||||||
|
static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 };
|
||||||
|
static const u8 int_debounce_register_offset[3] = { 0xa8, 0xc4, 0x64 };
|
||||||
|
|
||||||
|
void ep93xx_gpio_update_int_params(unsigned port)
|
||||||
|
{
|
||||||
|
BUG_ON(port > 2);
|
||||||
|
|
||||||
|
__raw_writeb(0, EP93XX_GPIO_REG(int_en_register_offset[port]));
|
||||||
|
|
||||||
|
__raw_writeb(gpio_int_type2[port],
|
||||||
|
EP93XX_GPIO_REG(int_type2_register_offset[port]));
|
||||||
|
|
||||||
|
__raw_writeb(gpio_int_type1[port],
|
||||||
|
EP93XX_GPIO_REG(int_type1_register_offset[port]));
|
||||||
|
|
||||||
|
__raw_writeb(gpio_int_unmasked[port] & gpio_int_enabled[port],
|
||||||
|
EP93XX_GPIO_REG(int_en_register_offset[port]));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ep93xx_gpio_int_mask(unsigned line)
|
||||||
|
{
|
||||||
|
gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ep93xx_gpio_int_debounce(unsigned int irq, int enable)
|
||||||
|
{
|
||||||
|
int line = irq_to_gpio(irq);
|
||||||
|
int port = line >> 3;
|
||||||
|
int port_mask = 1 << (line & 7);
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
gpio_int_debounce[port] |= port_mask;
|
||||||
|
else
|
||||||
|
gpio_int_debounce[port] &= ~port_mask;
|
||||||
|
|
||||||
|
__raw_writeb(gpio_int_debounce[port],
|
||||||
|
EP93XX_GPIO_REG(int_debounce_register_offset[port]));
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(ep93xx_gpio_int_debounce);
|
||||||
|
|
||||||
|
static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc)
|
||||||
|
{
|
||||||
|
unsigned char status;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
status = __raw_readb(EP93XX_GPIO_A_INT_STATUS);
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
if (status & (1 << i)) {
|
||||||
|
int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_A(0)) + i;
|
||||||
|
generic_handle_irq(gpio_irq);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
status = __raw_readb(EP93XX_GPIO_B_INT_STATUS);
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
if (status & (1 << i)) {
|
||||||
|
int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i;
|
||||||
|
generic_handle_irq(gpio_irq);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ep93xx_gpio_f_irq_handler(unsigned int irq, struct irq_desc *desc)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* map discontiguous hw irq range to continous sw irq range:
|
||||||
|
*
|
||||||
|
* IRQ_EP93XX_GPIO{0..7}MUX -> gpio_to_irq(EP93XX_GPIO_LINE_F({0..7})
|
||||||
|
*/
|
||||||
|
int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */
|
||||||
|
int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_F(0)) + port_f_idx;
|
||||||
|
|
||||||
|
generic_handle_irq(gpio_irq);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ep93xx_gpio_irq_ack(unsigned int irq)
|
||||||
|
{
|
||||||
|
int line = irq_to_gpio(irq);
|
||||||
|
int port = line >> 3;
|
||||||
|
int port_mask = 1 << (line & 7);
|
||||||
|
|
||||||
|
if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
|
||||||
|
gpio_int_type2[port] ^= port_mask; /* switch edge direction */
|
||||||
|
ep93xx_gpio_update_int_params(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
__raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ep93xx_gpio_irq_mask_ack(unsigned int irq)
|
||||||
|
{
|
||||||
|
int line = irq_to_gpio(irq);
|
||||||
|
int port = line >> 3;
|
||||||
|
int port_mask = 1 << (line & 7);
|
||||||
|
|
||||||
|
if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
|
||||||
|
gpio_int_type2[port] ^= port_mask; /* switch edge direction */
|
||||||
|
|
||||||
|
gpio_int_unmasked[port] &= ~port_mask;
|
||||||
|
ep93xx_gpio_update_int_params(port);
|
||||||
|
|
||||||
|
__raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ep93xx_gpio_irq_mask(unsigned int irq)
|
||||||
|
{
|
||||||
|
int line = irq_to_gpio(irq);
|
||||||
|
int port = line >> 3;
|
||||||
|
|
||||||
|
gpio_int_unmasked[port] &= ~(1 << (line & 7));
|
||||||
|
ep93xx_gpio_update_int_params(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ep93xx_gpio_irq_unmask(unsigned int irq)
|
||||||
|
{
|
||||||
|
int line = irq_to_gpio(irq);
|
||||||
|
int port = line >> 3;
|
||||||
|
|
||||||
|
gpio_int_unmasked[port] |= 1 << (line & 7);
|
||||||
|
ep93xx_gpio_update_int_params(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gpio_int_type1 controls whether the interrupt is level (0) or
|
||||||
|
* edge (1) triggered, while gpio_int_type2 controls whether it
|
||||||
|
* triggers on low/falling (0) or high/rising (1).
|
||||||
|
*/
|
||||||
|
static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
|
||||||
|
{
|
||||||
|
struct irq_desc *desc = irq_desc + irq;
|
||||||
|
const int gpio = irq_to_gpio(irq);
|
||||||
|
const int port = gpio >> 3;
|
||||||
|
const int port_mask = 1 << (gpio & 7);
|
||||||
|
|
||||||
|
gpio_direction_input(gpio);
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case IRQ_TYPE_EDGE_RISING:
|
||||||
|
gpio_int_type1[port] |= port_mask;
|
||||||
|
gpio_int_type2[port] |= port_mask;
|
||||||
|
desc->handle_irq = handle_edge_irq;
|
||||||
|
break;
|
||||||
|
case IRQ_TYPE_EDGE_FALLING:
|
||||||
|
gpio_int_type1[port] |= port_mask;
|
||||||
|
gpio_int_type2[port] &= ~port_mask;
|
||||||
|
desc->handle_irq = handle_edge_irq;
|
||||||
|
break;
|
||||||
|
case IRQ_TYPE_LEVEL_HIGH:
|
||||||
|
gpio_int_type1[port] &= ~port_mask;
|
||||||
|
gpio_int_type2[port] |= port_mask;
|
||||||
|
desc->handle_irq = handle_level_irq;
|
||||||
|
break;
|
||||||
|
case IRQ_TYPE_LEVEL_LOW:
|
||||||
|
gpio_int_type1[port] &= ~port_mask;
|
||||||
|
gpio_int_type2[port] &= ~port_mask;
|
||||||
|
desc->handle_irq = handle_level_irq;
|
||||||
|
break;
|
||||||
|
case IRQ_TYPE_EDGE_BOTH:
|
||||||
|
gpio_int_type1[port] |= port_mask;
|
||||||
|
/* set initial polarity based on current input level */
|
||||||
|
if (gpio_get_value(gpio))
|
||||||
|
gpio_int_type2[port] &= ~port_mask; /* falling */
|
||||||
|
else
|
||||||
|
gpio_int_type2[port] |= port_mask; /* rising */
|
||||||
|
desc->handle_irq = handle_edge_irq;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pr_err("failed to set irq type %d for gpio %d\n", type, gpio);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
gpio_int_enabled[port] |= port_mask;
|
||||||
|
|
||||||
|
desc->status &= ~IRQ_TYPE_SENSE_MASK;
|
||||||
|
desc->status |= type & IRQ_TYPE_SENSE_MASK;
|
||||||
|
|
||||||
|
ep93xx_gpio_update_int_params(port);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct irq_chip ep93xx_gpio_irq_chip = {
|
||||||
|
.name = "GPIO",
|
||||||
|
.ack = ep93xx_gpio_irq_ack,
|
||||||
|
.mask_ack = ep93xx_gpio_irq_mask_ack,
|
||||||
|
.mask = ep93xx_gpio_irq_mask,
|
||||||
|
.unmask = ep93xx_gpio_irq_unmask,
|
||||||
|
.set_type = ep93xx_gpio_irq_type,
|
||||||
|
};
|
||||||
|
|
||||||
|
void __init ep93xx_gpio_init_irq(void)
|
||||||
|
{
|
||||||
|
int gpio_irq;
|
||||||
|
|
||||||
|
for (gpio_irq = gpio_to_irq(0);
|
||||||
|
gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) {
|
||||||
|
set_irq_chip(gpio_irq, &ep93xx_gpio_irq_chip);
|
||||||
|
set_irq_handler(gpio_irq, handle_level_irq);
|
||||||
|
set_irq_flags(gpio_irq, IRQF_VALID);
|
||||||
|
}
|
||||||
|
|
||||||
|
set_irq_chained_handler(IRQ_EP93XX_GPIO_AB, ep93xx_gpio_ab_irq_handler);
|
||||||
|
set_irq_chained_handler(IRQ_EP93XX_GPIO0MUX, ep93xx_gpio_f_irq_handler);
|
||||||
|
set_irq_chained_handler(IRQ_EP93XX_GPIO1MUX, ep93xx_gpio_f_irq_handler);
|
||||||
|
set_irq_chained_handler(IRQ_EP93XX_GPIO2MUX, ep93xx_gpio_f_irq_handler);
|
||||||
|
set_irq_chained_handler(IRQ_EP93XX_GPIO3MUX, ep93xx_gpio_f_irq_handler);
|
||||||
|
set_irq_chained_handler(IRQ_EP93XX_GPIO4MUX, ep93xx_gpio_f_irq_handler);
|
||||||
|
set_irq_chained_handler(IRQ_EP93XX_GPIO5MUX, ep93xx_gpio_f_irq_handler);
|
||||||
|
set_irq_chained_handler(IRQ_EP93XX_GPIO6MUX, ep93xx_gpio_f_irq_handler);
|
||||||
|
set_irq_chained_handler(IRQ_EP93XX_GPIO7MUX, ep93xx_gpio_f_irq_handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* gpiolib interface for EP93xx on-chip GPIOs
|
||||||
|
*************************************************************************/
|
||||||
struct ep93xx_gpio_chip {
|
struct ep93xx_gpio_chip {
|
||||||
struct gpio_chip chip;
|
struct gpio_chip chip;
|
||||||
|
|
||||||
|
@ -31,10 +262,6 @@ struct ep93xx_gpio_chip {
|
||||||
|
|
||||||
#define to_ep93xx_gpio_chip(c) container_of(c, struct ep93xx_gpio_chip, chip)
|
#define to_ep93xx_gpio_chip(c) container_of(c, struct ep93xx_gpio_chip, chip)
|
||||||
|
|
||||||
/* From core.c */
|
|
||||||
extern void ep93xx_gpio_int_mask(unsigned line);
|
|
||||||
extern void ep93xx_gpio_update_int_params(unsigned port);
|
|
||||||
|
|
||||||
static int ep93xx_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
|
static int ep93xx_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
|
||||||
{
|
{
|
||||||
struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
|
struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
|
||||||
|
|
|
@ -92,21 +92,6 @@
|
||||||
|
|
||||||
/* APB peripherals */
|
/* APB peripherals */
|
||||||
#define EP93XX_TIMER_BASE EP93XX_APB_IOMEM(0x00010000)
|
#define EP93XX_TIMER_BASE EP93XX_APB_IOMEM(0x00010000)
|
||||||
#define EP93XX_TIMER_REG(x) (EP93XX_TIMER_BASE + (x))
|
|
||||||
#define EP93XX_TIMER1_LOAD EP93XX_TIMER_REG(0x00)
|
|
||||||
#define EP93XX_TIMER1_VALUE EP93XX_TIMER_REG(0x04)
|
|
||||||
#define EP93XX_TIMER1_CONTROL EP93XX_TIMER_REG(0x08)
|
|
||||||
#define EP93XX_TIMER1_CLEAR EP93XX_TIMER_REG(0x0c)
|
|
||||||
#define EP93XX_TIMER2_LOAD EP93XX_TIMER_REG(0x20)
|
|
||||||
#define EP93XX_TIMER2_VALUE EP93XX_TIMER_REG(0x24)
|
|
||||||
#define EP93XX_TIMER2_CONTROL EP93XX_TIMER_REG(0x28)
|
|
||||||
#define EP93XX_TIMER2_CLEAR EP93XX_TIMER_REG(0x2c)
|
|
||||||
#define EP93XX_TIMER4_VALUE_LOW EP93XX_TIMER_REG(0x60)
|
|
||||||
#define EP93XX_TIMER4_VALUE_HIGH EP93XX_TIMER_REG(0x64)
|
|
||||||
#define EP93XX_TIMER3_LOAD EP93XX_TIMER_REG(0x80)
|
|
||||||
#define EP93XX_TIMER3_VALUE EP93XX_TIMER_REG(0x84)
|
|
||||||
#define EP93XX_TIMER3_CONTROL EP93XX_TIMER_REG(0x88)
|
|
||||||
#define EP93XX_TIMER3_CLEAR EP93XX_TIMER_REG(0x8c)
|
|
||||||
|
|
||||||
#define EP93XX_I2S_BASE EP93XX_APB_IOMEM(0x00020000)
|
#define EP93XX_I2S_BASE EP93XX_APB_IOMEM(0x00020000)
|
||||||
|
|
||||||
|
@ -167,8 +152,11 @@
|
||||||
#define EP93XX_SYSCON_PWRCNT_DMA_M2P1 (1<<16)
|
#define EP93XX_SYSCON_PWRCNT_DMA_M2P1 (1<<16)
|
||||||
#define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08)
|
#define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08)
|
||||||
#define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c)
|
#define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c)
|
||||||
#define EP93XX_SYSCON_CLOCK_SET1 EP93XX_SYSCON_REG(0x20)
|
#define EP93XX_SYSCON_CLKSET1 EP93XX_SYSCON_REG(0x20)
|
||||||
#define EP93XX_SYSCON_CLOCK_SET2 EP93XX_SYSCON_REG(0x24)
|
#define EP93XX_SYSCON_CLKSET1_NBYP1 (1<<23)
|
||||||
|
#define EP93XX_SYSCON_CLKSET2 EP93XX_SYSCON_REG(0x24)
|
||||||
|
#define EP93XX_SYSCON_CLKSET2_NBYP2 (1<<19)
|
||||||
|
#define EP93XX_SYSCON_CLKSET2_PLL2_EN (1<<18)
|
||||||
#define EP93XX_SYSCON_DEVCFG EP93XX_SYSCON_REG(0x80)
|
#define EP93XX_SYSCON_DEVCFG EP93XX_SYSCON_REG(0x80)
|
||||||
#define EP93XX_SYSCON_DEVCFG_SWRST (1<<31)
|
#define EP93XX_SYSCON_DEVCFG_SWRST (1<<31)
|
||||||
#define EP93XX_SYSCON_DEVCFG_D1ONG (1<<30)
|
#define EP93XX_SYSCON_DEVCFG_D1ONG (1<<30)
|
||||||
|
|
97
arch/arm/mach-ep93xx/simone.c
Normal file
97
arch/arm/mach-ep93xx/simone.c
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-ep93xx/simone.c
|
||||||
|
* Simplemachines Sim.One support.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2010 Ryan Mallon <ryan@bluewatersys.com>
|
||||||
|
*
|
||||||
|
* Based on the 2.6.24.7 support:
|
||||||
|
* Copyright (C) 2009 Simplemachines
|
||||||
|
* MMC support by Peter Ivanov <ivanovp@gmail.com>, 2007
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/mtd/physmap.h>
|
||||||
|
#include <linux/gpio.h>
|
||||||
|
#include <linux/i2c.h>
|
||||||
|
#include <linux/i2c-gpio.h>
|
||||||
|
|
||||||
|
#include <mach/hardware.h>
|
||||||
|
#include <mach/fb.h>
|
||||||
|
|
||||||
|
#include <asm/mach-types.h>
|
||||||
|
#include <asm/mach/arch.h>
|
||||||
|
|
||||||
|
static struct physmap_flash_data simone_flash_data = {
|
||||||
|
.width = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct resource simone_flash_resource = {
|
||||||
|
.start = EP93XX_CS6_PHYS_BASE,
|
||||||
|
.end = EP93XX_CS6_PHYS_BASE + SZ_8M - 1,
|
||||||
|
.flags = IORESOURCE_MEM,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device simone_flash = {
|
||||||
|
.name = "physmap-flash",
|
||||||
|
.id = 0,
|
||||||
|
.num_resources = 1,
|
||||||
|
.resource = &simone_flash_resource,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = &simone_flash_data,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct ep93xx_eth_data simone_eth_data = {
|
||||||
|
.phy_id = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct ep93xxfb_mach_info simone_fb_info = {
|
||||||
|
.num_modes = EP93XXFB_USE_MODEDB,
|
||||||
|
.bpp = 16,
|
||||||
|
.flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct i2c_gpio_platform_data simone_i2c_gpio_data = {
|
||||||
|
.sda_pin = EP93XX_GPIO_LINE_EEDAT,
|
||||||
|
.sda_is_open_drain = 0,
|
||||||
|
.scl_pin = EP93XX_GPIO_LINE_EECLK,
|
||||||
|
.scl_is_open_drain = 0,
|
||||||
|
.udelay = 0,
|
||||||
|
.timeout = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct i2c_board_info __initdata simone_i2c_board_info[] = {
|
||||||
|
{
|
||||||
|
I2C_BOARD_INFO("ds1337", 0x68),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static void __init simone_init_machine(void)
|
||||||
|
{
|
||||||
|
ep93xx_init_devices();
|
||||||
|
|
||||||
|
platform_device_register(&simone_flash);
|
||||||
|
ep93xx_register_eth(&simone_eth_data, 1);
|
||||||
|
ep93xx_register_fb(&simone_fb_info);
|
||||||
|
ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info,
|
||||||
|
ARRAY_SIZE(simone_i2c_board_info));
|
||||||
|
}
|
||||||
|
|
||||||
|
MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
|
||||||
|
/* Maintainer: Ryan Mallon <ryan@bluewatersys.com> */
|
||||||
|
.phys_io = EP93XX_APB_PHYS_BASE,
|
||||||
|
.io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
|
||||||
|
.boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
|
||||||
|
.map_io = ep93xx_map_io,
|
||||||
|
.init_irq = ep93xx_init_irq,
|
||||||
|
.timer = &ep93xx_timer,
|
||||||
|
.init_machine = simone_init_machine,
|
||||||
|
MACHINE_END
|
172
arch/arm/mach-ep93xx/snappercl15.c
Normal file
172
arch/arm/mach-ep93xx/snappercl15.c
Normal file
|
@ -0,0 +1,172 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-ep93xx/snappercl15.c
|
||||||
|
* Bluewater Systems Snapper CL15 system module
|
||||||
|
*
|
||||||
|
* Copyright (C) 2009 Bluewater Systems Ltd
|
||||||
|
* Author: Ryan Mallon <ryan@bluewatersys.com>
|
||||||
|
*
|
||||||
|
* NAND code adapted from driver by:
|
||||||
|
* Andre Renaud <andre@bluewatersys.com>
|
||||||
|
* James R. McKaskill
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
#include <linux/gpio.h>
|
||||||
|
#include <linux/i2c.h>
|
||||||
|
#include <linux/i2c-gpio.h>
|
||||||
|
#include <linux/fb.h>
|
||||||
|
|
||||||
|
#include <linux/mtd/partitions.h>
|
||||||
|
#include <linux/mtd/nand.h>
|
||||||
|
|
||||||
|
#include <mach/hardware.h>
|
||||||
|
#include <mach/fb.h>
|
||||||
|
|
||||||
|
#include <asm/mach-types.h>
|
||||||
|
#include <asm/mach/arch.h>
|
||||||
|
|
||||||
|
#define SNAPPERCL15_NAND_BASE (EP93XX_CS7_PHYS_BASE + SZ_16M)
|
||||||
|
|
||||||
|
#define SNAPPERCL15_NAND_WPN (1 << 8) /* Write protect (active low) */
|
||||||
|
#define SNAPPERCL15_NAND_ALE (1 << 9) /* Address latch */
|
||||||
|
#define SNAPPERCL15_NAND_CLE (1 << 10) /* Command latch */
|
||||||
|
#define SNAPPERCL15_NAND_CEN (1 << 11) /* Chip enable (active low) */
|
||||||
|
#define SNAPPERCL15_NAND_RDY (1 << 14) /* Device ready */
|
||||||
|
|
||||||
|
#define NAND_CTRL_ADDR(chip) (chip->IO_ADDR_W + 0x40)
|
||||||
|
|
||||||
|
static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
|
||||||
|
unsigned int ctrl)
|
||||||
|
{
|
||||||
|
struct nand_chip *chip = mtd->priv;
|
||||||
|
static u16 nand_state = SNAPPERCL15_NAND_WPN;
|
||||||
|
u16 set;
|
||||||
|
|
||||||
|
if (ctrl & NAND_CTRL_CHANGE) {
|
||||||
|
set = SNAPPERCL15_NAND_CEN | SNAPPERCL15_NAND_WPN;
|
||||||
|
|
||||||
|
if (ctrl & NAND_NCE)
|
||||||
|
set &= ~SNAPPERCL15_NAND_CEN;
|
||||||
|
if (ctrl & NAND_CLE)
|
||||||
|
set |= SNAPPERCL15_NAND_CLE;
|
||||||
|
if (ctrl & NAND_ALE)
|
||||||
|
set |= SNAPPERCL15_NAND_ALE;
|
||||||
|
|
||||||
|
nand_state &= ~(SNAPPERCL15_NAND_CEN |
|
||||||
|
SNAPPERCL15_NAND_CLE |
|
||||||
|
SNAPPERCL15_NAND_ALE);
|
||||||
|
nand_state |= set;
|
||||||
|
__raw_writew(nand_state, NAND_CTRL_ADDR(chip));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmd != NAND_CMD_NONE)
|
||||||
|
__raw_writew((cmd & 0xff) | nand_state, chip->IO_ADDR_W);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int snappercl15_nand_dev_ready(struct mtd_info *mtd)
|
||||||
|
{
|
||||||
|
struct nand_chip *chip = mtd->priv;
|
||||||
|
|
||||||
|
return !!(__raw_readw(NAND_CTRL_ADDR(chip)) & SNAPPERCL15_NAND_RDY);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *snappercl15_nand_part_probes[] = {"cmdlinepart", NULL};
|
||||||
|
|
||||||
|
static struct mtd_partition snappercl15_nand_parts[] = {
|
||||||
|
{
|
||||||
|
.name = "Kernel",
|
||||||
|
.offset = 0,
|
||||||
|
.size = SZ_2M,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "Filesystem",
|
||||||
|
.offset = MTDPART_OFS_APPEND,
|
||||||
|
.size = MTDPART_SIZ_FULL,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_nand_data snappercl15_nand_data = {
|
||||||
|
.chip = {
|
||||||
|
.nr_chips = 1,
|
||||||
|
.part_probe_types = snappercl15_nand_part_probes,
|
||||||
|
.partitions = snappercl15_nand_parts,
|
||||||
|
.nr_partitions = ARRAY_SIZE(snappercl15_nand_parts),
|
||||||
|
.options = NAND_NO_AUTOINCR,
|
||||||
|
.chip_delay = 25,
|
||||||
|
},
|
||||||
|
.ctrl = {
|
||||||
|
.dev_ready = snappercl15_nand_dev_ready,
|
||||||
|
.cmd_ctrl = snappercl15_nand_cmd_ctrl,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct resource snappercl15_nand_resource[] = {
|
||||||
|
{
|
||||||
|
.start = SNAPPERCL15_NAND_BASE,
|
||||||
|
.end = SNAPPERCL15_NAND_BASE + SZ_4K - 1,
|
||||||
|
.flags = IORESOURCE_MEM,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device snappercl15_nand_device = {
|
||||||
|
.name = "gen_nand",
|
||||||
|
.id = -1,
|
||||||
|
.dev.platform_data = &snappercl15_nand_data,
|
||||||
|
.resource = snappercl15_nand_resource,
|
||||||
|
.num_resources = ARRAY_SIZE(snappercl15_nand_resource),
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct ep93xx_eth_data snappercl15_eth_data = {
|
||||||
|
.phy_id = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct i2c_gpio_platform_data snappercl15_i2c_gpio_data = {
|
||||||
|
.sda_pin = EP93XX_GPIO_LINE_EEDAT,
|
||||||
|
.sda_is_open_drain = 0,
|
||||||
|
.scl_pin = EP93XX_GPIO_LINE_EECLK,
|
||||||
|
.scl_is_open_drain = 0,
|
||||||
|
.udelay = 0,
|
||||||
|
.timeout = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct i2c_board_info __initdata snappercl15_i2c_data[] = {
|
||||||
|
{
|
||||||
|
/* Audio codec */
|
||||||
|
I2C_BOARD_INFO("tlv320aic23", 0x1a),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct ep93xxfb_mach_info snappercl15_fb_info = {
|
||||||
|
.num_modes = EP93XXFB_USE_MODEDB,
|
||||||
|
.bpp = 16,
|
||||||
|
};
|
||||||
|
|
||||||
|
static void __init snappercl15_init_machine(void)
|
||||||
|
{
|
||||||
|
ep93xx_init_devices();
|
||||||
|
ep93xx_register_eth(&snappercl15_eth_data, 1);
|
||||||
|
ep93xx_register_i2c(&snappercl15_i2c_gpio_data, snappercl15_i2c_data,
|
||||||
|
ARRAY_SIZE(snappercl15_i2c_data));
|
||||||
|
ep93xx_register_fb(&snappercl15_fb_info);
|
||||||
|
platform_device_register(&snappercl15_nand_device);
|
||||||
|
}
|
||||||
|
|
||||||
|
MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15")
|
||||||
|
/* Maintainer: Ryan Mallon <ryan@bluewatersys.com> */
|
||||||
|
.phys_io = EP93XX_APB_PHYS_BASE,
|
||||||
|
.io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
|
||||||
|
.boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
|
||||||
|
.map_io = ep93xx_map_io,
|
||||||
|
.init_irq = ep93xx_init_irq,
|
||||||
|
.timer = &ep93xx_timer,
|
||||||
|
.init_machine = snappercl15_init_machine,
|
||||||
|
MACHINE_END
|
|
@ -426,6 +426,17 @@ static void __init ixp4xx_clocksource_init(void)
|
||||||
clocksource_register(&clocksource_ixp4xx);
|
clocksource_register(&clocksource_ixp4xx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* sched_clock()
|
||||||
|
*/
|
||||||
|
unsigned long long sched_clock(void)
|
||||||
|
{
|
||||||
|
cycle_t cyc = ixp4xx_get_cycles(NULL);
|
||||||
|
struct clocksource *cs = &clocksource_ixp4xx;
|
||||||
|
|
||||||
|
return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* clockevents
|
* clockevents
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#include <mach/hardware.h>
|
#include <mach/hardware.h>
|
||||||
#include <mach/clocks.h>
|
#include <mach/clocks.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
|
#include <linux/device.h>
|
||||||
|
#include <linux/string.h>
|
||||||
|
|
||||||
struct module;
|
struct module;
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
|
|
||||||
|
|
||||||
static unsigned long ttc_dkb_pin_config[] __initdata = {
|
static unsigned long ttc_dkb_pin_config[] __initdata = {
|
||||||
/* UART2 */
|
/* UART2 */
|
||||||
GPIO47_UART2_RXD,
|
GPIO47_UART2_RXD,
|
||||||
|
|
|
@ -58,21 +58,6 @@ static unsigned int mxt_td60_pins[] __initdata = {
|
||||||
PE9_PF_UART3_RXD,
|
PE9_PF_UART3_RXD,
|
||||||
PE10_PF_UART3_CTS,
|
PE10_PF_UART3_CTS,
|
||||||
PE11_PF_UART3_RTS,
|
PE11_PF_UART3_RTS,
|
||||||
/* UART3 */
|
|
||||||
PB26_AF_UART4_RTS,
|
|
||||||
PB28_AF_UART4_TXD,
|
|
||||||
PB29_AF_UART4_CTS,
|
|
||||||
PB31_AF_UART4_RXD,
|
|
||||||
/* UART4 */
|
|
||||||
PB18_AF_UART5_TXD,
|
|
||||||
PB19_AF_UART5_RXD,
|
|
||||||
PB20_AF_UART5_CTS,
|
|
||||||
PB21_AF_UART5_RTS,
|
|
||||||
/* UART5 */
|
|
||||||
PB10_AF_UART6_TXD,
|
|
||||||
PB12_AF_UART6_CTS,
|
|
||||||
PB11_AF_UART6_RXD,
|
|
||||||
PB13_AF_UART6_RTS,
|
|
||||||
/* FEC */
|
/* FEC */
|
||||||
PD0_AIN_FEC_TXD0,
|
PD0_AIN_FEC_TXD0,
|
||||||
PD1_AIN_FEC_TXD1,
|
PD1_AIN_FEC_TXD1,
|
||||||
|
@ -261,12 +246,6 @@ static struct imxuart_platform_data uart_pdata[] = {
|
||||||
.flags = IMXUART_HAVE_RTSCTS,
|
.flags = IMXUART_HAVE_RTSCTS,
|
||||||
}, {
|
}, {
|
||||||
.flags = IMXUART_HAVE_RTSCTS,
|
.flags = IMXUART_HAVE_RTSCTS,
|
||||||
}, {
|
|
||||||
.flags = IMXUART_HAVE_RTSCTS,
|
|
||||||
}, {
|
|
||||||
.flags = IMXUART_HAVE_RTSCTS,
|
|
||||||
}, {
|
|
||||||
.flags = IMXUART_HAVE_RTSCTS,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -278,9 +257,6 @@ static void __init mxt_td60_board_init(void)
|
||||||
mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
|
mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
|
||||||
mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
|
mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
|
||||||
mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);
|
mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);
|
||||||
mxc_register_device(&mxc_uart_device3, &uart_pdata[3]);
|
|
||||||
mxc_register_device(&mxc_uart_device4, &uart_pdata[4]);
|
|
||||||
mxc_register_device(&mxc_uart_device5, &uart_pdata[5]);
|
|
||||||
mxc_register_device(&mxc_nand_device, &mxt_td60_nand_board_info);
|
mxc_register_device(&mxc_nand_device, &mxt_td60_nand_board_info);
|
||||||
|
|
||||||
i2c_register_board_info(0, mxt_td60_i2c_devices,
|
i2c_register_board_info(0, mxt_td60_i2c_devices,
|
||||||
|
|
|
@ -173,6 +173,7 @@ DEFINE_CLOCK(pwm4_clk, 0, CCM_CGCR2, 2, get_rate_ipg, NULL);
|
||||||
DEFINE_CLOCK(kpp_clk, 0, CCM_CGCR1, 28, get_rate_ipg, NULL);
|
DEFINE_CLOCK(kpp_clk, 0, CCM_CGCR1, 28, get_rate_ipg, NULL);
|
||||||
DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL);
|
DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL);
|
||||||
DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL);
|
DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL);
|
||||||
|
DEFINE_CLOCK(fec_clk, 0, CCM_CGCR0, 23, get_rate_ipg, NULL);
|
||||||
|
|
||||||
#define _REGISTER_CLOCK(d, n, c) \
|
#define _REGISTER_CLOCK(d, n, c) \
|
||||||
{ \
|
{ \
|
||||||
|
@ -204,6 +205,7 @@ static struct clk_lookup lookups[] = {
|
||||||
_REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk)
|
_REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk)
|
||||||
_REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk)
|
_REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk)
|
||||||
_REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk)
|
_REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk)
|
||||||
|
_REGISTER_CLOCK("fec.0", NULL, fec_clk)
|
||||||
};
|
};
|
||||||
|
|
||||||
int __init mx25_clocks_init(unsigned long fref)
|
int __init mx25_clocks_init(unsigned long fref)
|
||||||
|
|
|
@ -419,3 +419,22 @@ int __init mxc_register_gpios(void)
|
||||||
return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));
|
return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct resource mx25_fec_resources[] = {
|
||||||
|
{
|
||||||
|
.start = MX25_FEC_BASE_ADDR,
|
||||||
|
.end = MX25_FEC_BASE_ADDR + 0xfff,
|
||||||
|
.flags = IORESOURCE_MEM,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.start = MX25_INT_FEC,
|
||||||
|
.end = MX25_INT_FEC,
|
||||||
|
.flags = IORESOURCE_IRQ,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
struct platform_device mx25_fec_device = {
|
||||||
|
.name = "fec",
|
||||||
|
.id = 0,
|
||||||
|
.num_resources = ARRAY_SIZE(mx25_fec_resources),
|
||||||
|
.resource = mx25_fec_resources,
|
||||||
|
};
|
||||||
|
|
|
@ -17,3 +17,4 @@ extern struct platform_device mxc_keypad_device;
|
||||||
extern struct platform_device mxc_i2c_device0;
|
extern struct platform_device mxc_i2c_device0;
|
||||||
extern struct platform_device mxc_i2c_device1;
|
extern struct platform_device mxc_i2c_device1;
|
||||||
extern struct platform_device mxc_i2c_device2;
|
extern struct platform_device mxc_i2c_device2;
|
||||||
|
extern struct platform_device mx25_fec_device;
|
||||||
|
|
|
@ -18,10 +18,11 @@
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/irq.h>
|
#include <linux/irq.h>
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <linux/smsc911x.h>
|
#include <linux/fec.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
|
||||||
#include <mach/hardware.h>
|
#include <mach/hardware.h>
|
||||||
|
@ -35,16 +36,57 @@
|
||||||
#include <mach/mx25.h>
|
#include <mach/mx25.h>
|
||||||
#include <mach/mxc_nand.h>
|
#include <mach/mxc_nand.h>
|
||||||
#include "devices.h"
|
#include "devices.h"
|
||||||
#include <mach/iomux-v3.h>
|
#include <mach/iomux.h>
|
||||||
|
|
||||||
static struct imxuart_platform_data uart_pdata = {
|
static struct imxuart_platform_data uart_pdata = {
|
||||||
.flags = IMXUART_HAVE_RTSCTS,
|
.flags = IMXUART_HAVE_RTSCTS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct pad_desc mx25pdk_pads[] = {
|
||||||
|
MX25_PAD_FEC_MDC__FEC_MDC,
|
||||||
|
MX25_PAD_FEC_MDIO__FEC_MDIO,
|
||||||
|
MX25_PAD_FEC_TDATA0__FEC_TDATA0,
|
||||||
|
MX25_PAD_FEC_TDATA1__FEC_TDATA1,
|
||||||
|
MX25_PAD_FEC_TX_EN__FEC_TX_EN,
|
||||||
|
MX25_PAD_FEC_RDATA0__FEC_RDATA0,
|
||||||
|
MX25_PAD_FEC_RDATA1__FEC_RDATA1,
|
||||||
|
MX25_PAD_FEC_RX_DV__FEC_RX_DV,
|
||||||
|
MX25_PAD_FEC_TX_CLK__FEC_TX_CLK,
|
||||||
|
MX25_PAD_A17__GPIO_2_3, /* FEC_EN, GPIO 35 */
|
||||||
|
MX25_PAD_D12__GPIO_4_8, /* FEC_RESET_B, GPIO 104 */
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct fec_platform_data mx25_fec_pdata = {
|
||||||
|
.phy = PHY_INTERFACE_MODE_RMII,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define FEC_ENABLE_GPIO 35
|
||||||
|
#define FEC_RESET_B_GPIO 104
|
||||||
|
|
||||||
|
static void __init mx25pdk_fec_reset(void)
|
||||||
|
{
|
||||||
|
gpio_request(FEC_ENABLE_GPIO, "FEC PHY enable");
|
||||||
|
gpio_request(FEC_RESET_B_GPIO, "FEC PHY reset");
|
||||||
|
|
||||||
|
gpio_direction_output(FEC_ENABLE_GPIO, 0); /* drop PHY power */
|
||||||
|
gpio_direction_output(FEC_RESET_B_GPIO, 0); /* assert reset */
|
||||||
|
udelay(2);
|
||||||
|
|
||||||
|
/* turn on PHY power and lift reset */
|
||||||
|
gpio_set_value(FEC_ENABLE_GPIO, 1);
|
||||||
|
gpio_set_value(FEC_RESET_B_GPIO, 1);
|
||||||
|
}
|
||||||
|
|
||||||
static void __init mx25pdk_init(void)
|
static void __init mx25pdk_init(void)
|
||||||
{
|
{
|
||||||
|
mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
|
||||||
|
ARRAY_SIZE(mx25pdk_pads));
|
||||||
|
|
||||||
mxc_register_device(&mxc_uart_device0, &uart_pdata);
|
mxc_register_device(&mxc_uart_device0, &uart_pdata);
|
||||||
mxc_register_device(&mxc_usbh2, NULL);
|
mxc_register_device(&mxc_usbh2, NULL);
|
||||||
|
|
||||||
|
mx25pdk_fec_reset();
|
||||||
|
mxc_register_device(&mx25_fec_device, &mx25_fec_pdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init mx25pdk_timer_init(void)
|
static void __init mx25pdk_timer_init(void)
|
||||||
|
|
|
@ -49,6 +49,7 @@ config MACH_PCM037_EET
|
||||||
config MACH_MX31LITE
|
config MACH_MX31LITE
|
||||||
bool "Support MX31 LITEKIT (LogicPD)"
|
bool "Support MX31 LITEKIT (LogicPD)"
|
||||||
select ARCH_MX31
|
select ARCH_MX31
|
||||||
|
select MXC_ULPI if USB_ULPI
|
||||||
help
|
help
|
||||||
Include support for MX31 LITEKIT platform. This includes specific
|
Include support for MX31 LITEKIT platform. This includes specific
|
||||||
configurations for the board and its peripherals.
|
configurations for the board and its peripherals.
|
||||||
|
@ -63,7 +64,7 @@ config MACH_MX31_3DS
|
||||||
config MACH_MX31MOBOARD
|
config MACH_MX31MOBOARD
|
||||||
bool "Support mx31moboard platforms (EPFL Mobots group)"
|
bool "Support mx31moboard platforms (EPFL Mobots group)"
|
||||||
select ARCH_MX31
|
select ARCH_MX31
|
||||||
select MXC_ULPI
|
select MXC_ULPI if USB_ULPI
|
||||||
help
|
help
|
||||||
Include support for mx31moboard platform. This includes specific
|
Include support for mx31moboard platform. This includes specific
|
||||||
configurations for the board and its peripherals.
|
configurations for the board and its peripherals.
|
||||||
|
|
|
@ -65,6 +65,11 @@ static struct map_desc mxc_io_desc[] __initdata = {
|
||||||
.pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
|
.pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
|
||||||
.length = AIPS2_SIZE,
|
.length = AIPS2_SIZE,
|
||||||
.type = MT_DEVICE_NONSHARED
|
.type = MT_DEVICE_NONSHARED
|
||||||
|
}, {
|
||||||
|
.virtual = SPBA0_BASE_ADDR_VIRT,
|
||||||
|
.pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
|
||||||
|
.length = SPBA0_SIZE,
|
||||||
|
.type = MT_DEVICE_NONSHARED
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -494,11 +494,6 @@ static void mxc_init_i2c(void)
|
||||||
*/
|
*/
|
||||||
static struct map_desc mx31ads_io_desc[] __initdata = {
|
static struct map_desc mx31ads_io_desc[] __initdata = {
|
||||||
{
|
{
|
||||||
.virtual = SPBA0_BASE_ADDR_VIRT,
|
|
||||||
.pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
|
|
||||||
.length = SPBA0_SIZE,
|
|
||||||
.type = MT_DEVICE_NONSHARED
|
|
||||||
}, {
|
|
||||||
.virtual = CS4_BASE_ADDR_VIRT,
|
.virtual = CS4_BASE_ADDR_VIRT,
|
||||||
.pfn = __phys_to_pfn(CS4_BASE_ADDR),
|
.pfn = __phys_to_pfn(CS4_BASE_ADDR),
|
||||||
.length = CS4_SIZE / 2,
|
.length = CS4_SIZE / 2,
|
||||||
|
|
|
@ -135,6 +135,7 @@ static struct spi_board_info mc13783_spi_dev __initdata = {
|
||||||
* USB
|
* USB
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(CONFIG_USB_ULPI)
|
||||||
#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
|
#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
|
||||||
PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
|
PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
|
||||||
|
|
||||||
|
@ -180,6 +181,7 @@ static struct mxc_usbh_platform_data usbh2_pdata = {
|
||||||
.portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
|
.portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
|
||||||
.flags = MXC_EHCI_POWER_PINS_ENABLED,
|
.flags = MXC_EHCI_POWER_PINS_ENABLED,
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOR flash
|
* NOR flash
|
||||||
|
@ -212,11 +214,6 @@ static struct platform_device physmap_flash_device = {
|
||||||
*/
|
*/
|
||||||
static struct map_desc mx31lite_io_desc[] __initdata = {
|
static struct map_desc mx31lite_io_desc[] __initdata = {
|
||||||
{
|
{
|
||||||
.virtual = SPBA0_BASE_ADDR_VIRT,
|
|
||||||
.pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
|
|
||||||
.length = SPBA0_SIZE,
|
|
||||||
.type = MT_DEVICE_NONSHARED
|
|
||||||
}, {
|
|
||||||
.virtual = CS4_BASE_ADDR_VIRT,
|
.virtual = CS4_BASE_ADDR_VIRT,
|
||||||
.pfn = __phys_to_pfn(CS4_BASE_ADDR),
|
.pfn = __phys_to_pfn(CS4_BASE_ADDR),
|
||||||
.length = CS4_SIZE,
|
.length = CS4_SIZE,
|
||||||
|
@ -261,11 +258,13 @@ static void __init mxc_board_init(void)
|
||||||
mxc_register_device(&mxc_spi_device1, &spi1_pdata);
|
mxc_register_device(&mxc_spi_device1, &spi1_pdata);
|
||||||
spi_register_board_info(&mc13783_spi_dev, 1);
|
spi_register_board_info(&mc13783_spi_dev, 1);
|
||||||
|
|
||||||
|
#if defined(CONFIG_USB_ULPI)
|
||||||
/* USB */
|
/* USB */
|
||||||
usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
|
usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
|
||||||
USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
|
USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
|
||||||
|
|
||||||
mxc_register_device(&mxc_usbh2, &usbh2_pdata);
|
mxc_register_device(&mxc_usbh2, &usbh2_pdata);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* SMSC9117 IRQ pin */
|
/* SMSC9117 IRQ pin */
|
||||||
ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq");
|
ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq");
|
||||||
|
|
|
@ -179,7 +179,7 @@ static int __init devboard_usbh1_init(void)
|
||||||
|
|
||||||
usbh1_pdata.otg = otg;
|
usbh1_pdata.otg = otg;
|
||||||
|
|
||||||
return mxc_register_device(&mx31_usbh1, &usbh1_pdata);
|
return mxc_register_device(&mxc_usbh1, &usbh1_pdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -294,7 +294,7 @@ static int __init marxbot_usbh1_init(void)
|
||||||
|
|
||||||
usbh1_pdata.otg = otg;
|
usbh1_pdata.otg = otg;
|
||||||
|
|
||||||
return mxc_register_device(&mx31_usbh1, &usbh1_pdata);
|
return mxc_register_device(&mxc_usbh1, &usbh1_pdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -346,6 +346,8 @@ static struct fsl_usb2_platform_data usb_pdata = {
|
||||||
.phy_mode = FSL_USB2_PHY_ULPI,
|
.phy_mode = FSL_USB2_PHY_ULPI,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(CONFIG_USB_ULPI)
|
||||||
|
|
||||||
#define USBH2_EN_B IOMUX_TO_GPIO(MX31_PIN_SCK6)
|
#define USBH2_EN_B IOMUX_TO_GPIO(MX31_PIN_SCK6)
|
||||||
|
|
||||||
static int moboard_usbh2_hw_init(struct platform_device *pdev)
|
static int moboard_usbh2_hw_init(struct platform_device *pdev)
|
||||||
|
@ -392,8 +394,11 @@ static int __init moboard_usbh2_init(void)
|
||||||
usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
|
usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
|
||||||
USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
|
USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
|
||||||
|
|
||||||
return mxc_register_device(&mx31_usbh2, &usbh2_pdata);
|
return mxc_register_device(&mxc_usbh2, &usbh2_pdata);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static inline int moboard_usbh2_init(void) { return 0; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static struct gpio_led mx31moboard_leds[] = {
|
static struct gpio_led mx31moboard_leds[] = {
|
||||||
|
|
|
@ -211,11 +211,6 @@ static int __init mx31pdk_init_expio(void)
|
||||||
*/
|
*/
|
||||||
static struct map_desc mx31pdk_io_desc[] __initdata = {
|
static struct map_desc mx31pdk_io_desc[] __initdata = {
|
||||||
{
|
{
|
||||||
.virtual = SPBA0_BASE_ADDR_VIRT,
|
|
||||||
.pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
|
|
||||||
.length = SPBA0_SIZE,
|
|
||||||
.type = MT_DEVICE_NONSHARED,
|
|
||||||
}, {
|
|
||||||
.virtual = CS5_BASE_ADDR_VIRT,
|
.virtual = CS5_BASE_ADDR_VIRT,
|
||||||
.pfn = __phys_to_pfn(CS5_BASE_ADDR),
|
.pfn = __phys_to_pfn(CS5_BASE_ADDR),
|
||||||
.length = CS5_SIZE,
|
.length = CS5_SIZE,
|
||||||
|
|
|
@ -322,16 +322,25 @@ static int pcm037_camera_power(struct device *dev, int on)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct i2c_board_info pcm037_i2c_2_devices[] = {
|
static struct i2c_board_info pcm037_i2c_camera[] = {
|
||||||
{
|
{
|
||||||
I2C_BOARD_INFO("mt9t031", 0x5d),
|
I2C_BOARD_INFO("mt9t031", 0x5d),
|
||||||
|
}, {
|
||||||
|
I2C_BOARD_INFO("mt9v022", 0x48),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct soc_camera_link iclink = {
|
static struct soc_camera_link iclink_mt9v022 = {
|
||||||
|
.bus_id = 0, /* Must match with the camera ID */
|
||||||
|
.board_info = &pcm037_i2c_camera[1],
|
||||||
|
.i2c_adapter_id = 2,
|
||||||
|
.module_name = "mt9v022",
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct soc_camera_link iclink_mt9t031 = {
|
||||||
.bus_id = 0, /* Must match with the camera ID */
|
.bus_id = 0, /* Must match with the camera ID */
|
||||||
.power = pcm037_camera_power,
|
.power = pcm037_camera_power,
|
||||||
.board_info = &pcm037_i2c_2_devices[0],
|
.board_info = &pcm037_i2c_camera[0],
|
||||||
.i2c_adapter_id = 2,
|
.i2c_adapter_id = 2,
|
||||||
.module_name = "mt9t031",
|
.module_name = "mt9t031",
|
||||||
};
|
};
|
||||||
|
@ -345,11 +354,19 @@ static struct i2c_board_info pcm037_i2c_devices[] = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_device pcm037_camera = {
|
static struct platform_device pcm037_mt9t031 = {
|
||||||
.name = "soc-camera-pdrv",
|
.name = "soc-camera-pdrv",
|
||||||
.id = 0,
|
.id = 0,
|
||||||
.dev = {
|
.dev = {
|
||||||
.platform_data = &iclink,
|
.platform_data = &iclink_mt9t031,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device pcm037_mt9v022 = {
|
||||||
|
.name = "soc-camera-pdrv",
|
||||||
|
.id = 1,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = &iclink_mt9v022,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -449,7 +466,8 @@ static int __init pcm037_camera_alloc_dma(const size_t buf_size)
|
||||||
static struct platform_device *devices[] __initdata = {
|
static struct platform_device *devices[] __initdata = {
|
||||||
&pcm037_flash,
|
&pcm037_flash,
|
||||||
&pcm037_sram_device,
|
&pcm037_sram_device,
|
||||||
&pcm037_camera,
|
&pcm037_mt9t031,
|
||||||
|
&pcm037_mt9v022,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ipu_platform_data mx3_ipu_data = {
|
static struct ipu_platform_data mx3_ipu_data = {
|
||||||
|
@ -599,7 +617,7 @@ static void __init mxc_board_init(void)
|
||||||
if (!ret)
|
if (!ret)
|
||||||
gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1);
|
gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1);
|
||||||
else
|
else
|
||||||
iclink.power = NULL;
|
iclink_mt9t031.power = NULL;
|
||||||
|
|
||||||
if (!pcm037_camera_alloc_dma(4 * 1024 * 1024))
|
if (!pcm037_camera_alloc_dma(4 * 1024 * 1024))
|
||||||
mxc_register_device(&mx3_camera, &camera_pdata);
|
mxc_register_device(&mx3_camera, &camera_pdata);
|
||||||
|
|
19
arch/arm/mach-nuc93x/Kconfig
Normal file
19
arch/arm/mach-nuc93x/Kconfig
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
if ARCH_NUC93X
|
||||||
|
|
||||||
|
config CPU_NUC932
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Support for NUC932 of Nuvoton NUC93X CPUs.
|
||||||
|
|
||||||
|
menu "NUC932 Machines"
|
||||||
|
|
||||||
|
config MACH_NUC932EVB
|
||||||
|
bool "Nuvoton NUC932 Evaluation Board"
|
||||||
|
default y
|
||||||
|
select CPU_NUC932
|
||||||
|
help
|
||||||
|
Say Y here if you are using the Nuvoton NUC932EVB
|
||||||
|
|
||||||
|
endmenu
|
||||||
|
|
||||||
|
endif
|
14
arch/arm/mach-nuc93x/Makefile
Normal file
14
arch/arm/mach-nuc93x/Makefile
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#
|
||||||
|
# Makefile for the linux kernel.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Object file lists.
|
||||||
|
|
||||||
|
obj-y := irq.o time.o dev.o cpu.o clock.o
|
||||||
|
# NUC932 CPU support files
|
||||||
|
|
||||||
|
obj-$(CONFIG_CPU_NUC932) += nuc932.o
|
||||||
|
|
||||||
|
# machine support
|
||||||
|
|
||||||
|
obj-$(CONFIG_MACH_NUC932EVB) += mach-nuc932evb.o
|
3
arch/arm/mach-nuc93x/Makefile.boot
Normal file
3
arch/arm/mach-nuc93x/Makefile.boot
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
zreladdr-y := 0x00008000
|
||||||
|
params_phys-y := 0x00000100
|
||||||
|
|
83
arch/arm/mach-nuc93x/clock.c
Normal file
83
arch/arm/mach-nuc93x/clock.c
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
/*
|
||||||
|
* linux/arch/arm/mach-nuc93x/clock.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/list.h>
|
||||||
|
#include <linux/errno.h>
|
||||||
|
#include <linux/err.h>
|
||||||
|
#include <linux/string.h>
|
||||||
|
#include <linux/clk.h>
|
||||||
|
#include <linux/spinlock.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
|
||||||
|
#include <mach/hardware.h>
|
||||||
|
|
||||||
|
#include "clock.h"
|
||||||
|
|
||||||
|
static DEFINE_SPINLOCK(clocks_lock);
|
||||||
|
|
||||||
|
int clk_enable(struct clk *clk)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&clocks_lock, flags);
|
||||||
|
if (clk->enabled++ == 0)
|
||||||
|
(clk->enable)(clk, 1);
|
||||||
|
spin_unlock_irqrestore(&clocks_lock, flags);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(clk_enable);
|
||||||
|
|
||||||
|
void clk_disable(struct clk *clk)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
WARN_ON(clk->enabled == 0);
|
||||||
|
|
||||||
|
spin_lock_irqsave(&clocks_lock, flags);
|
||||||
|
if (--clk->enabled == 0)
|
||||||
|
(clk->enable)(clk, 0);
|
||||||
|
spin_unlock_irqrestore(&clocks_lock, flags);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(clk_disable);
|
||||||
|
|
||||||
|
unsigned long clk_get_rate(struct clk *clk)
|
||||||
|
{
|
||||||
|
return 27000000;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(clk_get_rate);
|
||||||
|
|
||||||
|
void nuc93x_clk_enable(struct clk *clk, int enable)
|
||||||
|
{
|
||||||
|
unsigned int clocks = clk->cken;
|
||||||
|
unsigned long clken;
|
||||||
|
|
||||||
|
clken = __raw_readl(NUC93X_VA_CLKPWR);
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
clken |= clocks;
|
||||||
|
else
|
||||||
|
clken &= ~clocks;
|
||||||
|
|
||||||
|
__raw_writel(clken, NUC93X_VA_CLKPWR);
|
||||||
|
}
|
||||||
|
|
||||||
|
void clks_register(struct clk_lookup *clks, size_t num)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < num; i++)
|
||||||
|
clkdev_add(&clks[i]);
|
||||||
|
}
|
36
arch/arm/mach-nuc93x/clock.h
Normal file
36
arch/arm/mach-nuc93x/clock.h
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
* linux/arch/arm/mach-nuc93x/clock.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <asm/clkdev.h>
|
||||||
|
|
||||||
|
void nuc93x_clk_enable(struct clk *clk, int enable);
|
||||||
|
void clks_register(struct clk_lookup *clks, size_t num);
|
||||||
|
|
||||||
|
struct clk {
|
||||||
|
unsigned long cken;
|
||||||
|
unsigned int enabled;
|
||||||
|
void (*enable)(struct clk *, int enable);
|
||||||
|
};
|
||||||
|
|
||||||
|
#define DEFINE_CLK(_name, _ctrlbit) \
|
||||||
|
struct clk clk_##_name = { \
|
||||||
|
.enable = nuc93x_clk_enable, \
|
||||||
|
.cken = (1 << _ctrlbit), \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define DEF_CLKLOOK(_clk, _devname, _conname) \
|
||||||
|
{ \
|
||||||
|
.clk = _clk, \
|
||||||
|
.dev_id = _devname, \
|
||||||
|
.con_id = _conname, \
|
||||||
|
}
|
||||||
|
|
135
arch/arm/mach-nuc93x/cpu.c
Normal file
135
arch/arm/mach-nuc93x/cpu.c
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
/*
|
||||||
|
* linux/arch/arm/mach-nuc93x/cpu.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009 Nuvoton corporation.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.com>
|
||||||
|
*
|
||||||
|
* NUC93x series cpu common support
|
||||||
|
*
|
||||||
|
* 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;version 2 of the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/list.h>
|
||||||
|
#include <linux/timer.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
#include <linux/serial_8250.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
|
|
||||||
|
#include <asm/mach/arch.h>
|
||||||
|
#include <asm/mach/map.h>
|
||||||
|
#include <asm/mach/irq.h>
|
||||||
|
#include <asm/irq.h>
|
||||||
|
|
||||||
|
#include <mach/hardware.h>
|
||||||
|
#include <mach/regs-serial.h>
|
||||||
|
#include <mach/regs-clock.h>
|
||||||
|
#include <mach/regs-ebi.h>
|
||||||
|
|
||||||
|
#include "cpu.h"
|
||||||
|
#include "clock.h"
|
||||||
|
|
||||||
|
/* Initial IO mappings */
|
||||||
|
|
||||||
|
static struct map_desc nuc93x_iodesc[] __initdata = {
|
||||||
|
IODESC_ENT(IRQ),
|
||||||
|
IODESC_ENT(GCR),
|
||||||
|
IODESC_ENT(UART),
|
||||||
|
IODESC_ENT(TIMER),
|
||||||
|
IODESC_ENT(EBI),
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Initial nuc932 clock declarations. */
|
||||||
|
static DEFINE_CLK(audio, 2);
|
||||||
|
static DEFINE_CLK(sd, 3);
|
||||||
|
static DEFINE_CLK(jpg, 4);
|
||||||
|
static DEFINE_CLK(video, 5);
|
||||||
|
static DEFINE_CLK(vpost, 6);
|
||||||
|
static DEFINE_CLK(2d, 7);
|
||||||
|
static DEFINE_CLK(gpu, 8);
|
||||||
|
static DEFINE_CLK(gdma, 9);
|
||||||
|
static DEFINE_CLK(adc, 10);
|
||||||
|
static DEFINE_CLK(uart, 11);
|
||||||
|
static DEFINE_CLK(spi, 12);
|
||||||
|
static DEFINE_CLK(pwm, 13);
|
||||||
|
static DEFINE_CLK(timer, 14);
|
||||||
|
static DEFINE_CLK(wdt, 15);
|
||||||
|
static DEFINE_CLK(ac97, 16);
|
||||||
|
static DEFINE_CLK(i2s, 16);
|
||||||
|
static DEFINE_CLK(usbck, 17);
|
||||||
|
static DEFINE_CLK(usb48, 18);
|
||||||
|
static DEFINE_CLK(usbh, 19);
|
||||||
|
static DEFINE_CLK(i2c, 20);
|
||||||
|
static DEFINE_CLK(ext, 0);
|
||||||
|
|
||||||
|
static struct clk_lookup nuc932_clkregs[] = {
|
||||||
|
DEF_CLKLOOK(&clk_audio, "nuc932-audio", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_sd, "nuc932-sd", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_jpg, "nuc932-jpg", "NULL"),
|
||||||
|
DEF_CLKLOOK(&clk_video, "nuc932-video", "NULL"),
|
||||||
|
DEF_CLKLOOK(&clk_vpost, "nuc932-vpost", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_2d, "nuc932-2d", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_gpu, "nuc932-gpu", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_gdma, "nuc932-gdma", "NULL"),
|
||||||
|
DEF_CLKLOOK(&clk_adc, "nuc932-adc", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_uart, NULL, "uart"),
|
||||||
|
DEF_CLKLOOK(&clk_spi, "nuc932-spi", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_pwm, "nuc932-pwm", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_timer, NULL, "timer"),
|
||||||
|
DEF_CLKLOOK(&clk_wdt, "nuc932-wdt", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_ac97, "nuc932-ac97", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_i2s, "nuc932-i2s", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_usbck, "nuc932-usbck", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_usb48, "nuc932-usb48", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_usbh, "nuc932-usbh", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_i2c, "nuc932-i2c", NULL),
|
||||||
|
DEF_CLKLOOK(&clk_ext, NULL, "ext"),
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Initial serial platform data */
|
||||||
|
|
||||||
|
struct plat_serial8250_port nuc93x_uart_data[] = {
|
||||||
|
NUC93X_8250PORT(UART0),
|
||||||
|
{},
|
||||||
|
};
|
||||||
|
|
||||||
|
struct platform_device nuc93x_serial_device = {
|
||||||
|
.name = "serial8250",
|
||||||
|
.id = PLAT8250_DEV_PLATFORM,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = nuc93x_uart_data,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/*Init NUC93x evb io*/
|
||||||
|
|
||||||
|
void __init nuc93x_map_io(struct map_desc *mach_desc, int mach_size)
|
||||||
|
{
|
||||||
|
unsigned long idcode = 0x0;
|
||||||
|
|
||||||
|
iotable_init(mach_desc, mach_size);
|
||||||
|
iotable_init(nuc93x_iodesc, ARRAY_SIZE(nuc93x_iodesc));
|
||||||
|
|
||||||
|
idcode = __raw_readl(NUC93XPDID);
|
||||||
|
if (idcode == NUC932_CPUID)
|
||||||
|
printk(KERN_INFO "CPU type 0x%08lx is NUC910\n", idcode);
|
||||||
|
else
|
||||||
|
printk(KERN_ERR "CPU type detect error!\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Init NUC93x clock*/
|
||||||
|
|
||||||
|
void __init nuc93x_init_clocks(void)
|
||||||
|
{
|
||||||
|
clks_register(nuc932_clkregs, ARRAY_SIZE(nuc932_clkregs));
|
||||||
|
}
|
||||||
|
|
48
arch/arm/mach-nuc93x/cpu.h
Normal file
48
arch/arm/mach-nuc93x/cpu.h
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/cpu.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Header file for NUC93X CPU support
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.com>
|
||||||
|
*
|
||||||
|
* 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 IODESC_ENT(y) \
|
||||||
|
{ \
|
||||||
|
.virtual = (unsigned long)NUC93X_VA_##y, \
|
||||||
|
.pfn = __phys_to_pfn(NUC93X_PA_##y), \
|
||||||
|
.length = NUC93X_SZ_##y, \
|
||||||
|
.type = MT_DEVICE, \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define NUC93X_8250PORT(name) \
|
||||||
|
{ \
|
||||||
|
.membase = name##_BA, \
|
||||||
|
.mapbase = name##_PA, \
|
||||||
|
.irq = IRQ_##name, \
|
||||||
|
.uartclk = 57139200, \
|
||||||
|
.regshift = 2, \
|
||||||
|
.iotype = UPIO_MEM, \
|
||||||
|
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Cpu identifier register*/
|
||||||
|
|
||||||
|
#define NUC93XPDID NUC93X_VA_GCR
|
||||||
|
#define NUC932_CPUID 0x29550091
|
||||||
|
|
||||||
|
/* extern file from cpu.c */
|
||||||
|
|
||||||
|
extern void nuc93x_clock_source(struct device *dev, unsigned char *src);
|
||||||
|
extern void nuc93x_init_clocks(void);
|
||||||
|
extern void nuc93x_map_io(struct map_desc *mach_desc, int mach_size);
|
||||||
|
extern void nuc93x_board_init(struct platform_device **device, int size);
|
||||||
|
extern struct platform_device nuc93x_serial_device;
|
||||||
|
|
42
arch/arm/mach-nuc93x/dev.c
Normal file
42
arch/arm/mach-nuc93x/dev.c
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* linux/arch/arm/mach-nuc93x/dev.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2009 Nuvoton corporation.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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;version 2 of the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/list.h>
|
||||||
|
#include <linux/timer.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
|
||||||
|
#include <asm/mach/arch.h>
|
||||||
|
#include <asm/mach/map.h>
|
||||||
|
#include <asm/mach/irq.h>
|
||||||
|
#include <asm/mach-types.h>
|
||||||
|
|
||||||
|
#include "cpu.h"
|
||||||
|
|
||||||
|
/*Here should be your evb resourse,such as LCD*/
|
||||||
|
|
||||||
|
static struct platform_device *nuc93x_public_dev[] __initdata = {
|
||||||
|
&nuc93x_serial_device,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Provide adding specific CPU platform devices API */
|
||||||
|
|
||||||
|
void __init nuc93x_board_init(struct platform_device **device, int size)
|
||||||
|
{
|
||||||
|
platform_add_devices(device, size);
|
||||||
|
platform_add_devices(nuc93x_public_dev, ARRAY_SIZE(nuc93x_public_dev));
|
||||||
|
}
|
||||||
|
|
7
arch/arm/mach-nuc93x/include/mach/clkdev.h
Normal file
7
arch/arm/mach-nuc93x/include/mach/clkdev.h
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef __ASM_MACH_CLKDEV_H
|
||||||
|
#define __ASM_MACH_CLKDEV_H
|
||||||
|
|
||||||
|
#define __clk_get(clk) ({ 1; })
|
||||||
|
#define __clk_put(clk) do { } while (0)
|
||||||
|
|
||||||
|
#endif
|
32
arch/arm/mach-nuc93x/include/mach/entry-macro.S
Normal file
32
arch/arm/mach-nuc93x/include/mach/entry-macro.S
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/entry-macro.S
|
||||||
|
*
|
||||||
|
* This file is licensed under the terms of the GNU General Public
|
||||||
|
* License version 2. This program is licensed "as is" without any
|
||||||
|
* warranty of any kind, whether express or implied.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <mach/hardware.h>
|
||||||
|
#include <mach/regs-irq.h>
|
||||||
|
|
||||||
|
.macro get_irqnr_preamble, base, tmp
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro arch_ret_to_user, tmp1, tmp2
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp
|
||||||
|
|
||||||
|
mov \base, #AIC_BA
|
||||||
|
|
||||||
|
ldr \irqnr, [ \base, #AIC_IPER]
|
||||||
|
ldr \irqnr, [ \base, #AIC_ISNR]
|
||||||
|
cmp \irqnr, #0
|
||||||
|
|
||||||
|
.endm
|
||||||
|
|
||||||
|
/* currently don't need an disable_fiq macro */
|
||||||
|
|
||||||
|
.macro disable_fiq
|
||||||
|
.endm
|
22
arch/arm/mach-nuc93x/include/mach/hardware.h
Normal file
22
arch/arm/mach-nuc93x/include/mach/hardware.h
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/hardware.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_HARDWARE_H
|
||||||
|
#define __ASM_ARCH_HARDWARE_H
|
||||||
|
|
||||||
|
#include <asm/sizes.h>
|
||||||
|
#include <mach/map.h>
|
||||||
|
|
||||||
|
#endif /* __ASM_ARCH_HARDWARE_H */
|
28
arch/arm/mach-nuc93x/include/mach/io.h
Normal file
28
arch/arm/mach-nuc93x/include/mach/io.h
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/io.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARM_ARCH_IO_H
|
||||||
|
#define __ASM_ARM_ARCH_IO_H
|
||||||
|
|
||||||
|
#define IO_SPACE_LIMIT 0xffffffff
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1:1 mapping for ioremapped regions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define __mem_pci(a) (a)
|
||||||
|
#define __io(a) __typesafe_io(a)
|
||||||
|
|
||||||
|
#endif
|
59
arch/arm/mach-nuc93x/include/mach/irqs.h
Normal file
59
arch/arm/mach-nuc93x/include/mach/irqs.h
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/irqs.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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;version 2 of the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_IRQS_H
|
||||||
|
#define __ASM_ARCH_IRQS_H
|
||||||
|
|
||||||
|
#define NUC93X_IRQ(x) (x)
|
||||||
|
|
||||||
|
/* Main cpu interrupts */
|
||||||
|
|
||||||
|
#define IRQ_WDT NUC93X_IRQ(1)
|
||||||
|
#define IRQ_IRQ0 NUC93X_IRQ(2)
|
||||||
|
#define IRQ_IRQ1 NUC93X_IRQ(3)
|
||||||
|
#define IRQ_IRQ2 NUC93X_IRQ(4)
|
||||||
|
#define IRQ_IRQ3 NUC93X_IRQ(5)
|
||||||
|
#define IRQ_USBH NUC93X_IRQ(6)
|
||||||
|
#define IRQ_APU NUC93X_IRQ(7)
|
||||||
|
#define IRQ_VPOST NUC93X_IRQ(8)
|
||||||
|
#define IRQ_ADC NUC93X_IRQ(9)
|
||||||
|
#define IRQ_UART0 NUC93X_IRQ(10)
|
||||||
|
#define IRQ_TIMER0 NUC93X_IRQ(11)
|
||||||
|
#define IRQ_GPU0 NUC93X_IRQ(12)
|
||||||
|
#define IRQ_GPU1 NUC93X_IRQ(13)
|
||||||
|
#define IRQ_GPU2 NUC93X_IRQ(14)
|
||||||
|
#define IRQ_GPU3 NUC93X_IRQ(15)
|
||||||
|
#define IRQ_GPU4 NUC93X_IRQ(16)
|
||||||
|
#define IRQ_VIN NUC93X_IRQ(17)
|
||||||
|
#define IRQ_USBD NUC93X_IRQ(18)
|
||||||
|
#define IRQ_VRAMLD NUC93X_IRQ(19)
|
||||||
|
#define IRQ_GDMA0 NUC93X_IRQ(20)
|
||||||
|
#define IRQ_GDMA1 NUC93X_IRQ(21)
|
||||||
|
#define IRQ_SDIO NUC93X_IRQ(22)
|
||||||
|
#define IRQ_FMI NUC93X_IRQ(22)
|
||||||
|
#define IRQ_JPEG NUC93X_IRQ(23)
|
||||||
|
#define IRQ_SPI0 NUC93X_IRQ(24)
|
||||||
|
#define IRQ_SPI1 NUC93X_IRQ(25)
|
||||||
|
#define IRQ_RTC NUC93X_IRQ(26)
|
||||||
|
#define IRQ_PWM0 NUC93X_IRQ(27)
|
||||||
|
#define IRQ_PWM1 NUC93X_IRQ(28)
|
||||||
|
#define IRQ_PWM2 NUC93X_IRQ(29)
|
||||||
|
#define IRQ_PWM3 NUC93X_IRQ(30)
|
||||||
|
#define IRQ_I2SAC97 NUC93X_IRQ(31)
|
||||||
|
#define IRQ_CAP0 IRQ_PWM0
|
||||||
|
#define IRQ_CAP1 IRQ_PWM1
|
||||||
|
#define IRQ_CAP2 IRQ_PWM2
|
||||||
|
#define IRQ_CAP3 IRQ_PWM3
|
||||||
|
#define NR_IRQS (IRQ_I2SAC97 + 1)
|
||||||
|
|
||||||
|
#endif /* __ASM_ARCH_IRQ_H */
|
139
arch/arm/mach-nuc93x/include/mach/map.h
Normal file
139
arch/arm/mach-nuc93x/include/mach/map.h
Normal file
|
@ -0,0 +1,139 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/map.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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;version 2 of the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_MAP_H
|
||||||
|
#define __ASM_ARCH_MAP_H
|
||||||
|
|
||||||
|
#define MAP_OFFSET (0xfff00000)
|
||||||
|
#define CLK_OFFSET (0x10)
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
|
#define NUC93X_ADDR(x) ((void __iomem *)(0xF0000000 + ((x)&(~MAP_OFFSET))))
|
||||||
|
#else
|
||||||
|
#define NUC93X_ADDR(x) (0xF0000000 + ((x)&(~MAP_OFFSET)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nuc932 hardware register definition
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define NUC93X_PA_IRQ (0xFFF83000)
|
||||||
|
#define NUC93X_PA_GCR (0xFFF00000)
|
||||||
|
#define NUC93X_PA_EBI (0xFFF01000)
|
||||||
|
#define NUC93X_PA_UART (0xFFF80000)
|
||||||
|
#define NUC93X_PA_TIMER (0xFFF81000)
|
||||||
|
#define NUC93X_PA_GPIO (0xFFF84000)
|
||||||
|
#define NUC93X_PA_GDMA (0xFFF03000)
|
||||||
|
#define NUC93X_PA_USBHOST (0xFFF0d000)
|
||||||
|
#define NUC93X_PA_I2C (0xFFF89000)
|
||||||
|
#define NUC93X_PA_LCD (0xFFF06000)
|
||||||
|
#define NUC93X_PA_GE (0xFFF05000)
|
||||||
|
#define NUC93X_PA_ADC (0xFFF85000)
|
||||||
|
#define NUC93X_PA_RTC (0xFFF87000)
|
||||||
|
#define NUC93X_PA_PWM (0xFFF82000)
|
||||||
|
#define NUC93X_PA_ACTL (0xFFF0a000)
|
||||||
|
#define NUC93X_PA_USBDEV (0xFFF0C000)
|
||||||
|
#define NUC93X_PA_JEPEG (0xFFF0e000)
|
||||||
|
#define NUC93X_PA_CACHE_T (0xFFF60000)
|
||||||
|
#define NUC93X_PA_VRAM (0xFFF0b000)
|
||||||
|
#define NUC93X_PA_DMAC (0xFFF09000)
|
||||||
|
#define NUC93X_PA_I2SM (0xFFF08000)
|
||||||
|
#define NUC93X_PA_CACHE (0xFFF02000)
|
||||||
|
#define NUC93X_PA_GPU (0xFFF04000)
|
||||||
|
#define NUC93X_PA_VIDEOIN (0xFFF07000)
|
||||||
|
#define NUC93X_PA_SPI0 (0xFFF86000)
|
||||||
|
#define NUC93X_PA_SPI1 (0xFFF88000)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* nuc932 virtual address mapping.
|
||||||
|
* interrupt controller is the first thing we put in, to make
|
||||||
|
* the assembly code for the irq detection easier
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define NUC93X_VA_IRQ NUC93X_ADDR(0x00000000)
|
||||||
|
#define NUC93X_SZ_IRQ SZ_4K
|
||||||
|
|
||||||
|
#define NUC93X_VA_GCR NUC93X_ADDR(NUC93X_PA_IRQ)
|
||||||
|
#define NUC93X_VA_CLKPWR (NUC93X_VA_GCR+CLK_OFFSET)
|
||||||
|
#define NUC93X_SZ_GCR SZ_4K
|
||||||
|
|
||||||
|
/* EBI management */
|
||||||
|
|
||||||
|
#define NUC93X_VA_EBI NUC93X_ADDR(NUC93X_PA_EBI)
|
||||||
|
#define NUC93X_SZ_EBI SZ_4K
|
||||||
|
|
||||||
|
/* UARTs */
|
||||||
|
|
||||||
|
#define NUC93X_VA_UART NUC93X_ADDR(NUC93X_PA_UART)
|
||||||
|
#define NUC93X_SZ_UART SZ_4K
|
||||||
|
|
||||||
|
/* Timers */
|
||||||
|
|
||||||
|
#define NUC93X_VA_TIMER NUC93X_ADDR(NUC93X_PA_TIMER)
|
||||||
|
#define NUC93X_SZ_TIMER SZ_4K
|
||||||
|
|
||||||
|
/* GPIO ports */
|
||||||
|
|
||||||
|
#define NUC93X_VA_GPIO NUC93X_ADDR(NUC93X_PA_GPIO)
|
||||||
|
#define NUC93X_SZ_GPIO SZ_4K
|
||||||
|
|
||||||
|
/* GDMA control */
|
||||||
|
|
||||||
|
#define NUC93X_VA_GDMA NUC93X_ADDR(NUC93X_PA_GDMA)
|
||||||
|
#define NUC93X_SZ_GDMA SZ_4K
|
||||||
|
|
||||||
|
/* I2C hardware controller */
|
||||||
|
|
||||||
|
#define NUC93X_VA_I2C NUC93X_ADDR(NUC93X_PA_I2C)
|
||||||
|
#define NUC93X_SZ_I2C SZ_4K
|
||||||
|
|
||||||
|
/* LCD controller*/
|
||||||
|
|
||||||
|
#define NUC93X_VA_LCD NUC93X_ADDR(NUC93X_PA_LCD)
|
||||||
|
#define NUC93X_SZ_LCD SZ_4K
|
||||||
|
|
||||||
|
/* 2D controller*/
|
||||||
|
|
||||||
|
#define NUC93X_VA_GE NUC93X_ADDR(NUC93X_PA_GE)
|
||||||
|
#define NUC93X_SZ_GE SZ_4K
|
||||||
|
|
||||||
|
/* ADC */
|
||||||
|
|
||||||
|
#define NUC93X_VA_ADC NUC93X_ADDR(NUC93X_PA_ADC)
|
||||||
|
#define NUC93X_SZ_ADC SZ_4K
|
||||||
|
|
||||||
|
/* RTC */
|
||||||
|
|
||||||
|
#define NUC93X_VA_RTC NUC93X_ADDR(NUC93X_PA_RTC)
|
||||||
|
#define NUC93X_SZ_RTC SZ_4K
|
||||||
|
|
||||||
|
/* Pulse Width Modulation(PWM) Registers */
|
||||||
|
|
||||||
|
#define NUC93X_VA_PWM NUC93X_ADDR(NUC93X_PA_PWM)
|
||||||
|
#define NUC93X_SZ_PWM SZ_4K
|
||||||
|
|
||||||
|
/* Audio Controller controller */
|
||||||
|
|
||||||
|
#define NUC93X_VA_ACTL NUC93X_ADDR(NUC93X_PA_ACTL)
|
||||||
|
#define NUC93X_SZ_ACTL SZ_4K
|
||||||
|
|
||||||
|
/* USB Device port */
|
||||||
|
|
||||||
|
#define NUC93X_VA_USBDEV NUC93X_ADDR(NUC93X_PA_USBDEV)
|
||||||
|
#define NUC93X_SZ_USBDEV SZ_4K
|
||||||
|
|
||||||
|
/* USB host controller*/
|
||||||
|
#define NUC93X_VA_USBHOST NUC93X_ADDR(NUC93X_PA_USBHOST)
|
||||||
|
#define NUC93X_SZ_USBHOST SZ_4K
|
||||||
|
|
||||||
|
#endif /* __ASM_ARCH_MAP_H */
|
21
arch/arm/mach-nuc93x/include/mach/memory.h
Normal file
21
arch/arm/mach-nuc93x/include/mach/memory.h
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/memory.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_MEMORY_H
|
||||||
|
#define __ASM_ARCH_MEMORY_H
|
||||||
|
|
||||||
|
#define PHYS_OFFSET UL(0x00000000)
|
||||||
|
|
||||||
|
#endif
|
53
arch/arm/mach-nuc93x/include/mach/regs-clock.h
Normal file
53
arch/arm/mach-nuc93x/include/mach/regs-clock.h
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/regs-clock.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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;version 2 of the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_REGS_CLOCK_H
|
||||||
|
#define __ASM_ARCH_REGS_CLOCK_H
|
||||||
|
|
||||||
|
/* Clock Control Registers */
|
||||||
|
#define CLK_BA NUC93X_VA_CLKPWR
|
||||||
|
#define REG_CLKEN (CLK_BA + 0x00)
|
||||||
|
#define REG_CLKSEL (CLK_BA + 0x04)
|
||||||
|
#define REG_CLKDIV (CLK_BA + 0x08)
|
||||||
|
#define REG_PLLCON0 (CLK_BA + 0x0C)
|
||||||
|
#define REG_PLLCON1 (CLK_BA + 0x10)
|
||||||
|
#define REG_PMCON (CLK_BA + 0x14)
|
||||||
|
#define REG_IRQWAKECON (CLK_BA + 0x18)
|
||||||
|
#define REG_IRQWAKEFLAG (CLK_BA + 0x1C)
|
||||||
|
#define REG_IPSRST (CLK_BA + 0x20)
|
||||||
|
#define REG_CLKEN1 (CLK_BA + 0x24)
|
||||||
|
#define REG_CLKDIV1 (CLK_BA + 0x28)
|
||||||
|
|
||||||
|
/* Define PLL freq setting */
|
||||||
|
#define PLL_DISABLE 0x12B63
|
||||||
|
#define PLL_66MHZ 0x2B63
|
||||||
|
#define PLL_100MHZ 0x4F64
|
||||||
|
#define PLL_120MHZ 0x4F63
|
||||||
|
#define PLL_166MHZ 0x4124
|
||||||
|
#define PLL_200MHZ 0x4F24
|
||||||
|
|
||||||
|
/* Define AHB:CPUFREQ ratio */
|
||||||
|
#define AHB_CPUCLK_1_1 0x00
|
||||||
|
#define AHB_CPUCLK_1_2 0x01
|
||||||
|
#define AHB_CPUCLK_1_4 0x02
|
||||||
|
#define AHB_CPUCLK_1_8 0x03
|
||||||
|
|
||||||
|
/* Define APB:AHB ratio */
|
||||||
|
#define APB_AHB_1_2 0x01
|
||||||
|
#define APB_AHB_1_4 0x02
|
||||||
|
#define APB_AHB_1_8 0x03
|
||||||
|
|
||||||
|
/* Define clock skew */
|
||||||
|
#define DEFAULTSKEW 0x48
|
||||||
|
|
||||||
|
#endif /* __ASM_ARCH_REGS_CLOCK_H */
|
33
arch/arm/mach-nuc93x/include/mach/regs-ebi.h
Normal file
33
arch/arm/mach-nuc93x/include/mach/regs-ebi.h
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/regs-ebi.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009 Nuvoton technology corporation.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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;version 2 of the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_REGS_EBI_H
|
||||||
|
#define __ASM_ARCH_REGS_EBI_H
|
||||||
|
|
||||||
|
/* EBI Control Registers */
|
||||||
|
|
||||||
|
#define EBI_BA NUC93X_VA_EBI
|
||||||
|
#define REG_EBICON (EBI_BA + 0x00)
|
||||||
|
#define REG_ROMCON (EBI_BA + 0x04)
|
||||||
|
#define REG_SDCONF0 (EBI_BA + 0x08)
|
||||||
|
#define REG_SDCONF1 (EBI_BA + 0x0C)
|
||||||
|
#define REG_SDTIME0 (EBI_BA + 0x10)
|
||||||
|
#define REG_SDTIME1 (EBI_BA + 0x14)
|
||||||
|
#define REG_EXT0CON (EBI_BA + 0x18)
|
||||||
|
#define REG_EXT1CON (EBI_BA + 0x1C)
|
||||||
|
#define REG_EXT2CON (EBI_BA + 0x20)
|
||||||
|
#define REG_EXT3CON (EBI_BA + 0x24)
|
||||||
|
#define REG_EXT4CON (EBI_BA + 0x28)
|
||||||
|
#define REG_CKSKEW (EBI_BA + 0x2C)
|
||||||
|
|
||||||
|
#endif /* __ASM_ARCH_REGS_EBI_H */
|
42
arch/arm/mach-nuc93x/include/mach/regs-irq.h
Normal file
42
arch/arm/mach-nuc93x/include/mach/regs-irq.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/regs-irq.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ___ASM_ARCH_REGS_IRQ_H
|
||||||
|
#define ___ASM_ARCH_REGS_IRQ_H
|
||||||
|
|
||||||
|
/* Advance Interrupt Controller (AIC) Registers */
|
||||||
|
|
||||||
|
#define AIC_BA NUC93X_VA_IRQ
|
||||||
|
|
||||||
|
#define REG_AIC_IRQSC (AIC_BA+0x80)
|
||||||
|
#define REG_AIC_GEN (AIC_BA+0x84)
|
||||||
|
#define REG_AIC_GASR (AIC_BA+0x88)
|
||||||
|
#define REG_AIC_GSCR (AIC_BA+0x8C)
|
||||||
|
#define REG_AIC_IRSR (AIC_BA+0x100)
|
||||||
|
#define REG_AIC_IASR (AIC_BA+0x104)
|
||||||
|
#define REG_AIC_ISR (AIC_BA+0x108)
|
||||||
|
#define REG_AIC_IPER (AIC_BA+0x10C)
|
||||||
|
#define REG_AIC_ISNR (AIC_BA+0x110)
|
||||||
|
#define REG_AIC_IMR (AIC_BA+0x114)
|
||||||
|
#define REG_AIC_OISR (AIC_BA+0x118)
|
||||||
|
#define REG_AIC_MECR (AIC_BA+0x120)
|
||||||
|
#define REG_AIC_MDCR (AIC_BA+0x124)
|
||||||
|
#define REG_AIC_SSCR (AIC_BA+0x128)
|
||||||
|
#define REG_AIC_SCCR (AIC_BA+0x12C)
|
||||||
|
#define REG_AIC_EOSCR (AIC_BA+0x130)
|
||||||
|
#define AIC_IPER (0x10C)
|
||||||
|
#define AIC_ISNR (0x110)
|
||||||
|
|
||||||
|
#endif /* ___ASM_ARCH_REGS_IRQ_H */
|
52
arch/arm/mach-nuc93x/include/mach/regs-serial.h
Normal file
52
arch/arm/mach-nuc93x/include/mach/regs-serial.h
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/regs-serial.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARM_REGS_SERIAL_H
|
||||||
|
#define __ASM_ARM_REGS_SERIAL_H
|
||||||
|
|
||||||
|
#define UART0_BA NUC93X_VA_UART
|
||||||
|
#define UART1_BA (NUC93X_VA_UART+0x100)
|
||||||
|
|
||||||
|
#define UART0_PA NUC93X_PA_UART
|
||||||
|
#define UART1_PA (NUC93X_PA_UART+0x100)
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
|
struct nuc93x_uart_clksrc {
|
||||||
|
const char *name;
|
||||||
|
unsigned int divisor;
|
||||||
|
unsigned int min_baud;
|
||||||
|
unsigned int max_baud;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct nuc93x_uartcfg {
|
||||||
|
unsigned char hwport;
|
||||||
|
unsigned char unused;
|
||||||
|
unsigned short flags;
|
||||||
|
unsigned long uart_flags;
|
||||||
|
|
||||||
|
unsigned long ucon;
|
||||||
|
unsigned long ulcon;
|
||||||
|
unsigned long ufcon;
|
||||||
|
|
||||||
|
struct nuc93x_uart_clksrc *clocks;
|
||||||
|
unsigned int clocks_size;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
|
#endif /* __ASM_ARM_REGS_SERIAL_H */
|
||||||
|
|
28
arch/arm/mach-nuc93x/include/mach/regs-timer.h
Normal file
28
arch/arm/mach-nuc93x/include/mach/regs-timer.h
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/regs-timer.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_REGS_TIMER_H
|
||||||
|
#define __ASM_ARCH_REGS_TIMER_H
|
||||||
|
|
||||||
|
/* Timer Registers */
|
||||||
|
|
||||||
|
#define TMR_BA NUC93X_VA_TIMER
|
||||||
|
#define REG_TCSR0 (TMR_BA+0x00)
|
||||||
|
#define REG_TICR0 (TMR_BA+0x08)
|
||||||
|
#define REG_TDR0 (TMR_BA+0x10)
|
||||||
|
#define REG_TISR (TMR_BA+0x18)
|
||||||
|
#define REG_WTCR (TMR_BA+0x1C)
|
||||||
|
|
||||||
|
#endif /* __ASM_ARCH_REGS_TIMER_H */
|
28
arch/arm/mach-nuc93x/include/mach/system.h
Normal file
28
arch/arm/mach-nuc93x/include/mach/system.h
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/machnuc93x/include/mach/system.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.com>
|
||||||
|
*
|
||||||
|
* Based on arch/arm/mach-s3c2410/include/mach/system.h
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <asm/proc-fns.h>
|
||||||
|
|
||||||
|
static void arch_idle(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void arch_reset(char mode, const char *cmd)
|
||||||
|
{
|
||||||
|
cpu_reset(0);
|
||||||
|
}
|
||||||
|
|
25
arch/arm/mach-nuc93x/include/mach/timex.h
Normal file
25
arch/arm/mach-nuc93x/include/mach/timex.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/timex.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.com>
|
||||||
|
*
|
||||||
|
* Based on arch/arm/mach-s3c2410/include/mach/timex.h
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_TIMEX_H
|
||||||
|
#define __ASM_ARCH_TIMEX_H
|
||||||
|
|
||||||
|
/* CLOCK_TICK_RATE Now, I don't use it. */
|
||||||
|
|
||||||
|
#define CLOCK_TICK_RATE 27000000
|
||||||
|
|
||||||
|
#endif /* __ASM_ARCH_TIMEX_H */
|
50
arch/arm/mach-nuc93x/include/mach/uncompress.h
Normal file
50
arch/arm/mach-nuc93x/include/mach/uncompress.h
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/uncompress.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.com>
|
||||||
|
*
|
||||||
|
* Based on arch/arm/mach-s3c2410/include/mach/uncompress.h
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_UNCOMPRESS_H
|
||||||
|
#define __ASM_ARCH_UNCOMPRESS_H
|
||||||
|
|
||||||
|
/* Defines for UART registers */
|
||||||
|
|
||||||
|
#include <mach/regs-serial.h>
|
||||||
|
#include <mach/map.h>
|
||||||
|
#include <linux/serial_reg.h>
|
||||||
|
|
||||||
|
#define arch_decomp_wdog()
|
||||||
|
|
||||||
|
#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
|
||||||
|
static u32 * uart_base = (u32 *)UART0_PA;
|
||||||
|
|
||||||
|
static void putc(int ch)
|
||||||
|
{
|
||||||
|
/* Check THRE and TEMT bits before we transmit the character.
|
||||||
|
*/
|
||||||
|
while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
|
||||||
|
barrier();
|
||||||
|
|
||||||
|
*uart_base = ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void flush(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void arch_decomp_setup(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif/* __ASM_NUC93X_UNCOMPRESS_H */
|
23
arch/arm/mach-nuc93x/include/mach/vmalloc.h
Normal file
23
arch/arm/mach-nuc93x/include/mach/vmalloc.h
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/include/mach/vmalloc.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.com>
|
||||||
|
*
|
||||||
|
* Based on arch/arm/mach-s3c2410/include/mach/vmalloc.h
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_VMALLOC_H
|
||||||
|
#define __ASM_ARCH_VMALLOC_H
|
||||||
|
|
||||||
|
#define VMALLOC_END (0xE0000000)
|
||||||
|
|
||||||
|
#endif /* __ASM_ARCH_VMALLOC_H */
|
66
arch/arm/mach-nuc93x/irq.c
Normal file
66
arch/arm/mach-nuc93x/irq.c
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
/*
|
||||||
|
* linux/arch/arm/mach-nuc93x/irq.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton technology corporation.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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;version 2 of the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/ioport.h>
|
||||||
|
#include <linux/ptrace.h>
|
||||||
|
#include <linux/sysdev.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
|
||||||
|
#include <asm/irq.h>
|
||||||
|
#include <asm/mach/irq.h>
|
||||||
|
|
||||||
|
#include <mach/hardware.h>
|
||||||
|
#include <mach/regs-irq.h>
|
||||||
|
|
||||||
|
static void nuc93x_irq_mask(unsigned int irq)
|
||||||
|
{
|
||||||
|
__raw_writel(1 << irq, REG_AIC_MDCR);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* By the w90p910 spec,any irq,only write 1
|
||||||
|
* to REG_AIC_EOSCR for ACK
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void nuc93x_irq_ack(unsigned int irq)
|
||||||
|
{
|
||||||
|
__raw_writel(0x01, REG_AIC_EOSCR);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void nuc93x_irq_unmask(unsigned int irq)
|
||||||
|
{
|
||||||
|
__raw_writel(1 << irq, REG_AIC_MECR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct irq_chip nuc93x_irq_chip = {
|
||||||
|
.ack = nuc93x_irq_ack,
|
||||||
|
.mask = nuc93x_irq_mask,
|
||||||
|
.unmask = nuc93x_irq_unmask,
|
||||||
|
};
|
||||||
|
|
||||||
|
void __init nuc93x_init_irq(void)
|
||||||
|
{
|
||||||
|
int irqno;
|
||||||
|
|
||||||
|
__raw_writel(0xFFFFFFFE, REG_AIC_MDCR);
|
||||||
|
|
||||||
|
for (irqno = IRQ_WDT; irqno <= NR_IRQS; irqno++) {
|
||||||
|
set_irq_chip(irqno, &nuc93x_irq_chip);
|
||||||
|
set_irq_handler(irqno, handle_level_irq);
|
||||||
|
set_irq_flags(irqno, IRQF_VALID);
|
||||||
|
}
|
||||||
|
}
|
45
arch/arm/mach-nuc93x/mach-nuc932evb.c
Normal file
45
arch/arm/mach-nuc93x/mach-nuc932evb.c
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
* linux/arch/arm/mach-w90x900/mach-nuc910evb.c
|
||||||
|
*
|
||||||
|
* Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008 Nuvoton technology corporation.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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;version 2 of the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <asm/mach/arch.h>
|
||||||
|
#include <asm/mach/map.h>
|
||||||
|
#include <asm/mach-types.h>
|
||||||
|
#include <mach/map.h>
|
||||||
|
|
||||||
|
#include "nuc932.h"
|
||||||
|
|
||||||
|
static void __init nuc932evb_map_io(void)
|
||||||
|
{
|
||||||
|
nuc932_map_io();
|
||||||
|
nuc932_init_clocks();
|
||||||
|
nuc932_init_uartclk();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __init nuc932evb_init(void)
|
||||||
|
{
|
||||||
|
nuc932_board_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
MACHINE_START(NUC932EVB, "NUC932EVB")
|
||||||
|
/* Maintainer: Wan ZongShun */
|
||||||
|
.phys_io = NUC93X_PA_UART,
|
||||||
|
.io_pg_offst = (((u32)NUC93X_VA_UART) >> 18) & 0xfffc,
|
||||||
|
.boot_params = 0,
|
||||||
|
.map_io = nuc932evb_map_io,
|
||||||
|
.init_irq = nuc93x_init_irq,
|
||||||
|
.init_machine = nuc932evb_init,
|
||||||
|
.timer = &nuc93x_timer,
|
||||||
|
MACHINE_END
|
65
arch/arm/mach-nuc93x/nuc932.c
Normal file
65
arch/arm/mach-nuc93x/nuc932.c
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
/*
|
||||||
|
* linux/arch/arm/mach-nuc93x/nuc932.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009 Nuvoton corporation.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.com>
|
||||||
|
*
|
||||||
|
* NUC932 cpu support
|
||||||
|
*
|
||||||
|
* 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;version 2 of the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/clk.h>
|
||||||
|
#include <linux/err.h>
|
||||||
|
|
||||||
|
#include <asm/mach/map.h>
|
||||||
|
#include <mach/hardware.h>
|
||||||
|
|
||||||
|
#include "cpu.h"
|
||||||
|
#include "clock.h"
|
||||||
|
|
||||||
|
/* define specific CPU platform device */
|
||||||
|
|
||||||
|
static struct platform_device *nuc932_dev[] __initdata = {
|
||||||
|
};
|
||||||
|
|
||||||
|
/* define specific CPU platform io map */
|
||||||
|
|
||||||
|
static struct map_desc nuc932evb_iodesc[] __initdata = {
|
||||||
|
};
|
||||||
|
|
||||||
|
/*Init NUC932 evb io*/
|
||||||
|
|
||||||
|
void __init nuc932_map_io(void)
|
||||||
|
{
|
||||||
|
nuc93x_map_io(nuc932evb_iodesc, ARRAY_SIZE(nuc932evb_iodesc));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Init NUC932 clock*/
|
||||||
|
|
||||||
|
void __init nuc932_init_clocks(void)
|
||||||
|
{
|
||||||
|
nuc93x_init_clocks();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*enable NUC932 uart clock*/
|
||||||
|
|
||||||
|
void __init nuc932_init_uartclk(void)
|
||||||
|
{
|
||||||
|
struct clk *ck_uart = clk_get(NULL, "uart");
|
||||||
|
BUG_ON(IS_ERR(ck_uart));
|
||||||
|
|
||||||
|
clk_enable(ck_uart);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Init NUC932 board info*/
|
||||||
|
|
||||||
|
void __init nuc932_board_init(void)
|
||||||
|
{
|
||||||
|
nuc93x_board_init(nuc932_dev, ARRAY_SIZE(nuc932_dev));
|
||||||
|
}
|
29
arch/arm/mach-nuc93x/nuc932.h
Normal file
29
arch/arm/mach-nuc93x/nuc932.h
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* arch/arm/mach-nuc93x/nuc932.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Nuvoton corporation
|
||||||
|
*
|
||||||
|
* Header file for NUC93x CPU support
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.com>
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct map_desc;
|
||||||
|
struct sys_timer;
|
||||||
|
|
||||||
|
/* core initialisation functions */
|
||||||
|
|
||||||
|
extern void nuc93x_init_irq(void);
|
||||||
|
extern struct sys_timer nuc93x_timer;
|
||||||
|
|
||||||
|
/* extern file from nuc932.c */
|
||||||
|
|
||||||
|
extern void nuc932_board_init(void);
|
||||||
|
extern void nuc932_init_clocks(void);
|
||||||
|
extern void nuc932_map_io(void);
|
||||||
|
extern void nuc932_init_uartclk(void);
|
100
arch/arm/mach-nuc93x/time.c
Normal file
100
arch/arm/mach-nuc93x/time.c
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
/*
|
||||||
|
* linux/arch/arm/mach-nuc93x/time.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009 Nuvoton technology corporation.
|
||||||
|
*
|
||||||
|
* Wan ZongShun <mcuos.com@gmail.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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/err.h>
|
||||||
|
#include <linux/clk.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
#include <linux/leds.h>
|
||||||
|
|
||||||
|
#include <asm/mach-types.h>
|
||||||
|
#include <asm/mach/irq.h>
|
||||||
|
#include <asm/mach/time.h>
|
||||||
|
|
||||||
|
#include <mach/system.h>
|
||||||
|
#include <mach/map.h>
|
||||||
|
#include <mach/regs-timer.h>
|
||||||
|
|
||||||
|
#define RESETINT 0x01
|
||||||
|
#define PERIOD (0x01 << 27)
|
||||||
|
#define ONESHOT (0x00 << 27)
|
||||||
|
#define COUNTEN (0x01 << 30)
|
||||||
|
#define INTEN (0x01 << 29)
|
||||||
|
|
||||||
|
#define TICKS_PER_SEC 100
|
||||||
|
#define PRESCALE 0x63 /* Divider = prescale + 1 */
|
||||||
|
|
||||||
|
unsigned int timer0_load;
|
||||||
|
|
||||||
|
static unsigned long nuc93x_gettimeoffset(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*IRQ handler for the timer*/
|
||||||
|
|
||||||
|
static irqreturn_t nuc93x_timer_interrupt(int irq, void *dev_id)
|
||||||
|
{
|
||||||
|
timer_tick();
|
||||||
|
__raw_writel(0x01, REG_TISR); /* clear TIF0 */
|
||||||
|
return IRQ_HANDLED;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct irqaction nuc93x_timer_irq = {
|
||||||
|
.name = "nuc93x Timer Tick",
|
||||||
|
.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
|
||||||
|
.handler = nuc93x_timer_interrupt,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*Set up timer reg.*/
|
||||||
|
|
||||||
|
static void nuc93x_timer_setup(void)
|
||||||
|
{
|
||||||
|
struct clk *ck_ext = clk_get(NULL, "ext");
|
||||||
|
struct clk *ck_timer = clk_get(NULL, "timer");
|
||||||
|
unsigned int rate, val = 0;
|
||||||
|
|
||||||
|
BUG_ON(IS_ERR(ck_ext) || IS_ERR(ck_timer));
|
||||||
|
|
||||||
|
clk_enable(ck_timer);
|
||||||
|
rate = clk_get_rate(ck_ext);
|
||||||
|
clk_put(ck_ext);
|
||||||
|
rate = rate / (PRESCALE + 0x01);
|
||||||
|
|
||||||
|
/* set a known state */
|
||||||
|
__raw_writel(0x00, REG_TCSR0);
|
||||||
|
__raw_writel(RESETINT, REG_TISR);
|
||||||
|
|
||||||
|
timer0_load = (rate / TICKS_PER_SEC);
|
||||||
|
__raw_writel(timer0_load, REG_TICR0);
|
||||||
|
|
||||||
|
val |= (PERIOD | COUNTEN | INTEN | PRESCALE);;
|
||||||
|
__raw_writel(val, REG_TCSR0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __init nuc93x_timer_init(void)
|
||||||
|
{
|
||||||
|
nuc93x_timer_setup();
|
||||||
|
setup_irq(IRQ_TIMER0, &nuc93x_timer_irq);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct sys_timer nuc93x_timer = {
|
||||||
|
.init = nuc93x_timer_init,
|
||||||
|
.offset = nuc93x_gettimeoffset,
|
||||||
|
.resume = nuc93x_timer_setup
|
||||||
|
};
|
|
@ -599,7 +599,7 @@ static struct clk i2c_ick = {
|
||||||
static struct omap_clk omap_clks[] = {
|
static struct omap_clk omap_clks[] = {
|
||||||
/* non-ULPD clocks */
|
/* non-ULPD clocks */
|
||||||
CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310 | CK_7XX),
|
CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310 | CK_7XX),
|
||||||
CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310),
|
CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310 | CK_7XX),
|
||||||
/* CK_GEN1 clocks */
|
/* CK_GEN1 clocks */
|
||||||
CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX),
|
CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX),
|
||||||
CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX),
|
CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX),
|
||||||
|
@ -627,7 +627,7 @@ static struct omap_clk omap_clks[] = {
|
||||||
CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX),
|
CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX),
|
||||||
CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310),
|
CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310),
|
||||||
CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX),
|
CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX),
|
||||||
CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310),
|
CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
|
||||||
CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310),
|
CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310),
|
||||||
CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX),
|
CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX),
|
||||||
CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX),
|
CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX),
|
||||||
|
@ -658,6 +658,10 @@ static struct omap_clk omap_clks[] = {
|
||||||
CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX),
|
CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX),
|
||||||
CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX),
|
CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX),
|
||||||
CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX),
|
CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX),
|
||||||
|
CLK("omap1_spi100k.1", "fck", &dummy_ck, CK_7XX),
|
||||||
|
CLK("omap1_spi100k.1", "ick", &dummy_ck, CK_7XX),
|
||||||
|
CLK("omap1_spi100k.2", "fck", &dummy_ck, CK_7XX),
|
||||||
|
CLK("omap1_spi100k.2", "ick", &dummy_ck, CK_7XX),
|
||||||
CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310),
|
CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310),
|
||||||
CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX),
|
CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX),
|
||||||
CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310),
|
CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310),
|
||||||
|
@ -674,7 +678,7 @@ static struct omap_clk omap_clks[] = {
|
||||||
* init
|
* init
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct clk_functions omap1_clk_functions __initdata = {
|
static struct clk_functions omap1_clk_functions = {
|
||||||
.clk_enable = omap1_clk_enable,
|
.clk_enable = omap1_clk_enable,
|
||||||
.clk_disable = omap1_clk_disable,
|
.clk_disable = omap1_clk_disable,
|
||||||
.clk_round_rate = omap1_clk_round_rate,
|
.clk_round_rate = omap1_clk_round_rate,
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
|
#include <linux/spi/spi.h>
|
||||||
|
|
||||||
#include <mach/hardware.h>
|
#include <mach/hardware.h>
|
||||||
#include <asm/mach/map.h>
|
#include <asm/mach/map.h>
|
||||||
|
@ -23,6 +24,7 @@
|
||||||
#include <plat/mux.h>
|
#include <plat/mux.h>
|
||||||
#include <mach/gpio.h>
|
#include <mach/gpio.h>
|
||||||
#include <plat/mmc.h>
|
#include <plat/mmc.h>
|
||||||
|
#include <plat/omap7xx.h>
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -196,6 +198,38 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* OMAP7xx SPI support */
|
||||||
|
#if defined(CONFIG_SPI_OMAP_100K) || defined(CONFIG_SPI_OMAP_100K_MODULE)
|
||||||
|
|
||||||
|
struct platform_device omap_spi1 = {
|
||||||
|
.name = "omap1_spi100k",
|
||||||
|
.id = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct platform_device omap_spi2 = {
|
||||||
|
.name = "omap1_spi100k",
|
||||||
|
.id = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static void omap_init_spi100k(void)
|
||||||
|
{
|
||||||
|
omap_spi1.dev.platform_data = ioremap(OMAP7XX_SPI1_BASE, 0x7ff);
|
||||||
|
if (omap_spi1.dev.platform_data)
|
||||||
|
platform_device_register(&omap_spi1);
|
||||||
|
|
||||||
|
omap_spi2.dev.platform_data = ioremap(OMAP7XX_SPI2_BASE, 0x7ff);
|
||||||
|
if (omap_spi2.dev.platform_data)
|
||||||
|
platform_device_register(&omap_spi2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
static inline void omap_init_spi100k(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#if defined(CONFIG_OMAP_STI)
|
#if defined(CONFIG_OMAP_STI)
|
||||||
|
|
||||||
#define OMAP1_STI_BASE 0xfffea000
|
#define OMAP1_STI_BASE 0xfffea000
|
||||||
|
@ -263,6 +297,7 @@ static int __init omap1_init_devices(void)
|
||||||
|
|
||||||
omap_init_mbox();
|
omap_init_mbox();
|
||||||
omap_init_rtc();
|
omap_init_rtc();
|
||||||
|
omap_init_spi100k();
|
||||||
omap_init_sti();
|
omap_init_sti();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue