Merge branch 'kill-jffs' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 19 Feb 2007 21:25:36 +0000 (13:25 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 19 Feb 2007 21:25:36 +0000 (13:25 -0800)
* 'kill-jffs' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
  Remove JFFS (version 1), as scheduled.

810 files changed:
Documentation/acpi-hotkey.txt [deleted file]
Documentation/arm/Samsung-S3C24XX/DMA.txt [new file with mode: 0644]
Documentation/arm/Samsung-S3C24XX/Overview.txt
Documentation/feature-removal-schedule.txt
Documentation/kernel-parameters.txt
Documentation/pci.txt
Documentation/powerpc/booting-without-of.txt
Documentation/sony-laptop.txt [new file with mode: 0644]
MAINTAINERS
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/boot/.gitignore [new file with mode: 0644]
arch/arm/boot/compressed/.gitignore [new file with mode: 0644]
arch/arm/common/dmabounce.c
arch/arm/common/gic.c
arch/arm/configs/at91sam9263ek_defconfig [new file with mode: 0644]
arch/arm/configs/ateb9200_defconfig
arch/arm/configs/csb337_defconfig
arch/arm/configs/csb637_defconfig
arch/arm/configs/kafa_defconfig
arch/arm/configs/ns9xxx_defconfig [new file with mode: 0644]
arch/arm/configs/s3c2410_defconfig
arch/arm/kernel/Makefile
arch/arm/kernel/calls.S
arch/arm/kernel/crunch.c
arch/arm/kernel/ecard.c
arch/arm/kernel/entry-armv.S
arch/arm/kernel/machine_kexec.c [new file with mode: 0644]
arch/arm/kernel/process.c
arch/arm/kernel/relocate_kernel.S [new file with mode: 0644]
arch/arm/kernel/setup.c
arch/arm/kernel/time.c
arch/arm/kernel/traps.c
arch/arm/mach-at91/Kconfig [new file with mode: 0644]
arch/arm/mach-at91/Makefile [new file with mode: 0644]
arch/arm/mach-at91/Makefile.boot [new file with mode: 0644]
arch/arm/mach-at91/at91rm9200.c [new file with mode: 0644]
arch/arm/mach-at91/at91rm9200_devices.c [new file with mode: 0644]
arch/arm/mach-at91/at91rm9200_time.c [new file with mode: 0644]
arch/arm/mach-at91/at91sam9260.c [new file with mode: 0644]
arch/arm/mach-at91/at91sam9260_devices.c [new file with mode: 0644]
arch/arm/mach-at91/at91sam9261.c [new file with mode: 0644]
arch/arm/mach-at91/at91sam9261_devices.c [new file with mode: 0644]
arch/arm/mach-at91/at91sam9263.c [new file with mode: 0644]
arch/arm/mach-at91/at91sam9263_devices.c [new file with mode: 0644]
arch/arm/mach-at91/at91sam926x_time.c [new file with mode: 0644]
arch/arm/mach-at91/board-1arm.c [new file with mode: 0644]
arch/arm/mach-at91/board-carmeva.c [new file with mode: 0644]
arch/arm/mach-at91/board-csb337.c [new file with mode: 0644]
arch/arm/mach-at91/board-csb637.c [new file with mode: 0644]
arch/arm/mach-at91/board-dk.c [new file with mode: 0644]
arch/arm/mach-at91/board-eb9200.c [new file with mode: 0644]
arch/arm/mach-at91/board-ek.c [new file with mode: 0644]
arch/arm/mach-at91/board-kafa.c [new file with mode: 0644]
arch/arm/mach-at91/board-kb9202.c [new file with mode: 0644]
arch/arm/mach-at91/board-sam9260ek.c [new file with mode: 0644]
arch/arm/mach-at91/board-sam9261ek.c [new file with mode: 0644]
arch/arm/mach-at91/board-sam9263ek.c [new file with mode: 0644]
arch/arm/mach-at91/clock.c [new file with mode: 0644]
arch/arm/mach-at91/clock.h [new file with mode: 0644]
arch/arm/mach-at91/generic.h [new file with mode: 0644]
arch/arm/mach-at91/gpio.c [new file with mode: 0644]
arch/arm/mach-at91/irq.c [new file with mode: 0644]
arch/arm/mach-at91/leds.c [new file with mode: 0644]
arch/arm/mach-at91/pm.c [new file with mode: 0644]
arch/arm/mach-at91rm9200/Kconfig [deleted file]
arch/arm/mach-at91rm9200/Makefile [deleted file]
arch/arm/mach-at91rm9200/Makefile.boot [deleted file]
arch/arm/mach-at91rm9200/at91rm9200.c [deleted file]
arch/arm/mach-at91rm9200/at91rm9200_devices.c [deleted file]
arch/arm/mach-at91rm9200/at91rm9200_time.c [deleted file]
arch/arm/mach-at91rm9200/at91sam9260.c [deleted file]
arch/arm/mach-at91rm9200/at91sam9260_devices.c [deleted file]
arch/arm/mach-at91rm9200/at91sam9261.c [deleted file]
arch/arm/mach-at91rm9200/at91sam9261_devices.c [deleted file]
arch/arm/mach-at91rm9200/at91sam926x_time.c [deleted file]
arch/arm/mach-at91rm9200/board-1arm.c [deleted file]
arch/arm/mach-at91rm9200/board-carmeva.c [deleted file]
arch/arm/mach-at91rm9200/board-csb337.c [deleted file]
arch/arm/mach-at91rm9200/board-csb637.c [deleted file]
arch/arm/mach-at91rm9200/board-dk.c [deleted file]
arch/arm/mach-at91rm9200/board-eb9200.c [deleted file]
arch/arm/mach-at91rm9200/board-ek.c [deleted file]
arch/arm/mach-at91rm9200/board-kafa.c [deleted file]
arch/arm/mach-at91rm9200/board-kb9202.c [deleted file]
arch/arm/mach-at91rm9200/board-sam9260ek.c [deleted file]
arch/arm/mach-at91rm9200/board-sam9261ek.c [deleted file]
arch/arm/mach-at91rm9200/clock.c [deleted file]
arch/arm/mach-at91rm9200/clock.h [deleted file]
arch/arm/mach-at91rm9200/generic.h [deleted file]
arch/arm/mach-at91rm9200/gpio.c [deleted file]
arch/arm/mach-at91rm9200/irq.c [deleted file]
arch/arm/mach-at91rm9200/leds.c [deleted file]
arch/arm/mach-at91rm9200/pm.c [deleted file]
arch/arm/mach-ep93xx/Kconfig
arch/arm/mach-ep93xx/Makefile
arch/arm/mach-ep93xx/clock.c
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/micro9.c [new file with mode: 0644]
arch/arm/mach-iop13xx/irq.c
arch/arm/mach-iop32x/irq.c
arch/arm/mach-iop32x/n2100.c
arch/arm/mach-iop33x/irq.c
arch/arm/mach-ixp4xx/Kconfig
arch/arm/mach-ixp4xx/Makefile
arch/arm/mach-ixp4xx/avila-pci.c [new file with mode: 0644]
arch/arm/mach-ixp4xx/avila-setup.c [new file with mode: 0644]
arch/arm/mach-ixp4xx/ixdp425-pci.c
arch/arm/mach-ixp4xx/ixdp425-setup.c
arch/arm/mach-ns9xxx/Kconfig [new file with mode: 0644]
arch/arm/mach-ns9xxx/Makefile [new file with mode: 0644]
arch/arm/mach-ns9xxx/Makefile.boot [new file with mode: 0644]
arch/arm/mach-ns9xxx/board-a9m9750dev.c [new file with mode: 0644]
arch/arm/mach-ns9xxx/board-a9m9750dev.h [new file with mode: 0644]
arch/arm/mach-ns9xxx/generic.c [new file with mode: 0644]
arch/arm/mach-ns9xxx/generic.h [new file with mode: 0644]
arch/arm/mach-ns9xxx/irq.c [new file with mode: 0644]
arch/arm/mach-ns9xxx/mach-cc9p9360dev.c [new file with mode: 0644]
arch/arm/mach-ns9xxx/time.c [new file with mode: 0644]
arch/arm/mach-pxa/generic.c
arch/arm/mach-realview/Kconfig
arch/arm/mach-realview/platsmp.c
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-s3c2400/Kconfig [new file with mode: 0644]
arch/arm/mach-s3c2400/Makefile [new file with mode: 0644]
arch/arm/mach-s3c2400/gpio.c [new file with mode: 0644]
arch/arm/mach-s3c2410/Kconfig
arch/arm/mach-s3c2410/Makefile
arch/arm/mach-s3c2410/bast-irq.c
arch/arm/mach-s3c2410/bast.h
arch/arm/mach-s3c2410/clock.c
arch/arm/mach-s3c2410/clock.h [deleted file]
arch/arm/mach-s3c2410/common-smdk.c [deleted file]
arch/arm/mach-s3c2410/common-smdk.h [deleted file]
arch/arm/mach-s3c2410/cpu.c [deleted file]
arch/arm/mach-s3c2410/cpu.h [deleted file]
arch/arm/mach-s3c2410/devs.c [deleted file]
arch/arm/mach-s3c2410/devs.h [deleted file]
arch/arm/mach-s3c2410/dma.c
arch/arm/mach-s3c2410/dma.h [deleted file]
arch/arm/mach-s3c2410/gpio.c
arch/arm/mach-s3c2410/irq.c
arch/arm/mach-s3c2410/irq.h [deleted file]
arch/arm/mach-s3c2410/mach-amlm5900.c
arch/arm/mach-s3c2410/mach-anubis.c [deleted file]
arch/arm/mach-s3c2410/mach-bast.c
arch/arm/mach-s3c2410/mach-h1940.c
arch/arm/mach-s3c2410/mach-n30.c
arch/arm/mach-s3c2410/mach-nexcoder.c [deleted file]
arch/arm/mach-s3c2410/mach-osiris.c [deleted file]
arch/arm/mach-s3c2410/mach-otom.c
arch/arm/mach-s3c2410/mach-qt2410.c [new file with mode: 0644]
arch/arm/mach-s3c2410/mach-rx3715.c [deleted file]
arch/arm/mach-s3c2410/mach-smdk2410.c
arch/arm/mach-s3c2410/mach-smdk2413.c [deleted file]
arch/arm/mach-s3c2410/mach-smdk2440.c [deleted file]
arch/arm/mach-s3c2410/mach-vr1000.c
arch/arm/mach-s3c2410/mach-vstms.c [deleted file]
arch/arm/mach-s3c2410/pm-simtec.c [deleted file]
arch/arm/mach-s3c2410/pm.c
arch/arm/mach-s3c2410/pm.h [deleted file]
arch/arm/mach-s3c2410/s3c2400-gpio.c [deleted file]
arch/arm/mach-s3c2410/s3c2400.h [deleted file]
arch/arm/mach-s3c2410/s3c2410-clock.c [deleted file]
arch/arm/mach-s3c2410/s3c2410-dma.c [deleted file]
arch/arm/mach-s3c2410/s3c2410-gpio.c [deleted file]
arch/arm/mach-s3c2410/s3c2410-irq.c [deleted file]
arch/arm/mach-s3c2410/s3c2410-pm.c [deleted file]
arch/arm/mach-s3c2410/s3c2410-sleep.S [deleted file]
arch/arm/mach-s3c2410/s3c2410.c
arch/arm/mach-s3c2410/s3c2410.h [deleted file]
arch/arm/mach-s3c2410/s3c2412-clock.c [deleted file]
arch/arm/mach-s3c2410/s3c2412-dma.c [deleted file]
arch/arm/mach-s3c2410/s3c2412-irq.c [deleted file]
arch/arm/mach-s3c2410/s3c2412-pm.c [deleted file]
arch/arm/mach-s3c2410/s3c2412.c [deleted file]
arch/arm/mach-s3c2410/s3c2412.h [deleted file]
arch/arm/mach-s3c2410/s3c2440-clock.c [deleted file]
arch/arm/mach-s3c2410/s3c2440-dma.c [deleted file]
arch/arm/mach-s3c2410/s3c2440-dsc.c [deleted file]
arch/arm/mach-s3c2410/s3c2440-irq.c [deleted file]
arch/arm/mach-s3c2410/s3c2440.c [deleted file]
arch/arm/mach-s3c2410/s3c2440.h [deleted file]
arch/arm/mach-s3c2410/s3c2442-clock.c [deleted file]
arch/arm/mach-s3c2410/s3c2442.c [deleted file]
arch/arm/mach-s3c2410/s3c2442.h [deleted file]
arch/arm/mach-s3c2410/s3c244x-irq.c [deleted file]
arch/arm/mach-s3c2410/s3c244x.c [deleted file]
arch/arm/mach-s3c2410/s3c244x.h [deleted file]
arch/arm/mach-s3c2410/sleep.S
arch/arm/mach-s3c2410/time.c [deleted file]
arch/arm/mach-s3c2410/usb-simtec.c
arch/arm/mach-s3c2412/Kconfig [new file with mode: 0644]
arch/arm/mach-s3c2412/Makefile [new file with mode: 0644]
arch/arm/mach-s3c2412/clock.c [new file with mode: 0644]
arch/arm/mach-s3c2412/dma.c [new file with mode: 0644]
arch/arm/mach-s3c2412/irq.c [new file with mode: 0644]
arch/arm/mach-s3c2412/mach-smdk2413.c [new file with mode: 0644]
arch/arm/mach-s3c2412/mach-vstms.c [new file with mode: 0644]
arch/arm/mach-s3c2412/pm.c [new file with mode: 0644]
arch/arm/mach-s3c2412/s3c2412.c [new file with mode: 0644]
arch/arm/mach-s3c2440/Kconfig [new file with mode: 0644]
arch/arm/mach-s3c2440/Makefile [new file with mode: 0644]
arch/arm/mach-s3c2440/clock.c [new file with mode: 0644]
arch/arm/mach-s3c2440/dma.c [new file with mode: 0644]
arch/arm/mach-s3c2440/dsc.c [new file with mode: 0644]
arch/arm/mach-s3c2440/irq.c [new file with mode: 0644]
arch/arm/mach-s3c2440/mach-anubis.c [new file with mode: 0644]
arch/arm/mach-s3c2440/mach-nexcoder.c [new file with mode: 0644]
arch/arm/mach-s3c2440/mach-osiris.c [new file with mode: 0644]
arch/arm/mach-s3c2440/mach-rx3715.c [new file with mode: 0644]
arch/arm/mach-s3c2440/mach-smdk2440.c [new file with mode: 0644]
arch/arm/mach-s3c2440/s3c2440.c [new file with mode: 0644]
arch/arm/mach-s3c2442/Kconfig [new file with mode: 0644]
arch/arm/mach-s3c2442/Makefile [new file with mode: 0644]
arch/arm/mach-s3c2442/clock.c [new file with mode: 0644]
arch/arm/mach-s3c2442/s3c2442.c [new file with mode: 0644]
arch/arm/mach-s3c2443/Kconfig [new file with mode: 0644]
arch/arm/mach-s3c2443/Makefile [new file with mode: 0644]
arch/arm/mach-s3c2443/clock.c [new file with mode: 0644]
arch/arm/mach-s3c2443/dma.c [new file with mode: 0644]
arch/arm/mach-s3c2443/irq.c [new file with mode: 0644]
arch/arm/mach-s3c2443/mach-smdk2443.c [new file with mode: 0644]
arch/arm/mach-s3c2443/s3c2443.c [new file with mode: 0644]
arch/arm/mm/Kconfig
arch/arm/mm/Makefile
arch/arm/mm/cache-l2x0.c [new file with mode: 0644]
arch/arm/mm/consistent.c
arch/arm/mm/context.c
arch/arm/mm/fault-armv.c
arch/arm/mm/mmu.c
arch/arm/mm/proc-v6.S
arch/arm/mm/proc-xsc3.S
arch/arm/mm/tlb-v6.S
arch/arm/oprofile/Kconfig
arch/arm/oprofile/Makefile
arch/arm/oprofile/common.c
arch/arm/oprofile/op_arm_model.h
arch/arm/oprofile/op_model_arm11_core.c [new file with mode: 0644]
arch/arm/oprofile/op_model_arm11_core.h [new file with mode: 0644]
arch/arm/oprofile/op_model_mpcore.c [new file with mode: 0644]
arch/arm/oprofile/op_model_mpcore.h [new file with mode: 0644]
arch/arm/oprofile/op_model_v6.c [new file with mode: 0644]
arch/arm/plat-iop/Makefile
arch/arm/plat-iop/cp6.c [new file with mode: 0644]
arch/arm/plat-iop/io.c [new file with mode: 0644]
arch/arm/plat-iop/pci.c
arch/arm/plat-s3c24xx/Kconfig [new file with mode: 0644]
arch/arm/plat-s3c24xx/Makefile [new file with mode: 0644]
arch/arm/plat-s3c24xx/clock.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/common-smdk.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/cpu.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/devs.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/dma.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/gpio.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/irq.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/pm-simtec.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/pm.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/s3c244x-irq.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/s3c244x.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/s3c244x.h [new file with mode: 0644]
arch/arm/plat-s3c24xx/sleep.S [new file with mode: 0644]
arch/arm/plat-s3c24xx/time.c [new file with mode: 0644]
arch/avr32/mach-at32ap/clock.c
arch/avr32/mach-at32ap/clock.h
arch/i386/kernel/acpi/boot.c
arch/i386/pci/common.c
arch/ia64/kernel/acpi.c
arch/powerpc/Kconfig
arch/powerpc/boot/dts/kuroboxHD.dts
arch/powerpc/boot/dts/kuroboxHG.dts
arch/powerpc/boot/dts/mpc7448hpc2.dts
arch/powerpc/boot/dts/mpc8272ads.dts
arch/powerpc/boot/dts/mpc8313erdb.dts
arch/powerpc/boot/dts/mpc8323emds.dts [deleted file]
arch/powerpc/boot/dts/mpc832x_mds.dts [new file with mode: 0644]
arch/powerpc/boot/dts/mpc8349emitx.dts
arch/powerpc/boot/dts/mpc8349emitxgp.dts
arch/powerpc/boot/dts/mpc834x_mds.dts
arch/powerpc/boot/dts/mpc8360emds.dts [deleted file]
arch/powerpc/boot/dts/mpc836x_mds.dts [new file with mode: 0644]
arch/powerpc/boot/dts/mpc8540ads.dts
arch/powerpc/boot/dts/mpc8541cds.dts
arch/powerpc/boot/dts/mpc8548cds.dts
arch/powerpc/boot/dts/mpc8555cds.dts
arch/powerpc/boot/dts/mpc8560ads.dts
arch/powerpc/boot/dts/mpc8568mds.dts
arch/powerpc/boot/dts/mpc8641_hpcn.dts
arch/powerpc/boot/dts/mpc866ads.dts
arch/powerpc/boot/dts/mpc885ads.dts
arch/powerpc/configs/cell_defconfig
arch/powerpc/configs/mpc832x_mds_defconfig [new file with mode: 0644]
arch/powerpc/configs/mpc832xemds_defconfig [deleted file]
arch/powerpc/configs/mpc8360emds_defconfig [deleted file]
arch/powerpc/configs/mpc836x_mds_defconfig [new file with mode: 0644]
arch/powerpc/configs/mpc8568mds_defconfig
arch/powerpc/configs/ppc64_defconfig
arch/powerpc/configs/pseries_defconfig
arch/powerpc/kernel/prom.c
arch/powerpc/kernel/prom_parse.c
arch/powerpc/mm/pgtable_64.c
arch/powerpc/platforms/83xx/Kconfig
arch/powerpc/platforms/83xx/Makefile
arch/powerpc/platforms/83xx/mpc8313_rdb.c
arch/powerpc/platforms/83xx/mpc832x_mds.c
arch/powerpc/platforms/83xx/mpc834x_itx.c
arch/powerpc/platforms/83xx/mpc834x_mds.c
arch/powerpc/platforms/83xx/mpc8360e_pb.c [deleted file]
arch/powerpc/platforms/83xx/mpc836x_mds.c [new file with mode: 0644]
arch/powerpc/platforms/85xx/Kconfig
arch/powerpc/platforms/85xx/Makefile
arch/powerpc/platforms/85xx/mpc8568_mds.c [deleted file]
arch/powerpc/platforms/85xx/mpc85xx_ads.c
arch/powerpc/platforms/85xx/mpc85xx_cds.c
arch/powerpc/platforms/85xx/mpc85xx_mds.c [new file with mode: 0644]
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
arch/powerpc/platforms/celleb/Makefile
arch/powerpc/platforms/celleb/setup.c
arch/powerpc/platforms/ps3/Kconfig
arch/powerpc/platforms/ps3/setup.c
arch/powerpc/platforms/pseries/Makefile
arch/powerpc/platforms/pseries/power.c [new file with mode: 0644]
arch/powerpc/platforms/pseries/pseries.h
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/sysdev/Makefile
arch/powerpc/sysdev/fsl_soc.c
arch/powerpc/sysdev/mpic.c
arch/powerpc/sysdev/pmi.c [new file with mode: 0644]
arch/powerpc/sysdev/qe_lib/ucc_fast.c
arch/powerpc/sysdev/qe_lib/ucc_slow.c
arch/x86_64/kernel/early-quirks.c
drivers/acpi/Kconfig
drivers/acpi/Makefile
drivers/acpi/ac.c
drivers/acpi/acpi_memhotplug.c
drivers/acpi/asus_acpi.c
drivers/acpi/battery.c
drivers/acpi/bay.c
drivers/acpi/bus.c
drivers/acpi/button.c
drivers/acpi/cm_sbs.c
drivers/acpi/container.c
drivers/acpi/debug.c
drivers/acpi/dispatcher/dsmethod.c
drivers/acpi/dock.c
drivers/acpi/ec.c
drivers/acpi/event.c
drivers/acpi/events/evgpe.c
drivers/acpi/events/evmisc.c
drivers/acpi/executer/exdump.c
drivers/acpi/executer/exmutex.c
drivers/acpi/fan.c
drivers/acpi/glue.c
drivers/acpi/hardware/hwsleep.c
drivers/acpi/hotkey.c [deleted file]
drivers/acpi/i2c_ec.c
drivers/acpi/ibm_acpi.c
drivers/acpi/numa.c
drivers/acpi/osl.c
drivers/acpi/pci_bind.c
drivers/acpi/pci_irq.c
drivers/acpi/pci_link.c
drivers/acpi/pci_root.c
drivers/acpi/power.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_perflib.c
drivers/acpi/processor_thermal.c
drivers/acpi/processor_throttling.c
drivers/acpi/sbs.c
drivers/acpi/scan.c
drivers/acpi/sleep/main.c
drivers/acpi/system.c
drivers/acpi/tables.c
drivers/acpi/tables/tbxface.c
drivers/acpi/thermal.c
drivers/acpi/toshiba_acpi.c
drivers/acpi/utilities/utdelete.c
drivers/acpi/utils.c
drivers/acpi/video.c
drivers/ata/Kconfig
drivers/ata/Makefile
drivers/ata/libata-acpi.c [new file with mode: 0644]
drivers/ata/libata-core.c
drivers/ata/libata.h
drivers/atm/he.c
drivers/atm/idt77252.c
drivers/atm/nicstarmac.c
drivers/base/bus.c
drivers/base/class.c
drivers/i2c/busses/i2c-iop3xx.c
drivers/i2c/busses/i2c-pxa.c
drivers/ide/Kconfig
drivers/ide/Makefile
drivers/ide/arm/icside.c
drivers/ide/arm/rapide.c
drivers/ide/cris/ide-cris.c
drivers/ide/h8300/ide-h8300.c
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-dma.c
drivers/ide/ide-floppy.c
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-lib.c
drivers/ide/ide-probe.c
drivers/ide/ide-tape.c
drivers/ide/ide.c
drivers/ide/legacy/buddha.c
drivers/ide/legacy/gayle.c
drivers/ide/legacy/ht6560b.c
drivers/ide/legacy/macide.c
drivers/ide/legacy/q40ide.c
drivers/ide/mips/au1xxx-ide.c
drivers/ide/mips/swarm.c
drivers/ide/pci/aec62xx.c
drivers/ide/pci/alim15x3.c
drivers/ide/pci/amd74xx.c
drivers/ide/pci/atiixp.c
drivers/ide/pci/cmd64x.c
drivers/ide/pci/cs5520.c
drivers/ide/pci/cs5530.c
drivers/ide/pci/cs5535.c
drivers/ide/pci/cy82c693.c
drivers/ide/pci/hpt34x.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/it8213.c
drivers/ide/pci/it821x.c
drivers/ide/pci/jmicron.c
drivers/ide/pci/ns87415.c
drivers/ide/pci/opti621.c
drivers/ide/pci/pdc202xx_new.c
drivers/ide/pci/pdc202xx_old.c
drivers/ide/pci/piix.c
drivers/ide/pci/sc1200.c
drivers/ide/pci/serverworks.c
drivers/ide/pci/sgiioc4.c
drivers/ide/pci/siimage.c
drivers/ide/pci/sis5513.c
drivers/ide/pci/sl82c105.c
drivers/ide/pci/slc90e66.c
drivers/ide/pci/tc86c001.c
drivers/ide/pci/triflex.c
drivers/ide/pci/trm290.c
drivers/ide/pci/via82cxxx.c
drivers/ide/ppc/pmac.c
drivers/ide/ppc/scc_pata.c [new file with mode: 0644]
drivers/ieee1394/ieee1394-ioctl.h
drivers/ieee1394/ieee1394_core.c
drivers/ieee1394/ieee1394_core.h
drivers/ieee1394/nodemgr.c
drivers/ieee1394/raw1394.c
drivers/ieee1394/raw1394.h
drivers/infiniband/core/Makefile
drivers/infiniband/core/cma.c
drivers/infiniband/core/fmr_pool.c
drivers/infiniband/core/iwcm.c
drivers/infiniband/core/multicast.c [new file with mode: 0644]
drivers/infiniband/core/sa.h [new file with mode: 0644]
drivers/infiniband/core/sa_query.c
drivers/infiniband/core/sysfs.c
drivers/infiniband/core/ucma.c
drivers/infiniband/hw/cxgb3/cxio_dbg.c
drivers/infiniband/hw/cxgb3/cxio_hal.c
drivers/infiniband/hw/cxgb3/cxio_hal.h
drivers/infiniband/hw/cxgb3/cxio_resource.c
drivers/infiniband/hw/cxgb3/cxio_resource.h
drivers/infiniband/hw/cxgb3/cxio_wr.h
drivers/infiniband/hw/cxgb3/iwch.c
drivers/infiniband/hw/cxgb3/iwch.h
drivers/infiniband/hw/cxgb3/iwch_cm.c
drivers/infiniband/hw/cxgb3/iwch_cm.h
drivers/infiniband/hw/cxgb3/iwch_cq.c
drivers/infiniband/hw/cxgb3/iwch_ev.c
drivers/infiniband/hw/cxgb3/iwch_mem.c
drivers/infiniband/hw/cxgb3/iwch_provider.c
drivers/infiniband/hw/cxgb3/iwch_provider.h
drivers/infiniband/hw/cxgb3/iwch_qp.c
drivers/infiniband/hw/cxgb3/iwch_user.h
drivers/infiniband/hw/ehca/Kconfig
drivers/infiniband/hw/ehca/ehca_classes.h
drivers/infiniband/hw/ehca/ehca_eq.c
drivers/infiniband/hw/ehca/ehca_hca.c
drivers/infiniband/hw/ehca/ehca_irq.c
drivers/infiniband/hw/ehca/ehca_irq.h
drivers/infiniband/hw/ehca/ehca_main.c
drivers/infiniband/hw/ehca/ipz_pt_fn.h
drivers/infiniband/hw/ipath/ipath_dma.c
drivers/infiniband/hw/mthca/mthca_memfree.c
drivers/infiniband/hw/mthca/mthca_qp.c
drivers/infiniband/ulp/ipoib/ipoib_cm.c
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/misc/asus-laptop.c
drivers/misc/sony-laptop.c [new file with mode: 0644]
drivers/mmc/at91_mci.c
drivers/net/Kconfig
drivers/net/arcnet/arc-rawmode.c
drivers/net/arcnet/arcnet.c
drivers/net/arcnet/com20020-pci.c
drivers/net/arcnet/com20020.c
drivers/net/atl1/atl1_hw.c
drivers/net/atl1/atl1_main.c
drivers/net/b44.c
drivers/net/cxgb3/cxgb3_defs.h
drivers/net/cxgb3/cxgb3_offload.c
drivers/net/cxgb3/cxgb3_offload.h
drivers/net/cxgb3/l2t.c
drivers/net/cxgb3/l2t.h
drivers/net/cxgb3/t3cdev.h
drivers/net/e1000/e1000.h
drivers/net/e1000/e1000_ethtool.c
drivers/net/e1000/e1000_main.c
drivers/net/ehea/ehea.h
drivers/net/ehea/ehea_main.c
drivers/net/ehea/ehea_phyp.c
drivers/net/ehea/ehea_phyp.h
drivers/net/ehea/ehea_qmr.c
drivers/net/ehea/ehea_qmr.h
drivers/net/gianfar.c
drivers/net/gianfar_sysfs.c
drivers/net/ioc3-eth.c
drivers/net/macb.c
drivers/net/meth.c
drivers/net/netxen/netxen_nic.h
drivers/net/netxen/netxen_nic_ethtool.c
drivers/net/netxen/netxen_nic_hw.c
drivers/net/netxen/netxen_nic_init.c
drivers/net/netxen/netxen_nic_main.c
drivers/net/netxen/netxen_nic_niu.c
drivers/net/pcmcia/3c574_cs.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/phy/marvell.c
drivers/net/phy/phy_device.c
drivers/net/sk98lin/skge.c
drivers/net/sky2.c
drivers/net/sky2.h
drivers/net/wan/Kconfig
drivers/net/wan/pc300too.c
drivers/net/wireless/bcm43xx/bcm43xx.h
drivers/net/wireless/bcm43xx/bcm43xx_dma.c
drivers/net/wireless/bcm43xx/bcm43xx_main.c
drivers/net/wireless/bcm43xx/bcm43xx_wx.c
drivers/net/wireless/ipw2100.c
drivers/net/wireless/zd1211rw/zd_mac.c
drivers/net/wireless/zd1211rw/zd_usb.c
drivers/pci/pci-driver.c
drivers/pci/pci-sysfs.c
drivers/pci/pci.c
drivers/pci/setup-bus.c
drivers/pci/setup-irq.c
drivers/pcmcia/at91_cf.c
drivers/pcmcia/soc_common.c
drivers/pnp/pnpacpi/Kconfig
drivers/ps3/Makefile
drivers/ps3/sys-manager.c [new file with mode: 0644]
drivers/ps3/vuart.c
drivers/ps3/vuart.h
drivers/scsi/ide-scsi.c
drivers/scsi/sd.c
drivers/serial/Kconfig
drivers/serial/atmel_serial.c
drivers/serial/cpm_uart/cpm_uart_cpm2.c
drivers/serial/imx.c
drivers/serial/mpc52xx_uart.c
drivers/serial/serial_cs.c
drivers/usb/Makefile
drivers/usb/atm/ueagle-atm.c
drivers/usb/class/cdc-acm.c
drivers/usb/core/devices.c
drivers/usb/core/devio.c
drivers/usb/core/driver.c
drivers/usb/core/endpoint.c
drivers/usb/core/generic.c
drivers/usb/core/hub.c
drivers/usb/core/message.c
drivers/usb/core/otg_whitelist.h
drivers/usb/core/sysfs.c
drivers/usb/gadget/at91_udc.c
drivers/usb/gadget/pxa2xx_udc.c
drivers/usb/gadget/pxa2xx_udc.h
drivers/usb/gadget/serial.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-hub.c
drivers/usb/host/isp116x-hcd.c
drivers/usb/host/ohci-at91.c
drivers/usb/host/ohci-hcd.c
drivers/usb/input/hid-core.c
drivers/usb/misc/Kconfig
drivers/usb/misc/Makefile
drivers/usb/misc/appledisplay.c
drivers/usb/misc/berry_charge.c [new file with mode: 0644]
drivers/usb/net/Kconfig
drivers/usb/net/asix.c
drivers/usb/net/cdc_subset.c
drivers/usb/net/usbnet.c
drivers/usb/serial/airprime.c
drivers/usb/serial/cp2101.c
drivers/usb/serial/generic.c
drivers/usb/serial/option.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/pl2303.h
drivers/usb/storage/scsiglue.c
drivers/usb/storage/unusual_devs.h
drivers/usb/usb-skeleton.c
fs/debugfs/file.c
fs/debugfs/inode.c
fs/partitions/check.c
fs/sysfs/file.c
include/acpi/acinterp.h
include/acpi/acobject.h
include/acpi/acpi_drivers.h
include/acpi/acpiosxf.h
include/asm-arm/.gitignore [new file with mode: 0644]
include/asm-arm/arch-at91/at91_aic.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_dbgu.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_ecc.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_lcdc.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_mci.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_pio.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_pit.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_pmc.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_rstc.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_rtc.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_rtt.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_shdwc.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_spi.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_ssc.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_st.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_tc.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_twi.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91_wdt.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91rm9200.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91rm9200_emac.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91rm9200_mc.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91sam9260.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91sam9260_matrix.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91sam9261.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91sam9261_matrix.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91sam9263.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91sam9263_matrix.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91sam926x_mc.h [new file with mode: 0644]
include/asm-arm/arch-at91/board.h [new file with mode: 0644]
include/asm-arm/arch-at91/cpu.h [new file with mode: 0644]
include/asm-arm/arch-at91/debug-macro.S [new file with mode: 0644]
include/asm-arm/arch-at91/dma.h [new file with mode: 0644]
include/asm-arm/arch-at91/entry-macro.S [new file with mode: 0644]
include/asm-arm/arch-at91/gpio.h [new file with mode: 0644]
include/asm-arm/arch-at91/hardware.h [new file with mode: 0644]
include/asm-arm/arch-at91/io.h [new file with mode: 0644]
include/asm-arm/arch-at91/irqs.h [new file with mode: 0644]
include/asm-arm/arch-at91/memory.h [new file with mode: 0644]
include/asm-arm/arch-at91/system.h [new file with mode: 0644]
include/asm-arm/arch-at91/timex.h [new file with mode: 0644]
include/asm-arm/arch-at91/uncompress.h [new file with mode: 0644]
include/asm-arm/arch-at91/vmalloc.h [new file with mode: 0644]
include/asm-arm/arch-at91rm9200/at91_aic.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_dbgu.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_ecc.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_lcdc.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_mci.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_pdc.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_pio.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_pit.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_pmc.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_rstc.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_rtc.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_rtt.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_shdwc.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_spi.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_ssc.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_st.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_tc.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_twi.h [deleted file]
include/asm-arm/arch-at91rm9200/at91_wdt.h [deleted file]
include/asm-arm/arch-at91rm9200/at91rm9200.h [deleted file]
include/asm-arm/arch-at91rm9200/at91rm9200_emac.h [deleted file]
include/asm-arm/arch-at91rm9200/at91rm9200_mc.h [deleted file]
include/asm-arm/arch-at91rm9200/at91sam9260.h [deleted file]
include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h [deleted file]
include/asm-arm/arch-at91rm9200/at91sam9261.h [deleted file]
include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h [deleted file]
include/asm-arm/arch-at91rm9200/at91sam926x_mc.h [deleted file]
include/asm-arm/arch-at91rm9200/board.h [deleted file]
include/asm-arm/arch-at91rm9200/cpu.h [deleted file]
include/asm-arm/arch-at91rm9200/debug-macro.S [deleted file]
include/asm-arm/arch-at91rm9200/dma.h [deleted file]
include/asm-arm/arch-at91rm9200/entry-macro.S [deleted file]
include/asm-arm/arch-at91rm9200/gpio.h [deleted file]
include/asm-arm/arch-at91rm9200/hardware.h [deleted file]
include/asm-arm/arch-at91rm9200/io.h [deleted file]
include/asm-arm/arch-at91rm9200/irqs.h [deleted file]
include/asm-arm/arch-at91rm9200/memory.h [deleted file]
include/asm-arm/arch-at91rm9200/system.h [deleted file]
include/asm-arm/arch-at91rm9200/timex.h [deleted file]
include/asm-arm/arch-at91rm9200/uncompress.h [deleted file]
include/asm-arm/arch-at91rm9200/vmalloc.h [deleted file]
include/asm-arm/arch-ep93xx/ep93xx-regs.h
include/asm-arm/arch-ep93xx/irqs.h
include/asm-arm/arch-ep93xx/platform.h
include/asm-arm/arch-imx/entry-macro.S
include/asm-arm/arch-iop32x/io.h
include/asm-arm/arch-iop33x/io.h
include/asm-arm/arch-ixp4xx/avila.h [new file with mode: 0644]
include/asm-arm/arch-ixp4xx/hardware.h
include/asm-arm/arch-ixp4xx/irqs.h
include/asm-arm/arch-ixp4xx/udc.h
include/asm-arm/arch-ns9xxx/board.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/clock.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/debug-macro.S [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/dma.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/entry-macro.S [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/hardware.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/io.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/irqs.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/memory.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/processor.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/regs-bbu.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/regs-mem.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/regs-sys.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/system.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/timex.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/uncompress.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/vmalloc.h [new file with mode: 0644]
include/asm-arm/arch-pxa/pxa-regs.h
include/asm-arm/arch-pxa/udc.h
include/asm-arm/arch-realview/hardware.h
include/asm-arm/arch-realview/irqs.h
include/asm-arm/arch-realview/platform.h
include/asm-arm/arch-realview/scu.h [new file with mode: 0644]
include/asm-arm/arch-s3c2410/dma.h
include/asm-arm/arch-s3c2410/irqs.h
include/asm-arm/arch-s3c2410/regs-adc.h
include/asm-arm/arch-s3c2410/regs-gpio.h
include/asm-arm/arch-s3c2410/regs-s3c2443-clock.h [new file with mode: 0644]
include/asm-arm/arch-s3c2410/regs-serial.h
include/asm-arm/arch-s3c2410/reset.h [new file with mode: 0644]
include/asm-arm/arch-s3c2410/system.h
include/asm-arm/arch-s3c2410/udc.h [new file with mode: 0644]
include/asm-arm/cacheflush.h
include/asm-arm/checksum.h
include/asm-arm/device.h
include/asm-arm/dma-mapping.h
include/asm-arm/domain.h
include/asm-arm/hardware/arm_scu.h
include/asm-arm/hardware/cache-l2x0.h [new file with mode: 0644]
include/asm-arm/hardware/gic.h
include/asm-arm/hardware/iop3xx.h
include/asm-arm/hardware/sa1111.h
include/asm-arm/kexec.h [new file with mode: 0644]
include/asm-arm/pgtable.h
include/asm-arm/plat-s3c24xx/clock.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/common-smdk.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/cpu.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/devs.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/dma.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/irq.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/pm.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/s3c2400.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/s3c2410.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/s3c2412.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/s3c2440.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/s3c2442.h [new file with mode: 0644]
include/asm-arm/plat-s3c24xx/s3c2443.h [new file with mode: 0644]
include/asm-arm/system.h
include/asm-arm/tlbflush.h
include/asm-arm/unistd.h
include/asm-avr32/arch-at32ap/at91_pdc.h [deleted file]
include/asm-i386/acpi.h
include/asm-powerpc/atomic.h
include/asm-powerpc/dcr-native.h
include/asm-powerpc/pmi.h [new file with mode: 0644]
include/asm-powerpc/prom.h
include/asm-powerpc/ps3.h
include/asm-powerpc/ucc_slow.h
include/linux/acpi.h
include/linux/atmel_pdc.h [new file with mode: 0644]
include/linux/debugfs.h
include/linux/device.h
include/linux/ide.h
include/linux/kexec.h
include/linux/kmod.h
include/linux/libata.h
include/linux/module.h
include/linux/moduleparam.h
include/linux/pci.h
include/linux/pci_ids.h
include/linux/usb.h
include/linux/usb/cdc.h
include/linux/usb/ch9.h
include/linux/usb/serial.h
include/linux/usb_usual.h
include/linux/usbdevice_fs.h
include/pcmcia/ciscode.h
include/rdma/ib_addr.h
include/rdma/ib_sa.h
include/rdma/rdma_cm.h
include/rdma/rdma_cm_ib.h
include/rdma/rdma_user_cm.h
include/scsi/scsi_device.h
kernel/kmod.c
kernel/module.c
kernel/params.c
lib/kobject.c
net/core/net-sysfs.c
net/ieee80211/ieee80211_tx.c
sound/arm/aaci.c
sound/arm/aaci.h

diff --git a/Documentation/acpi-hotkey.txt b/Documentation/acpi-hotkey.txt
deleted file mode 100644 (file)
index 38040fa..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-driver/acpi/hotkey.c implement:
-1. /proc/acpi/hotkey/event_config 
-(event based hotkey or event config interface):
-a. add a  event based hotkey(event) : 
-echo "0:bus::action:method:num:num" > event_config
-
-b. delete a event based hotkey(event): 
-echo "1:::::num:num" > event_config
-
-c.  modify a event based hotkey(event):    
-echo "2:bus::action:method:num:num" > event_config
-
-2. /proc/acpi/hotkey/poll_config 
-(polling based hotkey or event config interface):
-a.add a polling based hotkey(event) :  
-echo "0:bus:method:action:method:num" > poll_config
-this adding command will create a proc file 
-/proc/acpi/hotkey/method, which is used to get 
-result of polling.
-
-b.delete a polling based hotkey(event):        
-echo "1:::::num" > event_config
-
-c.modify a polling based hotkey(event):    
-echo "2:bus:method:action:method:num" > poll_config
-
-3./proc/acpi/hotkey/action 
-(interface to call aml method associated with a 
-specific hotkey(event))
-echo "event_num:event_type:event_argument" > 
-       /proc/acpi/hotkey/action.
-The result of the execution of this aml method is 
-attached to /proc/acpi/hotkey/poll_method, which is dynamically
-created.  Please use command "cat /proc/acpi/hotkey/polling_method" 
-to retrieve it.
-
-Note: Use cmdline "acpi_generic_hotkey" to over-ride
-platform-specific with generic driver.
diff --git a/Documentation/arm/Samsung-S3C24XX/DMA.txt b/Documentation/arm/Samsung-S3C24XX/DMA.txt
new file mode 100644 (file)
index 0000000..37f4edc
--- /dev/null
@@ -0,0 +1,46 @@
+                       S3C2410 DMA
+                       ===========
+
+Introduction
+------------
+
+   The kernel provides an interface to manage DMA transfers
+   using the DMA channels in the cpu, so that the central
+   duty of managing channel mappings, and programming the
+   channel generators is in one place.
+
+
+DMA Channel Ordering
+--------------------
+
+   Many of the range do not have connections for the DMA
+   channels to all sources, which means that some devices
+   have a restricted number of channels that can be used.
+
+   To allow flexibilty for each cpu type and board, the
+   dma code can be given an dma ordering structure which
+   allows the order of channel search to be specified, as
+   well as allowing the prohibition of certain claims.
+
+   struct s3c24xx_dma_order has a list of channels, and
+   each channel within has a slot for a list of dma
+   channel numbers. The slots are searched in order, for
+   the presence of a dma channel number with DMA_CH_VALID
+   orred in.
+
+   If the order has the flag DMA_CH_NEVER set, then after
+   checking the channel list, the system will return no
+   found channel, thus denying the request.
+
+   A board support file can call s3c24xx_dma_order_set()
+   to register an complete ordering set. The routine will
+   copy the data, so the original can be discared with
+   __initdata.
+
+
+Authour
+-------
+
+Ben Dooks,
+Copyright (c) 2007 Ben Dooks, Simtec Electronics
+Licensed under the GPL v2
index 28d014714ab8930fbfb9c3c65fb0f85644b807b4..c31b76fa66c462601a92054221baea08643057da 100644 (file)
@@ -8,13 +8,10 @@ Introduction
 
   The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported
   by the 's3c2410' architecture of ARM Linux. Currently the S3C2410,
-  S3C2440 and S3C2442 devices are supported.
+  S3C2412, S3C2413, S3C2440 and S3C2442 devices are supported.
 
   Support for the S3C2400 series is in progress.
 
-  Support for the S3C2412 and S3C2413 CPUs is being merged.
-
-
 Configuration
 -------------
 
@@ -26,6 +23,22 @@ Configuration
   please check the machine specific documentation.
 
 
+Layout
+------
+
+  The core support files are located in the platform code contained in
+  arch/arm/plat-s3c24xx with headers in include/asm-arm/plat-s3c24xx.
+  This directory should be kept to items shared between the platform
+  code (arch/arm/plat-s3c24xx) and the arch/arm/mach-s3c24* code.
+
+  Each cpu has a directory with the support files for it, and the
+  machines that carry the device. For example S3C2410 is contained
+  in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440
+
+  Register, kernel and platform data definitions are held in the
+  include/asm-arm/arch-s3c2410 directory.
+
+
 Machines
 --------
 
index e1bc0c534ef929912dc219df8a1ccddc3bcf2a2b..6a451f47d40f3ede1ee6b726b5782d13ed145d6b 100644 (file)
@@ -253,29 +253,6 @@ Who:       Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
 
 ---------------------------
 
-<<<<<<< test:Documentation/feature-removal-schedule.txt
-What:  ACPI hotkey driver (CONFIG_ACPI_HOTKEY)
-When:  2.6.21
-Why:   hotkey.c was an attempt to consolidate multiple drivers that use
-       ACPI to implement hotkeys.  However, hotkeys are not documented
-       in the ACPI specification, so the drivers used undocumented
-       vendor-specific hooks and turned out to be more different than
-       the same.
-
-       Further, the keys and the features supplied by each platform
-       are different, so there will always be a need for
-       platform-specific drivers.
-
-       So the new plan is to delete hotkey.c and instead, work on the
-       platform specific drivers to try to make them look the same
-       to the user when they supply the same features.
-
-       hotkey.c has always depended on CONFIG_EXPERIMENTAL
-
-Who:   Len Brown <len.brown@intel.com>
-
----------------------------
-
 What:  /sys/firmware/acpi/namespace
 When:  2.6.21
 Why:   The ACPI namespace is effectively the symbol list for
index abd575cfc759acbf085644ebe9b7dc04dd8ce81d..35470de14a9530bf9b7bb3af4cc80724fcf68a9b 100644 (file)
@@ -48,6 +48,7 @@ parameter is applicable:
        ISAPNP  ISA PnP code is enabled.
        ISDN    Appropriate ISDN support is enabled.
        JOY     Appropriate joystick support is enabled.
+       LIBATA  Libata driver is enabled
        LP      Printer support is enabled.
        LOOP    Loopback device support is enabled.
        M68k    M68k architecture is enabled.
@@ -1038,6 +1039,10 @@ and is between 256 and 4096 characters. It is defined in the file
                        emulation library even if a 387 maths coprocessor
                        is present.
 
+       noacpi          [LIBATA] Disables use of ACPI in libata suspend/resume
+                       when set.
+                       Format: <int>
+
        noaliencache    [MM, NUMA] Disables the allcoation of alien caches in
                        the slab allocator.  Saves per-node memory, but will
                        impact performance on real NUMA hardware.
@@ -1275,6 +1280,12 @@ and is between 256 and 4096 characters. It is defined in the file
                                This sorting is done to get a device
                                order compatible with older (<= 2.4) kernels.
                nobfsort        Don't sort PCI devices into breadth-first order.
+               cbiosize=nn[KMG]        The fixed amount of bus space which is
+                               reserved for the CardBus bridge's IO window.
+                               The default value is 256 bytes.
+               cbmemsize=nn[KMG]       The fixed amount of bus space which is
+                               reserved for the CardBus bridge's memory
+                               window. The default value is 64 megabytes.
 
        pcmv=           [HW,PCMCIA] BadgePAD 4
 
index fd5028eca13e68a99cee05d613eff1ac43b9b9a2..cdf2f3c0ab14f8398bee52c1e4a39c41984b28b6 100644 (file)
@@ -205,8 +205,8 @@ Tips on when/where to use the above attributes:
          exclusively called by the probe() routine, can be marked __devinit.
          Ditto for remove() and __devexit.
 
-       o If mydriver_probe() is marked with __devinit(), then all address
-         references to mydriver_probe must use __devexit_p(mydriver_probe)
+       o If mydriver_remove() is marked with __devexit(), then all address
+         references to mydriver_remove must use __devexit_p(mydriver_remove)
          (in the struct pci_driver declaration for example).
          __devexit_p() will generate the function name _or_ NULL if the
          function will be discarded.  For an example, see drivers/net/tg3.c.
index 3b514672b80ed3ef6d34b179dc65d35e366f0126..b41397d6430aa4a6a589d278e07d74f739b2f60e 100644 (file)
@@ -497,7 +497,7 @@ looks like in practice.
       |   |- device_type = "cpu"
       |   |- reg = <0>
       |   |- clock-frequency = <5f5e1000>
-      |   |- linux,boot-cpu
+      |   |- 64-bit
       |   |- linux,phandle = <2>
       |
       o memory@0
@@ -509,7 +509,6 @@ looks like in practice.
       o chosen
         |- name = "chosen"
         |- bootargs = "root=/dev/sda2"
-        |- linux,platform = <00000600>
         |- linux,phandle = <4>
 
 This tree is almost a minimal tree. It pretty much contains the
@@ -519,7 +518,7 @@ physical memory layout.  It also includes misc information passed
 through /chosen, like in this example, the platform type (mandatory)
 and the kernel command line arguments (optional).
 
-The /cpus/PowerPC,970@0/linux,boot-cpu property is an example of a
+The /cpus/PowerPC,970@0/64-bit property is an example of a
 property without a value. All other properties have a value. The
 significance of the #address-cells and #size-cells properties will be
 explained in chapter IV which defines precisely the required nodes and
@@ -733,8 +732,7 @@ address which can extend beyond that limit.
       that typically get driven by the same platform code in the
       kernel, you would use a different "model" property but put a
       value in "compatible". The kernel doesn't directly use that
-      value (see /chosen/linux,platform for how the kernel chooses a
-      platform type) but it is generally useful.
+      value but it is generally useful.
 
   The root node is also generally where you add additional properties
   specific to your board like the serial number if any, that sort of
@@ -778,7 +776,6 @@ address which can extend beyond that limit.
       bytes
     - d-cache-size : one cell, size of L1 data cache in bytes
     - i-cache-size : one cell, size of L1 instruction cache in bytes
-    - linux, boot-cpu : Should be defined if this cpu is the boot cpu.
 
   Recommended properties:
 
@@ -843,11 +840,6 @@ address which can extend beyond that limit.
   the prom_init() trampoline when booting with an OF client interface,
   but that you have to provide yourself when using the flattened format.
 
-  Required properties:
-
-    - linux,platform : This is your platform number as assigned by the
-      architecture maintainers
-
   Recommended properties:
 
     - bootargs : This zero-terminated string is passed as the kernel
diff --git a/Documentation/sony-laptop.txt b/Documentation/sony-laptop.txt
new file mode 100644 (file)
index 0000000..dfd26df
--- /dev/null
@@ -0,0 +1,106 @@
+Sony Notebook Control Driver (SNC) Readme
+-----------------------------------------
+       Copyright (C) 2004- 2005 Stelian Pop <stelian@popies.net>
+       Copyright (C) 2007 Mattia Dongili <malattia@linux.it>
+
+This mini-driver drives the SNC device present in the ACPI BIOS of
+the Sony Vaio laptops.
+
+It gives access to some extra laptop functionalities. In its current
+form, this driver let the user set or query the screen brightness
+through the backlight subsystem and remove/apply power to some devices.
+
+Backlight control:
+------------------
+If your laptop model supports it, you will find sysfs files in the
+/sys/class/backlight/sony/
+directory. You will be able to query and set the current screen
+brightness:
+       brightness              get/set screen brightness (an iteger
+                               between 0 and 7)
+       actual_brightness       reading from this file will query the HW
+                               to get real brightness value
+       max_brightness          the maximum brightness value
+
+
+Platform specific:
+------------------
+Loading the sony-laptop module will create a
+/sys/devices/platform/sony-laptop/
+directory populated with some files.
+
+You then read/write integer values from/to those files by using
+standard UNIX tools.
+
+The files are:
+       brightness_default      screen brightness which will be set
+                               when the laptop will be rebooted
+       cdpower                 power on/off the internal CD drive
+       audiopower              power on/off the internal sound card
+       lanpower                power on/off the internal ethernet card
+                               (only in debug mode)
+
+Note that some files may be missing if they are not supported
+by your particular laptop model.
+
+Example usage:
+       # echo "1" > /sys/devices/platform/sony-laptop/brightness_default
+sets the lowest screen brightness for the next and later reboots,
+       # echo "8" > /sys/devices/platform/sony-laptop/brightness_default
+sets the highest screen brightness for the next and later reboots,
+       # cat /sys/devices/platform/sony-laptop/brightness_default
+retrieves the value.
+
+       # echo "0" > /sys/devices/platform/sony-laptop/audiopower
+powers off the sound card,
+       # echo "1" > /sys/devices/platform/sony-laptop/audiopower
+powers on the sound card.
+
+Development:
+------------
+
+If you want to help with the development of this driver (and
+you are not afraid of any side effects doing strange things with
+your ACPI BIOS could have on your laptop), load the driver and
+pass the option 'debug=1'.
+
+REPEAT: DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS.
+
+In your kernel logs you will find the list of all ACPI methods
+the SNC device has on your laptop. You can see the GCDP/GCDP methods
+used to pwer on/off the CD drive, but there are others.
+
+I HAVE NO IDEA WHAT THOSE METHODS DO.
+
+The sony-laptop driver creates, for some of those methods (the most
+current ones found on several Vaio models), an entry under
+/sys/devices/platform/sony-laptop, just like the 'cdpower' one.
+You can create other entries corresponding to your own laptop methods by
+further editing the source (see the 'sony_acpi_values' table, and add a new
+entry to this table with your get/set method names using the
+HANDLE_NAMES macro).
+
+Your mission, should you accept it, is to try finding out what
+those entries are for, by reading/writing random values from/to those
+files and find out what is the impact on your laptop.
+
+Should you find anything interesting, please report it back to me,
+I will not disavow all knowledge of your actions :)
+
+Bugs/Limitations:
+-----------------
+
+* This driver is not based on official documentation from Sony
+  (because there is none), so there is no guarantee this driver
+  will work at all, or do the right thing. Although this hasn't
+  happened to me, this driver could do very bad things to your
+  laptop, including permanent damage.
+
+* The sony-laptop and sonypi drivers do not interact at all. In the
+  future, sonypi could use sony-laptop to do (part of) its business.
+
+* spicctrl, which is the userspace tool used to communicate with the
+  sonypi driver (through /dev/sonypi) does not try to use the
+  sony-laptop driver. In the future, spicctrl could try sonypi first,
+  and if it isn't present, try sony-laptop instead.
+
index b0fd71b3f66f6a20633fcd7d8f89d0959555cbde..270c6b006b91560fad13afe140ed5aabfdcacd76 100644 (file)
@@ -247,6 +247,13 @@ L: linux-acpi@vger.kernel.org
 W:     http://acpi.sourceforge.net/
 S:     Supported
 
+ACPI VIDEO DRIVER
+P:     Luming Yu
+M:     luming.yu@intel.com
+L:     linux-acpi@vger.kernel.org
+W:     http://acpi.sourceforge.net/
+S:     Supported
+
 AD1816 SOUND DRIVER
 P:     Thorsten Knabe
 M:     Thorsten Knabe <linux@thorsten-knabe.de>
@@ -2623,8 +2630,8 @@ T:        git kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
 S:     Maintained
 
 PCNET32 NETWORK DRIVER
-P:     Thomas Bogendörfer
-M:     tsbogend@alpha.franken.de
+P:     Don Fry
+M:     pcnet32@verizon.net
 L:     netdev@vger.kernel.org
 S:     Maintained
 
@@ -3061,6 +3068,8 @@ S:        Maintained
 SONY VAIO CONTROL DEVICE DRIVER
 P:     Stelian Pop
 M:     stelian@popies.net
+P:     Mattia Dongili
+M:     malattia@linux.it
 W:     http://popies.net/sonypi/
 S:     Maintained
 
index 5c795193ebbad56bcde85161ffaab4fde02e2e90..8bf97e0eacdb6ddcdbfec048fce20de9b88b6908 100644 (file)
@@ -245,6 +245,8 @@ config ARCH_IOP33X
 
 config ARCH_IOP13XX
        bool "IOP13xx-based"
+       depends on MMU
+       select PLAT_IOP
        select PCI
        help
          Support for Intel's IOP13XX (XScale) family of processors.
@@ -283,6 +285,14 @@ config ARCH_L7200
          If you have any questions or comments about the Linux kernel port
          to this board, send e-mail to <sjhill@cotw.com>.
 
+config ARCH_NS9XXX
+       bool "NetSilicon NS9xxx"
+       help
+         Say Y here if you intend to run this kernel on a NetSilicon NS9xxx
+         System.
+
+         <http://www.digi.com/products/microprocessors/index.jsp>
+
 config ARCH_PNX4008
        bool "Philips Nexperia PNX4008 Mobile"
        help
@@ -292,6 +302,7 @@ config ARCH_PXA
        bool "PXA2xx-based"
        depends on MMU
        select ARCH_MTD_XIP
+       select GENERIC_TIME
        help
          Support for Intel's PXA2XX processor line.
 
@@ -316,7 +327,7 @@ config ARCH_SA1100
          Support for StrongARM 11x0 based boards.
 
 config ARCH_S3C2410
-       bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442"
+       bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
        help
          Samsung S3C2410X CPU based systems, such as the Simtec Electronics
          BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
@@ -376,7 +387,16 @@ source "arch/arm/mach-omap1/Kconfig"
 
 source "arch/arm/mach-omap2/Kconfig"
 
+source "arch/arm/plat-s3c24xx/Kconfig"
+
+if ARCH_S3C2410
+source "arch/arm/mach-s3c2400/Kconfig"
 source "arch/arm/mach-s3c2410/Kconfig"
+source "arch/arm/mach-s3c2412/Kconfig"
+source "arch/arm/mach-s3c2440/Kconfig"
+source "arch/arm/mach-s3c2442/Kconfig"
+source "arch/arm/mach-s3c2443/Kconfig"
+endif
 
 source "arch/arm/mach-lh7a40x/Kconfig"
 
@@ -390,10 +410,12 @@ source "arch/arm/mach-aaec2000/Kconfig"
 
 source "arch/arm/mach-realview/Kconfig"
 
-source "arch/arm/mach-at91rm9200/Kconfig"
+source "arch/arm/mach-at91/Kconfig"
 
 source "arch/arm/mach-netx/Kconfig"
 
+source "arch/arm/mach-ns9xxx/Kconfig"
+
 # Definitions to make life easier
 config ARCH_ACORN
        bool
@@ -751,6 +773,20 @@ config XIP_PHYS_ADDR
          be linked for and stored to.  This address is dependent on your
          own flash usage.
 
+config KEXEC
+       bool "Kexec system call (EXPERIMENTAL)"
+       depends on EXPERIMENTAL
+       help
+         kexec is a system call that implements the ability to shutdown your
+         current kernel, and to start another kernel.  It is like a reboot
+         but it is indepedent of the system firmware.   And like a reboot
+         you can start any kernel with it, not just Linux.
+
+         It is an ongoing process to be certain the hardware in a machine
+         is properly shutdown, so do not be surprised if this code does not
+         initially work for you.  It may help to enable device hotplugging
+         support.
+
 endmenu
 
 if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX )
index 000f1100b5538f9f69da886fc0054d2d16746864..1320418b5d6f7328a383d023bac7ac1daadfe1db 100644 (file)
@@ -124,10 +124,12 @@ endif
  machine-$(CONFIG_ARCH_H720X)     := h720x
  machine-$(CONFIG_ARCH_AAEC2000)   := aaec2000
  machine-$(CONFIG_ARCH_REALVIEW)   := realview
- machine-$(CONFIG_ARCH_AT91)       := at91rm9200
- machine-$(CONFIG_ARCH_EP93XX)     := ep93xx
- machine-$(CONFIG_ARCH_PNX4008)    := pnx4008
- machine-$(CONFIG_ARCH_NETX)       := netx
+ machine-$(CONFIG_ARCH_AT91)      := at91rm9200
+ machine-$(CONFIG_ARCH_EP93XX)    := ep93xx
+ machine-$(CONFIG_ARCH_PNX4008)           := pnx4008
+ machine-$(CONFIG_ARCH_NETX)      := netx
+ machine-$(CONFIG_ARCH_NS9XXX)    := ns9xxx
+ textofs-$(CONFIG_ARCH_NS9XXX)    := 0x00108000
 
 ifeq ($(CONFIG_ARCH_EBSA110),y)
 # This is what happens if you forget the IOCS16 line.
@@ -149,7 +151,7 @@ MACHINE  := arch/arm/mach-$(machine-y)/
 else
 MACHINE  :=
 endif
-  
+
 export TEXT_OFFSET GZFLAGS MMUEXT
 
 # Do we have FASTFPE?
@@ -161,6 +163,11 @@ endif
 # If we have a machine-specific directory, then include it in the build.
 core-y                         += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
 core-y                         += $(MACHINE)
+core-$(CONFIG_ARCH_S3C2410)    += arch/arm/mach-s3c2400/
+core-$(CONFIG_ARCH_S3C2410)    += arch/arm/mach-s3c2412/
+core-$(CONFIG_ARCH_S3C2410)    += arch/arm/mach-s3c2440/
+core-$(CONFIG_ARCH_S3C2410)    += arch/arm/mach-s3c2442/
+core-$(CONFIG_ARCH_S3C2410)    += arch/arm/mach-s3c2443/
 core-$(CONFIG_FPE_NWFPE)       += arch/arm/nwfpe/
 core-$(CONFIG_FPE_FASTFPE)     += $(FASTFPE_OBJ)
 core-$(CONFIG_VFP)             += arch/arm/vfp/
@@ -168,6 +175,7 @@ core-$(CONFIG_VFP)          += arch/arm/vfp/
 # If we have a common platform directory, then include it in the build.
 core-$(CONFIG_PLAT_IOP)                += arch/arm/plat-iop/
 core-$(CONFIG_ARCH_OMAP)       += arch/arm/plat-omap/
+core-$(CONFIG_PLAT_S3C24XX)            += arch/arm/plat-s3c24xx/
 
 drivers-$(CONFIG_OPROFILE)      += arch/arm/oprofile/
 drivers-$(CONFIG_ARCH_CLPS7500)        += drivers/acorn/char/
diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
new file mode 100644 (file)
index 0000000..171a085
--- /dev/null
@@ -0,0 +1,2 @@
+Image
+zImage
diff --git a/arch/arm/boot/compressed/.gitignore b/arch/arm/boot/compressed/.gitignore
new file mode 100644 (file)
index 0000000..aefee20
--- /dev/null
@@ -0,0 +1 @@
+piggy.gz
index 2e635b814c14b06dd7cf84cbba4ccc2afd72cf58..6fbe7722aa44086403599f64f26c04aebece4568 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <asm/cacheflush.h>
 
-#undef DEBUG
 #undef STATS
 
 #ifdef STATS
@@ -66,14 +65,13 @@ struct dmabounce_pool {
 };
 
 struct dmabounce_device_info {
-       struct list_head node;
-
        struct device *dev;
        struct list_head safe_buffers;
 #ifdef STATS
        unsigned long total_allocs;
        unsigned long map_op_count;
        unsigned long bounce_count;
+       int attr_res;
 #endif
        struct dmabounce_pool   small;
        struct dmabounce_pool   large;
@@ -81,33 +79,23 @@ struct dmabounce_device_info {
        rwlock_t lock;
 };
 
-static LIST_HEAD(dmabounce_devs);
-
 #ifdef STATS
-static void print_alloc_stats(struct dmabounce_device_info *device_info)
+static ssize_t dmabounce_show(struct device *dev, struct device_attribute *attr,
+                             char *buf)
 {
-       printk(KERN_INFO
-               "%s: dmabounce: sbp: %lu, lbp: %lu, other: %lu, total: %lu\n",
-               device_info->dev->bus_id,
-               device_info->small.allocs, device_info->large.allocs,
+       struct dmabounce_device_info *device_info = dev->archdata.dmabounce;
+       return sprintf(buf, "%lu %lu %lu %lu %lu %lu\n",
+               device_info->small.allocs,
+               device_info->large.allocs,
                device_info->total_allocs - device_info->small.allocs -
                        device_info->large.allocs,
-               device_info->total_allocs);
+               device_info->total_allocs,
+               device_info->map_op_count,
+               device_info->bounce_count);
 }
-#endif
-
-/* find the given device in the dmabounce device list */
-static inline struct dmabounce_device_info *
-find_dmabounce_dev(struct device *dev)
-{
-       struct dmabounce_device_info *d;
 
-       list_for_each_entry(d, &dmabounce_devs, node)
-               if (d->dev == dev)
-                       return d;
-
-       return NULL;
-}
+static DEVICE_ATTR(dmabounce_stats, 0400, dmabounce_show, NULL);
+#endif
 
 
 /* allocate a 'safe' buffer and keep track of it */
@@ -162,8 +150,6 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr,
        if (pool)
                pool->allocs++;
        device_info->total_allocs++;
-       if (device_info->total_allocs % 1000 == 0)
-               print_alloc_stats(device_info);
 #endif
 
        write_lock_irqsave(&device_info->lock, flags);
@@ -218,20 +204,11 @@ free_safe_buffer(struct dmabounce_device_info *device_info, struct safe_buffer *
 
 /* ************************************************** */
 
-#ifdef STATS
-static void print_map_stats(struct dmabounce_device_info *device_info)
-{
-       dev_info(device_info->dev,
-               "dmabounce: map_op_count=%lu, bounce_count=%lu\n",
-               device_info->map_op_count, device_info->bounce_count);
-}
-#endif
-
 static inline dma_addr_t
 map_single(struct device *dev, void *ptr, size_t size,
                enum dma_data_direction dir)
 {
-       struct dmabounce_device_info *device_info = find_dmabounce_dev(dev);
+       struct dmabounce_device_info *device_info = dev->archdata.dmabounce;
        dma_addr_t dma_addr;
        int needs_bounce = 0;
 
@@ -281,10 +258,14 @@ map_single(struct device *dev, void *ptr, size_t size,
                ptr = buf->safe;
 
                dma_addr = buf->safe_dma_addr;
+       } else {
+               /*
+                * We don't need to sync the DMA buffer since
+                * it was allocated via the coherent allocators.
+                */
+               consistent_sync(ptr, size, dir);
        }
 
-       consistent_sync(ptr, size, dir);
-
        return dma_addr;
 }
 
@@ -292,7 +273,7 @@ static inline void
 unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
                enum dma_data_direction dir)
 {
-       struct dmabounce_device_info *device_info = find_dmabounce_dev(dev);
+       struct dmabounce_device_info *device_info = dev->archdata.dmabounce;
        struct safe_buffer *buf = NULL;
 
        /*
@@ -317,12 +298,12 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
                DO_STATS ( device_info->bounce_count++ );
 
                if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) {
-                       unsigned long ptr;
+                       void *ptr = buf->ptr;
 
                        dev_dbg(dev,
                                "%s: copy back safe %p to unsafe %p size %d\n",
-                               __func__, buf->safe, buf->ptr, size);
-                       memcpy(buf->ptr, buf->safe, size);
+                               __func__, buf->safe, ptr, size);
+                       memcpy(ptr, buf->safe, size);
 
                        /*
                         * DMA buffers must have the same cache properties
@@ -332,8 +313,8 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
                         * bidirectional case because we know the cache
                         * lines will be coherent with the data written.
                         */
-                       ptr = (unsigned long)buf->ptr;
                        dmac_clean_range(ptr, ptr + size);
+                       outer_clean_range(__pa(ptr), __pa(ptr) + size);
                }
                free_safe_buffer(device_info, buf);
        }
@@ -343,7 +324,7 @@ static inline void
 sync_single(struct device *dev, dma_addr_t dma_addr, size_t size,
                enum dma_data_direction dir)
 {
-       struct dmabounce_device_info *device_info = find_dmabounce_dev(dev);
+       struct dmabounce_device_info *device_info = dev->archdata.dmabounce;
        struct safe_buffer *buf = NULL;
 
        if (device_info)
@@ -397,7 +378,10 @@ sync_single(struct device *dev, dma_addr_t dma_addr, size_t size,
                default:
                        BUG();
                }
-               consistent_sync(buf->safe, size, dir);
+               /*
+                * No need to sync the safe buffer - it was allocated
+                * via the coherent allocators.
+                */
        } else {
                consistent_sync(dma_to_virt(dev, dma_addr), size, dir);
        }
@@ -604,9 +588,10 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
        device_info->total_allocs = 0;
        device_info->map_op_count = 0;
        device_info->bounce_count = 0;
+       device_info->attr_res = device_create_file(dev, &dev_attr_dmabounce_stats);
 #endif
 
-       list_add(&device_info->node, &dmabounce_devs);
+       dev->archdata.dmabounce = device_info;
 
        printk(KERN_INFO "dmabounce: registered device %s on %s bus\n",
                dev->bus_id, dev->bus->name);
@@ -623,7 +608,9 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
 void
 dmabounce_unregister_dev(struct device *dev)
 {
-       struct dmabounce_device_info *device_info = find_dmabounce_dev(dev);
+       struct dmabounce_device_info *device_info = dev->archdata.dmabounce;
+
+       dev->archdata.dmabounce = NULL;
 
        if (!device_info) {
                printk(KERN_WARNING
@@ -645,12 +632,10 @@ dmabounce_unregister_dev(struct device *dev)
                dma_pool_destroy(device_info->large.pool);
 
 #ifdef STATS
-       print_alloc_stats(device_info);
-       print_map_stats(device_info);
+       if (device_info->attr_res == 0)
+               device_remove_file(dev, &dev_attr_dmabounce_stats);
 #endif
 
-       list_del(&device_info->node);
-
        kfree(device_info);
 
        printk(KERN_INFO "dmabounce: device %s on %s bus unregistered\n",
index 09b9d1b6844c05315dc50af6e0ea0ffacdfad725..4deece5fbdf467ac1161a24dff612f0b973d3fbb 100644 (file)
@@ -14,7 +14,9 @@
  *
  * o There is one CPU Interface per CPU, which sends interrupts sent
  *   by the Distributor, and interrupts generated locally, to the
- *   associated CPU.
+ *   associated CPU. The base address of the CPU interface is usually
+ *   aliased so that the same address points to different chips depending
+ *   on the CPU it is accessed from.
  *
  * Note that IRQs 0-31 are special - they are local to each CPU.
  * As such, the enable set/clear, pending set/clear and active bit
 #include <asm/mach/irq.h>
 #include <asm/hardware/gic.h>
 
-static void __iomem *gic_dist_base;
-static void __iomem *gic_cpu_base;
 static DEFINE_SPINLOCK(irq_controller_lock);
 
+struct gic_chip_data {
+       unsigned int irq_offset;
+       void __iomem *dist_base;
+       void __iomem *cpu_base;
+};
+
+#ifndef MAX_GIC_NR
+#define MAX_GIC_NR     1
+#endif
+
+static struct gic_chip_data gic_data[MAX_GIC_NR];
+
+static inline void __iomem *gic_dist_base(unsigned int irq)
+{
+       struct gic_chip_data *gic_data = get_irq_chip_data(irq);
+       return gic_data->dist_base;
+}
+
+static inline void __iomem *gic_cpu_base(unsigned int irq)
+{
+       struct gic_chip_data *gic_data = get_irq_chip_data(irq);
+       return gic_data->cpu_base;
+}
+
+static inline unsigned int gic_irq(unsigned int irq)
+{
+       struct gic_chip_data *gic_data = get_irq_chip_data(irq);
+       return irq - gic_data->irq_offset;
+}
+
 /*
  * Routines to acknowledge, disable and enable interrupts
  *
@@ -55,8 +85,8 @@ static void gic_ack_irq(unsigned int irq)
        u32 mask = 1 << (irq % 32);
 
        spin_lock(&irq_controller_lock);
-       writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4);
-       writel(irq, gic_cpu_base + GIC_CPU_EOI);
+       writel(mask, gic_dist_base(irq) + GIC_DIST_ENABLE_CLEAR + (gic_irq(irq) / 32) * 4);
+       writel(gic_irq(irq), gic_cpu_base(irq) + GIC_CPU_EOI);
        spin_unlock(&irq_controller_lock);
 }
 
@@ -65,7 +95,7 @@ static void gic_mask_irq(unsigned int irq)
        u32 mask = 1 << (irq % 32);
 
        spin_lock(&irq_controller_lock);
-       writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4);
+       writel(mask, gic_dist_base(irq) + GIC_DIST_ENABLE_CLEAR + (gic_irq(irq) / 32) * 4);
        spin_unlock(&irq_controller_lock);
 }
 
@@ -74,14 +104,14 @@ static void gic_unmask_irq(unsigned int irq)
        u32 mask = 1 << (irq % 32);
 
        spin_lock(&irq_controller_lock);
-       writel(mask, gic_dist_base + GIC_DIST_ENABLE_SET + (irq / 32) * 4);
+       writel(mask, gic_dist_base(irq) + GIC_DIST_ENABLE_SET + (gic_irq(irq) / 32) * 4);
        spin_unlock(&irq_controller_lock);
 }
 
 #ifdef CONFIG_SMP
 static void gic_set_cpu(unsigned int irq, cpumask_t mask_val)
 {
-       void __iomem *reg = gic_dist_base + GIC_DIST_TARGET + (irq & ~3);
+       void __iomem *reg = gic_dist_base(irq) + GIC_DIST_TARGET + (gic_irq(irq) & ~3);
        unsigned int shift = (irq % 4) * 8;
        unsigned int cpu = first_cpu(mask_val);
        u32 val;
@@ -95,6 +125,37 @@ static void gic_set_cpu(unsigned int irq, cpumask_t mask_val)
 }
 #endif
 
+static void fastcall gic_handle_cascade_irq(unsigned int irq,
+                                           struct irq_desc *desc)
+{
+       struct gic_chip_data *chip_data = get_irq_data(irq);
+       struct irq_chip *chip = get_irq_chip(irq);
+       unsigned int cascade_irq;
+       unsigned long status;
+
+       /* primary controller ack'ing */
+       chip->ack(irq);
+
+       spin_lock(&irq_controller_lock);
+       status = readl(chip_data->cpu_base + GIC_CPU_INTACK);
+       spin_unlock(&irq_controller_lock);
+
+       cascade_irq = (status & 0x3ff);
+       if (cascade_irq > 1020)
+               goto out;
+       if (cascade_irq < 32 || cascade_irq >= NR_IRQS) {
+               do_bad_IRQ(cascade_irq, desc);
+               goto out;
+       }
+
+       cascade_irq += chip_data->irq_offset;
+       generic_handle_irq(cascade_irq);
+
+ out:
+       /* primary controller unmasking */
+       chip->unmask(irq);
+}
+
 static struct irq_chip gic_chip = {
        .name           = "GIC",
        .ack            = gic_ack_irq,
@@ -105,15 +166,29 @@ static struct irq_chip gic_chip = {
 #endif
 };
 
-void __init gic_dist_init(void __iomem *base)
+void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
+{
+       if (gic_nr >= MAX_GIC_NR)
+               BUG();
+       if (set_irq_data(irq, &gic_data[gic_nr]) != 0)
+               BUG();
+       set_irq_chained_handler(irq, gic_handle_cascade_irq);
+}
+
+void __init gic_dist_init(unsigned int gic_nr, void __iomem *base,
+                         unsigned int irq_start)
 {
        unsigned int max_irq, i;
        u32 cpumask = 1 << smp_processor_id();
 
+       if (gic_nr >= MAX_GIC_NR)
+               BUG();
+
        cpumask |= cpumask << 8;
        cpumask |= cpumask << 16;
 
-       gic_dist_base = base;
+       gic_data[gic_nr].dist_base = base;
+       gic_data[gic_nr].irq_offset = (irq_start - 1) & ~31;
 
        writel(0, base + GIC_DIST_CTRL);
 
@@ -158,8 +233,9 @@ void __init gic_dist_init(void __iomem *base)
        /*
         * Setup the Linux IRQ subsystem.
         */
-       for (i = 29; i < max_irq; i++) {
+       for (i = irq_start; i < gic_data[gic_nr].irq_offset + max_irq; i++) {
                set_irq_chip(i, &gic_chip);
+               set_irq_chip_data(i, &gic_data[gic_nr]);
                set_irq_handler(i, handle_level_irq);
                set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
        }
@@ -167,9 +243,13 @@ void __init gic_dist_init(void __iomem *base)
        writel(1, base + GIC_DIST_CTRL);
 }
 
-void __cpuinit gic_cpu_init(void __iomem *base)
+void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base)
 {
-       gic_cpu_base = base;
+       if (gic_nr >= MAX_GIC_NR)
+               BUG();
+
+       gic_data[gic_nr].cpu_base = base;
+
        writel(0xf0, base + GIC_CPU_PRIMASK);
        writel(1, base + GIC_CPU_CTRL);
 }
@@ -179,6 +259,7 @@ void gic_raise_softirq(cpumask_t cpumask, unsigned int irq)
 {
        unsigned long map = *cpus_addr(cpumask);
 
-       writel(map << 16 | irq, gic_dist_base + GIC_DIST_SOFTINT);
+       /* this always happens on GIC0 */
+       writel(map << 16 | irq, gic_data[0].dist_base + GIC_DIST_SOFTINT);
 }
 #endif
diff --git a/arch/arm/configs/at91sam9263ek_defconfig b/arch/arm/configs/at91sam9263ek_defconfig
new file mode 100644 (file)
index 0000000..c72ab82
--- /dev/null
@@ -0,0 +1,1184 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.20-rc1
+# Mon Jan  8 16:06:54 2007
+#
+CONFIG_ARM=y
+# CONFIG_GENERIC_TIME is not set
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+CONFIG_ARCH_AT91=y
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Atmel AT91 System-on-Chip
+#
+# CONFIG_ARCH_AT91RM9200 is not set
+# CONFIG_ARCH_AT91SAM9260 is not set
+# CONFIG_ARCH_AT91SAM9261 is not set
+CONFIG_ARCH_AT91SAM9263=y
+
+#
+# AT91SAM9263 Board Type
+#
+CONFIG_MACH_AT91SAM9263EK=y
+
+#
+# AT91 Board Options
+#
+CONFIG_MTD_AT91_DATAFLASH_CARD=y
+# CONFIG_MTD_NAND_AT91_BUSWIDTH_16 is not set
+
+#
+# AT91 Feature Selections
+#
+# CONFIG_AT91_PROGRAMMABLE_CLOCKS is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_THUMB is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+
+#
+# Bus support
+#
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_PREEMPT is not set
+# CONFIG_NO_IDLE_HZ is not set
+CONFIG_HZ=100
+# CONFIG_AEABI is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
+# CONFIG_XIP_KERNEL is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+# CONFIG_APM is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+CONFIG_MTD_DATAFLASH=y
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+CONFIG_MTD_NAND_AT91=y
+# CONFIG_MTD_NAND_NANDSIM is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_TSDEV=y
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_UCB1400 is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_NVRAM is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_AT91=y
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_PCA is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_ATMEL=y
+# CONFIG_SPI_BITBANG is not set
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+# CONFIG_TIFM_CORE is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FIRMWARE_EDID is not set
+CONFIG_FB=y
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+
+#
+# Logo configuration
+#
+# CONFIG_LOGO is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_MULTITHREAD_PROBE is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_ACECAD is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_TOUCHSCREEN is not set
+# CONFIG_USB_YEALINK is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+# CONFIG_USB_APPLETOUCH is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET_MII is not set
+# CONFIG_USB_USBNET is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+CONFIG_USB_GADGET_AT91=y
+CONFIG_USB_AT91=y
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+CONFIG_USB_ZERO=m
+# CONFIG_USB_ETH is not set
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_AT91=m
+# CONFIG_MMC_TIFM_SD is not set
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+CONFIG_NLS_CODEPAGE_850=y
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+CONFIG_FRAME_POINTER=y
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+CONFIG_DEBUG_USER=y
+# CONFIG_DEBUG_ERRORS is not set
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_IOMAP_COPY=y
index 3de5c643848c744229ed614af7836ee7f54774a0..baa97698c744171069b92985e2c82a6dc8d4ba63 100644 (file)
@@ -1066,7 +1066,7 @@ CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_DRV_PCF8563 is not set
 # CONFIG_RTC_DRV_RS5C372 is not set
 # CONFIG_RTC_DRV_M48T86 is not set
-CONFIG_RTC_DRV_AT91=y
+CONFIG_RTC_DRV_AT91RM9200=y
 # CONFIG_RTC_DRV_TEST is not set
 
 #
index 2cadd51506bb574c747e9935d8fbb86e67bdaa19..88e5d28aeec72585b974590ed68601845852c8d5 100644 (file)
@@ -355,10 +355,12 @@ CONFIG_MTD_CFI_UTIL=y
 # Mapping drivers for chip access
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0
+CONFIG_MTD_PHYSMAP_LEN=0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=0
 # CONFIG_MTD_ARM_INTEGRATOR is not set
 # CONFIG_MTD_PLATRAM is not set
-CONFIG_MTD_CSB337=y
 
 #
 # Self-contained MTD device drivers
@@ -986,7 +988,7 @@ CONFIG_RTC_DRV_DS1307=y
 # CONFIG_RTC_DRV_PCF8583 is not set
 # CONFIG_RTC_DRV_RS5C372 is not set
 # CONFIG_RTC_DRV_M48T86 is not set
-CONFIG_RTC_DRV_AT91=y
+CONFIG_RTC_DRV_AT91RM9200=y
 # CONFIG_RTC_DRV_TEST is not set
 # CONFIG_RTC_DRV_V3020 is not set
 
index 94908c1df4cf36c05673376db78048b6ecb1667f..669f035896f9fc9882d8b77a5b05036dac518ba3 100644 (file)
@@ -355,10 +355,12 @@ CONFIG_MTD_CFI_UTIL=y
 # Mapping drivers for chip access
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0
+CONFIG_MTD_PHYSMAP_LEN=0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=0
 # CONFIG_MTD_ARM_INTEGRATOR is not set
 # CONFIG_MTD_PLATRAM is not set
-CONFIG_MTD_CSB637=y
 
 #
 # Self-contained MTD device drivers
index a4cdafc1548a1113abe42de978a1595a3bfc83d9..a0f48d54fbcc7f0d8402d21cbead1157d330099d 100644 (file)
@@ -718,7 +718,7 @@ CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_DRV_PCF8563 is not set
 # CONFIG_RTC_DRV_RS5C372 is not set
 # CONFIG_RTC_DRV_M48T86 is not set
-CONFIG_RTC_DRV_AT91=y
+CONFIG_RTC_DRV_AT91RM9200=y
 # CONFIG_RTC_DRV_TEST is not set
 
 #
diff --git a/arch/arm/configs/ns9xxx_defconfig b/arch/arm/configs/ns9xxx_defconfig
new file mode 100644 (file)
index 0000000..0e5794c
--- /dev/null
@@ -0,0 +1,621 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.20
+# Thu Feb 15 20:51:47 2007
+#
+CONFIG_ARM=y
+# CONFIG_GENERIC_TIME is not set
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_UTS_NS is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_L7200 is not set
+CONFIG_ARCH_NS9XXX=y
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# NS9xxx Implementations
+#
+CONFIG_MACH_CC9P9360DEV=y
+CONFIG_PROCESSOR_NS9360=y
+CONFIG_BOARD_A9M9750DEV=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_THUMB is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+
+#
+# Bus support
+#
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_PREEMPT is not set
+# CONFIG_NO_IDLE_HZ is not set
+CONFIG_HZ=100
+# CONFIG_AEABI is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=""
+# CONFIG_XIP_KERNEL is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+# CONFIG_APM is not set
+
+#
+# Networking
+#
+# CONFIG_NET is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_NETLINK is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# ISDN subsystem
+#
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_SERPORT is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_RSA is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+# CONFIG_TIFM_CORE is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+
+#
+# Graphics support
+#
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DETECT_SOFTLOCKUP is not set
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+CONFIG_FRAME_POINTER=y
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_ICEDCC=y
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_IOMAP_COPY=y
index 3b31a33d0080eab75165a7f1166a02ab2da00bd1..df19e3632038d8bc0d3252afa41a5fbd44cc7df0 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc4
-# Fri Nov  3 17:41:31 2006
+# Linux kernel version: 2.6.20
+# Thu Feb 15 11:26:24 2007
 #
 CONFIG_ARM=y
 # CONFIG_GENERIC_TIME is not set
@@ -11,6 +11,8 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_VECTORS_BASE=0xffff0000
@@ -37,13 +39,14 @@ CONFIG_SYSVIPC=y
 # CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
 CONFIG_UID16=y
-# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -76,7 +79,9 @@ CONFIG_KMOD=y
 # Block layer
 #
 CONFIG_BLOCK=y
+# CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
 
 #
 # IO Schedulers
@@ -110,6 +115,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_IXP2000 is not set
 # CONFIG_ARCH_IXP23XX is not set
@@ -122,54 +128,73 @@ CONFIG_ARCH_S3C2410=y
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
 # CONFIG_ARCH_OMAP is not set
+CONFIG_PLAT_S3C24XX=y
+CONFIG_CPU_S3C244X=y
+CONFIG_PM_SIMTEC=y
+# CONFIG_S3C2410_BOOT_WATCHDOG is not set
+# CONFIG_S3C2410_BOOT_ERROR_RESET is not set
+# CONFIG_S3C2410_PM_DEBUG is not set
+# CONFIG_S3C2410_PM_CHECK is not set
+CONFIG_S3C2410_LOWLEVEL_UART_PORT=0
+CONFIG_S3C2410_DMA=y
+# CONFIG_S3C2410_DMA_DEBUG is not set
+CONFIG_MACH_SMDK=y
 
 #
-# S3C24XX Implementations
+# S3C2400 Machines
 #
-# CONFIG_MACH_AML_M5900 is not set
-CONFIG_MACH_ANUBIS=y
-CONFIG_MACH_OSIRIS=y
-CONFIG_ARCH_BAST=y
-CONFIG_BAST_PC104_IRQ=y
+CONFIG_CPU_S3C2410=y
+CONFIG_CPU_S3C2410_DMA=y
+CONFIG_S3C2410_PM=y
+CONFIG_S3C2410_GPIO=y
+CONFIG_S3C2410_CLOCK=y
+
+#
+# S3C2410 Machines
+#
+CONFIG_ARCH_SMDK2410=y
 CONFIG_ARCH_H1940=y
+CONFIG_PM_H1940=y
 CONFIG_MACH_N30=y
-CONFIG_MACH_SMDK=y
-CONFIG_ARCH_SMDK2410=y
-CONFIG_ARCH_S3C2440=y
-CONFIG_SMDK2440_CPU2440=y
-CONFIG_SMDK2440_CPU2442=y
-CONFIG_MACH_S3C2413=y
-CONFIG_MACH_SMDK2413=y
-CONFIG_MACH_VR1000=y
-CONFIG_MACH_RX3715=y
+CONFIG_ARCH_BAST=y
 CONFIG_MACH_OTOM=y
-CONFIG_MACH_NEXCODER_2440=y
-CONFIG_MACH_VSTMS=y
-CONFIG_S3C2410_CLOCK=y
-CONFIG_S3C2410_PM=y
-CONFIG_CPU_S3C2410_DMA=y
-CONFIG_CPU_S3C2410=y
-CONFIG_S3C2412_PM=y
+CONFIG_MACH_AML_M5900=y
+CONFIG_BAST_PC104_IRQ=y
+CONFIG_MACH_VR1000=y
 CONFIG_CPU_S3C2412=y
-CONFIG_CPU_S3C244X=y
+CONFIG_S3C2412_DMA=y
+CONFIG_S3C2412_PM=y
+
+#
+# S3C2412 Machines
+#
+CONFIG_MACH_SMDK2413=y
+CONFIG_MACH_S3C2413=y
+CONFIG_MACH_VSTMS=y
 CONFIG_CPU_S3C2440=y
+CONFIG_S3C2440_DMA=y
+
+#
+# S3C2440 Machines
+#
+CONFIG_MACH_ANUBIS=y
+CONFIG_MACH_OSIRIS=y
+CONFIG_MACH_RX3715=y
+CONFIG_ARCH_S3C2440=y
+CONFIG_MACH_NEXCODER_2440=y
+CONFIG_SMDK2440_CPU2440=y
 CONFIG_CPU_S3C2442=y
 
 #
-# S3C2410 Boot
+# S3C2442 Machines
 #
-# CONFIG_S3C2410_BOOT_WATCHDOG is not set
-# CONFIG_S3C2410_BOOT_ERROR_RESET is not set
+CONFIG_SMDK2440_CPU2442=y
+CONFIG_CPU_S3C2443=y
 
 #
-# S3C2410 Setup
+# S3C2443 Machines
 #
-CONFIG_S3C2410_DMA=y
-# CONFIG_S3C2410_DMA_DEBUG is not set
-# CONFIG_S3C2410_PM_DEBUG is not set
-# CONFIG_S3C2410_PM_CHECK is not set
-CONFIG_PM_SIMTEC=y
-CONFIG_S3C2410_LOWLEVEL_UART_PORT=0
+CONFIG_MACH_SMDK2443=y
 
 #
 # Processor Type
@@ -196,6 +221,7 @@ CONFIG_CPU_CP15_MMU=y
 # CONFIG_CPU_DCACHE_DISABLE is not set
 # CONFIG_CPU_DCACHE_WRITETHROUGH is not set
 # CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
 
 #
 # Bus support
@@ -303,6 +329,7 @@ CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
@@ -385,6 +412,7 @@ CONFIG_MTD_CMDLINE_PARTS=y
 # User Modules And Translation Layers
 #
 CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
 CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
@@ -530,6 +558,11 @@ CONFIG_BLK_DEV_IDE_BAST=y
 # CONFIG_SCSI is not set
 # CONFIG_SCSI_NETLINK is not set
 
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
 #
 # Multi-device support (RAID and LVM)
 #
@@ -682,7 +715,7 @@ CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_DIGIEPCA is not set
 # CONFIG_MOXA_INTELLIO is not set
 # CONFIG_MOXA_SMARTIO is not set
-# CONFIG_ISI is not set
+# CONFIG_MOXA_SMARTIO_NEW is not set
 # CONFIG_SYNCLINKMP is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_RISCOM8 is not set
@@ -700,13 +733,14 @@ CONFIG_SERIAL_8250_NR_UARTS=8
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
-CONFIG_SERIAL_8250_SHARE_IRQ=y
-# CONFIG_SERIAL_8250_DETECT_IRQ is not set
-# CONFIG_SERIAL_8250_RSA is not set
 # CONFIG_SERIAL_8250_FOURPORT is not set
 # CONFIG_SERIAL_8250_ACCENT is not set
 # CONFIG_SERIAL_8250_BOCA is not set
+# CONFIG_SERIAL_8250_EXAR_ST16C554 is not set
 # CONFIG_SERIAL_8250_HUB6 is not set
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_RSA is not set
 
 #
 # Non-8250 serial port support
@@ -755,10 +789,6 @@ CONFIG_HW_RANDOM=y
 # CONFIG_NVRAM is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
-
-#
-# Ftape, the floppy tape device driver
-#
 # CONFIG_RAW_DRIVER is not set
 
 #
@@ -863,6 +893,7 @@ CONFIG_SENSORS_LM85=m
 # CONFIG_SENSORS_LM92 is not set
 # CONFIG_SENSORS_MAX1619 is not set
 # CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
 # CONFIG_SENSORS_SMSC47M1 is not set
 # CONFIG_SENSORS_SMSC47M192 is not set
 # CONFIG_SENSORS_SMSC47B397 is not set
@@ -870,6 +901,7 @@ CONFIG_SENSORS_LM85=m
 # CONFIG_SENSORS_W83781D is not set
 # CONFIG_SENSORS_W83791D is not set
 # CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
 # CONFIG_SENSORS_W83L785TS is not set
 # CONFIG_SENSORS_W83627HF is not set
 # CONFIG_SENSORS_W83627EHF is not set
@@ -951,6 +983,11 @@ CONFIG_FONT_8x16=y
 #
 # CONFIG_SOUND is not set
 
+#
+# HID Devices
+#
+CONFIG_HID=y
+
 #
 # USB support
 #
@@ -1028,6 +1065,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_KAWETH is not set
 # CONFIG_USB_PEGASUS is not set
 # CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET_MII is not set
 # CONFIG_USB_USBNET is not set
 CONFIG_USB_MON=y
 
@@ -1179,9 +1217,6 @@ CONFIG_RAMFS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
-CONFIG_JFFS_FS=y
-CONFIG_JFFS_FS_VERBOSE=0
-# CONFIG_JFFS_PROC_FS is not set
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
 CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -1191,7 +1226,7 @@ CONFIG_JFFS2_FS_WRITEBUFFER=y
 CONFIG_JFFS2_ZLIB=y
 CONFIG_JFFS2_RTIME=y
 # CONFIG_JFFS2_RUBIN is not set
-# CONFIG_CRAMFS is not set
+CONFIG_CRAMFS=y
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
@@ -1284,6 +1319,11 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+
 #
 # Profiling support
 #
@@ -1296,6 +1336,8 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_DETECT_SOFTLOCKUP=y
@@ -1311,12 +1353,10 @@ CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
-# CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
 CONFIG_FRAME_POINTER=y
 CONFIG_FORCED_INLINING=y
-# CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_ERRORS is not set
@@ -1339,6 +1379,7 @@ CONFIG_DEBUG_S3C2410_UART=0
 #
 # Library routines
 #
+CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
 CONFIG_CRC32=y
@@ -1346,3 +1387,4 @@ CONFIG_CRC32=y
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
 CONFIG_PLIST=y
+CONFIG_IOMAP_COPY=y
index 1b935fb94b8300a10552b45fc214e2e4d2735198..bb28087bf818df7022e9c6e2185068e102d52a6b 100644 (file)
@@ -18,6 +18,7 @@ obj-$(CONFIG_ARTHUR)          += arthur.o
 obj-$(CONFIG_ISA_DMA)          += dma-isa.o
 obj-$(CONFIG_PCI)              += bios32.o isa.o
 obj-$(CONFIG_SMP)              += smp.o
+obj-$(CONFIG_KEXEC)            += machine_kexec.o relocate_kernel.o
 obj-$(CONFIG_OABI_COMPAT)      += sys_oabi-compat.o
 
 obj-$(CONFIG_CRUNCH)           += crunch.o crunch-bits.o
index f7598cbc7ec5a788cf6f032a548372682f679feb..ae89cdd82b1677d2b29494bed10391bd0be7c587 100644 (file)
                CALL(sys_move_pages)
 /* 345 */      CALL(sys_getcpu)
                CALL(sys_ni_syscall)            /* eventually epoll_pwait */
+               CALL(sys_kexec_load)
 #ifndef syscalls_counted
 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
 #define syscalls_counted
index cec83783206e335a11f9a88f225ad3eba3ab6620..627d79414c9d68212382eaefe64af6f896035509 100644 (file)
@@ -75,6 +75,7 @@ static struct notifier_block crunch_notifier_block = {
 static int __init crunch_init(void)
 {
        thread_register_notifier(&crunch_notifier_block);
+       elf_hwcap |= HWCAP_CRUNCH;
 
        return 0;
 }
index 71257e3d513f4604ed1d01c3db5eb8fb565bcf47..f1c0fb974177803c0ec2510d79d4e9c72669164b 100644 (file)
@@ -1009,7 +1009,7 @@ ecard_probe(int slot, card_type_t type)
                ec->fiqmask = 4;
        }
 
-       for (i = 0; i < sizeof(blacklist) / sizeof(*blacklist); i++)
+       for (i = 0; i < ARRAY_SIZE(blacklist); i++)
                if (blacklist[i].manufacturer == ec->cid.manufacturer &&
                    blacklist[i].product == ec->cid.product) {
                        ec->card_desc = blacklist[i].type;
index 8517c3c3eb3393c8ba539add942342757c117f2b..cc10a093a5455fa9f1b156b502c5346e64a985b6 100644 (file)
@@ -99,7 +99,6 @@ common_invalid:
                                        @ cpsr_<exception>, "old_r0"
 
        mov     r0, sp
-       and     r2, r6, #0x1f
        b       bad_mode
 
 /*
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
new file mode 100644 (file)
index 0000000..863c664
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * machine_kexec.c - handle transition of Linux booting another kernel
+ */
+
+#include <linux/mm.h>
+#include <linux/kexec.h>
+#include <linux/delay.h>
+#include <linux/reboot.h>
+#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
+#include <asm/mmu_context.h>
+#include <asm/io.h>
+#include <asm/cacheflush.h>
+#include <asm/mach-types.h>
+
+const extern unsigned char relocate_new_kernel[];
+const extern unsigned int relocate_new_kernel_size;
+
+extern void setup_mm_for_reboot(char mode);
+
+extern unsigned long kexec_start_address;
+extern unsigned long kexec_indirection_page;
+extern unsigned long kexec_mach_type;
+
+/*
+ * Provide a dummy crash_notes definition while crash dump arrives to arm.
+ * This prevents breakage of crash_notes attribute in kernel/ksysfs.c.
+ */
+
+int machine_kexec_prepare(struct kimage *image)
+{
+       return 0;
+}
+
+void machine_kexec_cleanup(struct kimage *image)
+{
+}
+
+void machine_shutdown(void)
+{
+}
+
+void machine_crash_shutdown(struct pt_regs *regs)
+{
+}
+
+void machine_kexec(struct kimage *image)
+{
+       unsigned long page_list;
+       unsigned long reboot_code_buffer_phys;
+       void *reboot_code_buffer;
+
+
+       page_list = image->head & PAGE_MASK;
+
+       /* we need both effective and real address here */
+       reboot_code_buffer_phys =
+           page_to_pfn(image->control_code_page) << PAGE_SHIFT;
+       reboot_code_buffer = page_address(image->control_code_page);
+
+       /* Prepare parameters for reboot_code_buffer*/
+       kexec_start_address = image->start;
+       kexec_indirection_page = page_list;
+       kexec_mach_type = machine_arch_type;
+
+       /* copy our kernel relocation code to the control code page */
+       memcpy(reboot_code_buffer,
+              relocate_new_kernel, relocate_new_kernel_size);
+
+
+       flush_icache_range((unsigned long) reboot_code_buffer,
+                          (unsigned long) reboot_code_buffer + KEXEC_CONTROL_CODE_SIZE);
+       printk(KERN_INFO "Bye!\n");
+
+       cpu_proc_fin();
+       setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
+       cpu_reset(reboot_code_buffer_phys);
+}
index a9e8f7e55fd61edc8242f1193c95d49fb5d14d42..782af3cb213f42b42f912115309480d73165c6d7 100644 (file)
 #include <asm/uaccess.h>
 #include <asm/mach/time.h>
 
-extern const char *processor_modes[];
+static const char *processor_modes[] = {
+  "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" ,
+  "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26",
+  "USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "UK6_32" , "ABT_32" ,
+  "UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32"
+};
+
 extern void setup_mm_for_reboot(char mode);
 
 static volatile int hlt_counter;
diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S
new file mode 100644 (file)
index 0000000..7baadae
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * relocate_kernel.S - put the kernel image in place to boot
+ */
+
+#include <asm/kexec.h>
+
+       .globl relocate_new_kernel
+relocate_new_kernel:
+
+       ldr     r0,kexec_indirection_page
+       ldr     r1,kexec_start_address
+
+
+0:     /* top, read another word for the indirection page */
+       ldr     r3, [r0],#4
+
+       /* Is it a destination page. Put destination address to r4 */
+       tst     r3,#1,0
+       beq     1f
+       bic     r4,r3,#1
+       b       0b
+1:
+       /* Is it an indirection page */
+       tst     r3,#2,0
+       beq     1f
+       bic     r0,r3,#2
+       b       0b
+1:
+
+       /* are we done ? */
+       tst     r3,#4,0
+       beq     1f
+       b       2f
+
+1:
+       /* is it source ? */
+       tst     r3,#8,0
+       beq     0b
+       bic r3,r3,#8
+       mov r6,#1024
+9:
+       ldr r5,[r3],#4
+       str r5,[r4],#4
+       subs r6,r6,#1
+       bne 9b
+       b 0b
+
+2:
+       /* Jump to relocated kernel */
+       mov lr,r1
+       mov r0,#0
+       ldr r1,kexec_mach_type
+       mov r2,#0
+       mov pc,lr
+
+       .globl kexec_start_address
+kexec_start_address:
+       .long   0x0
+
+       .globl kexec_indirection_page
+kexec_indirection_page:
+       .long   0x0
+
+       .globl kexec_mach_type
+kexec_mach_type:
+       .long   0x0
+
+relocate_new_kernel_end:
+
+       .globl relocate_new_kernel_size
+relocate_new_kernel_size:
+       .long relocate_new_kernel_end - relocate_new_kernel
+
+
index ed522151878bdc5996def09b367892f95e8e4881..03e37af315d76cc702ca0af3b5bfae6da904147e 100644 (file)
@@ -88,6 +88,9 @@ struct cpu_user_fns cpu_user;
 #ifdef MULTI_CACHE
 struct cpu_cache_fns cpu_cache;
 #endif
+#ifdef CONFIG_OUTER_CACHE
+struct outer_cache_fns outer_cache;
+#endif
 
 struct stack {
        u32 irq[3];
index ee47c532e2108b0879bef642c3a5ee174891b581..f61decb89ba25ffcb58933d8ece66a6918b0606e 100644 (file)
  */
 struct sys_timer *system_timer;
 
+#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE)
 /* this needs a better home */
 DEFINE_SPINLOCK(rtc_lock);
 
-#ifdef CONFIG_SA1100_RTC_MODULE
+#ifdef CONFIG_RTC_DRV_CMOS_MODULE
 EXPORT_SYMBOL(rtc_lock);
 #endif
+#endif /* pc-style 'CMOS' RTC support */
 
 /* change this if you have some constant time drift */
 #define USECS_PER_JIFFY        (1000000/HZ)
index 908915675edcb3f66520c9a3765441d388ef29c0..24095601359b94e04b9d8b83b2b9ab70cb9a2135 100644 (file)
 #include "ptrace.h"
 #include "signal.h"
 
-const char *processor_modes[]=
-{ "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" ,
-  "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26",
-  "USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "UK6_32" , "ABT_32" ,
-  "UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32"
-};
-
 static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };
 
 #ifdef CONFIG_DEBUG_USER
@@ -289,7 +282,10 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
        regs->ARM_pc -= correction;
 
        pc = (void __user *)instruction_pointer(regs);
-       if (thumb_mode(regs)) {
+
+       if (processor_mode(regs) == SVC_MODE) {
+               instr = *(u32 *) pc;
+       } else if (thumb_mode(regs)) {
                get_user(instr, (u16 __user *)pc);
        } else {
                get_user(instr, (u32 __user *)pc);
@@ -337,12 +333,11 @@ asmlinkage void do_unexp_fiq (struct pt_regs *regs)
  * It never returns, and never tries to sync.  We hope that we can at least
  * dump out some state information...
  */
-asmlinkage void bad_mode(struct pt_regs *regs, int reason, int proc_mode)
+asmlinkage void bad_mode(struct pt_regs *regs, int reason)
 {
        console_verbose();
 
-       printk(KERN_CRIT "Bad mode in %s handler detected: mode %s\n",
-               handler[reason], processor_modes[proc_mode]);
+       printk(KERN_CRIT "Bad mode in %s handler detected\n", handler[reason]);
 
        die("Oops - bad mode", regs, 0);
        local_irq_disable();
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
new file mode 100644 (file)
index 0000000..bf0d962
--- /dev/null
@@ -0,0 +1,175 @@
+if ARCH_AT91
+
+menu "Atmel AT91 System-on-Chip"
+
+choice
+       prompt "Atmel AT91 Processor"
+
+config ARCH_AT91RM9200
+       bool "AT91RM9200"
+
+config ARCH_AT91SAM9260
+       bool "AT91SAM9260 or AT91SAM9XE"
+
+config ARCH_AT91SAM9261
+       bool "AT91SAM9261"
+
+config ARCH_AT91SAM9263
+       bool "AT91SAM9263"
+
+endchoice
+
+# ----------------------------------------------------------
+
+if ARCH_AT91RM9200
+
+comment "AT91RM9200 Board Type"
+
+config MACH_ONEARM
+       bool "Ajeco 1ARM Single Board Computer"
+       depends on ARCH_AT91RM9200
+       help
+         Select this if you are using Ajeco's 1ARM Single Board Computer.
+         <http://www.ajeco.fi/products.htm>
+
+config ARCH_AT91RM9200DK
+       bool "Atmel AT91RM9200-DK Development board"
+       depends on ARCH_AT91RM9200
+       help
+         Select this if you are using Atmel's AT91RM9200-DK Development board.
+         (Discontinued)
+
+config MACH_AT91RM9200EK
+       bool "Atmel AT91RM9200-EK Evaluation Kit"
+       depends on ARCH_AT91RM9200
+       help
+         Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
+         <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507>
+
+config MACH_CSB337
+       bool "Cogent CSB337"
+       depends on ARCH_AT91RM9200
+       help
+         Select this if you are using Cogent's CSB337 board.
+         <http://www.cogcomp.com/csb_csb337.htm>
+
+config MACH_CSB637
+       bool "Cogent CSB637"
+       depends on ARCH_AT91RM9200
+       help
+         Select this if you are using Cogent's CSB637 board.
+         <http://www.cogcomp.com/csb_csb637.htm>
+
+config MACH_CARMEVA
+       bool "Conitec ARM&EVA"
+       depends on ARCH_AT91RM9200
+       help
+         Select this if you are using Conitec's AT91RM9200-MCU-Module.
+         <http://www.conitec.net/english/linuxboard.htm>
+
+config MACH_ATEB9200
+       bool "Embest ATEB9200"
+       depends on ARCH_AT91RM9200
+       help
+         Select this if you are using Embest's ATEB9200 board.
+         <http://www.embedinfo.com/english/product/ATEB9200.asp>
+
+config MACH_KB9200
+       bool "KwikByte KB920x"
+       depends on ARCH_AT91RM9200
+       help
+         Select this if you are using KwikByte's KB920x board.
+         <http://kwikbyte.com/KB9202_description_new.htm>
+
+config MACH_KAFA
+       bool "Sperry-Sun KAFA board"
+       depends on ARCH_AT91RM9200
+       help
+         Select this if you are using Sperry-Sun's KAFA board.
+
+endif
+
+# ----------------------------------------------------------
+
+if ARCH_AT91SAM9260
+
+comment "AT91SAM9260 Variants"
+
+config ARCH_AT91SAM9260_SAM9XE
+       bool "AT91SAM9XE"
+       depends on ARCH_AT91SAM9260
+       help
+         Select this if you are using Atmel's AT91SAM9XE System-on-Chip.
+         They are basicaly AT91SAM9260s with various sizes of embedded Flash.
+
+comment "AT91SAM9260 / AT91SAM9XE Board Type"
+
+config MACH_AT91SAM9260EK
+       bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit"
+       depends on ARCH_AT91SAM9260
+       help
+         Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
+         <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
+
+endif
+
+# ----------------------------------------------------------
+
+if ARCH_AT91SAM9261
+
+comment "AT91SAM9261 Board Type"
+
+config MACH_AT91SAM9261EK
+       bool "Atmel AT91SAM9261-EK Evaluation Kit"
+       depends on ARCH_AT91SAM9261
+       help
+         Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
+         <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
+
+endif
+
+# ----------------------------------------------------------
+
+if ARCH_AT91SAM9263
+
+comment "AT91SAM9263 Board Type"
+
+config MACH_AT91SAM9263EK
+       bool "Atmel AT91SAM9263-EK Evaluation Kit"
+       depends on ARCH_AT91SAM9263
+       help
+         Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit.
+         <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057>
+
+endif
+
+# ----------------------------------------------------------
+
+comment "AT91 Board Options"
+
+config MTD_AT91_DATAFLASH_CARD
+       bool "Enable DataFlash Card support"
+       depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK)
+       help
+         Enable support for the DataFlash card.
+
+config MTD_NAND_AT91_BUSWIDTH_16
+       bool "Enable 16-bit data bus interface to NAND flash"
+       depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK)
+       help
+         On AT91SAM926x boards both types of NAND flash can be present
+         (8 and 16 bit data bus width).
+
+# ----------------------------------------------------------
+
+comment "AT91 Feature Selections"
+
+config AT91_PROGRAMMABLE_CLOCKS
+       bool "Programmable Clocks"
+       help
+         Select this if you need to program one or more of the PCK0..PCK3
+         programmable clock outputs.
+
+endmenu
+
+endif
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
new file mode 100644 (file)
index 0000000..05de6cd
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Makefile for the linux kernel.
+#
+
+obj-y          := clock.o irq.o gpio.o
+obj-m          :=
+obj-n          :=
+obj-           :=
+
+obj-$(CONFIG_PM)               += pm.o
+
+# CPU-specific support
+obj-$(CONFIG_ARCH_AT91RM9200)  += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o
+obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o
+obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o
+obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_devices.o
+
+# AT91RM9200 board-specific support
+obj-$(CONFIG_MACH_ONEARM)      += board-1arm.o
+obj-$(CONFIG_ARCH_AT91RM9200DK)        += board-dk.o
+obj-$(CONFIG_MACH_AT91RM9200EK)        += board-ek.o
+obj-$(CONFIG_MACH_CSB337)      += board-csb337.o
+obj-$(CONFIG_MACH_CSB637)      += board-csb637.o
+obj-$(CONFIG_MACH_CARMEVA)     += board-carmeva.o
+obj-$(CONFIG_MACH_KB9200)      += board-kb9202.o
+obj-$(CONFIG_MACH_ATEB9200)    += board-eb9200.o
+obj-$(CONFIG_MACH_KAFA)                += board-kafa.o
+
+# AT91SAM9260 board-specific support
+obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
+
+# AT91SAM9261 board-specific support
+obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o
+
+# AT91SAM9263 board-specific support
+obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o
+
+# LEDs support
+led-$(CONFIG_ARCH_AT91RM9200DK)        += leds.o
+led-$(CONFIG_MACH_AT91RM9200EK)        += leds.o
+led-$(CONFIG_MACH_CSB337)      += leds.o
+led-$(CONFIG_MACH_CSB637)      += leds.o
+led-$(CONFIG_MACH_KB9200)      += leds.o
+led-$(CONFIG_MACH_KAFA)                += leds.o
+obj-$(CONFIG_LEDS) += $(led-y)
+
+# VGA support
+#obj-$(CONFIG_FB_S1D13XXX)     += ics1523.o
+
+
+ifeq ($(CONFIG_PM_DEBUG),y)
+CFLAGS_pm.o += -DDEBUG
+endif
diff --git a/arch/arm/mach-at91/Makefile.boot b/arch/arm/mach-at91/Makefile.boot
new file mode 100644 (file)
index 0000000..e667dcc
--- /dev/null
@@ -0,0 +1,9 @@
+# Note: the following conditions must always be true:
+#   ZRELADDR == virt_to_phys(TEXTADDR)
+#   PARAMS_PHYS must be within 4MB of ZRELADDR
+#   INITRD_PHYS must be in RAM
+
+   zreladdr-y  := 0x20008000
+params_phys-y  := 0x20000100
+initrd_phys-y  := 0x20410000
+
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
new file mode 100644 (file)
index 0000000..2ddcdd6
--- /dev/null
@@ -0,0 +1,329 @@
+/*
+ * arch/arm/mach-at91/at91rm9200.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *
+ * 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/module.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/arch/at91rm9200.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_st.h>
+
+#include "generic.h"
+#include "clock.h"
+
+static struct map_desc at91rm9200_io_desc[] __initdata = {
+       {
+               .virtual        = AT91_VA_BASE_SYS,
+               .pfn            = __phys_to_pfn(AT91_BASE_SYS),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_EMAC,
+               .pfn            = __phys_to_pfn(AT91RM9200_BASE_EMAC),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_IO_VIRT_BASE - AT91RM9200_SRAM_SIZE,
+               .pfn            = __phys_to_pfn(AT91RM9200_SRAM_BASE),
+               .length         = AT91RM9200_SRAM_SIZE,
+               .type           = MT_DEVICE,
+       },
+};
+
+/* --------------------------------------------------------------------
+ *  Clocks
+ * -------------------------------------------------------------------- */
+
+/*
+ * The peripheral clocks.
+ */
+static struct clk udc_clk = {
+       .name           = "udc_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_UDP,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ohci_clk = {
+       .name           = "ohci_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_UHP,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ether_clk = {
+       .name           = "ether_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_EMAC,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk mmc_clk = {
+       .name           = "mci_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_MCI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk twi_clk = {
+       .name           = "twi_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_TWI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart0_clk = {
+       .name           = "usart0_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_US0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart1_clk = {
+       .name           = "usart1_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_US1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart2_clk = {
+       .name           = "usart2_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_US2,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart3_clk = {
+       .name           = "usart3_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_US3,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk spi_clk = {
+       .name           = "spi_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_SPI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk pioA_clk = {
+       .name           = "pioA_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_PIOA,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk pioB_clk = {
+       .name           = "pioB_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_PIOB,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk pioC_clk = {
+       .name           = "pioC_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_PIOC,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk pioD_clk = {
+       .name           = "pioD_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_PIOD,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc0_clk = {
+       .name           = "tc0_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_TC0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc1_clk = {
+       .name           = "tc1_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_TC1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc2_clk = {
+       .name           = "tc2_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_TC2,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc3_clk = {
+       .name           = "tc3_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_TC3,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc4_clk = {
+       .name           = "tc4_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_TC4,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc5_clk = {
+       .name           = "tc5_clk",
+       .pmc_mask       = 1 << AT91RM9200_ID_TC5,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+
+static struct clk *periph_clocks[] __initdata = {
+       &pioA_clk,
+       &pioB_clk,
+       &pioC_clk,
+       &pioD_clk,
+       &usart0_clk,
+       &usart1_clk,
+       &usart2_clk,
+       &usart3_clk,
+       &mmc_clk,
+       &udc_clk,
+       &twi_clk,
+       &spi_clk,
+       // ssc 0 .. ssc2
+       &tc0_clk,
+       &tc1_clk,
+       &tc2_clk,
+       &tc3_clk,
+       &tc4_clk,
+       &tc5_clk,
+       &ohci_clk,
+       &ether_clk,
+       // irq0 .. irq6
+};
+
+/*
+ * The four programmable clocks.
+ * You must configure pin multiplexing to bring these signals out.
+ */
+static struct clk pck0 = {
+       .name           = "pck0",
+       .pmc_mask       = AT91_PMC_PCK0,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 0,
+};
+static struct clk pck1 = {
+       .name           = "pck1",
+       .pmc_mask       = AT91_PMC_PCK1,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 1,
+};
+static struct clk pck2 = {
+       .name           = "pck2",
+       .pmc_mask       = AT91_PMC_PCK2,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 2,
+};
+static struct clk pck3 = {
+       .name           = "pck3",
+       .pmc_mask       = AT91_PMC_PCK3,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 3,
+};
+
+static void __init at91rm9200_register_clocks(void)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
+               clk_register(periph_clocks[i]);
+
+       clk_register(&pck0);
+       clk_register(&pck1);
+       clk_register(&pck2);
+       clk_register(&pck3);
+}
+
+/* --------------------------------------------------------------------
+ *  GPIO
+ * -------------------------------------------------------------------- */
+
+static struct at91_gpio_bank at91rm9200_gpio[] = {
+       {
+               .id             = AT91RM9200_ID_PIOA,
+               .offset         = AT91_PIOA,
+               .clock          = &pioA_clk,
+       }, {
+               .id             = AT91RM9200_ID_PIOB,
+               .offset         = AT91_PIOB,
+               .clock          = &pioB_clk,
+       }, {
+               .id             = AT91RM9200_ID_PIOC,
+               .offset         = AT91_PIOC,
+               .clock          = &pioC_clk,
+       }, {
+               .id             = AT91RM9200_ID_PIOD,
+               .offset         = AT91_PIOD,
+               .clock          = &pioD_clk,
+       }
+};
+
+static void at91rm9200_reset(void)
+{
+       /*
+        * Perform a hardware reset with the use of the Watchdog timer.
+        */
+       at91_sys_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
+       at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
+}
+
+
+/* --------------------------------------------------------------------
+ *  AT91RM9200 processor initialization
+ * -------------------------------------------------------------------- */
+void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks)
+{
+       /* Map peripherals */
+       iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc));
+
+       at91_arch_reset = at91rm9200_reset;
+       at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
+                       | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
+                       | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5)
+                       | (1 << AT91RM9200_ID_IRQ6);
+
+       /* Init clock subsystem */
+       at91_clock_init(main_clock);
+
+       /* Register the processor-specific clocks */
+       at91rm9200_register_clocks();
+
+       /* Initialize GPIO subsystem */
+       at91_gpio_init(at91rm9200_gpio, banks);
+}
+
+
+/* --------------------------------------------------------------------
+ *  Interrupt initialization
+ * -------------------------------------------------------------------- */
+
+/*
+ * The default interrupt priority levels (0 = lowest, 7 = highest).
+ */
+static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
+       7,      /* Advanced Interrupt Controller (FIQ) */
+       7,      /* System Peripherals */
+       0,      /* Parallel IO Controller A */
+       0,      /* Parallel IO Controller B */
+       0,      /* Parallel IO Controller C */
+       0,      /* Parallel IO Controller D */
+       6,      /* USART 0 */
+       6,      /* USART 1 */
+       6,      /* USART 2 */
+       6,      /* USART 3 */
+       0,      /* Multimedia Card Interface */
+       4,      /* USB Device Port */
+       0,      /* Two-Wire Interface */
+       6,      /* Serial Peripheral Interface */
+       5,      /* Serial Synchronous Controller 0 */
+       5,      /* Serial Synchronous Controller 1 */
+       5,      /* Serial Synchronous Controller 2 */
+       0,      /* Timer Counter 0 */
+       0,      /* Timer Counter 1 */
+       0,      /* Timer Counter 2 */
+       0,      /* Timer Counter 3 */
+       0,      /* Timer Counter 4 */
+       0,      /* Timer Counter 5 */
+       3,      /* USB Host port */
+       3,      /* Ethernet MAC */
+       0,      /* Advanced Interrupt Controller (IRQ0) */
+       0,      /* Advanced Interrupt Controller (IRQ1) */
+       0,      /* Advanced Interrupt Controller (IRQ2) */
+       0,      /* Advanced Interrupt Controller (IRQ3) */
+       0,      /* Advanced Interrupt Controller (IRQ4) */
+       0,      /* Advanced Interrupt Controller (IRQ5) */
+       0       /* Advanced Interrupt Controller (IRQ6) */
+};
+
+void __init at91rm9200_init_interrupts(unsigned int priority[NR_AIC_IRQS])
+{
+       if (!priority)
+               priority = at91rm9200_default_irq_priority;
+
+       /* Initialize the AIC interrupt controller */
+       at91_aic_init(priority);
+
+       /* Enable GPIO interrupts */
+       at91_gpio_irq_setup();
+}
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
new file mode 100644 (file)
index 0000000..2624a4f
--- /dev/null
@@ -0,0 +1,879 @@
+/*
+ * arch/arm/mach-at91/at91rm9200_devices.c
+ *
+ *  Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
+ *  Copyright (C) 2005 David Brownell
+ *
+ * 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/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <linux/platform_device.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91rm9200.h>
+#include <asm/arch/at91rm9200_mc.h>
+
+#include "generic.h"
+
+#define SZ_512 0x00000200
+#define SZ_256 0x00000100
+#define SZ_16  0x00000010
+
+/* --------------------------------------------------------------------
+ *  USB Host
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+static u64 ohci_dmamask = 0xffffffffUL;
+static struct at91_usbh_data usbh_data;
+
+static struct resource usbh_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_UHP_BASE,
+               .end    = AT91RM9200_UHP_BASE + SZ_1M - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_UHP,
+               .end    = AT91RM9200_ID_UHP,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91rm9200_usbh_device = {
+       .name           = "at91_ohci",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &ohci_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &usbh_data,
+       },
+       .resource       = usbh_resources,
+       .num_resources  = ARRAY_SIZE(usbh_resources),
+};
+
+void __init at91_add_device_usbh(struct at91_usbh_data *data)
+{
+       if (!data)
+               return;
+
+       usbh_data = *data;
+       platform_device_register(&at91rm9200_usbh_device);
+}
+#else
+void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  USB Device (Gadget)
+ * -------------------------------------------------------------------- */
+
+#ifdef CONFIG_USB_GADGET_AT91
+static struct at91_udc_data udc_data;
+
+static struct resource udc_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_UDP,
+               .end    = AT91RM9200_BASE_UDP + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_UDP,
+               .end    = AT91RM9200_ID_UDP,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91rm9200_udc_device = {
+       .name           = "at91_udc",
+       .id             = -1,
+       .dev            = {
+                               .platform_data          = &udc_data,
+       },
+       .resource       = udc_resources,
+       .num_resources  = ARRAY_SIZE(udc_resources),
+};
+
+void __init at91_add_device_udc(struct at91_udc_data *data)
+{
+       if (!data)
+               return;
+
+       if (data->vbus_pin) {
+               at91_set_gpio_input(data->vbus_pin, 0);
+               at91_set_deglitch(data->vbus_pin, 1);
+       }
+       if (data->pullup_pin)
+               at91_set_gpio_output(data->pullup_pin, 0);
+
+       udc_data = *data;
+       platform_device_register(&at91rm9200_udc_device);
+}
+#else
+void __init at91_add_device_udc(struct at91_udc_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  Ethernet
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE)
+static u64 eth_dmamask = 0xffffffffUL;
+static struct at91_eth_data eth_data;
+
+static struct resource eth_resources[] = {
+       [0] = {
+               .start  = AT91_VA_BASE_EMAC,
+               .end    = AT91_VA_BASE_EMAC + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_EMAC,
+               .end    = AT91RM9200_ID_EMAC,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91rm9200_eth_device = {
+       .name           = "at91_ether",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &eth_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &eth_data,
+       },
+       .resource       = eth_resources,
+       .num_resources  = ARRAY_SIZE(eth_resources),
+};
+
+void __init at91_add_device_eth(struct at91_eth_data *data)
+{
+       if (!data)
+               return;
+
+       if (data->phy_irq_pin) {
+               at91_set_gpio_input(data->phy_irq_pin, 0);
+               at91_set_deglitch(data->phy_irq_pin, 1);
+       }
+
+       /* Pins used for MII and RMII */
+       at91_set_A_periph(AT91_PIN_PA16, 0);    /* EMDIO */
+       at91_set_A_periph(AT91_PIN_PA15, 0);    /* EMDC */
+       at91_set_A_periph(AT91_PIN_PA14, 0);    /* ERXER */
+       at91_set_A_periph(AT91_PIN_PA13, 0);    /* ERX1 */
+       at91_set_A_periph(AT91_PIN_PA12, 0);    /* ERX0 */
+       at91_set_A_periph(AT91_PIN_PA11, 0);    /* ECRS_ECRSDV */
+       at91_set_A_periph(AT91_PIN_PA10, 0);    /* ETX1 */
+       at91_set_A_periph(AT91_PIN_PA9, 0);     /* ETX0 */
+       at91_set_A_periph(AT91_PIN_PA8, 0);     /* ETXEN */
+       at91_set_A_periph(AT91_PIN_PA7, 0);     /* ETXCK_EREFCK */
+
+       if (!data->is_rmii) {
+               at91_set_B_periph(AT91_PIN_PB19, 0);    /* ERXCK */
+               at91_set_B_periph(AT91_PIN_PB18, 0);    /* ECOL */
+               at91_set_B_periph(AT91_PIN_PB17, 0);    /* ERXDV */
+               at91_set_B_periph(AT91_PIN_PB16, 0);    /* ERX3 */
+               at91_set_B_periph(AT91_PIN_PB15, 0);    /* ERX2 */
+               at91_set_B_periph(AT91_PIN_PB14, 0);    /* ETXER */
+               at91_set_B_periph(AT91_PIN_PB13, 0);    /* ETX3 */
+               at91_set_B_periph(AT91_PIN_PB12, 0);    /* ETX2 */
+       }
+
+       eth_data = *data;
+       platform_device_register(&at91rm9200_eth_device);
+}
+#else
+void __init at91_add_device_eth(struct at91_eth_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  Compact Flash / PCMCIA
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE)
+static struct at91_cf_data cf_data;
+
+#define CF_BASE                AT91_CHIPSELECT_4
+
+static struct resource cf_resources[] = {
+       [0] = {
+               .start  = CF_BASE,
+               /* ties up CS4, CS5 and CS6 */
+               .end    = CF_BASE + (0x30000000 - 1),
+               .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT,
+       },
+};
+
+static struct platform_device at91rm9200_cf_device = {
+       .name           = "at91_cf",
+       .id             = -1,
+       .dev            = {
+                               .platform_data          = &cf_data,
+       },
+       .resource       = cf_resources,
+       .num_resources  = ARRAY_SIZE(cf_resources),
+};
+
+void __init at91_add_device_cf(struct at91_cf_data *data)
+{
+       unsigned int csa;
+
+       if (!data)
+               return;
+
+       data->chipselect = 4;           /* can only use EBI ChipSelect 4 */
+
+       /* CF takes over CS4, CS5, CS6 */
+       csa = at91_sys_read(AT91_EBI_CSA);
+       at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS4A_SMC_COMPACTFLASH);
+
+       /*
+        * Static memory controller timing adjustments.
+        * REVISIT:  these timings are in terms of MCK cycles, so
+        * when MCK changes (cpufreq etc) so must these values...
+        */
+       at91_sys_write(AT91_SMC_CSR(4),
+                                 AT91_SMC_ACSS_STD
+                               | AT91_SMC_DBW_16
+                               | AT91_SMC_BAT
+                               | AT91_SMC_WSEN
+                               | AT91_SMC_NWS_(32)     /* wait states */
+                               | AT91_SMC_RWSETUP_(6)  /* setup time */
+                               | AT91_SMC_RWHOLD_(4)   /* hold time */
+       );
+
+       /* input/irq */
+       if (data->irq_pin) {
+               at91_set_gpio_input(data->irq_pin, 1);
+               at91_set_deglitch(data->irq_pin, 1);
+       }
+       at91_set_gpio_input(data->det_pin, 1);
+       at91_set_deglitch(data->det_pin, 1);
+
+       /* outputs, initially off */
+       if (data->vcc_pin)
+               at91_set_gpio_output(data->vcc_pin, 0);
+       at91_set_gpio_output(data->rst_pin, 0);
+
+       /* force poweron defaults for these pins ... */
+       at91_set_A_periph(AT91_PIN_PC9, 0);     /* A25/CFRNW */
+       at91_set_A_periph(AT91_PIN_PC10, 0);    /* NCS4/CFCS */
+       at91_set_A_periph(AT91_PIN_PC11, 0);    /* NCS5/CFCE1 */
+       at91_set_A_periph(AT91_PIN_PC12, 0);    /* NCS6/CFCE2 */
+
+       /* nWAIT is _not_ a default setting */
+       at91_set_A_periph(AT91_PIN_PC6, 1);     /* nWAIT */
+
+       cf_data = *data;
+       platform_device_register(&at91rm9200_cf_device);
+}
+#else
+void __init at91_add_device_cf(struct at91_cf_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  MMC / SD
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
+static u64 mmc_dmamask = 0xffffffffUL;
+static struct at91_mmc_data mmc_data;
+
+static struct resource mmc_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_MCI,
+               .end    = AT91RM9200_BASE_MCI + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_MCI,
+               .end    = AT91RM9200_ID_MCI,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91rm9200_mmc_device = {
+       .name           = "at91_mci",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &mmc_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &mmc_data,
+       },
+       .resource       = mmc_resources,
+       .num_resources  = ARRAY_SIZE(mmc_resources),
+};
+
+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
+{
+       if (!data)
+               return;
+
+       /* input/irq */
+       if (data->det_pin) {
+               at91_set_gpio_input(data->det_pin, 1);
+               at91_set_deglitch(data->det_pin, 1);
+       }
+       if (data->wp_pin)
+               at91_set_gpio_input(data->wp_pin, 1);
+       if (data->vcc_pin)
+               at91_set_gpio_output(data->vcc_pin, 0);
+
+       /* CLK */
+       at91_set_A_periph(AT91_PIN_PA27, 0);
+
+       if (data->slot_b) {
+               /* CMD */
+               at91_set_B_periph(AT91_PIN_PA8, 1);
+
+               /* DAT0, maybe DAT1..DAT3 */
+               at91_set_B_periph(AT91_PIN_PA9, 1);
+               if (data->wire4) {
+                       at91_set_B_periph(AT91_PIN_PA10, 1);
+                       at91_set_B_periph(AT91_PIN_PA11, 1);
+                       at91_set_B_periph(AT91_PIN_PA12, 1);
+               }
+       } else {
+               /* CMD */
+               at91_set_A_periph(AT91_PIN_PA28, 1);
+
+               /* DAT0, maybe DAT1..DAT3 */
+               at91_set_A_periph(AT91_PIN_PA29, 1);
+               if (data->wire4) {
+                       at91_set_B_periph(AT91_PIN_PB3, 1);
+                       at91_set_B_periph(AT91_PIN_PB4, 1);
+                       at91_set_B_periph(AT91_PIN_PB5, 1);
+               }
+       }
+
+       mmc_data = *data;
+       platform_device_register(&at91rm9200_mmc_device);
+}
+#else
+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  NAND / SmartMedia
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+static struct at91_nand_data nand_data;
+
+#define NAND_BASE      AT91_CHIPSELECT_3
+
+static struct resource nand_resources[] = {
+       {
+               .start  = NAND_BASE,
+               .end    = NAND_BASE + SZ_8M - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device at91rm9200_nand_device = {
+       .name           = "at91_nand",
+       .id             = -1,
+       .dev            = {
+                               .platform_data  = &nand_data,
+       },
+       .resource       = nand_resources,
+       .num_resources  = ARRAY_SIZE(nand_resources),
+};
+
+void __init at91_add_device_nand(struct at91_nand_data *data)
+{
+       unsigned int csa;
+
+       if (!data)
+               return;
+
+       /* enable the address range of CS3 */
+       csa = at91_sys_read(AT91_EBI_CSA);
+       at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS3A_SMC_SMARTMEDIA);
+
+       /* set the bus interface characteristics */
+       at91_sys_write(AT91_SMC_CSR(3), AT91_SMC_ACSS_STD | AT91_SMC_DBW_8 | AT91_SMC_WSEN
+               | AT91_SMC_NWS_(5)
+               | AT91_SMC_TDF_(1)
+               | AT91_SMC_RWSETUP_(0)  /* tDS Data Set up Time 30 - ns */
+               | AT91_SMC_RWHOLD_(1)   /* tDH Data Hold Time 20 - ns */
+       );
+
+       /* enable pin */
+       if (data->enable_pin)
+               at91_set_gpio_output(data->enable_pin, 1);
+
+       /* ready/busy pin */
+       if (data->rdy_pin)
+               at91_set_gpio_input(data->rdy_pin, 1);
+
+       /* card detect pin */
+       if (data->det_pin)
+               at91_set_gpio_input(data->det_pin, 1);
+
+       at91_set_A_periph(AT91_PIN_PC1, 0);             /* SMOE */
+       at91_set_A_periph(AT91_PIN_PC3, 0);             /* SMWE */
+
+       nand_data = *data;
+       platform_device_register(&at91rm9200_nand_device);
+}
+#else
+void __init at91_add_device_nand(struct at91_nand_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  TWI (i2c)
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
+
+static struct resource twi_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_TWI,
+               .end    = AT91RM9200_BASE_TWI + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_TWI,
+               .end    = AT91RM9200_ID_TWI,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91rm9200_twi_device = {
+       .name           = "at91_i2c",
+       .id             = -1,
+       .resource       = twi_resources,
+       .num_resources  = ARRAY_SIZE(twi_resources),
+};
+
+void __init at91_add_device_i2c(void)
+{
+       /* pins used for TWI interface */
+       at91_set_A_periph(AT91_PIN_PA25, 0);            /* TWD */
+       at91_set_multi_drive(AT91_PIN_PA25, 1);
+
+       at91_set_A_periph(AT91_PIN_PA26, 0);            /* TWCK */
+       at91_set_multi_drive(AT91_PIN_PA26, 1);
+
+       platform_device_register(&at91rm9200_twi_device);
+}
+#else
+void __init at91_add_device_i2c(void) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  SPI
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_SPI_AT91) || defined(CONFIG_SPI_AT91_MODULE) || defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE)
+static u64 spi_dmamask = 0xffffffffUL;
+
+static struct resource spi_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_SPI,
+               .end    = AT91RM9200_BASE_SPI + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_SPI,
+               .end    = AT91RM9200_ID_SPI,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91rm9200_spi_device = {
+       .name           = "at91_spi",
+       .id             = 0,
+       .dev            = {
+                               .dma_mask               = &spi_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+       },
+       .resource       = spi_resources,
+       .num_resources  = ARRAY_SIZE(spi_resources),
+};
+
+static const unsigned spi_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PA4, AT91_PIN_PA5, AT91_PIN_PA6 };
+
+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
+{
+       int i;
+       unsigned long cs_pin;
+
+       at91_set_A_periph(AT91_PIN_PA0, 0);     /* MISO */
+       at91_set_A_periph(AT91_PIN_PA1, 0);     /* MOSI */
+       at91_set_A_periph(AT91_PIN_PA2, 0);     /* SPCK */
+
+       /* Enable SPI chip-selects */
+       for (i = 0; i < nr_devices; i++) {
+               if (devices[i].controller_data)
+                       cs_pin = (unsigned long) devices[i].controller_data;
+               else
+                       cs_pin = spi_standard_cs[devices[i].chip_select];
+
+#ifdef CONFIG_SPI_AT91_MANUAL_CS
+               at91_set_gpio_output(cs_pin, 1);
+#else
+               at91_set_A_periph(cs_pin, 0);
+#endif
+
+               /* pass chip-select pin to driver */
+               devices[i].controller_data = (void *) cs_pin;
+       }
+
+       spi_register_board_info(devices, nr_devices);
+       at91_clock_associate("spi_clk", &at91rm9200_spi_device.dev, "spi");
+       platform_device_register(&at91rm9200_spi_device);
+}
+#else
+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  RTC
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE)
+static struct platform_device at91rm9200_rtc_device = {
+       .name           = "at91_rtc",
+       .id             = -1,
+       .num_resources  = 0,
+};
+
+static void __init at91_add_device_rtc(void)
+{
+       platform_device_register(&at91rm9200_rtc_device);
+}
+#else
+static void __init at91_add_device_rtc(void) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  Watchdog
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_AT91RM9200_WATCHDOG) || defined(CONFIG_AT91RM9200_WATCHDOG_MODULE)
+static struct platform_device at91rm9200_wdt_device = {
+       .name           = "at91_wdt",
+       .id             = -1,
+       .num_resources  = 0,
+};
+
+static void __init at91_add_device_watchdog(void)
+{
+       platform_device_register(&at91rm9200_wdt_device);
+}
+#else
+static void __init at91_add_device_watchdog(void) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  LEDs
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_LEDS)
+u8 at91_leds_cpu;
+u8 at91_leds_timer;
+
+void __init at91_init_leds(u8 cpu_led, u8 timer_led)
+{
+       /* Enable GPIO to access the LEDs */
+       at91_set_gpio_output(cpu_led, 1);
+       at91_set_gpio_output(timer_led, 1);
+
+       at91_leds_cpu   = cpu_led;
+       at91_leds_timer = timer_led;
+}
+#else
+void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  UART
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_SERIAL_ATMEL)
+static struct resource dbgu_resources[] = {
+       [0] = {
+               .start  = AT91_VA_BASE_SYS + AT91_DBGU,
+               .end    = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_ID_SYS,
+               .end    = AT91_ID_SYS,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data dbgu_data = {
+       .use_dma_tx     = 0,
+       .use_dma_rx     = 0,            /* DBGU not capable of receive DMA */
+       .regs           = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
+};
+
+static struct platform_device at91rm9200_dbgu_device = {
+       .name           = "atmel_usart",
+       .id             = 0,
+       .dev            = {
+                               .platform_data  = &dbgu_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = dbgu_resources,
+       .num_resources  = ARRAY_SIZE(dbgu_resources),
+};
+
+static inline void configure_dbgu_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PA30, 0);            /* DRXD */
+       at91_set_A_periph(AT91_PIN_PA31, 1);            /* DTXD */
+}
+
+static struct resource uart0_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_US0,
+               .end    = AT91RM9200_BASE_US0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_US0,
+               .end    = AT91RM9200_ID_US0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart0_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91rm9200_uart0_device = {
+       .name           = "atmel_usart",
+       .id             = 1,
+       .dev            = {
+                               .platform_data  = &uart0_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart0_resources,
+       .num_resources  = ARRAY_SIZE(uart0_resources),
+};
+
+static inline void configure_usart0_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PA17, 1);            /* TXD0 */
+       at91_set_A_periph(AT91_PIN_PA18, 0);            /* RXD0 */
+       at91_set_A_periph(AT91_PIN_PA20, 0);            /* CTS0 */
+
+       /*
+        * AT91RM9200 Errata #39 - RTS0 is not internally connected to PA21.
+        *  We need to drive the pin manually.  Default is off (RTS is active low).
+        */
+       at91_set_gpio_output(AT91_PIN_PA21, 1);
+}
+
+static struct resource uart1_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_US1,
+               .end    = AT91RM9200_BASE_US1 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_US1,
+               .end    = AT91RM9200_ID_US1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart1_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91rm9200_uart1_device = {
+       .name           = "atmel_usart",
+       .id             = 2,
+       .dev            = {
+                               .platform_data  = &uart1_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart1_resources,
+       .num_resources  = ARRAY_SIZE(uart1_resources),
+};
+
+static inline void configure_usart1_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PB18, 0);            /* RI1 */
+       at91_set_A_periph(AT91_PIN_PB19, 0);            /* DTR1 */
+       at91_set_A_periph(AT91_PIN_PB20, 1);            /* TXD1 */
+       at91_set_A_periph(AT91_PIN_PB21, 0);            /* RXD1 */
+       at91_set_A_periph(AT91_PIN_PB23, 0);            /* DCD1 */
+       at91_set_A_periph(AT91_PIN_PB24, 0);            /* CTS1 */
+       at91_set_A_periph(AT91_PIN_PB25, 0);            /* DSR1 */
+       at91_set_A_periph(AT91_PIN_PB26, 0);            /* RTS1 */
+}
+
+static struct resource uart2_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_US2,
+               .end    = AT91RM9200_BASE_US2 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_US2,
+               .end    = AT91RM9200_ID_US2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart2_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91rm9200_uart2_device = {
+       .name           = "atmel_usart",
+       .id             = 3,
+       .dev            = {
+                               .platform_data  = &uart2_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart2_resources,
+       .num_resources  = ARRAY_SIZE(uart2_resources),
+};
+
+static inline void configure_usart2_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PA22, 0);            /* RXD2 */
+       at91_set_A_periph(AT91_PIN_PA23, 1);            /* TXD2 */
+}
+
+static struct resource uart3_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_US3,
+               .end    = AT91RM9200_BASE_US3 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_US3,
+               .end    = AT91RM9200_ID_US3,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart3_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91rm9200_uart3_device = {
+       .name           = "atmel_usart",
+       .id             = 4,
+       .dev            = {
+                               .platform_data  = &uart3_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart3_resources,
+       .num_resources  = ARRAY_SIZE(uart3_resources),
+};
+
+static inline void configure_usart3_pins(void)
+{
+       at91_set_B_periph(AT91_PIN_PA5, 1);             /* TXD3 */
+       at91_set_B_periph(AT91_PIN_PA6, 0);             /* RXD3 */
+}
+
+struct platform_device *at91_uarts[ATMEL_MAX_UART];    /* the UARTs to use */
+struct platform_device *atmel_default_console_device;  /* the serial console device */
+
+void __init at91_init_serial(struct at91_uart_config *config)
+{
+       int i;
+
+       /* Fill in list of supported UARTs */
+       for (i = 0; i < config->nr_tty; i++) {
+               switch (config->tty_map[i]) {
+                       case 0:
+                               configure_usart0_pins();
+                               at91_uarts[i] = &at91rm9200_uart0_device;
+                               at91_clock_associate("usart0_clk", &at91rm9200_uart0_device.dev, "usart");
+                               break;
+                       case 1:
+                               configure_usart1_pins();
+                               at91_uarts[i] = &at91rm9200_uart1_device;
+                               at91_clock_associate("usart1_clk", &at91rm9200_uart1_device.dev, "usart");
+                               break;
+                       case 2:
+                               configure_usart2_pins();
+                               at91_uarts[i] = &at91rm9200_uart2_device;
+                               at91_clock_associate("usart2_clk", &at91rm9200_uart2_device.dev, "usart");
+                               break;
+                       case 3:
+                               configure_usart3_pins();
+                               at91_uarts[i] = &at91rm9200_uart3_device;
+                               at91_clock_associate("usart3_clk", &at91rm9200_uart3_device.dev, "usart");
+                               break;
+                       case 4:
+                               configure_dbgu_pins();
+                               at91_uarts[i] = &at91rm9200_dbgu_device;
+                               at91_clock_associate("mck", &at91rm9200_dbgu_device.dev, "usart");
+                               break;
+                       default:
+                               continue;
+               }
+               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
+       }
+
+       /* Set serial console device */
+       if (config->console_tty < ATMEL_MAX_UART)
+               atmel_default_console_device = at91_uarts[config->console_tty];
+       if (!atmel_default_console_device)
+               printk(KERN_INFO "AT91: No default serial console defined.\n");
+}
+
+void __init at91_add_device_serial(void)
+{
+       int i;
+
+       for (i = 0; i < ATMEL_MAX_UART; i++) {
+               if (at91_uarts[i])
+                       platform_device_register(at91_uarts[i]);
+       }
+}
+#else
+void __init at91_init_serial(struct at91_uart_config *config) {}
+void __init at91_add_device_serial(void) {}
+#endif
+
+
+/* -------------------------------------------------------------------- */
+
+/*
+ * These devices are always present and don't need any board-specific
+ * setup.
+ */
+static int __init at91_add_standard_devices(void)
+{
+       at91_add_device_rtc();
+       at91_add_device_watchdog();
+       return 0;
+}
+
+arch_initcall(at91_add_standard_devices);
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
new file mode 100644 (file)
index 0000000..949199a
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * linux/arch/arm/mach-at91/at91rm9200_time.c
+ *
+ *  Copyright (C) 2003 SAN People
+ *  Copyright (C) 2003 ATMEL
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/time.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/mach/time.h>
+
+#include <asm/arch/at91_st.h>
+
+static unsigned long last_crtr;
+
+/*
+ * The ST_CRTR is updated asynchronously to the master clock.  It is therefore
+ *  necessary to read it twice (with the same value) to ensure accuracy.
+ */
+static inline unsigned long read_CRTR(void) {
+       unsigned long x1, x2;
+
+       do {
+               x1 = at91_sys_read(AT91_ST_CRTR);
+               x2 = at91_sys_read(AT91_ST_CRTR);
+       } while (x1 != x2);
+
+       return x1;
+}
+
+/*
+ * Returns number of microseconds since last timer interrupt.  Note that interrupts
+ * will have been disabled by do_gettimeofday()
+ *  'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
+ *  'tick' is usecs per jiffy (linux/timex.h).
+ */
+static unsigned long at91rm9200_gettimeoffset(void)
+{
+       unsigned long elapsed;
+
+       elapsed = (read_CRTR() - last_crtr) & AT91_ST_ALMV;
+
+       return (unsigned long)(elapsed * (tick_nsec / 1000)) / LATCH;
+}
+
+/*
+ * IRQ handler for the timer.
+ */
+static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id)
+{
+       if (at91_sys_read(AT91_ST_SR) & AT91_ST_PITS) { /* This is a shared interrupt */
+               write_seqlock(&xtime_lock);
+
+               while (((read_CRTR() - last_crtr) & AT91_ST_ALMV) >= LATCH) {
+                       timer_tick();
+                       last_crtr = (last_crtr + LATCH) & AT91_ST_ALMV;
+               }
+
+               write_sequnlock(&xtime_lock);
+
+               return IRQ_HANDLED;
+       }
+       else
+               return IRQ_NONE;                /* not handled */
+}
+
+static struct irqaction at91rm9200_timer_irq = {
+       .name           = "at91_tick",
+       .flags          = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER,
+       .handler        = at91rm9200_timer_interrupt
+};
+
+void at91rm9200_timer_reset(void)
+{
+       last_crtr = 0;
+
+       /* Real time counter incremented every 30.51758 microseconds */
+       at91_sys_write(AT91_ST_RTMR, 1);
+
+       /* Set Period Interval timer */
+       at91_sys_write(AT91_ST_PIMR, LATCH);
+
+       /* Clear any pending interrupts */
+       (void) at91_sys_read(AT91_ST_SR);
+
+       /* Enable Period Interval Timer interrupt */
+       at91_sys_write(AT91_ST_IER, AT91_ST_PITS);
+}
+
+/*
+ * Set up timer interrupt.
+ */
+void __init at91rm9200_timer_init(void)
+{
+       /* Disable all timer interrupts */
+       at91_sys_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS);
+       (void) at91_sys_read(AT91_ST_SR);       /* Clear any pending interrupts */
+
+       /* Make IRQs happen for the system timer */
+       setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
+
+       /* Change the kernel's 'tick' value to 10009 usec. (the default is 10000) */
+       tick_usec = (LATCH * 1000000) / CLOCK_TICK_RATE;
+
+       /* Initialize and enable the timer interrupt */
+       at91rm9200_timer_reset();
+}
+
+#ifdef CONFIG_PM
+static void at91rm9200_timer_suspend(void)
+{
+       /* disable Period Interval Timer interrupt */
+       at91_sys_write(AT91_ST_IDR, AT91_ST_PITS);
+}
+#else
+#define at91rm9200_timer_suspend       NULL
+#endif
+
+struct sys_timer at91rm9200_timer = {
+       .init           = at91rm9200_timer_init,
+       .offset         = at91rm9200_gettimeoffset,
+       .suspend        = at91rm9200_timer_suspend,
+       .resume         = at91rm9200_timer_reset,
+};
+
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
new file mode 100644 (file)
index 0000000..6ea41d8
--- /dev/null
@@ -0,0 +1,367 @@
+/*
+ * arch/arm/mach-at91/at91sam9260.c
+ *
+ *  Copyright (C) 2006 SAN People
+ *
+ * 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/module.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/at91sam9260.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
+
+#include "generic.h"
+#include "clock.h"
+
+static struct map_desc at91sam9260_io_desc[] __initdata = {
+       {
+               .virtual        = AT91_VA_BASE_SYS,
+               .pfn            = __phys_to_pfn(AT91_BASE_SYS),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }
+};
+
+static struct map_desc at91sam9260_sram_desc[] __initdata = {
+       {
+               .virtual        = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE,
+               .pfn            = __phys_to_pfn(AT91SAM9260_SRAM0_BASE),
+               .length         = AT91SAM9260_SRAM0_SIZE,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE - AT91SAM9260_SRAM1_SIZE,
+               .pfn            = __phys_to_pfn(AT91SAM9260_SRAM1_BASE),
+               .length         = AT91SAM9260_SRAM1_SIZE,
+               .type           = MT_DEVICE,
+       }
+};
+
+static struct map_desc at91sam9xe_sram_desc[] __initdata = {
+       {
+               .pfn            = __phys_to_pfn(AT91SAM9XE_SRAM_BASE),
+               .type           = MT_DEVICE,
+       }
+};
+
+/* --------------------------------------------------------------------
+ *  Clocks
+ * -------------------------------------------------------------------- */
+
+/*
+ * The peripheral clocks.
+ */
+static struct clk pioA_clk = {
+       .name           = "pioA_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_PIOA,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk pioB_clk = {
+       .name           = "pioB_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_PIOB,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk pioC_clk = {
+       .name           = "pioC_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_PIOC,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk adc_clk = {
+       .name           = "adc_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_ADC,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart0_clk = {
+       .name           = "usart0_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_US0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart1_clk = {
+       .name           = "usart1_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_US1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart2_clk = {
+       .name           = "usart2_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_US2,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk mmc_clk = {
+       .name           = "mci_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_MCI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk udc_clk = {
+       .name           = "udc_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_UDP,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk twi_clk = {
+       .name           = "twi_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_TWI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk spi0_clk = {
+       .name           = "spi0_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_SPI0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk spi1_clk = {
+       .name           = "spi1_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_SPI1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc0_clk = {
+       .name           = "tc0_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_TC0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc1_clk = {
+       .name           = "tc1_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_TC1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc2_clk = {
+       .name           = "tc2_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_TC2,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ohci_clk = {
+       .name           = "ohci_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_UHP,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk macb_clk = {
+       .name           = "macb_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_EMAC,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk isi_clk = {
+       .name           = "isi_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_ISI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart3_clk = {
+       .name           = "usart3_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_US3,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart4_clk = {
+       .name           = "usart4_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_US4,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart5_clk = {
+       .name           = "usart5_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_US5,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc3_clk = {
+       .name           = "tc3_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_TC3,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc4_clk = {
+       .name           = "tc4_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_TC4,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc5_clk = {
+       .name           = "tc5_clk",
+       .pmc_mask       = 1 << AT91SAM9260_ID_TC5,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+
+static struct clk *periph_clocks[] __initdata = {
+       &pioA_clk,
+       &pioB_clk,
+       &pioC_clk,
+       &adc_clk,
+       &usart0_clk,
+       &usart1_clk,
+       &usart2_clk,
+       &mmc_clk,
+       &udc_clk,
+       &twi_clk,
+       &spi0_clk,
+       &spi1_clk,
+       // ssc
+       &tc0_clk,
+       &tc1_clk,
+       &tc2_clk,
+       &ohci_clk,
+       &macb_clk,
+       &isi_clk,
+       &usart3_clk,
+       &usart4_clk,
+       &usart5_clk,
+       &tc3_clk,
+       &tc4_clk,
+       &tc5_clk,
+       // irq0 .. irq2
+};
+
+/*
+ * The two programmable clocks.
+ * You must configure pin multiplexing to bring these signals out.
+ */
+static struct clk pck0 = {
+       .name           = "pck0",
+       .pmc_mask       = AT91_PMC_PCK0,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 0,
+};
+static struct clk pck1 = {
+       .name           = "pck1",
+       .pmc_mask       = AT91_PMC_PCK1,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 1,
+};
+
+static void __init at91sam9260_register_clocks(void)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
+               clk_register(periph_clocks[i]);
+
+       clk_register(&pck0);
+       clk_register(&pck1);
+}
+
+/* --------------------------------------------------------------------
+ *  GPIO
+ * -------------------------------------------------------------------- */
+
+static struct at91_gpio_bank at91sam9260_gpio[] = {
+       {
+               .id             = AT91SAM9260_ID_PIOA,
+               .offset         = AT91_PIOA,
+               .clock          = &pioA_clk,
+       }, {
+               .id             = AT91SAM9260_ID_PIOB,
+               .offset         = AT91_PIOB,
+               .clock          = &pioB_clk,
+       }, {
+               .id             = AT91SAM9260_ID_PIOC,
+               .offset         = AT91_PIOC,
+               .clock          = &pioC_clk,
+       }
+};
+
+static void at91sam9260_reset(void)
+{
+       at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
+}
+
+
+/* --------------------------------------------------------------------
+ *  AT91SAM9260 processor initialization
+ * -------------------------------------------------------------------- */
+
+static void __init at91sam9xe_initialize(void)
+{
+       unsigned long cidr, sram_size;
+
+       cidr = at91_sys_read(AT91_DBGU_CIDR);
+
+       switch (cidr & AT91_CIDR_SRAMSIZ) {
+               case AT91_CIDR_SRAMSIZ_32K:
+                       sram_size = 2 * SZ_16K;
+                       break;
+               case AT91_CIDR_SRAMSIZ_16K:
+               default:
+                       sram_size = SZ_16K;
+       }
+
+       at91sam9xe_sram_desc->virtual = AT91_IO_VIRT_BASE - sram_size;
+       at91sam9xe_sram_desc->length = sram_size;
+
+       iotable_init(at91sam9xe_sram_desc, ARRAY_SIZE(at91sam9xe_sram_desc));
+}
+
+void __init at91sam9260_initialize(unsigned long main_clock)
+{
+       /* Map peripherals */
+       iotable_init(at91sam9260_io_desc, ARRAY_SIZE(at91sam9260_io_desc));
+
+       if (cpu_is_at91sam9xe())
+               at91sam9xe_initialize();
+       else
+               iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc));
+
+       at91_arch_reset = at91sam9260_reset;
+       at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
+                       | (1 << AT91SAM9260_ID_IRQ2);
+
+       /* Init clock subsystem */
+       at91_clock_init(main_clock);
+
+       /* Register the processor-specific clocks */
+       at91sam9260_register_clocks();
+
+       /* Register GPIO subsystem */
+       at91_gpio_init(at91sam9260_gpio, 3);
+}
+
+/* --------------------------------------------------------------------
+ *  Interrupt initialization
+ * -------------------------------------------------------------------- */
+
+/*
+ * The default interrupt priority levels (0 = lowest, 7 = highest).
+ */
+static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = {
+       7,      /* Advanced Interrupt Controller */
+       7,      /* System Peripherals */
+       0,      /* Parallel IO Controller A */
+       0,      /* Parallel IO Controller B */
+       0,      /* Parallel IO Controller C */
+       0,      /* Analog-to-Digital Converter */
+       6,      /* USART 0 */
+       6,      /* USART 1 */
+       6,      /* USART 2 */
+       0,      /* Multimedia Card Interface */
+       4,      /* USB Device Port */
+       0,      /* Two-Wire Interface */
+       6,      /* Serial Peripheral Interface 0 */
+       6,      /* Serial Peripheral Interface 1 */
+       5,      /* Serial Synchronous Controller */
+       0,
+       0,
+       0,      /* Timer Counter 0 */
+       0,      /* Timer Counter 1 */
+       0,      /* Timer Counter 2 */
+       3,      /* USB Host port */
+       3,      /* Ethernet */
+       0,      /* Image Sensor Interface */
+       6,      /* USART 3 */
+       6,      /* USART 4 */
+       6,      /* USART 5 */
+       0,      /* Timer Counter 3 */
+       0,      /* Timer Counter 4 */
+       0,      /* Timer Counter 5 */
+       0,      /* Advanced Interrupt Controller */
+       0,      /* Advanced Interrupt Controller */
+       0,      /* Advanced Interrupt Controller */
+};
+
+void __init at91sam9260_init_interrupts(unsigned int priority[NR_AIC_IRQS])
+{
+       if (!priority)
+               priority = at91sam9260_default_irq_priority;
+
+       /* Initialize the AIC interrupt controller */
+       at91_aic_init(priority);
+
+       /* Enable GPIO interrupts */
+       at91_gpio_irq_setup();
+}
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
new file mode 100644 (file)
index 0000000..f7d342c
--- /dev/null
@@ -0,0 +1,871 @@
+/*
+ * arch/arm/mach-at91/at91sam9260_devices.c
+ *
+ *  Copyright (C) 2006 Atmel
+ *
+ * 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/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <linux/platform_device.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91sam9260.h>
+#include <asm/arch/at91sam926x_mc.h>
+#include <asm/arch/at91sam9260_matrix.h>
+
+#include "generic.h"
+
+#define SZ_512 0x00000200
+#define SZ_256 0x00000100
+#define SZ_16  0x00000010
+
+/* --------------------------------------------------------------------
+ *  USB Host
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+static u64 ohci_dmamask = 0xffffffffUL;
+static struct at91_usbh_data usbh_data;
+
+static struct resource usbh_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_UHP_BASE,
+               .end    = AT91SAM9260_UHP_BASE + SZ_1M - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_UHP,
+               .end    = AT91SAM9260_ID_UHP,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91_usbh_device = {
+       .name           = "at91_ohci",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &ohci_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &usbh_data,
+       },
+       .resource       = usbh_resources,
+       .num_resources  = ARRAY_SIZE(usbh_resources),
+};
+
+void __init at91_add_device_usbh(struct at91_usbh_data *data)
+{
+       if (!data)
+               return;
+
+       usbh_data = *data;
+       platform_device_register(&at91_usbh_device);
+}
+#else
+void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  USB Device (Gadget)
+ * -------------------------------------------------------------------- */
+
+#ifdef CONFIG_USB_GADGET_AT91
+static struct at91_udc_data udc_data;
+
+static struct resource udc_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_UDP,
+               .end    = AT91SAM9260_BASE_UDP + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_UDP,
+               .end    = AT91SAM9260_ID_UDP,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91_udc_device = {
+       .name           = "at91_udc",
+       .id             = -1,
+       .dev            = {
+                               .platform_data          = &udc_data,
+       },
+       .resource       = udc_resources,
+       .num_resources  = ARRAY_SIZE(udc_resources),
+};
+
+void __init at91_add_device_udc(struct at91_udc_data *data)
+{
+       if (!data)
+               return;
+
+       if (data->vbus_pin) {
+               at91_set_gpio_input(data->vbus_pin, 0);
+               at91_set_deglitch(data->vbus_pin, 1);
+       }
+
+       /* Pullup pin is handled internally by USB device peripheral */
+
+       udc_data = *data;
+       platform_device_register(&at91_udc_device);
+}
+#else
+void __init at91_add_device_udc(struct at91_udc_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  Ethernet
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
+static u64 eth_dmamask = 0xffffffffUL;
+static struct at91_eth_data eth_data;
+
+static struct resource eth_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_EMAC,
+               .end    = AT91SAM9260_BASE_EMAC + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_EMAC,
+               .end    = AT91SAM9260_ID_EMAC,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9260_eth_device = {
+       .name           = "macb",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &eth_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &eth_data,
+       },
+       .resource       = eth_resources,
+       .num_resources  = ARRAY_SIZE(eth_resources),
+};
+
+void __init at91_add_device_eth(struct at91_eth_data *data)
+{
+       if (!data)
+               return;
+
+       if (data->phy_irq_pin) {
+               at91_set_gpio_input(data->phy_irq_pin, 0);
+               at91_set_deglitch(data->phy_irq_pin, 1);
+       }
+
+       /* Pins used for MII and RMII */
+       at91_set_A_periph(AT91_PIN_PA19, 0);    /* ETXCK_EREFCK */
+       at91_set_A_periph(AT91_PIN_PA17, 0);    /* ERXDV */
+       at91_set_A_periph(AT91_PIN_PA14, 0);    /* ERX0 */
+       at91_set_A_periph(AT91_PIN_PA15, 0);    /* ERX1 */
+       at91_set_A_periph(AT91_PIN_PA18, 0);    /* ERXER */
+       at91_set_A_periph(AT91_PIN_PA16, 0);    /* ETXEN */
+       at91_set_A_periph(AT91_PIN_PA12, 0);    /* ETX0 */
+       at91_set_A_periph(AT91_PIN_PA13, 0);    /* ETX1 */
+       at91_set_A_periph(AT91_PIN_PA21, 0);    /* EMDIO */
+       at91_set_A_periph(AT91_PIN_PA20, 0);    /* EMDC */
+
+       if (!data->is_rmii) {
+               at91_set_B_periph(AT91_PIN_PA28, 0);    /* ECRS */
+               at91_set_B_periph(AT91_PIN_PA29, 0);    /* ECOL */
+               at91_set_B_periph(AT91_PIN_PA25, 0);    /* ERX2 */
+               at91_set_B_periph(AT91_PIN_PA26, 0);    /* ERX3 */
+               at91_set_B_periph(AT91_PIN_PA27, 0);    /* ERXCK */
+               at91_set_B_periph(AT91_PIN_PA23, 0);    /* ETX2 */
+               at91_set_B_periph(AT91_PIN_PA24, 0);    /* ETX3 */
+               at91_set_B_periph(AT91_PIN_PA22, 0);    /* ETXER */
+       }
+
+       eth_data = *data;
+       platform_device_register(&at91sam9260_eth_device);
+}
+#else
+void __init at91_add_device_eth(struct at91_eth_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  MMC / SD
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
+static u64 mmc_dmamask = 0xffffffffUL;
+static struct at91_mmc_data mmc_data;
+
+static struct resource mmc_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_MCI,
+               .end    = AT91SAM9260_BASE_MCI + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_MCI,
+               .end    = AT91SAM9260_ID_MCI,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9260_mmc_device = {
+       .name           = "at91_mci",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &mmc_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &mmc_data,
+       },
+       .resource       = mmc_resources,
+       .num_resources  = ARRAY_SIZE(mmc_resources),
+};
+
+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
+{
+       if (!data)
+               return;
+
+       /* input/irq */
+       if (data->det_pin) {
+               at91_set_gpio_input(data->det_pin, 1);
+               at91_set_deglitch(data->det_pin, 1);
+       }
+       if (data->wp_pin)
+               at91_set_gpio_input(data->wp_pin, 1);
+       if (data->vcc_pin)
+               at91_set_gpio_output(data->vcc_pin, 0);
+
+       /* CLK */
+       at91_set_A_periph(AT91_PIN_PA8, 0);
+
+       if (data->slot_b) {
+               /* CMD */
+               at91_set_B_periph(AT91_PIN_PA1, 1);
+
+               /* DAT0, maybe DAT1..DAT3 */
+               at91_set_B_periph(AT91_PIN_PA0, 1);
+               if (data->wire4) {
+                       at91_set_B_periph(AT91_PIN_PA5, 1);
+                       at91_set_B_periph(AT91_PIN_PA4, 1);
+                       at91_set_B_periph(AT91_PIN_PA3, 1);
+               }
+       } else {
+               /* CMD */
+               at91_set_A_periph(AT91_PIN_PA7, 1);
+
+               /* DAT0, maybe DAT1..DAT3 */
+               at91_set_A_periph(AT91_PIN_PA6, 1);
+               if (data->wire4) {
+                       at91_set_A_periph(AT91_PIN_PA9, 1);
+                       at91_set_A_periph(AT91_PIN_PA10, 1);
+                       at91_set_A_periph(AT91_PIN_PA11, 1);
+               }
+       }
+
+       mmc_data = *data;
+       platform_device_register(&at91sam9260_mmc_device);
+}
+#else
+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  NAND / SmartMedia
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+static struct at91_nand_data nand_data;
+
+#define NAND_BASE      AT91_CHIPSELECT_3
+
+static struct resource nand_resources[] = {
+       {
+               .start  = NAND_BASE,
+               .end    = NAND_BASE + SZ_8M - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device at91sam9260_nand_device = {
+       .name           = "at91_nand",
+       .id             = -1,
+       .dev            = {
+                               .platform_data  = &nand_data,
+       },
+       .resource       = nand_resources,
+       .num_resources  = ARRAY_SIZE(nand_resources),
+};
+
+void __init at91_add_device_nand(struct at91_nand_data *data)
+{
+       unsigned long csa, mode;
+
+       if (!data)
+               return;
+
+       csa = at91_sys_read(AT91_MATRIX_EBICSA);
+       at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC);
+
+       /* set the bus interface characteristics */
+       at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0)
+                       | AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0));
+
+       at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(2) | AT91_SMC_NCS_WRPULSE_(5)
+                       | AT91_SMC_NRDPULSE_(2) | AT91_SMC_NCS_RDPULSE_(5));
+
+       at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7));
+
+       if (data->bus_width_16)
+               mode = AT91_SMC_DBW_16;
+       else
+               mode = AT91_SMC_DBW_8;
+       at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(1));
+
+       /* enable pin */
+       if (data->enable_pin)
+               at91_set_gpio_output(data->enable_pin, 1);
+
+       /* ready/busy pin */
+       if (data->rdy_pin)
+               at91_set_gpio_input(data->rdy_pin, 1);
+
+       /* card detect pin */
+       if (data->det_pin)
+               at91_set_gpio_input(data->det_pin, 1);
+
+       nand_data = *data;
+       platform_device_register(&at91sam9260_nand_device);
+}
+#else
+void __init at91_add_device_nand(struct at91_nand_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  TWI (i2c)
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
+
+static struct resource twi_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_TWI,
+               .end    = AT91SAM9260_BASE_TWI + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_TWI,
+               .end    = AT91SAM9260_ID_TWI,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9260_twi_device = {
+       .name           = "at91_i2c",
+       .id             = -1,
+       .resource       = twi_resources,
+       .num_resources  = ARRAY_SIZE(twi_resources),
+};
+
+void __init at91_add_device_i2c(void)
+{
+       /* pins used for TWI interface */
+       at91_set_A_periph(AT91_PIN_PA23, 0);            /* TWD */
+       at91_set_multi_drive(AT91_PIN_PA23, 1);
+
+       at91_set_A_periph(AT91_PIN_PA24, 0);            /* TWCK */
+       at91_set_multi_drive(AT91_PIN_PA24, 1);
+
+       platform_device_register(&at91sam9260_twi_device);
+}
+#else
+void __init at91_add_device_i2c(void) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  SPI
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
+static u64 spi_dmamask = 0xffffffffUL;
+
+static struct resource spi0_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_SPI0,
+               .end    = AT91SAM9260_BASE_SPI0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_SPI0,
+               .end    = AT91SAM9260_ID_SPI0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9260_spi0_device = {
+       .name           = "atmel_spi",
+       .id             = 0,
+       .dev            = {
+                               .dma_mask               = &spi_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+       },
+       .resource       = spi0_resources,
+       .num_resources  = ARRAY_SIZE(spi0_resources),
+};
+
+static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PC11, AT91_PIN_PC16, AT91_PIN_PC17 };
+
+static struct resource spi1_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_SPI1,
+               .end    = AT91SAM9260_BASE_SPI1 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_SPI1,
+               .end    = AT91SAM9260_ID_SPI1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9260_spi1_device = {
+       .name           = "atmel_spi",
+       .id             = 1,
+       .dev            = {
+                               .dma_mask               = &spi_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+       },
+       .resource       = spi1_resources,
+       .num_resources  = ARRAY_SIZE(spi1_resources),
+};
+
+static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB3, AT91_PIN_PC5, AT91_PIN_PC4, AT91_PIN_PC3 };
+
+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
+{
+       int i;
+       unsigned long cs_pin;
+       short enable_spi0 = 0;
+       short enable_spi1 = 0;
+
+       /* Choose SPI chip-selects */
+       for (i = 0; i < nr_devices; i++) {
+               if (devices[i].controller_data)
+                       cs_pin = (unsigned long) devices[i].controller_data;
+               else if (devices[i].bus_num == 0)
+                       cs_pin = spi0_standard_cs[devices[i].chip_select];
+               else
+                       cs_pin = spi1_standard_cs[devices[i].chip_select];
+
+               if (devices[i].bus_num == 0)
+                       enable_spi0 = 1;
+               else
+                       enable_spi1 = 1;
+
+               /* enable chip-select pin */
+               at91_set_gpio_output(cs_pin, 1);
+
+               /* pass chip-select pin to driver */
+               devices[i].controller_data = (void *) cs_pin;
+       }
+
+       spi_register_board_info(devices, nr_devices);
+
+       /* Configure SPI bus(es) */
+       if (enable_spi0) {
+               at91_set_A_periph(AT91_PIN_PA0, 0);     /* SPI0_MISO */
+               at91_set_A_periph(AT91_PIN_PA1, 0);     /* SPI0_MOSI */
+               at91_set_A_periph(AT91_PIN_PA2, 0);     /* SPI1_SPCK */
+
+               at91_clock_associate("spi0_clk", &at91sam9260_spi0_device.dev, "spi_clk");
+               platform_device_register(&at91sam9260_spi0_device);
+       }
+       if (enable_spi1) {
+               at91_set_A_periph(AT91_PIN_PB0, 0);     /* SPI1_MISO */
+               at91_set_A_periph(AT91_PIN_PB1, 0);     /* SPI1_MOSI */
+               at91_set_A_periph(AT91_PIN_PB2, 0);     /* SPI1_SPCK */
+
+               at91_clock_associate("spi1_clk", &at91sam9260_spi1_device.dev, "spi_clk");
+               platform_device_register(&at91sam9260_spi1_device);
+       }
+}
+#else
+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  LEDs
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_LEDS)
+u8 at91_leds_cpu;
+u8 at91_leds_timer;
+
+void __init at91_init_leds(u8 cpu_led, u8 timer_led)
+{
+       /* Enable GPIO to access the LEDs */
+       at91_set_gpio_output(cpu_led, 1);
+       at91_set_gpio_output(timer_led, 1);
+
+       at91_leds_cpu   = cpu_led;
+       at91_leds_timer = timer_led;
+}
+#else
+void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  UART
+ * -------------------------------------------------------------------- */
+#if defined(CONFIG_SERIAL_ATMEL)
+static struct resource dbgu_resources[] = {
+       [0] = {
+               .start  = AT91_VA_BASE_SYS + AT91_DBGU,
+               .end    = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_ID_SYS,
+               .end    = AT91_ID_SYS,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data dbgu_data = {
+       .use_dma_tx     = 0,
+       .use_dma_rx     = 0,            /* DBGU not capable of receive DMA */
+       .regs           = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
+};
+
+static struct platform_device at91sam9260_dbgu_device = {
+       .name           = "atmel_usart",
+       .id             = 0,
+       .dev            = {
+                               .platform_data  = &dbgu_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = dbgu_resources,
+       .num_resources  = ARRAY_SIZE(dbgu_resources),
+};
+
+static inline void configure_dbgu_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PB14, 0);            /* DRXD */
+       at91_set_A_periph(AT91_PIN_PB15, 1);            /* DTXD */
+}
+
+static struct resource uart0_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_US0,
+               .end    = AT91SAM9260_BASE_US0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_US0,
+               .end    = AT91SAM9260_ID_US0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart0_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9260_uart0_device = {
+       .name           = "atmel_usart",
+       .id             = 1,
+       .dev            = {
+                               .platform_data  = &uart0_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart0_resources,
+       .num_resources  = ARRAY_SIZE(uart0_resources),
+};
+
+static inline void configure_usart0_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PB4, 1);             /* TXD0 */
+       at91_set_A_periph(AT91_PIN_PB5, 0);             /* RXD0 */
+       at91_set_A_periph(AT91_PIN_PB26, 0);            /* RTS0 */
+       at91_set_A_periph(AT91_PIN_PB27, 0);            /* CTS0 */
+       at91_set_A_periph(AT91_PIN_PB24, 0);            /* DTR0 */
+       at91_set_A_periph(AT91_PIN_PB22, 0);            /* DSR0 */
+       at91_set_A_periph(AT91_PIN_PB23, 0);            /* DCD0 */
+       at91_set_A_periph(AT91_PIN_PB25, 0);            /* RI0 */
+}
+
+static struct resource uart1_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_US1,
+               .end    = AT91SAM9260_BASE_US1 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_US1,
+               .end    = AT91SAM9260_ID_US1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart1_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9260_uart1_device = {
+       .name           = "atmel_usart",
+       .id             = 2,
+       .dev            = {
+                               .platform_data  = &uart1_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart1_resources,
+       .num_resources  = ARRAY_SIZE(uart1_resources),
+};
+
+static inline void configure_usart1_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PB6, 1);             /* TXD1 */
+       at91_set_A_periph(AT91_PIN_PB7, 0);             /* RXD1 */
+       at91_set_A_periph(AT91_PIN_PB28, 0);            /* RTS1 */
+       at91_set_A_periph(AT91_PIN_PB29, 0);            /* CTS1 */
+}
+
+static struct resource uart2_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_US2,
+               .end    = AT91SAM9260_BASE_US2 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_US2,
+               .end    = AT91SAM9260_ID_US2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart2_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9260_uart2_device = {
+       .name           = "atmel_usart",
+       .id             = 3,
+       .dev            = {
+                               .platform_data  = &uart2_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart2_resources,
+       .num_resources  = ARRAY_SIZE(uart2_resources),
+};
+
+static inline void configure_usart2_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PB8, 1);             /* TXD2 */
+       at91_set_A_periph(AT91_PIN_PB9, 0);             /* RXD2 */
+}
+
+static struct resource uart3_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_US3,
+               .end    = AT91SAM9260_BASE_US3 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_US3,
+               .end    = AT91SAM9260_ID_US3,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart3_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9260_uart3_device = {
+       .name           = "atmel_usart",
+       .id             = 4,
+       .dev            = {
+                               .platform_data  = &uart3_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart3_resources,
+       .num_resources  = ARRAY_SIZE(uart3_resources),
+};
+
+static inline void configure_usart3_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PB10, 1);            /* TXD3 */
+       at91_set_A_periph(AT91_PIN_PB11, 0);            /* RXD3 */
+}
+
+static struct resource uart4_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_US4,
+               .end    = AT91SAM9260_BASE_US4 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_US4,
+               .end    = AT91SAM9260_ID_US4,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart4_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9260_uart4_device = {
+       .name           = "atmel_usart",
+       .id             = 5,
+       .dev            = {
+                               .platform_data  = &uart4_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart4_resources,
+       .num_resources  = ARRAY_SIZE(uart4_resources),
+};
+
+static inline void configure_usart4_pins(void)
+{
+       at91_set_B_periph(AT91_PIN_PA31, 1);            /* TXD4 */
+       at91_set_B_periph(AT91_PIN_PA30, 0);            /* RXD4 */
+}
+
+static struct resource uart5_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_US5,
+               .end    = AT91SAM9260_BASE_US5 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_US5,
+               .end    = AT91SAM9260_ID_US5,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart5_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9260_uart5_device = {
+       .name           = "atmel_usart",
+       .id             = 6,
+       .dev            = {
+                               .platform_data  = &uart5_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart5_resources,
+       .num_resources  = ARRAY_SIZE(uart5_resources),
+};
+
+static inline void configure_usart5_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PB12, 1);            /* TXD5 */
+       at91_set_A_periph(AT91_PIN_PB13, 0);            /* RXD5 */
+}
+
+struct platform_device *at91_uarts[ATMEL_MAX_UART];    /* the UARTs to use */
+struct platform_device *atmel_default_console_device;  /* the serial console device */
+
+void __init at91_init_serial(struct at91_uart_config *config)
+{
+       int i;
+
+       /* Fill in list of supported UARTs */
+       for (i = 0; i < config->nr_tty; i++) {
+               switch (config->tty_map[i]) {
+                       case 0:
+                               configure_usart0_pins();
+                               at91_uarts[i] = &at91sam9260_uart0_device;
+                               at91_clock_associate("usart0_clk", &at91sam9260_uart0_device.dev, "usart");
+                               break;
+                       case 1:
+                               configure_usart1_pins();
+                               at91_uarts[i] = &at91sam9260_uart1_device;
+                               at91_clock_associate("usart1_clk", &at91sam9260_uart1_device.dev, "usart");
+                               break;
+                       case 2:
+                               configure_usart2_pins();
+                               at91_uarts[i] = &at91sam9260_uart2_device;
+                               at91_clock_associate("usart2_clk", &at91sam9260_uart2_device.dev, "usart");
+                               break;
+                       case 3:
+                               configure_usart3_pins();
+                               at91_uarts[i] = &at91sam9260_uart3_device;
+                               at91_clock_associate("usart3_clk", &at91sam9260_uart3_device.dev, "usart");
+                               break;
+                       case 4:
+                               configure_usart4_pins();
+                               at91_uarts[i] = &at91sam9260_uart4_device;
+                               at91_clock_associate("usart4_clk", &at91sam9260_uart4_device.dev, "usart");
+                               break;
+                       case 5:
+                               configure_usart5_pins();
+                               at91_uarts[i] = &at91sam9260_uart5_device;
+                               at91_clock_associate("usart5_clk", &at91sam9260_uart5_device.dev, "usart");
+                               break;
+                       case 6:
+                               configure_dbgu_pins();
+                               at91_uarts[i] = &at91sam9260_dbgu_device;
+                               at91_clock_associate("mck", &at91sam9260_dbgu_device.dev, "usart");
+                               break;
+                       default:
+                               continue;
+               }
+               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
+       }
+
+       /* Set serial console device */
+       if (config->console_tty < ATMEL_MAX_UART)
+               atmel_default_console_device = at91_uarts[config->console_tty];
+       if (!atmel_default_console_device)
+               printk(KERN_INFO "AT91: No default serial console defined.\n");
+}
+
+void __init at91_add_device_serial(void)
+{
+       int i;
+
+       for (i = 0; i < ATMEL_MAX_UART; i++) {
+               if (at91_uarts[i])
+                       platform_device_register(at91_uarts[i]);
+       }
+}
+#else
+void __init at91_init_serial(struct at91_uart_config *config) {}
+void __init at91_add_device_serial(void) {}
+#endif
+
+
+/* -------------------------------------------------------------------- */
+/*
+ * These devices are always present and don't need any board-specific
+ * setup.
+ */
+static int __init at91_add_standard_devices(void)
+{
+       return 0;
+}
+
+arch_initcall(at91_add_standard_devices);
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
new file mode 100644 (file)
index 0000000..784d1e6
--- /dev/null
@@ -0,0 +1,307 @@
+/*
+ * arch/arm/mach-at91/at91sam9261.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *
+ * 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/module.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/arch/at91sam9261.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
+
+#include "generic.h"
+#include "clock.h"
+
+static struct map_desc at91sam9261_io_desc[] __initdata = {
+       {
+               .virtual        = AT91_VA_BASE_SYS,
+               .pfn            = __phys_to_pfn(AT91_BASE_SYS),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_IO_VIRT_BASE - AT91SAM9261_SRAM_SIZE,
+               .pfn            = __phys_to_pfn(AT91SAM9261_SRAM_BASE),
+               .length         = AT91SAM9261_SRAM_SIZE,
+               .type           = MT_DEVICE,
+       },
+};
+
+/* --------------------------------------------------------------------
+ *  Clocks
+ * -------------------------------------------------------------------- */
+
+/*
+ * The peripheral clocks.
+ */
+static struct clk pioA_clk = {
+       .name           = "pioA_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_PIOA,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk pioB_clk = {
+       .name           = "pioB_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_PIOB,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk pioC_clk = {
+       .name           = "pioC_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_PIOC,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart0_clk = {
+       .name           = "usart0_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_US0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart1_clk = {
+       .name           = "usart1_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_US1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart2_clk = {
+       .name           = "usart2_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_US2,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk mmc_clk = {
+       .name           = "mci_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_MCI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk udc_clk = {
+       .name           = "udc_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_UDP,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk twi_clk = {
+       .name           = "twi_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_TWI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk spi0_clk = {
+       .name           = "spi0_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_SPI0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk spi1_clk = {
+       .name           = "spi1_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_SPI1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc0_clk = {
+       .name           = "tc0_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_TC0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc1_clk = {
+       .name           = "tc1_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_TC1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tc2_clk = {
+       .name           = "tc2_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_TC2,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ohci_clk = {
+       .name           = "ohci_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_UHP,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk lcdc_clk = {
+       .name           = "lcdc_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_LCDC,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+
+static struct clk *periph_clocks[] __initdata = {
+       &pioA_clk,
+       &pioB_clk,
+       &pioC_clk,
+       &usart0_clk,
+       &usart1_clk,
+       &usart2_clk,
+       &mmc_clk,
+       &udc_clk,
+       &twi_clk,
+       &spi0_clk,
+       &spi1_clk,
+       // ssc 0 .. ssc2
+       &tc0_clk,
+       &tc1_clk,
+       &tc2_clk,
+       &ohci_clk,
+       &lcdc_clk,
+       // irq0 .. irq2
+};
+
+/*
+ * The four programmable clocks.
+ * You must configure pin multiplexing to bring these signals out.
+ */
+static struct clk pck0 = {
+       .name           = "pck0",
+       .pmc_mask       = AT91_PMC_PCK0,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 0,
+};
+static struct clk pck1 = {
+       .name           = "pck1",
+       .pmc_mask       = AT91_PMC_PCK1,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 1,
+};
+static struct clk pck2 = {
+       .name           = "pck2",
+       .pmc_mask       = AT91_PMC_PCK2,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 2,
+};
+static struct clk pck3 = {
+       .name           = "pck3",
+       .pmc_mask       = AT91_PMC_PCK3,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 3,
+};
+
+/* HClocks */
+static struct clk hck0 = {
+       .name           = "hck0",
+       .pmc_mask       = AT91_PMC_HCK0,
+       .type           = CLK_TYPE_SYSTEM,
+       .id             = 0,
+};
+static struct clk hck1 = {
+       .name           = "hck1",
+       .pmc_mask       = AT91_PMC_HCK1,
+       .type           = CLK_TYPE_SYSTEM,
+       .id             = 1,
+};
+
+static void __init at91sam9261_register_clocks(void)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
+               clk_register(periph_clocks[i]);
+
+       clk_register(&pck0);
+       clk_register(&pck1);
+       clk_register(&pck2);
+       clk_register(&pck3);
+
+       clk_register(&hck0);
+       clk_register(&hck1);
+}
+
+/* --------------------------------------------------------------------
+ *  GPIO
+ * -------------------------------------------------------------------- */
+
+static struct at91_gpio_bank at91sam9261_gpio[] = {
+       {
+               .id             = AT91SAM9261_ID_PIOA,
+               .offset         = AT91_PIOA,
+               .clock          = &pioA_clk,
+       }, {
+               .id             = AT91SAM9261_ID_PIOB,
+               .offset         = AT91_PIOB,
+               .clock          = &pioB_clk,
+       }, {
+               .id             = AT91SAM9261_ID_PIOC,
+               .offset         = AT91_PIOC,
+               .clock          = &pioC_clk,
+       }
+};
+
+static void at91sam9261_reset(void)
+{
+       at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
+}
+
+
+/* --------------------------------------------------------------------
+ *  AT91SAM9261 processor initialization
+ * -------------------------------------------------------------------- */
+
+void __init at91sam9261_initialize(unsigned long main_clock)
+{
+       /* Map peripherals */
+       iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc));
+
+       at91_arch_reset = at91sam9261_reset;
+       at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
+                       | (1 << AT91SAM9261_ID_IRQ2);
+
+       /* Init clock subsystem */
+       at91_clock_init(main_clock);
+
+       /* Register the processor-specific clocks */
+       at91sam9261_register_clocks();
+
+       /* Register GPIO subsystem */
+       at91_gpio_init(at91sam9261_gpio, 3);
+}
+
+/* --------------------------------------------------------------------
+ *  Interrupt initialization
+ * -------------------------------------------------------------------- */
+
+/*
+ * The default interrupt priority levels (0 = lowest, 7 = highest).
+ */
+static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {
+       7,      /* Advanced Interrupt Controller */
+       7,      /* System Peripherals */
+       0,      /* Parallel IO Controller A */
+       0,      /* Parallel IO Controller B */
+       0,      /* Parallel IO Controller C */
+       0,
+       6,      /* USART 0 */
+       6,      /* USART 1 */
+       6,      /* USART 2 */
+       0,      /* Multimedia Card Interface */
+       4,      /* USB Device Port */
+       0,      /* Two-Wire Interface */
+       6,      /* Serial Peripheral Interface 0 */
+       6,      /* Serial Peripheral Interface 1 */
+       5,      /* Serial Synchronous Controller 0 */
+       5,      /* Serial Synchronous Controller 1 */
+       5,      /* Serial Synchronous Controller 2 */
+       0,      /* Timer Counter 0 */
+       0,      /* Timer Counter 1 */
+       0,      /* Timer Counter 2 */
+       3,      /* USB Host port */
+       3,      /* LCD Controller */
+       0,
+       0,
+       0,
+       0,
+       0,
+       0,
+       0,
+       0,      /* Advanced Interrupt Controller */
+       0,      /* Advanced Interrupt Controller */
+       0,      /* Advanced Interrupt Controller */
+};
+
+void __init at91sam9261_init_interrupts(unsigned int priority[NR_AIC_IRQS])
+{
+       if (!priority)
+               priority = at91sam9261_default_irq_priority;
+
+       /* Initialize the AIC interrupt controller */
+       at91_aic_init(priority);
+
+       /* Enable GPIO interrupts */
+       at91_gpio_irq_setup();
+}
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
new file mode 100644 (file)
index 0000000..e150476
--- /dev/null
@@ -0,0 +1,745 @@
+/*
+ * arch/arm/mach-at91/at91sam9261_devices.c
+ *
+ *  Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
+ *  Copyright (C) 2005 David Brownell
+ *
+ * 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/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <linux/platform_device.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91sam9261.h>
+#include <asm/arch/at91sam9261_matrix.h>
+#include <asm/arch/at91sam926x_mc.h>
+
+#include "generic.h"
+
+#define SZ_512 0x00000200
+#define SZ_256 0x00000100
+#define SZ_16  0x00000010
+
+/* --------------------------------------------------------------------
+ *  USB Host
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+static u64 ohci_dmamask = 0xffffffffUL;
+static struct at91_usbh_data usbh_data;
+
+static struct resource usbh_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_UHP_BASE,
+               .end    = AT91SAM9261_UHP_BASE + SZ_1M - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_UHP,
+               .end    = AT91SAM9261_ID_UHP,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9261_usbh_device = {
+       .name           = "at91_ohci",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &ohci_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &usbh_data,
+       },
+       .resource       = usbh_resources,
+       .num_resources  = ARRAY_SIZE(usbh_resources),
+};
+
+void __init at91_add_device_usbh(struct at91_usbh_data *data)
+{
+       if (!data)
+               return;
+
+       usbh_data = *data;
+       platform_device_register(&at91sam9261_usbh_device);
+}
+#else
+void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  USB Device (Gadget)
+ * -------------------------------------------------------------------- */
+
+#ifdef CONFIG_USB_GADGET_AT91
+static struct at91_udc_data udc_data;
+
+static struct resource udc_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_BASE_UDP,
+               .end    = AT91SAM9261_BASE_UDP + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_UDP,
+               .end    = AT91SAM9261_ID_UDP,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9261_udc_device = {
+       .name           = "at91_udc",
+       .id             = -1,
+       .dev            = {
+                               .platform_data          = &udc_data,
+       },
+       .resource       = udc_resources,
+       .num_resources  = ARRAY_SIZE(udc_resources),
+};
+
+void __init at91_add_device_udc(struct at91_udc_data *data)
+{
+       unsigned long x;
+
+       if (!data)
+               return;
+
+       if (data->vbus_pin) {
+               at91_set_gpio_input(data->vbus_pin, 0);
+               at91_set_deglitch(data->vbus_pin, 1);
+       }
+
+       /* Pullup pin is handled internally */
+       x = at91_sys_read(AT91_MATRIX_USBPUCR);
+       at91_sys_write(AT91_MATRIX_USBPUCR, x | AT91_MATRIX_USBPUCR_PUON);
+
+       udc_data = *data;
+       platform_device_register(&at91sam9261_udc_device);
+}
+#else
+void __init at91_add_device_udc(struct at91_udc_data *data) {}
+#endif
+
+/* --------------------------------------------------------------------
+ *  MMC / SD
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
+static u64 mmc_dmamask = 0xffffffffUL;
+static struct at91_mmc_data mmc_data;
+
+static struct resource mmc_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_BASE_MCI,
+               .end    = AT91SAM9261_BASE_MCI + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_MCI,
+               .end    = AT91SAM9261_ID_MCI,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9261_mmc_device = {
+       .name           = "at91_mci",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &mmc_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &mmc_data,
+       },
+       .resource       = mmc_resources,
+       .num_resources  = ARRAY_SIZE(mmc_resources),
+};
+
+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
+{
+       if (!data)
+               return;
+
+       /* input/irq */
+       if (data->det_pin) {
+               at91_set_gpio_input(data->det_pin, 1);
+               at91_set_deglitch(data->det_pin, 1);
+       }
+       if (data->wp_pin)
+               at91_set_gpio_input(data->wp_pin, 1);
+       if (data->vcc_pin)
+               at91_set_gpio_output(data->vcc_pin, 0);
+
+       /* CLK */
+       at91_set_B_periph(AT91_PIN_PA2, 0);
+
+       /* CMD */
+       at91_set_B_periph(AT91_PIN_PA1, 1);
+
+       /* DAT0, maybe DAT1..DAT3 */
+       at91_set_B_periph(AT91_PIN_PA0, 1);
+       if (data->wire4) {
+               at91_set_B_periph(AT91_PIN_PA4, 1);
+               at91_set_B_periph(AT91_PIN_PA5, 1);
+               at91_set_B_periph(AT91_PIN_PA6, 1);
+       }
+
+       mmc_data = *data;
+       platform_device_register(&at91sam9261_mmc_device);
+}
+#else
+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  NAND / SmartMedia
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+static struct at91_nand_data nand_data;
+
+#define NAND_BASE      AT91_CHIPSELECT_3
+
+static struct resource nand_resources[] = {
+       {
+               .start  = NAND_BASE,
+               .end    = NAND_BASE + SZ_256M - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device at91_nand_device = {
+       .name           = "at91_nand",
+       .id             = -1,
+       .dev            = {
+                               .platform_data  = &nand_data,
+       },
+       .resource       = nand_resources,
+       .num_resources  = ARRAY_SIZE(nand_resources),
+};
+
+void __init at91_add_device_nand(struct at91_nand_data *data)
+{
+       unsigned long csa, mode;
+
+       if (!data)
+               return;
+
+       csa = at91_sys_read(AT91_MATRIX_EBICSA);
+       at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC);
+
+       /* set the bus interface characteristics */
+       at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0)
+                       | AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0));
+
+       at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(2) | AT91_SMC_NCS_WRPULSE_(5)
+                       | AT91_SMC_NRDPULSE_(2) | AT91_SMC_NCS_RDPULSE_(5));
+
+       at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7));
+
+       if (data->bus_width_16)
+               mode = AT91_SMC_DBW_16;
+       else
+               mode = AT91_SMC_DBW_8;
+       at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(1));
+
+       /* enable pin */
+       if (data->enable_pin)
+               at91_set_gpio_output(data->enable_pin, 1);
+
+       /* ready/busy pin */
+       if (data->rdy_pin)
+               at91_set_gpio_input(data->rdy_pin, 1);
+
+       /* card detect pin */
+       if (data->det_pin)
+               at91_set_gpio_input(data->det_pin, 1);
+
+       at91_set_A_periph(AT91_PIN_PC0, 0);             /* NANDOE */
+       at91_set_A_periph(AT91_PIN_PC1, 0);             /* NANDWE */
+
+       nand_data = *data;
+       platform_device_register(&at91_nand_device);
+}
+
+#else
+void __init at91_add_device_nand(struct at91_nand_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  TWI (i2c)
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
+
+static struct resource twi_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_BASE_TWI,
+               .end    = AT91SAM9261_BASE_TWI + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_TWI,
+               .end    = AT91SAM9261_ID_TWI,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9261_twi_device = {
+       .name           = "at91_i2c",
+       .id             = -1,
+       .resource       = twi_resources,
+       .num_resources  = ARRAY_SIZE(twi_resources),
+};
+
+void __init at91_add_device_i2c(void)
+{
+       /* pins used for TWI interface */
+       at91_set_A_periph(AT91_PIN_PA7, 0);             /* TWD */
+       at91_set_multi_drive(AT91_PIN_PA7, 1);
+
+       at91_set_A_periph(AT91_PIN_PA8, 0);             /* TWCK */
+       at91_set_multi_drive(AT91_PIN_PA8, 1);
+
+       platform_device_register(&at91sam9261_twi_device);
+}
+#else
+void __init at91_add_device_i2c(void) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  SPI
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
+static u64 spi_dmamask = 0xffffffffUL;
+
+static struct resource spi0_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_BASE_SPI0,
+               .end    = AT91SAM9261_BASE_SPI0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_SPI0,
+               .end    = AT91SAM9261_ID_SPI0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9261_spi0_device = {
+       .name           = "atmel_spi",
+       .id             = 0,
+       .dev            = {
+                               .dma_mask               = &spi_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+       },
+       .resource       = spi0_resources,
+       .num_resources  = ARRAY_SIZE(spi0_resources),
+};
+
+static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PA4, AT91_PIN_PA5, AT91_PIN_PA6 };
+
+static struct resource spi1_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_BASE_SPI1,
+               .end    = AT91SAM9261_BASE_SPI1 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_SPI1,
+               .end    = AT91SAM9261_ID_SPI1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9261_spi1_device = {
+       .name           = "atmel_spi",
+       .id             = 1,
+       .dev            = {
+                               .dma_mask               = &spi_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+       },
+       .resource       = spi1_resources,
+       .num_resources  = ARRAY_SIZE(spi1_resources),
+};
+
+static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB28, AT91_PIN_PA24, AT91_PIN_PA25, AT91_PIN_PA26 };
+
+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
+{
+       int i;
+       unsigned long cs_pin;
+       short enable_spi0 = 0;
+       short enable_spi1 = 0;
+
+       /* Choose SPI chip-selects */
+       for (i = 0; i < nr_devices; i++) {
+               if (devices[i].controller_data)
+                       cs_pin = (unsigned long) devices[i].controller_data;
+               else if (devices[i].bus_num == 0)
+                       cs_pin = spi0_standard_cs[devices[i].chip_select];
+               else
+                       cs_pin = spi1_standard_cs[devices[i].chip_select];
+
+               if (devices[i].bus_num == 0)
+                       enable_spi0 = 1;
+               else
+                       enable_spi1 = 1;
+
+               /* enable chip-select pin */
+               at91_set_gpio_output(cs_pin, 1);
+
+               /* pass chip-select pin to driver */
+               devices[i].controller_data = (void *) cs_pin;
+       }
+
+       spi_register_board_info(devices, nr_devices);
+
+       /* Configure SPI bus(es) */
+       if (enable_spi0) {
+               at91_set_A_periph(AT91_PIN_PA0, 0);     /* SPI0_MISO */
+               at91_set_A_periph(AT91_PIN_PA1, 0);     /* SPI0_MOSI */
+               at91_set_A_periph(AT91_PIN_PA2, 0);     /* SPI0_SPCK */
+
+               at91_clock_associate("spi0_clk", &at91sam9261_spi0_device.dev, "spi_clk");
+               platform_device_register(&at91sam9261_spi0_device);
+       }
+       if (enable_spi1) {
+               at91_set_A_periph(AT91_PIN_PB30, 0);    /* SPI1_MISO */
+               at91_set_A_periph(AT91_PIN_PB31, 0);    /* SPI1_MOSI */
+               at91_set_A_periph(AT91_PIN_PB29, 0);    /* SPI1_SPCK */
+
+               at91_clock_associate("spi1_clk", &at91sam9261_spi1_device.dev, "spi_clk");
+               platform_device_register(&at91sam9261_spi1_device);
+       }
+}
+#else
+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  LCD Controller
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_FB_AT91) || defined(CONFIG_FB_AT91_MODULE)
+static u64 lcdc_dmamask = 0xffffffffUL;
+static struct at91fb_info lcdc_data;
+
+static struct resource lcdc_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_LCDC_BASE,
+               .end    = AT91SAM9261_LCDC_BASE + SZ_4K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_LCDC,
+               .end    = AT91SAM9261_ID_LCDC,
+               .flags  = IORESOURCE_IRQ,
+       },
+#if defined(CONFIG_FB_INTSRAM)
+       [2] = {
+               .start  = AT91SAM9261_SRAM_BASE,
+               .end    = AT91SAM9261_SRAM_BASE + AT91SAM9261_SRAM_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+#endif
+};
+
+static struct platform_device at91_lcdc_device = {
+       .name           = "at91-fb",
+       .id             = 0,
+       .dev            = {
+                               .dma_mask               = &lcdc_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &lcdc_data,
+       },
+       .resource       = lcdc_resources,
+       .num_resources  = ARRAY_SIZE(lcdc_resources),
+};
+
+void __init at91_add_device_lcdc(struct at91fb_info *data)
+{
+       if (!data) {
+               return;
+       }
+
+       at91_set_A_periph(AT91_PIN_PB1, 0);     /* LCDHSYNC */
+       at91_set_A_periph(AT91_PIN_PB2, 0);     /* LCDDOTCK */
+       at91_set_A_periph(AT91_PIN_PB3, 0);     /* LCDDEN */
+       at91_set_A_periph(AT91_PIN_PB4, 0);     /* LCDCC */
+       at91_set_A_periph(AT91_PIN_PB7, 0);     /* LCDD2 */
+       at91_set_A_periph(AT91_PIN_PB8, 0);     /* LCDD3 */
+       at91_set_A_periph(AT91_PIN_PB9, 0);     /* LCDD4 */
+       at91_set_A_periph(AT91_PIN_PB10, 0);    /* LCDD5 */
+       at91_set_A_periph(AT91_PIN_PB11, 0);    /* LCDD6 */
+       at91_set_A_periph(AT91_PIN_PB12, 0);    /* LCDD7 */
+       at91_set_A_periph(AT91_PIN_PB15, 0);    /* LCDD10 */
+       at91_set_A_periph(AT91_PIN_PB16, 0);    /* LCDD11 */
+       at91_set_A_periph(AT91_PIN_PB17, 0);    /* LCDD12 */
+       at91_set_A_periph(AT91_PIN_PB18, 0);    /* LCDD13 */
+       at91_set_A_periph(AT91_PIN_PB19, 0);    /* LCDD14 */
+       at91_set_A_periph(AT91_PIN_PB20, 0);    /* LCDD15 */
+       at91_set_B_periph(AT91_PIN_PB23, 0);    /* LCDD18 */
+       at91_set_B_periph(AT91_PIN_PB24, 0);    /* LCDD19 */
+       at91_set_B_periph(AT91_PIN_PB25, 0);    /* LCDD20 */
+       at91_set_B_periph(AT91_PIN_PB26, 0);    /* LCDD21 */
+       at91_set_B_periph(AT91_PIN_PB27, 0);    /* LCDD22 */
+       at91_set_B_periph(AT91_PIN_PB28, 0);    /* LCDD23 */
+
+       lcdc_data = *data;
+       platform_device_register(&at91_lcdc_device);
+}
+#else
+void __init at91_add_device_lcdc(struct at91fb_info *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  LEDs
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_LEDS)
+u8 at91_leds_cpu;
+u8 at91_leds_timer;
+
+void __init at91_init_leds(u8 cpu_led, u8 timer_led)
+{
+       /* Enable GPIO to access the LEDs */
+       at91_set_gpio_output(cpu_led, 1);
+       at91_set_gpio_output(timer_led, 1);
+
+       at91_leds_cpu   = cpu_led;
+       at91_leds_timer = timer_led;
+}
+#else
+void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  UART
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_SERIAL_ATMEL)
+static struct resource dbgu_resources[] = {
+       [0] = {
+               .start  = AT91_VA_BASE_SYS + AT91_DBGU,
+               .end    = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_ID_SYS,
+               .end    = AT91_ID_SYS,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data dbgu_data = {
+       .use_dma_tx     = 0,
+       .use_dma_rx     = 0,            /* DBGU not capable of receive DMA */
+       .regs           = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
+};
+
+static struct platform_device at91sam9261_dbgu_device = {
+       .name           = "atmel_usart",
+       .id             = 0,
+       .dev            = {
+                               .platform_data  = &dbgu_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = dbgu_resources,
+       .num_resources  = ARRAY_SIZE(dbgu_resources),
+};
+
+static inline void configure_dbgu_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PA9, 0);             /* DRXD */
+       at91_set_A_periph(AT91_PIN_PA10, 1);            /* DTXD */
+}
+
+static struct resource uart0_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_BASE_US0,
+               .end    = AT91SAM9261_BASE_US0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_US0,
+               .end    = AT91SAM9261_ID_US0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart0_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9261_uart0_device = {
+       .name           = "atmel_usart",
+       .id             = 1,
+       .dev            = {
+                               .platform_data  = &uart0_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart0_resources,
+       .num_resources  = ARRAY_SIZE(uart0_resources),
+};
+
+static inline void configure_usart0_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PC8, 1);             /* TXD0 */
+       at91_set_A_periph(AT91_PIN_PC9, 0);             /* RXD0 */
+       at91_set_A_periph(AT91_PIN_PC10, 0);            /* RTS0 */
+       at91_set_A_periph(AT91_PIN_PC11, 0);            /* CTS0 */
+}
+
+static struct resource uart1_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_BASE_US1,
+               .end    = AT91SAM9261_BASE_US1 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_US1,
+               .end    = AT91SAM9261_ID_US1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart1_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9261_uart1_device = {
+       .name           = "atmel_usart",
+       .id             = 2,
+       .dev            = {
+                               .platform_data  = &uart1_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart1_resources,
+       .num_resources  = ARRAY_SIZE(uart1_resources),
+};
+
+static inline void configure_usart1_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PC12, 1);            /* TXD1 */
+       at91_set_A_periph(AT91_PIN_PC13, 0);            /* RXD1 */
+}
+
+static struct resource uart2_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_BASE_US2,
+               .end    = AT91SAM9261_BASE_US2 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_US2,
+               .end    = AT91SAM9261_ID_US2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart2_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9261_uart2_device = {
+       .name           = "atmel_usart",
+       .id             = 3,
+       .dev            = {
+                               .platform_data  = &uart2_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart2_resources,
+       .num_resources  = ARRAY_SIZE(uart2_resources),
+};
+
+static inline void configure_usart2_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PC15, 0);            /* RXD2 */
+       at91_set_A_periph(AT91_PIN_PC14, 1);            /* TXD2 */
+}
+
+struct platform_device *at91_uarts[ATMEL_MAX_UART];    /* the UARTs to use */
+struct platform_device *atmel_default_console_device;  /* the serial console device */
+
+void __init at91_init_serial(struct at91_uart_config *config)
+{
+       int i;
+
+       /* Fill in list of supported UARTs */
+       for (i = 0; i < config->nr_tty; i++) {
+               switch (config->tty_map[i]) {
+                       case 0:
+                               configure_usart0_pins();
+                               at91_uarts[i] = &at91sam9261_uart0_device;
+                               at91_clock_associate("usart0_clk", &at91sam9261_uart0_device.dev, "usart");
+                               break;
+                       case 1:
+                               configure_usart1_pins();
+                               at91_uarts[i] = &at91sam9261_uart1_device;
+                               at91_clock_associate("usart1_clk", &at91sam9261_uart1_device.dev, "usart");
+                               break;
+                       case 2:
+                               configure_usart2_pins();
+                               at91_uarts[i] = &at91sam9261_uart2_device;
+                               at91_clock_associate("usart2_clk", &at91sam9261_uart2_device.dev, "usart");
+                               break;
+                       case 3:
+                               configure_dbgu_pins();
+                               at91_uarts[i] = &at91sam9261_dbgu_device;
+                               at91_clock_associate("mck", &at91sam9261_dbgu_device.dev, "usart");
+                               break;
+                       default:
+                               continue;
+               }
+               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
+       }
+
+       /* Set serial console device */
+       if (config->console_tty < ATMEL_MAX_UART)
+               atmel_default_console_device = at91_uarts[config->console_tty];
+       if (!atmel_default_console_device)
+               printk(KERN_INFO "AT91: No default serial console defined.\n");
+}
+
+void __init at91_add_device_serial(void)
+{
+       int i;
+
+       for (i = 0; i < ATMEL_MAX_UART; i++) {
+               if (at91_uarts[i])
+                       platform_device_register(at91_uarts[i]);
+       }
+}
+#else
+void __init at91_init_serial(struct at91_uart_config *config) {}
+void __init at91_add_device_serial(void) {}
+#endif
+
+
+/* -------------------------------------------------------------------- */
+
+/*
+ * These devices are always present and don't need any board-specific
+ * setup.
+ */
+static int __init at91_add_standard_devices(void)
+{
+       return 0;
+}
+
+arch_initcall(at91_add_standard_devices);
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
new file mode 100644 (file)
index 0000000..6aa342e
--- /dev/null
@@ -0,0 +1,313 @@
+/*
+ * arch/arm/mach-at91/at91sam9263.c
+ *
+ *  Copyright (C) 2007 Atmel Corporation.
+ *
+ * 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/module.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/arch/at91sam9263.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
+
+#include "generic.h"
+#include "clock.h"
+
+static struct map_desc at91sam9263_io_desc[] __initdata = {
+       {
+               .virtual        = AT91_VA_BASE_SYS,
+               .pfn            = __phys_to_pfn(AT91_BASE_SYS),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_IO_VIRT_BASE - AT91SAM9263_SRAM0_SIZE,
+               .pfn            = __phys_to_pfn(AT91SAM9263_SRAM0_BASE),
+               .length         = AT91SAM9263_SRAM0_SIZE,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_IO_VIRT_BASE - AT91SAM9263_SRAM0_SIZE - AT91SAM9263_SRAM1_SIZE,
+               .pfn            = __phys_to_pfn(AT91SAM9263_SRAM1_BASE),
+               .length         = AT91SAM9263_SRAM1_SIZE,
+               .type           = MT_DEVICE,
+       },
+};
+
+/* --------------------------------------------------------------------
+ *  Clocks
+ * -------------------------------------------------------------------- */
+
+/*
+ * The peripheral clocks.
+ */
+static struct clk pioA_clk = {
+       .name           = "pioA_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_PIOA,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk pioB_clk = {
+       .name           = "pioB_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_PIOB,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk pioCDE_clk = {
+       .name           = "pioCDE_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_PIOCDE,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart0_clk = {
+       .name           = "usart0_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_US0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart1_clk = {
+       .name           = "usart1_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_US1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk usart2_clk = {
+       .name           = "usart2_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_US2,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk mmc0_clk = {
+       .name           = "mci0_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_MCI0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk mmc1_clk = {
+       .name           = "mci1_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_MCI1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk twi_clk = {
+       .name           = "twi_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_TWI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk spi0_clk = {
+       .name           = "spi0_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_SPI0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk spi1_clk = {
+       .name           = "spi1_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_SPI1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk tcb_clk = {
+       .name           = "tcb_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_TCB,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk macb_clk = {
+       .name           = "macb_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_EMAC,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk udc_clk = {
+       .name           = "udc_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_UDP,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk isi_clk = {
+       .name           = "isi_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_ISI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk lcdc_clk = {
+       .name           = "lcdc_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_ISI,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ohci_clk = {
+       .name           = "ohci_clk",
+       .pmc_mask       = 1 << AT91SAM9263_ID_UHP,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+
+static struct clk *periph_clocks[] __initdata = {
+       &pioA_clk,
+       &pioB_clk,
+       &pioCDE_clk,
+       &usart0_clk,
+       &usart1_clk,
+       &usart2_clk,
+       &mmc0_clk,
+       &mmc1_clk,
+       // can
+       &twi_clk,
+       &spi0_clk,
+       &spi1_clk,
+       // ssc0 .. ssc1
+       // ac97
+       &tcb_clk,
+       // pwmc
+       &macb_clk,
+       // 2dge
+       &udc_clk,
+       &isi_clk,
+       &lcdc_clk,
+       // dma
+       &ohci_clk,
+       // irq0 .. irq1
+};
+
+/*
+ * The four programmable clocks.
+ * You must configure pin multiplexing to bring these signals out.
+ */
+static struct clk pck0 = {
+       .name           = "pck0",
+       .pmc_mask       = AT91_PMC_PCK0,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 0,
+};
+static struct clk pck1 = {
+       .name           = "pck1",
+       .pmc_mask       = AT91_PMC_PCK1,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 1,
+};
+static struct clk pck2 = {
+       .name           = "pck2",
+       .pmc_mask       = AT91_PMC_PCK2,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 2,
+};
+static struct clk pck3 = {
+       .name           = "pck3",
+       .pmc_mask       = AT91_PMC_PCK3,
+       .type           = CLK_TYPE_PROGRAMMABLE,
+       .id             = 3,
+};
+
+static void __init at91sam9263_register_clocks(void)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
+               clk_register(periph_clocks[i]);
+
+       clk_register(&pck0);
+       clk_register(&pck1);
+       clk_register(&pck2);
+       clk_register(&pck3);
+}
+
+/* --------------------------------------------------------------------
+ *  GPIO
+ * -------------------------------------------------------------------- */
+
+static struct at91_gpio_bank at91sam9263_gpio[] = {
+       {
+               .id             = AT91SAM9263_ID_PIOA,
+               .offset         = AT91_PIOA,
+               .clock          = &pioA_clk,
+       }, {
+               .id             = AT91SAM9263_ID_PIOB,
+               .offset         = AT91_PIOB,
+               .clock          = &pioB_clk,
+       }, {
+               .id             = AT91SAM9263_ID_PIOCDE,
+               .offset         = AT91_PIOC,
+               .clock          = &pioCDE_clk,
+       }, {
+               .id             = AT91SAM9263_ID_PIOCDE,
+               .offset         = AT91_PIOD,
+               .clock          = &pioCDE_clk,
+       }, {
+               .id             = AT91SAM9263_ID_PIOCDE,
+               .offset         = AT91_PIOE,
+               .clock          = &pioCDE_clk,
+       }
+};
+
+static void at91sam9263_reset(void)
+{
+       at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
+}
+
+
+/* --------------------------------------------------------------------
+ *  AT91SAM9263 processor initialization
+ * -------------------------------------------------------------------- */
+
+void __init at91sam9263_initialize(unsigned long main_clock)
+{
+       /* Map peripherals */
+       iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc));
+
+       at91_arch_reset = at91sam9263_reset;
+       at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
+
+       /* Init clock subsystem */
+       at91_clock_init(main_clock);
+
+       /* Register the processor-specific clocks */
+       at91sam9263_register_clocks();
+
+       /* Register GPIO subsystem */
+       at91_gpio_init(at91sam9263_gpio, 5);
+}
+
+/* --------------------------------------------------------------------
+ *  Interrupt initialization
+ * -------------------------------------------------------------------- */
+
+/*
+ * The default interrupt priority levels (0 = lowest, 7 = highest).
+ */
+static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = {
+       7,      /* Advanced Interrupt Controller (FIQ) */
+       7,      /* System Peripherals */
+       0,      /* Parallel IO Controller A */
+       0,      /* Parallel IO Controller B */
+       0,      /* Parallel IO Controller C, D and E */
+       0,
+       0,
+       6,      /* USART 0 */
+       6,      /* USART 1 */
+       6,      /* USART 2 */
+       0,      /* Multimedia Card Interface 0 */
+       0,      /* Multimedia Card Interface 1 */
+       4,      /* CAN */
+       0,      /* Two-Wire Interface */
+       6,      /* Serial Peripheral Interface 0 */
+       6,      /* Serial Peripheral Interface 1 */
+       5,      /* Serial Synchronous Controller 0 */
+       5,      /* Serial Synchronous Controller 1 */
+       6,      /* AC97 Controller */
+       0,      /* Timer Counter 0, 1 and 2 */
+       0,      /* Pulse Width Modulation Controller */
+       3,      /* Ethernet */
+       0,
+       0,      /* 2D Graphic Engine */
+       3,      /* USB Device Port */
+       0,      /* Image Sensor Interface */
+       3,      /* LDC Controller */
+       0,      /* DMA Controller */
+       0,
+       3,      /* USB Host port */
+       0,      /* Advanced Interrupt Controller (IRQ0) */
+       0,      /* Advanced Interrupt Controller (IRQ1) */
+};
+
+void __init at91sam9263_init_interrupts(unsigned int priority[NR_AIC_IRQS])
+{
+       if (!priority)
+               priority = at91sam9263_default_irq_priority;
+
+       /* Initialize the AIC interrupt controller */
+       at91_aic_init(priority);
+
+       /* Enable GPIO interrupts */
+       at91_gpio_irq_setup();
+}
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
new file mode 100644 (file)
index 0000000..d9af7ca
--- /dev/null
@@ -0,0 +1,818 @@
+/*
+ * arch/arm/mach-at91/at91sam9263_devices.c
+ *
+ *  Copyright (C) 2007 Atmel Corporation.
+ *
+ * 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/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <linux/platform_device.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91sam9263.h>
+#include <asm/arch/at91sam926x_mc.h>
+#include <asm/arch/at91sam9263_matrix.h>
+
+#include "generic.h"
+
+#define SZ_512 0x00000200
+#define SZ_256 0x00000100
+#define SZ_16  0x00000010
+
+/* --------------------------------------------------------------------
+ *  USB Host
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+static u64 ohci_dmamask = 0xffffffffUL;
+static struct at91_usbh_data usbh_data;
+
+static struct resource usbh_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_UHP_BASE,
+               .end    = AT91SAM9263_UHP_BASE + SZ_1M - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_UHP,
+               .end    = AT91SAM9263_ID_UHP,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91_usbh_device = {
+       .name           = "at91_ohci",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &ohci_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &usbh_data,
+       },
+       .resource       = usbh_resources,
+       .num_resources  = ARRAY_SIZE(usbh_resources),
+};
+
+void __init at91_add_device_usbh(struct at91_usbh_data *data)
+{
+       int i;
+
+       if (!data)
+               return;
+
+       /* Enable VBus control for UHP ports */
+       for (i = 0; i < data->ports; i++) {
+               if (data->vbus_pin[i])
+                       at91_set_gpio_output(data->vbus_pin[i], 0);
+       }
+
+       usbh_data = *data;
+       platform_device_register(&at91_usbh_device);
+}
+#else
+void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  USB Device (Gadget)
+ * -------------------------------------------------------------------- */
+
+#ifdef CONFIG_USB_GADGET_AT91
+static struct at91_udc_data udc_data;
+
+static struct resource udc_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_UDP,
+               .end    = AT91SAM9263_BASE_UDP + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_UDP,
+               .end    = AT91SAM9263_ID_UDP,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91_udc_device = {
+       .name           = "at91_udc",
+       .id             = -1,
+       .dev            = {
+                               .platform_data          = &udc_data,
+       },
+       .resource       = udc_resources,
+       .num_resources  = ARRAY_SIZE(udc_resources),
+};
+
+void __init at91_add_device_udc(struct at91_udc_data *data)
+{
+       if (!data)
+               return;
+
+       if (data->vbus_pin) {
+               at91_set_gpio_input(data->vbus_pin, 0);
+               at91_set_deglitch(data->vbus_pin, 1);
+       }
+
+       /* Pullup pin is handled internally by USB device peripheral */
+
+       udc_data = *data;
+       platform_device_register(&at91_udc_device);
+}
+#else
+void __init at91_add_device_udc(struct at91_udc_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  Ethernet
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
+static u64 eth_dmamask = 0xffffffffUL;
+static struct at91_eth_data eth_data;
+
+static struct resource eth_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_EMAC,
+               .end    = AT91SAM9263_BASE_EMAC + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_EMAC,
+               .end    = AT91SAM9263_ID_EMAC,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9263_eth_device = {
+       .name           = "macb",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &eth_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &eth_data,
+       },
+       .resource       = eth_resources,
+       .num_resources  = ARRAY_SIZE(eth_resources),
+};
+
+void __init at91_add_device_eth(struct at91_eth_data *data)
+{
+       if (!data)
+               return;
+
+       if (data->phy_irq_pin) {
+               at91_set_gpio_input(data->phy_irq_pin, 0);
+               at91_set_deglitch(data->phy_irq_pin, 1);
+       }
+
+       /* Pins used for MII and RMII */
+       at91_set_A_periph(AT91_PIN_PE21, 0);    /* ETXCK_EREFCK */
+       at91_set_B_periph(AT91_PIN_PC25, 0);    /* ERXDV */
+       at91_set_A_periph(AT91_PIN_PE25, 0);    /* ERX0 */
+       at91_set_A_periph(AT91_PIN_PE26, 0);    /* ERX1 */
+       at91_set_A_periph(AT91_PIN_PE27, 0);    /* ERXER */
+       at91_set_A_periph(AT91_PIN_PE28, 0);    /* ETXEN */
+       at91_set_A_periph(AT91_PIN_PE23, 0);    /* ETX0 */
+       at91_set_A_periph(AT91_PIN_PE24, 0);    /* ETX1 */
+       at91_set_A_periph(AT91_PIN_PE30, 0);    /* EMDIO */
+       at91_set_A_periph(AT91_PIN_PE29, 0);    /* EMDC */
+
+       if (!data->is_rmii) {
+               at91_set_A_periph(AT91_PIN_PE22, 0);    /* ECRS */
+               at91_set_B_periph(AT91_PIN_PC26, 0);    /* ECOL */
+               at91_set_B_periph(AT91_PIN_PC22, 0);    /* ERX2 */
+               at91_set_B_periph(AT91_PIN_PC23, 0);    /* ERX3 */
+               at91_set_B_periph(AT91_PIN_PC27, 0);    /* ERXCK */
+               at91_set_B_periph(AT91_PIN_PC20, 0);    /* ETX2 */
+               at91_set_B_periph(AT91_PIN_PC21, 0);    /* ETX3 */
+               at91_set_B_periph(AT91_PIN_PC24, 0);    /* ETXER */
+       }
+
+       eth_data = *data;
+       platform_device_register(&at91sam9263_eth_device);
+}
+#else
+void __init at91_add_device_eth(struct at91_eth_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  MMC / SD
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
+static u64 mmc_dmamask = 0xffffffffUL;
+static struct at91_mmc_data mmc0_data, mmc1_data;
+
+static struct resource mmc0_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_MCI0,
+               .end    = AT91SAM9263_BASE_MCI0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_MCI0,
+               .end    = AT91SAM9263_ID_MCI0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9263_mmc0_device = {
+       .name           = "at91_mci",
+       .id             = 0,
+       .dev            = {
+                               .dma_mask               = &mmc_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &mmc0_data,
+       },
+       .resource       = mmc0_resources,
+       .num_resources  = ARRAY_SIZE(mmc0_resources),
+};
+
+static struct resource mmc1_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_MCI1,
+               .end    = AT91SAM9263_BASE_MCI1 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_MCI1,
+               .end    = AT91SAM9263_ID_MCI1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9263_mmc1_device = {
+       .name           = "at91_mci",
+       .id             = 1,
+       .dev            = {
+                               .dma_mask               = &mmc_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+                               .platform_data          = &mmc1_data,
+       },
+       .resource       = mmc1_resources,
+       .num_resources  = ARRAY_SIZE(mmc1_resources),
+};
+
+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
+{
+       if (!data)
+               return;
+
+       /* input/irq */
+       if (data->det_pin) {
+               at91_set_gpio_input(data->det_pin, 1);
+               at91_set_deglitch(data->det_pin, 1);
+       }
+       if (data->wp_pin)
+               at91_set_gpio_input(data->wp_pin, 1);
+       if (data->vcc_pin)
+               at91_set_gpio_output(data->vcc_pin, 0);
+
+       if (mmc_id == 0) {              /* MCI0 */
+               /* CLK */
+               at91_set_A_periph(AT91_PIN_PA12, 0);
+
+               if (data->slot_b) {
+                       /* CMD */
+                       at91_set_A_periph(AT91_PIN_PA16, 1);
+
+                       /* DAT0, maybe DAT1..DAT3 */
+                       at91_set_A_periph(AT91_PIN_PA17, 1);
+                       if (data->wire4) {
+                               at91_set_A_periph(AT91_PIN_PA18, 1);
+                               at91_set_A_periph(AT91_PIN_PA19, 1);
+                               at91_set_A_periph(AT91_PIN_PA20, 1);
+                       }
+               } else {
+                       /* CMD */
+                       at91_set_A_periph(AT91_PIN_PA1, 1);
+
+                       /* DAT0, maybe DAT1..DAT3 */
+                       at91_set_A_periph(AT91_PIN_PA0, 1);
+                       if (data->wire4) {
+                               at91_set_A_periph(AT91_PIN_PA3, 1);
+                               at91_set_A_periph(AT91_PIN_PA4, 1);
+                               at91_set_A_periph(AT91_PIN_PA5, 1);
+                       }
+               }
+
+               mmc0_data = *data;
+               at91_clock_associate("mci0_clk", &at91sam9263_mmc1_device.dev, "mci_clk");
+               platform_device_register(&at91sam9263_mmc0_device);
+       } else {                        /* MCI1 */
+               /* CLK */
+               at91_set_A_periph(AT91_PIN_PA6, 0);
+
+               if (data->slot_b) {
+                       /* CMD */
+                       at91_set_A_periph(AT91_PIN_PA21, 1);
+
+                       /* DAT0, maybe DAT1..DAT3 */
+                       at91_set_A_periph(AT91_PIN_PA22, 1);
+                       if (data->wire4) {
+                               at91_set_A_periph(AT91_PIN_PA23, 1);
+                               at91_set_A_periph(AT91_PIN_PA24, 1);
+                               at91_set_A_periph(AT91_PIN_PA25, 1);
+                       }
+               } else {
+                       /* CMD */
+                       at91_set_A_periph(AT91_PIN_PA7, 1);
+
+                       /* DAT0, maybe DAT1..DAT3 */
+                       at91_set_A_periph(AT91_PIN_PA8, 1);
+                       if (data->wire4) {
+                               at91_set_A_periph(AT91_PIN_PA9, 1);
+                               at91_set_A_periph(AT91_PIN_PA10, 1);
+                               at91_set_A_periph(AT91_PIN_PA11, 1);
+                       }
+               }
+
+               mmc1_data = *data;
+               at91_clock_associate("mci1_clk", &at91sam9263_mmc1_device.dev, "mci_clk");
+               platform_device_register(&at91sam9263_mmc1_device);
+       }
+}
+#else
+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  NAND / SmartMedia
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+static struct at91_nand_data nand_data;
+
+#define NAND_BASE      AT91_CHIPSELECT_3
+
+static struct resource nand_resources[] = {
+       {
+               .start  = NAND_BASE,
+               .end    = NAND_BASE + SZ_256M - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device at91sam9263_nand_device = {
+       .name           = "at91_nand",
+       .id             = -1,
+       .dev            = {
+                               .platform_data  = &nand_data,
+       },
+       .resource       = nand_resources,
+       .num_resources  = ARRAY_SIZE(nand_resources),
+};
+
+void __init at91_add_device_nand(struct at91_nand_data *data)
+{
+       unsigned long csa, mode;
+
+       if (!data)
+               return;
+
+       csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
+       at91_sys_write(AT91_MATRIX_EBI0CSA, csa | AT91_MATRIX_EBI0_CS3A_SMC);
+
+       /* set the bus interface characteristics */
+       at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0)
+                       | AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0));
+
+       at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3)
+                       | AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
+
+       at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
+
+       if (data->bus_width_16)
+               mode = AT91_SMC_DBW_16;
+       else
+               mode = AT91_SMC_DBW_8;
+       at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(2));
+
+       /* enable pin */
+       if (data->enable_pin)
+               at91_set_gpio_output(data->enable_pin, 1);
+
+       /* ready/busy pin */
+       if (data->rdy_pin)
+               at91_set_gpio_input(data->rdy_pin, 1);
+
+       /* card detect pin */
+       if (data->det_pin)
+               at91_set_gpio_input(data->det_pin, 1);
+
+       nand_data = *data;
+       platform_device_register(&at91sam9263_nand_device);
+}
+#else
+void __init at91_add_device_nand(struct at91_nand_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  TWI (i2c)
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
+
+static struct resource twi_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_TWI,
+               .end    = AT91SAM9263_BASE_TWI + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_TWI,
+               .end    = AT91SAM9263_ID_TWI,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9263_twi_device = {
+       .name           = "at91_i2c",
+       .id             = -1,
+       .resource       = twi_resources,
+       .num_resources  = ARRAY_SIZE(twi_resources),
+};
+
+void __init at91_add_device_i2c(void)
+{
+       /* pins used for TWI interface */
+       at91_set_A_periph(AT91_PIN_PB4, 0);             /* TWD */
+       at91_set_multi_drive(AT91_PIN_PB4, 1);
+
+       at91_set_A_periph(AT91_PIN_PB5, 0);             /* TWCK */
+       at91_set_multi_drive(AT91_PIN_PB5, 1);
+
+       platform_device_register(&at91sam9263_twi_device);
+}
+#else
+void __init at91_add_device_i2c(void) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  SPI
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
+static u64 spi_dmamask = 0xffffffffUL;
+
+static struct resource spi0_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_SPI0,
+               .end    = AT91SAM9263_BASE_SPI0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_SPI0,
+               .end    = AT91SAM9263_ID_SPI0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9263_spi0_device = {
+       .name           = "atmel_spi",
+       .id             = 0,
+       .dev            = {
+                               .dma_mask               = &spi_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+       },
+       .resource       = spi0_resources,
+       .num_resources  = ARRAY_SIZE(spi0_resources),
+};
+
+static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA5, AT91_PIN_PA3, AT91_PIN_PA4, AT91_PIN_PB11 };
+
+static struct resource spi1_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_SPI1,
+               .end    = AT91SAM9263_BASE_SPI1 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_SPI1,
+               .end    = AT91SAM9263_ID_SPI1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9263_spi1_device = {
+       .name           = "atmel_spi",
+       .id             = 1,
+       .dev            = {
+                               .dma_mask               = &spi_dmamask,
+                               .coherent_dma_mask      = 0xffffffff,
+       },
+       .resource       = spi1_resources,
+       .num_resources  = ARRAY_SIZE(spi1_resources),
+};
+
+static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB15, AT91_PIN_PB16, AT91_PIN_PB17, AT91_PIN_PB18 };
+
+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
+{
+       int i;
+       unsigned long cs_pin;
+       short enable_spi0 = 0;
+       short enable_spi1 = 0;
+
+       /* Choose SPI chip-selects */
+       for (i = 0; i < nr_devices; i++) {
+               if (devices[i].controller_data)
+                       cs_pin = (unsigned long) devices[i].controller_data;
+               else if (devices[i].bus_num == 0)
+                       cs_pin = spi0_standard_cs[devices[i].chip_select];
+               else
+                       cs_pin = spi1_standard_cs[devices[i].chip_select];
+
+               if (devices[i].bus_num == 0)
+                       enable_spi0 = 1;
+               else
+                       enable_spi1 = 1;
+
+               /* enable chip-select pin */
+               at91_set_gpio_output(cs_pin, 1);
+
+               /* pass chip-select pin to driver */
+               devices[i].controller_data = (void *) cs_pin;
+       }
+
+       spi_register_board_info(devices, nr_devices);
+
+       /* Configure SPI bus(es) */
+       if (enable_spi0) {
+               at91_set_B_periph(AT91_PIN_PA0, 0);     /* SPI0_MISO */
+               at91_set_B_periph(AT91_PIN_PA1, 0);     /* SPI0_MOSI */
+               at91_set_B_periph(AT91_PIN_PA2, 0);     /* SPI1_SPCK */
+
+               at91_clock_associate("spi0_clk", &at91sam9263_spi0_device.dev, "spi_clk");
+               platform_device_register(&at91sam9263_spi0_device);
+       }
+       if (enable_spi1) {
+               at91_set_A_periph(AT91_PIN_PB12, 0);    /* SPI1_MISO */
+               at91_set_A_periph(AT91_PIN_PB13, 0);    /* SPI1_MOSI */
+               at91_set_A_periph(AT91_PIN_PB14, 0);    /* SPI1_SPCK */
+
+               at91_clock_associate("spi1_clk", &at91sam9263_spi1_device.dev, "spi_clk");
+               platform_device_register(&at91sam9263_spi1_device);
+       }
+}
+#else
+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  LEDs
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_LEDS)
+u8 at91_leds_cpu;
+u8 at91_leds_timer;
+
+void __init at91_init_leds(u8 cpu_led, u8 timer_led)
+{
+       /* Enable GPIO to access the LEDs */
+       at91_set_gpio_output(cpu_led, 1);
+       at91_set_gpio_output(timer_led, 1);
+
+       at91_leds_cpu   = cpu_led;
+       at91_leds_timer = timer_led;
+}
+#else
+void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  UART
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_SERIAL_ATMEL)
+
+static struct resource dbgu_resources[] = {
+       [0] = {
+               .start  = AT91_VA_BASE_SYS + AT91_DBGU,
+               .end    = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_ID_SYS,
+               .end    = AT91_ID_SYS,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data dbgu_data = {
+       .use_dma_tx     = 0,
+       .use_dma_rx     = 0,            /* DBGU not capable of receive DMA */
+       .regs           = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
+};
+
+static struct platform_device at91sam9263_dbgu_device = {
+       .name           = "atmel_usart",
+       .id             = 0,
+       .dev            = {
+                               .platform_data  = &dbgu_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = dbgu_resources,
+       .num_resources  = ARRAY_SIZE(dbgu_resources),
+};
+
+static inline void configure_dbgu_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PC30, 0);            /* DRXD */
+       at91_set_A_periph(AT91_PIN_PC31, 1);            /* DTXD */
+}
+
+static struct resource uart0_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_US0,
+               .end    = AT91SAM9263_BASE_US0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_US0,
+               .end    = AT91SAM9263_ID_US0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart0_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9263_uart0_device = {
+       .name           = "atmel_usart",
+       .id             = 1,
+       .dev            = {
+                               .platform_data  = &uart0_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart0_resources,
+       .num_resources  = ARRAY_SIZE(uart0_resources),
+};
+
+static inline void configure_usart0_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PA26, 1);            /* TXD0 */
+       at91_set_A_periph(AT91_PIN_PA27, 0);            /* RXD0 */
+       at91_set_A_periph(AT91_PIN_PA28, 0);            /* RTS0 */
+       at91_set_A_periph(AT91_PIN_PA29, 0);            /* CTS0 */
+}
+
+static struct resource uart1_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_US1,
+               .end    = AT91SAM9263_BASE_US1 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_US1,
+               .end    = AT91SAM9263_ID_US1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart1_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9263_uart1_device = {
+       .name           = "atmel_usart",
+       .id             = 2,
+       .dev            = {
+                               .platform_data  = &uart1_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart1_resources,
+       .num_resources  = ARRAY_SIZE(uart1_resources),
+};
+
+static inline void configure_usart1_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PD0, 1);             /* TXD1 */
+       at91_set_A_periph(AT91_PIN_PD1, 0);             /* RXD1 */
+       at91_set_B_periph(AT91_PIN_PD7, 0);             /* RTS1 */
+       at91_set_B_periph(AT91_PIN_PD8, 0);             /* CTS1 */
+}
+
+static struct resource uart2_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_US2,
+               .end    = AT91SAM9263_BASE_US2 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_US2,
+               .end    = AT91SAM9263_ID_US2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct atmel_uart_data uart2_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+
+static struct platform_device at91sam9263_uart2_device = {
+       .name           = "atmel_usart",
+       .id             = 3,
+       .dev            = {
+                               .platform_data  = &uart2_data,
+                               .coherent_dma_mask = 0xffffffff,
+       },
+       .resource       = uart2_resources,
+       .num_resources  = ARRAY_SIZE(uart2_resources),
+};
+
+static inline void configure_usart2_pins(void)
+{
+       at91_set_A_periph(AT91_PIN_PD2, 1);             /* TXD2 */
+       at91_set_A_periph(AT91_PIN_PD3, 0);             /* RXD2 */
+       at91_set_B_periph(AT91_PIN_PD5, 0);             /* RTS2 */
+       at91_set_B_periph(AT91_PIN_PD6, 0);             /* CTS2 */
+}
+
+struct platform_device *at91_uarts[ATMEL_MAX_UART];    /* the UARTs to use */
+struct platform_device *atmel_default_console_device;  /* the serial console device */
+
+void __init at91_init_serial(struct at91_uart_config *config)
+{
+       int i;
+
+       /* Fill in list of supported UARTs */
+       for (i = 0; i < config->nr_tty; i++) {
+               switch (config->tty_map[i]) {
+                       case 0:
+                               configure_usart0_pins();
+                               at91_uarts[i] = &at91sam9263_uart0_device;
+                               at91_clock_associate("usart0_clk", &at91sam9263_uart0_device.dev, "usart");
+                               break;
+                       case 1:
+                               configure_usart1_pins();
+                               at91_uarts[i] = &at91sam9263_uart1_device;
+                               at91_clock_associate("usart1_clk", &at91sam9263_uart1_device.dev, "usart");
+                               break;
+                       case 2:
+                               configure_usart2_pins();
+                               at91_uarts[i] = &at91sam9263_uart2_device;
+                               at91_clock_associate("usart2_clk", &at91sam9263_uart2_device.dev, "usart");
+                               break;
+                       case 3:
+                               configure_dbgu_pins();
+                               at91_uarts[i] = &at91sam9263_dbgu_device;
+                               at91_clock_associate("mck", &at91sam9263_dbgu_device.dev, "usart");
+                               break;
+                       default:
+                               continue;
+               }
+               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
+       }
+
+       /* Set serial console device */
+       if (config->console_tty < ATMEL_MAX_UART)
+               atmel_default_console_device = at91_uarts[config->console_tty];
+       if (!atmel_default_console_device)
+               printk(KERN_INFO "AT91: No default serial console defined.\n");
+}
+
+void __init at91_add_device_serial(void)
+{
+       int i;
+
+       for (i = 0; i < ATMEL_MAX_UART; i++) {
+               if (at91_uarts[i])
+                       platform_device_register(at91_uarts[i]);
+       }
+}
+#else
+void __init at91_init_serial(struct at91_uart_config *config) {}
+void __init at91_add_device_serial(void) {}
+#endif
+
+
+/* -------------------------------------------------------------------- */
+/*
+ * These devices are always present and don't need any board-specific
+ * setup.
+ */
+static int __init at91_add_standard_devices(void)
+{
+       return 0;
+}
+
+arch_initcall(at91_add_standard_devices);
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
new file mode 100644 (file)
index 0000000..a4dded2
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * linux/arch/arm/mach-at91/at91sam926x_time.c
+ *
+ * Copyright (C) 2005-2006 M. Amine SAYA, ATMEL Rousset, France
+ * Revision     2005 M. Nicolas Diremdjian, ATMEL Rousset, France
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/time.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/mach/time.h>
+
+#include <asm/arch/at91_pit.h>
+
+
+#define PIT_CPIV(x)    ((x) & AT91_PIT_CPIV)
+#define PIT_PICNT(x)   (((x) & AT91_PIT_PICNT) >> 20)
+
+/*
+ * Returns number of microseconds since last timer interrupt.  Note that interrupts
+ * will have been disabled by do_gettimeofday()
+ *  'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
+ */
+static unsigned long at91sam926x_gettimeoffset(void)
+{
+       unsigned long elapsed;
+       unsigned long t = at91_sys_read(AT91_PIT_PIIR);
+
+       elapsed = (PIT_PICNT(t) * LATCH) + PIT_CPIV(t);         /* hardware clock cycles */
+
+       return (unsigned long)(elapsed * jiffies_to_usecs(1)) / LATCH;
+}
+
+/*
+ * IRQ handler for the timer.
+ */
+static irqreturn_t at91sam926x_timer_interrupt(int irq, void *dev_id)
+{
+       volatile long nr_ticks;
+
+       if (at91_sys_read(AT91_PIT_SR) & AT91_PIT_PITS) {       /* This is a shared interrupt */
+               write_seqlock(&xtime_lock);
+
+               /* Get number to ticks performed before interrupt and clear PIT interrupt */
+               nr_ticks = PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
+               do {
+                       timer_tick();
+                       nr_ticks--;
+               } while (nr_ticks);
+
+               write_sequnlock(&xtime_lock);
+               return IRQ_HANDLED;
+       } else
+               return IRQ_NONE;                /* not handled */
+}
+
+static struct irqaction at91sam926x_timer_irq = {
+       .name           = "at91_tick",
+       .flags          = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER,
+       .handler        = at91sam926x_timer_interrupt
+};
+
+void at91sam926x_timer_reset(void)
+{
+       /* Disable timer */
+       at91_sys_write(AT91_PIT_MR, 0);
+
+       /* Clear any pending interrupts */
+       (void) at91_sys_read(AT91_PIT_PIVR);
+
+       /* Set Period Interval timer and enable its interrupt */
+       at91_sys_write(AT91_PIT_MR, (LATCH & AT91_PIT_PIV) | AT91_PIT_PITIEN | AT91_PIT_PITEN);
+}
+
+/*
+ * Set up timer interrupt.
+ */
+void __init at91sam926x_timer_init(void)
+{
+       /* Initialize and enable the timer */
+       at91sam926x_timer_reset();
+
+       /* Make IRQs happen for the system timer. */
+       setup_irq(AT91_ID_SYS, &at91sam926x_timer_irq);
+}
+
+#ifdef CONFIG_PM
+static void at91sam926x_timer_suspend(void)
+{
+       /* Disable timer */
+       at91_sys_write(AT91_PIT_MR, 0);
+}
+#else
+#define at91sam926x_timer_suspend      NULL
+#endif
+
+struct sys_timer at91sam926x_timer = {
+       .init           = at91sam926x_timer_init,
+       .offset         = at91sam926x_gettimeoffset,
+       .suspend        = at91sam926x_timer_suspend,
+       .resume         = at91sam926x_timer_reset,
+};
+
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c
new file mode 100644 (file)
index 0000000..2d3d4b6
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * linux/arch/arm/mach-at91/board-1arm.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 3 = USART0 .. USART3
+ *    4      = DBGU
+ */
+static struct at91_uart_config __initdata onearm_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 3,
+       .tty_map        = { 4, 0, 1, -1, -1 },          /* ttyS0, ..., ttyS4 */
+};
+
+static void __init onearm_map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       at91rm9200_initialize(18432000, AT91RM9200_PQFP);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&onearm_uart_config);
+}
+
+static void __init onearm_init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata onearm_eth_data = {
+       .phy_irq_pin    = AT91_PIN_PC4,
+       .is_rmii        = 1,
+};
+
+static struct at91_usbh_data __initdata onearm_usbh_data = {
+       .ports          = 1,
+};
+
+static struct at91_udc_data __initdata onearm_udc_data = {
+       .vbus_pin       = AT91_PIN_PC2,
+       .pullup_pin     = AT91_PIN_PC3,
+};
+
+static void __init onearm_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* Ethernet */
+       at91_add_device_eth(&onearm_eth_data);
+       /* USB Host */
+       at91_add_device_usbh(&onearm_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&onearm_udc_data);
+}
+
+MACHINE_START(ONEARM, "Ajeco 1ARM single board computer")
+       /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91rm9200_timer,
+       .map_io         = onearm_map_io,
+       .init_irq       = onearm_init_irq,
+       .init_machine   = onearm_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
new file mode 100644 (file)
index 0000000..b451861
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * linux/arch/arm/mach-at91/board-carmeva.c
+ *
+ *  Copyright (c) 2005 Peer Georgi
+ *                    Conitec Datasystems
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 3 = USART0 .. USART3
+ *    4      = DBGU
+ */
+static struct at91_uart_config __initdata carmeva_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 2,
+       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
+};
+
+static void __init carmeva_map_io(void)
+{
+       /* Initialize processor: 20.000 MHz crystal */
+       at91rm9200_initialize(20000000, AT91RM9200_BGA);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&carmeva_uart_config);
+}
+
+static void __init carmeva_init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata carmeva_eth_data = {
+       .phy_irq_pin    = AT91_PIN_PC4,
+       .is_rmii        = 1,
+};
+
+static struct at91_usbh_data __initdata carmeva_usbh_data = {
+       .ports          = 2,
+};
+
+static struct at91_udc_data __initdata carmeva_udc_data = {
+       .vbus_pin       = AT91_PIN_PD12,
+       .pullup_pin     = AT91_PIN_PD9,
+};
+
+/* FIXME: user dependend */
+// static struct at91_cf_data __initdata carmeva_cf_data = {
+//     .det_pin        = AT91_PIN_PB0,
+//     .rst_pin        = AT91_PIN_PC5,
+       // .irq_pin     = ... not connected
+       // .vcc_pin     = ... always powered
+// };
+
+static struct at91_mmc_data __initdata carmeva_mmc_data = {
+       .slot_b         = 0,
+       .wire4          = 1,
+       .det_pin        = AT91_PIN_PB10,
+       .wp_pin         = AT91_PIN_PC14,
+};
+
+static struct spi_board_info carmeva_spi_devices[] = {
+       { /* DataFlash chip */
+               .modalias = "mtd_dataflash",
+               .chip_select  = 0,
+               .max_speed_hz = 10 * 1000 * 1000,
+       },
+       { /* User accessable spi - cs1 (250KHz) */
+               .modalias = "spi-cs1",
+               .chip_select  = 1,
+               .max_speed_hz = 250 *  1000,
+       },
+       { /* User accessable spi - cs2 (1MHz) */
+               .modalias = "spi-cs2",
+               .chip_select  = 2,
+               .max_speed_hz = 1 * 1000 *  1000,
+       },
+       { /* User accessable spi - cs3 (10MHz) */
+               .modalias = "spi-cs3",
+               .chip_select  = 3,
+               .max_speed_hz = 10 * 1000 *  1000,
+       },
+};
+
+static void __init carmeva_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* Ethernet */
+       at91_add_device_eth(&carmeva_eth_data);
+       /* USB Host */
+       at91_add_device_usbh(&carmeva_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&carmeva_udc_data);
+       /* I2C */
+       at91_add_device_i2c();
+       /* SPI */
+       at91_add_device_spi(carmeva_spi_devices, ARRAY_SIZE(carmeva_spi_devices));
+       /* Compact Flash */
+//     at91_add_device_cf(&carmeva_cf_data);
+       /* MMC */
+       at91_add_device_mmc(0, &carmeva_mmc_data);
+}
+
+MACHINE_START(CARMEVA, "Carmeva")
+       /* Maintainer: Conitec Datasystems */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91rm9200_timer,
+       .map_io         = carmeva_map_io,
+       .init_irq       = carmeva_init_irq,
+       .init_machine   = carmeva_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
new file mode 100644 (file)
index 0000000..e18a41e
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * linux/arch/arm/mach-at91/board-csb337.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/mtd/physmap.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 3 = USART0 .. USART3
+ *    4      = DBGU
+ */
+static struct at91_uart_config __initdata csb337_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 2,
+       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
+};
+
+static void __init csb337_map_io(void)
+{
+       /* Initialize processor: 3.6864 MHz crystal */
+       at91rm9200_initialize(3686400, AT91RM9200_BGA);
+
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&csb337_uart_config);
+}
+
+static void __init csb337_init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata csb337_eth_data = {
+       .phy_irq_pin    = AT91_PIN_PC2,
+       .is_rmii        = 0,
+};
+
+static struct at91_usbh_data __initdata csb337_usbh_data = {
+       .ports          = 2,
+};
+
+static struct at91_udc_data __initdata csb337_udc_data = {
+       // this has no VBUS sensing pin
+       .pullup_pin     = AT91_PIN_PA24,
+};
+
+static struct at91_cf_data __initdata csb337_cf_data = {
+       /*
+        * connector P4 on the CSB 337 mates to
+        * connector P8 on the CSB 300CF
+        */
+
+       /* CSB337 specific */
+       .det_pin        = AT91_PIN_PC3,
+
+       /* CSB300CF specific */
+       .irq_pin        = AT91_PIN_PA19,
+       .vcc_pin        = AT91_PIN_PD0,
+       .rst_pin        = AT91_PIN_PD2,
+};
+
+static struct at91_mmc_data __initdata csb337_mmc_data = {
+       .det_pin        = AT91_PIN_PD5,
+       .slot_b         = 0,
+       .wire4          = 1,
+       .wp_pin         = AT91_PIN_PD6,
+};
+
+static struct spi_board_info csb337_spi_devices[] = {
+       {       /* CAN controller */
+               .modalias       = "sak82c900",
+               .chip_select    = 0,
+               .max_speed_hz   = 6 * 1000 * 1000,
+       },
+};
+
+#define CSB_FLASH_BASE AT91_CHIPSELECT_0
+#define CSB_FLASH_SIZE 0x800000
+
+static struct mtd_partition csb_flash_partitions[] = {
+       {
+               .name           = "uMON flash",
+               .offset         = 0,
+               .size           = MTDPART_SIZ_FULL,
+               .mask_flags     = MTD_WRITEABLE,        /* read only */
+       }
+};
+
+static struct physmap_flash_data csb_flash_data = {
+       .width          = 2,
+       .parts          = csb_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(csb_flash_partitions),
+};
+
+static struct resource csb_flash_resources[] = {
+       {
+               .start  = CSB_FLASH_BASE,
+               .end    = CSB_FLASH_BASE + CSB_FLASH_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device csb_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+                               .platform_data = &csb_flash_data,
+                       },
+       .resource       = csb_flash_resources,
+       .num_resources  = ARRAY_SIZE(csb_flash_resources),
+};
+
+static void __init csb337_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* Ethernet */
+       at91_add_device_eth(&csb337_eth_data);
+       /* USB Host */
+       at91_add_device_usbh(&csb337_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&csb337_udc_data);
+       /* I2C */
+       at91_add_device_i2c();
+       /* Compact Flash */
+       at91_set_gpio_input(AT91_PIN_PB22, 1);          /* IOIS16 */
+       at91_add_device_cf(&csb337_cf_data);
+       /* SPI */
+       at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
+       /* MMC */
+       at91_add_device_mmc(0, &csb337_mmc_data);
+       /* NOR flash */
+       platform_device_register(&csb_flash);
+}
+
+MACHINE_START(CSB337, "Cogent CSB337")
+       /* Maintainer: Bill Gatliff */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91rm9200_timer,
+       .map_io         = csb337_map_io,
+       .init_irq       = csb337_init_irq,
+       .init_machine   = csb337_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c
new file mode 100644 (file)
index 0000000..77f04b9
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * linux/arch/arm/mach-at91/board-csb637.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/physmap.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 3 = USART0 .. USART3
+ *    4      = DBGU
+ */
+static struct at91_uart_config __initdata csb637_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 2,
+       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
+};
+
+static void __init csb637_map_io(void)
+{
+       /* Initialize processor: 3.6864 MHz crystal */
+       at91rm9200_initialize(3686400, AT91RM9200_BGA);
+
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&csb637_uart_config);
+}
+
+static void __init csb637_init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata csb637_eth_data = {
+       .phy_irq_pin    = AT91_PIN_PC0,
+       .is_rmii        = 0,
+};
+
+static struct at91_usbh_data __initdata csb637_usbh_data = {
+       .ports          = 2,
+};
+
+static struct at91_udc_data __initdata csb637_udc_data = {
+       .vbus_pin     = AT91_PIN_PB28,
+       .pullup_pin   = AT91_PIN_PB1,
+};
+
+#define CSB_FLASH_BASE AT91_CHIPSELECT_0
+#define CSB_FLASH_SIZE 0x1000000
+
+static struct mtd_partition csb_flash_partitions[] = {
+       {
+               .name           = "uMON flash",
+               .offset         = 0,
+               .size           = MTDPART_SIZ_FULL,
+               .mask_flags     = MTD_WRITEABLE,        /* read only */
+       }
+};
+
+static struct physmap_flash_data csb_flash_data = {
+       .width          = 2,
+       .parts          = csb_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(csb_flash_partitions),
+};
+
+static struct resource csb_flash_resources[] = {
+       {
+               .start  = CSB_FLASH_BASE,
+               .end    = CSB_FLASH_BASE + CSB_FLASH_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device csb_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+                               .platform_data = &csb_flash_data,
+                       },
+       .resource       = csb_flash_resources,
+       .num_resources  = ARRAY_SIZE(csb_flash_resources),
+};
+
+static void __init csb637_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* Ethernet */
+       at91_add_device_eth(&csb637_eth_data);
+       /* USB Host */
+       at91_add_device_usbh(&csb637_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&csb637_udc_data);
+       /* I2C */
+       at91_add_device_i2c();
+       /* SPI */
+       at91_add_device_spi(NULL, 0);
+       /* NOR flash */
+       platform_device_register(&csb_flash);
+}
+
+MACHINE_START(CSB637, "Cogent CSB637")
+       /* Maintainer: Bill Gatliff */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91rm9200_timer,
+       .map_io         = csb637_map_io,
+       .init_irq       = csb637_init_irq,
+       .init_machine   = csb637_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-dk.c b/arch/arm/mach-at91/board-dk.c
new file mode 100644 (file)
index 0000000..6043c38
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+ * linux/arch/arm/mach-at91/board-dk.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *
+ *  Epson S1D framebuffer glue code is:
+ *     Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/mtd/physmap.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91rm9200_mc.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 3 = USART0 .. USART3
+ *    4      = DBGU
+ */
+static struct at91_uart_config __initdata dk_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 2,
+       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
+};
+
+static void __init dk_map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       at91rm9200_initialize(18432000, AT91RM9200_BGA);
+
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&dk_uart_config);
+}
+
+static void __init dk_init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata dk_eth_data = {
+       .phy_irq_pin    = AT91_PIN_PC4,
+       .is_rmii        = 1,
+};
+
+static struct at91_usbh_data __initdata dk_usbh_data = {
+       .ports          = 2,
+};
+
+static struct at91_udc_data __initdata dk_udc_data = {
+       .vbus_pin       = AT91_PIN_PD4,
+       .pullup_pin     = AT91_PIN_PD5,
+};
+
+static struct at91_cf_data __initdata dk_cf_data = {
+       .det_pin        = AT91_PIN_PB0,
+       .rst_pin        = AT91_PIN_PC5,
+       // .irq_pin     = ... not connected
+       // .vcc_pin     = ... always powered
+};
+
+static struct at91_mmc_data __initdata dk_mmc_data = {
+       .slot_b         = 0,
+       .wire4          = 1,
+};
+
+static struct spi_board_info dk_spi_devices[] = {
+       {       /* DataFlash chip */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 0,
+               .max_speed_hz   = 15 * 1000 * 1000,
+       },
+       {       /* UR6HCPS2-SP40 PS2-to-SPI adapter */
+               .modalias       = "ur6hcps2",
+               .chip_select    = 1,
+               .max_speed_hz   = 250 *  1000,
+       },
+       {       /* TLV1504 ADC, 4 channels, 10 bits; one is a temp sensor */
+               .modalias       = "tlv1504",
+               .chip_select    = 2,
+               .max_speed_hz   = 20 * 1000 * 1000,
+       },
+#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
+       {       /* DataFlash card */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 3,
+               .max_speed_hz   = 15 * 1000 * 1000,
+       }
+#endif
+};
+
+static struct mtd_partition __initdata dk_nand_partition[] = {
+       {
+               .name   = "NAND Partition 1",
+               .offset = 0,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
+{
+       *num_partitions = ARRAY_SIZE(dk_nand_partition);
+       return dk_nand_partition;
+}
+
+static struct at91_nand_data __initdata dk_nand_data = {
+       .ale            = 22,
+       .cle            = 21,
+       .det_pin        = AT91_PIN_PB1,
+       .rdy_pin        = AT91_PIN_PC2,
+       // .enable_pin  = ... not there
+       .partition_info = nand_partitions,
+};
+
+#define DK_FLASH_BASE  AT91_CHIPSELECT_0
+#define DK_FLASH_SIZE  0x200000
+
+static struct physmap_flash_data dk_flash_data = {
+       .width  = 2,
+};
+
+static struct resource dk_flash_resource = {
+       .start          = DK_FLASH_BASE,
+       .end            = DK_FLASH_BASE + DK_FLASH_SIZE - 1,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device dk_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+                               .platform_data  = &dk_flash_data,
+                       },
+       .resource       = &dk_flash_resource,
+       .num_resources  = 1,
+};
+
+
+static void __init dk_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* Ethernet */
+       at91_add_device_eth(&dk_eth_data);
+       /* USB Host */
+       at91_add_device_usbh(&dk_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&dk_udc_data);
+       at91_set_multi_drive(dk_udc_data.pullup_pin, 1);        /* pullup_pin is connected to reset */
+       /* Compact Flash */
+       at91_add_device_cf(&dk_cf_data);
+       /* I2C */
+       at91_add_device_i2c();
+       /* SPI */
+       at91_add_device_spi(dk_spi_devices, ARRAY_SIZE(dk_spi_devices));
+#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
+       /* DataFlash card */
+       at91_set_gpio_output(AT91_PIN_PB7, 0);
+#else
+       /* MMC */
+       at91_set_gpio_output(AT91_PIN_PB7, 1);  /* this MMC card slot can optionally use SPI signaling (CS3). */
+       at91_add_device_mmc(0, &dk_mmc_data);
+#endif
+       /* NAND */
+       at91_add_device_nand(&dk_nand_data);
+       /* NOR Flash */
+       platform_device_register(&dk_flash);
+       /* VGA */
+//     dk_add_device_video();
+}
+
+MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
+       /* Maintainer: SAN People/Atmel */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91rm9200_timer,
+       .map_io         = dk_map_io,
+       .init_irq       = dk_init_irq,
+       .init_machine   = dk_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c
new file mode 100644 (file)
index 0000000..20458b5
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * linux/arch/arm/mach-at91/board-eb9200.c
+ *
+ *  Copyright (C) 2005 SAN People, adapted for ATEB9200 from Embest
+ *  by Andrew Patrikalakis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/device.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 3 = USART0 .. USART3
+ *    4      = DBGU
+ */
+static struct at91_uart_config __initdata eb9200_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 2,
+       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
+};
+
+static void __init eb9200_map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       at91rm9200_initialize(18432000, AT91RM9200_BGA);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&eb9200_uart_config);
+}
+
+static void __init eb9200_init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata eb9200_eth_data = {
+       .phy_irq_pin    = AT91_PIN_PC4,
+       .is_rmii        = 1,
+};
+
+static struct at91_usbh_data __initdata eb9200_usbh_data = {
+       .ports          = 2,
+};
+
+static struct at91_udc_data __initdata eb9200_udc_data = {
+       .vbus_pin       = AT91_PIN_PD4,
+       .pullup_pin     = AT91_PIN_PD5,
+};
+
+static struct at91_cf_data __initdata eb9200_cf_data = {
+       .det_pin        = AT91_PIN_PB0,
+       .rst_pin        = AT91_PIN_PC5,
+       // .irq_pin     = ... not connected
+       // .vcc_pin     = ... always powered
+};
+
+static struct at91_mmc_data __initdata eb9200_mmc_data = {
+       .slot_b         = 0,
+       .wire4          = 1,
+};
+
+static void __init eb9200_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* Ethernet */
+       at91_add_device_eth(&eb9200_eth_data);
+       /* USB Host */
+       at91_add_device_usbh(&eb9200_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&eb9200_udc_data);
+       /* I2C */
+       at91_add_device_i2c();
+       /* Compact Flash */
+       at91_add_device_cf(&eb9200_cf_data);
+       /* SPI */
+       at91_add_device_spi(NULL, 0);
+       /* MMC */
+       /* only supports 1 or 4 bit interface, not wired through to SPI */
+       at91_add_device_mmc(0, &eb9200_mmc_data);
+}
+
+MACHINE_START(ATEB9200, "Embest ATEB9200")
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91rm9200_timer,
+       .map_io         = eb9200_map_io,
+       .init_irq       = eb9200_init_irq,
+       .init_machine   = eb9200_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-ek.c b/arch/arm/mach-at91/board-ek.c
new file mode 100644 (file)
index 0000000..322fdd7
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * linux/arch/arm/mach-at91/board-ek.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *
+ *  Epson S1D framebuffer glue code is:
+ *     Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/mtd/physmap.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91rm9200_mc.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 3 = USART0 .. USART3
+ *    4      = DBGU
+ */
+static struct at91_uart_config __initdata ek_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 2,
+       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
+};
+
+static void __init ek_map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       at91rm9200_initialize(18432000, AT91RM9200_BGA);
+
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&ek_uart_config);
+}
+
+static void __init ek_init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata ek_eth_data = {
+       .phy_irq_pin    = AT91_PIN_PC4,
+       .is_rmii        = 1,
+};
+
+static struct at91_usbh_data __initdata ek_usbh_data = {
+       .ports          = 2,
+};
+
+static struct at91_udc_data __initdata ek_udc_data = {
+       .vbus_pin       = AT91_PIN_PD4,
+       .pullup_pin     = AT91_PIN_PD5,
+};
+
+static struct at91_mmc_data __initdata ek_mmc_data = {
+       .det_pin        = AT91_PIN_PB27,
+       .slot_b         = 0,
+       .wire4          = 1,
+       .wp_pin         = AT91_PIN_PA17,
+};
+
+static struct spi_board_info ek_spi_devices[] = {
+       {       /* DataFlash chip */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 0,
+               .max_speed_hz   = 15 * 1000 * 1000,
+       },
+#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
+       {       /* DataFlash card */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 3,
+               .max_speed_hz   = 15 * 1000 * 1000,
+       },
+#endif
+};
+
+#define EK_FLASH_BASE  AT91_CHIPSELECT_0
+#define EK_FLASH_SIZE  0x200000
+
+static struct physmap_flash_data ek_flash_data = {
+       .width  = 2,
+};
+
+static struct resource ek_flash_resource = {
+       .start          = EK_FLASH_BASE,
+       .end            = EK_FLASH_BASE + EK_FLASH_SIZE - 1,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device ek_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+                               .platform_data  = &ek_flash_data,
+                       },
+       .resource       = &ek_flash_resource,
+       .num_resources  = 1,
+};
+
+
+static void __init ek_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* Ethernet */
+       at91_add_device_eth(&ek_eth_data);
+       /* USB Host */
+       at91_add_device_usbh(&ek_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&ek_udc_data);
+       at91_set_multi_drive(ek_udc_data.pullup_pin, 1);        /* pullup_pin is connected to reset */
+       /* I2C */
+       at91_add_device_i2c();
+       /* SPI */
+       at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
+#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
+       /* DataFlash card */
+       at91_set_gpio_output(AT91_PIN_PB22, 0);
+#else
+       /* MMC */
+       at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
+       at91_add_device_mmc(0, &ek_mmc_data);
+#endif
+       /* NOR Flash */
+       platform_device_register(&ek_flash);
+       /* VGA */
+//     ek_add_device_video();
+}
+
+MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
+       /* Maintainer: SAN People/Atmel */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91rm9200_timer,
+       .map_io         = ek_map_io,
+       .init_irq       = ek_init_irq,
+       .init_machine   = ek_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c
new file mode 100644 (file)
index 0000000..c77d84c
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * linux/arch/arm/mach-at91/board-kafa.c
+ *
+ *  Copyright (C) 2006 Sperry-Sun
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 3 = USART0 .. USART3
+ *    4      = DBGU
+ */
+static struct at91_uart_config __initdata kafa_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 2,
+       .tty_map        = { 4, 0, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
+};
+
+static void __init kafa_map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       at91rm9200_initialize(18432000, AT91RM9200_PQFP);
+
+       /* Set up the LEDs */
+       at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&kafa_uart_config);
+}
+
+static void __init kafa_init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata kafa_eth_data = {
+       .phy_irq_pin    = AT91_PIN_PC4,
+       .is_rmii        = 0,
+};
+
+static struct at91_usbh_data __initdata kafa_usbh_data = {
+       .ports          = 1,
+};
+
+static struct at91_udc_data __initdata kafa_udc_data = {
+       .vbus_pin       = AT91_PIN_PB6,
+       .pullup_pin     = AT91_PIN_PB7,
+};
+
+static void __init kafa_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* Ethernet */
+       at91_add_device_eth(&kafa_eth_data);
+       /* USB Host */
+       at91_add_device_usbh(&kafa_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&kafa_udc_data);
+       /* I2C */
+       at91_add_device_i2c();
+       /* SPI */
+       at91_add_device_spi(NULL, 0);
+}
+
+MACHINE_START(KAFA, "Sperry-Sun KAFA")
+       /* Maintainer: Sergei Sharonov */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91rm9200_timer,
+       .map_io         = kafa_map_io,
+       .init_irq       = kafa_init_irq,
+       .init_machine   = kafa_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
new file mode 100644 (file)
index 0000000..76f6e1e
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * linux/arch/arm/mach-at91/board-kb9202.c
+ *
+ *  Copyright (c) 2005 kb_admin
+ *                    KwikByte, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 3 = USART0 .. USART3
+ *    4      = DBGU
+ */
+static struct at91_uart_config __initdata kb9202_uart_config = {
+       .console_tty    = 0,                                    /* ttyS0 */
+       .nr_tty         = 3,
+       .tty_map        = { 4, 0, 1, -1, -1 }                   /* ttyS0, ..., ttyS4 */
+};
+
+static void __init kb9202_map_io(void)
+{
+       /* Initialize processor: 10 MHz crystal */
+       at91rm9200_initialize(10000000, AT91RM9200_PQFP);
+
+       /* Set up the LEDs */
+       at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&kb9202_uart_config);
+}
+
+static void __init kb9202_init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata kb9202_eth_data = {
+       .phy_irq_pin    = AT91_PIN_PB29,
+       .is_rmii        = 0,
+};
+
+static struct at91_usbh_data __initdata kb9202_usbh_data = {
+       .ports          = 1,
+};
+
+static struct at91_udc_data __initdata kb9202_udc_data = {
+       .vbus_pin       = AT91_PIN_PB24,
+       .pullup_pin     = AT91_PIN_PB22,
+};
+
+static struct at91_mmc_data __initdata kb9202_mmc_data = {
+       .det_pin        = AT91_PIN_PB2,
+       .slot_b         = 0,
+       .wire4          = 1,
+};
+
+static struct mtd_partition __initdata kb9202_nand_partition[] = {
+       {
+               .name   = "nand_fs",
+               .offset = 0,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
+{
+       *num_partitions = ARRAY_SIZE(kb9202_nand_partition);
+       return kb9202_nand_partition;
+}
+
+static struct at91_nand_data __initdata kb9202_nand_data = {
+       .ale            = 22,
+       .cle            = 21,
+       // .det_pin     = ... not there
+       .rdy_pin        = AT91_PIN_PC29,
+       .enable_pin     = AT91_PIN_PC28,
+       .partition_info = nand_partitions,
+};
+
+static void __init kb9202_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* Ethernet */
+       at91_add_device_eth(&kb9202_eth_data);
+       /* USB Host */
+       at91_add_device_usbh(&kb9202_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&kb9202_udc_data);
+       /* MMC */
+       at91_add_device_mmc(0, &kb9202_mmc_data);
+       /* I2C */
+       at91_add_device_i2c();
+       /* SPI */
+       at91_add_device_spi(NULL, 0);
+       /* NAND */
+       at91_add_device_nand(&kb9202_nand_data);
+}
+
+MACHINE_START(KB9200, "KB920x")
+       /* Maintainer: KwikByte, Inc. */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91rm9200_timer,
+       .map_io         = kb9202_map_io,
+       .init_irq       = kb9202_init_irq,
+       .init_machine   = kb9202_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
new file mode 100644 (file)
index 0000000..57fb449
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ * linux/arch/arm/mach-at91/board-sam9260ek.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *  Copyright (C) 2006 Atmel
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91sam926x_mc.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 5 = USART0 .. USART5
+ *    6      = DBGU
+ */
+static struct at91_uart_config __initdata ek_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 3,
+       .tty_map        = { 6, 0, 1, -1, -1, -1, -1 }   /* ttyS0, ..., ttyS6 */
+};
+
+static void __init ek_map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       at91sam9260_initialize(18432000);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&ek_uart_config);
+}
+
+static void __init ek_init_irq(void)
+{
+       at91sam9260_init_interrupts(NULL);
+}
+
+
+/*
+ * USB Host port
+ */
+static struct at91_usbh_data __initdata ek_usbh_data = {
+       .ports          = 2,
+};
+
+/*
+ * USB Device port
+ */
+static struct at91_udc_data __initdata ek_udc_data = {
+       .vbus_pin       = AT91_PIN_PC5,
+       .pullup_pin     = 0,            /* pull-up driven by UDC */
+};
+
+
+/*
+ * SPI devices.
+ */
+static struct spi_board_info ek_spi_devices[] = {
+#if !defined(CONFIG_MMC_AT91)
+       {       /* DataFlash chip */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 1,
+               .max_speed_hz   = 15 * 1000 * 1000,
+               .bus_num        = 0,
+       },
+#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
+       {       /* DataFlash card */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 0,
+               .max_speed_hz   = 15 * 1000 * 1000,
+               .bus_num        = 0,
+       },
+#endif
+#endif
+#if defined(CONFIG_SND_AT73C213)
+       {       /* AT73C213 DAC */
+               .modalias       = "snd_at73c213",
+               .chip_select    = 0,
+               .max_speed_hz   = 10 * 1000 * 1000,
+               .bus_num        = 1,
+       },
+#endif
+};
+
+
+/*
+ * MACB Ethernet device
+ */
+static struct __initdata at91_eth_data ek_macb_data = {
+       .phy_irq_pin    = AT91_PIN_PA7,
+       .is_rmii        = 1,
+};
+
+
+/*
+ * NAND flash
+ */
+static struct mtd_partition __initdata ek_nand_partition[] = {
+       {
+               .name   = "Partition 1",
+               .offset = 0,
+               .size   = 256 * 1024,
+       },
+       {
+               .name   = "Partition 2",
+               .offset = 256 * 1024,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
+{
+       *num_partitions = ARRAY_SIZE(ek_nand_partition);
+       return ek_nand_partition;
+}
+
+static struct at91_nand_data __initdata ek_nand_data = {
+       .ale            = 21,
+       .cle            = 22,
+//     .det_pin        = ... not connected
+       .rdy_pin        = AT91_PIN_PC13,
+       .enable_pin     = AT91_PIN_PC14,
+       .partition_info = nand_partitions,
+#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+       .bus_width_16   = 1,
+#else
+       .bus_width_16   = 0,
+#endif
+};
+
+
+/*
+ * MCI (SD/MMC)
+ */
+static struct at91_mmc_data __initdata ek_mmc_data = {
+       .slot_b         = 1,
+       .wire4          = 1,
+//     .det_pin        = ... not connected
+//     .wp_pin         = ... not connected
+//     .vcc_pin        = ... not connected
+};
+
+static void __init ek_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* USB Host */
+       at91_add_device_usbh(&ek_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&ek_udc_data);
+       /* SPI */
+       at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
+       /* NAND */
+       at91_add_device_nand(&ek_nand_data);
+       /* Ethernet */
+       at91_add_device_eth(&ek_macb_data);
+       /* MMC */
+       at91_add_device_mmc(0, &ek_mmc_data);
+}
+
+MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
+       /* Maintainer: Atmel */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91sam926x_timer,
+       .map_io         = ek_map_io,
+       .init_irq       = ek_init_irq,
+       .init_machine   = ek_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
new file mode 100644 (file)
index 0000000..b7e7724
--- /dev/null
@@ -0,0 +1,259 @@
+/*
+ * linux/arch/arm/mach-at91/board-sam9261ek.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *  Copyright (C) 2006 Atmel
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/dm9000.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91sam926x_mc.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 2 = USART0 .. USART2
+ *    3      = DBGU
+ */
+static struct at91_uart_config __initdata ek_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 1,
+       .tty_map        = { 3, -1, -1, -1 }             /* ttyS0, ..., ttyS3 */
+};
+
+static void __init ek_map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       at91sam9261_initialize(18432000);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&ek_uart_config);
+}
+
+static void __init ek_init_irq(void)
+{
+       at91sam9261_init_interrupts(NULL);
+}
+
+
+/*
+ * DM9000 ethernet device
+ */
+#if defined(CONFIG_DM9000)
+static struct resource at91sam9261_dm9000_resource[] = {
+       [0] = {
+               .start  = AT91_CHIPSELECT_2,
+               .end    = AT91_CHIPSELECT_2 + 3,
+               .flags  = IORESOURCE_MEM
+       },
+       [1] = {
+               .start  = AT91_CHIPSELECT_2 + 0x44,
+               .end    = AT91_CHIPSELECT_2 + 0xFF,
+               .flags  = IORESOURCE_MEM
+       },
+       [2] = {
+               .start  = AT91_PIN_PC11,
+               .end    = AT91_PIN_PC11,
+               .flags  = IORESOURCE_IRQ
+       }
+};
+
+static struct dm9000_plat_data dm9000_platdata = {
+       .flags          = DM9000_PLATF_16BITONLY,
+};
+
+static struct platform_device at91sam9261_dm9000_device = {
+       .name           = "dm9000",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(at91sam9261_dm9000_resource),
+       .resource       = at91sam9261_dm9000_resource,
+       .dev            = {
+               .platform_data  = &dm9000_platdata,
+       }
+};
+
+static void __init ek_add_device_dm9000(void)
+{
+       /*
+        * Configure Chip-Select 2 on SMC for the DM9000.
+        * Note: These timings were calculated for MASTER_CLOCK = 100000000
+        *  according to the DM9000 timings.
+        */
+       at91_sys_write(AT91_SMC_SETUP(2), AT91_SMC_NWESETUP_(2) | AT91_SMC_NCS_WRSETUP_(0) | AT91_SMC_NRDSETUP_(2) | AT91_SMC_NCS_RDSETUP_(0));
+       at91_sys_write(AT91_SMC_PULSE(2), AT91_SMC_NWEPULSE_(4) | AT91_SMC_NCS_WRPULSE_(8) | AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(8));
+       at91_sys_write(AT91_SMC_CYCLE(2), AT91_SMC_NWECYCLE_(16) | AT91_SMC_NRDCYCLE_(16));
+       at91_sys_write(AT91_SMC_MODE(2), AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE | AT91_SMC_DBW_16 | AT91_SMC_TDF_(1));
+
+       /* Configure Reset signal as output */
+       at91_set_gpio_output(AT91_PIN_PC10, 0);
+
+       /* Configure Interrupt pin as input, no pull-up */
+       at91_set_gpio_input(AT91_PIN_PC11, 0);
+
+       platform_device_register(&at91sam9261_dm9000_device);
+}
+#else
+static void __init ek_add_device_dm9000(void) {}
+#endif /* CONFIG_DM9000 */
+
+
+/*
+ * USB Host Port
+ */
+static struct at91_usbh_data __initdata ek_usbh_data = {
+       .ports          = 2,
+};
+
+
+/*
+ * USB Device Port
+ */
+static struct at91_udc_data __initdata ek_udc_data = {
+       .vbus_pin       = AT91_PIN_PB29,
+       .pullup_pin     = 0,            /* pull-up driven by UDC */
+};
+
+
+/*
+ * MCI (SD/MMC)
+ */
+static struct at91_mmc_data __initdata ek_mmc_data = {
+       .wire4          = 1,
+//     .det_pin        = ... not connected
+//     .wp_pin         = ... not connected
+//     .vcc_pin        = ... not connected
+};
+
+
+/*
+ * NAND flash
+ */
+static struct mtd_partition __initdata ek_nand_partition[] = {
+       {
+               .name   = "Partition 1",
+               .offset = 0,
+               .size   = 256 * 1024,
+       },
+       {
+               .name   = "Partition 2",
+               .offset = 256 * 1024 ,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
+{
+       *num_partitions = ARRAY_SIZE(ek_nand_partition);
+       return ek_nand_partition;
+}
+
+static struct at91_nand_data __initdata ek_nand_data = {
+       .ale            = 22,
+       .cle            = 21,
+//     .det_pin        = ... not connected
+       .rdy_pin        = AT91_PIN_PC15,
+       .enable_pin     = AT91_PIN_PC14,
+       .partition_info = nand_partitions,
+#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+       .bus_width_16   = 1,
+#else
+       .bus_width_16   = 0,
+#endif
+};
+
+/*
+ * SPI devices
+ */
+static struct spi_board_info ek_spi_devices[] = {
+       {       /* DataFlash chip */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 0,
+               .max_speed_hz   = 15 * 1000 * 1000,
+               .bus_num        = 0,
+       },
+#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
+       {       /* DataFlash card - jumper (J12) configurable to CS3 or CS0 */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 3,
+               .max_speed_hz   = 15 * 1000 * 1000,
+               .bus_num        = 0,
+       },
+#elif defined(CONFIG_SND_AT73C213)
+       {       /* AT73C213 DAC */
+               .modalias       = "snd_at73c213",
+               .chip_select    = 3,
+               .max_speed_hz   = 10 * 1000 * 1000,
+               .bus_num        = 0,
+       },
+#endif
+};
+
+
+static void __init ek_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* USB Host */
+       at91_add_device_usbh(&ek_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&ek_udc_data);
+       /* I2C */
+       at91_add_device_i2c();
+       /* NAND */
+       at91_add_device_nand(&ek_nand_data);
+       /* DM9000 ethernet */
+       ek_add_device_dm9000();
+
+       /* spi0 and mmc/sd share the same PIO pins */
+#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
+       /* SPI */
+       at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
+#else
+       /* MMC */
+       at91_add_device_mmc(0, &ek_mmc_data);
+#endif
+}
+
+MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
+       /* Maintainer: Atmel */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91sam926x_timer,
+       .map_io         = ek_map_io,
+       .init_irq       = ek_init_irq,
+       .init_machine   = ek_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
new file mode 100644 (file)
index 0000000..8fdce11
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * linux/arch/arm/mach-at91/board-sam9263ek.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *  Copyright (C) 2007 Atmel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91sam926x_mc.h>
+
+#include "generic.h"
+
+
+/*
+ * Serial port configuration.
+ *    0 .. 2 = USART0 .. USART2
+ *    3      = DBGU
+ */
+static struct at91_uart_config __initdata ek_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 2,
+       .tty_map        = { 3, 0, -1, -1, }             /* ttyS0, ..., ttyS3 */
+};
+
+static void __init ek_map_io(void)
+{
+       /* Initialize processor: 16.367 MHz crystal */
+       at91sam9263_initialize(16367660);
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&ek_uart_config);
+}
+
+static void __init ek_init_irq(void)
+{
+       at91sam9263_init_interrupts(NULL);
+}
+
+
+/*
+ * USB Host port
+ */
+static struct at91_usbh_data __initdata ek_usbh_data = {
+       .ports          = 2,
+       .vbus_pin       = { AT91_PIN_PA24, AT91_PIN_PA21 },
+};
+
+/*
+ * USB Device port
+ */
+static struct at91_udc_data __initdata ek_udc_data = {
+       .vbus_pin       = AT91_PIN_PA25,
+       .pullup_pin     = 0,            /* pull-up driven by UDC */
+};
+
+
+/*
+ * SPI devices.
+ */
+static struct spi_board_info ek_spi_devices[] = {
+#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
+       {       /* DataFlash card */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 0,
+               .max_speed_hz   = 15 * 1000 * 1000,
+               .bus_num        = 0,
+       },
+#endif
+};
+
+
+/*
+ * MCI (SD/MMC)
+ */
+static struct at91_mmc_data __initdata ek_mmc_data = {
+       .wire4          = 1,
+       .det_pin        = AT91_PIN_PE18,
+       .wp_pin         = AT91_PIN_PE19,
+//     .vcc_pin        = ... not connected
+};
+
+
+/*
+ * NAND flash
+ */
+static struct mtd_partition __initdata ek_nand_partition[] = {
+       {
+               .name   = "Partition 1",
+               .offset = 0,
+               .size   = 64 * 1024 * 1024,
+       },
+       {
+               .name   = "Partition 2",
+               .offset = 64 * 1024 * 1024,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
+{
+       *num_partitions = ARRAY_SIZE(ek_nand_partition);
+       return ek_nand_partition;
+}
+
+static struct at91_nand_data __initdata ek_nand_data = {
+       .ale            = 21,
+       .cle            = 22,
+//     .det_pin        = ... not connected
+       .rdy_pin        = AT91_PIN_PA22,
+       .enable_pin     = AT91_PIN_PD15,
+       .partition_info = nand_partitions,
+#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+       .bus_width_16   = 1,
+#else
+       .bus_width_16   = 0,
+#endif
+};
+
+
+static void __init ek_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* USB Host */
+       at91_add_device_usbh(&ek_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&ek_udc_data);
+       /* SPI */
+       at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
+       /* MMC */
+       at91_add_device_mmc(1, &ek_mmc_data);
+       /* NAND */
+       at91_add_device_nand(&ek_nand_data);
+}
+
+MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
+       /* Maintainer: Atmel */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91sam926x_timer,
+       .map_io         = ek_map_io,
+       .init_irq       = ek_init_irq,
+       .init_machine   = ek_board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
new file mode 100644 (file)
index 0000000..06c9a05
--- /dev/null
@@ -0,0 +1,640 @@
+/*
+ * linux/arch/arm/mach-at91/clock.c
+ *
+ * Copyright (C) 2005 David Brownell
+ * Copyright (C) 2005 Ivan Kokshaysky
+ *
+ * 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/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/fs.h>
+#include <linux/debugfs.h>
+#include <linux/seq_file.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/spinlock.h>
+#include <linux/delay.h>
+#include <linux/clk.h>
+
+#include <asm/semaphore.h>
+#include <asm/io.h>
+#include <asm/mach-types.h>
+
+#include <asm/hardware.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/cpu.h>
+
+#include "clock.h"
+
+
+/*
+ * There's a lot more which can be done with clocks, including cpufreq
+ * integration, slow clock mode support (for system suspend), letting
+ * PLLB be used at other rates (on boards that don't need USB), etc.
+ */
+
+#define clk_is_primary(x)      ((x)->type & CLK_TYPE_PRIMARY)
+#define clk_is_programmable(x) ((x)->type & CLK_TYPE_PROGRAMMABLE)
+#define clk_is_peripheral(x)   ((x)->type & CLK_TYPE_PERIPHERAL)
+#define clk_is_sys(x)          ((x)->type & CLK_TYPE_SYSTEM)
+
+
+static LIST_HEAD(clocks);
+static DEFINE_SPINLOCK(clk_lock);
+
+static u32 at91_pllb_usb_init;
+
+/*
+ * Four primary clock sources:  two crystal oscillators (32K, main), and
+ * two PLLs.  PLLA usually runs the master clock; and PLLB must run at
+ * 48 MHz (unless no USB function clocks are needed).  The main clock and
+ * both PLLs are turned off to run in "slow clock mode" (system suspend).
+ */
+static struct clk clk32k = {
+       .name           = "clk32k",
+       .rate_hz        = AT91_SLOW_CLOCK,
+       .users          = 1,            /* always on */
+       .id             = 0,
+       .type           = CLK_TYPE_PRIMARY,
+};
+static struct clk main_clk = {
+       .name           = "main",
+       .pmc_mask       = AT91_PMC_MOSCS,       /* in PMC_SR */
+       .id             = 1,
+       .type           = CLK_TYPE_PRIMARY,
+};
+static struct clk plla = {
+       .name           = "plla",
+       .parent         = &main_clk,
+       .pmc_mask       = AT91_PMC_LOCKA,       /* in PMC_SR */
+       .id             = 2,
+       .type           = CLK_TYPE_PRIMARY | CLK_TYPE_PLL,
+};
+
+static void pllb_mode(struct clk *clk, int is_on)
+{
+       u32     value;
+
+       if (is_on) {
+               is_on = AT91_PMC_LOCKB;
+               value = at91_pllb_usb_init;
+       } else
+               value = 0;
+
+       // REVISIT: Add work-around for AT91RM9200 Errata #26 ?
+       at91_sys_write(AT91_CKGR_PLLBR, value);
+
+       do {
+               cpu_relax();
+       } while ((at91_sys_read(AT91_PMC_SR) & AT91_PMC_LOCKB) != is_on);
+}
+
+static struct clk pllb = {
+       .name           = "pllb",
+       .parent         = &main_clk,
+       .pmc_mask       = AT91_PMC_LOCKB,       /* in PMC_SR */
+       .mode           = pllb_mode,
+       .id             = 3,
+       .type           = CLK_TYPE_PRIMARY | CLK_TYPE_PLL,
+};
+
+static void pmc_sys_mode(struct clk *clk, int is_on)
+{
+       if (is_on)
+               at91_sys_write(AT91_PMC_SCER, clk->pmc_mask);
+       else
+               at91_sys_write(AT91_PMC_SCDR, clk->pmc_mask);
+}
+
+/* USB function clocks (PLLB must be 48 MHz) */
+static struct clk udpck = {
+       .name           = "udpck",
+       .parent         = &pllb,
+       .mode           = pmc_sys_mode,
+};
+static struct clk uhpck = {
+       .name           = "uhpck",
+       .parent         = &pllb,
+       .mode           = pmc_sys_mode,
+};
+
+
+/*
+ * The master clock is divided from the CPU clock (by 1-4).  It's used for
+ * memory, interfaces to on-chip peripherals, the AIC, and sometimes more
+ * (e.g baud rate generation).  It's sourced from one of the primary clocks.
+ */
+static struct clk mck = {
+       .name           = "mck",
+       .pmc_mask       = AT91_PMC_MCKRDY,      /* in PMC_SR */
+};
+
+static void pmc_periph_mode(struct clk *clk, int is_on)
+{
+       if (is_on)
+               at91_sys_write(AT91_PMC_PCER, clk->pmc_mask);
+       else
+               at91_sys_write(AT91_PMC_PCDR, clk->pmc_mask);
+}
+
+static struct clk __init *at91_css_to_clk(unsigned long css)
+{
+       switch (css) {
+               case AT91_PMC_CSS_SLOW:
+                       return &clk32k;
+               case AT91_PMC_CSS_MAIN:
+                       return &main_clk;
+               case AT91_PMC_CSS_PLLA:
+                       return &plla;
+               case AT91_PMC_CSS_PLLB:
+                       return &pllb;
+       }
+
+       return NULL;
+}
+
+/*
+ * Associate a particular clock with a function (eg, "uart") and device.
+ * The drivers can then request the same 'function' with several different
+ * devices and not care about which clock name to use.
+ */
+void __init at91_clock_associate(const char *id, struct device *dev, const char *func)
+{
+       struct clk *clk = clk_get(NULL, id);
+
+       if (!dev || !clk || !IS_ERR(clk_get(dev, func)))
+               return;
+
+       clk->function = func;
+       clk->dev = dev;
+}
+
+/* clocks cannot be de-registered no refcounting necessary */
+struct clk *clk_get(struct device *dev, const char *id)
+{
+       struct clk *clk;
+
+       list_for_each_entry(clk, &clocks, node) {
+               if (strcmp(id, clk->name) == 0)
+                       return clk;
+               if (clk->function && (dev == clk->dev) && strcmp(id, clk->function) == 0)
+                       return clk;
+       }
+
+       return ERR_PTR(-ENOENT);
+}
+EXPORT_SYMBOL(clk_get);
+
+void clk_put(struct clk *clk)
+{
+}
+EXPORT_SYMBOL(clk_put);
+
+static void __clk_enable(struct clk *clk)
+{
+       if (clk->parent)
+               __clk_enable(clk->parent);
+       if (clk->users++ == 0 && clk->mode)
+               clk->mode(clk, 1);
+}
+
+int clk_enable(struct clk *clk)
+{
+       unsigned long   flags;
+
+       spin_lock_irqsave(&clk_lock, flags);
+       __clk_enable(clk);
+       spin_unlock_irqrestore(&clk_lock, flags);
+       return 0;
+}
+EXPORT_SYMBOL(clk_enable);
+
+static void __clk_disable(struct clk *clk)
+{
+       BUG_ON(clk->users == 0);
+       if (--clk->users == 0 && clk->mode)
+               clk->mode(clk, 0);
+       if (clk->parent)
+               __clk_disable(clk->parent);
+}
+
+void clk_disable(struct clk *clk)
+{
+       unsigned long   flags;
+
+       spin_lock_irqsave(&clk_lock, flags);
+       __clk_disable(clk);
+       spin_unlock_irqrestore(&clk_lock, flags);
+}
+EXPORT_SYMBOL(clk_disable);
+
+unsigned long clk_get_rate(struct clk *clk)
+{
+       unsigned long   flags;
+       unsigned long   rate;
+
+       spin_lock_irqsave(&clk_lock, flags);
+       for (;;) {
+               rate = clk->rate_hz;
+               if (rate || !clk->parent)
+                       break;
+               clk = clk->parent;
+       }
+       spin_unlock_irqrestore(&clk_lock, flags);
+       return rate;
+}
+EXPORT_SYMBOL(clk_get_rate);
+
+/*------------------------------------------------------------------------*/
+
+#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
+
+/*
+ * For now, only the programmable clocks support reparenting (MCK could
+ * do this too, with care) or rate changing (the PLLs could do this too,
+ * ditto MCK but that's more for cpufreq).  Drivers may reparent to get
+ * a better rate match; we don't.
+ */
+
+long clk_round_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long   flags;
+       unsigned        prescale;
+       unsigned long   actual;
+
+       if (!clk_is_programmable(clk))
+               return -EINVAL;
+       spin_lock_irqsave(&clk_lock, flags);
+
+       actual = clk->parent->rate_hz;
+       for (prescale = 0; prescale < 7; prescale++) {
+               if (actual && actual <= rate)
+                       break;
+               actual >>= 1;
+       }
+
+       spin_unlock_irqrestore(&clk_lock, flags);
+       return (prescale < 7) ? actual : -ENOENT;
+}
+EXPORT_SYMBOL(clk_round_rate);
+
+int clk_set_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long   flags;
+       unsigned        prescale;
+       unsigned long   actual;
+
+       if (!clk_is_programmable(clk))
+               return -EINVAL;
+       if (clk->users)
+               return -EBUSY;
+       spin_lock_irqsave(&clk_lock, flags);
+
+       actual = clk->parent->rate_hz;
+       for (prescale = 0; prescale < 7; prescale++) {
+               if (actual && actual <= rate) {
+                       u32     pckr;
+
+                       pckr = at91_sys_read(AT91_PMC_PCKR(clk->id));
+                       pckr &= AT91_PMC_CSS_PLLB;      /* clock selection */
+                       pckr |= prescale << 2;
+                       at91_sys_write(AT91_PMC_PCKR(clk->id), pckr);
+                       clk->rate_hz = actual;
+                       break;
+               }
+               actual >>= 1;
+       }
+
+       spin_unlock_irqrestore(&clk_lock, flags);
+       return (prescale < 7) ? actual : -ENOENT;
+}
+EXPORT_SYMBOL(clk_set_rate);
+
+struct clk *clk_get_parent(struct clk *clk)
+{
+       return clk->parent;
+}
+EXPORT_SYMBOL(clk_get_parent);
+
+int clk_set_parent(struct clk *clk, struct clk *parent)
+{
+       unsigned long   flags;
+
+       if (clk->users)
+               return -EBUSY;
+       if (!clk_is_primary(parent) || !clk_is_programmable(clk))
+               return -EINVAL;
+       spin_lock_irqsave(&clk_lock, flags);
+
+       clk->rate_hz = parent->rate_hz;
+       clk->parent = parent;
+       at91_sys_write(AT91_PMC_PCKR(clk->id), parent->id);
+
+       spin_unlock_irqrestore(&clk_lock, flags);
+       return 0;
+}
+EXPORT_SYMBOL(clk_set_parent);
+
+/* establish PCK0..PCK3 parentage and rate */
+static void init_programmable_clock(struct clk *clk)
+{
+       struct clk      *parent;
+       u32             pckr;
+
+       pckr = at91_sys_read(AT91_PMC_PCKR(clk->id));
+       parent = at91_css_to_clk(pckr & AT91_PMC_CSS);
+       clk->parent = parent;
+       clk->rate_hz = parent->rate_hz / (1 << ((pckr >> 2) & 3));
+}
+
+#endif /* CONFIG_AT91_PROGRAMMABLE_CLOCKS */
+
+/*------------------------------------------------------------------------*/
+
+#ifdef CONFIG_DEBUG_FS
+
+static int at91_clk_show(struct seq_file *s, void *unused)
+{
+       u32             scsr, pcsr, sr;
+       struct clk      *clk;
+       unsigned        i;
+
+       seq_printf(s, "SCSR = %8x\n", scsr = at91_sys_read(AT91_PMC_SCSR));
+       seq_printf(s, "PCSR = %8x\n", pcsr = at91_sys_read(AT91_PMC_PCSR));
+
+       seq_printf(s, "MOR  = %8x\n", at91_sys_read(AT91_CKGR_MOR));
+       seq_printf(s, "MCFR = %8x\n", at91_sys_read(AT91_CKGR_MCFR));
+       seq_printf(s, "PLLA = %8x\n", at91_sys_read(AT91_CKGR_PLLAR));
+       seq_printf(s, "PLLB = %8x\n", at91_sys_read(AT91_CKGR_PLLBR));
+
+       seq_printf(s, "MCKR = %8x\n", at91_sys_read(AT91_PMC_MCKR));
+       for (i = 0; i < 4; i++)
+               seq_printf(s, "PCK%d = %8x\n", i, at91_sys_read(AT91_PMC_PCKR(i)));
+       seq_printf(s, "SR   = %8x\n", sr = at91_sys_read(AT91_PMC_SR));
+
+       seq_printf(s, "\n");
+
+       list_for_each_entry(clk, &clocks, node) {
+               char    *state;
+
+               if (clk->mode == pmc_sys_mode)
+                       state = (scsr & clk->pmc_mask) ? "on" : "off";
+               else if (clk->mode == pmc_periph_mode)
+                       state = (pcsr & clk->pmc_mask) ? "on" : "off";
+               else if (clk->pmc_mask)
+                       state = (sr & clk->pmc_mask) ? "on" : "off";
+               else if (clk == &clk32k || clk == &main_clk)
+                       state = "on";
+               else
+                       state = "";
+
+               seq_printf(s, "%-10s users=%2d %-3s %9ld Hz %s\n",
+                       clk->name, clk->users, state, clk_get_rate(clk),
+                       clk->parent ? clk->parent->name : "");
+       }
+       return 0;
+}
+
+static int at91_clk_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, at91_clk_show, NULL);
+}
+
+static const struct file_operations at91_clk_operations = {
+       .open           = at91_clk_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+};
+
+static int __init at91_clk_debugfs_init(void)
+{
+       /* /sys/kernel/debug/at91_clk */
+       (void) debugfs_create_file("at91_clk", S_IFREG | S_IRUGO, NULL, NULL, &at91_clk_operations);
+
+       return 0;
+}
+postcore_initcall(at91_clk_debugfs_init);
+
+#endif
+
+/*------------------------------------------------------------------------*/
+
+/* Register a new clock */
+int __init clk_register(struct clk *clk)
+{
+       if (clk_is_peripheral(clk)) {
+               clk->parent = &mck;
+               clk->mode = pmc_periph_mode;
+               list_add_tail(&clk->node, &clocks);
+       }
+       else if (clk_is_sys(clk)) {
+               clk->parent = &mck;
+               clk->mode = pmc_sys_mode;
+
+               list_add_tail(&clk->node, &clocks);
+       }
+#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
+       else if (clk_is_programmable(clk)) {
+               clk->mode = pmc_sys_mode;
+               init_programmable_clock(clk);
+               list_add_tail(&clk->node, &clocks);
+       }
+#endif
+
+       return 0;
+}
+
+
+/*------------------------------------------------------------------------*/
+
+static u32 __init at91_pll_rate(struct clk *pll, u32 freq, u32 reg)
+{
+       unsigned mul, div;
+
+       div = reg & 0xff;
+       mul = (reg >> 16) & 0x7ff;
+       if (div && mul) {
+               freq /= div;
+               freq *= mul + 1;
+       } else
+               freq = 0;
+
+       return freq;
+}
+
+static u32 __init at91_usb_rate(struct clk *pll, u32 freq, u32 reg)
+{
+       if (pll == &pllb && (reg & AT91_PMC_USB96M))
+               return freq / 2;
+       else
+               return freq;
+}
+
+static unsigned __init at91_pll_calc(unsigned main_freq, unsigned out_freq)
+{
+       unsigned i, div = 0, mul = 0, diff = 1 << 30;
+       unsigned ret = (out_freq > 155000000) ? 0xbe00 : 0x3e00;
+
+       /* PLL output max 240 MHz (or 180 MHz per errata) */
+       if (out_freq > 240000000)
+               goto fail;
+
+       for (i = 1; i < 256; i++) {
+               int diff1;
+               unsigned input, mul1;
+
+               /*
+                * PLL input between 1MHz and 32MHz per spec, but lower
+                * frequences seem necessary in some cases so allow 100K.
+                */
+               input = main_freq / i;
+               if (input < 100000)
+                       continue;
+               if (input > 32000000)
+                       continue;
+
+               mul1 = out_freq / input;
+               if (mul1 > 2048)
+                       continue;
+               if (mul1 < 2)
+                       goto fail;
+
+               diff1 = out_freq - input * mul1;
+               if (diff1 < 0)
+                       diff1 = -diff1;
+               if (diff > diff1) {
+                       diff = diff1;
+                       div = i;
+                       mul = mul1;
+                       if (diff == 0)
+                               break;
+               }
+       }
+       if (i == 256 && diff > (out_freq >> 5))
+               goto fail;
+       return ret | ((mul - 1) << 16) | div;
+fail:
+       return 0;
+}
+
+static struct clk *const standard_pmc_clocks[] __initdata = {
+       /* four primary clocks */
+       &clk32k,
+       &main_clk,
+       &plla,
+       &pllb,
+
+       /* PLLB children (USB) */
+       &udpck,
+       &uhpck,
+
+       /* MCK */
+       &mck
+};
+
+int __init at91_clock_init(unsigned long main_clock)
+{
+       unsigned tmp, freq, mckr;
+       int i;
+
+       /*
+        * When the bootloader initialized the main oscillator correctly,
+        * there's no problem using the cycle counter.  But if it didn't,
+        * or when using oscillator bypass mode, we must be told the speed
+        * of the main clock.
+        */
+       if (!main_clock) {
+               do {
+                       tmp = at91_sys_read(AT91_CKGR_MCFR);
+               } while (!(tmp & AT91_PMC_MAINRDY));
+               main_clock = (tmp & AT91_PMC_MAINF) * (AT91_SLOW_CLOCK / 16);
+       }
+       main_clk.rate_hz = main_clock;
+
+       /* report if PLLA is more than mildly overclocked */
+       plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_sys_read(AT91_CKGR_PLLAR));
+       if (plla.rate_hz > 209000000)
+               pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000);
+
+       /*
+        * USB clock init:  choose 48 MHz PLLB value,
+        * disable 48MHz clock during usb peripheral suspend.
+        *
+        * REVISIT:  assumes MCK doesn't derive from PLLB!
+        */
+       at91_pllb_usb_init = at91_pll_calc(main_clock, 48000000 * 2) | AT91_PMC_USB96M;
+       pllb.rate_hz = at91_pll_rate(&pllb, main_clock, at91_pllb_usb_init);
+       if (cpu_is_at91rm9200()) {
+               uhpck.pmc_mask = AT91RM9200_PMC_UHP;
+               udpck.pmc_mask = AT91RM9200_PMC_UDP;
+               at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP);
+       } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263()) {
+               uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
+               udpck.pmc_mask = AT91SAM926x_PMC_UDP;
+       }
+       at91_sys_write(AT91_CKGR_PLLBR, 0);
+
+       udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
+       uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
+
+       /*
+        * MCK and CPU derive from one of those primary clocks.
+        * For now, assume this parentage won't change.
+        */
+       mckr = at91_sys_read(AT91_PMC_MCKR);
+       mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS);
+       freq = mck.parent->rate_hz;
+       freq /= (1 << ((mckr >> 2) & 3));               /* prescale */
+       mck.rate_hz = freq / (1 + ((mckr >> 8) & 3));   /* mdiv */
+
+       /* Register the PMC's standard clocks */
+       for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++)
+               list_add_tail(&standard_pmc_clocks[i]->node, &clocks);
+
+       /* MCK and CPU clock are "always on" */
+       clk_enable(&mck);
+
+       printk("Clocks: CPU %u MHz, master %u MHz, main %u.%03u MHz\n",
+               freq / 1000000, (unsigned) mck.rate_hz / 1000000,
+               (unsigned) main_clock / 1000000,
+               ((unsigned) main_clock % 1000000) / 1000);
+
+       return 0;
+}
+
+/*
+ * Several unused clocks may be active.  Turn them off.
+ */
+static int __init at91_clock_reset(void)
+{
+       unsigned long pcdr = 0;
+       unsigned long scdr = 0;
+       struct clk *clk;
+
+       list_for_each_entry(clk, &clocks, node) {
+               if (clk->users > 0)
+                       continue;
+
+               if (clk->mode == pmc_periph_mode)
+                       pcdr |= clk->pmc_mask;
+
+               if (clk->mode == pmc_sys_mode)
+                       scdr |= clk->pmc_mask;
+
+               pr_debug("Clocks: disable unused %s\n", clk->name);
+       }
+
+       at91_sys_write(AT91_PMC_PCDR, pcdr);
+       at91_sys_write(AT91_PMC_SCDR, scdr);
+
+       return 0;
+}
+late_initcall(at91_clock_reset);
diff --git a/arch/arm/mach-at91/clock.h b/arch/arm/mach-at91/clock.h
new file mode 100644 (file)
index 0000000..1ba3b95
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * linux/arch/arm/mach-at91/clock.h
+ *
+ * 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 CLK_TYPE_PRIMARY       0x1
+#define CLK_TYPE_PLL           0x2
+#define CLK_TYPE_PROGRAMMABLE  0x4
+#define CLK_TYPE_PERIPHERAL    0x8
+#define CLK_TYPE_SYSTEM                0x10
+
+
+struct clk {
+       struct list_head node;
+       const char      *name;          /* unique clock name */
+       const char      *function;      /* function of the clock */
+       struct device   *dev;           /* device associated with function */
+       unsigned long   rate_hz;
+       struct clk      *parent;
+       u32             pmc_mask;
+       void            (*mode)(struct clk *, int);
+       unsigned        id:2;           /* PCK0..3, or 32k/main/a/b */
+       unsigned        type;           /* clock type */
+       u16             users;
+};
+
+
+extern int __init clk_register(struct clk *clk);
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
new file mode 100644 (file)
index 0000000..bda2622
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * linux/arch/arm/mach-at91/generic.h
+ *
+ *  Copyright (C) 2005 David Brownell
+ *
+ * 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.
+ */
+
+ /* Processors */
+extern void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks);
+extern void __init at91sam9260_initialize(unsigned long main_clock);
+extern void __init at91sam9261_initialize(unsigned long main_clock);
+extern void __init at91sam9263_initialize(unsigned long main_clock);
+
+ /* Interrupts */
+extern void __init at91rm9200_init_interrupts(unsigned int priority[]);
+extern void __init at91sam9260_init_interrupts(unsigned int priority[]);
+extern void __init at91sam9261_init_interrupts(unsigned int priority[]);
+extern void __init at91sam9263_init_interrupts(unsigned int priority[]);
+extern void __init at91_aic_init(unsigned int priority[]);
+
+ /* Timer */
+struct sys_timer;
+extern struct sys_timer at91rm9200_timer;
+extern struct sys_timer at91sam926x_timer;
+
+ /* Clocks */
+extern int __init at91_clock_init(unsigned long main_clock);
+struct device;
+extern void __init at91_clock_associate(const char *id, struct device *dev, const char *func);
+
+ /* Power Management */
+extern void at91_irq_suspend(void);
+extern void at91_irq_resume(void);
+
+ /* GPIO */
+#define AT91RM9200_PQFP                3       /* AT91RM9200 PQFP package has 3 banks */
+#define AT91RM9200_BGA         4       /* AT91RM9200 BGA package has 4 banks */
+
+struct at91_gpio_bank {
+       unsigned short id;              /* peripheral ID */
+       unsigned long offset;           /* offset from system peripheral base */
+       struct clk *clock;              /* associated clock */
+};
+extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks);
+extern void __init at91_gpio_irq_setup(void);
+
+extern void (*at91_arch_reset)(void);
+extern int at91_extern_irq;
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
new file mode 100644 (file)
index 0000000..7b87f3f
--- /dev/null
@@ -0,0 +1,462 @@
+/*
+ * linux/arch/arm/mach-at91/gpio.c
+ *
+ * Copyright (C) 2005 HP Labs
+ *
+ * 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/clk.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/module.h>
+
+#include <asm/io.h>
+#include <asm/hardware.h>
+#include <asm/arch/at91_pio.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+static struct at91_gpio_bank *gpio;
+static int gpio_banks;
+
+
+static inline void __iomem *pin_to_controller(unsigned pin)
+{
+       void __iomem *sys_base = (void __iomem *) AT91_VA_BASE_SYS;
+
+       pin -= PIN_BASE;
+       pin /= 32;
+       if (likely(pin < gpio_banks))
+               return sys_base + gpio[pin].offset;
+
+       return NULL;
+}
+
+static inline unsigned pin_to_mask(unsigned pin)
+{
+       pin -= PIN_BASE;
+       return 1 << (pin % 32);
+}
+
+
+/*--------------------------------------------------------------------------*/
+
+/* Not all hardware capabilities are exposed through these calls; they
+ * only encapsulate the most common features and modes.  (So if you
+ * want to change signals in groups, do it directly.)
+ *
+ * Bootloaders will usually handle some of the pin multiplexing setup.
+ * The intent is certainly that by the time Linux is fully booted, all
+ * pins should have been fully initialized.  These setup calls should
+ * only be used by board setup routines, or possibly in driver probe().
+ *
+ * For bootloaders doing all that setup, these calls could be inlined
+ * as NOPs so Linux won't duplicate any setup code
+ */
+
+
+/*
+ * mux the pin to the "GPIO" peripheral role.
+ */
+int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio)
+               return -EINVAL;
+       __raw_writel(mask, pio + PIO_IDR);
+       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
+       __raw_writel(mask, pio + PIO_PER);
+       return 0;
+}
+EXPORT_SYMBOL(at91_set_GPIO_periph);
+
+
+/*
+ * mux the pin to the "A" internal peripheral role.
+ */
+int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio)
+               return -EINVAL;
+
+       __raw_writel(mask, pio + PIO_IDR);
+       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
+       __raw_writel(mask, pio + PIO_ASR);
+       __raw_writel(mask, pio + PIO_PDR);
+       return 0;
+}
+EXPORT_SYMBOL(at91_set_A_periph);
+
+
+/*
+ * mux the pin to the "B" internal peripheral role.
+ */
+int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio)
+               return -EINVAL;
+
+       __raw_writel(mask, pio + PIO_IDR);
+       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
+       __raw_writel(mask, pio + PIO_BSR);
+       __raw_writel(mask, pio + PIO_PDR);
+       return 0;
+}
+EXPORT_SYMBOL(at91_set_B_periph);
+
+
+/*
+ * mux the pin to the gpio controller (instead of "A" or "B" peripheral), and
+ * configure it for an input.
+ */
+int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio)
+               return -EINVAL;
+
+       __raw_writel(mask, pio + PIO_IDR);
+       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
+       __raw_writel(mask, pio + PIO_ODR);
+       __raw_writel(mask, pio + PIO_PER);
+       return 0;
+}
+EXPORT_SYMBOL(at91_set_gpio_input);
+
+
+/*
+ * mux the pin to the gpio controller (instead of "A" or "B" peripheral),
+ * and configure it for an output.
+ */
+int __init_or_module at91_set_gpio_output(unsigned pin, int value)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio)
+               return -EINVAL;
+
+       __raw_writel(mask, pio + PIO_IDR);
+       __raw_writel(mask, pio + PIO_PUDR);
+       __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
+       __raw_writel(mask, pio + PIO_OER);
+       __raw_writel(mask, pio + PIO_PER);
+       return 0;
+}
+EXPORT_SYMBOL(at91_set_gpio_output);
+
+
+/*
+ * enable/disable the glitch filter; mostly used with IRQ handling.
+ */
+int __init_or_module at91_set_deglitch(unsigned pin, int is_on)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio)
+               return -EINVAL;
+       __raw_writel(mask, pio + (is_on ? PIO_IFER : PIO_IFDR));
+       return 0;
+}
+EXPORT_SYMBOL(at91_set_deglitch);
+
+/*
+ * enable/disable the multi-driver; This is only valid for output and
+ * allows the output pin to run as an open collector output.
+ */
+int __init_or_module at91_set_multi_drive(unsigned pin, int is_on)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio)
+               return -EINVAL;
+
+       __raw_writel(mask, pio + (is_on ? PIO_MDER : PIO_MDDR));
+       return 0;
+}
+EXPORT_SYMBOL(at91_set_multi_drive);
+
+/*--------------------------------------------------------------------------*/
+
+/* new-style GPIO calls; these expect at91_set_GPIO_periph to have been
+ * called, and maybe at91_set_multi_drive() for putout pins.
+ */
+
+int gpio_direction_input(unsigned pin)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio || !(__raw_readl(pio + PIO_PSR) & mask))
+               return -EINVAL;
+       __raw_writel(mask, pio + PIO_OER);
+       return 0;
+}
+EXPORT_SYMBOL(gpio_direction_input);
+
+int gpio_direction_output(unsigned pin)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio || !(__raw_readl(pio + PIO_PSR) & mask))
+               return -EINVAL;
+       __raw_writel(mask, pio + PIO_OER);
+       return 0;
+}
+EXPORT_SYMBOL(gpio_direction_output);
+
+/*--------------------------------------------------------------------------*/
+
+/*
+ * assuming the pin is muxed as a gpio output, set its value.
+ */
+int at91_set_gpio_value(unsigned pin, int value)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio)
+               return -EINVAL;
+       __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
+       return 0;
+}
+EXPORT_SYMBOL(at91_set_gpio_value);
+
+
+/*
+ * read the pin's value (works even if it's not muxed as a gpio).
+ */
+int at91_get_gpio_value(unsigned pin)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+       u32             pdsr;
+
+       if (!pio)
+               return -EINVAL;
+       pdsr = __raw_readl(pio + PIO_PDSR);
+       return (pdsr & mask) != 0;
+}
+EXPORT_SYMBOL(at91_get_gpio_value);
+
+/*--------------------------------------------------------------------------*/
+
+#ifdef CONFIG_PM
+
+static u32 wakeups[MAX_GPIO_BANKS];
+static u32 backups[MAX_GPIO_BANKS];
+
+static int gpio_irq_set_wake(unsigned pin, unsigned state)
+{
+       unsigned        mask = pin_to_mask(pin);
+       unsigned        bank = (pin - PIN_BASE) / 32;
+
+       if (unlikely(bank >= MAX_GPIO_BANKS))
+               return -EINVAL;
+
+       if (state)
+               wakeups[bank] |= mask;
+       else
+               wakeups[bank] &= ~mask;
+
+       set_irq_wake(gpio[bank].id, state);
+
+       return 0;
+}
+
+void at91_gpio_suspend(void)
+{
+       int i;
+
+       for (i = 0; i < gpio_banks; i++) {
+               u32 pio = gpio[i].offset;
+
+               backups[i] = at91_sys_read(pio + PIO_IMR);
+               at91_sys_write(pio + PIO_IDR, backups[i]);
+               at91_sys_write(pio + PIO_IER, wakeups[i]);
+
+               if (!wakeups[i])
+                       clk_disable(gpio[i].clock);
+               else {
+#ifdef CONFIG_PM_DEBUG
+                       printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", 'A'+i, wakeups[i]);
+#endif
+               }
+       }
+}
+
+void at91_gpio_resume(void)
+{
+       int i;
+
+       for (i = 0; i < gpio_banks; i++) {
+               u32 pio = gpio[i].offset;
+
+               if (!wakeups[i])
+                       clk_enable(gpio[i].clock);
+
+               at91_sys_write(pio + PIO_IDR, wakeups[i]);
+               at91_sys_write(pio + PIO_IER, backups[i]);
+       }
+}
+
+#else
+#define gpio_irq_set_wake      NULL
+#endif
+
+
+/* Several AIC controller irqs are dispatched through this GPIO handler.
+ * To use any AT91_PIN_* as an externally triggered IRQ, first call
+ * at91_set_gpio_input() then maybe enable its glitch filter.
+ * Then just request_irq() with the pin ID; it works like any ARM IRQ
+ * handler, though it always triggers on rising and falling edges.
+ *
+ * Alternatively, certain pins may be used directly as IRQ0..IRQ6 after
+ * configuring them with at91_set_a_periph() or at91_set_b_periph().
+ * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering.
+ */
+
+static void gpio_irq_mask(unsigned pin)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (pio)
+               __raw_writel(mask, pio + PIO_IDR);
+}
+
+static void gpio_irq_unmask(unsigned pin)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (pio)
+               __raw_writel(mask, pio + PIO_IER);
+}
+
+static int gpio_irq_type(unsigned pin, unsigned type)
+{
+       return (type == IRQT_BOTHEDGE) ? 0 : -EINVAL;
+}
+
+static struct irq_chip gpio_irqchip = {
+       .name           = "GPIO",
+       .mask           = gpio_irq_mask,
+       .unmask         = gpio_irq_unmask,
+       .set_type       = gpio_irq_type,
+       .set_wake       = gpio_irq_set_wake,
+};
+
+static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+{
+       unsigned        pin;
+       struct irq_desc *gpio;
+       void __iomem    *pio;
+       u32             isr;
+
+       pio = get_irq_chip_data(irq);
+
+       /* temporarily mask (level sensitive) parent IRQ */
+       desc->chip->ack(irq);
+       for (;;) {
+               /* reading ISR acks the pending (edge triggered) GPIO interrupt */
+               isr = __raw_readl(pio + PIO_ISR) & __raw_readl(pio + PIO_IMR);
+               if (!isr)
+                       break;
+
+               pin = (unsigned) get_irq_data(irq);
+               gpio = &irq_desc[pin];
+
+               while (isr) {
+                       if (isr & 1) {
+                               if (unlikely(gpio->depth)) {
+                                       /*
+                                        * The core ARM interrupt handler lazily disables IRQs so
+                                        * another IRQ must be generated before it actually gets
+                                        * here to be disabled on the GPIO controller.
+                                        */
+                                       gpio_irq_mask(pin);
+                               }
+                               else
+                                       desc_handle_irq(pin, gpio);
+                       }
+                       pin++;
+                       gpio++;
+                       isr >>= 1;
+               }
+       }
+       desc->chip->unmask(irq);
+       /* now it may re-trigger */
+}
+
+/*--------------------------------------------------------------------------*/
+
+/*
+ * Called from the processor-specific init to enable GPIO interrupt support.
+ */
+void __init at91_gpio_irq_setup(void)
+{
+       unsigned        pioc, pin;
+
+       for (pioc = 0, pin = PIN_BASE;
+                       pioc < gpio_banks;
+                       pioc++) {
+               void __iomem    *controller;
+               unsigned        id = gpio[pioc].id;
+               unsigned        i;
+
+               clk_enable(gpio[pioc].clock);   /* enable PIO controller's clock */
+
+               controller = (void __iomem *) AT91_VA_BASE_SYS + gpio[pioc].offset;
+               __raw_writel(~0, controller + PIO_IDR);
+
+               set_irq_data(id, (void *) pin);
+               set_irq_chip_data(id, controller);
+
+               for (i = 0; i < 32; i++, pin++) {
+                       /*
+                        * Can use the "simple" and not "edge" handler since it's
+                        * shorter, and the AIC handles interupts sanely.
+                        */
+                       set_irq_chip(pin, &gpio_irqchip);
+                       set_irq_handler(pin, handle_simple_irq);
+                       set_irq_flags(pin, IRQF_VALID);
+               }
+
+               set_irq_chained_handler(id, gpio_irq_handler);
+       }
+       pr_info("AT91: %d gpio irqs in %d banks\n", pin - PIN_BASE, gpio_banks);
+}
+
+/*
+ * Called from the processor-specific init to enable GPIO pin support.
+ */
+void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks)
+{
+       BUG_ON(nr_banks > MAX_GPIO_BANKS);
+
+       gpio = data;
+       gpio_banks = nr_banks;
+}
diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c
new file mode 100644 (file)
index 0000000..78a5cdb
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * linux/arch/arm/mach-at91/irq.c
+ *
+ *  Copyright (C) 2004 SAN People
+ *  Copyright (C) 2004 ATMEL
+ *  Copyright (C) Rick Bronson
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/mm.h>
+#include <linux/types.h>
+
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/setup.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/irq.h>
+#include <asm/mach/map.h>
+
+
+static void at91_aic_mask_irq(unsigned int irq)
+{
+       /* Disable interrupt on AIC */
+       at91_sys_write(AT91_AIC_IDCR, 1 << irq);
+}
+
+static void at91_aic_unmask_irq(unsigned int irq)
+{
+       /* Enable interrupt on AIC */
+       at91_sys_write(AT91_AIC_IECR, 1 << irq);
+}
+
+unsigned int at91_extern_irq;
+
+#define is_extern_irq(irq) ((1 << (irq)) & at91_extern_irq)
+
+static int at91_aic_set_type(unsigned irq, unsigned type)
+{
+       unsigned int smr, srctype;
+
+       switch (type) {
+       case IRQT_HIGH:
+               srctype = AT91_AIC_SRCTYPE_HIGH;
+               break;
+       case IRQT_RISING:
+               srctype = AT91_AIC_SRCTYPE_RISING;
+               break;
+       case IRQT_LOW:
+               if ((irq == AT91_ID_FIQ) || is_extern_irq(irq))         /* only supported on external interrupts */
+                       srctype = AT91_AIC_SRCTYPE_LOW;
+               else
+                       return -EINVAL;
+               break;
+       case IRQT_FALLING:
+               if ((irq == AT91_ID_FIQ) || is_extern_irq(irq))         /* only supported on external interrupts */
+                       srctype = AT91_AIC_SRCTYPE_FALLING;
+               else
+                       return -EINVAL;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       smr = at91_sys_read(AT91_AIC_SMR(irq)) & ~AT91_AIC_SRCTYPE;
+       at91_sys_write(AT91_AIC_SMR(irq), smr | srctype);
+       return 0;
+}
+
+#ifdef CONFIG_PM
+
+static u32 wakeups;
+static u32 backups;
+
+static int at91_aic_set_wake(unsigned irq, unsigned value)
+{
+       if (unlikely(irq >= 32))
+               return -EINVAL;
+
+       if (value)
+               wakeups |= (1 << irq);
+       else
+               wakeups &= ~(1 << irq);
+
+       return 0;
+}
+
+void at91_irq_suspend(void)
+{
+       backups = at91_sys_read(AT91_AIC_IMR);
+       at91_sys_write(AT91_AIC_IDCR, backups);
+       at91_sys_write(AT91_AIC_IECR, wakeups);
+}
+
+void at91_irq_resume(void)
+{
+       at91_sys_write(AT91_AIC_IDCR, wakeups);
+       at91_sys_write(AT91_AIC_IECR, backups);
+}
+
+#else
+#define at91_aic_set_wake      NULL
+#endif
+
+static struct irq_chip at91_aic_chip = {
+       .name           = "AIC",
+       .ack            = at91_aic_mask_irq,
+       .mask           = at91_aic_mask_irq,
+       .unmask         = at91_aic_unmask_irq,
+       .set_type       = at91_aic_set_type,
+       .set_wake       = at91_aic_set_wake,
+};
+
+/*
+ * Initialize the AIC interrupt controller.
+ */
+void __init at91_aic_init(unsigned int priority[NR_AIC_IRQS])
+{
+       unsigned int i;
+
+       /*
+        * The IVR is used by macro get_irqnr_and_base to read and verify.
+        * The irq number is NR_AIC_IRQS when a spurious interrupt has occurred.
+        */
+       for (i = 0; i < NR_AIC_IRQS; i++) {
+               /* Put irq number in Source Vector Register: */
+               at91_sys_write(AT91_AIC_SVR(i), i);
+               /* Active Low interrupt, with the specified priority */
+               at91_sys_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]);
+
+               set_irq_chip(i, &at91_aic_chip);
+               set_irq_handler(i, handle_level_irq);
+               set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
+
+               /* Perform 8 End Of Interrupt Command to make sure AIC will not Lock out nIRQ */
+               if (i < 8)
+                       at91_sys_write(AT91_AIC_EOICR, 0);
+       }
+
+       /*
+        * Spurious Interrupt ID in Spurious Vector Register is NR_AIC_IRQS
+        * When there is no current interrupt, the IRQ Vector Register reads the value stored in AIC_SPU
+        */
+       at91_sys_write(AT91_AIC_SPU, NR_AIC_IRQS);
+
+       /* No debugging in AIC: Debug (Protect) Control Register */
+       at91_sys_write(AT91_AIC_DCR, 0);
+
+       /* Disable and clear all interrupts initially */
+       at91_sys_write(AT91_AIC_IDCR, 0xFFFFFFFF);
+       at91_sys_write(AT91_AIC_ICCR, 0xFFFFFFFF);
+}
diff --git a/arch/arm/mach-at91/leds.c b/arch/arm/mach-at91/leds.c
new file mode 100644 (file)
index 0000000..0d51449
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * LED driver for Atmel AT91-based boards.
+ *
+ *  Copyright (C) SAN People (Pty) Ltd
+ *
+ * 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/module.h>
+#include <linux/init.h>
+
+#include <asm/mach-types.h>
+#include <asm/leds.h>
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+
+static inline void at91_led_on(unsigned int led)
+{
+       at91_set_gpio_value(led, 0);
+}
+
+static inline void at91_led_off(unsigned int led)
+{
+       at91_set_gpio_value(led, 1);
+}
+
+static inline void at91_led_toggle(unsigned int led)
+{
+       unsigned long is_off = at91_get_gpio_value(led);
+       if (is_off)
+               at91_led_on(led);
+       else
+               at91_led_off(led);
+}
+
+
+/*
+ * Handle LED events.
+ */
+static void at91_leds_event(led_event_t evt)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+
+       switch(evt) {
+       case led_start:         /* System startup */
+               at91_led_on(at91_leds_cpu);
+               break;
+
+       case led_stop:          /* System stop / suspend */
+               at91_led_off(at91_leds_cpu);
+               break;
+
+#ifdef CONFIG_LEDS_TIMER
+       case led_timer:         /* Every 50 timer ticks */
+               at91_led_toggle(at91_leds_timer);
+               break;
+#endif
+
+#ifdef CONFIG_LEDS_CPU
+       case led_idle_start:    /* Entering idle state */
+               at91_led_off(at91_leds_cpu);
+               break;
+
+       case led_idle_end:      /* Exit idle state */
+               at91_led_on(at91_leds_cpu);
+               break;
+#endif
+
+       default:
+               break;
+       }
+
+       local_irq_restore(flags);
+}
+
+
+static int __init leds_init(void)
+{
+       if (!at91_leds_timer || !at91_leds_cpu)
+               return -ENODEV;
+
+       leds_event = at91_leds_event;
+
+       leds_event(led_start);
+       return 0;
+}
+
+__initcall(leds_init);
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
new file mode 100644 (file)
index 0000000..b49bfda
--- /dev/null
@@ -0,0 +1,229 @@
+/*
+ * arch/arm/mach-at91/pm.c
+ * AT91 Power Management
+ *
+ * Copyright (C) 2005 David Brownell
+ *
+ * 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/pm.h>
+#include <linux/sched.h>
+#include <linux/proc_fs.h>
+#include <linux/pm.h>
+#include <linux/interrupt.h>
+#include <linux/sysfs.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/atomic.h>
+#include <asm/mach/time.h>
+#include <asm/mach/irq.h>
+#include <asm/mach-types.h>
+
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91rm9200_mc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/cpu.h>
+
+#include "generic.h"
+
+
+static int at91_pm_valid_state(suspend_state_t state)
+{
+       switch (state) {
+               case PM_SUSPEND_ON:
+               case PM_SUSPEND_STANDBY:
+               case PM_SUSPEND_MEM:
+                       return 1;
+
+               default:
+                       return 0;
+       }
+}
+
+
+static suspend_state_t target_state;
+
+/*
+ * Called after processes are frozen, but before we shutdown devices.
+ */
+static int at91_pm_prepare(suspend_state_t state)
+{
+       target_state = state;
+       return 0;
+}
+
+/*
+ * Verify that all the clocks are correct before entering
+ * slow-clock mode.
+ */
+static int at91_pm_verify_clocks(void)
+{
+       unsigned long scsr;
+       int i;
+
+       scsr = at91_sys_read(AT91_PMC_SCSR);
+
+       /* USB must not be using PLLB */
+       if (cpu_is_at91rm9200()) {
+               if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) {
+                       pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n");
+                       return 0;
+               }
+       } else if (cpu_is_at91sam9260()) {
+#warning "Check SAM9260 USB clocks"
+       } else if (cpu_is_at91sam9261()) {
+#warning "Check SAM9261 USB clocks"
+       } else if (cpu_is_at91sam9263()) {
+#warning "Check SAM9263 USB clocks"
+       }
+
+#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
+       /* PCK0..PCK3 must be disabled, or configured to use clk32k */
+       for (i = 0; i < 4; i++) {
+               u32 css;
+
+               if ((scsr & (AT91_PMC_PCK0 << i)) == 0)
+                       continue;
+
+               css = at91_sys_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS;
+               if (css != AT91_PMC_CSS_SLOW) {
+                       pr_debug("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css);
+                       return 0;
+               }
+       }
+#endif
+
+       return 1;
+}
+
+/*
+ * Call this from platform driver suspend() to see how deeply to suspend.
+ * For example, some controllers (like OHCI) need one of the PLL clocks
+ * in order to act as a wakeup source, and those are not available when
+ * going into slow clock mode.
+ *
+ * REVISIT: generalize as clk_will_be_available(clk)?  Other platforms have
+ * the very same problem (but not using at91 main_clk), and it'd be better
+ * to add one generic API rather than lots of platform-specific ones.
+ */
+int at91_suspend_entering_slow_clock(void)
+{
+       return (target_state == PM_SUSPEND_MEM);
+}
+EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
+
+
+static void (*slow_clock)(void);
+
+
+static int at91_pm_enter(suspend_state_t state)
+{
+       at91_gpio_suspend();
+       at91_irq_suspend();
+
+       pr_debug("AT91: PM - wake mask %08x, pm state %d\n",
+                       /* remember all the always-wake irqs */
+                       (at91_sys_read(AT91_PMC_PCSR)
+                                       | (1 << AT91_ID_FIQ)
+                                       | (1 << AT91_ID_SYS)
+                                       | (at91_extern_irq))
+                               & at91_sys_read(AT91_AIC_IMR),
+                       state);
+
+       switch (state) {
+               /*
+                * Suspend-to-RAM is like STANDBY plus slow clock mode, so
+                * drivers must suspend more deeply:  only the master clock
+                * controller may be using the main oscillator.
+                */
+               case PM_SUSPEND_MEM:
+                       /*
+                        * Ensure that clocks are in a valid state.
+                        */
+                       if (!at91_pm_verify_clocks())
+                               goto error;
+
+                       /*
+                        * Enter slow clock mode by switching over to clk32k and
+                        * turning off the main oscillator; reverse on wakeup.
+                        */
+                       if (slow_clock) {
+                               slow_clock();
+                               break;
+                       } else {
+                               /* DEVELOPMENT ONLY */
+                               pr_info("AT91: PM - no slow clock mode yet ...\n");
+                               /* FALLTHROUGH leaving master clock alone */
+                       }
+
+               /*
+                * STANDBY mode has *all* drivers suspended; ignores irqs not
+                * marked as 'wakeup' event sources; and reduces DRAM power.
+                * But otherwise it's identical to PM_SUSPEND_ON:  cpu idle, and
+                * nothing fancy done with main or cpu clocks.
+                */
+               case PM_SUSPEND_STANDBY:
+                       /*
+                        * NOTE: the Wait-for-Interrupt instruction needs to be
+                        * in icache so the SDRAM stays in self-refresh mode until
+                        * the wakeup IRQ occurs.
+                        */
+                       asm("b 1f; .align 5; 1:");
+                       asm("mcr p15, 0, r0, c7, c10, 4");      /* drain write buffer */
+                       at91_sys_write(AT91_SDRAMC_SRR, 1);     /* self-refresh mode */
+                       /* fall though to next state */
+
+               case PM_SUSPEND_ON:
+                       asm("mcr p15, 0, r0, c7, c0, 4");       /* wait for interrupt */
+                       break;
+
+               default:
+                       pr_debug("AT91: PM - bogus suspend state %d\n", state);
+                       goto error;
+       }
+
+       pr_debug("AT91: PM - wakeup %08x\n",
+                       at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR));
+
+error:
+       target_state = PM_SUSPEND_ON;
+       at91_irq_resume();
+       at91_gpio_resume();
+       return 0;
+}
+
+
+static struct pm_ops at91_pm_ops ={
+       .pm_disk_mode   = 0,
+       .valid          = at91_pm_valid_state,
+       .prepare        = at91_pm_prepare,
+       .enter          = at91_pm_enter,
+};
+
+static int __init at91_pm_init(void)
+{
+       printk("AT91: Power Management\n");
+
+#ifdef CONFIG_AT91_PM_SLOW_CLOCK
+       /* REVISIT allocations of SRAM should be dynamically managed.
+        * FIQ handlers and other components will want SRAM/TCM too...
+        */
+       slow_clock = (void *) (AT91_VA_BASE_SRAM + (3 * SZ_4K));
+       memcpy(slow_clock, at91rm9200_slow_clock, at91rm9200_slow_clock_sz);
+#endif
+
+       /* Disable SDRAM low-power mode.  Cannot be used with self-refresh. */
+       at91_sys_write(AT91_SDRAMC_LPR, 0);
+
+       pm_set_ops(&at91_pm_ops);
+
+       return 0;
+}
+arch_initcall(at91_pm_init);
diff --git a/arch/arm/mach-at91rm9200/Kconfig b/arch/arm/mach-at91rm9200/Kconfig
deleted file mode 100644 (file)
index 9f11db8..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-if ARCH_AT91
-
-menu "Atmel AT91 System-on-Chip"
-
-choice
-       prompt "Atmel AT91 Processor"
-
-config ARCH_AT91RM9200
-       bool "AT91RM9200"
-
-config ARCH_AT91SAM9260
-       bool "AT91SAM9260"
-
-config ARCH_AT91SAM9261
-       bool "AT91SAM9261"
-
-endchoice
-
-# ----------------------------------------------------------
-
-if ARCH_AT91RM9200
-
-comment "AT91RM9200 Board Type"
-
-config MACH_ONEARM
-       bool "Ajeco 1ARM Single Board Computer"
-       depends on ARCH_AT91RM9200
-       help
-         Select this if you are using Ajeco's 1ARM Single Board Computer.
-         <http://www.ajeco.fi/products.htm>
-
-config ARCH_AT91RM9200DK
-       bool "Atmel AT91RM9200-DK Development board"
-       depends on ARCH_AT91RM9200
-       help
-         Select this if you are using Atmel's AT91RM9200-DK Development board.
-         (Discontinued)
-
-config MACH_AT91RM9200EK
-       bool "Atmel AT91RM9200-EK Evaluation Kit"
-       depends on ARCH_AT91RM9200
-       help
-         Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
-         <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507>
-
-config MACH_CSB337
-       bool "Cogent CSB337"
-       depends on ARCH_AT91RM9200
-       help
-         Select this if you are using Cogent's CSB337 board.
-         <http://www.cogcomp.com/csb_csb337.htm>
-
-config MACH_CSB637
-       bool "Cogent CSB637"
-       depends on ARCH_AT91RM9200
-       help
-         Select this if you are using Cogent's CSB637 board.
-         <http://www.cogcomp.com/csb_csb637.htm>
-
-config MACH_CARMEVA
-       bool "Conitec ARM&EVA"
-       depends on ARCH_AT91RM9200
-       help
-         Select this if you are using Conitec's AT91RM9200-MCU-Module.
-         <http://www.conitec.net/english/linuxboard.htm>
-
-config MACH_ATEB9200
-       bool "Embest ATEB9200"
-       depends on ARCH_AT91RM9200
-       help
-         Select this if you are using Embest's ATEB9200 board.
-         <http://www.embedinfo.com/english/product/ATEB9200.asp>
-
-config MACH_KB9200
-       bool "KwikByte KB920x"
-       depends on ARCH_AT91RM9200
-       help
-         Select this if you are using KwikByte's KB920x board.
-         <http://kwikbyte.com/KB9202_description_new.htm>
-
-config MACH_KAFA
-       bool "Sperry-Sun KAFA board"
-       depends on ARCH_AT91RM9200
-       help
-         Select this if you are using Sperry-Sun's KAFA board.
-
-endif
-
-# ----------------------------------------------------------
-
-if ARCH_AT91SAM9260
-
-comment "AT91SAM9260 Board Type"
-
-config MACH_AT91SAM9260EK
-       bool "Atmel AT91SAM9260-EK Evaluation Kit"
-       depends on ARCH_AT91SAM9260
-       help
-         Select this if you are using Atmel's AT91SAM9260-EK Evaluation Kit.
-         <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
-
-endif
-
-# ----------------------------------------------------------
-
-if ARCH_AT91SAM9261
-
-comment "AT91SAM9261 Board Type"
-
-config MACH_AT91SAM9261EK
-       bool "Atmel AT91SAM9261-EK Evaluation Kit"
-       depends on ARCH_AT91SAM9261
-       help
-         Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
-         <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
-
-endif
-
-# ----------------------------------------------------------
-
-comment "AT91 Board Options"
-
-config MTD_AT91_DATAFLASH_CARD
-       bool "Enable DataFlash Card support"
-       depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK)
-       help
-         Enable support for the DataFlash card.
-
-config MTD_NAND_AT91_BUSWIDTH_16
-       bool "Enable 16-bit data bus interface to NAND flash"
-       depends on (MACH_AT91SAM9261EK || MACH_AT91SAM9260EK)
-       help
-         On AT91SAM926x boards both types of NAND flash can be present
-         (8 and 16 bit data bus width).
-
-# ----------------------------------------------------------
-
-comment "AT91 Feature Selections"
-
-config AT91_PROGRAMMABLE_CLOCKS
-       bool "Programmable Clocks"
-       help
-         Select this if you need to program one or more of the PCK0..PCK3
-         programmable clock outputs.
-
-endmenu
-
-endif
diff --git a/arch/arm/mach-at91rm9200/Makefile b/arch/arm/mach-at91rm9200/Makefile
deleted file mode 100644 (file)
index cf77700..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Makefile for the linux kernel.
-#
-
-obj-y          := clock.o irq.o gpio.o
-obj-m          :=
-obj-n          :=
-obj-           :=
-
-obj-$(CONFIG_PM)               += pm.o
-
-# CPU-specific support
-obj-$(CONFIG_ARCH_AT91RM9200)  += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o
-obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o
-obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o
-
-# AT91RM9200 board-specific support
-obj-$(CONFIG_MACH_ONEARM)      += board-1arm.o
-obj-$(CONFIG_ARCH_AT91RM9200DK)        += board-dk.o
-obj-$(CONFIG_MACH_AT91RM9200EK)        += board-ek.o
-obj-$(CONFIG_MACH_CSB337)      += board-csb337.o
-obj-$(CONFIG_MACH_CSB637)      += board-csb637.o
-obj-$(CONFIG_MACH_CARMEVA)     += board-carmeva.o
-obj-$(CONFIG_MACH_KB9200)      += board-kb9202.o
-obj-$(CONFIG_MACH_ATEB9200)    += board-eb9200.o
-obj-$(CONFIG_MACH_KAFA)                += board-kafa.o
-
-# AT91SAM9260 board-specific support
-obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
-
-# AT91SAM9261 board-specific support
-obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o
-
-# LEDs support
-led-$(CONFIG_ARCH_AT91RM9200DK)        += leds.o
-led-$(CONFIG_MACH_AT91RM9200EK)        += leds.o
-led-$(CONFIG_MACH_CSB337)      += leds.o
-led-$(CONFIG_MACH_CSB637)      += leds.o
-led-$(CONFIG_MACH_KB9200)      += leds.o
-led-$(CONFIG_MACH_KAFA)                += leds.o
-obj-$(CONFIG_LEDS) += $(led-y)
-
-# VGA support
-#obj-$(CONFIG_FB_S1D13XXX)     += ics1523.o
-
-
-ifeq ($(CONFIG_PM_DEBUG),y)
-CFLAGS_pm.o += -DDEBUG
-endif
diff --git a/arch/arm/mach-at91rm9200/Makefile.boot b/arch/arm/mach-at91rm9200/Makefile.boot
deleted file mode 100644 (file)
index e667dcc..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# Note: the following conditions must always be true:
-#   ZRELADDR == virt_to_phys(TEXTADDR)
-#   PARAMS_PHYS must be within 4MB of ZRELADDR
-#   INITRD_PHYS must be in RAM
-
-   zreladdr-y  := 0x20008000
-params_phys-y  := 0x20000100
-initrd_phys-y  := 0x20410000
-
diff --git a/arch/arm/mach-at91rm9200/at91rm9200.c b/arch/arm/mach-at91rm9200/at91rm9200.c
deleted file mode 100644 (file)
index a92e9a4..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * arch/arm/mach-at91rm9200/at91rm9200.c
- *
- *  Copyright (C) 2005 SAN People
- *
- * 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/module.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/arch/at91rm9200.h>
-#include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_st.h>
-
-#include "generic.h"
-#include "clock.h"
-
-static struct map_desc at91rm9200_io_desc[] __initdata = {
-       {
-               .virtual        = AT91_VA_BASE_SYS,
-               .pfn            = __phys_to_pfn(AT91_BASE_SYS),
-               .length         = SZ_4K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_EMAC,
-               .pfn            = __phys_to_pfn(AT91RM9200_BASE_EMAC),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_IO_VIRT_BASE - AT91RM9200_SRAM_SIZE,
-               .pfn            = __phys_to_pfn(AT91RM9200_SRAM_BASE),
-               .length         = AT91RM9200_SRAM_SIZE,
-               .type           = MT_DEVICE,
-       },
-};
-
-/* --------------------------------------------------------------------
- *  Clocks
- * -------------------------------------------------------------------- */
-
-/*
- * The peripheral clocks.
- */
-static struct clk udc_clk = {
-       .name           = "udc_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_UDP,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk ohci_clk = {
-       .name           = "ohci_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_UHP,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk ether_clk = {
-       .name           = "ether_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_EMAC,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk mmc_clk = {
-       .name           = "mci_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_MCI,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk twi_clk = {
-       .name           = "twi_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_TWI,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart0_clk = {
-       .name           = "usart0_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_US0,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart1_clk = {
-       .name           = "usart1_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_US1,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart2_clk = {
-       .name           = "usart2_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_US2,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart3_clk = {
-       .name           = "usart3_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_US3,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk spi_clk = {
-       .name           = "spi_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_SPI,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioA_clk = {
-       .name           = "pioA_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_PIOA,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioB_clk = {
-       .name           = "pioB_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_PIOB,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioC_clk = {
-       .name           = "pioC_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_PIOC,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioD_clk = {
-       .name           = "pioD_clk",
-       .pmc_mask       = 1 << AT91RM9200_ID_PIOD,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-
-static struct clk *periph_clocks[] __initdata = {
-       &pioA_clk,
-       &pioB_clk,
-       &pioC_clk,
-       &pioD_clk,
-       &usart0_clk,
-       &usart1_clk,
-       &usart2_clk,
-       &usart3_clk,
-       &mmc_clk,
-       &udc_clk,
-       &twi_clk,
-       &spi_clk,
-       // ssc 0 .. ssc2
-       // tc0 .. tc5
-       &ohci_clk,
-       &ether_clk,
-       // irq0 .. irq6
-};
-
-/*
- * The four programmable clocks.
- * You must configure pin multiplexing to bring these signals out.
- */
-static struct clk pck0 = {
-       .name           = "pck0",
-       .pmc_mask       = AT91_PMC_PCK0,
-       .type           = CLK_TYPE_PROGRAMMABLE,
-       .id             = 0,
-};
-static struct clk pck1 = {
-       .name           = "pck1",
-       .pmc_mask       = AT91_PMC_PCK1,
-       .type           = CLK_TYPE_PROGRAMMABLE,
-       .id             = 1,
-};
-static struct clk pck2 = {
-       .name           = "pck2",
-       .pmc_mask       = AT91_PMC_PCK2,
-       .type           = CLK_TYPE_PROGRAMMABLE,
-       .id             = 2,
-};
-static struct clk pck3 = {
-       .name           = "pck3",
-       .pmc_mask       = AT91_PMC_PCK3,
-       .type           = CLK_TYPE_PROGRAMMABLE,
-       .id             = 3,
-};
-
-static void __init at91rm9200_register_clocks(void)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
-               clk_register(periph_clocks[i]);
-
-       clk_register(&pck0);
-       clk_register(&pck1);
-       clk_register(&pck2);
-       clk_register(&pck3);
-}
-
-/* --------------------------------------------------------------------
- *  GPIO
- * -------------------------------------------------------------------- */
-
-static struct at91_gpio_bank at91rm9200_gpio[] = {
-       {
-               .id             = AT91RM9200_ID_PIOA,
-               .offset         = AT91_PIOA,
-               .clock          = &pioA_clk,
-       }, {
-               .id             = AT91RM9200_ID_PIOB,
-               .offset         = AT91_PIOB,
-               .clock          = &pioB_clk,
-       }, {
-               .id             = AT91RM9200_ID_PIOC,
-               .offset         = AT91_PIOC,
-               .clock          = &pioC_clk,
-       }, {
-               .id             = AT91RM9200_ID_PIOD,
-               .offset         = AT91_PIOD,
-               .clock          = &pioD_clk,
-       }
-};
-
-static void at91rm9200_reset(void)
-{
-       /*
-        * Perform a hardware reset with the use of the Watchdog timer.
-        */
-       at91_sys_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
-       at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
-}
-
-
-/* --------------------------------------------------------------------
- *  AT91RM9200 processor initialization
- * -------------------------------------------------------------------- */
-void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks)
-{
-       /* Map peripherals */
-       iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc));
-
-       at91_arch_reset = at91rm9200_reset;
-       at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
-                       | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
-                       | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5)
-                       | (1 << AT91RM9200_ID_IRQ6);
-
-       /* Init clock subsystem */
-       at91_clock_init(main_clock);
-
-       /* Register the processor-specific clocks */
-       at91rm9200_register_clocks();
-
-       /* Initialize GPIO subsystem */
-       at91_gpio_init(at91rm9200_gpio, banks);
-}
-
-
-/* --------------------------------------------------------------------
- *  Interrupt initialization
- * -------------------------------------------------------------------- */
-
-/*
- * The default interrupt priority levels (0 = lowest, 7 = highest).
- */
-static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
-       7,      /* Advanced Interrupt Controller (FIQ) */
-       7,      /* System Peripherals */
-       0,      /* Parallel IO Controller A */
-       0,      /* Parallel IO Controller B */
-       0,      /* Parallel IO Controller C */
-       0,      /* Parallel IO Controller D */
-       6,      /* USART 0 */
-       6,      /* USART 1 */
-       6,      /* USART 2 */
-       6,      /* USART 3 */
-       0,      /* Multimedia Card Interface */
-       4,      /* USB Device Port */
-       0,      /* Two-Wire Interface */
-       6,      /* Serial Peripheral Interface */
-       5,      /* Serial Synchronous Controller 0 */
-       5,      /* Serial Synchronous Controller 1 */
-       5,      /* Serial Synchronous Controller 2 */
-       0,      /* Timer Counter 0 */
-       0,      /* Timer Counter 1 */
-       0,      /* Timer Counter 2 */
-       0,      /* Timer Counter 3 */
-       0,      /* Timer Counter 4 */
-       0,      /* Timer Counter 5 */
-       3,      /* USB Host port */
-       3,      /* Ethernet MAC */
-       0,      /* Advanced Interrupt Controller (IRQ0) */
-       0,      /* Advanced Interrupt Controller (IRQ1) */
-       0,      /* Advanced Interrupt Controller (IRQ2) */
-       0,      /* Advanced Interrupt Controller (IRQ3) */
-       0,      /* Advanced Interrupt Controller (IRQ4) */
-       0,      /* Advanced Interrupt Controller (IRQ5) */
-       0       /* Advanced Interrupt Controller (IRQ6) */
-};
-
-void __init at91rm9200_init_interrupts(unsigned int priority[NR_AIC_IRQS])
-{
-       if (!priority)
-               priority = at91rm9200_default_irq_priority;
-
-       /* Initialize the AIC interrupt controller */
-       at91_aic_init(priority);
-
-       /* Enable GPIO interrupts */
-       at91_gpio_irq_setup();
-}
diff --git a/arch/arm/mach-at91rm9200/at91rm9200_devices.c b/arch/arm/mach-at91rm9200/at91rm9200_devices.c
deleted file mode 100644 (file)
index 57fac72..0000000
+++ /dev/null
@@ -1,875 +0,0 @@
-/*
- * arch/arm/mach-at91rm9200/at91rm9200_devices.c
- *
- *  Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
- *  Copyright (C) 2005 David Brownell
- *
- * 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/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <linux/platform_device.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-#include <asm/arch/at91rm9200.h>
-#include <asm/arch/at91rm9200_mc.h>
-
-#include "generic.h"
-
-#define SZ_512 0x00000200
-#define SZ_256 0x00000100
-#define SZ_16  0x00000010
-
-/* --------------------------------------------------------------------
- *  USB Host
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-static u64 ohci_dmamask = 0xffffffffUL;
-static struct at91_usbh_data usbh_data;
-
-static struct resource usbh_resources[] = {
-       [0] = {
-               .start  = AT91RM9200_UHP_BASE,
-               .end    = AT91RM9200_UHP_BASE + SZ_1M - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91RM9200_ID_UHP,
-               .end    = AT91RM9200_ID_UHP,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91rm9200_usbh_device = {
-       .name           = "at91_ohci",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &ohci_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-                               .platform_data          = &usbh_data,
-       },
-       .resource       = usbh_resources,
-       .num_resources  = ARRAY_SIZE(usbh_resources),
-};
-
-void __init at91_add_device_usbh(struct at91_usbh_data *data)
-{
-       if (!data)
-               return;
-
-       usbh_data = *data;
-       platform_device_register(&at91rm9200_usbh_device);
-}
-#else
-void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  USB Device (Gadget)
- * -------------------------------------------------------------------- */
-
-#ifdef CONFIG_USB_GADGET_AT91
-static struct at91_udc_data udc_data;
-
-static struct resource udc_resources[] = {
-       [0] = {
-               .start  = AT91RM9200_BASE_UDP,
-               .end    = AT91RM9200_BASE_UDP + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91RM9200_ID_UDP,
-               .end    = AT91RM9200_ID_UDP,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91rm9200_udc_device = {
-       .name           = "at91_udc",
-       .id             = -1,
-       .dev            = {
-                               .platform_data          = &udc_data,
-       },
-       .resource       = udc_resources,
-       .num_resources  = ARRAY_SIZE(udc_resources),
-};
-
-void __init at91_add_device_udc(struct at91_udc_data *data)
-{
-       if (!data)
-               return;
-
-       if (data->vbus_pin) {
-               at91_set_gpio_input(data->vbus_pin, 0);
-               at91_set_deglitch(data->vbus_pin, 1);
-       }
-       if (data->pullup_pin)
-               at91_set_gpio_output(data->pullup_pin, 0);
-
-       udc_data = *data;
-       platform_device_register(&at91rm9200_udc_device);
-}
-#else
-void __init at91_add_device_udc(struct at91_udc_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  Ethernet
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE)
-static u64 eth_dmamask = 0xffffffffUL;
-static struct at91_eth_data eth_data;
-
-static struct resource eth_resources[] = {
-       [0] = {
-               .start  = AT91_VA_BASE_EMAC,
-               .end    = AT91_VA_BASE_EMAC + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91RM9200_ID_EMAC,
-               .end    = AT91RM9200_ID_EMAC,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91rm9200_eth_device = {
-       .name           = "at91_ether",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &eth_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-                               .platform_data          = &eth_data,
-       },
-       .resource       = eth_resources,
-       .num_resources  = ARRAY_SIZE(eth_resources),
-};
-
-void __init at91_add_device_eth(struct at91_eth_data *data)
-{
-       if (!data)
-               return;
-
-       if (data->phy_irq_pin) {
-               at91_set_gpio_input(data->phy_irq_pin, 0);
-               at91_set_deglitch(data->phy_irq_pin, 1);
-       }
-
-       /* Pins used for MII and RMII */
-       at91_set_A_periph(AT91_PIN_PA16, 0);    /* EMDIO */
-       at91_set_A_periph(AT91_PIN_PA15, 0);    /* EMDC */
-       at91_set_A_periph(AT91_PIN_PA14, 0);    /* ERXER */
-       at91_set_A_periph(AT91_PIN_PA13, 0);    /* ERX1 */
-       at91_set_A_periph(AT91_PIN_PA12, 0);    /* ERX0 */
-       at91_set_A_periph(AT91_PIN_PA11, 0);    /* ECRS_ECRSDV */
-       at91_set_A_periph(AT91_PIN_PA10, 0);    /* ETX1 */
-       at91_set_A_periph(AT91_PIN_PA9, 0);     /* ETX0 */
-       at91_set_A_periph(AT91_PIN_PA8, 0);     /* ETXEN */
-       at91_set_A_periph(AT91_PIN_PA7, 0);     /* ETXCK_EREFCK */
-
-       if (!data->is_rmii) {
-               at91_set_B_periph(AT91_PIN_PB19, 0);    /* ERXCK */
-               at91_set_B_periph(AT91_PIN_PB18, 0);    /* ECOL */
-               at91_set_B_periph(AT91_PIN_PB17, 0);    /* ERXDV */
-               at91_set_B_periph(AT91_PIN_PB16, 0);    /* ERX3 */
-               at91_set_B_periph(AT91_PIN_PB15, 0);    /* ERX2 */
-               at91_set_B_periph(AT91_PIN_PB14, 0);    /* ETXER */
-               at91_set_B_periph(AT91_PIN_PB13, 0);    /* ETX3 */
-               at91_set_B_periph(AT91_PIN_PB12, 0);    /* ETX2 */
-       }
-
-       eth_data = *data;
-       platform_device_register(&at91rm9200_eth_device);
-}
-#else
-void __init at91_add_device_eth(struct at91_eth_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  Compact Flash / PCMCIA
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE)
-static struct at91_cf_data cf_data;
-
-#define CF_BASE                AT91_CHIPSELECT_4
-
-static struct resource cf_resources[] = {
-       [0] = {
-               .start  = CF_BASE,
-               /* ties up CS4, CS5 and CS6 */
-               .end    = CF_BASE + (0x30000000 - 1),
-               .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT,
-       },
-};
-
-static struct platform_device at91rm9200_cf_device = {
-       .name           = "at91_cf",
-       .id             = -1,
-       .dev            = {
-                               .platform_data          = &cf_data,
-       },
-       .resource       = cf_resources,
-       .num_resources  = ARRAY_SIZE(cf_resources),
-};
-
-void __init at91_add_device_cf(struct at91_cf_data *data)
-{
-       unsigned int csa;
-
-       if (!data)
-               return;
-
-       data->chipselect = 4;           /* can only use EBI ChipSelect 4 */
-
-       /* CF takes over CS4, CS5, CS6 */
-       csa = at91_sys_read(AT91_EBI_CSA);
-       at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS4A_SMC_COMPACTFLASH);
-
-       /*
-        * Static memory controller timing adjustments.
-        * REVISIT:  these timings are in terms of MCK cycles, so
-        * when MCK changes (cpufreq etc) so must these values...
-        */
-       at91_sys_write(AT91_SMC_CSR(4),
-                                 AT91_SMC_ACSS_STD
-                               | AT91_SMC_DBW_16
-                               | AT91_SMC_BAT
-                               | AT91_SMC_WSEN
-                               | AT91_SMC_NWS_(32)     /* wait states */
-                               | AT91_SMC_RWSETUP_(6)  /* setup time */
-                               | AT91_SMC_RWHOLD_(4)   /* hold time */
-       );
-
-       /* input/irq */
-       if (data->irq_pin) {
-               at91_set_gpio_input(data->irq_pin, 1);
-               at91_set_deglitch(data->irq_pin, 1);
-       }
-       at91_set_gpio_input(data->det_pin, 1);
-       at91_set_deglitch(data->det_pin, 1);
-
-       /* outputs, initially off */
-       if (data->vcc_pin)
-               at91_set_gpio_output(data->vcc_pin, 0);
-       at91_set_gpio_output(data->rst_pin, 0);
-
-       /* force poweron defaults for these pins ... */
-       at91_set_A_periph(AT91_PIN_PC9, 0);     /* A25/CFRNW */
-       at91_set_A_periph(AT91_PIN_PC10, 0);    /* NCS4/CFCS */
-       at91_set_A_periph(AT91_PIN_PC11, 0);    /* NCS5/CFCE1 */
-       at91_set_A_periph(AT91_PIN_PC12, 0);    /* NCS6/CFCE2 */
-
-       /* nWAIT is _not_ a default setting */
-       at91_set_A_periph(AT91_PIN_PC6, 1);     /* nWAIT */
-
-       cf_data = *data;
-       platform_device_register(&at91rm9200_cf_device);
-}
-#else
-void __init at91_add_device_cf(struct at91_cf_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  MMC / SD
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
-static u64 mmc_dmamask = 0xffffffffUL;
-static struct at91_mmc_data mmc_data;
-
-static struct resource mmc_resources[] = {
-       [0] = {
-               .start  = AT91RM9200_BASE_MCI,
-               .end    = AT91RM9200_BASE_MCI + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91RM9200_ID_MCI,
-               .end    = AT91RM9200_ID_MCI,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91rm9200_mmc_device = {
-       .name           = "at91_mci",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &mmc_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-                               .platform_data          = &mmc_data,
-       },
-       .resource       = mmc_resources,
-       .num_resources  = ARRAY_SIZE(mmc_resources),
-};
-
-void __init at91_add_device_mmc(struct at91_mmc_data *data)
-{
-       if (!data)
-               return;
-
-       /* input/irq */
-       if (data->det_pin) {
-               at91_set_gpio_input(data->det_pin, 1);
-               at91_set_deglitch(data->det_pin, 1);
-       }
-       if (data->wp_pin)
-               at91_set_gpio_input(data->wp_pin, 1);
-       if (data->vcc_pin)
-               at91_set_gpio_output(data->vcc_pin, 0);
-
-       /* CLK */
-       at91_set_A_periph(AT91_PIN_PA27, 0);
-
-       if (data->slot_b) {
-               /* CMD */
-               at91_set_B_periph(AT91_PIN_PA8, 1);
-
-               /* DAT0, maybe DAT1..DAT3 */
-               at91_set_B_periph(AT91_PIN_PA9, 1);
-               if (data->wire4) {
-                       at91_set_B_periph(AT91_PIN_PA10, 1);
-                       at91_set_B_periph(AT91_PIN_PA11, 1);
-                       at91_set_B_periph(AT91_PIN_PA12, 1);
-               }
-       } else {
-               /* CMD */
-               at91_set_A_periph(AT91_PIN_PA28, 1);
-
-               /* DAT0, maybe DAT1..DAT3 */
-               at91_set_A_periph(AT91_PIN_PA29, 1);
-               if (data->wire4) {
-                       at91_set_B_periph(AT91_PIN_PB3, 1);
-                       at91_set_B_periph(AT91_PIN_PB4, 1);
-                       at91_set_B_periph(AT91_PIN_PB5, 1);
-               }
-       }
-
-       mmc_data = *data;
-       platform_device_register(&at91rm9200_mmc_device);
-}
-#else
-void __init at91_add_device_mmc(struct at91_mmc_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  NAND / SmartMedia
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
-static struct at91_nand_data nand_data;
-
-#define NAND_BASE      AT91_CHIPSELECT_3
-
-static struct resource nand_resources[] = {
-       {
-               .start  = NAND_BASE,
-               .end    = NAND_BASE + SZ_8M - 1,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device at91rm9200_nand_device = {
-       .name           = "at91_nand",
-       .id             = -1,
-       .dev            = {
-                               .platform_data  = &nand_data,
-       },
-       .resource       = nand_resources,
-       .num_resources  = ARRAY_SIZE(nand_resources),
-};
-
-void __init at91_add_device_nand(struct at91_nand_data *data)
-{
-       unsigned int csa;
-
-       if (!data)
-               return;
-
-       /* enable the address range of CS3 */
-       csa = at91_sys_read(AT91_EBI_CSA);
-       at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS3A_SMC_SMARTMEDIA);
-
-       /* set the bus interface characteristics */
-       at91_sys_write(AT91_SMC_CSR(3), AT91_SMC_ACSS_STD | AT91_SMC_DBW_8 | AT91_SMC_WSEN
-               | AT91_SMC_NWS_(5)
-               | AT91_SMC_TDF_(1)
-               | AT91_SMC_RWSETUP_(0)  /* tDS Data Set up Time 30 - ns */
-               | AT91_SMC_RWHOLD_(1)   /* tDH Data Hold Time 20 - ns */
-       );
-
-       /* enable pin */
-       if (data->enable_pin)
-               at91_set_gpio_output(data->enable_pin, 1);
-
-       /* ready/busy pin */
-       if (data->rdy_pin)
-               at91_set_gpio_input(data->rdy_pin, 1);
-
-       /* card detect pin */
-       if (data->det_pin)
-               at91_set_gpio_input(data->det_pin, 1);
-
-       at91_set_A_periph(AT91_PIN_PC1, 0);             /* SMOE */
-       at91_set_A_periph(AT91_PIN_PC3, 0);             /* SMWE */
-
-       nand_data = *data;
-       platform_device_register(&at91rm9200_nand_device);
-}
-#else
-void __init at91_add_device_nand(struct at91_nand_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  TWI (i2c)
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
-
-static struct resource twi_resources[] = {
-       [0] = {
-               .start  = AT91RM9200_BASE_TWI,
-               .end    = AT91RM9200_BASE_TWI + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91RM9200_ID_TWI,
-               .end    = AT91RM9200_ID_TWI,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91rm9200_twi_device = {
-       .name           = "at91_i2c",
-       .id             = -1,
-       .resource       = twi_resources,
-       .num_resources  = ARRAY_SIZE(twi_resources),
-};
-
-void __init at91_add_device_i2c(void)
-{
-       /* pins used for TWI interface */
-       at91_set_A_periph(AT91_PIN_PA25, 0);            /* TWD */
-       at91_set_multi_drive(AT91_PIN_PA25, 1);
-
-       at91_set_A_periph(AT91_PIN_PA26, 0);            /* TWCK */
-       at91_set_multi_drive(AT91_PIN_PA26, 1);
-
-       platform_device_register(&at91rm9200_twi_device);
-}
-#else
-void __init at91_add_device_i2c(void) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  SPI
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_SPI_AT91) || defined(CONFIG_SPI_AT91_MODULE) || defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE)
-static u64 spi_dmamask = 0xffffffffUL;
-
-static struct resource spi_resources[] = {
-       [0] = {
-               .start  = AT91RM9200_BASE_SPI,
-               .end    = AT91RM9200_BASE_SPI + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91RM9200_ID_SPI,
-               .end    = AT91RM9200_ID_SPI,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91rm9200_spi_device = {
-       .name           = "at91_spi",
-       .id             = 0,
-       .dev            = {
-                               .dma_mask               = &spi_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-       },
-       .resource       = spi_resources,
-       .num_resources  = ARRAY_SIZE(spi_resources),
-};
-
-static const unsigned spi_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PA4, AT91_PIN_PA5, AT91_PIN_PA6 };
-
-void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
-{
-       int i;
-       unsigned long cs_pin;
-
-       at91_set_A_periph(AT91_PIN_PA0, 0);     /* MISO */
-       at91_set_A_periph(AT91_PIN_PA1, 0);     /* MOSI */
-       at91_set_A_periph(AT91_PIN_PA2, 0);     /* SPCK */
-
-       /* Enable SPI chip-selects */
-       for (i = 0; i < nr_devices; i++) {
-               if (devices[i].controller_data)
-                       cs_pin = (unsigned long) devices[i].controller_data;
-               else
-                       cs_pin = spi_standard_cs[devices[i].chip_select];
-
-#ifdef CONFIG_SPI_AT91_MANUAL_CS
-               at91_set_gpio_output(cs_pin, 1);
-#else
-               at91_set_A_periph(cs_pin, 0);
-#endif
-
-               /* pass chip-select pin to driver */
-               devices[i].controller_data = (void *) cs_pin;
-       }
-
-       spi_register_board_info(devices, nr_devices);
-       at91_clock_associate("spi_clk", &at91rm9200_spi_device.dev, "spi");
-       platform_device_register(&at91rm9200_spi_device);
-}
-#else
-void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  RTC
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE)
-static struct platform_device at91rm9200_rtc_device = {
-       .name           = "at91_rtc",
-       .id             = -1,
-       .num_resources  = 0,
-};
-
-static void __init at91_add_device_rtc(void)
-{
-       platform_device_register(&at91rm9200_rtc_device);
-}
-#else
-static void __init at91_add_device_rtc(void) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  Watchdog
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_AT91RM9200_WATCHDOG) || defined(CONFIG_AT91RM9200_WATCHDOG_MODULE)
-static struct platform_device at91rm9200_wdt_device = {
-       .name           = "at91_wdt",
-       .id             = -1,
-       .num_resources  = 0,
-};
-
-static void __init at91_add_device_watchdog(void)
-{
-       platform_device_register(&at91rm9200_wdt_device);
-}
-#else
-static void __init at91_add_device_watchdog(void) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  LEDs
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_LEDS)
-u8 at91_leds_cpu;
-u8 at91_leds_timer;
-
-void __init at91_init_leds(u8 cpu_led, u8 timer_led)
-{
-       at91_leds_cpu   = cpu_led;
-       at91_leds_timer = timer_led;
-}
-#else
-void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  UART
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_SERIAL_ATMEL)
-static struct resource dbgu_resources[] = {
-       [0] = {
-               .start  = AT91_VA_BASE_SYS + AT91_DBGU,
-               .end    = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data dbgu_data = {
-       .use_dma_tx     = 0,
-       .use_dma_rx     = 0,            /* DBGU not capable of receive DMA */
-       .regs           = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
-};
-
-static struct platform_device at91rm9200_dbgu_device = {
-       .name           = "atmel_usart",
-       .id             = 0,
-       .dev            = {
-                               .platform_data  = &dbgu_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = dbgu_resources,
-       .num_resources  = ARRAY_SIZE(dbgu_resources),
-};
-
-static inline void configure_dbgu_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PA30, 0);            /* DRXD */
-       at91_set_A_periph(AT91_PIN_PA31, 1);            /* DTXD */
-}
-
-static struct resource uart0_resources[] = {
-       [0] = {
-               .start  = AT91RM9200_BASE_US0,
-               .end    = AT91RM9200_BASE_US0 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91RM9200_ID_US0,
-               .end    = AT91RM9200_ID_US0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart0_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91rm9200_uart0_device = {
-       .name           = "atmel_usart",
-       .id             = 1,
-       .dev            = {
-                               .platform_data  = &uart0_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart0_resources,
-       .num_resources  = ARRAY_SIZE(uart0_resources),
-};
-
-static inline void configure_usart0_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PA17, 1);            /* TXD0 */
-       at91_set_A_periph(AT91_PIN_PA18, 0);            /* RXD0 */
-       at91_set_A_periph(AT91_PIN_PA20, 0);            /* CTS0 */
-
-       /*
-        * AT91RM9200 Errata #39 - RTS0 is not internally connected to PA21.
-        *  We need to drive the pin manually.  Default is off (RTS is active low).
-        */
-       at91_set_gpio_output(AT91_PIN_PA21, 1);
-}
-
-static struct resource uart1_resources[] = {
-       [0] = {
-               .start  = AT91RM9200_BASE_US1,
-               .end    = AT91RM9200_BASE_US1 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91RM9200_ID_US1,
-               .end    = AT91RM9200_ID_US1,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart1_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91rm9200_uart1_device = {
-       .name           = "atmel_usart",
-       .id             = 2,
-       .dev            = {
-                               .platform_data  = &uart1_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart1_resources,
-       .num_resources  = ARRAY_SIZE(uart1_resources),
-};
-
-static inline void configure_usart1_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PB18, 0);            /* RI1 */
-       at91_set_A_periph(AT91_PIN_PB19, 0);            /* DTR1 */
-       at91_set_A_periph(AT91_PIN_PB20, 1);            /* TXD1 */
-       at91_set_A_periph(AT91_PIN_PB21, 0);            /* RXD1 */
-       at91_set_A_periph(AT91_PIN_PB23, 0);            /* DCD1 */
-       at91_set_A_periph(AT91_PIN_PB24, 0);            /* CTS1 */
-       at91_set_A_periph(AT91_PIN_PB25, 0);            /* DSR1 */
-       at91_set_A_periph(AT91_PIN_PB26, 0);            /* RTS1 */
-}
-
-static struct resource uart2_resources[] = {
-       [0] = {
-               .start  = AT91RM9200_BASE_US2,
-               .end    = AT91RM9200_BASE_US2 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91RM9200_ID_US2,
-               .end    = AT91RM9200_ID_US2,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart2_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91rm9200_uart2_device = {
-       .name           = "atmel_usart",
-       .id             = 3,
-       .dev            = {
-                               .platform_data  = &uart2_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart2_resources,
-       .num_resources  = ARRAY_SIZE(uart2_resources),
-};
-
-static inline void configure_usart2_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PA22, 0);            /* RXD2 */
-       at91_set_A_periph(AT91_PIN_PA23, 1);            /* TXD2 */
-}
-
-static struct resource uart3_resources[] = {
-       [0] = {
-               .start  = AT91RM9200_BASE_US3,
-               .end    = AT91RM9200_BASE_US3 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91RM9200_ID_US3,
-               .end    = AT91RM9200_ID_US3,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart3_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91rm9200_uart3_device = {
-       .name           = "atmel_usart",
-       .id             = 4,
-       .dev            = {
-                               .platform_data  = &uart3_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart3_resources,
-       .num_resources  = ARRAY_SIZE(uart3_resources),
-};
-
-static inline void configure_usart3_pins(void)
-{
-       at91_set_B_periph(AT91_PIN_PA5, 1);             /* TXD3 */
-       at91_set_B_periph(AT91_PIN_PA6, 0);             /* RXD3 */
-}
-
-struct platform_device *at91_uarts[ATMEL_MAX_UART];    /* the UARTs to use */
-struct platform_device *atmel_default_console_device;  /* the serial console device */
-
-void __init at91_init_serial(struct at91_uart_config *config)
-{
-       int i;
-
-       /* Fill in list of supported UARTs */
-       for (i = 0; i < config->nr_tty; i++) {
-               switch (config->tty_map[i]) {
-                       case 0:
-                               configure_usart0_pins();
-                               at91_uarts[i] = &at91rm9200_uart0_device;
-                               at91_clock_associate("usart0_clk", &at91rm9200_uart0_device.dev, "usart");
-                               break;
-                       case 1:
-                               configure_usart1_pins();
-                               at91_uarts[i] = &at91rm9200_uart1_device;
-                               at91_clock_associate("usart1_clk", &at91rm9200_uart1_device.dev, "usart");
-                               break;
-                       case 2:
-                               configure_usart2_pins();
-                               at91_uarts[i] = &at91rm9200_uart2_device;
-                               at91_clock_associate("usart2_clk", &at91rm9200_uart2_device.dev, "usart");
-                               break;
-                       case 3:
-                               configure_usart3_pins();
-                               at91_uarts[i] = &at91rm9200_uart3_device;
-                               at91_clock_associate("usart3_clk", &at91rm9200_uart3_device.dev, "usart");
-                               break;
-                       case 4:
-                               configure_dbgu_pins();
-                               at91_uarts[i] = &at91rm9200_dbgu_device;
-                               at91_clock_associate("mck", &at91rm9200_dbgu_device.dev, "usart");
-                               break;
-                       default:
-                               continue;
-               }
-               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
-       }
-
-       /* Set serial console device */
-       if (config->console_tty < ATMEL_MAX_UART)
-               atmel_default_console_device = at91_uarts[config->console_tty];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
-}
-
-void __init at91_add_device_serial(void)
-{
-       int i;
-
-       for (i = 0; i < ATMEL_MAX_UART; i++) {
-               if (at91_uarts[i])
-                       platform_device_register(at91_uarts[i]);
-       }
-}
-#else
-void __init at91_init_serial(struct at91_uart_config *config) {}
-void __init at91_add_device_serial(void) {}
-#endif
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * These devices are always present and don't need any board-specific
- * setup.
- */
-static int __init at91_add_standard_devices(void)
-{
-       at91_add_device_rtc();
-       at91_add_device_watchdog();
-       return 0;
-}
-
-arch_initcall(at91_add_standard_devices);
diff --git a/arch/arm/mach-at91rm9200/at91rm9200_time.c b/arch/arm/mach-at91rm9200/at91rm9200_time.c
deleted file mode 100644 (file)
index b999e19..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/at91rm9200_time.c
- *
- *  Copyright (C) 2003 SAN People
- *  Copyright (C) 2003 ATMEL
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/time.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/mach/time.h>
-
-#include <asm/arch/at91_st.h>
-
-static unsigned long last_crtr;
-
-/*
- * The ST_CRTR is updated asynchronously to the master clock.  It is therefore
- *  necessary to read it twice (with the same value) to ensure accuracy.
- */
-static inline unsigned long read_CRTR(void) {
-       unsigned long x1, x2;
-
-       do {
-               x1 = at91_sys_read(AT91_ST_CRTR);
-               x2 = at91_sys_read(AT91_ST_CRTR);
-       } while (x1 != x2);
-
-       return x1;
-}
-
-/*
- * Returns number of microseconds since last timer interrupt.  Note that interrupts
- * will have been disabled by do_gettimeofday()
- *  'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
- *  'tick' is usecs per jiffy (linux/timex.h).
- */
-static unsigned long at91rm9200_gettimeoffset(void)
-{
-       unsigned long elapsed;
-
-       elapsed = (read_CRTR() - last_crtr) & AT91_ST_ALMV;
-
-       return (unsigned long)(elapsed * (tick_nsec / 1000)) / LATCH;
-}
-
-/*
- * IRQ handler for the timer.
- */
-static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id)
-{
-       if (at91_sys_read(AT91_ST_SR) & AT91_ST_PITS) { /* This is a shared interrupt */
-               write_seqlock(&xtime_lock);
-
-               while (((read_CRTR() - last_crtr) & AT91_ST_ALMV) >= LATCH) {
-                       timer_tick();
-                       last_crtr = (last_crtr + LATCH) & AT91_ST_ALMV;
-               }
-
-               write_sequnlock(&xtime_lock);
-
-               return IRQ_HANDLED;
-       }
-       else
-               return IRQ_NONE;                /* not handled */
-}
-
-static struct irqaction at91rm9200_timer_irq = {
-       .name           = "at91_tick",
-       .flags          = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER,
-       .handler        = at91rm9200_timer_interrupt
-};
-
-void at91rm9200_timer_reset(void)
-{
-       last_crtr = 0;
-
-       /* Real time counter incremented every 30.51758 microseconds */
-       at91_sys_write(AT91_ST_RTMR, 1);
-
-       /* Set Period Interval timer */
-       at91_sys_write(AT91_ST_PIMR, LATCH);
-
-       /* Clear any pending interrupts */
-       (void) at91_sys_read(AT91_ST_SR);
-
-       /* Enable Period Interval Timer interrupt */
-       at91_sys_write(AT91_ST_IER, AT91_ST_PITS);
-}
-
-/*
- * Set up timer interrupt.
- */
-void __init at91rm9200_timer_init(void)
-{
-       /* Disable all timer interrupts */
-       at91_sys_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS);
-       (void) at91_sys_read(AT91_ST_SR);       /* Clear any pending interrupts */
-
-       /* Make IRQs happen for the system timer */
-       setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
-
-       /* Change the kernel's 'tick' value to 10009 usec. (the default is 10000) */
-       tick_usec = (LATCH * 1000000) / CLOCK_TICK_RATE;
-
-       /* Initialize and enable the timer interrupt */
-       at91rm9200_timer_reset();
-}
-
-#ifdef CONFIG_PM
-static void at91rm9200_timer_suspend(void)
-{
-       /* disable Period Interval Timer interrupt */
-       at91_sys_write(AT91_ST_IDR, AT91_ST_PITS);
-}
-#else
-#define at91rm9200_timer_suspend       NULL
-#endif
-
-struct sys_timer at91rm9200_timer = {
-       .init           = at91rm9200_timer_init,
-       .offset         = at91rm9200_gettimeoffset,
-       .suspend        = at91rm9200_timer_suspend,
-       .resume         = at91rm9200_timer_reset,
-};
-
diff --git a/arch/arm/mach-at91rm9200/at91sam9260.c b/arch/arm/mach-at91rm9200/at91sam9260.c
deleted file mode 100644 (file)
index b14871a..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * arch/arm/mach-at91rm9200/at91sam9260.c
- *
- *  Copyright (C) 2006 SAN People
- *
- * 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/module.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/arch/at91sam9260.h>
-#include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
-
-#include "generic.h"
-#include "clock.h"
-
-static struct map_desc at91sam9260_io_desc[] __initdata = {
-       {
-               .virtual        = AT91_VA_BASE_SYS,
-               .pfn            = __phys_to_pfn(AT91_BASE_SYS),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE,
-               .pfn            = __phys_to_pfn(AT91SAM9260_SRAM0_BASE),
-               .length         = AT91SAM9260_SRAM0_SIZE,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE - AT91SAM9260_SRAM1_SIZE,
-               .pfn            = __phys_to_pfn(AT91SAM9260_SRAM1_BASE),
-               .length         = AT91SAM9260_SRAM1_SIZE,
-               .type           = MT_DEVICE,
-       },
-};
-
-/* --------------------------------------------------------------------
- *  Clocks
- * -------------------------------------------------------------------- */
-
-/*
- * The peripheral clocks.
- */
-static struct clk pioA_clk = {
-       .name           = "pioA_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_PIOA,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioB_clk = {
-       .name           = "pioB_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_PIOB,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioC_clk = {
-       .name           = "pioC_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_PIOC,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk adc_clk = {
-       .name           = "adc_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_ADC,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart0_clk = {
-       .name           = "usart0_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_US0,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart1_clk = {
-       .name           = "usart1_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_US1,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart2_clk = {
-       .name           = "usart2_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_US2,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk mmc_clk = {
-       .name           = "mci_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_MCI,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk udc_clk = {
-       .name           = "udc_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_UDP,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk twi_clk = {
-       .name           = "twi_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_TWI,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk spi0_clk = {
-       .name           = "spi0_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_SPI0,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk spi1_clk = {
-       .name           = "spi1_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_SPI1,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk ohci_clk = {
-       .name           = "ohci_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_UHP,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk ether_clk = {
-       .name           = "ether_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_EMAC,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk isi_clk = {
-       .name           = "isi_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_ISI,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart3_clk = {
-       .name           = "usart3_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_US3,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart4_clk = {
-       .name           = "usart4_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_US4,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart5_clk = {
-       .name           = "usart5_clk",
-       .pmc_mask       = 1 << AT91SAM9260_ID_US5,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-
-static struct clk *periph_clocks[] __initdata = {
-       &pioA_clk,
-       &pioB_clk,
-       &pioC_clk,
-       &adc_clk,
-       &usart0_clk,
-       &usart1_clk,
-       &usart2_clk,
-       &mmc_clk,
-       &udc_clk,
-       &twi_clk,
-       &spi0_clk,
-       &spi1_clk,
-       // ssc
-       // tc0 .. tc2
-       &ohci_clk,
-       &ether_clk,
-       &isi_clk,
-       &usart3_clk,
-       &usart4_clk,
-       &usart5_clk,
-       // tc3 .. tc5
-       // irq0 .. irq2
-};
-
-/*
- * The two programmable clocks.
- * You must configure pin multiplexing to bring these signals out.
- */
-static struct clk pck0 = {
-       .name           = "pck0",
-       .pmc_mask       = AT91_PMC_PCK0,
-       .type           = CLK_TYPE_PROGRAMMABLE,
-       .id             = 0,
-};
-static struct clk pck1 = {
-       .name           = "pck1",
-       .pmc_mask       = AT91_PMC_PCK1,
-       .type           = CLK_TYPE_PROGRAMMABLE,
-       .id             = 1,
-};
-
-static void __init at91sam9260_register_clocks(void)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
-               clk_register(periph_clocks[i]);
-
-       clk_register(&pck0);
-       clk_register(&pck1);
-}
-
-/* --------------------------------------------------------------------
- *  GPIO
- * -------------------------------------------------------------------- */
-
-static struct at91_gpio_bank at91sam9260_gpio[] = {
-       {
-               .id             = AT91SAM9260_ID_PIOA,
-               .offset         = AT91_PIOA,
-               .clock          = &pioA_clk,
-       }, {
-               .id             = AT91SAM9260_ID_PIOB,
-               .offset         = AT91_PIOB,
-               .clock          = &pioB_clk,
-       }, {
-               .id             = AT91SAM9260_ID_PIOC,
-               .offset         = AT91_PIOC,
-               .clock          = &pioC_clk,
-       }
-};
-
-static void at91sam9260_reset(void)
-{
-       at91_sys_write(AT91_RSTC_CR, (0xA5 << 24) | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
-}
-
-
-/* --------------------------------------------------------------------
- *  AT91SAM9260 processor initialization
- * -------------------------------------------------------------------- */
-
-void __init at91sam9260_initialize(unsigned long main_clock)
-{
-       /* Map peripherals */
-       iotable_init(at91sam9260_io_desc, ARRAY_SIZE(at91sam9260_io_desc));
-
-       at91_arch_reset = at91sam9260_reset;
-       at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
-                       | (1 << AT91SAM9260_ID_IRQ2);
-
-       /* Init clock subsystem */
-       at91_clock_init(main_clock);
-
-       /* Register the processor-specific clocks */
-       at91sam9260_register_clocks();
-
-       /* Register GPIO subsystem */
-       at91_gpio_init(at91sam9260_gpio, 3);
-}
-
-/* --------------------------------------------------------------------
- *  Interrupt initialization
- * -------------------------------------------------------------------- */
-
-/*
- * The default interrupt priority levels (0 = lowest, 7 = highest).
- */
-static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = {
-       7,      /* Advanced Interrupt Controller */
-       7,      /* System Peripherals */
-       0,      /* Parallel IO Controller A */
-       0,      /* Parallel IO Controller B */
-       0,      /* Parallel IO Controller C */
-       0,      /* Analog-to-Digital Converter */
-       6,      /* USART 0 */
-       6,      /* USART 1 */
-       6,      /* USART 2 */
-       0,      /* Multimedia Card Interface */
-       4,      /* USB Device Port */
-       0,      /* Two-Wire Interface */
-       6,      /* Serial Peripheral Interface 0 */
-       6,      /* Serial Peripheral Interface 1 */
-       5,      /* Serial Synchronous Controller */
-       0,
-       0,
-       0,      /* Timer Counter 0 */
-       0,      /* Timer Counter 1 */
-       0,      /* Timer Counter 2 */
-       3,      /* USB Host port */
-       3,      /* Ethernet */
-       0,      /* Image Sensor Interface */
-       6,      /* USART 3 */
-       6,      /* USART 4 */
-       6,      /* USART 5 */
-       0,      /* Timer Counter 3 */
-       0,      /* Timer Counter 4 */
-       0,      /* Timer Counter 5 */
-       0,      /* Advanced Interrupt Controller */
-       0,      /* Advanced Interrupt Controller */
-       0,      /* Advanced Interrupt Controller */
-};
-
-void __init at91sam9260_init_interrupts(unsigned int priority[NR_AIC_IRQS])
-{
-       if (!priority)
-               priority = at91sam9260_default_irq_priority;
-
-       /* Initialize the AIC interrupt controller */
-       at91_aic_init(priority);
-
-       /* Enable GPIO interrupts */
-       at91_gpio_irq_setup();
-}
diff --git a/arch/arm/mach-at91rm9200/at91sam9260_devices.c b/arch/arm/mach-at91rm9200/at91sam9260_devices.c
deleted file mode 100644 (file)
index f42d3a4..0000000
+++ /dev/null
@@ -1,867 +0,0 @@
-/*
- * arch/arm/mach-at91rm9200/at91sam9260_devices.c
- *
- *  Copyright (C) 2006 Atmel
- *
- * 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/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <linux/platform_device.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-#include <asm/arch/at91sam9260.h>
-#include <asm/arch/at91sam926x_mc.h>
-#include <asm/arch/at91sam9260_matrix.h>
-
-#include "generic.h"
-
-#define SZ_512 0x00000200
-#define SZ_256 0x00000100
-#define SZ_16  0x00000010
-
-/* --------------------------------------------------------------------
- *  USB Host
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-static u64 ohci_dmamask = 0xffffffffUL;
-static struct at91_usbh_data usbh_data;
-
-static struct resource usbh_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_UHP_BASE,
-               .end    = AT91SAM9260_UHP_BASE + SZ_1M - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_UHP,
-               .end    = AT91SAM9260_ID_UHP,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91_usbh_device = {
-       .name           = "at91_ohci",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &ohci_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-                               .platform_data          = &usbh_data,
-       },
-       .resource       = usbh_resources,
-       .num_resources  = ARRAY_SIZE(usbh_resources),
-};
-
-void __init at91_add_device_usbh(struct at91_usbh_data *data)
-{
-       if (!data)
-               return;
-
-       usbh_data = *data;
-       platform_device_register(&at91_usbh_device);
-}
-#else
-void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  USB Device (Gadget)
- * -------------------------------------------------------------------- */
-
-#ifdef CONFIG_USB_GADGET_AT91
-static struct at91_udc_data udc_data;
-
-static struct resource udc_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_UDP,
-               .end    = AT91SAM9260_BASE_UDP + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_UDP,
-               .end    = AT91SAM9260_ID_UDP,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91_udc_device = {
-       .name           = "at91_udc",
-       .id             = -1,
-       .dev            = {
-                               .platform_data          = &udc_data,
-       },
-       .resource       = udc_resources,
-       .num_resources  = ARRAY_SIZE(udc_resources),
-};
-
-void __init at91_add_device_udc(struct at91_udc_data *data)
-{
-       if (!data)
-               return;
-
-       if (data->vbus_pin) {
-               at91_set_gpio_input(data->vbus_pin, 0);
-               at91_set_deglitch(data->vbus_pin, 1);
-       }
-
-       /* Pullup pin is handled internally by USB device peripheral */
-
-       udc_data = *data;
-       platform_device_register(&at91_udc_device);
-}
-#else
-void __init at91_add_device_udc(struct at91_udc_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  Ethernet
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
-static u64 eth_dmamask = 0xffffffffUL;
-static struct eth_platform_data eth_data;
-
-static struct resource eth_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_EMAC,
-               .end    = AT91SAM9260_BASE_EMAC + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_EMAC,
-               .end    = AT91SAM9260_ID_EMAC,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9260_eth_device = {
-       .name           = "macb",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &eth_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-                               .platform_data          = &eth_data,
-       },
-       .resource       = eth_resources,
-       .num_resources  = ARRAY_SIZE(eth_resources),
-};
-
-void __init at91_add_device_eth(struct eth_platform_data *data)
-{
-       if (!data)
-               return;
-
-       if (data->phy_irq_pin) {
-               at91_set_gpio_input(data->phy_irq_pin, 0);
-               at91_set_deglitch(data->phy_irq_pin, 1);
-       }
-
-       /* Pins used for MII and RMII */
-       at91_set_A_periph(AT91_PIN_PA19, 0);    /* ETXCK_EREFCK */
-       at91_set_A_periph(AT91_PIN_PA17, 0);    /* ERXDV */
-       at91_set_A_periph(AT91_PIN_PA14, 0);    /* ERX0 */
-       at91_set_A_periph(AT91_PIN_PA15, 0);    /* ERX1 */
-       at91_set_A_periph(AT91_PIN_PA18, 0);    /* ERXER */
-       at91_set_A_periph(AT91_PIN_PA16, 0);    /* ETXEN */
-       at91_set_A_periph(AT91_PIN_PA12, 0);    /* ETX0 */
-       at91_set_A_periph(AT91_PIN_PA13, 0);    /* ETX1 */
-       at91_set_A_periph(AT91_PIN_PA21, 0);    /* EMDIO */
-       at91_set_A_periph(AT91_PIN_PA20, 0);    /* EMDC */
-
-       if (!data->is_rmii) {
-               at91_set_B_periph(AT91_PIN_PA28, 0);    /* ECRS */
-               at91_set_B_periph(AT91_PIN_PA29, 0);    /* ECOL */
-               at91_set_B_periph(AT91_PIN_PA25, 0);    /* ERX2 */
-               at91_set_B_periph(AT91_PIN_PA26, 0);    /* ERX3 */
-               at91_set_B_periph(AT91_PIN_PA27, 0);    /* ERXCK */
-               at91_set_B_periph(AT91_PIN_PA23, 0);    /* ETX2 */
-               at91_set_B_periph(AT91_PIN_PA24, 0);    /* ETX3 */
-               at91_set_B_periph(AT91_PIN_PA22, 0);    /* ETXER */
-       }
-
-       eth_data = *data;
-       platform_device_register(&at91sam9260_eth_device);
-}
-#else
-void __init at91_add_device_eth(struct eth_platform_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  MMC / SD
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
-static u64 mmc_dmamask = 0xffffffffUL;
-static struct at91_mmc_data mmc_data;
-
-static struct resource mmc_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_MCI,
-               .end    = AT91SAM9260_BASE_MCI + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_MCI,
-               .end    = AT91SAM9260_ID_MCI,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9260_mmc_device = {
-       .name           = "at91_mci",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &mmc_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-                               .platform_data          = &mmc_data,
-       },
-       .resource       = mmc_resources,
-       .num_resources  = ARRAY_SIZE(mmc_resources),
-};
-
-void __init at91_add_device_mmc(struct at91_mmc_data *data)
-{
-       if (!data)
-               return;
-
-       /* input/irq */
-       if (data->det_pin) {
-               at91_set_gpio_input(data->det_pin, 1);
-               at91_set_deglitch(data->det_pin, 1);
-       }
-       if (data->wp_pin)
-               at91_set_gpio_input(data->wp_pin, 1);
-       if (data->vcc_pin)
-               at91_set_gpio_output(data->vcc_pin, 0);
-
-       /* CLK */
-       at91_set_A_periph(AT91_PIN_PA8, 0);
-
-       if (data->slot_b) {
-               /* CMD */
-               at91_set_B_periph(AT91_PIN_PA1, 1);
-
-               /* DAT0, maybe DAT1..DAT3 */
-               at91_set_B_periph(AT91_PIN_PA0, 1);
-               if (data->wire4) {
-                       at91_set_B_periph(AT91_PIN_PA5, 1);
-                       at91_set_B_periph(AT91_PIN_PA4, 1);
-                       at91_set_B_periph(AT91_PIN_PA3, 1);
-               }
-       } else {
-               /* CMD */
-               at91_set_A_periph(AT91_PIN_PA7, 1);
-
-               /* DAT0, maybe DAT1..DAT3 */
-               at91_set_A_periph(AT91_PIN_PA6, 1);
-               if (data->wire4) {
-                       at91_set_A_periph(AT91_PIN_PA9, 1);
-                       at91_set_A_periph(AT91_PIN_PA10, 1);
-                       at91_set_A_periph(AT91_PIN_PA11, 1);
-               }
-       }
-
-       mmc_data = *data;
-       platform_device_register(&at91sam9260_mmc_device);
-}
-#else
-void __init at91_add_device_mmc(struct at91_mmc_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  NAND / SmartMedia
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
-static struct at91_nand_data nand_data;
-
-#define NAND_BASE      AT91_CHIPSELECT_3
-
-static struct resource nand_resources[] = {
-       {
-               .start  = NAND_BASE,
-               .end    = NAND_BASE + SZ_8M - 1,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device at91sam9260_nand_device = {
-       .name           = "at91_nand",
-       .id             = -1,
-       .dev            = {
-                               .platform_data  = &nand_data,
-       },
-       .resource       = nand_resources,
-       .num_resources  = ARRAY_SIZE(nand_resources),
-};
-
-void __init at91_add_device_nand(struct at91_nand_data *data)
-{
-       unsigned long csa, mode;
-
-       if (!data)
-               return;
-
-       csa = at91_sys_read(AT91_MATRIX_EBICSA);
-       at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC);
-
-       /* set the bus interface characteristics */
-       at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0)
-                       | AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0));
-
-       at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(2) | AT91_SMC_NCS_WRPULSE_(5)
-                       | AT91_SMC_NRDPULSE_(2) | AT91_SMC_NCS_RDPULSE_(5));
-
-       at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7));
-
-       if (data->bus_width_16)
-               mode = AT91_SMC_DBW_16;
-       else
-               mode = AT91_SMC_DBW_8;
-       at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(1));
-
-       /* enable pin */
-       if (data->enable_pin)
-               at91_set_gpio_output(data->enable_pin, 1);
-
-       /* ready/busy pin */
-       if (data->rdy_pin)
-               at91_set_gpio_input(data->rdy_pin, 1);
-
-       /* card detect pin */
-       if (data->det_pin)
-               at91_set_gpio_input(data->det_pin, 1);
-
-       nand_data = *data;
-       platform_device_register(&at91sam9260_nand_device);
-}
-#else
-void __init at91_add_device_nand(struct at91_nand_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  TWI (i2c)
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
-
-static struct resource twi_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_TWI,
-               .end    = AT91SAM9260_BASE_TWI + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_TWI,
-               .end    = AT91SAM9260_ID_TWI,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9260_twi_device = {
-       .name           = "at91_i2c",
-       .id             = -1,
-       .resource       = twi_resources,
-       .num_resources  = ARRAY_SIZE(twi_resources),
-};
-
-void __init at91_add_device_i2c(void)
-{
-       /* pins used for TWI interface */
-       at91_set_A_periph(AT91_PIN_PA23, 0);            /* TWD */
-       at91_set_multi_drive(AT91_PIN_PA23, 1);
-
-       at91_set_A_periph(AT91_PIN_PA24, 0);            /* TWCK */
-       at91_set_multi_drive(AT91_PIN_PA24, 1);
-
-       platform_device_register(&at91sam9260_twi_device);
-}
-#else
-void __init at91_add_device_i2c(void) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  SPI
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
-static u64 spi_dmamask = 0xffffffffUL;
-
-static struct resource spi0_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_SPI0,
-               .end    = AT91SAM9260_BASE_SPI0 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_SPI0,
-               .end    = AT91SAM9260_ID_SPI0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9260_spi0_device = {
-       .name           = "atmel_spi",
-       .id             = 0,
-       .dev            = {
-                               .dma_mask               = &spi_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-       },
-       .resource       = spi0_resources,
-       .num_resources  = ARRAY_SIZE(spi0_resources),
-};
-
-static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PC11, AT91_PIN_PC16, AT91_PIN_PC17 };
-
-static struct resource spi1_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_SPI1,
-               .end    = AT91SAM9260_BASE_SPI1 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_SPI1,
-               .end    = AT91SAM9260_ID_SPI1,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9260_spi1_device = {
-       .name           = "atmel_spi",
-       .id             = 1,
-       .dev            = {
-                               .dma_mask               = &spi_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-       },
-       .resource       = spi1_resources,
-       .num_resources  = ARRAY_SIZE(spi1_resources),
-};
-
-static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB3, AT91_PIN_PC5, AT91_PIN_PC4, AT91_PIN_PC3 };
-
-void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
-{
-       int i;
-       unsigned long cs_pin;
-       short enable_spi0 = 0;
-       short enable_spi1 = 0;
-
-       /* Choose SPI chip-selects */
-       for (i = 0; i < nr_devices; i++) {
-               if (devices[i].controller_data)
-                       cs_pin = (unsigned long) devices[i].controller_data;
-               else if (devices[i].bus_num == 0)
-                       cs_pin = spi0_standard_cs[devices[i].chip_select];
-               else
-                       cs_pin = spi1_standard_cs[devices[i].chip_select];
-
-               if (devices[i].bus_num == 0)
-                       enable_spi0 = 1;
-               else
-                       enable_spi1 = 1;
-
-               /* enable chip-select pin */
-               at91_set_gpio_output(cs_pin, 1);
-
-               /* pass chip-select pin to driver */
-               devices[i].controller_data = (void *) cs_pin;
-       }
-
-       spi_register_board_info(devices, nr_devices);
-
-       /* Configure SPI bus(es) */
-       if (enable_spi0) {
-               at91_set_A_periph(AT91_PIN_PA0, 0);     /* SPI0_MISO */
-               at91_set_A_periph(AT91_PIN_PA1, 0);     /* SPI0_MOSI */
-               at91_set_A_periph(AT91_PIN_PA2, 0);     /* SPI1_SPCK */
-
-               at91_clock_associate("spi0_clk", &at91sam9260_spi0_device.dev, "spi_clk");
-               platform_device_register(&at91sam9260_spi0_device);
-       }
-       if (enable_spi1) {
-               at91_set_A_periph(AT91_PIN_PB0, 0);     /* SPI1_MISO */
-               at91_set_A_periph(AT91_PIN_PB1, 0);     /* SPI1_MOSI */
-               at91_set_A_periph(AT91_PIN_PB2, 0);     /* SPI1_SPCK */
-
-               at91_clock_associate("spi1_clk", &at91sam9260_spi1_device.dev, "spi_clk");
-               platform_device_register(&at91sam9260_spi1_device);
-       }
-}
-#else
-void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  LEDs
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_LEDS)
-u8 at91_leds_cpu;
-u8 at91_leds_timer;
-
-void __init at91_init_leds(u8 cpu_led, u8 timer_led)
-{
-       at91_leds_cpu   = cpu_led;
-       at91_leds_timer = timer_led;
-}
-#else
-void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  UART
- * -------------------------------------------------------------------- */
-#if defined(CONFIG_SERIAL_ATMEL)
-static struct resource dbgu_resources[] = {
-       [0] = {
-               .start  = AT91_VA_BASE_SYS + AT91_DBGU,
-               .end    = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data dbgu_data = {
-       .use_dma_tx     = 0,
-       .use_dma_rx     = 0,            /* DBGU not capable of receive DMA */
-       .regs           = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
-};
-
-static struct platform_device at91sam9260_dbgu_device = {
-       .name           = "atmel_usart",
-       .id             = 0,
-       .dev            = {
-                               .platform_data  = &dbgu_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = dbgu_resources,
-       .num_resources  = ARRAY_SIZE(dbgu_resources),
-};
-
-static inline void configure_dbgu_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PB14, 0);            /* DRXD */
-       at91_set_A_periph(AT91_PIN_PB15, 1);            /* DTXD */
-}
-
-static struct resource uart0_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_US0,
-               .end    = AT91SAM9260_BASE_US0 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_US0,
-               .end    = AT91SAM9260_ID_US0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart0_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91sam9260_uart0_device = {
-       .name           = "atmel_usart",
-       .id             = 1,
-       .dev            = {
-                               .platform_data  = &uart0_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart0_resources,
-       .num_resources  = ARRAY_SIZE(uart0_resources),
-};
-
-static inline void configure_usart0_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PB4, 1);             /* TXD0 */
-       at91_set_A_periph(AT91_PIN_PB5, 0);             /* RXD0 */
-       at91_set_A_periph(AT91_PIN_PB26, 0);            /* RTS0 */
-       at91_set_A_periph(AT91_PIN_PB27, 0);            /* CTS0 */
-       at91_set_A_periph(AT91_PIN_PB24, 0);            /* DTR0 */
-       at91_set_A_periph(AT91_PIN_PB22, 0);            /* DSR0 */
-       at91_set_A_periph(AT91_PIN_PB23, 0);            /* DCD0 */
-       at91_set_A_periph(AT91_PIN_PB25, 0);            /* RI0 */
-}
-
-static struct resource uart1_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_US1,
-               .end    = AT91SAM9260_BASE_US1 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_US1,
-               .end    = AT91SAM9260_ID_US1,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart1_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91sam9260_uart1_device = {
-       .name           = "atmel_usart",
-       .id             = 2,
-       .dev            = {
-                               .platform_data  = &uart1_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart1_resources,
-       .num_resources  = ARRAY_SIZE(uart1_resources),
-};
-
-static inline void configure_usart1_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PB6, 1);             /* TXD1 */
-       at91_set_A_periph(AT91_PIN_PB7, 0);             /* RXD1 */
-       at91_set_A_periph(AT91_PIN_PB28, 0);            /* RTS1 */
-       at91_set_A_periph(AT91_PIN_PB29, 0);            /* CTS1 */
-}
-
-static struct resource uart2_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_US2,
-               .end    = AT91SAM9260_BASE_US2 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_US2,
-               .end    = AT91SAM9260_ID_US2,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart2_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91sam9260_uart2_device = {
-       .name           = "atmel_usart",
-       .id             = 3,
-       .dev            = {
-                               .platform_data  = &uart2_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart2_resources,
-       .num_resources  = ARRAY_SIZE(uart2_resources),
-};
-
-static inline void configure_usart2_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PB8, 1);             /* TXD2 */
-       at91_set_A_periph(AT91_PIN_PB9, 0);             /* RXD2 */
-}
-
-static struct resource uart3_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_US3,
-               .end    = AT91SAM9260_BASE_US3 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_US3,
-               .end    = AT91SAM9260_ID_US3,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart3_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91sam9260_uart3_device = {
-       .name           = "atmel_usart",
-       .id             = 4,
-       .dev            = {
-                               .platform_data  = &uart3_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart3_resources,
-       .num_resources  = ARRAY_SIZE(uart3_resources),
-};
-
-static inline void configure_usart3_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PB10, 1);            /* TXD3 */
-       at91_set_A_periph(AT91_PIN_PB11, 0);            /* RXD3 */
-}
-
-static struct resource uart4_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_US4,
-               .end    = AT91SAM9260_BASE_US4 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_US4,
-               .end    = AT91SAM9260_ID_US4,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart4_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91sam9260_uart4_device = {
-       .name           = "atmel_usart",
-       .id             = 5,
-       .dev            = {
-                               .platform_data  = &uart4_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart4_resources,
-       .num_resources  = ARRAY_SIZE(uart4_resources),
-};
-
-static inline void configure_usart4_pins(void)
-{
-       at91_set_B_periph(AT91_PIN_PA31, 1);            /* TXD4 */
-       at91_set_B_periph(AT91_PIN_PA30, 0);            /* RXD4 */
-}
-
-static struct resource uart5_resources[] = {
-       [0] = {
-               .start  = AT91SAM9260_BASE_US5,
-               .end    = AT91SAM9260_BASE_US5 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9260_ID_US5,
-               .end    = AT91SAM9260_ID_US5,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart5_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91sam9260_uart5_device = {
-       .name           = "atmel_usart",
-       .id             = 6,
-       .dev            = {
-                               .platform_data  = &uart5_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart5_resources,
-       .num_resources  = ARRAY_SIZE(uart5_resources),
-};
-
-static inline void configure_usart5_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PB12, 1);            /* TXD5 */
-       at91_set_A_periph(AT91_PIN_PB13, 0);            /* RXD5 */
-}
-
-struct platform_device *at91_uarts[ATMEL_MAX_UART];    /* the UARTs to use */
-struct platform_device *atmel_default_console_device;  /* the serial console device */
-
-void __init at91_init_serial(struct at91_uart_config *config)
-{
-       int i;
-
-       /* Fill in list of supported UARTs */
-       for (i = 0; i < config->nr_tty; i++) {
-               switch (config->tty_map[i]) {
-                       case 0:
-                               configure_usart0_pins();
-                               at91_uarts[i] = &at91sam9260_uart0_device;
-                               at91_clock_associate("usart0_clk", &at91sam9260_uart0_device.dev, "usart");
-                               break;
-                       case 1:
-                               configure_usart1_pins();
-                               at91_uarts[i] = &at91sam9260_uart1_device;
-                               at91_clock_associate("usart1_clk", &at91sam9260_uart1_device.dev, "usart");
-                               break;
-                       case 2:
-                               configure_usart2_pins();
-                               at91_uarts[i] = &at91sam9260_uart2_device;
-                               at91_clock_associate("usart2_clk", &at91sam9260_uart2_device.dev, "usart");
-                               break;
-                       case 3:
-                               configure_usart3_pins();
-                               at91_uarts[i] = &at91sam9260_uart3_device;
-                               at91_clock_associate("usart3_clk", &at91sam9260_uart3_device.dev, "usart");
-                               break;
-                       case 4:
-                               configure_usart4_pins();
-                               at91_uarts[i] = &at91sam9260_uart4_device;
-                               at91_clock_associate("usart4_clk", &at91sam9260_uart4_device.dev, "usart");
-                               break;
-                       case 5:
-                               configure_usart5_pins();
-                               at91_uarts[i] = &at91sam9260_uart5_device;
-                               at91_clock_associate("usart5_clk", &at91sam9260_uart5_device.dev, "usart");
-                               break;
-                       case 6:
-                               configure_dbgu_pins();
-                               at91_uarts[i] = &at91sam9260_dbgu_device;
-                               at91_clock_associate("mck", &at91sam9260_dbgu_device.dev, "usart");
-                               break;
-                       default:
-                               continue;
-               }
-               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
-       }
-
-       /* Set serial console device */
-       if (config->console_tty < ATMEL_MAX_UART)
-               atmel_default_console_device = at91_uarts[config->console_tty];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
-}
-
-void __init at91_add_device_serial(void)
-{
-       int i;
-
-       for (i = 0; i < ATMEL_MAX_UART; i++) {
-               if (at91_uarts[i])
-                       platform_device_register(at91_uarts[i]);
-       }
-}
-#else
-void __init at91_init_serial(struct at91_uart_config *config) {}
-void __init at91_add_device_serial(void) {}
-#endif
-
-
-/* -------------------------------------------------------------------- */
-/*
- * These devices are always present and don't need any board-specific
- * setup.
- */
-static int __init at91_add_standard_devices(void)
-{
-       return 0;
-}
-
-arch_initcall(at91_add_standard_devices);
diff --git a/arch/arm/mach-at91rm9200/at91sam9261.c b/arch/arm/mach-at91rm9200/at91sam9261.c
deleted file mode 100644 (file)
index d242bb8..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * arch/arm/mach-at91rm9200/at91sam9261.c
- *
- *  Copyright (C) 2005 SAN People
- *
- * 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/module.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/arch/at91sam9261.h>
-#include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
-
-#include "generic.h"
-#include "clock.h"
-
-static struct map_desc at91sam9261_io_desc[] __initdata = {
-       {
-               .virtual        = AT91_VA_BASE_SYS,
-               .pfn            = __phys_to_pfn(AT91_BASE_SYS),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_IO_VIRT_BASE - AT91SAM9261_SRAM_SIZE,
-               .pfn            = __phys_to_pfn(AT91SAM9261_SRAM_BASE),
-               .length         = AT91SAM9261_SRAM_SIZE,
-               .type           = MT_DEVICE,
-       },
-};
-
-/* --------------------------------------------------------------------
- *  Clocks
- * -------------------------------------------------------------------- */
-
-/*
- * The peripheral clocks.
- */
-static struct clk pioA_clk = {
-       .name           = "pioA_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_PIOA,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioB_clk = {
-       .name           = "pioB_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_PIOB,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioC_clk = {
-       .name           = "pioC_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_PIOC,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart0_clk = {
-       .name           = "usart0_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_US0,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart1_clk = {
-       .name           = "usart1_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_US1,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart2_clk = {
-       .name           = "usart2_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_US2,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk mmc_clk = {
-       .name           = "mci_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_MCI,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk udc_clk = {
-       .name           = "udc_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_UDP,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk twi_clk = {
-       .name           = "twi_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_TWI,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk spi0_clk = {
-       .name           = "spi0_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_SPI0,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk spi1_clk = {
-       .name           = "spi1_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_SPI1,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk ohci_clk = {
-       .name           = "ohci_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_UHP,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-static struct clk lcdc_clk = {
-       .name           = "lcdc_clk",
-       .pmc_mask       = 1 << AT91SAM9261_ID_LCDC,
-       .type           = CLK_TYPE_PERIPHERAL,
-};
-
-static struct clk *periph_clocks[] __initdata = {
-       &pioA_clk,
-       &pioB_clk,
-       &pioC_clk,
-       &usart0_clk,
-       &usart1_clk,
-       &usart2_clk,
-       &mmc_clk,
-       &udc_clk,
-       &twi_clk,
-       &spi0_clk,
-       &spi1_clk,
-       // ssc 0 .. ssc2
-       // tc0 .. tc2
-       &ohci_clk,
-       &lcdc_clk,
-       // irq0 .. irq2
-};
-
-/*
- * The four programmable clocks.
- * You must configure pin multiplexing to bring these signals out.
- */
-static struct clk pck0 = {
-       .name           = "pck0",
-       .pmc_mask       = AT91_PMC_PCK0,
-       .type           = CLK_TYPE_PROGRAMMABLE,
-       .id             = 0,
-};
-static struct clk pck1 = {
-       .name           = "pck1",
-       .pmc_mask       = AT91_PMC_PCK1,
-       .type           = CLK_TYPE_PROGRAMMABLE,
-       .id             = 1,
-};
-static struct clk pck2 = {
-       .name           = "pck2",
-       .pmc_mask       = AT91_PMC_PCK2,
-       .type           = CLK_TYPE_PROGRAMMABLE,
-       .id             = 2,
-};
-static struct clk pck3 = {
-       .name           = "pck3",
-       .pmc_mask       = AT91_PMC_PCK3,
-       .type           = CLK_TYPE_PROGRAMMABLE,
-       .id             = 3,
-};
-
-/* HClocks */
-static struct clk hck0 = {
-       .name           = "hck0",
-       .pmc_mask       = AT91_PMC_HCK0,
-       .type           = CLK_TYPE_SYSTEM,
-       .id             = 0,
-};
-static struct clk hck1 = {
-       .name           = "hck1",
-       .pmc_mask       = AT91_PMC_HCK1,
-       .type           = CLK_TYPE_SYSTEM,
-       .id             = 1,
-};
-
-static void __init at91sam9261_register_clocks(void)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
-               clk_register(periph_clocks[i]);
-
-       clk_register(&pck0);
-       clk_register(&pck1);
-       clk_register(&pck2);
-       clk_register(&pck3);
-
-       clk_register(&hck0);
-       clk_register(&hck1);
-}
-
-/* --------------------------------------------------------------------
- *  GPIO
- * -------------------------------------------------------------------- */
-
-static struct at91_gpio_bank at91sam9261_gpio[] = {
-       {
-               .id             = AT91SAM9261_ID_PIOA,
-               .offset         = AT91_PIOA,
-               .clock          = &pioA_clk,
-       }, {
-               .id             = AT91SAM9261_ID_PIOB,
-               .offset         = AT91_PIOB,
-               .clock          = &pioB_clk,
-       }, {
-               .id             = AT91SAM9261_ID_PIOC,
-               .offset         = AT91_PIOC,
-               .clock          = &pioC_clk,
-       }
-};
-
-static void at91sam9261_reset(void)
-{
-       at91_sys_write(AT91_RSTC_CR, (0xA5 << 24) | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
-}
-
-
-/* --------------------------------------------------------------------
- *  AT91SAM9261 processor initialization
- * -------------------------------------------------------------------- */
-
-void __init at91sam9261_initialize(unsigned long main_clock)
-{
-       /* Map peripherals */
-       iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc));
-
-       at91_arch_reset = at91sam9261_reset;
-       at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
-                       | (1 << AT91SAM9261_ID_IRQ2);
-
-       /* Init clock subsystem */
-       at91_clock_init(main_clock);
-
-       /* Register the processor-specific clocks */
-       at91sam9261_register_clocks();
-
-       /* Register GPIO subsystem */
-       at91_gpio_init(at91sam9261_gpio, 3);
-}
-
-/* --------------------------------------------------------------------
- *  Interrupt initialization
- * -------------------------------------------------------------------- */
-
-/*
- * The default interrupt priority levels (0 = lowest, 7 = highest).
- */
-static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {
-       7,      /* Advanced Interrupt Controller */
-       7,      /* System Peripherals */
-       0,      /* Parallel IO Controller A */
-       0,      /* Parallel IO Controller B */
-       0,      /* Parallel IO Controller C */
-       0,
-       6,      /* USART 0 */
-       6,      /* USART 1 */
-       6,      /* USART 2 */
-       0,      /* Multimedia Card Interface */
-       4,      /* USB Device Port */
-       0,      /* Two-Wire Interface */
-       6,      /* Serial Peripheral Interface 0 */
-       6,      /* Serial Peripheral Interface 1 */
-       5,      /* Serial Synchronous Controller 0 */
-       5,      /* Serial Synchronous Controller 1 */
-       5,      /* Serial Synchronous Controller 2 */
-       0,      /* Timer Counter 0 */
-       0,      /* Timer Counter 1 */
-       0,      /* Timer Counter 2 */
-       3,      /* USB Host port */
-       3,      /* LCD Controller */
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,      /* Advanced Interrupt Controller */
-       0,      /* Advanced Interrupt Controller */
-       0,      /* Advanced Interrupt Controller */
-};
-
-void __init at91sam9261_init_interrupts(unsigned int priority[NR_AIC_IRQS])
-{
-       if (!priority)
-               priority = at91sam9261_default_irq_priority;
-
-       /* Initialize the AIC interrupt controller */
-       at91_aic_init(priority);
-
-       /* Enable GPIO interrupts */
-       at91_gpio_irq_setup();
-}
diff --git a/arch/arm/mach-at91rm9200/at91sam9261_devices.c b/arch/arm/mach-at91rm9200/at91sam9261_devices.c
deleted file mode 100644 (file)
index ed1d790..0000000
+++ /dev/null
@@ -1,741 +0,0 @@
-/*
- * arch/arm/mach-at91rm9200/at91sam9261_devices.c
- *
- *  Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
- *  Copyright (C) 2005 David Brownell
- *
- * 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/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <linux/platform_device.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-#include <asm/arch/at91sam9261.h>
-#include <asm/arch/at91sam9261_matrix.h>
-#include <asm/arch/at91sam926x_mc.h>
-
-#include "generic.h"
-
-#define SZ_512 0x00000200
-#define SZ_256 0x00000100
-#define SZ_16  0x00000010
-
-/* --------------------------------------------------------------------
- *  USB Host
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-static u64 ohci_dmamask = 0xffffffffUL;
-static struct at91_usbh_data usbh_data;
-
-static struct resource usbh_resources[] = {
-       [0] = {
-               .start  = AT91SAM9261_UHP_BASE,
-               .end    = AT91SAM9261_UHP_BASE + SZ_1M - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9261_ID_UHP,
-               .end    = AT91SAM9261_ID_UHP,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9261_usbh_device = {
-       .name           = "at91_ohci",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &ohci_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-                               .platform_data          = &usbh_data,
-       },
-       .resource       = usbh_resources,
-       .num_resources  = ARRAY_SIZE(usbh_resources),
-};
-
-void __init at91_add_device_usbh(struct at91_usbh_data *data)
-{
-       if (!data)
-               return;
-
-       usbh_data = *data;
-       platform_device_register(&at91sam9261_usbh_device);
-}
-#else
-void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  USB Device (Gadget)
- * -------------------------------------------------------------------- */
-
-#ifdef CONFIG_USB_GADGET_AT91
-static struct at91_udc_data udc_data;
-
-static struct resource udc_resources[] = {
-       [0] = {
-               .start  = AT91SAM9261_BASE_UDP,
-               .end    = AT91SAM9261_BASE_UDP + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9261_ID_UDP,
-               .end    = AT91SAM9261_ID_UDP,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9261_udc_device = {
-       .name           = "at91_udc",
-       .id             = -1,
-       .dev            = {
-                               .platform_data          = &udc_data,
-       },
-       .resource       = udc_resources,
-       .num_resources  = ARRAY_SIZE(udc_resources),
-};
-
-void __init at91_add_device_udc(struct at91_udc_data *data)
-{
-       unsigned long x;
-
-       if (!data)
-               return;
-
-       if (data->vbus_pin) {
-               at91_set_gpio_input(data->vbus_pin, 0);
-               at91_set_deglitch(data->vbus_pin, 1);
-       }
-
-       /* Pullup pin is handled internally */
-       x = at91_sys_read(AT91_MATRIX_USBPUCR);
-       at91_sys_write(AT91_MATRIX_USBPUCR, x | AT91_MATRIX_USBPUCR_PUON);
-
-       udc_data = *data;
-       platform_device_register(&at91sam9261_udc_device);
-}
-#else
-void __init at91_add_device_udc(struct at91_udc_data *data) {}
-#endif
-
-/* --------------------------------------------------------------------
- *  MMC / SD
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
-static u64 mmc_dmamask = 0xffffffffUL;
-static struct at91_mmc_data mmc_data;
-
-static struct resource mmc_resources[] = {
-       [0] = {
-               .start  = AT91SAM9261_BASE_MCI,
-               .end    = AT91SAM9261_BASE_MCI + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9261_ID_MCI,
-               .end    = AT91SAM9261_ID_MCI,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9261_mmc_device = {
-       .name           = "at91_mci",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &mmc_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-                               .platform_data          = &mmc_data,
-       },
-       .resource       = mmc_resources,
-       .num_resources  = ARRAY_SIZE(mmc_resources),
-};
-
-void __init at91_add_device_mmc(struct at91_mmc_data *data)
-{
-       if (!data)
-               return;
-
-       /* input/irq */
-       if (data->det_pin) {
-               at91_set_gpio_input(data->det_pin, 1);
-               at91_set_deglitch(data->det_pin, 1);
-       }
-       if (data->wp_pin)
-               at91_set_gpio_input(data->wp_pin, 1);
-       if (data->vcc_pin)
-               at91_set_gpio_output(data->vcc_pin, 0);
-
-       /* CLK */
-       at91_set_B_periph(AT91_PIN_PA2, 0);
-
-       /* CMD */
-       at91_set_B_periph(AT91_PIN_PA1, 1);
-
-       /* DAT0, maybe DAT1..DAT3 */
-       at91_set_B_periph(AT91_PIN_PA0, 1);
-       if (data->wire4) {
-               at91_set_B_periph(AT91_PIN_PA4, 1);
-               at91_set_B_periph(AT91_PIN_PA5, 1);
-               at91_set_B_periph(AT91_PIN_PA6, 1);
-       }
-
-       mmc_data = *data;
-       platform_device_register(&at91sam9261_mmc_device);
-}
-#else
-void __init at91_add_device_mmc(struct at91_mmc_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  NAND / SmartMedia
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
-static struct at91_nand_data nand_data;
-
-#define NAND_BASE      AT91_CHIPSELECT_3
-
-static struct resource nand_resources[] = {
-       {
-               .start  = NAND_BASE,
-               .end    = NAND_BASE + SZ_256M - 1,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device at91_nand_device = {
-       .name           = "at91_nand",
-       .id             = -1,
-       .dev            = {
-                               .platform_data  = &nand_data,
-       },
-       .resource       = nand_resources,
-       .num_resources  = ARRAY_SIZE(nand_resources),
-};
-
-void __init at91_add_device_nand(struct at91_nand_data *data)
-{
-       unsigned long csa, mode;
-
-       if (!data)
-               return;
-
-       csa = at91_sys_read(AT91_MATRIX_EBICSA);
-       at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC);
-
-       /* set the bus interface characteristics */
-       at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0)
-                       | AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0));
-
-       at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(2) | AT91_SMC_NCS_WRPULSE_(5)
-                       | AT91_SMC_NRDPULSE_(2) | AT91_SMC_NCS_RDPULSE_(5));
-
-       at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7));
-
-       if (data->bus_width_16)
-               mode = AT91_SMC_DBW_16;
-       else
-               mode = AT91_SMC_DBW_8;
-       at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(1));
-
-       /* enable pin */
-       if (data->enable_pin)
-               at91_set_gpio_output(data->enable_pin, 1);
-
-       /* ready/busy pin */
-       if (data->rdy_pin)
-               at91_set_gpio_input(data->rdy_pin, 1);
-
-       /* card detect pin */
-       if (data->det_pin)
-               at91_set_gpio_input(data->det_pin, 1);
-
-       at91_set_A_periph(AT91_PIN_PC0, 0);             /* NANDOE */
-       at91_set_A_periph(AT91_PIN_PC1, 0);             /* NANDWE */
-
-       nand_data = *data;
-       platform_device_register(&at91_nand_device);
-}
-
-#else
-void __init at91_add_device_nand(struct at91_nand_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  TWI (i2c)
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
-
-static struct resource twi_resources[] = {
-       [0] = {
-               .start  = AT91SAM9261_BASE_TWI,
-               .end    = AT91SAM9261_BASE_TWI + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9261_ID_TWI,
-               .end    = AT91SAM9261_ID_TWI,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9261_twi_device = {
-       .name           = "at91_i2c",
-       .id             = -1,
-       .resource       = twi_resources,
-       .num_resources  = ARRAY_SIZE(twi_resources),
-};
-
-void __init at91_add_device_i2c(void)
-{
-       /* pins used for TWI interface */
-       at91_set_A_periph(AT91_PIN_PA7, 0);             /* TWD */
-       at91_set_multi_drive(AT91_PIN_PA7, 1);
-
-       at91_set_A_periph(AT91_PIN_PA8, 0);             /* TWCK */
-       at91_set_multi_drive(AT91_PIN_PA8, 1);
-
-       platform_device_register(&at91sam9261_twi_device);
-}
-#else
-void __init at91_add_device_i2c(void) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  SPI
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
-static u64 spi_dmamask = 0xffffffffUL;
-
-static struct resource spi0_resources[] = {
-       [0] = {
-               .start  = AT91SAM9261_BASE_SPI0,
-               .end    = AT91SAM9261_BASE_SPI0 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9261_ID_SPI0,
-               .end    = AT91SAM9261_ID_SPI0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9261_spi0_device = {
-       .name           = "atmel_spi",
-       .id             = 0,
-       .dev            = {
-                               .dma_mask               = &spi_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-       },
-       .resource       = spi0_resources,
-       .num_resources  = ARRAY_SIZE(spi0_resources),
-};
-
-static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PA4, AT91_PIN_PA5, AT91_PIN_PA6 };
-
-static struct resource spi1_resources[] = {
-       [0] = {
-               .start  = AT91SAM9261_BASE_SPI1,
-               .end    = AT91SAM9261_BASE_SPI1 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9261_ID_SPI1,
-               .end    = AT91SAM9261_ID_SPI1,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device at91sam9261_spi1_device = {
-       .name           = "atmel_spi",
-       .id             = 1,
-       .dev            = {
-                               .dma_mask               = &spi_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-       },
-       .resource       = spi1_resources,
-       .num_resources  = ARRAY_SIZE(spi1_resources),
-};
-
-static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB28, AT91_PIN_PA24, AT91_PIN_PA25, AT91_PIN_PA26 };
-
-void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
-{
-       int i;
-       unsigned long cs_pin;
-       short enable_spi0 = 0;
-       short enable_spi1 = 0;
-
-       /* Choose SPI chip-selects */
-       for (i = 0; i < nr_devices; i++) {
-               if (devices[i].controller_data)
-                       cs_pin = (unsigned long) devices[i].controller_data;
-               else if (devices[i].bus_num == 0)
-                       cs_pin = spi0_standard_cs[devices[i].chip_select];
-               else
-                       cs_pin = spi1_standard_cs[devices[i].chip_select];
-
-               if (devices[i].bus_num == 0)
-                       enable_spi0 = 1;
-               else
-                       enable_spi1 = 1;
-
-               /* enable chip-select pin */
-               at91_set_gpio_output(cs_pin, 1);
-
-               /* pass chip-select pin to driver */
-               devices[i].controller_data = (void *) cs_pin;
-       }
-
-       spi_register_board_info(devices, nr_devices);
-
-       /* Configure SPI bus(es) */
-       if (enable_spi0) {
-               at91_set_A_periph(AT91_PIN_PA0, 0);     /* SPI0_MISO */
-               at91_set_A_periph(AT91_PIN_PA1, 0);     /* SPI0_MOSI */
-               at91_set_A_periph(AT91_PIN_PA2, 0);     /* SPI0_SPCK */
-
-               at91_clock_associate("spi0_clk", &at91sam9261_spi0_device.dev, "spi_clk");
-               platform_device_register(&at91sam9261_spi0_device);
-       }
-       if (enable_spi1) {
-               at91_set_A_periph(AT91_PIN_PB30, 0);    /* SPI1_MISO */
-               at91_set_A_periph(AT91_PIN_PB31, 0);    /* SPI1_MOSI */
-               at91_set_A_periph(AT91_PIN_PB29, 0);    /* SPI1_SPCK */
-
-               at91_clock_associate("spi1_clk", &at91sam9261_spi1_device.dev, "spi_clk");
-               platform_device_register(&at91sam9261_spi1_device);
-       }
-}
-#else
-void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  LCD Controller
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_FB_AT91) || defined(CONFIG_FB_AT91_MODULE)
-static u64 lcdc_dmamask = 0xffffffffUL;
-static struct at91fb_info lcdc_data;
-
-static struct resource lcdc_resources[] = {
-       [0] = {
-               .start  = AT91SAM9261_LCDC_BASE,
-               .end    = AT91SAM9261_LCDC_BASE + SZ_4K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9261_ID_LCDC,
-               .end    = AT91SAM9261_ID_LCDC,
-               .flags  = IORESOURCE_IRQ,
-       },
-#if defined(CONFIG_FB_INTSRAM)
-       [2] = {
-               .start  = AT91SAM9261_SRAM_BASE,
-               .end    = AT91SAM9261_SRAM_BASE + AT91SAM9261_SRAM_SIZE - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-#endif
-};
-
-static struct platform_device at91_lcdc_device = {
-       .name           = "at91-fb",
-       .id             = 0,
-       .dev            = {
-                               .dma_mask               = &lcdc_dmamask,
-                               .coherent_dma_mask      = 0xffffffff,
-                               .platform_data          = &lcdc_data,
-       },
-       .resource       = lcdc_resources,
-       .num_resources  = ARRAY_SIZE(lcdc_resources),
-};
-
-void __init at91_add_device_lcdc(struct at91fb_info *data)
-{
-       if (!data) {
-               return;
-       }
-
-       at91_set_A_periph(AT91_PIN_PB1, 0);     /* LCDHSYNC */
-       at91_set_A_periph(AT91_PIN_PB2, 0);     /* LCDDOTCK */
-       at91_set_A_periph(AT91_PIN_PB3, 0);     /* LCDDEN */
-       at91_set_A_periph(AT91_PIN_PB4, 0);     /* LCDCC */
-       at91_set_A_periph(AT91_PIN_PB7, 0);     /* LCDD2 */
-       at91_set_A_periph(AT91_PIN_PB8, 0);     /* LCDD3 */
-       at91_set_A_periph(AT91_PIN_PB9, 0);     /* LCDD4 */
-       at91_set_A_periph(AT91_PIN_PB10, 0);    /* LCDD5 */
-       at91_set_A_periph(AT91_PIN_PB11, 0);    /* LCDD6 */
-       at91_set_A_periph(AT91_PIN_PB12, 0);    /* LCDD7 */
-       at91_set_A_periph(AT91_PIN_PB15, 0);    /* LCDD10 */
-       at91_set_A_periph(AT91_PIN_PB16, 0);    /* LCDD11 */
-       at91_set_A_periph(AT91_PIN_PB17, 0);    /* LCDD12 */
-       at91_set_A_periph(AT91_PIN_PB18, 0);    /* LCDD13 */
-       at91_set_A_periph(AT91_PIN_PB19, 0);    /* LCDD14 */
-       at91_set_A_periph(AT91_PIN_PB20, 0);    /* LCDD15 */
-       at91_set_B_periph(AT91_PIN_PB23, 0);    /* LCDD18 */
-       at91_set_B_periph(AT91_PIN_PB24, 0);    /* LCDD19 */
-       at91_set_B_periph(AT91_PIN_PB25, 0);    /* LCDD20 */
-       at91_set_B_periph(AT91_PIN_PB26, 0);    /* LCDD21 */
-       at91_set_B_periph(AT91_PIN_PB27, 0);    /* LCDD22 */
-       at91_set_B_periph(AT91_PIN_PB28, 0);    /* LCDD23 */
-
-       lcdc_data = *data;
-       platform_device_register(&at91_lcdc_device);
-}
-#else
-void __init at91_add_device_lcdc(struct at91fb_info *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  LEDs
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_LEDS)
-u8 at91_leds_cpu;
-u8 at91_leds_timer;
-
-void __init at91_init_leds(u8 cpu_led, u8 timer_led)
-{
-       at91_leds_cpu   = cpu_led;
-       at91_leds_timer = timer_led;
-}
-#else
-void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  UART
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_SERIAL_ATMEL)
-static struct resource dbgu_resources[] = {
-       [0] = {
-               .start  = AT91_VA_BASE_SYS + AT91_DBGU,
-               .end    = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data dbgu_data = {
-       .use_dma_tx     = 0,
-       .use_dma_rx     = 0,            /* DBGU not capable of receive DMA */
-       .regs           = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
-};
-
-static struct platform_device at91sam9261_dbgu_device = {
-       .name           = "atmel_usart",
-       .id             = 0,
-       .dev            = {
-                               .platform_data  = &dbgu_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = dbgu_resources,
-       .num_resources  = ARRAY_SIZE(dbgu_resources),
-};
-
-static inline void configure_dbgu_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PA9, 0);             /* DRXD */
-       at91_set_A_periph(AT91_PIN_PA10, 1);            /* DTXD */
-}
-
-static struct resource uart0_resources[] = {
-       [0] = {
-               .start  = AT91SAM9261_BASE_US0,
-               .end    = AT91SAM9261_BASE_US0 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9261_ID_US0,
-               .end    = AT91SAM9261_ID_US0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart0_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91sam9261_uart0_device = {
-       .name           = "atmel_usart",
-       .id             = 1,
-       .dev            = {
-                               .platform_data  = &uart0_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart0_resources,
-       .num_resources  = ARRAY_SIZE(uart0_resources),
-};
-
-static inline void configure_usart0_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PC8, 1);             /* TXD0 */
-       at91_set_A_periph(AT91_PIN_PC9, 0);             /* RXD0 */
-       at91_set_A_periph(AT91_PIN_PC10, 0);            /* RTS0 */
-       at91_set_A_periph(AT91_PIN_PC11, 0);            /* CTS0 */
-}
-
-static struct resource uart1_resources[] = {
-       [0] = {
-               .start  = AT91SAM9261_BASE_US1,
-               .end    = AT91SAM9261_BASE_US1 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9261_ID_US1,
-               .end    = AT91SAM9261_ID_US1,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart1_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91sam9261_uart1_device = {
-       .name           = "atmel_usart",
-       .id             = 2,
-       .dev            = {
-                               .platform_data  = &uart1_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart1_resources,
-       .num_resources  = ARRAY_SIZE(uart1_resources),
-};
-
-static inline void configure_usart1_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PC12, 1);            /* TXD1 */
-       at91_set_A_periph(AT91_PIN_PC13, 0);            /* RXD1 */
-}
-
-static struct resource uart2_resources[] = {
-       [0] = {
-               .start  = AT91SAM9261_BASE_US2,
-               .end    = AT91SAM9261_BASE_US2 + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AT91SAM9261_ID_US2,
-               .end    = AT91SAM9261_ID_US2,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct atmel_uart_data uart2_data = {
-       .use_dma_tx     = 1,
-       .use_dma_rx     = 1,
-};
-
-static struct platform_device at91sam9261_uart2_device = {
-       .name           = "atmel_usart",
-       .id             = 3,
-       .dev            = {
-                               .platform_data  = &uart2_data,
-                               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource       = uart2_resources,
-       .num_resources  = ARRAY_SIZE(uart2_resources),
-};
-
-static inline void configure_usart2_pins(void)
-{
-       at91_set_A_periph(AT91_PIN_PC15, 0);            /* RXD2 */
-       at91_set_A_periph(AT91_PIN_PC14, 1);            /* TXD2 */
-}
-
-struct platform_device *at91_uarts[ATMEL_MAX_UART];    /* the UARTs to use */
-struct platform_device *atmel_default_console_device;  /* the serial console device */
-
-void __init at91_init_serial(struct at91_uart_config *config)
-{
-       int i;
-
-       /* Fill in list of supported UARTs */
-       for (i = 0; i < config->nr_tty; i++) {
-               switch (config->tty_map[i]) {
-                       case 0:
-                               configure_usart0_pins();
-                               at91_uarts[i] = &at91sam9261_uart0_device;
-                               at91_clock_associate("usart0_clk", &at91sam9261_uart0_device.dev, "usart");
-                               break;
-                       case 1:
-                               configure_usart1_pins();
-                               at91_uarts[i] = &at91sam9261_uart1_device;
-                               at91_clock_associate("usart1_clk", &at91sam9261_uart1_device.dev, "usart");
-                               break;
-                       case 2:
-                               configure_usart2_pins();
-                               at91_uarts[i] = &at91sam9261_uart2_device;
-                               at91_clock_associate("usart2_clk", &at91sam9261_uart2_device.dev, "usart");
-                               break;
-                       case 3:
-                               configure_dbgu_pins();
-                               at91_uarts[i] = &at91sam9261_dbgu_device;
-                               at91_clock_associate("mck", &at91sam9261_dbgu_device.dev, "usart");
-                               break;
-                       default:
-                               continue;
-               }
-               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
-       }
-
-       /* Set serial console device */
-       if (config->console_tty < ATMEL_MAX_UART)
-               atmel_default_console_device = at91_uarts[config->console_tty];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
-}
-
-void __init at91_add_device_serial(void)
-{
-       int i;
-
-       for (i = 0; i < ATMEL_MAX_UART; i++) {
-               if (at91_uarts[i])
-                       platform_device_register(at91_uarts[i]);
-       }
-}
-#else
-void __init at91_init_serial(struct at91_uart_config *config) {}
-void __init at91_add_device_serial(void) {}
-#endif
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * These devices are always present and don't need any board-specific
- * setup.
- */
-static int __init at91_add_standard_devices(void)
-{
-       return 0;
-}
-
-arch_initcall(at91_add_standard_devices);
diff --git a/arch/arm/mach-at91rm9200/at91sam926x_time.c b/arch/arm/mach-at91rm9200/at91sam926x_time.c
deleted file mode 100644 (file)
index 99df5f6..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/at91sam926x_time.c
- *
- * Copyright (C) 2005-2006 M. Amine SAYA, ATMEL Rousset, France
- * Revision     2005 M. Nicolas Diremdjian, ATMEL Rousset, France
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/time.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/mach/time.h>
-
-#include <asm/arch/at91_pit.h>
-
-
-#define PIT_CPIV(x)    ((x) & AT91_PIT_CPIV)
-#define PIT_PICNT(x)   (((x) & AT91_PIT_PICNT) >> 20)
-
-/*
- * Returns number of microseconds since last timer interrupt.  Note that interrupts
- * will have been disabled by do_gettimeofday()
- *  'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
- *  'tick' is usecs per jiffy (linux/timex.h).
- */
-static unsigned long at91sam926x_gettimeoffset(void)
-{
-       unsigned long elapsed;
-       unsigned long t = at91_sys_read(AT91_PIT_PIIR);
-
-       elapsed = (PIT_PICNT(t) * LATCH) + PIT_CPIV(t);         /* hardware clock cycles */
-
-       return (unsigned long)(elapsed * 1000000) / LATCH;
-}
-
-/*
- * IRQ handler for the timer.
- */
-static irqreturn_t at91sam926x_timer_interrupt(int irq, void *dev_id)
-{
-       volatile long nr_ticks;
-
-       if (at91_sys_read(AT91_PIT_SR) & AT91_PIT_PITS) {       /* This is a shared interrupt */
-               write_seqlock(&xtime_lock);
-
-               /* Get number to ticks performed before interrupt and clear PIT interrupt */
-               nr_ticks = PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
-               do {
-                       timer_tick();
-                       nr_ticks--;
-               } while (nr_ticks);
-
-               write_sequnlock(&xtime_lock);
-               return IRQ_HANDLED;
-       } else
-               return IRQ_NONE;                /* not handled */
-}
-
-static struct irqaction at91sam926x_timer_irq = {
-       .name           = "at91_tick",
-       .flags          = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER,
-       .handler        = at91sam926x_timer_interrupt
-};
-
-void at91sam926x_timer_reset(void)
-{
-       /* Disable timer */
-       at91_sys_write(AT91_PIT_MR, 0);
-
-       /* Clear any pending interrupts */
-       (void) at91_sys_read(AT91_PIT_PIVR);
-
-       /* Set Period Interval timer and enable its interrupt */
-       at91_sys_write(AT91_PIT_MR, (LATCH & AT91_PIT_PIV) | AT91_PIT_PITIEN | AT91_PIT_PITEN);
-}
-
-/*
- * Set up timer interrupt.
- */
-void __init at91sam926x_timer_init(void)
-{
-       /* Initialize and enable the timer */
-       at91sam926x_timer_reset();
-
-       /* Make IRQs happen for the system timer. */
-       setup_irq(AT91_ID_SYS, &at91sam926x_timer_irq);
-}
-
-#ifdef CONFIG_PM
-static void at91sam926x_timer_suspend(void)
-{
-       /* Disable timer */
-       at91_sys_write(AT91_PIT_MR, 0);
-}
-#else
-#define at91sam926x_timer_suspend      NULL
-#endif
-
-struct sys_timer at91sam926x_timer = {
-       .init           = at91sam926x_timer_init,
-       .offset         = at91sam926x_gettimeoffset,
-       .suspend        = at91sam926x_timer_suspend,
-       .resume         = at91sam926x_timer_reset,
-};
-
diff --git a/arch/arm/mach-at91rm9200/board-1arm.c b/arch/arm/mach-at91rm9200/board-1arm.c
deleted file mode 100644 (file)
index 971c3e2..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-1arm.c
- *
- *  Copyright (C) 2005 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata onearm_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 3,
-       .tty_map        = { 4, 0, 1, -1, -1 },          /* ttyS0, ..., ttyS4 */
-};
-
-static void __init onearm_map_io(void)
-{
-       /* Initialize processor: 18.432 MHz crystal */
-       at91rm9200_initialize(18432000, AT91RM9200_PQFP);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&onearm_uart_config);
-}
-
-static void __init onearm_init_irq(void)
-{
-       at91rm9200_init_interrupts(NULL);
-}
-
-static struct at91_eth_data __initdata onearm_eth_data = {
-       .phy_irq_pin    = AT91_PIN_PC4,
-       .is_rmii        = 1,
-};
-
-static struct at91_usbh_data __initdata onearm_usbh_data = {
-       .ports          = 1,
-};
-
-static struct at91_udc_data __initdata onearm_udc_data = {
-       .vbus_pin       = AT91_PIN_PC2,
-       .pullup_pin     = AT91_PIN_PC3,
-};
-
-static void __init onearm_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* Ethernet */
-       at91_add_device_eth(&onearm_eth_data);
-       /* USB Host */
-       at91_add_device_usbh(&onearm_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&onearm_udc_data);
-}
-
-MACHINE_START(ONEARM, "Ajeco 1ARM single board computer")
-       /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91rm9200_timer,
-       .map_io         = onearm_map_io,
-       .init_irq       = onearm_init_irq,
-       .init_machine   = onearm_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/board-carmeva.c b/arch/arm/mach-at91rm9200/board-carmeva.c
deleted file mode 100644 (file)
index 654f037..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-carmeva.c
- *
- *  Copyright (c) 2005 Peer Georgi
- *                    Conitec Datasystems
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata carmeva_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
-static void __init carmeva_map_io(void)
-{
-       /* Initialize processor: 20.000 MHz crystal */
-       at91rm9200_initialize(20000000, AT91RM9200_BGA);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&carmeva_uart_config);
-}
-
-static void __init carmeva_init_irq(void)
-{
-       at91rm9200_init_interrupts(NULL);
-}
-
-static struct at91_eth_data __initdata carmeva_eth_data = {
-       .phy_irq_pin    = AT91_PIN_PC4,
-       .is_rmii        = 1,
-};
-
-static struct at91_usbh_data __initdata carmeva_usbh_data = {
-       .ports          = 2,
-};
-
-static struct at91_udc_data __initdata carmeva_udc_data = {
-       .vbus_pin       = AT91_PIN_PD12,
-       .pullup_pin     = AT91_PIN_PD9,
-};
-
-/* FIXME: user dependend */
-// static struct at91_cf_data __initdata carmeva_cf_data = {
-//     .det_pin        = AT91_PIN_PB0,
-//     .rst_pin        = AT91_PIN_PC5,
-       // .irq_pin     = ... not connected
-       // .vcc_pin     = ... always powered
-// };
-
-static struct at91_mmc_data __initdata carmeva_mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-       .det_pin        = AT91_PIN_PB10,
-       .wp_pin         = AT91_PIN_PC14,
-};
-
-static struct spi_board_info carmeva_spi_devices[] = {
-       { /* DataFlash chip */
-               .modalias = "mtd_dataflash",
-               .chip_select  = 0,
-               .max_speed_hz = 10 * 1000 * 1000,
-       },
-       { /* User accessable spi - cs1 (250KHz) */
-               .modalias = "spi-cs1",
-               .chip_select  = 1,
-               .max_speed_hz = 250 *  1000,
-       },
-       { /* User accessable spi - cs2 (1MHz) */
-               .modalias = "spi-cs2",
-               .chip_select  = 2,
-               .max_speed_hz = 1 * 1000 *  1000,
-       },
-       { /* User accessable spi - cs3 (10MHz) */
-               .modalias = "spi-cs3",
-               .chip_select  = 3,
-               .max_speed_hz = 10 * 1000 *  1000,
-       },
-};
-
-static void __init carmeva_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* Ethernet */
-       at91_add_device_eth(&carmeva_eth_data);
-       /* USB Host */
-       at91_add_device_usbh(&carmeva_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&carmeva_udc_data);
-       /* I2C */
-       at91_add_device_i2c();
-       /* SPI */
-       at91_add_device_spi(carmeva_spi_devices, ARRAY_SIZE(carmeva_spi_devices));
-       /* Compact Flash */
-//     at91_add_device_cf(&carmeva_cf_data);
-       /* MMC */
-       at91_add_device_mmc(&carmeva_mmc_data);
-}
-
-MACHINE_START(CARMEVA, "Carmeva")
-       /* Maintainer: Conitec Datasystems */
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91rm9200_timer,
-       .map_io         = carmeva_map_io,
-       .init_irq       = carmeva_init_irq,
-       .init_machine   = carmeva_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/board-csb337.c b/arch/arm/mach-at91rm9200/board-csb337.c
deleted file mode 100644 (file)
index b8bb805..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-csb337.c
- *
- *  Copyright (C) 2005 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/spi/spi.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata csb337_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
-static void __init csb337_map_io(void)
-{
-       /* Initialize processor: 3.6864 MHz crystal */
-       at91rm9200_initialize(3686400, AT91RM9200_BGA);
-
-       /* Setup the LEDs */
-       at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&csb337_uart_config);
-}
-
-static void __init csb337_init_irq(void)
-{
-       at91rm9200_init_interrupts(NULL);
-}
-
-static struct at91_eth_data __initdata csb337_eth_data = {
-       .phy_irq_pin    = AT91_PIN_PC2,
-       .is_rmii        = 0,
-};
-
-static struct at91_usbh_data __initdata csb337_usbh_data = {
-       .ports          = 2,
-};
-
-static struct at91_udc_data __initdata csb337_udc_data = {
-       // this has no VBUS sensing pin
-       .pullup_pin     = AT91_PIN_PA24,
-};
-
-static struct at91_cf_data __initdata csb337_cf_data = {
-       /*
-        * connector P4 on the CSB 337 mates to
-        * connector P8 on the CSB 300CF
-        */
-
-       /* CSB337 specific */
-       .det_pin        = AT91_PIN_PC3,
-
-       /* CSB300CF specific */
-       .irq_pin        = AT91_PIN_PA19,
-       .vcc_pin        = AT91_PIN_PD0,
-       .rst_pin        = AT91_PIN_PD2,
-};
-
-static struct at91_mmc_data __initdata csb337_mmc_data = {
-       .det_pin        = AT91_PIN_PD5,
-       .slot_b         = 0,
-       .wire4          = 1,
-       .wp_pin         = AT91_PIN_PD6,
-};
-
-static struct spi_board_info csb337_spi_devices[] = {
-       {       /* CAN controller */
-               .modalias       = "sak82c900",
-               .chip_select    = 0,
-               .max_speed_hz   = 6 * 1000 * 1000,
-       },
-};
-
-static void __init csb337_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* Ethernet */
-       at91_add_device_eth(&csb337_eth_data);
-       /* USB Host */
-       at91_add_device_usbh(&csb337_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&csb337_udc_data);
-       /* I2C */
-       at91_add_device_i2c();
-       /* Compact Flash */
-       at91_set_gpio_input(AT91_PIN_PB22, 1);          /* IOIS16 */
-       at91_add_device_cf(&csb337_cf_data);
-       /* SPI */
-       at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
-       /* MMC */
-       at91_add_device_mmc(&csb337_mmc_data);
-}
-
-MACHINE_START(CSB337, "Cogent CSB337")
-       /* Maintainer: Bill Gatliff */
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91rm9200_timer,
-       .map_io         = csb337_map_io,
-       .init_irq       = csb337_init_irq,
-       .init_machine   = csb337_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/board-csb637.c b/arch/arm/mach-at91rm9200/board-csb637.c
deleted file mode 100644 (file)
index a29fa0e..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-csb637.c
- *
- *  Copyright (C) 2005 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata csb637_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
-static void __init csb637_map_io(void)
-{
-       /* Initialize processor: 3.6864 MHz crystal */
-       at91rm9200_initialize(3686400, AT91RM9200_BGA);
-
-       /* Setup the LEDs */
-       at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&csb637_uart_config);
-}
-
-static void __init csb637_init_irq(void)
-{
-       at91rm9200_init_interrupts(NULL);
-}
-
-static struct at91_eth_data __initdata csb637_eth_data = {
-       .phy_irq_pin    = AT91_PIN_PC0,
-       .is_rmii        = 0,
-};
-
-static struct at91_usbh_data __initdata csb637_usbh_data = {
-       .ports          = 2,
-};
-
-static struct at91_udc_data __initdata csb637_udc_data = {
-       .vbus_pin     = AT91_PIN_PB28,
-       .pullup_pin   = AT91_PIN_PB1,
-};
-
-static void __init csb637_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* Ethernet */
-       at91_add_device_eth(&csb637_eth_data);
-       /* USB Host */
-       at91_add_device_usbh(&csb637_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&csb637_udc_data);
-       /* I2C */
-       at91_add_device_i2c();
-       /* SPI */
-       at91_add_device_spi(NULL, 0);
-}
-
-MACHINE_START(CSB637, "Cogent CSB637")
-       /* Maintainer: Bill Gatliff */
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91rm9200_timer,
-       .map_io         = csb637_map_io,
-       .init_irq       = csb637_init_irq,
-       .init_machine   = csb637_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/board-dk.c b/arch/arm/mach-at91rm9200/board-dk.c
deleted file mode 100644 (file)
index 7522bf9..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-dk.c
- *
- *  Copyright (C) 2005 SAN People
- *
- *  Epson S1D framebuffer glue code is:
- *     Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/spi/spi.h>
-#include <linux/mtd/physmap.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-#include <asm/arch/at91rm9200_mc.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata dk_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
-static void __init dk_map_io(void)
-{
-       /* Initialize processor: 18.432 MHz crystal */
-       at91rm9200_initialize(18432000, AT91RM9200_BGA);
-
-       /* Setup the LEDs */
-       at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&dk_uart_config);
-}
-
-static void __init dk_init_irq(void)
-{
-       at91rm9200_init_interrupts(NULL);
-}
-
-static struct at91_eth_data __initdata dk_eth_data = {
-       .phy_irq_pin    = AT91_PIN_PC4,
-       .is_rmii        = 1,
-};
-
-static struct at91_usbh_data __initdata dk_usbh_data = {
-       .ports          = 2,
-};
-
-static struct at91_udc_data __initdata dk_udc_data = {
-       .vbus_pin       = AT91_PIN_PD4,
-       .pullup_pin     = AT91_PIN_PD5,
-};
-
-static struct at91_cf_data __initdata dk_cf_data = {
-       .det_pin        = AT91_PIN_PB0,
-       .rst_pin        = AT91_PIN_PC5,
-       // .irq_pin     = ... not connected
-       // .vcc_pin     = ... always powered
-};
-
-static struct at91_mmc_data __initdata dk_mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-};
-
-static struct spi_board_info dk_spi_devices[] = {
-       {       /* DataFlash chip */
-               .modalias       = "mtd_dataflash",
-               .chip_select    = 0,
-               .max_speed_hz   = 15 * 1000 * 1000,
-       },
-       {       /* UR6HCPS2-SP40 PS2-to-SPI adapter */
-               .modalias       = "ur6hcps2",
-               .chip_select    = 1,
-               .max_speed_hz   = 250 *  1000,
-       },
-       {       /* TLV1504 ADC, 4 channels, 10 bits; one is a temp sensor */
-               .modalias       = "tlv1504",
-               .chip_select    = 2,
-               .max_speed_hz   = 20 * 1000 * 1000,
-       },
-#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
-       {       /* DataFlash card */
-               .modalias       = "mtd_dataflash",
-               .chip_select    = 3,
-               .max_speed_hz   = 15 * 1000 * 1000,
-       }
-#endif
-};
-
-static struct mtd_partition __initdata dk_nand_partition[] = {
-       {
-               .name   = "NAND Partition 1",
-               .offset = 0,
-               .size   = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct mtd_partition *nand_partitions(int size, int *num_partitions)
-{
-       *num_partitions = ARRAY_SIZE(dk_nand_partition);
-       return dk_nand_partition;
-}
-
-static struct at91_nand_data __initdata dk_nand_data = {
-       .ale            = 22,
-       .cle            = 21,
-       .det_pin        = AT91_PIN_PB1,
-       .rdy_pin        = AT91_PIN_PC2,
-       // .enable_pin  = ... not there
-       .partition_info = nand_partitions,
-};
-
-#define DK_FLASH_BASE  AT91_CHIPSELECT_0
-#define DK_FLASH_SIZE  0x200000
-
-static struct physmap_flash_data dk_flash_data = {
-       .width  = 2,
-};
-
-static struct resource dk_flash_resource = {
-       .start          = DK_FLASH_BASE,
-       .end            = DK_FLASH_BASE + DK_FLASH_SIZE - 1,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device dk_flash = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-                               .platform_data  = &dk_flash_data,
-                       },
-       .resource       = &dk_flash_resource,
-       .num_resources  = 1,
-};
-
-
-static void __init dk_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* Ethernet */
-       at91_add_device_eth(&dk_eth_data);
-       /* USB Host */
-       at91_add_device_usbh(&dk_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&dk_udc_data);
-       at91_set_multi_drive(dk_udc_data.pullup_pin, 1);        /* pullup_pin is connected to reset */
-       /* Compact Flash */
-       at91_add_device_cf(&dk_cf_data);
-       /* I2C */
-       at91_add_device_i2c();
-       /* SPI */
-       at91_add_device_spi(dk_spi_devices, ARRAY_SIZE(dk_spi_devices));
-#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
-       /* DataFlash card */
-       at91_set_gpio_output(AT91_PIN_PB7, 0);
-#else
-       /* MMC */
-       at91_set_gpio_output(AT91_PIN_PB7, 1);  /* this MMC card slot can optionally use SPI signaling (CS3). */
-       at91_add_device_mmc(&dk_mmc_data);
-#endif
-       /* NAND */
-       at91_add_device_nand(&dk_nand_data);
-       /* NOR Flash */
-       platform_device_register(&dk_flash);
-       /* VGA */
-//     dk_add_device_video();
-}
-
-MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
-       /* Maintainer: SAN People/Atmel */
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91rm9200_timer,
-       .map_io         = dk_map_io,
-       .init_irq       = dk_init_irq,
-       .init_machine   = dk_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/board-eb9200.c b/arch/arm/mach-at91rm9200/board-eb9200.c
deleted file mode 100644 (file)
index 80b72cf..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-eb9200.c
- *
- *  Copyright (C) 2005 SAN People, adapted for ATEB9200 from Embest
- *  by Andrew Patrikalakis
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/device.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata eb9200_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
-static void __init eb9200_map_io(void)
-{
-       /* Initialize processor: 18.432 MHz crystal */
-       at91rm9200_initialize(18432000, AT91RM9200_BGA);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&eb9200_uart_config);
-}
-
-static void __init eb9200_init_irq(void)
-{
-       at91rm9200_init_interrupts(NULL);
-}
-
-static struct at91_eth_data __initdata eb9200_eth_data = {
-       .phy_irq_pin    = AT91_PIN_PC4,
-       .is_rmii        = 1,
-};
-
-static struct at91_usbh_data __initdata eb9200_usbh_data = {
-       .ports          = 2,
-};
-
-static struct at91_udc_data __initdata eb9200_udc_data = {
-       .vbus_pin       = AT91_PIN_PD4,
-       .pullup_pin     = AT91_PIN_PD5,
-};
-
-static struct at91_cf_data __initdata eb9200_cf_data = {
-       .det_pin        = AT91_PIN_PB0,
-       .rst_pin        = AT91_PIN_PC5,
-       // .irq_pin     = ... not connected
-       // .vcc_pin     = ... always powered
-};
-
-static struct at91_mmc_data __initdata eb9200_mmc_data = {
-       .slot_b         = 0,
-       .wire4          = 1,
-};
-
-static void __init eb9200_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* Ethernet */
-       at91_add_device_eth(&eb9200_eth_data);
-       /* USB Host */
-       at91_add_device_usbh(&eb9200_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&eb9200_udc_data);
-       /* I2C */
-       at91_add_device_i2c();
-       /* Compact Flash */
-       at91_add_device_cf(&eb9200_cf_data);
-       /* SPI */
-       at91_add_device_spi(NULL, 0);
-       /* MMC */
-       /* only supports 1 or 4 bit interface, not wired through to SPI */
-       at91_add_device_mmc(&eb9200_mmc_data);
-}
-
-MACHINE_START(ATEB9200, "Embest ATEB9200")
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91rm9200_timer,
-       .map_io         = eb9200_map_io,
-       .init_irq       = eb9200_init_irq,
-       .init_machine   = eb9200_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/board-ek.c b/arch/arm/mach-at91rm9200/board-ek.c
deleted file mode 100644 (file)
index c4fdb41..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-ek.c
- *
- *  Copyright (C) 2005 SAN People
- *
- *  Epson S1D framebuffer glue code is:
- *     Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/spi/spi.h>
-#include <linux/mtd/physmap.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-#include <asm/arch/at91rm9200_mc.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata ek_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
-static void __init ek_map_io(void)
-{
-       /* Initialize processor: 18.432 MHz crystal */
-       at91rm9200_initialize(18432000, AT91RM9200_BGA);
-
-       /* Setup the LEDs */
-       at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&ek_uart_config);
-}
-
-static void __init ek_init_irq(void)
-{
-       at91rm9200_init_interrupts(NULL);
-}
-
-static struct at91_eth_data __initdata ek_eth_data = {
-       .phy_irq_pin    = AT91_PIN_PC4,
-       .is_rmii        = 1,
-};
-
-static struct at91_usbh_data __initdata ek_usbh_data = {
-       .ports          = 2,
-};
-
-static struct at91_udc_data __initdata ek_udc_data = {
-       .vbus_pin       = AT91_PIN_PD4,
-       .pullup_pin     = AT91_PIN_PD5,
-};
-
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .det_pin        = AT91_PIN_PB27,
-       .slot_b         = 0,
-       .wire4          = 1,
-       .wp_pin         = AT91_PIN_PA17,
-};
-
-static struct spi_board_info ek_spi_devices[] = {
-       {       /* DataFlash chip */
-               .modalias       = "mtd_dataflash",
-               .chip_select    = 0,
-               .max_speed_hz   = 15 * 1000 * 1000,
-       },
-#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
-       {       /* DataFlash card */
-               .modalias       = "mtd_dataflash",
-               .chip_select    = 3,
-               .max_speed_hz   = 15 * 1000 * 1000,
-       },
-#endif
-};
-
-#define EK_FLASH_BASE  AT91_CHIPSELECT_0
-#define EK_FLASH_SIZE  0x200000
-
-static struct physmap_flash_data ek_flash_data = {
-       .width  = 2,
-};
-
-static struct resource ek_flash_resource = {
-       .start          = EK_FLASH_BASE,
-       .end            = EK_FLASH_BASE + EK_FLASH_SIZE - 1,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device ek_flash = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-                               .platform_data  = &ek_flash_data,
-                       },
-       .resource       = &ek_flash_resource,
-       .num_resources  = 1,
-};
-
-
-static void __init ek_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* Ethernet */
-       at91_add_device_eth(&ek_eth_data);
-       /* USB Host */
-       at91_add_device_usbh(&ek_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&ek_udc_data);
-       at91_set_multi_drive(ek_udc_data.pullup_pin, 1);        /* pullup_pin is connected to reset */
-       /* I2C */
-       at91_add_device_i2c();
-       /* SPI */
-       at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
-#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
-       /* DataFlash card */
-       at91_set_gpio_output(AT91_PIN_PB22, 0);
-#else
-       /* MMC */
-       at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
-       at91_add_device_mmc(&ek_mmc_data);
-#endif
-       /* NOR Flash */
-       platform_device_register(&ek_flash);
-       /* VGA */
-//     ek_add_device_video();
-}
-
-MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
-       /* Maintainer: SAN People/Atmel */
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91rm9200_timer,
-       .map_io         = ek_map_io,
-       .init_irq       = ek_init_irq,
-       .init_machine   = ek_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/board-kafa.c b/arch/arm/mach-at91rm9200/board-kafa.c
deleted file mode 100644 (file)
index 6ef3c48..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-kafa.c
- *
- *  Copyright (C) 2006 Sperry-Sun
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata kafa_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 0, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
-static void __init kafa_map_io(void)
-{
-       /* Initialize processor: 18.432 MHz crystal */
-       at91rm9200_initialize(18432000, AT91RM9200_PQFP);
-
-       /* Set up the LEDs */
-       at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&kafa_uart_config);
-}
-
-static void __init kafa_init_irq(void)
-{
-       at91rm9200_init_interrupts(NULL);
-}
-
-static struct at91_eth_data __initdata kafa_eth_data = {
-       .phy_irq_pin    = AT91_PIN_PC4,
-       .is_rmii        = 0,
-};
-
-static struct at91_usbh_data __initdata kafa_usbh_data = {
-       .ports          = 1,
-};
-
-static struct at91_udc_data __initdata kafa_udc_data = {
-       .vbus_pin       = AT91_PIN_PB6,
-       .pullup_pin     = AT91_PIN_PB7,
-};
-
-static void __init kafa_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* Ethernet */
-       at91_add_device_eth(&kafa_eth_data);
-       /* USB Host */
-       at91_add_device_usbh(&kafa_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&kafa_udc_data);
-       /* I2C */
-       at91_add_device_i2c();
-       /* SPI */
-       at91_add_device_spi(NULL, 0);
-}
-
-MACHINE_START(KAFA, "Sperry-Sun KAFA")
-       /* Maintainer: Sergei Sharonov */
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91rm9200_timer,
-       .map_io         = kafa_map_io,
-       .init_irq       = kafa_init_irq,
-       .init_machine   = kafa_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/board-kb9202.c b/arch/arm/mach-at91rm9200/board-kb9202.c
deleted file mode 100644 (file)
index 759d819..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-kb9202.c
- *
- *  Copyright (c) 2005 kb_admin
- *                    KwikByte, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata kb9202_uart_config = {
-       .console_tty    = 0,                                    /* ttyS0 */
-       .nr_tty         = 3,
-       .tty_map        = { 4, 0, 1, -1, -1 }                   /* ttyS0, ..., ttyS4 */
-};
-
-static void __init kb9202_map_io(void)
-{
-       /* Initialize processor: 10 MHz crystal */
-       at91rm9200_initialize(10000000, AT91RM9200_PQFP);
-
-       /* Set up the LEDs */
-       at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&kb9202_uart_config);
-}
-
-static void __init kb9202_init_irq(void)
-{
-       at91rm9200_init_interrupts(NULL);
-}
-
-static struct at91_eth_data __initdata kb9202_eth_data = {
-       .phy_irq_pin    = AT91_PIN_PB29,
-       .is_rmii        = 0,
-};
-
-static struct at91_usbh_data __initdata kb9202_usbh_data = {
-       .ports          = 1,
-};
-
-static struct at91_udc_data __initdata kb9202_udc_data = {
-       .vbus_pin       = AT91_PIN_PB24,
-       .pullup_pin     = AT91_PIN_PB22,
-};
-
-static struct at91_mmc_data __initdata kb9202_mmc_data = {
-       .det_pin        = AT91_PIN_PB2,
-       .slot_b         = 0,
-       .wire4          = 1,
-};
-
-static struct mtd_partition __initdata kb9202_nand_partition[] = {
-       {
-               .name   = "nand_fs",
-               .offset = 0,
-               .size   = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct mtd_partition *nand_partitions(int size, int *num_partitions)
-{
-       *num_partitions = ARRAY_SIZE(kb9202_nand_partition);
-       return kb9202_nand_partition;
-}
-
-static struct at91_nand_data __initdata kb9202_nand_data = {
-       .ale            = 22,
-       .cle            = 21,
-       // .det_pin     = ... not there
-       .rdy_pin        = AT91_PIN_PC29,
-       .enable_pin     = AT91_PIN_PC28,
-       .partition_info = nand_partitions,
-};
-
-static void __init kb9202_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* Ethernet */
-       at91_add_device_eth(&kb9202_eth_data);
-       /* USB Host */
-       at91_add_device_usbh(&kb9202_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&kb9202_udc_data);
-       /* MMC */
-       at91_add_device_mmc(&kb9202_mmc_data);
-       /* I2C */
-       at91_add_device_i2c();
-       /* SPI */
-       at91_add_device_spi(NULL, 0);
-       /* NAND */
-       at91_add_device_nand(&kb9202_nand_data);
-}
-
-MACHINE_START(KB9200, "KB920x")
-       /* Maintainer: KwikByte, Inc. */
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91rm9200_timer,
-       .map_io         = kb9202_map_io,
-       .init_irq       = kb9202_init_irq,
-       .init_machine   = kb9202_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/board-sam9260ek.c b/arch/arm/mach-at91rm9200/board-sam9260ek.c
deleted file mode 100644 (file)
index da5d58a..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-ek.c
- *
- *  Copyright (C) 2005 SAN People
- *  Copyright (C) 2006 Atmel
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/spi/spi.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-#include <asm/arch/at91sam926x_mc.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 5 = USART0 .. USART5
- *    6      = DBGU
- */
-static struct at91_uart_config __initdata ek_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 3,
-       .tty_map        = { 6, 0, 1, -1, -1, -1, -1 }   /* ttyS0, ..., ttyS6 */
-};
-
-static void __init ek_map_io(void)
-{
-       /* Initialize processor: 18.432 MHz crystal */
-       at91sam9260_initialize(18432000);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&ek_uart_config);
-}
-
-static void __init ek_init_irq(void)
-{
-       at91sam9260_init_interrupts(NULL);
-}
-
-
-/*
- * USB Host port
- */
-static struct at91_usbh_data __initdata ek_usbh_data = {
-       .ports          = 2,
-};
-
-/*
- * USB Device port
- */
-static struct at91_udc_data __initdata ek_udc_data = {
-       .vbus_pin       = AT91_PIN_PC5,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
-};
-
-
-/*
- * SPI devices.
- */
-static struct spi_board_info ek_spi_devices[] = {
-#if !defined(CONFIG_MMC_AT91)
-       {       /* DataFlash chip */
-               .modalias       = "mtd_dataflash",
-               .chip_select    = 1,
-               .max_speed_hz   = 15 * 1000 * 1000,
-               .bus_num        = 0,
-       },
-#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
-       {       /* DataFlash card */
-               .modalias       = "mtd_dataflash",
-               .chip_select    = 0,
-               .max_speed_hz   = 15 * 1000 * 1000,
-               .bus_num        = 0,
-       },
-#endif
-#endif
-#if defined(CONFIG_SND_AT73C213)
-       {       /* AT73C213 DAC */
-               .modalias       = "snd_at73c213",
-               .chip_select    = 0,
-               .max_speed_hz   = 10 * 1000 * 1000,
-               .bus_num        = 1,
-       },
-#endif
-};
-
-
-/*
- * MACB Ethernet device
- */
-static struct __initdata eth_platform_data ek_macb_data = {
-       .phy_irq_pin    = AT91_PIN_PA7,
-       .is_rmii        = 1,
-};
-
-
-/*
- * NAND flash
- */
-static struct mtd_partition __initdata ek_nand_partition[] = {
-       {
-               .name   = "Partition 1",
-               .offset = 0,
-               .size   = 256 * 1024,
-       },
-       {
-               .name   = "Partition 2",
-               .offset = 256 * 1024,
-               .size   = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct mtd_partition *nand_partitions(int size, int *num_partitions)
-{
-       *num_partitions = ARRAY_SIZE(ek_nand_partition);
-       return ek_nand_partition;
-}
-
-static struct at91_nand_data __initdata ek_nand_data = {
-       .ale            = 21,
-       .cle            = 22,
-//     .det_pin        = ... not connected
-       .rdy_pin        = AT91_PIN_PC13,
-       .enable_pin     = AT91_PIN_PC14,
-       .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
-       .bus_width_16   = 1,
-#else
-       .bus_width_16   = 0,
-#endif
-};
-
-
-/*
- * MCI (SD/MMC)
- */
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .slot_b         = 1,
-       .wire4          = 1,
-//     .det_pin        = ... not connected
-//     .wp_pin         = ... not connected
-//     .vcc_pin        = ... not connected
-};
-
-static void __init ek_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* USB Host */
-       at91_add_device_usbh(&ek_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&ek_udc_data);
-       /* SPI */
-       at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
-       /* NAND */
-       at91_add_device_nand(&ek_nand_data);
-       /* Ethernet */
-       at91_add_device_eth(&ek_macb_data);
-       /* MMC */
-       at91_add_device_mmc(&ek_mmc_data);
-}
-
-MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
-       /* Maintainer: Atmel */
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91sam926x_timer,
-       .map_io         = ek_map_io,
-       .init_irq       = ek_init_irq,
-       .init_machine   = ek_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/board-sam9261ek.c b/arch/arm/mach-at91rm9200/board-sam9261ek.c
deleted file mode 100644 (file)
index 30b490d..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/board-ek.c
- *
- *  Copyright (C) 2005 SAN People
- *  Copyright (C) 2006 Atmel
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/spi/spi.h>
-#include <linux/dm9000.h>
-
-#include <asm/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/irq.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-#include <asm/arch/at91sam926x_mc.h>
-
-#include "generic.h"
-
-
-/*
- * Serial port configuration.
- *    0 .. 2 = USART0 .. USART2
- *    3      = DBGU
- */
-static struct at91_uart_config __initdata ek_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 1,
-       .tty_map        = { 3, -1, -1, -1 }             /* ttyS0, ..., ttyS3 */
-};
-
-static void __init ek_map_io(void)
-{
-       /* Initialize processor: 18.432 MHz crystal */
-       at91sam9261_initialize(18432000);
-
-       /* Setup the serial ports and console */
-       at91_init_serial(&ek_uart_config);
-}
-
-static void __init ek_init_irq(void)
-{
-       at91sam9261_init_interrupts(NULL);
-}
-
-
-/*
- * DM9000 ethernet device
- */
-#if defined(CONFIG_DM9000)
-static struct resource at91sam9261_dm9000_resource[] = {
-       [0] = {
-               .start  = AT91_CHIPSELECT_2,
-               .end    = AT91_CHIPSELECT_2 + 3,
-               .flags  = IORESOURCE_MEM
-       },
-       [1] = {
-               .start  = AT91_CHIPSELECT_2 + 0x44,
-               .end    = AT91_CHIPSELECT_2 + 0xFF,
-               .flags  = IORESOURCE_MEM
-       },
-       [2] = {
-               .start  = AT91_PIN_PC11,
-               .end    = AT91_PIN_PC11,
-               .flags  = IORESOURCE_IRQ
-       }
-};
-
-static struct dm9000_plat_data dm9000_platdata = {
-       .flags          = DM9000_PLATF_16BITONLY,
-};
-
-static struct platform_device at91sam9261_dm9000_device = {
-       .name           = "dm9000",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(at91sam9261_dm9000_resource),
-       .resource       = at91sam9261_dm9000_resource,
-       .dev            = {
-               .platform_data  = &dm9000_platdata,
-       }
-};
-
-static void __init ek_add_device_dm9000(void)
-{
-       /*
-        * Configure Chip-Select 2 on SMC for the DM9000.
-        * Note: These timings were calculated for MASTER_CLOCK = 100000000
-        *  according to the DM9000 timings.
-        */
-       at91_sys_write(AT91_SMC_SETUP(2), AT91_SMC_NWESETUP_(2) | AT91_SMC_NCS_WRSETUP_(0) | AT91_SMC_NRDSETUP_(2) | AT91_SMC_NCS_RDSETUP_(0));
-       at91_sys_write(AT91_SMC_PULSE(2), AT91_SMC_NWEPULSE_(4) | AT91_SMC_NCS_WRPULSE_(8) | AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(8));
-       at91_sys_write(AT91_SMC_CYCLE(2), AT91_SMC_NWECYCLE_(16) | AT91_SMC_NRDCYCLE_(16));
-       at91_sys_write(AT91_SMC_MODE(2), AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE | AT91_SMC_DBW_16 | AT91_SMC_TDF_(1));
-
-       /* Configure Reset signal as output */
-       at91_set_gpio_output(AT91_PIN_PC10, 0);
-
-       /* Configure Interrupt pin as input, no pull-up */
-       at91_set_gpio_input(AT91_PIN_PC11, 0);
-
-       platform_device_register(&at91sam9261_dm9000_device);
-}
-#else
-static void __init ek_add_device_dm9000(void) {}
-#endif /* CONFIG_DM9000 */
-
-
-/*
- * USB Host Port
- */
-static struct at91_usbh_data __initdata ek_usbh_data = {
-       .ports          = 2,
-};
-
-
-/*
- * USB Device Port
- */
-static struct at91_udc_data __initdata ek_udc_data = {
-       .vbus_pin       = AT91_PIN_PB29,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
-};
-
-
-/*
- * MCI (SD/MMC)
- */
-static struct at91_mmc_data __initdata ek_mmc_data = {
-       .wire4          = 1,
-//     .det_pin        = ... not connected
-//     .wp_pin         = ... not connected
-//     .vcc_pin        = ... not connected
-};
-
-
-/*
- * NAND flash
- */
-static struct mtd_partition __initdata ek_nand_partition[] = {
-       {
-               .name   = "Partition 1",
-               .offset = 0,
-               .size   = 256 * 1024,
-       },
-       {
-               .name   = "Partition 2",
-               .offset = 256 * 1024 ,
-               .size   = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct mtd_partition *nand_partitions(int size, int *num_partitions)
-{
-       *num_partitions = ARRAY_SIZE(ek_nand_partition);
-       return ek_nand_partition;
-}
-
-static struct at91_nand_data __initdata ek_nand_data = {
-       .ale            = 22,
-       .cle            = 21,
-//     .det_pin        = ... not connected
-       .rdy_pin        = AT91_PIN_PC15,
-       .enable_pin     = AT91_PIN_PC14,
-       .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
-       .bus_width_16   = 1,
-#else
-       .bus_width_16   = 0,
-#endif
-};
-
-/*
- * SPI devices
- */
-static struct spi_board_info ek_spi_devices[] = {
-       {       /* DataFlash chip */
-               .modalias       = "mtd_dataflash",
-               .chip_select    = 0,
-               .max_speed_hz   = 15 * 1000 * 1000,
-               .bus_num        = 0,
-       },
-#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
-       {       /* DataFlash card - jumper (J12) configurable to CS3 or CS0 */
-               .modalias       = "mtd_dataflash",
-               .chip_select    = 3,
-               .max_speed_hz   = 15 * 1000 * 1000,
-               .bus_num        = 0,
-       },
-#elif defined(CONFIG_SND_AT73C213)
-       {       /* AT73C213 DAC */
-               .modalias       = "snd_at73c213",
-               .chip_select    = 3,
-               .max_speed_hz   = 10 * 1000 * 1000,
-               .bus_num        = 0,
-       },
-#endif
-};
-
-
-static void __init ek_board_init(void)
-{
-       /* Serial */
-       at91_add_device_serial();
-       /* USB Host */
-       at91_add_device_usbh(&ek_usbh_data);
-       /* USB Device */
-       at91_add_device_udc(&ek_udc_data);
-       /* I2C */
-       at91_add_device_i2c();
-       /* NAND */
-       at91_add_device_nand(&ek_nand_data);
-       /* DM9000 ethernet */
-       ek_add_device_dm9000();
-
-       /* spi0 and mmc/sd share the same PIO pins */
-#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
-       /* SPI */
-       at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
-#else
-       /* MMC */
-       at91_add_device_mmc(&ek_mmc_data);
-#endif
-}
-
-MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
-       /* Maintainer: Atmel */
-       .phys_io        = AT91_BASE_SYS,
-       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-       .boot_params    = AT91_SDRAM_BASE + 0x100,
-       .timer          = &at91sam926x_timer,
-       .map_io         = ek_map_io,
-       .init_irq       = ek_init_irq,
-       .init_machine   = ek_board_init,
-MACHINE_END
diff --git a/arch/arm/mach-at91rm9200/clock.c b/arch/arm/mach-at91rm9200/clock.c
deleted file mode 100644 (file)
index 36a8e4d..0000000
+++ /dev/null
@@ -1,644 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/clock.c
- *
- * Copyright (C) 2005 David Brownell
- * Copyright (C) 2005 Ivan Kokshaysky
- *
- * 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/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/fs.h>
-#include <linux/debugfs.h>
-#include <linux/seq_file.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/spinlock.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-
-#include <asm/semaphore.h>
-#include <asm/io.h>
-#include <asm/mach-types.h>
-
-#include <asm/hardware.h>
-#include <asm/arch/at91_pmc.h>
-#include <asm/arch/cpu.h>
-
-#include "clock.h"
-
-
-/*
- * There's a lot more which can be done with clocks, including cpufreq
- * integration, slow clock mode support (for system suspend), letting
- * PLLB be used at other rates (on boards that don't need USB), etc.
- */
-
-#define clk_is_primary(x)      ((x)->type & CLK_TYPE_PRIMARY)
-#define clk_is_programmable(x) ((x)->type & CLK_TYPE_PROGRAMMABLE)
-#define clk_is_peripheral(x)   ((x)->type & CLK_TYPE_PERIPHERAL)
-#define clk_is_sys(x)          ((x)->type & CLK_TYPE_SYSTEM)
-
-
-static LIST_HEAD(clocks);
-static DEFINE_SPINLOCK(clk_lock);
-
-static u32 at91_pllb_usb_init;
-
-/*
- * Four primary clock sources:  two crystal oscillators (32K, main), and
- * two PLLs.  PLLA usually runs the master clock; and PLLB must run at
- * 48 MHz (unless no USB function clocks are needed).  The main clock and
- * both PLLs are turned off to run in "slow clock mode" (system suspend).
- */
-static struct clk clk32k = {
-       .name           = "clk32k",
-       .rate_hz        = AT91_SLOW_CLOCK,
-       .users          = 1,            /* always on */
-       .id             = 0,
-       .type           = CLK_TYPE_PRIMARY,
-};
-static struct clk main_clk = {
-       .name           = "main",
-       .pmc_mask       = AT91_PMC_MOSCS,       /* in PMC_SR */
-       .id             = 1,
-       .type           = CLK_TYPE_PRIMARY,
-};
-static struct clk plla = {
-       .name           = "plla",
-       .parent         = &main_clk,
-       .pmc_mask       = AT91_PMC_LOCKA,       /* in PMC_SR */
-       .id             = 2,
-       .type           = CLK_TYPE_PRIMARY | CLK_TYPE_PLL,
-};
-
-static void pllb_mode(struct clk *clk, int is_on)
-{
-       u32     value;
-
-       if (is_on) {
-               is_on = AT91_PMC_LOCKB;
-               value = at91_pllb_usb_init;
-       } else
-               value = 0;
-
-       // REVISIT: Add work-around for AT91RM9200 Errata #26 ?
-       at91_sys_write(AT91_CKGR_PLLBR, value);
-
-       do {
-               cpu_relax();
-       } while ((at91_sys_read(AT91_PMC_SR) & AT91_PMC_LOCKB) != is_on);
-}
-
-static struct clk pllb = {
-       .name           = "pllb",
-       .parent         = &main_clk,
-       .pmc_mask       = AT91_PMC_LOCKB,       /* in PMC_SR */
-       .mode           = pllb_mode,
-       .id             = 3,
-       .type           = CLK_TYPE_PRIMARY | CLK_TYPE_PLL,
-};
-
-static void pmc_sys_mode(struct clk *clk, int is_on)
-{
-       if (is_on)
-               at91_sys_write(AT91_PMC_SCER, clk->pmc_mask);
-       else
-               at91_sys_write(AT91_PMC_SCDR, clk->pmc_mask);
-}
-
-/* USB function clocks (PLLB must be 48 MHz) */
-static struct clk udpck = {
-       .name           = "udpck",
-       .parent         = &pllb,
-       .mode           = pmc_sys_mode,
-};
-static struct clk uhpck = {
-       .name           = "uhpck",
-       .parent         = &pllb,
-       .mode           = pmc_sys_mode,
-};
-
-
-/*
- * The master clock is divided from the CPU clock (by 1-4).  It's used for
- * memory, interfaces to on-chip peripherals, the AIC, and sometimes more
- * (e.g baud rate generation).  It's sourced from one of the primary clocks.
- */
-static struct clk mck = {
-       .name           = "mck",
-       .pmc_mask       = AT91_PMC_MCKRDY,      /* in PMC_SR */
-};
-
-static void pmc_periph_mode(struct clk *clk, int is_on)
-{
-       if (is_on)
-               at91_sys_write(AT91_PMC_PCER, clk->pmc_mask);
-       else
-               at91_sys_write(AT91_PMC_PCDR, clk->pmc_mask);
-}
-
-static struct clk __init *at91_css_to_clk(unsigned long css)
-{
-       switch (css) {
-               case AT91_PMC_CSS_SLOW:
-                       return &clk32k;
-               case AT91_PMC_CSS_MAIN:
-                       return &main_clk;
-               case AT91_PMC_CSS_PLLA:
-                       return &plla;
-               case AT91_PMC_CSS_PLLB:
-                       return &pllb;
-       }
-
-       return NULL;
-}
-
-/*
- * Associate a particular clock with a function (eg, "uart") and device.
- * The drivers can then request the same 'function' with several different
- * devices and not care about which clock name to use.
- */
-void __init at91_clock_associate(const char *id, struct device *dev, const char *func)
-{
-       struct clk *clk = clk_get(NULL, id);
-
-       if (!dev || !clk || !IS_ERR(clk_get(dev, func)))
-               return;
-
-       clk->function = func;
-       clk->dev = dev;
-}
-
-/* clocks cannot be de-registered no refcounting necessary */
-struct clk *clk_get(struct device *dev, const char *id)
-{
-       struct clk *clk;
-
-       list_for_each_entry(clk, &clocks, node) {
-               if (strcmp(id, clk->name) == 0)
-                       return clk;
-               if (clk->function && (dev == clk->dev) && strcmp(id, clk->function) == 0)
-                       return clk;
-       }
-
-       return ERR_PTR(-ENOENT);
-}
-EXPORT_SYMBOL(clk_get);
-
-void clk_put(struct clk *clk)
-{
-}
-EXPORT_SYMBOL(clk_put);
-
-static void __clk_enable(struct clk *clk)
-{
-       if (clk->parent)
-               __clk_enable(clk->parent);
-       if (clk->users++ == 0 && clk->mode)
-               clk->mode(clk, 1);
-}
-
-int clk_enable(struct clk *clk)
-{
-       unsigned long   flags;
-
-       spin_lock_irqsave(&clk_lock, flags);
-       __clk_enable(clk);
-       spin_unlock_irqrestore(&clk_lock, flags);
-       return 0;
-}
-EXPORT_SYMBOL(clk_enable);
-
-static void __clk_disable(struct clk *clk)
-{
-       BUG_ON(clk->users == 0);
-       if (--clk->users == 0 && clk->mode)
-               clk->mode(clk, 0);
-       if (clk->parent)
-               __clk_disable(clk->parent);
-}
-
-void clk_disable(struct clk *clk)
-{
-       unsigned long   flags;
-
-       spin_lock_irqsave(&clk_lock, flags);
-       __clk_disable(clk);
-       spin_unlock_irqrestore(&clk_lock, flags);
-}
-EXPORT_SYMBOL(clk_disable);
-
-unsigned long clk_get_rate(struct clk *clk)
-{
-       unsigned long   flags;
-       unsigned long   rate;
-
-       spin_lock_irqsave(&clk_lock, flags);
-       for (;;) {
-               rate = clk->rate_hz;
-               if (rate || !clk->parent)
-                       break;
-               clk = clk->parent;
-       }
-       spin_unlock_irqrestore(&clk_lock, flags);
-       return rate;
-}
-EXPORT_SYMBOL(clk_get_rate);
-
-/*------------------------------------------------------------------------*/
-
-#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
-
-/*
- * For now, only the programmable clocks support reparenting (MCK could
- * do this too, with care) or rate changing (the PLLs could do this too,
- * ditto MCK but that's more for cpufreq).  Drivers may reparent to get
- * a better rate match; we don't.
- */
-
-long clk_round_rate(struct clk *clk, unsigned long rate)
-{
-       unsigned long   flags;
-       unsigned        prescale;
-       unsigned long   actual;
-
-       if (!clk_is_programmable(clk))
-               return -EINVAL;
-       spin_lock_irqsave(&clk_lock, flags);
-
-       actual = clk->parent->rate_hz;
-       for (prescale = 0; prescale < 7; prescale++) {
-               if (actual && actual <= rate)
-                       break;
-               actual >>= 1;
-       }
-
-       spin_unlock_irqrestore(&clk_lock, flags);
-       return (prescale < 7) ? actual : -ENOENT;
-}
-EXPORT_SYMBOL(clk_round_rate);
-
-int clk_set_rate(struct clk *clk, unsigned long rate)
-{
-       unsigned long   flags;
-       unsigned        prescale;
-       unsigned long   actual;
-
-       if (!clk_is_programmable(clk))
-               return -EINVAL;
-       if (clk->users)
-               return -EBUSY;
-       spin_lock_irqsave(&clk_lock, flags);
-
-       actual = clk->parent->rate_hz;
-       for (prescale = 0; prescale < 7; prescale++) {
-               if (actual && actual <= rate) {
-                       u32     pckr;
-
-                       pckr = at91_sys_read(AT91_PMC_PCKR(clk->id));
-                       pckr &= AT91_PMC_CSS_PLLB;      /* clock selection */
-                       pckr |= prescale << 2;
-                       at91_sys_write(AT91_PMC_PCKR(clk->id), pckr);
-                       clk->rate_hz = actual;
-                       break;
-               }
-               actual >>= 1;
-       }
-
-       spin_unlock_irqrestore(&clk_lock, flags);
-       return (prescale < 7) ? actual : -ENOENT;
-}
-EXPORT_SYMBOL(clk_set_rate);
-
-struct clk *clk_get_parent(struct clk *clk)
-{
-       return clk->parent;
-}
-EXPORT_SYMBOL(clk_get_parent);
-
-int clk_set_parent(struct clk *clk, struct clk *parent)
-{
-       unsigned long   flags;
-
-       if (clk->users)
-               return -EBUSY;
-       if (!clk_is_primary(parent) || !clk_is_programmable(clk))
-               return -EINVAL;
-       spin_lock_irqsave(&clk_lock, flags);
-
-       clk->rate_hz = parent->rate_hz;
-       clk->parent = parent;
-       at91_sys_write(AT91_PMC_PCKR(clk->id), parent->id);
-
-       spin_unlock_irqrestore(&clk_lock, flags);
-       return 0;
-}
-EXPORT_SYMBOL(clk_set_parent);
-
-/* establish PCK0..PCK3 parentage and rate */
-static void init_programmable_clock(struct clk *clk)
-{
-       struct clk      *parent;
-       u32             pckr;
-
-       pckr = at91_sys_read(AT91_PMC_PCKR(clk->id));
-       parent = at91_css_to_clk(pckr & AT91_PMC_CSS);
-       clk->parent = parent;
-       clk->rate_hz = parent->rate_hz / (1 << ((pckr >> 2) & 3));
-}
-
-#endif /* CONFIG_AT91_PROGRAMMABLE_CLOCKS */
-
-/*------------------------------------------------------------------------*/
-
-#ifdef CONFIG_DEBUG_FS
-
-static int at91_clk_show(struct seq_file *s, void *unused)
-{
-       u32             scsr, pcsr, sr;
-       struct clk      *clk;
-       unsigned        i;
-
-       seq_printf(s, "SCSR = %8x\n", scsr = at91_sys_read(AT91_PMC_SCSR));
-       seq_printf(s, "PCSR = %8x\n", pcsr = at91_sys_read(AT91_PMC_PCSR));
-
-       seq_printf(s, "MOR  = %8x\n", at91_sys_read(AT91_CKGR_MOR));
-       seq_printf(s, "MCFR = %8x\n", at91_sys_read(AT91_CKGR_MCFR));
-       seq_printf(s, "PLLA = %8x\n", at91_sys_read(AT91_CKGR_PLLAR));
-       seq_printf(s, "PLLB = %8x\n", at91_sys_read(AT91_CKGR_PLLBR));
-
-       seq_printf(s, "MCKR = %8x\n", at91_sys_read(AT91_PMC_MCKR));
-       for (i = 0; i < 4; i++)
-               seq_printf(s, "PCK%d = %8x\n", i, at91_sys_read(AT91_PMC_PCKR(i)));
-       seq_printf(s, "SR   = %8x\n", sr = at91_sys_read(AT91_PMC_SR));
-
-       seq_printf(s, "\n");
-
-       list_for_each_entry(clk, &clocks, node) {
-               char    *state;
-
-               if (clk->mode == pmc_sys_mode)
-                       state = (scsr & clk->pmc_mask) ? "on" : "off";
-               else if (clk->mode == pmc_periph_mode)
-                       state = (pcsr & clk->pmc_mask) ? "on" : "off";
-               else if (clk->pmc_mask)
-                       state = (sr & clk->pmc_mask) ? "on" : "off";
-               else if (clk == &clk32k || clk == &main_clk)
-                       state = "on";
-               else
-                       state = "";
-
-               seq_printf(s, "%-10s users=%2d %-3s %9ld Hz %s\n",
-                       clk->name, clk->users, state, clk_get_rate(clk),
-                       clk->parent ? clk->parent->name : "");
-       }
-       return 0;
-}
-
-static int at91_clk_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, at91_clk_show, NULL);
-}
-
-static const struct file_operations at91_clk_operations = {
-       .open           = at91_clk_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
-
-static int __init at91_clk_debugfs_init(void)
-{
-       /* /sys/kernel/debug/at91_clk */
-       (void) debugfs_create_file("at91_clk", S_IFREG | S_IRUGO, NULL, NULL, &at91_clk_operations);
-
-       return 0;
-}
-postcore_initcall(at91_clk_debugfs_init);
-
-#endif
-
-/*------------------------------------------------------------------------*/
-
-/* Register a new clock */
-int __init clk_register(struct clk *clk)
-{
-       if (clk_is_peripheral(clk)) {
-               clk->parent = &mck;
-               clk->mode = pmc_periph_mode;
-               list_add_tail(&clk->node, &clocks);
-       }
-       else if (clk_is_sys(clk)) {
-               clk->parent = &mck;
-               clk->mode = pmc_sys_mode;
-
-               list_add_tail(&clk->node, &clocks);
-       }
-#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
-       else if (clk_is_programmable(clk)) {
-               clk->mode = pmc_sys_mode;
-               init_programmable_clock(clk);
-               list_add_tail(&clk->node, &clocks);
-       }
-#endif
-
-       return 0;
-}
-
-
-/*------------------------------------------------------------------------*/
-
-static u32 __init at91_pll_rate(struct clk *pll, u32 freq, u32 reg)
-{
-       unsigned mul, div;
-
-       div = reg & 0xff;
-       mul = (reg >> 16) & 0x7ff;
-       if (div && mul) {
-               freq /= div;
-               freq *= mul + 1;
-       } else
-               freq = 0;
-
-       return freq;
-}
-
-static u32 __init at91_usb_rate(struct clk *pll, u32 freq, u32 reg)
-{
-       if (pll == &pllb && (reg & AT91_PMC_USB96M))
-               return freq / 2;
-       else
-               return freq;
-}
-
-static unsigned __init at91_pll_calc(unsigned main_freq, unsigned out_freq)
-{
-       unsigned i, div = 0, mul = 0, diff = 1 << 30;
-       unsigned ret = (out_freq > 155000000) ? 0xbe00 : 0x3e00;
-
-       /* PLL output max 240 MHz (or 180 MHz per errata) */
-       if (out_freq > 240000000)
-               goto fail;
-
-       for (i = 1; i < 256; i++) {
-               int diff1;
-               unsigned input, mul1;
-
-               /*
-                * PLL input between 1MHz and 32MHz per spec, but lower
-                * frequences seem necessary in some cases so allow 100K.
-                */
-               input = main_freq / i;
-               if (input < 100000)
-                       continue;
-               if (input > 32000000)
-                       continue;
-
-               mul1 = out_freq / input;
-               if (mul1 > 2048)
-                       continue;
-               if (mul1 < 2)
-                       goto fail;
-
-               diff1 = out_freq - input * mul1;
-               if (diff1 < 0)
-                       diff1 = -diff1;
-               if (diff > diff1) {
-                       diff = diff1;
-                       div = i;
-                       mul = mul1;
-                       if (diff == 0)
-                               break;
-               }
-       }
-       if (i == 256 && diff > (out_freq >> 5))
-               goto fail;
-       return ret | ((mul - 1) << 16) | div;
-fail:
-       return 0;
-}
-
-/*
- * Several unused clocks may be active.  Turn them off.
- */
-static void __init at91_periphclk_reset(void)
-{
-       unsigned long reg;
-       struct clk *clk;
-
-       reg = at91_sys_read(AT91_PMC_PCSR);
-
-       list_for_each_entry(clk, &clocks, node) {
-               if (clk->mode != pmc_periph_mode)
-                       continue;
-
-               if (clk->users > 0)
-                       reg &= ~clk->pmc_mask;
-       }
-
-       at91_sys_write(AT91_PMC_PCDR, reg);
-}
-
-static struct clk *const standard_pmc_clocks[] __initdata = {
-       /* four primary clocks */
-       &clk32k,
-       &main_clk,
-       &plla,
-       &pllb,
-
-       /* PLLB children (USB) */
-       &udpck,
-       &uhpck,
-
-       /* MCK */
-       &mck
-};
-
-int __init at91_clock_init(unsigned long main_clock)
-{
-       unsigned tmp, freq, mckr;
-       int i;
-
-       /*
-        * When the bootloader initialized the main oscillator correctly,
-        * there's no problem using the cycle counter.  But if it didn't,
-        * or when using oscillator bypass mode, we must be told the speed
-        * of the main clock.
-        */
-       if (!main_clock) {
-               do {
-                       tmp = at91_sys_read(AT91_CKGR_MCFR);
-               } while (!(tmp & AT91_PMC_MAINRDY));
-               main_clock = (tmp & AT91_PMC_MAINF) * (AT91_SLOW_CLOCK / 16);
-       }
-       main_clk.rate_hz = main_clock;
-
-       /* report if PLLA is more than mildly overclocked */
-       plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_sys_read(AT91_CKGR_PLLAR));
-       if (plla.rate_hz > 209000000)
-               pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000);
-
-       /*
-        * USB clock init:  choose 48 MHz PLLB value, turn all clocks off,
-        * disable 48MHz clock during usb peripheral suspend.
-        *
-        * REVISIT:  assumes MCK doesn't derive from PLLB!
-        */
-       at91_pllb_usb_init = at91_pll_calc(main_clock, 48000000 * 2) | AT91_PMC_USB96M;
-       pllb.rate_hz = at91_pll_rate(&pllb, main_clock, at91_pllb_usb_init);
-       if (cpu_is_at91rm9200()) {
-               uhpck.pmc_mask = AT91RM9200_PMC_UHP;
-               udpck.pmc_mask = AT91RM9200_PMC_UDP;
-               at91_sys_write(AT91_PMC_SCDR, AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP);
-               at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP);
-       } else if (cpu_is_at91sam9260()) {
-               uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
-               udpck.pmc_mask = AT91SAM926x_PMC_UDP;
-               at91_sys_write(AT91_PMC_SCDR, AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP);
-       } else if (cpu_is_at91sam9261()) {
-               uhpck.pmc_mask = (AT91SAM926x_PMC_UHP | AT91_PMC_HCK0);
-               udpck.pmc_mask = AT91SAM926x_PMC_UDP;
-               at91_sys_write(AT91_PMC_SCDR, AT91SAM926x_PMC_UHP | AT91_PMC_HCK0 | AT91SAM926x_PMC_UDP);
-       }
-       at91_sys_write(AT91_CKGR_PLLBR, 0);
-
-       udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
-       uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
-
-       /*
-        * MCK and CPU derive from one of those primary clocks.
-        * For now, assume this parentage won't change.
-        */
-       mckr = at91_sys_read(AT91_PMC_MCKR);
-       mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS);
-       freq = mck.parent->rate_hz;
-       freq /= (1 << ((mckr >> 2) & 3));               /* prescale */
-       mck.rate_hz = freq / (1 + ((mckr >> 8) & 3));   /* mdiv */
-
-       /* Register the PMC's standard clocks */
-       for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++)
-               list_add_tail(&standard_pmc_clocks[i]->node, &clocks);
-
-       /* MCK and CPU clock are "always on" */
-       clk_enable(&mck);
-
-       printk("Clocks: CPU %u MHz, master %u MHz, main %u.%03u MHz\n",
-               freq / 1000000, (unsigned) mck.rate_hz / 1000000,
-               (unsigned) main_clock / 1000000,
-               ((unsigned) main_clock % 1000000) / 1000);
-
-       /* disable all programmable clocks */
-       at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK0 | AT91_PMC_PCK1 | AT91_PMC_PCK2 | AT91_PMC_PCK3);
-
-       /* disable all other unused peripheral clocks */
-       at91_periphclk_reset();
-
-       return 0;
-}
diff --git a/arch/arm/mach-at91rm9200/clock.h b/arch/arm/mach-at91rm9200/clock.h
deleted file mode 100644 (file)
index b5c7a2e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/clock.h
- *
- * 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 CLK_TYPE_PRIMARY       0x1
-#define CLK_TYPE_PLL           0x2
-#define CLK_TYPE_PROGRAMMABLE  0x4
-#define CLK_TYPE_PERIPHERAL    0x8
-#define CLK_TYPE_SYSTEM                0x10
-
-
-struct clk {
-       struct list_head node;
-       const char      *name;          /* unique clock name */
-       const char      *function;      /* function of the clock */
-       struct device   *dev;           /* device associated with function */
-       unsigned long   rate_hz;
-       struct clk      *parent;
-       u32             pmc_mask;
-       void            (*mode)(struct clk *, int);
-       unsigned        id:2;           /* PCK0..3, or 32k/main/a/b */
-       unsigned        type;           /* clock type */
-       u16             users;
-};
-
-
-extern int __init clk_register(struct clk *clk);
diff --git a/arch/arm/mach-at91rm9200/generic.h b/arch/arm/mach-at91rm9200/generic.h
deleted file mode 100644 (file)
index 8c4d5a7..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/generic.h
- *
- *  Copyright (C) 2005 David Brownell
- *
- * 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.
- */
-
- /* Processors */
-extern void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks);
-extern void __init at91sam9260_initialize(unsigned long main_clock);
-extern void __init at91sam9261_initialize(unsigned long main_clock);
-
- /* Interrupts */
-extern void __init at91rm9200_init_interrupts(unsigned int priority[]);
-extern void __init at91sam9260_init_interrupts(unsigned int priority[]);
-extern void __init at91sam9261_init_interrupts(unsigned int priority[]);
-extern void __init at91_aic_init(unsigned int priority[]);
-
- /* Timer */
-struct sys_timer;
-extern struct sys_timer at91rm9200_timer;
-extern struct sys_timer at91sam926x_timer;
-
- /* Clocks */
-extern int __init at91_clock_init(unsigned long main_clock);
-struct device;
-extern void __init at91_clock_associate(const char *id, struct device *dev, const char *func);
-
- /* Power Management */
-extern void at91_irq_suspend(void);
-extern void at91_irq_resume(void);
-
- /* GPIO */
-#define AT91RM9200_PQFP                3       /* AT91RM9200 PQFP package has 3 banks */
-#define AT91RM9200_BGA         4       /* AT91RM9200 BGA package has 4 banks */
-
-struct at91_gpio_bank {
-       unsigned short id;              /* peripheral ID */
-       unsigned long offset;           /* offset from system peripheral base */
-       struct clk *clock;              /* associated clock */
-};
-extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks);
-extern void __init at91_gpio_irq_setup(void);
-
-extern void (*at91_arch_reset)(void);
-extern int at91_extern_irq;
diff --git a/arch/arm/mach-at91rm9200/gpio.c b/arch/arm/mach-at91rm9200/gpio.c
deleted file mode 100644 (file)
index 15eb5b6..0000000
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/gpio.c
- *
- * Copyright (C) 2005 HP Labs
- *
- * 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/clk.h>
-#include <linux/errno.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/module.h>
-
-#include <asm/io.h>
-#include <asm/hardware.h>
-#include <asm/arch/at91_pio.h>
-#include <asm/arch/gpio.h>
-
-#include "generic.h"
-
-
-static struct at91_gpio_bank *gpio;
-static int gpio_banks;
-
-
-static inline void __iomem *pin_to_controller(unsigned pin)
-{
-       void __iomem *sys_base = (void __iomem *) AT91_VA_BASE_SYS;
-
-       pin -= PIN_BASE;
-       pin /= 32;
-       if (likely(pin < gpio_banks))
-               return sys_base + gpio[pin].offset;
-
-       return NULL;
-}
-
-static inline unsigned pin_to_mask(unsigned pin)
-{
-       pin -= PIN_BASE;
-       return 1 << (pin % 32);
-}
-
-
-/*--------------------------------------------------------------------------*/
-
-/* Not all hardware capabilities are exposed through these calls; they
- * only encapsulate the most common features and modes.  (So if you
- * want to change signals in groups, do it directly.)
- *
- * Bootloaders will usually handle some of the pin multiplexing setup.
- * The intent is certainly that by the time Linux is fully booted, all
- * pins should have been fully initialized.  These setup calls should
- * only be used by board setup routines, or possibly in driver probe().
- *
- * For bootloaders doing all that setup, these calls could be inlined
- * as NOPs so Linux won't duplicate any setup code
- */
-
-
-/*
- * mux the pin to the "GPIO" peripheral role.
- */
-int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (!pio)
-               return -EINVAL;
-       __raw_writel(mask, pio + PIO_IDR);
-       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
-       __raw_writel(mask, pio + PIO_PER);
-       return 0;
-}
-EXPORT_SYMBOL(at91_set_GPIO_periph);
-
-
-/*
- * mux the pin to the "A" internal peripheral role.
- */
-int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (!pio)
-               return -EINVAL;
-
-       __raw_writel(mask, pio + PIO_IDR);
-       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
-       __raw_writel(mask, pio + PIO_ASR);
-       __raw_writel(mask, pio + PIO_PDR);
-       return 0;
-}
-EXPORT_SYMBOL(at91_set_A_periph);
-
-
-/*
- * mux the pin to the "B" internal peripheral role.
- */
-int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (!pio)
-               return -EINVAL;
-
-       __raw_writel(mask, pio + PIO_IDR);
-       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
-       __raw_writel(mask, pio + PIO_BSR);
-       __raw_writel(mask, pio + PIO_PDR);
-       return 0;
-}
-EXPORT_SYMBOL(at91_set_B_periph);
-
-
-/*
- * mux the pin to the gpio controller (instead of "A" or "B" peripheral), and
- * configure it for an input.
- */
-int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (!pio)
-               return -EINVAL;
-
-       __raw_writel(mask, pio + PIO_IDR);
-       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
-       __raw_writel(mask, pio + PIO_ODR);
-       __raw_writel(mask, pio + PIO_PER);
-       return 0;
-}
-EXPORT_SYMBOL(at91_set_gpio_input);
-
-
-/*
- * mux the pin to the gpio controller (instead of "A" or "B" peripheral),
- * and configure it for an output.
- */
-int __init_or_module at91_set_gpio_output(unsigned pin, int value)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (!pio)
-               return -EINVAL;
-
-       __raw_writel(mask, pio + PIO_IDR);
-       __raw_writel(mask, pio + PIO_PUDR);
-       __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
-       __raw_writel(mask, pio + PIO_OER);
-       __raw_writel(mask, pio + PIO_PER);
-       return 0;
-}
-EXPORT_SYMBOL(at91_set_gpio_output);
-
-
-/*
- * enable/disable the glitch filter; mostly used with IRQ handling.
- */
-int __init_or_module at91_set_deglitch(unsigned pin, int is_on)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (!pio)
-               return -EINVAL;
-       __raw_writel(mask, pio + (is_on ? PIO_IFER : PIO_IFDR));
-       return 0;
-}
-EXPORT_SYMBOL(at91_set_deglitch);
-
-/*
- * enable/disable the multi-driver; This is only valid for output and
- * allows the output pin to run as an open collector output.
- */
-int __init_or_module at91_set_multi_drive(unsigned pin, int is_on)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (!pio)
-               return -EINVAL;
-
-       __raw_writel(mask, pio + (is_on ? PIO_MDER : PIO_MDDR));
-       return 0;
-}
-EXPORT_SYMBOL(at91_set_multi_drive);
-
-/*--------------------------------------------------------------------------*/
-
-/* new-style GPIO calls; these expect at91_set_GPIO_periph to have been
- * called, and maybe at91_set_multi_drive() for putout pins.
- */
-
-int gpio_direction_input(unsigned pin)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (!pio || !(__raw_readl(pio + PIO_PSR) & mask))
-               return -EINVAL;
-       __raw_writel(mask, pio + PIO_OER);
-       return 0;
-}
-EXPORT_SYMBOL(gpio_direction_input);
-
-int gpio_direction_output(unsigned pin)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (!pio || !(__raw_readl(pio + PIO_PSR) & mask))
-               return -EINVAL;
-       __raw_writel(mask, pio + PIO_OER);
-       return 0;
-}
-EXPORT_SYMBOL(gpio_direction_output);
-
-/*--------------------------------------------------------------------------*/
-
-/*
- * assuming the pin is muxed as a gpio output, set its value.
- */
-int at91_set_gpio_value(unsigned pin, int value)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (!pio)
-               return -EINVAL;
-       __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
-       return 0;
-}
-EXPORT_SYMBOL(at91_set_gpio_value);
-
-
-/*
- * read the pin's value (works even if it's not muxed as a gpio).
- */
-int at91_get_gpio_value(unsigned pin)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-       u32             pdsr;
-
-       if (!pio)
-               return -EINVAL;
-       pdsr = __raw_readl(pio + PIO_PDSR);
-       return (pdsr & mask) != 0;
-}
-EXPORT_SYMBOL(at91_get_gpio_value);
-
-/*--------------------------------------------------------------------------*/
-
-#ifdef CONFIG_PM
-
-static u32 wakeups[MAX_GPIO_BANKS];
-static u32 backups[MAX_GPIO_BANKS];
-
-static int gpio_irq_set_wake(unsigned pin, unsigned state)
-{
-       unsigned        mask = pin_to_mask(pin);
-       unsigned        bank = (pin - PIN_BASE) / 32;
-
-       if (unlikely(bank >= MAX_GPIO_BANKS))
-               return -EINVAL;
-
-       if (state)
-               wakeups[bank] |= mask;
-       else
-               wakeups[bank] &= ~mask;
-
-       set_irq_wake(gpio[bank].id, state);
-
-       return 0;
-}
-
-void at91_gpio_suspend(void)
-{
-       int i;
-
-       for (i = 0; i < gpio_banks; i++) {
-               u32 pio = gpio[i].offset;
-
-               backups[i] = at91_sys_read(pio + PIO_IMR);
-               at91_sys_write(pio + PIO_IDR, backups[i]);
-               at91_sys_write(pio + PIO_IER, wakeups[i]);
-
-               if (!wakeups[i])
-                       clk_disable(gpio[i].clock);
-               else {
-#ifdef CONFIG_PM_DEBUG
-                       printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", 'A'+i, wakeups[i]);
-#endif
-               }
-       }
-}
-
-void at91_gpio_resume(void)
-{
-       int i;
-
-       for (i = 0; i < gpio_banks; i++) {
-               u32 pio = gpio[i].offset;
-
-               if (!wakeups[i])
-                       clk_enable(gpio[i].clock);
-
-               at91_sys_write(pio + PIO_IDR, wakeups[i]);
-               at91_sys_write(pio + PIO_IER, backups[i]);
-       }
-}
-
-#else
-#define gpio_irq_set_wake      NULL
-#endif
-
-
-/* Several AIC controller irqs are dispatched through this GPIO handler.
- * To use any AT91_PIN_* as an externally triggered IRQ, first call
- * at91_set_gpio_input() then maybe enable its glitch filter.
- * Then just request_irq() with the pin ID; it works like any ARM IRQ
- * handler, though it always triggers on rising and falling edges.
- *
- * Alternatively, certain pins may be used directly as IRQ0..IRQ6 after
- * configuring them with at91_set_a_periph() or at91_set_b_periph().
- * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering.
- */
-
-static void gpio_irq_mask(unsigned pin)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (pio)
-               __raw_writel(mask, pio + PIO_IDR);
-}
-
-static void gpio_irq_unmask(unsigned pin)
-{
-       void __iomem    *pio = pin_to_controller(pin);
-       unsigned        mask = pin_to_mask(pin);
-
-       if (pio)
-               __raw_writel(mask, pio + PIO_IER);
-}
-
-static int gpio_irq_type(unsigned pin, unsigned type)
-{
-       return (type == IRQT_BOTHEDGE) ? 0 : -EINVAL;
-}
-
-static struct irq_chip gpio_irqchip = {
-       .name           = "GPIO",
-       .mask           = gpio_irq_mask,
-       .unmask         = gpio_irq_unmask,
-       .set_type       = gpio_irq_type,
-       .set_wake       = gpio_irq_set_wake,
-};
-
-static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
-{
-       unsigned        pin;
-       struct irq_desc *gpio;
-       void __iomem    *pio;
-       u32             isr;
-
-       pio = get_irq_chip_data(irq);
-
-       /* temporarily mask (level sensitive) parent IRQ */
-       desc->chip->ack(irq);
-       for (;;) {
-               /* reading ISR acks the pending (edge triggered) GPIO interrupt */
-               isr = __raw_readl(pio + PIO_ISR) & __raw_readl(pio + PIO_IMR);
-               if (!isr)
-                       break;
-
-               pin = (unsigned) get_irq_data(irq);
-               gpio = &irq_desc[pin];
-
-               while (isr) {
-                       if (isr & 1) {
-                               if (unlikely(gpio->depth)) {
-                                       /*
-                                        * The core ARM interrupt handler lazily disables IRQs so
-                                        * another IRQ must be generated before it actually gets
-                                        * here to be disabled on the GPIO controller.
-                                        */
-                                       gpio_irq_mask(pin);
-                               }
-                               else
-                                       desc_handle_irq(pin, gpio);
-                       }
-                       pin++;
-                       gpio++;
-                       isr >>= 1;
-               }
-       }
-       desc->chip->unmask(irq);
-       /* now it may re-trigger */
-}
-
-/*--------------------------------------------------------------------------*/
-
-/*
- * Called from the processor-specific init to enable GPIO interrupt support.
- */
-void __init at91_gpio_irq_setup(void)
-{
-       unsigned        pioc, pin;
-
-       for (pioc = 0, pin = PIN_BASE;
-                       pioc < gpio_banks;
-                       pioc++) {
-               void __iomem    *controller;
-               unsigned        id = gpio[pioc].id;
-               unsigned        i;
-
-               clk_enable(gpio[pioc].clock);   /* enable PIO controller's clock */
-
-               controller = (void __iomem *) AT91_VA_BASE_SYS + gpio[pioc].offset;
-               __raw_writel(~0, controller + PIO_IDR);
-
-               set_irq_data(id, (void *) pin);
-               set_irq_chip_data(id, controller);
-
-               for (i = 0; i < 32; i++, pin++) {
-                       /*
-                        * Can use the "simple" and not "edge" handler since it's
-                        * shorter, and the AIC handles interupts sanely.
-                        */
-                       set_irq_chip(pin, &gpio_irqchip);
-                       set_irq_handler(pin, handle_simple_irq);
-                       set_irq_flags(pin, IRQF_VALID);
-               }
-
-               set_irq_chained_handler(id, gpio_irq_handler);
-       }
-       pr_info("AT91: %d gpio irqs in %d banks\n", pin - PIN_BASE, gpio_banks);
-}
-
-/*
- * Called from the processor-specific init to enable GPIO pin support.
- */
-void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks)
-{
-       BUG_ON(nr_banks > MAX_GPIO_BANKS);
-
-       gpio = data;
-       gpio_banks = nr_banks;
-}
diff --git a/arch/arm/mach-at91rm9200/irq.c b/arch/arm/mach-at91rm9200/irq.c
deleted file mode 100644 (file)
index 2148daa..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/irq.c
- *
- *  Copyright (C) 2004 SAN People
- *  Copyright (C) 2004 ATMEL
- *  Copyright (C) Rick Bronson
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/mm.h>
-#include <linux/types.h>
-
-#include <asm/hardware.h>
-#include <asm/irq.h>
-#include <asm/mach-types.h>
-#include <asm/setup.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/irq.h>
-#include <asm/mach/map.h>
-
-
-static void at91_aic_mask_irq(unsigned int irq)
-{
-       /* Disable interrupt on AIC */
-       at91_sys_write(AT91_AIC_IDCR, 1 << irq);
-}
-
-static void at91_aic_unmask_irq(unsigned int irq)
-{
-       /* Enable interrupt on AIC */
-       at91_sys_write(AT91_AIC_IECR, 1 << irq);
-}
-
-unsigned int at91_extern_irq;
-
-#define is_extern_irq(irq) ((1 << (irq)) & at91_extern_irq)
-
-static int at91_aic_set_type(unsigned irq, unsigned type)
-{
-       unsigned int smr, srctype;
-
-       switch (type) {
-       case IRQT_HIGH:
-               srctype = AT91_AIC_SRCTYPE_HIGH;
-               break;
-       case IRQT_RISING:
-               srctype = AT91_AIC_SRCTYPE_RISING;
-               break;
-       case IRQT_LOW:
-               if ((irq == AT91_ID_FIQ) || is_extern_irq(irq))         /* only supported on external interrupts */
-                       srctype = AT91_AIC_SRCTYPE_LOW;
-               else
-                       return -EINVAL;
-               break;
-       case IRQT_FALLING:
-               if ((irq == AT91_ID_FIQ) || is_extern_irq(irq))         /* only supported on external interrupts */
-                       srctype = AT91_AIC_SRCTYPE_FALLING;
-               else
-                       return -EINVAL;
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       smr = at91_sys_read(AT91_AIC_SMR(irq)) & ~AT91_AIC_SRCTYPE;
-       at91_sys_write(AT91_AIC_SMR(irq), smr | srctype);
-       return 0;
-}
-
-#ifdef CONFIG_PM
-
-static u32 wakeups;
-static u32 backups;
-
-static int at91_aic_set_wake(unsigned irq, unsigned value)
-{
-       if (unlikely(irq >= 32))
-               return -EINVAL;
-
-       if (value)
-               wakeups |= (1 << irq);
-       else
-               wakeups &= ~(1 << irq);
-
-       return 0;
-}
-
-void at91_irq_suspend(void)
-{
-       backups = at91_sys_read(AT91_AIC_IMR);
-       at91_sys_write(AT91_AIC_IDCR, backups);
-       at91_sys_write(AT91_AIC_IECR, wakeups);
-}
-
-void at91_irq_resume(void)
-{
-       at91_sys_write(AT91_AIC_IDCR, wakeups);
-       at91_sys_write(AT91_AIC_IECR, backups);
-}
-
-#else
-#define at91_aic_set_wake      NULL
-#endif
-
-static struct irq_chip at91_aic_chip = {
-       .name           = "AIC",
-       .ack            = at91_aic_mask_irq,
-       .mask           = at91_aic_mask_irq,
-       .unmask         = at91_aic_unmask_irq,
-       .set_type       = at91_aic_set_type,
-       .set_wake       = at91_aic_set_wake,
-};
-
-/*
- * Initialize the AIC interrupt controller.
- */
-void __init at91_aic_init(unsigned int priority[NR_AIC_IRQS])
-{
-       unsigned int i;
-
-       /*
-        * The IVR is used by macro get_irqnr_and_base to read and verify.
-        * The irq number is NR_AIC_IRQS when a spurious interrupt has occurred.
-        */
-       for (i = 0; i < NR_AIC_IRQS; i++) {
-               /* Put irq number in Source Vector Register: */
-               at91_sys_write(AT91_AIC_SVR(i), i);
-               /* Active Low interrupt, with the specified priority */
-               at91_sys_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]);
-
-               set_irq_chip(i, &at91_aic_chip);
-               set_irq_handler(i, handle_level_irq);
-               set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
-
-               /* Perform 8 End Of Interrupt Command to make sure AIC will not Lock out nIRQ */
-               if (i < 8)
-                       at91_sys_write(AT91_AIC_EOICR, 0);
-       }
-
-       /*
-        * Spurious Interrupt ID in Spurious Vector Register is NR_AIC_IRQS
-        * When there is no current interrupt, the IRQ Vector Register reads the value stored in AIC_SPU
-        */
-       at91_sys_write(AT91_AIC_SPU, NR_AIC_IRQS);
-
-       /* No debugging in AIC: Debug (Protect) Control Register */
-       at91_sys_write(AT91_AIC_DCR, 0);
-
-       /* Disable and clear all interrupts initially */
-       at91_sys_write(AT91_AIC_IDCR, 0xFFFFFFFF);
-       at91_sys_write(AT91_AIC_ICCR, 0xFFFFFFFF);
-}
diff --git a/arch/arm/mach-at91rm9200/leds.c b/arch/arm/mach-at91rm9200/leds.c
deleted file mode 100644 (file)
index 1a33373..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * LED driver for Atmel AT91-based boards.
- *
- *  Copyright (C) SAN People (Pty) Ltd
- *
- * 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/module.h>
-#include <linux/init.h>
-
-#include <asm/mach-types.h>
-#include <asm/leds.h>
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
-
-
-static inline void at91_led_on(unsigned int led)
-{
-       at91_set_gpio_value(led, 0);
-}
-
-static inline void at91_led_off(unsigned int led)
-{
-       at91_set_gpio_value(led, 1);
-}
-
-static inline void at91_led_toggle(unsigned int led)
-{
-       unsigned long is_off = at91_get_gpio_value(led);
-       if (is_off)
-               at91_led_on(led);
-       else
-               at91_led_off(led);
-}
-
-
-/*
- * Handle LED events.
- */
-static void at91_leds_event(led_event_t evt)
-{
-       unsigned long flags;
-
-       local_irq_save(flags);
-
-       switch(evt) {
-       case led_start:         /* System startup */
-               at91_led_on(at91_leds_cpu);
-               break;
-
-       case led_stop:          /* System stop / suspend */
-               at91_led_off(at91_leds_cpu);
-               break;
-
-#ifdef CONFIG_LEDS_TIMER
-       case led_timer:         /* Every 50 timer ticks */
-               at91_led_toggle(at91_leds_timer);
-               break;
-#endif
-
-#ifdef CONFIG_LEDS_CPU
-       case led_idle_start:    /* Entering idle state */
-               at91_led_off(at91_leds_cpu);
-               break;
-
-       case led_idle_end:      /* Exit idle state */
-               at91_led_on(at91_leds_cpu);
-               break;
-#endif
-
-       default:
-               break;
-       }
-
-       local_irq_restore(flags);
-}
-
-
-static int __init leds_init(void)
-{
-       if (!at91_leds_timer || !at91_leds_cpu)
-               return -ENODEV;
-
-       /* Enable PIO to access the LEDs */
-       at91_set_gpio_output(at91_leds_timer, 1);
-       at91_set_gpio_output(at91_leds_cpu, 1);
-
-       leds_event = at91_leds_event;
-
-       leds_event(led_start);
-       return 0;
-}
-
-__initcall(leds_init);
diff --git a/arch/arm/mach-at91rm9200/pm.c b/arch/arm/mach-at91rm9200/pm.c
deleted file mode 100644 (file)
index 67aa557..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * arch/arm/mach-at91rm9200/pm.c
- * AT91 Power Management
- *
- * Copyright (C) 2005 David Brownell
- *
- * 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/pm.h>
-#include <linux/sched.h>
-#include <linux/proc_fs.h>
-#include <linux/pm.h>
-#include <linux/interrupt.h>
-#include <linux/sysfs.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/atomic.h>
-#include <asm/mach/time.h>
-#include <asm/mach/irq.h>
-#include <asm/mach-types.h>
-
-#include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91rm9200_mc.h>
-#include <asm/arch/gpio.h>
-#include <asm/arch/cpu.h>
-
-#include "generic.h"
-
-
-static int at91_pm_valid_state(suspend_state_t state)
-{
-       switch (state) {
-               case PM_SUSPEND_ON:
-               case PM_SUSPEND_STANDBY:
-               case PM_SUSPEND_MEM:
-                       return 1;
-
-               default:
-                       return 0;
-       }
-}
-
-
-static suspend_state_t target_state;
-
-/*
- * Called after processes are frozen, but before we shutdown devices.
- */
-static int at91_pm_prepare(suspend_state_t state)
-{
-       target_state = state;
-       return 0;
-}
-
-/*
- * Verify that all the clocks are correct before entering
- * slow-clock mode.
- */
-static int at91_pm_verify_clocks(void)
-{
-       unsigned long scsr;
-       int i;
-
-       scsr = at91_sys_read(AT91_PMC_SCSR);
-
-       /* USB must not be using PLLB */
-       if (cpu_is_at91rm9200()) {
-               if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) {
-                       pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n");
-                       return 0;
-               }
-       } else if (cpu_is_at91sam9260()) {
-#warning "Check SAM9260 USB clocks"
-       } else if (cpu_is_at91sam9261()) {
-#warning "Check SAM9261 USB clocks"
-       }
-
-#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
-       /* PCK0..PCK3 must be disabled, or configured to use clk32k */
-       for (i = 0; i < 4; i++) {
-               u32 css;
-
-               if ((scsr & (AT91_PMC_PCK0 << i)) == 0)
-                       continue;
-
-               css = at91_sys_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS;
-               if (css != AT91_PMC_CSS_SLOW) {
-                       pr_debug("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css);
-                       return 0;
-               }
-       }
-#endif
-
-       return 1;
-}
-
-/*
- * Call this from platform driver suspend() to see how deeply to suspend.
- * For example, some controllers (like OHCI) need one of the PLL clocks
- * in order to act as a wakeup source, and those are not available when
- * going into slow clock mode.
- *
- * REVISIT: generalize as clk_will_be_available(clk)?  Other platforms have
- * the very same problem (but not using at91 main_clk), and it'd be better
- * to add one generic API rather than lots of platform-specific ones.
- */
-int at91_suspend_entering_slow_clock(void)
-{
-       return (target_state == PM_SUSPEND_MEM);
-}
-EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
-
-
-static void (*slow_clock)(void);
-
-
-static int at91_pm_enter(suspend_state_t state)
-{
-       at91_gpio_suspend();
-       at91_irq_suspend();
-
-       pr_debug("AT91: PM - wake mask %08x, pm state %d\n",
-                       /* remember all the always-wake irqs */
-                       (at91_sys_read(AT91_PMC_PCSR)
-                                       | (1 << AT91_ID_FIQ)
-                                       | (1 << AT91_ID_SYS)
-                                       | (at91_extern_irq))
-                               & at91_sys_read(AT91_AIC_IMR),
-                       state);
-
-       switch (state) {
-               /*
-                * Suspend-to-RAM is like STANDBY plus slow clock mode, so
-                * drivers must suspend more deeply:  only the master clock
-                * controller may be using the main oscillator.
-                */
-               case PM_SUSPEND_MEM:
-                       /*
-                        * Ensure that clocks are in a valid state.
-                        */
-                       if (!at91_pm_verify_clocks())
-                               goto error;
-
-                       /*
-                        * Enter slow clock mode by switching over to clk32k and
-                        * turning off the main oscillator; reverse on wakeup.
-                        */
-                       if (slow_clock) {
-                               slow_clock();
-                               break;
-                       } else {
-                               /* DEVELOPMENT ONLY */
-                               pr_info("AT91: PM - no slow clock mode yet ...\n");
-                               /* FALLTHROUGH leaving master clock alone */
-                       }
-
-               /*
-                * STANDBY mode has *all* drivers suspended; ignores irqs not
-                * marked as 'wakeup' event sources; and reduces DRAM power.
-                * But otherwise it's identical to PM_SUSPEND_ON:  cpu idle, and
-                * nothing fancy done with main or cpu clocks.
-                */
-               case PM_SUSPEND_STANDBY:
-                       /*
-                        * NOTE: the Wait-for-Interrupt instruction needs to be
-                        * in icache so the SDRAM stays in self-refresh mode until
-                        * the wakeup IRQ occurs.
-                        */
-                       asm("b 1f; .align 5; 1:");
-                       asm("mcr p15, 0, r0, c7, c10, 4");      /* drain write buffer */
-                       at91_sys_write(AT91_SDRAMC_SRR, 1);     /* self-refresh mode */
-                       /* fall though to next state */
-
-               case PM_SUSPEND_ON:
-                       asm("mcr p15, 0, r0, c7, c0, 4");       /* wait for interrupt */
-                       break;
-
-               default:
-                       pr_debug("AT91: PM - bogus suspend state %d\n", state);
-                       goto error;
-       }
-
-       pr_debug("AT91: PM - wakeup %08x\n",
-                       at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR));
-
-error:
-       target_state = PM_SUSPEND_ON;
-       at91_irq_resume();
-       at91_gpio_resume();
-       return 0;
-}
-
-
-static struct pm_ops at91_pm_ops ={
-       .pm_disk_mode   = 0,
-       .valid          = at91_pm_valid_state,
-       .prepare        = at91_pm_prepare,
-       .enter          = at91_pm_enter,
-};
-
-static int __init at91_pm_init(void)
-{
-       printk("AT91: Power Management\n");
-
-#ifdef CONFIG_AT91_PM_SLOW_CLOCK
-       /* REVISIT allocations of SRAM should be dynamically managed.
-        * FIQ handlers and other components will want SRAM/TCM too...
-        */
-       slow_clock = (void *) (AT91_VA_BASE_SRAM + (3 * SZ_4K));
-       memcpy(slow_clock, at91rm9200_slow_clock, at91rm9200_slow_clock_sz);
-#endif
-
-       /* Disable SDRAM low-power mode.  Cannot be used with self-refresh. */
-       at91_sys_write(AT91_SDRAMC_LPR, 0);
-
-       pm_set_ops(&at91_pm_ops);
-
-       return 0;
-}
-arch_initcall(at91_pm_init);
index af7904b3d0a864149593d38e307f7debbc49267f..575a21dabd2f530ab8dbb1c7a570d6c0ba8084e8 100644 (file)
@@ -51,6 +51,31 @@ config MACH_GESBC9312
          Say 'Y' here if you want your kernel to support the Glomation
          GESBC-9312-sx board.
 
+config MACH_MICRO9
+        bool
+        default n
+
+config MACH_MICRO9H
+       bool "Support Contec Hypercontrol Micro9-H"
+       select MACH_MICRO9
+       help
+         Say 'Y' here if you want your kernel to support the
+         Contec Hypercontrol Micro9-H board.
+
+config MACH_MICRO9M
+       bool "Support Contec Hypercontrol Micro9-M"
+       select MACH_MICRO9
+       help
+         Say 'Y' here if you want your kernel to support the
+         Contec Hypercontrol Micro9-M board.
+
+config MACH_MICRO9L
+       bool "Support Contec Hypercontrol Micro9-L"
+       select MACH_MICRO9
+       help
+         Say 'Y' here if you want your kernel to support the
+         Contec Hypercontrol Micro9-L board.
+
 config MACH_TS72XX
        bool "Support Technologic Systems TS-72xx SBC"
        help
index b06641dd450d5699c9bda5422d6dc2eabfe08027..0d3bf932654ee431bfc4d9b9682ca431114373e9 100644 (file)
@@ -13,4 +13,5 @@ obj-$(CONFIG_MACH_EDB9312)    += edb9312.o
 obj-$(CONFIG_MACH_EDB9315)     += edb9315.o
 obj-$(CONFIG_MACH_EDB9315A)    += edb9315a.o
 obj-$(CONFIG_MACH_GESBC9312)   += gesbc9312.o
+obj-$(CONFIG_MACH_MICRO9)      += micro9.o
 obj-$(CONFIG_MACH_TS72XX)      += ts72xx.o
index 08ad782c1649fb116987f14914f36872c481cd93..f174d1a3b11c7333d18a19f3524e39256af05add 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/clk.h>
 #include <linux/err.h>
+#include <linux/module.h>
 #include <linux/string.h>
 #include <asm/div64.h>
 #include <asm/hardware.h>
@@ -124,7 +125,7 @@ static unsigned long calc_pll_rate(u32 config_word)
        return (unsigned long)rate;
 }
 
-void ep93xx_clock_init(void)
+static int __init ep93xx_clock_init(void)
 {
        u32 value;
 
@@ -153,4 +154,7 @@ void ep93xx_clock_init(void)
        printk(KERN_INFO "ep93xx: FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
                clk_f.rate / 1000000, clk_h.rate / 1000000,
                clk_p.rate / 1000000);
+
+       return 0;
 }
+arch_initcall(ep93xx_clock_init);
index 6b26346191c040f9949094232a7cf8e072949161..829aed696d982420b094280e8ff6cd9b3a029c6b 100644 (file)
@@ -152,22 +152,30 @@ struct sys_timer ep93xx_timer = {
 /*************************************************************************
  * GPIO handling for EP93xx
  *************************************************************************/
-static unsigned char gpio_int_enable[2];
-static unsigned char gpio_int_type1[2];
-static unsigned char gpio_int_type2[2];
+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 void update_gpio_ab_int_params(int port)
+static void update_gpio_int_params(int abf)
 {
-       if (port == 0) {
+       if (abf == 0) {
                __raw_writeb(0, EP93XX_GPIO_A_INT_ENABLE);
                __raw_writeb(gpio_int_type2[0], EP93XX_GPIO_A_INT_TYPE2);
                __raw_writeb(gpio_int_type1[0], EP93XX_GPIO_A_INT_TYPE1);
-               __raw_writeb(gpio_int_enable[0], EP93XX_GPIO_A_INT_ENABLE);
-       } else if (port == 1) {
+               __raw_writeb(gpio_int_unmasked[0] & gpio_int_enabled[0], EP93XX_GPIO_A_INT_ENABLE);
+       } else if (abf == 1) {
                __raw_writeb(0, EP93XX_GPIO_B_INT_ENABLE);
                __raw_writeb(gpio_int_type2[1], EP93XX_GPIO_B_INT_TYPE2);
                __raw_writeb(gpio_int_type1[1], EP93XX_GPIO_B_INT_TYPE1);
-               __raw_writeb(gpio_int_enable[1], EP93XX_GPIO_B_INT_ENABLE);
+               __raw_writeb(gpio_int_unmasked[1] & gpio_int_enabled[1], EP93XX_GPIO_B_INT_ENABLE);
+       } else if (abf == 2) {
+               __raw_writeb(0, EP93XX_GPIO_F_INT_ENABLE);
+               __raw_writeb(gpio_int_type2[2], EP93XX_GPIO_F_INT_TYPE2);
+               __raw_writeb(gpio_int_type1[2], EP93XX_GPIO_F_INT_TYPE1);
+               __raw_writeb(gpio_int_unmasked[2] & gpio_int_enabled[2], EP93XX_GPIO_F_INT_ENABLE);
+       } else {
+               BUG();
        }
 }
 
@@ -192,8 +200,13 @@ void gpio_line_config(int line, int direction)
        local_irq_save(flags);
        if (direction == GPIO_OUT) {
                if (line >= 0 && line < 16) {
-                       gpio_int_enable[line >> 3] &= ~(1 << (line & 7));
-                       update_gpio_ab_int_params(line >> 3);
+                       /* Port A/B.  */
+                       gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
+                       update_gpio_int_params(line >> 3);
+               } else if (line >= 40 && line < 48) {
+                       /* Port F.  */
+                       gpio_int_unmasked[2] &= ~(1 << (line & 7));
+                       update_gpio_int_params(2);
                }
 
                v = __raw_readb(data_direction_register);
@@ -244,8 +257,7 @@ EXPORT_SYMBOL(gpio_line_set);
 /*************************************************************************
  * EP93xx IRQ handling
  *************************************************************************/
-static void ep93xx_gpio_ab_irq_handler(unsigned int irq,
-               struct irq_desc *desc)
+static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc)
 {
        unsigned char status;
        int i;
@@ -267,37 +279,46 @@ static void ep93xx_gpio_ab_irq_handler(unsigned int irq,
        }
 }
 
-static void ep93xx_gpio_ab_irq_mask_ack(unsigned int irq)
+static void ep93xx_gpio_f_irq_handler(unsigned int irq, struct irq_desc *desc)
+{
+       int gpio_irq = IRQ_EP93XX_GPIO(16) + (((irq + 1) & 7) ^ 4);
+
+       desc_handle_irq(gpio_irq, irq_desc + gpio_irq);
+}
+
+static void ep93xx_gpio_irq_mask_ack(unsigned int irq)
 {
        int line = irq - IRQ_EP93XX_GPIO(0);
        int port = line >> 3;
 
-       gpio_int_enable[port] &= ~(1 << (line & 7));
-       update_gpio_ab_int_params(port);
+       gpio_int_unmasked[port] &= ~(1 << (line & 7));
+       update_gpio_int_params(port);
 
-       if (line >> 3) {
-               __raw_writel(1 << (line & 7), EP93XX_GPIO_B_INT_ACK);
-       } else {
+       if (port == 0) {
                __raw_writel(1 << (line & 7), EP93XX_GPIO_A_INT_ACK);
+       } else if (port == 1) {
+               __raw_writel(1 << (line & 7), EP93XX_GPIO_B_INT_ACK);
+       } else if (port == 2) {
+               __raw_writel(1 << (line & 7), EP93XX_GPIO_F_INT_ACK);
        }
 }
 
-static void ep93xx_gpio_ab_irq_mask(unsigned int irq)
+static void ep93xx_gpio_irq_mask(unsigned int irq)
 {
        int line = irq - IRQ_EP93XX_GPIO(0);
        int port = line >> 3;
 
-       gpio_int_enable[port] &= ~(1 << (line & 7));
-       update_gpio_ab_int_params(port);
+       gpio_int_unmasked[port] &= ~(1 << (line & 7));
+       update_gpio_int_params(port);
 }
 
-static void ep93xx_gpio_ab_irq_unmask(unsigned int irq)
+static void ep93xx_gpio_irq_unmask(unsigned int irq)
 {
        int line = irq - IRQ_EP93XX_GPIO(0);
        int port = line >> 3;
 
-       gpio_int_enable[port] |= 1 << (line & 7);
-       update_gpio_ab_int_params(port);
+       gpio_int_unmasked[port] |= 1 << (line & 7);
+       update_gpio_int_params(port);
 }
 
 
@@ -306,40 +327,51 @@ static void ep93xx_gpio_ab_irq_unmask(unsigned int irq)
  * edge (1) triggered, while gpio_int_type2 controls whether it
  * triggers on low/falling (0) or high/rising (1).
  */
-static int ep93xx_gpio_ab_irq_type(unsigned int irq, unsigned int type)
+static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
 {
        int port;
        int line;
 
        line = irq - IRQ_EP93XX_GPIO(0);
-       gpio_line_config(line, GPIO_IN);
+       if (line >= 0 && line < 16) {
+               gpio_line_config(line, GPIO_IN);
+       } else {
+               gpio_line_config(EP93XX_GPIO_LINE_F(line), GPIO_IN);
+       }
 
        port = line >> 3;
        line &= 7;
 
        if (type & IRQT_RISING) {
+               gpio_int_enabled[port] |= 1 << line;
                gpio_int_type1[port] |= 1 << line;
                gpio_int_type2[port] |= 1 << line;
        } else if (type & IRQT_FALLING) {
+               gpio_int_enabled[port] |= 1 << line;
                gpio_int_type1[port] |= 1 << line;
                gpio_int_type2[port] &= ~(1 << line);
        } else if (type & IRQT_HIGH) {
+               gpio_int_enabled[port] |= 1 << line;
                gpio_int_type1[port] &= ~(1 << line);
                gpio_int_type2[port] |= 1 << line;
        } else if (type & IRQT_LOW) {
+               gpio_int_enabled[port] |= 1 << line;
                gpio_int_type1[port] &= ~(1 << line);
                gpio_int_type2[port] &= ~(1 << line);
+       } else {
+               gpio_int_enabled[port] &= ~(1 << line);
        }
-       update_gpio_ab_int_params(port);
+       update_gpio_int_params(port);
 
        return 0;
 }
 
-static struct irq_chip ep93xx_gpio_ab_irq_chip = {
-       .ack            = ep93xx_gpio_ab_irq_mask_ack,
-       .mask           = ep93xx_gpio_ab_irq_mask,
-       .unmask         = ep93xx_gpio_ab_irq_unmask,
-       .set_type       = ep93xx_gpio_ab_irq_type,
+static struct irq_chip ep93xx_gpio_irq_chip = {
+       .name           = "GPIO",
+       .ack            = ep93xx_gpio_irq_mask_ack,
+       .mask           = ep93xx_gpio_irq_mask,
+       .unmask         = ep93xx_gpio_irq_unmask,
+       .set_type       = ep93xx_gpio_irq_type,
 };
 
 
@@ -350,12 +382,21 @@ void __init ep93xx_init_irq(void)
        vic_init((void *)EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK);
        vic_init((void *)EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK);
 
-       for (irq = IRQ_EP93XX_GPIO(0) ; irq <= IRQ_EP93XX_GPIO(15); irq++) {
-               set_irq_chip(irq, &ep93xx_gpio_ab_irq_chip);
+       for (irq = IRQ_EP93XX_GPIO(0); irq <= IRQ_EP93XX_GPIO(23); irq++) {
+               set_irq_chip(irq, &ep93xx_gpio_irq_chip);
                set_irq_handler(irq, handle_level_irq);
                set_irq_flags(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);
 }
 
 
@@ -461,8 +502,6 @@ void __init ep93xx_init_devices(void)
 {
        unsigned int v;
 
-       ep93xx_clock_init();
-
        /*
         * Disallow access to MaverickCrunch initially.
         */
@@ -477,8 +516,4 @@ void __init ep93xx_init_devices(void)
 
        platform_device_register(&ep93xx_rtc_device);
        platform_device_register(&ep93xx_ohci_device);
-
-#ifdef CONFIG_CRUNCH
-       elf_hwcap |= HWCAP_CRUNCH;
-#endif
 }
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c
new file mode 100644 (file)
index 0000000..f28c129
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ *  linux/arch/arm/mach-ep93xx/micro9.c
+ *
+ * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH
+ *                   Manfred Gruber <manfred.gruber@contec.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/platform_device.h>
+#include <linux/sched.h>
+
+#include <linux/mtd/physmap.h>
+
+#include <asm/io.h>
+#include <asm/hardware.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach-types.h>
+
+static struct ep93xx_eth_data micro9_eth_data = {
+       .phy_id                 = 0x1f,
+};
+
+static struct resource micro9_eth_resource[] = {
+       {
+               .start  = EP93XX_ETHERNET_PHYS_BASE,
+               .end    = EP93XX_ETHERNET_PHYS_BASE + 0xffff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = IRQ_EP93XX_ETHERNET,
+               .end    = IRQ_EP93XX_ETHERNET,
+               .flags  = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device micro9_eth_device = {
+       .name           = "ep93xx-eth",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &micro9_eth_data,
+       },
+       .num_resources = ARRAY_SIZE(micro9_eth_resource),
+       .resource       = micro9_eth_resource,
+};
+
+static void __init micro9_eth_init(void)
+{
+       memcpy(micro9_eth_data.dev_addr,
+               (void *)(EP93XX_ETHERNET_BASE + 0x50), 6);
+       platform_device_register(&micro9_eth_device);
+}
+
+static void __init micro9_init(void)
+{
+       micro9_eth_init();
+}
+
+/*
+ * Micro9-H
+ */
+#ifdef CONFIG_MACH_MICRO9H
+static struct physmap_flash_data micro9h_flash_data = {
+       .width          = 4,
+};
+
+static struct resource micro9h_flash_resource = {
+       .start          = 0x10000000,
+       .end            = 0x13ffffff,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device micro9h_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &micro9h_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &micro9h_flash_resource,
+};
+
+static void __init micro9h_init(void)
+{
+       platform_device_register(&micro9h_flash);
+}
+
+static void __init micro9h_init_machine(void)
+{
+       ep93xx_init_devices();
+       micro9_init();
+       micro9h_init();
+}
+
+MACHINE_START(MICRO9, "Contec Hypercontrol Micro9-H")
+       /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
+       .phys_io        = EP93XX_APB_PHYS_BASE,
+       .io_pg_offst    = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
+       .boot_params    = 0x00000100,
+       .map_io         = ep93xx_map_io,
+       .init_irq       = ep93xx_init_irq,
+       .timer          = &ep93xx_timer,
+       .init_machine   = micro9h_init_machine,
+MACHINE_END
+#endif
+
+/*
+ * Micro9-M
+ */
+#ifdef CONFIG_MACH_MICRO9M
+static void __init micro9m_init_machine(void)
+{
+       ep93xx_init_devices();
+       micro9_init();
+}
+
+MACHINE_START(MICRO9M, "Contec Hypercontrol Micro9-M")
+       /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
+       .phys_io        = EP93XX_APB_PHYS_BASE,
+       .io_pg_offst    = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
+       .boot_params    = 0x00000100,
+       .map_io         = ep93xx_map_io,
+       .init_irq       = ep93xx_init_irq,
+       .timer          = &ep93xx_timer,
+       .init_machine   = micro9m_init_machine,
+MACHINE_END
+#endif
+
+/*
+ * Micro9-L
+ */
+#ifdef CONFIG_MACH_MICRO9L
+static void __init micro9l_init_machine(void)
+{
+       ep93xx_init_devices();
+       micro9_init();
+}
+
+MACHINE_START(MICRO9L, "Contec Hypercontrol Micro9-L")
+       /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
+       .phys_io        = EP93XX_APB_PHYS_BASE,
+       .io_pg_offst    = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
+       .boot_params    = 0x00000100,
+       .map_io         = ep93xx_map_io,
+       .init_irq       = ep93xx_init_irq,
+       .timer          = &ep93xx_timer,
+       .init_machine   = micro9l_init_machine,
+MACHINE_END
+#endif
+
index dbbc07c38b141349f9883b78019407517cf32a33..162b93214965435d395a95b437162d49a49c935f 100644 (file)
@@ -250,11 +250,14 @@ static struct irq_chip iop13xx_irqchip4 = {
        .unmask = iop13xx_irq_unmask3,
 };
 
+extern void iop_init_cp6_handler(void);
+
 void __init iop13xx_init_irq(void)
 {
        unsigned int i;
 
        u32 cp_flags = iop13xx_cp6_save();
+       iop_init_cp6_handler();
 
        /* disable all interrupts */
        write_intctl_0(0);
index 3ec1cd5c4f99733e4b1e76a9116f27b6040709b9..8b0ac5590ae4611ad2ac519b220dd75bde0b33fd 100644 (file)
@@ -60,6 +60,8 @@ void __init iop32x_init_irq(void)
 {
        int i;
 
+       iop_init_cp6_handler();
+
        intctl_write(0);
        intstr_write(0);
        if (machine_is_glantank() ||
index 2499a7707e3ca8288ba84d3a18d1f70ed184b8f6..966aa51aee09f2a2ae2f430357234d7e178bce85 100644 (file)
@@ -120,6 +120,20 @@ static struct hw_pci n2100_pci __initdata = {
        .map_irq        = n2100_pci_map_irq,
 };
 
+/*
+ * Both r8169 chips on the n2100 exhibit PCI parity problems.  Set
+ * the ->broken_parity_status flag for both ports so that the r8169
+ * driver knows it should ignore error interrupts.
+ */
+static void n2100_fixup_r8169(struct pci_dev *dev)
+{
+       if (dev->bus->number == 0 &&
+           (dev->devfn == PCI_DEVFN(1, 0) ||
+            dev->devfn == PCI_DEVFN(2, 0)))
+               dev->broken_parity_status = 1;
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REALTEK, PCI_ANY_ID, n2100_fixup_r8169);
+
 static int __init n2100_pci_init(void)
 {
        if (machine_is_n2100())
index 00b37f32d72e0c9a9314d93412850babd7c8c926..effbe6b782d04b2dc3d7f6f0abbc5839013ba044 100644 (file)
@@ -110,6 +110,8 @@ void __init iop33x_init_irq(void)
 {
        int i;
 
+       iop_init_cp6_handler();
+
        intctl0_write(0);
        intctl1_write(0);
        intstr0_write(0);
index e316bd93313f656215588f30488188860c9da7b7..8a339cdfe222f807ab32c3a18a0759003a9261b0 100644 (file)
@@ -17,7 +17,7 @@ config MACH_NSLU2
          NSLU2 NAS device. For more information on this platform,
          see http://www.nslu2-linux.org
 
-config ARCH_AVILA
+config MACH_AVILA
        bool "Avila"
        select PCI
        help
@@ -25,6 +25,14 @@ config ARCH_AVILA
          Avila Network Platform. For more information on this platform,
          see <file:Documentation/arm/IXP4xx>.
 
+config MACH_LOFT
+    bool "Loft"
+    depends on MACH_AVILA
+    help
+         Say 'Y' here if you want your kernel to support the Giant
+         Shoulder Inc Loft board (a minor variation on the standard
+         Gateworks Avila Network Platform).
+
 config ARCH_ADI_COYOTE
        bool "Coyote"
        select PCI
@@ -86,7 +94,7 @@ config MACH_NAS100D
 #
 config ARCH_IXDP4XX
        bool
-       depends on ARCH_IXDP425 || ARCH_AVILA || MACH_IXDP465
+       depends on ARCH_IXDP425 || MACH_IXDP465
        default y
 
 #
index 640315d8b96a2f0fedfdb374303b3074d7a5e030..746e297284ed9b7bd6b1ab2cff54fb0d37efedb0 100644 (file)
@@ -6,6 +6,7 @@ obj-pci-y       :=
 obj-pci-n      :=
 
 obj-pci-$(CONFIG_ARCH_IXDP4XX)         += ixdp425-pci.o
+obj-pci-$(CONFIG_MACH_AVILA)           += avila-pci.o
 obj-pci-$(CONFIG_MACH_IXDPG425)                += ixdpg425-pci.o
 obj-pci-$(CONFIG_ARCH_ADI_COYOTE)      += coyote-pci.o
 obj-pci-$(CONFIG_MACH_GTWX5715)                += gtwx5715-pci.o
@@ -15,6 +16,7 @@ obj-pci-$(CONFIG_MACH_NAS100D)                += nas100d-pci.o
 obj-y  += common.o
 
 obj-$(CONFIG_ARCH_IXDP4XX)     += ixdp425-setup.o
+obj-$(CONFIG_MACH_AVILA)       += avila-setup.o
 obj-$(CONFIG_MACH_IXDPG425)    += coyote-setup.o
 obj-$(CONFIG_ARCH_ADI_COYOTE)  += coyote-setup.o
 obj-$(CONFIG_MACH_GTWX5715)    += gtwx5715-setup.o
diff --git a/arch/arm/mach-ixp4xx/avila-pci.c b/arch/arm/mach-ixp4xx/avila-pci.c
new file mode 100644 (file)
index 0000000..3f86769
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * arch/arm/mach-ixp4xx/avila-pci.c
+ *
+ * Gateworks Avila board-level PCI initialization
+ *
+ * Author: Michael-Luke Jones <mlj28@cam.ac.uk>
+ *
+ * Based on ixdp-pci.c
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Maintainer: Deepak Saxena <dsaxena@plexity.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/delay.h>
+
+#include <asm/mach/pci.h>
+#include <asm/irq.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+
+void __init avila_pci_preinit(void)
+{
+       set_irq_type(IRQ_AVILA_PCI_INTA, IRQT_LOW);
+       set_irq_type(IRQ_AVILA_PCI_INTB, IRQT_LOW);
+       set_irq_type(IRQ_AVILA_PCI_INTC, IRQT_LOW);
+       set_irq_type(IRQ_AVILA_PCI_INTD, IRQT_LOW);
+
+       ixp4xx_pci_preinit();
+}
+
+static int __init avila_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+       static int pci_irq_table[AVILA_PCI_IRQ_LINES] = {
+               IRQ_AVILA_PCI_INTA,
+               IRQ_AVILA_PCI_INTB,
+               IRQ_AVILA_PCI_INTC,
+               IRQ_AVILA_PCI_INTD
+       };
+
+       int irq = -1;
+
+       if (slot >= 1 &&
+       slot <= (machine_is_loft() ? LOFT_PCI_MAX_DEV : AVILA_PCI_MAX_DEV) &&
+               pin >= 1 && pin <= AVILA_PCI_IRQ_LINES) {
+               irq = pci_irq_table[(slot + pin - 2) % 4];
+       }
+
+       return irq;
+}
+
+struct hw_pci avila_pci __initdata = {
+       .nr_controllers = 1,
+       .preinit        = avila_pci_preinit,
+       .swizzle        = pci_std_swizzle,
+       .setup          = ixp4xx_setup,
+       .scan           = ixp4xx_scan_bus,
+       .map_irq        = avila_map_irq,
+};
+
+int __init avila_pci_init(void)
+{
+       if (machine_is_avila() || machine_is_loft())
+               pci_common_init(&avila_pci);
+       return 0;
+}
+
+subsys_initcall(avila_pci_init);
+
diff --git a/arch/arm/mach-ixp4xx/avila-setup.c b/arch/arm/mach-ixp4xx/avila-setup.c
new file mode 100644 (file)
index 0000000..d59b8dc
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * arch/arm/mach-ixp4xx/avila-setup.c
+ *
+ * Gateworks Avila board-setup
+ *
+ * Author: Michael-Luke Jones <mlj28@cam.ac.uk>
+ *
+ * Based on ixdp-setup.c
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Deepak Saxena <dsaxena@plexity.net>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data avila_flash_data = {
+       .map_name       = "cfi_probe",
+       .width          = 2,
+};
+
+static struct resource avila_flash_resource = {
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device avila_flash = {
+       .name           = "IXP4XX-Flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data = &avila_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &avila_flash_resource,
+};
+
+static struct ixp4xx_i2c_pins avila_i2c_gpio_pins = {
+       .sda_pin        = AVILA_SDA_PIN,
+       .scl_pin        = AVILA_SCL_PIN,
+};
+
+static struct platform_device avila_i2c_controller = {
+       .name           = "IXP4XX-I2C",
+       .id             = 0,
+       .dev            = {
+               .platform_data = &avila_i2c_gpio_pins,
+       },
+       .num_resources  = 0
+};
+
+static struct resource avila_uart_resources[] = {
+       {
+               .start          = IXP4XX_UART1_BASE_PHYS,
+               .end            = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+               .flags          = IORESOURCE_MEM
+       },
+       {
+               .start          = IXP4XX_UART2_BASE_PHYS,
+               .end            = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+               .flags          = IORESOURCE_MEM
+       }
+};
+
+static struct plat_serial8250_port avila_uart_data[] = {
+       {
+               .mapbase        = IXP4XX_UART1_BASE_PHYS,
+               .membase        = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+               .irq            = IRQ_IXP4XX_UART1,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+               .iotype         = UPIO_MEM,
+               .regshift       = 2,
+               .uartclk        = IXP4XX_UART_XTAL,
+       },
+       {
+               .mapbase        = IXP4XX_UART2_BASE_PHYS,
+               .membase        = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+               .irq            = IRQ_IXP4XX_UART2,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+               .iotype         = UPIO_MEM,
+               .regshift       = 2,
+               .uartclk        = IXP4XX_UART_XTAL,
+       },
+       { },
+};
+
+static struct platform_device avila_uart = {
+       .name                   = "serial8250",
+       .id                     = PLAT8250_DEV_PLATFORM,
+       .dev.platform_data      = avila_uart_data,
+       .num_resources          = 2,
+       .resource               = avila_uart_resources
+};
+
+static struct resource avila_pata_resources[] = {
+       {
+               .flags  = IORESOURCE_MEM
+       },
+       {
+               .flags  = IORESOURCE_MEM,
+       },
+       {
+               .name   = "intrq",
+               .start  = IRQ_IXP4XX_GPIO12,
+               .end    = IRQ_IXP4XX_GPIO12,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct ixp4xx_pata_data avila_pata_data = {
+       .cs0_bits       = 0xbfff0043,
+       .cs1_bits       = 0xbfff0043,
+};
+
+static struct platform_device avila_pata = {
+       .name                   = "pata_ixp4xx_cf",
+       .id                     = 0,
+       .dev.platform_data      = &avila_pata_data,
+       .num_resources          = ARRAY_SIZE(avila_pata_resources),
+       .resource               = avila_pata_resources,
+};
+
+static struct platform_device *avila_devices[] __initdata = {
+       &avila_i2c_controller,
+       &avila_flash,
+       &avila_uart
+};
+
+static void __init avila_init(void)
+{
+       ixp4xx_sys_init();
+
+       avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+       avila_flash_resource.end =
+               IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
+
+       platform_add_devices(avila_devices, ARRAY_SIZE(avila_devices));
+
+       avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1);
+       avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1);
+
+       avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2);
+       avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2);
+
+       avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1;
+       avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2;
+
+       platform_device_register(&avila_pata);
+
+}
+
+MACHINE_START(AVILA, "Gateworks Avila Network Platform")
+       /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
+       .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
+       .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+       .map_io         = ixp4xx_map_io,
+       .init_irq       = ixp4xx_init_irq,
+       .timer          = &ixp4xx_timer,
+       .boot_params    = 0x0100,
+       .init_machine   = avila_init,
+MACHINE_END
+
+ /*
+  * Loft is functionally equivalent to Avila except that it has a
+  * different number for the maximum PCI devices.  The MACHINE
+  * structure below is identical to Avila except for the comment.
+  */
+#ifdef CONFIG_MACH_LOFT
+MACHINE_START(LOFT, "Giant Shoulder Inc Loft board")
+       /* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */
+       .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
+       .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+       .map_io         = ixp4xx_map_io,
+       .init_irq       = ixp4xx_init_irq,
+       .timer          = &ixp4xx_timer,
+       .boot_params    = 0x0100,
+       .init_machine   = avila_init,
+MACHINE_END
+#endif
+
index d5156c043f0b09094ba5279c651afd52162f9466..99c1dc8033c8e89cef7d8a4f54c2d9f8d615a3d4 100644 (file)
@@ -66,7 +66,7 @@ struct hw_pci ixdp425_pci __initdata = {
 int __init ixdp425_pci_init(void)
 {
        if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
-                       machine_is_avila() || machine_is_ixdp465())
+                       machine_is_ixdp465())
                pci_common_init(&ixdp425_pci);
        return 0;
 }
index da72383ee301e15218a737cf91408b4c78ad3a86..04b1d56396a096b357fd3c23e3562aeee34bc96e 100644 (file)
@@ -156,23 +156,3 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
        .init_machine   = ixdp425_init,
 MACHINE_END
 #endif
-
-/*
- * Avila is functionally equivalent to IXDP425 except that it adds
- * a CF IDE slot hanging off the expansion bus. When we have a 
- * driver for IXP4xx CF IDE with driver model support we'll move
- * Avila to it's own setup file.
- */
-#ifdef CONFIG_ARCH_AVILA
-MACHINE_START(AVILA, "Gateworks Avila Network Platform")
-       /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
-       .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
-       .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
-       .map_io         = ixp4xx_map_io,
-       .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
-       .boot_params    = 0x0100,
-       .init_machine   = ixdp425_init,
-MACHINE_END
-#endif
-
diff --git a/arch/arm/mach-ns9xxx/Kconfig b/arch/arm/mach-ns9xxx/Kconfig
new file mode 100644 (file)
index 0000000..8175ba9
--- /dev/null
@@ -0,0 +1,21 @@
+if ARCH_NS9XXX
+
+menu "NS9xxx Implementations"
+
+config MACH_CC9P9360DEV
+       bool "Connect Core 9P 9360 on an A9M9750 Devboard"
+       select PROCESSOR_NS9360
+       select BOARD_A9M9750DEV
+       help
+         Say Y here if you are using the Digi Connect Core 9P 9360
+         on an A9M9750 Development Board.
+
+config PROCESSOR_NS9360
+       bool
+
+config BOARD_A9M9750DEV
+       bool
+
+endmenu
+
+endif
diff --git a/arch/arm/mach-ns9xxx/Makefile b/arch/arm/mach-ns9xxx/Makefile
new file mode 100644 (file)
index 0000000..91e945f
--- /dev/null
@@ -0,0 +1,5 @@
+obj-y := irq.o time.o generic.o
+
+obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o
+
+obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o
diff --git a/arch/arm/mach-ns9xxx/Makefile.boot b/arch/arm/mach-ns9xxx/Makefile.boot
new file mode 100644 (file)
index 0000000..75ed64e
--- /dev/null
@@ -0,0 +1,2 @@
+zreladdr-y := 0x108000
+params_phys-y := 0x100
diff --git a/arch/arm/mach-ns9xxx/board-a9m9750dev.c b/arch/arm/mach-ns9xxx/board-a9m9750dev.c
new file mode 100644 (file)
index 0000000..2528988
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * arch/arm/mach-ns9xxx/board-a9m9750dev.c
+ *
+ * Copyright (C) 2006,2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <linux/platform_device.h>
+#include <linux/serial_8250.h>
+#include <linux/irq.h>
+
+#include <asm/mach/map.h>
+
+#include <asm/arch-ns9xxx/board.h>
+#include <asm/arch-ns9xxx/regs-sys.h>
+#include <asm/arch-ns9xxx/regs-mem.h>
+#include <asm/arch-ns9xxx/regs-bbu.h>
+#include <asm/arch-ns9xxx/regs-board-a9m9750dev.h>
+
+#include "board-a9m9750dev.h"
+
+static struct map_desc board_a9m9750dev_io_desc[] __initdata = {
+       { /* FPGA on CS0 */
+               .virtual = io_p2v(NS9XXX_CSxSTAT_PHYS(0)),
+               .pfn = __phys_to_pfn(NS9XXX_CSxSTAT_PHYS(0)),
+               .length = NS9XXX_CS0STAT_LENGTH,
+               .type = MT_DEVICE,
+       },
+};
+
+void __init board_a9m9750dev_map_io(void)
+{
+       iotable_init(board_a9m9750dev_io_desc,
+                    ARRAY_SIZE(board_a9m9750dev_io_desc));
+}
+
+static void a9m9750dev_fpga_ack_irq(unsigned int irq)
+{
+       /* nothing */
+}
+
+static void a9m9750dev_fpga_mask_irq(unsigned int irq)
+{
+       FPGA_IER &= ~(1 << (irq - FPGA_IRQ(0)));
+}
+
+static void a9m9750dev_fpga_maskack_irq(unsigned int irq)
+{
+       a9m9750dev_fpga_mask_irq(irq);
+       a9m9750dev_fpga_ack_irq(irq);
+}
+
+static void a9m9750dev_fpga_unmask_irq(unsigned int irq)
+{
+       FPGA_IER |= 1 << (irq - FPGA_IRQ(0));
+}
+
+static struct irq_chip a9m9750dev_fpga_chip = {
+       .ack            = a9m9750dev_fpga_ack_irq,
+       .mask           = a9m9750dev_fpga_mask_irq,
+       .mask_ack       = a9m9750dev_fpga_maskack_irq,
+       .unmask         = a9m9750dev_fpga_unmask_irq,
+};
+
+static void a9m9750dev_fpga_demux_handler(unsigned int irq,
+               struct irq_desc *desc)
+{
+       int stat = FPGA_ISR;
+
+       while (stat != 0) {
+               int irqno = fls(stat) - 1;
+
+               stat &= ~(1 << irqno);
+
+               desc = irq_desc + FPGA_IRQ(irqno);
+
+               desc_handle_irq(irqno, desc);
+       }
+}
+
+void __init board_a9m9750dev_init_irq(void)
+{
+       u32 reg;
+       int i;
+
+       /*
+        * configure gpio for IRQ_EXT2
+        * use GPIO 11, because GPIO 32 is used for the LCD
+        */
+       /* XXX: proper GPIO handling */
+       BBU_GC(2) &= ~0x2000;
+
+       for (i = FPGA_IRQ(0); i <= FPGA_IRQ(7); ++i) {
+               set_irq_chip(i, &a9m9750dev_fpga_chip);
+               set_irq_handler(i, handle_level_irq);
+               set_irq_flags(i, IRQF_VALID);
+       }
+
+       /* IRQ_EXT2: level sensitive + active low */
+       reg = SYS_EIC(2);
+       REGSET(reg, SYS_EIC, PLTY, AL);
+       REGSET(reg, SYS_EIC, LVEDG, LEVEL);
+       SYS_EIC(2) = reg;
+
+       set_irq_chained_handler(IRQ_EXT2,
+                       a9m9750dev_fpga_demux_handler);
+}
+
+static struct plat_serial8250_port board_a9m9750dev_serial8250_port[] = {
+       {
+               .iobase         = FPGA_UARTA_BASE,
+               .membase        = (unsigned char*)FPGA_UARTA_BASE,
+               .mapbase        = FPGA_UARTA_BASE,
+               .irq            = IRQ_FPGA_UARTA,
+               .iotype         = UPIO_MEM,
+               .uartclk        = 18432000,
+               .regshift       = 0,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
+       }, {
+               .iobase         = FPGA_UARTB_BASE,
+               .membase        = (unsigned char*)FPGA_UARTB_BASE,
+               .mapbase        = FPGA_UARTB_BASE,
+               .irq            = IRQ_FPGA_UARTB,
+               .iotype         = UPIO_MEM,
+               .uartclk        = 18432000,
+               .regshift       = 0,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
+       }, {
+               .iobase         = FPGA_UARTC_BASE,
+               .membase        = (unsigned char*)FPGA_UARTC_BASE,
+               .mapbase        = FPGA_UARTC_BASE,
+               .irq            = IRQ_FPGA_UARTC,
+               .iotype         = UPIO_MEM,
+               .uartclk        = 18432000,
+               .regshift       = 0,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
+       }, {
+               .iobase         = FPGA_UARTD_BASE,
+               .membase        = (unsigned char*)FPGA_UARTD_BASE,
+               .mapbase        = FPGA_UARTD_BASE,
+               .irq            = IRQ_FPGA_UARTD,
+               .iotype         = UPIO_MEM,
+               .uartclk        = 18432000,
+               .regshift       = 0,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
+       }, {
+               /* end marker */
+       },
+};
+
+static struct platform_device board_a9m9750dev_serial_device = {
+       .name = "serial8250",
+       .dev = {
+               .platform_data = board_a9m9750dev_serial8250_port,
+       },
+};
+
+static struct platform_device *board_a9m9750dev_devices[] __initdata = {
+       &board_a9m9750dev_serial_device,
+};
+
+void __init board_a9m9750dev_init_machine(void)
+{
+       u32 reg;
+
+       /* setup static CS0: memory base ... */
+       REGSETIM(SYS_SMCSSMB(0), SYS_SMCSSMB, CSxB,
+                       NS9XXX_CSxSTAT_PHYS(0) >> 12);
+
+       /* ... and mask */
+       reg = SYS_SMCSSMM(0);
+       REGSETIM(reg, SYS_SMCSSMM, CSxM, 0xfffff);
+       REGSET(reg, SYS_SMCSSMM, CSEx, EN);
+       SYS_SMCSSMM(0) = reg;
+
+       /* setup static CS0: memory configuration */
+       reg = MEM_SMC(0);
+       REGSET(reg, MEM_SMC, WSMC, OFF);
+       REGSET(reg, MEM_SMC, BSMC, OFF);
+       REGSET(reg, MEM_SMC, EW, OFF);
+       REGSET(reg, MEM_SMC, PB, 1);
+       REGSET(reg, MEM_SMC, PC, AL);
+       REGSET(reg, MEM_SMC, PM, DIS);
+       REGSET(reg, MEM_SMC, MW, 8);
+       MEM_SMC(0) = reg;
+
+       /* setup static CS0: timing */
+       MEM_SMWED(0) = 0x2;
+       MEM_SMOED(0) = 0x2;
+       MEM_SMRD(0) = 0x6;
+       MEM_SMWD(0) = 0x6;
+
+       platform_add_devices(board_a9m9750dev_devices,
+                       ARRAY_SIZE(board_a9m9750dev_devices));
+}
+
diff --git a/arch/arm/mach-ns9xxx/board-a9m9750dev.h b/arch/arm/mach-ns9xxx/board-a9m9750dev.h
new file mode 100644 (file)
index 0000000..edc75ab
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * arch/arm/mach-ns9xxx/board-a9m9750dev.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <linux/init.h>
+
+void __init board_a9m9750dev_map_io(void);
+void __init board_a9m9750dev_init_machine(void);
+void __init board_a9m9750dev_init_irq(void);
diff --git a/arch/arm/mach-ns9xxx/generic.c b/arch/arm/mach-ns9xxx/generic.c
new file mode 100644 (file)
index 0000000..83e2b65
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * arch/arm/mach-ns9xxx/generic.c
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <asm/memory.h>
+#include <asm/page.h>
+#include <asm/mach-types.h>
+#include <asm/mach/map.h>
+#include <asm/arch-ns9xxx/regs-sys.h>
+#include <asm/arch-ns9xxx/regs-mem.h>
+#include <asm/arch-ns9xxx/board.h>
+
+static struct map_desc standard_io_desc[] __initdata = {
+       { /* BBus */
+               .virtual = io_p2v(0x90000000),
+               .pfn = __phys_to_pfn(0x90000000),
+               .length = 0x00700000,
+               .type = MT_DEVICE,
+       }, { /* AHB */
+               .virtual = io_p2v(0xa0100000),
+               .pfn = __phys_to_pfn(0xa0100000),
+               .length = 0x00900000,
+               .type = MT_DEVICE,
+       },
+};
+
+void __init ns9xxx_map_io(void)
+{
+       iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
+}
+
+void __init ns9xxx_init_machine(void)
+{
+}
diff --git a/arch/arm/mach-ns9xxx/generic.h b/arch/arm/mach-ns9xxx/generic.h
new file mode 100644 (file)
index 0000000..687e291
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * arch/arm/mach-ns9xxx/generic.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <linux/time.h>
+#include <asm/mach/time.h>
+#include <linux/init.h>
+
+void __init ns9xxx_init_irq(void);
+void __init ns9xxx_map_io(void);
+void __init ns9xxx_init_machine(void);
+
+extern struct sys_timer ns9xxx_timer;
diff --git a/arch/arm/mach-ns9xxx/irq.c b/arch/arm/mach-ns9xxx/irq.c
new file mode 100644 (file)
index 0000000..83d9272
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * arch/arm/mach-ns9xxx/irq.c
+ *
+ * Copyright (C) 2006,2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <linux/interrupt.h>
+#include <asm/mach/irq.h>
+#include <asm/mach-types.h>
+#include <asm/arch-ns9xxx/regs-sys.h>
+#include <asm/arch-ns9xxx/irqs.h>
+#include <asm/arch-ns9xxx/board.h>
+
+#include "generic.h"
+
+static void ns9xxx_ack_irq_timer(unsigned int irq)
+{
+       u32 tc = SYS_TC(irq - IRQ_TIMER0);
+
+       REGSET(tc, SYS_TCx, INTC, SET);
+       SYS_TC(irq - IRQ_TIMER0) = tc;
+
+       REGSET(tc, SYS_TCx, INTC, UNSET);
+       SYS_TC(irq - IRQ_TIMER0) = tc;
+}
+
+void (*ns9xxx_ack_irq_functions[NR_IRQS])(unsigned int) = {
+       [IRQ_TIMER0] = ns9xxx_ack_irq_timer,
+       [IRQ_TIMER1] = ns9xxx_ack_irq_timer,
+       [IRQ_TIMER2] = ns9xxx_ack_irq_timer,
+       [IRQ_TIMER3] = ns9xxx_ack_irq_timer,
+};
+
+static void ns9xxx_mask_irq(unsigned int irq)
+{
+       /* XXX: better use cpp symbols */
+       SYS_IC(irq / 4) &= ~(1 << (7 + 8 * (3 - (irq & 3))));
+}
+
+static void ns9xxx_ack_irq(unsigned int irq)
+{
+       if (!ns9xxx_ack_irq_functions[irq]) {
+               printk(KERN_ERR "no ack function for irq %u\n", irq);
+               BUG();
+       }
+
+       ns9xxx_ack_irq_functions[irq](irq);
+       SYS_ISRADDR = 0;
+}
+
+static void ns9xxx_maskack_irq(unsigned int irq)
+{
+       ns9xxx_mask_irq(irq);
+       ns9xxx_ack_irq(irq);
+}
+
+static void ns9xxx_unmask_irq(unsigned int irq)
+{
+       /* XXX: better use cpp symbols */
+       SYS_IC(irq / 4) |= 1 << (7 + 8 * (3 - (irq & 3)));
+}
+
+static struct irq_chip ns9xxx_chip = {
+       .ack            = ns9xxx_ack_irq,
+       .mask           = ns9xxx_mask_irq,
+       .mask_ack       = ns9xxx_maskack_irq,
+       .unmask         = ns9xxx_unmask_irq,
+};
+
+void __init ns9xxx_init_irq(void)
+{
+       int i;
+
+       /* disable all IRQs */
+       for (i = 0; i < 8; ++i)
+               SYS_IC(i) = (4 * i) << 24 | (4 * i + 1) << 16 |
+                       (4 * i + 2) << 8 | (4 * i + 3);
+
+       /* simple interrupt prio table:
+        * prio(x) < prio(y) <=> x < y
+        */
+       for (i = 0; i < 32; ++i)
+               SYS_IVA(i) = i;
+
+       for (i = IRQ_WATCHDOG; i <= IRQ_EXT3; ++i) {
+               set_irq_chip(i, &ns9xxx_chip);
+               set_irq_handler(i, handle_level_irq);
+               set_irq_flags(i, IRQF_VALID);
+       }
+}
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c b/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
new file mode 100644 (file)
index 0000000..a193dd9
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <asm/mach/arch.h>
+#include <asm/mach-types.h>
+
+#include "board-a9m9750dev.h"
+#include "generic.h"
+
+static void __init mach_cc9p9360dev_map_io(void)
+{
+       ns9xxx_map_io();
+       board_a9m9750dev_map_io();
+}
+
+static void __init mach_cc9p9360dev_init_irq(void)
+{
+       ns9xxx_init_irq();
+       board_a9m9750dev_init_irq();
+}
+
+static void __init mach_cc9p9360dev_init_machine(void)
+{
+       ns9xxx_init_machine();
+       board_a9m9750dev_init_machine();
+}
+
+MACHINE_START(CC9P9360DEV, "Connect Core 9P 9360 on an A9M9750 Devboard")
+       .map_io = mach_cc9p9360dev_map_io,
+       .init_irq = mach_cc9p9360dev_init_irq,
+       .init_machine = mach_cc9p9360dev_init_machine,
+       .timer = &ns9xxx_timer,
+       .boot_params = 0x100,
+MACHINE_END
diff --git a/arch/arm/mach-ns9xxx/time.c b/arch/arm/mach-ns9xxx/time.c
new file mode 100644 (file)
index 0000000..eec05f1
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * arch/arm/mach-ns9xxx/time.c
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <linux/jiffies.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <asm/arch-ns9xxx/regs-sys.h>
+#include <asm/arch-ns9xxx/clock.h>
+#include <asm/arch-ns9xxx/irqs.h>
+#include <asm/arch/system.h>
+#include "generic.h"
+
+#define TIMERCLOCKSELECT 64
+
+static u32 usecs_per_tick;
+
+static irqreturn_t
+ns9xxx_timer_interrupt(int irq, void *dev_id)
+{
+       write_seqlock(&xtime_lock);
+       timer_tick();
+       write_sequnlock(&xtime_lock);
+
+       return IRQ_HANDLED;
+}
+
+static unsigned long ns9xxx_timer_gettimeoffset(void)
+{
+       /* return the microseconds which have passed since the last interrupt
+        * was _serviced_.  That is, if an interrupt is pending or the counter
+        * reloads, return one periode more. */
+
+       u32 counter1 = SYS_TR(0);
+       int pending = SYS_ISR & (1 << IRQ_TIMER0);
+       u32 counter2 = SYS_TR(0);
+       u32 elapsed;
+
+       if (pending || counter2 > counter1)
+               elapsed = 2 * SYS_TRC(0) - counter2;
+       else
+               elapsed = SYS_TRC(0) - counter1;
+
+       return (elapsed * usecs_per_tick) >> 16;
+
+}
+
+static struct irqaction ns9xxx_timer_irq = {
+       .name = "NS9xxx Timer Tick",
+       .flags = IRQF_DISABLED | IRQF_TIMER,
+       .handler = ns9xxx_timer_interrupt,
+};
+
+static void __init ns9xxx_timer_init(void)
+{
+       int tc;
+
+       usecs_per_tick =
+               SH_DIV(1000000 * TIMERCLOCKSELECT, ns9xxx_cpuclock(), 16);
+
+       /* disable timer */
+       if ((tc = SYS_TC(0)) & SYS_TCx_TEN)
+               SYS_TC(0) = tc & ~SYS_TCx_TEN;
+
+       SYS_TRC(0) = SH_DIV(ns9xxx_cpuclock(), (TIMERCLOCKSELECT * HZ), 0);
+
+       REGSET(tc, SYS_TCx, TEN, EN);
+       REGSET(tc, SYS_TCx, TLCS, DIV64); /* This must match TIMERCLOCKSELECT */
+       REGSET(tc, SYS_TCx, INTS, EN);
+       REGSET(tc, SYS_TCx, UDS, DOWN);
+       REGSET(tc, SYS_TCx, TDBG, STOP);
+       REGSET(tc, SYS_TCx, TSZ, 32);
+       REGSET(tc, SYS_TCx, REN, EN);
+       SYS_TC(0) = tc;
+
+       setup_irq(IRQ_TIMER0, &ns9xxx_timer_irq);
+}
+
+struct sys_timer ns9xxx_timer = {
+       .init = ns9xxx_timer_init,
+       .offset = ns9xxx_timer_gettimeoffset,
+};
index 9de1278d234f86d655880c6f587e10b785cb843a..390524c4710f543384861206557a72cc514a1175 100644 (file)
@@ -338,6 +338,27 @@ static struct platform_device i2c_device = {
        .num_resources  = ARRAY_SIZE(i2c_resources),
 };
 
+#ifdef CONFIG_PXA27x
+static struct resource i2c_power_resources[] = {
+       {
+               .start  = 0x40f00180,
+               .end    = 0x40f001a3,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = IRQ_PWRI2C,
+               .end    = IRQ_PWRI2C,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device i2c_power_device = {
+       .name           = "pxa2xx-i2c",
+       .id             = 1,
+       .resource       = i2c_power_resources,
+       .num_resources  = ARRAY_SIZE(i2c_resources),
+};
+#endif
+
 void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
 {
        i2c_device.dev.platform_data = info;
@@ -392,6 +413,9 @@ static struct platform_device *devices[] __initdata = {
        &stuart_device,
        &pxaficp_device,
        &i2c_device,
+#ifdef CONFIG_PXA27x
+       &i2c_power_device,
+#endif
        &i2s_device,
        &pxartc_device,
 };
index 17f5f4439fe756a966391732a83a02018ed94bd7..35156ca39df77e6a62414f30f879119e12b513df 100644 (file)
@@ -10,10 +10,21 @@ config MACH_REALVIEW_EB
 config REALVIEW_MPCORE
        bool "Support MPcore tile"
        depends on MACH_REALVIEW_EB
+       select CACHE_L2X0
        help
          Enable support for the MPCore tile on the Realview platform.
          Since there are device address and interrupt differences, a
          kernel built with this option enabled is not compatible with
          other tiles.
 
+config REALVIEW_MPCORE_REVB
+       bool "Support MPcore RevB tile"
+       depends on REALVIEW_MPCORE
+       default n
+       help
+         Enable support for the MPCore RevB tile on the Realview platform.
+         Since there are device address differences, a
+         kernel built with this option enabled is not compatible with
+         other tiles.
+
 endmenu
index b8484e15dacb7f3e8f3d69ca09ea58334ea47b42..fce3596f9950a6aea5d8489d9d674a99759ad7b0 100644 (file)
@@ -52,13 +52,14 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
         * core (e.g. timer irq), then they will not have been enabled
         * for us: do so
         */
-       gic_cpu_init(__io_address(REALVIEW_GIC_CPU_BASE));
+       gic_cpu_init(0, __io_address(REALVIEW_GIC_CPU_BASE));
 
        /*
         * let the primary processor know we're out of the
         * pen, then head off into the C entry point
         */
        pen_release = -1;
+       smp_wmb();
 
        /*
         * Synchronise with the boot thread.
@@ -102,6 +103,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 
        timeout = jiffies + (1 * HZ);
        while (time_before(jiffies, timeout)) {
+               smp_rmb();
                if (pen_release == -1)
                        break;
 
index 9741b4d3c9cfca9c938db2c23c3f1c3e29ba6876..3dba666151dbb7be39bc22757701adacc012a447 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/mach-types.h>
 #include <asm/hardware/gic.h>
 #include <asm/hardware/icst307.h>
+#include <asm/hardware/cache-l2x0.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -57,7 +58,26 @@ static struct map_desc realview_eb_io_desc[] __initdata = {
                .pfn            = __phys_to_pfn(REALVIEW_GIC_DIST_BASE),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
+       },
+#ifdef CONFIG_REALVIEW_MPCORE
+       {
+               .virtual        = IO_ADDRESS(REALVIEW_GIC1_CPU_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_GIC1_CPU_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_GIC1_DIST_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_GIC1_DIST_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
        }, {
+               .virtual        = IO_ADDRESS(REALVIEW_MPCORE_L220_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_MPCORE_L220_BASE),
+               .length         = SZ_8K,
+               .type           = MT_DEVICE,
+       },
+#endif
+       {
                .virtual        = IO_ADDRESS(REALVIEW_SCTL_BASE),
                .pfn            = __phys_to_pfn(REALVIEW_SCTL_BASE),
                .length         = SZ_4K,
@@ -138,19 +158,29 @@ static void __init gic_init_irq(void)
 #ifdef CONFIG_REALVIEW_MPCORE
        unsigned int pldctrl;
        writel(0x0000a05f, __io_address(REALVIEW_SYS_LOCK));
-       pldctrl = readl(__io_address(REALVIEW_SYS_BASE) + 0xd8);
+       pldctrl = readl(__io_address(REALVIEW_SYS_BASE) + REALVIEW_MPCORE_SYS_PLD_CTRL1);
        pldctrl |= 0x00800000;  /* New irq mode */
-       writel(pldctrl, __io_address(REALVIEW_SYS_BASE) + 0xd8);
+       writel(pldctrl, __io_address(REALVIEW_SYS_BASE) + REALVIEW_MPCORE_SYS_PLD_CTRL1);
        writel(0x00000000, __io_address(REALVIEW_SYS_LOCK));
 #endif
-       gic_dist_init(__io_address(REALVIEW_GIC_DIST_BASE));
-       gic_cpu_init(__io_address(REALVIEW_GIC_CPU_BASE));
+       gic_dist_init(0, __io_address(REALVIEW_GIC_DIST_BASE), 29);
+       gic_cpu_init(0, __io_address(REALVIEW_GIC_CPU_BASE));
+#ifdef CONFIG_REALVIEW_MPCORE
+       gic_dist_init(1, __io_address(REALVIEW_GIC1_DIST_BASE), 64);
+       gic_cpu_init(1, __io_address(REALVIEW_GIC1_CPU_BASE));
+       gic_cascade_irq(1, IRQ_EB_IRQ1);
+#endif
 }
 
 static void __init realview_eb_init(void)
 {
        int i;
 
+#ifdef CONFIG_REALVIEW_MPCORE
+       /* 1MB (128KB/way), 8-way associativity, evmon/parity/share enabled
+        * Bits:  .... ...0 0111 1001 0000 .... .... .... */
+       l2x0_init(__io_address(REALVIEW_MPCORE_L220_BASE), 0x00790000, 0xfe000fff);
+#endif
        clk_register(&realview_clcd_clk);
 
        platform_device_register(&realview_flash_device);
diff --git a/arch/arm/mach-s3c2400/Kconfig b/arch/arm/mach-s3c2400/Kconfig
new file mode 100644 (file)
index 0000000..deab072
--- /dev/null
@@ -0,0 +1,13 @@
+# arch/arm/mach-s3c2400/Kconfig
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+
+
+menu "S3C2400 Machines"
+
+
+endmenu
+
diff --git a/arch/arm/mach-s3c2400/Makefile b/arch/arm/mach-s3c2400/Makefile
new file mode 100644 (file)
index 0000000..7e23f4e
--- /dev/null
@@ -0,0 +1,15 @@
+# arch/arm/mach-s3c2400/Makefile
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+obj-y                          :=
+obj-m                          :=
+obj-n                          :=
+obj-                           :=
+
+obj-$(CONFIG_CPU_S3C2400)      += gpio.o
+
+# Machine support
+
diff --git a/arch/arm/mach-s3c2400/gpio.c b/arch/arm/mach-s3c2400/gpio.c
new file mode 100644 (file)
index 0000000..758e160
--- /dev/null
@@ -0,0 +1,42 @@
+/* linux/arch/arm/mach-s3c2400/gpio.c
+ *
+ * Copyright (c) 2006 Lucas Correia Villa Real <lucasvr@gobolinux.org>
+ *
+ * S3C2400 GPIO 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/arch/regs-gpio.h>
+
+int s3c2400_gpio_getirq(unsigned int pin)
+{
+       if (pin < S3C2410_GPE0 || pin > S3C2400_GPE7_EINT7)
+               return -1;  /* not valid interrupts */
+
+       return (pin - S3C2410_GPE0) + IRQ_EINT0;
+}
+
+EXPORT_SYMBOL(s3c2400_gpio_getirq);
index eb4ec411312ba8684d7e6830b2be578c8abf2262..d4b013b283c3680f63be0b9b8b05b4120ebf3777 100644 (file)
@@ -1,54 +1,51 @@
-if ARCH_S3C2410
+# arch/arm/mach-s3c2410/Kconfig
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
 
-menu "S3C24XX Implementations"
+config CPU_S3C2410
+       bool
+       depends on ARCH_S3C2410
+       select S3C2410_CLOCK
+       select S3C2410_GPIO
+       select S3C2410_PM if PM
+       help
+         Support for S3C2410 and S3C2410A family from the S3C24XX line
+         of Samsung Mobile CPUs.
 
-config MACH_AML_M5900
-       bool "AML M5900 Series"
-       select CPU_S3C2410
-       select PM_SIMTEC if PM
+config CPU_S3C2410_DMA
+       bool
+       depends on S3C2410_DMA && (CPU_S3C2410 || CPU_S3C2442)
+       default y if CPU_S3C2410 || CPU_S3C2442
        help
-          Say Y here if you are using the American Microsystems M5900 Series
-           <http://www.amltd.com>
+         DMA device selection for S3C2410 and compatible CPUs
 
-config MACH_ANUBIS
-       bool "Simtec Electronics ANUBIS"
-       select CPU_S3C2440
-       select PM_SIMTEC if PM
+config S3C2410_PM
+       bool
        help
-         Say Y here if you are using the Simtec Electronics ANUBIS
-         development system
+         Power Management code common to S3C2410 and better
 
-config MACH_OSIRIS
-       bool "Simtec IM2440D20 (OSIRIS) module"
-       select CPU_S3C2440
-       select PM_SIMTEC if PM
+config S3C2410_GPIO
+       bool
        help
-         Say Y here if you are using the Simtec IM2440D20 module, also
-         known as the Osiris.
+         GPIO code for S3C2410 and similar processors
 
-config ARCH_BAST
-       bool "Simtec Electronics BAST (EB2410ITX)"
-       select CPU_S3C2410
-       select PM_SIMTEC if PM
-       select ISA
+config S3C2410_CLOCK
+       bool
        help
-         Say Y here if you are using the Simtec Electronics EB2410ITX
-         development board (also known as BAST)
+         Clock code for the S3C2410, and similar processors
 
-         Product page: <http://www.simtec.co.uk/products/EB2410ITX/>.
 
-config BAST_PC104_IRQ
-       bool "BAST PC104 IRQ support"
-       depends on ARCH_BAST
-       default y
-       help
-         Say Y here to enable the PC104 IRQ routing on the
-         Simtec BAST (EB2410ITX)
+menu "S3C2410 Machines"
 
-config PM_H1940
-       bool
+config ARCH_SMDK2410
+       bool "SMDK2410/A9M2410"
+       select CPU_S3C2410
+       select MACH_SMDK
        help
-         Internal node for H1940 and related PM
+          Say Y here if you are using the SMDK2410 or the derived module A9M2410
+           <http://www.fsforth.de>
 
 config ARCH_H1940
        bool "IPAQ H1940"
@@ -57,7 +54,10 @@ config ARCH_H1940
        help
          Say Y here if you are using the HP IPAQ H1940
 
-         <http://www.handhelds.org/projects/h1940.html>.
+config PM_H1940
+       bool
+       help
+         Internal node for H1940 and related PM
 
 config MACH_N30
        bool "Acer N30"
@@ -65,53 +65,36 @@ config MACH_N30
        help
          Say Y here if you are using the Acer N30
 
-         <http://zoo.weinigel.se/n30>.
-
-config MACH_SMDK
-       bool
-       help
-         Common machine code for SMDK2410 and SMDK2440
-
-config ARCH_SMDK2410
-       bool "SMDK2410/A9M2410"
+config ARCH_BAST
+       bool "Simtec Electronics BAST (EB2410ITX)"
        select CPU_S3C2410
-       select MACH_SMDK
+       select PM_SIMTEC if PM
+       select ISA
        help
-          Say Y here if you are using the SMDK2410 or the derived module A9M2410
-           <http://www.fsforth.de>
+         Say Y here if you are using the Simtec Electronics EB2410ITX
+         development board (also known as BAST)
 
-config ARCH_S3C2440
-       bool "SMDK2440"
-       select CPU_S3C2440
-       select MACH_SMDK
+config MACH_OTOM
+       bool "NexVision OTOM Board"
+       select CPU_S3C2410
        help
-         Say Y here if you are using the SMDK2440.
-
-config SMDK2440_CPU2440
-       bool "SMDK2440 with S3C2440 CPU module"
-       depends on ARCH_S3C2440
-       default y if ARCH_S3C2440
-       select CPU_S3C2440
-
-config SMDK2440_CPU2442
-       bool "SMDM2440 with S3C2442 CPU module"
-       depends on ARCH_S3C2440
-       select CPU_S3C2442
+         Say Y here if you are using the Nex Vision OTOM board
 
-config MACH_S3C2413
-       bool
+config MACH_AML_M5900
+       bool "AML M5900 Series"
+       select CPU_S3C2410
+       select PM_SIMTEC if PM
        help
-         Internal node for S3C2413 version of SMDK2413, so that
-         machine_is_s3c2413() will work when MACH_SMDK2413 is
-         selected
+          Say Y here if you are using the American Microsystems M5900 Series
+           <http://www.amltd.com>
 
-config MACH_SMDK2413
-       bool "SMDK2413"
-       select CPU_S3C2412
-       select MACH_S3C2413
-       select MACH_SMDK
+config BAST_PC104_IRQ
+       bool "BAST PC104 IRQ support"
+       depends on ARCH_BAST
+       default y
        help
-         Say Y here if you are using an SMDK2413
+         Say Y here to enable the PC104 IRQ routing on the
+         Simtec BAST (EB2410ITX)
 
 config MACH_VR1000
        bool "Thorcom VR1000"
@@ -120,202 +103,11 @@ config MACH_VR1000
        help
          Say Y here if you are using the Thorcom VR1000 board.
 
-         This linux port is currently being maintained by Simtec, on behalf
-         of Thorcom. Any queries, please contact Thorcom first.
-
-config MACH_RX3715
-       bool "HP iPAQ rx3715"
-       select CPU_S3C2440
-       select PM_H1940 if PM
-       help
-         Say Y here if you are using the HP iPAQ rx3715.
-
-         See <http://www.handhelds.org/projects/rx3715.html> for more
-         information on this project
-
-config MACH_OTOM
-       bool "NexVision OTOM Board"
-       select CPU_S3C2410
-       help
-         Say Y here if you are using the Nex Vision OTOM board
-
-config MACH_NEXCODER_2440
-       bool "NexVision NEXCODER 2440 Light Board"
-       select CPU_S3C2440
-       help
-         Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
-
-config MACH_VSTMS
-       bool "VMSTMS"
-       select CPU_S3C2412
+config MACH_QT2410
+       bool "QT2410"
+       select CPU_S3C2410
        help
-         Say Y here if you are using an VSTMS board
+          Say Y here if you are using the Armzone QT2410
 
 endmenu
 
-config S3C2410_CLOCK
-       bool
-       help
-         Clock code for the S3C2410, and similar processors
-
-config S3C2410_PM
-       bool
-       help
-         Power Management code common to S3C2410 and better
-
-config CPU_S3C2410_DMA
-       bool
-       depends on S3C2410_DMA && (CPU_S3C2410 || CPU_S3C2442)
-       default y if CPU_S3C2410 || CPU_S3C2442
-       help
-         DMA device selection for S3C2410 and compatible CPUs
-
-config CPU_S3C2410
-       bool
-       depends on ARCH_S3C2410
-       select S3C2410_CLOCK
-       select S3C2410_PM if PM
-       help
-         Support for S3C2410 and S3C2410A family from the S3C24XX line
-         of Samsung Mobile CPUs.
-
-# internal node to signify if we are only dealing with an S3C2412
-
-config CPU_S3C2412_ONLY
-       bool
-       depends on ARCH_S3C2410 && !CPU_S3C2400 && !CPU_S3C2410 && \
-                  !CPU_S3C2440 && !CPU_S3C2442 && CPU_S3C2412
-       default y if CPU_S3C2412
-
-config S3C2412_PM
-       bool
-       help
-         Internal config node to apply S3C2412 power management
-
-config CPU_S3C2412
-       bool
-       depends on ARCH_S3C2410
-       select S3C2412_PM if PM
-       help
-         Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
-
-config CPU_S3C244X
-       bool
-       depends on ARCH_S3C2410 && (CPU_S3C2440 || CPU_S3C2442)
-       help
-         Support for S3C2440 and S3C2442 Samsung Mobile CPU based systems.
-
-config CPU_S3C2440
-       bool
-       depends on ARCH_S3C2410
-       select S3C2410_CLOCK
-       select S3C2410_PM if PM
-       select CPU_S3C244X
-       help
-         Support for S3C2440 Samsung Mobile CPU based systems.
-
-config CPU_S3C2442
-       bool
-       depends on ARCH_S3C2420
-       select S3C2410_CLOCK
-       select S3C2410_PM if PM
-       select CPU_S3C244X
-       help
-         Support for S3C2442 Samsung Mobile CPU based systems.
-
-comment "S3C2410 Boot"
-
-config S3C2410_BOOT_WATCHDOG
-       bool "S3C2410 Initialisation watchdog"
-       depends on ARCH_S3C2410 && S3C2410_WATCHDOG
-       help
-         Say y to enable the watchdog during the kernel decompression
-         stage. If the kernel fails to uncompress, then the watchdog
-         will trigger a reset and the system should restart.
-
-         Although this uses the same hardware unit as the kernel watchdog
-         driver, it is not a replacement for it. If you use this option,
-         you will have to use the watchdg driver to either stop the timeout
-         or restart it. If you do not, then your kernel will reboot after
-         startup.
-
-         The driver uses a fixed timeout value, so the exact time till the
-         system resets depends on the value of PCLK. The timeout on an
-         200MHz s3c2410 should be about 30 seconds.
-
-config S3C2410_BOOT_ERROR_RESET
-       bool "S3C2410 Reboot on decompression error"
-       depends on ARCH_S3C2410
-       help
-         Say y here to use the watchdog to reset the system if the
-         kernel decompressor detects an error during decompression.
-
-
-comment "S3C2410 Setup"
-
-config S3C2410_DMA
-       bool "S3C2410 DMA support"
-       depends on ARCH_S3C2410
-       help
-         S3C2410 DMA support. This is needed for drivers like sound which
-         use the S3C2410's DMA system to move data to and from the
-         peripheral blocks.
-
-config S3C2410_DMA_DEBUG
-       bool "S3C2410 DMA support debug"
-       depends on ARCH_S3C2410 && S3C2410_DMA
-       help
-         Enable debugging output for the DMA code. This option sends info
-         to the kernel log, at priority KERN_DEBUG.
-
-         Note, it is easy to create and fill the log buffer in a small
-         amount of time, as well as using an significant percentage of
-         the CPU time doing so.
-
-
-config S3C2410_PM_DEBUG
-       bool "S3C2410 PM Suspend debug"
-       depends on ARCH_S3C2410 && PM
-       help
-         Say Y here if you want verbose debugging from the PM Suspend and
-         Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
-         for more information.
-
-config S3C2410_PM_CHECK
-       bool "S3C2410 PM Suspend Memory CRC"
-       depends on ARCH_S3C2410 && PM && CRC32
-       help
-         Enable the PM code's memory area checksum over sleep. This option
-         will generate CRCs of all blocks of memory, and store them before
-         going to sleep. The blocks are then checked on resume for any
-         errors.
-
-config S3C2410_PM_CHECK_CHUNKSIZE
-       int "S3C2410 PM Suspend CRC Chunksize (KiB)"
-       depends on ARCH_S3C2410 && PM && S3C2410_PM_CHECK
-       default 64
-       help
-         Set the chunksize in Kilobytes of the CRC for checking memory
-         corruption over suspend and resume. A smaller value will mean that
-         the CRC data block will take more memory, but wil identify any
-         faults with better precision.
-
-config PM_SIMTEC
-       bool
-       help
-         Common power management code for systems that are
-         compatible with the Simtec style of power management
-
-config S3C2410_LOWLEVEL_UART_PORT
-       int "S3C2410 UART to use for low-level messages"
-       default 0
-       help
-         Choice of which UART port to use for the low-level messages,
-         such as the `Uncompressing...` at start time. The value of
-         this configuration should be between zero and two. The port
-         must have been initialised by the boot-loader before use.
-
-         Note, this does not affect the port used by the debug messages,
-         which is a separate configuration.
-
-endif
index 27663e28cc8881bd49aefd1a59fba40b3b337862..9a3d3d24c08446621523649b89273e8564cb577d 100644 (file)
@@ -1,92 +1,31 @@
-
+# arch/arm/mach-s3c2410/Makefile
 #
-# Makefile for the linux kernel.
+# Copyright 2007 Simtec Electronics
 #
+# Licensed under GPLv2
 
-# Object file lists.
-
-obj-y                  := cpu.o irq.o time.o gpio.o clock.o devs.o
-obj-m                  :=
-obj-n                  :=
-obj-                   :=
-obj-dma-y              :=
-obj-dma-n              :=
-
-# DMA
-obj-$(CONFIG_S3C2410_DMA)      += dma.o
-
-# S3C2400 support files
-obj-$(CONFIG_CPU_S3C2400)      += s3c2400-gpio.o
-
-# S3C2410 support files
+obj-y                          :=
+obj-m                          :=
+obj-n                          :=
+obj-                           :=
 
 obj-$(CONFIG_CPU_S3C2410)      += s3c2410.o
-obj-$(CONFIG_CPU_S3C2410)      += s3c2410-gpio.o
-obj-$(CONFIG_CPU_S3C2410)      += s3c2410-irq.o
-
-obj-$(CONFIG_S3C2410_PM)       += s3c2410-pm.o s3c2410-sleep.o
-obj-$(CONFIG_CPU_S3C2410_DMA)  += s3c2410-dma.o
-
-# Power Management support
-
-obj-$(CONFIG_PM)               += pm.o sleep.o
-obj-$(CONFIG_PM_SIMTEC)                += pm-simtec.o
-obj-$(CONFIG_PM_H1940)         += pm-h1940.o
-
-# S3C2412 support
-obj-$(CONFIG_CPU_S3C2412)      += s3c2412.o
-obj-$(CONFIG_CPU_S3C2412)      += s3c2412-irq.o
-obj-$(CONFIG_CPU_S3C2412)      += s3c2412-clock.o
-obj-dma-$(CONFIG_CPU_S3C2412)  += s3c2412-dma.o
-
-obj-$(CONFIG_S3C2412_PM)       += s3c2412-pm.o
-
-#
-# S3C244X support
-
-obj-$(CONFIG_CPU_S3C244X)      += s3c244x.o
-obj-$(CONFIG_CPU_S3C244X)      += s3c244x-irq.o
-
-# Clock control
-
-obj-$(CONFIG_S3C2410_CLOCK)    += s3c2410-clock.o
-
-# S3C2440 support
-
-obj-$(CONFIG_CPU_S3C2440)      += s3c2440.o s3c2440-dsc.o
-obj-$(CONFIG_CPU_S3C2440)      += s3c2440-irq.o
-obj-$(CONFIG_CPU_S3C2440)      += s3c2440-clock.o
-obj-$(CONFIG_CPU_S3C2440)      += s3c2410-gpio.o
-obj-dma-$(CONFIG_CPU_S3C2440)  += s3c2440-dma.o
+obj-$(CONFIG_CPU_S3C2410)      += irq.o
+obj-$(CONFIG_CPU_S3C2410_DMA)  += dma.o
+obj-$(CONFIG_CPU_S3C2410_DMA)  += dma.o
+obj-$(CONFIG_S3C2410_PM)       += pm.o sleep.o
+obj-$(CONFIG_S3C2410_GPIO)     += gpio.o
+obj-$(CONFIG_S3C2410_CLOCK)    += clock.o
 
-# S3C2442 support
+# Machine support
 
-obj-$(CONFIG_CPU_S3C2442)      += s3c2442.o
-obj-$(CONFIG_CPU_S3C2442)      += s3c2442-clock.o
-
-# bast extras
-
-obj-$(CONFIG_BAST_PC104_IRQ)   += bast-irq.o
-
-# merge in dma objects
-
-obj-y                          += $(obj-dma-y)
-
-# machine specific support
-
-obj-$(CONFIG_MACH_AML_M5900)   += mach-amlm5900.o
-obj-$(CONFIG_MACH_ANUBIS)      += mach-anubis.o
-obj-$(CONFIG_MACH_OSIRIS)      += mach-osiris.o
-obj-$(CONFIG_ARCH_BAST)                += mach-bast.o usb-simtec.o
+obj-$(CONFIG_ARCH_SMDK2410)    += mach-smdk2410.o
 obj-$(CONFIG_ARCH_H1940)       += mach-h1940.o
+obj-$(CONFIG_PM_H1940)         += pm-h1940.o
 obj-$(CONFIG_MACH_N30)         += mach-n30.o
-obj-$(CONFIG_ARCH_SMDK2410)    += mach-smdk2410.o
-obj-$(CONFIG_MACH_SMDK2413)    += mach-smdk2413.o
-obj-$(CONFIG_ARCH_S3C2440)     += mach-smdk2440.o
-obj-$(CONFIG_MACH_VR1000)      += mach-vr1000.o usb-simtec.o
-obj-$(CONFIG_MACH_RX3715)      += mach-rx3715.o
+obj-$(CONFIG_ARCH_BAST)                += mach-bast.o usb-simtec.o
 obj-$(CONFIG_MACH_OTOM)                += mach-otom.o
-obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
-obj-$(CONFIG_MACH_VSTMS)       += mach-vstms.o
-
-obj-$(CONFIG_MACH_SMDK)                += common-smdk.o
\ No newline at end of file
+obj-$(CONFIG_MACH_AML_M5900)   += mach-amlm5900.o
+obj-$(CONFIG_BAST_PC104_IRQ)   += bast-irq.o
+obj-$(CONFIG_MACH_VR1000)      += mach-vr1000.o usb-simtec.o
+obj-$(CONFIG_MACH_QT2410)      += mach-qt2410.o
index 379efe70778c6841d4b407d16b3a33c5f66070b5..daeba427d781bf9868396db7811941101e163c82 100644 (file)
@@ -39,7 +39,7 @@
 #include <asm/arch/bast-map.h>
 #include <asm/arch/bast-irq.h>
 
-#include "irq.h"
+#include <asm/plat-s3c24xx/irq.h>
 
 #if 0
 #include <asm/debug-ll.h>
index e5d03311752c06b4965c0c123112769f0b5ea1f4..e98543742eb936ae17da100530d63bf510999b5b 100644 (file)
@@ -1,2 +1,2 @@
-
+/* linux/arch/arm/mach-s3c2410/bast.h
 extern void bast_init_irq(void);
index e13fb6778890d6559f2a57e532cf16f4cf13dd38..5b4831c4c1d8dccb556c35a6502c92b238933672 100644 (file)
@@ -1,15 +1,9 @@
 /* linux/arch/arm/mach-s3c2410/clock.c
  *
- * Copyright (c) 2004-2005 Simtec Electronics
+ * Copyright (c) 2006 Simtec Electronics
  *     Ben Dooks <ben@simtec.co.uk>
  *
- * S3C24XX Core clock control support
- *
- * Based on, and code from linux/arch/arm/mach-versatile/clock.c
- **
- **  Copyright (C) 2004 ARM Limited.
- **  Written by Deep Blue Solutions Limited.
- *
+ * S3C2410,S3C2440,S3C2442 Clock control 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
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/err.h>
-#include <linux/platform_device.h>
 #include <linux/sysdev.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
 #include <linux/clk.h>
 #include <linux/mutex.h>
 #include <linux/delay.h>
+#include <linux/serial_core.h>
+
+#include <asm/mach/map.h>
 
 #include <asm/hardware.h>
-#include <asm/irq.h>
 #include <asm/io.h>
 
+#include <asm/arch/regs-serial.h>
 #include <asm/arch/regs-clock.h>
 #include <asm/arch/regs-gpio.h>
 
-#include "clock.h"
-#include "cpu.h"
-
-/* clock information */
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/cpu.h>
 
-static LIST_HEAD(clocks);
-
-DEFINE_MUTEX(clocks_mutex);
-
-/* enable and disable calls for use with the clk struct */
-
-static int clk_null_enable(struct clk *clk, int enable)
+int s3c2410_clkcon_enable(struct clk *clk, int enable)
 {
-       return 0;
-}
-
-/* Clock API calls */
+       unsigned int clocks = clk->ctrlbit;
+       unsigned long clkcon;
 
-struct clk *clk_get(struct device *dev, const char *id)
-{
-       struct clk *p;
-       struct clk *clk = ERR_PTR(-ENOENT);
-       int idno;
+       clkcon = __raw_readl(S3C2410_CLKCON);
 
-       if (dev == NULL || dev->bus != &platform_bus_type)
-               idno = -1;
+       if (enable)
+               clkcon |= clocks;
        else
-               idno = to_platform_device(dev)->id;
-
-       mutex_lock(&clocks_mutex);
-
-       list_for_each_entry(p, &clocks, list) {
-               if (p->id == idno &&
-                   strcmp(id, p->name) == 0 &&
-                   try_module_get(p->owner)) {
-                       clk = p;
-                       break;
-               }
-       }
-
-       /* check for the case where a device was supplied, but the
-        * clock that was being searched for is not device specific */
-
-       if (IS_ERR(clk)) {
-               list_for_each_entry(p, &clocks, list) {
-                       if (p->id == -1 && strcmp(id, p->name) == 0 &&
-                           try_module_get(p->owner)) {
-                               clk = p;
-                               break;
-                       }
-               }
-       }
+               clkcon &= ~clocks;
 
-       mutex_unlock(&clocks_mutex);
-       return clk;
-}
+       /* ensure none of the special function bits set */
+       clkcon &= ~(S3C2410_CLKCON_IDLE|S3C2410_CLKCON_POWER);
 
-void clk_put(struct clk *clk)
-{
-       module_put(clk->owner);
-}
+       __raw_writel(clkcon, S3C2410_CLKCON);
 
-int clk_enable(struct clk *clk)
-{
-       if (IS_ERR(clk) || clk == NULL)
-               return -EINVAL;
-
-       clk_enable(clk->parent);
-
-       mutex_lock(&clocks_mutex);
-
-       if ((clk->usage++) == 0)
-               (clk->enable)(clk, 1);
-
-       mutex_unlock(&clocks_mutex);
        return 0;
 }
 
-void clk_disable(struct clk *clk)
-{
-       if (IS_ERR(clk) || clk == NULL)
-               return;
-
-       mutex_lock(&clocks_mutex);
-
-       if ((--clk->usage) == 0)
-               (clk->enable)(clk, 0);
-
-       mutex_unlock(&clocks_mutex);
-       clk_disable(clk->parent);
-}
-
-
-unsigned long clk_get_rate(struct clk *clk)
-{
-       if (IS_ERR(clk))
-               return 0;
-
-       if (clk->rate != 0)
-               return clk->rate;
-
-       if (clk->get_rate != NULL)
-               return (clk->get_rate)(clk);
-
-       if (clk->parent != NULL)
-               return clk_get_rate(clk->parent);
-
-       return clk->rate;
-}
-
-long clk_round_rate(struct clk *clk, unsigned long rate)
-{
-       if (!IS_ERR(clk) && clk->round_rate)
-               return (clk->round_rate)(clk, rate);
-
-       return rate;
-}
-
-int clk_set_rate(struct clk *clk, unsigned long rate)
-{
-       int ret;
-
-       if (IS_ERR(clk))
-               return -EINVAL;
-
-       mutex_lock(&clocks_mutex);
-       ret = (clk->set_rate)(clk, rate);
-       mutex_unlock(&clocks_mutex);
-
-       return ret;
-}
-
-struct clk *clk_get_parent(struct clk *clk)
+static int s3c2410_upll_enable(struct clk *clk, int enable)
 {
-       return clk->parent;
-}
-
-int clk_set_parent(struct clk *clk, struct clk *parent)
-{
-       int ret = 0;
-
-       if (IS_ERR(clk))
-               return -EINVAL;
-
-       mutex_lock(&clocks_mutex);
-
-       if (clk->set_parent)
-               ret = (clk->set_parent)(clk, parent);
-
-       mutex_unlock(&clocks_mutex);
-
-       return ret;
-}
-
-EXPORT_SYMBOL(clk_get);
-EXPORT_SYMBOL(clk_put);
-EXPORT_SYMBOL(clk_enable);
-EXPORT_SYMBOL(clk_disable);
-EXPORT_SYMBOL(clk_get_rate);
-EXPORT_SYMBOL(clk_round_rate);
-EXPORT_SYMBOL(clk_set_rate);
-EXPORT_SYMBOL(clk_get_parent);
-EXPORT_SYMBOL(clk_set_parent);
-
-/* base clocks */
-
-struct clk clk_xtal = {
-       .name           = "xtal",
-       .id             = -1,
-       .rate           = 0,
-       .parent         = NULL,
-       .ctrlbit        = 0,
-};
-
-struct clk clk_mpll = {
-       .name           = "mpll",
-       .id             = -1,
-};
-
-struct clk clk_upll = {
-       .name           = "upll",
-       .id             = -1,
-       .parent         = NULL,
-       .ctrlbit        = 0,
-};
-
-struct clk clk_f = {
-       .name           = "fclk",
-       .id             = -1,
-       .rate           = 0,
-       .parent         = &clk_mpll,
-       .ctrlbit        = 0,
-};
-
-struct clk clk_h = {
-       .name           = "hclk",
-       .id             = -1,
-       .rate           = 0,
-       .parent         = NULL,
-       .ctrlbit        = 0,
-};
-
-struct clk clk_p = {
-       .name           = "pclk",
-       .id             = -1,
-       .rate           = 0,
-       .parent         = NULL,
-       .ctrlbit        = 0,
-};
-
-struct clk clk_usb_bus = {
-       .name           = "usb-bus",
-       .id             = -1,
-       .rate           = 0,
-       .parent         = &clk_upll,
-};
-
-/* clocks that could be registered by external code */
-
-static int s3c24xx_dclk_enable(struct clk *clk, int enable)
-{
-       unsigned long dclkcon = __raw_readl(S3C24XX_DCLKCON);
+       unsigned long clkslow = __raw_readl(S3C2410_CLKSLOW);
+       unsigned long orig = clkslow;
 
        if (enable)
-               dclkcon |= clk->ctrlbit;
+               clkslow &= ~S3C2410_CLKSLOW_UCLK_OFF;
        else
-               dclkcon &= ~clk->ctrlbit;
+               clkslow |= S3C2410_CLKSLOW_UCLK_OFF;
 
-       __raw_writel(dclkcon, S3C24XX_DCLKCON);
+       __raw_writel(clkslow, S3C2410_CLKSLOW);
 
-       return 0;
-}
+       /* if we started the UPLL, then allow to settle */
 
-static int s3c24xx_dclk_setparent(struct clk *clk, struct clk *parent)
-{
-       unsigned long dclkcon;
-       unsigned int uclk;
-
-       if (parent == &clk_upll)
-               uclk = 1;
-       else if (parent == &clk_p)
-               uclk = 0;
-       else
-               return -EINVAL;
-
-       clk->parent = parent;
-
-       dclkcon = __raw_readl(S3C24XX_DCLKCON);
-
-       if (clk->ctrlbit == S3C2410_DCLKCON_DCLK0EN) {
-               if (uclk)
-                       dclkcon |= S3C2410_DCLKCON_DCLK0_UCLK;
-               else
-                       dclkcon &= ~S3C2410_DCLKCON_DCLK0_UCLK;
-       } else {
-               if (uclk)
-                       dclkcon |= S3C2410_DCLKCON_DCLK1_UCLK;
-               else
-                       dclkcon &= ~S3C2410_DCLKCON_DCLK1_UCLK;
-       }
-
-       __raw_writel(dclkcon, S3C24XX_DCLKCON);
+       if (enable && (orig & S3C2410_CLKSLOW_UCLK_OFF))
+               udelay(200);
 
        return 0;
 }
 
-
-static int s3c24xx_clkout_setparent(struct clk *clk, struct clk *parent)
-{
-       unsigned long mask;
-       unsigned long source;
-
-       /* calculate the MISCCR setting for the clock */
-
-       if (parent == &clk_xtal)
-               source = S3C2410_MISCCR_CLK0_MPLL;
-       else if (parent == &clk_upll)
-               source = S3C2410_MISCCR_CLK0_UPLL;
-       else if (parent == &clk_f)
-               source = S3C2410_MISCCR_CLK0_FCLK;
-       else if (parent == &clk_h)
-               source = S3C2410_MISCCR_CLK0_HCLK;
-       else if (parent == &clk_p)
-               source = S3C2410_MISCCR_CLK0_PCLK;
-       else if (clk == &s3c24xx_clkout0 && parent == &s3c24xx_dclk0)
-               source = S3C2410_MISCCR_CLK0_DCLK0;
-       else if (clk == &s3c24xx_clkout1 && parent == &s3c24xx_dclk1)
-               source = S3C2410_MISCCR_CLK0_DCLK0;
-       else
-               return -EINVAL;
-
-       clk->parent = parent;
-
-       if (clk == &s3c24xx_dclk0)
-               mask = S3C2410_MISCCR_CLK0_MASK;
-       else {
-               source <<= 4;
-               mask = S3C2410_MISCCR_CLK1_MASK;
+/* standard clock definitions */
+
+static struct clk init_clocks_disable[] = {
+       {
+               .name           = "nand",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_NAND,
+       }, {
+               .name           = "sdi",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_SDI,
+       }, {
+               .name           = "adc",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_ADC,
+       }, {
+               .name           = "i2c",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_IIC,
+       }, {
+               .name           = "iis",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_IIS,
+       }, {
+               .name           = "spi",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_SPI,
        }
-
-       s3c2410_modify_misccr(mask, source);
-       return 0;
-}
-
-/* external clock definitions */
-
-struct clk s3c24xx_dclk0 = {
-       .name           = "dclk0",
-       .id             = -1,
-       .ctrlbit        = S3C2410_DCLKCON_DCLK0EN,
-       .enable         = s3c24xx_dclk_enable,
-       .set_parent     = s3c24xx_dclk_setparent,
-};
-
-struct clk s3c24xx_dclk1 = {
-       .name           = "dclk1",
-       .id             = -1,
-       .ctrlbit        = S3C2410_DCLKCON_DCLK0EN,
-       .enable         = s3c24xx_dclk_enable,
-       .set_parent     = s3c24xx_dclk_setparent,
 };
 
-struct clk s3c24xx_clkout0 = {
-       .name           = "clkout0",
-       .id             = -1,
-       .set_parent     = s3c24xx_clkout_setparent,
+static struct clk init_clocks[] = {
+       {
+               .name           = "lcd",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_LCDC,
+       }, {
+               .name           = "gpio",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_GPIO,
+       }, {
+               .name           = "usb-host",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_USBH,
+       }, {
+               .name           = "usb-device",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_USBD,
+       }, {
+               .name           = "timers",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_PWMT,
+       }, {
+               .name           = "uart",
+               .id             = 0,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_UART0,
+       }, {
+               .name           = "uart",
+               .id             = 1,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_UART1,
+       }, {
+               .name           = "uart",
+               .id             = 2,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_UART2,
+       }, {
+               .name           = "rtc",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2410_clkcon_enable,
+               .ctrlbit        = S3C2410_CLKCON_RTC,
+       }, {
+               .name           = "watchdog",
+               .id             = -1,
+               .parent         = &clk_p,
+               .ctrlbit        = 0,
+       }, {
+               .name           = "usb-bus-host",
+               .id             = -1,
+               .parent         = &clk_usb_bus,
+       }, {
+               .name           = "usb-bus-gadget",
+               .id             = -1,
+               .parent         = &clk_usb_bus,
+       },
 };
 
-struct clk s3c24xx_clkout1 = {
-       .name           = "clkout1",
-       .id             = -1,
-       .set_parent     = s3c24xx_clkout_setparent,
-};
-
-struct clk s3c24xx_uclk = {
-       .name           = "uclk",
-       .id             = -1,
-};
-
-/* initialise the clock system */
-
-int s3c24xx_register_clock(struct clk *clk)
-{
-       clk->owner = THIS_MODULE;
-
-       if (clk->enable == NULL)
-               clk->enable = clk_null_enable;
-
-       /* add to the list of available clocks */
-
-       mutex_lock(&clocks_mutex);
-       list_add(&clk->list, &clocks);
-       mutex_unlock(&clocks_mutex);
-
-       return 0;
-}
-
-/* initalise all the clocks */
+/* s3c2410_baseclk_add()
+ *
+ * Add all the clocks used by the s3c2410 or compatible CPUs
+ * such as the S3C2440 and S3C2442.
+ *
+ * We cannot use a system device as we are needed before any
+ * of the init-calls that initialise the devices are actually
+ * done.
+*/
 
-int __init s3c24xx_setup_clocks(unsigned long xtal,
-                               unsigned long fclk,
-                               unsigned long hclk,
-                               unsigned long pclk)
+int __init s3c2410_baseclk_add(void)
 {
-       printk(KERN_INFO "S3C24XX Clocks, (c) 2004 Simtec Electronics\n");
+       unsigned long clkslow = __raw_readl(S3C2410_CLKSLOW);
+       unsigned long clkcon  = __raw_readl(S3C2410_CLKCON);
+       struct clk *clkp;
+       struct clk *xtal;
+       int ret;
+       int ptr;
 
-       /* initialise the main system clocks */
+       clk_upll.enable = s3c2410_upll_enable;
 
-       clk_xtal.rate = xtal;
-       clk_upll.rate = s3c2410_get_pll(__raw_readl(S3C2410_UPLLCON), xtal);
+       if (s3c24xx_register_clock(&clk_usb_bus) < 0)
+               printk(KERN_ERR "failed to register usb bus clock\n");
 
-       clk_mpll.rate = fclk;
-       clk_h.rate = hclk;
-       clk_p.rate = pclk;
-       clk_f.rate = fclk;
+       /* register clocks from clock array */
 
-       /* assume uart clocks are correctly setup */
+       clkp = init_clocks;
+       for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
+               /* ensure that we note the clock state */
 
-       /* register our clocks */
+               clkp->usage = clkcon & clkp->ctrlbit ? 1 : 0;
 
-       if (s3c24xx_register_clock(&clk_xtal) < 0)
-               printk(KERN_ERR "failed to register master xtal\n");
+               ret = s3c24xx_register_clock(clkp);
+               if (ret < 0) {
+                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
+                              clkp->name, ret);
+               }
+       }
 
-       if (s3c24xx_register_clock(&clk_mpll) < 0)
-               printk(KERN_ERR "failed to register mpll clock\n");
+       /* We must be careful disabling the clocks we are not intending to
+        * be using at boot time, as subsytems such as the LCD which do
+        * their own DMA requests to the bus can cause the system to lockup
+        * if they where in the middle of requesting bus access.
+        *
+        * Disabling the LCD clock if the LCD is active is very dangerous,
+        * and therefore the bootloader should be careful to not enable
+        * the LCD clock if it is not needed.
+       */
+
+       /* install (and disable) the clocks we do not need immediately */
+
+       clkp = init_clocks_disable;
+       for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
+
+               ret = s3c24xx_register_clock(clkp);
+               if (ret < 0) {
+                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
+                              clkp->name, ret);
+               }
 
-       if (s3c24xx_register_clock(&clk_upll) < 0)
-               printk(KERN_ERR "failed to register upll clock\n");
+               s3c2410_clkcon_enable(clkp, 0);
+       }
 
-       if (s3c24xx_register_clock(&clk_f) < 0)
-               printk(KERN_ERR "failed to register cpu fclk\n");
+       /* show the clock-slow value */
 
-       if (s3c24xx_register_clock(&clk_h) < 0)
-               printk(KERN_ERR "failed to register cpu hclk\n");
+       xtal = clk_get(NULL, "xtal");
 
-       if (s3c24xx_register_clock(&clk_p) < 0)
-               printk(KERN_ERR "failed to register cpu pclk\n");
+       printk("CLOCK: Slow mode (%ld.%ld MHz), %s, MPLL %s, UPLL %s\n",
+              print_mhz(clk_get_rate(xtal) /
+                        ( 2 * S3C2410_CLKSLOW_GET_SLOWVAL(clkslow))),
+              (clkslow & S3C2410_CLKSLOW_SLOW) ? "slow" : "fast",
+              (clkslow & S3C2410_CLKSLOW_MPLL_OFF) ? "off" : "on",
+              (clkslow & S3C2410_CLKSLOW_UCLK_OFF) ? "off" : "on");
 
        return 0;
 }
diff --git a/arch/arm/mach-s3c2410/clock.h b/arch/arm/mach-s3c2410/clock.h
deleted file mode 100644 (file)
index 7f0ea03..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * linux/arch/arm/mach-s3c2410/clock.h
- *
- * Copyright (c) 2004-2005 Simtec Electronics
- *     http://www.simtec.co.uk/products/SWLINUX/
- *     Written by Ben Dooks, <ben@simtec.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-struct clk {
-       struct list_head      list;
-       struct module        *owner;
-       struct clk           *parent;
-       const char           *name;
-       int                   id;
-       int                   usage;
-       unsigned long         rate;
-       unsigned long         ctrlbit;
-
-       int                 (*enable)(struct clk *, int enable);
-       int                 (*set_rate)(struct clk *c, unsigned long rate);
-       unsigned long       (*get_rate)(struct clk *c);
-       unsigned long       (*round_rate)(struct clk *c, unsigned long rate);
-       int                 (*set_parent)(struct clk *c, struct clk *parent);
-};
-
-/* other clocks which may be registered by board support */
-
-extern struct clk s3c24xx_dclk0;
-extern struct clk s3c24xx_dclk1;
-extern struct clk s3c24xx_clkout0;
-extern struct clk s3c24xx_clkout1;
-extern struct clk s3c24xx_uclk;
-
-extern struct clk clk_usb_bus;
-
-/* core clock support */
-
-extern struct clk clk_f;
-extern struct clk clk_h;
-extern struct clk clk_p;
-extern struct clk clk_mpll;
-extern struct clk clk_upll;
-extern struct clk clk_xtal;
-
-/* exports for arch/arm/mach-s3c2410
- *
- * Please DO NOT use these outside of arch/arm/mach-s3c2410
-*/
-
-extern struct mutex clocks_mutex;
-
-extern int s3c2410_clkcon_enable(struct clk *clk, int enable);
-
-extern int s3c24xx_register_clock(struct clk *clk);
-
-extern int s3c24xx_setup_clocks(unsigned long xtal,
-                               unsigned long fclk,
-                               unsigned long hclk,
-                               unsigned long pclk);
diff --git a/arch/arm/mach-s3c2410/common-smdk.c b/arch/arm/mach-s3c2410/common-smdk.c
deleted file mode 100644 (file)
index a40eaa6..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/common-smdk.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Common code for SMDK2410 and SMDK2440 boards
- *
- * http://www.fluff.org/ben/smdk2440/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <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/mtd/mtd.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/nand_ecc.h>
-#include <linux/mtd/partitions.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/leds-gpio.h>
-
-#include <asm/arch/nand.h>
-
-#include "common-smdk.h"
-#include "devs.h"
-#include "pm.h"
-
-/* LED devices */
-
-static struct s3c24xx_led_platdata smdk_pdata_led4 = {
-       .gpio           = S3C2410_GPF4,
-       .flags          = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
-       .name           = "led4",
-       .def_trigger    = "timer",
-};
-
-static struct s3c24xx_led_platdata smdk_pdata_led5 = {
-       .gpio           = S3C2410_GPF5,
-       .flags          = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
-       .name           = "led5",
-       .def_trigger    = "nand-disk",
-};
-
-static struct s3c24xx_led_platdata smdk_pdata_led6 = {
-       .gpio           = S3C2410_GPF6,
-       .flags          = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
-       .name           = "led6",
-};
-
-static struct s3c24xx_led_platdata smdk_pdata_led7 = {
-       .gpio           = S3C2410_GPF7,
-       .flags          = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
-       .name           = "led7",
-};
-
-static struct platform_device smdk_led4 = {
-       .name           = "s3c24xx_led",
-       .id             = 0,
-       .dev            = {
-               .platform_data = &smdk_pdata_led4,
-       },
-};
-
-static struct platform_device smdk_led5 = {
-       .name           = "s3c24xx_led",
-       .id             = 1,
-       .dev            = {
-               .platform_data = &smdk_pdata_led5,
-       },
-};
-
-static struct platform_device smdk_led6 = {
-       .name           = "s3c24xx_led",
-       .id             = 2,
-       .dev            = {
-               .platform_data = &smdk_pdata_led6,
-       },
-};
-
-static struct platform_device smdk_led7 = {
-       .name           = "s3c24xx_led",
-       .id             = 3,
-       .dev            = {
-               .platform_data = &smdk_pdata_led7,
-       },
-};
-
-/* NAND parititon from 2.4.18-swl5 */
-
-static struct mtd_partition smdk_default_nand_part[] = {
-       [0] = {
-               .name   = "Boot Agent",
-               .size   = SZ_16K,
-               .offset = 0,
-       },
-       [1] = {
-               .name   = "S3C2410 flash partition 1",
-               .offset = 0,
-               .size   = SZ_2M,
-       },
-       [2] = {
-               .name   = "S3C2410 flash partition 2",
-               .offset = SZ_4M,
-               .size   = SZ_4M,
-       },
-       [3] = {
-               .name   = "S3C2410 flash partition 3",
-               .offset = SZ_8M,
-               .size   = SZ_2M,
-       },
-       [4] = {
-               .name   = "S3C2410 flash partition 4",
-               .offset = SZ_1M * 10,
-               .size   = SZ_4M,
-       },
-       [5] = {
-               .name   = "S3C2410 flash partition 5",
-               .offset = SZ_1M * 14,
-               .size   = SZ_1M * 10,
-       },
-       [6] = {
-               .name   = "S3C2410 flash partition 6",
-               .offset = SZ_1M * 24,
-               .size   = SZ_1M * 24,
-       },
-       [7] = {
-               .name   = "S3C2410 flash partition 7",
-               .offset = SZ_1M * 48,
-               .size   = SZ_16M,
-       }
-};
-
-static struct s3c2410_nand_set smdk_nand_sets[] = {
-       [0] = {
-               .name           = "NAND",
-               .nr_chips       = 1,
-               .nr_partitions  = ARRAY_SIZE(smdk_default_nand_part),
-               .partitions     = smdk_default_nand_part,
-       },
-};
-
-/* choose a set of timings which should suit most 512Mbit
- * chips and beyond.
-*/
-
-static struct s3c2410_platform_nand smdk_nand_info = {
-       .tacls          = 20,
-       .twrph0         = 60,
-       .twrph1         = 20,
-       .nr_sets        = ARRAY_SIZE(smdk_nand_sets),
-       .sets           = smdk_nand_sets,
-};
-
-/* devices we initialise */
-
-static struct platform_device __initdata *smdk_devs[] = {
-       &s3c_device_nand,
-       &smdk_led4,
-       &smdk_led5,
-       &smdk_led6,
-       &smdk_led7,
-};
-
-void __init smdk_machine_init(void)
-{
-       /* Configure the LEDs (even if we have no LED support)*/
-
-       s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP);
-       s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
-       s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP);
-       s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP);
-
-       s3c2410_gpio_setpin(S3C2410_GPF4, 1);
-       s3c2410_gpio_setpin(S3C2410_GPF5, 1);
-       s3c2410_gpio_setpin(S3C2410_GPF6, 1);
-       s3c2410_gpio_setpin(S3C2410_GPF7, 1);
-
-       s3c_device_nand.dev.platform_data = &smdk_nand_info;
-
-       platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs));
-
-       s3c2410_pm_init();
-}
diff --git a/arch/arm/mach-s3c2410/common-smdk.h b/arch/arm/mach-s3c2410/common-smdk.h
deleted file mode 100644 (file)
index 0e3a3be..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/common-smdk.h
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Common code for SMDK2410 and SMDK2440 boards
- *
- * http://www.fluff.org/ben/smdk2440/
- *
- * 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.
-*/
-
-extern void smdk_machine_init(void);
diff --git a/arch/arm/mach-s3c2410/cpu.c b/arch/arm/mach-s3c2410/cpu.c
deleted file mode 100644 (file)
index ae1f5bb..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/cpu.c
- *
- * Copyright (c) 2004-2005 Simtec Electronics
- *     http://www.simtec.co.uk/products/SWLINUX/
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C24XX 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/serial_core.h>
-#include <linux/platform_device.h>
-
-#include <asm/hardware.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/delay.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-serial.h>
-
-#include "cpu.h"
-#include "devs.h"
-#include "clock.h"
-#include "s3c2400.h"
-#include "s3c2410.h"
-#include "s3c2412.h"
-#include "s3c244x.h"
-#include "s3c2440.h"
-#include "s3c2442.h"
-
-struct cpu_table {
-       unsigned long   idcode;
-       unsigned long   idmask;
-       void            (*map_io)(struct map_desc *mach_desc, int size);
-       void            (*init_uarts)(struct s3c2410_uartcfg *cfg, int no);
-       void            (*init_clocks)(int xtal);
-       int             (*init)(void);
-       const char      *name;
-};
-
-/* table of supported CPUs */
-
-static const char name_s3c2400[]  = "S3C2400";
-static const char name_s3c2410[]  = "S3C2410";
-static const char name_s3c2412[]  = "S3C2412";
-static const char name_s3c2440[]  = "S3C2440";
-static const char name_s3c2442[]  = "S3C2442";
-static const char name_s3c2410a[] = "S3C2410A";
-static const char name_s3c2440a[] = "S3C2440A";
-
-static struct cpu_table cpu_ids[] __initdata = {
-       {
-               .idcode         = 0x32410000,
-               .idmask         = 0xffffffff,
-               .map_io         = s3c2410_map_io,
-               .init_clocks    = s3c2410_init_clocks,
-               .init_uarts     = s3c2410_init_uarts,
-               .init           = s3c2410_init,
-               .name           = name_s3c2410
-       },
-       {
-               .idcode         = 0x32410002,
-               .idmask         = 0xffffffff,
-               .map_io         = s3c2410_map_io,
-               .init_clocks    = s3c2410_init_clocks,
-               .init_uarts     = s3c2410_init_uarts,
-               .init           = s3c2410_init,
-               .name           = name_s3c2410a
-       },
-       {
-               .idcode         = 0x32440000,
-               .idmask         = 0xffffffff,
-               .map_io         = s3c244x_map_io,
-               .init_clocks    = s3c244x_init_clocks,
-               .init_uarts     = s3c244x_init_uarts,
-               .init           = s3c2440_init,
-               .name           = name_s3c2440
-       },
-       {
-               .idcode         = 0x32440001,
-               .idmask         = 0xffffffff,
-               .map_io         = s3c244x_map_io,
-               .init_clocks    = s3c244x_init_clocks,
-               .init_uarts     = s3c244x_init_uarts,
-               .init           = s3c2440_init,
-               .name           = name_s3c2440a
-       },
-       {
-               .idcode         = 0x32440aaa,
-               .idmask         = 0xffffffff,
-               .map_io         = s3c244x_map_io,
-               .init_clocks    = s3c244x_init_clocks,
-               .init_uarts     = s3c244x_init_uarts,
-               .init           = s3c2442_init,
-               .name           = name_s3c2442
-       },
-       {
-               .idcode         = 0x32412001,
-               .idmask         = 0xffffffff,
-               .map_io         = s3c2412_map_io,
-               .init_clocks    = s3c2412_init_clocks,
-               .init_uarts     = s3c2412_init_uarts,
-               .init           = s3c2412_init,
-               .name           = name_s3c2412,
-       },
-       {                       /* a newer version of the s3c2412 */
-               .idcode         = 0x32412003,
-               .idmask         = 0xffffffff,
-               .map_io         = s3c2412_map_io,
-               .init_clocks    = s3c2412_init_clocks,
-               .init_uarts     = s3c2412_init_uarts,
-               .init           = s3c2412_init,
-               .name           = name_s3c2412,
-       },
-       {
-               .idcode         = 0x0,   /* S3C2400 doesn't have an idcode */
-               .idmask         = 0xffffffff,
-               .map_io         = s3c2400_map_io,
-               .init_clocks    = s3c2400_init_clocks,
-               .init_uarts     = s3c2400_init_uarts,
-               .init           = s3c2400_init,
-               .name           = name_s3c2400
-       },
-};
-
-/* minimal IO mapping */
-
-static struct map_desc s3c_iodesc[] __initdata = {
-       IODESC_ENT(GPIO),
-       IODESC_ENT(IRQ),
-       IODESC_ENT(MEMCTRL),
-       IODESC_ENT(UART)
-};
-
-
-static struct cpu_table *
-s3c_lookup_cpu(unsigned long idcode)
-{
-       struct cpu_table *tab;
-       int count;
-
-       tab = cpu_ids;
-       for (count = 0; count < ARRAY_SIZE(cpu_ids); count++, tab++) {
-               if ((idcode & tab->idmask) == tab->idcode)
-                       return tab;
-       }
-
-       return NULL;
-}
-
-/* board information */
-
-static struct s3c24xx_board *board;
-
-void s3c24xx_set_board(struct s3c24xx_board *b)
-{
-       int i;
-
-       board = b;
-
-       if (b->clocks_count != 0) {
-               struct clk **ptr = b->clocks;
-
-               for (i = b->clocks_count; i > 0; i--, ptr++)
-                       s3c24xx_register_clock(*ptr);
-       }
-}
-
-/* cpu information */
-
-static struct cpu_table *cpu;
-
-static unsigned long s3c24xx_read_idcode_v5(void)
-{
-#if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413)
-       return __raw_readl(S3C2412_GSTATUS1);
-#else
-       return 1UL;     /* don't look like an 2400 */
-#endif
-}
-
-static unsigned long s3c24xx_read_idcode_v4(void)
-{
-#ifndef CONFIG_CPU_S3C2400
-       return __raw_readl(S3C2410_GSTATUS1);
-#else
-       return 0UL;
-#endif
-}
-
-void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
-{
-       unsigned long idcode = 0x0;
-
-       /* initialise the io descriptors we need for initialisation */
-       iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
-
-       if (cpu_architecture() >= CPU_ARCH_ARMv5) {
-               idcode = s3c24xx_read_idcode_v5();
-       } else {
-               idcode = s3c24xx_read_idcode_v4();
-       }
-
-       cpu = s3c_lookup_cpu(idcode);
-
-       if (cpu == NULL) {
-               printk(KERN_ERR "Unknown CPU type 0x%08lx\n", idcode);
-               panic("Unknown S3C24XX CPU");
-       }
-
-       printk("CPU %s (id 0x%08lx)\n", cpu->name, idcode);
-
-       if (cpu->map_io == NULL || cpu->init == NULL) {
-               printk(KERN_ERR "CPU %s support not enabled\n", cpu->name);
-               panic("Unsupported S3C24XX CPU");
-       }
-
-       (cpu->map_io)(mach_desc, size);
-}
-
-/* s3c24xx_init_clocks
- *
- * Initialise the clock subsystem and associated information from the
- * given master crystal value.
- *
- * xtal  = 0 -> use default PLL crystal value (normally 12MHz)
- *      != 0 -> PLL crystal value in Hz
-*/
-
-void __init s3c24xx_init_clocks(int xtal)
-{
-       if (xtal == 0)
-               xtal = 12*1000*1000;
-
-       if (cpu == NULL)
-               panic("s3c24xx_init_clocks: no cpu setup?\n");
-
-       if (cpu->init_clocks == NULL)
-               panic("s3c24xx_init_clocks: cpu has no clock init\n");
-       else
-               (cpu->init_clocks)(xtal);
-}
-
-/* uart management */
-
-static int nr_uarts __initdata = 0;
-
-static struct s3c2410_uartcfg uart_cfgs[3];
-
-/* s3c24xx_init_uartdevs
- *
- * copy the specified platform data and configuration into our central
- * set of devices, before the data is thrown away after the init process.
- *
- * This also fills in the array passed to the serial driver for the
- * early initialisation of the console.
-*/
-
-void __init s3c24xx_init_uartdevs(char *name,
-                                 struct s3c24xx_uart_resources *res,
-                                 struct s3c2410_uartcfg *cfg, int no)
-{
-       struct platform_device *platdev;
-       struct s3c2410_uartcfg *cfgptr = uart_cfgs;
-       struct s3c24xx_uart_resources *resp;
-       int uart;
-
-       memcpy(cfgptr, cfg, sizeof(struct s3c2410_uartcfg) * no);
-
-       for (uart = 0; uart < no; uart++, cfg++, cfgptr++) {
-               platdev = s3c24xx_uart_src[cfgptr->hwport];
-
-               resp = res + cfgptr->hwport;
-
-               s3c24xx_uart_devs[uart] = platdev;
-
-               platdev->name = name;
-               platdev->resource = resp->resources;
-               platdev->num_resources = resp->nr_resources;
-
-               platdev->dev.platform_data = cfgptr;
-       }
-
-       nr_uarts = no;
-}
-
-void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
-{
-       if (cpu == NULL)
-               return;
-
-       if (cpu->init_uarts == NULL) {
-               printk(KERN_ERR "s3c24xx_init_uarts: cpu has no uart init\n");
-       } else
-               (cpu->init_uarts)(cfg, no);
-}
-
-static int __init s3c_arch_init(void)
-{
-       int ret;
-
-       // do the correct init for cpu
-
-       if (cpu == NULL)
-               panic("s3c_arch_init: NULL cpu\n");
-
-       ret = (cpu->init)();
-       if (ret != 0)
-               return ret;
-
-       ret = platform_add_devices(s3c24xx_uart_devs, nr_uarts);
-       if (ret != 0)
-               return ret;
-
-       if (board != NULL) {
-               struct platform_device **ptr = board->devices;
-               int i;
-
-               for (i = 0; i < board->devices_count; i++, ptr++) {
-                       ret = platform_device_register(*ptr);
-
-                       if (ret) {
-                               printk(KERN_ERR "s3c24xx: failed to add board device %s (%d) @%p\n", (*ptr)->name, ret, *ptr);
-                       }
-               }
-
-               /* mask any error, we may not need all these board
-                * devices */
-               ret = 0;
-       }
-
-       return ret;
-}
-
-arch_initcall(s3c_arch_init);
diff --git a/arch/arm/mach-s3c2410/cpu.h b/arch/arm/mach-s3c2410/cpu.h
deleted file mode 100644 (file)
index be42e40..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/* arch/arm/mach-s3c2410/cpu.h
- *
- * Copyright (c) 2004-2005 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Header file for S3C24XX CPU support
- *
- * 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.
-*/
-
-/* todo - fix when rmk changes iodescs to use `void __iomem *` */
-
-#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
-
-#ifndef MHZ
-#define MHZ (1000*1000)
-#endif
-
-#define print_mhz(m) ((m) / MHZ), ((m / 1000) % 1000)
-
-/* forward declaration */
-struct s3c24xx_uart_resources;
-struct platform_device;
-struct s3c2410_uartcfg;
-struct map_desc;
-
-/* core initialisation functions */
-
-extern void s3c24xx_init_irq(void);
-
-extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
-
-extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
-
-extern void s3c24xx_init_clocks(int xtal);
-
-extern void s3c24xx_init_uartdevs(char *name,
-                                 struct s3c24xx_uart_resources *res,
-                                 struct s3c2410_uartcfg *cfg, int no);
-
-/* the board structure is used at first initialsation time
- * to get info such as the devices to register for this
- * board. This is done because platfrom_add_devices() cannot
- * be called from the map_io entry.
-*/
-
-struct s3c24xx_board {
-       struct platform_device  **devices;
-       unsigned int              devices_count;
-
-       struct clk              **clocks;
-       unsigned int              clocks_count;
-};
-
-extern void s3c24xx_set_board(struct s3c24xx_board *board);
-
-/* timer for 2410/2440 */
-
-struct sys_timer;
-extern struct sys_timer s3c24xx_timer;
-
-/* system device classes */
-
-extern struct sysdev_class s3c2410_sysclass;
-extern struct sysdev_class s3c2412_sysclass;
-extern struct sysdev_class s3c2440_sysclass;
-extern struct sysdev_class s3c2442_sysclass;
diff --git a/arch/arm/mach-s3c2410/devs.c b/arch/arm/mach-s3c2410/devs.c
deleted file mode 100644 (file)
index faccde2..0000000
+++ /dev/null
@@ -1,585 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/devs.c
- *
- * Copyright (c) 2004 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Base S3C24XX platform device definitions
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
-*/
-
-#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/serial_core.h>
-#include <linux/platform_device.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-#include <asm/arch/fb.h>
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-
-#include <asm/arch/regs-serial.h>
-
-#include "devs.h"
-#include "cpu.h"
-
-/* Serial port registrations */
-
-static struct resource s3c2410_uart0_resource[] = {
-       [0] = {
-               .start = S3C2410_PA_UART0,
-               .end   = S3C2410_PA_UART0 + 0x3fff,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_S3CUART_RX0,
-               .end   = IRQ_S3CUART_ERR0,
-               .flags = IORESOURCE_IRQ,
-       }
-};
-
-static struct resource s3c2410_uart1_resource[] = {
-       [0] = {
-               .start = S3C2410_PA_UART1,
-               .end   = S3C2410_PA_UART1 + 0x3fff,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_S3CUART_RX1,
-               .end   = IRQ_S3CUART_ERR1,
-               .flags = IORESOURCE_IRQ,
-       }
-};
-
-static struct resource s3c2410_uart2_resource[] = {
-       [0] = {
-               .start = S3C2410_PA_UART2,
-               .end   = S3C2410_PA_UART2 + 0x3fff,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_S3CUART_RX2,
-               .end   = IRQ_S3CUART_ERR2,
-               .flags = IORESOURCE_IRQ,
-       }
-};
-
-struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = {
-       [0] = {
-               .resources      = s3c2410_uart0_resource,
-               .nr_resources   = ARRAY_SIZE(s3c2410_uart0_resource),
-       },
-       [1] = {
-               .resources      = s3c2410_uart1_resource,
-               .nr_resources   = ARRAY_SIZE(s3c2410_uart1_resource),
-       },
-       [2] = {
-               .resources      = s3c2410_uart2_resource,
-               .nr_resources   = ARRAY_SIZE(s3c2410_uart2_resource),
-       },
-};
-
-/* yart devices */
-
-static struct platform_device s3c24xx_uart_device0 = {
-       .id             = 0,
-};
-
-static struct platform_device s3c24xx_uart_device1 = {
-       .id             = 1,
-};
-
-static struct platform_device s3c24xx_uart_device2 = {
-       .id             = 2,
-};
-
-struct platform_device *s3c24xx_uart_src[3] = {
-       &s3c24xx_uart_device0,
-       &s3c24xx_uart_device1,
-       &s3c24xx_uart_device2,
-};
-
-struct platform_device *s3c24xx_uart_devs[3] = {
-};
-
-/* USB Host Controller */
-
-static struct resource s3c_usb_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_USBHOST,
-               .end   = S3C24XX_PA_USBHOST + S3C24XX_SZ_USBHOST - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_USBH,
-               .end   = IRQ_USBH,
-               .flags = IORESOURCE_IRQ,
-       }
-};
-
-static u64 s3c_device_usb_dmamask = 0xffffffffUL;
-
-struct platform_device s3c_device_usb = {
-       .name             = "s3c2410-ohci",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_usb_resource),
-       .resource         = s3c_usb_resource,
-       .dev              = {
-               .dma_mask = &s3c_device_usb_dmamask,
-               .coherent_dma_mask = 0xffffffffUL
-       }
-};
-
-EXPORT_SYMBOL(s3c_device_usb);
-
-/* LCD Controller */
-
-static struct resource s3c_lcd_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_LCD,
-               .end   = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_LCD,
-               .end   = IRQ_LCD,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
-
-struct platform_device s3c_device_lcd = {
-       .name             = "s3c2410-lcd",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_lcd_resource),
-       .resource         = s3c_lcd_resource,
-       .dev              = {
-               .dma_mask               = &s3c_device_lcd_dmamask,
-               .coherent_dma_mask      = 0xffffffffUL
-       }
-};
-
-EXPORT_SYMBOL(s3c_device_lcd);
-
-void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
-{
-       struct s3c2410fb_mach_info *npd;
-
-       npd = kmalloc(sizeof(*npd), GFP_KERNEL);
-       if (npd) {
-               memcpy(npd, pd, sizeof(*npd));
-               s3c_device_lcd.dev.platform_data = npd;
-       } else {
-               printk(KERN_ERR "no memory for LCD platform data\n");
-       }
-}
-
-/* NAND Controller */
-
-static struct resource s3c_nand_resource[] = {
-       [0] = {
-               .start = S3C2410_PA_NAND,
-               .end   = S3C2410_PA_NAND + S3C24XX_SZ_NAND - 1,
-               .flags = IORESOURCE_MEM,
-       }
-};
-
-struct platform_device s3c_device_nand = {
-       .name             = "s3c2410-nand",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_nand_resource),
-       .resource         = s3c_nand_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_nand);
-
-/* USB Device (Gadget)*/
-
-static struct resource s3c_usbgadget_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_USBDEV,
-               .end   = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_USBD,
-               .end   = IRQ_USBD,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_usbgadget = {
-       .name             = "s3c2410-usbgadget",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_usbgadget_resource),
-       .resource         = s3c_usbgadget_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_usbgadget);
-
-/* Watchdog */
-
-static struct resource s3c_wdt_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_WATCHDOG,
-               .end   = S3C24XX_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_WDT,
-               .end   = IRQ_WDT,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_wdt = {
-       .name             = "s3c2410-wdt",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_wdt_resource),
-       .resource         = s3c_wdt_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_wdt);
-
-/* I2C */
-
-static struct resource s3c_i2c_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_IIC,
-               .end   = S3C24XX_PA_IIC + S3C24XX_SZ_IIC - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_IIC,
-               .end   = IRQ_IIC,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_i2c = {
-       .name             = "s3c2410-i2c",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_i2c_resource),
-       .resource         = s3c_i2c_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_i2c);
-
-/* IIS */
-
-static struct resource s3c_iis_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_IIS,
-               .end   = S3C24XX_PA_IIS + S3C24XX_SZ_IIS -1,
-               .flags = IORESOURCE_MEM,
-       }
-};
-
-static u64 s3c_device_iis_dmamask = 0xffffffffUL;
-
-struct platform_device s3c_device_iis = {
-       .name             = "s3c2410-iis",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_iis_resource),
-       .resource         = s3c_iis_resource,
-       .dev              = {
-               .dma_mask = &s3c_device_iis_dmamask,
-               .coherent_dma_mask = 0xffffffffUL
-       }
-};
-
-EXPORT_SYMBOL(s3c_device_iis);
-
-/* RTC */
-
-static struct resource s3c_rtc_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_RTC,
-               .end   = S3C24XX_PA_RTC + 0xff,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_RTC,
-               .end   = IRQ_RTC,
-               .flags = IORESOURCE_IRQ,
-       },
-       [2] = {
-               .start = IRQ_TICK,
-               .end   = IRQ_TICK,
-               .flags = IORESOURCE_IRQ
-       }
-};
-
-struct platform_device s3c_device_rtc = {
-       .name             = "s3c2410-rtc",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_rtc_resource),
-       .resource         = s3c_rtc_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_rtc);
-
-/* ADC */
-
-static struct resource s3c_adc_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_ADC,
-               .end   = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_TC,
-               .end   = IRQ_TC,
-               .flags = IORESOURCE_IRQ,
-       },
-       [2] = {
-               .start = IRQ_ADC,
-               .end   = IRQ_ADC,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_adc = {
-       .name             = "s3c2410-adc",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_adc_resource),
-       .resource         = s3c_adc_resource,
-};
-
-/* SDI */
-
-static struct resource s3c_sdi_resource[] = {
-       [0] = {
-               .start = S3C2410_PA_SDI,
-               .end   = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_SDI,
-               .end   = IRQ_SDI,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_sdi = {
-       .name             = "s3c2410-sdi",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_sdi_resource),
-       .resource         = s3c_sdi_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_sdi);
-
-/* SPI (0) */
-
-static struct resource s3c_spi0_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_SPI,
-               .end   = S3C24XX_PA_SPI + 0x1f,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_SPI0,
-               .end   = IRQ_SPI0,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-static u64 s3c_device_spi0_dmamask = 0xffffffffUL;
-
-struct platform_device s3c_device_spi0 = {
-       .name             = "s3c2410-spi",
-       .id               = 0,
-       .num_resources    = ARRAY_SIZE(s3c_spi0_resource),
-       .resource         = s3c_spi0_resource,
-        .dev              = {
-                .dma_mask = &s3c_device_spi0_dmamask,
-                .coherent_dma_mask = 0xffffffffUL
-        }
-};
-
-EXPORT_SYMBOL(s3c_device_spi0);
-
-/* SPI (1) */
-
-static struct resource s3c_spi1_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_SPI + 0x20,
-               .end   = S3C24XX_PA_SPI + 0x20 + 0x1f,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_SPI1,
-               .end   = IRQ_SPI1,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-static u64 s3c_device_spi1_dmamask = 0xffffffffUL;
-
-struct platform_device s3c_device_spi1 = {
-       .name             = "s3c2410-spi",
-       .id               = 1,
-       .num_resources    = ARRAY_SIZE(s3c_spi1_resource),
-       .resource         = s3c_spi1_resource,
-        .dev              = {
-                .dma_mask = &s3c_device_spi1_dmamask,
-                .coherent_dma_mask = 0xffffffffUL
-        }
-};
-
-EXPORT_SYMBOL(s3c_device_spi1);
-
-/* pwm timer blocks */
-
-static struct resource s3c_timer0_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_TIMER + 0x0C,
-               .end   = S3C24XX_PA_TIMER + 0x0C + 0xB,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_TIMER0,
-               .end   = IRQ_TIMER0,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_timer0 = {
-       .name             = "s3c2410-timer",
-       .id               = 0,
-       .num_resources    = ARRAY_SIZE(s3c_timer0_resource),
-       .resource         = s3c_timer0_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_timer0);
-
-/* timer 1 */
-
-static struct resource s3c_timer1_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_TIMER + 0x18,
-               .end   = S3C24XX_PA_TIMER + 0x23,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_TIMER1,
-               .end   = IRQ_TIMER1,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_timer1 = {
-       .name             = "s3c2410-timer",
-       .id               = 1,
-       .num_resources    = ARRAY_SIZE(s3c_timer1_resource),
-       .resource         = s3c_timer1_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_timer1);
-
-/* timer 2 */
-
-static struct resource s3c_timer2_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_TIMER + 0x24,
-               .end   = S3C24XX_PA_TIMER + 0x2F,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_TIMER2,
-               .end   = IRQ_TIMER2,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_timer2 = {
-       .name             = "s3c2410-timer",
-       .id               = 2,
-       .num_resources    = ARRAY_SIZE(s3c_timer2_resource),
-       .resource         = s3c_timer2_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_timer2);
-
-/* timer 3 */
-
-static struct resource s3c_timer3_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_TIMER + 0x30,
-               .end   = S3C24XX_PA_TIMER + 0x3B,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_TIMER3,
-               .end   = IRQ_TIMER3,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_timer3 = {
-       .name             = "s3c2410-timer",
-       .id               = 3,
-       .num_resources    = ARRAY_SIZE(s3c_timer3_resource),
-       .resource         = s3c_timer3_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_timer3);
-
-#ifdef CONFIG_CPU_S3C2440
-
-/* Camif Controller */
-
-static struct resource s3c_camif_resource[] = {
-       [0] = {
-               .start = S3C2440_PA_CAMIF,
-               .end   = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_CAM,
-               .end   = IRQ_CAM,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-static u64 s3c_device_camif_dmamask = 0xffffffffUL;
-
-struct platform_device s3c_device_camif = {
-       .name             = "s3c2440-camif",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_camif_resource),
-       .resource         = s3c_camif_resource,
-       .dev              = {
-               .dma_mask = &s3c_device_camif_dmamask,
-               .coherent_dma_mask = 0xffffffffUL
-       }
-};
-
-EXPORT_SYMBOL(s3c_device_camif);
-
-#endif // CONFIG_CPU_S32440
diff --git a/arch/arm/mach-s3c2410/devs.h b/arch/arm/mach-s3c2410/devs.h
deleted file mode 100644 (file)
index 14fb0ba..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* arch/arm/mach-s3c2410/devs.h
- *
- * Copyright (c) 2004 Simtec Electronics
- * Ben Dooks <ben@simtec.co.uk>
- *
- * Header file for s3c2410 standard platform devices
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-#include <linux/platform_device.h>
-
-struct s3c24xx_uart_resources {
-       struct resource         *resources;
-       unsigned long            nr_resources;
-};
-
-extern struct s3c24xx_uart_resources s3c2410_uart_resources[];
-
-extern struct platform_device *s3c24xx_uart_devs[];
-extern struct platform_device *s3c24xx_uart_src[];
-
-extern struct platform_device s3c_device_usb;
-extern struct platform_device s3c_device_lcd;
-extern struct platform_device s3c_device_wdt;
-extern struct platform_device s3c_device_i2c;
-extern struct platform_device s3c_device_iis;
-extern struct platform_device s3c_device_rtc;
-extern struct platform_device s3c_device_adc;
-extern struct platform_device s3c_device_sdi;
-
-extern struct platform_device s3c_device_spi0;
-extern struct platform_device s3c_device_spi1;
-
-extern struct platform_device s3c_device_nand;
-
-extern struct platform_device s3c_device_timer0;
-extern struct platform_device s3c_device_timer1;
-extern struct platform_device s3c_device_timer2;
-extern struct platform_device s3c_device_timer3;
-
-extern struct platform_device s3c_device_usbgadget;
-
-/* s3c2440 specific devices */
-
-#ifdef CONFIG_CPU_S3C2440
-
-extern struct platform_device s3c_device_camif;
-
-#endif
index fa860e716b4ff74e5af753a81ae3a2c8152b3e30..67d1ad36397344715a1c085a0abe0ce9b82632ea 100644 (file)
@@ -1,9 +1,9 @@
 /* linux/arch/arm/mach-s3c2410/dma.c
  *
- * Copyright (c) 2003-2005,2006 Simtec Electronics
+ * Copyright (c) 2006 Simtec Electronics
  *     Ben Dooks <ben@simtec.co.uk>
  *
- * S3C2410 DMA core
+ * S3C2410 DMA selection
  *
  * http://armlinux.simtec.co.uk/
  *
  * published by the Free Software Foundation.
 */
 
-
-#ifdef CONFIG_S3C2410_DMA_DEBUG
-#define DEBUG
-#endif
-
-#include <linux/module.h>
+#include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
 #include <linux/sysdev.h>
-#include <linux/slab.h>
-#include <linux/errno.h>
-#include <linux/delay.h>
+#include <linux/serial_core.h>
 
-#include <asm/system.h>
-#include <asm/irq.h>
-#include <asm/hardware.h>
-#include <asm/io.h>
 #include <asm/dma.h>
-
-#include <asm/mach/dma.h>
-#include <asm/arch/map.h>
-
-#include "dma.h"
-
-/* io map for dma */
-static void __iomem *dma_base;
-static struct kmem_cache *dma_kmem;
-
-struct s3c24xx_dma_selection dma_sel;
-
-/* dma channel state information */
-struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS];
-
-/* debugging functions */
-
-#define BUF_MAGIC (0xcafebabe)
-
-#define dmawarn(fmt...) printk(KERN_DEBUG fmt)
-
-#define dma_regaddr(chan, reg) ((chan)->regs + (reg))
-
-#if 1
-#define dma_wrreg(chan, reg, val) writel((val), (chan)->regs + (reg))
-#else
-static inline void
-dma_wrreg(struct s3c2410_dma_chan *chan, int reg, unsigned long val)
-{
-       pr_debug("writing %08x to register %08x\n",(unsigned int)val,reg);
-       writel(val, dma_regaddr(chan, reg));
-}
-#endif
-
-#define dma_rdreg(chan, reg) readl((chan)->regs + (reg))
-
-/* captured register state for debug */
-
-struct s3c2410_dma_regstate {
-       unsigned long         dcsrc;
-       unsigned long         disrc;
-       unsigned long         dstat;
-       unsigned long         dcon;
-       unsigned long         dmsktrig;
+#include <asm/arch/dma.h>
+
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/dma.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-ac97.h>
+#include <asm/arch/regs-mem.h>
+#include <asm/arch/regs-lcd.h>
+#include <asm/arch/regs-sdi.h>
+#include <asm/arch/regs-iis.h>
+#include <asm/arch/regs-spi.h>
+
+static struct s3c24xx_dma_map __initdata s3c2410_dma_mappings[] = {
+       [DMACH_XD0] = {
+               .name           = "xdreq0",
+               .channels[0]    = S3C2410_DCON_CH0_XDREQ0 | DMA_CH_VALID,
+       },
+       [DMACH_XD1] = {
+               .name           = "xdreq1",
+               .channels[1]    = S3C2410_DCON_CH1_XDREQ1 | DMA_CH_VALID,
+       },
+       [DMACH_SDI] = {
+               .name           = "sdi",
+               .channels[0]    = S3C2410_DCON_CH0_SDI | DMA_CH_VALID,
+               .channels[2]    = S3C2410_DCON_CH2_SDI | DMA_CH_VALID,
+               .channels[3]    = S3C2410_DCON_CH3_SDI | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
+               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_SPI0] = {
+               .name           = "spi0",
+               .channels[1]    = S3C2410_DCON_CH1_SPI | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_SPI + S3C2410_SPTDAT,
+               .hw_addr.from   = S3C2410_PA_SPI + S3C2410_SPRDAT,
+       },
+       [DMACH_SPI1] = {
+               .name           = "spi1",
+               .channels[3]    = S3C2410_DCON_CH3_SPI | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_SPI + 0x20 + S3C2410_SPTDAT,
+               .hw_addr.from   = S3C2410_PA_SPI + 0x20 + S3C2410_SPRDAT,
+       },
+       [DMACH_UART0] = {
+               .name           = "uart0",
+               .channels[0]    = S3C2410_DCON_CH0_UART0 | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_UART0 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART0 + S3C2410_URXH,
+       },
+       [DMACH_UART1] = {
+               .name           = "uart1",
+               .channels[1]    = S3C2410_DCON_CH1_UART1 | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_UART1 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART1 + S3C2410_URXH,
+       },
+       [DMACH_UART2] = {
+               .name           = "uart2",
+               .channels[3]    = S3C2410_DCON_CH3_UART2 | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_UART2 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART2 + S3C2410_URXH,
+       },
+       [DMACH_TIMER] = {
+               .name           = "timer",
+               .channels[0]    = S3C2410_DCON_CH0_TIMER | DMA_CH_VALID,
+               .channels[2]    = S3C2410_DCON_CH2_TIMER | DMA_CH_VALID,
+               .channels[3]    = S3C2410_DCON_CH3_TIMER | DMA_CH_VALID,
+       },
+       [DMACH_I2S_IN] = {
+               .name           = "i2s-sdi",
+               .channels[1]    = S3C2410_DCON_CH1_I2SSDI | DMA_CH_VALID,
+               .channels[2]    = S3C2410_DCON_CH2_I2SSDI | DMA_CH_VALID,
+               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_I2S_OUT] = {
+               .name           = "i2s-sdo",
+               .channels[2]    = S3C2410_DCON_CH2_I2SSDO | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_USB_EP1] = {
+               .name           = "usb-ep1",
+               .channels[0]    = S3C2410_DCON_CH0_USBEP1 | DMA_CH_VALID,
+       },
+       [DMACH_USB_EP2] = {
+               .name           = "usb-ep2",
+               .channels[1]    = S3C2410_DCON_CH1_USBEP2 | DMA_CH_VALID,
+       },
+       [DMACH_USB_EP3] = {
+               .name           = "usb-ep3",
+               .channels[2]    = S3C2410_DCON_CH2_USBEP3 | DMA_CH_VALID,
+       },
+       [DMACH_USB_EP4] = {
+               .name           = "usb-ep4",
+               .channels[3]    =S3C2410_DCON_CH3_USBEP4 | DMA_CH_VALID,
+       },
 };
 
-#ifdef CONFIG_S3C2410_DMA_DEBUG
-
-/* dmadbg_showregs
- *
- * simple debug routine to print the current state of the dma registers
-*/
-
-static void
-dmadbg_capture(struct s3c2410_dma_chan *chan, struct s3c2410_dma_regstate *regs)
-{
-       regs->dcsrc    = dma_rdreg(chan, S3C2410_DMA_DCSRC);
-       regs->disrc    = dma_rdreg(chan, S3C2410_DMA_DISRC);
-       regs->dstat    = dma_rdreg(chan, S3C2410_DMA_DSTAT);
-       regs->dcon     = dma_rdreg(chan, S3C2410_DMA_DCON);
-       regs->dmsktrig = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
-}
-
-static void
-dmadbg_dumpregs(const char *fname, int line, struct s3c2410_dma_chan *chan,
-                struct s3c2410_dma_regstate *regs)
-{
-       printk(KERN_DEBUG "dma%d: %s:%d: DCSRC=%08lx, DISRC=%08lx, DSTAT=%08lx DMT=%02lx, DCON=%08lx\n",
-              chan->number, fname, line,
-              regs->dcsrc, regs->disrc, regs->dstat, regs->dmsktrig,
-              regs->dcon);
-}
-
-static void
-dmadbg_showchan(const char *fname, int line, struct s3c2410_dma_chan *chan)
-{
-       struct s3c2410_dma_regstate state;
-
-       dmadbg_capture(chan, &state);
-
-       printk(KERN_DEBUG "dma%d: %s:%d: ls=%d, cur=%p, %p %p\n",
-              chan->number, fname, line, chan->load_state,
-              chan->curr, chan->next, chan->end);
-
-       dmadbg_dumpregs(fname, line, chan, &state);
-}
-
-static void
-dmadbg_showregs(const char *fname, int line, struct s3c2410_dma_chan *chan)
-{
-       struct s3c2410_dma_regstate state;
-
-       dmadbg_capture(chan, &state);
-       dmadbg_dumpregs(fname, line, chan, &state);
-}
-
-#define dbg_showregs(chan) dmadbg_showregs(__FUNCTION__, __LINE__, (chan))
-#define dbg_showchan(chan) dmadbg_showchan(__FUNCTION__, __LINE__, (chan))
-#else
-#define dbg_showregs(chan) do { } while(0)
-#define dbg_showchan(chan) do { } while(0)
-#endif /* CONFIG_S3C2410_DMA_DEBUG */
-
-static struct s3c2410_dma_chan *dma_chan_map[DMACH_MAX];
-
-/* lookup_dma_channel
- *
- * change the dma channel number given into a real dma channel id
-*/
-
-static struct s3c2410_dma_chan *lookup_dma_channel(unsigned int channel)
-{
-       if (channel & DMACH_LOW_LEVEL)
-               return &s3c2410_chans[channel & ~DMACH_LOW_LEVEL];
-       else
-               return dma_chan_map[channel];
-}
-
-/* s3c2410_dma_stats_timeout
- *
- * Update DMA stats from timeout info
-*/
-
-static void
-s3c2410_dma_stats_timeout(struct s3c2410_dma_stats *stats, int val)
+static void s3c2410_dma_select(struct s3c2410_dma_chan *chan,
+                              struct s3c24xx_dma_map *map)
 {
-       if (stats == NULL)
-               return;
-
-       if (val > stats->timeout_longest)
-               stats->timeout_longest = val;
-       if (val < stats->timeout_shortest)
-               stats->timeout_shortest = val;
-
-       stats->timeout_avg += val;
+       chan->dcon = map->channels[chan->number] & ~DMA_CH_VALID;
 }
 
-/* s3c2410_dma_waitforload
- *
- * wait for the DMA engine to load a buffer, and update the state accordingly
-*/
-
-static int
-s3c2410_dma_waitforload(struct s3c2410_dma_chan *chan, int line)
-{
-       int timeout = chan->load_timeout;
-       int took;
-
-       if (chan->load_state != S3C2410_DMALOAD_1LOADED) {
-               printk(KERN_ERR "dma%d: s3c2410_dma_waitforload() called in loadstate %d from line %d\n", chan->number, chan->load_state, line);
-               return 0;
-       }
-
-       if (chan->stats != NULL)
-               chan->stats->loads++;
-
-       while (--timeout > 0) {
-               if ((dma_rdreg(chan, S3C2410_DMA_DSTAT) << (32-20)) != 0) {
-                       took = chan->load_timeout - timeout;
-
-                       s3c2410_dma_stats_timeout(chan->stats, took);
-
-                       switch (chan->load_state) {
-                       case S3C2410_DMALOAD_1LOADED:
-                               chan->load_state = S3C2410_DMALOAD_1RUNNING;
-                               break;
-
-                       default:
-                               printk(KERN_ERR "dma%d: unknown load_state in s3c2410_dma_waitforload() %d\n", chan->number, chan->load_state);
-                       }
-
-                       return 1;
-               }
-       }
-
-       if (chan->stats != NULL) {
-               chan->stats->timeout_failed++;
-       }
-
-       return 0;
-}
-
-
-
-/* s3c2410_dma_loadbuffer
- *
- * load a buffer, and update the channel state
-*/
-
-static inline int
-s3c2410_dma_loadbuffer(struct s3c2410_dma_chan *chan,
-                      struct s3c2410_dma_buf *buf)
-{
-       unsigned long reload;
-
-       pr_debug("s3c2410_chan_loadbuffer: loading buff %p (0x%08lx,0x%06x)\n",
-                buf, (unsigned long)buf->data, buf->size);
-
-       if (buf == NULL) {
-               dmawarn("buffer is NULL\n");
-               return -EINVAL;
-       }
-
-       /* check the state of the channel before we do anything */
-
-       if (chan->load_state == S3C2410_DMALOAD_1LOADED) {
-               dmawarn("load_state is S3C2410_DMALOAD_1LOADED\n");
-       }
-
-       if (chan->load_state == S3C2410_DMALOAD_1LOADED_1RUNNING) {
-               dmawarn("state is S3C2410_DMALOAD_1LOADED_1RUNNING\n");
-       }
-
-       /* it would seem sensible if we are the last buffer to not bother
-        * with the auto-reload bit, so that the DMA engine will not try
-        * and load another transfer after this one has finished...
-        */
-       if (chan->load_state == S3C2410_DMALOAD_NONE) {
-               pr_debug("load_state is none, checking for noreload (next=%p)\n",
-                        buf->next);
-               reload = (buf->next == NULL) ? S3C2410_DCON_NORELOAD : 0;
-       } else {
-               //pr_debug("load_state is %d => autoreload\n", chan->load_state);
-               reload = S3C2410_DCON_AUTORELOAD;
-       }
-
-       if ((buf->data & 0xf0000000) != 0x30000000) {
-               dmawarn("dmaload: buffer is %p\n", (void *)buf->data);
-       }
-
-       writel(buf->data, chan->addr_reg);
-
-       dma_wrreg(chan, S3C2410_DMA_DCON,
-                 chan->dcon | reload | (buf->size/chan->xfer_unit));
-
-       chan->next = buf->next;
-
-       /* update the state of the channel */
-
-       switch (chan->load_state) {
-       case S3C2410_DMALOAD_NONE:
-               chan->load_state = S3C2410_DMALOAD_1LOADED;
-               break;
-
-       case S3C2410_DMALOAD_1RUNNING:
-               chan->load_state = S3C2410_DMALOAD_1LOADED_1RUNNING;
-               break;
-
-       default:
-               dmawarn("dmaload: unknown state %d in loadbuffer\n",
-                       chan->load_state);
-               break;
-       }
-
-       return 0;
-}
-
-/* s3c2410_dma_call_op
- *
- * small routine to call the op routine with the given op if it has been
- * registered
-*/
-
-static void
-s3c2410_dma_call_op(struct s3c2410_dma_chan *chan, enum s3c2410_chan_op op)
-{
-       if (chan->op_fn != NULL) {
-               (chan->op_fn)(chan, op);
-       }
-}
-
-/* s3c2410_dma_buffdone
- *
- * small wrapper to check if callback routine needs to be called, and
- * if so, call it
-*/
-
-static inline void
-s3c2410_dma_buffdone(struct s3c2410_dma_chan *chan, struct s3c2410_dma_buf *buf,
-                    enum s3c2410_dma_buffresult result)
-{
-#if 0
-       pr_debug("callback_fn=%p, buf=%p, id=%p, size=%d, result=%d\n",
-                chan->callback_fn, buf, buf->id, buf->size, result);
-#endif
-
-       if (chan->callback_fn != NULL) {
-               (chan->callback_fn)(chan, buf->id, buf->size, result);
-       }
-}
-
-/* s3c2410_dma_start
- *
- * start a dma channel going
-*/
-
-static int s3c2410_dma_start(struct s3c2410_dma_chan *chan)
-{
-       unsigned long tmp;
-       unsigned long flags;
-
-       pr_debug("s3c2410_start_dma: channel=%d\n", chan->number);
-
-       local_irq_save(flags);
-
-       if (chan->state == S3C2410_DMA_RUNNING) {
-               pr_debug("s3c2410_start_dma: already running (%d)\n", chan->state);
-               local_irq_restore(flags);
-               return 0;
-       }
-
-       chan->state = S3C2410_DMA_RUNNING;
-
-       /* check wether there is anything to load, and if not, see
-        * if we can find anything to load
-        */
-
-       if (chan->load_state == S3C2410_DMALOAD_NONE) {
-               if (chan->next == NULL) {
-                       printk(KERN_ERR "dma%d: channel has nothing loaded\n",
-                              chan->number);
-                       chan->state = S3C2410_DMA_IDLE;
-                       local_irq_restore(flags);
-                       return -EINVAL;
-               }
-
-               s3c2410_dma_loadbuffer(chan, chan->next);
-       }
-
-       dbg_showchan(chan);
-
-       /* enable the channel */
-
-       if (!chan->irq_enabled) {
-               enable_irq(chan->irq);
-               chan->irq_enabled = 1;
-       }
-
-       /* start the channel going */
-
-       tmp = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
-       tmp &= ~S3C2410_DMASKTRIG_STOP;
-       tmp |= S3C2410_DMASKTRIG_ON;
-       dma_wrreg(chan, S3C2410_DMA_DMASKTRIG, tmp);
-
-       pr_debug("dma%d: %08lx to DMASKTRIG\n", chan->number, tmp);
-
-#if 0
-       /* the dma buffer loads should take care of clearing the AUTO
-        * reloading feature */
-       tmp = dma_rdreg(chan, S3C2410_DMA_DCON);
-       tmp &= ~S3C2410_DCON_NORELOAD;
-       dma_wrreg(chan, S3C2410_DMA_DCON, tmp);
-#endif
-
-       s3c2410_dma_call_op(chan, S3C2410_DMAOP_START);
-
-       dbg_showchan(chan);
-
-       /* if we've only loaded one buffer onto the channel, then chec
-        * to see if we have another, and if so, try and load it so when
-        * the first buffer is finished, the new one will be loaded onto
-        * the channel */
-
-       if (chan->next != NULL) {
-               if (chan->load_state == S3C2410_DMALOAD_1LOADED) {
-
-                       if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
-                               pr_debug("%s: buff not yet loaded, no more todo\n",
-                                        __FUNCTION__);
-                       } else {
-                               chan->load_state = S3C2410_DMALOAD_1RUNNING;
-                               s3c2410_dma_loadbuffer(chan, chan->next);
-                       }
-
-               } else if (chan->load_state == S3C2410_DMALOAD_1RUNNING) {
-                       s3c2410_dma_loadbuffer(chan, chan->next);
-               }
-       }
-
-
-       local_irq_restore(flags);
-
-       return 0;
-}
-
-/* s3c2410_dma_canload
- *
- * work out if we can queue another buffer into the DMA engine
-*/
-
-static int
-s3c2410_dma_canload(struct s3c2410_dma_chan *chan)
-{
-       if (chan->load_state == S3C2410_DMALOAD_NONE ||
-           chan->load_state == S3C2410_DMALOAD_1RUNNING)
-               return 1;
-
-       return 0;
-}
-
-/* s3c2410_dma_enqueue
- *
- * queue an given buffer for dma transfer.
- *
- * id         the device driver's id information for this buffer
- * data       the physical address of the buffer data
- * size       the size of the buffer in bytes
- *
- * If the channel is not running, then the flag S3C2410_DMAF_AUTOSTART
- * is checked, and if set, the channel is started. If this flag isn't set,
- * then an error will be returned.
- *
- * It is possible to queue more than one DMA buffer onto a channel at
- * once, and the code will deal with the re-loading of the next buffer
- * when necessary.
-*/
-
-int s3c2410_dma_enqueue(unsigned int channel, void *id,
-                       dma_addr_t data, int size)
-{
-       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
-       struct s3c2410_dma_buf *buf;
-       unsigned long flags;
-
-       if (chan == NULL)
-               return -EINVAL;
-
-       pr_debug("%s: id=%p, data=%08x, size=%d\n",
-                __FUNCTION__, id, (unsigned int)data, size);
-
-       buf = kmem_cache_alloc(dma_kmem, GFP_ATOMIC);
-       if (buf == NULL) {
-               pr_debug("%s: out of memory (%ld alloc)\n",
-                        __FUNCTION__, (long)sizeof(*buf));
-               return -ENOMEM;
-       }
-
-       //pr_debug("%s: new buffer %p\n", __FUNCTION__, buf);
-       //dbg_showchan(chan);
-
-       buf->next  = NULL;
-       buf->data  = buf->ptr = data;
-       buf->size  = size;
-       buf->id    = id;
-       buf->magic = BUF_MAGIC;
-
-       local_irq_save(flags);
-
-       if (chan->curr == NULL) {
-               /* we've got nothing loaded... */
-               pr_debug("%s: buffer %p queued onto empty channel\n",
-                        __FUNCTION__, buf);
-
-               chan->curr = buf;
-               chan->end  = buf;
-               chan->next = NULL;
-       } else {
-               pr_debug("dma%d: %s: buffer %p queued onto non-empty channel\n",
-                        chan->number, __FUNCTION__, buf);
-
-               if (chan->end == NULL)
-                       pr_debug("dma%d: %s: %p not empty, and chan->end==NULL?\n",
-                                chan->number, __FUNCTION__, chan);
-
-               chan->end->next = buf;
-               chan->end = buf;
-       }
-
-       /* if necessary, update the next buffer field */
-       if (chan->next == NULL)
-               chan->next = buf;
-
-       /* check to see if we can load a buffer */
-       if (chan->state == S3C2410_DMA_RUNNING) {
-               if (chan->load_state == S3C2410_DMALOAD_1LOADED && 1) {
-                       if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
-                               printk(KERN_ERR "dma%d: loadbuffer:"
-                                      "timeout loading buffer\n",
-                                      chan->number);
-                               dbg_showchan(chan);
-                               local_irq_restore(flags);
-                               return -EINVAL;
-                       }
-               }
-
-               while (s3c2410_dma_canload(chan) && chan->next != NULL) {
-                       s3c2410_dma_loadbuffer(chan, chan->next);
-               }
-       } else if (chan->state == S3C2410_DMA_IDLE) {
-               if (chan->flags & S3C2410_DMAF_AUTOSTART) {
-                       s3c2410_dma_ctrl(chan->number, S3C2410_DMAOP_START);
-               }
-       }
-
-       local_irq_restore(flags);
-       return 0;
-}
-
-EXPORT_SYMBOL(s3c2410_dma_enqueue);
-
-static inline void
-s3c2410_dma_freebuf(struct s3c2410_dma_buf *buf)
-{
-       int magicok = (buf->magic == BUF_MAGIC);
-
-       buf->magic = -1;
-
-       if (magicok) {
-               kmem_cache_free(dma_kmem, buf);
-       } else {
-               printk("s3c2410_dma_freebuf: buff %p with bad magic\n", buf);
-       }
-}
-
-/* s3c2410_dma_lastxfer
- *
- * called when the system is out of buffers, to ensure that the channel
- * is prepared for shutdown.
-*/
-
-static inline void
-s3c2410_dma_lastxfer(struct s3c2410_dma_chan *chan)
-{
-#if 0
-       pr_debug("dma%d: s3c2410_dma_lastxfer: load_state %d\n",
-                chan->number, chan->load_state);
-#endif
-
-       switch (chan->load_state) {
-       case S3C2410_DMALOAD_NONE:
-               break;
-
-       case S3C2410_DMALOAD_1LOADED:
-               if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
-                               /* flag error? */
-                       printk(KERN_ERR "dma%d: timeout waiting for load (%s)\n",
-                              chan->number, __FUNCTION__);
-                       return;
-               }
-               break;
-
-       case S3C2410_DMALOAD_1LOADED_1RUNNING:
-               /* I belive in this case we do not have anything to do
-                * until the next buffer comes along, and we turn off the
-                * reload */
-               return;
-
-       default:
-               pr_debug("dma%d: lastxfer: unhandled load_state %d with no next\n",
-                        chan->number, chan->load_state);
-               return;
-
-       }
-
-       /* hopefully this'll shut the damned thing up after the transfer... */
-       dma_wrreg(chan, S3C2410_DMA_DCON, chan->dcon | S3C2410_DCON_NORELOAD);
-}
-
-
-#define dmadbg2(x...)
-
-static irqreturn_t
-s3c2410_dma_irq(int irq, void *devpw)
-{
-       struct s3c2410_dma_chan *chan = (struct s3c2410_dma_chan *)devpw;
-       struct s3c2410_dma_buf  *buf;
-
-       buf = chan->curr;
-
-       dbg_showchan(chan);
-
-       /* modify the channel state */
-
-       switch (chan->load_state) {
-       case S3C2410_DMALOAD_1RUNNING:
-               /* TODO - if we are running only one buffer, we probably
-                * want to reload here, and then worry about the buffer
-                * callback */
-
-               chan->load_state = S3C2410_DMALOAD_NONE;
-               break;
-
-       case S3C2410_DMALOAD_1LOADED:
-               /* iirc, we should go back to NONE loaded here, we
-                * had a buffer, and it was never verified as being
-                * loaded.
-                */
-
-               chan->load_state = S3C2410_DMALOAD_NONE;
-               break;
-
-       case S3C2410_DMALOAD_1LOADED_1RUNNING:
-               /* we'll worry about checking to see if another buffer is
-                * ready after we've called back the owner. This should
-                * ensure we do not wait around too long for the DMA
-                * engine to start the next transfer
-                */
-
-               chan->load_state = S3C2410_DMALOAD_1LOADED;
-               break;
-
-       case S3C2410_DMALOAD_NONE:
-               printk(KERN_ERR "dma%d: IRQ with no loaded buffer?\n",
-                      chan->number);
-               break;
-
-       default:
-               printk(KERN_ERR "dma%d: IRQ in invalid load_state %d\n",
-                      chan->number, chan->load_state);
-               break;
-       }
-
-       if (buf != NULL) {
-               /* update the chain to make sure that if we load any more
-                * buffers when we call the callback function, things should
-                * work properly */
-
-               chan->curr = buf->next;
-               buf->next  = NULL;
-
-               if (buf->magic != BUF_MAGIC) {
-                       printk(KERN_ERR "dma%d: %s: buf %p incorrect magic\n",
-                              chan->number, __FUNCTION__, buf);
-                       return IRQ_HANDLED;
-               }
-
-               s3c2410_dma_buffdone(chan, buf, S3C2410_RES_OK);
-
-               /* free resouces */
-               s3c2410_dma_freebuf(buf);
-       } else {
-       }
-
-       /* only reload if the channel is still running... our buffer done
-        * routine may have altered the state by requesting the dma channel
-        * to stop or shutdown... */
-
-       /* todo: check that when the channel is shut-down from inside this
-        * function, we cope with unsetting reload, etc */
-
-       if (chan->next != NULL && chan->state != S3C2410_DMA_IDLE) {
-               unsigned long flags;
-
-               switch (chan->load_state) {
-               case S3C2410_DMALOAD_1RUNNING:
-                       /* don't need to do anything for this state */
-                       break;
-
-               case S3C2410_DMALOAD_NONE:
-                       /* can load buffer immediately */
-                       break;
-
-               case S3C2410_DMALOAD_1LOADED:
-                       if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
-                               /* flag error? */
-                               printk(KERN_ERR "dma%d: timeout waiting for load (%s)\n",
-                                      chan->number, __FUNCTION__);
-                               return IRQ_HANDLED;
-                       }
-
-                       break;
-
-               case S3C2410_DMALOAD_1LOADED_1RUNNING:
-                       goto no_load;
-
-               default:
-                       printk(KERN_ERR "dma%d: unknown load_state in irq, %d\n",
-                              chan->number, chan->load_state);
-                       return IRQ_HANDLED;
-               }
-
-               local_irq_save(flags);
-               s3c2410_dma_loadbuffer(chan, chan->next);
-               local_irq_restore(flags);
-       } else {
-               s3c2410_dma_lastxfer(chan);
-
-               /* see if we can stop this channel.. */
-               if (chan->load_state == S3C2410_DMALOAD_NONE) {
-                       pr_debug("dma%d: end of transfer, stopping channel (%ld)\n",
-                                chan->number, jiffies);
-                       s3c2410_dma_ctrl(chan->number | DMACH_LOW_LEVEL,
-                                        S3C2410_DMAOP_STOP);
-               }
-       }
-
- no_load:
-       return IRQ_HANDLED;
-}
-
-static struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel);
-
-/* s3c2410_request_dma
- *
- * get control of an dma channel
-*/
-
-int s3c2410_dma_request(unsigned int channel,
-                       struct s3c2410_dma_client *client,
-                       void *dev)
-{
-       struct s3c2410_dma_chan *chan;
-       unsigned long flags;
-       int err;
-
-       pr_debug("dma%d: s3c2410_request_dma: client=%s, dev=%p\n",
-                channel, client->name, dev);
-
-       local_irq_save(flags);
-
-       chan = s3c2410_dma_map_channel(channel);
-       if (chan == NULL) {
-               local_irq_restore(flags);
-               return -EBUSY;
-       }
-
-       dbg_showchan(chan);
-
-       chan->client = client;
-       chan->in_use = 1;
-
-       if (!chan->irq_claimed) {
-               pr_debug("dma%d: %s : requesting irq %d\n",
-                        channel, __FUNCTION__, chan->irq);
-
-               chan->irq_claimed = 1;
-               local_irq_restore(flags);
-
-               err = request_irq(chan->irq, s3c2410_dma_irq, IRQF_DISABLED,
-                                 client->name, (void *)chan);
-
-               local_irq_save(flags);
-
-               if (err) {
-                       chan->in_use = 0;
-                       chan->irq_claimed = 0;
-                       local_irq_restore(flags);
-
-                       printk(KERN_ERR "%s: cannot get IRQ %d for DMA %d\n",
-                              client->name, chan->irq, chan->number);
-                       return err;
-               }
-
-               chan->irq_enabled = 1;
-       }
-
-       local_irq_restore(flags);
-
-       /* need to setup */
-
-       pr_debug("%s: channel initialised, %p\n", __FUNCTION__, chan);
-
-       return 0;
-}
-
-EXPORT_SYMBOL(s3c2410_dma_request);
+static struct s3c24xx_dma_selection __initdata s3c2410_dma_sel = {
+       .select         = s3c2410_dma_select,
+       .dcon_mask      = 7 << 24,
+       .map            = s3c2410_dma_mappings,
+       .map_size       = ARRAY_SIZE(s3c2410_dma_mappings),
+};
 
-/* s3c2410_dma_free
- *
- * release the given channel back to the system, will stop and flush
- * any outstanding transfers, and ensure the channel is ready for the
- * next claimant.
- *
- * Note, although a warning is currently printed if the freeing client
- * info is not the same as the registrant's client info, the free is still
- * allowed to go through.
-*/
+static struct s3c24xx_dma_order __initdata s3c2410_dma_order = {
+       .channels       = {
+               [DMACH_SDI]     = {
+                       .list   = {
+                               [0]     = 3 | DMA_CH_VALID,
+                               [1]     = 2 | DMA_CH_VALID,
+                               [2]     = 0 | DMA_CH_VALID,
+                       },
+               },
+               [DMACH_I2S_IN]  = {
+                       .list   = {
+                               [0]     = 1 | DMA_CH_VALID,
+                               [1]     = 2 | DMA_CH_VALID,
+                       },
+               },
+       },
+};
 
-int s3c2410_dma_free(dmach_t channel, struct s3c2410_dma_client *client)
+static int s3c2410_dma_add(struct sys_device *sysdev)
 {
-       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
-       unsigned long flags;
-
-       if (chan == NULL)
-               return -EINVAL;
-
-       local_irq_save(flags);
-
-       if (chan->client != client) {
-               printk(KERN_WARNING "dma%d: possible free from different client (channel %p, passed %p)\n",
-                      channel, chan->client, client);
-       }
-
-       /* sort out stopping and freeing the channel */
-
-       if (chan->state != S3C2410_DMA_IDLE) {
-               pr_debug("%s: need to stop dma channel %p\n",
-                      __FUNCTION__, chan);
-
-               /* possibly flush the channel */
-               s3c2410_dma_ctrl(channel, S3C2410_DMAOP_STOP);
-       }
-
-       chan->client = NULL;
-       chan->in_use = 0;
-
-       if (chan->irq_claimed)
-               free_irq(chan->irq, (void *)chan);
-
-       chan->irq_claimed = 0;
-
-       if (!(channel & DMACH_LOW_LEVEL))
-               dma_chan_map[channel] = NULL;
-
-       local_irq_restore(flags);
-
-       return 0;
+       s3c2410_dma_init();
+       s3c24xx_dma_order_set(&s3c2410_dma_order);
+       return s3c24xx_dma_init_map(&s3c2410_dma_sel);
 }
 
-EXPORT_SYMBOL(s3c2410_dma_free);
-
-static int s3c2410_dma_dostop(struct s3c2410_dma_chan *chan)
-{
-       unsigned long flags;
-       unsigned long tmp;
-
-       pr_debug("%s:\n", __FUNCTION__);
-
-       dbg_showchan(chan);
-
-       local_irq_save(flags);
-
-       s3c2410_dma_call_op(chan,  S3C2410_DMAOP_STOP);
-
-       tmp = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
-       tmp |= S3C2410_DMASKTRIG_STOP;
-       //tmp &= ~S3C2410_DMASKTRIG_ON;
-       dma_wrreg(chan, S3C2410_DMA_DMASKTRIG, tmp);
-
-#if 0
-       /* should also clear interrupts, according to WinCE BSP */
-       tmp = dma_rdreg(chan, S3C2410_DMA_DCON);
-       tmp |= S3C2410_DCON_NORELOAD;
-       dma_wrreg(chan, S3C2410_DMA_DCON, tmp);
-#endif
-
-       /* should stop do this, or should we wait for flush? */
-       chan->state      = S3C2410_DMA_IDLE;
-       chan->load_state = S3C2410_DMALOAD_NONE;
-
-       local_irq_restore(flags);
-
-       return 0;
-}
+#if defined(CONFIG_CPU_S3C2410)
+static struct sysdev_driver s3c2410_dma_driver = {
+       .add    = s3c2410_dma_add,
+};
 
-void s3c2410_dma_waitforstop(struct s3c2410_dma_chan *chan)
+static int __init s3c2410_dma_drvinit(void)
 {
-       unsigned long tmp;
-       unsigned int timeout = 0x10000;
-
-       while (timeout-- > 0) {
-               tmp = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
-
-               if (!(tmp & S3C2410_DMASKTRIG_ON))
-                       return;
-       }
-
-       pr_debug("dma%d: failed to stop?\n", chan->number);
+       return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_dma_driver);
 }
 
-
-/* s3c2410_dma_flush
- *
- * stop the channel, and remove all current and pending transfers
-*/
-
-static int s3c2410_dma_flush(struct s3c2410_dma_chan *chan)
-{
-       struct s3c2410_dma_buf *buf, *next;
-       unsigned long flags;
-
-       pr_debug("%s: chan %p (%d)\n", __FUNCTION__, chan, chan->number);
-
-       dbg_showchan(chan);
-
-       local_irq_save(flags);
-
-       if (chan->state != S3C2410_DMA_IDLE) {
-               pr_debug("%s: stopping channel...\n", __FUNCTION__ );
-               s3c2410_dma_ctrl(chan->number, S3C2410_DMAOP_STOP);
-       }
-
-       buf = chan->curr;
-       if (buf == NULL)
-               buf = chan->next;
-
-       chan->curr = chan->next = chan->end = NULL;
-
-       if (buf != NULL) {
-               for ( ; buf != NULL; buf = next) {
-                       next = buf->next;
-
-                       pr_debug("%s: free buffer %p, next %p\n",
-                              __FUNCTION__, buf, buf->next);
-
-                       s3c2410_dma_buffdone(chan, buf, S3C2410_RES_ABORT);
-                       s3c2410_dma_freebuf(buf);
-               }
-       }
-
-       dbg_showregs(chan);
-
-       s3c2410_dma_waitforstop(chan);
-
-#if 0
-       /* should also clear interrupts, according to WinCE BSP */
-       {
-               unsigned long tmp;
-
-               tmp = dma_rdreg(chan, S3C2410_DMA_DCON);
-               tmp |= S3C2410_DCON_NORELOAD;
-               dma_wrreg(chan, S3C2410_DMA_DCON, tmp);
-       }
+arch_initcall(s3c2410_dma_drvinit);
 #endif
 
-       dbg_showregs(chan);
-
-       local_irq_restore(flags);
-
-       return 0;
-}
-
-int
-s3c2410_dma_started(struct s3c2410_dma_chan *chan)
-{
-       unsigned long flags;
-
-       local_irq_save(flags);
-
-       dbg_showchan(chan);
-
-       /* if we've only loaded one buffer onto the channel, then chec
-        * to see if we have another, and if so, try and load it so when
-        * the first buffer is finished, the new one will be loaded onto
-        * the channel */
-
-       if (chan->next != NULL) {
-               if (chan->load_state == S3C2410_DMALOAD_1LOADED) {
-
-                       if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
-                               pr_debug("%s: buff not yet loaded, no more todo\n",
-                                        __FUNCTION__);
-                       } else {
-                               chan->load_state = S3C2410_DMALOAD_1RUNNING;
-                               s3c2410_dma_loadbuffer(chan, chan->next);
-                       }
-
-               } else if (chan->load_state == S3C2410_DMALOAD_1RUNNING) {
-                       s3c2410_dma_loadbuffer(chan, chan->next);
-               }
-       }
-
-
-       local_irq_restore(flags);
-
-       return 0;
-
-}
-
-int
-s3c2410_dma_ctrl(dmach_t channel, enum s3c2410_chan_op op)
-{
-       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
-
-       if (chan == NULL)
-               return -EINVAL;
-
-       switch (op) {
-       case S3C2410_DMAOP_START:
-               return s3c2410_dma_start(chan);
-
-       case S3C2410_DMAOP_STOP:
-               return s3c2410_dma_dostop(chan);
-
-       case S3C2410_DMAOP_PAUSE:
-       case S3C2410_DMAOP_RESUME:
-               return -ENOENT;
-
-       case S3C2410_DMAOP_FLUSH:
-               return s3c2410_dma_flush(chan);
-
-       case S3C2410_DMAOP_STARTED:
-               return s3c2410_dma_started(chan);
-
-       case S3C2410_DMAOP_TIMEOUT:
-               return 0;
-
-       }
-
-       return -ENOENT;      /* unknown, don't bother */
-}
-
-EXPORT_SYMBOL(s3c2410_dma_ctrl);
-
-/* DMA configuration for each channel
- *
- * DISRCC -> source of the DMA (AHB,APB)
- * DISRC  -> source address of the DMA
- * DIDSTC -> destination of the DMA (AHB,APD)
- * DIDST  -> destination address of the DMA
-*/
-
-/* s3c2410_dma_config
- *
- * xfersize:     size of unit in bytes (1,2,4)
- * dcon:         base value of the DCONx register
-*/
-
-int s3c2410_dma_config(dmach_t channel,
-                      int xferunit,
-                      int dcon)
-{
-       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
-
-       pr_debug("%s: chan=%d, xfer_unit=%d, dcon=%08x\n",
-                __FUNCTION__, channel, xferunit, dcon);
-
-       if (chan == NULL)
-               return -EINVAL;
-
-       pr_debug("%s: Initial dcon is %08x\n", __FUNCTION__, dcon);
-
-       dcon |= chan->dcon & dma_sel.dcon_mask;
-
-       pr_debug("%s: New dcon is %08x\n", __FUNCTION__, dcon);
-
-       switch (xferunit) {
-       case 1:
-               dcon |= S3C2410_DCON_BYTE;
-               break;
-
-       case 2:
-               dcon |= S3C2410_DCON_HALFWORD;
-               break;
-
-       case 4:
-               dcon |= S3C2410_DCON_WORD;
-               break;
-
-       default:
-               pr_debug("%s: bad transfer size %d\n", __FUNCTION__, xferunit);
-               return -EINVAL;
-       }
-
-       dcon |= S3C2410_DCON_HWTRIG;
-       dcon |= S3C2410_DCON_INTREQ;
-
-       pr_debug("%s: dcon now %08x\n", __FUNCTION__, dcon);
-
-       chan->dcon = dcon;
-       chan->xfer_unit = xferunit;
-
-       return 0;
-}
-
-EXPORT_SYMBOL(s3c2410_dma_config);
-
-int s3c2410_dma_setflags(dmach_t channel, unsigned int flags)
-{
-       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
-
-       if (chan == NULL)
-               return -EINVAL;
-
-       pr_debug("%s: chan=%p, flags=%08x\n", __FUNCTION__, chan, flags);
-
-       chan->flags = flags;
-
-       return 0;
-}
-
-EXPORT_SYMBOL(s3c2410_dma_setflags);
-
-
-/* do we need to protect the settings of the fields from
- * irq?
-*/
-
-int s3c2410_dma_set_opfn(dmach_t channel, s3c2410_dma_opfn_t rtn)
-{
-       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
-
-       if (chan == NULL)
-               return -EINVAL;
-
-       pr_debug("%s: chan=%p, op rtn=%p\n", __FUNCTION__, chan, rtn);
-
-       chan->op_fn = rtn;
-
-       return 0;
-}
-
-EXPORT_SYMBOL(s3c2410_dma_set_opfn);
-
-int s3c2410_dma_set_buffdone_fn(dmach_t channel, s3c2410_dma_cbfn_t rtn)
-{
-       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
-
-       if (chan == NULL)
-               return -EINVAL;
-
-       pr_debug("%s: chan=%p, callback rtn=%p\n", __FUNCTION__, chan, rtn);
-
-       chan->callback_fn = rtn;
-
-       return 0;
-}
-
-EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn);
-
-/* s3c2410_dma_devconfig
- *
- * configure the dma source/destination hardware type and address
- *
- * source:    S3C2410_DMASRC_HW: source is hardware
- *            S3C2410_DMASRC_MEM: source is memory
- *
- * hwcfg:     the value for xxxSTCn register,
- *            bit 0: 0=increment pointer, 1=leave pointer
- *            bit 1: 0=soucre is AHB, 1=soucre is APB
- *
- * devaddr:   physical address of the source
-*/
-
-int s3c2410_dma_devconfig(int channel,
-                         enum s3c2410_dmasrc source,
-                         int hwcfg,
-                         unsigned long devaddr)
-{
-       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
-
-       if (chan == NULL)
-               return -EINVAL;
-
-       pr_debug("%s: source=%d, hwcfg=%08x, devaddr=%08lx\n",
-                __FUNCTION__, (int)source, hwcfg, devaddr);
-
-       chan->source = source;
-       chan->dev_addr = devaddr;
-
-       switch (source) {
-       case S3C2410_DMASRC_HW:
-               /* source is hardware */
-               pr_debug("%s: hw source, devaddr=%08lx, hwcfg=%d\n",
-                        __FUNCTION__, devaddr, hwcfg);
-               dma_wrreg(chan, S3C2410_DMA_DISRCC, hwcfg & 3);
-               dma_wrreg(chan, S3C2410_DMA_DISRC,  devaddr);
-               dma_wrreg(chan, S3C2410_DMA_DIDSTC, (0<<1) | (0<<0));
-
-               chan->addr_reg = dma_regaddr(chan, S3C2410_DMA_DIDST);
-               return 0;
-
-       case S3C2410_DMASRC_MEM:
-               /* source is memory */
-               pr_debug( "%s: mem source, devaddr=%08lx, hwcfg=%d\n",
-                         __FUNCTION__, devaddr, hwcfg);
-               dma_wrreg(chan, S3C2410_DMA_DISRCC, (0<<1) | (0<<0));
-               dma_wrreg(chan, S3C2410_DMA_DIDST,  devaddr);
-               dma_wrreg(chan, S3C2410_DMA_DIDSTC, hwcfg & 3);
-
-               chan->addr_reg = dma_regaddr(chan, S3C2410_DMA_DISRC);
-               return 0;
-       }
-
-       printk(KERN_ERR "dma%d: invalid source type (%d)\n", channel, source);
-       return -EINVAL;
-}
-
-EXPORT_SYMBOL(s3c2410_dma_devconfig);
-
-/* s3c2410_dma_getposition
- *
- * returns the current transfer points for the dma source and destination
-*/
-
-int s3c2410_dma_getposition(dmach_t channel, dma_addr_t *src, dma_addr_t *dst)
-{
-       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
-
-       if (chan == NULL)
-               return -EINVAL;
-
-       if (src != NULL)
-               *src = dma_rdreg(chan, S3C2410_DMA_DCSRC);
-
-       if (dst != NULL)
-               *dst = dma_rdreg(chan, S3C2410_DMA_DCDST);
-
-       return 0;
-}
-
-EXPORT_SYMBOL(s3c2410_dma_getposition);
-
-
-/* system device class */
-
-#ifdef CONFIG_PM
-
-static int s3c2410_dma_suspend(struct sys_device *dev, pm_message_t state)
-{
-       struct s3c2410_dma_chan *cp = container_of(dev, struct s3c2410_dma_chan, dev);
-
-       printk(KERN_DEBUG "suspending dma channel %d\n", cp->number);
-
-       if (dma_rdreg(cp, S3C2410_DMA_DMASKTRIG) & S3C2410_DMASKTRIG_ON) {
-               /* the dma channel is still working, which is probably
-                * a bad thing to do over suspend/resume. We stop the
-                * channel and assume that the client is either going to
-                * retry after resume, or that it is broken.
-                */
-
-               printk(KERN_INFO "dma: stopping channel %d due to suspend\n",
-                      cp->number);
-
-               s3c2410_dma_dostop(cp);
-       }
-
-       return 0;
-}
-
-static int s3c2410_dma_resume(struct sys_device *dev)
-{
-       return 0;
-}
-
-#else
-#define s3c2410_dma_suspend NULL
-#define s3c2410_dma_resume  NULL
-#endif /* CONFIG_PM */
-
-struct sysdev_class dma_sysclass = {
-       set_kset_name("s3c24xx-dma"),
-       .suspend        = s3c2410_dma_suspend,
-       .resume         = s3c2410_dma_resume,
+#if defined(CONFIG_CPU_S3C2442)
+/* S3C2442 DMA contains the same selection table as the S3C2410 */
+static struct sysdev_driver s3c2442_dma_driver = {
+       .add    = s3c2410_dma_add,
 };
 
-/* kmem cache implementation */
-
-static void s3c2410_dma_cache_ctor(void *p, struct kmem_cache *c, unsigned long f)
-{
-       memset(p, 0, sizeof(struct s3c2410_dma_buf));
-}
-
-/* initialisation code */
-
-static int __init s3c2410_init_dma(void)
-{
-       struct s3c2410_dma_chan *cp;
-       int channel;
-       int ret;
-
-       printk("S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics\n");
-
-       dma_base = ioremap(S3C24XX_PA_DMA, 0x200);
-       if (dma_base == NULL) {
-               printk(KERN_ERR "dma failed to remap register block\n");
-               return -ENOMEM;
-       }
-
-       printk("Registering sysclass\n");
-
-       ret = sysdev_class_register(&dma_sysclass);
-       if (ret != 0) {
-               printk(KERN_ERR "dma sysclass registration failed\n");
-               goto err;
-       }
-
-       dma_kmem = kmem_cache_create("dma_desc", sizeof(struct s3c2410_dma_buf), 0,
-                                    SLAB_HWCACHE_ALIGN,
-                                    s3c2410_dma_cache_ctor, NULL);
-
-       if (dma_kmem == NULL) {
-               printk(KERN_ERR "dma failed to make kmem cache\n");
-               ret = -ENOMEM;
-               goto err;
-       }
-
-       for (channel = 0; channel < S3C2410_DMA_CHANNELS; channel++) {
-               cp = &s3c2410_chans[channel];
-
-               memset(cp, 0, sizeof(struct s3c2410_dma_chan));
-
-               /* dma channel irqs are in order.. */
-               cp->number = channel;
-               cp->irq    = channel + IRQ_DMA0;
-               cp->regs   = dma_base + (channel*0x40);
-
-               /* point current stats somewhere */
-               cp->stats  = &cp->stats_store;
-               cp->stats_store.timeout_shortest = LONG_MAX;
-
-               /* basic channel configuration */
-
-               cp->load_timeout = 1<<18;
-
-               /* register system device */
-
-               cp->dev.cls = &dma_sysclass;
-               cp->dev.id  = channel;
-               ret = sysdev_register(&cp->dev);
-
-               printk("DMA channel %d at %p, irq %d\n",
-                      cp->number, cp->regs, cp->irq);
-       }
-
-       return 0;
-
- err:
-       kmem_cache_destroy(dma_kmem);
-       iounmap(dma_base);
-       dma_base = NULL;
-       return ret;
-}
-
-core_initcall(s3c2410_init_dma);
-
-static inline int is_channel_valid(unsigned int channel)
+static int __init s3c2442_dma_drvinit(void)
 {
-       return (channel & DMA_CH_VALID);
+       return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_dma_driver);
 }
 
-/* s3c2410_dma_map_channel()
- *
- * turn the virtual channel number into a real, and un-used hardware
- * channel.
- *
- * currently this code uses first-free channel from the specified harware
- * map, not taking into account anything that the board setup code may
- * have to say about the likely peripheral set to be in use.
-*/
-
-struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel)
-{
-       struct s3c24xx_dma_map *ch_map;
-       struct s3c2410_dma_chan *dmach;
-       int ch;
-
-       if (dma_sel.map == NULL || channel > dma_sel.map_size)
-               return NULL;
-
-       ch_map = dma_sel.map + channel;
-
-       for (ch = 0; ch < S3C2410_DMA_CHANNELS; ch++) {
-               if (!is_channel_valid(ch_map->channels[ch]))
-                       continue;
-
-               if (s3c2410_chans[ch].in_use == 0) {
-                       printk("mapped channel %d to %d\n", channel, ch);
-                       break;
-               }
-       }
-
-       if (ch >= S3C2410_DMA_CHANNELS)
-               return NULL;
-
-       /* update our channel mapping */
-
-       dmach = &s3c2410_chans[ch];
-       dma_chan_map[channel] = dmach;
-
-       /* select the channel */
-
-       (dma_sel.select)(dmach, ch_map);
-
-       return dmach;
-}
-
-static void s3c24xx_dma_show_ch(struct s3c24xx_dma_map *map, int ch)
-{
-       /* show the channel configuration */
-
-       printk("%2d: %20s, channels %c%c%c%c\n", ch, map->name,
-              (is_channel_valid(map->channels[0]) ? '0' : '-'),
-              (is_channel_valid(map->channels[1]) ? '1' : '-'),
-              (is_channel_valid(map->channels[2]) ? '2' : '-'),
-              (is_channel_valid(map->channels[3]) ? '3' : '-'));
-}
-
-static int s3c24xx_dma_check_entry(struct s3c24xx_dma_map *map, int ch)
-{
-       if (1)
-               s3c24xx_dma_show_ch(map, ch);
-
-       return 0;
-}
-
-int __init s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel)
-{
-       struct s3c24xx_dma_map *nmap;
-       size_t map_sz = sizeof(*nmap) * sel->map_size;
-       int ptr;
-
-       nmap = kmalloc(map_sz, GFP_KERNEL);
-       if (nmap == NULL)
-               return -ENOMEM;
-
-       memcpy(nmap, sel->map, map_sz);
-       memcpy(&dma_sel, sel, sizeof(*sel));
-
-       dma_sel.map = nmap;
-
-       for (ptr = 0; ptr < sel->map_size; ptr++)
-               s3c24xx_dma_check_entry(nmap+ptr, ptr);
+arch_initcall(s3c2442_dma_drvinit);
+#endif
 
-       return 0;
-}
diff --git a/arch/arm/mach-s3c2410/dma.h b/arch/arm/mach-s3c2410/dma.h
deleted file mode 100644 (file)
index 0ebfe0a..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* arch/arm/mach-s3c2410/dma.h
- *
- * Copyright (C) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Samsung S3C24XX DMA support
- *
- * 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.
-*/
-
-extern struct sysdev_class dma_sysclass;
-extern struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS];
-
-#define DMA_CH_VALID           (1<<31)
-
-struct s3c24xx_dma_addr {
-       unsigned long           from;
-       unsigned long           to;
-};
-
-/* struct s3c24xx_dma_map
- *
- * this holds the mapping information for the channel selected
- * to be connected to the specified device
-*/
-
-struct s3c24xx_dma_map {
-       const char              *name;
-       struct s3c24xx_dma_addr  hw_addr;
-
-       unsigned long            channels[S3C2410_DMA_CHANNELS];
-};
-
-struct s3c24xx_dma_selection {
-       struct s3c24xx_dma_map  *map;
-       unsigned long            map_size;
-       unsigned long            dcon_mask;
-
-       void    (*select)(struct s3c2410_dma_chan *chan,
-                         struct s3c24xx_dma_map *map);
-};
-
-extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel);
index f6fb215bb48c2a7d6f5dc108cc1ffe70ccd532c3..01e795d1146eec85691ff1d1f41495e94108a5bf 100644 (file)
@@ -1,9 +1,9 @@
 /* linux/arch/arm/mach-s3c2410/gpio.c
  *
- * Copyright (c) 2004-2005 Simtec Electronics
+ * Copyright (c) 2004-2006 Simtec Electronics
  *     Ben Dooks <ben@simtec.co.uk>
  *
- * S3C24XX GPIO support
+ * S3C2410 GPIO 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
@@ -18,8 +18,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
+ */
 
 #include <linux/kernel.h>
 #include <linux/init.h>
 
 #include <asm/arch/regs-gpio.h>
 
-void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function)
-{
-       void __iomem *base = S3C24XX_GPIO_BASE(pin);
-       unsigned long mask;
-       unsigned long con;
-       unsigned long flags;
-
-       if (pin < S3C2410_GPIO_BANKB) {
-               mask = 1 << S3C2410_GPIO_OFFSET(pin);
-       } else {
-               mask = 3 << S3C2410_GPIO_OFFSET(pin)*2;
-       }
-
-       switch (function) {
-       case S3C2410_GPIO_LEAVE:
-               mask = 0;
-               function = 0;
-               break;
-
-       case S3C2410_GPIO_INPUT:
-       case S3C2410_GPIO_OUTPUT:
-       case S3C2410_GPIO_SFN2:
-       case S3C2410_GPIO_SFN3:
-               if (pin < S3C2410_GPIO_BANKB) {
-                       function -= 1;
-                       function &= 1;
-                       function <<= S3C2410_GPIO_OFFSET(pin);
-               } else {
-                       function &= 3;
-                       function <<= S3C2410_GPIO_OFFSET(pin)*2;
-               }
-       }
-
-       /* modify the specified register wwith IRQs off */
-
-       local_irq_save(flags);
-
-       con  = __raw_readl(base + 0x00);
-       con &= ~mask;
-       con |= function;
-
-       __raw_writel(con, base + 0x00);
-
-       local_irq_restore(flags);
-}
-
-EXPORT_SYMBOL(s3c2410_gpio_cfgpin);
-
-unsigned int s3c2410_gpio_getcfg(unsigned int pin)
-{
-       void __iomem *base = S3C24XX_GPIO_BASE(pin);
-       unsigned long val = __raw_readl(base);
-
-       if (pin < S3C2410_GPIO_BANKB) {
-               val >>= S3C2410_GPIO_OFFSET(pin);
-               val &= 1;
-               val += 1;
-       } else {
-               val >>= S3C2410_GPIO_OFFSET(pin)*2;
-               val &= 3;
-       }
-
-       return val | S3C2410_GPIO_INPUT;
-}
-
-EXPORT_SYMBOL(s3c2410_gpio_getcfg);
-
-void s3c2410_gpio_pullup(unsigned int pin, unsigned int to)
+int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
+                          unsigned int config)
 {
-       void __iomem *base = S3C24XX_GPIO_BASE(pin);
-       unsigned long offs = S3C2410_GPIO_OFFSET(pin);
+       void __iomem *reg = S3C24XX_EINFLT0;
        unsigned long flags;
-       unsigned long up;
-
-       if (pin < S3C2410_GPIO_BANKB)
-               return;
-
-       local_irq_save(flags);
-
-       up = __raw_readl(base + 0x08);
-       up &= ~(1L << offs);
-       up |= to << offs;
-       __raw_writel(up, base + 0x08);
+       unsigned long val;
 
-       local_irq_restore(flags);
-}
+       if (pin < S3C2410_GPG8 || pin > S3C2410_GPG15)
+               return -1;
 
-EXPORT_SYMBOL(s3c2410_gpio_pullup);
+       config &= 0xff;
 
-void s3c2410_gpio_setpin(unsigned int pin, unsigned int to)
-{
-       void __iomem *base = S3C24XX_GPIO_BASE(pin);
-       unsigned long offs = S3C2410_GPIO_OFFSET(pin);
-       unsigned long flags;
-       unsigned long dat;
+       pin -= S3C2410_GPG8;
+       reg += pin & ~3;
 
        local_irq_save(flags);
 
-       dat = __raw_readl(base + 0x04);
-       dat &= ~(1 << offs);
-       dat |= to << offs;
-       __raw_writel(dat, base + 0x04);
-
-       local_irq_restore(flags);
-}
-
-EXPORT_SYMBOL(s3c2410_gpio_setpin);
-
-unsigned int s3c2410_gpio_getpin(unsigned int pin)
-{
-       void __iomem *base = S3C24XX_GPIO_BASE(pin);
-       unsigned long offs = S3C2410_GPIO_OFFSET(pin);
+       /* update filter width and clock source */
 
-       return __raw_readl(base + 0x04) & (1<< offs);
-}
+       val = __raw_readl(reg);
+       val &= ~(0xff << ((pin & 3) * 8));
+       val |= config << ((pin & 3) * 8);
+       __raw_writel(val, reg);
 
-EXPORT_SYMBOL(s3c2410_gpio_getpin);
+       /* update filter enable */
 
-unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change)
-{
-       unsigned long flags;
-       unsigned long misccr;
+       val = __raw_readl(S3C24XX_EXTINT2);
+       val &= ~(1 << ((pin * 4) + 3));
+       val |= on << ((pin * 4) + 3);
+       __raw_writel(val, S3C24XX_EXTINT2);
 
-       local_irq_save(flags);
-       misccr = __raw_readl(S3C24XX_MISCCR);
-       misccr &= ~clear;
-       misccr ^= change;
-       __raw_writel(misccr, S3C24XX_MISCCR);
        local_irq_restore(flags);
 
-       return misccr;
-}
-
-EXPORT_SYMBOL(s3c2410_modify_misccr);
-
-int s3c2410_gpio_getirq(unsigned int pin)
-{
-       if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15)
-               return -1;      /* not valid interrupts */
-
-       if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7)
-               return -1;      /* not valid pin */
-
-       if (pin < S3C2410_GPF4)
-               return (pin - S3C2410_GPF0) + IRQ_EINT0;
-
-       if (pin < S3C2410_GPG0)
-               return (pin - S3C2410_GPF4) + IRQ_EINT4;
-
-       return (pin - S3C2410_GPG0) + IRQ_EINT8;
+       return 0;
 }
 
-EXPORT_SYMBOL(s3c2410_gpio_getirq);
+EXPORT_SYMBOL(s3c2410_gpio_irqfilter);
index 3c0ed7871c55dc51c0c4dbf41a7a0d4e92fbb70f..53cbdaa43ac666a0d4ab5f2e05531c71910095ea 100644 (file)
@@ -1,6 +1,6 @@
 /* linux/arch/arm/mach-s3c2410/irq.c
  *
- * Copyright (c) 2003,2004 Simtec Electronics
+ * Copyright (c) 2006 Simtec Electronics
  *     Ben Dooks <ben@simtec.co.uk>
  *
  * This program is free software; you can redistribute it and/or modify
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * Changelog:
- *
- *   22-Jul-2004  Ben Dooks <ben@simtec.co.uk>
- *                Fixed compile warnings
- *
- *   22-Jul-2004  Roc Wu <cooloney@yahoo.com.cn>
- *                Fixed s3c_extirq_type
- *
- *   21-Jul-2004  Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
- *                Addition of ADC/TC demux
- *
- *   04-Oct-2004  Klaus Fetscher <k.fetscher@fetron.de>
- *               Fix for set_irq_type() on low EINT numbers
- *
- *   05-Oct-2004  Ben Dooks <ben@simtec.co.uk>
- *               Tidy up KF's patch and sort out new release
- *
- *   05-Oct-2004  Ben Dooks <ben@simtec.co.uk>
- *               Add support for power management controls
- *
- *   04-Nov-2004  Ben Dooks
- *               Fix standard IRQ wake for EINT0..4 and RTC
- *
- *   22-Feb-2005  Ben Dooks
- *               Fixed edge-triggering on ADC IRQ
- *
- *   28-Jun-2005  Ben Dooks
- *               Mark IRQ_LCD valid
- *
- *   25-Jul-2005  Ben Dooks
- *               Split the S3C2440 IRQ code to seperate file
 */
 
 #include <linux/init.h>
 #include <linux/ptrace.h>
 #include <linux/sysdev.h>
 
-#include <asm/hardware.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-#include <asm/mach/irq.h>
-
-#include <asm/arch/regs-irq.h>
-#include <asm/arch/regs-gpio.h>
-
-#include "cpu.h"
-#include "pm.h"
-#include "irq.h"
-
-/* wakeup irq control */
-
-#ifdef CONFIG_PM
-
-/* state for IRQs over sleep */
-
-/* default is to allow for EINT0..EINT15, and IRQ_RTC as wakeup sources
- *
- * set bit to 1 in allow bitfield to enable the wakeup settings on it
-*/
-
-unsigned long s3c_irqwake_intallow     = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL;
-unsigned long s3c_irqwake_intmask      = 0xffffffffL;
-unsigned long s3c_irqwake_eintallow    = 0x0000fff0L;
-unsigned long s3c_irqwake_eintmask     = 0xffffffffL;
-
-int
-s3c_irq_wake(unsigned int irqno, unsigned int state)
-{
-       unsigned long irqbit = 1 << (irqno - IRQ_EINT0);
-
-       if (!(s3c_irqwake_intallow & irqbit))
-               return -ENOENT;
-
-       printk(KERN_INFO "wake %s for irq %d\n",
-              state ? "enabled" : "disabled", irqno);
-
-       if (!state)
-               s3c_irqwake_intmask |= irqbit;
-       else
-               s3c_irqwake_intmask &= ~irqbit;
-
-       return 0;
-}
-
-static int
-s3c_irqext_wake(unsigned int irqno, unsigned int state)
-{
-       unsigned long bit = 1L << (irqno - EXTINT_OFF);
-
-       if (!(s3c_irqwake_eintallow & bit))
-               return -ENOENT;
-
-       printk(KERN_INFO "wake %s for irq %d\n",
-              state ? "enabled" : "disabled", irqno);
-
-       if (!state)
-               s3c_irqwake_eintmask |= bit;
-       else
-               s3c_irqwake_eintmask &= ~bit;
-
-       return 0;
-}
-
-#else
-#define s3c_irqext_wake NULL
-#define s3c_irq_wake NULL
-#endif
-
-
-static void
-s3c_irq_mask(unsigned int irqno)
-{
-       unsigned long mask;
-
-       irqno -= IRQ_EINT0;
-
-       mask = __raw_readl(S3C2410_INTMSK);
-       mask |= 1UL << irqno;
-       __raw_writel(mask, S3C2410_INTMSK);
-}
-
-static inline void
-s3c_irq_ack(unsigned int irqno)
-{
-       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
-
-       __raw_writel(bitval, S3C2410_SRCPND);
-       __raw_writel(bitval, S3C2410_INTPND);
-}
-
-static inline void
-s3c_irq_maskack(unsigned int irqno)
-{
-       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
-       unsigned long mask;
-
-       mask = __raw_readl(S3C2410_INTMSK);
-       __raw_writel(mask|bitval, S3C2410_INTMSK);
-
-       __raw_writel(bitval, S3C2410_SRCPND);
-       __raw_writel(bitval, S3C2410_INTPND);
-}
-
-
-static void
-s3c_irq_unmask(unsigned int irqno)
-{
-       unsigned long mask;
-
-       if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23)
-               irqdbf2("s3c_irq_unmask %d\n", irqno);
-
-       irqno -= IRQ_EINT0;
-
-       mask = __raw_readl(S3C2410_INTMSK);
-       mask &= ~(1UL << irqno);
-       __raw_writel(mask, S3C2410_INTMSK);
-}
-
-struct irq_chip s3c_irq_level_chip = {
-       .name           = "s3c-level",
-       .ack            = s3c_irq_maskack,
-       .mask           = s3c_irq_mask,
-       .unmask         = s3c_irq_unmask,
-       .set_wake       = s3c_irq_wake
-};
-
-static struct irq_chip s3c_irq_chip = {
-       .name           = "s3c",
-       .ack            = s3c_irq_ack,
-       .mask           = s3c_irq_mask,
-       .unmask         = s3c_irq_unmask,
-       .set_wake       = s3c_irq_wake
-};
-
-static void
-s3c_irqext_mask(unsigned int irqno)
-{
-       unsigned long mask;
-
-       irqno -= EXTINT_OFF;
-
-       mask = __raw_readl(S3C24XX_EINTMASK);
-       mask |= ( 1UL << irqno);
-       __raw_writel(mask, S3C24XX_EINTMASK);
-}
-
-static void
-s3c_irqext_ack(unsigned int irqno)
-{
-       unsigned long req;
-       unsigned long bit;
-       unsigned long mask;
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
 
-       bit = 1UL << (irqno - EXTINT_OFF);
-
-       mask = __raw_readl(S3C24XX_EINTMASK);
-
-       __raw_writel(bit, S3C24XX_EINTPEND);
-
-       req = __raw_readl(S3C24XX_EINTPEND);
-       req &= ~mask;
-
-       /* not sure if we should be acking the parent irq... */
-
-       if (irqno <= IRQ_EINT7 ) {
-               if ((req & 0xf0) == 0)
-                       s3c_irq_ack(IRQ_EINT4t7);
-       } else {
-               if ((req >> 8) == 0)
-                       s3c_irq_ack(IRQ_EINT8t23);
-       }
-}
-
-static void
-s3c_irqext_unmask(unsigned int irqno)
+static int s3c2410_irq_add(struct sys_device *sysdev)
 {
-       unsigned long mask;
-
-       irqno -= EXTINT_OFF;
-
-       mask = __raw_readl(S3C24XX_EINTMASK);
-       mask &= ~( 1UL << irqno);
-       __raw_writel(mask, S3C24XX_EINTMASK);
-}
-
-int
-s3c_irqext_type(unsigned int irq, unsigned int type)
-{
-       void __iomem *extint_reg;
-       void __iomem *gpcon_reg;
-       unsigned long gpcon_offset, extint_offset;
-       unsigned long newvalue = 0, value;
-
-       if ((irq >= IRQ_EINT0) && (irq <= IRQ_EINT3))
-       {
-               gpcon_reg = S3C2410_GPFCON;
-               extint_reg = S3C24XX_EXTINT0;
-               gpcon_offset = (irq - IRQ_EINT0) * 2;
-               extint_offset = (irq - IRQ_EINT0) * 4;
-       }
-       else if ((irq >= IRQ_EINT4) && (irq <= IRQ_EINT7))
-       {
-               gpcon_reg = S3C2410_GPFCON;
-               extint_reg = S3C24XX_EXTINT0;
-               gpcon_offset = (irq - (EXTINT_OFF)) * 2;
-               extint_offset = (irq - (EXTINT_OFF)) * 4;
-       }
-       else if ((irq >= IRQ_EINT8) && (irq <= IRQ_EINT15))
-       {
-               gpcon_reg = S3C2410_GPGCON;
-               extint_reg = S3C24XX_EXTINT1;
-               gpcon_offset = (irq - IRQ_EINT8) * 2;
-               extint_offset = (irq - IRQ_EINT8) * 4;
-       }
-       else if ((irq >= IRQ_EINT16) && (irq <= IRQ_EINT23))
-       {
-               gpcon_reg = S3C2410_GPGCON;
-               extint_reg = S3C24XX_EXTINT2;
-               gpcon_offset = (irq - IRQ_EINT8) * 2;
-               extint_offset = (irq - IRQ_EINT16) * 4;
-       } else
-               return -1;
-
-       /* Set the GPIO to external interrupt mode */
-       value = __raw_readl(gpcon_reg);
-       value = (value & ~(3 << gpcon_offset)) | (0x02 << gpcon_offset);
-       __raw_writel(value, gpcon_reg);
-
-       /* Set the external interrupt to pointed trigger type */
-       switch (type)
-       {
-               case IRQT_NOEDGE:
-                       printk(KERN_WARNING "No edge setting!\n");
-                       break;
-
-               case IRQT_RISING:
-                       newvalue = S3C2410_EXTINT_RISEEDGE;
-                       break;
-
-               case IRQT_FALLING:
-                       newvalue = S3C2410_EXTINT_FALLEDGE;
-                       break;
-
-               case IRQT_BOTHEDGE:
-                       newvalue = S3C2410_EXTINT_BOTHEDGE;
-                       break;
-
-               case IRQT_LOW:
-                       newvalue = S3C2410_EXTINT_LOWLEV;
-                       break;
-
-               case IRQT_HIGH:
-                       newvalue = S3C2410_EXTINT_HILEV;
-                       break;
-
-               default:
-                       printk(KERN_ERR "No such irq type %d", type);
-                       return -1;
-       }
-
-       value = __raw_readl(extint_reg);
-       value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
-       __raw_writel(value, extint_reg);
-
        return 0;
 }
 
-static struct irq_chip s3c_irqext_chip = {
-       .name           = "s3c-ext",
-       .mask           = s3c_irqext_mask,
-       .unmask         = s3c_irqext_unmask,
-       .ack            = s3c_irqext_ack,
-       .set_type       = s3c_irqext_type,
-       .set_wake       = s3c_irqext_wake
-};
-
-static struct irq_chip s3c_irq_eint0t4 = {
-       .name           = "s3c-ext0",
-       .ack            = s3c_irq_ack,
-       .mask           = s3c_irq_mask,
-       .unmask         = s3c_irq_unmask,
-       .set_wake       = s3c_irq_wake,
-       .set_type       = s3c_irqext_type,
-};
-
-/* mask values for the parent registers for each of the interrupt types */
-
-#define INTMSK_UART0    (1UL << (IRQ_UART0 - IRQ_EINT0))
-#define INTMSK_UART1    (1UL << (IRQ_UART1 - IRQ_EINT0))
-#define INTMSK_UART2    (1UL << (IRQ_UART2 - IRQ_EINT0))
-#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
-
-
-/* UART0 */
-
-static void
-s3c_irq_uart0_mask(unsigned int irqno)
-{
-       s3c_irqsub_mask(irqno, INTMSK_UART0, 7);
-}
-
-static void
-s3c_irq_uart0_unmask(unsigned int irqno)
-{
-       s3c_irqsub_unmask(irqno, INTMSK_UART0);
-}
-
-static void
-s3c_irq_uart0_ack(unsigned int irqno)
-{
-       s3c_irqsub_maskack(irqno, INTMSK_UART0, 7);
-}
-
-static struct irq_chip s3c_irq_uart0 = {
-       .name           = "s3c-uart0",
-       .mask           = s3c_irq_uart0_mask,
-       .unmask         = s3c_irq_uart0_unmask,
-       .ack            = s3c_irq_uart0_ack,
-};
-
-/* UART1 */
-
-static void
-s3c_irq_uart1_mask(unsigned int irqno)
-{
-       s3c_irqsub_mask(irqno, INTMSK_UART1, 7 << 3);
-}
-
-static void
-s3c_irq_uart1_unmask(unsigned int irqno)
-{
-       s3c_irqsub_unmask(irqno, INTMSK_UART1);
-}
-
-static void
-s3c_irq_uart1_ack(unsigned int irqno)
-{
-       s3c_irqsub_maskack(irqno, INTMSK_UART1, 7 << 3);
-}
-
-static struct irq_chip s3c_irq_uart1 = {
-       .name           = "s3c-uart1",
-       .mask           = s3c_irq_uart1_mask,
-       .unmask         = s3c_irq_uart1_unmask,
-       .ack            = s3c_irq_uart1_ack,
-};
-
-/* UART2 */
-
-static void
-s3c_irq_uart2_mask(unsigned int irqno)
-{
-       s3c_irqsub_mask(irqno, INTMSK_UART2, 7 << 6);
-}
-
-static void
-s3c_irq_uart2_unmask(unsigned int irqno)
-{
-       s3c_irqsub_unmask(irqno, INTMSK_UART2);
-}
-
-static void
-s3c_irq_uart2_ack(unsigned int irqno)
-{
-       s3c_irqsub_maskack(irqno, INTMSK_UART2, 7 << 6);
-}
-
-static struct irq_chip s3c_irq_uart2 = {
-       .name           = "s3c-uart2",
-       .mask           = s3c_irq_uart2_mask,
-       .unmask         = s3c_irq_uart2_unmask,
-       .ack            = s3c_irq_uart2_ack,
-};
-
-/* ADC and Touchscreen */
-
-static void
-s3c_irq_adc_mask(unsigned int irqno)
-{
-       s3c_irqsub_mask(irqno, INTMSK_ADCPARENT, 3 << 9);
-}
-
-static void
-s3c_irq_adc_unmask(unsigned int irqno)
-{
-       s3c_irqsub_unmask(irqno, INTMSK_ADCPARENT);
-}
-
-static void
-s3c_irq_adc_ack(unsigned int irqno)
-{
-       s3c_irqsub_ack(irqno, INTMSK_ADCPARENT, 3 << 9);
-}
-
-static struct irq_chip s3c_irq_adc = {
-       .name           = "s3c-adc",
-       .mask           = s3c_irq_adc_mask,
-       .unmask         = s3c_irq_adc_unmask,
-       .ack            = s3c_irq_adc_ack,
-};
-
-/* irq demux for adc */
-static void s3c_irq_demux_adc(unsigned int irq,
-                             struct irq_desc *desc)
-{
-       unsigned int subsrc, submsk;
-       unsigned int offset = 9;
-       struct irq_desc *mydesc;
-
-       /* read the current pending interrupts, and the mask
-        * for what it is available */
-
-       subsrc = __raw_readl(S3C2410_SUBSRCPND);
-       submsk = __raw_readl(S3C2410_INTSUBMSK);
-
-       subsrc &= ~submsk;
-       subsrc >>= offset;
-       subsrc &= 3;
-
-       if (subsrc != 0) {
-               if (subsrc & 1) {
-                       mydesc = irq_desc + IRQ_TC;
-                       desc_handle_irq(IRQ_TC, mydesc);
-               }
-               if (subsrc & 2) {
-                       mydesc = irq_desc + IRQ_ADC;
-                       desc_handle_irq(IRQ_ADC, mydesc);
-               }
-       }
-}
-
-static void s3c_irq_demux_uart(unsigned int start)
-{
-       unsigned int subsrc, submsk;
-       unsigned int offset = start - IRQ_S3CUART_RX0;
-       struct irq_desc *desc;
-
-       /* read the current pending interrupts, and the mask
-        * for what it is available */
-
-       subsrc = __raw_readl(S3C2410_SUBSRCPND);
-       submsk = __raw_readl(S3C2410_INTSUBMSK);
-
-       irqdbf2("s3c_irq_demux_uart: start=%d (%d), subsrc=0x%08x,0x%08x\n",
-               start, offset, subsrc, submsk);
-
-       subsrc &= ~submsk;
-       subsrc >>= offset;
-       subsrc &= 7;
-
-       if (subsrc != 0) {
-               desc = irq_desc + start;
-
-               if (subsrc & 1)
-                       desc_handle_irq(start, desc);
-
-               desc++;
-
-               if (subsrc & 2)
-                       desc_handle_irq(start+1, desc);
-
-               desc++;
-
-               if (subsrc & 4)
-                       desc_handle_irq(start+2, desc);
-       }
-}
-
-/* uart demux entry points */
-
-static void
-s3c_irq_demux_uart0(unsigned int irq,
-                   struct irq_desc *desc)
-{
-       irq = irq;
-       s3c_irq_demux_uart(IRQ_S3CUART_RX0);
-}
-
-static void
-s3c_irq_demux_uart1(unsigned int irq,
-                   struct irq_desc *desc)
-{
-       irq = irq;
-       s3c_irq_demux_uart(IRQ_S3CUART_RX1);
-}
-
-static void
-s3c_irq_demux_uart2(unsigned int irq,
-                   struct irq_desc *desc)
-{
-       irq = irq;
-       s3c_irq_demux_uart(IRQ_S3CUART_RX2);
-}
-
-static void
-s3c_irq_demux_extint8(unsigned int irq,
-                     struct irq_desc *desc)
-{
-       unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
-       unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);
-
-       eintpnd &= ~eintmsk;
-       eintpnd &= ~0xff;       /* ignore lower irqs */
-
-       /* we may as well handle all the pending IRQs here */
-
-       while (eintpnd) {
-               irq = __ffs(eintpnd);
-               eintpnd &= ~(1<<irq);
-
-               irq += (IRQ_EINT4 - 4);
-               desc_handle_irq(irq, irq_desc + irq);
-       }
-
-}
-
-static void
-s3c_irq_demux_extint4t7(unsigned int irq,
-                       struct irq_desc *desc)
-{
-       unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
-       unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);
-
-       eintpnd &= ~eintmsk;
-       eintpnd &= 0xff;        /* only lower irqs */
-
-       /* we may as well handle all the pending IRQs here */
-
-       while (eintpnd) {
-               irq = __ffs(eintpnd);
-               eintpnd &= ~(1<<irq);
-
-               irq += (IRQ_EINT4 - 4);
-
-               desc_handle_irq(irq, irq_desc + irq);
-       }
-}
-
-#ifdef CONFIG_PM
-
-static struct sleep_save irq_save[] = {
-       SAVE_ITEM(S3C2410_INTMSK),
-       SAVE_ITEM(S3C2410_INTSUBMSK),
+static struct sysdev_driver s3c2410_irq_driver = {
+       .add            = s3c2410_irq_add,
+       .suspend        = s3c24xx_irq_suspend,
+       .resume         = s3c24xx_irq_resume,
 };
 
-/* the extint values move between the s3c2410/s3c2440 and the s3c2412
- * so we use an array to hold them, and to calculate the address of
- * the register at run-time
-*/
-
-static unsigned long save_extint[3];
-static unsigned long save_eintflt[4];
-static unsigned long save_eintmask;
-
-int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state)
+static int s3c2410_irq_init(void)
 {
-       unsigned int i;
-
-       for (i = 0; i < ARRAY_SIZE(save_extint); i++)
-               save_extint[i] = __raw_readl(S3C24XX_EXTINT0 + (i*4));
-
-       for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
-               save_eintflt[i] = __raw_readl(S3C24XX_EINFLT0 + (i*4));
-
-       s3c2410_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
-       save_eintmask = __raw_readl(S3C24XX_EINTMASK);
-
-       return 0;
+       return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_irq_driver);
 }
 
-int s3c24xx_irq_resume(struct sys_device *dev)
-{
-       unsigned int i;
-
-       for (i = 0; i < ARRAY_SIZE(save_extint); i++)
-               __raw_writel(save_extint[i], S3C24XX_EXTINT0 + (i*4));
-
-       for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
-               __raw_writel(save_eintflt[i], S3C24XX_EINFLT0 + (i*4));
-
-       s3c2410_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
-       __raw_writel(save_eintmask, S3C24XX_EINTMASK);
-
-       return 0;
-}
-
-#else
-#define s3c24xx_irq_suspend NULL
-#define s3c24xx_irq_resume  NULL
-#endif
-
-/* s3c24xx_init_irq
- *
- * Initialise S3C2410 IRQ system
-*/
-
-void __init s3c24xx_init_irq(void)
-{
-       unsigned long pend;
-       unsigned long last;
-       int irqno;
-       int i;
-
-       irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");
-
-       /* first, clear all interrupts pending... */
-
-       last = 0;
-       for (i = 0; i < 4; i++) {
-               pend = __raw_readl(S3C24XX_EINTPEND);
-
-               if (pend == 0 || pend == last)
-                       break;
-
-               __raw_writel(pend, S3C24XX_EINTPEND);
-               printk("irq: clearing pending ext status %08x\n", (int)pend);
-               last = pend;
-       }
-
-       last = 0;
-       for (i = 0; i < 4; i++) {
-               pend = __raw_readl(S3C2410_INTPND);
-
-               if (pend == 0 || pend == last)
-                       break;
-
-               __raw_writel(pend, S3C2410_SRCPND);
-               __raw_writel(pend, S3C2410_INTPND);
-               printk("irq: clearing pending status %08x\n", (int)pend);
-               last = pend;
-       }
-
-       last = 0;
-       for (i = 0; i < 4; i++) {
-               pend = __raw_readl(S3C2410_SUBSRCPND);
-
-               if (pend == 0 || pend == last)
-                       break;
-
-               printk("irq: clearing subpending status %08x\n", (int)pend);
-               __raw_writel(pend, S3C2410_SUBSRCPND);
-               last = pend;
-       }
-
-       /* register the main interrupts */
-
-       irqdbf("s3c2410_init_irq: registering s3c2410 interrupt handlers\n");
-
-       for (irqno = IRQ_EINT4t7; irqno <= IRQ_ADCPARENT; irqno++) {
-               /* set all the s3c2410 internal irqs */
-
-               switch (irqno) {
-                       /* deal with the special IRQs (cascaded) */
-
-               case IRQ_EINT4t7:
-               case IRQ_EINT8t23:
-               case IRQ_UART0:
-               case IRQ_UART1:
-               case IRQ_UART2:
-               case IRQ_ADCPARENT:
-                       set_irq_chip(irqno, &s3c_irq_level_chip);
-                       set_irq_handler(irqno, handle_level_irq);
-                       break;
-
-               case IRQ_RESERVED6:
-               case IRQ_RESERVED24:
-                       /* no IRQ here */
-                       break;
-
-               default:
-                       //irqdbf("registering irq %d (s3c irq)\n", irqno);
-                       set_irq_chip(irqno, &s3c_irq_chip);
-                       set_irq_handler(irqno, handle_edge_irq);
-                       set_irq_flags(irqno, IRQF_VALID);
-               }
-       }
-
-       /* setup the cascade irq handlers */
-
-       set_irq_chained_handler(IRQ_EINT4t7, s3c_irq_demux_extint4t7);
-       set_irq_chained_handler(IRQ_EINT8t23, s3c_irq_demux_extint8);
-
-       set_irq_chained_handler(IRQ_UART0, s3c_irq_demux_uart0);
-       set_irq_chained_handler(IRQ_UART1, s3c_irq_demux_uart1);
-       set_irq_chained_handler(IRQ_UART2, s3c_irq_demux_uart2);
-       set_irq_chained_handler(IRQ_ADCPARENT, s3c_irq_demux_adc);
-
-       /* external interrupts */
-
-       for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
-               irqdbf("registering irq %d (ext int)\n", irqno);
-               set_irq_chip(irqno, &s3c_irq_eint0t4);
-               set_irq_handler(irqno, handle_edge_irq);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       for (irqno = IRQ_EINT4; irqno <= IRQ_EINT23; irqno++) {
-               irqdbf("registering irq %d (extended s3c irq)\n", irqno);
-               set_irq_chip(irqno, &s3c_irqext_chip);
-               set_irq_handler(irqno, handle_edge_irq);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       /* register the uart interrupts */
-
-       irqdbf("s3c2410: registering external interrupts\n");
-
-       for (irqno = IRQ_S3CUART_RX0; irqno <= IRQ_S3CUART_ERR0; irqno++) {
-               irqdbf("registering irq %d (s3c uart0 irq)\n", irqno);
-               set_irq_chip(irqno, &s3c_irq_uart0);
-               set_irq_handler(irqno, handle_level_irq);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       for (irqno = IRQ_S3CUART_RX1; irqno <= IRQ_S3CUART_ERR1; irqno++) {
-               irqdbf("registering irq %d (s3c uart1 irq)\n", irqno);
-               set_irq_chip(irqno, &s3c_irq_uart1);
-               set_irq_handler(irqno, handle_level_irq);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       for (irqno = IRQ_S3CUART_RX2; irqno <= IRQ_S3CUART_ERR2; irqno++) {
-               irqdbf("registering irq %d (s3c uart2 irq)\n", irqno);
-               set_irq_chip(irqno, &s3c_irq_uart2);
-               set_irq_handler(irqno, handle_level_irq);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       for (irqno = IRQ_TC; irqno <= IRQ_ADC; irqno++) {
-               irqdbf("registering irq %d (s3c adc irq)\n", irqno);
-               set_irq_chip(irqno, &s3c_irq_adc);
-               set_irq_handler(irqno, handle_edge_irq);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       irqdbf("s3c2410: registered interrupt handlers\n");
-}
+arch_initcall(s3c2410_irq_init);
diff --git a/arch/arm/mach-s3c2410/irq.h b/arch/arm/mach-s3c2410/irq.h
deleted file mode 100644 (file)
index e5913da..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/* arch/arm/mach-s3c2410/irq.h
- *
- * Copyright (c) 2004-2005 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Header file for S3C24XX CPU IRQ support
- *
- * 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 irqdbf(x...)
-#define irqdbf2(x...)
-
-#define EXTINT_OFF (IRQ_EINT4 - 4)
-
-extern struct irq_chip s3c_irq_level_chip;
-
-static inline void
-s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
-               int subcheck)
-{
-       unsigned long mask;
-       unsigned long submask;
-
-       submask = __raw_readl(S3C2410_INTSUBMSK);
-       mask = __raw_readl(S3C2410_INTMSK);
-
-       submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
-
-       /* check to see if we need to mask the parent IRQ */
-
-       if ((submask  & subcheck) == subcheck) {
-               __raw_writel(mask | parentbit, S3C2410_INTMSK);
-       }
-
-       /* write back masks */
-       __raw_writel(submask, S3C2410_INTSUBMSK);
-
-}
-
-static inline void
-s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
-{
-       unsigned long mask;
-       unsigned long submask;
-
-       submask = __raw_readl(S3C2410_INTSUBMSK);
-       mask = __raw_readl(S3C2410_INTMSK);
-
-       submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
-       mask &= ~parentbit;
-
-       /* write back masks */
-       __raw_writel(submask, S3C2410_INTSUBMSK);
-       __raw_writel(mask, S3C2410_INTMSK);
-}
-
-
-static inline void
-s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
-{
-       unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
-
-       s3c_irqsub_mask(irqno, parentmask, group);
-
-       __raw_writel(bit, S3C2410_SUBSRCPND);
-
-       /* only ack parent if we've got all the irqs (seems we must
-        * ack, all and hope that the irq system retriggers ok when
-        * the interrupt goes off again)
-        */
-
-       if (1) {
-               __raw_writel(parentmask, S3C2410_SRCPND);
-               __raw_writel(parentmask, S3C2410_INTPND);
-       }
-}
-
-static inline void
-s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
-{
-       unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
-
-       __raw_writel(bit, S3C2410_SUBSRCPND);
-
-       /* only ack parent if we've got all the irqs (seems we must
-        * ack, all and hope that the irq system retriggers ok when
-        * the interrupt goes off again)
-        */
-
-       if (1) {
-               __raw_writel(parentmask, S3C2410_SRCPND);
-               __raw_writel(parentmask, S3C2410_INTPND);
-       }
-}
-
-/* exported for use in arch/arm/mach-s3c2410 */
-
-#ifdef CONFIG_PM
-extern int s3c_irq_wake(unsigned int irqno, unsigned int state);
-#else
-#define s3c_irq_wake NULL
-#endif
-
-extern int s3c_irqext_type(unsigned int irq, unsigned int type);
index 817e2c684410bce25eeae0d383f296bad14cb644..72f2cc4fcd03b2cc901bdd02472f71ff21238809 100644 (file)
@@ -1,4 +1,4 @@
-/***********************************************************************
+/* linux/arch/arm/mach-s3c2410/mach-amlm5900.c
  *
  * linux/arch/arm/mach-s3c2410/mach-amlm5900.c
  *
@@ -35,7 +35,7 @@
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/proc_fs.h>
-
+#include <linux/serial_core.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -52,8 +52,8 @@
 #include <asm/arch/regs-lcd.h>
 #include <asm/arch/regs-gpio.h>
 
-#include "devs.h"
-#include "cpu.h"
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
 
 #ifdef CONFIG_MTD_PARTITIONS
 
@@ -113,12 +113,6 @@ static struct platform_device amlm5900_device_nor = {
 #endif
 
 static struct map_desc amlm5900_iodesc[] __initdata = {
-       {
-               .virtual        = (u32)S3C24XX_VA_SPI,
-               .pfn            = __phys_to_pfn(S3C2410_PA_SPI),
-               .length         = SZ_1M,
-               .type           = MT_DEVICE
-       }
 };
 
 #define UCON S3C2410_UCON_DEFAULT
diff --git a/arch/arm/mach-s3c2410/mach-anubis.c b/arch/arm/mach-s3c2410/mach-anubis.c
deleted file mode 100644 (file)
index 0fad0c2..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/mach-anubis.c
- *
- * Copyright (c) 2003-2005 Simtec Electronics
- *     http://armlinux.simtec.co.uk/
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <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/serial_core.h>
-#include <linux/platform_device.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/anubis-map.h>
-#include <asm/arch/anubis-irq.h>
-#include <asm/arch/anubis-cpld.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/mach-types.h>
-
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-mem.h>
-#include <asm/arch/regs-lcd.h>
-#include <asm/arch/nand.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/nand_ecc.h>
-#include <linux/mtd/partitions.h>
-
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
-
-#define COPYRIGHT ", (c) 2005 Simtec Electronics"
-
-static struct map_desc anubis_iodesc[] __initdata = {
-  /* ISA IO areas */
-
-  {
-       .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
-       .pfn            = __phys_to_pfn(0x0),
-       .length         = SZ_4M,
-       .type           = MT_DEVICE,
-  }, {
-       .virtual        = (u32)S3C24XX_VA_ISA_WORD,
-       .pfn            = __phys_to_pfn(0x0),
-       .length         = SZ_4M,
-       .type           = MT_DEVICE,
-  },
-
-  /* we could possibly compress the next set down into a set of smaller tables
-   * pagetables, but that would mean using an L2 section, and it still means
-   * we cannot actually feed the same register to an LDR due to 16K spacing
-   */
-
-  /* CPLD control registers */
-
-  {
-       .virtual        = (u32)ANUBIS_VA_CTRL1,
-       .pfn            = __phys_to_pfn(ANUBIS_PA_CTRL1),
-       .length         = SZ_4K,
-       .type           = MT_DEVICE,
-  }, {
-       .virtual        = (u32)ANUBIS_VA_CTRL2,
-       .pfn            = __phys_to_pfn(ANUBIS_PA_CTRL2),
-       .length         = SZ_4K,
-       .type           = MT_DEVICE,
-  },
-};
-
-#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
-#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
-#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
-
-static struct s3c24xx_uart_clksrc anubis_serial_clocks[] = {
-       [0] = {
-               .name           = "uclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-       [1] = {
-               .name           = "pclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       }
-};
-
-
-static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = {
-       [0] = {
-               .hwport      = 0,
-               .flags       = 0,
-               .ucon        = UCON,
-               .ulcon       = ULCON,
-               .ufcon       = UFCON,
-               .clocks      = anubis_serial_clocks,
-               .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
-       },
-       [1] = {
-               .hwport      = 2,
-               .flags       = 0,
-               .ucon        = UCON,
-               .ulcon       = ULCON,
-               .ufcon       = UFCON,
-               .clocks      = anubis_serial_clocks,
-               .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
-       },
-};
-
-/* NAND Flash on Anubis board */
-
-static int external_map[]   = { 2 };
-static int chip0_map[]      = { 0 };
-static int chip1_map[]      = { 1 };
-
-static struct mtd_partition anubis_default_nand_part[] = {
-       [0] = {
-               .name   = "Boot Agent",
-               .size   = SZ_16K,
-               .offset = 0,
-       },
-       [1] = {
-               .name   = "/boot",
-               .size   = SZ_4M - SZ_16K,
-               .offset = SZ_16K,
-       },
-       [2] = {
-               .name   = "user1",
-               .offset = SZ_4M,
-               .size   = SZ_32M - SZ_4M,
-       },
-       [3] = {
-               .name   = "user2",
-               .offset = SZ_32M,
-               .size   = MTDPART_SIZ_FULL,
-       }
-};
-
-/* the Anubis has 3 selectable slots for nand-flash, the two
- * on-board chip areas, as well as the external slot.
- *
- * Note, there is no current hot-plug support for the External
- * socket.
-*/
-
-static struct s3c2410_nand_set anubis_nand_sets[] = {
-       [1] = {
-               .name           = "External",
-               .nr_chips       = 1,
-               .nr_map         = external_map,
-               .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
-               .partitions     = anubis_default_nand_part,
-       },
-       [0] = {
-               .name           = "chip0",
-               .nr_chips       = 1,
-               .nr_map         = chip0_map,
-               .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
-               .partitions     = anubis_default_nand_part,
-       },
-       [2] = {
-               .name           = "chip1",
-               .nr_chips       = 1,
-               .nr_map         = chip1_map,
-               .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
-               .partitions     = anubis_default_nand_part,
-       },
-};
-
-static void anubis_nand_select(struct s3c2410_nand_set *set, int slot)
-{
-       unsigned int tmp;
-
-       slot = set->nr_map[slot] & 3;
-
-       pr_debug("anubis_nand: selecting slot %d (set %p,%p)\n",
-                slot, set, set->nr_map);
-
-       tmp = __raw_readb(ANUBIS_VA_CTRL1);
-       tmp &= ~ANUBIS_CTRL1_NANDSEL;
-       tmp |= slot;
-
-       pr_debug("anubis_nand: ctrl1 now %02x\n", tmp);
-
-       __raw_writeb(tmp, ANUBIS_VA_CTRL1);
-}
-
-static struct s3c2410_platform_nand anubis_nand_info = {
-       .tacls          = 25,
-       .twrph0         = 55,
-       .twrph1         = 40,
-       .nr_sets        = ARRAY_SIZE(anubis_nand_sets),
-       .sets           = anubis_nand_sets,
-       .select_chip    = anubis_nand_select,
-};
-
-/* IDE channels */
-
-static struct resource anubis_ide0_resource[] = {
-       {
-               .start  = S3C2410_CS3,
-               .end    = S3C2410_CS3 + (8*32) - 1,
-               .flags  = IORESOURCE_MEM,
-       }, {
-               .start  = S3C2410_CS3 + (1<<26),
-               .end    = S3C2410_CS3 + (1<<26) + (8*32) - 1,
-               .flags  = IORESOURCE_MEM,
-       }, {
-               .start  = IRQ_IDE0,
-               .end    = IRQ_IDE0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device anubis_device_ide0 = {
-       .name           = "simtec-ide",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(anubis_ide0_resource),
-       .resource       = anubis_ide0_resource,
-};
-
-static struct resource anubis_ide1_resource[] = {
-       {
-               .start  = S3C2410_CS4,
-               .end    = S3C2410_CS4 + (8*32) - 1,
-               .flags  = IORESOURCE_MEM,
-       }, {
-               .start  = S3C2410_CS4 + (1<<26),
-               .end    = S3C2410_CS4 + (1<<26) + (8*32) - 1,
-               .flags  = IORESOURCE_MEM,
-       }, {
-               .start  = IRQ_IDE0,
-               .end    = IRQ_IDE0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-
-static struct platform_device anubis_device_ide1 = {
-       .name           = "simtec-ide",
-       .id             = 1,
-       .num_resources  = ARRAY_SIZE(anubis_ide1_resource),
-       .resource       = anubis_ide1_resource,
-};
-
-/* Standard Anubis devices */
-
-static struct platform_device *anubis_devices[] __initdata = {
-       &s3c_device_usb,
-       &s3c_device_wdt,
-       &s3c_device_adc,
-       &s3c_device_i2c,
-       &s3c_device_rtc,
-       &s3c_device_nand,
-       &anubis_device_ide0,
-       &anubis_device_ide1,
-};
-
-static struct clk *anubis_clocks[] = {
-       &s3c24xx_dclk0,
-       &s3c24xx_dclk1,
-       &s3c24xx_clkout0,
-       &s3c24xx_clkout1,
-       &s3c24xx_uclk,
-};
-
-static struct s3c24xx_board anubis_board __initdata = {
-       .devices       = anubis_devices,
-       .devices_count = ARRAY_SIZE(anubis_devices),
-       .clocks        = anubis_clocks,
-       .clocks_count  = ARRAY_SIZE(anubis_clocks),
-};
-
-static void __init anubis_map_io(void)
-{
-       /* initialise the clocks */
-
-       s3c24xx_dclk0.parent = NULL;
-       s3c24xx_dclk0.rate   = 12*1000*1000;
-
-       s3c24xx_dclk1.parent = NULL;
-       s3c24xx_dclk1.rate   = 24*1000*1000;
-
-       s3c24xx_clkout0.parent  = &s3c24xx_dclk0;
-       s3c24xx_clkout1.parent  = &s3c24xx_dclk1;
-
-       s3c24xx_uclk.parent  = &s3c24xx_clkout1;
-
-       s3c_device_nand.dev.platform_data = &anubis_nand_info;
-
-       s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc));
-       s3c24xx_init_clocks(0);
-       s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs));
-       s3c24xx_set_board(&anubis_board);
-
-       /* ensure that the GPIO is setup */
-       s3c2410_gpio_setpin(S3C2410_GPA0, 1);
-}
-
-MACHINE_START(ANUBIS, "Simtec-Anubis")
-       /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
-       .phys_io        = S3C2410_PA_UART,
-       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
-       .boot_params    = S3C2410_SDRAM_PA + 0x100,
-       .map_io         = anubis_map_io,
-       .init_irq       = s3c24xx_init_irq,
-       .timer          = &s3c24xx_timer,
-MACHINE_END
index b8b76757ec54a70272a9107b06f5b554a50d299f..7b81296427ebc54ce28cc519575e57e23eb58a95 100644 (file)
@@ -50,9 +50,9 @@
 
 #include <linux/serial_8250.h>
 
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
 #include "usb-simtec.h"
 
 #define COPYRIGHT ", (c) 2004-2005 Simtec Electronics"
index 15b625eae499e2e13b0d3e61dea07a7963347520..01c60d0923cd49d86da8d98b31e1c4dc85ed1f41 100644 (file)
 #include <asm/mach/irq.h>
 
 #include <asm/hardware.h>
-#include <asm/hardware/iomd.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
-
 #include <asm/arch/regs-serial.h>
 #include <asm/arch/regs-lcd.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-clock.h>
 
 #include <asm/arch/h1940.h>
 #include <asm/arch/h1940-latch.h>
 #include <asm/arch/fb.h>
+#include <asm/arch/udc.h>
 
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
-#include "pm.h"
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
 
 static struct map_desc h1940_iodesc[] __initdata = {
        [0] = {
@@ -102,6 +103,32 @@ void h1940_latch_control(unsigned int clear, unsigned int set)
 
 EXPORT_SYMBOL_GPL(h1940_latch_control);
 
+static void h1940_udc_pullup(enum s3c2410_udc_cmd_e cmd)
+{
+       printk(KERN_DEBUG "udc: pullup(%d)\n",cmd);
+
+       switch (cmd)
+       {
+               case S3C2410_UDC_P_ENABLE :
+                       h1940_latch_control(0, H1940_LATCH_USB_DP);
+                       break;
+               case S3C2410_UDC_P_DISABLE :
+                       h1940_latch_control(H1940_LATCH_USB_DP, 0);
+                       break;
+               case S3C2410_UDC_P_RESET :
+                       break;
+               default:
+                       break;
+       }
+}
+
+static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = {
+       .udc_command            = h1940_udc_pullup,
+       .vbus_pin               = S3C2410_GPG5,
+       .vbus_pin_inverted      = 1,
+};
+
+
 
 /**
  * Set lcd on or off
@@ -146,12 +173,19 @@ static struct s3c2410fb_mach_info h1940_lcdcfg __initdata = {
        .bpp=           {16,16,16},
 };
 
+static struct platform_device s3c_device_leds = {
+       .name             = "h1940-leds",
+       .id               = -1,
+};
+
 static struct platform_device *h1940_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
        &s3c_device_i2c,
        &s3c_device_iis,
+       &s3c_device_usbgadget,
+       &s3c_device_leds,
 };
 
 static struct s3c24xx_board h1940_board __initdata = {
@@ -179,7 +213,23 @@ static void __init h1940_init_irq(void)
 
 static void __init h1940_init(void)
 {
+       u32 tmp;
+
        s3c24xx_fb_set_platdata(&h1940_lcdcfg);
+       s3c24xx_udc_set_platdata(&h1940_udc_cfg);
+
+       /* Turn off suspend on both USB ports, and switch the
+        * selectable USB port to USB device mode. */
+
+       s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
+                             S3C2410_MISCCR_USBSUSPND0 |
+                             S3C2410_MISCCR_USBSUSPND1, 0x0);
+
+       tmp = (
+                0x78 << S3C2410_PLLCON_MDIVSHIFT)
+             | (0x02 << S3C2410_PLLCON_PDIVSHIFT)
+             | (0x03 << S3C2410_PLLCON_SDIVSHIFT);
+       writel(tmp, S3C2410_UPLLCON);
 }
 
 MACHINE_START(H1940, "IPAQ-H1940")
@@ -189,6 +239,6 @@ MACHINE_START(H1940, "IPAQ-H1940")
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
        .map_io         = h1940_map_io,
        .init_irq       = h1940_init_irq,
-       .init_machine   = h1940_init,
+       .init_machine   = h1940_init,
        .timer          = &s3c24xx_timer,
 MACHINE_END
index 0411e9adb54d9b208682d849859a5dd16c97f08d..261aa4cc07700e509be8ee96907df184e9414307 100644 (file)
@@ -29,7 +29,6 @@
 #include <asm/mach/irq.h>
 
 #include <asm/hardware.h>
-#include <asm/hardware/iomd.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 #include <asm/arch/regs-gpio.h>
 #include <asm/arch/iic.h>
 
-#include "s3c2410.h"
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
 
 static struct map_desc n30_iodesc[] __initdata = {
        /* nothing here yet */
diff --git a/arch/arm/mach-s3c2410/mach-nexcoder.c b/arch/arm/mach-s3c2410/mach-nexcoder.c
deleted file mode 100644 (file)
index d6dfdad..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/mach-nexcoder.c
- *
- * Copyright (c) 2004 Nex Vision
- *   Guillaume GOURAT <guillaume.gourat@nexvision.tv>
- *
- * 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.
- *
- * Modifications:
- *     15-10-2004 GG  Created initial version
- *     12-03-2005 BJD Updated for release
- */
-
-#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/string.h>
-#include <linux/serial_core.h>
-#include <linux/platform_device.h>
-
-#include <linux/mtd/map.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/setup.h>
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/mach-types.h>
-
-//#include <asm/debug-ll.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-serial.h>
-
-#include "s3c2410.h"
-#include "s3c2440.h"
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
-
-static struct map_desc nexcoder_iodesc[] __initdata = {
-       /* nothing here yet */
-};
-
-#define UCON S3C2410_UCON_DEFAULT
-#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
-#define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE
-
-static struct s3c2410_uartcfg nexcoder_uartcfgs[] __initdata = {
-       [0] = {
-               .hwport      = 0,
-               .flags       = 0,
-               .ucon        = UCON,
-               .ulcon       = ULCON,
-               .ufcon       = UFCON,
-       },
-       [1] = {
-               .hwport      = 1,
-               .flags       = 0,
-               .ucon        = UCON,
-               .ulcon       = ULCON,
-               .ufcon       = UFCON,
-       },
-       [2] = {
-               .hwport      = 2,
-               .flags       = 0,
-               .ucon        = UCON,
-               .ulcon       = ULCON,
-               .ufcon       = UFCON,
-       }
-};
-
-/* NOR Flash on NexVision NexCoder 2440 board */
-
-static struct resource nexcoder_nor_resource[] = {
-       [0] = {
-               .start = S3C2410_CS0,
-               .end   = S3C2410_CS0 + (8*1024*1024) - 1,
-               .flags = IORESOURCE_MEM,
-       }
-};
-
-static struct map_info nexcoder_nor_map = {
-       .bankwidth = 2,
-};
-
-static struct platform_device nexcoder_device_nor = {
-       .name           = "mtd-flash",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(nexcoder_nor_resource),
-       .resource       = nexcoder_nor_resource,
-       .dev =
-       {
-               .platform_data = &nexcoder_nor_map,
-       }
-};
-
-/* Standard Nexcoder devices */
-
-static struct platform_device *nexcoder_devices[] __initdata = {
-       &s3c_device_usb,
-       &s3c_device_lcd,
-       &s3c_device_wdt,
-       &s3c_device_i2c,
-       &s3c_device_iis,
-       &s3c_device_rtc,
-       &s3c_device_camif,
-       &s3c_device_spi0,
-       &s3c_device_spi1,
-       &nexcoder_device_nor,
-};
-
-static struct s3c24xx_board nexcoder_board __initdata = {
-       .devices       = nexcoder_devices,
-       .devices_count = ARRAY_SIZE(nexcoder_devices),
-};
-
-
-static void __init nexcoder_sensorboard_init(void)
-{
-       // Initialize SCCB bus
-       s3c2410_gpio_setpin(S3C2410_GPE14, 1); // IICSCL
-       s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_OUTP);
-       s3c2410_gpio_setpin(S3C2410_GPE15, 1); // IICSDA
-       s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_OUTP);
-
-       // Power up the sensor board
-       s3c2410_gpio_setpin(S3C2410_GPF1, 1);
-       s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_OUTP); // CAM_GPIO7 => nLDO_PWRDN
-       s3c2410_gpio_setpin(S3C2410_GPF2, 0);
-       s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); // CAM_GPIO6 => CAM_PWRDN
-}
-
-static void __init nexcoder_map_io(void)
-{
-       s3c24xx_init_io(nexcoder_iodesc, ARRAY_SIZE(nexcoder_iodesc));
-       s3c24xx_init_clocks(0);
-       s3c24xx_init_uarts(nexcoder_uartcfgs, ARRAY_SIZE(nexcoder_uartcfgs));
-       s3c24xx_set_board(&nexcoder_board);
-       nexcoder_sensorboard_init();
-}
-
-
-MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
-       /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
-       .phys_io        = S3C2410_PA_UART,
-       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
-       .boot_params    = S3C2410_SDRAM_PA + 0x100,
-       .map_io         = nexcoder_map_io,
-       .init_irq       = s3c24xx_init_irq,
-       .timer          = &s3c24xx_timer,
-MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-osiris.c b/arch/arm/mach-s3c2410/mach-osiris.c
deleted file mode 100644 (file)
index 37b4085..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/mach-osiris.c
- *
- * Copyright (c) 2005 Simtec Electronics
- *     http://armlinux.simtec.co.uk/
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <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/device.h>
-#include <linux/serial_core.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/arch/osiris-map.h>
-#include <asm/arch/osiris-cpld.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/mach-types.h>
-
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-mem.h>
-#include <asm/arch/regs-lcd.h>
-#include <asm/arch/nand.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/nand_ecc.h>
-#include <linux/mtd/partitions.h>
-
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
-
-/* onboard perihpheral map */
-
-static struct map_desc osiris_iodesc[] __initdata = {
-  /* ISA IO areas (may be over-written later) */
-
-  {
-         .virtual      = (u32)S3C24XX_VA_ISA_BYTE,
-         .pfn          = __phys_to_pfn(S3C2410_CS5),
-         .length       = SZ_16M,
-         .type         = MT_DEVICE,
-  }, {
-         .virtual      = (u32)S3C24XX_VA_ISA_WORD,
-         .pfn          = __phys_to_pfn(S3C2410_CS5),
-         .length       = SZ_16M,
-         .type         = MT_DEVICE,
-  },
-
-  /* CPLD control registers */
-
-  {
-         .virtual      = (u32)OSIRIS_VA_CTRL1,
-         .pfn          = __phys_to_pfn(OSIRIS_PA_CTRL1),
-         .length       = SZ_16K,
-         .type         = MT_DEVICE,
-  }, {
-         .virtual      = (u32)OSIRIS_VA_CTRL2,
-         .pfn          = __phys_to_pfn(OSIRIS_PA_CTRL2),
-         .length       = SZ_16K,
-         .type         = MT_DEVICE,
-  },
-};
-
-#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
-#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
-#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
-
-static struct s3c24xx_uart_clksrc osiris_serial_clocks[] = {
-       [0] = {
-               .name           = "uclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-       [1] = {
-               .name           = "pclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       }
-};
-
-static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = {
-       [0] = {
-               .hwport      = 0,
-               .flags       = 0,
-               .ucon        = UCON,
-               .ulcon       = ULCON,
-               .ufcon       = UFCON,
-               .clocks      = osiris_serial_clocks,
-               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
-       },
-       [1] = {
-               .hwport      = 1,
-               .flags       = 0,
-               .ucon        = UCON,
-               .ulcon       = ULCON,
-               .ufcon       = UFCON,
-               .clocks      = osiris_serial_clocks,
-               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
-       },
-       [2] = {
-               .hwport      = 2,
-               .flags       = 0,
-               .ucon        = UCON,
-               .ulcon       = ULCON,
-               .ufcon       = UFCON,
-               .clocks      = osiris_serial_clocks,
-               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
-       }
-};
-
-/* NAND Flash on Osiris board */
-
-static int external_map[]   = { 2 };
-static int chip0_map[]      = { 0 };
-static int chip1_map[]      = { 1 };
-
-static struct mtd_partition osiris_default_nand_part[] = {
-       [0] = {
-               .name   = "Boot Agent",
-               .size   = SZ_16K,
-               .offset = 0,
-       },
-       [1] = {
-               .name   = "/boot",
-               .size   = SZ_4M - SZ_16K,
-               .offset = SZ_16K,
-       },
-       [2] = {
-               .name   = "user1",
-               .offset = SZ_4M,
-               .size   = SZ_32M - SZ_4M,
-       },
-       [3] = {
-               .name   = "user2",
-               .offset = SZ_32M,
-               .size   = MTDPART_SIZ_FULL,
-       }
-};
-
-/* the Osiris has 3 selectable slots for nand-flash, the two
- * on-board chip areas, as well as the external slot.
- *
- * Note, there is no current hot-plug support for the External
- * socket.
-*/
-
-static struct s3c2410_nand_set osiris_nand_sets[] = {
-       [1] = {
-               .name           = "External",
-               .nr_chips       = 1,
-               .nr_map         = external_map,
-               .nr_partitions  = ARRAY_SIZE(osiris_default_nand_part),
-               .partitions     = osiris_default_nand_part,
-       },
-       [0] = {
-               .name           = "chip0",
-               .nr_chips       = 1,
-               .nr_map         = chip0_map,
-               .nr_partitions  = ARRAY_SIZE(osiris_default_nand_part),
-               .partitions     = osiris_default_nand_part,
-       },
-       [2] = {
-               .name           = "chip1",
-               .nr_chips       = 1,
-               .nr_map         = chip1_map,
-               .nr_partitions  = ARRAY_SIZE(osiris_default_nand_part),
-               .partitions     = osiris_default_nand_part,
-       },
-};
-
-static void osiris_nand_select(struct s3c2410_nand_set *set, int slot)
-{
-       unsigned int tmp;
-
-       slot = set->nr_map[slot] & 3;
-
-       pr_debug("osiris_nand: selecting slot %d (set %p,%p)\n",
-                slot, set, set->nr_map);
-
-       tmp = __raw_readb(OSIRIS_VA_CTRL1);
-       tmp &= ~OSIRIS_CTRL1_NANDSEL;
-       tmp |= slot;
-
-       pr_debug("osiris_nand: ctrl1 now %02x\n", tmp);
-
-       __raw_writeb(tmp, OSIRIS_VA_CTRL1);
-}
-
-static struct s3c2410_platform_nand osiris_nand_info = {
-       .tacls          = 25,
-       .twrph0         = 60,
-       .twrph1         = 60,
-       .nr_sets        = ARRAY_SIZE(osiris_nand_sets),
-       .sets           = osiris_nand_sets,
-       .select_chip    = osiris_nand_select,
-};
-
-/* PCMCIA control and configuration */
-
-static struct resource osiris_pcmcia_resource[] = {
-       [0] = {
-               .start  = 0x0f000000,
-               .end    = 0x0f100000,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 0x0c000000,
-               .end    = 0x0c100000,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device osiris_pcmcia = {
-       .name           = "osiris-pcmcia",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(osiris_pcmcia_resource),
-       .resource       = osiris_pcmcia_resource,
-};
-
-/* Standard Osiris devices */
-
-static struct platform_device *osiris_devices[] __initdata = {
-       &s3c_device_i2c,
-       &s3c_device_nand,
-       &osiris_pcmcia,
-};
-
-static struct clk *osiris_clocks[] = {
-       &s3c24xx_dclk0,
-       &s3c24xx_dclk1,
-       &s3c24xx_clkout0,
-       &s3c24xx_clkout1,
-       &s3c24xx_uclk,
-};
-
-static struct s3c24xx_board osiris_board __initdata = {
-       .devices       = osiris_devices,
-       .devices_count = ARRAY_SIZE(osiris_devices),
-       .clocks        = osiris_clocks,
-       .clocks_count  = ARRAY_SIZE(osiris_clocks),
-};
-
-static void __init osiris_map_io(void)
-{
-       unsigned long flags;
-
-       /* initialise the clocks */
-
-       s3c24xx_dclk0.parent = NULL;
-       s3c24xx_dclk0.rate   = 12*1000*1000;
-
-       s3c24xx_dclk1.parent = NULL;
-       s3c24xx_dclk1.rate   = 24*1000*1000;
-
-       s3c24xx_clkout0.parent  = &s3c24xx_dclk0;
-       s3c24xx_clkout1.parent  = &s3c24xx_dclk1;
-
-       s3c24xx_uclk.parent  = &s3c24xx_clkout1;
-
-       s3c_device_nand.dev.platform_data = &osiris_nand_info;
-
-       s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc));
-       s3c24xx_init_clocks(0);
-       s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs));
-       s3c24xx_set_board(&osiris_board);
-
-       /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */
-
-       local_irq_save(flags);
-       __raw_writel(__raw_readl(S3C2410_BWSCON) | S3C2410_BWSCON_ST1 | S3C2410_BWSCON_ST2 | S3C2410_BWSCON_ST3 | S3C2410_BWSCON_ST4 | S3C2410_BWSCON_ST5, S3C2410_BWSCON);
-       local_irq_restore(flags);
-
-       /* write-protect line to the NAND */
-       s3c2410_gpio_setpin(S3C2410_GPA0, 1);
-}
-
-MACHINE_START(OSIRIS, "Simtec-OSIRIS")
-       /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
-       .phys_io        = S3C2410_PA_UART,
-       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
-       .boot_params    = S3C2410_SDRAM_PA + 0x100,
-       .map_io         = osiris_map_io,
-       .init_irq       = s3c24xx_init_irq,
-       .timer          = &s3c24xx_timer,
-MACHINE_END
index 2c738b375e4d6da64359154ea3f0073f6e6a2ea9..c78ab75b44f30cb33d198e4ba455baadd4af5aa2 100644 (file)
 #include <asm/arch/regs-serial.h>
 #include <asm/arch/regs-gpio.h>
 
-#include "s3c2410.h"
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
 
 static struct map_desc otom11_iodesc[] __initdata = {
   /* Device area */
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
new file mode 100644 (file)
index 0000000..c6a4159
--- /dev/null
@@ -0,0 +1,448 @@
+/* linux/arch/arm/mach-s3c2410/mach-qt2410.c
+ *
+ * Copyright (C) 2006 by OpenMoko, Inc.
+ * Author: Harald Welte <laforge@openmoko.org>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#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/serial_core.h>
+#include <linux/mmc/protocol.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_bitbang.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/nand_ecc.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/leds-gpio.h>
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/fb.h>
+#include <asm/arch/nand.h>
+#include <asm/arch/udc.h>
+#include <asm/arch/spi.h>
+#include <asm/arch/spi-gpio.h>
+
+#include <asm/plat-s3c24xx/common-smdk.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
+
+static struct map_desc qt2410_iodesc[] __initdata = {
+       { 0xe0000000, __phys_to_pfn(S3C2410_CS3+0x01000000), SZ_1M, MT_DEVICE }
+};
+
+#define UCON S3C2410_UCON_DEFAULT
+#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
+#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
+
+static struct s3c2410_uartcfg smdk2410_uartcfgs[] = {
+       [0] = {
+               .hwport      = 0,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+       },
+       [1] = {
+               .hwport      = 1,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+       },
+       [2] = {
+               .hwport      = 2,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+       }
+};
+
+/* LCD driver info */
+
+/* Configuration for 640x480 SHARP LQ080V3DG01 */
+static struct s3c2410fb_mach_info qt2410_biglcd_cfg __initdata = {
+       .regs   = {
+
+               .lcdcon1        = S3C2410_LCDCON1_TFT16BPP |
+                                 S3C2410_LCDCON1_TFT |
+                                 S3C2410_LCDCON1_CLKVAL(0x01), /* HCLK/4 */
+
+               .lcdcon2        = S3C2410_LCDCON2_VBPD(18) |    /* 19 */
+                                 S3C2410_LCDCON2_LINEVAL(479) |
+                                 S3C2410_LCDCON2_VFPD(10) |    /* 11 */
+                                 S3C2410_LCDCON2_VSPW(14),     /* 15 */
+
+               .lcdcon3        = S3C2410_LCDCON3_HBPD(43) |    /* 44 */
+                                 S3C2410_LCDCON3_HOZVAL(639) | /* 640 */
+                                 S3C2410_LCDCON3_HFPD(115),    /* 116 */
+
+               .lcdcon4        = S3C2410_LCDCON4_MVAL(0) |
+                                 S3C2410_LCDCON4_HSPW(95),     /* 96 */
+
+               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
+                                 S3C2410_LCDCON5_INVVLINE |
+                                 S3C2410_LCDCON5_INVVFRAME |
+                                 S3C2410_LCDCON5_PWREN |
+                                 S3C2410_LCDCON5_HWSWP,
+       },
+
+       .lpcsel         = ((0xCE6) & ~7) | 1<<4,
+
+       .width          = 640,
+       .height         = 480,
+
+       .xres           = {
+               .min    = 640,
+               .max    = 640,
+               .defval = 640,
+       },
+
+       .yres           = {
+               .min    = 480,
+               .max    = 480,
+               .defval = 480,
+       },
+
+       .bpp            = {
+               .min    = 16,
+               .max    = 16,
+               .defval = 16,
+       },
+};
+
+/* Configuration for 480x640 toppoly TD028TTEC1 */
+static struct s3c2410fb_mach_info qt2410_prodlcd_cfg __initdata = {
+       .regs   = {
+
+               .lcdcon1        = S3C2410_LCDCON1_TFT16BPP |
+                                 S3C2410_LCDCON1_TFT |
+                                 S3C2410_LCDCON1_CLKVAL(0x01), /* HCLK/4 */
+
+               .lcdcon2        = S3C2410_LCDCON2_VBPD(1) |     /* 2 */
+                                 S3C2410_LCDCON2_LINEVAL(639) |/* 640 */
+                                 S3C2410_LCDCON2_VFPD(3) |     /* 4 */
+                                 S3C2410_LCDCON2_VSPW(1),      /* 2 */
+
+               .lcdcon3        = S3C2410_LCDCON3_HBPD(7) |     /* 8 */
+                                 S3C2410_LCDCON3_HOZVAL(479) | /* 479 */
+                                 S3C2410_LCDCON3_HFPD(23),     /* 24 */
+
+               .lcdcon4        = S3C2410_LCDCON4_MVAL(0) |
+                                 S3C2410_LCDCON4_HSPW(7),      /* 8 */
+
+               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
+                                 S3C2410_LCDCON5_INVVLINE |
+                                 S3C2410_LCDCON5_INVVFRAME |
+                                 S3C2410_LCDCON5_PWREN |
+                                 S3C2410_LCDCON5_HWSWP,
+       },
+
+       .lpcsel         = ((0xCE6) & ~7) | 1<<4,
+
+       .width          = 480,
+       .height         = 640,
+
+       .xres           = {
+               .min    = 480,
+               .max    = 480,
+               .defval = 480,
+       },
+
+       .yres           = {
+               .min    = 640,
+               .max    = 640,
+               .defval = 640,
+       },
+
+       .bpp            = {
+               .min    = 16,
+               .max    = 16,
+               .defval = 16,
+       },
+};
+
+/* Config for 240x320 LCD */
+static struct s3c2410fb_mach_info qt2410_lcd_cfg __initdata = {
+       .regs   = {
+
+               .lcdcon1        = S3C2410_LCDCON1_TFT16BPP |
+                                 S3C2410_LCDCON1_TFT |
+                                 S3C2410_LCDCON1_CLKVAL(0x04),
+
+               .lcdcon2        = S3C2410_LCDCON2_VBPD(1) |
+                                 S3C2410_LCDCON2_LINEVAL(319) |
+                                 S3C2410_LCDCON2_VFPD(6) |
+                                 S3C2410_LCDCON2_VSPW(3),
+
+               .lcdcon3        = S3C2410_LCDCON3_HBPD(12) |
+                                 S3C2410_LCDCON3_HOZVAL(239) |
+                                 S3C2410_LCDCON3_HFPD(7),
+
+               .lcdcon4        = S3C2410_LCDCON4_MVAL(0) |
+                                 S3C2410_LCDCON4_HSPW(3),
+
+               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
+                                 S3C2410_LCDCON5_INVVLINE |
+                                 S3C2410_LCDCON5_INVVFRAME |
+                                 S3C2410_LCDCON5_PWREN |
+                                 S3C2410_LCDCON5_HWSWP,
+       },
+
+       .lpcsel         = ((0xCE6) & ~7) | 1<<4,
+
+       .width          = 240,
+       .height         = 320,
+
+       .xres           = {
+               .min    = 240,
+               .max    = 240,
+               .defval = 240,
+       },
+
+       .yres           = {
+               .min    = 320,
+               .max    = 320,
+               .defval = 320,
+       },
+
+       .bpp            = {
+               .min    = 16,
+               .max    = 16,
+               .defval = 16,
+       },
+};
+
+/* CS8900 */
+
+static struct resource qt2410_cs89x0_resources[] = {
+       [0] = {
+               .start  = 0x19000000,
+               .end    = 0x19000000 + 16,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_EINT9,
+               .end    = IRQ_EINT9,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device qt2410_cs89x0 = {
+       .name           = "cirrus-cs89x0",
+       .num_resources  = ARRAY_SIZE(qt2410_cs89x0_resources),
+       .resource       = qt2410_cs89x0_resources,
+};
+
+/* LED */
+
+static struct s3c24xx_led_platdata qt2410_pdata_led = {
+       .gpio           = S3C2410_GPB0,
+       .flags          = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
+       .name           = "led",
+       .def_trigger    = "timer",
+};
+
+static struct platform_device qt2410_led = {
+       .name           = "s3c24xx_led",
+       .id             = 0,
+       .dev            = {
+               .platform_data = &qt2410_pdata_led,
+       },
+};
+
+/* SPI */
+
+static void spi_gpio_cs(struct s3c2410_spigpio_info *spi, int cs)
+{
+       switch (cs) {
+       case BITBANG_CS_ACTIVE:
+               s3c2410_gpio_setpin(S3C2410_GPB5, 0);
+               break;
+       case BITBANG_CS_INACTIVE:
+               s3c2410_gpio_setpin(S3C2410_GPB5, 1);
+               break;
+       }
+}
+
+static struct s3c2410_spigpio_info spi_gpio_cfg = {
+       .pin_clk        = S3C2410_GPG7,
+       .pin_mosi       = S3C2410_GPG6,
+       .pin_miso       = S3C2410_GPG5,
+       .chip_select    = &spi_gpio_cs,
+};
+
+
+static struct platform_device qt2410_spi = {
+       .name             = "s3c24xx-spi-gpio",
+       .id               = 1,
+       .dev = {
+               .platform_data = &spi_gpio_cfg,
+       },
+};
+
+/* Board devices */
+
+static struct platform_device *qt2410_devices[] __initdata = {
+       &s3c_device_usb,
+       &s3c_device_lcd,
+       &s3c_device_wdt,
+       &s3c_device_i2c,
+       &s3c_device_iis,
+       &s3c_device_sdi,
+       &s3c_device_usbgadget,
+       &qt2410_spi,
+       &qt2410_cs89x0,
+       &qt2410_led,
+};
+
+static struct s3c24xx_board qt2410_board __initdata = {
+       .devices       = qt2410_devices,
+       .devices_count = ARRAY_SIZE(qt2410_devices)
+};
+
+static struct mtd_partition qt2410_nand_part[] = {
+       [0] = {
+               .name   = "U-Boot",
+               .size   = 0x30000,
+               .offset = 0,
+       },
+       [1] = {
+               .name   = "U-Boot environment",
+               .offset = 0x30000,
+               .size   = 0x4000,
+       },
+       [2] = {
+               .name   = "kernel",
+               .offset = 0x34000,
+               .size   = SZ_2M,
+       },
+       [3] = {
+               .name   = "initrd",
+               .offset = 0x234000,
+               .size   = SZ_4M,
+       },
+       [4] = {
+               .name   = "jffs2",
+               .offset = 0x634000,
+               .size   = 0x39cc000,
+       },
+};
+
+static struct s3c2410_nand_set qt2410_nand_sets[] = {
+       [0] = {
+               .name           = "NAND",
+               .nr_chips       = 1,
+               .nr_partitions  = ARRAY_SIZE(qt2410_nand_part),
+               .partitions     = qt2410_nand_part,
+       },
+};
+
+/* choose a set of timings which should suit most 512Mbit
+ * chips and beyond.
+ */
+
+static struct s3c2410_platform_nand qt2410_nand_info = {
+       .tacls          = 20,
+       .twrph0         = 60,
+       .twrph1         = 20,
+       .nr_sets        = ARRAY_SIZE(qt2410_nand_sets),
+       .sets           = qt2410_nand_sets,
+};
+
+/* UDC */
+
+static struct s3c2410_udc_mach_info qt2410_udc_cfg = {
+};
+
+static char tft_type = 's';
+
+static int __init qt2410_tft_setup(char *str)
+{
+       tft_type = str[0];
+       return 1;
+}
+
+__setup("tft=", qt2410_tft_setup);
+
+static void __init qt2410_map_io(void)
+{
+       s3c24xx_init_io(qt2410_iodesc, ARRAY_SIZE(qt2410_iodesc));
+       s3c24xx_init_clocks(12*1000*1000);
+       s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
+       s3c24xx_set_board(&qt2410_board);
+}
+
+static void __init qt2410_machine_init(void)
+{
+       s3c_device_nand.dev.platform_data = &qt2410_nand_info;
+
+       switch (tft_type) {
+       case 'p': /* production */
+               s3c24xx_fb_set_platdata(&qt2410_prodlcd_cfg);
+               break;
+       case 'b': /* big */
+               s3c24xx_fb_set_platdata(&qt2410_biglcd_cfg);
+               break;
+       case 's': /* small */
+       default:
+               s3c24xx_fb_set_platdata(&qt2410_lcd_cfg);
+               break;
+       }
+
+       s3c2410_gpio_cfgpin(S3C2410_GPB0, S3C2410_GPIO_OUTPUT);
+       s3c2410_gpio_setpin(S3C2410_GPB0, 1);
+
+       s3c24xx_udc_set_platdata(&qt2410_udc_cfg);
+
+       s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT);
+
+       s3c2410_pm_init();
+}
+
+MACHINE_START(QT2410, "QT2410")
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+       .map_io         = qt2410_map_io,
+       .init_irq       = s3c24xx_init_irq,
+       .init_machine   = qt2410_machine_init,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
+
+
diff --git a/arch/arm/mach-s3c2410/mach-rx3715.c b/arch/arm/mach-s3c2410/mach-rx3715.c
deleted file mode 100644 (file)
index ecbcdf7..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/mach-rx3715.c
- *
- * Copyright (c) 2003,2004 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * http://www.handhelds.org/projects/rx3715.html
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
-*/
-
-#include <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/tty.h>
-#include <linux/console.h>
-#include <linux/platform_device.h>
-#include <linux/serial_core.h>
-#include <linux/serial.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/nand_ecc.h>
-#include <linux/mtd/partitions.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/hardware.h>
-#include <asm/hardware/iomd.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/mach-types.h>
-
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-lcd.h>
-
-#include <asm/arch/h1940.h>
-#include <asm/arch/nand.h>
-#include <asm/arch/fb.h>
-
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
-#include "pm.h"
-
-static struct map_desc rx3715_iodesc[] __initdata = {
-       /* dump ISA space somewhere unused */
-
-       {
-               .virtual        = (u32)S3C24XX_VA_ISA_WORD,
-               .pfn            = __phys_to_pfn(S3C2410_CS3),
-               .length         = SZ_1M,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
-               .pfn            = __phys_to_pfn(S3C2410_CS3),
-               .length         = SZ_1M,
-               .type           = MT_DEVICE,
-       },
-};
-
-
-static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = {
-       [0] = {
-               .name           = "fclk",
-               .divisor        = 0,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       }
-};
-
-static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
-       [0] = {
-               .hwport      = 0,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x03,
-               .ufcon       = 0x51,
-               .clocks      = rx3715_serial_clocks,
-               .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
-       },
-       [1] = {
-               .hwport      = 1,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x03,
-               .ufcon       = 0x00,
-               .clocks      = rx3715_serial_clocks,
-               .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
-       },
-       /* IR port */
-       [2] = {
-               .hwport      = 2,
-               .uart_flags  = UPF_CONS_FLOW,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x43,
-               .ufcon       = 0x51,
-               .clocks      = rx3715_serial_clocks,
-               .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
-       }
-};
-
-/* framebuffer lcd controller information */
-
-static struct s3c2410fb_mach_info rx3715_lcdcfg __initdata = {
-       .regs   = {
-               .lcdcon1 =      S3C2410_LCDCON1_TFT16BPP | \
-                               S3C2410_LCDCON1_TFT | \
-                               S3C2410_LCDCON1_CLKVAL(0x0C),
-
-               .lcdcon2 =      S3C2410_LCDCON2_VBPD(5) | \
-                               S3C2410_LCDCON2_LINEVAL(319) | \
-                               S3C2410_LCDCON2_VFPD(6) | \
-                               S3C2410_LCDCON2_VSPW(2),
-
-               .lcdcon3 =      S3C2410_LCDCON3_HBPD(35) | \
-                               S3C2410_LCDCON3_HOZVAL(239) | \
-                               S3C2410_LCDCON3_HFPD(35),
-
-               .lcdcon4 =      S3C2410_LCDCON4_MVAL(0) | \
-                               S3C2410_LCDCON4_HSPW(7),
-
-               .lcdcon5 =      S3C2410_LCDCON5_INVVLINE |
-                               S3C2410_LCDCON5_FRM565 |
-                               S3C2410_LCDCON5_HWSWP,
-       },
-
-       .lpcsel =       0xf82,
-
-       .gpccon =       0xaa955699,
-       .gpccon_mask =  0xffc003cc,
-       .gpcup =        0x0000ffff,
-       .gpcup_mask =   0xffffffff,
-
-       .gpdcon =       0xaa95aaa1,
-       .gpdcon_mask =  0xffc0fff0,
-       .gpdup =        0x0000faff,
-       .gpdup_mask =   0xffffffff,
-
-       .fixed_syncs =  1,
-       .width  =       240,
-       .height =       320,
-
-       .xres   = {
-               .min =          240,
-               .max =          240,
-               .defval =       240,
-       },
-
-       .yres   = {
-               .max =          320,
-               .min =          320,
-               .defval =       320,
-       },
-
-       .bpp    = {
-               .min =          16,
-               .max =          16,
-               .defval =       16,
-       },
-};
-
-static struct mtd_partition rx3715_nand_part[] = {
-       [0] = {
-               .name           = "Whole Flash",
-               .offset         = 0,
-               .size           = MTDPART_SIZ_FULL,
-               .mask_flags     = MTD_WRITEABLE,
-       }
-};
-
-static struct s3c2410_nand_set rx3715_nand_sets[] = {
-       [0] = {
-               .name           = "Internal",
-               .nr_chips       = 1,
-               .nr_partitions  = ARRAY_SIZE(rx3715_nand_part),
-               .partitions     = rx3715_nand_part,
-       },
-};
-
-static struct s3c2410_platform_nand rx3715_nand_info = {
-       .tacls          = 25,
-       .twrph0         = 50,
-       .twrph1         = 15,
-       .nr_sets        = ARRAY_SIZE(rx3715_nand_sets),
-       .sets           = rx3715_nand_sets,
-};
-
-static struct platform_device *rx3715_devices[] __initdata = {
-       &s3c_device_usb,
-       &s3c_device_lcd,
-       &s3c_device_wdt,
-       &s3c_device_i2c,
-       &s3c_device_iis,
-       &s3c_device_nand,
-};
-
-static struct s3c24xx_board rx3715_board __initdata = {
-       .devices       = rx3715_devices,
-       .devices_count = ARRAY_SIZE(rx3715_devices)
-};
-
-static void __init rx3715_map_io(void)
-{
-       s3c_device_nand.dev.platform_data = &rx3715_nand_info;
-
-       s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
-       s3c24xx_init_clocks(16934000);
-       s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
-       s3c24xx_set_board(&rx3715_board);
-}
-
-static void __init rx3715_init_irq(void)
-{
-       s3c24xx_init_irq();
-}
-
-static void __init rx3715_init_machine(void)
-{
-       memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024);
-       s3c2410_pm_init();
-
-       s3c24xx_fb_set_platdata(&rx3715_lcdcfg);
-}
-
-
-MACHINE_START(RX3715, "IPAQ-RX3715")
-       /* Maintainer: Ben Dooks <ben@fluff.org> */
-       .phys_io        = S3C2410_PA_UART,
-       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
-       .boot_params    = S3C2410_SDRAM_PA + 0x100,
-       .map_io         = rx3715_map_io,
-       .init_irq       = rx3715_init_irq,
-       .init_machine   = rx3715_init_machine,
-       .timer          = &s3c24xx_timer,
-MACHINE_END
index 01c0c986d827de5d12f775aaf4abce49a7bd988e..57b8a80f33d0c53c2672d72c496b88255add8072 100644 (file)
@@ -1,4 +1,4 @@
-/***********************************************************************
+/* linux/arch/arm/mach-s3c2410/mach-smdk2410.c
  *
  * linux/arch/arm/mach-s3c2410/mach-smdk2410.c
  *
 
 #include <asm/arch/regs-serial.h>
 
-#include "devs.h"
-#include "cpu.h"
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
 
-#include "common-smdk.h"
+#include <asm/plat-s3c24xx/common-smdk.h>
 
 static struct map_desc smdk2410_iodesc[] __initdata = {
   /* nothing here yet */
diff --git a/arch/arm/mach-s3c2410/mach-smdk2413.c b/arch/arm/mach-s3c2410/mach-smdk2413.c
deleted file mode 100644 (file)
index 4f89abd..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/mach-smdk2413.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Thanks to Dimity Andric (TomTom) and Steven Ryu (Samsung) for the
- * loans of SMDK2413 to work with.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <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/serial_core.h>
-#include <linux/platform_device.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/hardware.h>
-#include <asm/hardware/iomd.h>
-#include <asm/setup.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/mach-types.h>
-
-//#include <asm/debug-ll.h>
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-lcd.h>
-
-#include <asm/arch/idle.h>
-#include <asm/arch/fb.h>
-
-#include "s3c2410.h"
-#include "s3c2412.h"
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
-
-#include "common-smdk.h"
-
-static struct map_desc smdk2413_iodesc[] __initdata = {
-};
-
-static struct s3c2410_uartcfg smdk2413_uartcfgs[] __initdata = {
-       [0] = {
-               .hwport      = 0,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x03,
-               .ufcon       = 0x51,
-       },
-       [1] = {
-               .hwport      = 1,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x03,
-               .ufcon       = 0x51,
-       },
-       /* IR port */
-       [2] = {
-               .hwport      = 2,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x43,
-               .ufcon       = 0x51,
-       }
-};
-
-static struct platform_device *smdk2413_devices[] __initdata = {
-       &s3c_device_usb,
-       //&s3c_device_lcd,
-       &s3c_device_wdt,
-       &s3c_device_i2c,
-       &s3c_device_iis,
-};
-
-static struct s3c24xx_board smdk2413_board __initdata = {
-       .devices       = smdk2413_devices,
-       .devices_count = ARRAY_SIZE(smdk2413_devices)
-};
-
-static void __init smdk2413_fixup(struct machine_desc *desc,
-                                 struct tag *tags, char **cmdline,
-                                 struct meminfo *mi)
-{
-       if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
-               mi->nr_banks=1;
-               mi->bank[0].start = 0x30000000;
-               mi->bank[0].size = SZ_64M;
-               mi->bank[0].node = 0;
-       }
-}
-
-static void __init smdk2413_map_io(void)
-{
-       s3c24xx_init_io(smdk2413_iodesc, ARRAY_SIZE(smdk2413_iodesc));
-       s3c24xx_init_clocks(12000000);
-       s3c24xx_init_uarts(smdk2413_uartcfgs, ARRAY_SIZE(smdk2413_uartcfgs));
-       s3c24xx_set_board(&smdk2413_board);
-}
-
-static void __init smdk2413_machine_init(void)
-{
-       smdk_machine_init();
-}
-
-MACHINE_START(S3C2413, "S3C2413")
-       /* Maintainer: Ben Dooks <ben@fluff.org> */
-       .phys_io        = S3C2410_PA_UART,
-       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
-       .boot_params    = S3C2410_SDRAM_PA + 0x100,
-
-       .fixup          = smdk2413_fixup,
-       .init_irq       = s3c24xx_init_irq,
-       .map_io         = smdk2413_map_io,
-       .init_machine   = smdk2413_machine_init,
-       .timer          = &s3c24xx_timer,
-MACHINE_END
-
-MACHINE_START(SMDK2413, "SMDK2413")
-       /* Maintainer: Ben Dooks <ben@fluff.org> */
-       .phys_io        = S3C2410_PA_UART,
-       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
-       .boot_params    = S3C2410_SDRAM_PA + 0x100,
-
-       .fixup          = smdk2413_fixup,
-       .init_irq       = s3c24xx_init_irq,
-       .map_io         = smdk2413_map_io,
-       .init_machine   = smdk2413_machine_init,
-       .timer          = &s3c24xx_timer,
-MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-smdk2440.c b/arch/arm/mach-s3c2410/mach-smdk2440.c
deleted file mode 100644 (file)
index 2b61f4e..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/mach-smdk2440.c
- *
- * Copyright (c) 2004,2005 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * http://www.fluff.org/ben/smdk2440/
- *
- * Thanks to Dimity Andric and TomTom for the loan of an SMDK2440.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
-*/
-
-#include <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/serial_core.h>
-#include <linux/platform_device.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/hardware.h>
-#include <asm/hardware/iomd.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/mach-types.h>
-
-//#include <asm/debug-ll.h>
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-lcd.h>
-
-#include <asm/arch/idle.h>
-#include <asm/arch/fb.h>
-
-#include "s3c2410.h"
-#include "s3c2440.h"
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
-
-#include "common-smdk.h"
-
-static struct map_desc smdk2440_iodesc[] __initdata = {
-       /* ISA IO Space map (memory space selected by A24) */
-
-       {
-               .virtual        = (u32)S3C24XX_VA_ISA_WORD,
-               .pfn            = __phys_to_pfn(S3C2410_CS2),
-               .length         = 0x10000,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
-               .pfn            = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
-               .length         = SZ_4M,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
-               .pfn            = __phys_to_pfn(S3C2410_CS2),
-               .length         = 0x10000,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
-               .pfn            = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
-               .length         = SZ_4M,
-               .type           = MT_DEVICE,
-       }
-};
-
-#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
-#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
-#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
-
-static struct s3c2410_uartcfg smdk2440_uartcfgs[] __initdata = {
-       [0] = {
-               .hwport      = 0,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x03,
-               .ufcon       = 0x51,
-       },
-       [1] = {
-               .hwport      = 1,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x03,
-               .ufcon       = 0x51,
-       },
-       /* IR port */
-       [2] = {
-               .hwport      = 2,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x43,
-               .ufcon       = 0x51,
-       }
-};
-
-/* LCD driver info */
-
-static struct s3c2410fb_mach_info smdk2440_lcd_cfg __initdata = {
-       .regs   = {
-
-               .lcdcon1        = S3C2410_LCDCON1_TFT16BPP |
-                                 S3C2410_LCDCON1_TFT |
-                                 S3C2410_LCDCON1_CLKVAL(0x04),
-
-               .lcdcon2        = S3C2410_LCDCON2_VBPD(7) |
-                                 S3C2410_LCDCON2_LINEVAL(319) |
-                                 S3C2410_LCDCON2_VFPD(6) |
-                                 S3C2410_LCDCON2_VSPW(3),
-
-               .lcdcon3        = S3C2410_LCDCON3_HBPD(19) |
-                                 S3C2410_LCDCON3_HOZVAL(239) |
-                                 S3C2410_LCDCON3_HFPD(7),
-
-               .lcdcon4        = S3C2410_LCDCON4_MVAL(0) |
-                                 S3C2410_LCDCON4_HSPW(3),
-
-               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
-                                 S3C2410_LCDCON5_INVVLINE |
-                                 S3C2410_LCDCON5_INVVFRAME |
-                                 S3C2410_LCDCON5_PWREN |
-                                 S3C2410_LCDCON5_HWSWP,
-       },
-
-#if 0
-       /* currently setup by downloader */
-       .gpccon         = 0xaa940659,
-       .gpccon_mask    = 0xffffffff,
-       .gpcup          = 0x0000ffff,
-       .gpcup_mask     = 0xffffffff,
-       .gpdcon         = 0xaa84aaa0,
-       .gpdcon_mask    = 0xffffffff,
-       .gpdup          = 0x0000faff,
-       .gpdup_mask     = 0xffffffff,
-#endif
-
-       .lpcsel         = ((0xCE6) & ~7) | 1<<4,
-
-       .width          = 240,
-       .height         = 320,
-
-       .xres           = {
-               .min    = 240,
-               .max    = 240,
-               .defval = 240,
-       },
-
-       .yres           = {
-               .min    = 320,
-               .max    = 320,
-               .defval = 320,
-       },
-
-       .bpp            = {
-               .min    = 16,
-               .max    = 16,
-               .defval = 16,
-       },
-};
-
-static struct platform_device *smdk2440_devices[] __initdata = {
-       &s3c_device_usb,
-       &s3c_device_lcd,
-       &s3c_device_wdt,
-       &s3c_device_i2c,
-       &s3c_device_iis,
-};
-
-static struct s3c24xx_board smdk2440_board __initdata = {
-       .devices       = smdk2440_devices,
-       .devices_count = ARRAY_SIZE(smdk2440_devices)
-};
-
-static void __init smdk2440_map_io(void)
-{
-       s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
-       s3c24xx_init_clocks(16934400);
-       s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
-       s3c24xx_set_board(&smdk2440_board);
-}
-
-static void __init smdk2440_machine_init(void)
-{
-       s3c24xx_fb_set_platdata(&smdk2440_lcd_cfg);
-
-       smdk_machine_init();
-}
-
-MACHINE_START(S3C2440, "SMDK2440")
-       /* Maintainer: Ben Dooks <ben@fluff.org> */
-       .phys_io        = S3C2410_PA_UART,
-       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
-       .boot_params    = S3C2410_SDRAM_PA + 0x100,
-
-       .init_irq       = s3c24xx_init_irq,
-       .map_io         = smdk2440_map_io,
-       .init_machine   = smdk2440_machine_init,
-       .timer          = &s3c24xx_timer,
-MACHINE_END
index a382fc095110ec21b9b07563a0b140893e40db98..c947c75bcbf0f982f13566db3a0fe61b45ea7eb5 100644 (file)
@@ -43,9 +43,9 @@
 #include <asm/arch/regs-gpio.h>
 #include <asm/arch/leds-gpio.h>
 
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
 #include "usb-simtec.h"
 
 /* macros for virtual address mods for the io space entries */
diff --git a/arch/arm/mach-s3c2410/mach-vstms.c b/arch/arm/mach-s3c2410/mach-vstms.c
deleted file mode 100644 (file)
index 0360e10..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/mach-vstms.c
- *
- * (C) 2006 Thomas Gleixner <tglx@linutronix.de>
- *
- * Derived from mach-smdk2413.c - (C) 2006 Simtec Electronics
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <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/serial_core.h>
-#include <linux/platform_device.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/nand_ecc.h>
-#include <linux/mtd/partitions.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/hardware.h>
-#include <asm/hardware/iomd.h>
-#include <asm/setup.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/mach-types.h>
-
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-lcd.h>
-
-#include <asm/arch/idle.h>
-#include <asm/arch/fb.h>
-
-#include <asm/arch/nand.h>
-
-#include "s3c2410.h"
-#include "s3c2412.h"
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
-
-
-static struct map_desc vstms_iodesc[] __initdata = {
-};
-
-static struct s3c2410_uartcfg vstms_uartcfgs[] __initdata = {
-       [0] = {
-               .hwport      = 0,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x03,
-               .ufcon       = 0x51,
-       },
-       [1] = {
-               .hwport      = 1,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x03,
-               .ufcon       = 0x51,
-       },
-       [2] = {
-               .hwport      = 2,
-               .flags       = 0,
-               .ucon        = 0x3c5,
-               .ulcon       = 0x03,
-               .ufcon       = 0x51,
-       }
-};
-
-static struct mtd_partition vstms_nand_part[] = {
-       [0] = {
-               .name   = "Boot Agent",
-               .size   = 0x7C000,
-               .offset = 0,
-       },
-       [1] = {
-               .name   = "UBoot Config",
-               .offset = 0x7C000,
-               .size   = 0x4000,
-       },
-       [2] = {
-               .name   = "Kernel",
-               .offset = 0x80000,
-               .size   = 0x200000,
-       },
-       [3] = {
-               .name   = "RFS",
-               .offset = 0x280000,
-               .size   = 0x3d80000,
-       },
-};
-
-static struct s3c2410_nand_set vstms_nand_sets[] = {
-       [0] = {
-               .name           = "NAND",
-               .nr_chips       = 1,
-               .nr_partitions  = ARRAY_SIZE(vstms_nand_part),
-               .partitions     = vstms_nand_part,
-       },
-};
-
-/* choose a set of timings which should suit most 512Mbit
- * chips and beyond.
-*/
-
-static struct s3c2410_platform_nand vstms_nand_info = {
-       .tacls          = 20,
-       .twrph0         = 60,
-       .twrph1         = 20,
-       .nr_sets        = ARRAY_SIZE(vstms_nand_sets),
-       .sets           = vstms_nand_sets,
-};
-
-static struct platform_device *vstms_devices[] __initdata = {
-       &s3c_device_usb,
-       &s3c_device_wdt,
-       &s3c_device_i2c,
-       &s3c_device_iis,
-       &s3c_device_rtc,
-       &s3c_device_nand,
-};
-
-static struct s3c24xx_board vstms_board __initdata = {
-       .devices       = vstms_devices,
-       .devices_count = ARRAY_SIZE(vstms_devices)
-};
-
-static void __init vstms_fixup(struct machine_desc *desc,
-                                 struct tag *tags, char **cmdline,
-                                 struct meminfo *mi)
-{
-       if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
-               mi->nr_banks=1;
-               mi->bank[0].start = 0x30000000;
-               mi->bank[0].size = SZ_64M;
-               mi->bank[0].node = 0;
-       }
-}
-
-static void __init vstms_map_io(void)
-{
-       s3c_device_nand.dev.platform_data = &vstms_nand_info;
-
-       s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
-       s3c24xx_init_clocks(12000000);
-       s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
-       s3c24xx_set_board(&vstms_board);
-}
-
-MACHINE_START(VSTMS, "VSTMS")
-       .phys_io        = S3C2410_PA_UART,
-       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
-       .boot_params    = S3C2410_SDRAM_PA + 0x100,
-
-       .fixup          = vstms_fixup,
-       .init_irq       = s3c24xx_init_irq,
-       .map_io         = vstms_map_io,
-       .timer          = &s3c24xx_timer,
-MACHINE_END
diff --git a/arch/arm/mach-s3c2410/pm-simtec.c b/arch/arm/mach-s3c2410/pm-simtec.c
deleted file mode 100644 (file)
index 619133e..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/pm-simtec.c
- *
- * Copyright (c) 2004 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * http://armlinux.simtec.co.uk/
- *
- * Power Management helpers for Simtec S3C24XX implementations
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <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/device.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-
-#include <asm/arch/map.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-mem.h>
-
-#include <asm/mach-types.h>
-
-#include "pm.h"
-
-#define COPYRIGHT ", (c) 2005 Simtec Electronics"
-
-/* pm_simtec_init
- *
- * enable the power management functions
-*/
-
-static __init int pm_simtec_init(void)
-{
-       unsigned long gstatus4;
-
-       /* check which machine we are running on */
-
-       if (!machine_is_bast() && !machine_is_vr1000() &&
-           !machine_is_anubis() && !machine_is_osiris() &&
-           !machine_is_aml_m5900())
-               return 0;
-
-       printk(KERN_INFO "Simtec Board Power Manangement" COPYRIGHT "\n");
-
-       gstatus4  = (__raw_readl(S3C2410_BANKCON7) & 0x3) << 30;
-       gstatus4 |= (__raw_readl(S3C2410_BANKCON6) & 0x3) << 28;
-       gstatus4 |= (__raw_readl(S3C2410_BANKSIZE) & S3C2410_BANKSIZE_MASK);
-
-       __raw_writel(gstatus4, S3C2410_GSTATUS4);
-
-       return s3c2410_pm_init();
-}
-
-arch_initcall(pm_simtec_init);
index ebf294dd31da7cf25410ac4327f58a230833a1b9..3b3a7db4e0dd961028ad43869fc22f5e6a2d365e 100644 (file)
@@ -1,11 +1,9 @@
 /* linux/arch/arm/mach-s3c2410/pm.c
  *
- * Copyright (c) 2004,2006 Simtec Electronics
+ * Copyright (c) 2006 Simtec Electronics
  *     Ben Dooks <ben@simtec.co.uk>
  *
- * S3C24XX Power Manager (Suspend-To-RAM) support
- *
- * See Documentation/arm/Samsung-S3C24XX/Suspend.txt for more information
+ * S3C2410 (and compatible) Power Manager (Suspend-To-RAM) 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
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Parts based on arch/arm/mach-pxa/pm.c
- *
- * Thanks to Dimitry Andric for debugging
 */
 
 #include <linux/init.h>
 #include <linux/suspend.h>
 #include <linux/errno.h>
 #include <linux/time.h>
-#include <linux/interrupt.h>
-#include <linux/crc32.h>
-#include <linux/ioport.h>
-#include <linux/delay.h>
-#include <linux/serial_core.h>
+#include <linux/sysdev.h>
 
-#include <asm/cacheflush.h>
 #include <asm/hardware.h>
 #include <asm/io.h>
 
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-clock.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-mem.h>
-#include <asm/arch/regs-irq.h>
-
-#include <asm/mach/time.h>
-
-#include "pm.h"
-
-/* for external use */
-
-unsigned long s3c_pm_flags;
-
-#define PFX "s3c24xx-pm: "
-
-static struct sleep_save core_save[] = {
-       SAVE_ITEM(S3C2410_LOCKTIME),
-       SAVE_ITEM(S3C2410_CLKCON),
-
-       /* we restore the timings here, with the proviso that the board
-        * brings the system up in an slower, or equal frequency setting
-        * to the original system.
-        *
-        * if we cannot guarantee this, then things are going to go very
-        * wrong here, as we modify the refresh and both pll settings.
-        */
-
-       SAVE_ITEM(S3C2410_BWSCON),
-       SAVE_ITEM(S3C2410_BANKCON0),
-       SAVE_ITEM(S3C2410_BANKCON1),
-       SAVE_ITEM(S3C2410_BANKCON2),
-       SAVE_ITEM(S3C2410_BANKCON3),
-       SAVE_ITEM(S3C2410_BANKCON4),
-       SAVE_ITEM(S3C2410_BANKCON5),
-
-       SAVE_ITEM(S3C2410_CLKDIVN),
-       SAVE_ITEM(S3C2410_MPLLCON),
-       SAVE_ITEM(S3C2410_UPLLCON),
-       SAVE_ITEM(S3C2410_CLKSLOW),
-       SAVE_ITEM(S3C2410_REFRESH),
-};
-
-static struct sleep_save gpio_save[] = {
-       SAVE_ITEM(S3C2410_GPACON),
-       SAVE_ITEM(S3C2410_GPADAT),
-
-       SAVE_ITEM(S3C2410_GPBCON),
-       SAVE_ITEM(S3C2410_GPBDAT),
-       SAVE_ITEM(S3C2410_GPBUP),
-
-       SAVE_ITEM(S3C2410_GPCCON),
-       SAVE_ITEM(S3C2410_GPCDAT),
-       SAVE_ITEM(S3C2410_GPCUP),
-
-       SAVE_ITEM(S3C2410_GPDCON),
-       SAVE_ITEM(S3C2410_GPDDAT),
-       SAVE_ITEM(S3C2410_GPDUP),
-
-       SAVE_ITEM(S3C2410_GPECON),
-       SAVE_ITEM(S3C2410_GPEDAT),
-       SAVE_ITEM(S3C2410_GPEUP),
-
-       SAVE_ITEM(S3C2410_GPFCON),
-       SAVE_ITEM(S3C2410_GPFDAT),
-       SAVE_ITEM(S3C2410_GPFUP),
+#include <asm/mach-types.h>
 
-       SAVE_ITEM(S3C2410_GPGCON),
-       SAVE_ITEM(S3C2410_GPGDAT),
-       SAVE_ITEM(S3C2410_GPGUP),
-
-       SAVE_ITEM(S3C2410_GPHCON),
-       SAVE_ITEM(S3C2410_GPHDAT),
-       SAVE_ITEM(S3C2410_GPHUP),
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/h1940.h>
 
-       SAVE_ITEM(S3C2410_DCLKCON),
-};
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
 
 #ifdef CONFIG_S3C2410_PM_DEBUG
-
-#define SAVE_UART(va) \
-       SAVE_ITEM((va) + S3C2410_ULCON), \
-       SAVE_ITEM((va) + S3C2410_UCON), \
-       SAVE_ITEM((va) + S3C2410_UFCON), \
-       SAVE_ITEM((va) + S3C2410_UMCON), \
-       SAVE_ITEM((va) + S3C2410_UBRDIV)
-
-static struct sleep_save uart_save[] = {
-       SAVE_UART(S3C24XX_VA_UART0),
-       SAVE_UART(S3C24XX_VA_UART1),
-#ifndef CONFIG_CPU_S3C2400
-       SAVE_UART(S3C24XX_VA_UART2),
-#endif
-};
-
-/* debug
- *
- * we send the debug to printascii() to allow it to be seen if the
- * system never wakes up from the sleep
-*/
-
-extern void printascii(const char *);
-
-void pm_dbg(const char *fmt, ...)
-{
-       va_list va;
-       char buff[256];
-
-       va_start(va, fmt);
-       vsprintf(buff, fmt, va);
-       va_end(va);
-
-       printascii(buff);
-}
-
-static void s3c2410_pm_debug_init(void)
-{
-       unsigned long tmp = __raw_readl(S3C2410_CLKCON);
-
-       /* re-start uart clocks */
-       tmp |= S3C2410_CLKCON_UART0;
-       tmp |= S3C2410_CLKCON_UART1;
-       tmp |= S3C2410_CLKCON_UART2;
-
-       __raw_writel(tmp, S3C2410_CLKCON);
-       udelay(10);
-}
-
+extern void pm_dbg(const char *fmt, ...);
 #define DBG(fmt...) pm_dbg(fmt)
 #else
 #define DBG(fmt...) printk(KERN_DEBUG fmt)
-
-#define s3c2410_pm_debug_init() do { } while(0)
-
-static struct sleep_save uart_save[] = {};
 #endif
 
-#if defined(CONFIG_S3C2410_PM_CHECK) && CONFIG_S3C2410_PM_CHECK_CHUNKSIZE != 0
-
-/* suspend checking code...
- *
- * this next area does a set of crc checks over all the installed
- * memory, so the system can verify if the resume was ok.
- *
- * CONFIG_S3C2410_PM_CHECK_CHUNKSIZE defines the block-size for the CRC,
- * increasing it will mean that the area corrupted will be less easy to spot,
- * and reducing the size will cause the CRC save area to grow
-*/
-
-#define CHECK_CHUNKSIZE (CONFIG_S3C2410_PM_CHECK_CHUNKSIZE * 1024)
-
-static u32 crc_size;   /* size needed for the crc block */
-static u32 *crcs;      /* allocated over suspend/resume */
-
-typedef u32 *(run_fn_t)(struct resource *ptr, u32 *arg);
-
-/* s3c2410_pm_run_res
- *
- * go thorugh the given resource list, and look for system ram
-*/
-
-static void s3c2410_pm_run_res(struct resource *ptr, run_fn_t fn, u32 *arg)
-{
-       while (ptr != NULL) {
-               if (ptr->child != NULL)
-                       s3c2410_pm_run_res(ptr->child, fn, arg);
-
-               if ((ptr->flags & IORESOURCE_MEM) &&
-                   strcmp(ptr->name, "System RAM") == 0) {
-                       DBG("Found system RAM at %08lx..%08lx\n",
-                           ptr->start, ptr->end);
-                       arg = (fn)(ptr, arg);
-               }
-
-               ptr = ptr->sibling;
-       }
-}
-
-static void s3c2410_pm_run_sysram(run_fn_t fn, u32 *arg)
-{
-       s3c2410_pm_run_res(&iomem_resource, fn, arg);
-}
-
-static u32 *s3c2410_pm_countram(struct resource *res, u32 *val)
-{
-       u32 size = (u32)(res->end - res->start)+1;
-
-       size += CHECK_CHUNKSIZE-1;
-       size /= CHECK_CHUNKSIZE;
-
-       DBG("Area %08lx..%08lx, %d blocks\n", res->start, res->end, size);
-
-       *val += size * sizeof(u32);
-       return val;
-}
-
-/* s3c2410_pm_prepare_check
- *
- * prepare the necessary information for creating the CRCs. This
- * must be done before the final save, as it will require memory
- * allocating, and thus touching bits of the kernel we do not
- * know about.
-*/
-
-static void s3c2410_pm_check_prepare(void)
+static void s3c2410_pm_prepare(void)
 {
-       crc_size = 0;
+       /* ensure at least GSTATUS3 has the resume address */
 
-       s3c2410_pm_run_sysram(s3c2410_pm_countram, &crc_size);
+       __raw_writel(virt_to_phys(s3c2410_cpu_resume), S3C2410_GSTATUS3);
 
-       DBG("s3c2410_pm_prepare_check: %u checks needed\n", crc_size);
+       DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3));
+       DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4));
 
-       crcs = kmalloc(crc_size+4, GFP_KERNEL);
-       if (crcs == NULL)
-               printk(KERN_ERR "Cannot allocated CRC save area\n");
-}
+       if (machine_is_h1940()) {
+               void *base = phys_to_virt(H1940_SUSPEND_CHECK);
+               unsigned long ptr;
+               unsigned long calc = 0;
 
-static u32 *s3c2410_pm_makecheck(struct resource *res, u32 *val)
-{
-       unsigned long addr, left;
+               /* generate check for the bootloader to check on resume */
 
-       for (addr = res->start; addr < res->end;
-            addr += CHECK_CHUNKSIZE) {
-               left = res->end - addr;
+               for (ptr = 0; ptr < 0x40000; ptr += 0x400)
+                       calc += __raw_readl(base+ptr);
 
-               if (left > CHECK_CHUNKSIZE)
-                       left = CHECK_CHUNKSIZE;
-
-               *val = crc32_le(~0, phys_to_virt(addr), left);
-               val++;
+               __raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
        }
 
-       return val;
-}
-
-/* s3c2410_pm_check_store
- *
- * compute the CRC values for the memory blocks before the final
- * sleep.
-*/
-
-static void s3c2410_pm_check_store(void)
-{
-       if (crcs != NULL)
-               s3c2410_pm_run_sysram(s3c2410_pm_makecheck, crcs);
-}
-
-/* in_region
- *
- * return TRUE if the area defined by ptr..ptr+size contatins the
- * what..what+whatsz
-*/
-
-static inline int in_region(void *ptr, int size, void *what, size_t whatsz)
-{
-       if ((what+whatsz) < ptr)
-               return 0;
-
-       if (what > (ptr+size))
-               return 0;
-
-       return 1;
-}
-
-static u32 *s3c2410_pm_runcheck(struct resource *res, u32 *val)
-{
-       void *save_at = phys_to_virt(s3c2410_sleep_save_phys);
-       unsigned long addr;
-       unsigned long left;
-       void *ptr;
-       u32 calc;
-
-       for (addr = res->start; addr < res->end;
-            addr += CHECK_CHUNKSIZE) {
-               left = res->end - addr;
+       /* the RX3715 uses similar code and the same H1940 and the
+        * same offsets for resume and checksum pointers */
 
-               if (left > CHECK_CHUNKSIZE)
-                       left = CHECK_CHUNKSIZE;
+       if (machine_is_rx3715()) {
+               void *base = phys_to_virt(H1940_SUSPEND_CHECK);
+               unsigned long ptr;
+               unsigned long calc = 0;
 
-               ptr = phys_to_virt(addr);
+               /* generate check for the bootloader to check on resume */
 
-               if (in_region(ptr, left, crcs, crc_size)) {
-                       DBG("skipping %08lx, has crc block in\n", addr);
-                       goto skip_check;
-               }
+               for (ptr = 0; ptr < 0x40000; ptr += 0x4)
+                       calc += __raw_readl(base+ptr);
 
-               if (in_region(ptr, left, save_at, 32*4 )) {
-                       DBG("skipping %08lx, has save block in\n", addr);
-                       goto skip_check;
-               }
-
-               /* calculate and check the checksum */
-
-               calc = crc32_le(~0, ptr, left);
-               if (calc != *val) {
-                       printk(KERN_ERR PFX "Restore CRC error at "
-                              "%08lx (%08x vs %08x)\n", addr, calc, *val);
-
-                       DBG("Restore CRC error at %08lx (%08x vs %08x)\n",
-                           addr, calc, *val);
-               }
-
-       skip_check:
-               val++;
+               __raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
        }
 
-       return val;
-}
+       if ( machine_is_aml_m5900() )
+               s3c2410_gpio_setpin(S3C2410_GPF2, 1);
 
-/* s3c2410_pm_check_restore
- *
- * check the CRCs after the restore event and free the memory used
- * to hold them
-*/
-
-static void s3c2410_pm_check_restore(void)
-{
-       if (crcs != NULL) {
-               s3c2410_pm_run_sysram(s3c2410_pm_runcheck, crcs);
-               kfree(crcs);
-               crcs = NULL;
-       }
 }
 
-#else
-
-#define s3c2410_pm_check_prepare() do { } while(0)
-#define s3c2410_pm_check_restore() do { } while(0)
-#define s3c2410_pm_check_store()   do { } while(0)
-#endif
-
-/* helper functions to save and restore register state */
-
-void s3c2410_pm_do_save(struct sleep_save *ptr, int count)
+static int s3c2410_pm_resume(struct sys_device *dev)
 {
-       for (; count > 0; count--, ptr++) {
-               ptr->val = __raw_readl(ptr->reg);
-               DBG("saved %p value %08lx\n", ptr->reg, ptr->val);
-       }
-}
+       unsigned long tmp;
 
-/* s3c2410_pm_do_restore
- *
- * restore the system from the given list of saved registers
- *
- * Note, we do not use DBG() in here, as the system may not have
- * restore the UARTs state yet
-*/
+       /* unset the return-from-sleep flag, to ensure reset */
 
-void s3c2410_pm_do_restore(struct sleep_save *ptr, int count)
-{
-       for (; count > 0; count--, ptr++) {
-               printk(KERN_DEBUG "restore %p (restore %08lx, was %08x)\n",
-                      ptr->reg, ptr->val, __raw_readl(ptr->reg));
-
-               __raw_writel(ptr->val, ptr->reg);
-       }
-}
+       tmp = __raw_readl(S3C2410_GSTATUS2);
+       tmp &= S3C2410_GSTATUS2_OFFRESET;
+       __raw_writel(tmp, S3C2410_GSTATUS2);
 
-/* s3c2410_pm_do_restore_core
- *
- * similar to s3c2410_pm_do_restore_core
- *
- * WARNING: Do not put any debug in here that may effect memory or use
- * peripherals, as things may be changing!
-*/
+       if ( machine_is_aml_m5900() )
+               s3c2410_gpio_setpin(S3C2410_GPF2, 0);
 
-static void s3c2410_pm_do_restore_core(struct sleep_save *ptr, int count)
-{
-       for (; count > 0; count--, ptr++) {
-               __raw_writel(ptr->val, ptr->reg);
-       }
+       return 0;
 }
 
-/* s3c2410_pm_show_resume_irqs
- *
- * print any IRQs asserted at resume time (ie, we woke from)
-*/
-
-static void s3c2410_pm_show_resume_irqs(int start, unsigned long which,
-                                       unsigned long mask)
+static int s3c2410_pm_add(struct sys_device *dev)
 {
-       int i;
+       pm_cpu_prep = s3c2410_pm_prepare;
+       pm_cpu_sleep = s3c2410_cpu_suspend;
 
-       which &= ~mask;
-
-       for (i = 0; i <= 31; i++) {
-               if ((which) & (1L<<i)) {
-                       DBG("IRQ %d asserted at resume\n", start+i);
-               }
-       }
+       return 0;
 }
 
-/* s3c2410_pm_check_resume_pin
- *
- * check to see if the pin is configured correctly for sleep mode, and
- * make any necessary adjustments if it is not
-*/
-
-static void s3c2410_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs)
-{
-       unsigned long irqstate;
-       unsigned long pinstate;
-       int irq = s3c2410_gpio_getirq(pin);
-
-       if (irqoffs < 4)
-               irqstate = s3c_irqwake_intmask & (1L<<irqoffs);
-       else
-               irqstate = s3c_irqwake_eintmask & (1L<<irqoffs);
-
-       pinstate = s3c2410_gpio_getcfg(pin);
-
-       if (!irqstate) {
-               if (pinstate == S3C2410_GPIO_IRQ)
-                       DBG("Leaving IRQ %d (pin %d) enabled\n", irq, pin);
-       } else {
-               if (pinstate == S3C2410_GPIO_IRQ) {
-                       DBG("Disabling IRQ %d (pin %d)\n", irq, pin);
-                       s3c2410_gpio_cfgpin(pin, S3C2410_GPIO_INPUT);
-               }
-       }
-}
+#if defined(CONFIG_CPU_S3C2410)
+static struct sysdev_driver s3c2410_pm_driver = {
+       .add            = s3c2410_pm_add,
+       .resume         = s3c2410_pm_resume,
+};
 
-/* s3c2410_pm_configure_extint
- *
- * configure all external interrupt pins
-*/
+/* register ourselves */
 
-static void s3c2410_pm_configure_extint(void)
+static int __init s3c2410_pm_drvinit(void)
 {
-       int pin;
-
-       /* for each of the external interrupts (EINT0..EINT15) we
-        * need to check wether it is an external interrupt source,
-        * and then configure it as an input if it is not
-       */
-
-       for (pin = S3C2410_GPF0; pin <= S3C2410_GPF7; pin++) {
-               s3c2410_pm_check_resume_pin(pin, pin - S3C2410_GPF0);
-       }
-
-       for (pin = S3C2410_GPG0; pin <= S3C2410_GPG7; pin++) {
-               s3c2410_pm_check_resume_pin(pin, (pin - S3C2410_GPG0)+8);
-       }
+       return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_pm_driver);
 }
 
-void (*pm_cpu_prep)(void);
-void (*pm_cpu_sleep)(void);
-
-#define any_allowed(mask, allow) (((mask) & (allow)) != (allow))
-
-/* s3c2410_pm_enter
- *
- * central control for sleep/resume process
-*/
-
-static int s3c2410_pm_enter(suspend_state_t state)
-{
-       unsigned long regs_save[16];
-
-       /* ensure the debug is initialised (if enabled) */
-
-       s3c2410_pm_debug_init();
-
-       DBG("s3c2410_pm_enter(%d)\n", state);
-
-       if (pm_cpu_prep == NULL || pm_cpu_sleep == NULL) {
-               printk(KERN_ERR PFX "error: no cpu sleep functions set\n");
-               return -EINVAL;
-       }
-
-       if (state != PM_SUSPEND_MEM) {
-               printk(KERN_ERR PFX "error: only PM_SUSPEND_MEM supported\n");
-               return -EINVAL;
-       }
-
-       /* check if we have anything to wake-up with... bad things seem
-        * to happen if you suspend with no wakeup (system will often
-        * require a full power-cycle)
-       */
-
-       if (!any_allowed(s3c_irqwake_intmask, s3c_irqwake_intallow) &&
-           !any_allowed(s3c_irqwake_eintmask, s3c_irqwake_eintallow)) {
-               printk(KERN_ERR PFX "No sources enabled for wake-up!\n");
-               printk(KERN_ERR PFX "Aborting sleep\n");
-               return -EINVAL;
-       }
-
-       /* prepare check area if configured */
-
-       s3c2410_pm_check_prepare();
-
-       /* store the physical address of the register recovery block */
-
-       s3c2410_sleep_save_phys = virt_to_phys(regs_save);
-
-       DBG("s3c2410_sleep_save_phys=0x%08lx\n", s3c2410_sleep_save_phys);
-
-       /* save all necessary core registers not covered by the drivers */
-
-       s3c2410_pm_do_save(gpio_save, ARRAY_SIZE(gpio_save));
-       s3c2410_pm_do_save(core_save, ARRAY_SIZE(core_save));
-       s3c2410_pm_do_save(uart_save, ARRAY_SIZE(uart_save));
-
-       /* set the irq configuration for wake */
-
-       s3c2410_pm_configure_extint();
-
-       DBG("sleep: irq wakeup masks: %08lx,%08lx\n",
-           s3c_irqwake_intmask, s3c_irqwake_eintmask);
-
-       __raw_writel(s3c_irqwake_intmask, S3C2410_INTMSK);
-       __raw_writel(s3c_irqwake_eintmask, S3C2410_EINTMASK);
-
-       /* ack any outstanding external interrupts before we go to sleep */
-
-       __raw_writel(__raw_readl(S3C2410_EINTPEND), S3C2410_EINTPEND);
-       __raw_writel(__raw_readl(S3C2410_INTPND), S3C2410_INTPND);
-       __raw_writel(__raw_readl(S3C2410_SRCPND), S3C2410_SRCPND);
-
-       /* call cpu specific preperation */
-
-       pm_cpu_prep();
-
-       /* flush cache back to ram */
-
-       flush_cache_all();
-
-       s3c2410_pm_check_store();
-
-       /* send the cpu to sleep... */
-
-       __raw_writel(0x00, S3C2410_CLKCON);  /* turn off clocks over sleep */
-
-       /* s3c2410_cpu_save will also act as our return point from when
-        * we resume as it saves its own register state, so use the return
-        * code to differentiate return from save and return from sleep */
-
-       if (s3c2410_cpu_save(regs_save) == 0) {
-               flush_cache_all();
-               pm_cpu_sleep();
-       }
-
-       /* restore the cpu state */
-
-       cpu_init();
-
-       /* restore the system state */
-
-       s3c2410_pm_do_restore_core(core_save, ARRAY_SIZE(core_save));
-       s3c2410_pm_do_restore(gpio_save, ARRAY_SIZE(gpio_save));
-       s3c2410_pm_do_restore(uart_save, ARRAY_SIZE(uart_save));
-
-       s3c2410_pm_debug_init();
-
-       /* check what irq (if any) restored the system */
-
-       DBG("post sleep: IRQs 0x%08x, 0x%08x\n",
-           __raw_readl(S3C2410_SRCPND),
-           __raw_readl(S3C2410_EINTPEND));
-
-       s3c2410_pm_show_resume_irqs(IRQ_EINT0, __raw_readl(S3C2410_SRCPND),
-                                   s3c_irqwake_intmask);
-
-       s3c2410_pm_show_resume_irqs(IRQ_EINT4-4, __raw_readl(S3C2410_EINTPEND),
-                                   s3c_irqwake_eintmask);
-
-       DBG("post sleep, preparing to return\n");
-
-       s3c2410_pm_check_restore();
-
-       /* ok, let's return from sleep */
+arch_initcall(s3c2410_pm_drvinit);
+#endif
 
-       DBG("S3C2410 PM Resume (post-restore)\n");
-       return 0;
-}
+#if defined(CONFIG_CPU_S3C2440)
+static struct sysdev_driver s3c2440_pm_driver = {
+       .add            = s3c2410_pm_add,
+       .resume         = s3c2410_pm_resume,
+};
 
-/*
- * Called after processes are frozen, but before we shut down devices.
- */
-static int s3c2410_pm_prepare(suspend_state_t state)
+static int __init s3c2440_pm_drvinit(void)
 {
-       return 0;
+       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_pm_driver);
 }
 
-/*
- * Called after devices are re-setup, but before processes are thawed.
- */
-static int s3c2410_pm_finish(suspend_state_t state)
-{
-       return 0;
-}
+arch_initcall(s3c2440_pm_drvinit);
+#endif
 
-/*
- * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
- */
-static struct pm_ops s3c2410_pm_ops = {
-       .pm_disk_mode   = PM_DISK_FIRMWARE,
-       .prepare        = s3c2410_pm_prepare,
-       .enter          = s3c2410_pm_enter,
-       .finish         = s3c2410_pm_finish,
+#if defined(CONFIG_CPU_S3C2442)
+static struct sysdev_driver s3c2442_pm_driver = {
+       .add            = s3c2410_pm_add,
+       .resume         = s3c2410_pm_resume,
 };
 
-/* s3c2410_pm_init
- *
- * Attach the power management functions. This should be called
- * from the board specific initialisation if the board supports
- * it.
-*/
-
-int __init s3c2410_pm_init(void)
+static int __init s3c2442_pm_drvinit(void)
 {
-       printk("S3C2410 Power Management, (c) 2004 Simtec Electronics\n");
-
-       pm_set_ops(&s3c2410_pm_ops);
-       return 0;
+       return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_pm_driver);
 }
+
+arch_initcall(s3c2442_pm_drvinit);
+#endif
diff --git a/arch/arm/mach-s3c2410/pm.h b/arch/arm/mach-s3c2410/pm.h
deleted file mode 100644 (file)
index ffe197a..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/pm.h
- *
- * Copyright (c) 2004 Simtec Electronics
- *     Written by Ben Dooks, <ben@simtec.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-/* s3c2410_pm_init
- *
- * called from board at initialisation time to setup the power
- * management
-*/
-
-#ifdef CONFIG_PM
-
-extern __init int s3c2410_pm_init(void);
-
-#else
-
-static inline int s3c2410_pm_init(void)
-{
-       return 0;
-}
-#endif
-
-/* configuration for the IRQ mask over sleep */
-extern unsigned long s3c_irqwake_intmask;
-extern unsigned long s3c_irqwake_eintmask;
-
-/* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
-extern unsigned long s3c_irqwake_intallow;
-extern unsigned long s3c_irqwake_eintallow;
-
-/* per-cpu sleep functions */
-
-extern void (*pm_cpu_prep)(void);
-extern void (*pm_cpu_sleep)(void);
-
-/* Flags for PM Control */
-
-extern unsigned long s3c_pm_flags;
-
-/* from sleep.S */
-
-extern int  s3c2410_cpu_save(unsigned long *saveblk);
-extern void s3c2410_cpu_suspend(void);
-extern void s3c2410_cpu_resume(void);
-
-extern unsigned long s3c2410_sleep_save_phys;
-
-/* sleep save info */
-
-struct sleep_save {
-       void __iomem    *reg;
-       unsigned long   val;
-};
-
-#define SAVE_ITEM(x) \
-       { .reg = (x) }
-
-extern void s3c2410_pm_do_save(struct sleep_save *ptr, int count);
-extern void s3c2410_pm_do_restore(struct sleep_save *ptr, int count);
-
-#ifdef CONFIG_PM
-extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
-extern int s3c24xx_irq_resume(struct sys_device *dev);
-#else
-#define s3c24xx_irq_suspend NULL
-#define s3c24xx_irq_resume  NULL
-#endif
diff --git a/arch/arm/mach-s3c2410/s3c2400-gpio.c b/arch/arm/mach-s3c2410/s3c2400-gpio.c
deleted file mode 100644 (file)
index 1576d01..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2400-gpio.c
- *
- * Copyright (c) 2006 Lucas Correia Villa Real <lucasvr@gobolinux.org>
- *
- * S3C2400 GPIO 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-
-#include <asm/hardware.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-#include <asm/arch/regs-gpio.h>
-
-int s3c2400_gpio_getirq(unsigned int pin)
-{
-       if (pin < S3C2410_GPE0 || pin > S3C2400_GPE7_EINT7)
-               return -1;  /* not valid interrupts */
-
-       return (pin - S3C2410_GPE0) + IRQ_EINT0;
-}
-
-EXPORT_SYMBOL(s3c2400_gpio_getirq);
diff --git a/arch/arm/mach-s3c2410/s3c2400.h b/arch/arm/mach-s3c2410/s3c2400.h
deleted file mode 100644 (file)
index 8b2394e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* arch/arm/mach-s3c2410/s3c2400.h
- *
- * Copyright (c) 2004 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Header file for S3C2400 cpu support
- *
- * 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.
- *
- * Modifications:
- *     09-Fev-2006 LCVR  First version, based on s3c2410.h
-*/
-
-#ifdef CONFIG_CPU_S3C2400
-
-extern  int s3c2400_init(void);
-
-extern void s3c2400_map_io(struct map_desc *mach_desc, int size);
-
-extern void s3c2400_init_uarts(struct s3c2410_uartcfg *cfg, int no);
-
-extern void s3c2400_init_clocks(int xtal);
-
-#else
-#define s3c2400_init_clocks NULL
-#define s3c2400_init_uarts NULL
-#define s3c2400_map_io NULL
-#define s3c2400_init NULL
-#endif
diff --git a/arch/arm/mach-s3c2410/s3c2410-clock.c b/arch/arm/mach-s3c2410/s3c2410-clock.c
deleted file mode 100644 (file)
index 992cc6a..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2410-clock.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2410,S3C2440,S3C2442 Clock control 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/sysdev.h>
-#include <linux/clk.h>
-#include <linux/mutex.h>
-#include <linux/delay.h>
-#include <linux/serial_core.h>
-
-#include <asm/mach/map.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-clock.h>
-#include <asm/arch/regs-gpio.h>
-
-#include "s3c2410.h"
-#include "clock.h"
-#include "cpu.h"
-
-int s3c2410_clkcon_enable(struct clk *clk, int enable)
-{
-       unsigned int clocks = clk->ctrlbit;
-       unsigned long clkcon;
-
-       clkcon = __raw_readl(S3C2410_CLKCON);
-
-       if (enable)
-               clkcon |= clocks;
-       else
-               clkcon &= ~clocks;
-
-       /* ensure none of the special function bits set */
-       clkcon &= ~(S3C2410_CLKCON_IDLE|S3C2410_CLKCON_POWER);
-
-       __raw_writel(clkcon, S3C2410_CLKCON);
-
-       return 0;
-}
-
-static int s3c2410_upll_enable(struct clk *clk, int enable)
-{
-       unsigned long clkslow = __raw_readl(S3C2410_CLKSLOW);
-       unsigned long orig = clkslow;
-
-       if (enable)
-               clkslow &= ~S3C2410_CLKSLOW_UCLK_OFF;
-       else
-               clkslow |= S3C2410_CLKSLOW_UCLK_OFF;
-
-       __raw_writel(clkslow, S3C2410_CLKSLOW);
-
-       /* if we started the UPLL, then allow to settle */
-
-       if (enable && (orig & S3C2410_CLKSLOW_UCLK_OFF))
-               udelay(200);
-
-       return 0;
-}
-
-/* standard clock definitions */
-
-static struct clk init_clocks_disable[] = {
-       {
-               .name           = "nand",
-               .id             = -1,
-               .parent         = &clk_h,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_NAND,
-       }, {
-               .name           = "sdi",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_SDI,
-       }, {
-               .name           = "adc",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_ADC,
-       }, {
-               .name           = "i2c",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_IIC,
-       }, {
-               .name           = "iis",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_IIS,
-       }, {
-               .name           = "spi",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_SPI,
-       }
-};
-
-static struct clk init_clocks[] = {
-       {
-               .name           = "lcd",
-               .id             = -1,
-               .parent         = &clk_h,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_LCDC,
-       }, {
-               .name           = "gpio",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_GPIO,
-       }, {
-               .name           = "usb-host",
-               .id             = -1,
-               .parent         = &clk_h,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_USBH,
-       }, {
-               .name           = "usb-device",
-               .id             = -1,
-               .parent         = &clk_h,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_USBD,
-       }, {
-               .name           = "timers",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_PWMT,
-       }, {
-               .name           = "uart",
-               .id             = 0,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_UART0,
-       }, {
-               .name           = "uart",
-               .id             = 1,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_UART1,
-       }, {
-               .name           = "uart",
-               .id             = 2,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_UART2,
-       }, {
-               .name           = "rtc",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2410_clkcon_enable,
-               .ctrlbit        = S3C2410_CLKCON_RTC,
-       }, {
-               .name           = "watchdog",
-               .id             = -1,
-               .parent         = &clk_p,
-               .ctrlbit        = 0,
-       }, {
-               .name           = "usb-bus-host",
-               .id             = -1,
-               .parent         = &clk_usb_bus,
-       }, {
-               .name           = "usb-bus-gadget",
-               .id             = -1,
-               .parent         = &clk_usb_bus,
-       },
-};
-
-/* s3c2410_baseclk_add()
- *
- * Add all the clocks used by the s3c2410 or compatible CPUs
- * such as the S3C2440 and S3C2442.
- *
- * We cannot use a system device as we are needed before any
- * of the init-calls that initialise the devices are actually
- * done.
-*/
-
-int __init s3c2410_baseclk_add(void)
-{
-       unsigned long clkslow = __raw_readl(S3C2410_CLKSLOW);
-       unsigned long clkcon  = __raw_readl(S3C2410_CLKCON);
-       struct clk *clkp;
-       struct clk *xtal;
-       int ret;
-       int ptr;
-
-       clk_upll.enable = s3c2410_upll_enable;
-
-       if (s3c24xx_register_clock(&clk_usb_bus) < 0)
-               printk(KERN_ERR "failed to register usb bus clock\n");
-
-       /* register clocks from clock array */
-
-       clkp = init_clocks;
-       for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
-               /* ensure that we note the clock state */
-
-               clkp->usage = clkcon & clkp->ctrlbit ? 1 : 0;
-
-               ret = s3c24xx_register_clock(clkp);
-               if (ret < 0) {
-                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
-                              clkp->name, ret);
-               }
-       }
-
-       /* We must be careful disabling the clocks we are not intending to
-        * be using at boot time, as subsytems such as the LCD which do
-        * their own DMA requests to the bus can cause the system to lockup
-        * if they where in the middle of requesting bus access.
-        *
-        * Disabling the LCD clock if the LCD is active is very dangerous,
-        * and therefore the bootloader should be careful to not enable
-        * the LCD clock if it is not needed.
-       */
-
-       /* install (and disable) the clocks we do not need immediately */
-
-       clkp = init_clocks_disable;
-       for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
-
-               ret = s3c24xx_register_clock(clkp);
-               if (ret < 0) {
-                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
-                              clkp->name, ret);
-               }
-
-               s3c2410_clkcon_enable(clkp, 0);
-       }
-
-       /* show the clock-slow value */
-
-       xtal = clk_get(NULL, "xtal");
-
-       printk("CLOCK: Slow mode (%ld.%ld MHz), %s, MPLL %s, UPLL %s\n",
-              print_mhz(clk_get_rate(xtal) /
-                        ( 2 * S3C2410_CLKSLOW_GET_SLOWVAL(clkslow))),
-              (clkslow & S3C2410_CLKSLOW_SLOW) ? "slow" : "fast",
-              (clkslow & S3C2410_CLKSLOW_MPLL_OFF) ? "off" : "on",
-              (clkslow & S3C2410_CLKSLOW_UCLK_OFF) ? "off" : "on");
-
-       return 0;
-}
diff --git a/arch/arm/mach-s3c2410/s3c2410-dma.c b/arch/arm/mach-s3c2410/s3c2410-dma.c
deleted file mode 100644 (file)
index e67ba39..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2410-dma.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2410 DMA selection
- *
- * http://armlinux.simtec.co.uk/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/sysdev.h>
-#include <linux/serial_core.h>
-
-#include <asm/dma.h>
-#include <asm/arch/dma.h>
-#include "dma.h"
-
-#include "cpu.h"
-
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-ac97.h>
-#include <asm/arch/regs-mem.h>
-#include <asm/arch/regs-lcd.h>
-#include <asm/arch/regs-sdi.h>
-#include <asm/arch/regs-iis.h>
-#include <asm/arch/regs-spi.h>
-
-static struct s3c24xx_dma_map __initdata s3c2410_dma_mappings[] = {
-       [DMACH_XD0] = {
-               .name           = "xdreq0",
-               .channels[0]    = S3C2410_DCON_CH0_XDREQ0 | DMA_CH_VALID,
-       },
-       [DMACH_XD1] = {
-               .name           = "xdreq1",
-               .channels[1]    = S3C2410_DCON_CH1_XDREQ1 | DMA_CH_VALID,
-       },
-       [DMACH_SDI] = {
-               .name           = "sdi",
-               .channels[0]    = S3C2410_DCON_CH0_SDI | DMA_CH_VALID,
-               .channels[2]    = S3C2410_DCON_CH2_SDI | DMA_CH_VALID,
-               .channels[3]    = S3C2410_DCON_CH3_SDI | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
-               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
-       },
-       [DMACH_SPI0] = {
-               .name           = "spi0",
-               .channels[1]    = S3C2410_DCON_CH1_SPI | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_SPI + S3C2410_SPTDAT,
-               .hw_addr.from   = S3C2410_PA_SPI + S3C2410_SPRDAT,
-       },
-       [DMACH_SPI1] = {
-               .name           = "spi1",
-               .channels[3]    = S3C2410_DCON_CH3_SPI | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_SPI + 0x20 + S3C2410_SPTDAT,
-               .hw_addr.from   = S3C2410_PA_SPI + 0x20 + S3C2410_SPRDAT,
-       },
-       [DMACH_UART0] = {
-               .name           = "uart0",
-               .channels[0]    = S3C2410_DCON_CH0_UART0 | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_UART0 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART0 + S3C2410_URXH,
-       },
-       [DMACH_UART1] = {
-               .name           = "uart1",
-               .channels[1]    = S3C2410_DCON_CH1_UART1 | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_UART1 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART1 + S3C2410_URXH,
-       },
-       [DMACH_UART2] = {
-               .name           = "uart2",
-               .channels[3]    = S3C2410_DCON_CH3_UART2 | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_UART2 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART2 + S3C2410_URXH,
-       },
-       [DMACH_TIMER] = {
-               .name           = "timer",
-               .channels[0]    = S3C2410_DCON_CH0_TIMER | DMA_CH_VALID,
-               .channels[2]    = S3C2410_DCON_CH2_TIMER | DMA_CH_VALID,
-               .channels[3]    = S3C2410_DCON_CH3_TIMER | DMA_CH_VALID,
-       },
-       [DMACH_I2S_IN] = {
-               .name           = "i2s-sdi",
-               .channels[1]    = S3C2410_DCON_CH1_I2SSDI | DMA_CH_VALID,
-               .channels[2]    = S3C2410_DCON_CH2_I2SSDI | DMA_CH_VALID,
-               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
-       },
-       [DMACH_I2S_OUT] = {
-               .name           = "i2s-sdo",
-               .channels[2]    = S3C2410_DCON_CH2_I2SSDO | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
-       },
-       [DMACH_USB_EP1] = {
-               .name           = "usb-ep1",
-               .channels[0]    = S3C2410_DCON_CH0_USBEP1 | DMA_CH_VALID,
-       },
-       [DMACH_USB_EP2] = {
-               .name           = "usb-ep2",
-               .channels[1]    = S3C2410_DCON_CH1_USBEP2 | DMA_CH_VALID,
-       },
-       [DMACH_USB_EP3] = {
-               .name           = "usb-ep3",
-               .channels[2]    = S3C2410_DCON_CH2_USBEP3 | DMA_CH_VALID,
-       },
-       [DMACH_USB_EP4] = {
-               .name           = "usb-ep4",
-               .channels[3]    =S3C2410_DCON_CH3_USBEP4 | DMA_CH_VALID,
-       },
-};
-
-static void s3c2410_dma_select(struct s3c2410_dma_chan *chan,
-                              struct s3c24xx_dma_map *map)
-{
-       chan->dcon = map->channels[chan->number] & ~DMA_CH_VALID;
-}
-
-static struct s3c24xx_dma_selection __initdata s3c2410_dma_sel = {
-       .select         = s3c2410_dma_select,
-       .dcon_mask      = 7 << 24,
-       .map            = s3c2410_dma_mappings,
-       .map_size       = ARRAY_SIZE(s3c2410_dma_mappings),
-};
-
-static int s3c2410_dma_add(struct sys_device *sysdev)
-{
-       return s3c24xx_dma_init_map(&s3c2410_dma_sel);
-}
-
-#if defined(CONFIG_CPU_S3C2410)
-static struct sysdev_driver s3c2410_dma_driver = {
-       .add    = s3c2410_dma_add,
-};
-
-static int __init s3c2410_dma_init(void)
-{
-       return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_dma_driver);
-}
-
-arch_initcall(s3c2410_dma_init);
-#endif
-
-#if defined(CONFIG_CPU_S3C2442)
-/* S3C2442 DMA contains the same selection table as the S3C2410 */
-static struct sysdev_driver s3c2442_dma_driver = {
-       .add    = s3c2410_dma_add,
-};
-
-static int __init s3c2442_dma_init(void)
-{
-       return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_dma_driver);
-}
-
-arch_initcall(s3c2442_dma_init);
-#endif
-
diff --git a/arch/arm/mach-s3c2410/s3c2410-gpio.c b/arch/arm/mach-s3c2410/s3c2410-gpio.c
deleted file mode 100644 (file)
index ec3a276..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2410-gpio.c
- *
- * Copyright (c) 2004-2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2410 GPIO 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-
-#include <asm/hardware.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-#include <asm/arch/regs-gpio.h>
-
-int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
-                          unsigned int config)
-{
-       void __iomem *reg = S3C24XX_EINFLT0;
-       unsigned long flags;
-       unsigned long val;
-
-       if (pin < S3C2410_GPG8 || pin > S3C2410_GPG15)
-               return -1;
-
-       config &= 0xff;
-
-       pin -= S3C2410_GPG8;
-       reg += pin & ~3;
-
-       local_irq_save(flags);
-
-       /* update filter width and clock source */
-
-       val = __raw_readl(reg);
-       val &= ~(0xff << ((pin & 3) * 8));
-       val |= config << ((pin & 3) * 8);
-       __raw_writel(val, reg);
-
-       /* update filter enable */
-
-       val = __raw_readl(S3C24XX_EXTINT2);
-       val &= ~(1 << ((pin * 4) + 3));
-       val |= on << ((pin * 4) + 3);
-       __raw_writel(val, S3C24XX_EXTINT2);
-
-       local_irq_restore(flags);
-
-       return 0;
-}
-
-EXPORT_SYMBOL(s3c2410_gpio_irqfilter);
diff --git a/arch/arm/mach-s3c2410/s3c2410-irq.c b/arch/arm/mach-s3c2410/s3c2410-irq.c
deleted file mode 100644 (file)
index c796c9c..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2410-irq.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
-*/
-
-#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 "cpu.h"
-#include "pm.h"
-
-static int s3c2410_irq_add(struct sys_device *sysdev)
-{
-       return 0;
-}
-
-static struct sysdev_driver s3c2410_irq_driver = {
-       .add            = s3c2410_irq_add,
-       .suspend        = s3c24xx_irq_suspend,
-       .resume         = s3c24xx_irq_resume,
-};
-
-static int s3c2410_irq_init(void)
-{
-       return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_irq_driver);
-}
-
-arch_initcall(s3c2410_irq_init);
diff --git a/arch/arm/mach-s3c2410/s3c2410-pm.c b/arch/arm/mach-s3c2410/s3c2410-pm.c
deleted file mode 100644 (file)
index 8bb6e5e..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2410-pm.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2410 (and compatible) Power Manager (Suspend-To-RAM) 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <linux/init.h>
-#include <linux/suspend.h>
-#include <linux/errno.h>
-#include <linux/time.h>
-#include <linux/sysdev.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-
-#include <asm/mach-types.h>
-
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/h1940.h>
-
-#include "cpu.h"
-#include "pm.h"
-
-#ifdef CONFIG_S3C2410_PM_DEBUG
-extern void pm_dbg(const char *fmt, ...);
-#define DBG(fmt...) pm_dbg(fmt)
-#else
-#define DBG(fmt...) printk(KERN_DEBUG fmt)
-#endif
-
-static void s3c2410_pm_prepare(void)
-{
-       /* ensure at least GSTATUS3 has the resume address */
-
-       __raw_writel(virt_to_phys(s3c2410_cpu_resume), S3C2410_GSTATUS3);
-
-       DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3));
-       DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4));
-
-       if (machine_is_h1940()) {
-               void *base = phys_to_virt(H1940_SUSPEND_CHECK);
-               unsigned long ptr;
-               unsigned long calc = 0;
-
-               /* generate check for the bootloader to check on resume */
-
-               for (ptr = 0; ptr < 0x40000; ptr += 0x400)
-                       calc += __raw_readl(base+ptr);
-
-               __raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
-       }
-
-       /* the RX3715 uses similar code and the same H1940 and the
-        * same offsets for resume and checksum pointers */
-
-       if (machine_is_rx3715()) {
-               void *base = phys_to_virt(H1940_SUSPEND_CHECK);
-               unsigned long ptr;
-               unsigned long calc = 0;
-
-               /* generate check for the bootloader to check on resume */
-
-               for (ptr = 0; ptr < 0x40000; ptr += 0x4)
-                       calc += __raw_readl(base+ptr);
-
-               __raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
-       }
-
-       if ( machine_is_aml_m5900() )
-               s3c2410_gpio_setpin(S3C2410_GPF2, 1);
-
-}
-
-static int s3c2410_pm_resume(struct sys_device *dev)
-{
-       unsigned long tmp;
-
-       /* unset the return-from-sleep flag, to ensure reset */
-
-       tmp = __raw_readl(S3C2410_GSTATUS2);
-       tmp &= S3C2410_GSTATUS2_OFFRESET;
-       __raw_writel(tmp, S3C2410_GSTATUS2);
-
-       if ( machine_is_aml_m5900() )
-               s3c2410_gpio_setpin(S3C2410_GPF2, 0);
-
-       return 0;
-}
-
-static int s3c2410_pm_add(struct sys_device *dev)
-{
-       pm_cpu_prep = s3c2410_pm_prepare;
-       pm_cpu_sleep = s3c2410_cpu_suspend;
-
-       return 0;
-}
-
-#if defined(CONFIG_CPU_S3C2410)
-static struct sysdev_driver s3c2410_pm_driver = {
-       .add            = s3c2410_pm_add,
-       .resume         = s3c2410_pm_resume,
-};
-
-/* register ourselves */
-
-static int __init s3c2410_pm_drvinit(void)
-{
-       return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_pm_driver);
-}
-
-arch_initcall(s3c2410_pm_drvinit);
-#endif
-
-#if defined(CONFIG_CPU_S3C2440)
-static struct sysdev_driver s3c2440_pm_driver = {
-       .add            = s3c2410_pm_add,
-       .resume         = s3c2410_pm_resume,
-};
-
-static int __init s3c2440_pm_drvinit(void)
-{
-       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_pm_driver);
-}
-
-arch_initcall(s3c2440_pm_drvinit);
-#endif
-
-#if defined(CONFIG_CPU_S3C2442)
-static struct sysdev_driver s3c2442_pm_driver = {
-       .add            = s3c2410_pm_add,
-       .resume         = s3c2410_pm_resume,
-};
-
-static int __init s3c2442_pm_drvinit(void)
-{
-       return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_pm_driver);
-}
-
-arch_initcall(s3c2442_pm_drvinit);
-#endif
diff --git a/arch/arm/mach-s3c2410/s3c2410-sleep.S b/arch/arm/mach-s3c2410/s3c2410-sleep.S
deleted file mode 100644 (file)
index 9179a10..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2410-sleep.S
- *
- * Copyright (c) 2004 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2410 Power Manager (Suspend-To-RAM) support
- *
- * Based on PXA/SA1100 sleep code by:
- *     Nicolas Pitre, (c) 2002 Monta Vista Software Inc
- *     Cliff Brake, (c) 2001
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <linux/linkage.h>
-#include <asm/assembler.h>
-#include <asm/hardware.h>
-#include <asm/arch/map.h>
-
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-clock.h>
-#include <asm/arch/regs-mem.h>
-#include <asm/arch/regs-serial.h>
-
-       /* s3c2410_cpu_suspend
-        *
-        * put the cpu into sleep mode
-       */
-
-ENTRY(s3c2410_cpu_suspend)
-       @@ prepare cpu to sleep
-
-       ldr     r4, =S3C2410_REFRESH
-       ldr     r5, =S3C24XX_MISCCR
-       ldr     r6, =S3C2410_CLKCON
-       ldr     r7, [ r4 ]              @ get REFRESH (and ensure in TLB)
-       ldr     r8, [ r5 ]              @ get MISCCR (and ensure in TLB)
-       ldr     r9, [ r6 ]              @ get CLKCON (and ensure in TLB)
-
-       orr     r7, r7, #S3C2410_REFRESH_SELF   @ SDRAM sleep command
-       orr     r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals
-       orr     r9, r9, #S3C2410_CLKCON_POWER   @ power down command
-
-       teq     pc, #0                  @ first as a trial-run to load cache
-       bl      s3c2410_do_sleep
-       teq     r0, r0                  @ now do it for real
-       b       s3c2410_do_sleep        @
-
-       @@ align next bit of code to cache line
-       .align  8
-s3c2410_do_sleep:
-       streq   r7, [ r4 ]                      @ SDRAM sleep command
-       streq   r8, [ r5 ]                      @ SDRAM power-down config
-       streq   r9, [ r6 ]                      @ CPU sleep
-1:     beq     1b
-       mov     pc, r14
index 4cdc0d70c19f3fa6203440a6ea2f3082575c9861..1a86a9803753470acb87ea3476d30c9ece2a87d8 100644 (file)
 #include <asm/arch/regs-clock.h>
 #include <asm/arch/regs-serial.h>
 
-#include "s3c2410.h"
-#include "cpu.h"
-#include "devs.h"
-#include "clock.h"
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/clock.h>
 
 /* Initial IO mappings */
 
@@ -110,7 +110,7 @@ static struct sys_device s3c2410_sysdev = {
 
 /* need to register class before we actually register the device, and
  * we also need to ensure that it has been initialised before any of the
- * drivers even try to use it (even if not on an s3c2440 based system)
+ * drivers even try to use it (even if not on an s3c2410 based system)
  * as a driver which may support both 2410 and 2440 may try and use it.
 */
 
diff --git a/arch/arm/mach-s3c2410/s3c2410.h b/arch/arm/mach-s3c2410/s3c2410.h
deleted file mode 100644 (file)
index fbed084..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* arch/arm/mach-s3c2410/s3c2410.h
- *
- * Copyright (c) 2004 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Header file for s3c2410 machine directory
- *
- * 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.
- *
-*/
-
-#ifdef CONFIG_CPU_S3C2410
-
-extern  int s3c2410_init(void);
-
-extern void s3c2410_map_io(struct map_desc *mach_desc, int size);
-
-extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no);
-
-extern void s3c2410_init_clocks(int xtal);
-
-extern  int s3c2410_baseclk_add(void);
-
-#else
-#define s3c2410_init_clocks NULL
-#define s3c2410_init_uarts NULL
-#define s3c2410_map_io NULL
-#define s3c2410_init NULL
-#endif
diff --git a/arch/arm/mach-s3c2410/s3c2412-clock.c b/arch/arm/mach-s3c2410/s3c2412-clock.c
deleted file mode 100644 (file)
index 8f94ad8..0000000
+++ /dev/null
@@ -1,716 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2412-clock.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2412,S3C2413 Clock control 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/sysdev.h>
-#include <linux/clk.h>
-#include <linux/mutex.h>
-#include <linux/delay.h>
-#include <linux/serial_core.h>
-
-#include <asm/mach/map.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-clock.h>
-#include <asm/arch/regs-gpio.h>
-
-#include "s3c2412.h"
-#include "clock.h"
-#include "cpu.h"
-
-/* We currently have to assume that the system is running
- * from the XTPll input, and that all ***REFCLKs are being
- * fed from it, as we cannot read the state of OM[4] from
- * software.
- *
- * It would be possible for each board initialisation to
- * set the correct muxing at initialisation
-*/
-
-static int s3c2412_clkcon_enable(struct clk *clk, int enable)
-{
-       unsigned int clocks = clk->ctrlbit;
-       unsigned long clkcon;
-
-       clkcon = __raw_readl(S3C2410_CLKCON);
-
-       if (enable)
-               clkcon |= clocks;
-       else
-               clkcon &= ~clocks;
-
-       __raw_writel(clkcon, S3C2410_CLKCON);
-
-       return 0;
-}
-
-static int s3c2412_upll_enable(struct clk *clk, int enable)
-{
-       unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
-       unsigned long orig = upllcon;
-
-       if (!enable)
-               upllcon |= S3C2412_PLLCON_OFF;
-       else
-               upllcon &= ~S3C2412_PLLCON_OFF;
-
-       __raw_writel(upllcon, S3C2410_UPLLCON);
-
-       /* allow ~150uS for the PLL to settle and lock */
-
-       if (enable && (orig & S3C2412_PLLCON_OFF))
-               udelay(150);
-
-       return 0;
-}
-
-/* clock selections */
-
-/* CPU EXTCLK input */
-static struct clk clk_ext = {
-       .name           = "extclk",
-       .id             = -1,
-};
-
-static struct clk clk_erefclk = {
-       .name           = "erefclk",
-       .id             = -1,
-};
-
-static struct clk clk_urefclk = {
-       .name           = "urefclk",
-       .id             = -1,
-};
-
-static int s3c2412_setparent_usysclk(struct clk *clk, struct clk *parent)
-{
-       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
-
-       if (parent == &clk_urefclk)
-               clksrc &= ~S3C2412_CLKSRC_USYSCLK_UPLL;
-       else if (parent == &clk_upll)
-               clksrc |= S3C2412_CLKSRC_USYSCLK_UPLL;
-       else
-               return -EINVAL;
-
-       clk->parent = parent;
-
-       __raw_writel(clksrc, S3C2412_CLKSRC);
-       return 0;
-}
-
-static struct clk clk_usysclk = {
-       .name           = "usysclk",
-       .id             = -1,
-       .parent         = &clk_xtal,
-       .set_parent     = s3c2412_setparent_usysclk,
-};
-
-static struct clk clk_mrefclk = {
-       .name           = "mrefclk",
-       .parent         = &clk_xtal,
-       .id             = -1,
-};
-
-static struct clk clk_mdivclk = {
-       .name           = "mdivclk",
-       .parent         = &clk_xtal,
-       .id             = -1,
-};
-
-static int s3c2412_setparent_usbsrc(struct clk *clk, struct clk *parent)
-{
-       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
-
-       if (parent == &clk_usysclk)
-               clksrc &= ~S3C2412_CLKSRC_USBCLK_HCLK;
-       else if (parent == &clk_h)
-               clksrc |= S3C2412_CLKSRC_USBCLK_HCLK;
-       else
-               return -EINVAL;
-
-       clk->parent = parent;
-
-       __raw_writel(clksrc, S3C2412_CLKSRC);
-       return 0;
-}
-
-static unsigned long s3c2412_roundrate_usbsrc(struct clk *clk,
-                                             unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       int div;
-
-       if (rate > parent_rate)
-               return parent_rate;
-
-       div = parent_rate / rate;
-       if (div > 2)
-               div = 2;
-
-       return parent_rate / div;
-}
-
-static unsigned long s3c2412_getrate_usbsrc(struct clk *clk)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long div = __raw_readl(S3C2410_CLKDIVN);
-
-       return parent_rate / ((div & S3C2412_CLKDIVN_USB48DIV) ? 2 : 1);
-}
-
-static int s3c2412_setrate_usbsrc(struct clk *clk, unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long clkdivn = __raw_readl(S3C2410_CLKDIVN);
-
-       rate = s3c2412_roundrate_usbsrc(clk, rate);
-
-       if ((parent_rate / rate) == 2)
-               clkdivn |= S3C2412_CLKDIVN_USB48DIV;
-       else
-               clkdivn &= ~S3C2412_CLKDIVN_USB48DIV;
-
-       __raw_writel(clkdivn, S3C2410_CLKDIVN);
-       return 0;
-}
-
-static struct clk clk_usbsrc = {
-       .name           = "usbsrc",
-       .id             = -1,
-       .get_rate       = s3c2412_getrate_usbsrc,
-       .set_rate       = s3c2412_setrate_usbsrc,
-       .round_rate     = s3c2412_roundrate_usbsrc,
-       .set_parent     = s3c2412_setparent_usbsrc,
-};
-
-static int s3c2412_setparent_msysclk(struct clk *clk, struct clk *parent)
-{
-       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
-
-       if (parent == &clk_mdivclk)
-               clksrc &= ~S3C2412_CLKSRC_MSYSCLK_MPLL;
-       else if (parent == &clk_upll)
-               clksrc |= S3C2412_CLKSRC_MSYSCLK_MPLL;
-       else
-               return -EINVAL;
-
-       clk->parent = parent;
-
-       __raw_writel(clksrc, S3C2412_CLKSRC);
-       return 0;
-}
-
-static struct clk clk_msysclk = {
-       .name           = "msysclk",
-       .id             = -1,
-       .set_parent     = s3c2412_setparent_msysclk,
-};
-
-/* these next clocks have an divider immediately after them,
- * so we can register them with their divider and leave out the
- * intermediate clock stage
-*/
-static unsigned long s3c2412_roundrate_clksrc(struct clk *clk,
-                                             unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       int div;
-
-       if (rate > parent_rate)
-               return parent_rate;
-
-       /* note, we remove the +/- 1 calculations as they cancel out */
-
-       div = (rate / parent_rate);
-
-       if (div < 1)
-               div = 1;
-       else if (div > 16)
-               div = 16;
-
-       return parent_rate / div;
-}
-
-static int s3c2412_setparent_uart(struct clk *clk, struct clk *parent)
-{
-       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
-
-       if (parent == &clk_erefclk)
-               clksrc &= ~S3C2412_CLKSRC_UARTCLK_MPLL;
-       else if (parent == &clk_mpll)
-               clksrc |= S3C2412_CLKSRC_UARTCLK_MPLL;
-       else
-               return -EINVAL;
-
-       clk->parent = parent;
-
-       __raw_writel(clksrc, S3C2412_CLKSRC);
-       return 0;
-}
-
-static unsigned long s3c2412_getrate_uart(struct clk *clk)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long div = __raw_readl(S3C2410_CLKDIVN);
-
-       div &= S3C2412_CLKDIVN_UARTDIV_MASK;
-       div >>= S3C2412_CLKDIVN_UARTDIV_SHIFT;
-
-       return parent_rate / (div + 1);
-}
-
-static int s3c2412_setrate_uart(struct clk *clk, unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long clkdivn = __raw_readl(S3C2410_CLKDIVN);
-
-       rate = s3c2412_roundrate_clksrc(clk, rate);
-
-       clkdivn &= ~S3C2412_CLKDIVN_UARTDIV_MASK;
-       clkdivn |= ((parent_rate / rate) - 1) << S3C2412_CLKDIVN_UARTDIV_SHIFT;
-
-       __raw_writel(clkdivn, S3C2410_CLKDIVN);
-       return 0;
-}
-
-static struct clk clk_uart = {
-       .name           = "uartclk",
-       .id             = -1,
-       .get_rate       = s3c2412_getrate_uart,
-       .set_rate       = s3c2412_setrate_uart,
-       .set_parent     = s3c2412_setparent_uart,
-       .round_rate     = s3c2412_roundrate_clksrc,
-};
-
-static int s3c2412_setparent_i2s(struct clk *clk, struct clk *parent)
-{
-       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
-
-       if (parent == &clk_erefclk)
-               clksrc &= ~S3C2412_CLKSRC_I2SCLK_MPLL;
-       else if (parent == &clk_mpll)
-               clksrc |= S3C2412_CLKSRC_I2SCLK_MPLL;
-       else
-               return -EINVAL;
-
-       clk->parent = parent;
-
-       __raw_writel(clksrc, S3C2412_CLKSRC);
-       return 0;
-}
-
-static unsigned long s3c2412_getrate_i2s(struct clk *clk)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long div = __raw_readl(S3C2410_CLKDIVN);
-
-       div &= S3C2412_CLKDIVN_I2SDIV_MASK;
-       div >>= S3C2412_CLKDIVN_I2SDIV_SHIFT;
-
-       return parent_rate / (div + 1);
-}
-
-static int s3c2412_setrate_i2s(struct clk *clk, unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long clkdivn = __raw_readl(S3C2410_CLKDIVN);
-
-       rate = s3c2412_roundrate_clksrc(clk, rate);
-
-       clkdivn &= ~S3C2412_CLKDIVN_I2SDIV_MASK;
-       clkdivn |= ((parent_rate / rate) - 1) << S3C2412_CLKDIVN_I2SDIV_SHIFT;
-
-       __raw_writel(clkdivn, S3C2410_CLKDIVN);
-       return 0;
-}
-
-static struct clk clk_i2s = {
-       .name           = "i2sclk",
-       .id             = -1,
-       .get_rate       = s3c2412_getrate_i2s,
-       .set_rate       = s3c2412_setrate_i2s,
-       .set_parent     = s3c2412_setparent_i2s,
-       .round_rate     = s3c2412_roundrate_clksrc,
-};
-
-static int s3c2412_setparent_cam(struct clk *clk, struct clk *parent)
-{
-       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
-
-       if (parent == &clk_usysclk)
-               clksrc &= ~S3C2412_CLKSRC_CAMCLK_HCLK;
-       else if (parent == &clk_h)
-               clksrc |= S3C2412_CLKSRC_CAMCLK_HCLK;
-       else
-               return -EINVAL;
-
-       clk->parent = parent;
-
-       __raw_writel(clksrc, S3C2412_CLKSRC);
-       return 0;
-}
-static unsigned long s3c2412_getrate_cam(struct clk *clk)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long div = __raw_readl(S3C2410_CLKDIVN);
-
-       div &= S3C2412_CLKDIVN_CAMDIV_MASK;
-       div >>= S3C2412_CLKDIVN_CAMDIV_SHIFT;
-
-       return parent_rate / (div + 1);
-}
-
-static int s3c2412_setrate_cam(struct clk *clk, unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long clkdivn = __raw_readl(S3C2410_CLKDIVN);
-
-       rate = s3c2412_roundrate_clksrc(clk, rate);
-
-       clkdivn &= ~S3C2412_CLKDIVN_CAMDIV_MASK;
-       clkdivn |= ((parent_rate / rate) - 1) << S3C2412_CLKDIVN_CAMDIV_SHIFT;
-
-       __raw_writel(clkdivn, S3C2410_CLKDIVN);
-       return 0;
-}
-
-static struct clk clk_cam = {
-       .name           = "camif-upll", /* same as 2440 name */
-       .id             = -1,
-       .get_rate       = s3c2412_getrate_cam,
-       .set_rate       = s3c2412_setrate_cam,
-       .set_parent     = s3c2412_setparent_cam,
-       .round_rate     = s3c2412_roundrate_clksrc,
-};
-
-/* standard clock definitions */
-
-static struct clk init_clocks_disable[] = {
-       {
-               .name           = "nand",
-               .id             = -1,
-               .parent         = &clk_h,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_NAND,
-       }, {
-               .name           = "sdi",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_SDI,
-       }, {
-               .name           = "adc",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_ADC,
-       }, {
-               .name           = "i2c",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_IIC,
-       }, {
-               .name           = "iis",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_IIS,
-       }, {
-               .name           = "spi",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_SPI,
-       }
-};
-
-static struct clk init_clocks[] = {
-       {
-               .name           = "dma",
-               .id             = 0,
-               .parent         = &clk_h,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_DMA0,
-       }, {
-               .name           = "dma",
-               .id             = 1,
-               .parent         = &clk_h,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_DMA1,
-       }, {
-               .name           = "dma",
-               .id             = 2,
-               .parent         = &clk_h,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_DMA2,
-       }, {
-               .name           = "dma",
-               .id             = 3,
-               .parent         = &clk_h,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_DMA3,
-       }, {
-               .name           = "lcd",
-               .id             = -1,
-               .parent         = &clk_h,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_LCDC,
-       }, {
-               .name           = "gpio",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_GPIO,
-       }, {
-               .name           = "usb-host",
-               .id             = -1,
-               .parent         = &clk_h,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_USBH,
-       }, {
-               .name           = "usb-device",
-               .id             = -1,
-               .parent         = &clk_h,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_USBD,
-       }, {
-               .name           = "timers",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_PWMT,
-       }, {
-               .name           = "uart",
-               .id             = 0,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_UART0,
-       }, {
-               .name           = "uart",
-               .id             = 1,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_UART1,
-       }, {
-               .name           = "uart",
-               .id             = 2,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_UART2,
-       }, {
-               .name           = "rtc",
-               .id             = -1,
-               .parent         = &clk_p,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_RTC,
-       }, {
-               .name           = "watchdog",
-               .id             = -1,
-               .parent         = &clk_p,
-               .ctrlbit        = 0,
-       }, {
-               .name           = "usb-bus-gadget",
-               .id             = -1,
-               .parent         = &clk_usb_bus,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_USB_DEV48,
-       }, {
-               .name           = "usb-bus-host",
-               .id             = -1,
-               .parent         = &clk_usb_bus,
-               .enable         = s3c2412_clkcon_enable,
-               .ctrlbit        = S3C2412_CLKCON_USB_HOST48,
-       }
-};
-
-/* clocks to add where we need to check their parentage */
-
-struct clk_init {
-       struct clk      *clk;
-       unsigned int     bit;
-       struct clk      *src_0;
-       struct clk      *src_1;
-};
-
-static struct clk_init clks_src[] __initdata = {
-       {
-               .clk    = &clk_usysclk,
-               .bit    = S3C2412_CLKSRC_USBCLK_HCLK,
-               .src_0  = &clk_urefclk,
-               .src_1  = &clk_upll,
-       }, {
-               .clk    = &clk_i2s,
-               .bit    = S3C2412_CLKSRC_I2SCLK_MPLL,
-               .src_0  = &clk_erefclk,
-               .src_1  = &clk_mpll,
-       }, {
-               .clk    = &clk_cam,
-               .bit    = S3C2412_CLKSRC_CAMCLK_HCLK,
-               .src_0  = &clk_usysclk,
-               .src_1  = &clk_h,
-       }, {
-               .clk    = &clk_msysclk,
-               .bit    = S3C2412_CLKSRC_MSYSCLK_MPLL,
-               .src_0  = &clk_mdivclk,
-               .src_1  = &clk_mpll,
-       }, {
-               .clk    = &clk_uart,
-               .bit    = S3C2412_CLKSRC_UARTCLK_MPLL,
-               .src_0  = &clk_erefclk,
-               .src_1  = &clk_mpll,
-       }, {
-               .clk    = &clk_usbsrc,
-               .bit    = S3C2412_CLKSRC_USBCLK_HCLK,
-               .src_0  = &clk_usysclk,
-               .src_1  = &clk_h,
-       },
-};
-
-/* s3c2412_clk_initparents
- *
- * Initialise the parents for the clocks that we get at start-time
-*/
-
-static void __init s3c2412_clk_initparents(void)
-{
-       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
-       struct clk_init *cip = clks_src;
-       struct clk *src;
-       int ptr;
-       int ret;
-
-       for (ptr = 0; ptr < ARRAY_SIZE(clks_src); ptr++, cip++) {
-               ret = s3c24xx_register_clock(cip->clk);
-               if (ret < 0) {
-                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
-                              cip->clk->name, ret);
-               }
-
-               src = (clksrc & cip->bit) ? cip->src_1 : cip->src_0;
-
-               printk(KERN_INFO "%s: parent %s\n", cip->clk->name, src->name);
-               clk_set_parent(cip->clk, src);
-       }
-}
-
-/* clocks to add straight away */
-
-static struct clk *clks[] __initdata = {
-       &clk_ext,
-       &clk_usb_bus,
-       &clk_erefclk,
-       &clk_urefclk,
-       &clk_mrefclk,
-};
-
-int __init s3c2412_baseclk_add(void)
-{
-       unsigned long clkcon  = __raw_readl(S3C2410_CLKCON);
-       struct clk *clkp;
-       int ret;
-       int ptr;
-
-       clk_upll.enable = s3c2412_upll_enable;
-       clk_usb_bus.parent = &clk_usbsrc;
-       clk_usb_bus.rate = 0x0;
-
-       s3c2412_clk_initparents();
-
-       for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) {
-               clkp = clks[ptr];
-
-               ret = s3c24xx_register_clock(clkp);
-               if (ret < 0) {
-                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
-                              clkp->name, ret);
-               }
-       }
-
-       /* ensure usb bus clock is within correct rate of 48MHz */
-
-       if (clk_get_rate(&clk_usb_bus) != (48 * 1000 * 1000)) {
-               printk(KERN_INFO "Warning: USB bus clock not at 48MHz\n");
-
-               /* for the moment, let's use the UPLL, and see if we can
-                * get 48MHz */
-
-               clk_set_parent(&clk_usysclk, &clk_upll);
-               clk_set_parent(&clk_usbsrc, &clk_usysclk);
-               clk_set_rate(&clk_usbsrc, 48*1000*1000);
-       }
-
-       printk("S3C2412: upll %s, %ld.%03ld MHz, usb-bus %ld.%03ld MHz\n",
-              (__raw_readl(S3C2410_UPLLCON) & S3C2412_PLLCON_OFF) ? "off":"on",
-              print_mhz(clk_get_rate(&clk_upll)),
-              print_mhz(clk_get_rate(&clk_usb_bus)));
-
-       /* register clocks from clock array */
-
-       clkp = init_clocks;
-       for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
-               /* ensure that we note the clock state */
-
-               clkp->usage = clkcon & clkp->ctrlbit ? 1 : 0;
-
-               ret = s3c24xx_register_clock(clkp);
-               if (ret < 0) {
-                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
-                              clkp->name, ret);
-               }
-       }
-
-       /* We must be careful disabling the clocks we are not intending to
-        * be using at boot time, as subsytems such as the LCD which do
-        * their own DMA requests to the bus can cause the system to lockup
-        * if they where in the middle of requesting bus access.
-        *
-        * Disabling the LCD clock if the LCD is active is very dangerous,
-        * and therefore the bootloader should be careful to not enable
-        * the LCD clock if it is not needed.
-       */
-
-       /* install (and disable) the clocks we do not need immediately */
-
-       clkp = init_clocks_disable;
-       for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
-
-               ret = s3c24xx_register_clock(clkp);
-               if (ret < 0) {
-                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
-                              clkp->name, ret);
-               }
-
-               s3c2412_clkcon_enable(clkp, 0);
-       }
-
-       return 0;
-}
diff --git a/arch/arm/mach-s3c2410/s3c2412-dma.c b/arch/arm/mach-s3c2410/s3c2412-dma.c
deleted file mode 100644 (file)
index 138f726..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2412-dma.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2412 DMA selection
- *
- * http://armlinux.simtec.co.uk/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/sysdev.h>
-#include <linux/serial_core.h>
-
-#include <asm/dma.h>
-#include <asm/arch/dma.h>
-#include <asm/io.h>
-
-#include "dma.h"
-#include "cpu.h"
-
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-ac97.h>
-#include <asm/arch/regs-mem.h>
-#include <asm/arch/regs-lcd.h>
-#include <asm/arch/regs-sdi.h>
-#include <asm/arch/regs-iis.h>
-#include <asm/arch/regs-spi.h>
-
-#define MAP(x) { (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID }
-
-static struct s3c24xx_dma_map __initdata s3c2412_dma_mappings[] = {
-       [DMACH_XD0] = {
-               .name           = "xdreq0",
-               .channels       = MAP(S3C2412_DMAREQSEL_XDREQ0),
-       },
-       [DMACH_XD1] = {
-               .name           = "xdreq1",
-               .channels       = MAP(S3C2412_DMAREQSEL_XDREQ1),
-       },
-       [DMACH_SDI] = {
-               .name           = "sdi",
-               .channels       = MAP(S3C2412_DMAREQSEL_SDI),
-               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
-               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
-       },
-       [DMACH_SPI0] = {
-               .name           = "spi0",
-               .channels       = MAP(S3C2412_DMAREQSEL_SPI0TX),
-               .hw_addr.to     = S3C2410_PA_SPI + S3C2410_SPTDAT,
-               .hw_addr.from   = S3C2410_PA_SPI + S3C2410_SPRDAT,
-       },
-       [DMACH_SPI1] = {
-               .name           = "spi1",
-               .channels       = MAP(S3C2412_DMAREQSEL_SPI1TX),
-               .hw_addr.to     = S3C2410_PA_SPI + 0x20 + S3C2410_SPTDAT,
-               .hw_addr.from   = S3C2410_PA_SPI + 0x20 + S3C2410_SPRDAT,
-       },
-       [DMACH_UART0] = {
-               .name           = "uart0",
-               .channels       = MAP(S3C2412_DMAREQSEL_UART0_0),
-               .hw_addr.to     = S3C2410_PA_UART0 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART0 + S3C2410_URXH,
-       },
-       [DMACH_UART1] = {
-               .name           = "uart1",
-               .channels       = MAP(S3C2412_DMAREQSEL_UART1_0),
-               .hw_addr.to     = S3C2410_PA_UART1 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART1 + S3C2410_URXH,
-       },
-       [DMACH_UART2] = {
-               .name           = "uart2",
-               .channels       = MAP(S3C2412_DMAREQSEL_UART2_0),
-               .hw_addr.to     = S3C2410_PA_UART2 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART2 + S3C2410_URXH,
-       },
-       [DMACH_UART0_SRC2] = {
-               .name           = "uart0",
-               .channels       = MAP(S3C2412_DMAREQSEL_UART0_1),
-               .hw_addr.to     = S3C2410_PA_UART0 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART0 + S3C2410_URXH,
-       },
-       [DMACH_UART1_SRC2] = {
-               .name           = "uart1",
-               .channels       = MAP(S3C2412_DMAREQSEL_UART1_1),
-               .hw_addr.to     = S3C2410_PA_UART1 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART1 + S3C2410_URXH,
-       },
-       [DMACH_UART2_SRC2] = {
-               .name           = "uart2",
-               .channels       = MAP(S3C2412_DMAREQSEL_UART2_1),
-               .hw_addr.to     = S3C2410_PA_UART2 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART2 + S3C2410_URXH,
-       },
-       [DMACH_TIMER] = {
-               .name           = "timer",
-               .channels       = MAP(S3C2412_DMAREQSEL_TIMER),
-       },
-       [DMACH_I2S_IN] = {
-               .name           = "i2s-sdi",
-               .channels       = MAP(S3C2412_DMAREQSEL_I2SRX),
-               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
-       },
-       [DMACH_I2S_OUT] = {
-               .name           = "i2s-sdo",
-               .channels       = MAP(S3C2412_DMAREQSEL_I2STX),
-               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
-       },
-       [DMACH_USB_EP1] = {
-               .name           = "usb-ep1",
-               .channels       = MAP(S3C2412_DMAREQSEL_USBEP1),
-       },
-       [DMACH_USB_EP2] = {
-               .name           = "usb-ep2",
-               .channels       = MAP(S3C2412_DMAREQSEL_USBEP2),
-       },
-       [DMACH_USB_EP3] = {
-               .name           = "usb-ep3",
-               .channels       = MAP(S3C2412_DMAREQSEL_USBEP3),
-       },
-       [DMACH_USB_EP4] = {
-               .name           = "usb-ep4",
-               .channels       = MAP(S3C2412_DMAREQSEL_USBEP4),
-       },
-};
-
-static void s3c2412_dma_select(struct s3c2410_dma_chan *chan,
-                              struct s3c24xx_dma_map *map)
-{
-       writel(map->channels[0] | S3C2412_DMAREQSEL_HW,
-              chan->regs + S3C2412_DMA_DMAREQSEL);
-}
-
-static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = {
-       .select         = s3c2412_dma_select,
-       .dcon_mask      = 0,
-       .map            = s3c2412_dma_mappings,
-       .map_size       = ARRAY_SIZE(s3c2412_dma_mappings),
-};
-
-static int s3c2412_dma_add(struct sys_device *sysdev)
-{
-       return s3c24xx_dma_init_map(&s3c2412_dma_sel);
-}
-
-static struct sysdev_driver s3c2412_dma_driver = {
-       .add    = s3c2412_dma_add,
-};
-
-static int __init s3c2412_dma_init(void)
-{
-       return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_dma_driver);
-}
-
-arch_initcall(s3c2412_dma_init);
diff --git a/arch/arm/mach-s3c2410/s3c2412-irq.c b/arch/arm/mach-s3c2410/s3c2412-irq.c
deleted file mode 100644 (file)
index ffcc30b..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/* linux/arch/arm/mach-s3c2412/s3c2412-irq.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
-*/
-
-#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 <asm/hardware.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-#include <asm/mach/irq.h>
-
-#include <asm/arch/regs-irq.h>
-#include <asm/arch/regs-gpio.h>
-
-#include "cpu.h"
-#include "irq.h"
-#include "pm.h"
-
-/* the s3c2412 changes the behaviour of IRQ_EINT0 through IRQ_EINT3 by
- * having them turn up in both the INT* and the EINT* registers. Whilst
- * both show the status, they both now need to be acked when the IRQs
- * go off.
-*/
-
-static void
-s3c2412_irq_mask(unsigned int irqno)
-{
-       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
-       unsigned long mask;
-
-       mask = __raw_readl(S3C2410_INTMSK);
-       __raw_writel(mask | bitval, S3C2410_INTMSK);
-
-       mask = __raw_readl(S3C2412_EINTMASK);
-       __raw_writel(mask | bitval, S3C2412_EINTMASK);
-}
-
-static inline void
-s3c2412_irq_ack(unsigned int irqno)
-{
-       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
-
-       __raw_writel(bitval, S3C2412_EINTPEND);
-       __raw_writel(bitval, S3C2410_SRCPND);
-       __raw_writel(bitval, S3C2410_INTPND);
-}
-
-static inline void
-s3c2412_irq_maskack(unsigned int irqno)
-{
-       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
-       unsigned long mask;
-
-       mask = __raw_readl(S3C2410_INTMSK);
-       __raw_writel(mask|bitval, S3C2410_INTMSK);
-
-       mask = __raw_readl(S3C2412_EINTMASK);
-       __raw_writel(mask | bitval, S3C2412_EINTMASK);
-
-       __raw_writel(bitval, S3C2412_EINTPEND);
-       __raw_writel(bitval, S3C2410_SRCPND);
-       __raw_writel(bitval, S3C2410_INTPND);
-}
-
-static void
-s3c2412_irq_unmask(unsigned int irqno)
-{
-       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
-       unsigned long mask;
-
-       mask = __raw_readl(S3C2412_EINTMASK);
-       __raw_writel(mask & ~bitval, S3C2412_EINTMASK);
-
-       mask = __raw_readl(S3C2410_INTMSK);
-       __raw_writel(mask & ~bitval, S3C2410_INTMSK);
-}
-
-static struct irq_chip s3c2412_irq_eint0t4 = {
-       .ack       = s3c2412_irq_ack,
-       .mask      = s3c2412_irq_mask,
-       .unmask    = s3c2412_irq_unmask,
-       .set_wake  = s3c_irq_wake,
-       .set_type  = s3c_irqext_type,
-};
-
-static int s3c2412_irq_add(struct sys_device *sysdev)
-{
-       unsigned int irqno;
-
-       for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
-               set_irq_chip(irqno, &s3c2412_irq_eint0t4);
-               set_irq_handler(irqno, handle_edge_irq);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       return 0;
-}
-
-static struct sysdev_driver s3c2412_irq_driver = {
-       .add            = s3c2412_irq_add,
-       .suspend        = s3c24xx_irq_suspend,
-       .resume         = s3c24xx_irq_resume,
-};
-
-static int s3c2412_irq_init(void)
-{
-       return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_irq_driver);
-}
-
-arch_initcall(s3c2412_irq_init);
diff --git a/arch/arm/mach-s3c2410/s3c2412-pm.c b/arch/arm/mach-s3c2410/s3c2412-pm.c
deleted file mode 100644 (file)
index 19b6332..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2412-pm.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * http://armlinux.simtec.co.uk/.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <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/sysdev.h>
-#include <linux/platform_device.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-
-#include <asm/arch/regs-power.h>
-#include <asm/arch/regs-gpioj.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-dsc.h>
-
-#include "cpu.h"
-#include "pm.h"
-
-#include "s3c2412.h"
-
-static void s3c2412_cpu_suspend(void)
-{
-       unsigned long tmp;
-
-       /* set our standby method to sleep */
-
-       tmp = __raw_readl(S3C2412_PWRCFG);
-       tmp |= S3C2412_PWRCFG_STANDBYWFI_SLEEP;
-       __raw_writel(tmp, S3C2412_PWRCFG);
-
-       /* issue the standby signal into the pm unit. Note, we
-        * issue a write-buffer drain just in case */
-
-       tmp = 0;
-
-       asm("b 1f\n\t"
-           ".align 5\n\t"
-           "1:\n\t"
-           "mcr p15, 0, %0, c7, c10, 4\n\t"
-           "mcr p15, 0, %0, c7, c0, 4" :: "r" (tmp));
-
-       /* we should never get past here */
-
-       panic("sleep resumed to originator?");
-}
-
-static void s3c2412_pm_prepare(void)
-{
-}
-
-static int s3c2412_pm_add(struct sys_device *sysdev)
-{
-       pm_cpu_prep = s3c2412_pm_prepare;
-       pm_cpu_sleep = s3c2412_cpu_suspend;
-
-       return 0;
-}
-
-static struct sleep_save s3c2412_sleep[] = {
-       SAVE_ITEM(S3C2412_DSC0),
-       SAVE_ITEM(S3C2412_DSC1),
-       SAVE_ITEM(S3C2413_GPJDAT),
-       SAVE_ITEM(S3C2413_GPJCON),
-       SAVE_ITEM(S3C2413_GPJUP),
-
-       /* save the PWRCFG to get back to original sleep method */
-
-       SAVE_ITEM(S3C2412_PWRCFG),
-
-       /* save the sleep configuration anyway, just in case these
-        * get damaged during wakeup */
-
-       SAVE_ITEM(S3C2412_GPBSLPCON),
-       SAVE_ITEM(S3C2412_GPCSLPCON),
-       SAVE_ITEM(S3C2412_GPDSLPCON),
-       SAVE_ITEM(S3C2412_GPESLPCON),
-       SAVE_ITEM(S3C2412_GPFSLPCON),
-       SAVE_ITEM(S3C2412_GPGSLPCON),
-       SAVE_ITEM(S3C2412_GPHSLPCON),
-       SAVE_ITEM(S3C2413_GPJSLPCON),
-};
-
-static int s3c2412_pm_suspend(struct sys_device *dev, pm_message_t state)
-{
-       s3c2410_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
-       return 0;
-}
-
-static int s3c2412_pm_resume(struct sys_device *dev)
-{
-       unsigned long tmp;
-
-       tmp = __raw_readl(S3C2412_PWRCFG);
-       tmp &= ~S3C2412_PWRCFG_STANDBYWFI_MASK;
-       tmp |=  S3C2412_PWRCFG_STANDBYWFI_IDLE;
-       __raw_writel(tmp, S3C2412_PWRCFG);
-
-       s3c2410_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
-       return 0;
-}
-
-static struct sysdev_driver s3c2412_pm_driver = {
-       .add            = s3c2412_pm_add,
-       .suspend        = s3c2412_pm_suspend,
-       .resume         = s3c2412_pm_resume,
-};
-
-static __init int s3c2412_pm_init(void)
-{
-       return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver);
-}
-
-arch_initcall(s3c2412_pm_init);
diff --git a/arch/arm/mach-s3c2410/s3c2412.c b/arch/arm/mach-s3c2410/s3c2412.c
deleted file mode 100644 (file)
index 2f651a8..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2412.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * http://armlinux.simtec.co.uk/.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <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/sysdev.h>
-#include <linux/serial_core.h>
-#include <linux/platform_device.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/hardware.h>
-#include <asm/proc-fns.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-
-#include <asm/arch/idle.h>
-
-#include <asm/arch/regs-clock.h>
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-power.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-gpioj.h>
-#include <asm/arch/regs-dsc.h>
-
-#include "s3c2412.h"
-#include "cpu.h"
-#include "devs.h"
-#include "clock.h"
-#include "pm.h"
-
-#ifndef CONFIG_CPU_S3C2412_ONLY
-void __iomem *s3c24xx_va_gpio2 = S3C24XX_VA_GPIO;
-
-static inline void s3c2412_init_gpio2(void)
-{
-       s3c24xx_va_gpio2 = S3C24XX_VA_GPIO + 0x10;
-}
-#else
-#define s3c2412_init_gpio2() do { } while(0)
-#endif
-
-/* Initial IO mappings */
-
-static struct map_desc s3c2412_iodesc[] __initdata = {
-       IODESC_ENT(CLKPWR),
-       IODESC_ENT(LCD),
-       IODESC_ENT(TIMER),
-       IODESC_ENT(WATCHDOG),
-};
-
-/* uart registration process */
-
-void __init s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no)
-{
-       s3c24xx_init_uartdevs("s3c2412-uart", s3c2410_uart_resources, cfg, no);
-
-       /* rename devices that are s3c2412/s3c2413 specific */
-       s3c_device_sdi.name  = "s3c2412-sdi";
-       s3c_device_lcd.name  = "s3c2412-lcd";
-       s3c_device_nand.name = "s3c2412-nand";
-}
-
-/* s3c2412_idle
- *
- * use the standard idle call by ensuring the idle mode
- * in power config, then issuing the idle co-processor
- * instruction
-*/
-
-static void s3c2412_idle(void)
-{
-       unsigned long tmp;
-
-       /* ensure our idle mode is to go to idle */
-
-       tmp = __raw_readl(S3C2412_PWRCFG);
-       tmp &= ~S3C2412_PWRCFG_STANDBYWFI_MASK;
-       tmp |= S3C2412_PWRCFG_STANDBYWFI_IDLE;
-       __raw_writel(tmp, S3C2412_PWRCFG);
-
-       cpu_do_idle();
-}
-
-/* s3c2412_map_io
- *
- * register the standard cpu IO areas, and any passed in from the
- * machine specific initialisation.
-*/
-
-void __init s3c2412_map_io(struct map_desc *mach_desc, int mach_size)
-{
-       /* move base of IO */
-
-       s3c2412_init_gpio2();
-
-       /* set our idle function */
-
-       s3c24xx_idle = s3c2412_idle;
-
-       /* register our io-tables */
-
-       iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc));
-       iotable_init(mach_desc, mach_size);
-}
-
-void __init s3c2412_init_clocks(int xtal)
-{
-       unsigned long tmp;
-       unsigned long fclk;
-       unsigned long hclk;
-       unsigned long pclk;
-
-       /* now we've got our machine bits initialised, work out what
-        * clocks we've got */
-
-       fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), xtal*2);
-
-       tmp = __raw_readl(S3C2410_CLKDIVN);
-
-       /* work out clock scalings */
-
-       hclk = fclk / ((tmp & S3C2412_CLKDIVN_HDIVN_MASK) + 1);
-       hclk /= ((tmp & S3C2421_CLKDIVN_ARMDIVN) ? 2 : 1);
-       pclk = hclk / ((tmp & S3C2412_CLKDIVN_PDIVN) ? 2 : 1);
-
-       /* print brieft summary of clocks, etc */
-
-       printk("S3C2412: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n",
-              print_mhz(fclk), print_mhz(hclk), print_mhz(pclk));
-
-       /* initialise the clocks here, to allow other things like the
-        * console to use them
-        */
-
-       s3c24xx_setup_clocks(xtal, fclk, hclk, pclk);
-       s3c2412_baseclk_add();
-}
-
-/* need to register class before we actually register the device, and
- * we also need to ensure that it has been initialised before any of the
- * drivers even try to use it (even if not on an s3c2412 based system)
- * as a driver which may support both 2410 and 2440 may try and use it.
-*/
-
-struct sysdev_class s3c2412_sysclass = {
-       set_kset_name("s3c2412-core"),
-};
-
-static int __init s3c2412_core_init(void)
-{
-       return sysdev_class_register(&s3c2412_sysclass);
-}
-
-core_initcall(s3c2412_core_init);
-
-static struct sys_device s3c2412_sysdev = {
-       .cls            = &s3c2412_sysclass,
-};
-
-int __init s3c2412_init(void)
-{
-       printk("S3C2412: Initialising architecture\n");
-
-       return sysdev_register(&s3c2412_sysdev);
-}
diff --git a/arch/arm/mach-s3c2410/s3c2412.h b/arch/arm/mach-s3c2410/s3c2412.h
deleted file mode 100644 (file)
index c6e5603..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* arch/arm/mach-s3c2410/s3c2412.h
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Header file for s3c2412 cpu support
- *
- * 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.
-*/
-
-#ifdef CONFIG_CPU_S3C2412
-
-extern  int s3c2412_init(void);
-
-extern void s3c2412_map_io(struct map_desc *mach_desc, int size);
-
-extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no);
-
-extern void s3c2412_init_clocks(int xtal);
-
-extern  int s3c2412_baseclk_add(void);
-#else
-#define s3c2412_init_clocks NULL
-#define s3c2412_init_uarts NULL
-#define s3c2412_map_io NULL
-#define s3c2412_init NULL
-#endif
diff --git a/arch/arm/mach-s3c2410/s3c2440-clock.c b/arch/arm/mach-s3c2410/s3c2440-clock.c
deleted file mode 100644 (file)
index ba13c1d..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2440-clock.c
- *
- * Copyright (c) 2004-2005 Simtec Electronics
- *     http://armlinux.simtec.co.uk/
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2440 Clock 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/device.h>
-#include <linux/sysdev.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/mutex.h>
-#include <linux/clk.h>
-
-#include <asm/hardware.h>
-#include <asm/atomic.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-#include <asm/arch/regs-clock.h>
-
-#include "clock.h"
-#include "cpu.h"
-
-/* S3C2440 extended clock support */
-
-static unsigned long s3c2440_camif_upll_round(struct clk *clk,
-                                             unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       int div;
-
-       if (rate > parent_rate)
-               return parent_rate;
-
-       /* note, we remove the +/- 1 calculations for the divisor */
-
-       div = (parent_rate / rate) / 2;
-
-       if (div < 1)
-               div = 1;
-       else if (div > 16)
-               div = 16;
-
-       return parent_rate / (div * 2);
-}
-
-static int s3c2440_camif_upll_setrate(struct clk *clk, unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long camdivn =  __raw_readl(S3C2440_CAMDIVN);
-
-       rate = s3c2440_camif_upll_round(clk, rate);
-
-       camdivn &= ~(S3C2440_CAMDIVN_CAMCLK_SEL | S3C2440_CAMDIVN_CAMCLK_MASK);
-
-       if (rate != parent_rate) {
-               camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL;
-               camdivn |= (((parent_rate / rate) / 2) - 1);
-       }
-
-       __raw_writel(camdivn, S3C2440_CAMDIVN);
-
-       return 0;
-}
-
-/* Extra S3C2440 clocks */
-
-static struct clk s3c2440_clk_cam = {
-       .name           = "camif",
-       .id             = -1,
-       .enable         = s3c2410_clkcon_enable,
-       .ctrlbit        = S3C2440_CLKCON_CAMERA,
-};
-
-static struct clk s3c2440_clk_cam_upll = {
-       .name           = "camif-upll",
-       .id             = -1,
-       .set_rate       = s3c2440_camif_upll_setrate,
-       .round_rate     = s3c2440_camif_upll_round,
-};
-
-static struct clk s3c2440_clk_ac97 = {
-       .name           = "ac97",
-       .id             = -1,
-       .enable         = s3c2410_clkcon_enable,
-       .ctrlbit        = S3C2440_CLKCON_CAMERA,
-};
-
-static int s3c2440_clk_add(struct sys_device *sysdev)
-{
-       unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
-       unsigned long clkdivn;
-       struct clk *clock_h;
-       struct clk *clock_p;
-       struct clk *clock_upll;
-
-       printk("S3C2440: Clock Support, DVS %s\n",
-              (camdivn & S3C2440_CAMDIVN_DVSEN) ? "on" : "off");
-
-       clock_p = clk_get(NULL, "pclk");
-       clock_h = clk_get(NULL, "hclk");
-       clock_upll = clk_get(NULL, "upll");
-
-       if (IS_ERR(clock_p) || IS_ERR(clock_h) || IS_ERR(clock_upll)) {
-               printk(KERN_ERR "S3C2440: Failed to get parent clocks\n");
-               return -EINVAL;
-       }
-
-       /* check rate of UPLL, and if it is near 96MHz, then change
-        * to using half the UPLL rate for the system */
-
-       if (clk_get_rate(clock_upll) > (94 * MHZ)) {
-               clk_usb_bus.rate = clk_get_rate(clock_upll) / 2;
-
-               mutex_lock(&clocks_mutex);
-
-               clkdivn = __raw_readl(S3C2410_CLKDIVN);
-               clkdivn |= S3C2440_CLKDIVN_UCLK;
-               __raw_writel(clkdivn, S3C2410_CLKDIVN);
-
-               mutex_unlock(&clocks_mutex);
-       }
-
-       s3c2440_clk_cam.parent = clock_h;
-       s3c2440_clk_ac97.parent = clock_p;
-       s3c2440_clk_cam_upll.parent = clock_upll;
-
-       s3c24xx_register_clock(&s3c2440_clk_ac97);
-       s3c24xx_register_clock(&s3c2440_clk_cam);
-       s3c24xx_register_clock(&s3c2440_clk_cam_upll);
-
-       clk_disable(&s3c2440_clk_ac97);
-       clk_disable(&s3c2440_clk_cam);
-
-       return 0;
-}
-
-static struct sysdev_driver s3c2440_clk_driver = {
-       .add    = s3c2440_clk_add,
-};
-
-static __init int s3c24xx_clk_driver(void)
-{
-       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver);
-}
-
-arch_initcall(s3c24xx_clk_driver);
diff --git a/arch/arm/mach-s3c2410/s3c2440-dma.c b/arch/arm/mach-s3c2410/s3c2440-dma.c
deleted file mode 100644 (file)
index 47b861b..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2440-dma.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2440 DMA selection
- *
- * http://armlinux.simtec.co.uk/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/sysdev.h>
-#include <linux/serial_core.h>
-
-#include <asm/dma.h>
-#include <asm/arch/dma.h>
-#include "dma.h"
-
-#include "cpu.h"
-
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-ac97.h>
-#include <asm/arch/regs-mem.h>
-#include <asm/arch/regs-lcd.h>
-#include <asm/arch/regs-sdi.h>
-#include <asm/arch/regs-iis.h>
-#include <asm/arch/regs-spi.h>
-
-static struct s3c24xx_dma_map __initdata s3c2440_dma_mappings[] = {
-       [DMACH_XD0] = {
-               .name           = "xdreq0",
-               .channels[0]    = S3C2410_DCON_CH0_XDREQ0 | DMA_CH_VALID,
-       },
-       [DMACH_XD1] = {
-               .name           = "xdreq1",
-               .channels[1]    = S3C2410_DCON_CH1_XDREQ1 | DMA_CH_VALID,
-       },
-       [DMACH_SDI] = {
-               .name           = "sdi",
-               .channels[0]    = S3C2410_DCON_CH0_SDI | DMA_CH_VALID,
-               .channels[1]    = S3C2440_DCON_CH1_SDI | DMA_CH_VALID,
-               .channels[2]    = S3C2410_DCON_CH2_SDI | DMA_CH_VALID,
-               .channels[3]    = S3C2410_DCON_CH3_SDI | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
-               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
-       },
-       [DMACH_SPI0] = {
-               .name           = "spi0",
-               .channels[1]    = S3C2410_DCON_CH1_SPI | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_SPI + S3C2410_SPTDAT,
-               .hw_addr.from   = S3C2410_PA_SPI + S3C2410_SPRDAT,
-       },
-       [DMACH_SPI1] = {
-               .name           = "spi1",
-               .channels[3]    = S3C2410_DCON_CH3_SPI | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_SPI + 0x20 + S3C2410_SPTDAT,
-               .hw_addr.from   = S3C2410_PA_SPI + 0x20 + S3C2410_SPRDAT,
-       },
-       [DMACH_UART0] = {
-               .name           = "uart0",
-               .channels[0]    = S3C2410_DCON_CH0_UART0 | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_UART0 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART0 + S3C2410_URXH,
-       },
-       [DMACH_UART1] = {
-               .name           = "uart1",
-               .channels[1]    = S3C2410_DCON_CH1_UART1 | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_UART1 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART1 + S3C2410_URXH,
-       },
-       [DMACH_UART2] = {
-               .name           = "uart2",
-               .channels[3]    = S3C2410_DCON_CH3_UART2 | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_UART2 + S3C2410_UTXH,
-               .hw_addr.from   = S3C2410_PA_UART2 + S3C2410_URXH,
-       },
-       [DMACH_TIMER] = {
-               .name           = "timer",
-               .channels[0]    = S3C2410_DCON_CH0_TIMER | DMA_CH_VALID,
-               .channels[2]    = S3C2410_DCON_CH2_TIMER | DMA_CH_VALID,
-               .channels[3]    = S3C2410_DCON_CH3_TIMER | DMA_CH_VALID,
-       },
-       [DMACH_I2S_IN] = {
-               .name           = "i2s-sdi",
-               .channels[1]    = S3C2410_DCON_CH1_I2SSDI | DMA_CH_VALID,
-               .channels[2]    = S3C2410_DCON_CH2_I2SSDI | DMA_CH_VALID,
-               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
-       },
-       [DMACH_I2S_OUT] = {
-               .name           = "i2s-sdo",
-               .channels[0]    = S3C2440_DCON_CH0_I2SSDO | DMA_CH_VALID,
-               .channels[2]    = S3C2410_DCON_CH2_I2SSDO | DMA_CH_VALID,
-               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
-       },
-       [DMACH_PCM_IN] = {
-               .name           = "pcm-in",
-               .channels[0]    = S3C2440_DCON_CH0_PCMIN | DMA_CH_VALID,
-               .channels[2]    = S3C2440_DCON_CH2_PCMIN | DMA_CH_VALID,
-               .hw_addr.from   = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA,
-       },
-       [DMACH_PCM_OUT] = {
-               .name           = "pcm-out",
-               .channels[1]    = S3C2440_DCON_CH1_PCMOUT | DMA_CH_VALID,
-               .channels[3]    = S3C2440_DCON_CH3_PCMOUT | DMA_CH_VALID,
-               .hw_addr.to     = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA,
-       },
-       [DMACH_MIC_IN] = {
-               .name           = "mic-in",
-               .channels[2]    = S3C2440_DCON_CH2_MICIN | DMA_CH_VALID,
-               .channels[3]    = S3C2440_DCON_CH3_MICIN | DMA_CH_VALID,
-               .hw_addr.from   = S3C2440_PA_AC97 + S3C_AC97_MIC_DATA,
-       },
-       [DMACH_USB_EP1] = {
-               .name           = "usb-ep1",
-               .channels[0]    = S3C2410_DCON_CH0_USBEP1 | DMA_CH_VALID,
-       },
-       [DMACH_USB_EP2] = {
-               .name           = "usb-ep2",
-               .channels[1]    = S3C2410_DCON_CH1_USBEP2 | DMA_CH_VALID,
-       },
-       [DMACH_USB_EP3] = {
-               .name           = "usb-ep3",
-               .channels[2]    = S3C2410_DCON_CH2_USBEP3 | DMA_CH_VALID,
-       },
-       [DMACH_USB_EP4] = {
-               .name           = "usb-ep4",
-               .channels[3]    = S3C2410_DCON_CH3_USBEP4 | DMA_CH_VALID,
-       },
-};
-
-static void s3c2440_dma_select(struct s3c2410_dma_chan *chan,
-                              struct s3c24xx_dma_map *map)
-{
-       chan->dcon = map->channels[chan->number] & ~DMA_CH_VALID;
-}
-
-static struct s3c24xx_dma_selection __initdata s3c2440_dma_sel = {
-       .select         = s3c2440_dma_select,
-       .dcon_mask      = 7 << 24,
-       .map            = s3c2440_dma_mappings,
-       .map_size       = ARRAY_SIZE(s3c2440_dma_mappings),
-};
-
-static int s3c2440_dma_add(struct sys_device *sysdev)
-{
-       return s3c24xx_dma_init_map(&s3c2440_dma_sel);
-}
-
-static struct sysdev_driver s3c2440_dma_driver = {
-       .add    = s3c2440_dma_add,
-};
-
-static int __init s3c2440_dma_init(void)
-{
-       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_dma_driver);
-}
-
-arch_initcall(s3c2440_dma_init);
-
diff --git a/arch/arm/mach-s3c2410/s3c2440-dsc.c b/arch/arm/mach-s3c2410/s3c2440-dsc.c
deleted file mode 100644 (file)
index c92ea66..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2440-dsc.c
- *
- * Copyright (c) 2004-2005 Simtec Electronics
- *   Ben Dooks <ben@simtec.co.uk>
- *
- * Samsung S3C2440 Drive Strength Control support
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/module.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-dsc.h>
-
-#include "cpu.h"
-#include "s3c2440.h"
-
-int s3c2440_set_dsc(unsigned int pin, unsigned int value)
-{
-       void __iomem *base;
-       unsigned long val;
-       unsigned long flags;
-       unsigned long mask;
-
-       base = (pin & S3C2440_SELECT_DSC1) ? S3C2440_DSC1 : S3C2440_DSC0;
-       mask = 3 << S3C2440_DSC_GETSHIFT(pin);
-
-       local_irq_save(flags);
-
-       val = __raw_readl(base);
-       val &= ~mask;
-       val |= value & mask;
-       __raw_writel(val, base);
-
-       local_irq_restore(flags);
-       return 0;
-}
-
-EXPORT_SYMBOL(s3c2440_set_dsc);
diff --git a/arch/arm/mach-s3c2410/s3c2440-irq.c b/arch/arm/mach-s3c2410/s3c2440-irq.c
deleted file mode 100644 (file)
index 1ba19b2..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2440-irq.c
- *
- * Copyright (c) 2003,2004 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
-*/
-
-#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 <asm/hardware.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-#include <asm/mach/irq.h>
-
-#include <asm/arch/regs-irq.h>
-#include <asm/arch/regs-gpio.h>
-
-#include "cpu.h"
-#include "pm.h"
-#include "irq.h"
-
-/* WDT/AC97 */
-
-static void s3c_irq_demux_wdtac97(unsigned int irq,
-                                 struct irq_desc *desc)
-{
-       unsigned int subsrc, submsk;
-       struct irq_desc *mydesc;
-
-       /* read the current pending interrupts, and the mask
-        * for what it is available */
-
-       subsrc = __raw_readl(S3C2410_SUBSRCPND);
-       submsk = __raw_readl(S3C2410_INTSUBMSK);
-
-       subsrc &= ~submsk;
-       subsrc >>= 13;
-       subsrc &= 3;
-
-       if (subsrc != 0) {
-               if (subsrc & 1) {
-                       mydesc = irq_desc + IRQ_S3C2440_WDT;
-                       desc_handle_irq(IRQ_S3C2440_WDT, mydesc);
-               }
-               if (subsrc & 2) {
-                       mydesc = irq_desc + IRQ_S3C2440_AC97;
-                       desc_handle_irq(IRQ_S3C2440_AC97, mydesc);
-               }
-       }
-}
-
-
-#define INTMSK_WDT      (1UL << (IRQ_WDT - IRQ_EINT0))
-
-static void
-s3c_irq_wdtac97_mask(unsigned int irqno)
-{
-       s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13);
-}
-
-static void
-s3c_irq_wdtac97_unmask(unsigned int irqno)
-{
-       s3c_irqsub_unmask(irqno, INTMSK_WDT);
-}
-
-static void
-s3c_irq_wdtac97_ack(unsigned int irqno)
-{
-       s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13);
-}
-
-static struct irq_chip s3c_irq_wdtac97 = {
-       .mask       = s3c_irq_wdtac97_mask,
-       .unmask     = s3c_irq_wdtac97_unmask,
-       .ack        = s3c_irq_wdtac97_ack,
-};
-
-static int s3c2440_irq_add(struct sys_device *sysdev)
-{
-       unsigned int irqno;
-
-       printk("S3C2440: IRQ Support\n");
-
-       /* add new chained handler for wdt, ac7 */
-
-       set_irq_chip(IRQ_WDT, &s3c_irq_level_chip);
-       set_irq_handler(IRQ_WDT, handle_level_irq);
-       set_irq_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
-
-       for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
-               set_irq_chip(irqno, &s3c_irq_wdtac97);
-               set_irq_handler(irqno, handle_level_irq);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       return 0;
-}
-
-static struct sysdev_driver s3c2440_irq_driver = {
-       .add            = s3c2440_irq_add,
-};
-
-static int s3c2440_irq_init(void)
-{
-       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
-}
-
-arch_initcall(s3c2440_irq_init);
-
diff --git a/arch/arm/mach-s3c2410/s3c2440.c b/arch/arm/mach-s3c2410/s3c2440.c
deleted file mode 100644 (file)
index 344eb27..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2440.c
- *
- * Copyright (c) 2004-2006 Simtec Electronics
- *   Ben Dooks <ben@simtec.co.uk>
- *
- * Samsung S3C2440 Mobile CPU support
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <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/serial_core.h>
-#include <linux/sysdev.h>
-#include <linux/clk.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-
-#include "s3c2440.h"
-#include "devs.h"
-#include "cpu.h"
-
-static struct sys_device s3c2440_sysdev = {
-       .cls            = &s3c2440_sysclass,
-};
-
-int __init s3c2440_init(void)
-{
-       printk("S3C2440: Initialising architecture\n");
-
-       /* change irq for watchdog */
-
-       s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT;
-       s3c_device_wdt.resource[1].end   = IRQ_S3C2440_WDT;
-
-       /* register our system device for everything else */
-
-       return sysdev_register(&s3c2440_sysdev);
-}
diff --git a/arch/arm/mach-s3c2410/s3c2440.h b/arch/arm/mach-s3c2410/s3c2440.h
deleted file mode 100644 (file)
index dcd3160..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* arch/arm/mach-s3c2410/s3c2440.h
- *
- * Copyright (c) 2004-2005 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Header file for s3c2440 cpu support
- *
- * 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.
-*/
-
-#ifdef CONFIG_CPU_S3C2440
-extern  int s3c2440_init(void);
-#else
-#define s3c2440_init NULL
-#endif
diff --git a/arch/arm/mach-s3c2410/s3c2442-clock.c b/arch/arm/mach-s3c2410/s3c2442-clock.c
deleted file mode 100644 (file)
index 4e292ca..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2442-clock.c
- *
- * Copyright (c) 2004-2005 Simtec Electronics
- *     http://armlinux.simtec.co.uk/
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2442 Clock 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/device.h>
-#include <linux/sysdev.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/mutex.h>
-#include <linux/clk.h>
-
-#include <asm/hardware.h>
-#include <asm/atomic.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-#include <asm/arch/regs-clock.h>
-
-#include "clock.h"
-#include "cpu.h"
-
-/* S3C2442 extended clock support */
-
-static unsigned long s3c2442_camif_upll_round(struct clk *clk,
-                                             unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       int div;
-
-       if (rate > parent_rate)
-               return parent_rate;
-
-       div = parent_rate / rate;
-
-       if (div == 3)
-               return parent_rate / 3;
-
-       /* note, we remove the +/- 1 calculations for the divisor */
-
-       div /= 2;
-
-       if (div < 1)
-               div = 1;
-       else if (div > 16)
-               div = 16;
-
-       return parent_rate / (div * 2);
-}
-
-static int s3c2442_camif_upll_setrate(struct clk *clk, unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long camdivn =  __raw_readl(S3C2440_CAMDIVN);
-
-       rate = s3c2442_camif_upll_round(clk, rate);
-
-       camdivn &= ~S3C2442_CAMDIVN_CAMCLK_DIV3;
-
-       if (rate == parent_rate) {
-               camdivn &= ~S3C2440_CAMDIVN_CAMCLK_SEL;
-       } else if ((parent_rate / rate) == 3) {
-               camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL;
-               camdivn |= S3C2442_CAMDIVN_CAMCLK_DIV3;
-       } else {
-               camdivn &= ~S3C2440_CAMDIVN_CAMCLK_MASK;
-               camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL;
-               camdivn |= (((parent_rate / rate) / 2) - 1);
-       }
-
-       __raw_writel(camdivn, S3C2440_CAMDIVN);
-
-       return 0;
-}
-
-/* Extra S3C2442 clocks */
-
-static struct clk s3c2442_clk_cam = {
-       .name           = "camif",
-       .id             = -1,
-       .enable         = s3c2410_clkcon_enable,
-       .ctrlbit        = S3C2440_CLKCON_CAMERA,
-};
-
-static struct clk s3c2442_clk_cam_upll = {
-       .name           = "camif-upll",
-       .id             = -1,
-       .set_rate       = s3c2442_camif_upll_setrate,
-       .round_rate     = s3c2442_camif_upll_round,
-};
-
-static int s3c2442_clk_add(struct sys_device *sysdev)
-{
-       unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
-       unsigned long clkdivn;
-       struct clk *clock_h;
-       struct clk *clock_p;
-       struct clk *clock_upll;
-
-       printk("S3C2442: Clock Support, DVS %s\n",
-              (camdivn & S3C2440_CAMDIVN_DVSEN) ? "on" : "off");
-
-       clock_p = clk_get(NULL, "pclk");
-       clock_h = clk_get(NULL, "hclk");
-       clock_upll = clk_get(NULL, "upll");
-
-       if (IS_ERR(clock_p) || IS_ERR(clock_h) || IS_ERR(clock_upll)) {
-               printk(KERN_ERR "S3C2442: Failed to get parent clocks\n");
-               return -EINVAL;
-       }
-
-       /* check rate of UPLL, and if it is near 96MHz, then change
-        * to using half the UPLL rate for the system */
-
-       if (clk_get_rate(clock_upll) > (94 * MHZ)) {
-               clk_usb_bus.rate = clk_get_rate(clock_upll) / 2;
-
-               mutex_lock(&clocks_mutex);
-
-               clkdivn = __raw_readl(S3C2410_CLKDIVN);
-               clkdivn |= S3C2440_CLKDIVN_UCLK;
-               __raw_writel(clkdivn, S3C2410_CLKDIVN);
-
-               mutex_unlock(&clocks_mutex);
-       }
-
-       s3c2442_clk_cam.parent = clock_h;
-       s3c2442_clk_cam_upll.parent = clock_upll;
-
-       s3c24xx_register_clock(&s3c2442_clk_cam);
-       s3c24xx_register_clock(&s3c2442_clk_cam_upll);
-
-       clk_disable(&s3c2442_clk_cam);
-
-       return 0;
-}
-
-static struct sysdev_driver s3c2442_clk_driver = {
-       .add    = s3c2442_clk_add,
-};
-
-static __init int s3c2442_clk_init(void)
-{
-       return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_clk_driver);
-}
-
-arch_initcall(s3c2442_clk_init);
diff --git a/arch/arm/mach-s3c2410/s3c2442.c b/arch/arm/mach-s3c2410/s3c2442.c
deleted file mode 100644 (file)
index 428732e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c2442.c
- *
- * Copyright (c) 2006 Simtec Electronics
- *   Ben Dooks <ben@simtec.co.uk>
- *
- * Samsung S3C2442 Mobile CPU support
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <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/serial_core.h>
-#include <linux/sysdev.h>
-
-#include "s3c2442.h"
-#include "cpu.h"
-
-static struct sys_device s3c2442_sysdev = {
-       .cls            = &s3c2442_sysclass,
-};
-
-int __init s3c2442_init(void)
-{
-       printk("S3C2442: Initialising architecture\n");
-
-       return sysdev_register(&s3c2442_sysdev);
-}
diff --git a/arch/arm/mach-s3c2410/s3c2442.h b/arch/arm/mach-s3c2410/s3c2442.h
deleted file mode 100644 (file)
index 0ae37d2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* arch/arm/mach-s3c2410/s3c2442.h
- *
- * Copyright (c) 2006 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Header file for s3c2442 cpu support
- *
- * 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.
-*/
-
-#ifdef CONFIG_CPU_S3C2442
-extern  int s3c2442_init(void);
-#else
-#define s3c2442_init NULL
-#endif
diff --git a/arch/arm/mach-s3c2410/s3c244x-irq.c b/arch/arm/mach-s3c2410/s3c244x-irq.c
deleted file mode 100644 (file)
index ede9463..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c244x-irq.c
- *
- * Copyright (c) 2003,2004 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
-*/
-
-#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 <asm/hardware.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-#include <asm/mach/irq.h>
-
-#include <asm/arch/regs-irq.h>
-#include <asm/arch/regs-gpio.h>
-
-#include "cpu.h"
-#include "pm.h"
-#include "irq.h"
-
-/* camera irq */
-
-static void s3c_irq_demux_cam(unsigned int irq,
-                             struct irq_desc *desc)
-{
-       unsigned int subsrc, submsk;
-       struct irq_desc *mydesc;
-
-       /* read the current pending interrupts, and the mask
-        * for what it is available */
-
-       subsrc = __raw_readl(S3C2410_SUBSRCPND);
-       submsk = __raw_readl(S3C2410_INTSUBMSK);
-
-       subsrc &= ~submsk;
-       subsrc >>= 11;
-       subsrc &= 3;
-
-       if (subsrc != 0) {
-               if (subsrc & 1) {
-                       mydesc = irq_desc + IRQ_S3C2440_CAM_C;
-                       desc_handle_irq(IRQ_S3C2440_CAM_C, mydesc);
-               }
-               if (subsrc & 2) {
-                       mydesc = irq_desc + IRQ_S3C2440_CAM_P;
-                       desc_handle_irq(IRQ_S3C2440_CAM_P, mydesc);
-               }
-       }
-}
-
-#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
-
-static void
-s3c_irq_cam_mask(unsigned int irqno)
-{
-       s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11);
-}
-
-static void
-s3c_irq_cam_unmask(unsigned int irqno)
-{
-       s3c_irqsub_unmask(irqno, INTMSK_CAM);
-}
-
-static void
-s3c_irq_cam_ack(unsigned int irqno)
-{
-       s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11);
-}
-
-static struct irq_chip s3c_irq_cam = {
-       .mask       = s3c_irq_cam_mask,
-       .unmask     = s3c_irq_cam_unmask,
-       .ack        = s3c_irq_cam_ack,
-};
-
-static int s3c244x_irq_add(struct sys_device *sysdev)
-{
-       unsigned int irqno;
-
-       set_irq_chip(IRQ_NFCON, &s3c_irq_level_chip);
-       set_irq_handler(IRQ_NFCON, handle_level_irq);
-       set_irq_flags(IRQ_NFCON, IRQF_VALID);
-
-       /* add chained handler for camera */
-
-       set_irq_chip(IRQ_CAM, &s3c_irq_level_chip);
-       set_irq_handler(IRQ_CAM, handle_level_irq);
-       set_irq_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
-
-       for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
-               set_irq_chip(irqno, &s3c_irq_cam);
-               set_irq_handler(irqno, handle_level_irq);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       return 0;
-}
-
-static struct sysdev_driver s3c2440_irq_driver = {
-       .add            = s3c244x_irq_add,
-       .suspend        = s3c24xx_irq_suspend,
-       .resume         = s3c24xx_irq_resume,
-};
-
-static int s3c2440_irq_init(void)
-{
-       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
-}
-
-arch_initcall(s3c2440_irq_init);
-
-static struct sysdev_driver s3c2442_irq_driver = {
-       .add            = s3c244x_irq_add,
-       .suspend        = s3c24xx_irq_suspend,
-       .resume         = s3c24xx_irq_resume,
-};
-
-
-static int s3c2442_irq_init(void)
-{
-       return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_irq_driver);
-}
-
-arch_initcall(s3c2442_irq_init);
diff --git a/arch/arm/mach-s3c2410/s3c244x.c b/arch/arm/mach-s3c2410/s3c244x.c
deleted file mode 100644 (file)
index 23c7494..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/s3c244x.c
- *
- * Copyright (c) 2004-2006 Simtec Electronics
- *   Ben Dooks <ben@simtec.co.uk>
- *
- * Samsung S3C2440 and S3C2442 Mobile CPU support
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <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/serial_core.h>
-#include <linux/platform_device.h>
-#include <linux/sysdev.h>
-#include <linux/clk.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-
-#include <asm/arch/regs-clock.h>
-#include <asm/arch/regs-serial.h>
-#include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-gpioj.h>
-#include <asm/arch/regs-dsc.h>
-
-#include "s3c2410.h"
-#include "s3c2440.h"
-#include "s3c244x.h"
-#include "clock.h"
-#include "devs.h"
-#include "cpu.h"
-#include "pm.h"
-
-static struct map_desc s3c244x_iodesc[] __initdata = {
-       IODESC_ENT(CLKPWR),
-       IODESC_ENT(TIMER),
-       IODESC_ENT(WATCHDOG),
-       IODESC_ENT(LCD),
-};
-
-/* uart initialisation */
-
-void __init s3c244x_init_uarts(struct s3c2410_uartcfg *cfg, int no)
-{
-       s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
-}
-
-void __init s3c244x_map_io(struct map_desc *mach_desc, int size)
-{
-       /* register our io-tables */
-
-       iotable_init(s3c244x_iodesc, ARRAY_SIZE(s3c244x_iodesc));
-       iotable_init(mach_desc, size);
-
-       /* rename any peripherals used differing from the s3c2410 */
-
-       s3c_device_i2c.name  = "s3c2440-i2c";
-       s3c_device_nand.name = "s3c2440-nand";
-       s3c_device_usbgadget.name = "s3c2440-usbgadget";
-}
-
-void __init s3c244x_init_clocks(int xtal)
-{
-       unsigned long clkdiv;
-       unsigned long camdiv;
-       unsigned long hclk, fclk, pclk;
-       int hdiv = 1;
-
-       /* now we've got our machine bits initialised, work out what
-        * clocks we've got */
-
-       fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), xtal) * 2;
-
-       clkdiv = __raw_readl(S3C2410_CLKDIVN);
-       camdiv = __raw_readl(S3C2440_CAMDIVN);
-
-       /* work out clock scalings */
-
-       switch (clkdiv & S3C2440_CLKDIVN_HDIVN_MASK) {
-       case S3C2440_CLKDIVN_HDIVN_1:
-               hdiv = 1;
-               break;
-
-       case S3C2440_CLKDIVN_HDIVN_2:
-               hdiv = 2;
-               break;
-
-       case S3C2440_CLKDIVN_HDIVN_4_8:
-               hdiv = (camdiv & S3C2440_CAMDIVN_HCLK4_HALF) ? 8 : 4;
-               break;
-
-       case S3C2440_CLKDIVN_HDIVN_3_6:
-               hdiv = (camdiv & S3C2440_CAMDIVN_HCLK3_HALF) ? 6 : 3;
-               break;
-       }
-
-       hclk = fclk / hdiv;
-       pclk = hclk / ((clkdiv & S3C2440_CLKDIVN_PDIVN)? 2:1);
-
-       /* print brief summary of clocks, etc */
-
-       printk("S3C244X: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n",
-              print_mhz(fclk), print_mhz(hclk), print_mhz(pclk));
-
-       /* initialise the clocks here, to allow other things like the
-        * console to use them, and to add new ones after the initialisation
-        */
-
-       s3c24xx_setup_clocks(xtal, fclk, hclk, pclk);
-       s3c2410_baseclk_add();
-}
-
-#ifdef CONFIG_PM
-
-static struct sleep_save s3c244x_sleep[] = {
-       SAVE_ITEM(S3C2440_DSC0),
-       SAVE_ITEM(S3C2440_DSC1),
-       SAVE_ITEM(S3C2440_GPJDAT),
-       SAVE_ITEM(S3C2440_GPJCON),
-       SAVE_ITEM(S3C2440_GPJUP)
-};
-
-static int s3c244x_suspend(struct sys_device *dev, pm_message_t state)
-{
-       s3c2410_pm_do_save(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
-       return 0;
-}
-
-static int s3c244x_resume(struct sys_device *dev)
-{
-       s3c2410_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
-       return 0;
-}
-
-#else
-#define s3c244x_suspend NULL
-#define s3c244x_resume  NULL
-#endif
-
-/* Since the S3C2442 and S3C2440 share  items, put both sysclasses here */
-
-struct sysdev_class s3c2440_sysclass = {
-       set_kset_name("s3c2440-core"),
-       .suspend        = s3c244x_suspend,
-       .resume         = s3c244x_resume
-};
-
-struct sysdev_class s3c2442_sysclass = {
-       set_kset_name("s3c2442-core"),
-       .suspend        = s3c244x_suspend,
-       .resume         = s3c244x_resume
-};
-
-/* need to register class before we actually register the device, and
- * we also need to ensure that it has been initialised before any of the
- * drivers even try to use it (even if not on an s3c2440 based system)
- * as a driver which may support both 2410 and 2440 may try and use it.
-*/
-
-static int __init s3c2440_core_init(void)
-{
-       return sysdev_class_register(&s3c2440_sysclass);
-}
-
-core_initcall(s3c2440_core_init);
-
-static int __init s3c2442_core_init(void)
-{
-       return sysdev_class_register(&s3c2442_sysclass);
-}
-
-core_initcall(s3c2442_core_init);
diff --git a/arch/arm/mach-s3c2410/s3c244x.h b/arch/arm/mach-s3c2410/s3c244x.h
deleted file mode 100644 (file)
index 1488c1e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/* arch/arm/mach-s3c2410/s3c244x.h
- *
- * Copyright (c) 2004-2005 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Header file for S3C2440 and S3C2442 cpu support
- *
- * 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.
-*/
-
-#if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2442)
-
-extern void s3c244x_map_io(struct map_desc *mach_desc, int size);
-
-extern void s3c244x_init_uarts(struct s3c2410_uartcfg *cfg, int no);
-
-extern void s3c244x_init_clocks(int xtal);
-
-#else
-#define s3c244x_init_clocks NULL
-#define s3c244x_init_uarts NULL
-#define s3c244x_map_io NULL
-#endif
index 2018c2e1dcc5aecc97a9c9ec1825fc3c6b2fc29c..637aaba653901a23f640edfdfa7c2569c0a41c93 100644 (file)
@@ -1,4 +1,4 @@
-/* linux/arch/arm/mach-s3c2410/sleep.S
+/* linux/arch/arm/mach-s3c2410/s3c2410-sleep.S
  *
  * Copyright (c) 2004 Simtec Electronics
  *     Ben Dooks <ben@simtec.co.uk>
 #include <asm/arch/regs-mem.h>
 #include <asm/arch/regs-serial.h>
 
-/* CONFIG_DEBUG_RESUME is dangerous if your bootloader does not
- * reset the UART configuration, only enable if you really need this!
-*/
-//#define CONFIG_DEBUG_RESUME
-
-       .text
-
-       /* s3c2410_cpu_save
-        *
-        * save enough of the CPU state to allow us to re-start
-        * pm.c code. as we store items like the sp/lr, we will
-        * end up returning from this function when the cpu resumes
-        * so the return value is set to mark this.
-        *
-        * This arangement means we avoid having to flush the cache
-        * from this code.
-        *
-        * entry:
-        *      r0 = pointer to save block
-        *
-        * exit:
-        *      r0 = 0 => we stored everything
-        *           1 => resumed from sleep
-       */
-
-ENTRY(s3c2410_cpu_save)
-       stmfd   sp!, { r4 - r12, lr }
-
-       @@ store co-processor registers
-
-       mrc     p15, 0, r4, c15, c1, 0  @ CP access register
-       mrc     p15, 0, r5, c13, c0, 0  @ PID
-       mrc     p15, 0, r6, c3, c0, 0   @ Domain ID
-       mrc     p15, 0, r7, c2, c0, 0   @ translation table base address
-       mrc     p15, 0, r8, c1, c0, 0   @ control register
-
-       stmia   r0, { r4 - r13 }
-
-       mov     r0, #0
-       ldmfd   sp, { r4 - r12, pc }
-
-       @@ return to the caller, after having the MMU
-       @@ turned on, this restores the last bits from the
-       @@ stack
-resume_with_mmu:
-       mov     r0, #1
-       ldmfd   sp!, { r4 - r12, pc }
-
-       .ltorg
-
-       @@ the next bits sit in the .data segment, even though they
-       @@ happen to be code... the s3c2410_sleep_save_phys needs to be
-       @@ accessed by the resume code before it can restore the MMU.
-       @@ This means that the variable has to be close enough for the
-       @@ code to read it... since the .text segment needs to be RO,
-       @@ the data segment can be the only place to put this code.
-
-       .data
-
-       .global s3c2410_sleep_save_phys
-s3c2410_sleep_save_phys:
-       .word   0
-
-       /* s3c2410_cpu_resume
+       /* s3c2410_cpu_suspend
         *
-        * resume code entry for bootloader to call
-        *
-        * we must put this code here in the data segment as we have no
-        * other way of restoring the stack pointer after sleep, and we
-        * must not write to the code segment (code is read-only)
+        * put the cpu into sleep mode
        */
 
-ENTRY(s3c2410_cpu_resume)
-       mov     r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE
-       msr     cpsr_c, r0
-
-       @@ load UART to allow us to print the two characters for
-       @@ resume debug
-
-       mov     r2, #S3C24XX_PA_UART & 0xff000000
-       orr     r2, r2, #S3C24XX_PA_UART & 0xff000
-
-#if 0
-       /* SMDK2440 LED set */
-       mov     r14, #S3C24XX_PA_GPIO
-       ldr     r12, [ r14, #0x54 ]
-       bic     r12, r12, #3<<4
-       orr     r12, r12, #1<<7
-       str     r12, [ r14, #0x54 ]
-#endif
-
-#ifdef CONFIG_DEBUG_RESUME
-       mov     r3, #'L'
-       strb    r3, [ r2, #S3C2410_UTXH ]
-1001:
-       ldrb    r14, [ r3, #S3C2410_UTRSTAT ]
-       tst     r14, #S3C2410_UTRSTAT_TXE
-       beq     1001b
-#endif /* CONFIG_DEBUG_RESUME */
-
-       mov     r1, #0
-       mcr     p15, 0, r1, c8, c7, 0           @@ invalidate I & D TLBs
-       mcr     p15, 0, r1, c7, c7, 0           @@ invalidate I & D caches
-
-       ldr     r0, s3c2410_sleep_save_phys     @ address of restore block
-       ldmia   r0, { r4 - r13 }
-
-       mcr     p15, 0, r4, c15, c1, 0          @ CP access register
-       mcr     p15, 0, r5, c13, c0, 0          @ PID
-       mcr     p15, 0, r6, c3, c0, 0           @ Domain ID
-       mcr     p15, 0, r7, c2, c0, 0           @ translation table base
-
-#ifdef CONFIG_DEBUG_RESUME
-       mov     r3, #'R'
-       strb    r3, [ r2, #S3C2410_UTXH ]
-#endif
-
-       ldr     r2, =resume_with_mmu
-       mcr     p15, 0, r8, c1, c0, 0           @ turn on MMU, etc
-       nop                                     @ second-to-last before mmu
-       mov     pc, r2                          @ go back to virtual address
-
-       .ltorg
+ENTRY(s3c2410_cpu_suspend)
+       @@ prepare cpu to sleep
+
+       ldr     r4, =S3C2410_REFRESH
+       ldr     r5, =S3C24XX_MISCCR
+       ldr     r6, =S3C2410_CLKCON
+       ldr     r7, [ r4 ]              @ get REFRESH (and ensure in TLB)
+       ldr     r8, [ r5 ]              @ get MISCCR (and ensure in TLB)
+       ldr     r9, [ r6 ]              @ get CLKCON (and ensure in TLB)
+
+       orr     r7, r7, #S3C2410_REFRESH_SELF   @ SDRAM sleep command
+       orr     r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals
+       orr     r9, r9, #S3C2410_CLKCON_POWER   @ power down command
+
+       teq     pc, #0                  @ first as a trial-run to load cache
+       bl      s3c2410_do_sleep
+       teq     r0, r0                  @ now do it for real
+       b       s3c2410_do_sleep        @
+
+       @@ align next bit of code to cache line
+       .align  5
+s3c2410_do_sleep:
+       streq   r7, [ r4 ]                      @ SDRAM sleep command
+       streq   r8, [ r5 ]                      @ SDRAM power-down config
+       streq   r9, [ r6 ]                      @ CPU sleep
+1:     beq     1b
+       mov     pc, r14
diff --git a/arch/arm/mach-s3c2410/time.c b/arch/arm/mach-s3c2410/time.c
deleted file mode 100644 (file)
index 9910bf0..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-/* linux/arch/arm/mach-s3c2410/time.c
- *
- * Copyright (C) 2003-2005 Simtec Electronics
- *     Ben Dooks, <ben@simtec.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/err.h>
-#include <linux/clk.h>
-
-#include <asm/system.h>
-#include <asm/leds.h>
-#include <asm/mach-types.h>
-
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/arch/map.h>
-#include <asm/arch/regs-timer.h>
-#include <asm/arch/regs-irq.h>
-#include <asm/mach/time.h>
-
-#include "clock.h"
-#include "cpu.h"
-
-static unsigned long timer_startval;
-static unsigned long timer_usec_ticks;
-
-#define TIMER_USEC_SHIFT 16
-
-/* we use the shifted arithmetic to work out the ratio of timer ticks
- * to usecs, as often the peripheral clock is not a nice even multiple
- * of 1MHz.
- *
- * shift of 14 and 15 are too low for the 12MHz, 16 seems to be ok
- * for the current HZ value of 200 without producing overflows.
- *
- * Original patch by Dimitry Andric, updated by Ben Dooks
-*/
-
-
-/* timer_mask_usec_ticks
- *
- * given a clock and divisor, make the value to pass into timer_ticks_to_usec
- * to scale the ticks into usecs
-*/
-
-static inline unsigned long
-timer_mask_usec_ticks(unsigned long scaler, unsigned long pclk)
-{
-       unsigned long den = pclk / 1000;
-
-       return ((1000 << TIMER_USEC_SHIFT) * scaler + (den >> 1)) / den;
-}
-
-/* timer_ticks_to_usec
- *
- * convert timer ticks to usec.
-*/
-
-static inline unsigned long timer_ticks_to_usec(unsigned long ticks)
-{
-       unsigned long res;
-
-       res = ticks * timer_usec_ticks;
-       res += 1 << (TIMER_USEC_SHIFT - 4);     /* round up slightly */
-
-       return res >> TIMER_USEC_SHIFT;
-}
-
-/***
- * Returns microsecond  since last clock interrupt.  Note that interrupts
- * will have been disabled by do_gettimeoffset()
- * IRQs are disabled before entering here from do_gettimeofday()
- */
-
-#define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0))
-
-static unsigned long s3c2410_gettimeoffset (void)
-{
-       unsigned long tdone;
-       unsigned long irqpend;
-       unsigned long tval;
-
-       /* work out how many ticks have gone since last timer interrupt */
-
-        tval =  __raw_readl(S3C2410_TCNTO(4));
-       tdone = timer_startval - tval;
-
-       /* check to see if there is an interrupt pending */
-
-       irqpend = __raw_readl(S3C2410_SRCPND);
-       if (irqpend & SRCPND_TIMER4) {
-               /* re-read the timer, and try and fix up for the missed
-                * interrupt. Note, the interrupt may go off before the
-                * timer has re-loaded from wrapping.
-                */
-
-               tval =  __raw_readl(S3C2410_TCNTO(4));
-               tdone = timer_startval - tval;
-
-               if (tval != 0)
-                       tdone += timer_startval;
-       }
-
-       return timer_ticks_to_usec(tdone);
-}
-
-
-/*
- * IRQ handler for the timer
- */
-static irqreturn_t
-s3c2410_timer_interrupt(int irq, void *dev_id)
-{
-       write_seqlock(&xtime_lock);
-       timer_tick();
-       write_sequnlock(&xtime_lock);
-       return IRQ_HANDLED;
-}
-
-static struct irqaction s3c2410_timer_irq = {
-       .name           = "S3C2410 Timer Tick",
-       .flags          = IRQF_DISABLED | IRQF_TIMER,
-       .handler        = s3c2410_timer_interrupt,
-};
-
-#define use_tclk1_12() ( \
-       machine_is_bast()       || \
-       machine_is_vr1000()     || \
-       machine_is_anubis()     || \
-       machine_is_osiris() )
-
-/*
- * Set up timer interrupt, and return the current time in seconds.
- *
- * Currently we only use timer4, as it is the only timer which has no
- * other function that can be exploited externally
- */
-static void s3c2410_timer_setup (void)
-{
-       unsigned long tcon;
-       unsigned long tcnt;
-       unsigned long tcfg1;
-       unsigned long tcfg0;
-
-       tcnt = 0xffff;  /* default value for tcnt */
-
-       /* read the current timer configuration bits */
-
-       tcon = __raw_readl(S3C2410_TCON);
-       tcfg1 = __raw_readl(S3C2410_TCFG1);
-       tcfg0 = __raw_readl(S3C2410_TCFG0);
-
-       /* configure the system for whichever machine is in use */
-
-       if (use_tclk1_12()) {
-               /* timer is at 12MHz, scaler is 1 */
-               timer_usec_ticks = timer_mask_usec_ticks(1, 12000000);
-               tcnt = 12000000 / HZ;
-
-               tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
-               tcfg1 |= S3C2410_TCFG1_MUX4_TCLK1;
-       } else {
-               unsigned long pclk;
-               struct clk *clk;
-
-               /* for the h1940 (and others), we use the pclk from the core
-                * to generate the timer values. since values around 50 to
-                * 70MHz are not values we can directly generate the timer
-                * value from, we need to pre-scale and divide before using it.
-                *
-                * for instance, using 50.7MHz and dividing by 6 gives 8.45MHz
-                * (8.45 ticks per usec)
-                */
-
-               /* this is used as default if no other timer can be found */
-
-               clk = clk_get(NULL, "timers");
-               if (IS_ERR(clk))
-                       panic("failed to get clock for system timer");
-
-               clk_enable(clk);
-
-               pclk = clk_get_rate(clk);
-
-               /* configure clock tick */
-
-               timer_usec_ticks = timer_mask_usec_ticks(6, pclk);
-
-               tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
-               tcfg1 |= S3C2410_TCFG1_MUX4_DIV2;
-
-               tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
-               tcfg0 |= ((6 - 1) / 2) << S3C2410_TCFG_PRESCALER1_SHIFT;
-
-               tcnt = (pclk / 6) / HZ;
-       }
-
-       /* timers reload after counting zero, so reduce the count by 1 */
-
-       tcnt--;
-
-       printk("timer tcon=%08lx, tcnt %04lx, tcfg %08lx,%08lx, usec %08lx\n",
-              tcon, tcnt, tcfg0, tcfg1, timer_usec_ticks);
-
-       /* check to see if timer is within 16bit range... */
-       if (tcnt > 0xffff) {
-               panic("setup_timer: HZ is too small, cannot configure timer!");
-               return;
-       }
-
-       __raw_writel(tcfg1, S3C2410_TCFG1);
-       __raw_writel(tcfg0, S3C2410_TCFG0);
-
-       timer_startval = tcnt;
-       __raw_writel(tcnt, S3C2410_TCNTB(4));
-
-       /* ensure timer is stopped... */
-
-       tcon &= ~(7<<20);
-       tcon |= S3C2410_TCON_T4RELOAD;
-       tcon |= S3C2410_TCON_T4MANUALUPD;
-
-       __raw_writel(tcon, S3C2410_TCON);
-       __raw_writel(tcnt, S3C2410_TCNTB(4));
-       __raw_writel(tcnt, S3C2410_TCMPB(4));
-
-       /* start the timer running */
-       tcon |= S3C2410_TCON_T4START;
-       tcon &= ~S3C2410_TCON_T4MANUALUPD;
-       __raw_writel(tcon, S3C2410_TCON);
-}
-
-static void __init s3c2410_timer_init (void)
-{
-       s3c2410_timer_setup();
-       setup_irq(IRQ_TIMER4, &s3c2410_timer_irq);
-}
-
-struct sys_timer s3c24xx_timer = {
-       .init           = s3c2410_timer_init,
-       .offset         = s3c2410_gettimeoffset,
-       .resume         = s3c2410_timer_setup
-};
index 22b0e1cdd4bf3d4e584588b4399c54646c673847..bcd562ac1d3da4899dca3b73ac3e9184e6c2d55e 100644 (file)
@@ -35,7 +35,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
-#include "devs.h"
+#include <asm/plat-s3c24xx/devs.h>
 #include "usb-simtec.h"
 
 /* control power and monitor over-current events on various Simtec
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
new file mode 100644 (file)
index 0000000..befc5fd
--- /dev/null
@@ -0,0 +1,58 @@
+# arch/arm/mach-s3c2412/Kconfig
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+config CPU_S3C2412
+       bool
+       depends on ARCH_S3C2410
+       select S3C2412_PM if PM
+       select S3C2412_DMA if S3C2410_DMA
+       help
+         Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
+
+config CPU_S3C2412_ONLY
+       bool
+       depends on ARCH_S3C2410 && !CPU_S3C2400 && !CPU_S3C2410 && \
+                  !CPU_S3C2440 && !CPU_S3C2442 && !CPU_S3C2443 && CPU_S3C2412
+       default y if CPU_S3C2412
+
+config S3C2412_DMA
+       bool
+       depends on CPU_S3C2412
+       help
+         Internal config node for S3C2412 DMA support
+
+config S3C2412_PM
+       bool
+       help
+         Internal config node to apply S3C2412 power management
+
+
+menu "S3C2412 Machines"
+
+config MACH_SMDK2413
+       bool "SMDK2413"
+       select CPU_S3C2412
+       select MACH_S3C2413
+       select MACH_SMDK
+       help
+         Say Y here if you are using an SMDK2413
+
+config MACH_S3C2413
+       bool
+       help
+         Internal node for S3C2413 version of SMDK2413, so that
+         machine_is_s3c2413() will work when MACH_SMDK2413 is
+         selected
+
+config MACH_VSTMS
+       bool "VMSTMS"
+       select CPU_S3C2412
+       help
+         Say Y here if you are using an VSTMS board
+
+
+endmenu
+
diff --git a/arch/arm/mach-s3c2412/Makefile b/arch/arm/mach-s3c2412/Makefile
new file mode 100644 (file)
index 0000000..f8e0116
--- /dev/null
@@ -0,0 +1,21 @@
+# arch/arm/mach-s3c2412/Makefile
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+obj-y                          :=
+obj-m                          :=
+obj-n                          :=
+obj-                           :=
+
+obj-$(CONFIG_CPU_S3C2412)      += s3c2412.o
+obj-$(CONFIG_CPU_S3C2412)      += irq.o
+obj-$(CONFIG_CPU_S3C2412)      += clock.o
+obj-$(CONFIG_S3C2412_DMA)      += dma.o
+obj-$(CONFIG_S3C2412_PM)       += pm.o
+
+# Machine support
+
+obj-$(CONFIG_MACH_SMDK2413)    += mach-smdk2413.o
+obj-$(CONFIG_MACH_VSTMS)       += mach-vstms.o
diff --git a/arch/arm/mach-s3c2412/clock.c b/arch/arm/mach-s3c2412/clock.c
new file mode 100644 (file)
index 0000000..6a8e444
--- /dev/null
@@ -0,0 +1,716 @@
+/* linux/arch/arm/mach-s3c2412/clock.c
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2412,S3C2413 Clock control 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/sysdev.h>
+#include <linux/clk.h>
+#include <linux/mutex.h>
+#include <linux/delay.h>
+#include <linux/serial_core.h>
+
+#include <asm/mach/map.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-clock.h>
+#include <asm/arch/regs-gpio.h>
+
+#include <asm/plat-s3c24xx/s3c2412.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+/* We currently have to assume that the system is running
+ * from the XTPll input, and that all ***REFCLKs are being
+ * fed from it, as we cannot read the state of OM[4] from
+ * software.
+ *
+ * It would be possible for each board initialisation to
+ * set the correct muxing at initialisation
+*/
+
+static int s3c2412_clkcon_enable(struct clk *clk, int enable)
+{
+       unsigned int clocks = clk->ctrlbit;
+       unsigned long clkcon;
+
+       clkcon = __raw_readl(S3C2410_CLKCON);
+
+       if (enable)
+               clkcon |= clocks;
+       else
+               clkcon &= ~clocks;
+
+       __raw_writel(clkcon, S3C2410_CLKCON);
+
+       return 0;
+}
+
+static int s3c2412_upll_enable(struct clk *clk, int enable)
+{
+       unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
+       unsigned long orig = upllcon;
+
+       if (!enable)
+               upllcon |= S3C2412_PLLCON_OFF;
+       else
+               upllcon &= ~S3C2412_PLLCON_OFF;
+
+       __raw_writel(upllcon, S3C2410_UPLLCON);
+
+       /* allow ~150uS for the PLL to settle and lock */
+
+       if (enable && (orig & S3C2412_PLLCON_OFF))
+               udelay(150);
+
+       return 0;
+}
+
+/* clock selections */
+
+/* CPU EXTCLK input */
+static struct clk clk_ext = {
+       .name           = "extclk",
+       .id             = -1,
+};
+
+static struct clk clk_erefclk = {
+       .name           = "erefclk",
+       .id             = -1,
+};
+
+static struct clk clk_urefclk = {
+       .name           = "urefclk",
+       .id             = -1,
+};
+
+static int s3c2412_setparent_usysclk(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
+
+       if (parent == &clk_urefclk)
+               clksrc &= ~S3C2412_CLKSRC_USYSCLK_UPLL;
+       else if (parent == &clk_upll)
+               clksrc |= S3C2412_CLKSRC_USYSCLK_UPLL;
+       else
+               return -EINVAL;
+
+       clk->parent = parent;
+
+       __raw_writel(clksrc, S3C2412_CLKSRC);
+       return 0;
+}
+
+static struct clk clk_usysclk = {
+       .name           = "usysclk",
+       .id             = -1,
+       .parent         = &clk_xtal,
+       .set_parent     = s3c2412_setparent_usysclk,
+};
+
+static struct clk clk_mrefclk = {
+       .name           = "mrefclk",
+       .parent         = &clk_xtal,
+       .id             = -1,
+};
+
+static struct clk clk_mdivclk = {
+       .name           = "mdivclk",
+       .parent         = &clk_xtal,
+       .id             = -1,
+};
+
+static int s3c2412_setparent_usbsrc(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
+
+       if (parent == &clk_usysclk)
+               clksrc &= ~S3C2412_CLKSRC_USBCLK_HCLK;
+       else if (parent == &clk_h)
+               clksrc |= S3C2412_CLKSRC_USBCLK_HCLK;
+       else
+               return -EINVAL;
+
+       clk->parent = parent;
+
+       __raw_writel(clksrc, S3C2412_CLKSRC);
+       return 0;
+}
+
+static unsigned long s3c2412_roundrate_usbsrc(struct clk *clk,
+                                             unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       int div;
+
+       if (rate > parent_rate)
+               return parent_rate;
+
+       div = parent_rate / rate;
+       if (div > 2)
+               div = 2;
+
+       return parent_rate / div;
+}
+
+static unsigned long s3c2412_getrate_usbsrc(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2410_CLKDIVN);
+
+       return parent_rate / ((div & S3C2412_CLKDIVN_USB48DIV) ? 2 : 1);
+}
+
+static int s3c2412_setrate_usbsrc(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdivn = __raw_readl(S3C2410_CLKDIVN);
+
+       rate = s3c2412_roundrate_usbsrc(clk, rate);
+
+       if ((parent_rate / rate) == 2)
+               clkdivn |= S3C2412_CLKDIVN_USB48DIV;
+       else
+               clkdivn &= ~S3C2412_CLKDIVN_USB48DIV;
+
+       __raw_writel(clkdivn, S3C2410_CLKDIVN);
+       return 0;
+}
+
+static struct clk clk_usbsrc = {
+       .name           = "usbsrc",
+       .id             = -1,
+       .get_rate       = s3c2412_getrate_usbsrc,
+       .set_rate       = s3c2412_setrate_usbsrc,
+       .round_rate     = s3c2412_roundrate_usbsrc,
+       .set_parent     = s3c2412_setparent_usbsrc,
+};
+
+static int s3c2412_setparent_msysclk(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
+
+       if (parent == &clk_mdivclk)
+               clksrc &= ~S3C2412_CLKSRC_MSYSCLK_MPLL;
+       else if (parent == &clk_upll)
+               clksrc |= S3C2412_CLKSRC_MSYSCLK_MPLL;
+       else
+               return -EINVAL;
+
+       clk->parent = parent;
+
+       __raw_writel(clksrc, S3C2412_CLKSRC);
+       return 0;
+}
+
+static struct clk clk_msysclk = {
+       .name           = "msysclk",
+       .id             = -1,
+       .set_parent     = s3c2412_setparent_msysclk,
+};
+
+/* these next clocks have an divider immediately after them,
+ * so we can register them with their divider and leave out the
+ * intermediate clock stage
+*/
+static unsigned long s3c2412_roundrate_clksrc(struct clk *clk,
+                                             unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       int div;
+
+       if (rate > parent_rate)
+               return parent_rate;
+
+       /* note, we remove the +/- 1 calculations as they cancel out */
+
+       div = (rate / parent_rate);
+
+       if (div < 1)
+               div = 1;
+       else if (div > 16)
+               div = 16;
+
+       return parent_rate / div;
+}
+
+static int s3c2412_setparent_uart(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
+
+       if (parent == &clk_erefclk)
+               clksrc &= ~S3C2412_CLKSRC_UARTCLK_MPLL;
+       else if (parent == &clk_mpll)
+               clksrc |= S3C2412_CLKSRC_UARTCLK_MPLL;
+       else
+               return -EINVAL;
+
+       clk->parent = parent;
+
+       __raw_writel(clksrc, S3C2412_CLKSRC);
+       return 0;
+}
+
+static unsigned long s3c2412_getrate_uart(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2410_CLKDIVN);
+
+       div &= S3C2412_CLKDIVN_UARTDIV_MASK;
+       div >>= S3C2412_CLKDIVN_UARTDIV_SHIFT;
+
+       return parent_rate / (div + 1);
+}
+
+static int s3c2412_setrate_uart(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdivn = __raw_readl(S3C2410_CLKDIVN);
+
+       rate = s3c2412_roundrate_clksrc(clk, rate);
+
+       clkdivn &= ~S3C2412_CLKDIVN_UARTDIV_MASK;
+       clkdivn |= ((parent_rate / rate) - 1) << S3C2412_CLKDIVN_UARTDIV_SHIFT;
+
+       __raw_writel(clkdivn, S3C2410_CLKDIVN);
+       return 0;
+}
+
+static struct clk clk_uart = {
+       .name           = "uartclk",
+       .id             = -1,
+       .get_rate       = s3c2412_getrate_uart,
+       .set_rate       = s3c2412_setrate_uart,
+       .set_parent     = s3c2412_setparent_uart,
+       .round_rate     = s3c2412_roundrate_clksrc,
+};
+
+static int s3c2412_setparent_i2s(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
+
+       if (parent == &clk_erefclk)
+               clksrc &= ~S3C2412_CLKSRC_I2SCLK_MPLL;
+       else if (parent == &clk_mpll)
+               clksrc |= S3C2412_CLKSRC_I2SCLK_MPLL;
+       else
+               return -EINVAL;
+
+       clk->parent = parent;
+
+       __raw_writel(clksrc, S3C2412_CLKSRC);
+       return 0;
+}
+
+static unsigned long s3c2412_getrate_i2s(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2410_CLKDIVN);
+
+       div &= S3C2412_CLKDIVN_I2SDIV_MASK;
+       div >>= S3C2412_CLKDIVN_I2SDIV_SHIFT;
+
+       return parent_rate / (div + 1);
+}
+
+static int s3c2412_setrate_i2s(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdivn = __raw_readl(S3C2410_CLKDIVN);
+
+       rate = s3c2412_roundrate_clksrc(clk, rate);
+
+       clkdivn &= ~S3C2412_CLKDIVN_I2SDIV_MASK;
+       clkdivn |= ((parent_rate / rate) - 1) << S3C2412_CLKDIVN_I2SDIV_SHIFT;
+
+       __raw_writel(clkdivn, S3C2410_CLKDIVN);
+       return 0;
+}
+
+static struct clk clk_i2s = {
+       .name           = "i2sclk",
+       .id             = -1,
+       .get_rate       = s3c2412_getrate_i2s,
+       .set_rate       = s3c2412_setrate_i2s,
+       .set_parent     = s3c2412_setparent_i2s,
+       .round_rate     = s3c2412_roundrate_clksrc,
+};
+
+static int s3c2412_setparent_cam(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
+
+       if (parent == &clk_usysclk)
+               clksrc &= ~S3C2412_CLKSRC_CAMCLK_HCLK;
+       else if (parent == &clk_h)
+               clksrc |= S3C2412_CLKSRC_CAMCLK_HCLK;
+       else
+               return -EINVAL;
+
+       clk->parent = parent;
+
+       __raw_writel(clksrc, S3C2412_CLKSRC);
+       return 0;
+}
+static unsigned long s3c2412_getrate_cam(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2410_CLKDIVN);
+
+       div &= S3C2412_CLKDIVN_CAMDIV_MASK;
+       div >>= S3C2412_CLKDIVN_CAMDIV_SHIFT;
+
+       return parent_rate / (div + 1);
+}
+
+static int s3c2412_setrate_cam(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdivn = __raw_readl(S3C2410_CLKDIVN);
+
+       rate = s3c2412_roundrate_clksrc(clk, rate);
+
+       clkdivn &= ~S3C2412_CLKDIVN_CAMDIV_MASK;
+       clkdivn |= ((parent_rate / rate) - 1) << S3C2412_CLKDIVN_CAMDIV_SHIFT;
+
+       __raw_writel(clkdivn, S3C2410_CLKDIVN);
+       return 0;
+}
+
+static struct clk clk_cam = {
+       .name           = "camif-upll", /* same as 2440 name */
+       .id             = -1,
+       .get_rate       = s3c2412_getrate_cam,
+       .set_rate       = s3c2412_setrate_cam,
+       .set_parent     = s3c2412_setparent_cam,
+       .round_rate     = s3c2412_roundrate_clksrc,
+};
+
+/* standard clock definitions */
+
+static struct clk init_clocks_disable[] = {
+       {
+               .name           = "nand",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_NAND,
+       }, {
+               .name           = "sdi",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_SDI,
+       }, {
+               .name           = "adc",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_ADC,
+       }, {
+               .name           = "i2c",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_IIC,
+       }, {
+               .name           = "iis",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_IIS,
+       }, {
+               .name           = "spi",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_SPI,
+       }
+};
+
+static struct clk init_clocks[] = {
+       {
+               .name           = "dma",
+               .id             = 0,
+               .parent         = &clk_h,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_DMA0,
+       }, {
+               .name           = "dma",
+               .id             = 1,
+               .parent         = &clk_h,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_DMA1,
+       }, {
+               .name           = "dma",
+               .id             = 2,
+               .parent         = &clk_h,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_DMA2,
+       }, {
+               .name           = "dma",
+               .id             = 3,
+               .parent         = &clk_h,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_DMA3,
+       }, {
+               .name           = "lcd",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_LCDC,
+       }, {
+               .name           = "gpio",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_GPIO,
+       }, {
+               .name           = "usb-host",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_USBH,
+       }, {
+               .name           = "usb-device",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_USBD,
+       }, {
+               .name           = "timers",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_PWMT,
+       }, {
+               .name           = "uart",
+               .id             = 0,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_UART0,
+       }, {
+               .name           = "uart",
+               .id             = 1,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_UART1,
+       }, {
+               .name           = "uart",
+               .id             = 2,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_UART2,
+       }, {
+               .name           = "rtc",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_RTC,
+       }, {
+               .name           = "watchdog",
+               .id             = -1,
+               .parent         = &clk_p,
+               .ctrlbit        = 0,
+       }, {
+               .name           = "usb-bus-gadget",
+               .id             = -1,
+               .parent         = &clk_usb_bus,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_USB_DEV48,
+       }, {
+               .name           = "usb-bus-host",
+               .id             = -1,
+               .parent         = &clk_usb_bus,
+               .enable         = s3c2412_clkcon_enable,
+               .ctrlbit        = S3C2412_CLKCON_USB_HOST48,
+       }
+};
+
+/* clocks to add where we need to check their parentage */
+
+struct clk_init {
+       struct clk      *clk;
+       unsigned int     bit;
+       struct clk      *src_0;
+       struct clk      *src_1;
+};
+
+static struct clk_init clks_src[] __initdata = {
+       {
+               .clk    = &clk_usysclk,
+               .bit    = S3C2412_CLKSRC_USBCLK_HCLK,
+               .src_0  = &clk_urefclk,
+               .src_1  = &clk_upll,
+       }, {
+               .clk    = &clk_i2s,
+               .bit    = S3C2412_CLKSRC_I2SCLK_MPLL,
+               .src_0  = &clk_erefclk,
+               .src_1  = &clk_mpll,
+       }, {
+               .clk    = &clk_cam,
+               .bit    = S3C2412_CLKSRC_CAMCLK_HCLK,
+               .src_0  = &clk_usysclk,
+               .src_1  = &clk_h,
+       }, {
+               .clk    = &clk_msysclk,
+               .bit    = S3C2412_CLKSRC_MSYSCLK_MPLL,
+               .src_0  = &clk_mdivclk,
+               .src_1  = &clk_mpll,
+       }, {
+               .clk    = &clk_uart,
+               .bit    = S3C2412_CLKSRC_UARTCLK_MPLL,
+               .src_0  = &clk_erefclk,
+               .src_1  = &clk_mpll,
+       }, {
+               .clk    = &clk_usbsrc,
+               .bit    = S3C2412_CLKSRC_USBCLK_HCLK,
+               .src_0  = &clk_usysclk,
+               .src_1  = &clk_h,
+       },
+};
+
+/* s3c2412_clk_initparents
+ *
+ * Initialise the parents for the clocks that we get at start-time
+*/
+
+static void __init s3c2412_clk_initparents(void)
+{
+       unsigned long clksrc = __raw_readl(S3C2412_CLKSRC);
+       struct clk_init *cip = clks_src;
+       struct clk *src;
+       int ptr;
+       int ret;
+
+       for (ptr = 0; ptr < ARRAY_SIZE(clks_src); ptr++, cip++) {
+               ret = s3c24xx_register_clock(cip->clk);
+               if (ret < 0) {
+                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
+                              cip->clk->name, ret);
+               }
+
+               src = (clksrc & cip->bit) ? cip->src_1 : cip->src_0;
+
+               printk(KERN_INFO "%s: parent %s\n", cip->clk->name, src->name);
+               clk_set_parent(cip->clk, src);
+       }
+}
+
+/* clocks to add straight away */
+
+static struct clk *clks[] __initdata = {
+       &clk_ext,
+       &clk_usb_bus,
+       &clk_erefclk,
+       &clk_urefclk,
+       &clk_mrefclk,
+};
+
+int __init s3c2412_baseclk_add(void)
+{
+       unsigned long clkcon  = __raw_readl(S3C2410_CLKCON);
+       struct clk *clkp;
+       int ret;
+       int ptr;
+
+       clk_upll.enable = s3c2412_upll_enable;
+       clk_usb_bus.parent = &clk_usbsrc;
+       clk_usb_bus.rate = 0x0;
+
+       s3c2412_clk_initparents();
+
+       for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) {
+               clkp = clks[ptr];
+
+               ret = s3c24xx_register_clock(clkp);
+               if (ret < 0) {
+                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
+                              clkp->name, ret);
+               }
+       }
+
+       /* ensure usb bus clock is within correct rate of 48MHz */
+
+       if (clk_get_rate(&clk_usb_bus) != (48 * 1000 * 1000)) {
+               printk(KERN_INFO "Warning: USB bus clock not at 48MHz\n");
+
+               /* for the moment, let's use the UPLL, and see if we can
+                * get 48MHz */
+
+               clk_set_parent(&clk_usysclk, &clk_upll);
+               clk_set_parent(&clk_usbsrc, &clk_usysclk);
+               clk_set_rate(&clk_usbsrc, 48*1000*1000);
+       }
+
+       printk("S3C2412: upll %s, %ld.%03ld MHz, usb-bus %ld.%03ld MHz\n",
+              (__raw_readl(S3C2410_UPLLCON) & S3C2412_PLLCON_OFF) ? "off":"on",
+              print_mhz(clk_get_rate(&clk_upll)),
+              print_mhz(clk_get_rate(&clk_usb_bus)));
+
+       /* register clocks from clock array */
+
+       clkp = init_clocks;
+       for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
+               /* ensure that we note the clock state */
+
+               clkp->usage = clkcon & clkp->ctrlbit ? 1 : 0;
+
+               ret = s3c24xx_register_clock(clkp);
+               if (ret < 0) {
+                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
+                              clkp->name, ret);
+               }
+       }
+
+       /* We must be careful disabling the clocks we are not intending to
+        * be using at boot time, as subsytems such as the LCD which do
+        * their own DMA requests to the bus can cause the system to lockup
+        * if they where in the middle of requesting bus access.
+        *
+        * Disabling the LCD clock if the LCD is active is very dangerous,
+        * and therefore the bootloader should be careful to not enable
+        * the LCD clock if it is not needed.
+       */
+
+       /* install (and disable) the clocks we do not need immediately */
+
+       clkp = init_clocks_disable;
+       for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
+
+               ret = s3c24xx_register_clock(clkp);
+               if (ret < 0) {
+                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
+                              clkp->name, ret);
+               }
+
+               s3c2412_clkcon_enable(clkp, 0);
+       }
+
+       return 0;
+}
diff --git a/arch/arm/mach-s3c2412/dma.c b/arch/arm/mach-s3c2412/dma.c
new file mode 100644 (file)
index 0000000..d0f4695
--- /dev/null
@@ -0,0 +1,162 @@
+/* linux/arch/arm/mach-s3c2412/dma.c
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2412 DMA selection
+ *
+ * http://armlinux.simtec.co.uk/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/sysdev.h>
+#include <linux/serial_core.h>
+
+#include <asm/dma.h>
+#include <asm/arch/dma.h>
+#include <asm/io.h>
+
+#include <asm/plat-s3c24xx/dma.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-ac97.h>
+#include <asm/arch/regs-mem.h>
+#include <asm/arch/regs-lcd.h>
+#include <asm/arch/regs-sdi.h>
+#include <asm/arch/regs-iis.h>
+#include <asm/arch/regs-spi.h>
+
+#define MAP(x) { (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID }
+
+static struct s3c24xx_dma_map __initdata s3c2412_dma_mappings[] = {
+       [DMACH_XD0] = {
+               .name           = "xdreq0",
+               .channels       = MAP(S3C2412_DMAREQSEL_XDREQ0),
+       },
+       [DMACH_XD1] = {
+               .name           = "xdreq1",
+               .channels       = MAP(S3C2412_DMAREQSEL_XDREQ1),
+       },
+       [DMACH_SDI] = {
+               .name           = "sdi",
+               .channels       = MAP(S3C2412_DMAREQSEL_SDI),
+               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
+               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_SPI0] = {
+               .name           = "spi0",
+               .channels       = MAP(S3C2412_DMAREQSEL_SPI0TX),
+               .hw_addr.to     = S3C2410_PA_SPI + S3C2410_SPTDAT,
+               .hw_addr.from   = S3C2410_PA_SPI + S3C2410_SPRDAT,
+       },
+       [DMACH_SPI1] = {
+               .name           = "spi1",
+               .channels       = MAP(S3C2412_DMAREQSEL_SPI1TX),
+               .hw_addr.to     = S3C2410_PA_SPI + 0x20 + S3C2410_SPTDAT,
+               .hw_addr.from   = S3C2410_PA_SPI + 0x20 + S3C2410_SPRDAT,
+       },
+       [DMACH_UART0] = {
+               .name           = "uart0",
+               .channels       = MAP(S3C2412_DMAREQSEL_UART0_0),
+               .hw_addr.to     = S3C2410_PA_UART0 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART0 + S3C2410_URXH,
+       },
+       [DMACH_UART1] = {
+               .name           = "uart1",
+               .channels       = MAP(S3C2412_DMAREQSEL_UART1_0),
+               .hw_addr.to     = S3C2410_PA_UART1 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART1 + S3C2410_URXH,
+       },
+       [DMACH_UART2] = {
+               .name           = "uart2",
+               .channels       = MAP(S3C2412_DMAREQSEL_UART2_0),
+               .hw_addr.to     = S3C2410_PA_UART2 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART2 + S3C2410_URXH,
+       },
+       [DMACH_UART0_SRC2] = {
+               .name           = "uart0",
+               .channels       = MAP(S3C2412_DMAREQSEL_UART0_1),
+               .hw_addr.to     = S3C2410_PA_UART0 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART0 + S3C2410_URXH,
+       },
+       [DMACH_UART1_SRC2] = {
+               .name           = "uart1",
+               .channels       = MAP(S3C2412_DMAREQSEL_UART1_1),
+               .hw_addr.to     = S3C2410_PA_UART1 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART1 + S3C2410_URXH,
+       },
+       [DMACH_UART2_SRC2] = {
+               .name           = "uart2",
+               .channels       = MAP(S3C2412_DMAREQSEL_UART2_1),
+               .hw_addr.to     = S3C2410_PA_UART2 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART2 + S3C2410_URXH,
+       },
+       [DMACH_TIMER] = {
+               .name           = "timer",
+               .channels       = MAP(S3C2412_DMAREQSEL_TIMER),
+       },
+       [DMACH_I2S_IN] = {
+               .name           = "i2s-sdi",
+               .channels       = MAP(S3C2412_DMAREQSEL_I2SRX),
+               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_I2S_OUT] = {
+               .name           = "i2s-sdo",
+               .channels       = MAP(S3C2412_DMAREQSEL_I2STX),
+               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_USB_EP1] = {
+               .name           = "usb-ep1",
+               .channels       = MAP(S3C2412_DMAREQSEL_USBEP1),
+       },
+       [DMACH_USB_EP2] = {
+               .name           = "usb-ep2",
+               .channels       = MAP(S3C2412_DMAREQSEL_USBEP2),
+       },
+       [DMACH_USB_EP3] = {
+               .name           = "usb-ep3",
+               .channels       = MAP(S3C2412_DMAREQSEL_USBEP3),
+       },
+       [DMACH_USB_EP4] = {
+               .name           = "usb-ep4",
+               .channels       = MAP(S3C2412_DMAREQSEL_USBEP4),
+       },
+};
+
+static void s3c2412_dma_select(struct s3c2410_dma_chan *chan,
+                              struct s3c24xx_dma_map *map)
+{
+       writel(map->channels[0] | S3C2412_DMAREQSEL_HW,
+              chan->regs + S3C2412_DMA_DMAREQSEL);
+}
+
+static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = {
+       .select         = s3c2412_dma_select,
+       .dcon_mask      = 0,
+       .map            = s3c2412_dma_mappings,
+       .map_size       = ARRAY_SIZE(s3c2412_dma_mappings),
+};
+
+static int s3c2412_dma_add(struct sys_device *sysdev)
+{
+       s3c2410_dma_init();
+       return s3c24xx_dma_init_map(&s3c2412_dma_sel);
+}
+
+static struct sysdev_driver s3c2412_dma_driver = {
+       .add    = s3c2412_dma_add,
+};
+
+static int __init s3c2412_dma_init(void)
+{
+       return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_dma_driver);
+}
+
+arch_initcall(s3c2412_dma_init);
diff --git a/arch/arm/mach-s3c2412/irq.c b/arch/arm/mach-s3c2412/irq.c
new file mode 100644 (file)
index 0000000..e89dbdc
--- /dev/null
@@ -0,0 +1,133 @@
+/* linux/arch/arm/mach-s3c2412/irq.c
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+*/
+
+#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 <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/mach/irq.h>
+
+#include <asm/arch/regs-irq.h>
+#include <asm/arch/regs-gpio.h>
+
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/irq.h>
+#include <asm/plat-s3c24xx/pm.h>
+
+/* the s3c2412 changes the behaviour of IRQ_EINT0 through IRQ_EINT3 by
+ * having them turn up in both the INT* and the EINT* registers. Whilst
+ * both show the status, they both now need to be acked when the IRQs
+ * go off.
+*/
+
+static void
+s3c2412_irq_mask(unsigned int irqno)
+{
+       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
+       unsigned long mask;
+
+       mask = __raw_readl(S3C2410_INTMSK);
+       __raw_writel(mask | bitval, S3C2410_INTMSK);
+
+       mask = __raw_readl(S3C2412_EINTMASK);
+       __raw_writel(mask | bitval, S3C2412_EINTMASK);
+}
+
+static inline void
+s3c2412_irq_ack(unsigned int irqno)
+{
+       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
+
+       __raw_writel(bitval, S3C2412_EINTPEND);
+       __raw_writel(bitval, S3C2410_SRCPND);
+       __raw_writel(bitval, S3C2410_INTPND);
+}
+
+static inline void
+s3c2412_irq_maskack(unsigned int irqno)
+{
+       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
+       unsigned long mask;
+
+       mask = __raw_readl(S3C2410_INTMSK);
+       __raw_writel(mask|bitval, S3C2410_INTMSK);
+
+       mask = __raw_readl(S3C2412_EINTMASK);
+       __raw_writel(mask | bitval, S3C2412_EINTMASK);
+
+       __raw_writel(bitval, S3C2412_EINTPEND);
+       __raw_writel(bitval, S3C2410_SRCPND);
+       __raw_writel(bitval, S3C2410_INTPND);
+}
+
+static void
+s3c2412_irq_unmask(unsigned int irqno)
+{
+       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
+       unsigned long mask;
+
+       mask = __raw_readl(S3C2412_EINTMASK);
+       __raw_writel(mask & ~bitval, S3C2412_EINTMASK);
+
+       mask = __raw_readl(S3C2410_INTMSK);
+       __raw_writel(mask & ~bitval, S3C2410_INTMSK);
+}
+
+static struct irq_chip s3c2412_irq_eint0t4 = {
+       .ack       = s3c2412_irq_ack,
+       .mask      = s3c2412_irq_mask,
+       .unmask    = s3c2412_irq_unmask,
+       .set_wake  = s3c_irq_wake,
+       .set_type  = s3c_irqext_type,
+};
+
+static int s3c2412_irq_add(struct sys_device *sysdev)
+{
+       unsigned int irqno;
+
+       for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
+               set_irq_chip(irqno, &s3c2412_irq_eint0t4);
+               set_irq_handler(irqno, handle_edge_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       return 0;
+}
+
+static struct sysdev_driver s3c2412_irq_driver = {
+       .add            = s3c2412_irq_add,
+       .suspend        = s3c24xx_irq_suspend,
+       .resume         = s3c24xx_irq_resume,
+};
+
+static int s3c2412_irq_init(void)
+{
+       return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_irq_driver);
+}
+
+arch_initcall(s3c2412_irq_init);
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
new file mode 100644 (file)
index 0000000..b5befce
--- /dev/null
@@ -0,0 +1,192 @@
+/* linux/arch/arm/mach-s3c2412/mach-smdk2413.c
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Thanks to Dimity Andric (TomTom) and Steven Ryu (Samsung) for the
+ * loans of SMDK2413 to work with.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/serial_core.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/hardware/iomd.h>
+#include <asm/setup.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+//#include <asm/debug-ll.h>
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-lcd.h>
+
+#include <asm/arch/idle.h>
+#include <asm/arch/udc.h>
+#include <asm/arch/fb.h>
+
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/s3c2412.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+#include <asm/plat-s3c24xx/common-smdk.h>
+
+static struct map_desc smdk2413_iodesc[] __initdata = {
+};
+
+static struct s3c2410_uartcfg smdk2413_uartcfgs[] __initdata = {
+       [0] = {
+               .hwport      = 0,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x51,
+       },
+       [1] = {
+               .hwport      = 1,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x51,
+       },
+       /* IR port */
+       [2] = {
+               .hwport      = 2,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x43,
+               .ufcon       = 0x51,
+       }
+};
+
+static void smdk2413_udc_pullup(enum s3c2410_udc_cmd_e cmd)
+{
+       printk(KERN_DEBUG "udc: pullup(%d)\n",cmd);
+
+       switch (cmd)
+       {
+               case S3C2410_UDC_P_ENABLE :
+                       s3c2410_gpio_setpin(S3C2410_GPF2, 1);
+                       break;
+               case S3C2410_UDC_P_DISABLE :
+                       s3c2410_gpio_setpin(S3C2410_GPF2, 0);
+                       break;
+               case S3C2410_UDC_P_RESET :
+                       break;
+               default:
+                       break;
+       }
+}
+
+
+static struct s3c2410_udc_mach_info smdk2413_udc_cfg __initdata = {
+       .udc_command            = smdk2413_udc_pullup,
+};
+
+
+static struct platform_device *smdk2413_devices[] __initdata = {
+       &s3c_device_usb,
+       //&s3c_device_lcd,
+       &s3c_device_wdt,
+       &s3c_device_i2c,
+       &s3c_device_iis,
+       &s3c_device_usbgadget,
+};
+
+static struct s3c24xx_board smdk2413_board __initdata = {
+       .devices       = smdk2413_devices,
+       .devices_count = ARRAY_SIZE(smdk2413_devices)
+};
+
+static void __init smdk2413_fixup(struct machine_desc *desc,
+                                 struct tag *tags, char **cmdline,
+                                 struct meminfo *mi)
+{
+       if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
+               mi->nr_banks=1;
+               mi->bank[0].start = 0x30000000;
+               mi->bank[0].size = SZ_64M;
+               mi->bank[0].node = 0;
+       }
+}
+
+static void __init smdk2413_map_io(void)
+{
+       s3c24xx_init_io(smdk2413_iodesc, ARRAY_SIZE(smdk2413_iodesc));
+       s3c24xx_init_clocks(12000000);
+       s3c24xx_init_uarts(smdk2413_uartcfgs, ARRAY_SIZE(smdk2413_uartcfgs));
+       s3c24xx_set_board(&smdk2413_board);
+}
+
+static void __init smdk2413_machine_init(void)
+{      /* Turn off suspend on both USB ports, and switch the
+        * selectable USB port to USB device mode. */
+
+       s3c2410_gpio_setpin(S3C2410_GPF2, 0);
+       s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPIO_OUTPUT);
+
+       s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
+                             S3C2410_MISCCR_USBSUSPND0 |
+                             S3C2410_MISCCR_USBSUSPND1, 0x0);
+
+
+       s3c24xx_udc_set_platdata(&smdk2413_udc_cfg);
+
+       smdk_machine_init();
+}
+
+MACHINE_START(S3C2413, "S3C2413")
+       /* Maintainer: Ben Dooks <ben@fluff.org> */
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+
+       .fixup          = smdk2413_fixup,
+       .init_irq       = s3c24xx_init_irq,
+       .map_io         = smdk2413_map_io,
+       .init_machine   = smdk2413_machine_init,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
+
+MACHINE_START(SMDK2412, "SMDK2412")
+       /* Maintainer: Ben Dooks <ben@fluff.org> */
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+
+       .fixup          = smdk2413_fixup,
+       .init_irq       = s3c24xx_init_irq,
+       .map_io         = smdk2413_map_io,
+       .init_machine   = smdk2413_machine_init,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
+
+MACHINE_START(SMDK2413, "SMDK2413")
+       /* Maintainer: Ben Dooks <ben@fluff.org> */
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+
+       .fixup          = smdk2413_fixup,
+       .init_irq       = s3c24xx_init_irq,
+       .map_io         = smdk2413_map_io,
+       .init_machine   = smdk2413_machine_init,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
new file mode 100644 (file)
index 0000000..4231b54
--- /dev/null
@@ -0,0 +1,168 @@
+/* linux/arch/arm/mach-s3c2412/mach-vstms.c
+ *
+ * (C) 2006 Thomas Gleixner <tglx@linutronix.de>
+ *
+ * Derived from mach-smdk2413.c - (C) 2006 Simtec Electronics
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <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/serial_core.h>
+#include <linux/platform_device.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/nand_ecc.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-lcd.h>
+
+#include <asm/arch/idle.h>
+#include <asm/arch/fb.h>
+
+#include <asm/arch/nand.h>
+
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/s3c2412.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+
+static struct map_desc vstms_iodesc[] __initdata = {
+};
+
+static struct s3c2410_uartcfg vstms_uartcfgs[] __initdata = {
+       [0] = {
+               .hwport      = 0,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x51,
+       },
+       [1] = {
+               .hwport      = 1,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x51,
+       },
+       [2] = {
+               .hwport      = 2,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x51,
+       }
+};
+
+static struct mtd_partition vstms_nand_part[] = {
+       [0] = {
+               .name   = "Boot Agent",
+               .size   = 0x7C000,
+               .offset = 0,
+       },
+       [1] = {
+               .name   = "UBoot Config",
+               .offset = 0x7C000,
+               .size   = 0x4000,
+       },
+       [2] = {
+               .name   = "Kernel",
+               .offset = 0x80000,
+               .size   = 0x200000,
+       },
+       [3] = {
+               .name   = "RFS",
+               .offset = 0x280000,
+               .size   = 0x3d80000,
+       },
+};
+
+static struct s3c2410_nand_set vstms_nand_sets[] = {
+       [0] = {
+               .name           = "NAND",
+               .nr_chips       = 1,
+               .nr_partitions  = ARRAY_SIZE(vstms_nand_part),
+               .partitions     = vstms_nand_part,
+       },
+};
+
+/* choose a set of timings which should suit most 512Mbit
+ * chips and beyond.
+*/
+
+static struct s3c2410_platform_nand vstms_nand_info = {
+       .tacls          = 20,
+       .twrph0         = 60,
+       .twrph1         = 20,
+       .nr_sets        = ARRAY_SIZE(vstms_nand_sets),
+       .sets           = vstms_nand_sets,
+};
+
+static struct platform_device *vstms_devices[] __initdata = {
+       &s3c_device_usb,
+       &s3c_device_wdt,
+       &s3c_device_i2c,
+       &s3c_device_iis,
+       &s3c_device_rtc,
+       &s3c_device_nand,
+};
+
+static struct s3c24xx_board vstms_board __initdata = {
+       .devices       = vstms_devices,
+       .devices_count = ARRAY_SIZE(vstms_devices)
+};
+
+static void __init vstms_fixup(struct machine_desc *desc,
+                                 struct tag *tags, char **cmdline,
+                                 struct meminfo *mi)
+{
+       if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
+               mi->nr_banks=1;
+               mi->bank[0].start = 0x30000000;
+               mi->bank[0].size = SZ_64M;
+               mi->bank[0].node = 0;
+       }
+}
+
+static void __init vstms_map_io(void)
+{
+       s3c_device_nand.dev.platform_data = &vstms_nand_info;
+
+       s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
+       s3c24xx_init_clocks(12000000);
+       s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
+       s3c24xx_set_board(&vstms_board);
+}
+
+MACHINE_START(VSTMS, "VSTMS")
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+
+       .fixup          = vstms_fixup,
+       .init_irq       = s3c24xx_init_irq,
+       .map_io         = vstms_map_io,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c
new file mode 100644 (file)
index 0000000..8988dac
--- /dev/null
@@ -0,0 +1,128 @@
+/* linux/arch/arm/mach-s3c2412/pm.c
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * http://armlinux.simtec.co.uk/.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/sysdev.h>
+#include <linux/platform_device.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+
+#include <asm/arch/regs-power.h>
+#include <asm/arch/regs-gpioj.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-dsc.h>
+
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
+
+#include <asm/plat-s3c24xx/s3c2412.h>
+
+static void s3c2412_cpu_suspend(void)
+{
+       unsigned long tmp;
+
+       /* set our standby method to sleep */
+
+       tmp = __raw_readl(S3C2412_PWRCFG);
+       tmp |= S3C2412_PWRCFG_STANDBYWFI_SLEEP;
+       __raw_writel(tmp, S3C2412_PWRCFG);
+
+       /* issue the standby signal into the pm unit. Note, we
+        * issue a write-buffer drain just in case */
+
+       tmp = 0;
+
+       asm("b 1f\n\t"
+           ".align 5\n\t"
+           "1:\n\t"
+           "mcr p15, 0, %0, c7, c10, 4\n\t"
+           "mcr p15, 0, %0, c7, c0, 4" :: "r" (tmp));
+
+       /* we should never get past here */
+
+       panic("sleep resumed to originator?");
+}
+
+static void s3c2412_pm_prepare(void)
+{
+}
+
+static int s3c2412_pm_add(struct sys_device *sysdev)
+{
+       pm_cpu_prep = s3c2412_pm_prepare;
+       pm_cpu_sleep = s3c2412_cpu_suspend;
+
+       return 0;
+}
+
+static struct sleep_save s3c2412_sleep[] = {
+       SAVE_ITEM(S3C2412_DSC0),
+       SAVE_ITEM(S3C2412_DSC1),
+       SAVE_ITEM(S3C2413_GPJDAT),
+       SAVE_ITEM(S3C2413_GPJCON),
+       SAVE_ITEM(S3C2413_GPJUP),
+
+       /* save the PWRCFG to get back to original sleep method */
+
+       SAVE_ITEM(S3C2412_PWRCFG),
+
+       /* save the sleep configuration anyway, just in case these
+        * get damaged during wakeup */
+
+       SAVE_ITEM(S3C2412_GPBSLPCON),
+       SAVE_ITEM(S3C2412_GPCSLPCON),
+       SAVE_ITEM(S3C2412_GPDSLPCON),
+       SAVE_ITEM(S3C2412_GPESLPCON),
+       SAVE_ITEM(S3C2412_GPFSLPCON),
+       SAVE_ITEM(S3C2412_GPGSLPCON),
+       SAVE_ITEM(S3C2412_GPHSLPCON),
+       SAVE_ITEM(S3C2413_GPJSLPCON),
+};
+
+static int s3c2412_pm_suspend(struct sys_device *dev, pm_message_t state)
+{
+       s3c2410_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
+       return 0;
+}
+
+static int s3c2412_pm_resume(struct sys_device *dev)
+{
+       unsigned long tmp;
+
+       tmp = __raw_readl(S3C2412_PWRCFG);
+       tmp &= ~S3C2412_PWRCFG_STANDBYWFI_MASK;
+       tmp |=  S3C2412_PWRCFG_STANDBYWFI_IDLE;
+       __raw_writel(tmp, S3C2412_PWRCFG);
+
+       s3c2410_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
+       return 0;
+}
+
+static struct sysdev_driver s3c2412_pm_driver = {
+       .add            = s3c2412_pm_add,
+       .suspend        = s3c2412_pm_suspend,
+       .resume         = s3c2412_pm_resume,
+};
+
+static __init int s3c2412_pm_init(void)
+{
+       return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver);
+}
+
+arch_initcall(s3c2412_pm_init);
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
new file mode 100644 (file)
index 0000000..aafe0bc
--- /dev/null
@@ -0,0 +1,181 @@
+/* linux/arch/arm/mach-s3c2412/s3c2412.c
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * http://armlinux.simtec.co.uk/.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/sysdev.h>
+#include <linux/serial_core.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/proc-fns.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+
+#include <asm/arch/idle.h>
+
+#include <asm/arch/regs-clock.h>
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-power.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-gpioj.h>
+#include <asm/arch/regs-dsc.h>
+
+#include <asm/plat-s3c24xx/s3c2412.h>
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/pm.h>
+
+#ifndef CONFIG_CPU_S3C2412_ONLY
+void __iomem *s3c24xx_va_gpio2 = S3C24XX_VA_GPIO;
+
+static inline void s3c2412_init_gpio2(void)
+{
+       s3c24xx_va_gpio2 = S3C24XX_VA_GPIO + 0x10;
+}
+#else
+#define s3c2412_init_gpio2() do { } while(0)
+#endif
+
+/* Initial IO mappings */
+
+static struct map_desc s3c2412_iodesc[] __initdata = {
+       IODESC_ENT(CLKPWR),
+       IODESC_ENT(LCD),
+       IODESC_ENT(TIMER),
+       IODESC_ENT(WATCHDOG),
+};
+
+/* uart registration process */
+
+void __init s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no)
+{
+       s3c24xx_init_uartdevs("s3c2412-uart", s3c2410_uart_resources, cfg, no);
+
+       /* rename devices that are s3c2412/s3c2413 specific */
+       s3c_device_sdi.name  = "s3c2412-sdi";
+       s3c_device_lcd.name  = "s3c2412-lcd";
+       s3c_device_nand.name = "s3c2412-nand";
+}
+
+/* s3c2412_idle
+ *
+ * use the standard idle call by ensuring the idle mode
+ * in power config, then issuing the idle co-processor
+ * instruction
+*/
+
+static void s3c2412_idle(void)
+{
+       unsigned long tmp;
+
+       /* ensure our idle mode is to go to idle */
+
+       tmp = __raw_readl(S3C2412_PWRCFG);
+       tmp &= ~S3C2412_PWRCFG_STANDBYWFI_MASK;
+       tmp |= S3C2412_PWRCFG_STANDBYWFI_IDLE;
+       __raw_writel(tmp, S3C2412_PWRCFG);
+
+       cpu_do_idle();
+}
+
+/* s3c2412_map_io
+ *
+ * register the standard cpu IO areas, and any passed in from the
+ * machine specific initialisation.
+*/
+
+void __init s3c2412_map_io(struct map_desc *mach_desc, int mach_size)
+{
+       /* move base of IO */
+
+       s3c2412_init_gpio2();
+
+       /* set our idle function */
+
+       s3c24xx_idle = s3c2412_idle;
+
+       /* register our io-tables */
+
+       iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc));
+       iotable_init(mach_desc, mach_size);
+}
+
+void __init s3c2412_init_clocks(int xtal)
+{
+       unsigned long tmp;
+       unsigned long fclk;
+       unsigned long hclk;
+       unsigned long pclk;
+
+       /* now we've got our machine bits initialised, work out what
+        * clocks we've got */
+
+       fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), xtal*2);
+
+       tmp = __raw_readl(S3C2410_CLKDIVN);
+
+       /* work out clock scalings */
+
+       hclk = fclk / ((tmp & S3C2412_CLKDIVN_HDIVN_MASK) + 1);
+       hclk /= ((tmp & S3C2421_CLKDIVN_ARMDIVN) ? 2 : 1);
+       pclk = hclk / ((tmp & S3C2412_CLKDIVN_PDIVN) ? 2 : 1);
+
+       /* print brieft summary of clocks, etc */
+
+       printk("S3C2412: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n",
+              print_mhz(fclk), print_mhz(hclk), print_mhz(pclk));
+
+       /* initialise the clocks here, to allow other things like the
+        * console to use them
+        */
+
+       s3c24xx_setup_clocks(xtal, fclk, hclk, pclk);
+       s3c2412_baseclk_add();
+}
+
+/* need to register class before we actually register the device, and
+ * we also need to ensure that it has been initialised before any of the
+ * drivers even try to use it (even if not on an s3c2412 based system)
+ * as a driver which may support both 2410 and 2440 may try and use it.
+*/
+
+struct sysdev_class s3c2412_sysclass = {
+       set_kset_name("s3c2412-core"),
+};
+
+static int __init s3c2412_core_init(void)
+{
+       return sysdev_class_register(&s3c2412_sysclass);
+}
+
+core_initcall(s3c2412_core_init);
+
+static struct sys_device s3c2412_sysdev = {
+       .cls            = &s3c2412_sysclass,
+};
+
+int __init s3c2412_init(void)
+{
+       printk("S3C2412: Initialising architecture\n");
+
+       return sysdev_register(&s3c2412_sysdev);
+}
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
new file mode 100644 (file)
index 0000000..e3bfda0
--- /dev/null
@@ -0,0 +1,71 @@
+# arch/arm/mach-s3c2440/Kconfig
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+config CPU_S3C2440
+       bool
+       depends on ARCH_S3C2410
+       select S3C2410_CLOCK
+       select S3C2410_PM if PM
+       select S3C2410_GPIO
+       select S3C2440_DMA if S3C2410_DMA
+       select CPU_S3C244X
+       help
+         Support for S3C2440 Samsung Mobile CPU based systems.
+
+config S3C2440_DMA
+       bool
+       depends on ARCH_S3C2410 && CPU_S3C24405B
+       help
+         Support for S3C2440 specific DMA code5A
+
+
+menu "S3C2440 Machines"
+
+config MACH_ANUBIS
+       bool "Simtec Electronics ANUBIS"
+       select CPU_S3C2440
+       select PM_SIMTEC if PM
+       help
+         Say Y here if you are using the Simtec Electronics ANUBIS
+         development system
+
+config MACH_OSIRIS
+       bool "Simtec IM2440D20 (OSIRIS) module"
+       select CPU_S3C2440
+       select PM_SIMTEC if PM
+       help
+         Say Y here if you are using the Simtec IM2440D20 module, also
+         known as the Osiris.
+
+config MACH_RX3715
+       bool "HP iPAQ rx3715"
+       select CPU_S3C2440
+       select PM_H1940 if PM
+       help
+         Say Y here if you are using the HP iPAQ rx3715.
+
+config ARCH_S3C2440
+       bool "SMDK2440"
+       select CPU_S3C2440
+       select MACH_SMDK
+       help
+         Say Y here if you are using the SMDK2440.
+
+config MACH_NEXCODER_2440
+       bool "NexVision NEXCODER 2440 Light Board"
+       select CPU_S3C2440
+       help
+         Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
+
+config SMDK2440_CPU2440
+       bool "SMDK2440 with S3C2440 CPU module"
+       depends on ARCH_S3C2440
+       default y if ARCH_S3C2440
+       select CPU_S3C2440
+
+
+endmenu
+
diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile
new file mode 100644 (file)
index 0000000..c81ed62
--- /dev/null
@@ -0,0 +1,23 @@
+# arch/arm/mach-s3c2440/Makefile
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+obj-y                          :=
+obj-m                          :=
+obj-n                          :=
+obj-                           :=
+
+obj-$(CONFIG_CPU_S3C2440)      += s3c2440.o dsc.o
+obj-$(CONFIG_CPU_S3C2440)      += irq.o
+obj-$(CONFIG_CPU_S3C2440)      += clock.o
+obj-$(CONFIG_S3C2440_DMA)      += dma.o
+
+# Machine support
+
+obj-$(CONFIG_MACH_ANUBIS)      += mach-anubis.o
+obj-$(CONFIG_MACH_OSIRIS)      += mach-osiris.o
+obj-$(CONFIG_MACH_RX3715)      += mach-rx3715.o
+obj-$(CONFIG_ARCH_S3C2440)     += mach-smdk2440.o
+obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
diff --git a/arch/arm/mach-s3c2440/clock.c b/arch/arm/mach-s3c2440/clock.c
new file mode 100644 (file)
index 0000000..79e2ea4
--- /dev/null
@@ -0,0 +1,170 @@
+/* linux/arch/arm/mach-s3c2440/clock.c
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     http://armlinux.simtec.co.uk/
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2440 Clock 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/device.h>
+#include <linux/sysdev.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/mutex.h>
+#include <linux/clk.h>
+
+#include <asm/hardware.h>
+#include <asm/atomic.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/arch/regs-clock.h>
+
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+/* S3C2440 extended clock support */
+
+static unsigned long s3c2440_camif_upll_round(struct clk *clk,
+                                             unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       int div;
+
+       if (rate > parent_rate)
+               return parent_rate;
+
+       /* note, we remove the +/- 1 calculations for the divisor */
+
+       div = (parent_rate / rate) / 2;
+
+       if (div < 1)
+               div = 1;
+       else if (div > 16)
+               div = 16;
+
+       return parent_rate / (div * 2);
+}
+
+static int s3c2440_camif_upll_setrate(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long camdivn =  __raw_readl(S3C2440_CAMDIVN);
+
+       rate = s3c2440_camif_upll_round(clk, rate);
+
+       camdivn &= ~(S3C2440_CAMDIVN_CAMCLK_SEL | S3C2440_CAMDIVN_CAMCLK_MASK);
+
+       if (rate != parent_rate) {
+               camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL;
+               camdivn |= (((parent_rate / rate) / 2) - 1);
+       }
+
+       __raw_writel(camdivn, S3C2440_CAMDIVN);
+
+       return 0;
+}
+
+/* Extra S3C2440 clocks */
+
+static struct clk s3c2440_clk_cam = {
+       .name           = "camif",
+       .id             = -1,
+       .enable         = s3c2410_clkcon_enable,
+       .ctrlbit        = S3C2440_CLKCON_CAMERA,
+};
+
+static struct clk s3c2440_clk_cam_upll = {
+       .name           = "camif-upll",
+       .id             = -1,
+       .set_rate       = s3c2440_camif_upll_setrate,
+       .round_rate     = s3c2440_camif_upll_round,
+};
+
+static struct clk s3c2440_clk_ac97 = {
+       .name           = "ac97",
+       .id             = -1,
+       .enable         = s3c2410_clkcon_enable,
+       .ctrlbit        = S3C2440_CLKCON_CAMERA,
+};
+
+static int s3c2440_clk_add(struct sys_device *sysdev)
+{
+       unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
+       unsigned long clkdivn;
+       struct clk *clock_h;
+       struct clk *clock_p;
+       struct clk *clock_upll;
+
+       printk("S3C2440: Clock Support, DVS %s\n",
+              (camdivn & S3C2440_CAMDIVN_DVSEN) ? "on" : "off");
+
+       clock_p = clk_get(NULL, "pclk");
+       clock_h = clk_get(NULL, "hclk");
+       clock_upll = clk_get(NULL, "upll");
+
+       if (IS_ERR(clock_p) || IS_ERR(clock_h) || IS_ERR(clock_upll)) {
+               printk(KERN_ERR "S3C2440: Failed to get parent clocks\n");
+               return -EINVAL;
+       }
+
+       /* check rate of UPLL, and if it is near 96MHz, then change
+        * to using half the UPLL rate for the system */
+
+       if (clk_get_rate(clock_upll) > (94 * MHZ)) {
+               clk_usb_bus.rate = clk_get_rate(clock_upll) / 2;
+
+               mutex_lock(&clocks_mutex);
+
+               clkdivn = __raw_readl(S3C2410_CLKDIVN);
+               clkdivn |= S3C2440_CLKDIVN_UCLK;
+               __raw_writel(clkdivn, S3C2410_CLKDIVN);
+
+               mutex_unlock(&clocks_mutex);
+       }
+
+       s3c2440_clk_cam.parent = clock_h;
+       s3c2440_clk_ac97.parent = clock_p;
+       s3c2440_clk_cam_upll.parent = clock_upll;
+
+       s3c24xx_register_clock(&s3c2440_clk_ac97);
+       s3c24xx_register_clock(&s3c2440_clk_cam);
+       s3c24xx_register_clock(&s3c2440_clk_cam_upll);
+
+       clk_disable(&s3c2440_clk_ac97);
+       clk_disable(&s3c2440_clk_cam);
+
+       return 0;
+}
+
+static struct sysdev_driver s3c2440_clk_driver = {
+       .add    = s3c2440_clk_add,
+};
+
+static __init int s3c24xx_clk_driver(void)
+{
+       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver);
+}
+
+arch_initcall(s3c24xx_clk_driver);
diff --git a/arch/arm/mach-s3c2440/dma.c b/arch/arm/mach-s3c2440/dma.c
new file mode 100644 (file)
index 0000000..cd035a3
--- /dev/null
@@ -0,0 +1,210 @@
+/* linux/arch/arm/mach-s3c2440/dma.c
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2440 DMA selection
+ *
+ * http://armlinux.simtec.co.uk/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/sysdev.h>
+#include <linux/serial_core.h>
+
+#include <asm/dma.h>
+#include <asm/arch/dma.h>
+
+#include <asm/plat-s3c24xx/dma.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-ac97.h>
+#include <asm/arch/regs-mem.h>
+#include <asm/arch/regs-lcd.h>
+#include <asm/arch/regs-sdi.h>
+#include <asm/arch/regs-iis.h>
+#include <asm/arch/regs-spi.h>
+
+static struct s3c24xx_dma_map __initdata s3c2440_dma_mappings[] = {
+       [DMACH_XD0] = {
+               .name           = "xdreq0",
+               .channels[0]    = S3C2410_DCON_CH0_XDREQ0 | DMA_CH_VALID,
+       },
+       [DMACH_XD1] = {
+               .name           = "xdreq1",
+               .channels[1]    = S3C2410_DCON_CH1_XDREQ1 | DMA_CH_VALID,
+       },
+       [DMACH_SDI] = {
+               .name           = "sdi",
+               .channels[0]    = S3C2410_DCON_CH0_SDI | DMA_CH_VALID,
+               .channels[1]    = S3C2440_DCON_CH1_SDI | DMA_CH_VALID,
+               .channels[2]    = S3C2410_DCON_CH2_SDI | DMA_CH_VALID,
+               .channels[3]    = S3C2410_DCON_CH3_SDI | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
+               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_SPI0] = {
+               .name           = "spi0",
+               .channels[1]    = S3C2410_DCON_CH1_SPI | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_SPI + S3C2410_SPTDAT,
+               .hw_addr.from   = S3C2410_PA_SPI + S3C2410_SPRDAT,
+       },
+       [DMACH_SPI1] = {
+               .name           = "spi1",
+               .channels[3]    = S3C2410_DCON_CH3_SPI | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_SPI + 0x20 + S3C2410_SPTDAT,
+               .hw_addr.from   = S3C2410_PA_SPI + 0x20 + S3C2410_SPRDAT,
+       },
+       [DMACH_UART0] = {
+               .name           = "uart0",
+               .channels[0]    = S3C2410_DCON_CH0_UART0 | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_UART0 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART0 + S3C2410_URXH,
+       },
+       [DMACH_UART1] = {
+               .name           = "uart1",
+               .channels[1]    = S3C2410_DCON_CH1_UART1 | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_UART1 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART1 + S3C2410_URXH,
+       },
+       [DMACH_UART2] = {
+               .name           = "uart2",
+               .channels[3]    = S3C2410_DCON_CH3_UART2 | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_UART2 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART2 + S3C2410_URXH,
+       },
+       [DMACH_TIMER] = {
+               .name           = "timer",
+               .channels[0]    = S3C2410_DCON_CH0_TIMER | DMA_CH_VALID,
+               .channels[2]    = S3C2410_DCON_CH2_TIMER | DMA_CH_VALID,
+               .channels[3]    = S3C2410_DCON_CH3_TIMER | DMA_CH_VALID,
+       },
+       [DMACH_I2S_IN] = {
+               .name           = "i2s-sdi",
+               .channels[1]    = S3C2410_DCON_CH1_I2SSDI | DMA_CH_VALID,
+               .channels[2]    = S3C2410_DCON_CH2_I2SSDI | DMA_CH_VALID,
+               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_I2S_OUT] = {
+               .name           = "i2s-sdo",
+               .channels[0]    = S3C2440_DCON_CH0_I2SSDO | DMA_CH_VALID,
+               .channels[2]    = S3C2410_DCON_CH2_I2SSDO | DMA_CH_VALID,
+               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_PCM_IN] = {
+               .name           = "pcm-in",
+               .channels[0]    = S3C2440_DCON_CH0_PCMIN | DMA_CH_VALID,
+               .channels[2]    = S3C2440_DCON_CH2_PCMIN | DMA_CH_VALID,
+               .hw_addr.from   = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA,
+       },
+       [DMACH_PCM_OUT] = {
+               .name           = "pcm-out",
+               .channels[1]    = S3C2440_DCON_CH1_PCMOUT | DMA_CH_VALID,
+               .channels[3]    = S3C2440_DCON_CH3_PCMOUT | DMA_CH_VALID,
+               .hw_addr.to     = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA,
+       },
+       [DMACH_MIC_IN] = {
+               .name           = "mic-in",
+               .channels[2]    = S3C2440_DCON_CH2_MICIN | DMA_CH_VALID,
+               .channels[3]    = S3C2440_DCON_CH3_MICIN | DMA_CH_VALID,
+               .hw_addr.from   = S3C2440_PA_AC97 + S3C_AC97_MIC_DATA,
+       },
+       [DMACH_USB_EP1] = {
+               .name           = "usb-ep1",
+               .channels[0]    = S3C2410_DCON_CH0_USBEP1 | DMA_CH_VALID,
+       },
+       [DMACH_USB_EP2] = {
+               .name           = "usb-ep2",
+               .channels[1]    = S3C2410_DCON_CH1_USBEP2 | DMA_CH_VALID,
+       },
+       [DMACH_USB_EP3] = {
+               .name           = "usb-ep3",
+               .channels[2]    = S3C2410_DCON_CH2_USBEP3 | DMA_CH_VALID,
+       },
+       [DMACH_USB_EP4] = {
+               .name           = "usb-ep4",
+               .channels[3]    = S3C2410_DCON_CH3_USBEP4 | DMA_CH_VALID,
+       },
+};
+
+static void s3c2440_dma_select(struct s3c2410_dma_chan *chan,
+                              struct s3c24xx_dma_map *map)
+{
+       chan->dcon = map->channels[chan->number] & ~DMA_CH_VALID;
+}
+
+static struct s3c24xx_dma_selection __initdata s3c2440_dma_sel = {
+       .select         = s3c2440_dma_select,
+       .dcon_mask      = 7 << 24,
+       .map            = s3c2440_dma_mappings,
+       .map_size       = ARRAY_SIZE(s3c2440_dma_mappings),
+};
+
+static struct s3c24xx_dma_order __initdata s3c2440_dma_order = {
+       .channels       = {
+               [DMACH_SDI]     = {
+                       .list   = {
+                               [0]     = 3 | DMA_CH_VALID,
+                               [1]     = 2 | DMA_CH_VALID,
+                               [2]     = 1 | DMA_CH_VALID,
+                               [3]     = 0 | DMA_CH_VALID,
+                       },
+               },
+               [DMACH_I2S_IN]  = {
+                       .list   = {
+                               [0]     = 1 | DMA_CH_VALID,
+                               [1]     = 2 | DMA_CH_VALID,
+                       },
+               },
+               [DMACH_I2S_OUT] = {
+                       .list   = {
+                               [0]     = 2 | DMA_CH_VALID,
+                               [1]     = 1 | DMA_CH_VALID,
+                       },
+               },
+               [DMACH_PCM_IN] = {
+                       .list   = {
+                               [0]     = 2 | DMA_CH_VALID,
+                               [1]     = 1 | DMA_CH_VALID,
+                       },
+               },
+               [DMACH_PCM_OUT] = {
+                       .list   = {
+                               [0]     = 1 | DMA_CH_VALID,
+                               [1]     = 3 | DMA_CH_VALID,
+                       },
+               },
+               [DMACH_MIC_IN] = {
+                       .list   = {
+                               [0]     = 3 | DMA_CH_VALID,
+                               [1]     = 2 | DMA_CH_VALID,
+                       },
+               },
+       },
+};
+
+static int s3c2440_dma_add(struct sys_device *sysdev)
+{
+       s3c2410_dma_init();
+       s3c24xx_dma_order_set(&s3c2440_dma_order);
+       return s3c24xx_dma_init_map(&s3c2440_dma_sel);
+}
+
+static struct sysdev_driver s3c2440_dma_driver = {
+       .add    = s3c2440_dma_add,
+};
+
+static int __init s3c2440_dma_init(void)
+{
+       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_dma_driver);
+}
+
+arch_initcall(s3c2440_dma_init);
+
diff --git a/arch/arm/mach-s3c2440/dsc.c b/arch/arm/mach-s3c2440/dsc.c
new file mode 100644 (file)
index 0000000..2995ff5
--- /dev/null
@@ -0,0 +1,54 @@
+/* linux/arch/arm/mach-s3c2440/dsc.c
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *   Ben Dooks <ben@simtec.co.uk>
+ *
+ * Samsung S3C2440 Drive Strength Control support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/module.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-dsc.h>
+
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/s3c2440.h>
+
+int s3c2440_set_dsc(unsigned int pin, unsigned int value)
+{
+       void __iomem *base;
+       unsigned long val;
+       unsigned long flags;
+       unsigned long mask;
+
+       base = (pin & S3C2440_SELECT_DSC1) ? S3C2440_DSC1 : S3C2440_DSC0;
+       mask = 3 << S3C2440_DSC_GETSHIFT(pin);
+
+       local_irq_save(flags);
+
+       val = __raw_readl(base);
+       val &= ~mask;
+       val |= value & mask;
+       __raw_writel(val, base);
+
+       local_irq_restore(flags);
+       return 0;
+}
+
+EXPORT_SYMBOL(s3c2440_set_dsc);
diff --git a/arch/arm/mach-s3c2440/irq.c b/arch/arm/mach-s3c2440/irq.c
new file mode 100644 (file)
index 0000000..1069d13
--- /dev/null
@@ -0,0 +1,130 @@
+/* linux/arch/arm/mach-s3c2440/irq.c
+ *
+ * Copyright (c) 2003,2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+*/
+
+#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 <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/mach/irq.h>
+
+#include <asm/arch/regs-irq.h>
+#include <asm/arch/regs-gpio.h>
+
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
+#include <asm/plat-s3c24xx/irq.h>
+
+/* WDT/AC97 */
+
+static void s3c_irq_demux_wdtac97(unsigned int irq,
+                                 struct irq_desc *desc)
+{
+       unsigned int subsrc, submsk;
+       struct irq_desc *mydesc;
+
+       /* read the current pending interrupts, and the mask
+        * for what it is available */
+
+       subsrc = __raw_readl(S3C2410_SUBSRCPND);
+       submsk = __raw_readl(S3C2410_INTSUBMSK);
+
+       subsrc &= ~submsk;
+       subsrc >>= 13;
+       subsrc &= 3;
+
+       if (subsrc != 0) {
+               if (subsrc & 1) {
+                       mydesc = irq_desc + IRQ_S3C2440_WDT;
+                       desc_handle_irq(IRQ_S3C2440_WDT, mydesc);
+               }
+               if (subsrc & 2) {
+                       mydesc = irq_desc + IRQ_S3C2440_AC97;
+                       desc_handle_irq(IRQ_S3C2440_AC97, mydesc);
+               }
+       }
+}
+
+
+#define INTMSK_WDT      (1UL << (IRQ_WDT - IRQ_EINT0))
+
+static void
+s3c_irq_wdtac97_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13);
+}
+
+static void
+s3c_irq_wdtac97_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_WDT);
+}
+
+static void
+s3c_irq_wdtac97_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13);
+}
+
+static struct irq_chip s3c_irq_wdtac97 = {
+       .mask       = s3c_irq_wdtac97_mask,
+       .unmask     = s3c_irq_wdtac97_unmask,
+       .ack        = s3c_irq_wdtac97_ack,
+};
+
+static int s3c2440_irq_add(struct sys_device *sysdev)
+{
+       unsigned int irqno;
+
+       printk("S3C2440: IRQ Support\n");
+
+       /* add new chained handler for wdt, ac7 */
+
+       set_irq_chip(IRQ_WDT, &s3c_irq_level_chip);
+       set_irq_handler(IRQ_WDT, handle_level_irq);
+       set_irq_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
+
+       for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
+               set_irq_chip(irqno, &s3c_irq_wdtac97);
+               set_irq_handler(irqno, handle_level_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       return 0;
+}
+
+static struct sysdev_driver s3c2440_irq_driver = {
+       .add            = s3c2440_irq_add,
+};
+
+static int s3c2440_irq_init(void)
+{
+       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
+}
+
+arch_initcall(s3c2440_irq_init);
+
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
new file mode 100644 (file)
index 0000000..3f0288e
--- /dev/null
@@ -0,0 +1,325 @@
+/* linux/arch/arm/mach-s3c2440/mach-anubis.c
+ *
+ * Copyright (c) 2003-2005 Simtec Electronics
+ *     http://armlinux.simtec.co.uk/
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/serial_core.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/anubis-map.h>
+#include <asm/arch/anubis-irq.h>
+#include <asm/arch/anubis-cpld.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-mem.h>
+#include <asm/arch/regs-lcd.h>
+#include <asm/arch/nand.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/nand_ecc.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+#define COPYRIGHT ", (c) 2005 Simtec Electronics"
+
+static struct map_desc anubis_iodesc[] __initdata = {
+  /* ISA IO areas */
+
+  {
+       .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
+       .pfn            = __phys_to_pfn(0x0),
+       .length         = SZ_4M,
+       .type           = MT_DEVICE,
+  }, {
+       .virtual        = (u32)S3C24XX_VA_ISA_WORD,
+       .pfn            = __phys_to_pfn(0x0),
+       .length         = SZ_4M,
+       .type           = MT_DEVICE,
+  },
+
+  /* we could possibly compress the next set down into a set of smaller tables
+   * pagetables, but that would mean using an L2 section, and it still means
+   * we cannot actually feed the same register to an LDR due to 16K spacing
+   */
+
+  /* CPLD control registers */
+
+  {
+       .virtual        = (u32)ANUBIS_VA_CTRL1,
+       .pfn            = __phys_to_pfn(ANUBIS_PA_CTRL1),
+       .length         = SZ_4K,
+       .type           = MT_DEVICE,
+  }, {
+       .virtual        = (u32)ANUBIS_VA_CTRL2,
+       .pfn            = __phys_to_pfn(ANUBIS_PA_CTRL2),
+       .length         = SZ_4K,
+       .type           = MT_DEVICE,
+  },
+};
+
+#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
+#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
+#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
+
+static struct s3c24xx_uart_clksrc anubis_serial_clocks[] = {
+       [0] = {
+               .name           = "uclk",
+               .divisor        = 1,
+               .min_baud       = 0,
+               .max_baud       = 0,
+       },
+       [1] = {
+               .name           = "pclk",
+               .divisor        = 1,
+               .min_baud       = 0,
+               .max_baud       = 0,
+       }
+};
+
+
+static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = {
+       [0] = {
+               .hwport      = 0,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+               .clocks      = anubis_serial_clocks,
+               .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
+       },
+       [1] = {
+               .hwport      = 2,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+               .clocks      = anubis_serial_clocks,
+               .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
+       },
+};
+
+/* NAND Flash on Anubis board */
+
+static int external_map[]   = { 2 };
+static int chip0_map[]      = { 0 };
+static int chip1_map[]      = { 1 };
+
+static struct mtd_partition anubis_default_nand_part[] = {
+       [0] = {
+               .name   = "Boot Agent",
+               .size   = SZ_16K,
+               .offset = 0,
+       },
+       [1] = {
+               .name   = "/boot",
+               .size   = SZ_4M - SZ_16K,
+               .offset = SZ_16K,
+       },
+       [2] = {
+               .name   = "user1",
+               .offset = SZ_4M,
+               .size   = SZ_32M - SZ_4M,
+       },
+       [3] = {
+               .name   = "user2",
+               .offset = SZ_32M,
+               .size   = MTDPART_SIZ_FULL,
+       }
+};
+
+/* the Anubis has 3 selectable slots for nand-flash, the two
+ * on-board chip areas, as well as the external slot.
+ *
+ * Note, there is no current hot-plug support for the External
+ * socket.
+*/
+
+static struct s3c2410_nand_set anubis_nand_sets[] = {
+       [1] = {
+               .name           = "External",
+               .nr_chips       = 1,
+               .nr_map         = external_map,
+               .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
+               .partitions     = anubis_default_nand_part,
+       },
+       [0] = {
+               .name           = "chip0",
+               .nr_chips       = 1,
+               .nr_map         = chip0_map,
+               .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
+               .partitions     = anubis_default_nand_part,
+       },
+       [2] = {
+               .name           = "chip1",
+               .nr_chips       = 1,
+               .nr_map         = chip1_map,
+               .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
+               .partitions     = anubis_default_nand_part,
+       },
+};
+
+static void anubis_nand_select(struct s3c2410_nand_set *set, int slot)
+{
+       unsigned int tmp;
+
+       slot = set->nr_map[slot] & 3;
+
+       pr_debug("anubis_nand: selecting slot %d (set %p,%p)\n",
+                slot, set, set->nr_map);
+
+       tmp = __raw_readb(ANUBIS_VA_CTRL1);
+       tmp &= ~ANUBIS_CTRL1_NANDSEL;
+       tmp |= slot;
+
+       pr_debug("anubis_nand: ctrl1 now %02x\n", tmp);
+
+       __raw_writeb(tmp, ANUBIS_VA_CTRL1);
+}
+
+static struct s3c2410_platform_nand anubis_nand_info = {
+       .tacls          = 25,
+       .twrph0         = 55,
+       .twrph1         = 40,
+       .nr_sets        = ARRAY_SIZE(anubis_nand_sets),
+       .sets           = anubis_nand_sets,
+       .select_chip    = anubis_nand_select,
+};
+
+/* IDE channels */
+
+static struct resource anubis_ide0_resource[] = {
+       {
+               .start  = S3C2410_CS3,
+               .end    = S3C2410_CS3 + (8*32) - 1,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = S3C2410_CS3 + (1<<26),
+               .end    = S3C2410_CS3 + (1<<26) + (8*32) - 1,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = IRQ_IDE0,
+               .end    = IRQ_IDE0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device anubis_device_ide0 = {
+       .name           = "simtec-ide",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(anubis_ide0_resource),
+       .resource       = anubis_ide0_resource,
+};
+
+static struct resource anubis_ide1_resource[] = {
+       {
+               .start  = S3C2410_CS4,
+               .end    = S3C2410_CS4 + (8*32) - 1,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = S3C2410_CS4 + (1<<26),
+               .end    = S3C2410_CS4 + (1<<26) + (8*32) - 1,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = IRQ_IDE0,
+               .end    = IRQ_IDE0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+
+static struct platform_device anubis_device_ide1 = {
+       .name           = "simtec-ide",
+       .id             = 1,
+       .num_resources  = ARRAY_SIZE(anubis_ide1_resource),
+       .resource       = anubis_ide1_resource,
+};
+
+/* Standard Anubis devices */
+
+static struct platform_device *anubis_devices[] __initdata = {
+       &s3c_device_usb,
+       &s3c_device_wdt,
+       &s3c_device_adc,
+       &s3c_device_i2c,
+       &s3c_device_rtc,
+       &s3c_device_nand,
+       &anubis_device_ide0,
+       &anubis_device_ide1,
+};
+
+static struct clk *anubis_clocks[] = {
+       &s3c24xx_dclk0,
+       &s3c24xx_dclk1,
+       &s3c24xx_clkout0,
+       &s3c24xx_clkout1,
+       &s3c24xx_uclk,
+};
+
+static struct s3c24xx_board anubis_board __initdata = {
+       .devices       = anubis_devices,
+       .devices_count = ARRAY_SIZE(anubis_devices),
+       .clocks        = anubis_clocks,
+       .clocks_count  = ARRAY_SIZE(anubis_clocks),
+};
+
+static void __init anubis_map_io(void)
+{
+       /* initialise the clocks */
+
+       s3c24xx_dclk0.parent = NULL;
+       s3c24xx_dclk0.rate   = 12*1000*1000;
+
+       s3c24xx_dclk1.parent = NULL;
+       s3c24xx_dclk1.rate   = 24*1000*1000;
+
+       s3c24xx_clkout0.parent  = &s3c24xx_dclk0;
+       s3c24xx_clkout1.parent  = &s3c24xx_dclk1;
+
+       s3c24xx_uclk.parent  = &s3c24xx_clkout1;
+
+       s3c_device_nand.dev.platform_data = &anubis_nand_info;
+
+       s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc));
+       s3c24xx_init_clocks(0);
+       s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs));
+       s3c24xx_set_board(&anubis_board);
+
+       /* ensure that the GPIO is setup */
+       s3c2410_gpio_setpin(S3C2410_GPA0, 1);
+}
+
+MACHINE_START(ANUBIS, "Simtec-Anubis")
+       /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+       .map_io         = anubis_map_io,
+       .init_irq       = s3c24xx_init_irq,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c2440/mach-nexcoder.c
new file mode 100644 (file)
index 0000000..6d551d8
--- /dev/null
@@ -0,0 +1,158 @@
+/* linux/arch/arm/mach-s3c2440/mach-nexcoder.c
+ *
+ * Copyright (c) 2004 Nex Vision
+ *   Guillaume GOURAT <guillaume.gourat@nexvision.tv>
+ *
+ * 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.
+ *
+ * Modifications:
+ *     15-10-2004 GG  Created initial version
+ *     12-03-2005 BJD Updated for release
+ */
+
+#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/string.h>
+#include <linux/serial_core.h>
+#include <linux/platform_device.h>
+
+#include <linux/mtd/map.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/setup.h>
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+//#include <asm/debug-ll.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-serial.h>
+
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/s3c2440.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+static struct map_desc nexcoder_iodesc[] __initdata = {
+       /* nothing here yet */
+};
+
+#define UCON S3C2410_UCON_DEFAULT
+#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
+#define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE
+
+static struct s3c2410_uartcfg nexcoder_uartcfgs[] __initdata = {
+       [0] = {
+               .hwport      = 0,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+       },
+       [1] = {
+               .hwport      = 1,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+       },
+       [2] = {
+               .hwport      = 2,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+       }
+};
+
+/* NOR Flash on NexVision NexCoder 2440 board */
+
+static struct resource nexcoder_nor_resource[] = {
+       [0] = {
+               .start = S3C2410_CS0,
+               .end   = S3C2410_CS0 + (8*1024*1024) - 1,
+               .flags = IORESOURCE_MEM,
+       }
+};
+
+static struct map_info nexcoder_nor_map = {
+       .bankwidth = 2,
+};
+
+static struct platform_device nexcoder_device_nor = {
+       .name           = "mtd-flash",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(nexcoder_nor_resource),
+       .resource       = nexcoder_nor_resource,
+       .dev =
+       {
+               .platform_data = &nexcoder_nor_map,
+       }
+};
+
+/* Standard Nexcoder devices */
+
+static struct platform_device *nexcoder_devices[] __initdata = {
+       &s3c_device_usb,
+       &s3c_device_lcd,
+       &s3c_device_wdt,
+       &s3c_device_i2c,
+       &s3c_device_iis,
+       &s3c_device_rtc,
+       &s3c_device_camif,
+       &s3c_device_spi0,
+       &s3c_device_spi1,
+       &nexcoder_device_nor,
+};
+
+static struct s3c24xx_board nexcoder_board __initdata = {
+       .devices       = nexcoder_devices,
+       .devices_count = ARRAY_SIZE(nexcoder_devices),
+};
+
+
+static void __init nexcoder_sensorboard_init(void)
+{
+       // Initialize SCCB bus
+       s3c2410_gpio_setpin(S3C2410_GPE14, 1); // IICSCL
+       s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_OUTP);
+       s3c2410_gpio_setpin(S3C2410_GPE15, 1); // IICSDA
+       s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_OUTP);
+
+       // Power up the sensor board
+       s3c2410_gpio_setpin(S3C2410_GPF1, 1);
+       s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_OUTP); // CAM_GPIO7 => nLDO_PWRDN
+       s3c2410_gpio_setpin(S3C2410_GPF2, 0);
+       s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); // CAM_GPIO6 => CAM_PWRDN
+}
+
+static void __init nexcoder_map_io(void)
+{
+       s3c24xx_init_io(nexcoder_iodesc, ARRAY_SIZE(nexcoder_iodesc));
+       s3c24xx_init_clocks(0);
+       s3c24xx_init_uarts(nexcoder_uartcfgs, ARRAY_SIZE(nexcoder_uartcfgs));
+       s3c24xx_set_board(&nexcoder_board);
+       nexcoder_sensorboard_init();
+}
+
+
+MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
+       /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+       .map_io         = nexcoder_map_io,
+       .init_irq       = s3c24xx_init_irq,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
new file mode 100644 (file)
index 0000000..2ed8e51
--- /dev/null
@@ -0,0 +1,303 @@
+/* linux/arch/arm/mach-s3c2440/mach-osiris.c
+ *
+ * Copyright (c) 2005 Simtec Electronics
+ *     http://armlinux.simtec.co.uk/
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/device.h>
+#include <linux/serial_core.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/osiris-map.h>
+#include <asm/arch/osiris-cpld.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-mem.h>
+#include <asm/arch/regs-lcd.h>
+#include <asm/arch/nand.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/nand_ecc.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+/* onboard perihpheral map */
+
+static struct map_desc osiris_iodesc[] __initdata = {
+  /* ISA IO areas (may be over-written later) */
+
+  {
+         .virtual      = (u32)S3C24XX_VA_ISA_BYTE,
+         .pfn          = __phys_to_pfn(S3C2410_CS5),
+         .length       = SZ_16M,
+         .type         = MT_DEVICE,
+  }, {
+         .virtual      = (u32)S3C24XX_VA_ISA_WORD,
+         .pfn          = __phys_to_pfn(S3C2410_CS5),
+         .length       = SZ_16M,
+         .type         = MT_DEVICE,
+  },
+
+  /* CPLD control registers */
+
+  {
+         .virtual      = (u32)OSIRIS_VA_CTRL1,
+         .pfn          = __phys_to_pfn(OSIRIS_PA_CTRL1),
+         .length       = SZ_16K,
+         .type         = MT_DEVICE,
+  }, {
+         .virtual      = (u32)OSIRIS_VA_CTRL2,
+         .pfn          = __phys_to_pfn(OSIRIS_PA_CTRL2),
+         .length       = SZ_16K,
+         .type         = MT_DEVICE,
+  },
+};
+
+#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
+#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
+#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
+
+static struct s3c24xx_uart_clksrc osiris_serial_clocks[] = {
+       [0] = {
+               .name           = "uclk",
+               .divisor        = 1,
+               .min_baud       = 0,
+               .max_baud       = 0,
+       },
+       [1] = {
+               .name           = "pclk",
+               .divisor        = 1,
+               .min_baud       = 0,
+               .max_baud       = 0,
+       }
+};
+
+static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = {
+       [0] = {
+               .hwport      = 0,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+               .clocks      = osiris_serial_clocks,
+               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
+       },
+       [1] = {
+               .hwport      = 1,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+               .clocks      = osiris_serial_clocks,
+               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
+       },
+       [2] = {
+               .hwport      = 2,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+               .clocks      = osiris_serial_clocks,
+               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
+       }
+};
+
+/* NAND Flash on Osiris board */
+
+static int external_map[]   = { 2 };
+static int chip0_map[]      = { 0 };
+static int chip1_map[]      = { 1 };
+
+static struct mtd_partition osiris_default_nand_part[] = {
+       [0] = {
+               .name   = "Boot Agent",
+               .size   = SZ_16K,
+               .offset = 0,
+       },
+       [1] = {
+               .name   = "/boot",
+               .size   = SZ_4M - SZ_16K,
+               .offset = SZ_16K,
+       },
+       [2] = {
+               .name   = "user1",
+               .offset = SZ_4M,
+               .size   = SZ_32M - SZ_4M,
+       },
+       [3] = {
+               .name   = "user2",
+               .offset = SZ_32M,
+               .size   = MTDPART_SIZ_FULL,
+       }
+};
+
+/* the Osiris has 3 selectable slots for nand-flash, the two
+ * on-board chip areas, as well as the external slot.
+ *
+ * Note, there is no current hot-plug support for the External
+ * socket.
+*/
+
+static struct s3c2410_nand_set osiris_nand_sets[] = {
+       [1] = {
+               .name           = "External",
+               .nr_chips       = 1,
+               .nr_map         = external_map,
+               .nr_partitions  = ARRAY_SIZE(osiris_default_nand_part),
+               .partitions     = osiris_default_nand_part,
+       },
+       [0] = {
+               .name           = "chip0",
+               .nr_chips       = 1,
+               .nr_map         = chip0_map,
+               .nr_partitions  = ARRAY_SIZE(osiris_default_nand_part),
+               .partitions     = osiris_default_nand_part,
+       },
+       [2] = {
+               .name           = "chip1",
+               .nr_chips       = 1,
+               .nr_map         = chip1_map,
+               .nr_partitions  = ARRAY_SIZE(osiris_default_nand_part),
+               .partitions     = osiris_default_nand_part,
+       },
+};
+
+static void osiris_nand_select(struct s3c2410_nand_set *set, int slot)
+{
+       unsigned int tmp;
+
+       slot = set->nr_map[slot] & 3;
+
+       pr_debug("osiris_nand: selecting slot %d (set %p,%p)\n",
+                slot, set, set->nr_map);
+
+       tmp = __raw_readb(OSIRIS_VA_CTRL1);
+       tmp &= ~OSIRIS_CTRL1_NANDSEL;
+       tmp |= slot;
+
+       pr_debug("osiris_nand: ctrl1 now %02x\n", tmp);
+
+       __raw_writeb(tmp, OSIRIS_VA_CTRL1);
+}
+
+static struct s3c2410_platform_nand osiris_nand_info = {
+       .tacls          = 25,
+       .twrph0         = 60,
+       .twrph1         = 60,
+       .nr_sets        = ARRAY_SIZE(osiris_nand_sets),
+       .sets           = osiris_nand_sets,
+       .select_chip    = osiris_nand_select,
+};
+
+/* PCMCIA control and configuration */
+
+static struct resource osiris_pcmcia_resource[] = {
+       [0] = {
+               .start  = 0x0f000000,
+               .end    = 0x0f100000,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 0x0c000000,
+               .end    = 0x0c100000,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device osiris_pcmcia = {
+       .name           = "osiris-pcmcia",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(osiris_pcmcia_resource),
+       .resource       = osiris_pcmcia_resource,
+};
+
+/* Standard Osiris devices */
+
+static struct platform_device *osiris_devices[] __initdata = {
+       &s3c_device_i2c,
+       &s3c_device_nand,
+       &osiris_pcmcia,
+};
+
+static struct clk *osiris_clocks[] = {
+       &s3c24xx_dclk0,
+       &s3c24xx_dclk1,
+       &s3c24xx_clkout0,
+       &s3c24xx_clkout1,
+       &s3c24xx_uclk,
+};
+
+static struct s3c24xx_board osiris_board __initdata = {
+       .devices       = osiris_devices,
+       .devices_count = ARRAY_SIZE(osiris_devices),
+       .clocks        = osiris_clocks,
+       .clocks_count  = ARRAY_SIZE(osiris_clocks),
+};
+
+static void __init osiris_map_io(void)
+{
+       unsigned long flags;
+
+       /* initialise the clocks */
+
+       s3c24xx_dclk0.parent = NULL;
+       s3c24xx_dclk0.rate   = 12*1000*1000;
+
+       s3c24xx_dclk1.parent = NULL;
+       s3c24xx_dclk1.rate   = 24*1000*1000;
+
+       s3c24xx_clkout0.parent  = &s3c24xx_dclk0;
+       s3c24xx_clkout1.parent  = &s3c24xx_dclk1;
+
+       s3c24xx_uclk.parent  = &s3c24xx_clkout1;
+
+       s3c_device_nand.dev.platform_data = &osiris_nand_info;
+
+       s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc));
+       s3c24xx_init_clocks(0);
+       s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs));
+       s3c24xx_set_board(&osiris_board);
+
+       /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */
+
+       local_irq_save(flags);
+       __raw_writel(__raw_readl(S3C2410_BWSCON) | S3C2410_BWSCON_ST1 | S3C2410_BWSCON_ST2 | S3C2410_BWSCON_ST3 | S3C2410_BWSCON_ST4 | S3C2410_BWSCON_ST5, S3C2410_BWSCON);
+       local_irq_restore(flags);
+
+       /* write-protect line to the NAND */
+       s3c2410_gpio_setpin(S3C2410_GPA0, 1);
+}
+
+MACHINE_START(OSIRIS, "Simtec-OSIRIS")
+       /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+       .map_io         = osiris_map_io,
+       .init_irq       = s3c24xx_init_irq,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
new file mode 100644 (file)
index 0000000..480ccde
--- /dev/null
@@ -0,0 +1,243 @@
+/* linux/arch/arm/mach-s3c2440/mach-rx3715.c
+ *
+ * Copyright (c) 2003,2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * http://www.handhelds.org/projects/rx3715.html
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+#include <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/tty.h>
+#include <linux/console.h>
+#include <linux/platform_device.h>
+#include <linux/serial_core.h>
+#include <linux/serial.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/nand_ecc.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-lcd.h>
+
+#include <asm/arch/h1940.h>
+#include <asm/arch/nand.h>
+#include <asm/arch/fb.h>
+
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
+
+static struct map_desc rx3715_iodesc[] __initdata = {
+       /* dump ISA space somewhere unused */
+
+       {
+               .virtual        = (u32)S3C24XX_VA_ISA_WORD,
+               .pfn            = __phys_to_pfn(S3C2410_CS3),
+               .length         = SZ_1M,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
+               .pfn            = __phys_to_pfn(S3C2410_CS3),
+               .length         = SZ_1M,
+               .type           = MT_DEVICE,
+       },
+};
+
+
+static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = {
+       [0] = {
+               .name           = "fclk",
+               .divisor        = 0,
+               .min_baud       = 0,
+               .max_baud       = 0,
+       }
+};
+
+static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
+       [0] = {
+               .hwport      = 0,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x51,
+               .clocks      = rx3715_serial_clocks,
+               .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
+       },
+       [1] = {
+               .hwport      = 1,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x00,
+               .clocks      = rx3715_serial_clocks,
+               .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
+       },
+       /* IR port */
+       [2] = {
+               .hwport      = 2,
+               .uart_flags  = UPF_CONS_FLOW,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x43,
+               .ufcon       = 0x51,
+               .clocks      = rx3715_serial_clocks,
+               .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
+       }
+};
+
+/* framebuffer lcd controller information */
+
+static struct s3c2410fb_mach_info rx3715_lcdcfg __initdata = {
+       .regs   = {
+               .lcdcon1 =      S3C2410_LCDCON1_TFT16BPP | \
+                               S3C2410_LCDCON1_TFT | \
+                               S3C2410_LCDCON1_CLKVAL(0x0C),
+
+               .lcdcon2 =      S3C2410_LCDCON2_VBPD(5) | \
+                               S3C2410_LCDCON2_LINEVAL(319) | \
+                               S3C2410_LCDCON2_VFPD(6) | \
+                               S3C2410_LCDCON2_VSPW(2),
+
+               .lcdcon3 =      S3C2410_LCDCON3_HBPD(35) | \
+                               S3C2410_LCDCON3_HOZVAL(239) | \
+                               S3C2410_LCDCON3_HFPD(35),
+
+               .lcdcon4 =      S3C2410_LCDCON4_MVAL(0) | \
+                               S3C2410_LCDCON4_HSPW(7),
+
+               .lcdcon5 =      S3C2410_LCDCON5_INVVLINE |
+                               S3C2410_LCDCON5_FRM565 |
+                               S3C2410_LCDCON5_HWSWP,
+       },
+
+       .lpcsel =       0xf82,
+
+       .gpccon =       0xaa955699,
+       .gpccon_mask =  0xffc003cc,
+       .gpcup =        0x0000ffff,
+       .gpcup_mask =   0xffffffff,
+
+       .gpdcon =       0xaa95aaa1,
+       .gpdcon_mask =  0xffc0fff0,
+       .gpdup =        0x0000faff,
+       .gpdup_mask =   0xffffffff,
+
+       .fixed_syncs =  1,
+       .width  =       240,
+       .height =       320,
+
+       .xres   = {
+               .min =          240,
+               .max =          240,
+               .defval =       240,
+       },
+
+       .yres   = {
+               .max =          320,
+               .min =          320,
+               .defval =       320,
+       },
+
+       .bpp    = {
+               .min =          16,
+               .max =          16,
+               .defval =       16,
+       },
+};
+
+static struct mtd_partition rx3715_nand_part[] = {
+       [0] = {
+               .name           = "Whole Flash",
+               .offset         = 0,
+               .size           = MTDPART_SIZ_FULL,
+               .mask_flags     = MTD_WRITEABLE,
+       }
+};
+
+static struct s3c2410_nand_set rx3715_nand_sets[] = {
+       [0] = {
+               .name           = "Internal",
+               .nr_chips       = 1,
+               .nr_partitions  = ARRAY_SIZE(rx3715_nand_part),
+               .partitions     = rx3715_nand_part,
+       },
+};
+
+static struct s3c2410_platform_nand rx3715_nand_info = {
+       .tacls          = 25,
+       .twrph0         = 50,
+       .twrph1         = 15,
+       .nr_sets        = ARRAY_SIZE(rx3715_nand_sets),
+       .sets           = rx3715_nand_sets,
+};
+
+static struct platform_device *rx3715_devices[] __initdata = {
+       &s3c_device_usb,
+       &s3c_device_lcd,
+       &s3c_device_wdt,
+       &s3c_device_i2c,
+       &s3c_device_iis,
+       &s3c_device_nand,
+};
+
+static struct s3c24xx_board rx3715_board __initdata = {
+       .devices       = rx3715_devices,
+       .devices_count = ARRAY_SIZE(rx3715_devices)
+};
+
+static void __init rx3715_map_io(void)
+{
+       s3c_device_nand.dev.platform_data = &rx3715_nand_info;
+
+       s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
+       s3c24xx_init_clocks(16934000);
+       s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
+       s3c24xx_set_board(&rx3715_board);
+}
+
+static void __init rx3715_init_irq(void)
+{
+       s3c24xx_init_irq();
+}
+
+static void __init rx3715_init_machine(void)
+{
+       memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024);
+       s3c2410_pm_init();
+
+       s3c24xx_fb_set_platdata(&rx3715_lcdcfg);
+}
+
+
+MACHINE_START(RX3715, "IPAQ-RX3715")
+       /* Maintainer: Ben Dooks <ben@fluff.org> */
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+       .map_io         = rx3715_map_io,
+       .init_irq       = rx3715_init_irq,
+       .init_machine   = rx3715_init_machine,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
new file mode 100644 (file)
index 0000000..c17eb5b
--- /dev/null
@@ -0,0 +1,207 @@
+/* linux/arch/arm/mach-s3c2440/mach-smdk2440.c
+ *
+ * Copyright (c) 2004,2005 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * http://www.fluff.org/ben/smdk2440/
+ *
+ * Thanks to Dimity Andric and TomTom for the loan of an SMDK2440.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+#include <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/serial_core.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-lcd.h>
+
+#include <asm/arch/idle.h>
+#include <asm/arch/fb.h>
+
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/s3c2440.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+#include <asm/plat-s3c24xx/common-smdk.h>
+
+static struct map_desc smdk2440_iodesc[] __initdata = {
+       /* ISA IO Space map (memory space selected by A24) */
+
+       {
+               .virtual        = (u32)S3C24XX_VA_ISA_WORD,
+               .pfn            = __phys_to_pfn(S3C2410_CS2),
+               .length         = 0x10000,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
+               .pfn            = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
+               .length         = SZ_4M,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
+               .pfn            = __phys_to_pfn(S3C2410_CS2),
+               .length         = 0x10000,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
+               .pfn            = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
+               .length         = SZ_4M,
+               .type           = MT_DEVICE,
+       }
+};
+
+#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
+#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
+#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
+
+static struct s3c2410_uartcfg smdk2440_uartcfgs[] __initdata = {
+       [0] = {
+               .hwport      = 0,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x51,
+       },
+       [1] = {
+               .hwport      = 1,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x51,
+       },
+       /* IR port */
+       [2] = {
+               .hwport      = 2,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x43,
+               .ufcon       = 0x51,
+       }
+};
+
+/* LCD driver info */
+
+static struct s3c2410fb_mach_info smdk2440_lcd_cfg __initdata = {
+       .regs   = {
+
+               .lcdcon1        = S3C2410_LCDCON1_TFT16BPP |
+                                 S3C2410_LCDCON1_TFT |
+                                 S3C2410_LCDCON1_CLKVAL(0x04),
+
+               .lcdcon2        = S3C2410_LCDCON2_VBPD(7) |
+                                 S3C2410_LCDCON2_LINEVAL(319) |
+                                 S3C2410_LCDCON2_VFPD(6) |
+                                 S3C2410_LCDCON2_VSPW(3),
+
+               .lcdcon3        = S3C2410_LCDCON3_HBPD(19) |
+                                 S3C2410_LCDCON3_HOZVAL(239) |
+                                 S3C2410_LCDCON3_HFPD(7),
+
+               .lcdcon4        = S3C2410_LCDCON4_MVAL(0) |
+                                 S3C2410_LCDCON4_HSPW(3),
+
+               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
+                                 S3C2410_LCDCON5_INVVLINE |
+                                 S3C2410_LCDCON5_INVVFRAME |
+                                 S3C2410_LCDCON5_PWREN |
+                                 S3C2410_LCDCON5_HWSWP,
+       },
+
+#if 0
+       /* currently setup by downloader */
+       .gpccon         = 0xaa940659,
+       .gpccon_mask    = 0xffffffff,
+       .gpcup          = 0x0000ffff,
+       .gpcup_mask     = 0xffffffff,
+       .gpdcon         = 0xaa84aaa0,
+       .gpdcon_mask    = 0xffffffff,
+       .gpdup          = 0x0000faff,
+       .gpdup_mask     = 0xffffffff,
+#endif
+
+       .lpcsel         = ((0xCE6) & ~7) | 1<<4,
+       .type           = S3C2410_LCDCON1_TFT16BPP,
+
+       .width          = 240,
+       .height         = 320,
+
+       .xres           = {
+               .min    = 240,
+               .max    = 240,
+               .defval = 240,
+       },
+
+       .yres           = {
+               .min    = 320,
+               .max    = 320,
+               .defval = 320,
+       },
+
+       .bpp            = {
+               .min    = 16,
+               .max    = 16,
+               .defval = 16,
+       },
+};
+
+static struct platform_device *smdk2440_devices[] __initdata = {
+       &s3c_device_usb,
+       &s3c_device_lcd,
+       &s3c_device_wdt,
+       &s3c_device_i2c,
+       &s3c_device_iis,
+};
+
+static struct s3c24xx_board smdk2440_board __initdata = {
+       .devices       = smdk2440_devices,
+       .devices_count = ARRAY_SIZE(smdk2440_devices)
+};
+
+static void __init smdk2440_map_io(void)
+{
+       s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
+       s3c24xx_init_clocks(16934400);
+       s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
+       s3c24xx_set_board(&smdk2440_board);
+}
+
+static void __init smdk2440_machine_init(void)
+{
+       s3c24xx_fb_set_platdata(&smdk2440_lcd_cfg);
+
+       smdk_machine_init();
+}
+
+MACHINE_START(S3C2440, "SMDK2440")
+       /* Maintainer: Ben Dooks <ben@fluff.org> */
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+
+       .init_irq       = s3c24xx_init_irq,
+       .map_io         = smdk2440_map_io,
+       .init_machine   = smdk2440_machine_init,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c2440/s3c2440.c
new file mode 100644 (file)
index 0000000..90e1da6
--- /dev/null
@@ -0,0 +1,52 @@
+/* linux/arch/arm/mach-s3c2440/s3c2440.c
+ *
+ * Copyright (c) 2004-2006 Simtec Electronics
+ *   Ben Dooks <ben@simtec.co.uk>
+ *
+ * Samsung S3C2440 Mobile CPU support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/serial_core.h>
+#include <linux/sysdev.h>
+#include <linux/clk.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+
+#include <asm/plat-s3c24xx/s3c2440.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+static struct sys_device s3c2440_sysdev = {
+       .cls            = &s3c2440_sysclass,
+};
+
+int __init s3c2440_init(void)
+{
+       printk("S3C2440: Initialising architecture\n");
+
+       /* change irq for watchdog */
+
+       s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT;
+       s3c_device_wdt.resource[1].end   = IRQ_S3C2440_WDT;
+
+       /* register our system device for everything else */
+
+       return sysdev_register(&s3c2440_sysdev);
+}
diff --git a/arch/arm/mach-s3c2442/Kconfig b/arch/arm/mach-s3c2442/Kconfig
new file mode 100644 (file)
index 0000000..bf8d87a
--- /dev/null
@@ -0,0 +1,27 @@
+# arch/arm/mach-s3c2442/Kconfig
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+config CPU_S3C2442
+       bool
+       depends on ARCH_S3C2420
+       select S3C2410_CLOCK
+       select S3C2410_GPIO
+       select S3C2410_PM if PM
+       select CPU_S3C244X
+       help
+         Support for S3C2442 Samsung Mobile CPU based systems.
+
+
+menu "S3C2442 Machines"
+
+config SMDK2440_CPU2442
+       bool "SMDM2440 with S3C2442 CPU module"
+       depends on ARCH_S3C2440
+       select CPU_S3C2442
+
+
+endmenu
+
diff --git a/arch/arm/mach-s3c2442/Makefile b/arch/arm/mach-s3c2442/Makefile
new file mode 100644 (file)
index 0000000..2a909c6
--- /dev/null
@@ -0,0 +1,16 @@
+# arch/arm/mach-s3c2442/Makefile
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+obj-y                          :=
+obj-m                          :=
+obj-n                          :=
+obj-                           :=
+
+obj-$(CONFIG_CPU_S3C2442)      += s3c2442.o
+obj-$(CONFIG_CPU_S3C2442)      += clock.o
+
+# Machine support
+
diff --git a/arch/arm/mach-s3c2442/clock.c b/arch/arm/mach-s3c2442/clock.c
new file mode 100644 (file)
index 0000000..5b9e830
--- /dev/null
@@ -0,0 +1,171 @@
+/* linux/arch/arm/mach-s3c2442/clock.c
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     http://armlinux.simtec.co.uk/
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2442 Clock 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/device.h>
+#include <linux/sysdev.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/mutex.h>
+#include <linux/clk.h>
+
+#include <asm/hardware.h>
+#include <asm/atomic.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/arch/regs-clock.h>
+
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+/* S3C2442 extended clock support */
+
+static unsigned long s3c2442_camif_upll_round(struct clk *clk,
+                                             unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       int div;
+
+       if (rate > parent_rate)
+               return parent_rate;
+
+       div = parent_rate / rate;
+
+       if (div == 3)
+               return parent_rate / 3;
+
+       /* note, we remove the +/- 1 calculations for the divisor */
+
+       div /= 2;
+
+       if (div < 1)
+               div = 1;
+       else if (div > 16)
+               div = 16;
+
+       return parent_rate / (div * 2);
+}
+
+static int s3c2442_camif_upll_setrate(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long camdivn =  __raw_readl(S3C2440_CAMDIVN);
+
+       rate = s3c2442_camif_upll_round(clk, rate);
+
+       camdivn &= ~S3C2442_CAMDIVN_CAMCLK_DIV3;
+
+       if (rate == parent_rate) {
+               camdivn &= ~S3C2440_CAMDIVN_CAMCLK_SEL;
+       } else if ((parent_rate / rate) == 3) {
+               camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL;
+               camdivn |= S3C2442_CAMDIVN_CAMCLK_DIV3;
+       } else {
+               camdivn &= ~S3C2440_CAMDIVN_CAMCLK_MASK;
+               camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL;
+               camdivn |= (((parent_rate / rate) / 2) - 1);
+       }
+
+       __raw_writel(camdivn, S3C2440_CAMDIVN);
+
+       return 0;
+}
+
+/* Extra S3C2442 clocks */
+
+static struct clk s3c2442_clk_cam = {
+       .name           = "camif",
+       .id             = -1,
+       .enable         = s3c2410_clkcon_enable,
+       .ctrlbit        = S3C2440_CLKCON_CAMERA,
+};
+
+static struct clk s3c2442_clk_cam_upll = {
+       .name           = "camif-upll",
+       .id             = -1,
+       .set_rate       = s3c2442_camif_upll_setrate,
+       .round_rate     = s3c2442_camif_upll_round,
+};
+
+static int s3c2442_clk_add(struct sys_device *sysdev)
+{
+       unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
+       unsigned long clkdivn;
+       struct clk *clock_h;
+       struct clk *clock_p;
+       struct clk *clock_upll;
+
+       printk("S3C2442: Clock Support, DVS %s\n",
+              (camdivn & S3C2440_CAMDIVN_DVSEN) ? "on" : "off");
+
+       clock_p = clk_get(NULL, "pclk");
+       clock_h = clk_get(NULL, "hclk");
+       clock_upll = clk_get(NULL, "upll");
+
+       if (IS_ERR(clock_p) || IS_ERR(clock_h) || IS_ERR(clock_upll)) {
+               printk(KERN_ERR "S3C2442: Failed to get parent clocks\n");
+               return -EINVAL;
+       }
+
+       /* check rate of UPLL, and if it is near 96MHz, then change
+        * to using half the UPLL rate for the system */
+
+       if (clk_get_rate(clock_upll) > (94 * MHZ)) {
+               clk_usb_bus.rate = clk_get_rate(clock_upll) / 2;
+
+               mutex_lock(&clocks_mutex);
+
+               clkdivn = __raw_readl(S3C2410_CLKDIVN);
+               clkdivn |= S3C2440_CLKDIVN_UCLK;
+               __raw_writel(clkdivn, S3C2410_CLKDIVN);
+
+               mutex_unlock(&clocks_mutex);
+       }
+
+       s3c2442_clk_cam.parent = clock_h;
+       s3c2442_clk_cam_upll.parent = clock_upll;
+
+       s3c24xx_register_clock(&s3c2442_clk_cam);
+       s3c24xx_register_clock(&s3c2442_clk_cam_upll);
+
+       clk_disable(&s3c2442_clk_cam);
+
+       return 0;
+}
+
+static struct sysdev_driver s3c2442_clk_driver = {
+       .add    = s3c2442_clk_add,
+};
+
+static __init int s3c2442_clk_init(void)
+{
+       return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_clk_driver);
+}
+
+arch_initcall(s3c2442_clk_init);
diff --git a/arch/arm/mach-s3c2442/s3c2442.c b/arch/arm/mach-s3c2442/s3c2442.c
new file mode 100644 (file)
index 0000000..fbf8264
--- /dev/null
@@ -0,0 +1,34 @@
+/* linux/arch/arm/mach-s3c2442/s3c2442.c
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *   Ben Dooks <ben@simtec.co.uk>
+ *
+ * Samsung S3C2442 Mobile CPU support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/serial_core.h>
+#include <linux/sysdev.h>
+
+#include <asm/plat-s3c24xx/s3c2442.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+static struct sys_device s3c2442_sysdev = {
+       .cls            = &s3c2442_sysclass,
+};
+
+int __init s3c2442_init(void)
+{
+       printk("S3C2442: Initialising architecture\n");
+
+       return sysdev_register(&s3c2442_sysdev);
+}
diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
new file mode 100644 (file)
index 0000000..c649bb2
--- /dev/null
@@ -0,0 +1,29 @@
+# arch/arm/mach-s3c2443/Kconfig
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+config CPU_S3C2443
+       bool
+       depends on ARCH_S3C2410
+       select S3C2443_DMA if S3C2410_DMA
+       help
+         Support for the S3C2443 SoC from the S3C24XX line
+
+config S3C2443_DMA
+       bool
+       depends on CPU_S3C2443
+       help
+         Internal config node for S3C2443 DMA support
+
+menu "S3C2443 Machines"
+
+config MACH_SMDK2443
+       bool "SMDK2443"
+       select CPU_S3C2443
+       select MACH_SMDK
+       help
+         Say Y here if you are using an SMDK2443
+
+endmenu
diff --git a/arch/arm/mach-s3c2443/Makefile b/arch/arm/mach-s3c2443/Makefile
new file mode 100644 (file)
index 0000000..d1843c9
--- /dev/null
@@ -0,0 +1,20 @@
+# arch/arm/mach-s3c2443/Makefile
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+obj-y                          :=
+obj-m                          :=
+obj-n                          :=
+obj-                           :=
+
+obj-$(CONFIG_CPU_S3C2443)      += s3c2443.o
+obj-$(CONFIG_CPU_S3C2443)      += irq.o
+obj-$(CONFIG_CPU_S3C2443)      += clock.o
+
+obj-$(CONFIG_S3C2443_DMA)      += dma.o
+
+# Machine support
+
+obj-$(CONFIG_MACH_SMDK2443)    += mach-smdk2443.o
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
new file mode 100644 (file)
index 0000000..dd2272f
--- /dev/null
@@ -0,0 +1,1007 @@
+/* linux/arch/arm/mach-s3c2443/clock.c
+ *
+ * Copyright (c) 2007 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2443 Clock control 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/sysdev.h>
+#include <linux/clk.h>
+#include <linux/mutex.h>
+#include <linux/delay.h>
+#include <linux/serial_core.h>
+
+#include <asm/mach/map.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+
+#include <asm/arch/regs-s3c2443-clock.h>
+
+#include <asm/plat-s3c24xx/s3c2443.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+/* We currently have to assume that the system is running
+ * from the XTPll input, and that all ***REFCLKs are being
+ * fed from it, as we cannot read the state of OM[4] from
+ * software.
+ *
+ * It would be possible for each board initialisation to
+ * set the correct muxing at initialisation
+*/
+
+static int s3c2443_clkcon_enable_h(struct clk *clk, int enable)
+{
+       unsigned int clocks = clk->ctrlbit;
+       unsigned long clkcon;
+
+       clkcon = __raw_readl(S3C2443_HCLKCON);
+
+       if (enable)
+               clkcon |= clocks;
+       else
+               clkcon &= ~clocks;
+
+       __raw_writel(clkcon, S3C2443_HCLKCON);
+
+       return 0;
+}
+
+static int s3c2443_clkcon_enable_p(struct clk *clk, int enable)
+{
+       unsigned int clocks = clk->ctrlbit;
+       unsigned long clkcon;
+
+       clkcon = __raw_readl(S3C2443_PCLKCON);
+
+       if (enable)
+               clkcon |= clocks;
+       else
+               clkcon &= ~clocks;
+
+       __raw_writel(clkcon, S3C2443_HCLKCON);
+
+       return 0;
+}
+
+static int s3c2443_clkcon_enable_s(struct clk *clk, int enable)
+{
+       unsigned int clocks = clk->ctrlbit;
+       unsigned long clkcon;
+
+       clkcon = __raw_readl(S3C2443_SCLKCON);
+
+       if (enable)
+               clkcon |= clocks;
+       else
+               clkcon &= ~clocks;
+
+       __raw_writel(clkcon, S3C2443_SCLKCON);
+
+       return 0;
+}
+
+static unsigned long s3c2443_roundrate_clksrc(struct clk *clk,
+                                             unsigned long rate,
+                                             unsigned int max)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       int div;
+
+       if (rate > parent_rate)
+               return parent_rate;
+
+       /* note, we remove the +/- 1 calculations as they cancel out */
+
+       div = (rate / parent_rate);
+
+       if (div < 1)
+               div = 1;
+       else if (div > max)
+               div = max;
+
+       return parent_rate / div;
+}
+
+static unsigned long s3c2443_roundrate_clksrc4(struct clk *clk,
+                                              unsigned long rate)
+{
+       return s3c2443_roundrate_clksrc(clk, rate, 4);
+}
+
+static unsigned long s3c2443_roundrate_clksrc16(struct clk *clk,
+                                               unsigned long rate)
+{
+       return s3c2443_roundrate_clksrc(clk, rate, 16);
+}
+
+static unsigned long s3c2443_roundrate_clksrc256(struct clk *clk,
+                                                unsigned long rate)
+{
+       return s3c2443_roundrate_clksrc(clk, rate, 256);
+}
+
+/* clock selections */
+
+/* CPU EXTCLK input */
+static struct clk clk_ext = {
+       .name           = "ext",
+       .id             = -1,
+};
+
+static struct clk clk_mpllref = {
+       .name           = "mpllref",
+       .parent         = &clk_xtal,
+       .id             = -1,
+};
+
+#if 0
+static struct clk clk_mpll = {
+       .name           = "mpll",
+       .parent         = &clk_mpllref,
+       .id             = -1,
+};
+#endif
+
+static struct clk clk_epllref;
+
+static struct clk clk_epll = {
+       .name           = "epll",
+       .parent         = &clk_epllref,
+       .id             = -1,
+};
+
+static struct clk clk_i2s_ext = {
+       .name           = "i2s-ext",
+       .id             = -1,
+};
+
+static int s3c2443_setparent_epllref(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2443_CLKSRC);
+
+       clksrc &= ~S3C2443_CLKSRC_EPLLREF_MASK;
+
+       if (parent == &clk_xtal)
+               clksrc |= S3C2443_CLKSRC_EPLLREF_XTAL;
+       else if (parent == &clk_ext)
+               clksrc |= S3C2443_CLKSRC_EPLLREF_EXTCLK;
+       else if (parent != &clk_mpllref)
+               return -EINVAL;
+
+       __raw_writel(clksrc, S3C2443_CLKSRC);
+       clk->parent = parent;
+
+       return 0;
+}
+
+static struct clk clk_epllref = {
+       .name           = "epllref",
+       .id             = -1,
+       .set_parent     = s3c2443_setparent_epllref,
+};
+
+static unsigned long s3c2443_getrate_mdivclk(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2443_CLKDIV0);
+
+       div  &= S3C2443_CLKDIV0_EXTDIV_MASK;
+       div >>= (S3C2443_CLKDIV0_EXTDIV_SHIFT-1);       /* x2 */
+
+       return parent_rate / (div + 1);
+}
+
+static struct clk clk_mdivclk = {
+       .name           = "mdivclk",
+       .parent         = &clk_mpllref,
+       .id             = -1,
+       .get_rate       = s3c2443_getrate_mdivclk,
+};
+
+
+static int s3c2443_setparent_msysclk(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2443_CLKSRC);
+
+       clksrc &= ~(S3C2443_CLKSRC_MSYSCLK_MPLL |
+                   S3C2443_CLKSRC_EXTCLK_DIV);
+
+       if (parent == &clk_mpll)
+               clksrc |= S3C2443_CLKSRC_MSYSCLK_MPLL;
+       else if (parent == &clk_mdivclk)
+               clksrc |= S3C2443_CLKSRC_EXTCLK_DIV;
+       else if (parent != &clk_mpllref)
+               return -EINVAL;
+
+       __raw_writel(clksrc, S3C2443_CLKSRC);
+       clk->parent = parent;
+
+       return 0;
+}
+
+static struct clk clk_msysclk = {
+       .name           = "msysclk",
+       .parent         = &clk_xtal,
+       .id             = -1,
+       .set_parent     = s3c2443_setparent_msysclk,
+};
+
+
+/* esysclk
+ *
+ * this is sourced from either the EPLL or the EPLLref clock
+*/
+
+static int s3c2443_setparent_esysclk(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2443_CLKSRC);
+
+       if (parent == &clk_epll)
+               clksrc |= S3C2443_CLKSRC_ESYSCLK_EPLL;
+       else if (parent == &clk_epllref)
+               clksrc &= ~S3C2443_CLKSRC_ESYSCLK_EPLL;
+       else
+               return -EINVAL;
+
+       __raw_writel(clksrc, S3C2443_CLKSRC);
+       clk->parent = parent;
+
+       return 0;
+}
+
+static struct clk clk_esysclk = {
+       .name           = "esysclk",
+       .parent         = &clk_epll,
+       .id             = -1,
+       .set_parent     = s3c2443_setparent_esysclk,
+};
+
+/* uartclk
+ *
+ * UART baud-rate clock sourced from esysclk via a divisor
+*/
+
+static unsigned long s3c2443_getrate_uart(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2443_CLKDIV1);
+
+       div &= S3C2443_CLKDIV1_UARTDIV_MASK;
+       div >>= S3C2443_CLKDIV1_UARTDIV_SHIFT;
+
+       return parent_rate / (div + 1);
+}
+
+
+static int s3c2443_setrate_uart(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
+
+       rate = s3c2443_roundrate_clksrc16(clk, rate);
+       rate = parent_rate / rate;
+
+       clkdivn &= ~S3C2443_CLKDIV1_UARTDIV_MASK;
+       clkdivn |= (rate - 1) << S3C2443_CLKDIV1_UARTDIV_SHIFT;
+
+       __raw_writel(clkdivn, S3C2443_CLKDIV1);
+       return 0;
+}
+
+static struct clk clk_uart = {
+       .name           = "uartclk",
+       .id             = -1,
+       .parent         = &clk_esysclk,
+       .get_rate       = s3c2443_getrate_uart,
+       .set_rate       = s3c2443_setrate_uart,
+       .round_rate     = s3c2443_roundrate_clksrc16,
+};
+
+/* hsspi
+ *
+ * high-speed spi clock, sourced from esysclk
+*/
+
+static unsigned long s3c2443_getrate_hsspi(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2443_CLKDIV1);
+
+       div &= S3C2443_CLKDIV1_HSSPIDIV_MASK;
+       div >>= S3C2443_CLKDIV1_HSSPIDIV_SHIFT;
+
+       return parent_rate / (div + 1);
+}
+
+
+static int s3c2443_setrate_hsspi(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
+
+       rate = s3c2443_roundrate_clksrc4(clk, rate);
+       rate = parent_rate / rate;
+
+       clkdivn &= ~S3C2443_CLKDIV1_HSSPIDIV_MASK;
+       clkdivn |= (rate - 1) << S3C2443_CLKDIV1_HSSPIDIV_SHIFT;
+
+       __raw_writel(clkdivn, S3C2443_CLKDIV1);
+       return 0;
+}
+
+static struct clk clk_hsspi = {
+       .name           = "hsspi",
+       .id             = -1,
+       .parent         = &clk_esysclk,
+       .ctrlbit        = S3C2443_SCLKCON_HSSPICLK,
+       .enable         = s3c2443_clkcon_enable_s,
+       .get_rate       = s3c2443_getrate_hsspi,
+       .set_rate       = s3c2443_setrate_hsspi,
+       .round_rate     = s3c2443_roundrate_clksrc4,
+};
+
+/* usbhost
+ *
+ * usb host bus-clock, usually 48MHz to provide USB bus clock timing
+*/
+
+static unsigned long s3c2443_getrate_usbhost(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2443_CLKDIV1);
+
+       div &= S3C2443_CLKDIV1_USBHOSTDIV_MASK;
+       div >>= S3C2443_CLKDIV1_USBHOSTDIV_SHIFT;
+
+       return parent_rate / (div + 1);
+}
+
+static int s3c2443_setrate_usbhost(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
+
+       rate = s3c2443_roundrate_clksrc4(clk, rate);
+       rate = parent_rate / rate;
+
+       clkdivn &= ~S3C2443_CLKDIV1_USBHOSTDIV_MASK;
+       clkdivn |= (rate - 1) << S3C2443_CLKDIV1_USBHOSTDIV_SHIFT;
+
+       __raw_writel(clkdivn, S3C2443_CLKDIV1);
+       return 0;
+}
+
+struct clk clk_usb_bus_host = {
+       .name           = "usb-bus-host-parent",
+       .id             = -1,
+       .parent         = &clk_esysclk,
+       .ctrlbit        = S3C2443_SCLKCON_USBHOST,
+       .enable         = s3c2443_clkcon_enable_s,
+       .get_rate       = s3c2443_getrate_usbhost,
+       .set_rate       = s3c2443_setrate_usbhost,
+       .round_rate     = s3c2443_roundrate_clksrc4,
+};
+
+/* clk_hsmcc_div
+ *
+ * this clock is sourced from epll, and is fed through a divider,
+ * to a mux controlled by sclkcon where either it or a extclk can
+ * be fed to the hsmmc block
+*/
+
+static unsigned long s3c2443_getrate_hsmmc_div(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2443_CLKDIV1);
+
+       div &= S3C2443_CLKDIV1_HSMMCDIV_MASK;
+       div >>= S3C2443_CLKDIV1_HSMMCDIV_SHIFT;
+
+       return parent_rate / (div + 1);
+}
+
+static int s3c2443_setrate_hsmmc_div(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
+
+       rate = s3c2443_roundrate_clksrc4(clk, rate);
+       rate = parent_rate / rate;
+
+       clkdivn &= ~S3C2443_CLKDIV1_HSMMCDIV_MASK;
+       clkdivn |= (rate - 1) << S3C2443_CLKDIV1_HSMMCDIV_SHIFT;
+
+       __raw_writel(clkdivn, S3C2443_CLKDIV1);
+       return 0;
+}
+
+static struct clk clk_hsmmc_div = {
+       .name           = "hsmmc-div",
+       .id             = -1,
+       .parent         = &clk_esysclk,
+       .get_rate       = s3c2443_getrate_hsmmc_div,
+       .set_rate       = s3c2443_setrate_hsmmc_div,
+       .round_rate     = s3c2443_roundrate_clksrc4,
+};
+
+static int s3c2443_setparent_hsmmc(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2443_SCLKCON);
+
+       clksrc &= ~(S3C2443_SCLKCON_HSMMCCLK_EXT |
+                   S3C2443_SCLKCON_HSMMCCLK_EPLL);
+
+       if (parent == &clk_epll)
+               clksrc |= S3C2443_SCLKCON_HSMMCCLK_EPLL;
+       else if (parent == &clk_ext)
+               clksrc |= S3C2443_SCLKCON_HSMMCCLK_EXT;
+       else
+               return -EINVAL;
+
+       if (clk->usage > 0) {
+               __raw_writel(clksrc, S3C2443_SCLKCON);
+       }
+
+       clk->parent = parent;
+       return 0;
+}
+
+static int s3c2443_enable_hsmmc(struct clk *clk, int enable)
+{
+       return s3c2443_setparent_hsmmc(clk, clk->parent);
+}
+
+static struct clk clk_hsmmc = {
+       .name           = "hsmmc-if",
+       .id             = -1,
+       .parent         = &clk_hsmmc_div,
+       .enable         = s3c2443_enable_hsmmc,
+       .set_parent     = s3c2443_setparent_hsmmc,
+};
+
+/* i2s_eplldiv
+ *
+ * this clock is the output from the i2s divisor of esysclk
+*/
+
+static unsigned long s3c2443_getrate_i2s_eplldiv(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2443_CLKDIV1);
+
+       div &= S3C2443_CLKDIV1_I2SDIV_MASK;
+       div >>= S3C2443_CLKDIV1_I2SDIV_SHIFT;
+
+       return parent_rate / (div + 1);
+}
+
+static int s3c2443_setrate_i2s_eplldiv(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
+
+       rate = s3c2443_roundrate_clksrc16(clk, rate);
+       rate = parent_rate / rate;
+
+       clkdivn &= ~S3C2443_CLKDIV1_I2SDIV_MASK;
+       clkdivn |= (rate - 1) << S3C2443_CLKDIV1_I2SDIV_SHIFT;
+
+       __raw_writel(clkdivn, S3C2443_CLKDIV1);
+       return 0;
+}
+
+static struct clk clk_i2s_eplldiv = {
+       .name           = "i2s-eplldiv",
+       .id             = -1,
+       .parent         = &clk_esysclk,
+       .get_rate       = s3c2443_getrate_i2s_eplldiv,
+       .set_rate       = s3c2443_setrate_i2s_eplldiv,
+       .round_rate     = s3c2443_roundrate_clksrc16,
+};
+
+/* i2s-ref
+ *
+ * i2s bus reference clock, selectable from external, esysclk or epllref
+*/
+
+static int s3c2443_setparent_i2s(struct clk *clk, struct clk *parent)
+{
+       unsigned long clksrc = __raw_readl(S3C2443_CLKSRC);
+
+       clksrc &= ~S3C2443_CLKSRC_I2S_MASK;
+
+       if (parent == &clk_epllref)
+               clksrc |= S3C2443_CLKSRC_I2S_EPLLREF;
+       else if (parent == &clk_i2s_ext)
+               clksrc |= S3C2443_CLKSRC_I2S_EXT;
+       else if (parent != &clk_i2s_eplldiv)
+               return -EINVAL;
+
+       clk->parent = parent;
+       __raw_writel(clksrc, S3C2443_CLKSRC);
+
+       return 0;
+}
+
+static struct clk clk_i2s = {
+       .name           = "i2s-if",
+       .id             = -1,
+       .parent         = &clk_i2s_eplldiv,
+       .ctrlbit        = S3C2443_SCLKCON_I2SCLK,
+       .enable         = s3c2443_clkcon_enable_s,
+       .set_parent     = s3c2443_setparent_i2s,
+};
+
+/* cam-if
+ *
+ * camera interface bus-clock, divided down from esysclk
+*/
+
+static unsigned long s3c2443_getrate_cam(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2443_CLKDIV1);
+
+       div  &= S3C2443_CLKDIV1_CAMDIV_MASK;
+       div >>= S3C2443_CLKDIV1_CAMDIV_SHIFT;
+
+       return parent_rate / (div + 1);
+}
+
+static int s3c2443_setrate_cam(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdiv1 = __raw_readl(S3C2443_CLKDIV1);
+
+       rate = s3c2443_roundrate_clksrc16(clk, rate);
+       rate = parent_rate / rate;
+
+       clkdiv1 &= ~S3C2443_CLKDIV1_CAMDIV_MASK;
+       clkdiv1 |= (rate - 1) << S3C2443_CLKDIV1_CAMDIV_SHIFT;
+
+       __raw_writel(clkdiv1, S3C2443_CLKDIV1);
+       return 0;
+}
+
+static struct clk clk_cam = {
+       .name           = "camif-upll",         /* same as 2440 name */
+       .id             = -1,
+       .parent         = &clk_esysclk,
+       .ctrlbit        = S3C2443_SCLKCON_CAMCLK,
+       .enable         = s3c2443_clkcon_enable_s,
+       .get_rate       = s3c2443_getrate_cam,
+       .set_rate       = s3c2443_setrate_cam,
+       .round_rate     = s3c2443_roundrate_clksrc16,
+};
+
+/* display-if
+ *
+ * display interface clock, divided from esysclk
+*/
+
+static unsigned long s3c2443_getrate_display(struct clk *clk)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long div = __raw_readl(S3C2443_CLKDIV1);
+
+       div &= S3C2443_CLKDIV1_DISPDIV_MASK;
+       div >>= S3C2443_CLKDIV1_DISPDIV_SHIFT;
+
+       return parent_rate / (div + 1);
+}
+
+static int s3c2443_setrate_display(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk_get_rate(clk->parent);
+       unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
+
+       rate = s3c2443_roundrate_clksrc256(clk, rate);
+       rate = parent_rate / rate;
+
+       clkdivn &= ~S3C2443_CLKDIV1_UARTDIV_MASK;
+       clkdivn |= (rate - 1) << S3C2443_CLKDIV1_UARTDIV_SHIFT;
+
+       __raw_writel(clkdivn, S3C2443_CLKDIV1);
+       return 0;
+}
+
+static struct clk clk_display = {
+       .name           = "display-if",
+       .id             = -1,
+       .parent         = &clk_esysclk,
+       .ctrlbit        = S3C2443_SCLKCON_DISPCLK,
+       .enable         = s3c2443_clkcon_enable_s,
+       .get_rate       = s3c2443_getrate_display,
+       .set_rate       = s3c2443_setrate_display,
+       .round_rate     = s3c2443_roundrate_clksrc256,
+};
+
+/* standard clock definitions */
+
+static struct clk init_clocks_disable[] = {
+       {
+               .name           = "nand",
+               .id             = -1,
+               .parent         = &clk_h,
+       }, {
+               .name           = "sdi",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_SDI,
+       }, {
+               .name           = "adc",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_ADC,
+       }, {
+               .name           = "i2c",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_IIC,
+       }, {
+               .name           = "iis",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_IIS,
+       }, {
+               .name           = "spi",
+               .id             = 0,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_SPI0,
+       }, {
+               .name           = "spi",
+               .id             = 1,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_SPI1,
+       }
+};
+
+static struct clk init_clocks[] = {
+       {
+               .name           = "dma",
+               .id             = 0,
+               .parent         = &clk_h,
+               .enable         = s3c2443_clkcon_enable_h,
+               .ctrlbit        = S3C2443_HCLKCON_DMA0,
+       }, {
+               .name           = "dma",
+               .id             = 1,
+               .parent         = &clk_h,
+               .enable         = s3c2443_clkcon_enable_h,
+               .ctrlbit        = S3C2443_HCLKCON_DMA1,
+       }, {
+               .name           = "dma",
+               .id             = 2,
+               .parent         = &clk_h,
+               .enable         = s3c2443_clkcon_enable_h,
+               .ctrlbit        = S3C2443_HCLKCON_DMA2,
+       }, {
+               .name           = "dma",
+               .id             = 3,
+               .parent         = &clk_h,
+               .enable         = s3c2443_clkcon_enable_h,
+               .ctrlbit        = S3C2443_HCLKCON_DMA3,
+       }, {
+               .name           = "dma",
+               .id             = 4,
+               .parent         = &clk_h,
+               .enable         = s3c2443_clkcon_enable_h,
+               .ctrlbit        = S3C2443_HCLKCON_DMA4,
+       }, {
+               .name           = "dma",
+               .id             = 5,
+               .parent         = &clk_h,
+               .enable         = s3c2443_clkcon_enable_h,
+               .ctrlbit        = S3C2443_HCLKCON_DMA5,
+       }, {
+               .name           = "lcd",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2443_clkcon_enable_h,
+               .ctrlbit        = S3C2443_HCLKCON_LCDC,
+       }, {
+               .name           = "gpio",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_GPIO,
+       }, {
+               .name           = "usb-host",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2443_clkcon_enable_h,
+               .ctrlbit        = S3C2443_HCLKCON_USBH,
+       }, {
+               .name           = "usb-device",
+               .id             = -1,
+               .parent         = &clk_h,
+               .enable         = s3c2443_clkcon_enable_h,
+               .ctrlbit        = S3C2443_HCLKCON_USBD,
+       }, {
+               .name           = "timers",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_PWMT,
+       }, {
+               .name           = "uart",
+               .id             = 0,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_UART0,
+       }, {
+               .name           = "uart",
+               .id             = 1,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_UART1,
+       }, {
+               .name           = "uart",
+               .id             = 2,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_UART2,
+       }, {
+               .name           = "uart",
+               .id             = 3,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_UART3,
+       }, {
+               .name           = "rtc",
+               .id             = -1,
+               .parent         = &clk_p,
+               .enable         = s3c2443_clkcon_enable_p,
+               .ctrlbit        = S3C2443_PCLKCON_RTC,
+       }, {
+               .name           = "watchdog",
+               .id             = -1,
+               .parent         = &clk_p,
+               .ctrlbit        = S3C2443_PCLKCON_WDT,
+       }, {
+               .name           = "usb-bus-host",
+               .id             = -1,
+               .parent         = &clk_usb_bus_host,
+       }
+};
+
+/* clocks to add where we need to check their parentage */
+
+/* s3c2443_clk_initparents
+ *
+ * Initialise the parents for the clocks that we get at start-time
+*/
+
+static int __init clk_init_set_parent(struct clk *clk, struct clk *parent)
+{
+       printk(KERN_DEBUG "clock %s: parent %s\n", clk->name, parent->name);
+       return clk_set_parent(clk, parent);
+}
+
+static void __init s3c2443_clk_initparents(void)
+{
+       unsigned long clksrc = __raw_readl(S3C2443_CLKSRC);
+       struct clk *parent;
+
+       switch (clksrc & S3C2443_CLKSRC_EPLLREF_MASK) {
+       case S3C2443_CLKSRC_EPLLREF_EXTCLK:
+               parent = &clk_ext;
+               break;
+
+       case S3C2443_CLKSRC_EPLLREF_XTAL:
+       default:
+               parent = &clk_xtal;
+               break;
+
+       case S3C2443_CLKSRC_EPLLREF_MPLLREF:
+       case S3C2443_CLKSRC_EPLLREF_MPLLREF2:
+               parent = &clk_mpllref;
+               break;
+       }
+
+       clk_init_set_parent(&clk_epllref, parent);
+
+       switch (clksrc & S3C2443_CLKSRC_I2S_MASK) {
+       case S3C2443_CLKSRC_I2S_EXT:
+               parent = &clk_i2s_ext;
+               break;
+
+       case S3C2443_CLKSRC_I2S_EPLLDIV:
+       default:
+               parent = &clk_i2s_eplldiv;
+               break;
+
+       case S3C2443_CLKSRC_I2S_EPLLREF:
+       case S3C2443_CLKSRC_I2S_EPLLREF3:
+               parent = &clk_epllref;
+       }
+
+       clk_init_set_parent(&clk_i2s, &clk_epllref);
+
+       /* esysclk source */
+
+       parent = (clksrc & S3C2443_CLKSRC_ESYSCLK_EPLL) ?
+               &clk_epll : &clk_epllref;
+
+       clk_init_set_parent(&clk_esysclk, parent);
+
+       /* msysclk source */
+
+       if (clksrc & S3C2443_CLKSRC_MSYSCLK_MPLL) {
+               parent = &clk_mpll;
+       } else {
+               parent = (clksrc & S3C2443_CLKSRC_EXTCLK_DIV) ?
+                       &clk_mdivclk : &clk_mpllref;
+       }
+
+       clk_init_set_parent(&clk_msysclk, parent);
+}
+
+/* armdiv divisor table */
+
+static unsigned int armdiv[16] = {
+       [S3C2443_CLKDIV0_ARMDIV_1 >> S3C2443_CLKDIV0_ARMDIV_SHIFT]      = 1,
+       [S3C2443_CLKDIV0_ARMDIV_2 >> S3C2443_CLKDIV0_ARMDIV_SHIFT]      = 2,
+       [S3C2443_CLKDIV0_ARMDIV_3 >> S3C2443_CLKDIV0_ARMDIV_SHIFT]      = 3,
+       [S3C2443_CLKDIV0_ARMDIV_4 >> S3C2443_CLKDIV0_ARMDIV_SHIFT]      = 4,
+       [S3C2443_CLKDIV0_ARMDIV_6 >> S3C2443_CLKDIV0_ARMDIV_SHIFT]      = 6,
+       [S3C2443_CLKDIV0_ARMDIV_8 >> S3C2443_CLKDIV0_ARMDIV_SHIFT]      = 8,
+       [S3C2443_CLKDIV0_ARMDIV_12 >> S3C2443_CLKDIV0_ARMDIV_SHIFT]     = 12,
+       [S3C2443_CLKDIV0_ARMDIV_16 >> S3C2443_CLKDIV0_ARMDIV_SHIFT]     = 16,
+};
+
+static inline unsigned int s3c2443_fclk_div(unsigned long clkcon0)
+{
+       clkcon0 &= S3C2443_CLKDIV0_ARMDIV_MASK;
+
+       return armdiv[clkcon0 >> S3C2443_CLKDIV0_ARMDIV_SHIFT];
+}
+
+static inline unsigned long s3c2443_get_prediv(unsigned long clkcon0)
+{
+       clkcon0 &= S3C2443_CLKDIV0_PREDIV_MASK;
+       clkcon0 >>= S3C2443_CLKDIV0_PREDIV_SHIFT;
+
+       return clkcon0 + 1;
+}
+
+/* clocks to add straight away */
+
+static struct clk *clks[] __initdata = {
+       &clk_ext,
+       &clk_epll,
+       &clk_usb_bus_host,
+       &clk_usb_bus,
+       &clk_esysclk,
+       &clk_epllref,
+       &clk_mpllref,
+       &clk_msysclk,
+       &clk_uart,
+       &clk_display,
+       &clk_cam,
+       &clk_i2s_eplldiv,
+       &clk_i2s,
+       &clk_hsspi,
+       &clk_hsmmc_div,
+       &clk_hsmmc,
+};
+
+void __init s3c2443_init_clocks(int xtal)
+{
+       unsigned long epllcon = __raw_readl(S3C2443_EPLLCON);
+       unsigned long mpllcon = __raw_readl(S3C2443_MPLLCON);
+       unsigned long clkdiv0 = __raw_readl(S3C2443_CLKDIV0);
+       unsigned long pll;
+       unsigned long fclk;
+       unsigned long hclk;
+       unsigned long pclk;
+       struct clk *clkp;
+       int ret;
+       int ptr;
+
+       pll = s3c2443_get_mpll(mpllcon, xtal);
+
+       fclk = pll / s3c2443_fclk_div(clkdiv0);
+       hclk = fclk / s3c2443_get_prediv(clkdiv0);
+       hclk = hclk / ((clkdiv0 & S3C2443_CLKDIV0_HALF_HCLK) ? 2 : 1);
+       pclk = hclk / ((clkdiv0 & S3C2443_CLKDIV0_HALF_PCLK) ? 2 : 1);
+
+       s3c24xx_setup_clocks(xtal, fclk, hclk, pclk);
+
+       printk("S3C2443: mpll %s %ld.%03ld MHz, cpu %ld.%03ld MHz, mem %ld.%03ld MHz, pclk %ld.%03ld MHz\n",
+              (mpllcon & S3C2443_PLLCON_OFF) ? "off":"on",
+              print_mhz(pll), print_mhz(fclk),
+              print_mhz(hclk), print_mhz(pclk));
+
+       s3c2443_clk_initparents();
+
+       for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) {
+               clkp = clks[ptr];
+
+               ret = s3c24xx_register_clock(clkp);
+               if (ret < 0) {
+                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
+                              clkp->name, ret);
+               }
+       }
+
+       clk_epll.rate = s3c2443_get_epll(epllcon, xtal);
+
+       clk_usb_bus.parent = &clk_usb_bus_host;
+
+       /* ensure usb bus clock is within correct rate of 48MHz */
+
+       if (clk_get_rate(&clk_usb_bus_host) != (48 * 1000 * 1000)) {
+               printk(KERN_INFO "Warning: USB host bus not at 48MHz\n");
+               clk_set_rate(&clk_usb_bus_host, 48*1000*1000);
+       }
+
+       printk("S3C2443: epll %s %ld.%03ld MHz, usb-bus %ld.%03ld MHz\n",
+              (epllcon & S3C2443_PLLCON_OFF) ? "off":"on",
+              print_mhz(clk_get_rate(&clk_epll)),
+              print_mhz(clk_get_rate(&clk_usb_bus)));
+
+       /* register clocks from clock array */
+
+       clkp = init_clocks;
+       for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
+               ret = s3c24xx_register_clock(clkp);
+               if (ret < 0) {
+                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
+                              clkp->name, ret);
+               }
+       }
+
+       /* We must be careful disabling the clocks we are not intending to
+        * be using at boot time, as subsytems such as the LCD which do
+        * their own DMA requests to the bus can cause the system to lockup
+        * if they where in the middle of requesting bus access.
+        *
+        * Disabling the LCD clock if the LCD is active is very dangerous,
+        * and therefore the bootloader should be careful to not enable
+        * the LCD clock if it is not needed.
+       */
+
+       /* install (and disable) the clocks we do not need immediately */
+
+       clkp = init_clocks_disable;
+       for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
+
+               ret = s3c24xx_register_clock(clkp);
+               if (ret < 0) {
+                       printk(KERN_ERR "Failed to register clock %s (%d)\n",
+                              clkp->name, ret);
+               }
+
+               (clkp->enable)(clkp, 0);
+       }
+}
diff --git a/arch/arm/mach-s3c2443/dma.c b/arch/arm/mach-s3c2443/dma.c
new file mode 100644 (file)
index 0000000..f70e8cc
--- /dev/null
@@ -0,0 +1,180 @@
+/* linux/arch/arm/mach-s3c2443/dma.c
+ *
+ * Copyright (c) 2007 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2443 DMA selection
+ *
+ * http://armlinux.simtec.co.uk/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/sysdev.h>
+#include <linux/serial_core.h>
+
+#include <asm/dma.h>
+#include <asm/arch/dma.h>
+#include <asm/io.h>
+
+#include <asm/plat-s3c24xx/dma.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-ac97.h>
+#include <asm/arch/regs-mem.h>
+#include <asm/arch/regs-lcd.h>
+#include <asm/arch/regs-sdi.h>
+#include <asm/arch/regs-iis.h>
+#include <asm/arch/regs-spi.h>
+
+#define MAP(x) { \
+               [0]     = (x) | DMA_CH_VALID,   \
+               [1]     = (x) | DMA_CH_VALID,   \
+               [2]     = (x) | DMA_CH_VALID,   \
+               [3]     = (x) | DMA_CH_VALID,   \
+               [4]     = (x) | DMA_CH_VALID,   \
+               [5]     = (x) | DMA_CH_VALID,   \
+       }
+
+static struct s3c24xx_dma_map __initdata s3c2443_dma_mappings[] = {
+       [DMACH_XD0] = {
+               .name           = "xdreq0",
+               .channels       = MAP(S3C2443_DMAREQSEL_XDREQ0),
+       },
+       [DMACH_XD1] = {
+               .name           = "xdreq1",
+               .channels       = MAP(S3C2443_DMAREQSEL_XDREQ1),
+       },
+       [DMACH_SDI] = {
+               .name           = "sdi",
+               .channels       = MAP(S3C2443_DMAREQSEL_SDI),
+               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
+               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_SPI0] = {
+               .name           = "spi0",
+               .channels       = MAP(S3C2443_DMAREQSEL_SPI0TX),
+               .hw_addr.to     = S3C2410_PA_SPI + S3C2410_SPTDAT,
+               .hw_addr.from   = S3C2410_PA_SPI + S3C2410_SPRDAT,
+       },
+       [DMACH_SPI1] = {
+               .name           = "spi1",
+               .channels       = MAP(S3C2443_DMAREQSEL_SPI1TX),
+               .hw_addr.to     = S3C2410_PA_SPI + 0x20 + S3C2410_SPTDAT,
+               .hw_addr.from   = S3C2410_PA_SPI + 0x20 + S3C2410_SPRDAT,
+       },
+       [DMACH_UART0] = {
+               .name           = "uart0",
+               .channels       = MAP(S3C2443_DMAREQSEL_UART0_0),
+               .hw_addr.to     = S3C2410_PA_UART0 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART0 + S3C2410_URXH,
+       },
+       [DMACH_UART1] = {
+               .name           = "uart1",
+               .channels       = MAP(S3C2443_DMAREQSEL_UART1_0),
+               .hw_addr.to     = S3C2410_PA_UART1 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART1 + S3C2410_URXH,
+       },
+       [DMACH_UART2] = {
+               .name           = "uart2",
+               .channels       = MAP(S3C2443_DMAREQSEL_UART2_0),
+               .hw_addr.to     = S3C2410_PA_UART2 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART2 + S3C2410_URXH,
+       },
+       [DMACH_UART3] = {
+               .name           = "uart3",
+               .channels       = MAP(S3C2443_DMAREQSEL_UART3_0),
+               .hw_addr.to     = S3C2443_PA_UART3 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2443_PA_UART3 + S3C2410_URXH,
+       },
+       [DMACH_UART0_SRC2] = {
+               .name           = "uart0",
+               .channels       = MAP(S3C2443_DMAREQSEL_UART0_1),
+               .hw_addr.to     = S3C2410_PA_UART0 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART0 + S3C2410_URXH,
+       },
+       [DMACH_UART1_SRC2] = {
+               .name           = "uart1",
+               .channels       = MAP(S3C2443_DMAREQSEL_UART1_1),
+               .hw_addr.to     = S3C2410_PA_UART1 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART1 + S3C2410_URXH,
+       },
+       [DMACH_UART2_SRC2] = {
+               .name           = "uart2",
+               .channels       = MAP(S3C2443_DMAREQSEL_UART2_1),
+               .hw_addr.to     = S3C2410_PA_UART2 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2410_PA_UART2 + S3C2410_URXH,
+       },
+       [DMACH_UART3_SRC2] = {
+               .name           = "uart3",
+               .channels       = MAP(S3C2443_DMAREQSEL_UART3_1),
+               .hw_addr.to     = S3C2443_PA_UART3 + S3C2410_UTXH,
+               .hw_addr.from   = S3C2443_PA_UART3 + S3C2410_URXH,
+       },
+       [DMACH_TIMER] = {
+               .name           = "timer",
+               .channels       = MAP(S3C2443_DMAREQSEL_TIMER),
+       },
+       [DMACH_I2S_IN] = {
+               .name           = "i2s-sdi",
+               .channels       = MAP(S3C2443_DMAREQSEL_I2SRX),
+               .hw_addr.from   = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_I2S_OUT] = {
+               .name           = "i2s-sdo",
+               .channels       = MAP(S3C2443_DMAREQSEL_I2STX),
+               .hw_addr.to     = S3C2410_PA_IIS + S3C2410_IISFIFO,
+       },
+       [DMACH_PCM_IN] = {
+               .name           = "pcm-in",
+               .channels       = MAP(S3C2443_DMAREQSEL_PCMIN),
+               .hw_addr.from   = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA,
+       },
+       [DMACH_PCM_OUT] = {
+               .name           = "pcm-out",
+               .channels       = MAP(S3C2443_DMAREQSEL_PCMOUT),
+               .hw_addr.to     = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA,
+       },
+       [DMACH_MIC_IN] = {
+               .name           = "mic-in",
+               .channels       = MAP(S3C2443_DMAREQSEL_MICIN),
+               .hw_addr.from   = S3C2440_PA_AC97 + S3C_AC97_MIC_DATA,
+       },
+};
+
+static void s3c2443_dma_select(struct s3c2410_dma_chan *chan,
+                              struct s3c24xx_dma_map *map)
+{
+       writel(map->channels[0] | S3C2443_DMAREQSEL_HW,
+              chan->regs + S3C2443_DMA_DMAREQSEL);
+}
+
+static struct s3c24xx_dma_selection __initdata s3c2443_dma_sel = {
+       .select         = s3c2443_dma_select,
+       .dcon_mask      = 0,
+       .map            = s3c2443_dma_mappings,
+       .map_size       = ARRAY_SIZE(s3c2443_dma_mappings),
+};
+
+static int s3c2443_dma_add(struct sys_device *sysdev)
+{
+       s3c24xx_dma_init(6, IRQ_S3C2443_DMA0, 0x100);
+       return s3c24xx_dma_init_map(&s3c2443_dma_sel);
+}
+
+static struct sysdev_driver s3c2443_dma_driver = {
+       .add    = s3c2443_dma_add,
+};
+
+static int __init s3c2443_dma_init(void)
+{
+       return sysdev_driver_register(&s3c2443_sysclass, &s3c2443_dma_driver);
+}
+
+arch_initcall(s3c2443_dma_init);
diff --git a/arch/arm/mach-s3c2443/irq.c b/arch/arm/mach-s3c2443/irq.c
new file mode 100644 (file)
index 0000000..7a45b6d
--- /dev/null
@@ -0,0 +1,290 @@
+/* linux/arch/arm/mach-s3c2443/irq.c
+ *
+ * Copyright (c) 2007 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+*/
+
+#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 <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/mach/irq.h>
+
+#include <asm/arch/regs-irq.h>
+#include <asm/arch/regs-gpio.h>
+
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
+#include <asm/plat-s3c24xx/irq.h>
+
+#define INTMSK(start, end) ((1 << ((end) + 1 - (start))) - 1)
+
+static inline void s3c2443_irq_demux(unsigned int irq, unsigned int len)
+{
+       unsigned int subsrc, submsk;
+       unsigned int end;
+       struct irq_desc *mydesc;
+
+       /* read the current pending interrupts, and the mask
+        * for what it is available */
+
+       subsrc = __raw_readl(S3C2410_SUBSRCPND);
+       submsk = __raw_readl(S3C2410_INTSUBMSK);
+
+       subsrc  &= ~submsk;
+       subsrc >>= (irq - S3C2410_IRQSUB(0));
+       subsrc  &= (1 << len)-1;
+
+       end = len + irq;
+       mydesc = irq_desc + irq;
+
+       for (; irq < end && subsrc; irq++) {
+               if (subsrc & 1)
+                       desc_handle_irq(irq, mydesc);
+
+               mydesc++;
+               subsrc >>= 1;
+       }
+}
+
+/* WDT/AC97 sub interrupts */
+
+static void s3c2443_irq_demux_wdtac97(unsigned int irq, struct irq_desc *desc)
+{
+       s3c2443_irq_demux(IRQ_S3C2443_WDT, 4);
+}
+
+#define INTMSK_WDTAC97 (1UL << (IRQ_WDT - IRQ_EINT0))
+#define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97)
+
+static void s3c2443_irq_wdtac97_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97);
+}
+
+static void s3c2443_irq_wdtac97_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_WDTAC97);
+}
+
+static void s3c2443_irq_wdtac97_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97);
+}
+
+static struct irq_chip s3c2443_irq_wdtac97 = {
+       .mask       = s3c2443_irq_wdtac97_mask,
+       .unmask     = s3c2443_irq_wdtac97_unmask,
+       .ack        = s3c2443_irq_wdtac97_ack,
+};
+
+
+/* LCD sub interrupts */
+
+static void s3c2443_irq_demux_lcd(unsigned int irq, struct irq_desc *desc)
+{
+       s3c2443_irq_demux(IRQ_S3C2443_LCD1, 4);
+}
+
+#define INTMSK_LCD     (1UL << (IRQ_LCD - IRQ_EINT0))
+#define SUBMSK_LCD     INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4)
+
+static void s3c2443_irq_lcd_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_LCD, SUBMSK_LCD);
+}
+
+static void s3c2443_irq_lcd_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_LCD);
+}
+
+static void s3c2443_irq_lcd_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_LCD, SUBMSK_LCD);
+}
+
+static struct irq_chip s3c2443_irq_lcd = {
+       .mask       = s3c2443_irq_lcd_mask,
+       .unmask     = s3c2443_irq_lcd_unmask,
+       .ack        = s3c2443_irq_lcd_ack,
+};
+
+
+/* DMA sub interrupts */
+
+static void s3c2443_irq_demux_dma(unsigned int irq, struct irq_desc *desc)
+{
+       s3c2443_irq_demux(IRQ_S3C2443_DMA1, 6);
+}
+
+#define INTMSK_DMA     (1UL << (IRQ_S3C2443_DMA - IRQ_EINT0))
+#define SUBMSK_DMA     INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5)
+
+
+static void s3c2443_irq_dma_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_DMA, SUBMSK_DMA);
+}
+
+static void s3c2443_irq_dma_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_DMA);
+}
+
+static void s3c2443_irq_dma_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_DMA, SUBMSK_DMA);
+}
+
+static struct irq_chip s3c2443_irq_dma = {
+       .mask       = s3c2443_irq_dma_mask,
+       .unmask     = s3c2443_irq_dma_unmask,
+       .ack        = s3c2443_irq_dma_ack,
+};
+
+
+/* UART3 sub interrupts */
+
+static void s3c2443_irq_demux_uart3(unsigned int irq, struct irq_desc *desc)
+{
+       s3c2443_irq_demux(IRQ_S3C2443_UART3, 3);
+}
+
+#define INTMSK_UART3   (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0))
+#define SUBMSK_UART3   (0xf << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0)))
+
+
+static void s3c2443_irq_uart3_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_UART3, SUBMSK_UART3);
+}
+
+static void s3c2443_irq_uart3_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_UART3);
+}
+
+static void s3c2443_irq_uart3_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_UART3, SUBMSK_UART3);
+}
+
+static struct irq_chip s3c2443_irq_uart3 = {
+       .mask       = s3c2443_irq_uart3_mask,
+       .unmask     = s3c2443_irq_uart3_unmask,
+       .ack        = s3c2443_irq_uart3_ack,
+};
+
+
+/* CAM sub interrupts */
+
+static void s3c2443_irq_demux_cam(unsigned int irq, struct irq_desc *desc)
+{
+       s3c2443_irq_demux(IRQ_S3C2440_CAM_C, 4);
+}
+
+#define INTMSK_CAM     (1UL << (IRQ_CAM - IRQ_EINT0))
+#define SUBMSK_CAM     INTMSK(IRQ_S3C2440_CAM_C, IRQ_S3C2440_CAM_P)
+
+static void s3c2443_irq_cam_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_CAM, SUBMSK_CAM);
+}
+
+static void s3c2443_irq_cam_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_CAM);
+}
+
+static void s3c2443_irq_cam_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_CAM, SUBMSK_CAM);
+}
+
+static struct irq_chip s3c2443_irq_cam = {
+       .mask       = s3c2443_irq_cam_mask,
+       .unmask     = s3c2443_irq_cam_unmask,
+       .ack        = s3c2443_irq_cam_ack,
+};
+
+/* IRQ initialisation code */
+
+static int __init s3c2443_add_sub(unsigned int base,
+                                  void (*demux)(unsigned int,
+                                                struct irq_desc *),
+                                  struct irq_chip *chip,
+                                  unsigned int start, unsigned int end)
+{
+       unsigned int irqno;
+
+       set_irq_chip(base, &s3c_irq_level_chip);
+       set_irq_handler(base, handle_level_irq);
+       set_irq_chained_handler(base, demux);
+
+       for (irqno = start; irqno <= end; irqno++) {
+               set_irq_chip(irqno, chip);
+               set_irq_handler(irqno, handle_level_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       return 0;
+}
+
+static int s3c2443_irq_add(struct sys_device *sysdev)
+{
+       printk("S3C2443: IRQ Support\n");
+
+       s3c2443_add_sub(IRQ_CAM, s3c2443_irq_demux_cam, &s3c2443_irq_cam,
+                       IRQ_S3C2440_CAM_C, IRQ_S3C2440_CAM_P);
+
+       s3c2443_add_sub(IRQ_LCD, s3c2443_irq_demux_lcd, &s3c2443_irq_lcd,
+                       IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4);
+
+       s3c2443_add_sub(IRQ_S3C2443_DMA, s3c2443_irq_demux_dma,
+                       &s3c2443_irq_dma, IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5);
+
+       s3c2443_add_sub(IRQ_S3C2443_UART3, s3c2443_irq_demux_uart3,
+                       &s3c2443_irq_uart3,
+                       IRQ_S3C2443_RX3, IRQ_S3C2443_ERR3);
+
+       s3c2443_add_sub(IRQ_WDT, s3c2443_irq_demux_wdtac97,
+                       &s3c2443_irq_wdtac97,
+                       IRQ_S3C2443_WDT, IRQ_S3C2443_AC97);
+
+       return 0;
+}
+
+static struct sysdev_driver s3c2443_irq_driver = {
+       .add            = s3c2443_irq_add,
+};
+
+static int s3c2443_irq_init(void)
+{
+       return sysdev_driver_register(&s3c2443_sysclass, &s3c2443_irq_driver);
+}
+
+arch_initcall(s3c2443_irq_init);
+
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
new file mode 100644 (file)
index 0000000..e82aaff
--- /dev/null
@@ -0,0 +1,137 @@
+/* linux/arch/arm/mach-s3c2443/mach-smdk2443.c
+ *
+ * Copyright (c) 2007 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * http://www.fluff.org/ben/smdk2443/
+ *
+ * Thanks to Samsung for the loan of an SMDK2443
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+#include <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/serial_core.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-lcd.h>
+
+#include <asm/arch/idle.h>
+#include <asm/arch/fb.h>
+
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/s3c2440.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+#include <asm/plat-s3c24xx/common-smdk.h>
+
+static struct map_desc smdk2443_iodesc[] __initdata = {
+       /* ISA IO Space map (memory space selected by A24) */
+
+       {
+               .virtual        = (u32)S3C24XX_VA_ISA_WORD,
+               .pfn            = __phys_to_pfn(S3C2410_CS2),
+               .length         = 0x10000,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
+               .pfn            = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
+               .length         = SZ_4M,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
+               .pfn            = __phys_to_pfn(S3C2410_CS2),
+               .length         = 0x10000,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
+               .pfn            = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
+               .length         = SZ_4M,
+               .type           = MT_DEVICE,
+       }
+};
+
+#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
+#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
+#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
+
+static struct s3c2410_uartcfg smdk2443_uartcfgs[] __initdata = {
+       [0] = {
+               .hwport      = 0,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x51,
+       },
+       [1] = {
+               .hwport      = 1,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x03,
+               .ufcon       = 0x51,
+       },
+       /* IR port */
+       [2] = {
+               .hwport      = 2,
+               .flags       = 0,
+               .ucon        = 0x3c5,
+               .ulcon       = 0x43,
+               .ufcon       = 0x51,
+       }
+};
+
+static struct platform_device *smdk2443_devices[] __initdata = {
+       &s3c_device_wdt,
+       &s3c_device_i2c,
+};
+
+static struct s3c24xx_board smdk2443_board __initdata = {
+       .devices       = smdk2443_devices,
+       .devices_count = ARRAY_SIZE(smdk2443_devices)
+};
+
+static void __init smdk2443_map_io(void)
+{
+       s3c24xx_init_io(smdk2443_iodesc, ARRAY_SIZE(smdk2443_iodesc));
+       s3c24xx_init_clocks(12000000);
+       s3c24xx_init_uarts(smdk2443_uartcfgs, ARRAY_SIZE(smdk2443_uartcfgs));
+       s3c24xx_set_board(&smdk2443_board);
+}
+
+static void __init smdk2443_machine_init(void)
+{
+       smdk_machine_init();
+}
+
+MACHINE_START(SMDK2443, "SMDK2443")
+       /* Maintainer: Ben Dooks <ben@fluff.org> */
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+
+       .init_irq       = s3c24xx_init_irq,
+       .map_io         = smdk2443_map_io,
+       .init_machine   = smdk2443_machine_init,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c2443/s3c2443.c
new file mode 100644 (file)
index 0000000..11b1d0b
--- /dev/null
@@ -0,0 +1,97 @@
+/* linux/arch/arm/mach-s3c2443/s3c2443.c
+ *
+ * Copyright (c) 2007 Simtec Electronics
+ *   Ben Dooks <ben@simtec.co.uk>
+ *
+ * Samsung S3C2443 Mobile CPU support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/serial_core.h>
+#include <linux/sysdev.h>
+#include <linux/clk.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+
+#include <asm/arch/regs-s3c2443-clock.h>
+#include <asm/arch/reset.h>
+
+#include <asm/plat-s3c24xx/s3c2443.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+static struct map_desc s3c2443_iodesc[] __initdata = {
+       IODESC_ENT(WATCHDOG),
+       IODESC_ENT(CLKPWR),
+       IODESC_ENT(TIMER),
+};
+
+struct sysdev_class s3c2443_sysclass = {
+       set_kset_name("s3c2443-core"),
+};
+
+static struct sys_device s3c2443_sysdev = {
+       .cls            = &s3c2443_sysclass,
+};
+
+static void s3c2443_hard_reset(void)
+{
+       __raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST);
+}
+
+int __init s3c2443_init(void)
+{
+       printk("S3C2443: Initialising architecture\n");
+
+       s3c24xx_reset_hook = s3c2443_hard_reset;
+
+       s3c_device_nand.name = "s3c2412-nand";
+
+       return sysdev_register(&s3c2443_sysdev);
+}
+
+void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no)
+{
+       s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
+}
+
+/* s3c2443_map_io
+ *
+ * register the standard cpu IO areas, and any passed in from the
+ * machine specific initialisation.
+ */
+
+void __init s3c2443_map_io(struct map_desc *mach_desc, int mach_size)
+{
+       iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
+       iotable_init(mach_desc, mach_size);
+}
+
+/* need to register class before we actually register the device, and
+ * we also need to ensure that it has been initialised before any of the
+ * drivers even try to use it (even if not on an s3c2443 based system)
+ * as a driver which may support both 2443 and 2440 may try and use it.
+*/
+
+static int __init s3c2443_core_init(void)
+{
+       return sysdev_class_register(&s3c2443_sysclass);
+}
+
+core_initcall(s3c2443_core_init);
index aade2f72c9209f995b4f7e70461742610648bccf..4b277199d0e8f8c1ef7faf4a2323d595edf5c8c6 100644 (file)
@@ -171,8 +171,8 @@ config CPU_ARM925T
 # ARM926T
 config CPU_ARM926T
        bool "Support ARM926T processor"
-       depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261
-       default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261
+       depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_NS9XXX
+       default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_NS9XXX
        select CPU_32v5
        select CPU_ABRT_EV5TJ
        select CPU_CACHE_VIVT
@@ -609,3 +609,10 @@ config NEEDS_SYSCALL_FOR_CMPXCHG
          Forget about fast user space cmpxchg support.
          It is just not possible.
 
+config OUTER_CACHE
+       bool
+       default n
+
+config CACHE_L2X0
+       bool
+       select OUTER_CACHE
index d2f5672ecf62e2a06967884f9edf1c7b53975ab6..2f8b95947774dc8d263ce753ba7cb64e2299d241 100644 (file)
@@ -66,3 +66,5 @@ obj-$(CONFIG_CPU_SA1100)      += proc-sa1100.o
 obj-$(CONFIG_CPU_XSCALE)       += proc-xscale.o
 obj-$(CONFIG_CPU_XSC3)         += proc-xsc3.o
 obj-$(CONFIG_CPU_V6)           += proc-v6.o
+
+obj-$(CONFIG_CACHE_L2X0)       += cache-l2x0.o
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
new file mode 100644 (file)
index 0000000..08a36f1
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * arch/arm/mm/cache-l2x0.c - L210/L220 cache controller support
+ *
+ * Copyright (C) 2007 ARM Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <linux/init.h>
+
+#include <asm/cacheflush.h>
+#include <asm/io.h>
+#include <asm/hardware/cache-l2x0.h>
+
+#define CACHE_LINE_SIZE                32
+
+static void __iomem *l2x0_base;
+
+static inline void sync_writel(unsigned long val, unsigned long reg,
+                              unsigned long complete_mask)
+{
+       writel(val, l2x0_base + reg);
+       /* wait for the operation to complete */
+       while (readl(l2x0_base + reg) & complete_mask)
+               ;
+}
+
+static inline void cache_sync(void)
+{
+       sync_writel(0, L2X0_CACHE_SYNC, 1);
+}
+
+static inline void l2x0_inv_all(void)
+{
+       /* invalidate all ways */
+       sync_writel(0xff, L2X0_INV_WAY, 0xff);
+       cache_sync();
+}
+
+static void l2x0_inv_range(unsigned long start, unsigned long end)
+{
+       unsigned long addr;
+
+       start &= ~(CACHE_LINE_SIZE - 1);
+       for (addr = start; addr < end; addr += CACHE_LINE_SIZE)
+               sync_writel(addr, L2X0_INV_LINE_PA, 1);
+       cache_sync();
+}
+
+static void l2x0_clean_range(unsigned long start, unsigned long end)
+{
+       unsigned long addr;
+
+       start &= ~(CACHE_LINE_SIZE - 1);
+       for (addr = start; addr < end; addr += CACHE_LINE_SIZE)
+               sync_writel(addr, L2X0_CLEAN_LINE_PA, 1);
+       cache_sync();
+}
+
+static void l2x0_flush_range(unsigned long start, unsigned long end)
+{
+       unsigned long addr;
+
+       start &= ~(CACHE_LINE_SIZE - 1);
+       for (addr = start; addr < end; addr += CACHE_LINE_SIZE)
+               sync_writel(addr, L2X0_CLEAN_INV_LINE_PA, 1);
+       cache_sync();
+}
+
+void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
+{
+       __u32 aux;
+
+       l2x0_base = base;
+
+       /* disable L2X0 */
+       writel(0, l2x0_base + L2X0_CTRL);
+
+       aux = readl(l2x0_base + L2X0_AUX_CTRL);
+       aux &= aux_mask;
+       aux |= aux_val;
+       writel(aux, l2x0_base + L2X0_AUX_CTRL);
+
+       l2x0_inv_all();
+
+       /* enable L2X0 */
+       writel(1, l2x0_base + L2X0_CTRL);
+
+       outer_cache.inv_range = l2x0_inv_range;
+       outer_cache.clean_range = l2x0_clean_range;
+       outer_cache.flush_range = l2x0_flush_range;
+
+       printk(KERN_INFO "L2X0 cache controller enabled\n");
+}
index 6a9c362fef5e241969c42c6133456fb901ce31a2..1f9f94f9af4bac8d99137cad55204afcc279c0e4 100644 (file)
@@ -205,9 +205,10 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
         * kernel direct-mapped region for device DMA.
         */
        {
-               unsigned long kaddr = (unsigned long)page_address(page);
-               memset(page_address(page), 0, size);
-               dmac_flush_range(kaddr, kaddr + size);
+               void *ptr = page_address(page);
+               memset(ptr, 0, size);
+               dmac_flush_range(ptr, ptr + size);
+               outer_flush_range(__pa(ptr), __pa(ptr) + size);
        }
 
        /*
@@ -480,20 +481,24 @@ core_initcall(consistent_init);
  * platforms with CONFIG_DMABOUNCE.
  * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
  */
-void consistent_sync(void *vaddr, size_t size, int direction)
+void consistent_sync(const void *start, size_t size, int direction)
 {
-       unsigned long start = (unsigned long)vaddr;
-       unsigned long end   = start + size;
+       const void *end = start + size;
+
+       BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(end - 1));
 
        switch (direction) {
        case DMA_FROM_DEVICE:           /* invalidate only */
                dmac_inv_range(start, end);
+               outer_inv_range(__pa(start), __pa(end));
                break;
        case DMA_TO_DEVICE:             /* writeback only */
                dmac_clean_range(start, end);
+               outer_clean_range(__pa(start), __pa(end));
                break;
        case DMA_BIDIRECTIONAL:         /* writeback and invalidate */
                dmac_flush_range(start, end);
+               outer_flush_range(__pa(start), __pa(end));
                break;
        default:
                BUG();
index 79e8002024240238aa86ff5086ad165b0bb91aa5..9da43a0fdcdffc5ff09b4e8fd1bdf6d95ac0452b 100644 (file)
@@ -19,7 +19,8 @@ unsigned int cpu_last_asid = { 1 << ASID_BITS };
 /*
  * We fork()ed a process, and we need a new context for the child
  * to run in.  We reserve version 0 for initial tasks so we will
- * always allocate an ASID.
+ * always allocate an ASID. The ASID 0 is reserved for the TTBR
+ * register changing sequence.
  */
 void __init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 {
@@ -38,8 +39,15 @@ void __new_context(struct mm_struct *mm)
         * If we've used up all our ASIDs, we need
         * to start a new version and flush the TLB.
         */
-       if ((asid & ~ASID_MASK) == 0)
+       if ((asid & ~ASID_MASK) == 0) {
+               asid = ++cpu_last_asid;
+               /* set the reserved ASID before flushing the TLB */
+               asm("mcr        p15, 0, %0, c13, c0, 1  @ set reserved context ID\n"
+                   :
+                   : "r" (0));
+               isb();
                flush_tlb_all();
+       }
 
        mm->context.id = asid;
 }
index cf95c5d0ce4cdb60f4ea317f07cde2c8de0764ba..44558d5f9313c0e22d476bc07cd995c466666e66 100644 (file)
@@ -119,8 +119,6 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigne
                flush_cache_page(vma, addr, pfn);
 }
 
-void __flush_dcache_page(struct address_space *mapping, struct page *page);
-
 /*
  * Take care of architecture specific things when placing a new PTE into
  * a page table, or changing an existing PTE.  Basically, there are two
index 655c8376f0b57b73ee48dca75ce0197e619605ac..94fd4bf5cb9e4f31dcd0c41f68b31dfce332b15a 100644 (file)
@@ -49,8 +49,10 @@ pmd_t *top_pmd;
 
 static unsigned int cachepolicy __initdata = CPOLICY_WRITEBACK;
 static unsigned int ecc_mask __initdata = 0;
+pgprot_t pgprot_user;
 pgprot_t pgprot_kernel;
 
+EXPORT_SYMBOL(pgprot_user);
 EXPORT_SYMBOL(pgprot_kernel);
 
 struct cachepolicy {
@@ -345,6 +347,7 @@ static void __init build_mem_type_table(void)
                mem_types[MT_MINICLEAN].prot_sect &= ~PMD_SECT_TEX(1);
        }
 
+       pgprot_user   = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot);
        pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
                                 L_PTE_DIRTY | L_PTE_WRITE |
                                 L_PTE_EXEC | kern_pgprot);
index 7b1843befb9c2deb693947e5cac5e1f5f8823d57..eb42e5b948630d106372b6296d71bdf02e7943d6 100644 (file)
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/elf.h>
-#include <asm/hardware/arm_scu.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/pgtable.h>
 
+#ifdef CONFIG_SMP
+#include <asm/hardware/arm_scu.h>
+#endif
+
 #include "proc-macros.S"
 
 #define D_CACHE_LINE_SIZE      32
 #define TTB_RGN_WT     (2 << 3)
 #define TTB_RGN_WB     (3 << 3)
 
+#ifndef CONFIG_SMP
+#define TTB_FLAGS      TTB_RGN_WBWA
+#else
+#define TTB_FLAGS      TTB_RGN_WBWA|TTB_S
+#endif
+
 ENTRY(cpu_v6_proc_init)
        mov     pc, lr
 
@@ -92,9 +101,7 @@ ENTRY(cpu_v6_switch_mm)
 #ifdef CONFIG_MMU
        mov     r2, #0
        ldr     r1, [r1, #MM_CONTEXT_ID]        @ get mm->context.id
-#ifdef CONFIG_SMP
-       orr     r0, r0, #TTB_RGN_WBWA|TTB_S     @ mark PTWs shared, outer cacheable
-#endif
+       orr     r0, r0, #TTB_FLAGS
        mcr     p15, 0, r2, c7, c5, 6           @ flush BTAC/BTB
        mcr     p15, 0, r2, c7, c10, 4          @ drain write buffer
        mcr     p15, 0, r0, c2, c0, 0           @ set TTB 0
@@ -183,8 +190,7 @@ __v6_setup:
        /* Set up the SCU on core 0 only */
        mrc     p15, 0, r0, c0, c0, 5           @ CPU core number
        ands    r0, r0, #15
-       moveq   r0, #0x10000000 @ SCU_BASE
-       orreq   r0, r0, #0x00100000
+       ldreq   r0, =SCU_BASE
        ldreq   r5, [r0, #SCU_CTRL]
        orreq   r5, r5, #1
        streq   r5, [r0, #SCU_CTRL]
@@ -204,9 +210,7 @@ __v6_setup:
 #ifdef CONFIG_MMU
        mcr     p15, 0, r0, c8, c7, 0           @ invalidate I + D TLBs
        mcr     p15, 0, r0, c2, c0, 2           @ TTB control register
-#ifdef CONFIG_SMP
-       orr     r4, r4, #TTB_RGN_WBWA|TTB_S     @ mark PTWs shared, outer cacheable
-#endif
+       orr     r4, r4, #TTB_FLAGS
        mcr     p15, 0, r4, c2, c0, 1           @ load TTB1
 #endif /* CONFIG_MMU */
        adr     r5, v6_crval
index 94a58455f346cca45fd759af3cb899b03594efd0..d95921a2ab99b81cc0c17cdab5cc433df6b9a9cc 100644 (file)
@@ -5,23 +5,23 @@
  * Current Maintainer: Lennert Buytenhek <buytenh@wantstofly.org>
  *
  * Copyright 2004 (C) Intel Corp.
- * Copyright 2005 (c) MontaVista Software, Inc.
+ * Copyright 2005 (C) MontaVista Software, Inc.
  *
  * 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.
  *
- * MMU functions for the Intel XScale3 Core (XSC3).  The XSC3 core is an
- * extension to Intel's original XScale core that adds the following
+ * MMU functions for the Intel XScale3 Core (XSC3).  The XSC3 core is
+ * an extension to Intel's original XScale core that adds the following
  * features:
  *
  * - ARMv6 Supersections
  * - Low Locality Reference pages (replaces mini-cache)
  * - 36-bit addressing
  * - L2 cache
- * - Cache-coherency if chipset supports it
+ * - Cache coherency if chipset supports it
  *
- * Based on orignal XScale code by Nicolas Pitre
+ * Based on original XScale code by Nicolas Pitre.
  */
 
 #include <linux/linkage.h>
 #define MAX_AREA_SIZE  32768
 
 /*
- * The cache line size of the I and D cache.
+ * The cache line size of the L1 I, L1 D and unified L2 cache.
  */
 #define CACHELINESIZE  32
 
 /*
- * The size of the data cache.
+ * The size of the L1 D cache.
  */
 #define CACHESIZE      32768
 
@@ -57,9 +57,9 @@
 #define L2_CACHE_ENABLE        1
 
 /*
- * This macro is used to wait for a CP15 write and is needed
- * when we have to ensure that the last operation to the co-pro
- * was completed before continuing with operation.
+ * This macro is used to wait for a CP15 write and is needed when we
+ * have to ensure that the last operation to the coprocessor was
+ * completed before continuing with operation.
  */
        .macro  cpwait_ret, lr, rd
        mrc     p15, 0, \rd, c2, c0, 0          @ arbitrary read of cp15
        .endm
 
 /*
- * This macro cleans & invalidates the entire xsc3 dcache by set & way.
+ * This macro cleans and invalidates the entire L1 D cache.
  */
 
        .macro  clean_d_cache rd, rs
        mov     \rd, #0x1f00
        orr     \rd, \rd, #0x00e0
-1:     mcr     p15, 0, \rd, c7, c14, 2         @ clean/inv set/way
+1:     mcr     p15, 0, \rd, c7, c14, 2         @ clean/invalidate L1 D line
        adds    \rd, \rd, #0x40000000
        bcc     1b
        subs    \rd, \rd, #0x20
@@ -119,15 +119,15 @@ ENTRY(cpu_xsc3_reset)
        mov     r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
        msr     cpsr_c, r1                      @ reset CPSR
        mrc     p15, 0, r1, c1, c0, 0           @ ctrl register
-       bic     r1, r1, #0x0086                 @ ........B....CA.
        bic     r1, r1, #0x3900                 @ ..VIZ..S........
+       bic     r1, r1, #0x0086                 @ ........B....CA.
        mcr     p15, 0, r1, c1, c0, 0           @ ctrl register
-       mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches & BTB
+       mcr     p15, 0, ip, c7, c7, 0           @ invalidate L1 caches and BTB
        bic     r1, r1, #0x0001                 @ ...............M
        mcr     p15, 0, r1, c1, c0, 0           @ ctrl register
        @ CAUTION: MMU turned off from this point.  We count on the pipeline
        @ already containing those two last instructions to survive.
-       mcr     p15, 0, ip, c8, c7, 0           @ invalidate I & D TLBs
+       mcr     p15, 0, ip, c8, c7, 0           @ invalidate I and D TLBs
        mov     pc, r0
 
 /*
@@ -139,14 +139,12 @@ ENTRY(cpu_xsc3_reset)
  *
  * XScale supports clock switching, but using idle mode support
  * allows external hardware to react to system state changes.
-
- MMG: Come back to this one.
  */
        .align  5
 
 ENTRY(cpu_xsc3_do_idle)
        mov     r0, #1
-       mcr     p14, 0, r0, c7, c0, 0           @ Go to IDLE
+       mcr     p14, 0, r0, c7, c0, 0           @ go to idle
        mov     pc, lr
 
 /* ================================= CACHE ================================ */
@@ -171,9 +169,9 @@ ENTRY(xsc3_flush_kern_cache_all)
 __flush_whole_cache:
        clean_d_cache r0, r1
        tst     r2, #VM_EXEC
-       mcrne   p15, 0, ip, c7, c5, 0           @ Invalidate I cache & BTB
-       mcrne   p15, 0, ip, c7, c10, 4          @ Drain Write Buffer
-       mcrne   p15, 0, ip, c7, c5, 4           @ Prefetch Flush
+       mcrne   p15, 0, ip, c7, c5, 0           @ invalidate L1 I cache and BTB
+       mcrne   p15, 0, ip, c7, c10, 4          @ data write barrier
+       mcrne   p15, 0, ip, c7, c5, 4           @ prefetch flush
        mov     pc, lr
 
 /*
@@ -194,21 +192,21 @@ ENTRY(xsc3_flush_user_cache_range)
        bhs     __flush_whole_cache
 
 1:     tst     r2, #VM_EXEC
-       mcrne   p15, 0, r0, c7, c5, 1           @ Invalidate I cache line
-       mcr     p15, 0, r0, c7, c14, 1          @ Clean/invalidate D cache line
+       mcrne   p15, 0, r0, c7, c5, 1           @ invalidate L1 I line
+       mcr     p15, 0, r0, c7, c14, 1          @ clean/invalidate L1 D line
        add     r0, r0, #CACHELINESIZE
        cmp     r0, r1
        blo     1b
        tst     r2, #VM_EXEC
-       mcrne   p15, 0, ip, c7, c5, 6           @ Invalidate BTB
-       mcrne   p15, 0, ip, c7, c10, 4          @ Drain Write Buffer
-       mcrne   p15, 0, ip, c7, c5, 4           @ Prefetch Flush
+       mcrne   p15, 0, ip, c7, c5, 6           @ invalidate BTB
+       mcrne   p15, 0, ip, c7, c10, 4          @ data write barrier
+       mcrne   p15, 0, ip, c7, c5, 4           @ prefetch flush
        mov     pc, lr
 
 /*
  *     coherent_kern_range(start, end)
  *
- *     Ensure coherency between the Icache and the Dcache in the
+ *     Ensure coherency between the I cache and the D cache in the
  *     region described by start.  If you have non-snooping
  *     Harvard caches, you need to implement this function.
  *
@@ -222,34 +220,34 @@ ENTRY(xsc3_coherent_kern_range)
 /* FALLTHROUGH */
 ENTRY(xsc3_coherent_user_range)
        bic     r0, r0, #CACHELINESIZE - 1
-1:     mcr     p15, 0, r0, c7, c10, 1          @ clean D entry
+1:     mcr     p15, 0, r0, c7, c10, 1          @ clean L1 D line
        add     r0, r0, #CACHELINESIZE
        cmp     r0, r1
        blo     1b
        mov     r0, #0
-       mcr     p15, 0, r0, c7, c5, 0           @ Invalidate I cache & BTB
-       mcr     p15, 0, r0, c7, c10, 4          @ Drain Write Buffer
-       mcr     p15, 0, r0, c7, c5, 4           @ Prefetch Flush
+       mcr     p15, 0, r0, c7, c5, 0           @ invalidate L1 I cache and BTB
+       mcr     p15, 0, r0, c7, c10, 4          @ data write barrier
+       mcr     p15, 0, r0, c7, c5, 4           @ prefetch flush
        mov     pc, lr
 
 /*
  *     flush_kern_dcache_page(void *page)
  *
  *     Ensure no D cache aliasing occurs, either with itself or
- *     the I cache
+ *     the I cache.
  *
  *     - addr  - page aligned address
  */
 ENTRY(xsc3_flush_kern_dcache_page)
        add     r1, r0, #PAGE_SZ
-1:     mcr     p15, 0, r0, c7, c14, 1          @ Clean/Invalidate D Cache line
+1:     mcr     p15, 0, r0, c7, c14, 1          @ clean/invalidate L1 D line
        add     r0, r0, #CACHELINESIZE
        cmp     r0, r1
        blo     1b
        mov     r0, #0
-       mcr     p15, 0, r0, c7, c5, 0           @ Invalidate I cache & BTB
-       mcr     p15, 0, r0, c7, c10, 4          @ Drain Write Buffer
-       mcr     p15, 0, r0, c7, c5, 4           @ Prefetch Flush
+       mcr     p15, 0, r0, c7, c5, 0           @ invalidate L1 I cache and BTB
+       mcr     p15, 0, r0, c7, c10, 4          @ data write barrier
+       mcr     p15, 0, r0, c7, c5, 4           @ prefetch flush
        mov     pc, lr
 
 /*
@@ -266,17 +264,17 @@ ENTRY(xsc3_flush_kern_dcache_page)
 ENTRY(xsc3_dma_inv_range)
        tst     r0, #CACHELINESIZE - 1
        bic     r0, r0, #CACHELINESIZE - 1
-       mcrne   p15, 0, r0, c7, c10, 1          @ clean L1 D entry
-       mcrne   p15, 1, r0, c7, c11, 1          @ clean L2 D entry
+       mcrne   p15, 0, r0, c7, c10, 1          @ clean L1 D line
+       mcrne   p15, 1, r0, c7, c11, 1          @ clean L2 line
        tst     r1, #CACHELINESIZE - 1
-       mcrne   p15, 0, r1, c7, c10, 1          @ clean L1 D entry
-       mcrne   p15, 1, r1, c7, c11, 1          @ clean L2 D entry
-1:     mcr     p15, 0, r0, c7, c6, 1           @ invalidate L1 D entry
-       mcr     p15, 1, r0, c7, c7, 1           @ Invalidate L2 D cache line
+       mcrne   p15, 0, r1, c7, c10, 1          @ clean L1 D line
+       mcrne   p15, 1, r1, c7, c11, 1          @ clean L2 line
+1:     mcr     p15, 0, r0, c7, c6, 1           @ invalidate L1 D line
+       mcr     p15, 1, r0, c7, c7, 1           @ invalidate L2 line
        add     r0, r0, #CACHELINESIZE
        cmp     r0, r1
        blo     1b
-       mcr     p15, 0, r0, c7, c10, 4          @ Drain Write Buffer
+       mcr     p15, 0, r0, c7, c10, 4          @ data write barrier
        mov     pc, lr
 
 /*
@@ -289,12 +287,12 @@ ENTRY(xsc3_dma_inv_range)
  */
 ENTRY(xsc3_dma_clean_range)
        bic     r0, r0, #CACHELINESIZE - 1
-1:     mcr     p15, 0, r0, c7, c10, 1          @ clean L1 D entry
-       mcr     p15, 1, r0, c7, c11, 1          @ clean L2 D entry
+1:     mcr     p15, 0, r0, c7, c10, 1          @ clean L1 D line
+       mcr     p15, 1, r0, c7, c11, 1          @ clean L2 line
        add     r0, r0, #CACHELINESIZE
        cmp     r0, r1
        blo     1b
-       mcr     p15, 0, r0, c7, c10, 4          @ Drain Write Buffer
+       mcr     p15, 0, r0, c7, c10, 4          @ data write barrier
        mov     pc, lr
 
 /*
@@ -307,13 +305,13 @@ ENTRY(xsc3_dma_clean_range)
  */
 ENTRY(xsc3_dma_flush_range)
        bic     r0, r0, #CACHELINESIZE - 1
-1:     mcr     p15, 0, r0, c7, c14, 1  @ Clean/invalidate L1 D cache line
-       mcr     p15, 1, r0, c7, c11, 1  @ Clean L2 D cache line
-       mcr     p15, 1, r0, c7, c7, 1   @ Invalidate L2 D cache line
+1:     mcr     p15, 0, r0, c7, c14, 1          @ clean/invalidate L1 D line
+       mcr     p15, 1, r0, c7, c11, 1          @ clean L2 line
+       mcr     p15, 1, r0, c7, c7, 1           @ invalidate L2 line
        add     r0, r0, #CACHELINESIZE
        cmp     r0, r1
        blo     1b
-       mcr     p15, 0, r0, c7, c10, 4          @ Drain Write Buffer
+       mcr     p15, 0, r0, c7, c10, 4          @ data write barrier
        mov     pc, lr
 
 ENTRY(xsc3_cache_fns)
@@ -328,7 +326,7 @@ ENTRY(xsc3_cache_fns)
        .long   xsc3_dma_flush_range
 
 ENTRY(cpu_xsc3_dcache_clean_area)
-1:     mcr     p15, 0, r0, c7, c10, 1          @ clean D entry
+1:     mcr     p15, 0, r0, c7, c10, 1          @ clean L1 D line
        add     r0, r0, #CACHELINESIZE
        subs    r1, r1, #CACHELINESIZE
        bhi     1b
@@ -346,14 +344,14 @@ ENTRY(cpu_xsc3_dcache_clean_area)
        .align  5
 ENTRY(cpu_xsc3_switch_mm)
        clean_d_cache r1, r2
-       mcr     p15, 0, ip, c7, c5, 0           @ Invalidate I cache & BTB
-       mcr     p15, 0, ip, c7, c10, 4          @ Drain Write Buffer
-       mcr     p15, 0, ip, c7, c5, 4           @ Prefetch Flush
+       mcr     p15, 0, ip, c7, c5, 0           @ invalidate L1 I cache and BTB
+       mcr     p15, 0, ip, c7, c10, 4          @ data write barrier
+       mcr     p15, 0, ip, c7, c5, 4           @ prefetch flush
 #ifdef L2_CACHE_ENABLE
        orr     r0, r0, #0x18                   @ cache the page table in L2
 #endif
        mcr     p15, 0, r0, c2, c0, 0           @ load page table pointer
-       mcr     p15, 0, ip, c8, c7, 0           @ invalidate I & D TLBs
+       mcr     p15, 0, ip, c8, c7, 0           @ invalidate I and D TLBs
        cpwait_ret lr, ip
 
 /*
@@ -366,34 +364,34 @@ ENTRY(cpu_xsc3_switch_mm)
 ENTRY(cpu_xsc3_set_pte_ext)
        str     r1, [r0], #-2048                @ linux version
 
-       bic     r2, r1, #0xff0                  @ Keep C, B bits
+       bic     r2, r1, #0xff0                  @ keep C, B bits
        orr     r2, r2, #PTE_TYPE_EXT           @ extended page
-       tst     r1, #L_PTE_SHARED               @ Shared?
+       tst     r1, #L_PTE_SHARED               @ shared?
        orrne   r2, r2, #0x200
 
        eor     r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
 
-       tst     r3, #L_PTE_USER                 @ User?
+       tst     r3, #L_PTE_USER                 @ user?
        orrne   r2, r2, #PTE_EXT_AP_URO_SRW     @ yes -> user r/o, system r/w
 
-       tst     r3, #L_PTE_WRITE | L_PTE_DIRTY  @ Write and Dirty?
+       tst     r3, #L_PTE_WRITE | L_PTE_DIRTY  @ write and dirty?
        orreq   r2, r2, #PTE_EXT_AP_UNO_SRW     @ yes -> user n/a, system r/w
                                                @ combined with user -> user r/w
 
 #if L2_CACHE_ENABLE
-       @ If its cacheable it needs to be in L2 also.
+       @ If it's cacheable, it needs to be in L2 also.
        eor     ip, r1, #L_PTE_CACHEABLE
        tst     ip, #L_PTE_CACHEABLE
        orreq   r2, r2, #PTE_EXT_TEX(0x5)
 #endif
 
-       tst     r3, #L_PTE_PRESENT | L_PTE_YOUNG        @ Present and Young?
+       tst     r3, #L_PTE_PRESENT | L_PTE_YOUNG        @ present and young?
        movne   r2, #0                          @ no -> fault
 
        str     r2, [r0]                        @ hardware version
        mov     ip, #0
-       mcr     p15, 0, r0, c7, c10, 1          @ Clean D cache line mcr
-       mcr     p15, 0, ip, c7, c10, 4          @ Drain Write Buffer
+       mcr     p15, 0, r0, c7, c10, 1          @ clean L1 D line
+       mcr     p15, 0, ip, c7, c10, 4          @ data write barrier
        mov     pc, lr
 
        .ltorg
@@ -406,17 +404,18 @@ ENTRY(cpu_xsc3_set_pte_ext)
 __xsc3_setup:
        mov     r0, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
        msr     cpsr_c, r0
-       mcr     p15, 0, ip, c7, c7, 0           @ invalidate I, D caches & BTB
-       mcr     p15, 0, ip, c7, c10, 4          @ Drain Write Buffer
-       mcr     p15, 0, ip, c7, c5, 4           @ Prefetch Flush
-       mcr     p15, 0, ip, c8, c7, 0           @ invalidate I, D TLBs
+       mcr     p15, 0, ip, c7, c7, 0           @ invalidate L1 caches and BTB
+       mcr     p15, 0, ip, c7, c10, 4          @ data write barrier
+       mcr     p15, 0, ip, c7, c5, 4           @ prefetch flush
+       mcr     p15, 0, ip, c8, c7, 0           @ invalidate I and D TLBs
 #if L2_CACHE_ENABLE
        orr     r4, r4, #0x18                   @ cache the page table in L2
 #endif
        mcr     p15, 0, r4, c2, c0, 0           @ load page table pointer
-       mov     r0, #1                          @ Allow access to CP0 and CP13
-       orr     r0, r0, #1 << 13                @ Its undefined whether this
-       mcr     p15, 0, r0, c15, c1, 0          @ affects USR or SVC modes
+
+       mov     r0, #0                          @ don't allow CP access
+       mcr     p15, 0, r0, c15, c1, 0          @ write CP access register
+
        mrc     p15, 0, r0, c1, c0, 1           @ get auxiliary control reg
        and     r0, r0, #2                      @ preserve bit P bit setting
 #if L2_CACHE_ENABLE
@@ -427,9 +426,9 @@ __xsc3_setup:
        adr     r5, xsc3_crval
        ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0, 0           @ get control register
-       bic     r0, r0, r5                      @ .... .... .... ..A.
-       orr     r0, r0, r6                      @ .... .... .... .C.M
-       orr     r0, r0, #0x00000800             @ ..VI Z..S .... ....
+       bic     r0, r0, r5                      @ ..V. ..R. .... ..A.
+       orr     r0, r0, r6                      @ ..VI Z..S .... .C.M (mmu)
+                                               @ ...I Z..S .... .... (uc)
 #if L2_CACHE_ENABLE
        orr     r0, r0, #0x04000000             @ L2 enable
 #endif
@@ -439,7 +438,7 @@ __xsc3_setup:
 
        .type   xsc3_crval, #object
 xsc3_crval:
-       crval   clear=0x04003b02, mmuset=0x00003105, ucset=0x00001100
+       crval   clear=0x04002202, mmuset=0x00003905, ucset=0x00001900
 
        __INITDATA
 
@@ -474,7 +473,7 @@ cpu_elf_name:
 
        .type   cpu_xsc3_name, #object
 cpu_xsc3_name:
-       .asciz  "XScale-Core3"
+       .asciz  "XScale-V3 based processor"
        .size   cpu_xsc3_name, . - cpu_xsc3_name
 
        .align
@@ -490,7 +489,7 @@ __xsc3_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
-       .long   PMD_TYPE_SECT | \
+       .long   PMD_TYPE_SECT | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
        b       __xsc3_setup
index fd6adde39091ef28cadf0d4fa273d8376fbbe707..20f84bbaa9bbc7c1f5cfe1fbadf532c8f10947d1 100644 (file)
@@ -53,6 +53,8 @@ ENTRY(v6wbi_flush_user_tlb_range)
        add     r0, r0, #PAGE_SZ
        cmp     r0, r1
        blo     1b
+       mcr     p15, 0, ip, c7, c5, 6           @ flush BTAC/BTB
+       mcr     p15, 0, ip, c7, c10, 4          @ data synchronization barrier
        mov     pc, lr
 
 /*
@@ -80,7 +82,9 @@ ENTRY(v6wbi_flush_kern_tlb_range)
        add     r0, r0, #PAGE_SZ
        cmp     r0, r1
        blo     1b
+       mcr     p15, 0, r2, c7, c5, 6           @ flush BTAC/BTB
        mcr     p15, 0, r2, c7, c10, 4          @ data synchronization barrier
+       mcr     p15, 0, r2, c7, c5, 4           @ prefetch flush
        mov     pc, lr
 
        .section ".text.init", #alloc, #execinstr
index 19d37730b664a03cc441886740dc517fd7349c2c..afd93ad02febb9c07262b49648d8438a53db0c27 100644 (file)
@@ -19,5 +19,24 @@ config OPROFILE
 
          If unsure, say N.
 
+if OPROFILE
+
+config OPROFILE_ARMV6
+       bool
+       depends on CPU_V6 && !SMP
+       default y
+       select OPROFILE_ARM11_CORE
+
+config OPROFILE_MPCORE
+       bool
+       depends on CPU_V6 && SMP
+       default y
+       select OPROFILE_ARM11_CORE
+
+config OPROFILE_ARM11_CORE
+       bool
+
+endif
+
 endmenu
 
index 6a94e54848fd7a965294c1be8fc72e350878aaee..e61d0cc520b76a72419a17244d4a970579bac210 100644 (file)
@@ -8,4 +8,6 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
 
 oprofile-y                             := $(DRIVER_OBJS) common.o backtrace.o
 oprofile-$(CONFIG_CPU_XSCALE)          += op_model_xscale.o
-
+oprofile-$(CONFIG_OPROFILE_ARM11_CORE) += op_model_arm11_core.o
+oprofile-$(CONFIG_OPROFILE_ARMV6)      += op_model_v6.o
+oprofile-$(CONFIG_OPROFILE_MPCORE)     += op_model_mpcore.o
index 6f833358cd0612c4c13e5d59619e86ccee2749e5..0a007b931f6368f8dcb8eb3dc4b47d4c5ae17b6d 100644 (file)
@@ -135,6 +135,14 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
        spec = &op_xscale_spec;
 #endif
 
+#ifdef CONFIG_OPROFILE_ARMV6
+       spec = &op_armv6_spec;
+#endif
+
+#ifdef CONFIG_OPROFILE_MPCORE
+       spec = &op_mpcore_spec;
+#endif
+
        if (spec) {
                ret = spec->init();
                if (ret < 0)
index 38c6ad158547e2e615620888c59848be57784f46..4899c629aa03473fe4a7d7fe1ad67b77b15ce9d2 100644 (file)
@@ -24,6 +24,9 @@ struct op_arm_model_spec {
 extern struct op_arm_model_spec op_xscale_spec;
 #endif
 
+extern struct op_arm_model_spec op_armv6_spec;
+extern struct op_arm_model_spec op_mpcore_spec;
+
 extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth);
 
 extern int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec);
diff --git a/arch/arm/oprofile/op_model_arm11_core.c b/arch/arm/oprofile/op_model_arm11_core.c
new file mode 100644 (file)
index 0000000..ad80752
--- /dev/null
@@ -0,0 +1,162 @@
+/**
+ * @file op_model_arm11_core.c
+ * ARM11 Event Monitor Driver
+ * @remark Copyright 2004 ARM SMP Development Team
+ */
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/oprofile.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/smp.h>
+
+#include "op_counter.h"
+#include "op_arm_model.h"
+#include "op_model_arm11_core.h"
+
+/*
+ * ARM11 PMU support
+ */
+static inline void arm11_write_pmnc(u32 val)
+{
+       /* upper 4bits and 7, 11 are write-as-0 */
+       val &= 0x0ffff77f;
+       asm volatile("mcr p15, 0, %0, c15, c12, 0" : : "r" (val));
+}
+
+static inline u32 arm11_read_pmnc(void)
+{
+       u32 val;
+       asm volatile("mrc p15, 0, %0, c15, c12, 0" : "=r" (val));
+       return val;
+}
+
+static void arm11_reset_counter(unsigned int cnt)
+{
+       u32 val = -(u32)counter_config[CPU_COUNTER(smp_processor_id(), cnt)].count;
+       switch (cnt) {
+       case CCNT:
+               asm volatile("mcr p15, 0, %0, c15, c12, 1" : : "r" (val));
+               break;
+
+       case PMN0:
+               asm volatile("mcr p15, 0, %0, c15, c12, 2" : : "r" (val));
+               break;
+
+       case PMN1:
+               asm volatile("mcr p15, 0, %0, c15, c12, 3" : : "r" (val));
+               break;
+       }
+}
+
+int arm11_setup_pmu(void)
+{
+       unsigned int cnt;
+       u32 pmnc;
+
+       if (arm11_read_pmnc() & PMCR_E) {
+               printk(KERN_ERR "oprofile: CPU%u PMU still enabled when setup new event counter.\n", smp_processor_id());
+               return -EBUSY;
+       }
+
+       /* initialize PMNC, reset overflow, D bit, C bit and P bit. */
+       arm11_write_pmnc(PMCR_OFL_PMN0 | PMCR_OFL_PMN1 | PMCR_OFL_CCNT |
+                        PMCR_C | PMCR_P);
+
+       for (pmnc = 0, cnt = PMN0; cnt <= CCNT; cnt++) {
+               unsigned long event;
+
+               if (!counter_config[CPU_COUNTER(smp_processor_id(), cnt)].enabled)
+                       continue;
+
+               event = counter_config[CPU_COUNTER(smp_processor_id(), cnt)].event & 255;
+
+               /*
+                * Set event (if destined for PMNx counters)
+                */
+               if (cnt == PMN0) {
+                       pmnc |= event << 20;
+               } else if (cnt == PMN1) {
+                       pmnc |= event << 12;
+               }
+
+               /*
+                * We don't need to set the event if it's a cycle count
+                * Enable interrupt for this counter
+                */
+               pmnc |= PMCR_IEN_PMN0 << cnt;
+               arm11_reset_counter(cnt);
+       }
+       arm11_write_pmnc(pmnc);
+
+       return 0;
+}
+
+int arm11_start_pmu(void)
+{
+       arm11_write_pmnc(arm11_read_pmnc() | PMCR_E);
+       return 0;
+}
+
+int arm11_stop_pmu(void)
+{
+       unsigned int cnt;
+
+       arm11_write_pmnc(arm11_read_pmnc() & ~PMCR_E);
+
+       for (cnt = PMN0; cnt <= CCNT; cnt++)
+               arm11_reset_counter(cnt);
+
+       return 0;
+}
+
+/*
+ * CPU counters' IRQ handler (one IRQ per CPU)
+ */
+static irqreturn_t arm11_pmu_interrupt(int irq, void *arg)
+{
+       struct pt_regs *regs = get_irq_regs();
+       unsigned int cnt;
+       u32 pmnc;
+
+       pmnc = arm11_read_pmnc();
+
+       for (cnt = PMN0; cnt <= CCNT; cnt++) {
+               if ((pmnc & (PMCR_OFL_PMN0 << cnt)) && (pmnc & (PMCR_IEN_PMN0 << cnt))) {
+                       arm11_reset_counter(cnt);
+                       oprofile_add_sample(regs, CPU_COUNTER(smp_processor_id(), cnt));
+               }
+       }
+       /* Clear counter flag(s) */
+       arm11_write_pmnc(pmnc);
+       return IRQ_HANDLED;
+}
+
+int arm11_request_interrupts(int *irqs, int nr)
+{
+       unsigned int i;
+       int ret = 0;
+
+       for(i = 0; i < nr; i++) {
+               ret = request_irq(irqs[i], arm11_pmu_interrupt, IRQF_DISABLED, "CP15 PMU", NULL);
+               if (ret != 0) {
+                       printk(KERN_ERR "oprofile: unable to request IRQ%u for MPCORE-EM\n",
+                              irqs[i]);
+                       break;
+               }
+       }
+
+       if (i != nr)
+               while (i-- != 0)
+                       free_irq(irqs[i], NULL);
+
+       return ret;
+}
+
+void arm11_release_interrupts(int *irqs, int nr)
+{
+       unsigned int i;
+
+       for (i = 0; i < nr; i++)
+               free_irq(irqs[i], NULL);
+}
diff --git a/arch/arm/oprofile/op_model_arm11_core.h b/arch/arm/oprofile/op_model_arm11_core.h
new file mode 100644 (file)
index 0000000..6f8538e
--- /dev/null
@@ -0,0 +1,45 @@
+/**
+ * @file op_model_arm11_core.h
+ * ARM11 Event Monitor Driver
+ * @remark Copyright 2004 ARM SMP Development Team
+ * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com>
+ * @remark Copyright 2000-2004 MontaVista Software Inc
+ * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com>
+ * @remark Copyright 2004 Intel Corporation
+ * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk>
+ * @remark Copyright 2004 Oprofile Authors
+ *
+ * @remark Read the file COPYING
+ *
+ * @author Zwane Mwaikambo
+ */
+#ifndef OP_MODEL_ARM11_CORE_H
+#define OP_MODEL_ARM11_CORE_H
+
+/*
+ * Per-CPU PMCR
+ */
+#define PMCR_E         (1 << 0)        /* Enable */
+#define PMCR_P         (1 << 1)        /* Count reset */
+#define PMCR_C         (1 << 2)        /* Cycle counter reset */
+#define PMCR_D         (1 << 3)        /* Cycle counter counts every 64th cpu cycle */
+#define PMCR_IEN_PMN0  (1 << 4)        /* Interrupt enable count reg 0 */
+#define PMCR_IEN_PMN1  (1 << 5)        /* Interrupt enable count reg 1 */
+#define PMCR_IEN_CCNT  (1 << 6)        /* Interrupt enable cycle counter */
+#define PMCR_OFL_PMN0  (1 << 8)        /* Count reg 0 overflow */
+#define PMCR_OFL_PMN1  (1 << 9)        /* Count reg 1 overflow */
+#define PMCR_OFL_CCNT  (1 << 10)       /* Cycle counter overflow */
+
+#define PMN0 0
+#define PMN1 1
+#define CCNT 2
+
+#define CPU_COUNTER(cpu, counter)      ((cpu) * 3 + (counter))
+
+int arm11_setup_pmu(void);
+int arm11_start_pmu(void);
+int arm11_stop_pmu(void);
+int arm11_request_interrupts(int *, int);
+void arm11_release_interrupts(int *, int);
+
+#endif
diff --git a/arch/arm/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c
new file mode 100644 (file)
index 0000000..8985007
--- /dev/null
@@ -0,0 +1,296 @@
+/**
+ * @file op_model_mpcore.c
+ * MPCORE Event Monitor Driver
+ * @remark Copyright 2004 ARM SMP Development Team
+ * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com>
+ * @remark Copyright 2000-2004 MontaVista Software Inc
+ * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com>
+ * @remark Copyright 2004 Intel Corporation
+ * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk>
+ * @remark Copyright 2004 Oprofile Authors
+ *
+ * @remark Read the file COPYING
+ *
+ * @author Zwane Mwaikambo
+ *
+ *  Counters:
+ *    0: PMN0 on CPU0, per-cpu configurable event counter
+ *    1: PMN1 on CPU0, per-cpu configurable event counter
+ *    2: CCNT on CPU0
+ *    3: PMN0 on CPU1
+ *    4: PMN1 on CPU1
+ *    5: CCNT on CPU1
+ *    6: PMN0 on CPU1
+ *    7: PMN1 on CPU1
+ *    8: CCNT on CPU1
+ *    9: PMN0 on CPU1
+ *   10: PMN1 on CPU1
+ *   11: CCNT on CPU1
+ *   12-19: configurable SCU event counters
+ */
+
+/* #define DEBUG */
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/oprofile.h>
+#include <linux/interrupt.h>
+#include <linux/smp.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach/irq.h>
+#include <asm/hardware.h>
+#include <asm/system.h>
+
+#include "op_counter.h"
+#include "op_arm_model.h"
+#include "op_model_arm11_core.h"
+#include "op_model_mpcore.h"
+
+/*
+ * MPCore SCU event monitor support
+ */
+#define SCU_EVENTMONITORS_VA_BASE __io_address(REALVIEW_MPCORE_SCU_BASE + 0x10)
+
+/*
+ * Bitmask of used SCU counters
+ */
+static unsigned int scu_em_used;
+
+/*
+ * 2 helper fns take a counter number from 0-7 (not the userspace-visible counter number)
+ */
+static inline void scu_reset_counter(struct eventmonitor __iomem *emc, unsigned int n)
+{
+       writel(-(u32)counter_config[SCU_COUNTER(n)].count, &emc->MC[n]);
+}
+
+static inline void scu_set_event(struct eventmonitor __iomem *emc, unsigned int n, u32 event)
+{
+       event &= 0xff;
+       writeb(event, &emc->MCEB[n]);
+}
+
+/*
+ * SCU counters' IRQ handler (one IRQ per counter => 2 IRQs per CPU)
+ */
+static irqreturn_t scu_em_interrupt(int irq, void *arg)
+{
+       struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE;
+       unsigned int cnt;
+
+       cnt = irq - IRQ_PMU_SCU0;
+       oprofile_add_sample(get_irq_regs(), SCU_COUNTER(cnt));
+       scu_reset_counter(emc, cnt);
+
+       /* Clear overflow flag for this counter */
+       writel(1 << (cnt + 16), &emc->PMCR);
+
+       return IRQ_HANDLED;
+}
+
+/* Configure just the SCU counters that the user has requested */
+static void scu_setup(void)
+{
+       struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE;
+       unsigned int i;
+
+       scu_em_used = 0;
+
+       for (i = 0; i < NUM_SCU_COUNTERS; i++) {
+               if (counter_config[SCU_COUNTER(i)].enabled &&
+                   counter_config[SCU_COUNTER(i)].event) {
+                       scu_set_event(emc, i, 0); /* disable counter for now */
+                       scu_em_used |= 1 << i;
+               }
+       }
+}
+
+static int scu_start(void)
+{
+       struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE;
+       unsigned int temp, i;
+       unsigned long event;
+       int ret = 0;
+
+       /*
+        * request the SCU counter interrupts that we need
+        */
+       for (i = 0; i < NUM_SCU_COUNTERS; i++) {
+               if (scu_em_used & (1 << i)) {
+                       ret = request_irq(IRQ_PMU_SCU0 + i, scu_em_interrupt, IRQF_DISABLED, "SCU PMU", NULL);
+                       if (ret) {
+                               printk(KERN_ERR "oprofile: unable to request IRQ%u for SCU Event Monitor\n",
+                                      IRQ_PMU_SCU0 + i);
+                               goto err_free_scu;
+                       }
+               }
+       }
+
+       /*
+        * clear overflow and enable interrupt for all used counters
+        */
+       temp = readl(&emc->PMCR);
+       for (i = 0; i < NUM_SCU_COUNTERS; i++) {
+               if (scu_em_used & (1 << i)) {
+                       scu_reset_counter(emc, i);
+                       event = counter_config[SCU_COUNTER(i)].event;
+                       scu_set_event(emc, i, event);
+
+                       /* clear overflow/interrupt */
+                       temp |= 1 << (i + 16);
+                       /* enable interrupt*/
+                       temp |= 1 << (i + 8);
+               }
+       }
+
+       /* Enable all 8 counters */
+       temp |= PMCR_E;
+       writel(temp, &emc->PMCR);
+
+       return 0;
+
+ err_free_scu:
+       while (i--)
+               free_irq(IRQ_PMU_SCU0 + i, NULL);
+       return ret;
+}
+
+static void scu_stop(void)
+{
+       struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE;
+       unsigned int temp, i;
+
+       /* Disable counter interrupts */
+       /* Don't disable all 8 counters (with the E bit) as they may be in use */
+       temp = readl(&emc->PMCR);
+       for (i = 0; i < NUM_SCU_COUNTERS; i++) {
+               if (scu_em_used & (1 << i))
+                       temp &= ~(1 << (i + 8));
+       }
+       writel(temp, &emc->PMCR);
+
+       /* Free counter interrupts and reset counters */
+       for (i = 0; i < NUM_SCU_COUNTERS; i++) {
+               if (scu_em_used & (1 << i)) {
+                       scu_reset_counter(emc, i);
+                       free_irq(IRQ_PMU_SCU0 + i, NULL);
+               }
+       }
+}
+
+struct em_function_data {
+       int (*fn)(void);
+       int ret;
+};
+
+static void em_func(void *data)
+{
+       struct em_function_data *d = data;
+       int ret = d->fn();
+       if (ret)
+               d->ret = ret;
+}
+
+static int em_call_function(int (*fn)(void))
+{
+       struct em_function_data data;
+
+       data.fn = fn;
+       data.ret = 0;
+
+       smp_call_function(em_func, &data, 1, 1);
+       em_func(&data);
+
+       return data.ret;
+}
+
+/*
+ * Glue to stick the individual ARM11 PMUs and the SCU
+ * into the oprofile framework.
+ */
+static int em_setup_ctrs(void)
+{
+       int ret;
+
+       /* Configure CPU counters by cross-calling to the other CPUs */
+       ret = em_call_function(arm11_setup_pmu);
+       if (ret == 0)
+               scu_setup();
+
+       return 0;
+}
+
+static int arm11_irqs[] = {
+       [0]     = IRQ_PMU_CPU0,
+       [1]     = IRQ_PMU_CPU1,
+       [2]     = IRQ_PMU_CPU2,
+       [3]     = IRQ_PMU_CPU3
+};
+
+static int em_start(void)
+{
+       int ret;
+
+       ret = arm11_request_interrupts(arm11_irqs, ARRAY_SIZE(arm11_irqs));
+       if (ret == 0) {
+               em_call_function(arm11_start_pmu);
+
+               ret = scu_start();
+               if (ret)
+                       arm11_release_interrupts(arm11_irqs, ARRAY_SIZE(arm11_irqs));
+       }
+       return ret;
+}
+
+static void em_stop(void)
+{
+       em_call_function(arm11_stop_pmu);
+       arm11_release_interrupts(arm11_irqs, ARRAY_SIZE(arm11_irqs));
+       scu_stop();
+}
+
+/*
+ * Why isn't there a function to route an IRQ to a specific CPU in
+ * genirq?
+ */
+static void em_route_irq(int irq, unsigned int cpu)
+{
+       irq_desc[irq].affinity = cpumask_of_cpu(cpu);
+       irq_desc[irq].chip->set_affinity(irq, cpumask_of_cpu(cpu));
+}
+
+static int em_setup(void)
+{
+       /*
+        * Send SCU PMU interrupts to the "owner" CPU.
+        */
+       em_route_irq(IRQ_PMU_SCU0, 0);
+       em_route_irq(IRQ_PMU_SCU1, 0);
+       em_route_irq(IRQ_PMU_SCU2, 1);
+       em_route_irq(IRQ_PMU_SCU3, 1);
+       em_route_irq(IRQ_PMU_SCU4, 2);
+       em_route_irq(IRQ_PMU_SCU5, 2);
+       em_route_irq(IRQ_PMU_SCU6, 3);
+       em_route_irq(IRQ_PMU_SCU7, 3);
+
+       /*
+        * Send CP15 PMU interrupts to the owner CPU.
+        */
+       em_route_irq(IRQ_PMU_CPU0, 0);
+       em_route_irq(IRQ_PMU_CPU1, 1);
+       em_route_irq(IRQ_PMU_CPU2, 2);
+       em_route_irq(IRQ_PMU_CPU3, 3);
+
+       return 0;
+}
+
+struct op_arm_model_spec op_mpcore_spec = {
+       .init           = em_setup,
+       .num_counters   = MPCORE_NUM_COUNTERS,
+       .setup_ctrs     = em_setup_ctrs,
+       .start          = em_start,
+       .stop           = em_stop,
+       .name           = "arm/mpcore",
+};
diff --git a/arch/arm/oprofile/op_model_mpcore.h b/arch/arm/oprofile/op_model_mpcore.h
new file mode 100644 (file)
index 0000000..73d8110
--- /dev/null
@@ -0,0 +1,61 @@
+/**
+ * @file op_model_mpcore.c
+ * MPCORE Event Monitor Driver
+ * @remark Copyright 2004 ARM SMP Development Team
+ * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com>
+ * @remark Copyright 2000-2004 MontaVista Software Inc
+ * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com>
+ * @remark Copyright 2004 Intel Corporation
+ * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk>
+ * @remark Copyright 2004 Oprofile Authors
+ *
+ * @remark Read the file COPYING
+ *
+ * @author Zwane Mwaikambo
+ */
+#ifndef OP_MODEL_MPCORE_H
+#define OP_MODEL_MPCORE_H
+
+struct eventmonitor {
+       unsigned long PMCR;
+       unsigned char MCEB[8];
+       unsigned long MC[8];
+};
+
+/*
+ * List of userspace counter numbers: note that the structure is important.
+ * The code relies on CPUn's counters being CPU0's counters + 3n
+ * and on CPU0's counters starting at 0
+ */
+
+#define COUNTER_CPU0_PMN0 0
+#define COUNTER_CPU0_PMN1 1
+#define COUNTER_CPU0_CCNT 2
+
+#define COUNTER_CPU1_PMN0 3
+#define COUNTER_CPU1_PMN1 4
+#define COUNTER_CPU1_CCNT 5
+
+#define COUNTER_CPU2_PMN0 6
+#define COUNTER_CPU2_PMN1 7
+#define COUNTER_CPU2_CCNT 8
+
+#define COUNTER_CPU3_PMN0 9
+#define COUNTER_CPU3_PMN1 10
+#define COUNTER_CPU3_CCNT 11
+
+#define COUNTER_SCU_MN0 12
+#define COUNTER_SCU_MN1 13
+#define COUNTER_SCU_MN2 14
+#define COUNTER_SCU_MN3 15
+#define COUNTER_SCU_MN4 16
+#define COUNTER_SCU_MN5 17
+#define COUNTER_SCU_MN6 18
+#define COUNTER_SCU_MN7 19
+#define NUM_SCU_COUNTERS 8
+
+#define SCU_COUNTER(number)    ((number) + COUNTER_SCU_MN0)
+
+#define MPCORE_NUM_COUNTERS    SCU_COUNTER(NUM_SCU_COUNTERS)
+
+#endif
diff --git a/arch/arm/oprofile/op_model_v6.c b/arch/arm/oprofile/op_model_v6.c
new file mode 100644 (file)
index 0000000..fe58138
--- /dev/null
@@ -0,0 +1,67 @@
+/**
+ * @file op_model_v6.c
+ * ARM11 Performance Monitor Driver
+ *
+ * Based on op_model_xscale.c
+ *
+ * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com>
+ * @remark Copyright 2000-2004 MontaVista Software Inc
+ * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com>
+ * @remark Copyright 2004 Intel Corporation
+ * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk>
+ * @remark Copyright 2004 OProfile Authors
+ *
+ * @remark Read the file COPYING
+ *
+ * @author Tony Lindgren <tony@atomide.com>
+ */
+
+/* #define DEBUG */
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/oprofile.h>
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+
+#include "op_counter.h"
+#include "op_arm_model.h"
+#include "op_model_arm11_core.h"
+
+static int irqs[] = {
+#ifdef CONFIG_ARCH_OMAP2
+       3,
+#endif
+};
+
+static void armv6_pmu_stop(void)
+{
+       arm11_stop_pmu();
+       arm11_release_interrupts(irqs, ARRAY_SIZE(irqs));
+}
+
+static int armv6_pmu_start(void)
+{
+       int ret;
+
+       ret = arm11_request_interrupts(irqs, ARRAY_SIZE(irqs));
+       if (ret >= 0)
+               ret = arm11_start_pmu();
+
+       return ret;
+}
+
+static int armv6_detect_pmu(void)
+{
+       return 0;
+}
+
+struct op_arm_model_spec op_armv6_spec = {
+       .init           = armv6_detect_pmu,
+       .num_counters   = 3,
+       .setup_ctrs     = arm11_setup_pmu,
+       .start          = armv6_pmu_start,
+       .stop           = armv6_pmu_stop,
+       .name           = "arm/armv6",
+};
index 23da00b11517768c9129a418492c8eafb0ffd3cb..3250d732a17142fec31636d18a551df97b57e1ba 100644 (file)
@@ -2,7 +2,29 @@
 # Makefile for the linux kernel.
 #
 
-obj-y                  := gpio.o i2c.o pci.o setup.o time.o
-obj-m                  :=
-obj-n                  :=
-obj-                   :=
+obj-y :=
+
+# IOP32X
+obj-$(CONFIG_ARCH_IOP32X) += gpio.o
+obj-$(CONFIG_ARCH_IOP32X) += i2c.o
+obj-$(CONFIG_ARCH_IOP32X) += pci.o
+obj-$(CONFIG_ARCH_IOP32X) += setup.o
+obj-$(CONFIG_ARCH_IOP32X) += time.o
+obj-$(CONFIG_ARCH_IOP32X) += io.o
+obj-$(CONFIG_ARCH_IOP32X) += cp6.o
+
+# IOP33X
+obj-$(CONFIG_ARCH_IOP33X) += gpio.o
+obj-$(CONFIG_ARCH_IOP33X) += i2c.o
+obj-$(CONFIG_ARCH_IOP33X) += pci.o
+obj-$(CONFIG_ARCH_IOP33X) += setup.o
+obj-$(CONFIG_ARCH_IOP33X) += time.o
+obj-$(CONFIG_ARCH_IOP33X) += io.o
+obj-$(CONFIG_ARCH_IOP33X) += cp6.o
+
+# IOP13XX
+obj-$(CONFIG_ARCH_IOP13XX) += cp6.o
+
+obj-m                  :=
+obj-n                  :=
+obj-                   :=
diff --git a/arch/arm/plat-iop/cp6.c b/arch/arm/plat-iop/cp6.c
new file mode 100644 (file)
index 0000000..9612a87
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * IOP Coprocessor-6 access handler
+ * Copyright (c) 2006, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ */
+#include <linux/init.h>
+#include <asm/traps.h>
+
+static int cp6_trap(struct pt_regs *regs, unsigned int instr)
+{
+       u32 temp;
+
+        /* enable cp6 access */
+        asm volatile (
+               "mrc    p15, 0, %0, c15, c1, 0\n\t"
+               "orr    %0, %0, #(1 << 6)\n\t"
+               "mcr    p15, 0, %0, c15, c1, 0\n\t"
+               : "=r"(temp));
+
+       return 0;
+}
+
+/* permit kernel space cp6 access
+ * deny user space cp6 access
+ */
+static struct undef_hook cp6_hook = {
+       .instr_mask     = 0x0f000ff0,
+       .instr_val      = 0x0e000610,
+       .cpsr_mask      = MODE_MASK,
+       .cpsr_val       = SVC_MODE,
+       .fn             = cp6_trap,
+};
+
+void __init iop_init_cp6_handler(void)
+{
+       register_undef_hook(&cp6_hook);
+}
diff --git a/arch/arm/plat-iop/io.c b/arch/arm/plat-iop/io.c
new file mode 100644 (file)
index 0000000..f7eccec
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * iop3xx custom ioremap implementation
+ * Copyright (c) 2006, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <asm/hardware.h>
+#include <asm/io.h>
+
+void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size,
+       unsigned long flags)
+{
+       void __iomem * retval;
+
+       switch (cookie) {
+       case IOP3XX_PCI_LOWER_IO_PA ... IOP3XX_PCI_UPPER_IO_PA:
+               retval = (void *) IOP3XX_PCI_IO_PHYS_TO_VIRT(cookie);
+               break;
+       case IOP3XX_PERIPHERAL_PHYS_BASE ... IOP3XX_PERIPHERAL_UPPER_PA:
+               retval = (void *) IOP3XX_PMMR_PHYS_TO_VIRT(cookie);
+               break;
+       default:
+               retval = __ioremap(cookie, size, flags);
+       }
+
+       return retval;
+}
+EXPORT_SYMBOL(__iop3xx_ioremap);
+
+void __iop3xx_iounmap(void __iomem *addr)
+{
+       extern void __iounmap(volatile void __iomem *addr);
+
+       switch ((u32) addr) {
+       case IOP3XX_PCI_LOWER_IO_VA ... IOP3XX_PCI_UPPER_IO_VA:
+       case IOP3XX_PERIPHERAL_VIRT_BASE ... IOP3XX_PERIPHERAL_UPPER_VA:
+               goto skip;
+       }
+       __iounmap(addr);
+
+skip:
+       return;
+}
+EXPORT_SYMBOL(__iop3xx_iounmap);
index e647812654f2c0bcdf0b47c76c83e807419414a8..b5f6ec35aafb59e2b9fd1597e615e7000a157769 100644 (file)
@@ -196,8 +196,8 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys)
        if (!res)
                panic("PCI: unable to alloc resources");
 
-       res[0].start = IOP3XX_PCI_LOWER_IO_VA;
-       res[0].end   = IOP3XX_PCI_LOWER_IO_VA + IOP3XX_PCI_IO_WINDOW_SIZE - 1;
+       res[0].start = IOP3XX_PCI_LOWER_IO_PA;
+       res[0].end   = IOP3XX_PCI_LOWER_IO_PA + IOP3XX_PCI_IO_WINDOW_SIZE - 1;
        res[0].name  = "IOP3XX PCI I/O Space";
        res[0].flags = IORESOURCE_IO;
        request_resource(&ioport_resource, &res[0]);
@@ -209,7 +209,7 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys)
        request_resource(&iomem_resource, &res[1]);
 
        sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - IOP3XX_PCI_LOWER_MEM_BA;
-       sys->io_offset  = IOP3XX_PCI_LOWER_IO_VA - IOP3XX_PCI_LOWER_IO_BA;
+       sys->io_offset  = IOP3XX_PCI_LOWER_IO_PA - IOP3XX_PCI_LOWER_IO_BA;
 
        sys->resource[0] = &res[0];
        sys->resource[1] = &res[1];
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
new file mode 100644 (file)
index 0000000..e223431
--- /dev/null
@@ -0,0 +1,99 @@
+# arch/arm/plat-s3c24xx/Kconfig
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+config PLAT_S3C24XX
+       bool
+       depends on ARCH_S3C2410
+       default y if ARCH_S3C2410
+       help
+         Base platform code for any Samsung S3C device
+
+if PLAT_S3C24XX
+
+config CPU_S3C244X
+       bool
+       depends on ARCH_S3C2410 && (CPU_S3C2440 || CPU_S3C2442)
+       help
+         Support for S3C2440 and S3C2442 Samsung Mobile CPU based systems.
+
+config PM_SIMTEC
+       bool
+       help
+         Common power management code for systems that are
+         compatible with the Simtec style of power management
+
+config S3C2410_BOOT_WATCHDOG
+       bool "S3C2410 Initialisation watchdog"
+       depends on ARCH_S3C2410 && S3C2410_WATCHDOG
+       help
+         Say y to enable the watchdog during the kernel decompression
+         stage. If the kernel fails to uncompress, then the watchdog
+         will trigger a reset and the system should restart.
+
+config S3C2410_BOOT_ERROR_RESET
+       bool "S3C2410 Reboot on decompression error"
+       depends on ARCH_S3C2410
+       help
+         Say y here to use the watchdog to reset the system if the
+         kernel decompressor detects an error during decompression.
+
+config S3C2410_PM_DEBUG
+       bool "S3C2410 PM Suspend debug"
+       depends on ARCH_S3C2410 && PM
+       help
+         Say Y here if you want verbose debugging from the PM Suspend and
+         Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
+         for more information.
+
+config S3C2410_PM_CHECK
+       bool "S3C2410 PM Suspend Memory CRC"
+       depends on ARCH_S3C2410 && PM && CRC32
+       help
+         Enable the PM code's memory area checksum over sleep. This option
+         will generate CRCs of all blocks of memory, and store them before
+         going to sleep. The blocks are then checked on resume for any
+         errors.
+
+config S3C2410_PM_CHECK_CHUNKSIZE
+       int "S3C2410 PM Suspend CRC Chunksize (KiB)"
+       depends on ARCH_S3C2410 && PM && S3C2410_PM_CHECK
+       default 64
+       help
+         Set the chunksize in Kilobytes of the CRC for checking memory
+         corruption over suspend and resume. A smaller value will mean that
+         the CRC data block will take more memory, but wil identify any
+         faults with better precision.
+
+config S3C2410_LOWLEVEL_UART_PORT
+       int "S3C2410 UART to use for low-level messages"
+       default 0
+       help
+         Choice of which UART port to use for the low-level messages,
+         such as the `Uncompressing...` at start time. The value of
+         this configuration should be between zero and two. The port
+         must have been initialised by the boot-loader before use.
+
+config S3C2410_DMA
+       bool "S3C2410 DMA support"
+       depends on ARCH_S3C2410
+       help
+         S3C2410 DMA support. This is needed for drivers like sound which
+         use the S3C2410's DMA system to move data to and from the
+         peripheral blocks.
+
+config S3C2410_DMA_DEBUG
+       bool "S3C2410 DMA support debug"
+       depends on ARCH_S3C2410 && S3C2410_DMA
+       help
+         Enable debugging output for the DMA code. This option sends info
+         to the kernel log, at priority KERN_DEBUG.
+
+config MACH_SMDK
+       bool
+       help
+         Common machine code for SMDK2410 and SMDK2440
+
+endif
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
new file mode 100644 (file)
index 0000000..8e5ccaa
--- /dev/null
@@ -0,0 +1,30 @@
+# arch/arm/plat-s3c24xx/Makefile
+#
+# Copyright 2007 Simtec Electronics
+#
+# Licensed under GPLv2
+
+obj-y                          :=
+obj-m                          :=
+obj-n                          :=
+obj-                           :=
+
+
+# Core files
+
+obj-y                          += cpu.o
+obj-y                          += irq.o
+obj-y                          += devs.o
+obj-y                          += gpio.o
+obj-y                          += time.o
+obj-y                          += clock.o
+
+# Architecture dependant builds
+
+obj-$(CONFIG_CPU_S3C244X)      += s3c244x.o
+obj-$(CONFIG_CPU_S3C244X)      += s3c244x-irq.o
+obj-$(CONFIG_PM_SIMTEC)                += pm-simtec.o
+obj-$(CONFIG_PM)               += pm.o
+obj-$(CONFIG_PM)               += sleep.o
+obj-$(CONFIG_S3C2410_DMA)      += dma.o
+obj-$(CONFIG_MACH_SMDK)                += common-smdk.o
diff --git a/arch/arm/plat-s3c24xx/clock.c b/arch/arm/plat-s3c24xx/clock.c
new file mode 100644 (file)
index 0000000..d3dc03a
--- /dev/null
@@ -0,0 +1,449 @@
+/* linux/arch/arm/plat-s3c24xx/clock.c
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C24XX Core clock control support
+ *
+ * Based on, and code from linux/arch/arm/mach-versatile/clock.c
+ **
+ **  Copyright (C) 2004 ARM Limited.
+ **  Written by Deep Blue Solutions Limited.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <linux/sysdev.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/clk.h>
+#include <linux/mutex.h>
+#include <linux/delay.h>
+
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/arch/regs-clock.h>
+#include <asm/arch/regs-gpio.h>
+
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+/* clock information */
+
+static LIST_HEAD(clocks);
+
+DEFINE_MUTEX(clocks_mutex);
+
+/* enable and disable calls for use with the clk struct */
+
+static int clk_null_enable(struct clk *clk, int enable)
+{
+       return 0;
+}
+
+/* Clock API calls */
+
+struct clk *clk_get(struct device *dev, const char *id)
+{
+       struct clk *p;
+       struct clk *clk = ERR_PTR(-ENOENT);
+       int idno;
+
+       if (dev == NULL || dev->bus != &platform_bus_type)
+               idno = -1;
+       else
+               idno = to_platform_device(dev)->id;
+
+       mutex_lock(&clocks_mutex);
+
+       list_for_each_entry(p, &clocks, list) {
+               if (p->id == idno &&
+                   strcmp(id, p->name) == 0 &&
+                   try_module_get(p->owner)) {
+                       clk = p;
+                       break;
+               }
+       }
+
+       /* check for the case where a device was supplied, but the
+        * clock that was being searched for is not device specific */
+
+       if (IS_ERR(clk)) {
+               list_for_each_entry(p, &clocks, list) {
+                       if (p->id == -1 && strcmp(id, p->name) == 0 &&
+                           try_module_get(p->owner)) {
+                               clk = p;
+                               break;
+                       }
+               }
+       }
+
+       mutex_unlock(&clocks_mutex);
+       return clk;
+}
+
+void clk_put(struct clk *clk)
+{
+       module_put(clk->owner);
+}
+
+int clk_enable(struct clk *clk)
+{
+       if (IS_ERR(clk) || clk == NULL)
+               return -EINVAL;
+
+       clk_enable(clk->parent);
+
+       mutex_lock(&clocks_mutex);
+
+       if ((clk->usage++) == 0)
+               (clk->enable)(clk, 1);
+
+       mutex_unlock(&clocks_mutex);
+       return 0;
+}
+
+void clk_disable(struct clk *clk)
+{
+       if (IS_ERR(clk) || clk == NULL)
+               return;
+
+       mutex_lock(&clocks_mutex);
+
+       if ((--clk->usage) == 0)
+               (clk->enable)(clk, 0);
+
+       mutex_unlock(&clocks_mutex);
+       clk_disable(clk->parent);
+}
+
+
+unsigned long clk_get_rate(struct clk *clk)
+{
+       if (IS_ERR(clk))
+               return 0;
+
+       if (clk->rate != 0)
+               return clk->rate;
+
+       if (clk->get_rate != NULL)
+               return (clk->get_rate)(clk);
+
+       if (clk->parent != NULL)
+               return clk_get_rate(clk->parent);
+
+       return clk->rate;
+}
+
+long clk_round_rate(struct clk *clk, unsigned long rate)
+{
+       if (!IS_ERR(clk) && clk->round_rate)
+               return (clk->round_rate)(clk, rate);
+
+       return rate;
+}
+
+int clk_set_rate(struct clk *clk, unsigned long rate)
+{
+       int ret;
+
+       if (IS_ERR(clk))
+               return -EINVAL;
+
+       mutex_lock(&clocks_mutex);
+       ret = (clk->set_rate)(clk, rate);
+       mutex_unlock(&clocks_mutex);
+
+       return ret;
+}
+
+struct clk *clk_get_parent(struct clk *clk)
+{
+       return clk->parent;
+}
+
+int clk_set_parent(struct clk *clk, struct clk *parent)
+{
+       int ret = 0;
+
+       if (IS_ERR(clk))
+               return -EINVAL;
+
+       mutex_lock(&clocks_mutex);
+
+       if (clk->set_parent)
+               ret = (clk->set_parent)(clk, parent);
+
+       mutex_unlock(&clocks_mutex);
+
+       return ret;
+}
+
+EXPORT_SYMBOL(clk_get);
+EXPORT_SYMBOL(clk_put);
+EXPORT_SYMBOL(clk_enable);
+EXPORT_SYMBOL(clk_disable);
+EXPORT_SYMBOL(clk_get_rate);
+EXPORT_SYMBOL(clk_round_rate);
+EXPORT_SYMBOL(clk_set_rate);
+EXPORT_SYMBOL(clk_get_parent);
+EXPORT_SYMBOL(clk_set_parent);
+
+/* base clocks */
+
+struct clk clk_xtal = {
+       .name           = "xtal",
+       .id             = -1,
+       .rate           = 0,
+       .parent         = NULL,
+       .ctrlbit        = 0,
+};
+
+struct clk clk_mpll = {
+       .name           = "mpll",
+       .id             = -1,
+};
+
+struct clk clk_upll = {
+       .name           = "upll",
+       .id             = -1,
+       .parent         = NULL,
+       .ctrlbit        = 0,
+};
+
+struct clk clk_f = {
+       .name           = "fclk",
+       .id             = -1,
+       .rate           = 0,
+       .parent         = &clk_mpll,
+       .ctrlbit        = 0,
+};
+
+struct clk clk_h = {
+       .name           = "hclk",
+       .id             = -1,
+       .rate           = 0,
+       .parent         = NULL,
+       .ctrlbit        = 0,
+};
+
+struct clk clk_p = {
+       .name           = "pclk",
+       .id             = -1,
+       .rate           = 0,
+       .parent         = NULL,
+       .ctrlbit        = 0,
+};
+
+struct clk clk_usb_bus = {
+       .name           = "usb-bus",
+       .id             = -1,
+       .rate           = 0,
+       .parent         = &clk_upll,
+};
+
+/* clocks that could be registered by external code */
+
+static int s3c24xx_dclk_enable(struct clk *clk, int enable)
+{
+       unsigned long dclkcon = __raw_readl(S3C24XX_DCLKCON);
+
+       if (enable)
+               dclkcon |= clk->ctrlbit;
+       else
+               dclkcon &= ~clk->ctrlbit;
+
+       __raw_writel(dclkcon, S3C24XX_DCLKCON);
+
+       return 0;
+}
+
+static int s3c24xx_dclk_setparent(struct clk *clk, struct clk *parent)
+{
+       unsigned long dclkcon;
+       unsigned int uclk;
+
+       if (parent == &clk_upll)
+               uclk = 1;
+       else if (parent == &clk_p)
+               uclk = 0;
+       else
+               return -EINVAL;
+
+       clk->parent = parent;
+
+       dclkcon = __raw_readl(S3C24XX_DCLKCON);
+
+       if (clk->ctrlbit == S3C2410_DCLKCON_DCLK0EN) {
+               if (uclk)
+                       dclkcon |= S3C2410_DCLKCON_DCLK0_UCLK;
+               else
+                       dclkcon &= ~S3C2410_DCLKCON_DCLK0_UCLK;
+       } else {
+               if (uclk)
+                       dclkcon |= S3C2410_DCLKCON_DCLK1_UCLK;
+               else
+                       dclkcon &= ~S3C2410_DCLKCON_DCLK1_UCLK;
+       }
+
+       __raw_writel(dclkcon, S3C24XX_DCLKCON);
+
+       return 0;
+}
+
+
+static int s3c24xx_clkout_setparent(struct clk *clk, struct clk *parent)
+{
+       unsigned long mask;
+       unsigned long source;
+
+       /* calculate the MISCCR setting for the clock */
+
+       if (parent == &clk_xtal)
+               source = S3C2410_MISCCR_CLK0_MPLL;
+       else if (parent == &clk_upll)
+               source = S3C2410_MISCCR_CLK0_UPLL;
+       else if (parent == &clk_f)
+               source = S3C2410_MISCCR_CLK0_FCLK;
+       else if (parent == &clk_h)
+               source = S3C2410_MISCCR_CLK0_HCLK;
+       else if (parent == &clk_p)
+               source = S3C2410_MISCCR_CLK0_PCLK;
+       else if (clk == &s3c24xx_clkout0 && parent == &s3c24xx_dclk0)
+               source = S3C2410_MISCCR_CLK0_DCLK0;
+       else if (clk == &s3c24xx_clkout1 && parent == &s3c24xx_dclk1)
+               source = S3C2410_MISCCR_CLK0_DCLK0;
+       else
+               return -EINVAL;
+
+       clk->parent = parent;
+
+       if (clk == &s3c24xx_dclk0)
+               mask = S3C2410_MISCCR_CLK0_MASK;
+       else {
+               source <<= 4;
+               mask = S3C2410_MISCCR_CLK1_MASK;
+       }
+
+       s3c2410_modify_misccr(mask, source);
+       return 0;
+}
+
+/* external clock definitions */
+
+struct clk s3c24xx_dclk0 = {
+       .name           = "dclk0",
+       .id             = -1,
+       .ctrlbit        = S3C2410_DCLKCON_DCLK0EN,
+       .enable         = s3c24xx_dclk_enable,
+       .set_parent     = s3c24xx_dclk_setparent,
+};
+
+struct clk s3c24xx_dclk1 = {
+       .name           = "dclk1",
+       .id             = -1,
+       .ctrlbit        = S3C2410_DCLKCON_DCLK0EN,
+       .enable         = s3c24xx_dclk_enable,
+       .set_parent     = s3c24xx_dclk_setparent,
+};
+
+struct clk s3c24xx_clkout0 = {
+       .name           = "clkout0",
+       .id             = -1,
+       .set_parent     = s3c24xx_clkout_setparent,
+};
+
+struct clk s3c24xx_clkout1 = {
+       .name           = "clkout1",
+       .id             = -1,
+       .set_parent     = s3c24xx_clkout_setparent,
+};
+
+struct clk s3c24xx_uclk = {
+       .name           = "uclk",
+       .id             = -1,
+};
+
+/* initialise the clock system */
+
+int s3c24xx_register_clock(struct clk *clk)
+{
+       clk->owner = THIS_MODULE;
+
+       if (clk->enable == NULL)
+               clk->enable = clk_null_enable;
+
+       /* add to the list of available clocks */
+
+       mutex_lock(&clocks_mutex);
+       list_add(&clk->list, &clocks);
+       mutex_unlock(&clocks_mutex);
+
+       return 0;
+}
+
+/* initalise all the clocks */
+
+int __init s3c24xx_setup_clocks(unsigned long xtal,
+                               unsigned long fclk,
+                               unsigned long hclk,
+                               unsigned long pclk)
+{
+       printk(KERN_INFO "S3C24XX Clocks, (c) 2004 Simtec Electronics\n");
+
+       /* initialise the main system clocks */
+
+       clk_xtal.rate = xtal;
+       clk_upll.rate = s3c2410_get_pll(__raw_readl(S3C2410_UPLLCON), xtal);
+
+       clk_mpll.rate = fclk;
+       clk_h.rate = hclk;
+       clk_p.rate = pclk;
+       clk_f.rate = fclk;
+
+       /* assume uart clocks are correctly setup */
+
+       /* register our clocks */
+
+       if (s3c24xx_register_clock(&clk_xtal) < 0)
+               printk(KERN_ERR "failed to register master xtal\n");
+
+       if (s3c24xx_register_clock(&clk_mpll) < 0)
+               printk(KERN_ERR "failed to register mpll clock\n");
+
+       if (s3c24xx_register_clock(&clk_upll) < 0)
+               printk(KERN_ERR "failed to register upll clock\n");
+
+       if (s3c24xx_register_clock(&clk_f) < 0)
+               printk(KERN_ERR "failed to register cpu fclk\n");
+
+       if (s3c24xx_register_clock(&clk_h) < 0)
+               printk(KERN_ERR "failed to register cpu hclk\n");
+
+       if (s3c24xx_register_clock(&clk_p) < 0)
+               printk(KERN_ERR "failed to register cpu pclk\n");
+
+       return 0;
+}
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c
new file mode 100644 (file)
index 0000000..908efa7
--- /dev/null
@@ -0,0 +1,200 @@
+/* linux/arch/arm/plat-s3c24xx/common-smdk.c
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Common code for SMDK2410 and SMDK2440 boards
+ *
+ * http://www.fluff.org/ben/smdk2440/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/nand_ecc.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/leds-gpio.h>
+
+#include <asm/arch/nand.h>
+
+#include <asm/plat-s3c24xx/common-smdk.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/pm.h>
+
+/* LED devices */
+
+static struct s3c24xx_led_platdata smdk_pdata_led4 = {
+       .gpio           = S3C2410_GPF4,
+       .flags          = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
+       .name           = "led4",
+       .def_trigger    = "timer",
+};
+
+static struct s3c24xx_led_platdata smdk_pdata_led5 = {
+       .gpio           = S3C2410_GPF5,
+       .flags          = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
+       .name           = "led5",
+       .def_trigger    = "nand-disk",
+};
+
+static struct s3c24xx_led_platdata smdk_pdata_led6 = {
+       .gpio           = S3C2410_GPF6,
+       .flags          = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
+       .name           = "led6",
+};
+
+static struct s3c24xx_led_platdata smdk_pdata_led7 = {
+       .gpio           = S3C2410_GPF7,
+       .flags          = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
+       .name           = "led7",
+};
+
+static struct platform_device smdk_led4 = {
+       .name           = "s3c24xx_led",
+       .id             = 0,
+       .dev            = {
+               .platform_data = &smdk_pdata_led4,
+       },
+};
+
+static struct platform_device smdk_led5 = {
+       .name           = "s3c24xx_led",
+       .id             = 1,
+       .dev            = {
+               .platform_data = &smdk_pdata_led5,
+       },
+};
+
+static struct platform_device smdk_led6 = {
+       .name           = "s3c24xx_led",
+       .id             = 2,
+       .dev            = {
+               .platform_data = &smdk_pdata_led6,
+       },
+};
+
+static struct platform_device smdk_led7 = {
+       .name           = "s3c24xx_led",
+       .id             = 3,
+       .dev            = {
+               .platform_data = &smdk_pdata_led7,
+       },
+};
+
+/* NAND parititon from 2.4.18-swl5 */
+
+static struct mtd_partition smdk_default_nand_part[] = {
+       [0] = {
+               .name   = "Boot Agent",
+               .size   = SZ_16K,
+               .offset = 0,
+       },
+       [1] = {
+               .name   = "S3C2410 flash partition 1",
+               .offset = 0,
+               .size   = SZ_2M,
+       },
+       [2] = {
+               .name   = "S3C2410 flash partition 2",
+               .offset = SZ_4M,
+               .size   = SZ_4M,
+       },
+       [3] = {
+               .name   = "S3C2410 flash partition 3",
+               .offset = SZ_8M,
+               .size   = SZ_2M,
+       },
+       [4] = {
+               .name   = "S3C2410 flash partition 4",
+               .offset = SZ_1M * 10,
+               .size   = SZ_4M,
+       },
+       [5] = {
+               .name   = "S3C2410 flash partition 5",
+               .offset = SZ_1M * 14,
+               .size   = SZ_1M * 10,
+       },
+       [6] = {
+               .name   = "S3C2410 flash partition 6",
+               .offset = SZ_1M * 24,
+               .size   = SZ_1M * 24,
+       },
+       [7] = {
+               .name   = "S3C2410 flash partition 7",
+               .offset = SZ_1M * 48,
+               .size   = SZ_16M,
+       }
+};
+
+static struct s3c2410_nand_set smdk_nand_sets[] = {
+       [0] = {
+               .name           = "NAND",
+               .nr_chips       = 1,
+               .nr_partitions  = ARRAY_SIZE(smdk_default_nand_part),
+               .partitions     = smdk_default_nand_part,
+       },
+};
+
+/* choose a set of timings which should suit most 512Mbit
+ * chips and beyond.
+*/
+
+static struct s3c2410_platform_nand smdk_nand_info = {
+       .tacls          = 20,
+       .twrph0         = 60,
+       .twrph1         = 20,
+       .nr_sets        = ARRAY_SIZE(smdk_nand_sets),
+       .sets           = smdk_nand_sets,
+};
+
+/* devices we initialise */
+
+static struct platform_device __initdata *smdk_devs[] = {
+       &s3c_device_nand,
+       &smdk_led4,
+       &smdk_led5,
+       &smdk_led6,
+       &smdk_led7,
+};
+
+void __init smdk_machine_init(void)
+{
+       /* Configure the LEDs (even if we have no LED support)*/
+
+       s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP);
+       s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
+       s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP);
+       s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP);
+
+       s3c2410_gpio_setpin(S3C2410_GPF4, 1);
+       s3c2410_gpio_setpin(S3C2410_GPF5, 1);
+       s3c2410_gpio_setpin(S3C2410_GPF6, 1);
+       s3c2410_gpio_setpin(S3C2410_GPF7, 1);
+
+       s3c_device_nand.dev.platform_data = &smdk_nand_info;
+
+       platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs));
+
+       s3c2410_pm_init();
+}
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
new file mode 100644 (file)
index 0000000..6a2d107
--- /dev/null
@@ -0,0 +1,368 @@
+/* linux/arch/arm/plat-s3c24xx/cpu.c
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     http://www.simtec.co.uk/products/SWLINUX/
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C24XX 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/serial_core.h>
+#include <linux/platform_device.h>
+
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/delay.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-serial.h>
+
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/s3c2400.h>
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/s3c2412.h>
+#include "s3c244x.h"
+#include <asm/plat-s3c24xx/s3c2440.h>
+#include <asm/plat-s3c24xx/s3c2442.h>
+#include <asm/plat-s3c24xx/s3c2443.h>
+
+struct cpu_table {
+       unsigned long   idcode;
+       unsigned long   idmask;
+       void            (*map_io)(struct map_desc *mach_desc, int size);
+       void            (*init_uarts)(struct s3c2410_uartcfg *cfg, int no);
+       void            (*init_clocks)(int xtal);
+       int             (*init)(void);
+       const char      *name;
+};
+
+/* table of supported CPUs */
+
+static const char name_s3c2400[]  = "S3C2400";
+static const char name_s3c2410[]  = "S3C2410";
+static const char name_s3c2412[]  = "S3C2412";
+static const char name_s3c2440[]  = "S3C2440";
+static const char name_s3c2442[]  = "S3C2442";
+static const char name_s3c2443[]  = "S3C2443";
+static const char name_s3c2410a[] = "S3C2410A";
+static const char name_s3c2440a[] = "S3C2440A";
+
+static struct cpu_table cpu_ids[] __initdata = {
+       {
+               .idcode         = 0x32410000,
+               .idmask         = 0xffffffff,
+               .map_io         = s3c2410_map_io,
+               .init_clocks    = s3c2410_init_clocks,
+               .init_uarts     = s3c2410_init_uarts,
+               .init           = s3c2410_init,
+               .name           = name_s3c2410
+       },
+       {
+               .idcode         = 0x32410002,
+               .idmask         = 0xffffffff,
+               .map_io         = s3c2410_map_io,
+               .init_clocks    = s3c2410_init_clocks,
+               .init_uarts     = s3c2410_init_uarts,
+               .init           = s3c2410_init,
+               .name           = name_s3c2410a
+       },
+       {
+               .idcode         = 0x32440000,
+               .idmask         = 0xffffffff,
+               .map_io         = s3c244x_map_io,
+               .init_clocks    = s3c244x_init_clocks,
+               .init_uarts     = s3c244x_init_uarts,
+               .init           = s3c2440_init,
+               .name           = name_s3c2440
+       },
+       {
+               .idcode         = 0x32440001,
+               .idmask         = 0xffffffff,
+               .map_io         = s3c244x_map_io,
+               .init_clocks    = s3c244x_init_clocks,
+               .init_uarts     = s3c244x_init_uarts,
+               .init           = s3c2440_init,
+               .name           = name_s3c2440a
+       },
+       {
+               .idcode         = 0x32440aaa,
+               .idmask         = 0xffffffff,
+               .map_io         = s3c244x_map_io,
+               .init_clocks    = s3c244x_init_clocks,
+               .init_uarts     = s3c244x_init_uarts,
+               .init           = s3c2442_init,
+               .name           = name_s3c2442
+       },
+       {
+               .idcode         = 0x32412001,
+               .idmask         = 0xffffffff,
+               .map_io         = s3c2412_map_io,
+               .init_clocks    = s3c2412_init_clocks,
+               .init_uarts     = s3c2412_init_uarts,
+               .init           = s3c2412_init,
+               .name           = name_s3c2412,
+       },
+       {                       /* a newer version of the s3c2412 */
+               .idcode         = 0x32412003,
+               .idmask         = 0xffffffff,
+               .map_io         = s3c2412_map_io,
+               .init_clocks    = s3c2412_init_clocks,
+               .init_uarts     = s3c2412_init_uarts,
+               .init           = s3c2412_init,
+               .name           = name_s3c2412,
+       },
+       {
+               .idcode         = 0x32443001,
+               .idmask         = 0xffffffff,
+               .map_io         = s3c2443_map_io,
+               .init_clocks    = s3c2443_init_clocks,
+               .init_uarts     = s3c2443_init_uarts,
+               .init           = s3c2443_init,
+               .name           = name_s3c2443,
+       },
+       {
+               .idcode         = 0x0,   /* S3C2400 doesn't have an idcode */
+               .idmask         = 0xffffffff,
+               .map_io         = s3c2400_map_io,
+               .init_clocks    = s3c2400_init_clocks,
+               .init_uarts     = s3c2400_init_uarts,
+               .init           = s3c2400_init,
+               .name           = name_s3c2400
+       },
+};
+
+/* minimal IO mapping */
+
+static struct map_desc s3c_iodesc[] __initdata = {
+       IODESC_ENT(GPIO),
+       IODESC_ENT(IRQ),
+       IODESC_ENT(MEMCTRL),
+       IODESC_ENT(UART)
+};
+
+
+static struct cpu_table *
+s3c_lookup_cpu(unsigned long idcode)
+{
+       struct cpu_table *tab;
+       int count;
+
+       tab = cpu_ids;
+       for (count = 0; count < ARRAY_SIZE(cpu_ids); count++, tab++) {
+               if ((idcode & tab->idmask) == tab->idcode)
+                       return tab;
+       }
+
+       return NULL;
+}
+
+/* board information */
+
+static struct s3c24xx_board *board;
+
+void s3c24xx_set_board(struct s3c24xx_board *b)
+{
+       int i;
+
+       board = b;
+
+       if (b->clocks_count != 0) {
+               struct clk **ptr = b->clocks;
+
+               for (i = b->clocks_count; i > 0; i--, ptr++)
+                       s3c24xx_register_clock(*ptr);
+       }
+}
+
+/* cpu information */
+
+static struct cpu_table *cpu;
+
+static unsigned long s3c24xx_read_idcode_v5(void)
+{
+#if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413)
+       return __raw_readl(S3C2412_GSTATUS1);
+#else
+       return 1UL;     /* don't look like an 2400 */
+#endif
+}
+
+static unsigned long s3c24xx_read_idcode_v4(void)
+{
+#ifndef CONFIG_CPU_S3C2400
+       return __raw_readl(S3C2410_GSTATUS1);
+#else
+       return 0UL;
+#endif
+}
+
+void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
+{
+       unsigned long idcode = 0x0;
+
+       /* initialise the io descriptors we need for initialisation */
+       iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
+
+       if (cpu_architecture() >= CPU_ARCH_ARMv5) {
+               idcode = s3c24xx_read_idcode_v5();
+       } else {
+               idcode = s3c24xx_read_idcode_v4();
+       }
+
+       cpu = s3c_lookup_cpu(idcode);
+
+       if (cpu == NULL) {
+               printk(KERN_ERR "Unknown CPU type 0x%08lx\n", idcode);
+               panic("Unknown S3C24XX CPU");
+       }
+
+       printk("CPU %s (id 0x%08lx)\n", cpu->name, idcode);
+
+       if (cpu->map_io == NULL || cpu->init == NULL) {
+               printk(KERN_ERR "CPU %s support not enabled\n", cpu->name);
+               panic("Unsupported S3C24XX CPU");
+       }
+
+       (cpu->map_io)(mach_desc, size);
+}
+
+/* s3c24xx_init_clocks
+ *
+ * Initialise the clock subsystem and associated information from the
+ * given master crystal value.
+ *
+ * xtal  = 0 -> use default PLL crystal value (normally 12MHz)
+ *      != 0 -> PLL crystal value in Hz
+*/
+
+void __init s3c24xx_init_clocks(int xtal)
+{
+       if (xtal == 0)
+               xtal = 12*1000*1000;
+
+       if (cpu == NULL)
+               panic("s3c24xx_init_clocks: no cpu setup?\n");
+
+       if (cpu->init_clocks == NULL)
+               panic("s3c24xx_init_clocks: cpu has no clock init\n");
+       else
+               (cpu->init_clocks)(xtal);
+}
+
+/* uart management */
+
+static int nr_uarts __initdata = 0;
+
+static struct s3c2410_uartcfg uart_cfgs[3];
+
+/* s3c24xx_init_uartdevs
+ *
+ * copy the specified platform data and configuration into our central
+ * set of devices, before the data is thrown away after the init process.
+ *
+ * This also fills in the array passed to the serial driver for the
+ * early initialisation of the console.
+*/
+
+void __init s3c24xx_init_uartdevs(char *name,
+                                 struct s3c24xx_uart_resources *res,
+                                 struct s3c2410_uartcfg *cfg, int no)
+{
+       struct platform_device *platdev;
+       struct s3c2410_uartcfg *cfgptr = uart_cfgs;
+       struct s3c24xx_uart_resources *resp;
+       int uart;
+
+       memcpy(cfgptr, cfg, sizeof(struct s3c2410_uartcfg) * no);
+
+       for (uart = 0; uart < no; uart++, cfg++, cfgptr++) {
+               platdev = s3c24xx_uart_src[cfgptr->hwport];
+
+               resp = res + cfgptr->hwport;
+
+               s3c24xx_uart_devs[uart] = platdev;
+
+               platdev->name = name;
+               platdev->resource = resp->resources;
+               platdev->num_resources = resp->nr_resources;
+
+               platdev->dev.platform_data = cfgptr;
+       }
+
+       nr_uarts = no;
+}
+
+void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
+{
+       if (cpu == NULL)
+               return;
+
+       if (cpu->init_uarts == NULL) {
+               printk(KERN_ERR "s3c24xx_init_uarts: cpu has no uart init\n");
+       } else
+               (cpu->init_uarts)(cfg, no);
+}
+
+static int __init s3c_arch_init(void)
+{
+       int ret;
+
+       // do the correct init for cpu
+
+       if (cpu == NULL)
+               panic("s3c_arch_init: NULL cpu\n");
+
+       ret = (cpu->init)();
+       if (ret != 0)
+               return ret;
+
+       ret = platform_add_devices(s3c24xx_uart_devs, nr_uarts);
+       if (ret != 0)
+               return ret;
+
+       if (board != NULL) {
+               struct platform_device **ptr = board->devices;
+               int i;
+
+               for (i = 0; i < board->devices_count; i++, ptr++) {
+                       ret = platform_device_register(*ptr);
+
+                       if (ret) {
+                               printk(KERN_ERR "s3c24xx: failed to add board device %s (%d) @%p\n", (*ptr)->name, ret, *ptr);
+                       }
+               }
+
+               /* mask any error, we may not need all these board
+                * devices */
+               ret = 0;
+       }
+
+       return ret;
+}
+
+arch_initcall(s3c_arch_init);
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
new file mode 100644 (file)
index 0000000..0fe53b3
--- /dev/null
@@ -0,0 +1,600 @@
+/* linux/arch/arm/plat-s3c24xx/devs.c
+ *
+ * Copyright (c) 2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Base S3C24XX platform device definitions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+#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/serial_core.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+#include <asm/arch/fb.h>
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/udc.h>
+
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+/* Serial port registrations */
+
+static struct resource s3c2410_uart0_resource[] = {
+       [0] = {
+               .start = S3C2410_PA_UART0,
+               .end   = S3C2410_PA_UART0 + 0x3fff,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_S3CUART_RX0,
+               .end   = IRQ_S3CUART_ERR0,
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+static struct resource s3c2410_uart1_resource[] = {
+       [0] = {
+               .start = S3C2410_PA_UART1,
+               .end   = S3C2410_PA_UART1 + 0x3fff,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_S3CUART_RX1,
+               .end   = IRQ_S3CUART_ERR1,
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+static struct resource s3c2410_uart2_resource[] = {
+       [0] = {
+               .start = S3C2410_PA_UART2,
+               .end   = S3C2410_PA_UART2 + 0x3fff,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_S3CUART_RX2,
+               .end   = IRQ_S3CUART_ERR2,
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = {
+       [0] = {
+               .resources      = s3c2410_uart0_resource,
+               .nr_resources   = ARRAY_SIZE(s3c2410_uart0_resource),
+       },
+       [1] = {
+               .resources      = s3c2410_uart1_resource,
+               .nr_resources   = ARRAY_SIZE(s3c2410_uart1_resource),
+       },
+       [2] = {
+               .resources      = s3c2410_uart2_resource,
+               .nr_resources   = ARRAY_SIZE(s3c2410_uart2_resource),
+       },
+};
+
+/* yart devices */
+
+static struct platform_device s3c24xx_uart_device0 = {
+       .id             = 0,
+};
+
+static struct platform_device s3c24xx_uart_device1 = {
+       .id             = 1,
+};
+
+static struct platform_device s3c24xx_uart_device2 = {
+       .id             = 2,
+};
+
+struct platform_device *s3c24xx_uart_src[3] = {
+       &s3c24xx_uart_device0,
+       &s3c24xx_uart_device1,
+       &s3c24xx_uart_device2,
+};
+
+struct platform_device *s3c24xx_uart_devs[3] = {
+};
+
+/* USB Host Controller */
+
+static struct resource s3c_usb_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_USBHOST,
+               .end   = S3C24XX_PA_USBHOST + S3C24XX_SZ_USBHOST - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_USBH,
+               .end   = IRQ_USBH,
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+static u64 s3c_device_usb_dmamask = 0xffffffffUL;
+
+struct platform_device s3c_device_usb = {
+       .name             = "s3c2410-ohci",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_usb_resource),
+       .resource         = s3c_usb_resource,
+       .dev              = {
+               .dma_mask = &s3c_device_usb_dmamask,
+               .coherent_dma_mask = 0xffffffffUL
+       }
+};
+
+EXPORT_SYMBOL(s3c_device_usb);
+
+/* LCD Controller */
+
+static struct resource s3c_lcd_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_LCD,
+               .end   = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_LCD,
+               .end   = IRQ_LCD,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
+
+struct platform_device s3c_device_lcd = {
+       .name             = "s3c2410-lcd",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_lcd_resource),
+       .resource         = s3c_lcd_resource,
+       .dev              = {
+               .dma_mask               = &s3c_device_lcd_dmamask,
+               .coherent_dma_mask      = 0xffffffffUL
+       }
+};
+
+EXPORT_SYMBOL(s3c_device_lcd);
+
+void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
+{
+       struct s3c2410fb_mach_info *npd;
+
+       npd = kmalloc(sizeof(*npd), GFP_KERNEL);
+       if (npd) {
+               memcpy(npd, pd, sizeof(*npd));
+               s3c_device_lcd.dev.platform_data = npd;
+       } else {
+               printk(KERN_ERR "no memory for LCD platform data\n");
+       }
+}
+
+/* NAND Controller */
+
+static struct resource s3c_nand_resource[] = {
+       [0] = {
+               .start = S3C2410_PA_NAND,
+               .end   = S3C2410_PA_NAND + S3C24XX_SZ_NAND - 1,
+               .flags = IORESOURCE_MEM,
+       }
+};
+
+struct platform_device s3c_device_nand = {
+       .name             = "s3c2410-nand",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_nand_resource),
+       .resource         = s3c_nand_resource,
+};
+
+EXPORT_SYMBOL(s3c_device_nand);
+
+/* USB Device (Gadget)*/
+
+static struct resource s3c_usbgadget_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_USBDEV,
+               .end   = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_USBD,
+               .end   = IRQ_USBD,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+struct platform_device s3c_device_usbgadget = {
+       .name             = "s3c2410-usbgadget",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_usbgadget_resource),
+       .resource         = s3c_usbgadget_resource,
+};
+
+EXPORT_SYMBOL(s3c_device_usbgadget);
+
+void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
+{
+       struct s3c2410_udc_mach_info *npd;
+
+       npd = kmalloc(sizeof(*npd), GFP_KERNEL);
+       if (npd) {
+               memcpy(npd, pd, sizeof(*npd));
+               s3c_device_usbgadget.dev.platform_data = npd;
+       } else {
+               printk(KERN_ERR "no memory for udc platform data\n");
+       }
+}
+
+
+/* Watchdog */
+
+static struct resource s3c_wdt_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_WATCHDOG,
+               .end   = S3C24XX_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_WDT,
+               .end   = IRQ_WDT,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+struct platform_device s3c_device_wdt = {
+       .name             = "s3c2410-wdt",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_wdt_resource),
+       .resource         = s3c_wdt_resource,
+};
+
+EXPORT_SYMBOL(s3c_device_wdt);
+
+/* I2C */
+
+static struct resource s3c_i2c_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_IIC,
+               .end   = S3C24XX_PA_IIC + S3C24XX_SZ_IIC - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_IIC,
+               .end   = IRQ_IIC,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+struct platform_device s3c_device_i2c = {
+       .name             = "s3c2410-i2c",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_i2c_resource),
+       .resource         = s3c_i2c_resource,
+};
+
+EXPORT_SYMBOL(s3c_device_i2c);
+
+/* IIS */
+
+static struct resource s3c_iis_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_IIS,
+               .end   = S3C24XX_PA_IIS + S3C24XX_SZ_IIS -1,
+               .flags = IORESOURCE_MEM,
+       }
+};
+
+static u64 s3c_device_iis_dmamask = 0xffffffffUL;
+
+struct platform_device s3c_device_iis = {
+       .name             = "s3c2410-iis",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_iis_resource),
+       .resource         = s3c_iis_resource,
+       .dev              = {
+               .dma_mask = &s3c_device_iis_dmamask,
+               .coherent_dma_mask = 0xffffffffUL
+       }
+};
+
+EXPORT_SYMBOL(s3c_device_iis);
+
+/* RTC */
+
+static struct resource s3c_rtc_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_RTC,
+               .end   = S3C24XX_PA_RTC + 0xff,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_RTC,
+               .end   = IRQ_RTC,
+               .flags = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start = IRQ_TICK,
+               .end   = IRQ_TICK,
+               .flags = IORESOURCE_IRQ
+       }
+};
+
+struct platform_device s3c_device_rtc = {
+       .name             = "s3c2410-rtc",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_rtc_resource),
+       .resource         = s3c_rtc_resource,
+};
+
+EXPORT_SYMBOL(s3c_device_rtc);
+
+/* ADC */
+
+static struct resource s3c_adc_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_ADC,
+               .end   = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_TC,
+               .end   = IRQ_TC,
+               .flags = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start = IRQ_ADC,
+               .end   = IRQ_ADC,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+struct platform_device s3c_device_adc = {
+       .name             = "s3c2410-adc",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_adc_resource),
+       .resource         = s3c_adc_resource,
+};
+
+/* SDI */
+
+static struct resource s3c_sdi_resource[] = {
+       [0] = {
+               .start = S3C2410_PA_SDI,
+               .end   = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_SDI,
+               .end   = IRQ_SDI,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+struct platform_device s3c_device_sdi = {
+       .name             = "s3c2410-sdi",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_sdi_resource),
+       .resource         = s3c_sdi_resource,
+};
+
+EXPORT_SYMBOL(s3c_device_sdi);
+
+/* SPI (0) */
+
+static struct resource s3c_spi0_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_SPI,
+               .end   = S3C24XX_PA_SPI + 0x1f,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_SPI0,
+               .end   = IRQ_SPI0,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+static u64 s3c_device_spi0_dmamask = 0xffffffffUL;
+
+struct platform_device s3c_device_spi0 = {
+       .name             = "s3c2410-spi",
+       .id               = 0,
+       .num_resources    = ARRAY_SIZE(s3c_spi0_resource),
+       .resource         = s3c_spi0_resource,
+        .dev              = {
+                .dma_mask = &s3c_device_spi0_dmamask,
+                .coherent_dma_mask = 0xffffffffUL
+        }
+};
+
+EXPORT_SYMBOL(s3c_device_spi0);
+
+/* SPI (1) */
+
+static struct resource s3c_spi1_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_SPI + 0x20,
+               .end   = S3C24XX_PA_SPI + 0x20 + 0x1f,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_SPI1,
+               .end   = IRQ_SPI1,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+static u64 s3c_device_spi1_dmamask = 0xffffffffUL;
+
+struct platform_device s3c_device_spi1 = {
+       .name             = "s3c2410-spi",
+       .id               = 1,
+       .num_resources    = ARRAY_SIZE(s3c_spi1_resource),
+       .resource         = s3c_spi1_resource,
+        .dev              = {
+                .dma_mask = &s3c_device_spi1_dmamask,
+                .coherent_dma_mask = 0xffffffffUL
+        }
+};
+
+EXPORT_SYMBOL(s3c_device_spi1);
+
+/* pwm timer blocks */
+
+static struct resource s3c_timer0_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_TIMER + 0x0C,
+               .end   = S3C24XX_PA_TIMER + 0x0C + 0xB,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_TIMER0,
+               .end   = IRQ_TIMER0,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+struct platform_device s3c_device_timer0 = {
+       .name             = "s3c2410-timer",
+       .id               = 0,
+       .num_resources    = ARRAY_SIZE(s3c_timer0_resource),
+       .resource         = s3c_timer0_resource,
+};
+
+EXPORT_SYMBOL(s3c_device_timer0);
+
+/* timer 1 */
+
+static struct resource s3c_timer1_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_TIMER + 0x18,
+               .end   = S3C24XX_PA_TIMER + 0x23,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_TIMER1,
+               .end   = IRQ_TIMER1,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+struct platform_device s3c_device_timer1 = {
+       .name             = "s3c2410-timer",
+       .id               = 1,
+       .num_resources    = ARRAY_SIZE(s3c_timer1_resource),
+       .resource         = s3c_timer1_resource,
+};
+
+EXPORT_SYMBOL(s3c_device_timer1);
+
+/* timer 2 */
+
+static struct resource s3c_timer2_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_TIMER + 0x24,
+               .end   = S3C24XX_PA_TIMER + 0x2F,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_TIMER2,
+               .end   = IRQ_TIMER2,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+struct platform_device s3c_device_timer2 = {
+       .name             = "s3c2410-timer",
+       .id               = 2,
+       .num_resources    = ARRAY_SIZE(s3c_timer2_resource),
+       .resource         = s3c_timer2_resource,
+};
+
+EXPORT_SYMBOL(s3c_device_timer2);
+
+/* timer 3 */
+
+static struct resource s3c_timer3_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_TIMER + 0x30,
+               .end   = S3C24XX_PA_TIMER + 0x3B,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_TIMER3,
+               .end   = IRQ_TIMER3,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+struct platform_device s3c_device_timer3 = {
+       .name             = "s3c2410-timer",
+       .id               = 3,
+       .num_resources    = ARRAY_SIZE(s3c_timer3_resource),
+       .resource         = s3c_timer3_resource,
+};
+
+EXPORT_SYMBOL(s3c_device_timer3);
+
+#ifdef CONFIG_CPU_S3C2440
+
+/* Camif Controller */
+
+static struct resource s3c_camif_resource[] = {
+       [0] = {
+               .start = S3C2440_PA_CAMIF,
+               .end   = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_CAM,
+               .end   = IRQ_CAM,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+static u64 s3c_device_camif_dmamask = 0xffffffffUL;
+
+struct platform_device s3c_device_camif = {
+       .name             = "s3c2440-camif",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_camif_resource),
+       .resource         = s3c_camif_resource,
+       .dev              = {
+               .dma_mask = &s3c_device_camif_dmamask,
+               .coherent_dma_mask = 0xffffffffUL
+       }
+};
+
+EXPORT_SYMBOL(s3c_device_camif);
+
+#endif // CONFIG_CPU_S32440
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
new file mode 100644 (file)
index 0000000..4540a80
--- /dev/null
@@ -0,0 +1,1499 @@
+/* linux/arch/arm/plat-s3c24xx/dma.c
+ *
+ * Copyright (c) 2003-2005,2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2410 DMA core
+ *
+ * http://armlinux.simtec.co.uk/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+
+#ifdef CONFIG_S3C2410_DMA_DEBUG
+#define DEBUG
+#endif
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/spinlock.h>
+#include <linux/interrupt.h>
+#include <linux/sysdev.h>
+#include <linux/slab.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+
+#include <asm/system.h>
+#include <asm/irq.h>
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/dma.h>
+
+#include <asm/mach/dma.h>
+#include <asm/arch/map.h>
+
+#include <asm/plat-s3c24xx/dma.h>
+
+/* io map for dma */
+static void __iomem *dma_base;
+static struct kmem_cache *dma_kmem;
+
+static int dma_channels;
+
+struct s3c24xx_dma_selection dma_sel;
+
+/* dma channel state information */
+struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS];
+
+/* debugging functions */
+
+#define BUF_MAGIC (0xcafebabe)
+
+#define dmawarn(fmt...) printk(KERN_DEBUG fmt)
+
+#define dma_regaddr(chan, reg) ((chan)->regs + (reg))
+
+#if 1
+#define dma_wrreg(chan, reg, val) writel((val), (chan)->regs + (reg))
+#else
+static inline void
+dma_wrreg(struct s3c2410_dma_chan *chan, int reg, unsigned long val)
+{
+       pr_debug("writing %08x to register %08x\n",(unsigned int)val,reg);
+       writel(val, dma_regaddr(chan, reg));
+}
+#endif
+
+#define dma_rdreg(chan, reg) readl((chan)->regs + (reg))
+
+/* captured register state for debug */
+
+struct s3c2410_dma_regstate {
+       unsigned long         dcsrc;
+       unsigned long         disrc;
+       unsigned long         dstat;
+       unsigned long         dcon;
+       unsigned long         dmsktrig;
+};
+
+#ifdef CONFIG_S3C2410_DMA_DEBUG
+
+/* dmadbg_showregs
+ *
+ * simple debug routine to print the current state of the dma registers
+*/
+
+static void
+dmadbg_capture(struct s3c2410_dma_chan *chan, struct s3c2410_dma_regstate *regs)
+{
+       regs->dcsrc    = dma_rdreg(chan, S3C2410_DMA_DCSRC);
+       regs->disrc    = dma_rdreg(chan, S3C2410_DMA_DISRC);
+       regs->dstat    = dma_rdreg(chan, S3C2410_DMA_DSTAT);
+       regs->dcon     = dma_rdreg(chan, S3C2410_DMA_DCON);
+       regs->dmsktrig = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
+}
+
+static void
+dmadbg_dumpregs(const char *fname, int line, struct s3c2410_dma_chan *chan,
+                struct s3c2410_dma_regstate *regs)
+{
+       printk(KERN_DEBUG "dma%d: %s:%d: DCSRC=%08lx, DISRC=%08lx, DSTAT=%08lx DMT=%02lx, DCON=%08lx\n",
+              chan->number, fname, line,
+              regs->dcsrc, regs->disrc, regs->dstat, regs->dmsktrig,
+              regs->dcon);
+}
+
+static void
+dmadbg_showchan(const char *fname, int line, struct s3c2410_dma_chan *chan)
+{
+       struct s3c2410_dma_regstate state;
+
+       dmadbg_capture(chan, &state);
+
+       printk(KERN_DEBUG "dma%d: %s:%d: ls=%d, cur=%p, %p %p\n",
+              chan->number, fname, line, chan->load_state,
+              chan->curr, chan->next, chan->end);
+
+       dmadbg_dumpregs(fname, line, chan, &state);
+}
+
+static void
+dmadbg_showregs(const char *fname, int line, struct s3c2410_dma_chan *chan)
+{
+       struct s3c2410_dma_regstate state;
+
+       dmadbg_capture(chan, &state);
+       dmadbg_dumpregs(fname, line, chan, &state);
+}
+
+#define dbg_showregs(chan) dmadbg_showregs(__FUNCTION__, __LINE__, (chan))
+#define dbg_showchan(chan) dmadbg_showchan(__FUNCTION__, __LINE__, (chan))
+#else
+#define dbg_showregs(chan) do { } while(0)
+#define dbg_showchan(chan) do { } while(0)
+#endif /* CONFIG_S3C2410_DMA_DEBUG */
+
+static struct s3c2410_dma_chan *dma_chan_map[DMACH_MAX];
+
+/* lookup_dma_channel
+ *
+ * change the dma channel number given into a real dma channel id
+*/
+
+static struct s3c2410_dma_chan *lookup_dma_channel(unsigned int channel)
+{
+       if (channel & DMACH_LOW_LEVEL)
+               return &s3c2410_chans[channel & ~DMACH_LOW_LEVEL];
+       else
+               return dma_chan_map[channel];
+}
+
+/* s3c2410_dma_stats_timeout
+ *
+ * Update DMA stats from timeout info
+*/
+
+static void
+s3c2410_dma_stats_timeout(struct s3c2410_dma_stats *stats, int val)
+{
+       if (stats == NULL)
+               return;
+
+       if (val > stats->timeout_longest)
+               stats->timeout_longest = val;
+       if (val < stats->timeout_shortest)
+               stats->timeout_shortest = val;
+
+       stats->timeout_avg += val;
+}
+
+/* s3c2410_dma_waitforload
+ *
+ * wait for the DMA engine to load a buffer, and update the state accordingly
+*/
+
+static int
+s3c2410_dma_waitforload(struct s3c2410_dma_chan *chan, int line)
+{
+       int timeout = chan->load_timeout;
+       int took;
+
+       if (chan->load_state != S3C2410_DMALOAD_1LOADED) {
+               printk(KERN_ERR "dma%d: s3c2410_dma_waitforload() called in loadstate %d from line %d\n", chan->number, chan->load_state, line);
+               return 0;
+       }
+
+       if (chan->stats != NULL)
+               chan->stats->loads++;
+
+       while (--timeout > 0) {
+               if ((dma_rdreg(chan, S3C2410_DMA_DSTAT) << (32-20)) != 0) {
+                       took = chan->load_timeout - timeout;
+
+                       s3c2410_dma_stats_timeout(chan->stats, took);
+
+                       switch (chan->load_state) {
+                       case S3C2410_DMALOAD_1LOADED:
+                               chan->load_state = S3C2410_DMALOAD_1RUNNING;
+                               break;
+
+                       default:
+                               printk(KERN_ERR "dma%d: unknown load_state in s3c2410_dma_waitforload() %d\n", chan->number, chan->load_state);
+                       }
+
+                       return 1;
+               }
+       }
+
+       if (chan->stats != NULL) {
+               chan->stats->timeout_failed++;
+       }
+
+       return 0;
+}
+
+
+
+/* s3c2410_dma_loadbuffer
+ *
+ * load a buffer, and update the channel state
+*/
+
+static inline int
+s3c2410_dma_loadbuffer(struct s3c2410_dma_chan *chan,
+                      struct s3c2410_dma_buf *buf)
+{
+       unsigned long reload;
+
+       pr_debug("s3c2410_chan_loadbuffer: loading buff %p (0x%08lx,0x%06x)\n",
+                buf, (unsigned long)buf->data, buf->size);
+
+       if (buf == NULL) {
+               dmawarn("buffer is NULL\n");
+               return -EINVAL;
+       }
+
+       /* check the state of the channel before we do anything */
+
+       if (chan->load_state == S3C2410_DMALOAD_1LOADED) {
+               dmawarn("load_state is S3C2410_DMALOAD_1LOADED\n");
+       }
+
+       if (chan->load_state == S3C2410_DMALOAD_1LOADED_1RUNNING) {
+               dmawarn("state is S3C2410_DMALOAD_1LOADED_1RUNNING\n");
+       }
+
+       /* it would seem sensible if we are the last buffer to not bother
+        * with the auto-reload bit, so that the DMA engine will not try
+        * and load another transfer after this one has finished...
+        */
+       if (chan->load_state == S3C2410_DMALOAD_NONE) {
+               pr_debug("load_state is none, checking for noreload (next=%p)\n",
+                        buf->next);
+               reload = (buf->next == NULL) ? S3C2410_DCON_NORELOAD : 0;
+       } else {
+               //pr_debug("load_state is %d => autoreload\n", chan->load_state);
+               reload = S3C2410_DCON_AUTORELOAD;
+       }
+
+       if ((buf->data & 0xf0000000) != 0x30000000) {
+               dmawarn("dmaload: buffer is %p\n", (void *)buf->data);
+       }
+
+       writel(buf->data, chan->addr_reg);
+
+       dma_wrreg(chan, S3C2410_DMA_DCON,
+                 chan->dcon | reload | (buf->size/chan->xfer_unit));
+
+       chan->next = buf->next;
+
+       /* update the state of the channel */
+
+       switch (chan->load_state) {
+       case S3C2410_DMALOAD_NONE:
+               chan->load_state = S3C2410_DMALOAD_1LOADED;
+               break;
+
+       case S3C2410_DMALOAD_1RUNNING:
+               chan->load_state = S3C2410_DMALOAD_1LOADED_1RUNNING;
+               break;
+
+       default:
+               dmawarn("dmaload: unknown state %d in loadbuffer\n",
+                       chan->load_state);
+               break;
+       }
+
+       return 0;
+}
+
+/* s3c2410_dma_call_op
+ *
+ * small routine to call the op routine with the given op if it has been
+ * registered
+*/
+
+static void
+s3c2410_dma_call_op(struct s3c2410_dma_chan *chan, enum s3c2410_chan_op op)
+{
+       if (chan->op_fn != NULL) {
+               (chan->op_fn)(chan, op);
+       }
+}
+
+/* s3c2410_dma_buffdone
+ *
+ * small wrapper to check if callback routine needs to be called, and
+ * if so, call it
+*/
+
+static inline void
+s3c2410_dma_buffdone(struct s3c2410_dma_chan *chan, struct s3c2410_dma_buf *buf,
+                    enum s3c2410_dma_buffresult result)
+{
+#if 0
+       pr_debug("callback_fn=%p, buf=%p, id=%p, size=%d, result=%d\n",
+                chan->callback_fn, buf, buf->id, buf->size, result);
+#endif
+
+       if (chan->callback_fn != NULL) {
+               (chan->callback_fn)(chan, buf->id, buf->size, result);
+       }
+}
+
+/* s3c2410_dma_start
+ *
+ * start a dma channel going
+*/
+
+static int s3c2410_dma_start(struct s3c2410_dma_chan *chan)
+{
+       unsigned long tmp;
+       unsigned long flags;
+
+       pr_debug("s3c2410_start_dma: channel=%d\n", chan->number);
+
+       local_irq_save(flags);
+
+       if (chan->state == S3C2410_DMA_RUNNING) {
+               pr_debug("s3c2410_start_dma: already running (%d)\n", chan->state);
+               local_irq_restore(flags);
+               return 0;
+       }
+
+       chan->state = S3C2410_DMA_RUNNING;
+
+       /* check wether there is anything to load, and if not, see
+        * if we can find anything to load
+        */
+
+       if (chan->load_state == S3C2410_DMALOAD_NONE) {
+               if (chan->next == NULL) {
+                       printk(KERN_ERR "dma%d: channel has nothing loaded\n",
+                              chan->number);
+                       chan->state = S3C2410_DMA_IDLE;
+                       local_irq_restore(flags);
+                       return -EINVAL;
+               }
+
+               s3c2410_dma_loadbuffer(chan, chan->next);
+       }
+
+       dbg_showchan(chan);
+
+       /* enable the channel */
+
+       if (!chan->irq_enabled) {
+               enable_irq(chan->irq);
+               chan->irq_enabled = 1;
+       }
+
+       /* start the channel going */
+
+       tmp = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
+       tmp &= ~S3C2410_DMASKTRIG_STOP;
+       tmp |= S3C2410_DMASKTRIG_ON;
+       dma_wrreg(chan, S3C2410_DMA_DMASKTRIG, tmp);
+
+       pr_debug("dma%d: %08lx to DMASKTRIG\n", chan->number, tmp);
+
+#if 0
+       /* the dma buffer loads should take care of clearing the AUTO
+        * reloading feature */
+       tmp = dma_rdreg(chan, S3C2410_DMA_DCON);
+       tmp &= ~S3C2410_DCON_NORELOAD;
+       dma_wrreg(chan, S3C2410_DMA_DCON, tmp);
+#endif
+
+       s3c2410_dma_call_op(chan, S3C2410_DMAOP_START);
+
+       dbg_showchan(chan);
+
+       /* if we've only loaded one buffer onto the channel, then chec
+        * to see if we have another, and if so, try and load it so when
+        * the first buffer is finished, the new one will be loaded onto
+        * the channel */
+
+       if (chan->next != NULL) {
+               if (chan->load_state == S3C2410_DMALOAD_1LOADED) {
+
+                       if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
+                               pr_debug("%s: buff not yet loaded, no more todo\n",
+                                        __FUNCTION__);
+                       } else {
+                               chan->load_state = S3C2410_DMALOAD_1RUNNING;
+                               s3c2410_dma_loadbuffer(chan, chan->next);
+                       }
+
+               } else if (chan->load_state == S3C2410_DMALOAD_1RUNNING) {
+                       s3c2410_dma_loadbuffer(chan, chan->next);
+               }
+       }
+
+
+       local_irq_restore(flags);
+
+       return 0;
+}
+
+/* s3c2410_dma_canload
+ *
+ * work out if we can queue another buffer into the DMA engine
+*/
+
+static int
+s3c2410_dma_canload(struct s3c2410_dma_chan *chan)
+{
+       if (chan->load_state == S3C2410_DMALOAD_NONE ||
+           chan->load_state == S3C2410_DMALOAD_1RUNNING)
+               return 1;
+
+       return 0;
+}
+
+/* s3c2410_dma_enqueue
+ *
+ * queue an given buffer for dma transfer.
+ *
+ * id         the device driver's id information for this buffer
+ * data       the physical address of the buffer data
+ * size       the size of the buffer in bytes
+ *
+ * If the channel is not running, then the flag S3C2410_DMAF_AUTOSTART
+ * is checked, and if set, the channel is started. If this flag isn't set,
+ * then an error will be returned.
+ *
+ * It is possible to queue more than one DMA buffer onto a channel at
+ * once, and the code will deal with the re-loading of the next buffer
+ * when necessary.
+*/
+
+int s3c2410_dma_enqueue(unsigned int channel, void *id,
+                       dma_addr_t data, int size)
+{
+       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
+       struct s3c2410_dma_buf *buf;
+       unsigned long flags;
+
+       if (chan == NULL)
+               return -EINVAL;
+
+       pr_debug("%s: id=%p, data=%08x, size=%d\n",
+                __FUNCTION__, id, (unsigned int)data, size);
+
+       buf = kmem_cache_alloc(dma_kmem, GFP_ATOMIC);
+       if (buf == NULL) {
+               pr_debug("%s: out of memory (%ld alloc)\n",
+                        __FUNCTION__, (long)sizeof(*buf));
+               return -ENOMEM;
+       }
+
+       //pr_debug("%s: new buffer %p\n", __FUNCTION__, buf);
+       //dbg_showchan(chan);
+
+       buf->next  = NULL;
+       buf->data  = buf->ptr = data;
+       buf->size  = size;
+       buf->id    = id;
+       buf->magic = BUF_MAGIC;
+
+       local_irq_save(flags);
+
+       if (chan->curr == NULL) {
+               /* we've got nothing loaded... */
+               pr_debug("%s: buffer %p queued onto empty channel\n",
+                        __FUNCTION__, buf);
+
+               chan->curr = buf;
+               chan->end  = buf;
+               chan->next = NULL;
+       } else {
+               pr_debug("dma%d: %s: buffer %p queued onto non-empty channel\n",
+                        chan->number, __FUNCTION__, buf);
+
+               if (chan->end == NULL)
+                       pr_debug("dma%d: %s: %p not empty, and chan->end==NULL?\n",
+                                chan->number, __FUNCTION__, chan);
+
+               chan->end->next = buf;
+               chan->end = buf;
+       }
+
+       /* if necessary, update the next buffer field */
+       if (chan->next == NULL)
+               chan->next = buf;
+
+       /* check to see if we can load a buffer */
+       if (chan->state == S3C2410_DMA_RUNNING) {
+               if (chan->load_state == S3C2410_DMALOAD_1LOADED && 1) {
+                       if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
+                               printk(KERN_ERR "dma%d: loadbuffer:"
+                                      "timeout loading buffer\n",
+                                      chan->number);
+                               dbg_showchan(chan);
+                               local_irq_restore(flags);
+                               return -EINVAL;
+                       }
+               }
+
+               while (s3c2410_dma_canload(chan) && chan->next != NULL) {
+                       s3c2410_dma_loadbuffer(chan, chan->next);
+               }
+       } else if (chan->state == S3C2410_DMA_IDLE) {
+               if (chan->flags & S3C2410_DMAF_AUTOSTART) {
+                       s3c2410_dma_ctrl(chan->number, S3C2410_DMAOP_START);
+               }
+       }
+
+       local_irq_restore(flags);
+       return 0;
+}
+
+EXPORT_SYMBOL(s3c2410_dma_enqueue);
+
+static inline void
+s3c2410_dma_freebuf(struct s3c2410_dma_buf *buf)
+{
+       int magicok = (buf->magic == BUF_MAGIC);
+
+       buf->magic = -1;
+
+       if (magicok) {
+               kmem_cache_free(dma_kmem, buf);
+       } else {
+               printk("s3c2410_dma_freebuf: buff %p with bad magic\n", buf);
+       }
+}
+
+/* s3c2410_dma_lastxfer
+ *
+ * called when the system is out of buffers, to ensure that the channel
+ * is prepared for shutdown.
+*/
+
+static inline void
+s3c2410_dma_lastxfer(struct s3c2410_dma_chan *chan)
+{
+#if 0
+       pr_debug("dma%d: s3c2410_dma_lastxfer: load_state %d\n",
+                chan->number, chan->load_state);
+#endif
+
+       switch (chan->load_state) {
+       case S3C2410_DMALOAD_NONE:
+               break;
+
+       case S3C2410_DMALOAD_1LOADED:
+               if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
+                               /* flag error? */
+                       printk(KERN_ERR "dma%d: timeout waiting for load (%s)\n",
+                              chan->number, __FUNCTION__);
+                       return;
+               }
+               break;
+
+       case S3C2410_DMALOAD_1LOADED_1RUNNING:
+               /* I belive in this case we do not have anything to do
+                * until the next buffer comes along, and we turn off the
+                * reload */
+               return;
+
+       default:
+               pr_debug("dma%d: lastxfer: unhandled load_state %d with no next\n",
+                        chan->number, chan->load_state);
+               return;
+
+       }
+
+       /* hopefully this'll shut the damned thing up after the transfer... */
+       dma_wrreg(chan, S3C2410_DMA_DCON, chan->dcon | S3C2410_DCON_NORELOAD);
+}
+
+
+#define dmadbg2(x...)
+
+static irqreturn_t
+s3c2410_dma_irq(int irq, void *devpw)
+{
+       struct s3c2410_dma_chan *chan = (struct s3c2410_dma_chan *)devpw;
+       struct s3c2410_dma_buf  *buf;
+
+       buf = chan->curr;
+
+       dbg_showchan(chan);
+
+       /* modify the channel state */
+
+       switch (chan->load_state) {
+       case S3C2410_DMALOAD_1RUNNING:
+               /* TODO - if we are running only one buffer, we probably
+                * want to reload here, and then worry about the buffer
+                * callback */
+
+               chan->load_state = S3C2410_DMALOAD_NONE;
+               break;
+
+       case S3C2410_DMALOAD_1LOADED:
+               /* iirc, we should go back to NONE loaded here, we
+                * had a buffer, and it was never verified as being
+                * loaded.
+                */
+
+               chan->load_state = S3C2410_DMALOAD_NONE;
+               break;
+
+       case S3C2410_DMALOAD_1LOADED_1RUNNING:
+               /* we'll worry about checking to see if another buffer is
+                * ready after we've called back the owner. This should
+                * ensure we do not wait around too long for the DMA
+                * engine to start the next transfer
+                */
+
+               chan->load_state = S3C2410_DMALOAD_1LOADED;
+               break;
+
+       case S3C2410_DMALOAD_NONE:
+               printk(KERN_ERR "dma%d: IRQ with no loaded buffer?\n",
+                      chan->number);
+               break;
+
+       default:
+               printk(KERN_ERR "dma%d: IRQ in invalid load_state %d\n",
+                      chan->number, chan->load_state);
+               break;
+       }
+
+       if (buf != NULL) {
+               /* update the chain to make sure that if we load any more
+                * buffers when we call the callback function, things should
+                * work properly */
+
+               chan->curr = buf->next;
+               buf->next  = NULL;
+
+               if (buf->magic != BUF_MAGIC) {
+                       printk(KERN_ERR "dma%d: %s: buf %p incorrect magic\n",
+                              chan->number, __FUNCTION__, buf);
+                       return IRQ_HANDLED;
+               }
+
+               s3c2410_dma_buffdone(chan, buf, S3C2410_RES_OK);
+
+               /* free resouces */
+               s3c2410_dma_freebuf(buf);
+       } else {
+       }
+
+       /* only reload if the channel is still running... our buffer done
+        * routine may have altered the state by requesting the dma channel
+        * to stop or shutdown... */
+
+       /* todo: check that when the channel is shut-down from inside this
+        * function, we cope with unsetting reload, etc */
+
+       if (chan->next != NULL && chan->state != S3C2410_DMA_IDLE) {
+               unsigned long flags;
+
+               switch (chan->load_state) {
+               case S3C2410_DMALOAD_1RUNNING:
+                       /* don't need to do anything for this state */
+                       break;
+
+               case S3C2410_DMALOAD_NONE:
+                       /* can load buffer immediately */
+                       break;
+
+               case S3C2410_DMALOAD_1LOADED:
+                       if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
+                               /* flag error? */
+                               printk(KERN_ERR "dma%d: timeout waiting for load (%s)\n",
+                                      chan->number, __FUNCTION__);
+                               return IRQ_HANDLED;
+                       }
+
+                       break;
+
+               case S3C2410_DMALOAD_1LOADED_1RUNNING:
+                       goto no_load;
+
+               default:
+                       printk(KERN_ERR "dma%d: unknown load_state in irq, %d\n",
+                              chan->number, chan->load_state);
+                       return IRQ_HANDLED;
+               }
+
+               local_irq_save(flags);
+               s3c2410_dma_loadbuffer(chan, chan->next);
+               local_irq_restore(flags);
+       } else {
+               s3c2410_dma_lastxfer(chan);
+
+               /* see if we can stop this channel.. */
+               if (chan->load_state == S3C2410_DMALOAD_NONE) {
+                       pr_debug("dma%d: end of transfer, stopping channel (%ld)\n",
+                                chan->number, jiffies);
+                       s3c2410_dma_ctrl(chan->number | DMACH_LOW_LEVEL,
+                                        S3C2410_DMAOP_STOP);
+               }
+       }
+
+ no_load:
+       return IRQ_HANDLED;
+}
+
+static struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel);
+
+/* s3c2410_request_dma
+ *
+ * get control of an dma channel
+*/
+
+int s3c2410_dma_request(unsigned int channel,
+                       struct s3c2410_dma_client *client,
+                       void *dev)
+{
+       struct s3c2410_dma_chan *chan;
+       unsigned long flags;
+       int err;
+
+       pr_debug("dma%d: s3c2410_request_dma: client=%s, dev=%p\n",
+                channel, client->name, dev);
+
+       local_irq_save(flags);
+
+       chan = s3c2410_dma_map_channel(channel);
+       if (chan == NULL) {
+               local_irq_restore(flags);
+               return -EBUSY;
+       }
+
+       dbg_showchan(chan);
+
+       chan->client = client;
+       chan->in_use = 1;
+
+       if (!chan->irq_claimed) {
+               pr_debug("dma%d: %s : requesting irq %d\n",
+                        channel, __FUNCTION__, chan->irq);
+
+               chan->irq_claimed = 1;
+               local_irq_restore(flags);
+
+               err = request_irq(chan->irq, s3c2410_dma_irq, IRQF_DISABLED,
+                                 client->name, (void *)chan);
+
+               local_irq_save(flags);
+
+               if (err) {
+                       chan->in_use = 0;
+                       chan->irq_claimed = 0;
+                       local_irq_restore(flags);
+
+                       printk(KERN_ERR "%s: cannot get IRQ %d for DMA %d\n",
+                              client->name, chan->irq, chan->number);
+                       return err;
+               }
+
+               chan->irq_enabled = 1;
+       }
+
+       local_irq_restore(flags);
+
+       /* need to setup */
+
+       pr_debug("%s: channel initialised, %p\n", __FUNCTION__, chan);
+
+       return 0;
+}
+
+EXPORT_SYMBOL(s3c2410_dma_request);
+
+/* s3c2410_dma_free
+ *
+ * release the given channel back to the system, will stop and flush
+ * any outstanding transfers, and ensure the channel is ready for the
+ * next claimant.
+ *
+ * Note, although a warning is currently printed if the freeing client
+ * info is not the same as the registrant's client info, the free is still
+ * allowed to go through.
+*/
+
+int s3c2410_dma_free(dmach_t channel, struct s3c2410_dma_client *client)
+{
+       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
+       unsigned long flags;
+
+       if (chan == NULL)
+               return -EINVAL;
+
+       local_irq_save(flags);
+
+       if (chan->client != client) {
+               printk(KERN_WARNING "dma%d: possible free from different client (channel %p, passed %p)\n",
+                      channel, chan->client, client);
+       }
+
+       /* sort out stopping and freeing the channel */
+
+       if (chan->state != S3C2410_DMA_IDLE) {
+               pr_debug("%s: need to stop dma channel %p\n",
+                      __FUNCTION__, chan);
+
+               /* possibly flush the channel */
+               s3c2410_dma_ctrl(channel, S3C2410_DMAOP_STOP);
+       }
+
+       chan->client = NULL;
+       chan->in_use = 0;
+
+       if (chan->irq_claimed)
+               free_irq(chan->irq, (void *)chan);
+
+       chan->irq_claimed = 0;
+
+       if (!(channel & DMACH_LOW_LEVEL))
+               dma_chan_map[channel] = NULL;
+
+       local_irq_restore(flags);
+
+       return 0;
+}
+
+EXPORT_SYMBOL(s3c2410_dma_free);
+
+static int s3c2410_dma_dostop(struct s3c2410_dma_chan *chan)
+{
+       unsigned long flags;
+       unsigned long tmp;
+
+       pr_debug("%s:\n", __FUNCTION__);
+
+       dbg_showchan(chan);
+
+       local_irq_save(flags);
+
+       s3c2410_dma_call_op(chan,  S3C2410_DMAOP_STOP);
+
+       tmp = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
+       tmp |= S3C2410_DMASKTRIG_STOP;
+       //tmp &= ~S3C2410_DMASKTRIG_ON;
+       dma_wrreg(chan, S3C2410_DMA_DMASKTRIG, tmp);
+
+#if 0
+       /* should also clear interrupts, according to WinCE BSP */
+       tmp = dma_rdreg(chan, S3C2410_DMA_DCON);
+       tmp |= S3C2410_DCON_NORELOAD;
+       dma_wrreg(chan, S3C2410_DMA_DCON, tmp);
+#endif
+
+       /* should stop do this, or should we wait for flush? */
+       chan->state      = S3C2410_DMA_IDLE;
+       chan->load_state = S3C2410_DMALOAD_NONE;
+
+       local_irq_restore(flags);
+
+       return 0;
+}
+
+void s3c2410_dma_waitforstop(struct s3c2410_dma_chan *chan)
+{
+       unsigned long tmp;
+       unsigned int timeout = 0x10000;
+
+       while (timeout-- > 0) {
+               tmp = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
+
+               if (!(tmp & S3C2410_DMASKTRIG_ON))
+                       return;
+       }
+
+       pr_debug("dma%d: failed to stop?\n", chan->number);
+}
+
+
+/* s3c2410_dma_flush
+ *
+ * stop the channel, and remove all current and pending transfers
+*/
+
+static int s3c2410_dma_flush(struct s3c2410_dma_chan *chan)
+{
+       struct s3c2410_dma_buf *buf, *next;
+       unsigned long flags;
+
+       pr_debug("%s: chan %p (%d)\n", __FUNCTION__, chan, chan->number);
+
+       dbg_showchan(chan);
+
+       local_irq_save(flags);
+
+       if (chan->state != S3C2410_DMA_IDLE) {
+               pr_debug("%s: stopping channel...\n", __FUNCTION__ );
+               s3c2410_dma_ctrl(chan->number, S3C2410_DMAOP_STOP);
+       }
+
+       buf = chan->curr;
+       if (buf == NULL)
+               buf = chan->next;
+
+       chan->curr = chan->next = chan->end = NULL;
+
+       if (buf != NULL) {
+               for ( ; buf != NULL; buf = next) {
+                       next = buf->next;
+
+                       pr_debug("%s: free buffer %p, next %p\n",
+                              __FUNCTION__, buf, buf->next);
+
+                       s3c2410_dma_buffdone(chan, buf, S3C2410_RES_ABORT);
+                       s3c2410_dma_freebuf(buf);
+               }
+       }
+
+       dbg_showregs(chan);
+
+       s3c2410_dma_waitforstop(chan);
+
+#if 0
+       /* should also clear interrupts, according to WinCE BSP */
+       {
+               unsigned long tmp;
+
+               tmp = dma_rdreg(chan, S3C2410_DMA_DCON);
+               tmp |= S3C2410_DCON_NORELOAD;
+               dma_wrreg(chan, S3C2410_DMA_DCON, tmp);
+       }
+#endif
+
+       dbg_showregs(chan);
+
+       local_irq_restore(flags);
+
+       return 0;
+}
+
+int
+s3c2410_dma_started(struct s3c2410_dma_chan *chan)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+
+       dbg_showchan(chan);
+
+       /* if we've only loaded one buffer onto the channel, then chec
+        * to see if we have another, and if so, try and load it so when
+        * the first buffer is finished, the new one will be loaded onto
+        * the channel */
+
+       if (chan->next != NULL) {
+               if (chan->load_state == S3C2410_DMALOAD_1LOADED) {
+
+                       if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
+                               pr_debug("%s: buff not yet loaded, no more todo\n",
+                                        __FUNCTION__);
+                       } else {
+                               chan->load_state = S3C2410_DMALOAD_1RUNNING;
+                               s3c2410_dma_loadbuffer(chan, chan->next);
+                       }
+
+               } else if (chan->load_state == S3C2410_DMALOAD_1RUNNING) {
+                       s3c2410_dma_loadbuffer(chan, chan->next);
+               }
+       }
+
+
+       local_irq_restore(flags);
+
+       return 0;
+
+}
+
+int
+s3c2410_dma_ctrl(dmach_t channel, enum s3c2410_chan_op op)
+{
+       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
+
+       if (chan == NULL)
+               return -EINVAL;
+
+       switch (op) {
+       case S3C2410_DMAOP_START:
+               return s3c2410_dma_start(chan);
+
+       case S3C2410_DMAOP_STOP:
+               return s3c2410_dma_dostop(chan);
+
+       case S3C2410_DMAOP_PAUSE:
+       case S3C2410_DMAOP_RESUME:
+               return -ENOENT;
+
+       case S3C2410_DMAOP_FLUSH:
+               return s3c2410_dma_flush(chan);
+
+       case S3C2410_DMAOP_STARTED:
+               return s3c2410_dma_started(chan);
+
+       case S3C2410_DMAOP_TIMEOUT:
+               return 0;
+
+       }
+
+       return -ENOENT;      /* unknown, don't bother */
+}
+
+EXPORT_SYMBOL(s3c2410_dma_ctrl);
+
+/* DMA configuration for each channel
+ *
+ * DISRCC -> source of the DMA (AHB,APB)
+ * DISRC  -> source address of the DMA
+ * DIDSTC -> destination of the DMA (AHB,APD)
+ * DIDST  -> destination address of the DMA
+*/
+
+/* s3c2410_dma_config
+ *
+ * xfersize:     size of unit in bytes (1,2,4)
+ * dcon:         base value of the DCONx register
+*/
+
+int s3c2410_dma_config(dmach_t channel,
+                      int xferunit,
+                      int dcon)
+{
+       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
+
+       pr_debug("%s: chan=%d, xfer_unit=%d, dcon=%08x\n",
+                __FUNCTION__, channel, xferunit, dcon);
+
+       if (chan == NULL)
+               return -EINVAL;
+
+       pr_debug("%s: Initial dcon is %08x\n", __FUNCTION__, dcon);
+
+       dcon |= chan->dcon & dma_sel.dcon_mask;
+
+       pr_debug("%s: New dcon is %08x\n", __FUNCTION__, dcon);
+
+       switch (xferunit) {
+       case 1:
+               dcon |= S3C2410_DCON_BYTE;
+               break;
+
+       case 2:
+               dcon |= S3C2410_DCON_HALFWORD;
+               break;
+
+       case 4:
+               dcon |= S3C2410_DCON_WORD;
+               break;
+
+       default:
+               pr_debug("%s: bad transfer size %d\n", __FUNCTION__, xferunit);
+               return -EINVAL;
+       }
+
+       dcon |= S3C2410_DCON_HWTRIG;
+       dcon |= S3C2410_DCON_INTREQ;
+
+       pr_debug("%s: dcon now %08x\n", __FUNCTION__, dcon);
+
+       chan->dcon = dcon;
+       chan->xfer_unit = xferunit;
+
+       return 0;
+}
+
+EXPORT_SYMBOL(s3c2410_dma_config);
+
+int s3c2410_dma_setflags(dmach_t channel, unsigned int flags)
+{
+       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
+
+       if (chan == NULL)
+               return -EINVAL;
+
+       pr_debug("%s: chan=%p, flags=%08x\n", __FUNCTION__, chan, flags);
+
+       chan->flags = flags;
+
+       return 0;
+}
+
+EXPORT_SYMBOL(s3c2410_dma_setflags);
+
+
+/* do we need to protect the settings of the fields from
+ * irq?
+*/
+
+int s3c2410_dma_set_opfn(dmach_t channel, s3c2410_dma_opfn_t rtn)
+{
+       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
+
+       if (chan == NULL)
+               return -EINVAL;
+
+       pr_debug("%s: chan=%p, op rtn=%p\n", __FUNCTION__, chan, rtn);
+
+       chan->op_fn = rtn;
+
+       return 0;
+}
+
+EXPORT_SYMBOL(s3c2410_dma_set_opfn);
+
+int s3c2410_dma_set_buffdone_fn(dmach_t channel, s3c2410_dma_cbfn_t rtn)
+{
+       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
+
+       if (chan == NULL)
+               return -EINVAL;
+
+       pr_debug("%s: chan=%p, callback rtn=%p\n", __FUNCTION__, chan, rtn);
+
+       chan->callback_fn = rtn;
+
+       return 0;
+}
+
+EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn);
+
+/* s3c2410_dma_devconfig
+ *
+ * configure the dma source/destination hardware type and address
+ *
+ * source:    S3C2410_DMASRC_HW: source is hardware
+ *            S3C2410_DMASRC_MEM: source is memory
+ *
+ * hwcfg:     the value for xxxSTCn register,
+ *            bit 0: 0=increment pointer, 1=leave pointer
+ *            bit 1: 0=soucre is AHB, 1=soucre is APB
+ *
+ * devaddr:   physical address of the source
+*/
+
+int s3c2410_dma_devconfig(int channel,
+                         enum s3c2410_dmasrc source,
+                         int hwcfg,
+                         unsigned long devaddr)
+{
+       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
+
+       if (chan == NULL)
+               return -EINVAL;
+
+       pr_debug("%s: source=%d, hwcfg=%08x, devaddr=%08lx\n",
+                __FUNCTION__, (int)source, hwcfg, devaddr);
+
+       chan->source = source;
+       chan->dev_addr = devaddr;
+
+       switch (source) {
+       case S3C2410_DMASRC_HW:
+               /* source is hardware */
+               pr_debug("%s: hw source, devaddr=%08lx, hwcfg=%d\n",
+                        __FUNCTION__, devaddr, hwcfg);
+               dma_wrreg(chan, S3C2410_DMA_DISRCC, hwcfg & 3);
+               dma_wrreg(chan, S3C2410_DMA_DISRC,  devaddr);
+               dma_wrreg(chan, S3C2410_DMA_DIDSTC, (0<<1) | (0<<0));
+
+               chan->addr_reg = dma_regaddr(chan, S3C2410_DMA_DIDST);
+               return 0;
+
+       case S3C2410_DMASRC_MEM:
+               /* source is memory */
+               pr_debug( "%s: mem source, devaddr=%08lx, hwcfg=%d\n",
+                         __FUNCTION__, devaddr, hwcfg);
+               dma_wrreg(chan, S3C2410_DMA_DISRCC, (0<<1) | (0<<0));
+               dma_wrreg(chan, S3C2410_DMA_DIDST,  devaddr);
+               dma_wrreg(chan, S3C2410_DMA_DIDSTC, hwcfg & 3);
+
+               chan->addr_reg = dma_regaddr(chan, S3C2410_DMA_DISRC);
+               return 0;
+       }
+
+       printk(KERN_ERR "dma%d: invalid source type (%d)\n", channel, source);
+       return -EINVAL;
+}
+
+EXPORT_SYMBOL(s3c2410_dma_devconfig);
+
+/* s3c2410_dma_getposition
+ *
+ * returns the current transfer points for the dma source and destination
+*/
+
+int s3c2410_dma_getposition(dmach_t channel, dma_addr_t *src, dma_addr_t *dst)
+{
+       struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
+
+       if (chan == NULL)
+               return -EINVAL;
+
+       if (src != NULL)
+               *src = dma_rdreg(chan, S3C2410_DMA_DCSRC);
+
+       if (dst != NULL)
+               *dst = dma_rdreg(chan, S3C2410_DMA_DCDST);
+
+       return 0;
+}
+
+EXPORT_SYMBOL(s3c2410_dma_getposition);
+
+
+/* system device class */
+
+#ifdef CONFIG_PM
+
+static int s3c2410_dma_suspend(struct sys_device *dev, pm_message_t state)
+{
+       struct s3c2410_dma_chan *cp = container_of(dev, struct s3c2410_dma_chan, dev);
+
+       printk(KERN_DEBUG "suspending dma channel %d\n", cp->number);
+
+       if (dma_rdreg(cp, S3C2410_DMA_DMASKTRIG) & S3C2410_DMASKTRIG_ON) {
+               /* the dma channel is still working, which is probably
+                * a bad thing to do over suspend/resume. We stop the
+                * channel and assume that the client is either going to
+                * retry after resume, or that it is broken.
+                */
+
+               printk(KERN_INFO "dma: stopping channel %d due to suspend\n",
+                      cp->number);
+
+               s3c2410_dma_dostop(cp);
+       }
+
+       return 0;
+}
+
+static int s3c2410_dma_resume(struct sys_device *dev)
+{
+       return 0;
+}
+
+#else
+#define s3c2410_dma_suspend NULL
+#define s3c2410_dma_resume  NULL
+#endif /* CONFIG_PM */
+
+struct sysdev_class dma_sysclass = {
+       set_kset_name("s3c24xx-dma"),
+       .suspend        = s3c2410_dma_suspend,
+       .resume         = s3c2410_dma_resume,
+};
+
+/* kmem cache implementation */
+
+static void s3c2410_dma_cache_ctor(void *p, struct kmem_cache *c, unsigned long f)
+{
+       memset(p, 0, sizeof(struct s3c2410_dma_buf));
+}
+
+/* initialisation code */
+
+int __init s3c24xx_dma_sysclass_init(void)
+{
+       int ret = sysdev_class_register(&dma_sysclass);
+
+       if (ret != 0)
+               printk(KERN_ERR "dma sysclass registration failed\n");
+
+       return ret;
+}
+
+core_initcall(s3c24xx_dma_sysclass_init);
+
+int __init s3c24xx_dma_sysdev_register(void)
+{
+       struct s3c2410_dma_chan *cp = s3c2410_chans;
+       int channel, ret;
+
+       for (channel = 0; channel < dma_channels; cp++, channel++) {
+               cp->dev.cls = &dma_sysclass;
+               cp->dev.id  = channel;
+               ret = sysdev_register(&cp->dev);
+
+               if (ret) {
+                       printk(KERN_ERR "error registering dev for dma %d\n",
+                              channel);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+late_initcall(s3c24xx_dma_sysdev_register);
+
+int __init s3c24xx_dma_init(unsigned int channels, unsigned int irq,
+                           unsigned int stride)
+{
+       struct s3c2410_dma_chan *cp;
+       int channel;
+       int ret;
+
+       printk("S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics\n");
+
+       dma_channels = channels;
+
+       dma_base = ioremap(S3C24XX_PA_DMA, stride * channels);
+       if (dma_base == NULL) {
+               printk(KERN_ERR "dma failed to remap register block\n");
+               return -ENOMEM;
+       }
+
+       dma_kmem = kmem_cache_create("dma_desc",
+                                    sizeof(struct s3c2410_dma_buf), 0,
+                                    SLAB_HWCACHE_ALIGN,
+                                    s3c2410_dma_cache_ctor, NULL);
+
+       if (dma_kmem == NULL) {
+               printk(KERN_ERR "dma failed to make kmem cache\n");
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       for (channel = 0; channel < channels;  channel++) {
+               cp = &s3c2410_chans[channel];
+
+               memset(cp, 0, sizeof(struct s3c2410_dma_chan));
+
+               /* dma channel irqs are in order.. */
+               cp->number = channel;
+               cp->irq    = channel + irq;
+               cp->regs   = dma_base + (channel * stride);
+
+               /* point current stats somewhere */
+               cp->stats  = &cp->stats_store;
+               cp->stats_store.timeout_shortest = LONG_MAX;
+
+               /* basic channel configuration */
+
+               cp->load_timeout = 1<<18;
+
+               printk("DMA channel %d at %p, irq %d\n",
+                      cp->number, cp->regs, cp->irq);
+       }
+
+       return 0;
+
+ err:
+       kmem_cache_destroy(dma_kmem);
+       iounmap(dma_base);
+       dma_base = NULL;
+       return ret;
+}
+
+int s3c2410_dma_init(void)
+{
+       return s3c24xx_dma_init(4, IRQ_DMA0, 0x40);
+}
+
+static inline int is_channel_valid(unsigned int channel)
+{
+       return (channel & DMA_CH_VALID);
+}
+
+static struct s3c24xx_dma_order *dma_order;
+
+
+/* s3c2410_dma_map_channel()
+ *
+ * turn the virtual channel number into a real, and un-used hardware
+ * channel.
+ *
+ * first, try the dma ordering given to us by either the relevant
+ * dma code, or the board. Then just find the first usable free
+ * channel
+*/
+
+struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel)
+{
+       struct s3c24xx_dma_order_ch *ord = NULL;
+       struct s3c24xx_dma_map *ch_map;
+       struct s3c2410_dma_chan *dmach;
+       int ch;
+
+       if (dma_sel.map == NULL || channel > dma_sel.map_size)
+               return NULL;
+
+       ch_map = dma_sel.map + channel;
+
+       /* first, try the board mapping */
+
+       if (dma_order) {
+               ord = &dma_order->channels[channel];
+
+               for (ch = 0; ch < dma_channels; ch++) {
+                       if (!is_channel_valid(ord->list[ch]))
+                               continue;
+
+                       if (s3c2410_chans[ord->list[ch]].in_use == 0) {
+                               ch = ord->list[ch] & ~DMA_CH_VALID;
+                               goto found;
+                       }
+               }
+
+               if (ord->flags & DMA_CH_NEVER)
+                       return NULL;
+       }
+
+       /* second, search the channel map for first free */
+
+       for (ch = 0; ch < dma_channels; ch++) {
+               if (!is_channel_valid(ch_map->channels[ch]))
+                       continue;
+
+               if (s3c2410_chans[ch].in_use == 0) {
+                       printk("mapped channel %d to %d\n", channel, ch);
+                       break;
+               }
+       }
+
+       if (ch >= dma_channels)
+               return NULL;
+
+       /* update our channel mapping */
+
+ found:
+       dmach = &s3c2410_chans[ch];
+       dma_chan_map[channel] = dmach;
+
+       /* select the channel */
+
+       (dma_sel.select)(dmach, ch_map);
+
+       return dmach;
+}
+
+static int s3c24xx_dma_check_entry(struct s3c24xx_dma_map *map, int ch)
+{
+       return 0;
+}
+
+int __init s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel)
+{
+       struct s3c24xx_dma_map *nmap;
+       size_t map_sz = sizeof(*nmap) * sel->map_size;
+       int ptr;
+
+       nmap = kmalloc(map_sz, GFP_KERNEL);
+       if (nmap == NULL)
+               return -ENOMEM;
+
+       memcpy(nmap, sel->map, map_sz);
+       memcpy(&dma_sel, sel, sizeof(*sel));
+
+       dma_sel.map = nmap;
+
+       for (ptr = 0; ptr < sel->map_size; ptr++)
+               s3c24xx_dma_check_entry(nmap+ptr, ptr);
+
+       return 0;
+}
+
+int __init s3c24xx_dma_order_set(struct s3c24xx_dma_order *ord)
+{
+       struct s3c24xx_dma_order *nord = dma_order;
+
+       if (nord == NULL)
+               nord = kmalloc(sizeof(struct s3c24xx_dma_order), GFP_KERNEL);
+
+       if (nord == NULL) {
+               printk(KERN_ERR "no memory to store dma channel order\n");
+               return -ENOMEM;
+       }
+
+       dma_order = nord;
+       memcpy(nord, ord, sizeof(struct s3c24xx_dma_order));
+       return 0;
+}
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c
new file mode 100644 (file)
index 0000000..ec3a09c
--- /dev/null
@@ -0,0 +1,188 @@
+/* linux/arch/arm/plat-s3c24xx/gpio.c
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C24XX GPIO 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/arch/regs-gpio.h>
+
+void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function)
+{
+       void __iomem *base = S3C24XX_GPIO_BASE(pin);
+       unsigned long mask;
+       unsigned long con;
+       unsigned long flags;
+
+       if (pin < S3C2410_GPIO_BANKB) {
+               mask = 1 << S3C2410_GPIO_OFFSET(pin);
+       } else {
+               mask = 3 << S3C2410_GPIO_OFFSET(pin)*2;
+       }
+
+       switch (function) {
+       case S3C2410_GPIO_LEAVE:
+               mask = 0;
+               function = 0;
+               break;
+
+       case S3C2410_GPIO_INPUT:
+       case S3C2410_GPIO_OUTPUT:
+       case S3C2410_GPIO_SFN2:
+       case S3C2410_GPIO_SFN3:
+               if (pin < S3C2410_GPIO_BANKB) {
+                       function -= 1;
+                       function &= 1;
+                       function <<= S3C2410_GPIO_OFFSET(pin);
+               } else {
+                       function &= 3;
+                       function <<= S3C2410_GPIO_OFFSET(pin)*2;
+               }
+       }
+
+       /* modify the specified register wwith IRQs off */
+
+       local_irq_save(flags);
+
+       con  = __raw_readl(base + 0x00);
+       con &= ~mask;
+       con |= function;
+
+       __raw_writel(con, base + 0x00);
+
+       local_irq_restore(flags);
+}
+
+EXPORT_SYMBOL(s3c2410_gpio_cfgpin);
+
+unsigned int s3c2410_gpio_getcfg(unsigned int pin)
+{
+       void __iomem *base = S3C24XX_GPIO_BASE(pin);
+       unsigned long val = __raw_readl(base);
+
+       if (pin < S3C2410_GPIO_BANKB) {
+               val >>= S3C2410_GPIO_OFFSET(pin);
+               val &= 1;
+               val += 1;
+       } else {
+               val >>= S3C2410_GPIO_OFFSET(pin)*2;
+               val &= 3;
+       }
+
+       return val | S3C2410_GPIO_INPUT;
+}
+
+EXPORT_SYMBOL(s3c2410_gpio_getcfg);
+
+void s3c2410_gpio_pullup(unsigned int pin, unsigned int to)
+{
+       void __iomem *base = S3C24XX_GPIO_BASE(pin);
+       unsigned long offs = S3C2410_GPIO_OFFSET(pin);
+       unsigned long flags;
+       unsigned long up;
+
+       if (pin < S3C2410_GPIO_BANKB)
+               return;
+
+       local_irq_save(flags);
+
+       up = __raw_readl(base + 0x08);
+       up &= ~(1L << offs);
+       up |= to << offs;
+       __raw_writel(up, base + 0x08);
+
+       local_irq_restore(flags);
+}
+
+EXPORT_SYMBOL(s3c2410_gpio_pullup);
+
+void s3c2410_gpio_setpin(unsigned int pin, unsigned int to)
+{
+       void __iomem *base = S3C24XX_GPIO_BASE(pin);
+       unsigned long offs = S3C2410_GPIO_OFFSET(pin);
+       unsigned long flags;
+       unsigned long dat;
+
+       local_irq_save(flags);
+
+       dat = __raw_readl(base + 0x04);
+       dat &= ~(1 << offs);
+       dat |= to << offs;
+       __raw_writel(dat, base + 0x04);
+
+       local_irq_restore(flags);
+}
+
+EXPORT_SYMBOL(s3c2410_gpio_setpin);
+
+unsigned int s3c2410_gpio_getpin(unsigned int pin)
+{
+       void __iomem *base = S3C24XX_GPIO_BASE(pin);
+       unsigned long offs = S3C2410_GPIO_OFFSET(pin);
+
+       return __raw_readl(base + 0x04) & (1<< offs);
+}
+
+EXPORT_SYMBOL(s3c2410_gpio_getpin);
+
+unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change)
+{
+       unsigned long flags;
+       unsigned long misccr;
+
+       local_irq_save(flags);
+       misccr = __raw_readl(S3C24XX_MISCCR);
+       misccr &= ~clear;
+       misccr ^= change;
+       __raw_writel(misccr, S3C24XX_MISCCR);
+       local_irq_restore(flags);
+
+       return misccr;
+}
+
+EXPORT_SYMBOL(s3c2410_modify_misccr);
+
+int s3c2410_gpio_getirq(unsigned int pin)
+{
+       if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15)
+               return -1;      /* not valid interrupts */
+
+       if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7)
+               return -1;      /* not valid pin */
+
+       if (pin < S3C2410_GPF4)
+               return (pin - S3C2410_GPF0) + IRQ_EINT0;
+
+       if (pin < S3C2410_GPG0)
+               return (pin - S3C2410_GPF4) + IRQ_EINT4;
+
+       return (pin - S3C2410_GPG0) + IRQ_EINT8;
+}
+
+EXPORT_SYMBOL(s3c2410_gpio_getirq);
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
new file mode 100644 (file)
index 0000000..ce18639
--- /dev/null
@@ -0,0 +1,801 @@
+/* linux/arch/arm/plat-s3c24xx/irq.c
+ *
+ * Copyright (c) 2003,2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Changelog:
+ *
+ *   22-Jul-2004  Ben Dooks <ben@simtec.co.uk>
+ *                Fixed compile warnings
+ *
+ *   22-Jul-2004  Roc Wu <cooloney@yahoo.com.cn>
+ *                Fixed s3c_extirq_type
+ *
+ *   21-Jul-2004  Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
+ *                Addition of ADC/TC demux
+ *
+ *   04-Oct-2004  Klaus Fetscher <k.fetscher@fetron.de>
+ *               Fix for set_irq_type() on low EINT numbers
+ *
+ *   05-Oct-2004  Ben Dooks <ben@simtec.co.uk>
+ *               Tidy up KF's patch and sort out new release
+ *
+ *   05-Oct-2004  Ben Dooks <ben@simtec.co.uk>
+ *               Add support for power management controls
+ *
+ *   04-Nov-2004  Ben Dooks
+ *               Fix standard IRQ wake for EINT0..4 and RTC
+ *
+ *   22-Feb-2005  Ben Dooks
+ *               Fixed edge-triggering on ADC IRQ
+ *
+ *   28-Jun-2005  Ben Dooks
+ *               Mark IRQ_LCD valid
+ *
+ *   25-Jul-2005  Ben Dooks
+ *               Split the S3C2440 IRQ code to seperate file
+*/
+
+#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 <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/mach/irq.h>
+
+#include <asm/arch/regs-irq.h>
+#include <asm/arch/regs-gpio.h>
+
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
+#include <asm/plat-s3c24xx/irq.h>
+
+/* wakeup irq control */
+
+#ifdef CONFIG_PM
+
+/* state for IRQs over sleep */
+
+/* default is to allow for EINT0..EINT15, and IRQ_RTC as wakeup sources
+ *
+ * set bit to 1 in allow bitfield to enable the wakeup settings on it
+*/
+
+unsigned long s3c_irqwake_intallow     = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL;
+unsigned long s3c_irqwake_intmask      = 0xffffffffL;
+unsigned long s3c_irqwake_eintallow    = 0x0000fff0L;
+unsigned long s3c_irqwake_eintmask     = 0xffffffffL;
+
+int
+s3c_irq_wake(unsigned int irqno, unsigned int state)
+{
+       unsigned long irqbit = 1 << (irqno - IRQ_EINT0);
+
+       if (!(s3c_irqwake_intallow & irqbit))
+               return -ENOENT;
+
+       printk(KERN_INFO "wake %s for irq %d\n",
+              state ? "enabled" : "disabled", irqno);
+
+       if (!state)
+               s3c_irqwake_intmask |= irqbit;
+       else
+               s3c_irqwake_intmask &= ~irqbit;
+
+       return 0;
+}
+
+static int
+s3c_irqext_wake(unsigned int irqno, unsigned int state)
+{
+       unsigned long bit = 1L << (irqno - EXTINT_OFF);
+
+       if (!(s3c_irqwake_eintallow & bit))
+               return -ENOENT;
+
+       printk(KERN_INFO "wake %s for irq %d\n",
+              state ? "enabled" : "disabled", irqno);
+
+       if (!state)
+               s3c_irqwake_eintmask |= bit;
+       else
+               s3c_irqwake_eintmask &= ~bit;
+
+       return 0;
+}
+
+#else
+#define s3c_irqext_wake NULL
+#define s3c_irq_wake NULL
+#endif
+
+
+static void
+s3c_irq_mask(unsigned int irqno)
+{
+       unsigned long mask;
+
+       irqno -= IRQ_EINT0;
+
+       mask = __raw_readl(S3C2410_INTMSK);
+       mask |= 1UL << irqno;
+       __raw_writel(mask, S3C2410_INTMSK);
+}
+
+static inline void
+s3c_irq_ack(unsigned int irqno)
+{
+       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
+
+       __raw_writel(bitval, S3C2410_SRCPND);
+       __raw_writel(bitval, S3C2410_INTPND);
+}
+
+static inline void
+s3c_irq_maskack(unsigned int irqno)
+{
+       unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
+       unsigned long mask;
+
+       mask = __raw_readl(S3C2410_INTMSK);
+       __raw_writel(mask|bitval, S3C2410_INTMSK);
+
+       __raw_writel(bitval, S3C2410_SRCPND);
+       __raw_writel(bitval, S3C2410_INTPND);
+}
+
+
+static void
+s3c_irq_unmask(unsigned int irqno)
+{
+       unsigned long mask;
+
+       if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23)
+               irqdbf2("s3c_irq_unmask %d\n", irqno);
+
+       irqno -= IRQ_EINT0;
+
+       mask = __raw_readl(S3C2410_INTMSK);
+       mask &= ~(1UL << irqno);
+       __raw_writel(mask, S3C2410_INTMSK);
+}
+
+struct irq_chip s3c_irq_level_chip = {
+       .name           = "s3c-level",
+       .ack            = s3c_irq_maskack,
+       .mask           = s3c_irq_mask,
+       .unmask         = s3c_irq_unmask,
+       .set_wake       = s3c_irq_wake
+};
+
+static struct irq_chip s3c_irq_chip = {
+       .name           = "s3c",
+       .ack            = s3c_irq_ack,
+       .mask           = s3c_irq_mask,
+       .unmask         = s3c_irq_unmask,
+       .set_wake       = s3c_irq_wake
+};
+
+static void
+s3c_irqext_mask(unsigned int irqno)
+{
+       unsigned long mask;
+
+       irqno -= EXTINT_OFF;
+
+       mask = __raw_readl(S3C24XX_EINTMASK);
+       mask |= ( 1UL << irqno);
+       __raw_writel(mask, S3C24XX_EINTMASK);
+}
+
+static void
+s3c_irqext_ack(unsigned int irqno)
+{
+       unsigned long req;
+       unsigned long bit;
+       unsigned long mask;
+
+       bit = 1UL << (irqno - EXTINT_OFF);
+
+       mask = __raw_readl(S3C24XX_EINTMASK);
+
+       __raw_writel(bit, S3C24XX_EINTPEND);
+
+       req = __raw_readl(S3C24XX_EINTPEND);
+       req &= ~mask;
+
+       /* not sure if we should be acking the parent irq... */
+
+       if (irqno <= IRQ_EINT7 ) {
+               if ((req & 0xf0) == 0)
+                       s3c_irq_ack(IRQ_EINT4t7);
+       } else {
+               if ((req >> 8) == 0)
+                       s3c_irq_ack(IRQ_EINT8t23);
+       }
+}
+
+static void
+s3c_irqext_unmask(unsigned int irqno)
+{
+       unsigned long mask;
+
+       irqno -= EXTINT_OFF;
+
+       mask = __raw_readl(S3C24XX_EINTMASK);
+       mask &= ~( 1UL << irqno);
+       __raw_writel(mask, S3C24XX_EINTMASK);
+}
+
+int
+s3c_irqext_type(unsigned int irq, unsigned int type)
+{
+       void __iomem *extint_reg;
+       void __iomem *gpcon_reg;
+       unsigned long gpcon_offset, extint_offset;
+       unsigned long newvalue = 0, value;
+
+       if ((irq >= IRQ_EINT0) && (irq <= IRQ_EINT3))
+       {
+               gpcon_reg = S3C2410_GPFCON;
+               extint_reg = S3C24XX_EXTINT0;
+               gpcon_offset = (irq - IRQ_EINT0) * 2;
+               extint_offset = (irq - IRQ_EINT0) * 4;
+       }
+       else if ((irq >= IRQ_EINT4) && (irq <= IRQ_EINT7))
+       {
+               gpcon_reg = S3C2410_GPFCON;
+               extint_reg = S3C24XX_EXTINT0;
+               gpcon_offset = (irq - (EXTINT_OFF)) * 2;
+               extint_offset = (irq - (EXTINT_OFF)) * 4;
+       }
+       else if ((irq >= IRQ_EINT8) && (irq <= IRQ_EINT15))
+       {
+               gpcon_reg = S3C2410_GPGCON;
+               extint_reg = S3C24XX_EXTINT1;
+               gpcon_offset = (irq - IRQ_EINT8) * 2;
+               extint_offset = (irq - IRQ_EINT8) * 4;
+       }
+       else if ((irq >= IRQ_EINT16) && (irq <= IRQ_EINT23))
+       {
+               gpcon_reg = S3C2410_GPGCON;
+               extint_reg = S3C24XX_EXTINT2;
+               gpcon_offset = (irq - IRQ_EINT8) * 2;
+               extint_offset = (irq - IRQ_EINT16) * 4;
+       } else
+               return -1;
+
+       /* Set the GPIO to external interrupt mode */
+       value = __raw_readl(gpcon_reg);
+       value = (value & ~(3 << gpcon_offset)) | (0x02 << gpcon_offset);
+       __raw_writel(value, gpcon_reg);
+
+       /* Set the external interrupt to pointed trigger type */
+       switch (type)
+       {
+               case IRQT_NOEDGE:
+                       printk(KERN_WARNING "No edge setting!\n");
+                       break;
+
+               case IRQT_RISING:
+                       newvalue = S3C2410_EXTINT_RISEEDGE;
+                       break;
+
+               case IRQT_FALLING:
+                       newvalue = S3C2410_EXTINT_FALLEDGE;
+                       break;
+
+               case IRQT_BOTHEDGE:
+                       newvalue = S3C2410_EXTINT_BOTHEDGE;
+                       break;
+
+               case IRQT_LOW:
+                       newvalue = S3C2410_EXTINT_LOWLEV;
+                       break;
+
+               case IRQT_HIGH:
+                       newvalue = S3C2410_EXTINT_HILEV;
+                       break;
+
+               default:
+                       printk(KERN_ERR "No such irq type %d", type);
+                       return -1;
+       }
+
+       value = __raw_readl(extint_reg);
+       value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
+       __raw_writel(value, extint_reg);
+
+       return 0;
+}
+
+static struct irq_chip s3c_irqext_chip = {
+       .name           = "s3c-ext",
+       .mask           = s3c_irqext_mask,
+       .unmask         = s3c_irqext_unmask,
+       .ack            = s3c_irqext_ack,
+       .set_type       = s3c_irqext_type,
+       .set_wake       = s3c_irqext_wake
+};
+
+static struct irq_chip s3c_irq_eint0t4 = {
+       .name           = "s3c-ext0",
+       .ack            = s3c_irq_ack,
+       .mask           = s3c_irq_mask,
+       .unmask         = s3c_irq_unmask,
+       .set_wake       = s3c_irq_wake,
+       .set_type       = s3c_irqext_type,
+};
+
+/* mask values for the parent registers for each of the interrupt types */
+
+#define INTMSK_UART0    (1UL << (IRQ_UART0 - IRQ_EINT0))
+#define INTMSK_UART1    (1UL << (IRQ_UART1 - IRQ_EINT0))
+#define INTMSK_UART2    (1UL << (IRQ_UART2 - IRQ_EINT0))
+#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
+
+
+/* UART0 */
+
+static void
+s3c_irq_uart0_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_UART0, 7);
+}
+
+static void
+s3c_irq_uart0_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_UART0);
+}
+
+static void
+s3c_irq_uart0_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_UART0, 7);
+}
+
+static struct irq_chip s3c_irq_uart0 = {
+       .name           = "s3c-uart0",
+       .mask           = s3c_irq_uart0_mask,
+       .unmask         = s3c_irq_uart0_unmask,
+       .ack            = s3c_irq_uart0_ack,
+};
+
+/* UART1 */
+
+static void
+s3c_irq_uart1_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_UART1, 7 << 3);
+}
+
+static void
+s3c_irq_uart1_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_UART1);
+}
+
+static void
+s3c_irq_uart1_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_UART1, 7 << 3);
+}
+
+static struct irq_chip s3c_irq_uart1 = {
+       .name           = "s3c-uart1",
+       .mask           = s3c_irq_uart1_mask,
+       .unmask         = s3c_irq_uart1_unmask,
+       .ack            = s3c_irq_uart1_ack,
+};
+
+/* UART2 */
+
+static void
+s3c_irq_uart2_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_UART2, 7 << 6);
+}
+
+static void
+s3c_irq_uart2_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_UART2);
+}
+
+static void
+s3c_irq_uart2_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_UART2, 7 << 6);
+}
+
+static struct irq_chip s3c_irq_uart2 = {
+       .name           = "s3c-uart2",
+       .mask           = s3c_irq_uart2_mask,
+       .unmask         = s3c_irq_uart2_unmask,
+       .ack            = s3c_irq_uart2_ack,
+};
+
+/* ADC and Touchscreen */
+
+static void
+s3c_irq_adc_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_ADCPARENT, 3 << 9);
+}
+
+static void
+s3c_irq_adc_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_ADCPARENT);
+}
+
+static void
+s3c_irq_adc_ack(unsigned int irqno)
+{
+       s3c_irqsub_ack(irqno, INTMSK_ADCPARENT, 3 << 9);
+}
+
+static struct irq_chip s3c_irq_adc = {
+       .name           = "s3c-adc",
+       .mask           = s3c_irq_adc_mask,
+       .unmask         = s3c_irq_adc_unmask,
+       .ack            = s3c_irq_adc_ack,
+};
+
+/* irq demux for adc */
+static void s3c_irq_demux_adc(unsigned int irq,
+                             struct irq_desc *desc)
+{
+       unsigned int subsrc, submsk;
+       unsigned int offset = 9;
+       struct irq_desc *mydesc;
+
+       /* read the current pending interrupts, and the mask
+        * for what it is available */
+
+       subsrc = __raw_readl(S3C2410_SUBSRCPND);
+       submsk = __raw_readl(S3C2410_INTSUBMSK);
+
+       subsrc &= ~submsk;
+       subsrc >>= offset;
+       subsrc &= 3;
+
+       if (subsrc != 0) {
+               if (subsrc & 1) {
+                       mydesc = irq_desc + IRQ_TC;
+                       desc_handle_irq(IRQ_TC, mydesc);
+               }
+               if (subsrc & 2) {
+                       mydesc = irq_desc + IRQ_ADC;
+                       desc_handle_irq(IRQ_ADC, mydesc);
+               }
+       }
+}
+
+static void s3c_irq_demux_uart(unsigned int start)
+{
+       unsigned int subsrc, submsk;
+       unsigned int offset = start - IRQ_S3CUART_RX0;
+       struct irq_desc *desc;
+
+       /* read the current pending interrupts, and the mask
+        * for what it is available */
+
+       subsrc = __raw_readl(S3C2410_SUBSRCPND);
+       submsk = __raw_readl(S3C2410_INTSUBMSK);
+
+       irqdbf2("s3c_irq_demux_uart: start=%d (%d), subsrc=0x%08x,0x%08x\n",
+               start, offset, subsrc, submsk);
+
+       subsrc &= ~submsk;
+       subsrc >>= offset;
+       subsrc &= 7;
+
+       if (subsrc != 0) {
+               desc = irq_desc + start;
+
+               if (subsrc & 1)
+                       desc_handle_irq(start, desc);
+
+               desc++;
+
+               if (subsrc & 2)
+                       desc_handle_irq(start+1, desc);
+
+               desc++;
+
+               if (subsrc & 4)
+                       desc_handle_irq(start+2, desc);
+       }
+}
+
+/* uart demux entry points */
+
+static void
+s3c_irq_demux_uart0(unsigned int irq,
+                   struct irq_desc *desc)
+{
+       irq = irq;
+       s3c_irq_demux_uart(IRQ_S3CUART_RX0);
+}
+
+static void
+s3c_irq_demux_uart1(unsigned int irq,
+                   struct irq_desc *desc)
+{
+       irq = irq;
+       s3c_irq_demux_uart(IRQ_S3CUART_RX1);
+}
+
+static void
+s3c_irq_demux_uart2(unsigned int irq,
+                   struct irq_desc *desc)
+{
+       irq = irq;
+       s3c_irq_demux_uart(IRQ_S3CUART_RX2);
+}
+
+static void
+s3c_irq_demux_extint8(unsigned int irq,
+                     struct irq_desc *desc)
+{
+       unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
+       unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);
+
+       eintpnd &= ~eintmsk;
+       eintpnd &= ~0xff;       /* ignore lower irqs */
+
+       /* we may as well handle all the pending IRQs here */
+
+       while (eintpnd) {
+               irq = __ffs(eintpnd);
+               eintpnd &= ~(1<<irq);
+
+               irq += (IRQ_EINT4 - 4);
+               desc_handle_irq(irq, irq_desc + irq);
+       }
+
+}
+
+static void
+s3c_irq_demux_extint4t7(unsigned int irq,
+                       struct irq_desc *desc)
+{
+       unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
+       unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);
+
+       eintpnd &= ~eintmsk;
+       eintpnd &= 0xff;        /* only lower irqs */
+
+       /* we may as well handle all the pending IRQs here */
+
+       while (eintpnd) {
+               irq = __ffs(eintpnd);
+               eintpnd &= ~(1<<irq);
+
+               irq += (IRQ_EINT4 - 4);
+
+               desc_handle_irq(irq, irq_desc + irq);
+       }
+}
+
+#ifdef CONFIG_PM
+
+static struct sleep_save irq_save[] = {
+       SAVE_ITEM(S3C2410_INTMSK),
+       SAVE_ITEM(S3C2410_INTSUBMSK),
+};
+
+/* the extint values move between the s3c2410/s3c2440 and the s3c2412
+ * so we use an array to hold them, and to calculate the address of
+ * the register at run-time
+*/
+
+static unsigned long save_extint[3];
+static unsigned long save_eintflt[4];
+static unsigned long save_eintmask;
+
+int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state)
+{
+       unsigned int i;
+
+       for (i = 0; i < ARRAY_SIZE(save_extint); i++)
+               save_extint[i] = __raw_readl(S3C24XX_EXTINT0 + (i*4));
+
+       for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
+               save_eintflt[i] = __raw_readl(S3C24XX_EINFLT0 + (i*4));
+
+       s3c2410_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
+       save_eintmask = __raw_readl(S3C24XX_EINTMASK);
+
+       return 0;
+}
+
+int s3c24xx_irq_resume(struct sys_device *dev)
+{
+       unsigned int i;
+
+       for (i = 0; i < ARRAY_SIZE(save_extint); i++)
+               __raw_writel(save_extint[i], S3C24XX_EXTINT0 + (i*4));
+
+       for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
+               __raw_writel(save_eintflt[i], S3C24XX_EINFLT0 + (i*4));
+
+       s3c2410_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
+       __raw_writel(save_eintmask, S3C24XX_EINTMASK);
+
+       return 0;
+}
+
+#else
+#define s3c24xx_irq_suspend NULL
+#define s3c24xx_irq_resume  NULL
+#endif
+
+/* s3c24xx_init_irq
+ *
+ * Initialise S3C2410 IRQ system
+*/
+
+void __init s3c24xx_init_irq(void)
+{
+       unsigned long pend;
+       unsigned long last;
+       int irqno;
+       int i;
+
+       irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");
+
+       /* first, clear all interrupts pending... */
+
+       last = 0;
+       for (i = 0; i < 4; i++) {
+               pend = __raw_readl(S3C24XX_EINTPEND);
+
+               if (pend == 0 || pend == last)
+                       break;
+
+               __raw_writel(pend, S3C24XX_EINTPEND);
+               printk("irq: clearing pending ext status %08x\n", (int)pend);
+               last = pend;
+       }
+
+       last = 0;
+       for (i = 0; i < 4; i++) {
+               pend = __raw_readl(S3C2410_INTPND);
+
+               if (pend == 0 || pend == last)
+                       break;
+
+               __raw_writel(pend, S3C2410_SRCPND);
+               __raw_writel(pend, S3C2410_INTPND);
+               printk("irq: clearing pending status %08x\n", (int)pend);
+               last = pend;
+       }
+
+       last = 0;
+       for (i = 0; i < 4; i++) {
+               pend = __raw_readl(S3C2410_SUBSRCPND);
+
+               if (pend == 0 || pend == last)
+                       break;
+
+               printk("irq: clearing subpending status %08x\n", (int)pend);
+               __raw_writel(pend, S3C2410_SUBSRCPND);
+               last = pend;
+       }
+
+       /* register the main interrupts */
+
+       irqdbf("s3c2410_init_irq: registering s3c2410 interrupt handlers\n");
+
+       for (irqno = IRQ_EINT4t7; irqno <= IRQ_ADCPARENT; irqno++) {
+               /* set all the s3c2410 internal irqs */
+
+               switch (irqno) {
+                       /* deal with the special IRQs (cascaded) */
+
+               case IRQ_EINT4t7:
+               case IRQ_EINT8t23:
+               case IRQ_UART0:
+               case IRQ_UART1:
+               case IRQ_UART2:
+               case IRQ_ADCPARENT:
+                       set_irq_chip(irqno, &s3c_irq_level_chip);
+                       set_irq_handler(irqno, handle_level_irq);
+                       break;
+
+               case IRQ_RESERVED6:
+               case IRQ_RESERVED24:
+                       /* no IRQ here */
+                       break;
+
+               default:
+                       //irqdbf("registering irq %d (s3c irq)\n", irqno);
+                       set_irq_chip(irqno, &s3c_irq_chip);
+                       set_irq_handler(irqno, handle_edge_irq);
+                       set_irq_flags(irqno, IRQF_VALID);
+               }
+       }
+
+       /* setup the cascade irq handlers */
+
+       set_irq_chained_handler(IRQ_EINT4t7, s3c_irq_demux_extint4t7);
+       set_irq_chained_handler(IRQ_EINT8t23, s3c_irq_demux_extint8);
+
+       set_irq_chained_handler(IRQ_UART0, s3c_irq_demux_uart0);
+       set_irq_chained_handler(IRQ_UART1, s3c_irq_demux_uart1);
+       set_irq_chained_handler(IRQ_UART2, s3c_irq_demux_uart2);
+       set_irq_chained_handler(IRQ_ADCPARENT, s3c_irq_demux_adc);
+
+       /* external interrupts */
+
+       for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
+               irqdbf("registering irq %d (ext int)\n", irqno);
+               set_irq_chip(irqno, &s3c_irq_eint0t4);
+               set_irq_handler(irqno, handle_edge_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       for (irqno = IRQ_EINT4; irqno <= IRQ_EINT23; irqno++) {
+               irqdbf("registering irq %d (extended s3c irq)\n", irqno);
+               set_irq_chip(irqno, &s3c_irqext_chip);
+               set_irq_handler(irqno, handle_edge_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       /* register the uart interrupts */
+
+       irqdbf("s3c2410: registering external interrupts\n");
+
+       for (irqno = IRQ_S3CUART_RX0; irqno <= IRQ_S3CUART_ERR0; irqno++) {
+               irqdbf("registering irq %d (s3c uart0 irq)\n", irqno);
+               set_irq_chip(irqno, &s3c_irq_uart0);
+               set_irq_handler(irqno, handle_level_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       for (irqno = IRQ_S3CUART_RX1; irqno <= IRQ_S3CUART_ERR1; irqno++) {
+               irqdbf("registering irq %d (s3c uart1 irq)\n", irqno);
+               set_irq_chip(irqno, &s3c_irq_uart1);
+               set_irq_handler(irqno, handle_level_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       for (irqno = IRQ_S3CUART_RX2; irqno <= IRQ_S3CUART_ERR2; irqno++) {
+               irqdbf("registering irq %d (s3c uart2 irq)\n", irqno);
+               set_irq_chip(irqno, &s3c_irq_uart2);
+               set_irq_handler(irqno, handle_level_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       for (irqno = IRQ_TC; irqno <= IRQ_ADC; irqno++) {
+               irqdbf("registering irq %d (s3c adc irq)\n", irqno);
+               set_irq_chip(irqno, &s3c_irq_adc);
+               set_irq_handler(irqno, handle_edge_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       irqdbf("s3c2410: registered interrupt handlers\n");
+}
diff --git a/arch/arm/plat-s3c24xx/pm-simtec.c b/arch/arm/plat-s3c24xx/pm-simtec.c
new file mode 100644 (file)
index 0000000..bd965f2
--- /dev/null
@@ -0,0 +1,66 @@
+/* linux/arch/arm/plat-s3c24xx/pm-simtec.c
+ *
+ * Copyright (c) 2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * http://armlinux.simtec.co.uk/
+ *
+ * Power Management helpers for Simtec S3C24XX implementations
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/device.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+
+#include <asm/arch/map.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-mem.h>
+
+#include <asm/mach-types.h>
+
+#include <asm/plat-s3c24xx/pm.h>
+
+#define COPYRIGHT ", (c) 2005 Simtec Electronics"
+
+/* pm_simtec_init
+ *
+ * enable the power management functions
+*/
+
+static __init int pm_simtec_init(void)
+{
+       unsigned long gstatus4;
+
+       /* check which machine we are running on */
+
+       if (!machine_is_bast() && !machine_is_vr1000() &&
+           !machine_is_anubis() && !machine_is_osiris() &&
+           !machine_is_aml_m5900())
+               return 0;
+
+       printk(KERN_INFO "Simtec Board Power Manangement" COPYRIGHT "\n");
+
+       gstatus4  = (__raw_readl(S3C2410_BANKCON7) & 0x3) << 30;
+       gstatus4 |= (__raw_readl(S3C2410_BANKCON6) & 0x3) << 28;
+       gstatus4 |= (__raw_readl(S3C2410_BANKSIZE) & S3C2410_BANKSIZE_MASK);
+
+       __raw_writel(gstatus4, S3C2410_GSTATUS4);
+
+       return s3c2410_pm_init();
+}
+
+arch_initcall(pm_simtec_init);
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c
new file mode 100644 (file)
index 0000000..ecf68d6
--- /dev/null
@@ -0,0 +1,659 @@
+/* linux/arch/arm/plat-s3c24xx/pm.c
+ *
+ * Copyright (c) 2004,2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C24XX Power Manager (Suspend-To-RAM) support
+ *
+ * See Documentation/arm/Samsung-S3C24XX/Suspend.txt for more information
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Parts based on arch/arm/mach-pxa/pm.c
+ *
+ * Thanks to Dimitry Andric for debugging
+*/
+
+#include <linux/init.h>
+#include <linux/suspend.h>
+#include <linux/errno.h>
+#include <linux/time.h>
+#include <linux/interrupt.h>
+#include <linux/crc32.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <linux/serial_core.h>
+
+#include <asm/cacheflush.h>
+#include <asm/hardware.h>
+#include <asm/io.h>
+
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-clock.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-mem.h>
+#include <asm/arch/regs-irq.h>
+
+#include <asm/mach/time.h>
+
+#include <asm/plat-s3c24xx/pm.h>
+
+/* for external use */
+
+unsigned long s3c_pm_flags;
+
+#define PFX "s3c24xx-pm: "
+
+static struct sleep_save core_save[] = {
+       SAVE_ITEM(S3C2410_LOCKTIME),
+       SAVE_ITEM(S3C2410_CLKCON),
+
+       /* we restore the timings here, with the proviso that the board
+        * brings the system up in an slower, or equal frequency setting
+        * to the original system.
+        *
+        * if we cannot guarantee this, then things are going to go very
+        * wrong here, as we modify the refresh and both pll settings.
+        */
+
+       SAVE_ITEM(S3C2410_BWSCON),
+       SAVE_ITEM(S3C2410_BANKCON0),
+       SAVE_ITEM(S3C2410_BANKCON1),
+       SAVE_ITEM(S3C2410_BANKCON2),
+       SAVE_ITEM(S3C2410_BANKCON3),
+       SAVE_ITEM(S3C2410_BANKCON4),
+       SAVE_ITEM(S3C2410_BANKCON5),
+
+       SAVE_ITEM(S3C2410_CLKDIVN),
+       SAVE_ITEM(S3C2410_MPLLCON),
+       SAVE_ITEM(S3C2410_UPLLCON),
+       SAVE_ITEM(S3C2410_CLKSLOW),
+       SAVE_ITEM(S3C2410_REFRESH),
+};
+
+static struct sleep_save gpio_save[] = {
+       SAVE_ITEM(S3C2410_GPACON),
+       SAVE_ITEM(S3C2410_GPADAT),
+
+       SAVE_ITEM(S3C2410_GPBCON),
+       SAVE_ITEM(S3C2410_GPBDAT),
+       SAVE_ITEM(S3C2410_GPBUP),
+
+       SAVE_ITEM(S3C2410_GPCCON),
+       SAVE_ITEM(S3C2410_GPCDAT),
+       SAVE_ITEM(S3C2410_GPCUP),
+
+       SAVE_ITEM(S3C2410_GPDCON),
+       SAVE_ITEM(S3C2410_GPDDAT),
+       SAVE_ITEM(S3C2410_GPDUP),
+
+       SAVE_ITEM(S3C2410_GPECON),
+       SAVE_ITEM(S3C2410_GPEDAT),
+       SAVE_ITEM(S3C2410_GPEUP),
+
+       SAVE_ITEM(S3C2410_GPFCON),
+       SAVE_ITEM(S3C2410_GPFDAT),
+       SAVE_ITEM(S3C2410_GPFUP),
+
+       SAVE_ITEM(S3C2410_GPGCON),
+       SAVE_ITEM(S3C2410_GPGDAT),
+       SAVE_ITEM(S3C2410_GPGUP),
+
+       SAVE_ITEM(S3C2410_GPHCON),
+       SAVE_ITEM(S3C2410_GPHDAT),
+       SAVE_ITEM(S3C2410_GPHUP),
+
+       SAVE_ITEM(S3C2410_DCLKCON),
+};
+
+#ifdef CONFIG_S3C2410_PM_DEBUG
+
+#define SAVE_UART(va) \
+       SAVE_ITEM((va) + S3C2410_ULCON), \
+       SAVE_ITEM((va) + S3C2410_UCON), \
+       SAVE_ITEM((va) + S3C2410_UFCON), \
+       SAVE_ITEM((va) + S3C2410_UMCON), \
+       SAVE_ITEM((va) + S3C2410_UBRDIV)
+
+static struct sleep_save uart_save[] = {
+       SAVE_UART(S3C24XX_VA_UART0),
+       SAVE_UART(S3C24XX_VA_UART1),
+#ifndef CONFIG_CPU_S3C2400
+       SAVE_UART(S3C24XX_VA_UART2),
+#endif
+};
+
+/* debug
+ *
+ * we send the debug to printascii() to allow it to be seen if the
+ * system never wakes up from the sleep
+*/
+
+extern void printascii(const char *);
+
+void pm_dbg(const char *fmt, ...)
+{
+       va_list va;
+       char buff[256];
+
+       va_start(va, fmt);
+       vsprintf(buff, fmt, va);
+       va_end(va);
+
+       printascii(buff);
+}
+
+static void s3c2410_pm_debug_init(void)
+{
+       unsigned long tmp = __raw_readl(S3C2410_CLKCON);
+
+       /* re-start uart clocks */
+       tmp |= S3C2410_CLKCON_UART0;
+       tmp |= S3C2410_CLKCON_UART1;
+       tmp |= S3C2410_CLKCON_UART2;
+
+       __raw_writel(tmp, S3C2410_CLKCON);
+       udelay(10);
+}
+
+#define DBG(fmt...) pm_dbg(fmt)
+#else
+#define DBG(fmt...) printk(KERN_DEBUG fmt)
+
+#define s3c2410_pm_debug_init() do { } while(0)
+
+static struct sleep_save uart_save[] = {};
+#endif
+
+#if defined(CONFIG_S3C2410_PM_CHECK) && CONFIG_S3C2410_PM_CHECK_CHUNKSIZE != 0
+
+/* suspend checking code...
+ *
+ * this next area does a set of crc checks over all the installed
+ * memory, so the system can verify if the resume was ok.
+ *
+ * CONFIG_S3C2410_PM_CHECK_CHUNKSIZE defines the block-size for the CRC,
+ * increasing it will mean that the area corrupted will be less easy to spot,
+ * and reducing the size will cause the CRC save area to grow
+*/
+
+#define CHECK_CHUNKSIZE (CONFIG_S3C2410_PM_CHECK_CHUNKSIZE * 1024)
+
+static u32 crc_size;   /* size needed for the crc block */
+static u32 *crcs;      /* allocated over suspend/resume */
+
+typedef u32 *(run_fn_t)(struct resource *ptr, u32 *arg);
+
+/* s3c2410_pm_run_res
+ *
+ * go thorugh the given resource list, and look for system ram
+*/
+
+static void s3c2410_pm_run_res(struct resource *ptr, run_fn_t fn, u32 *arg)
+{
+       while (ptr != NULL) {
+               if (ptr->child != NULL)
+                       s3c2410_pm_run_res(ptr->child, fn, arg);
+
+               if ((ptr->flags & IORESOURCE_MEM) &&
+                   strcmp(ptr->name, "System RAM") == 0) {
+                       DBG("Found system RAM at %08lx..%08lx\n",
+                           ptr->start, ptr->end);
+                       arg = (fn)(ptr, arg);
+               }
+
+               ptr = ptr->sibling;
+       }
+}
+
+static void s3c2410_pm_run_sysram(run_fn_t fn, u32 *arg)
+{
+       s3c2410_pm_run_res(&iomem_resource, fn, arg);
+}
+
+static u32 *s3c2410_pm_countram(struct resource *res, u32 *val)
+{
+       u32 size = (u32)(res->end - res->start)+1;
+
+       size += CHECK_CHUNKSIZE-1;
+       size /= CHECK_CHUNKSIZE;
+
+       DBG("Area %08lx..%08lx, %d blocks\n", res->start, res->end, size);
+
+       *val += size * sizeof(u32);
+       return val;
+}
+
+/* s3c2410_pm_prepare_check
+ *
+ * prepare the necessary information for creating the CRCs. This
+ * must be done before the final save, as it will require memory
+ * allocating, and thus touching bits of the kernel we do not
+ * know about.
+*/
+
+static void s3c2410_pm_check_prepare(void)
+{
+       crc_size = 0;
+
+       s3c2410_pm_run_sysram(s3c2410_pm_countram, &crc_size);
+
+       DBG("s3c2410_pm_prepare_check: %u checks needed\n", crc_size);
+
+       crcs = kmalloc(crc_size+4, GFP_KERNEL);
+       if (crcs == NULL)
+               printk(KERN_ERR "Cannot allocated CRC save area\n");
+}
+
+static u32 *s3c2410_pm_makecheck(struct resource *res, u32 *val)
+{
+       unsigned long addr, left;
+
+       for (addr = res->start; addr < res->end;
+            addr += CHECK_CHUNKSIZE) {
+               left = res->end - addr;
+
+               if (left > CHECK_CHUNKSIZE)
+                       left = CHECK_CHUNKSIZE;
+
+               *val = crc32_le(~0, phys_to_virt(addr), left);
+               val++;
+       }
+
+       return val;
+}
+
+/* s3c2410_pm_check_store
+ *
+ * compute the CRC values for the memory blocks before the final
+ * sleep.
+*/
+
+static void s3c2410_pm_check_store(void)
+{
+       if (crcs != NULL)
+               s3c2410_pm_run_sysram(s3c2410_pm_makecheck, crcs);
+}
+
+/* in_region
+ *
+ * return TRUE if the area defined by ptr..ptr+size contatins the
+ * what..what+whatsz
+*/
+
+static inline int in_region(void *ptr, int size, void *what, size_t whatsz)
+{
+       if ((what+whatsz) < ptr)
+               return 0;
+
+       if (what > (ptr+size))
+               return 0;
+
+       return 1;
+}
+
+static u32 *s3c2410_pm_runcheck(struct resource *res, u32 *val)
+{
+       void *save_at = phys_to_virt(s3c2410_sleep_save_phys);
+       unsigned long addr;
+       unsigned long left;
+       void *ptr;
+       u32 calc;
+
+       for (addr = res->start; addr < res->end;
+            addr += CHECK_CHUNKSIZE) {
+               left = res->end - addr;
+
+               if (left > CHECK_CHUNKSIZE)
+                       left = CHECK_CHUNKSIZE;
+
+               ptr = phys_to_virt(addr);
+
+               if (in_region(ptr, left, crcs, crc_size)) {
+                       DBG("skipping %08lx, has crc block in\n", addr);
+                       goto skip_check;
+               }
+
+               if (in_region(ptr, left, save_at, 32*4 )) {
+                       DBG("skipping %08lx, has save block in\n", addr);
+                       goto skip_check;
+               }
+
+               /* calculate and check the checksum */
+
+               calc = crc32_le(~0, ptr, left);
+               if (calc != *val) {
+                       printk(KERN_ERR PFX "Restore CRC error at "
+                              "%08lx (%08x vs %08x)\n", addr, calc, *val);
+
+                       DBG("Restore CRC error at %08lx (%08x vs %08x)\n",
+                           addr, calc, *val);
+               }
+
+       skip_check:
+               val++;
+       }
+
+       return val;
+}
+
+/* s3c2410_pm_check_restore
+ *
+ * check the CRCs after the restore event and free the memory used
+ * to hold them
+*/
+
+static void s3c2410_pm_check_restore(void)
+{
+       if (crcs != NULL) {
+               s3c2410_pm_run_sysram(s3c2410_pm_runcheck, crcs);
+               kfree(crcs);
+               crcs = NULL;
+       }
+}
+
+#else
+
+#define s3c2410_pm_check_prepare() do { } while(0)
+#define s3c2410_pm_check_restore() do { } while(0)
+#define s3c2410_pm_check_store()   do { } while(0)
+#endif
+
+/* helper functions to save and restore register state */
+
+void s3c2410_pm_do_save(struct sleep_save *ptr, int count)
+{
+       for (; count > 0; count--, ptr++) {
+               ptr->val = __raw_readl(ptr->reg);
+               DBG("saved %p value %08lx\n", ptr->reg, ptr->val);
+       }
+}
+
+/* s3c2410_pm_do_restore
+ *
+ * restore the system from the given list of saved registers
+ *
+ * Note, we do not use DBG() in here, as the system may not have
+ * restore the UARTs state yet
+*/
+
+void s3c2410_pm_do_restore(struct sleep_save *ptr, int count)
+{
+       for (; count > 0; count--, ptr++) {
+               printk(KERN_DEBUG "restore %p (restore %08lx, was %08x)\n",
+                      ptr->reg, ptr->val, __raw_readl(ptr->reg));
+
+               __raw_writel(ptr->val, ptr->reg);
+       }
+}
+
+/* s3c2410_pm_do_restore_core
+ *
+ * similar to s3c2410_pm_do_restore_core
+ *
+ * WARNING: Do not put any debug in here that may effect memory or use
+ * peripherals, as things may be changing!
+*/
+
+static void s3c2410_pm_do_restore_core(struct sleep_save *ptr, int count)
+{
+       for (; count > 0; count--, ptr++) {
+               __raw_writel(ptr->val, ptr->reg);
+       }
+}
+
+/* s3c2410_pm_show_resume_irqs
+ *
+ * print any IRQs asserted at resume time (ie, we woke from)
+*/
+
+static void s3c2410_pm_show_resume_irqs(int start, unsigned long which,
+                                       unsigned long mask)
+{
+       int i;
+
+       which &= ~mask;
+
+       for (i = 0; i <= 31; i++) {
+               if ((which) & (1L<<i)) {
+                       DBG("IRQ %d asserted at resume\n", start+i);
+               }
+       }
+}
+
+/* s3c2410_pm_check_resume_pin
+ *
+ * check to see if the pin is configured correctly for sleep mode, and
+ * make any necessary adjustments if it is not
+*/
+
+static void s3c2410_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs)
+{
+       unsigned long irqstate;
+       unsigned long pinstate;
+       int irq = s3c2410_gpio_getirq(pin);
+
+       if (irqoffs < 4)
+               irqstate = s3c_irqwake_intmask & (1L<<irqoffs);
+       else
+               irqstate = s3c_irqwake_eintmask & (1L<<irqoffs);
+
+       pinstate = s3c2410_gpio_getcfg(pin);
+
+       if (!irqstate) {
+               if (pinstate == S3C2410_GPIO_IRQ)
+                       DBG("Leaving IRQ %d (pin %d) enabled\n", irq, pin);
+       } else {
+               if (pinstate == S3C2410_GPIO_IRQ) {
+                       DBG("Disabling IRQ %d (pin %d)\n", irq, pin);
+                       s3c2410_gpio_cfgpin(pin, S3C2410_GPIO_INPUT);
+               }
+       }
+}
+
+/* s3c2410_pm_configure_extint
+ *
+ * configure all external interrupt pins
+*/
+
+static void s3c2410_pm_configure_extint(void)
+{
+       int pin;
+
+       /* for each of the external interrupts (EINT0..EINT15) we
+        * need to check wether it is an external interrupt source,
+        * and then configure it as an input if it is not
+       */
+
+       for (pin = S3C2410_GPF0; pin <= S3C2410_GPF7; pin++) {
+               s3c2410_pm_check_resume_pin(pin, pin - S3C2410_GPF0);
+       }
+
+       for (pin = S3C2410_GPG0; pin <= S3C2410_GPG7; pin++) {
+               s3c2410_pm_check_resume_pin(pin, (pin - S3C2410_GPG0)+8);
+       }
+}
+
+void (*pm_cpu_prep)(void);
+void (*pm_cpu_sleep)(void);
+
+#define any_allowed(mask, allow) (((mask) & (allow)) != (allow))
+
+/* s3c2410_pm_enter
+ *
+ * central control for sleep/resume process
+*/
+
+static int s3c2410_pm_enter(suspend_state_t state)
+{
+       unsigned long regs_save[16];
+
+       /* ensure the debug is initialised (if enabled) */
+
+       s3c2410_pm_debug_init();
+
+       DBG("s3c2410_pm_enter(%d)\n", state);
+
+       if (pm_cpu_prep == NULL || pm_cpu_sleep == NULL) {
+               printk(KERN_ERR PFX "error: no cpu sleep functions set\n");
+               return -EINVAL;
+       }
+
+       if (state != PM_SUSPEND_MEM) {
+               printk(KERN_ERR PFX "error: only PM_SUSPEND_MEM supported\n");
+               return -EINVAL;
+       }
+
+       /* check if we have anything to wake-up with... bad things seem
+        * to happen if you suspend with no wakeup (system will often
+        * require a full power-cycle)
+       */
+
+       if (!any_allowed(s3c_irqwake_intmask, s3c_irqwake_intallow) &&
+           !any_allowed(s3c_irqwake_eintmask, s3c_irqwake_eintallow)) {
+               printk(KERN_ERR PFX "No sources enabled for wake-up!\n");
+               printk(KERN_ERR PFX "Aborting sleep\n");
+               return -EINVAL;
+       }
+
+       /* prepare check area if configured */
+
+       s3c2410_pm_check_prepare();
+
+       /* store the physical address of the register recovery block */
+
+       s3c2410_sleep_save_phys = virt_to_phys(regs_save);
+
+       DBG("s3c2410_sleep_save_phys=0x%08lx\n", s3c2410_sleep_save_phys);
+
+       /* save all necessary core registers not covered by the drivers */
+
+       s3c2410_pm_do_save(gpio_save, ARRAY_SIZE(gpio_save));
+       s3c2410_pm_do_save(core_save, ARRAY_SIZE(core_save));
+       s3c2410_pm_do_save(uart_save, ARRAY_SIZE(uart_save));
+
+       /* set the irq configuration for wake */
+
+       s3c2410_pm_configure_extint();
+
+       DBG("sleep: irq wakeup masks: %08lx,%08lx\n",
+           s3c_irqwake_intmask, s3c_irqwake_eintmask);
+
+       __raw_writel(s3c_irqwake_intmask, S3C2410_INTMSK);
+       __raw_writel(s3c_irqwake_eintmask, S3C2410_EINTMASK);
+
+       /* ack any outstanding external interrupts before we go to sleep */
+
+       __raw_writel(__raw_readl(S3C2410_EINTPEND), S3C2410_EINTPEND);
+       __raw_writel(__raw_readl(S3C2410_INTPND), S3C2410_INTPND);
+       __raw_writel(__raw_readl(S3C2410_SRCPND), S3C2410_SRCPND);
+
+       /* call cpu specific preperation */
+
+       pm_cpu_prep();
+
+       /* flush cache back to ram */
+
+       flush_cache_all();
+
+       s3c2410_pm_check_store();
+
+       /* send the cpu to sleep... */
+
+       __raw_writel(0x00, S3C2410_CLKCON);  /* turn off clocks over sleep */
+
+       /* s3c2410_cpu_save will also act as our return point from when
+        * we resume as it saves its own register state, so use the return
+        * code to differentiate return from save and return from sleep */
+
+       if (s3c2410_cpu_save(regs_save) == 0) {
+               flush_cache_all();
+               pm_cpu_sleep();
+       }
+
+       /* restore the cpu state */
+
+       cpu_init();
+
+       /* restore the system state */
+
+       s3c2410_pm_do_restore_core(core_save, ARRAY_SIZE(core_save));
+       s3c2410_pm_do_restore(gpio_save, ARRAY_SIZE(gpio_save));
+       s3c2410_pm_do_restore(uart_save, ARRAY_SIZE(uart_save));
+
+       s3c2410_pm_debug_init();
+
+       /* check what irq (if any) restored the system */
+
+       DBG("post sleep: IRQs 0x%08x, 0x%08x\n",
+           __raw_readl(S3C2410_SRCPND),
+           __raw_readl(S3C2410_EINTPEND));
+
+       s3c2410_pm_show_resume_irqs(IRQ_EINT0, __raw_readl(S3C2410_SRCPND),
+                                   s3c_irqwake_intmask);
+
+       s3c2410_pm_show_resume_irqs(IRQ_EINT4-4, __raw_readl(S3C2410_EINTPEND),
+                                   s3c_irqwake_eintmask);
+
+       DBG("post sleep, preparing to return\n");
+
+       s3c2410_pm_check_restore();
+
+       /* ok, let's return from sleep */
+
+       DBG("S3C2410 PM Resume (post-restore)\n");
+       return 0;
+}
+
+/*
+ * Called after processes are frozen, but before we shut down devices.
+ */
+static int s3c2410_pm_prepare(suspend_state_t state)
+{
+       return 0;
+}
+
+/*
+ * Called after devices are re-setup, but before processes are thawed.
+ */
+static int s3c2410_pm_finish(suspend_state_t state)
+{
+       return 0;
+}
+
+/*
+ * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
+ */
+static struct pm_ops s3c2410_pm_ops = {
+       .pm_disk_mode   = PM_DISK_FIRMWARE,
+       .prepare        = s3c2410_pm_prepare,
+       .enter          = s3c2410_pm_enter,
+       .finish         = s3c2410_pm_finish,
+};
+
+/* s3c2410_pm_init
+ *
+ * Attach the power management functions. This should be called
+ * from the board specific initialisation if the board supports
+ * it.
+*/
+
+int __init s3c2410_pm_init(void)
+{
+       printk("S3C2410 Power Management, (c) 2004 Simtec Electronics\n");
+
+       pm_set_ops(&s3c2410_pm_ops);
+       return 0;
+}
diff --git a/arch/arm/plat-s3c24xx/s3c244x-irq.c b/arch/arm/plat-s3c24xx/s3c244x-irq.c
new file mode 100644 (file)
index 0000000..a0e39d8
--- /dev/null
@@ -0,0 +1,146 @@
+/* linux/arch/arm/plat-s3c24xx/s3c244x-irq.c
+ *
+ * Copyright (c) 2003,2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+*/
+
+#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 <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/mach/irq.h>
+
+#include <asm/arch/regs-irq.h>
+#include <asm/arch/regs-gpio.h>
+
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
+#include <asm/plat-s3c24xx/irq.h>
+
+/* camera irq */
+
+static void s3c_irq_demux_cam(unsigned int irq,
+                             struct irq_desc *desc)
+{
+       unsigned int subsrc, submsk;
+       struct irq_desc *mydesc;
+
+       /* read the current pending interrupts, and the mask
+        * for what it is available */
+
+       subsrc = __raw_readl(S3C2410_SUBSRCPND);
+       submsk = __raw_readl(S3C2410_INTSUBMSK);
+
+       subsrc &= ~submsk;
+       subsrc >>= 11;
+       subsrc &= 3;
+
+       if (subsrc != 0) {
+               if (subsrc & 1) {
+                       mydesc = irq_desc + IRQ_S3C2440_CAM_C;
+                       desc_handle_irq(IRQ_S3C2440_CAM_C, mydesc);
+               }
+               if (subsrc & 2) {
+                       mydesc = irq_desc + IRQ_S3C2440_CAM_P;
+                       desc_handle_irq(IRQ_S3C2440_CAM_P, mydesc);
+               }
+       }
+}
+
+#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
+
+static void
+s3c_irq_cam_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11);
+}
+
+static void
+s3c_irq_cam_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_CAM);
+}
+
+static void
+s3c_irq_cam_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11);
+}
+
+static struct irq_chip s3c_irq_cam = {
+       .mask       = s3c_irq_cam_mask,
+       .unmask     = s3c_irq_cam_unmask,
+       .ack        = s3c_irq_cam_ack,
+};
+
+static int s3c244x_irq_add(struct sys_device *sysdev)
+{
+       unsigned int irqno;
+
+       set_irq_chip(IRQ_NFCON, &s3c_irq_level_chip);
+       set_irq_handler(IRQ_NFCON, handle_level_irq);
+       set_irq_flags(IRQ_NFCON, IRQF_VALID);
+
+       /* add chained handler for camera */
+
+       set_irq_chip(IRQ_CAM, &s3c_irq_level_chip);
+       set_irq_handler(IRQ_CAM, handle_level_irq);
+       set_irq_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
+
+       for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
+               set_irq_chip(irqno, &s3c_irq_cam);
+               set_irq_handler(irqno, handle_level_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       return 0;
+}
+
+static struct sysdev_driver s3c2440_irq_driver = {
+       .add            = s3c244x_irq_add,
+       .suspend        = s3c24xx_irq_suspend,
+       .resume         = s3c24xx_irq_resume,
+};
+
+static int s3c2440_irq_init(void)
+{
+       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
+}
+
+arch_initcall(s3c2440_irq_init);
+
+static struct sysdev_driver s3c2442_irq_driver = {
+       .add            = s3c244x_irq_add,
+       .suspend        = s3c24xx_irq_suspend,
+       .resume         = s3c24xx_irq_resume,
+};
+
+
+static int s3c2442_irq_init(void)
+{
+       return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_irq_driver);
+}
+
+arch_initcall(s3c2442_irq_init);
diff --git a/arch/arm/plat-s3c24xx/s3c244x.c b/arch/arm/plat-s3c24xx/s3c244x.c
new file mode 100644 (file)
index 0000000..767f2e9
--- /dev/null
@@ -0,0 +1,184 @@
+/* linux/arch/arm/plat-s3c24xx/s3c244x.c
+ *
+ * Copyright (c) 2004-2006 Simtec Electronics
+ *   Ben Dooks <ben@simtec.co.uk>
+ *
+ * Samsung S3C2440 and S3C2442 Mobile CPU support (not S3C2443)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <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/serial_core.h>
+#include <linux/platform_device.h>
+#include <linux/sysdev.h>
+#include <linux/clk.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+
+#include <asm/arch/regs-clock.h>
+#include <asm/arch/regs-serial.h>
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-gpioj.h>
+#include <asm/arch/regs-dsc.h>
+
+#include <asm/plat-s3c24xx/s3c2410.h>
+#include <asm/plat-s3c24xx/s3c2440.h>
+#include "s3c244x.h"
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
+
+static struct map_desc s3c244x_iodesc[] __initdata = {
+       IODESC_ENT(CLKPWR),
+       IODESC_ENT(TIMER),
+       IODESC_ENT(WATCHDOG),
+       IODESC_ENT(LCD),
+};
+
+/* uart initialisation */
+
+void __init s3c244x_init_uarts(struct s3c2410_uartcfg *cfg, int no)
+{
+       s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
+}
+
+void __init s3c244x_map_io(struct map_desc *mach_desc, int size)
+{
+       /* register our io-tables */
+
+       iotable_init(s3c244x_iodesc, ARRAY_SIZE(s3c244x_iodesc));
+       iotable_init(mach_desc, size);
+
+       /* rename any peripherals used differing from the s3c2410 */
+
+       s3c_device_i2c.name  = "s3c2440-i2c";
+       s3c_device_nand.name = "s3c2440-nand";
+       s3c_device_usbgadget.name = "s3c2440-usbgadget";
+}
+
+void __init s3c244x_init_clocks(int xtal)
+{
+       unsigned long clkdiv;
+       unsigned long camdiv;
+       unsigned long hclk, fclk, pclk;
+       int hdiv = 1;
+
+       /* now we've got our machine bits initialised, work out what
+        * clocks we've got */
+
+       fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), xtal) * 2;
+
+       clkdiv = __raw_readl(S3C2410_CLKDIVN);
+       camdiv = __raw_readl(S3C2440_CAMDIVN);
+
+       /* work out clock scalings */
+
+       switch (clkdiv & S3C2440_CLKDIVN_HDIVN_MASK) {
+       case S3C2440_CLKDIVN_HDIVN_1:
+               hdiv = 1;
+               break;
+
+       case S3C2440_CLKDIVN_HDIVN_2:
+               hdiv = 2;
+               break;
+
+       case S3C2440_CLKDIVN_HDIVN_4_8:
+               hdiv = (camdiv & S3C2440_CAMDIVN_HCLK4_HALF) ? 8 : 4;
+               break;
+
+       case S3C2440_CLKDIVN_HDIVN_3_6:
+               hdiv = (camdiv & S3C2440_CAMDIVN_HCLK3_HALF) ? 6 : 3;
+               break;
+       }
+
+       hclk = fclk / hdiv;
+       pclk = hclk / ((clkdiv & S3C2440_CLKDIVN_PDIVN)? 2:1);
+
+       /* print brief summary of clocks, etc */
+
+       printk("S3C244X: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n",
+              print_mhz(fclk), print_mhz(hclk), print_mhz(pclk));
+
+       /* initialise the clocks here, to allow other things like the
+        * console to use them, and to add new ones after the initialisation
+        */
+
+       s3c24xx_setup_clocks(xtal, fclk, hclk, pclk);
+       s3c2410_baseclk_add();
+}
+
+#ifdef CONFIG_PM
+
+static struct sleep_save s3c244x_sleep[] = {
+       SAVE_ITEM(S3C2440_DSC0),
+       SAVE_ITEM(S3C2440_DSC1),
+       SAVE_ITEM(S3C2440_GPJDAT),
+       SAVE_ITEM(S3C2440_GPJCON),
+       SAVE_ITEM(S3C2440_GPJUP)
+};
+
+static int s3c244x_suspend(struct sys_device *dev, pm_message_t state)
+{
+       s3c2410_pm_do_save(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
+       return 0;
+}
+
+static int s3c244x_resume(struct sys_device *dev)
+{
+       s3c2410_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
+       return 0;
+}
+
+#else
+#define s3c244x_suspend NULL
+#define s3c244x_resume  NULL
+#endif
+
+/* Since the S3C2442 and S3C2440 share  items, put both sysclasses here */
+
+struct sysdev_class s3c2440_sysclass = {
+       set_kset_name("s3c2440-core"),
+       .suspend        = s3c244x_suspend,
+       .resume         = s3c244x_resume
+};
+
+struct sysdev_class s3c2442_sysclass = {
+       set_kset_name("s3c2442-core"),
+       .suspend        = s3c244x_suspend,
+       .resume         = s3c244x_resume
+};
+
+/* need to register class before we actually register the device, and
+ * we also need to ensure that it has been initialised before any of the
+ * drivers even try to use it (even if not on an s3c2440 based system)
+ * as a driver which may support both 2410 and 2440 may try and use it.
+*/
+
+static int __init s3c2440_core_init(void)
+{
+       return sysdev_class_register(&s3c2440_sysclass);
+}
+
+core_initcall(s3c2440_core_init);
+
+static int __init s3c2442_core_init(void)
+{
+       return sysdev_class_register(&s3c2442_sysclass);
+}
+
+core_initcall(s3c2442_core_init);
diff --git a/arch/arm/plat-s3c24xx/s3c244x.h b/arch/arm/plat-s3c24xx/s3c244x.h
new file mode 100644 (file)
index 0000000..f8ed176
--- /dev/null
@@ -0,0 +1,25 @@
+/* linux/arch/arm/plat-s3c24xx/s3c244x.h
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for S3C2440 and S3C2442 cpu support
+ *
+ * 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.
+*/
+
+#if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2442)
+
+extern void s3c244x_map_io(struct map_desc *mach_desc, int size);
+
+extern void s3c244x_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+
+extern void s3c244x_init_clocks(int xtal);
+
+#else
+#define s3c244x_init_clocks NULL
+#define s3c244x_init_uarts NULL
+#define s3c244x_map_io NULL
+#endif
diff --git a/arch/arm/plat-s3c24xx/sleep.S b/arch/arm/plat-s3c24xx/sleep.S
new file mode 100644 (file)
index 0000000..435349d
--- /dev/null
@@ -0,0 +1,157 @@
+/* linux/arch/arm/mach-s3c2410/sleep.S
+ *
+ * Copyright (c) 2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2410 Power Manager (Suspend-To-RAM) support
+ *
+ * Based on PXA/SA1100 sleep code by:
+ *     Nicolas Pitre, (c) 2002 Monta Vista Software Inc
+ *     Cliff Brake, (c) 2001
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+#include <asm/hardware.h>
+#include <asm/arch/map.h>
+
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/regs-clock.h>
+#include <asm/arch/regs-mem.h>
+#include <asm/arch/regs-serial.h>
+
+/* CONFIG_DEBUG_RESUME is dangerous if your bootloader does not
+ * reset the UART configuration, only enable if you really need this!
+*/
+//#define CONFIG_DEBUG_RESUME
+
+       .text
+
+       /* s3c2410_cpu_save
+        *
+        * save enough of the CPU state to allow us to re-start
+        * pm.c code. as we store items like the sp/lr, we will
+        * end up returning from this function when the cpu resumes
+        * so the return value is set to mark this.
+        *
+        * This arangement means we avoid having to flush the cache
+        * from this code.
+        *
+        * entry:
+        *      r0 = pointer to save block
+        *
+        * exit:
+        *      r0 = 0 => we stored everything
+        *           1 => resumed from sleep
+       */
+
+ENTRY(s3c2410_cpu_save)
+       stmfd   sp!, { r4 - r12, lr }
+
+       @@ store co-processor registers
+
+       mrc     p15, 0, r4, c13, c0, 0  @ PID
+       mrc     p15, 0, r5, c3, c0, 0   @ Domain ID
+       mrc     p15, 0, r6, c2, c0, 0   @ translation table base address
+       mrc     p15, 0, r7, c1, c0, 0   @ control register
+
+       stmia   r0, { r4 - r13 }
+
+       mov     r0, #0
+       ldmfd   sp, { r4 - r12, pc }
+
+       @@ return to the caller, after having the MMU
+       @@ turned on, this restores the last bits from the
+       @@ stack
+resume_with_mmu:
+       mov     r0, #1
+       ldmfd   sp!, { r4 - r12, pc }
+
+       .ltorg
+
+       @@ the next bits sit in the .data segment, even though they
+       @@ happen to be code... the s3c2410_sleep_save_phys needs to be
+       @@ accessed by the resume code before it can restore the MMU.
+       @@ This means that the variable has to be close enough for the
+       @@ code to read it... since the .text segment needs to be RO,
+       @@ the data segment can be the only place to put this code.
+
+       .data
+
+       .global s3c2410_sleep_save_phys
+s3c2410_sleep_save_phys:
+       .word   0
+
+       /* s3c2410_cpu_resume
+        *
+        * resume code entry for bootloader to call
+        *
+        * we must put this code here in the data segment as we have no
+        * other way of restoring the stack pointer after sleep, and we
+        * must not write to the code segment (code is read-only)
+       */
+
+ENTRY(s3c2410_cpu_resume)
+       mov     r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE
+       msr     cpsr_c, r0
+
+       @@ load UART to allow us to print the two characters for
+       @@ resume debug
+
+       mov     r2, #S3C24XX_PA_UART & 0xff000000
+       orr     r2, r2, #S3C24XX_PA_UART & 0xff000
+
+#if 0
+       /* SMDK2440 LED set */
+       mov     r14, #S3C24XX_PA_GPIO
+       ldr     r12, [ r14, #0x54 ]
+       bic     r12, r12, #3<<4
+       orr     r12, r12, #1<<7
+       str     r12, [ r14, #0x54 ]
+#endif
+
+#ifdef CONFIG_DEBUG_RESUME
+       mov     r3, #'L'
+       strb    r3, [ r2, #S3C2410_UTXH ]
+1001:
+       ldrb    r14, [ r3, #S3C2410_UTRSTAT ]
+       tst     r14, #S3C2410_UTRSTAT_TXE
+       beq     1001b
+#endif /* CONFIG_DEBUG_RESUME */
+
+       mov     r1, #0
+       mcr     p15, 0, r1, c8, c7, 0           @@ invalidate I & D TLBs
+       mcr     p15, 0, r1, c7, c7, 0           @@ invalidate I & D caches
+
+       ldr     r0, s3c2410_sleep_save_phys     @ address of restore block
+       ldmia   r0, { r4 - r13 }
+
+       mcr     p15, 0, r4, c13, c0, 0          @ PID
+       mcr     p15, 0, r5, c3, c0, 0           @ Domain ID
+       mcr     p15, 0, r6, c2, c0, 0           @ translation table base
+
+#ifdef CONFIG_DEBUG_RESUME
+       mov     r3, #'R'
+       strb    r3, [ r2, #S3C2410_UTXH ]
+#endif
+
+       ldr     r2, =resume_with_mmu
+       mcr     p15, 0, r7, c1, c0, 0           @ turn on MMU, etc
+       nop                                     @ second-to-last before mmu
+       mov     pc, r2                          @ go back to virtual address
+
+       .ltorg
diff --git a/arch/arm/plat-s3c24xx/time.c b/arch/arm/plat-s3c24xx/time.c
new file mode 100644 (file)
index 0000000..c523d1c
--- /dev/null
@@ -0,0 +1,262 @@
+/* linux/arch/arm/plat-s3c24xx/time.c
+ *
+ * Copyright (C) 2003-2005 Simtec Electronics
+ *     Ben Dooks, <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/err.h>
+#include <linux/clk.h>
+
+#include <asm/system.h>
+#include <asm/leds.h>
+#include <asm/mach-types.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/arch/map.h>
+#include <asm/arch/regs-timer.h>
+#include <asm/arch/regs-irq.h>
+#include <asm/mach/time.h>
+
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+static unsigned long timer_startval;
+static unsigned long timer_usec_ticks;
+
+#define TIMER_USEC_SHIFT 16
+
+/* we use the shifted arithmetic to work out the ratio of timer ticks
+ * to usecs, as often the peripheral clock is not a nice even multiple
+ * of 1MHz.
+ *
+ * shift of 14 and 15 are too low for the 12MHz, 16 seems to be ok
+ * for the current HZ value of 200 without producing overflows.
+ *
+ * Original patch by Dimitry Andric, updated by Ben Dooks
+*/
+
+
+/* timer_mask_usec_ticks
+ *
+ * given a clock and divisor, make the value to pass into timer_ticks_to_usec
+ * to scale the ticks into usecs
+*/
+
+static inline unsigned long
+timer_mask_usec_ticks(unsigned long scaler, unsigned long pclk)
+{
+       unsigned long den = pclk / 1000;
+
+       return ((1000 << TIMER_USEC_SHIFT) * scaler + (den >> 1)) / den;
+}
+
+/* timer_ticks_to_usec
+ *
+ * convert timer ticks to usec.
+*/
+
+static inline unsigned long timer_ticks_to_usec(unsigned long ticks)
+{
+       unsigned long res;
+
+       res = ticks * timer_usec_ticks;
+       res += 1 << (TIMER_USEC_SHIFT - 4);     /* round up slightly */
+
+       return res >> TIMER_USEC_SHIFT;
+}
+
+/***
+ * Returns microsecond  since last clock interrupt.  Note that interrupts
+ * will have been disabled by do_gettimeoffset()
+ * IRQs are disabled before entering here from do_gettimeofday()
+ */
+
+#define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0))
+
+static unsigned long s3c2410_gettimeoffset (void)
+{
+       unsigned long tdone;
+       unsigned long irqpend;
+       unsigned long tval;
+
+       /* work out how many ticks have gone since last timer interrupt */
+
+        tval =  __raw_readl(S3C2410_TCNTO(4));
+       tdone = timer_startval - tval;
+
+       /* check to see if there is an interrupt pending */
+
+       irqpend = __raw_readl(S3C2410_SRCPND);
+       if (irqpend & SRCPND_TIMER4) {
+               /* re-read the timer, and try and fix up for the missed
+                * interrupt. Note, the interrupt may go off before the
+                * timer has re-loaded from wrapping.
+                */
+
+               tval =  __raw_readl(S3C2410_TCNTO(4));
+               tdone = timer_startval - tval;
+
+               if (tval != 0)
+                       tdone += timer_startval;
+       }
+
+       return timer_ticks_to_usec(tdone);
+}
+
+
+/*
+ * IRQ handler for the timer
+ */
+static irqreturn_t
+s3c2410_timer_interrupt(int irq, void *dev_id)
+{
+       write_seqlock(&xtime_lock);
+       timer_tick();
+       write_sequnlock(&xtime_lock);
+       return IRQ_HANDLED;
+}
+
+static struct irqaction s3c2410_timer_irq = {
+       .name           = "S3C2410 Timer Tick",
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
+       .handler        = s3c2410_timer_interrupt,
+};
+
+#define use_tclk1_12() ( \
+       machine_is_bast()       || \
+       machine_is_vr1000()     || \
+       machine_is_anubis()     || \
+       machine_is_osiris() )
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ *
+ * Currently we only use timer4, as it is the only timer which has no
+ * other function that can be exploited externally
+ */
+static void s3c2410_timer_setup (void)
+{
+       unsigned long tcon;
+       unsigned long tcnt;
+       unsigned long tcfg1;
+       unsigned long tcfg0;
+
+       tcnt = 0xffff;  /* default value for tcnt */
+
+       /* read the current timer configuration bits */
+
+       tcon = __raw_readl(S3C2410_TCON);
+       tcfg1 = __raw_readl(S3C2410_TCFG1);
+       tcfg0 = __raw_readl(S3C2410_TCFG0);
+
+       /* configure the system for whichever machine is in use */
+
+       if (use_tclk1_12()) {
+               /* timer is at 12MHz, scaler is 1 */
+               timer_usec_ticks = timer_mask_usec_ticks(1, 12000000);
+               tcnt = 12000000 / HZ;
+
+               tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
+               tcfg1 |= S3C2410_TCFG1_MUX4_TCLK1;
+       } else {
+               unsigned long pclk;
+               struct clk *clk;
+
+               /* for the h1940 (and others), we use the pclk from the core
+                * to generate the timer values. since values around 50 to
+                * 70MHz are not values we can directly generate the timer
+                * value from, we need to pre-scale and divide before using it.
+                *
+                * for instance, using 50.7MHz and dividing by 6 gives 8.45MHz
+                * (8.45 ticks per usec)
+                */
+
+               /* this is used as default if no other timer can be found */
+
+               clk = clk_get(NULL, "timers");
+               if (IS_ERR(clk))
+                       panic("failed to get clock for system timer");
+
+               clk_enable(clk);
+
+               pclk = clk_get_rate(clk);
+
+               /* configure clock tick */
+
+               timer_usec_ticks = timer_mask_usec_ticks(6, pclk);
+
+               tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
+               tcfg1 |= S3C2410_TCFG1_MUX4_DIV2;
+
+               tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
+               tcfg0 |= ((6 - 1) / 2) << S3C2410_TCFG_PRESCALER1_SHIFT;
+
+               tcnt = (pclk / 6) / HZ;
+       }
+
+       /* timers reload after counting zero, so reduce the count by 1 */
+
+       tcnt--;
+
+       printk("timer tcon=%08lx, tcnt %04lx, tcfg %08lx,%08lx, usec %08lx\n",
+              tcon, tcnt, tcfg0, tcfg1, timer_usec_ticks);
+
+       /* check to see if timer is within 16bit range... */
+       if (tcnt > 0xffff) {
+               panic("setup_timer: HZ is too small, cannot configure timer!");
+               return;
+       }
+
+       __raw_writel(tcfg1, S3C2410_TCFG1);
+       __raw_writel(tcfg0, S3C2410_TCFG0);
+
+       timer_startval = tcnt;
+       __raw_writel(tcnt, S3C2410_TCNTB(4));
+
+       /* ensure timer is stopped... */
+
+       tcon &= ~(7<<20);
+       tcon |= S3C2410_TCON_T4RELOAD;
+       tcon |= S3C2410_TCON_T4MANUALUPD;
+
+       __raw_writel(tcon, S3C2410_TCON);
+       __raw_writel(tcnt, S3C2410_TCNTB(4));
+       __raw_writel(tcnt, S3C2410_TCMPB(4));
+
+       /* start the timer running */
+       tcon |= S3C2410_TCON_T4START;
+       tcon &= ~S3C2410_TCON_T4MANUALUPD;
+       __raw_writel(tcon, S3C2410_TCON);
+}
+
+static void __init s3c2410_timer_init (void)
+{
+       s3c2410_timer_setup();
+       setup_irq(IRQ_TIMER4, &s3c2410_timer_irq);
+}
+
+struct sys_timer s3c24xx_timer = {
+       .init           = s3c2410_timer_init,
+       .offset         = s3c2410_gettimeoffset,
+       .resume         = s3c2410_timer_setup
+};
index 49e7b12fe710848dfa1b4fa18f12978768efa481..00c435452d7e500e473b3cbbeb1b4f1d939d5659 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2006 Atmel Corporation
  *
- * Based on arch/arm/mach-at91rm9200/clock.c
+ * Based on arch/arm/mach-at91/clock.c
  *   Copyright (C) 2005 David Brownell
  *   Copyright (C) 2005 Ivan Kokshaysky
  *
index f953f044ba4da40afe56d45ab28d2d816210230a..bb8e1f295835e95fa306c42071a6d5c55fe4fe3b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2006 Atmel Corporation
  *
- * Based on arch/arm/mach-at91rm9200/clock.c
+ * Based on arch/arm/mach-at91/clock.c
  *   Copyright (C) 2005 David Brownell
  *   Copyright (C) 2005 Ivan Kokshaysky
  *
index fb3e72328a5aacf8f86cdf17fe96e171259ad5a6..e5eb97a910ed8d82f74fc67802e04321eacdc82c 100644 (file)
@@ -850,10 +850,9 @@ static inline int acpi_parse_madt_ioapic_entries(void)
 static void __init acpi_process_madt(void)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
-       int count, error;
+       int error;
 
-       count = acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt);
-       if (count >= 1) {
+       if (!acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) {
 
                /*
                 * Parse MADT LAPIC entries
index 53ca6e897984a669e4a36ef23295bb0f9e30d561..1bb069372143caa99c30f33c7f4484e5c1d930e6 100644 (file)
@@ -191,6 +191,94 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2950"),
                },
        },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL20p G3",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL20p G3"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL20p G4",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL20p G4"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL30p G1",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL30p G1"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL25p G1",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL25p G1"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL35p G1",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL35p G1"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL45p G1",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL45p G1"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL45p G2",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL45p G2"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL460c G1",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL460c G1"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL465c G1",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL465c G1"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL480c G1",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL480c G1"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant BL685c G1",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL685c G1"),
+               },
+       },
        {}
 };
 
index 9197d7b361b33da914744bff7a2a393a799c9ba9..3549c94467b8a2ceea285af768f5a3a6da2dbc32 100644 (file)
@@ -651,7 +651,7 @@ int __init acpi_boot_init(void)
         * information -- the successor to MPS tables.
         */
 
-       if (acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt) < 1) {
+       if (acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) {
                printk(KERN_ERR PREFIX "Can't find MADT\n");
                goto skip_madt;
        }
@@ -702,7 +702,7 @@ int __init acpi_boot_init(void)
         * gets interrupts such as power and sleep buttons.  If it's not
         * on a Legacy interrupt, it needs to be setup.
         */
-       if (acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt) < 1)
+       if (acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt))
                printk(KERN_ERR PREFIX "Can't find FADT\n");
 
 #ifdef CONFIG_SMP
index 340d9beab6d1368978907f387fa1ff9943a71123..6dfbd52694ab855600205680beea9b3b49c89ed4 100644 (file)
@@ -620,6 +620,15 @@ config RTAS_FLASH
        tristate "Firmware flash interface"
        depends on PPC64 && RTAS_PROC
 
+config PPC_PMI
+       tristate "Support for PMI"
+       depends PPC_IBM_CELL_BLADE
+       help
+         PMI (Platform Management Interrupt) is a way to
+         communicate with the BMC (Baseboard Mangement Controller).
+         It is used in some IBM Cell blades.
+       default m
+
 config MMIO_NVRAM
        bool
        default n
index 096e94ac415f6611081f92fef64d387231490660..b89791802e86efcc422c97ba9c71954d022312b0 100644 (file)
@@ -35,7 +35,6 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
 
                PowerPC,603e { /* Really 8241 */
                        linux,phandle = <2100>;
-                       linux,boot-cpu;
                        device_type = "cpu";
                        reg = <0>;
                        clock-frequency = <bebc200>;    /* Fixed by bootwrapper */
index d06b0b0188996a6673a1d92d6fea54da7c9bbfa7..753102752d8babb0d83142b93681b1053b26f047 100644 (file)
@@ -35,7 +35,6 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
 
                PowerPC,603e { /* Really 8241 */
                        linux,phandle = <2100>;
-                       linux,boot-cpu;
                        device_type = "cpu";
                        reg = <0>;
                        clock-frequency = <fdad680>;    /* Fixed by bootwrapper */
index c4d9562cbaadd40320f20d45db802ffbe85c77ad..41d0720c5900a2d27eba79f37650ab0b863fba2a 100644 (file)
@@ -36,7 +36,6 @@
                        bus-frequency = <0>;            // From U-Boot
                        32-bit;
                        linux,phandle = <201>;
-                       linux,boot-cpu;
                };
        };
 
index 26b44f7513dcfe12cfc46f8f5574921f58a08d83..260b2e447779f5c672ed686dac183416b8864529 100644 (file)
@@ -34,7 +34,6 @@
                        clock-frequency = <0>;
                        32-bit;
                        linux,phandle = <201>;
-                       linux,boot-cpu;
                };
        };
 
index 3d2f5a06df3f1216d0861a07a8f5672760668c76..6d721900d00e702d3d4b4b1e5f7709f74227fd51 100644 (file)
@@ -11,7 +11,7 @@
 
 / {
        model = "MPC8313ERDB";
-       compatible = "MPC83xx";
+       compatible = "MPC8313ERDB", "MPC831xRDB", "MPC83xxRDB";
        #address-cells = <1>;
        #size-cells = <1>;
 
@@ -59,7 +59,7 @@
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <e 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        dfsrr;
                };
 
@@ -68,7 +68,7 @@
                        compatible = "fsl-i2c";
                        reg = <3100 100>;
                        interrupts = <f 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        dfsrr;
                };
 
@@ -77,7 +77,7 @@
                        compatible = "mpc83xx_spi";
                        reg = <7000 1000>;
                        interrupts = <10 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        mode = <0>;
                };
 
@@ -88,8 +88,8 @@
                        reg = <23000 1000>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       interrupt-parent = <700>;
-                       interrupts = <26 2>;
+                       interrupt-parent = < &ipic >;
+                       interrupts = <26 8>;
                        phy_type = "utmi_wide";
                };
 
                        reg = <24520 20>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       linux,phandle = <24520>;
-                       ethernet-phy@1 {
-                               linux,phandle = <2452001>;
-                               interrupt-parent = <700>;
-                               interrupts = <13 2>;
+                       phy1: ethernet-phy@1 {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <13 8>;
                                reg = <1>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@4 {
-                               linux,phandle = <2452004>;
-                               interrupt-parent = <700>;
-                               interrupts = <14 2>;
+                       phy4: ethernet-phy@4 {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <14 8>;
                                reg = <4>;
                                device_type = "ethernet-phy";
                        };
                        reg = <24000 1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <25 8 24 8 23 8>;
-                       interrupt-parent = <700>;
-                       phy-handle = <2452001>;
+                       interrupt-parent = < &ipic >;
+                       phy-handle = < &phy1 >;
                };
 
                ethernet@25000 {
                        reg = <25000 1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <22 8 21 8 20 8>;
-                       interrupt-parent = <700>;
-                       phy-handle = <2452004>;
+                       interrupt-parent = < &ipic >;
+                       phy-handle = < &phy4 >;
                };
 
                serial@4500 {
                        reg = <4500 100>;
                        clock-frequency = <0>;
                        interrupts = <9 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                };
 
                serial@4600 {
                        reg = <4600 100>;
                        clock-frequency = <0>;
                        interrupts = <a 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                };
 
                pci@8500 {
                        interrupt-map = <
 
                                        /* IDSEL 0x0E -mini PCI */
-                                        7000 0 0 1 700 12 8
-                                        7000 0 0 2 700 12 8
-                                        7000 0 0 3 700 12 8
-                                        7000 0 0 4 700 12 8
+                                        7000 0 0 1 &ipic 12 8
+                                        7000 0 0 2 &ipic 12 8
+                                        7000 0 0 3 &ipic 12 8
+                                        7000 0 0 4 &ipic 12 8
 
                                        /* IDSEL 0x0F - PCI slot */
-                                        7800 0 0 1 700 11 8
-                                        7800 0 0 2 700 12 8
-                                        7800 0 0 3 700 11 8
-                                        7800 0 0 4 700 12 8>;
-                       interrupt-parent = <700>;
+                                        7800 0 0 1 &ipic 11 8
+                                        7800 0 0 2 &ipic 12 8
+                                        7800 0 0 3 &ipic 11 8
+                                        7800 0 0 4 &ipic 12 8>;
+                       interrupt-parent = < &ipic >;
                        interrupts = <42 8>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 90000000 90000000 0 10000000
                        compatible = "talitos";
                        reg = <30000 7000>;
                        interrupts = <b 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        /* Rev. 2.2 */
                        num-channels = <1>;
                        channel-fifo-len = <18>;
                 * sense == 8: Level, low assertion
                 * sense == 2: Edge, high-to-low change
                 */
-               pic@700 {
-                       linux,phandle = <700>;
+               ipic: pic@700 {
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
diff --git a/arch/powerpc/boot/dts/mpc8323emds.dts b/arch/powerpc/boot/dts/mpc8323emds.dts
deleted file mode 100644 (file)
index fa7ef24..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * MPC8323E EMDS Device Tree Source
- *
- * Copyright 2006 Freescale Semiconductor Inc.
- *
- * 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.
- */
-
-/ {
-       model = "MPC8323EMDS";
-       compatible = "MPC83xx";
-       #address-cells = <1>;
-       #size-cells = <1>;
-       linux,phandle = <100>;
-
-       cpus {
-               #cpus = <1>;
-               #address-cells = <1>;
-               #size-cells = <0>;
-               linux,phandle = <200>;
-
-               PowerPC,8323@0 {
-                       device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <4000>;          // L1, 16K
-                       i-cache-size = <4000>;          // L1, 16K
-                       timebase-frequency = <0>;
-                       bus-frequency = <0>;
-                       clock-frequency = <0>;
-                       32-bit;
-                       linux,phandle = <201>;
-                       linux,boot-cpu;
-               };
-       };
-
-       memory {
-               device_type = "memory";
-               linux,phandle = <300>;
-               reg = <00000000 08000000>;
-       };
-
-       bcsr@f8000000 {
-               device_type = "board-control";
-               reg = <f8000000 8000>;
-       };
-
-       soc8323@e0000000 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               #interrupt-cells = <2>;
-               device_type = "soc";
-               ranges = <0 e0000000 00100000>;
-               reg = <e0000000 00000200>;
-               bus-frequency = <7DE2900>;
-
-               wdt@200 {
-                       device_type = "watchdog";
-                       compatible = "mpc83xx_wdt";
-                       reg = <200 100>;
-               };
-
-               i2c@3000 {
-                       device_type = "i2c";
-                       compatible = "fsl-i2c";
-                       reg = <3000 100>;
-                       interrupts = <e 8>;
-                       interrupt-parent = <700>;
-                       dfsrr;
-               };
-
-               serial@4500 {
-                       device_type = "serial";
-                       compatible = "ns16550";
-                       reg = <4500 100>;
-                       clock-frequency = <0>;
-                       interrupts = <9 8>;
-                       interrupt-parent = <700>;
-               };
-
-               serial@4600 {
-                       device_type = "serial";
-                       compatible = "ns16550";
-                       reg = <4600 100>;
-                       clock-frequency = <0>;
-                       interrupts = <a 8>;
-                       interrupt-parent = <700>;
-               };
-
-               crypto@30000 {
-                       device_type = "crypto";
-                       model = "SEC2";
-                       compatible = "talitos";
-                       reg = <30000 7000>;
-                       interrupts = <b 8>;
-                       interrupt-parent = <700>;
-                       /* Rev. 2.2 */
-                       num-channels = <1>;
-                       channel-fifo-len = <18>;
-                       exec-units-mask = <0000004c>;
-                       descriptor-types-mask = <0122003f>;
-               };
-
-               pci@8500 {
-                       linux,phandle = <8500>;
-                       interrupt-map-mask = <f800 0 0 7>;
-                       interrupt-map = <
-                                       /* IDSEL 0x11 AD17 */
-                                        8800 0 0 1 700 14 8
-                                        8800 0 0 2 700 15 8
-                                        8800 0 0 3 700 16 8
-                                        8800 0 0 4 700 17 8
-
-                                       /* IDSEL 0x12 AD18 */
-                                        9000 0 0 1 700 16 8
-                                        9000 0 0 2 700 17 8
-                                        9000 0 0 3 700 14 8
-                                        9000 0 0 4 700 15 8
-
-                                       /* IDSEL 0x13 AD19 */
-                                        9800 0 0 1 700 17 8
-                                        9800 0 0 2 700 14 8
-                                        9800 0 0 3 700 15 8
-                                        9800 0 0 4 700 16 8
-
-                                       /* IDSEL 0x15 AD21*/
-                                        a800 0 0 1 700 14 8
-                                        a800 0 0 2 700 15 8
-                                        a800 0 0 3 700 16 8
-                                        a800 0 0 4 700 17 8
-
-                                       /* IDSEL 0x16 AD22*/
-                                        b000 0 0 1 700 17 8
-                                        b000 0 0 2 700 14 8
-                                        b000 0 0 3 700 15 8
-                                        b000 0 0 4 700 16 8
-
-                                       /* IDSEL 0x17 AD23*/
-                                        b800 0 0 1 700 16 8
-                                        b800 0 0 2 700 17 8
-                                        b800 0 0 3 700 14 8
-                                        b800 0 0 4 700 15 8
-
-                                       /* IDSEL 0x18 AD24*/
-                                        c000 0 0 1 700 15 8
-                                        c000 0 0 2 700 16 8
-                                        c000 0 0 3 700 17 8
-                                        c000 0 0 4 700 14 8>;
-                       interrupt-parent = <700>;
-                       interrupts = <42 8>;
-                       bus-range = <0 0>;
-                       ranges = <02000000 0 a0000000 90000000 0 10000000
-                                 42000000 0 80000000 80000000 0 10000000
-                                 01000000 0 00000000 d0000000 0 00100000>;
-                       clock-frequency = <0>;
-                       #interrupt-cells = <1>;
-                       #size-cells = <2>;
-                       #address-cells = <3>;
-                       reg = <8500 100>;
-                       compatible = "83xx";
-                       device_type = "pci";
-               };
-
-               pic@700 {
-                       linux,phandle = <700>;
-                       interrupt-controller;
-                       #address-cells = <0>;
-                       #interrupt-cells = <2>;
-                       reg = <700 100>;
-                       built-in;
-                       device_type = "ipic";
-               };
-               
-               par_io@1400 {
-                       reg = <1400 100>;
-                       device_type = "par_io";
-                       num-ports = <7>;
-
-                       ucc_pin@03 {
-                               linux,phandle = <140003>;
-                               pio-map = <
-                       /* port  pin  dir  open_drain  assignment  has_irq */
-                                       3  4  3  0  2  0  /* MDIO */
-                                       3  5  1  0  2  0  /* MDC */
-                                       0  d  2  0  1  0        /* RX_CLK (CLK9) */
-                                       3 18  2  0  1  0        /* TX_CLK (CLK10) */
-                                       1  1  1  0  1  0        /* TxD1 */
-                                       1  0  1  0  1  0        /* TxD0 */
-                                       1  1  1  0  1  0        /* TxD1 */
-                                       1  2  1  0  1  0        /* TxD2 */
-                                       1  3  1  0  1  0        /* TxD3 */
-                                       1  4  2  0  1  0        /* RxD0 */
-                                       1  5  2  0  1  0        /* RxD1 */
-                                       1  6  2  0  1  0        /* RxD2 */
-                                       1  7  2  0  1  0        /* RxD3 */
-                                       1  8  2  0  1  0        /* RX_ER */
-                                       1  9  1  0  1  0        /* TX_ER */
-                                       1  a  2  0  1  0        /* RX_DV */
-                                       1  b  2  0  1  0        /* COL */
-                                       1  c  1  0  1  0        /* TX_EN */
-                                       1  d  2  0  1  0>;/* CRS */
-                       };
-                       ucc_pin@04 {
-                               linux,phandle = <140004>;
-                               pio-map = <
-                       /* port  pin  dir  open_drain  assignment  has_irq */
-                                       3 1f  2  0  1  0        /* RX_CLK (CLK7) */
-                                       3  6  2  0  1  0        /* TX_CLK (CLK8) */
-                                       1 12  1  0  1  0        /* TxD0 */
-                                       1 13  1  0  1  0        /* TxD1 */
-                                       1 14  1  0  1  0        /* TxD2 */
-                                       1 15  1  0  1  0        /* TxD3 */
-                                       1 16  2  0  1  0        /* RxD0 */
-                                       1 17  2  0  1  0        /* RxD1 */
-                                       1 18  2  0  1  0        /* RxD2 */
-                                       1 19  2  0  1  0        /* RxD3 */
-                                       1 1a  2  0  1  0        /* RX_ER */
-                                       1 1b  1  0  1  0        /* TX_ER */
-                                       1 1c  2  0  1  0        /* RX_DV */
-                                       1 1d  2  0  1  0        /* COL */
-                                       1 1e  1  0  1  0        /* TX_EN */
-                                       1 1f  2  0  1  0>;/* CRS */
-                       };
-               };
-       };
-
-       qe@e0100000 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               device_type = "qe";
-               model = "QE";
-               ranges = <0 e0100000 00100000>;
-               reg = <e0100000 480>;
-               brg-frequency = <0>;
-               bus-frequency = <BCD3D80>;
-               
-               muram@10000 {
-                       device_type = "muram";
-                       ranges = <0 00010000 00004000>;
-       
-                       data-only@0 {
-                               reg = <0 4000>;
-                       };
-               };
-
-               spi@4c0 {
-                       device_type = "spi";
-                       compatible = "fsl_spi";
-                       reg = <4c0 40>;
-                       interrupts = <2>;
-                       interrupt-parent = <80>;
-                       mode = "cpu";
-               };
-
-               spi@500 {
-                       device_type = "spi";
-                       compatible = "fsl_spi";
-                       reg = <500 40>;
-                       interrupts = <1>;
-                       interrupt-parent = <80>;
-                       mode = "cpu";
-               };
-
-               usb@6c0 {
-                       device_type = "usb";
-                       compatible = "qe_udc";
-                       reg = <6c0 40 8B00 100>;
-                       interrupts = <b>;
-                       interrupt-parent = <80>;
-                       mode = "slave";
-               };
-
-               ucc@2200 {
-                       device_type = "network";
-                       compatible = "ucc_geth";
-                       model = "UCC";
-                       device-id = <3>;
-                       reg = <2200 200>;
-                       interrupts = <22>;
-                       interrupt-parent = <80>;
-                       mac-address = [ 00 04 9f 00 23 23 ];
-                       rx-clock = <19>;
-                       tx-clock = <1a>;
-                       phy-handle = <212003>;
-                       pio-handle = <140003>;
-               };
-
-               ucc@3200 {
-                       device_type = "network";
-                       compatible = "ucc_geth";
-                       model = "UCC";
-                       device-id = <4>;
-                       reg = <3000 200>;
-                       interrupts = <23>;
-                       interrupt-parent = <80>;
-                       mac-address = [ 00 11 22 33 44 55 ];
-                       rx-clock = <17>;
-                       tx-clock = <18>;
-                       phy-handle = <212004>;
-                       pio-handle = <140004>;
-               };
-
-               mdio@2320 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       reg = <2320 18>;
-                       device_type = "mdio";
-                       compatible = "ucc_geth_phy";
-
-                       ethernet-phy@03 {
-                               linux,phandle = <212003>;
-                               interrupt-parent = <700>;
-                               interrupts = <11 2>;
-                               reg = <3>;
-                               device_type = "ethernet-phy";
-                               interface = <3>; //ENET_100_MII
-                       };
-                       ethernet-phy@04 {
-                               linux,phandle = <212004>;
-                               interrupt-parent = <700>;
-                               interrupts = <12 2>;
-                               reg = <4>;
-                               device_type = "ethernet-phy";
-                               interface = <3>;
-                       };
-               };
-
-               qeic@80 {
-                       linux,phandle = <80>;
-                       interrupt-controller;
-                       device_type = "qeic";
-                       #address-cells = <0>;
-                       #interrupt-cells = <1>;
-                       reg = <80 80>;
-                       built-in;
-                       big-endian;
-                       interrupts = <20 8 21 8>; //high:32 low:33
-                       interrupt-parent = <700>;
-               };
-       };
-};
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
new file mode 100644 (file)
index 0000000..06b3106
--- /dev/null
@@ -0,0 +1,333 @@
+/*
+ * MPC8323E EMDS Device Tree Source
+ *
+ * Copyright 2006 Freescale Semiconductor Inc.
+ *
+ * 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.
+ */
+
+/ {
+       model = "MPC8323EMDS";
+       compatible = "MPC8323EMDS", "MPC832xMDS", "MPC83xxMDS";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       cpus {
+               #cpus = <1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               PowerPC,8323@0 {
+                       device_type = "cpu";
+                       reg = <0>;
+                       d-cache-line-size = <20>;       // 32 bytes
+                       i-cache-line-size = <20>;       // 32 bytes
+                       d-cache-size = <4000>;          // L1, 16K
+                       i-cache-size = <4000>;          // L1, 16K
+                       timebase-frequency = <0>;
+                       bus-frequency = <0>;
+                       clock-frequency = <0>;
+                       32-bit;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <00000000 08000000>;
+       };
+
+       bcsr@f8000000 {
+               device_type = "board-control";
+               reg = <f8000000 8000>;
+       };
+
+       soc8323@e0000000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               #interrupt-cells = <2>;
+               device_type = "soc";
+               ranges = <0 e0000000 00100000>;
+               reg = <e0000000 00000200>;
+               bus-frequency = <7DE2900>;
+
+               wdt@200 {
+                       device_type = "watchdog";
+                       compatible = "mpc83xx_wdt";
+                       reg = <200 100>;
+               };
+
+               i2c@3000 {
+                       device_type = "i2c";
+                       compatible = "fsl-i2c";
+                       reg = <3000 100>;
+                       interrupts = <e 8>;
+                       interrupt-parent = < &ipic >;
+                       dfsrr;
+               };
+
+               serial@4500 {
+                       device_type = "serial";
+                       compatible = "ns16550";
+                       reg = <4500 100>;
+                       clock-frequency = <0>;
+                       interrupts = <9 8>;
+                       interrupt-parent = < &ipic >;
+               };
+
+               serial@4600 {
+                       device_type = "serial";
+                       compatible = "ns16550";
+                       reg = <4600 100>;
+                       clock-frequency = <0>;
+                       interrupts = <a 8>;
+                       interrupt-parent = < &ipic >;
+               };
+
+               crypto@30000 {
+                       device_type = "crypto";
+                       model = "SEC2";
+                       compatible = "talitos";
+                       reg = <30000 7000>;
+                       interrupts = <b 8>;
+                       interrupt-parent = < &ipic >;
+                       /* Rev. 2.2 */
+                       num-channels = <1>;
+                       channel-fifo-len = <18>;
+                       exec-units-mask = <0000004c>;
+                       descriptor-types-mask = <0122003f>;
+               };
+
+               pci@8500 {
+                       interrupt-map-mask = <f800 0 0 7>;
+                       interrupt-map = <
+                                       /* IDSEL 0x11 AD17 */
+                                        8800 0 0 1 &ipic 14 8
+                                        8800 0 0 2 &ipic 15 8
+                                        8800 0 0 3 &ipic 16 8
+                                        8800 0 0 4 &ipic 17 8
+
+                                       /* IDSEL 0x12 AD18 */
+                                        9000 0 0 1 &ipic 16 8
+                                        9000 0 0 2 &ipic 17 8
+                                        9000 0 0 3 &ipic 14 8
+                                        9000 0 0 4 &ipic 15 8
+
+                                       /* IDSEL 0x13 AD19 */
+                                        9800 0 0 1 &ipic 17 8
+                                        9800 0 0 2 &ipic 14 8
+                                        9800 0 0 3 &ipic 15 8
+                                        9800 0 0 4 &ipic 16 8
+
+                                       /* IDSEL 0x15 AD21*/
+                                        a800 0 0 1 &ipic 14 8
+                                        a800 0 0 2 &ipic 15 8
+                                        a800 0 0 3 &ipic 16 8
+                                        a800 0 0 4 &ipic 17 8
+
+                                       /* IDSEL 0x16 AD22*/
+                                        b000 0 0 1 &ipic 17 8
+                                        b000 0 0 2 &ipic 14 8
+                                        b000 0 0 3 &ipic 15 8
+                                        b000 0 0 4 &ipic 16 8
+
+                                       /* IDSEL 0x17 AD23*/
+                                        b800 0 0 1 &ipic 16 8
+                                        b800 0 0 2 &ipic 17 8
+                                        b800 0 0 3 &ipic 14 8
+                                        b800 0 0 4 &ipic 15 8
+
+                                       /* IDSEL 0x18 AD24*/
+                                        c000 0 0 1 &ipic 15 8
+                                        c000 0 0 2 &ipic 16 8
+                                        c000 0 0 3 &ipic 17 8
+                                        c000 0 0 4 &ipic 14 8>;
+                       interrupt-parent = < &ipic >;
+                       interrupts = <42 8>;
+                       bus-range = <0 0>;
+                       ranges = <02000000 0 a0000000 90000000 0 10000000
+                                 42000000 0 80000000 80000000 0 10000000
+                                 01000000 0 00000000 d0000000 0 00100000>;
+                       clock-frequency = <0>;
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       reg = <8500 100>;
+                       compatible = "83xx";
+                       device_type = "pci";
+               };
+
+               ipic: pic@700 {
+                       interrupt-controller;
+                       #address-cells = <0>;
+                       #interrupt-cells = <2>;
+                       reg = <700 100>;
+                       built-in;
+                       device_type = "ipic";
+               };
+               
+               par_io@1400 {
+                       reg = <1400 100>;
+                       device_type = "par_io";
+                       num-ports = <7>;
+
+                       pio3: ucc_pin@03 {
+                               pio-map = <
+                       /* port  pin  dir  open_drain  assignment  has_irq */
+                                       3  4  3  0  2  0  /* MDIO */
+                                       3  5  1  0  2  0  /* MDC */
+                                       0  d  2  0  1  0        /* RX_CLK (CLK9) */
+                                       3 18  2  0  1  0        /* TX_CLK (CLK10) */
+                                       1  1  1  0  1  0        /* TxD1 */
+                                       1  0  1  0  1  0        /* TxD0 */
+                                       1  1  1  0  1  0        /* TxD1 */
+                                       1  2  1  0  1  0        /* TxD2 */
+                                       1  3  1  0  1  0        /* TxD3 */
+                                       1  4  2  0  1  0        /* RxD0 */
+                                       1  5  2  0  1  0        /* RxD1 */
+                                       1  6  2  0  1  0        /* RxD2 */
+                                       1  7  2  0  1  0        /* RxD3 */
+                                       1  8  2  0  1  0        /* RX_ER */
+                                       1  9  1  0  1  0        /* TX_ER */
+                                       1  a  2  0  1  0        /* RX_DV */
+                                       1  b  2  0  1  0        /* COL */
+                                       1  c  1  0  1  0        /* TX_EN */
+                                       1  d  2  0  1  0>;/* CRS */
+                       };
+                       pio4: ucc_pin@04 {
+                               pio-map = <
+                       /* port  pin  dir  open_drain  assignment  has_irq */
+                                       3 1f  2  0  1  0        /* RX_CLK (CLK7) */
+                                       3  6  2  0  1  0        /* TX_CLK (CLK8) */
+                                       1 12  1  0  1  0        /* TxD0 */
+                                       1 13  1  0  1  0        /* TxD1 */
+                                       1 14  1  0  1  0        /* TxD2 */
+                                       1 15  1  0  1  0        /* TxD3 */
+                                       1 16  2  0  1  0        /* RxD0 */
+                                       1 17  2  0  1  0        /* RxD1 */
+                                       1 18  2  0  1  0        /* RxD2 */
+                                       1 19  2  0  1  0        /* RxD3 */
+                                       1 1a  2  0  1  0        /* RX_ER */
+                                       1 1b  1  0  1  0        /* TX_ER */
+                                       1 1c  2  0  1  0        /* RX_DV */
+                                       1 1d  2  0  1  0        /* COL */
+                                       1 1e  1  0  1  0        /* TX_EN */
+                                       1 1f  2  0  1  0>;/* CRS */
+                       };
+               };
+       };
+
+       qe@e0100000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               device_type = "qe";
+               model = "QE";
+               ranges = <0 e0100000 00100000>;
+               reg = <e0100000 480>;
+               brg-frequency = <0>;
+               bus-frequency = <BCD3D80>;
+               
+               muram@10000 {
+                       device_type = "muram";
+                       ranges = <0 00010000 00004000>;
+       
+                       data-only@0 {
+                               reg = <0 4000>;
+                       };
+               };
+
+               spi@4c0 {
+                       device_type = "spi";
+                       compatible = "fsl_spi";
+                       reg = <4c0 40>;
+                       interrupts = <2>;
+                       interrupt-parent = < &qeic >;
+                       mode = "cpu";
+               };
+
+               spi@500 {
+                       device_type = "spi";
+                       compatible = "fsl_spi";
+                       reg = <500 40>;
+                       interrupts = <1>;
+                       interrupt-parent = < &qeic >;
+                       mode = "cpu";
+               };
+
+               usb@6c0 {
+                       device_type = "usb";
+                       compatible = "qe_udc";
+                       reg = <6c0 40 8B00 100>;
+                       interrupts = <b>;
+                       interrupt-parent = < &qeic >;
+                       mode = "slave";
+               };
+
+               ucc@2200 {
+                       device_type = "network";
+                       compatible = "ucc_geth";
+                       model = "UCC";
+                       device-id = <3>;
+                       reg = <2200 200>;
+                       interrupts = <22>;
+                       interrupt-parent = < &qeic >;
+                       mac-address = [ 00 04 9f 00 23 23 ];
+                       rx-clock = <19>;
+                       tx-clock = <1a>;
+                       phy-handle = < &phy3 >;
+                       pio-handle = < &pio3 >;
+               };
+
+               ucc@3200 {
+                       device_type = "network";
+                       compatible = "ucc_geth";
+                       model = "UCC";
+                       device-id = <4>;
+                       reg = <3000 200>;
+                       interrupts = <23>;
+                       interrupt-parent = < &qeic >;
+                       mac-address = [ 00 11 22 33 44 55 ];
+                       rx-clock = <17>;
+                       tx-clock = <18>;
+                       phy-handle = < &phy4 >;
+                       pio-handle = < &pio4 >;
+               };
+
+               mdio@2320 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <2320 18>;
+                       device_type = "mdio";
+                       compatible = "ucc_geth_phy";
+
+                       phy3: ethernet-phy@03 {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <11 8>;
+                               reg = <3>;
+                               device_type = "ethernet-phy";
+                               interface = <3>; //ENET_100_MII
+                       };
+                       phy4: ethernet-phy@04 {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <12 8>;
+                               reg = <4>;
+                               device_type = "ethernet-phy";
+                               interface = <3>;
+                       };
+               };
+
+               qeic: qeic@80 {
+                       interrupt-controller;
+                       device_type = "qeic";
+                       #address-cells = <0>;
+                       #interrupt-cells = <1>;
+                       reg = <80 80>;
+                       built-in;
+                       big-endian;
+                       interrupts = <20 8 21 8>; //high:32 low:33
+                       interrupt-parent = < &ipic >;
+               };
+       };
+};
index 27807fc45888d1dee01028e3e7c00000cd4dd017..61b550bf1645df06b9425167b3132d6571db2d7a 100644 (file)
@@ -10,7 +10,7 @@
  */
 / {
        model = "MPC8349EMITX";
-       compatible = "MPC834xMITX";
+       compatible = "MPC8349EMITX", "MPC834xMITX", "MPC83xxMITX";
        #address-cells = <1>;
        #size-cells = <1>;
 
@@ -58,7 +58,7 @@
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <e 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        dfsrr;
                };
 
@@ -67,7 +67,7 @@
                        compatible = "fsl-i2c";
                        reg = <3100 100>;
                        interrupts = <f 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        dfsrr;
                };
 
@@ -76,7 +76,7 @@
                        compatible = "mpc83xx_spi";
                        reg = <7000 1000>;
                        interrupts = <10 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        mode = <0>;
                };
 
@@ -86,8 +86,8 @@
                        reg = <22000 1000>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       interrupt-parent = <700>;
-                       interrupts = <27 2>;
+                       interrupt-parent = < &ipic >;
+                       interrupts = <27 8>;
                        phy_type = "ulpi";
                        port1;
                };
@@ -98,8 +98,8 @@
                        reg = <23000 1000>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       interrupt-parent = <700>;
-                       interrupts = <26 2>;
+                       interrupt-parent = < &ipic >;
+                       interrupts = <26 8>;
                        phy_type = "ulpi";
                };
 
                        reg = <24520 20>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       linux,phandle = <24520>;
 
                        /* Vitesse 8201 */
-                       ethernet-phy@1c {
-                               linux,phandle = <245201c>;
-                               interrupt-parent = <700>;
-                               interrupts = <12 2>;
+                       phy1c: ethernet-phy@1c {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <12 8>;
                                reg = <1c>;
                                device_type = "ethernet-phy";
                        };
 
                        /* Vitesse 7385 */
-                       ethernet-phy@1f {
-                               linux,phandle = <245201f>;
-                               interrupt-parent = <700>;
-                               interrupts = <12 2>;
+                       phy1f: ethernet-phy@1f {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <12 8>;
                                reg = <1f>;
                                device_type = "ethernet-phy";
                        };
                        address = [ 00 00 00 00 00 00 ];
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <20 8 21 8 22 8>;
-                       interrupt-parent = <700>;
-                       phy-handle = <245201c>;
+                       interrupt-parent = < &ipic >;
+                       phy-handle = < &phy1c >;
                };
 
                ethernet@25000 {
                        address = [ 00 00 00 00 00 00 ];
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <23 8 24 8 25 8>;
-                       interrupt-parent = <700>;
-                       phy-handle = <245201f>;
+                       interrupt-parent = < &ipic >;
+                       phy-handle = < &phy1f >;
                };
 
                serial@4500 {
                        reg = <4500 100>;
                        clock-frequency = <0>;          // from bootloader
                        interrupts = <9 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                };
 
                serial@4600 {
                        reg = <4600 100>;
                        clock-frequency = <0>;          // from bootloader
                        interrupts = <a 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                };
 
                pci@8500 {
                        interrupt-map-mask = <f800 0 0 7>;
                        interrupt-map = <
                                        /* IDSEL 0x10 - SATA */
-                                       8000 0 0 1 700 16 8 /* SATA_INTA */
+                                       8000 0 0 1 &ipic 16 8 /* SATA_INTA */
                                        >;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        interrupts = <42 8>;
                        bus-range = <0 0>;
                        ranges = <42000000 0 80000000 80000000 0 10000000
                        interrupt-map-mask = <f800 0 0 7>;
                        interrupt-map = <
                                        /* IDSEL 0x0E - MiniPCI Slot */
-                                       7000 0 0 1 700 15 8 /* PCI_INTA */
+                                       7000 0 0 1 &ipic 15 8 /* PCI_INTA */
 
                                        /* IDSEL 0x0F - PCI Slot */
-                                       7800 0 0 1 700 14 8 /* PCI_INTA */
-                                       7800 0 0 2 700 15 8 /* PCI_INTB */
+                                       7800 0 0 1 &ipic 14 8 /* PCI_INTA */
+                                       7800 0 0 2 &ipic 15 8 /* PCI_INTB */
                                         >;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        interrupts = <43 8>;
                        bus-range = <1 1>;
                        ranges = <42000000 0 a0000000 a0000000 0 10000000
                        compatible = "talitos";
                        reg = <30000 10000>;
                        interrupts = <b 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        num-channels = <4>;
                        channel-fifo-len = <18>;
                        exec-units-mask = <0000007e>;
                        descriptor-types-mask = <01010ebf>;
                };
 
-               pic@700 {
-                       linux,phandle = <700>;
+               ipic: pic@700 {
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
index 3190774de1d8896ebd07626023579bf0a8530e19..b2e1a5ec3779b60959b5cf6ef2961400f3173a1e 100644 (file)
@@ -10,7 +10,7 @@
  */
 / {
        model = "MPC8349EMITXGP";
-       compatible = "MPC834xMITXGP";
+       compatible = "MPC8349EMITXGP", "MPC834xMITX", "MPC83xxMITX";
        #address-cells = <1>;
        #size-cells = <1>;
 
@@ -58,7 +58,7 @@
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <e 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        dfsrr;
                };
 
@@ -67,7 +67,7 @@
                        compatible = "fsl-i2c";
                        reg = <3100 100>;
                        interrupts = <f 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        dfsrr;
                };
 
@@ -76,7 +76,7 @@
                        compatible = "mpc83xx_spi";
                        reg = <7000 1000>;
                        interrupts = <10 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        mode = <0>;
                };
 
@@ -86,8 +86,8 @@
                        reg = <23000 1000>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       interrupt-parent = <700>;
-                       interrupts = <26 2>;
+                       interrupt-parent = < &ipic >;
+                       interrupts = <26 8>;
                        dr_mode = "otg";
                        phy_type = "ulpi";
                };
                        reg = <24520 20>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       linux,phandle = <24520>;
 
                        /* Vitesse 8201 */
-                       ethernet-phy@1c {
-                               linux,phandle = <245201c>;
-                               interrupt-parent = <700>;
-                               interrupts = <12 2>;
+                       phy1c: ethernet-phy@1c {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <12 8>;
                                reg = <1c>;
                                device_type = "ethernet-phy";
                        };
                        reg = <24000 1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <20 8 21 8 22 8>;
-                       interrupt-parent = <700>;
-                       phy-handle = <245201c>;
+                       interrupt-parent = < &ipic >;
+                       phy-handle = < &phy1c >;
                };
 
                serial@4500 {
                        reg = <4500 100>;
                        clock-frequency = <0>;          // from bootloader
                        interrupts = <9 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                };
 
                serial@4600 {
                        reg = <4600 100>;
                        clock-frequency = <0>;          // from bootloader
                        interrupts = <a 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                };
 
                pci@8600 {
                        interrupt-map-mask = <f800 0 0 7>;
                        interrupt-map = <
                                        /* IDSEL 0x0F - PCI Slot */
-                                       7800 0 0 1 700 14 8 /* PCI_INTA */
-                                       7800 0 0 2 700 15 8 /* PCI_INTB */
+                                       7800 0 0 1 &ipic 14 8 /* PCI_INTA */
+                                       7800 0 0 2 &ipic 15 8 /* PCI_INTB */
                                         >;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        interrupts = <43 8>;
                        bus-range = <1 1>;
                        ranges = <42000000 0 a0000000 a0000000 0 10000000
                        compatible = "talitos";
                        reg = <30000 10000>;
                        interrupts = <b 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        num-channels = <4>;
                        channel-fifo-len = <18>;
                        exec-units-mask = <0000007e>;
                        descriptor-types-mask = <01010ebf>;
                };
 
-               pic@700 {
-                       linux,phandle = <700>;
+               ipic: pic@700 {
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
index dc121b3cb4a9654a9b6bf48355989651f34b3767..e4b43c24bc0bb54750c6ec9bd2fa864702e000e5 100644 (file)
@@ -11,7 +11,7 @@
 
 / {
        model = "MPC8349EMDS";
-       compatible = "MPC834xMDS";
+       compatible = "MPC8349EMDS", "MPC834xMDS", "MPC83xxMDS";
        #address-cells = <1>;
        #size-cells = <1>;
 
@@ -64,7 +64,7 @@
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <e 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        dfsrr;
                };
 
@@ -73,7 +73,7 @@
                        compatible = "fsl-i2c";
                        reg = <3100 100>;
                        interrupts = <f 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        dfsrr;
                };
 
@@ -82,7 +82,7 @@
                        compatible = "mpc83xx_spi";
                        reg = <7000 1000>;
                        interrupts = <10 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        mode = <0>;
                };
 
@@ -94,8 +94,8 @@
                        reg = <22000 1000>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       interrupt-parent = <700>;
-                       interrupts = <27 2>;
+                       interrupt-parent = < &ipic >;
+                       interrupts = <27 8>;
                        phy_type = "ulpi";
                        port1;
                };
                        reg = <23000 1000>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       interrupt-parent = <700>;
-                       interrupts = <26 2>;
+                       interrupt-parent = < &ipic >;
+                       interrupts = <26 8>;
                        dr_mode = "otg";
                        phy_type = "ulpi";
                };
                        reg = <24520 20>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       linux,phandle = <24520>;
-                       ethernet-phy@0 {
-                               linux,phandle = <2452000>;
-                               interrupt-parent = <700>;
-                               interrupts = <11 2>;
+                       phy0: ethernet-phy@0 {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <11 8>;
                                reg = <0>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@1 {
-                               linux,phandle = <2452001>;
-                               interrupt-parent = <700>;
-                               interrupts = <12 2>;
+                       phy1: ethernet-phy@1 {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <12 8>;
                                reg = <1>;
                                device_type = "ethernet-phy";
                        };
                        address = [ 00 00 00 00 00 00 ];
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <20 8 21 8 22 8>;
-                       interrupt-parent = <700>;
-                       phy-handle = <2452000>;
+                       interrupt-parent = < &ipic >;
+                       phy-handle = < &phy0 >;
                };
 
                ethernet@25000 {
                        address = [ 00 00 00 00 00 00 ];
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <23 8 24 8 25 8>;
-                       interrupt-parent = <700>;
-                       phy-handle = <2452001>;
+                       interrupt-parent = < &ipic >;
+                       phy-handle = < &phy1 >;
                };
 
                serial@4500 {
                        reg = <4500 100>;
                        clock-frequency = <0>;
                        interrupts = <9 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                };
 
                serial@4600 {
                        reg = <4600 100>;
                        clock-frequency = <0>;
                        interrupts = <a 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                };
 
                pci@8500 {
                        interrupt-map = <
 
                                        /* IDSEL 0x11 */
-                                        8800 0 0 1 700 14 8
-                                        8800 0 0 2 700 15 8
-                                        8800 0 0 3 700 16 8
-                                        8800 0 0 4 700 17 8
+                                        8800 0 0 1 &ipic 14 8
+                                        8800 0 0 2 &ipic 15 8
+                                        8800 0 0 3 &ipic 16 8
+                                        8800 0 0 4 &ipic 17 8
 
                                        /* IDSEL 0x12 */
-                                        9000 0 0 1 700 16 8
-                                        9000 0 0 2 700 17 8
-                                        9000 0 0 3 700 14 8
-                                        9000 0 0 4 700 15 8
+                                        9000 0 0 1 &ipic 16 8
+                                        9000 0 0 2 &ipic 17 8
+                                        9000 0 0 3 &ipic 14 8
+                                        9000 0 0 4 &ipic 15 8
 
                                        /* IDSEL 0x13 */
-                                        9800 0 0 1 700 17 8
-                                        9800 0 0 2 700 14 8
-                                        9800 0 0 3 700 15 8
-                                        9800 0 0 4 700 16 8
+                                        9800 0 0 1 &ipic 17 8
+                                        9800 0 0 2 &ipic 14 8
+                                        9800 0 0 3 &ipic 15 8
+                                        9800 0 0 4 &ipic 16 8
 
                                        /* IDSEL 0x15 */
-                                        a800 0 0 1 700 14 8
-                                        a800 0 0 2 700 15 8
-                                        a800 0 0 3 700 16 8
-                                        a800 0 0 4 700 17 8
+                                        a800 0 0 1 &ipic 14 8
+                                        a800 0 0 2 &ipic 15 8
+                                        a800 0 0 3 &ipic 16 8
+                                        a800 0 0 4 &ipic 17 8
 
                                        /* IDSEL 0x16 */
-                                        b000 0 0 1 700 17 8
-                                        b000 0 0 2 700 14 8
-                                        b000 0 0 3 700 15 8
-                                        b000 0 0 4 700 16 8
+                                        b000 0 0 1 &ipic 17 8
+                                        b000 0 0 2 &ipic 14 8
+                                        b000 0 0 3 &ipic 15 8
+                                        b000 0 0 4 &ipic 16 8
 
                                        /* IDSEL 0x17 */
-                                        b800 0 0 1 700 16 8
-                                        b800 0 0 2 700 17 8
-                                        b800 0 0 3 700 14 8
-                                        b800 0 0 4 700 15 8
+                                        b800 0 0 1 &ipic 16 8
+                                        b800 0 0 2 &ipic 17 8
+                                        b800 0 0 3 &ipic 14 8
+                                        b800 0 0 4 &ipic 15 8
 
                                        /* IDSEL 0x18 */
-                                        c000 0 0 1 700 15 8
-                                        c000 0 0 2 700 16 8
-                                        c000 0 0 3 700 17 8
-                                        c000 0 0 4 700 14 8>;
-                       interrupt-parent = <700>;
+                                        c000 0 0 1 &ipic 15 8
+                                        c000 0 0 2 &ipic 16 8
+                                        c000 0 0 3 &ipic 17 8
+                                        c000 0 0 4 &ipic 14 8>;
+                       interrupt-parent = < &ipic >;
                        interrupts = <42 8>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 a0000000 a0000000 0 10000000
                        interrupt-map = <
 
                                        /* IDSEL 0x11 */
-                                        8800 0 0 1 700 14 8
-                                        8800 0 0 2 700 15 8
-                                        8800 0 0 3 700 16 8
-                                        8800 0 0 4 700 17 8
+                                        8800 0 0 1 &ipic 14 8
+                                        8800 0 0 2 &ipic 15 8
+                                        8800 0 0 3 &ipic 16 8
+                                        8800 0 0 4 &ipic 17 8
 
                                        /* IDSEL 0x12 */
-                                        9000 0 0 1 700 16 8
-                                        9000 0 0 2 700 17 8
-                                        9000 0 0 3 700 14 8
-                                        9000 0 0 4 700 15 8
+                                        9000 0 0 1 &ipic 16 8
+                                        9000 0 0 2 &ipic 17 8
+                                        9000 0 0 3 &ipic 14 8
+                                        9000 0 0 4 &ipic 15 8
 
                                        /* IDSEL 0x13 */
-                                        9800 0 0 1 700 17 8
-                                        9800 0 0 2 700 14 8
-                                        9800 0 0 3 700 15 8
-                                        9800 0 0 4 700 16 8
+                                        9800 0 0 1 &ipic 17 8
+                                        9800 0 0 2 &ipic 14 8
+                                        9800 0 0 3 &ipic 15 8
+                                        9800 0 0 4 &ipic 16 8
 
                                        /* IDSEL 0x15 */
-                                        a800 0 0 1 700 14 8
-                                        a800 0 0 2 700 15 8
-                                        a800 0 0 3 700 16 8
-                                        a800 0 0 4 700 17 8
+                                        a800 0 0 1 &ipic 14 8
+                                        a800 0 0 2 &ipic 15 8
+                                        a800 0 0 3 &ipic 16 8
+                                        a800 0 0 4 &ipic 17 8
 
                                        /* IDSEL 0x16 */
-                                        b000 0 0 1 700 17 8
-                                        b000 0 0 2 700 14 8
-                                        b000 0 0 3 700 15 8
-                                        b000 0 0 4 700 16 8
+                                        b000 0 0 1 &ipic 17 8
+                                        b000 0 0 2 &ipic 14 8
+                                        b000 0 0 3 &ipic 15 8
+                                        b000 0 0 4 &ipic 16 8
 
                                        /* IDSEL 0x17 */
-                                        b800 0 0 1 700 16 8
-                                        b800 0 0 2 700 17 8
-                                        b800 0 0 3 700 14 8
-                                        b800 0 0 4 700 15 8
+                                        b800 0 0 1 &ipic 16 8
+                                        b800 0 0 2 &ipic 17 8
+                                        b800 0 0 3 &ipic 14 8
+                                        b800 0 0 4 &ipic 15 8
 
                                        /* IDSEL 0x18 */
-                                        c000 0 0 1 700 15 8
-                                        c000 0 0 2 700 16 8
-                                        c000 0 0 3 700 17 8
-                                        c000 0 0 4 700 14 8>;
-                       interrupt-parent = <700>;
+                                        c000 0 0 1 &ipic 15 8
+                                        c000 0 0 2 &ipic 16 8
+                                        c000 0 0 3 &ipic 17 8
+                                        c000 0 0 4 &ipic 14 8>;
+                       interrupt-parent = < &ipic >;
                        interrupts = <42 8>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 b0000000 b0000000 0 10000000
                        compatible = "talitos";
                        reg = <30000 10000>;
                        interrupts = <b 8>;
-                       interrupt-parent = <700>;
+                       interrupt-parent = < &ipic >;
                        num-channels = <4>;
                        channel-fifo-len = <18>;
                        exec-units-mask = <0000007e>;
                 * sense == 8: Level, low assertion
                 * sense == 2: Edge, high-to-low change
                 */
-               pic@700 {
-                       linux,phandle = <700>;
+               ipic: pic@700 {
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
diff --git a/arch/powerpc/boot/dts/mpc8360emds.dts b/arch/powerpc/boot/dts/mpc8360emds.dts
deleted file mode 100644 (file)
index 9022192..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * MPC8360E EMDS Device Tree Source
- *
- * Copyright 2006 Freescale Semiconductor Inc.
- *
- * 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.
- */
-
-
-/*
-/memreserve/   00000000 1000000;
-*/
-
-/ {
-       model = "MPC8360EPB";
-       compatible = "MPC83xx";
-       #address-cells = <1>;
-       #size-cells = <1>;
-       linux,phandle = <100>;
-
-       cpus {
-               #cpus = <1>;
-               #address-cells = <1>;
-               #size-cells = <0>;
-               linux,phandle = <200>;
-
-               PowerPC,8360@0 {
-                       device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K
-                       i-cache-size = <8000>;          // L1, 32K
-                       timebase-frequency = <3EF1480>;
-                       bus-frequency = <FBC5200>;
-                       clock-frequency = <1F78A400>;
-                       32-bit;
-                       linux,phandle = <201>;
-                       linux,boot-cpu;
-               };
-       };
-
-       memory {
-               device_type = "memory";
-               linux,phandle = <300>;
-               reg = <00000000 10000000>;
-       };
-
-       bcsr@f8000000 {
-               device_type = "board-control";
-               reg = <f8000000 8000>;
-       };
-
-       soc8360@e0000000 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               #interrupt-cells = <2>;
-               device_type = "soc";
-               ranges = <0 e0000000 00100000>;
-               reg = <e0000000 00000200>;
-               bus-frequency = <FBC5200>;
-
-               wdt@200 {
-                       device_type = "watchdog";
-                       compatible = "mpc83xx_wdt";
-                       reg = <200 100>;
-               };
-
-               i2c@3000 {
-                       device_type = "i2c";
-                       compatible = "fsl-i2c";
-                       reg = <3000 100>;
-                       interrupts = <e 8>;
-                       interrupt-parent = <700>;
-                       dfsrr;
-               };
-
-               i2c@3100 {
-                       device_type = "i2c";
-                       compatible = "fsl-i2c";
-                       reg = <3100 100>;
-                       interrupts = <f 8>;
-                       interrupt-parent = <700>;
-                       dfsrr;
-               };
-
-               serial@4500 {
-                       device_type = "serial";
-                       compatible = "ns16550";
-                       reg = <4500 100>;
-                       clock-frequency = <FBC5200>;
-                       interrupts = <9 8>;
-                       interrupt-parent = <700>;
-               };
-
-               serial@4600 {
-                       device_type = "serial";
-                       compatible = "ns16550";
-                       reg = <4600 100>;
-                       clock-frequency = <FBC5200>;
-                       interrupts = <a 8>;
-                       interrupt-parent = <700>;
-               };
-
-               crypto@30000 {
-                       device_type = "crypto";
-                       model = "SEC2";
-                       compatible = "talitos";
-                       reg = <30000 10000>;
-                       interrupts = <b 8>;
-                       interrupt-parent = <700>;
-                       num-channels = <4>;
-                       channel-fifo-len = <18>;
-                       exec-units-mask = <0000007e>;
-                       /* desc mask is for rev1.x, we need runtime fixup for >=2.x */
-                       descriptor-types-mask = <01010ebf>;
-               };
-
-               pci@8500 {
-                       linux,phandle = <8500>;
-                       interrupt-map-mask = <f800 0 0 7>;
-                       interrupt-map = <
-
-                                       /* IDSEL 0x11 AD17 */
-                                        8800 0 0 1 700 14 8
-                                        8800 0 0 2 700 15 8
-                                        8800 0 0 3 700 16 8
-                                        8800 0 0 4 700 17 8
-
-                                       /* IDSEL 0x12 AD18 */
-                                        9000 0 0 1 700 16 8
-                                        9000 0 0 2 700 17 8
-                                        9000 0 0 3 700 14 8
-                                        9000 0 0 4 700 15 8
-
-                                       /* IDSEL 0x13 AD19 */
-                                        9800 0 0 1 700 17 8
-                                        9800 0 0 2 700 14 8
-                                        9800 0 0 3 700 15 8
-                                        9800 0 0 4 700 16 8
-
-                                       /* IDSEL 0x15 AD21*/
-                                        a800 0 0 1 700 14 8
-                                        a800 0 0 2 700 15 8
-                                        a800 0 0 3 700 16 8
-                                        a800 0 0 4 700 17 8
-
-                                       /* IDSEL 0x16 AD22*/
-                                        b000 0 0 1 700 17 8
-                                        b000 0 0 2 700 14 8
-                                        b000 0 0 3 700 15 8
-                                        b000 0 0 4 700 16 8
-
-                                       /* IDSEL 0x17 AD23*/
-                                        b800 0 0 1 700 16 8
-                                        b800 0 0 2 700 17 8
-                                        b800 0 0 3 700 14 8
-                                        b800 0 0 4 700 15 8
-
-                                       /* IDSEL 0x18 AD24*/
-                                        c000 0 0 1 700 15 8
-                                        c000 0 0 2 700 16 8
-                                        c000 0 0 3 700 17 8
-                                        c000 0 0 4 700 14 8>;
-                       interrupt-parent = <700>;
-                       interrupts = <42 8>;
-                       bus-range = <0 0>;
-                       ranges = <02000000 0 a0000000 a0000000 0 10000000
-                                 42000000 0 80000000 80000000 0 10000000
-                                 01000000 0 00000000 e2000000 0 00100000>;
-                       clock-frequency = <3f940aa>;
-                       #interrupt-cells = <1>;
-                       #size-cells = <2>;
-                       #address-cells = <3>;
-                       reg = <8500 100>;
-                       compatible = "83xx";
-                       device_type = "pci";
-               };
-
-               pic@700 {
-                       linux,phandle = <700>;
-                       interrupt-controller;
-                       #address-cells = <0>;
-                       #interrupt-cells = <2>;
-                       reg = <700 100>;
-                       built-in;
-                       device_type = "ipic";
-               };
-
-               par_io@1400 {
-                       reg = <1400 100>;
-                       device_type = "par_io";
-                       num-ports = <7>;
-
-                       ucc_pin@01 {
-                               linux,phandle = <140001>;
-                               pio-map = <
-                       /* port  pin  dir  open_drain  assignment  has_irq */
-                                       0  3  1  0  1  0        /* TxD0 */
-                                       0  4  1  0  1  0        /* TxD1 */
-                                       0  5  1  0  1  0        /* TxD2 */
-                                       0  6  1  0  1  0        /* TxD3 */
-                                       1  6  1  0  3  0        /* TxD4 */
-                                       1  7  1  0  1  0        /* TxD5 */
-                                       1  9  1  0  2  0        /* TxD6 */
-                                       1  a  1  0  2  0        /* TxD7 */
-                                       0  9  2  0  1  0        /* RxD0 */
-                                       0  a  2  0  1  0        /* RxD1 */
-                                       0  b  2  0  1  0        /* RxD2 */
-                                       0  c  2  0  1  0        /* RxD3 */
-                                       0  d  2  0  1  0        /* RxD4 */
-                                       1  1  2  0  2  0        /* RxD5 */
-                                       1  0  2  0  2  0        /* RxD6 */
-                                       1  4  2  0  2  0        /* RxD7 */
-                                       0  7  1  0  1  0        /* TX_EN */
-                                       0  8  1  0  1  0        /* TX_ER */
-                                       0  f  2  0  1  0        /* RX_DV */
-                                       0  10 2  0  1  0        /* RX_ER */
-                                       0  0  2  0  1  0        /* RX_CLK */
-                                       2  9  1  0  3  0        /* GTX_CLK - CLK10 */
-                                       2  8  2  0  1  0>;      /* GTX125 - CLK9 */
-                       };
-                       ucc_pin@02 {
-                               linux,phandle = <140002>;
-                               pio-map = <
-                       /* port  pin  dir  open_drain  assignment  has_irq */
-                                       0  11 1  0  1  0   /* TxD0 */
-                                       0  12 1  0  1  0   /* TxD1 */
-                                       0  13 1  0  1  0   /* TxD2 */
-                                       0  14 1  0  1  0   /* TxD3 */
-                                       1  2  1  0  1  0   /* TxD4 */
-                                       1  3  1  0  2  0   /* TxD5 */
-                                       1  5  1  0  3  0   /* TxD6 */
-                                       1  8  1  0  3  0   /* TxD7 */
-                                       0  17 2  0  1  0   /* RxD0 */
-                                       0  18 2  0  1  0   /* RxD1 */
-                                       0  19 2  0  1  0   /* RxD2 */
-                                       0  1a 2  0  1  0   /* RxD3 */
-                                       0  1b 2  0  1  0   /* RxD4 */
-                                       1  c  2  0  2  0   /* RxD5 */
-                                       1  d  2  0  3  0   /* RxD6 */
-                                       1  b  2  0  2  0   /* RxD7 */
-                                       0  15 1  0  1  0   /* TX_EN */
-                                       0  16 1  0  1  0   /* TX_ER */
-                                       0  1d 2  0  1  0   /* RX_DV */
-                                       0  1e 2  0  1  0   /* RX_ER */
-                                       0  1f 2  0  1  0   /* RX_CLK */
-                                       2  2  1  0  2  0   /* GTX_CLK - CLK10 */
-                                       2  3  2  0  1  0   /* GTX125 - CLK4 */
-                                       0  1  3  0  2  0   /* MDIO */
-                                       0  2  1  0  1  0>; /* MDC */
-                       };
-
-               };
-       };
-
-       qe@e0100000 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               device_type = "qe";
-               model = "QE";
-               ranges = <0 e0100000 00100000>;
-               reg = <e0100000 480>;
-               brg-frequency = <0>;
-               bus-frequency = <179A7B00>;
-
-               muram@10000 {
-                       device_type = "muram";
-                       ranges = <0 00010000 0000c000>;
-
-                       data-only@0{
-                               reg = <0 c000>;
-                       };
-               };
-
-               spi@4c0 {
-                       device_type = "spi";
-                       compatible = "fsl_spi";
-                       reg = <4c0 40>;
-                       interrupts = <2>;
-                       interrupt-parent = <80>;
-                       mode = "cpu";
-               };
-
-               spi@500 {
-                       device_type = "spi";
-                       compatible = "fsl_spi";
-                       reg = <500 40>;
-                       interrupts = <1>;
-                       interrupt-parent = <80>;
-                       mode = "cpu";
-               };
-
-               usb@6c0 {
-                       device_type = "usb";
-                       compatible = "qe_udc";
-                       reg = <6c0 40 8B00 100>;
-                       interrupts = <b>;
-                       interrupt-parent = <80>;
-                       mode = "slave";
-               };
-
-               ucc@2000 {
-                       device_type = "network";
-                       compatible = "ucc_geth";
-                       model = "UCC";
-                       device-id = <1>;
-                       reg = <2000 200>;
-                       interrupts = <20>;
-                       interrupt-parent = <80>;
-                       mac-address = [ 00 04 9f 00 23 23 ];
-                       rx-clock = <0>;
-                       tx-clock = <19>;
-                       phy-handle = <212000>;
-                       pio-handle = <140001>;
-               };
-
-               ucc@3000 {
-                       device_type = "network";
-                       compatible = "ucc_geth";
-                       model = "UCC";
-                       device-id = <2>;
-                       reg = <3000 200>;
-                       interrupts = <21>;
-                       interrupt-parent = <80>;
-                       mac-address = [ 00 11 22 33 44 55 ];
-                       rx-clock = <0>;
-                       tx-clock = <14>;
-                       phy-handle = <212001>;
-                       pio-handle = <140002>;
-               };
-
-               mdio@2120 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       reg = <2120 18>;
-                       device_type = "mdio";
-                       compatible = "ucc_geth_phy";
-
-                       ethernet-phy@00 {
-                               linux,phandle = <212000>;
-                               interrupt-parent = <700>;
-                               interrupts = <11 2>;
-                               reg = <0>;
-                               device_type = "ethernet-phy";
-                               interface = <6>; //ENET_1000_GMII
-                       };
-                       ethernet-phy@01 {
-                               linux,phandle = <212001>;
-                               interrupt-parent = <700>;
-                               interrupts = <12 2>;
-                               reg = <1>;
-                               device_type = "ethernet-phy";
-                               interface = <6>;
-                       };
-               };
-
-               qeic@80 {
-                       linux,phandle = <80>;
-                       interrupt-controller;
-                       device_type = "qeic";
-                       #address-cells = <0>;
-                       #interrupt-cells = <1>;
-                       reg = <80 80>;
-                       built-in;
-                       big-endian;
-                       interrupts = <20 8 21 8>; //high:32 low:33
-                       interrupt-parent = <700>;
-               };
-
-       };
-};
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
new file mode 100644 (file)
index 0000000..4fe45c0
--- /dev/null
@@ -0,0 +1,363 @@
+/*
+ * MPC8360E EMDS Device Tree Source
+ *
+ * Copyright 2006 Freescale Semiconductor Inc.
+ *
+ * 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.
+ */
+
+
+/*
+/memreserve/   00000000 1000000;
+*/
+
+/ {
+       model = "MPC8360MDS";
+       compatible = "MPC8360EMDS", "MPC836xMDS", "MPC83xxMDS";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       cpus {
+               #cpus = <1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               PowerPC,8360@0 {
+                       device_type = "cpu";
+                       reg = <0>;
+                       d-cache-line-size = <20>;       // 32 bytes
+                       i-cache-line-size = <20>;       // 32 bytes
+                       d-cache-size = <8000>;          // L1, 32K
+                       i-cache-size = <8000>;          // L1, 32K
+                       timebase-frequency = <3EF1480>;
+                       bus-frequency = <FBC5200>;
+                       clock-frequency = <1F78A400>;
+                       32-bit;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <00000000 10000000>;
+       };
+
+       bcsr@f8000000 {
+               device_type = "board-control";
+               reg = <f8000000 8000>;
+       };
+
+       soc8360@e0000000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               #interrupt-cells = <2>;
+               device_type = "soc";
+               ranges = <0 e0000000 00100000>;
+               reg = <e0000000 00000200>;
+               bus-frequency = <FBC5200>;
+
+               wdt@200 {
+                       device_type = "watchdog";
+                       compatible = "mpc83xx_wdt";
+                       reg = <200 100>;
+               };
+
+               i2c@3000 {
+                       device_type = "i2c";
+                       compatible = "fsl-i2c";
+                       reg = <3000 100>;
+                       interrupts = <e 8>;
+                       interrupt-parent = < &ipic >;
+                       dfsrr;
+               };
+
+               i2c@3100 {
+                       device_type = "i2c";
+                       compatible = "fsl-i2c";
+                       reg = <3100 100>;
+                       interrupts = <f 8>;
+                       interrupt-parent = < &ipic >;
+                       dfsrr;
+               };
+
+               serial@4500 {
+                       device_type = "serial";
+                       compatible = "ns16550";
+                       reg = <4500 100>;
+                       clock-frequency = <FBC5200>;
+                       interrupts = <9 8>;
+                       interrupt-parent = < &ipic >;
+               };
+
+               serial@4600 {
+                       device_type = "serial";
+                       compatible = "ns16550";
+                       reg = <4600 100>;
+                       clock-frequency = <FBC5200>;
+                       interrupts = <a 8>;
+                       interrupt-parent = < &ipic >;
+               };
+
+               crypto@30000 {
+                       device_type = "crypto";
+                       model = "SEC2";
+                       compatible = "talitos";
+                       reg = <30000 10000>;
+                       interrupts = <b 8>;
+                       interrupt-parent = < &ipic >;
+                       num-channels = <4>;
+                       channel-fifo-len = <18>;
+                       exec-units-mask = <0000007e>;
+                       /* desc mask is for rev1.x, we need runtime fixup for >=2.x */
+                       descriptor-types-mask = <01010ebf>;
+               };
+
+               pci@8500 {
+                       interrupt-map-mask = <f800 0 0 7>;
+                       interrupt-map = <
+
+                                       /* IDSEL 0x11 AD17 */
+                                        8800 0 0 1 &ipic 14 8
+                                        8800 0 0 2 &ipic 15 8
+                                        8800 0 0 3 &ipic 16 8
+                                        8800 0 0 4 &ipic 17 8
+
+                                       /* IDSEL 0x12 AD18 */
+                                        9000 0 0 1 &ipic 16 8
+                                        9000 0 0 2 &ipic 17 8
+                                        9000 0 0 3 &ipic 14 8
+                                        9000 0 0 4 &ipic 15 8
+
+                                       /* IDSEL 0x13 AD19 */
+                                        9800 0 0 1 &ipic 17 8
+                                        9800 0 0 2 &ipic 14 8
+                                        9800 0 0 3 &ipic 15 8
+                                        9800 0 0 4 &ipic 16 8
+
+                                       /* IDSEL 0x15 AD21*/
+                                        a800 0 0 1 &ipic 14 8
+                                        a800 0 0 2 &ipic 15 8
+                                        a800 0 0 3 &ipic 16 8
+                                        a800 0 0 4 &ipic 17 8
+
+                                       /* IDSEL 0x16 AD22*/
+                                        b000 0 0 1 &ipic 17 8
+                                        b000 0 0 2 &ipic 14 8
+                                        b000 0 0 3 &ipic 15 8
+                                        b000 0 0 4 &ipic 16 8
+
+                                       /* IDSEL 0x17 AD23*/
+                                        b800 0 0 1 &ipic 16 8
+                                        b800 0 0 2 &ipic 17 8
+                                        b800 0 0 3 &ipic 14 8
+                                        b800 0 0 4 &ipic 15 8
+
+                                       /* IDSEL 0x18 AD24*/
+                                        c000 0 0 1 &ipic 15 8
+                                        c000 0 0 2 &ipic 16 8
+                                        c000 0 0 3 &ipic 17 8
+                                        c000 0 0 4 &ipic 14 8>;
+                       interrupt-parent = < &ipic >;
+                       interrupts = <42 8>;
+                       bus-range = <0 0>;
+                       ranges = <02000000 0 a0000000 a0000000 0 10000000
+                                 42000000 0 80000000 80000000 0 10000000
+                                 01000000 0 00000000 e2000000 0 00100000>;
+                       clock-frequency = <3f940aa>;
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       reg = <8500 100>;
+                       compatible = "83xx";
+                       device_type = "pci";
+               };
+
+               ipic: pic@700 {
+                       interrupt-controller;
+                       #address-cells = <0>;
+                       #interrupt-cells = <2>;
+                       reg = <700 100>;
+                       built-in;
+                       device_type = "ipic";
+               };
+
+               par_io@1400 {
+                       reg = <1400 100>;
+                       device_type = "par_io";
+                       num-ports = <7>;
+
+                       pio1: ucc_pin@01 {
+                               pio-map = <
+                       /* port  pin  dir  open_drain  assignment  has_irq */
+                                       0  3  1  0  1  0        /* TxD0 */
+                                       0  4  1  0  1  0        /* TxD1 */
+                                       0  5  1  0  1  0        /* TxD2 */
+                                       0  6  1  0  1  0        /* TxD3 */
+                                       1  6  1  0  3  0        /* TxD4 */
+                                       1  7  1  0  1  0        /* TxD5 */
+                                       1  9  1  0  2  0        /* TxD6 */
+                                       1  a  1  0  2  0        /* TxD7 */
+                                       0  9  2  0  1  0        /* RxD0 */
+                                       0  a  2  0  1  0        /* RxD1 */
+                                       0  b  2  0  1  0        /* RxD2 */
+                                       0  c  2  0  1  0        /* RxD3 */
+                                       0  d  2  0  1  0        /* RxD4 */
+                                       1  1  2  0  2  0        /* RxD5 */
+                                       1  0  2  0  2  0        /* RxD6 */
+                                       1  4  2  0  2  0        /* RxD7 */
+                                       0  7  1  0  1  0        /* TX_EN */
+                                       0  8  1  0  1  0        /* TX_ER */
+                                       0  f  2  0  1  0        /* RX_DV */
+                                       0  10 2  0  1  0        /* RX_ER */
+                                       0  0  2  0  1  0        /* RX_CLK */
+                                       2  9  1  0  3  0        /* GTX_CLK - CLK10 */
+                                       2  8  2  0  1  0>;      /* GTX125 - CLK9 */
+                       };
+                       pio2: ucc_pin@02 {
+                               pio-map = <
+                       /* port  pin  dir  open_drain  assignment  has_irq */
+                                       0  11 1  0  1  0   /* TxD0 */
+                                       0  12 1  0  1  0   /* TxD1 */
+                                       0  13 1  0  1  0   /* TxD2 */
+                                       0  14 1  0  1  0   /* TxD3 */
+                                       1  2  1  0  1  0   /* TxD4 */
+                                       1  3  1  0  2  0   /* TxD5 */
+                                       1  5  1  0  3  0   /* TxD6 */
+                                       1  8  1  0  3  0   /* TxD7 */
+                                       0  17 2  0  1  0   /* RxD0 */
+                                       0  18 2  0  1  0   /* RxD1 */
+                                       0  19 2  0  1  0   /* RxD2 */
+                                       0  1a 2  0  1  0   /* RxD3 */
+                                       0  1b 2  0  1  0   /* RxD4 */
+                                       1  c  2  0  2  0   /* RxD5 */
+                                       1  d  2  0  3  0   /* RxD6 */
+                                       1  b  2  0  2  0   /* RxD7 */
+                                       0  15 1  0  1  0   /* TX_EN */
+                                       0  16 1  0  1  0   /* TX_ER */
+                                       0  1d 2  0  1  0   /* RX_DV */
+                                       0  1e 2  0  1  0   /* RX_ER */
+                                       0  1f 2  0  1  0   /* RX_CLK */
+                                       2  2  1  0  2  0   /* GTX_CLK - CLK10 */
+                                       2  3  2  0  1  0   /* GTX125 - CLK4 */
+                                       0  1  3  0  2  0   /* MDIO */
+                                       0  2  1  0  1  0>; /* MDC */
+                       };
+
+               };
+       };
+
+       qe@e0100000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               device_type = "qe";
+               model = "QE";
+               ranges = <0 e0100000 00100000>;
+               reg = <e0100000 480>;
+               brg-frequency = <0>;
+               bus-frequency = <179A7B00>;
+
+               muram@10000 {
+                       device_type = "muram";
+                       ranges = <0 00010000 0000c000>;
+
+                       data-only@0{
+                               reg = <0 c000>;
+                       };
+               };
+
+               spi@4c0 {
+                       device_type = "spi";
+                       compatible = "fsl_spi";
+                       reg = <4c0 40>;
+                       interrupts = <2>;
+                       interrupt-parent = < &qeic >;
+                       mode = "cpu";
+               };
+
+               spi@500 {
+                       device_type = "spi";
+                       compatible = "fsl_spi";
+                       reg = <500 40>;
+                       interrupts = <1>;
+                       interrupt-parent = < &qeic >;
+                       mode = "cpu";
+               };
+
+               usb@6c0 {
+                       device_type = "usb";
+                       compatible = "qe_udc";
+                       reg = <6c0 40 8B00 100>;
+                       interrupts = <b>;
+                       interrupt-parent = < &qeic >;
+                       mode = "slave";
+               };
+
+               ucc@2000 {
+                       device_type = "network";
+                       compatible = "ucc_geth";
+                       model = "UCC";
+                       device-id = <1>;
+                       reg = <2000 200>;
+                       interrupts = <20>;
+                       interrupt-parent = < &qeic >;
+                       mac-address = [ 00 04 9f 00 23 23 ];
+                       rx-clock = <0>;
+                       tx-clock = <19>;
+                       phy-handle = < &phy0 >;
+                       pio-handle = < &pio1 >;
+               };
+
+               ucc@3000 {
+                       device_type = "network";
+                       compatible = "ucc_geth";
+                       model = "UCC";
+                       device-id = <2>;
+                       reg = <3000 200>;
+                       interrupts = <21>;
+                       interrupt-parent = < &qeic >;
+                       mac-address = [ 00 11 22 33 44 55 ];
+                       rx-clock = <0>;
+                       tx-clock = <14>;
+                       phy-handle = < &phy1 >;
+                       pio-handle = < &pio2 >;
+               };
+
+               mdio@2120 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <2120 18>;
+                       device_type = "mdio";
+                       compatible = "ucc_geth_phy";
+
+                       phy0: ethernet-phy@00 {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <11 8>;
+                               reg = <0>;
+                               device_type = "ethernet-phy";
+                               interface = <6>; //ENET_1000_GMII
+                       };
+                       phy1: ethernet-phy@01 {
+                               interrupt-parent = < &ipic >;
+                               interrupts = <12 8>;
+                               reg = <1>;
+                               device_type = "ethernet-phy";
+                               interface = <6>;
+                       };
+               };
+
+               qeic: qeic@80 {
+                       interrupt-controller;
+                       device_type = "qeic";
+                       #address-cells = <0>;
+                       #interrupt-cells = <1>;
+                       reg = <80 80>;
+                       built-in;
+                       big-endian;
+                       interrupts = <20 8 21 8>; //high:32 low:33
+                       interrupt-parent = < &ipic >;
+               };
+
+       };
+};
index 5f41c1f7a5f311cb83b9d94c55592a681ea091fe..3c0917fa791cff3f512350db29ccf06dac022309 100644 (file)
 
 / {
        model = "MPC8540ADS";
-       compatible = "MPC85xxADS";
+       compatible = "MPC8540ADS", "MPC85xxADS";
        #address-cells = <1>;
        #size-cells = <1>;
-       linux,phandle = <100>;
 
        cpus {
                #cpus = <1>;
                #address-cells = <1>;
                #size-cells = <0>;
-               linux,phandle = <200>;
 
                PowerPC,8540@0 {
                        device_type = "cpu";
                        bus-frequency = <0>;    // 166 MHz
                        clock-frequency = <0>;  // 825 MHz, from uboot
                        32-bit;
-                       linux,phandle = <201>;
                };
        };
 
        memory {
                device_type = "memory";
-               linux,phandle = <300>;
                reg = <00000000 08000000>;      // 128M at 0x0
        };
 
@@ -58,7 +54,7 @@
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <1b 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        dfsrr;
                };
 
                        device_type = "mdio";
                        compatible = "gianfar";
                        reg = <24520 20>;
-                       linux,phandle = <24520>;
-                       ethernet-phy@0 {
-                               linux,phandle = <2452000>;
-                               interrupt-parent = <40000>;
+                       phy0: ethernet-phy@0 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 1>;
                                reg = <0>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@1 {
-                               linux,phandle = <2452001>;
-                               interrupt-parent = <40000>;
+                       phy1: ethernet-phy@1 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 1>;
                                reg = <1>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@3 {
-                               linux,phandle = <2452003>;
-                               interrupt-parent = <40000>;
+                       phy3: ethernet-phy@3 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <37 1>;
                                reg = <3>;
                                device_type = "ethernet-phy";
                        address = [ 00 E0 0C 00 73 00 ];
                        local-mac-address = [ 00 E0 0C 00 73 00 ];
                        interrupts = <d 2 e 2 12 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452000>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy0>;
                };
 
                ethernet@25000 {
                        address = [ 00 E0 0C 00 73 01 ];
                        local-mac-address = [ 00 E0 0C 00 73 01 ];
                        interrupts = <13 2 14 2 18 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452001>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy1>;
                };
 
                ethernet@26000 {
                        address = [ 00 E0 0C 00 73 02 ];
                        local-mac-address = [ 00 E0 0C 00 73 02 ];
                        interrupts = <19 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452003>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy3>;
                };
 
                serial@4500 {
                        reg = <4500 100>;       // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
                        interrupts = <1a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
                serial@4600 {
                        reg = <4600 100>;       // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
                        interrupts = <1a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
                pci@8000 {
-                       linux,phandle = <8000>;
                        interrupt-map-mask = <f800 0 0 7>;
                        interrupt-map = <
 
                                /* IDSEL 0x02 */
-                               1000 0 0 1 40000 31 1
-                               1000 0 0 2 40000 32 1
-                               1000 0 0 3 40000 33 1
-                               1000 0 0 4 40000 34 1
+                               1000 0 0 1 &mpic 31 1
+                               1000 0 0 2 &mpic 32 1
+                               1000 0 0 3 &mpic 33 1
+                               1000 0 0 4 &mpic 34 1
 
                                /* IDSEL 0x03 */
-                               1800 0 0 1 40000 34 1
-                               1800 0 0 2 40000 31 1
-                               1800 0 0 3 40000 32 1
-                               1800 0 0 4 40000 33 1
+                               1800 0 0 1 &mpic 34 1
+                               1800 0 0 2 &mpic 31 1
+                               1800 0 0 3 &mpic 32 1
+                               1800 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x04 */
-                               2000 0 0 1 40000 33 1
-                               2000 0 0 2 40000 34 1
-                               2000 0 0 3 40000 31 1
-                               2000 0 0 4 40000 32 1
+                               2000 0 0 1 &mpic 33 1
+                               2000 0 0 2 &mpic 34 1
+                               2000 0 0 3 &mpic 31 1
+                               2000 0 0 4 &mpic 32 1
 
                                /* IDSEL 0x05 */
-                               2800 0 0 1 40000 32 1
-                               2800 0 0 2 40000 33 1
-                               2800 0 0 3 40000 34 1
-                               2800 0 0 4 40000 31 1
+                               2800 0 0 1 &mpic 32 1
+                               2800 0 0 2 &mpic 33 1
+                               2800 0 0 3 &mpic 34 1
+                               2800 0 0 4 &mpic 31 1
 
                                /* IDSEL 0x0c */
-                               6000 0 0 1 40000 31 1
-                               6000 0 0 2 40000 32 1
-                               6000 0 0 3 40000 33 1
-                               6000 0 0 4 40000 34 1
+                               6000 0 0 1 &mpic 31 1
+                               6000 0 0 2 &mpic 32 1
+                               6000 0 0 3 &mpic 33 1
+                               6000 0 0 4 &mpic 34 1
 
                                /* IDSEL 0x0d */
-                               6800 0 0 1 40000 34 1
-                               6800 0 0 2 40000 31 1
-                               6800 0 0 3 40000 32 1
-                               6800 0 0 4 40000 33 1
+                               6800 0 0 1 &mpic 34 1
+                               6800 0 0 2 &mpic 31 1
+                               6800 0 0 3 &mpic 32 1
+                               6800 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x0e */
-                               7000 0 0 1 40000 33 1
-                               7000 0 0 2 40000 34 1
-                               7000 0 0 3 40000 31 1
-                               7000 0 0 4 40000 32 1
+                               7000 0 0 1 &mpic 33 1
+                               7000 0 0 2 &mpic 34 1
+                               7000 0 0 3 &mpic 31 1
+                               7000 0 0 4 &mpic 32 1
 
                                /* IDSEL 0x0f */
-                               7800 0 0 1 40000 32 1
-                               7800 0 0 2 40000 33 1
-                               7800 0 0 3 40000 34 1
-                               7800 0 0 4 40000 31 1
+                               7800 0 0 1 &mpic 32 1
+                               7800 0 0 2 &mpic 33 1
+                               7800 0 0 3 &mpic 34 1
+                               7800 0 0 4 &mpic 31 1
 
                                /* IDSEL 0x12 */
-                               9000 0 0 1 40000 31 1
-                               9000 0 0 2 40000 32 1
-                               9000 0 0 3 40000 33 1
-                               9000 0 0 4 40000 34 1
+                               9000 0 0 1 &mpic 31 1
+                               9000 0 0 2 &mpic 32 1
+                               9000 0 0 3 &mpic 33 1
+                               9000 0 0 4 &mpic 34 1
 
                                /* IDSEL 0x13 */
-                               9800 0 0 1 40000 34 1
-                               9800 0 0 2 40000 31 1
-                               9800 0 0 3 40000 32 1
-                               9800 0 0 4 40000 33 1
+                               9800 0 0 1 &mpic 34 1
+                               9800 0 0 2 &mpic 31 1
+                               9800 0 0 3 &mpic 32 1
+                               9800 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x14 */
-                               a000 0 0 1 40000 33 1
-                               a000 0 0 2 40000 34 1
-                               a000 0 0 3 40000 31 1
-                               a000 0 0 4 40000 32 1
+                               a000 0 0 1 &mpic 33 1
+                               a000 0 0 2 &mpic 34 1
+                               a000 0 0 3 &mpic 31 1
+                               a000 0 0 4 &mpic 32 1
 
                                /* IDSEL 0x15 */
-                               a800 0 0 1 40000 32 1
-                               a800 0 0 2 40000 33 1
-                               a800 0 0 3 40000 34 1
-                               a800 0 0 4 40000 31 1>;
-                       interrupt-parent = <40000>;
+                               a800 0 0 1 &mpic 32 1
+                               a800 0 0 2 &mpic 33 1
+                               a800 0 0 3 &mpic 34 1
+                               a800 0 0 4 &mpic 31 1>;
+                       interrupt-parent = <&mpic>;
                        interrupts = <08 2>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 80000000 80000000 0 20000000
                        device_type = "pci";
                };
 
-               pic@40000 {
-                       linux,phandle = <40000>;
+               mpic: pic@40000 {
                        clock-frequency = <0>;
                        interrupt-controller;
                        #address-cells = <0>;
index 7be0bc659e1c3f42cc4b98c72ee234226e902f21..2a1ae760ab3a9fa349015deb31f2a06cb45b8b2c 100644 (file)
 
 / {
        model = "MPC8541CDS";
-       compatible = "MPC85xxCDS";
+       compatible = "MPC8541CDS", "MPC85xxCDS";
        #address-cells = <1>;
        #size-cells = <1>;
-       linux,phandle = <100>;
 
        cpus {
                #cpus = <1>;
                #address-cells = <1>;
                #size-cells = <0>;
-               linux,phandle = <200>;
 
                PowerPC,8541@0 {
                        device_type = "cpu";
                        bus-frequency = <0>;    // 166 MHz
                        clock-frequency = <0>;  // 825 MHz, from uboot
                        32-bit;
-                       linux,phandle = <201>;
                };
        };
 
        memory {
                device_type = "memory";
-               linux,phandle = <300>;
                reg = <00000000 08000000>;      // 128M at 0x0
        };
 
@@ -58,7 +54,7 @@
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <1b 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        dfsrr;
                };
 
                        device_type = "mdio";
                        compatible = "gianfar";
                        reg = <24520 20>;
-                       linux,phandle = <24520>;
-                       ethernet-phy@0 {
-                               linux,phandle = <2452000>;
-                               interrupt-parent = <40000>;
+                       phy0: ethernet-phy@0 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 0>;
                                reg = <0>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@1 {
-                               linux,phandle = <2452001>;
-                               interrupt-parent = <40000>;
+                       phy1: ethernet-phy@1 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 0>;
                                reg = <1>;
                                device_type = "ethernet-phy";
@@ -94,8 +87,8 @@
                        reg = <24000 1000>;
                        local-mac-address = [ 00 E0 0C 00 73 00 ];
                        interrupts = <d 2 e 2 12 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452000>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy0>;
                };
 
                ethernet@25000 {
                        reg = <25000 1000>;
                        local-mac-address = [ 00 E0 0C 00 73 01 ];
                        interrupts = <13 2 14 2 18 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452001>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy1>;
                };
 
                serial@4500 {
                        reg = <4500 100>;       // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
                        interrupts = <1a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
                serial@4600 {
                        reg = <4600 100>;       // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
                        interrupts = <1a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
-               pci@8000 {
-                       linux,phandle = <8000>;
+               pci1: pci@8000 {
                        interrupt-map-mask = <1f800 0 0 7>;
                        interrupt-map = <
 
                                /* IDSEL 0x10 */
-                               08000 0 0 1 40000 30 1
-                               08000 0 0 2 40000 31 1
-                               08000 0 0 3 40000 32 1
-                               08000 0 0 4 40000 33 1
+                               08000 0 0 1 &mpic 30 1
+                               08000 0 0 2 &mpic 31 1
+                               08000 0 0 3 &mpic 32 1
+                               08000 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x11 */
-                               08800 0 0 1 40000 30 1
-                               08800 0 0 2 40000 31 1
-                               08800 0 0 3 40000 32 1
-                               08800 0 0 4 40000 33 1
+                               08800 0 0 1 &mpic 30 1
+                               08800 0 0 2 &mpic 31 1
+                               08800 0 0 3 &mpic 32 1
+                               08800 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x12 (Slot 1) */
-                               09000 0 0 1 40000 30 1
-                               09000 0 0 2 40000 31 1
-                               09000 0 0 3 40000 32 1
-                               09000 0 0 4 40000 33 1
+                               09000 0 0 1 &mpic 30 1
+                               09000 0 0 2 &mpic 31 1
+                               09000 0 0 3 &mpic 32 1
+                               09000 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x13 (Slot 2) */
-                               09800 0 0 1 40000 31 1
-                               09800 0 0 2 40000 32 1
-                               09800 0 0 3 40000 33 1
-                               09800 0 0 4 40000 30 1
+                               09800 0 0 1 &mpic 31 1
+                               09800 0 0 2 &mpic 32 1
+                               09800 0 0 3 &mpic 33 1
+                               09800 0 0 4 &mpic 30 1
 
                                /* IDSEL 0x14 (Slot 3) */
-                               0a000 0 0 1 40000 32 1
-                               0a000 0 0 2 40000 33 1
-                               0a000 0 0 3 40000 30 1
-                               0a000 0 0 4 40000 31 1
+                               0a000 0 0 1 &mpic 32 1
+                               0a000 0 0 2 &mpic 33 1
+                               0a000 0 0 3 &mpic 30 1
+                               0a000 0 0 4 &mpic 31 1
 
                                /* IDSEL 0x15 (Slot 4) */
-                               0a800 0 0 1 40000 33 1
-                               0a800 0 0 2 40000 30 1
-                               0a800 0 0 3 40000 31 1
-                               0a800 0 0 4 40000 32 1
+                               0a800 0 0 1 &mpic 33 1
+                               0a800 0 0 2 &mpic 30 1
+                               0a800 0 0 3 &mpic 31 1
+                               0a800 0 0 4 &mpic 32 1
 
                                /* Bus 1 (Tundra Bridge) */
                                /* IDSEL 0x12 (ISA bridge) */
-                               19000 0 0 1 40000 30 1
-                               19000 0 0 2 40000 31 1
-                               19000 0 0 3 40000 32 1
-                               19000 0 0 4 40000 33 1>;
-                       interrupt-parent = <40000>;
+                               19000 0 0 1 &mpic 30 1
+                               19000 0 0 2 &mpic 31 1
+                               19000 0 0 3 &mpic 32 1
+                               19000 0 0 4 &mpic 33 1>;
+                       interrupt-parent = <&mpic>;
                        interrupts = <08 2>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 80000000 80000000 0 20000000
                                compatible = "chrp,iic";
                                big-endian;
                                interrupts = <1>;
-                               interrupt-parent = <8000>;
+                               interrupt-parent = <&pci1>;
                        };
                };
 
                pci@9000 {
-                       linux,phandle = <9000>;
                        interrupt-map-mask = <f800 0 0 7>;
                        interrupt-map = <
 
                                /* IDSEL 0x15 */
-                               a800 0 0 1 40000 3b 1
-                               a800 0 0 2 40000 3b 1
-                               a800 0 0 3 40000 3b 1
-                               a800 0 0 4 40000 3b 1>;
-                       interrupt-parent = <40000>;
+                               a800 0 0 1 &mpic 3b 1
+                               a800 0 0 2 &mpic 3b 1
+                               a800 0 0 3 &mpic 3b 1
+                               a800 0 0 4 &mpic 3b 1>;
+                       interrupt-parent = <&mpic>;
                        interrupts = <09 2>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 a0000000 a0000000 0 20000000
                        device_type = "pci";
                };
 
-               pic@40000 {
-                       linux,phandle = <40000>;
+               mpic: pic@40000 {
                        clock-frequency = <0>;
                        interrupt-controller;
                        #address-cells = <0>;
index 893d7957c174a1432754e937339663ee1445a02d..7eb5d81d5eec60cb80a8b149970ae60e6f38e362 100644 (file)
 
 / {
        model = "MPC8548CDS";
-       compatible = "MPC85xxCDS";
+       compatible = "MPC8548CDS", "MPC85xxCDS";
        #address-cells = <1>;
        #size-cells = <1>;
-       linux,phandle = <100>;
 
        cpus {
                #cpus = <1>;
                #address-cells = <1>;
                #size-cells = <0>;
-               linux,phandle = <200>;
 
                PowerPC,8548@0 {
                        device_type = "cpu";
                        bus-frequency = <0>;    // 166 MHz
                        clock-frequency = <0>;  // 825 MHz, from uboot
                        32-bit;
-                       linux,phandle = <201>;
                };
        };
 
        memory {
                device_type = "memory";
-               linux,phandle = <300>;
                reg = <00000000 08000000>;      // 128M at 0x0
        };
 
@@ -58,7 +54,7 @@
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <1b 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        dfsrr;
                };
 
                        device_type = "mdio";
                        compatible = "gianfar";
                        reg = <24520 20>;
-                       linux,phandle = <24520>;
-                       ethernet-phy@0 {
-                               linux,phandle = <2452000>;
-                               interrupt-parent = <40000>;
+                       phy0: ethernet-phy@0 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 0>;
                                reg = <0>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@1 {
-                               linux,phandle = <2452001>;
-                               interrupt-parent = <40000>;
+                       phy1: ethernet-phy@1 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 0>;
                                reg = <1>;
                                device_type = "ethernet-phy";
                        };
-
-                       ethernet-phy@2 {
-                               linux,phandle = <2452002>;
-                               interrupt-parent = <40000>;
+                       phy2: ethernet-phy@2 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 0>;
                                reg = <2>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@3 {
-                               linux,phandle = <2452003>;
-                               interrupt-parent = <40000>;
+                       phy3: ethernet-phy@3 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 0>;
                                reg = <3>;
                                device_type = "ethernet-phy";
                        reg = <24000 1000>;
                        local-mac-address = [ 00 E0 0C 00 73 00 ];
                        interrupts = <d 2 e 2 12 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452000>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy0>;
                };
 
                ethernet@25000 {
                        reg = <25000 1000>;
                        local-mac-address = [ 00 E0 0C 00 73 01 ];
                        interrupts = <13 2 14 2 18 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452001>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy1>;
                };
 
+/* eTSEC 3/4 are currently broken
                ethernet@26000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <26000 1000>;
                        local-mac-address = [ 00 E0 0C 00 73 02 ];
                        interrupts = <f 2 10 2 11 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452001>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy2>;
                };
 
-/* eTSEC 4 is currently broken
                ethernet@27000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <27000 1000>;
                        local-mac-address = [ 00 E0 0C 00 73 03 ];
                        interrupts = <15 2 16 2 17 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452001>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy3>;
                };
  */
 
                        reg = <4500 100>;       // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
                        interrupts = <1a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
                serial@4600 {
                        reg = <4600 100>;       // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
                        interrupts = <1a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
-               pci@8000 {
-                       linux,phandle = <8000>;
+               pci1: pci@8000 {
                        interrupt-map-mask = <1f800 0 0 7>;
                        interrupt-map = <
 
                                /* IDSEL 0x10 */
-                               08000 0 0 1 40000 30 1
-                               08000 0 0 2 40000 31 1
-                               08000 0 0 3 40000 32 1
-                               08000 0 0 4 40000 33 1
+                               08000 0 0 1 &mpic 30 1
+                               08000 0 0 2 &mpic 31 1
+                               08000 0 0 3 &mpic 32 1
+                               08000 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x11 */
-                               08800 0 0 1 40000 30 1
-                               08800 0 0 2 40000 31 1
-                               08800 0 0 3 40000 32 1
-                               08800 0 0 4 40000 33 1
+                               08800 0 0 1 &mpic 30 1
+                               08800 0 0 2 &mpic 31 1
+                               08800 0 0 3 &mpic 32 1
+                               08800 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x12 (Slot 1) */
-                               09000 0 0 1 40000 30 1
-                               09000 0 0 2 40000 31 1
-                               09000 0 0 3 40000 32 1
-                               09000 0 0 4 40000 33 1
+                               09000 0 0 1 &mpic 30 1
+                               09000 0 0 2 &mpic 31 1
+                               09000 0 0 3 &mpic 32 1
+                               09000 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x13 (Slot 2) */
-                               09800 0 0 1 40000 31 1
-                               09800 0 0 2 40000 32 1
-                               09800 0 0 3 40000 33 1
-                               09800 0 0 4 40000 30 1
+                               09800 0 0 1 &mpic 31 1
+                               09800 0 0 2 &mpic 32 1
+                               09800 0 0 3 &mpic 33 1
+                               09800 0 0 4 &mpic 30 1
 
                                /* IDSEL 0x14 (Slot 3) */
-                               0a000 0 0 1 40000 32 1
-                               0a000 0 0 2 40000 33 1
-                               0a000 0 0 3 40000 30 1
-                               0a000 0 0 4 40000 31 1
+                               0a000 0 0 1 &mpic 32 1
+                               0a000 0 0 2 &mpic 33 1
+                               0a000 0 0 3 &mpic 30 1
+                               0a000 0 0 4 &mpic 31 1
 
                                /* IDSEL 0x15 (Slot 4) */
-                               0a800 0 0 1 40000 33 1
-                               0a800 0 0 2 40000 30 1
-                               0a800 0 0 3 40000 31 1
-                               0a800 0 0 4 40000 32 1
+                               0a800 0 0 1 &mpic 33 1
+                               0a800 0 0 2 &mpic 30 1
+                               0a800 0 0 3 &mpic 31 1
+                               0a800 0 0 4 &mpic 32 1
 
                                /* Bus 1 (Tundra Bridge) */
                                /* IDSEL 0x12 (ISA bridge) */
-                               19000 0 0 1 40000 30 1
-                               19000 0 0 2 40000 31 1
-                               19000 0 0 3 40000 32 1
-                               19000 0 0 4 40000 33 1>;
-                       interrupt-parent = <40000>;
+                               19000 0 0 1 &mpic 30 1
+                               19000 0 0 2 &mpic 31 1
+                               19000 0 0 3 &mpic 32 1
+                               19000 0 0 4 &mpic 33 1>;
+                       interrupt-parent = <&mpic>;
                        interrupts = <08 2>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 80000000 80000000 0 20000000
                                compatible = "chrp,iic";
                                big-endian;
                                interrupts = <1>;
-                               interrupt-parent = <8000>;
+                               interrupt-parent = <&pci1>;
                        };
                };
 
                pci@9000 {
-                       linux,phandle = <9000>;
                        interrupt-map-mask = <f800 0 0 7>;
                        interrupt-map = <
 
                                /* IDSEL 0x15 */
-                               a800 0 0 1 40000 3b 1
-                               a800 0 0 2 40000 3b 1
-                               a800 0 0 3 40000 3b 1
-                               a800 0 0 4 40000 3b 1>;
-                       interrupt-parent = <40000>;
+                               a800 0 0 1 &mpic 3b 1
+                               a800 0 0 2 &mpic 3b 1
+                               a800 0 0 3 &mpic 3b 1
+                               a800 0 0 4 &mpic 3b 1>;
+                       interrupt-parent = <&mpic>;
                        interrupts = <09 2>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 a0000000 a0000000 0 20000000
                        device_type = "pci";
                };
 
-               pic@40000 {
-                       linux,phandle = <40000>;
+               mpic: pic@40000 {
                        clock-frequency = <0>;
                        interrupt-controller;
                        #address-cells = <0>;
index 118f5a887651a460ebc4fd51e080cd7095e42959..5f9c102a0ab422ada16bd03bafc1944082a6d22d 100644 (file)
 
 / {
        model = "MPC8555CDS";
-       compatible = "MPC85xxCDS";
+       compatible = "MPC8555CDS", "MPC85xxCDS";
        #address-cells = <1>;
        #size-cells = <1>;
-       linux,phandle = <100>;
 
        cpus {
                #cpus = <1>;
                #address-cells = <1>;
                #size-cells = <0>;
-               linux,phandle = <200>;
 
                PowerPC,8555@0 {
                        device_type = "cpu";
                        bus-frequency = <0>;    // 166 MHz
                        clock-frequency = <0>;  // 825 MHz, from uboot
                        32-bit;
-                       linux,phandle = <201>;
                };
        };
 
        memory {
                device_type = "memory";
-               linux,phandle = <300>;
                reg = <00000000 08000000>;      // 128M at 0x0
        };
 
@@ -58,7 +54,7 @@
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <1b 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        dfsrr;
                };
 
                        device_type = "mdio";
                        compatible = "gianfar";
                        reg = <24520 20>;
-                       linux,phandle = <24520>;
-                       ethernet-phy@0 {
-                               linux,phandle = <2452000>;
-                               interrupt-parent = <40000>;
+                       phy0: ethernet-phy@0 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 0>;
                                reg = <0>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@1 {
-                               linux,phandle = <2452001>;
-                               interrupt-parent = <40000>;
+                       phy1: ethernet-phy@1 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 0>;
                                reg = <1>;
                                device_type = "ethernet-phy";
@@ -94,8 +87,8 @@
                        reg = <24000 1000>;
                        local-mac-address = [ 00 E0 0C 00 73 00 ];
                        interrupts = <0d 2 0e 2 12 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452000>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy0>;
                };
 
                ethernet@25000 {
                        reg = <25000 1000>;
                        local-mac-address = [ 00 E0 0C 00 73 01 ];
                        interrupts = <13 2 14 2 18 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452001>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy1>;
                };
 
                serial@4500 {
                        reg = <4500 100>;       // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
                        interrupts = <1a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
                serial@4600 {
                        reg = <4600 100>;       // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
                        interrupts = <1a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
-               pci@8000 {
-                       linux,phandle = <8000>;
+               pci1: pci@8000 {
                        interrupt-map-mask = <1f800 0 0 7>;
                        interrupt-map = <
 
                                /* IDSEL 0x10 */
-                               08000 0 0 1 40000 30 1
-                               08000 0 0 2 40000 31 1
-                               08000 0 0 3 40000 32 1
-                               08000 0 0 4 40000 33 1
+                               08000 0 0 1 &mpic 30 1
+                               08000 0 0 2 &mpic 31 1
+                               08000 0 0 3 &mpic 32 1
+                               08000 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x11 */
-                               08800 0 0 1 40000 30 1
-                               08800 0 0 2 40000 31 1
-                               08800 0 0 3 40000 32 1
-                               08800 0 0 4 40000 33 1
+                               08800 0 0 1 &mpic 30 1
+                               08800 0 0 2 &mpic 31 1
+                               08800 0 0 3 &mpic 32 1
+                               08800 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x12 (Slot 1) */
-                               09000 0 0 1 40000 30 1
-                               09000 0 0 2 40000 31 1
-                               09000 0 0 3 40000 32 1
-                               09000 0 0 4 40000 33 1
+                               09000 0 0 1 &mpic 30 1
+                               09000 0 0 2 &mpic 31 1
+                               09000 0 0 3 &mpic 32 1
+                               09000 0 0 4 &mpic 33 1
 
                                /* IDSEL 0x13 (Slot 2) */
-                               09800 0 0 1 40000 31 1
-                               09800 0 0 2 40000 32 1
-                               09800 0 0 3 40000 33 1
-                               09800 0 0 4 40000 30 1
+                               09800 0 0 1 &mpic 31 1
+                               09800 0 0 2 &mpic 32 1
+                               09800 0 0 3 &mpic 33 1
+                               09800 0 0 4 &mpic 30 1
 
                                /* IDSEL 0x14 (Slot 3) */
-                               0a000 0 0 1 40000 32 1
-                               0a000 0 0 2 40000 33 1
-                               0a000 0 0 3 40000 30 1
-                               0a000 0 0 4 40000 31 1
+                               0a000 0 0 1 &mpic 32 1
+                               0a000 0 0 2 &mpic 33 1
+                               0a000 0 0 3 &mpic 30 1
+                               0a000 0 0 4 &mpic 31 1
 
                                /* IDSEL 0x15 (Slot 4) */
-                               0a800 0 0 1 40000 33 1
-                               0a800 0 0 2 40000 30 1
-                               0a800 0 0 3 40000 31 1
-                               0a800 0 0 4 40000 32 1
+                               0a800 0 0 1 &mpic 33 1
+                               0a800 0 0 2 &mpic 30 1
+                               0a800 0 0 3 &mpic 31 1
+                               0a800 0 0 4 &mpic 32 1
 
                                /* Bus 1 (Tundra Bridge) */
                                /* IDSEL 0x12 (ISA bridge) */
-                               19000 0 0 1 40000 30 1
-                               19000 0 0 2 40000 31 1
-                               19000 0 0 3 40000 32 1
-                               19000 0 0 4 40000 33 1>;
-                       interrupt-parent = <40000>;
+                               19000 0 0 1 &mpic 30 1
+                               19000 0 0 2 &mpic 31 1
+                               19000 0 0 3 &mpic 32 1
+                               19000 0 0 4 &mpic 33 1>;
+                       interrupt-parent = <&mpic>;
                        interrupts = <08 2>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 80000000 80000000 0 20000000
                                compatible = "chrp,iic";
                                big-endian;
                                interrupts = <1>;
-                               interrupt-parent = <8000>;
+                               interrupt-parent = <&pci1>;
                        };
                };
 
                pci@9000 {
-                       linux,phandle = <9000>;
                        interrupt-map-mask = <f800 0 0 7>;
                        interrupt-map = <
 
                                /* IDSEL 0x15 */
-                               a800 0 0 1 40000 3b 1
-                               a800 0 0 2 40000 3b 1
-                               a800 0 0 3 40000 3b 1
-                               a800 0 0 4 40000 3b 1>;
-                       interrupt-parent = <40000>;
+                               a800 0 0 1 &mpic 3b 1
+                               a800 0 0 2 &mpic 3b 1
+                               a800 0 0 3 &mpic 3b 1
+                               a800 0 0 4 &mpic 3b 1>;
+                       interrupt-parent = <&mpic>;
                        interrupts = <09 2>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 a0000000 a0000000 0 20000000
                        device_type = "pci";
                };
 
-               pic@40000 {
-                       linux,phandle = <40000>;
+               mpic: pic@40000 {
                        clock-frequency = <0>;
                        interrupt-controller;
                        #address-cells = <0>;
index 119bd5d3a834476d91be6f2e90d3fa8f2e7b68fb..10502638b0e977f06f472c6c76d3fe1524ad6dd9 100644 (file)
 
 / {
        model = "MPC8560ADS";
-       compatible = "MPC85xxADS";
+       compatible = "MPC8560ADS", "MPC85xxADS";
        #address-cells = <1>;
        #size-cells = <1>;
-       linux,phandle = <100>;
 
        cpus {
                #cpus = <1>;
                #address-cells = <1>;
                #size-cells = <0>;
-               linux,phandle = <200>;
 
                PowerPC,8560@0 {
                        device_type = "cpu";
                        bus-frequency = <13ab6680>;
                        clock-frequency = <312c8040>;
                        32-bit;
-                       linux,phandle = <201>;
-                       linux,boot-cpu;
                };
        };
 
        memory {
                device_type = "memory";
-               linux,phandle = <300>;
                reg = <00000000 10000000>;
        };
 
                        device_type = "mdio";
                        compatible = "gianfar";
                        reg = <24520 20>;
-                       linux,phandle = <24520>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       ethernet-phy@0 {
-                               linux,phandle = <2452000>;
-                               interrupt-parent = <40000>;
+                       phy0: ethernet-phy@0 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 1>;
                                reg = <0>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@1 {
-                               linux,phandle = <2452001>;
-                               interrupt-parent = <40000>;
+                       phy1: ethernet-phy@1 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <35 1>;
                                reg = <1>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@2 {
-                               linux,phandle = <2452002>;
-                               interrupt-parent = <40000>;
+                       phy2: ethernet-phy@2 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <37 1>;
                                reg = <2>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@3 {
-                               linux,phandle = <2452003>;
-                               interrupt-parent = <40000>;
+                       phy3: ethernet-phy@3 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <37 1>;
                                reg = <3>;
                                device_type = "ethernet-phy";
@@ -98,8 +88,8 @@
                        reg = <24000 1000>;
                        address = [ 00 00 0C 00 00 FD ];
                        interrupts = <d 2 e 2 12 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452000>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy0>;
                };
 
                ethernet@25000 {
                        reg = <25000 1000>;
                        address = [ 00 00 0C 00 01 FD ];
                        interrupts = <13 2 14 2 18 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452001>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy1>;
                };
 
                pci@8000 {
-                       linux,phandle = <8000>;
                        #interrupt-cells = <1>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        interrupt-map = <
 
                                        /* IDSEL 0x2 */
-                                        1000 0 0 1 40000 31 1
-                                        1000 0 0 2 40000 32 1
-                                        1000 0 0 3 40000 33 1
-                                        1000 0 0 4 40000 34 1
+                                        1000 0 0 1 &mpic 31 1
+                                        1000 0 0 2 &mpic 32 1
+                                        1000 0 0 3 &mpic 33 1
+                                        1000 0 0 4 &mpic 34 1
 
                                        /* IDSEL 0x3 */
-                                        1800 0 0 1 40000 34 1
-                                        1800 0 0 2 40000 31 1
-                                        1800 0 0 3 40000 32 1
-                                        1800 0 0 4 40000 33 1
+                                        1800 0 0 1 &mpic 34 1
+                                        1800 0 0 2 &mpic 31 1
+                                        1800 0 0 3 &mpic 32 1
+                                        1800 0 0 4 &mpic 33 1
 
                                        /* IDSEL 0x4 */
-                                        2000 0 0 1 40000 33 1
-                                        2000 0 0 2 40000 34 1
-                                        2000 0 0 3 40000 31 1
-                                        2000 0 0 4 40000 32 1
+                                        2000 0 0 1 &mpic 33 1
+                                        2000 0 0 2 &mpic 34 1
+                                        2000 0 0 3 &mpic 31 1
+                                        2000 0 0 4 &mpic 32 1
 
                                        /* IDSEL 0x5  */
-                                        2800 0 0 1 40000 32 1
-                                        2800 0 0 2 40000 33 1
-                                        2800 0 0 3 40000 34 1
-                                        2800 0 0 4 40000 31 1
+                                        2800 0 0 1 &mpic 32 1
+                                        2800 0 0 2 &mpic 33 1
+                                        2800 0 0 3 &mpic 34 1
+                                        2800 0 0 4 &mpic 31 1
 
                                        /* IDSEL 12 */
-                                        6000 0 0 1 40000 31 1
-                                        6000 0 0 2 40000 32 1
-                                        6000 0 0 3 40000 33 1
-                                        6000 0 0 4 40000 34 1
+                                        6000 0 0 1 &mpic 31 1
+                                        6000 0 0 2 &mpic 32 1
+                                        6000 0 0 3 &mpic 33 1
+                                        6000 0 0 4 &mpic 34 1
 
                                        /* IDSEL 13 */
-                                        6800 0 0 1 40000 34 1
-                                        6800 0 0 2 40000 31 1
-                                        6800 0 0 3 40000 32 1
-                                        6800 0 0 4 40000 33 1
+                                        6800 0 0 1 &mpic 34 1
+                                        6800 0 0 2 &mpic 31 1
+                                        6800 0 0 3 &mpic 32 1
+                                        6800 0 0 4 &mpic 33 1
 
                                        /* IDSEL 14*/
-                                        7000 0 0 1 40000 33 1
-                                        7000 0 0 2 40000 34 1
-                                        7000 0 0 3 40000 31 1
-                                        7000 0 0 4 40000 32 1
+                                        7000 0 0 1 &mpic 33 1
+                                        7000 0 0 2 &mpic 34 1
+                                        7000 0 0 3 &mpic 31 1
+                                        7000 0 0 4 &mpic 32 1
 
                                        /* IDSEL 15 */
-                                        7800 0 0 1 40000 32 1
-                                        7800 0 0 2 40000 33 1
-                                        7800 0 0 3 40000 34 1
-                                        7800 0 0 4 40000 31 1
+                                        7800 0 0 1 &mpic 32 1
+                                        7800 0 0 2 &mpic 33 1
+                                        7800 0 0 3 &mpic 34 1
+                                        7800 0 0 4 &mpic 31 1
 
                                        /* IDSEL 18 */
-                                        9000 0 0 1 40000 31 1
-                                        9000 0 0 2 40000 32 1
-                                        9000 0 0 3 40000 33 1
-                                        9000 0 0 4 40000 34 1
+                                        9000 0 0 1 &mpic 31 1
+                                        9000 0 0 2 &mpic 32 1
+                                        9000 0 0 3 &mpic 33 1
+                                        9000 0 0 4 &mpic 34 1
 
                                        /* IDSEL 19 */
-                                        9800 0 0 1 40000 34 1
-                                        9800 0 0 2 40000 31 1
-                                        9800 0 0 3 40000 32 1
-                                        9800 0 0 4 40000 33 1
+                                        9800 0 0 1 &mpic 34 1
+                                        9800 0 0 2 &mpic 31 1
+                                        9800 0 0 3 &mpic 32 1
+                                        9800 0 0 4 &mpic 33 1
 
                                        /* IDSEL 20 */
-                                        a000 0 0 1 40000 33 1
-                                        a000 0 0 2 40000 34 1
-                                        a000 0 0 3 40000 31 1
-                                        a000 0 0 4 40000 32 1
+                                        a000 0 0 1 &mpic 33 1
+                                        a000 0 0 2 &mpic 34 1
+                                        a000 0 0 3 &mpic 31 1
+                                        a000 0 0 4 &mpic 32 1
 
                                        /* IDSEL 21 */
-                                        a800 0 0 1 40000 32 1
-                                        a800 0 0 2 40000 33 1
-                                        a800 0 0 3 40000 34 1
-                                        a800 0 0 4 40000 31 1>;
+                                        a800 0 0 1 &mpic 32 1
+                                        a800 0 0 2 &mpic 33 1
+                                        a800 0 0 3 &mpic 34 1
+                                        a800 0 0 4 &mpic 31 1>;
 
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        interrupts = <8 0>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 80000000 80000000 0 20000000
                                  01000000 0 00000000 e2000000 0 01000000>;
                };
 
-               pic@40000 {
-                       linux,phandle = <40000>;
+               mpic: pic@40000 {
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
-                       reg = <40000 20100>;
+                       reg = <40000 40000>;
                        built-in;
                        device_type = "open-pic";
                };
 
                cpm@e0000000 {
-                       linux,phandle = <e0000000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        #interrupt-cells = <2>;
                        command-proc = <919c0>;
                        brg-frequency = <9d5b340>;
 
-                       pic@90c00 {
-                               linux,phandle = <90c00>;
+                       cpmpic: pic@90c00 {
                                interrupt-controller;
                                #address-cells = <0>;
                                #interrupt-cells = <2>;
                                interrupts = <1e 0>;
-                               interrupt-parent = <40000>;
+                               interrupt-parent = <&mpic>;
                                reg = <90c00 80>;
                                built-in;
                                device_type = "cpm-pic";
                                tx-clock = <1>;
                                current-speed = <1c200>;
                                interrupts = <28 8>;
-                               interrupt-parent = <90c00>;
+                               interrupt-parent = <&cpmpic>;
                        };
 
                        scc@91a20 {
                                tx-clock = <2>;
                                current-speed = <1c200>;
                                interrupts = <29 8>;
-                               interrupt-parent = <90c00>;
+                               interrupt-parent = <&cpmpic>;
                        };
 
                        fcc@91320 {
                                rx-clock = <15>;
                                tx-clock = <16>;
                                interrupts = <21 8>;
-                               interrupt-parent = <90c00>;
-                               phy-handle = <2452002>;
+                               interrupt-parent = <&cpmpic>;
+                               phy-handle = <&phy2>;
                        };
 
                        fcc@91340 {
                                rx-clock = <17>;
                                tx-clock = <18>;
                                interrupts = <22 8>;
-                               interrupt-parent = <90c00>;
-                               phy-handle = <2452003>;
+                               interrupt-parent = <&cpmpic>;
+                               phy-handle = <&phy3>;
                        };
                };
        };
index 06d24653e422979cdbb8d871c06ae3444fa02b69..bf49d8c997b9c7be09d382e54508eaabb96cb3c5 100644 (file)
 
 / {
        model = "MPC8568EMDS";
-       compatible = "MPC85xxMDS";
+       compatible = "MPC8568EMDS", "MPC85xxMDS";
        #address-cells = <1>;
        #size-cells = <1>;
-       linux,phandle = <100>;
 
        cpus {
                #cpus = <1>;
                #address-cells = <1>;
                #size-cells = <0>;
-               linux,phandle = <200>;
 
                PowerPC,8568@0 {
                        device_type = "cpu";
                        bus-frequency = <0>;
                        clock-frequency = <0>;
                        32-bit;
-                       linux,phandle = <201>;
                };
        };
 
        memory {
                device_type = "memory";
-               linux,phandle = <300>;
                reg = <00000000 10000000>;
        };
 
@@ -67,7 +63,7 @@
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <1b 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        dfsrr;
                };
 
@@ -76,7 +72,7 @@
                        compatible = "fsl-i2c";
                        reg = <3100 100>;
                        interrupts = <1b 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        dfsrr;
                };
 
                        device_type = "mdio";
                        compatible = "gianfar";
                        reg = <24520 20>;
-                       linux,phandle = <24520>;
-                       ethernet-phy@0 {
-                               linux,phandle = <2452000>;
-                               interrupt-parent = <40000>;
+                       phy0: ethernet-phy@0 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <31 1>;
                                reg = <0>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@1 {
-                               linux,phandle = <2452001>;
-                               interrupt-parent = <40000>;
+                       phy1: ethernet-phy@1 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <32 1>;
                                reg = <1>;
                                device_type = "ethernet-phy";
                        };
-
-                       ethernet-phy@2 {
-                               linux,phandle = <2452002>;
-                               interrupt-parent = <40000>;
+                       phy2: ethernet-phy@2 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <31 1>;
                                reg = <2>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@3 {
-                               linux,phandle = <2452003>;
-                               interrupt-parent = <40000>;
+                       phy3: ethernet-phy@3 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <32 1>;
                                reg = <3>;
                                device_type = "ethernet-phy";
                        reg = <24000 1000>;
                        mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <d 2 e 2 12 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452002>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy2>;
                };
 
                ethernet@25000 {
                        reg = <25000 1000>;
                        mac-address = [ 00 00 00 00 00 00];
                        interrupts = <13 2 14 2 18 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452003>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy3>;
                };
 
                serial@4500 {
                        reg = <4500 100>;
                        clock-frequency = <0>;
                        interrupts = <1a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
                serial@4600 {
                        reg = <4600 100>;
                        clock-frequency = <0>;
                        interrupts = <1a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
                crypto@30000 {
                        compatible = "talitos";
                        reg = <30000 f000>;
                        interrupts = <1d 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        num-channels = <4>;
                        channel-fifo-len = <18>;
                        exec-units-mask = <000000fe>;
                        descriptor-types-mask = <012b0ebf>;
                };
 
-               pic@40000 {
-                       linux,phandle = <40000>;
+               mpic: pic@40000 {
                        clock-frequency = <0>;
                        interrupt-controller;
                        #address-cells = <0>;
                        device_type = "par_io";
                        num-ports = <7>;
 
-                       ucc_pin@01 {
-                               linux,phandle = <e010001>;
+                       pio1: ucc_pin@01 {
                                pio-map = <
                        /* port  pin  dir  open_drain  assignment  has_irq */
                                        4  0a  1  0  2  0       /* TxD0 */
                                        4  13  1  0  2  0       /* GTX_CLK */
                                        1  1f  2  0  3  0>;     /* GTX125 */
                        };
-                       ucc_pin@02 {
-                               linux,phandle = <e010002>;
+                       pio2: ucc_pin@02 {
                                pio-map = <
                        /* port  pin  dir  open_drain  assignment  has_irq */
                                        5  0a 1  0  2  0   /* TxD0 */
                        compatible = "fsl_spi";
                        reg = <4c0 40>;
                        interrupts = <2>;
-                       interrupt-parent = <80>;
+                       interrupt-parent = <&qeic>;
                        mode = "cpu";
                };
 
                        compatible = "fsl_spi";
                        reg = <500 40>;
                        interrupts = <1>;
-                       interrupt-parent = <80>;
+                       interrupt-parent = <&qeic>;
                        mode = "cpu";
                };
 
                        device-id = <1>;
                        reg = <2000 200>;
                        interrupts = <20>;
-                       interrupt-parent = <80>;
+                       interrupt-parent = <&qeic>;
                        mac-address = [ 00 04 9f 00 23 23 ];
                        rx-clock = <0>;
                        tx-clock = <19>;
-                       phy-handle = <212000>;
-                       pio-handle = <e010001>;
+                       phy-handle = <&qe_phy0>;
+                       pio-handle = <&pio1>;
                };
 
                ucc@3000 {
                        device-id = <2>;
                        reg = <3000 200>;
                        interrupts = <21>;
-                       interrupt-parent = <80>;
+                       interrupt-parent = <&qeic>;
                        mac-address = [ 00 11 22 33 44 55 ];
                        rx-clock = <0>;
                        tx-clock = <14>;
-                       phy-handle = <212001>;
-                       pio-handle = <e010002>;
+                       phy-handle = <&qe_phy1>;
+                       pio-handle = <&pio2>;
                };
 
                mdio@2120 {
 
                        /* These are the same PHYs as on
                         * gianfar's MDIO bus */
-                       ethernet-phy@00 {
-                               linux,phandle = <212000>;
-                               interrupt-parent = <40000>;
+                       qe_phy0: ethernet-phy@00 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <31 1>;
                                reg = <0>;
                                device_type = "ethernet-phy";
                                interface = <6>; //ENET_1000_GMII
                        };
-                       ethernet-phy@01 {
-                               linux,phandle = <212001>;
-                               interrupt-parent = <40000>;
+                       qe_phy1: ethernet-phy@01 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <32 1>;
                                reg = <1>;
                                device_type = "ethernet-phy";
                                interface = <6>;
                        };
-                       ethernet-phy@02 {
-                               linux,phandle = <212002>;
-                               interrupt-parent = <40000>;
+                       qe_phy2: ethernet-phy@02 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <31 1>;
                                reg = <2>;
                                device_type = "ethernet-phy";
                                interface = <6>; //ENET_1000_GMII
                        };
-                       ethernet-phy@03 {
-                               linux,phandle = <212003>;
-                               interrupt-parent = <40000>;
+                       qe_phy3: ethernet-phy@03 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <32 1>;
                                reg = <3>;
                                device_type = "ethernet-phy";
                        };
                };
 
-               qeic@80 {
-                       linux,phandle = <80>;
+               qeic: qeic@80 {
                        interrupt-controller;
                        device_type = "qeic";
                        #address-cells = <0>;
                        built-in;
                        big-endian;
                        interrupts = <1e 2 1e 2>; //high:30 low:30
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
        };
index f0c7731743ea0dd1a827084f32ed36a5ab9b823b..8a4995a85ba035f28865aacf96a4cca758d89259 100644 (file)
@@ -32,7 +32,6 @@
                        bus-frequency = <0>;            // From uboot
                        clock-frequency = <0>;          // From uboot
                        32-bit;
-                       linux,boot-cpu;
                };
                PowerPC,8641@1 {
                        device_type = "cpu";
@@ -67,7 +66,7 @@
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <2b 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        dfsrr;
                };
 
@@ -76,7 +75,7 @@
                        compatible = "fsl-i2c";
                        reg = <3100 100>;
                        interrupts = <2b 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        dfsrr;
                };
 
                        device_type = "mdio";
                        compatible = "gianfar";
                        reg = <24520 20>;
-                       linux,phandle = <24520>;
-                       ethernet-phy@0 {
-                               linux,phandle = <2452000>;
-                               interrupt-parent = <40000>;
+                       phy0: ethernet-phy@0 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <4a 1>;
                                reg = <0>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@1 {
-                               linux,phandle = <2452001>;
-                               interrupt-parent = <40000>;
+                       phy1: ethernet-phy@1 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <4a 1>;
                                reg = <1>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@2 {
-                               linux,phandle = <2452002>;
-                               interrupt-parent = <40000>;
+                       phy2: ethernet-phy@2 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <4a 1>;
                                reg = <2>;
                                device_type = "ethernet-phy";
                        };
-                       ethernet-phy@3 {
-                               linux,phandle = <2452003>;
-                               interrupt-parent = <40000>;
+                       phy3: ethernet-phy@3 {
+                               interrupt-parent = <&mpic>;
                                interrupts = <4a 1>;
                                reg = <3>;
                                device_type = "ethernet-phy";
                        reg = <24000 1000>;
                        mac-address = [ 00 E0 0C 00 73 00 ];
                        interrupts = <1d 2 1e 2 22 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452000>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy0>;
                };
 
                ethernet@25000 {
                        reg = <25000 1000>;
                        mac-address = [ 00 E0 0C 00 73 01 ];
                        interrupts = <23 2 24 2 28 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452001>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy1>;
                };
                
                ethernet@26000 {
                        reg = <26000 1000>;
                        mac-address = [ 00 E0 0C 00 02 FD ];
                        interrupts = <1F 2 20 2 21 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452002>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy2>;
                };
 
                ethernet@27000 {
                        reg = <27000 1000>;
                        mac-address = [ 00 E0 0C 00 03 FD ];
                        interrupts = <25 2 26 2 27 2>;
-                       interrupt-parent = <40000>;
-                       phy-handle = <2452003>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy3>;
                };
                serial@4500 {
                        device_type = "serial";
                        reg = <4500 100>;
                        clock-frequency = <0>;
                        interrupts = <2a 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
                serial@4600 {
                        reg = <4600 100>;
                        clock-frequency = <0>;
                        interrupts = <1c 2>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                };
 
                pci@8000 {
                        ranges = <02000000 0 80000000 80000000 0 20000000
                                  01000000 0 00000000 e2000000 0 00100000>;
                        clock-frequency = <1fca055>;
-                       interrupt-parent = <40000>;
+                       interrupt-parent = <&mpic>;
                        interrupts = <18 2>;
                        interrupt-map-mask = <f800 0 0 7>;
                        interrupt-map = <
                                /* IDSEL 0x11 */
-                               8800 0 0 1 4d0 3 2
-                               8800 0 0 2 4d0 4 2
-                               8800 0 0 3 4d0 5 2
-                               8800 0 0 4 4d0 6 2
+                               8800 0 0 1 &i8259 3 2
+                               8800 0 0 2 &i8259 4 2
+                               8800 0 0 3 &i8259 5 2
+                               8800 0 0 4 &i8259 6 2
 
                                /* IDSEL 0x12 */
-                               9000 0 0 1 4d0 4 2
-                               9000 0 0 2 4d0 5 2
-                               9000 0 0 3 4d0 6 2
-                               9000 0 0 4 4d0 3 2
+                               9000 0 0 1 &i8259 4 2
+                               9000 0 0 2 &i8259 5 2
+                               9000 0 0 3 &i8259 6 2
+                               9000 0 0 4 &i8259 3 2
 
                                /* IDSEL 0x13 */
-                               9800 0 0 1 4d0 0 0
-                               9800 0 0 2 4d0 0 0
-                               9800 0 0 3 4d0 0 0
-                               9800 0 0 4 4d0 0 0
+                               9800 0 0 1 &i8259 0 0
+                               9800 0 0 2 &i8259 0 0
+                               9800 0 0 3 &i8259 0 0
+                               9800 0 0 4 &i8259 0 0
 
                                /* IDSEL 0x14 */
-                               a000 0 0 1 4d0 0 0
-                               a000 0 0 2 4d0 0 0
-                               a000 0 0 3 4d0 0 0
-                               a000 0 0 4 4d0 0 0
+                               a000 0 0 1 &i8259 0 0
+                               a000 0 0 2 &i8259 0 0
+                               a000 0 0 3 &i8259 0 0
+                               a000 0 0 4 &i8259 0 0
 
                                /* IDSEL 0x15 */
-                               a800 0 0 1 4d0 0 0
-                               a800 0 0 2 4d0 0 0
-                               a800 0 0 3 4d0 0 0
-                               a800 0 0 4 4d0 0 0
+                               a800 0 0 1 &i8259 0 0
+                               a800 0 0 2 &i8259 0 0
+                               a800 0 0 3 &i8259 0 0
+                               a800 0 0 4 &i8259 0 0
 
                                /* IDSEL 0x16 */
-                               b000 0 0 1 4d0 0 0
-                               b000 0 0 2 4d0 0 0
-                               b000 0 0 3 4d0 0 0
-                               b000 0 0 4 4d0 0 0
+                               b000 0 0 1 &i8259 0 0
+                               b000 0 0 2 &i8259 0 0
+                               b000 0 0 3 &i8259 0 0
+                               b000 0 0 4 &i8259 0 0
 
                                /* IDSEL 0x17 */
-                               b800 0 0 1 4d0 0 0
-                               b800 0 0 2 4d0 0 0
-                               b800 0 0 3 4d0 0 0
-                               b800 0 0 4 4d0 0 0
+                               b800 0 0 1 &i8259 0 0
+                               b800 0 0 2 &i8259 0 0
+                               b800 0 0 3 &i8259 0 0
+                               b800 0 0 4 &i8259 0 0
 
                                /* IDSEL 0x18 */
-                               c000 0 0 1 4d0 0 0
-                               c000 0 0 2 4d0 0 0
-                               c000 0 0 3 4d0 0 0
-                               c000 0 0 4 4d0 0 0
+                               c000 0 0 1 &i8259 0 0
+                               c000 0 0 2 &i8259 0 0
+                               c000 0 0 3 &i8259 0 0
+                               c000 0 0 4 &i8259 0 0
 
                                /* IDSEL 0x19 */
-                               c800 0 0 1 4d0 0 0
-                               c800 0 0 2 4d0 0 0
-                               c800 0 0 3 4d0 0 0
-                               c800 0 0 4 4d0 0 0
+                               c800 0 0 1 &i8259 0 0
+                               c800 0 0 2 &i8259 0 0
+                               c800 0 0 3 &i8259 0 0
+                               c800 0 0 4 &i8259 0 0
 
                                /* IDSEL 0x1a */
-                               d000 0 0 1 4d0 6 2
-                               d000 0 0 2 4d0 3 2
-                               d000 0 0 3 4d0 4 2
-                               d000 0 0 4 4d0 5 2
+                               d000 0 0 1 &i8259 6 2
+                               d000 0 0 2 &i8259 3 2
+                               d000 0 0 3 &i8259 4 2
+                               d000 0 0 4 &i8259 5 2
 
 
                                /* IDSEL 0x1b */
-                               d800 0 0 1 4d0 5 2
-                               d800 0 0 2 4d0 0 0
-                               d800 0 0 3 4d0 0 0
-                               d800 0 0 4 4d0 0 0
+                               d800 0 0 1 &i8259 5 2
+                               d800 0 0 2 &i8259 0 0
+                               d800 0 0 3 &i8259 0 0
+                               d800 0 0 4 &i8259 0 0
 
                                /* IDSEL 0x1c */
-                               e000 0 0 1 4d0 9 2
-                               e000 0 0 2 4d0 a 2
-                               e000 0 0 3 4d0 c 2
-                               e000 0 0 4 4d0 7 2
+                               e000 0 0 1 &i8259 9 2
+                               e000 0 0 2 &i8259 a 2
+                               e000 0 0 3 &i8259 c 2
+                               e000 0 0 4 &i8259 7 2
 
                                /* IDSEL 0x1d */
-                               e800 0 0 1 4d0 9 2
-                               e800 0 0 2 4d0 a 2
-                               e800 0 0 3 4d0 b 2
-                               e800 0 0 4 4d0 0 0
+                               e800 0 0 1 &i8259 9 2
+                               e800 0 0 2 &i8259 a 2
+                               e800 0 0 3 &i8259 b 2
+                               e800 0 0 4 &i8259 0 0
 
                                /* IDSEL 0x1e */
-                               f000 0 0 1 4d0 c 2
-                               f000 0 0 2 4d0 0 0
-                               f000 0 0 3 4d0 0 0
-                               f000 0 0 4 4d0 0 0
+                               f000 0 0 1 &i8259 c 2
+                               f000 0 0 2 &i8259 0 0
+                               f000 0 0 3 &i8259 0 0
+                               f000 0 0 4 &i8259 0 0
 
                                /* IDSEL 0x1f */
-                               f800 0 0 1 4d0 6 2
-                               f800 0 0 2 4d0 0 0
-                               f800 0 0 3 4d0 0 0
-                               f800 0 0 4 4d0 0 0
+                               f800 0 0 1 &i8259 6 2
+                               f800 0 0 2 &i8259 0 0
+                               f800 0 0 3 &i8259 0 0
+                               f800 0 0 4 &i8259 0 0
                                >;
-                       i8259@4d0 {
-                               linux,phandle = <4d0>;
+                       i8259: i8259@4d0 {
                                clock-frequency = <0>;
                                interrupt-controller;
                                device_type = "interrupt-controller";
                                compatible = "chrp,iic";
                                big-endian;
                                interrupts = <49 2>;
-                               interrupt-parent = <40000>;
+                               interrupt-parent = <&mpic>;
                        };
 
                };
-               pic@40000 {
-                       linux,phandle = <40000>;
+               mpic: pic@40000 {
                        clock-frequency = <0>;
                        interrupt-controller;
                        #address-cells = <0>;
                        built-in;
                        compatible = "chrp,open-pic";
                        device_type = "open-pic";
-                        big-endian;
-                       interrupts = <
-                               10 2 11 2 12 2 13 2
-                               14 2 15 2 16 2 17 2
-                               18 2 19 2 1a 2 1b 2
-                               1c 2 1d 2 1e 2 1f 2
-                               20 2 21 2 22 2 23 2
-                               24 2 25 2 26 2 27 2
-                               28 2 29 2 2a 2 2b 2
-                               2c 2 2d 2 2e 2 2f 2
-                               30 2 31 2 32 2 33 2
-                               34 2 35 2 36 2 37 2
-                               38 2 39 2 2a 2 3b 2
-                               3c 2 3d 2 3e 2 3f 2
-                               48 1 49 2 4a 1
-                               >;
-                       interrupt-parent = <40000>;
+                       big-endian;
                };
        };
 };
index 5d4005239b83e1f1c8e5bf0d05ad8b804a35a5b4..2b56b5df451a31ab9b2c7e6d5d6124b916e3c569 100644 (file)
@@ -37,7 +37,6 @@
                        interrupts = <f 2>;     // decrementer interrupt
                        interrupt-parent = <ff000000>;
                        linux,phandle = <201>;
-                       linux,boot-cpu;
                };
        };
 
index cf1a19f962c5e416d0e08c3f82f098eeeecff996..faecd08c54dae3afddb6bf2aea8dfc5a24f5000a 100644 (file)
@@ -37,7 +37,6 @@
                        interrupts = <f 2>;     // decrementer interrupt
                        interrupt-parent = <ff000000>;
                        linux,phandle = <201>;
-                       linux,boot-cpu;
                };
        };
 
index e956548da00ce6276c5343d7200e1fae39676bd4..24367319ce24ac873bb279fb83d00e614f37fbb7 100644 (file)
@@ -147,6 +147,7 @@ CONFIG_PPC_RTAS=y
 # CONFIG_RTAS_ERROR_LOGGING is not set
 CONFIG_RTAS_PROC=y
 CONFIG_RTAS_FLASH=y
+CONFIG_PPC_PMI=m
 CONFIG_MMIO_NVRAM=y
 # CONFIG_PPC_MPC106 is not set
 # CONFIG_PPC_970_NAP is not set
diff --git a/arch/powerpc/configs/mpc832x_mds_defconfig b/arch/powerpc/configs/mpc832x_mds_defconfig
new file mode 100644 (file)
index 0000000..e1b36de
--- /dev/null
@@ -0,0 +1,1083 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.20-rc5
+# Tue Jan 30 14:27:25 2007
+#
+# CONFIG_PPC64 is not set
+CONFIG_PPC32=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+
+#
+# Processor support
+#
+# CONFIG_CLASSIC32 is not set
+# CONFIG_PPC_82xx is not set
+CONFIG_PPC_83xx=y
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_86xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_8xx is not set
+# CONFIG_E200 is not set
+CONFIG_6xx=y
+CONFIG_83xx=y
+CONFIG_PPC_FPU=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+# CONFIG_SMP is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+# CONFIG_EPOLL is not set
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_QUICC_ENGINE=y
+CONFIG_PPC_GEN550=y
+# CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# Platform support
+#
+CONFIG_MPC832x_MDS=y
+# CONFIG_MPC834x_SYS is not set
+# CONFIG_MPC834x_ITX is not set
+# CONFIG_MPC8360E_PB is not set
+CONFIG_PPC_MPC832x=y
+# CONFIG_MPIC is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_MATH_EMULATION=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+CONFIG_SECCOMP=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_GENERIC_ISA_DMA=y
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_FSL_SOC=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=32768
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# Misc devices
+#
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+# CONFIG_BLK_DEV_SD is not set
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ARCMSR is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_SRP is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+# CONFIG_MAC_EMUMOUSEBTN is not set
+# CONFIG_WINDFARM is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_GIANFAR is not set
+CONFIG_UCC_GETH=y
+# CONFIG_UGETH_NAPI is not set
+# CONFIG_UGETH_MAGIC_PACKET is not set
+# CONFIG_UGETH_FILTERING is not set
+# CONFIG_UGETH_TX_ON_DEMOND is not set
+# CONFIG_QLA3XXX is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+# CONFIG_NETXEN_NIC is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_83xx_WDT=y
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_NVRAM is not set
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+CONFIG_I2C_MPC=y
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_M41T00 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB is not set
+# CONFIG_FB_IBM_GXT4500 is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+# CONFIG_RTC_CLASS is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# Virtualization
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+# CONFIG_MSDOS_PARTITION is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+
+#
+# QE Options
+#
+CONFIG_UCC_SLOW=y
+CONFIG_UCC_FAST=y
+CONFIG_UCC=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_IOMAP_COPY=y
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_SERIAL_TEXT_DEBUG is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Hardware crypto devices
+#
diff --git a/arch/powerpc/configs/mpc832xemds_defconfig b/arch/powerpc/configs/mpc832xemds_defconfig
deleted file mode 100644 (file)
index e1b36de..0000000
+++ /dev/null
@@ -1,1083 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20-rc5
-# Tue Jan 30 14:27:25 2007
-#
-# CONFIG_PPC64 is not set
-CONFIG_PPC32=y
-CONFIG_PPC_MERGE=y
-CONFIG_MMU=y
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_IRQ_PER_CPU=y
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
-CONFIG_ARCH_HAS_ILOG2_U32=y
-CONFIG_GENERIC_HWEIGHT=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_PPC=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_GENERIC_NVRAM=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_ARCH_MAY_HAVE_PC_FDC=y
-CONFIG_PPC_OF=y
-CONFIG_PPC_UDBG_16550=y
-# CONFIG_GENERIC_TBSYNC is not set
-CONFIG_AUDIT_ARCH=y
-CONFIG_GENERIC_BUG=y
-CONFIG_DEFAULT_UIMAGE=y
-
-#
-# Processor support
-#
-# CONFIG_CLASSIC32 is not set
-# CONFIG_PPC_82xx is not set
-CONFIG_PPC_83xx=y
-# CONFIG_PPC_85xx is not set
-# CONFIG_PPC_86xx is not set
-# CONFIG_40x is not set
-# CONFIG_44x is not set
-# CONFIG_8xx is not set
-# CONFIG_E200 is not set
-CONFIG_6xx=y
-CONFIG_83xx=y
-CONFIG_PPC_FPU=y
-# CONFIG_PPC_DCR_NATIVE is not set
-# CONFIG_PPC_DCR_MMIO is not set
-CONFIG_PPC_STD_MMU=y
-CONFIG_PPC_STD_MMU_32=y
-# CONFIG_SMP is not set
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
-CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
-# CONFIG_POSIX_MQUEUE is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
-# CONFIG_AUDIT is not set
-# CONFIG_IKCONFIG is not set
-CONFIG_SYSFS_DEPRECATED=y
-# CONFIG_RELAY is not set
-CONFIG_INITRAMFS_SOURCE=""
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_SYSCTL=y
-CONFIG_EMBEDDED=y
-CONFIG_SYSCTL_SYSCALL=y
-# CONFIG_KALLSYMS is not set
-CONFIG_HOTPLUG=y
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-CONFIG_ELF_CORE=y
-CONFIG_BASE_FULL=y
-CONFIG_FUTEX=y
-# CONFIG_EPOLL is not set
-CONFIG_SHMEM=y
-CONFIG_SLAB=y
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
-CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_MODULE_FORCE_UNLOAD is not set
-# CONFIG_MODVERSIONS is not set
-# CONFIG_MODULE_SRCVERSION_ALL is not set
-# CONFIG_KMOD is not set
-
-#
-# Block layer
-#
-CONFIG_BLOCK=y
-# CONFIG_LBD is not set
-# CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-CONFIG_DEFAULT_AS=y
-# CONFIG_DEFAULT_DEADLINE is not set
-# CONFIG_DEFAULT_CFQ is not set
-# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="anticipatory"
-CONFIG_QUICC_ENGINE=y
-CONFIG_PPC_GEN550=y
-# CONFIG_WANT_EARLY_SERIAL is not set
-
-#
-# Platform support
-#
-CONFIG_MPC832x_MDS=y
-# CONFIG_MPC834x_SYS is not set
-# CONFIG_MPC834x_ITX is not set
-# CONFIG_MPC8360E_PB is not set
-CONFIG_PPC_MPC832x=y
-# CONFIG_MPIC is not set
-
-#
-# Kernel options
-#
-# CONFIG_HIGHMEM is not set
-# CONFIG_HZ_100 is not set
-CONFIG_HZ_250=y
-# CONFIG_HZ_300 is not set
-# CONFIG_HZ_1000 is not set
-CONFIG_HZ=250
-CONFIG_PREEMPT_NONE=y
-# CONFIG_PREEMPT_VOLUNTARY is not set
-# CONFIG_PREEMPT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
-CONFIG_MATH_EMULATION=y
-CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
-CONFIG_ARCH_FLATMEM_ENABLE=y
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4
-# CONFIG_RESOURCES_64BIT is not set
-CONFIG_PROC_DEVICETREE=y
-# CONFIG_CMDLINE_BOOL is not set
-# CONFIG_PM is not set
-CONFIG_SECCOMP=y
-CONFIG_ISA_DMA_API=y
-
-#
-# Bus options
-#
-CONFIG_GENERIC_ISA_DMA=y
-# CONFIG_MPIC_WEIRD is not set
-# CONFIG_PPC_I8259 is not set
-CONFIG_PPC_INDIRECT_PCI=y
-CONFIG_FSL_SOC=y
-CONFIG_PCI=y
-CONFIG_PCI_DOMAINS=y
-# CONFIG_PCIEPORTBUS is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
-# CONFIG_PCCARD is not set
-
-#
-# PCI Hotplug Support
-#
-# CONFIG_HOTPLUG_PCI is not set
-
-#
-# Advanced setup
-#
-# CONFIG_ADVANCED_OPTIONS is not set
-
-#
-# Default settings for advanced configuration options are used
-#
-CONFIG_HIGHMEM_START=0xfe000000
-CONFIG_LOWMEM_SIZE=0x30000000
-CONFIG_KERNEL_START=0xc0000000
-CONFIG_TASK_SIZE=0x80000000
-CONFIG_BOOT_LOAD=0x00800000
-
-#
-# Networking
-#
-CONFIG_NET=y
-
-#
-# Networking options
-#
-# CONFIG_NETDEBUG is not set
-CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
-CONFIG_UNIX=y
-CONFIG_XFRM=y
-# CONFIG_XFRM_USER is not set
-# CONFIG_XFRM_SUB_POLICY is not set
-# CONFIG_NET_KEY is not set
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-CONFIG_IP_FIB_HASH=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-# CONFIG_IP_PNP_RARP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
-CONFIG_SYN_COOKIES=y
-# CONFIG_INET_AH is not set
-# CONFIG_INET_ESP is not set
-# CONFIG_INET_IPCOMP is not set
-# CONFIG_INET_XFRM_TUNNEL is not set
-# CONFIG_INET_TUNNEL is not set
-CONFIG_INET_XFRM_MODE_TRANSPORT=y
-CONFIG_INET_XFRM_MODE_TUNNEL=y
-CONFIG_INET_XFRM_MODE_BEET=y
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-# CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
-# CONFIG_TCP_MD5SIG is not set
-# CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
-# CONFIG_NETWORK_SECMARK is not set
-# CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
-# CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
-# CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
-# CONFIG_TIPC is not set
-# CONFIG_ATM is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_VLAN_8021Q is not set
-# CONFIG_DECNET is not set
-# CONFIG_LLC2 is not set
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
-# CONFIG_NET_SCHED is not set
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_IRDA is not set
-# CONFIG_BT is not set
-# CONFIG_IEEE80211 is not set
-
-#
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-# CONFIG_FW_LOADER is not set
-# CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
-# CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-# CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_CPQ_DA is not set
-# CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_BLK_DEV_DAC960 is not set
-# CONFIG_BLK_DEV_UMEM is not set
-# CONFIG_BLK_DEV_COW_COMMON is not set
-CONFIG_BLK_DEV_LOOP=y
-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-# CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_SX8 is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CDROM_PKTCDVD is not set
-# CONFIG_ATA_OVER_ETH is not set
-
-#
-# Misc devices
-#
-# CONFIG_SGI_IOC4 is not set
-# CONFIG_TIFM_CORE is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
-# CONFIG_IDE is not set
-
-#
-# SCSI device support
-#
-# CONFIG_RAID_ATTRS is not set
-CONFIG_SCSI=y
-# CONFIG_SCSI_TGT is not set
-# CONFIG_SCSI_NETLINK is not set
-CONFIG_SCSI_PROC_FS=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-# CONFIG_BLK_DEV_SD is not set
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-# CONFIG_BLK_DEV_SR is not set
-# CONFIG_CHR_DEV_SG is not set
-# CONFIG_CHR_DEV_SCH is not set
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_CONSTANTS is not set
-# CONFIG_SCSI_LOGGING is not set
-# CONFIG_SCSI_SCAN_ASYNC is not set
-
-#
-# SCSI Transports
-#
-# CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_SCSI_FC_ATTRS is not set
-# CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
-# CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
-# CONFIG_ISCSI_TCP is not set
-# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
-# CONFIG_SCSI_3W_9XXX is not set
-# CONFIG_SCSI_ACARD is not set
-# CONFIG_SCSI_AACRAID is not set
-# CONFIG_SCSI_AIC7XXX is not set
-# CONFIG_SCSI_AIC7XXX_OLD is not set
-# CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_AIC94XX is not set
-# CONFIG_SCSI_DPT_I2O is not set
-# CONFIG_SCSI_ARCMSR is not set
-# CONFIG_MEGARAID_NEWGEN is not set
-# CONFIG_MEGARAID_LEGACY is not set
-# CONFIG_MEGARAID_SAS is not set
-# CONFIG_SCSI_HPTIOP is not set
-# CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_DMX3191D is not set
-# CONFIG_SCSI_EATA is not set
-# CONFIG_SCSI_FUTURE_DOMAIN is not set
-# CONFIG_SCSI_GDTH is not set
-# CONFIG_SCSI_IPS is not set
-# CONFIG_SCSI_INITIO is not set
-# CONFIG_SCSI_INIA100 is not set
-# CONFIG_SCSI_STEX is not set
-# CONFIG_SCSI_SYM53C8XX_2 is not set
-# CONFIG_SCSI_QLOGIC_1280 is not set
-# CONFIG_SCSI_QLA_FC is not set
-# CONFIG_SCSI_QLA_ISCSI is not set
-# CONFIG_SCSI_LPFC is not set
-# CONFIG_SCSI_DC395x is not set
-# CONFIG_SCSI_DC390T is not set
-# CONFIG_SCSI_NSP32 is not set
-# CONFIG_SCSI_DEBUG is not set
-# CONFIG_SCSI_SRP is not set
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
-# CONFIG_ATA is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-# CONFIG_IEEE1394 is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-
-#
-# Macintosh device drivers
-#
-# CONFIG_MAC_EMUMOUSEBTN is not set
-# CONFIG_WINDFARM is not set
-
-#
-# Network device support
-#
-CONFIG_NETDEVICES=y
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
-
-#
-# PHY device support
-#
-# CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=y
-# CONFIG_HAPPYMEAL is not set
-# CONFIG_SUNGEM is not set
-# CONFIG_CASSINI is not set
-# CONFIG_NET_VENDOR_3COM is not set
-
-#
-# Tulip family network device support
-#
-# CONFIG_NET_TULIP is not set
-# CONFIG_HP100 is not set
-# CONFIG_NET_PCI is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_ACENIC is not set
-# CONFIG_DL2K is not set
-# CONFIG_E1000 is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
-# CONFIG_SKGE is not set
-# CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_TIGON3 is not set
-# CONFIG_BNX2 is not set
-# CONFIG_GIANFAR is not set
-CONFIG_UCC_GETH=y
-# CONFIG_UGETH_NAPI is not set
-# CONFIG_UGETH_MAGIC_PACKET is not set
-# CONFIG_UGETH_FILTERING is not set
-# CONFIG_UGETH_TX_ON_DEMOND is not set
-# CONFIG_QLA3XXX is not set
-
-#
-# Ethernet (10000 Mbit)
-#
-# CONFIG_CHELSIO_T1 is not set
-# CONFIG_IXGB is not set
-# CONFIG_S2IO is not set
-# CONFIG_MYRI10GE is not set
-# CONFIG_NETXEN_NIC is not set
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-# CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
-# CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
-# CONFIG_PHONE is not set
-
-#
-# Input device support
-#
-CONFIG_INPUT=y
-# CONFIG_INPUT_FF_MEMLESS is not set
-
-#
-# Userland interfaces
-#
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-# CONFIG_INPUT_EVBUG is not set
-
-#
-# Input Device Drivers
-#
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
-
-#
-# Hardware I/O ports
-#
-# CONFIG_SERIO is not set
-# CONFIG_GAMEPORT is not set
-
-#
-# Character devices
-#
-# CONFIG_VT is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-
-#
-# Serial drivers
-#
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_PCI=y
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-# CONFIG_SERIAL_8250_EXTENDED is not set
-
-#
-# Non-8250 serial port support
-#
-# CONFIG_SERIAL_UARTLITE is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-# CONFIG_SERIAL_JSM is not set
-CONFIG_UNIX98_PTYS=y
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
-# CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-CONFIG_83xx_WDT=y
-
-#
-# PCI-based Watchdog Cards
-#
-# CONFIG_PCIPCWATCHDOG is not set
-# CONFIG_WDTPCI is not set
-CONFIG_HW_RANDOM=y
-# CONFIG_NVRAM is not set
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-# CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
-# CONFIG_TCG_TPM is not set
-
-#
-# I2C support
-#
-CONFIG_I2C=y
-CONFIG_I2C_CHARDEV=y
-
-#
-# I2C Algorithms
-#
-# CONFIG_I2C_ALGOBIT is not set
-# CONFIG_I2C_ALGOPCF is not set
-# CONFIG_I2C_ALGOPCA is not set
-
-#
-# I2C Hardware Bus support
-#
-# CONFIG_I2C_ALI1535 is not set
-# CONFIG_I2C_ALI1563 is not set
-# CONFIG_I2C_ALI15X3 is not set
-# CONFIG_I2C_AMD756 is not set
-# CONFIG_I2C_AMD8111 is not set
-# CONFIG_I2C_I801 is not set
-# CONFIG_I2C_I810 is not set
-# CONFIG_I2C_PIIX4 is not set
-CONFIG_I2C_MPC=y
-# CONFIG_I2C_NFORCE2 is not set
-# CONFIG_I2C_OCORES is not set
-# CONFIG_I2C_PARPORT_LIGHT is not set
-# CONFIG_I2C_PROSAVAGE is not set
-# CONFIG_I2C_SAVAGE4 is not set
-# CONFIG_I2C_SIS5595 is not set
-# CONFIG_I2C_SIS630 is not set
-# CONFIG_I2C_SIS96X is not set
-# CONFIG_I2C_STUB is not set
-# CONFIG_I2C_VIA is not set
-# CONFIG_I2C_VIAPRO is not set
-# CONFIG_I2C_VOODOO3 is not set
-# CONFIG_I2C_PCA_ISA is not set
-
-#
-# Miscellaneous I2C Chip support
-#
-# CONFIG_SENSORS_DS1337 is not set
-# CONFIG_SENSORS_DS1374 is not set
-# CONFIG_SENSORS_EEPROM is not set
-# CONFIG_SENSORS_PCF8574 is not set
-# CONFIG_SENSORS_PCA9539 is not set
-# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_SENSORS_M41T00 is not set
-# CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_I2C_DEBUG_CORE is not set
-# CONFIG_I2C_DEBUG_ALGO is not set
-# CONFIG_I2C_DEBUG_BUS is not set
-# CONFIG_I2C_DEBUG_CHIP is not set
-
-#
-# SPI support
-#
-# CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
-# CONFIG_W1 is not set
-
-#
-# Hardware Monitoring support
-#
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_ADM1025 is not set
-# CONFIG_SENSORS_ADM1026 is not set
-# CONFIG_SENSORS_ADM1031 is not set
-# CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ASB100 is not set
-# CONFIG_SENSORS_ATXP1 is not set
-# CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_FSCHER is not set
-# CONFIG_SENSORS_FSCPOS is not set
-# CONFIG_SENSORS_GL518SM is not set
-# CONFIG_SENSORS_GL520SM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM63 is not set
-# CONFIG_SENSORS_LM75 is not set
-# CONFIG_SENSORS_LM77 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM80 is not set
-# CONFIG_SENSORS_LM83 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_LM87 is not set
-# CONFIG_SENSORS_LM90 is not set
-# CONFIG_SENSORS_LM92 is not set
-# CONFIG_SENSORS_MAX1619 is not set
-# CONFIG_SENSORS_PC87360 is not set
-# CONFIG_SENSORS_PC87427 is not set
-# CONFIG_SENSORS_SIS5595 is not set
-# CONFIG_SENSORS_SMSC47M1 is not set
-# CONFIG_SENSORS_SMSC47M192 is not set
-# CONFIG_SENSORS_SMSC47B397 is not set
-# CONFIG_SENSORS_VIA686A is not set
-# CONFIG_SENSORS_VT1211 is not set
-# CONFIG_SENSORS_VT8231 is not set
-# CONFIG_SENSORS_W83781D is not set
-# CONFIG_SENSORS_W83791D is not set
-# CONFIG_SENSORS_W83792D is not set
-# CONFIG_SENSORS_W83793 is not set
-# CONFIG_SENSORS_W83L785TS is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# Digital Video Broadcasting Devices
-#
-# CONFIG_DVB is not set
-
-#
-# Graphics support
-#
-CONFIG_FIRMWARE_EDID=y
-# CONFIG_FB is not set
-# CONFIG_FB_IBM_GXT4500 is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# HID Devices
-#
-CONFIG_HID=y
-
-#
-# USB support
-#
-CONFIG_USB_ARCH_HAS_HCD=y
-CONFIG_USB_ARCH_HAS_OHCI=y
-CONFIG_USB_ARCH_HAS_EHCI=y
-# CONFIG_USB is not set
-
-#
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
-#
-
-#
-# USB Gadget Support
-#
-# CONFIG_USB_GADGET is not set
-
-#
-# MMC/SD Card support
-#
-# CONFIG_MMC is not set
-
-#
-# LED devices
-#
-# CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
-# CONFIG_INFINIBAND is not set
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
-# CONFIG_RTC_CLASS is not set
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
-#
-# Virtualization
-#
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-# CONFIG_EXT2_FS_XIP is not set
-CONFIG_EXT3_FS=y
-CONFIG_EXT3_FS_XATTR=y
-# CONFIG_EXT3_FS_POSIX_ACL is not set
-# CONFIG_EXT3_FS_SECURITY is not set
-# CONFIG_EXT4DEV_FS is not set
-CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_FS_POSIX_ACL is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_GFS2_FS is not set
-# CONFIG_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_INOTIFY=y
-CONFIG_INOTIFY_USER=y
-# CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_FUSE_FS is not set
-
-#
-# CD-ROM/DVD Filesystems
-#
-# CONFIG_ISO9660_FS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-# CONFIG_MSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_PROC_KCORE=y
-CONFIG_PROC_SYSCTL=y
-CONFIG_SYSFS=y
-CONFIG_TMPFS=y
-# CONFIG_TMPFS_POSIX_ACL is not set
-# CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
-# CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_NFS_V3_ACL is not set
-CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
-# CONFIG_NFSD is not set
-CONFIG_ROOT_NFS=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-CONFIG_SUNRPC_GSS=y
-CONFIG_RPCSEC_GSS_KRB5=y
-# CONFIG_RPCSEC_GSS_SPKM3 is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
-
-#
-# Partition Types
-#
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-# CONFIG_MAC_PARTITION is not set
-# CONFIG_MSDOS_PARTITION is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_KARMA_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
-
-#
-# Native Language Support
-#
-# CONFIG_NLS is not set
-
-#
-# Distributed Lock Manager
-#
-# CONFIG_DLM is not set
-
-#
-# QE Options
-#
-CONFIG_UCC_SLOW=y
-CONFIG_UCC_FAST=y
-CONFIG_UCC=y
-
-#
-# Library routines
-#
-CONFIG_BITREVERSE=y
-# CONFIG_CRC_CCITT is not set
-# CONFIG_CRC16 is not set
-CONFIG_CRC32=y
-# CONFIG_LIBCRC32C is not set
-CONFIG_PLIST=y
-CONFIG_IOMAP_COPY=y
-
-#
-# Instrumentation Support
-#
-# CONFIG_PROFILING is not set
-
-#
-# Kernel hacking
-#
-# CONFIG_PRINTK_TIME is not set
-CONFIG_ENABLE_MUST_CHECK=y
-# CONFIG_MAGIC_SYSRQ is not set
-# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
-# CONFIG_HEADERS_CHECK is not set
-# CONFIG_DEBUG_KERNEL is not set
-CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_BOOTX_TEXT is not set
-# CONFIG_SERIAL_TEXT_DEBUG is not set
-# CONFIG_PPC_EARLY_DEBUG is not set
-
-#
-# Security options
-#
-# CONFIG_KEYS is not set
-# CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
-CONFIG_CRYPTO=y
-CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_BLKCIPHER=y
-CONFIG_CRYPTO_MANAGER=y
-# CONFIG_CRYPTO_HMAC is not set
-# CONFIG_CRYPTO_XCBC is not set
-# CONFIG_CRYPTO_NULL is not set
-# CONFIG_CRYPTO_MD4 is not set
-CONFIG_CRYPTO_MD5=y
-# CONFIG_CRYPTO_SHA1 is not set
-# CONFIG_CRYPTO_SHA256 is not set
-# CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
-# CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=y
-# CONFIG_CRYPTO_LRW is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_AES is not set
-# CONFIG_CRYPTO_CAST5 is not set
-# CONFIG_CRYPTO_CAST6 is not set
-# CONFIG_CRYPTO_TEA is not set
-# CONFIG_CRYPTO_ARC4 is not set
-# CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_DEFLATE is not set
-# CONFIG_CRYPTO_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_TEST is not set
-
-#
-# Hardware crypto devices
-#
diff --git a/arch/powerpc/configs/mpc8360emds_defconfig b/arch/powerpc/configs/mpc8360emds_defconfig
deleted file mode 100644 (file)
index bbe38cc..0000000
+++ /dev/null
@@ -1,1082 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20-rc5
-# Fri Jan 26 00:19:45 2007
-#
-# CONFIG_PPC64 is not set
-CONFIG_PPC32=y
-CONFIG_PPC_MERGE=y
-CONFIG_MMU=y
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_IRQ_PER_CPU=y
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
-CONFIG_ARCH_HAS_ILOG2_U32=y
-CONFIG_GENERIC_HWEIGHT=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_PPC=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_GENERIC_NVRAM=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_ARCH_MAY_HAVE_PC_FDC=y
-CONFIG_PPC_OF=y
-CONFIG_PPC_UDBG_16550=y
-# CONFIG_GENERIC_TBSYNC is not set
-CONFIG_AUDIT_ARCH=y
-CONFIG_GENERIC_BUG=y
-CONFIG_DEFAULT_UIMAGE=y
-
-#
-# Processor support
-#
-# CONFIG_CLASSIC32 is not set
-# CONFIG_PPC_82xx is not set
-CONFIG_PPC_83xx=y
-# CONFIG_PPC_85xx is not set
-# CONFIG_PPC_86xx is not set
-# CONFIG_40x is not set
-# CONFIG_44x is not set
-# CONFIG_8xx is not set
-# CONFIG_E200 is not set
-CONFIG_6xx=y
-CONFIG_83xx=y
-CONFIG_PPC_FPU=y
-# CONFIG_PPC_DCR_NATIVE is not set
-# CONFIG_PPC_DCR_MMIO is not set
-CONFIG_PPC_STD_MMU=y
-CONFIG_PPC_STD_MMU_32=y
-# CONFIG_SMP is not set
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
-CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
-# CONFIG_POSIX_MQUEUE is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
-# CONFIG_AUDIT is not set
-# CONFIG_IKCONFIG is not set
-CONFIG_SYSFS_DEPRECATED=y
-# CONFIG_RELAY is not set
-CONFIG_INITRAMFS_SOURCE=""
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_SYSCTL=y
-CONFIG_EMBEDDED=y
-CONFIG_SYSCTL_SYSCALL=y
-# CONFIG_KALLSYMS is not set
-CONFIG_HOTPLUG=y
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-CONFIG_ELF_CORE=y
-CONFIG_BASE_FULL=y
-CONFIG_FUTEX=y
-# CONFIG_EPOLL is not set
-CONFIG_SHMEM=y
-CONFIG_SLAB=y
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
-CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_MODULE_FORCE_UNLOAD is not set
-# CONFIG_MODVERSIONS is not set
-# CONFIG_MODULE_SRCVERSION_ALL is not set
-# CONFIG_KMOD is not set
-
-#
-# Block layer
-#
-CONFIG_BLOCK=y
-# CONFIG_LBD is not set
-# CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-CONFIG_DEFAULT_AS=y
-# CONFIG_DEFAULT_DEADLINE is not set
-# CONFIG_DEFAULT_CFQ is not set
-# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="anticipatory"
-CONFIG_QUICC_ENGINE=y
-CONFIG_PPC_GEN550=y
-# CONFIG_WANT_EARLY_SERIAL is not set
-
-#
-# Platform support
-#
-# CONFIG_MPC832x_MDS is not set
-# CONFIG_MPC834x_SYS is not set
-# CONFIG_MPC834x_ITX is not set
-CONFIG_MPC8360E_PB=y
-CONFIG_PPC_MPC836x=y
-# CONFIG_MPIC is not set
-
-#
-# Kernel options
-#
-# CONFIG_HIGHMEM is not set
-# CONFIG_HZ_100 is not set
-CONFIG_HZ_250=y
-# CONFIG_HZ_300 is not set
-# CONFIG_HZ_1000 is not set
-CONFIG_HZ=250
-CONFIG_PREEMPT_NONE=y
-# CONFIG_PREEMPT_VOLUNTARY is not set
-# CONFIG_PREEMPT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
-CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
-CONFIG_ARCH_FLATMEM_ENABLE=y
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4
-# CONFIG_RESOURCES_64BIT is not set
-CONFIG_PROC_DEVICETREE=y
-# CONFIG_CMDLINE_BOOL is not set
-# CONFIG_PM is not set
-CONFIG_SECCOMP=y
-CONFIG_ISA_DMA_API=y
-
-#
-# Bus options
-#
-CONFIG_GENERIC_ISA_DMA=y
-# CONFIG_MPIC_WEIRD is not set
-# CONFIG_PPC_I8259 is not set
-CONFIG_PPC_INDIRECT_PCI=y
-CONFIG_FSL_SOC=y
-CONFIG_PCI=y
-CONFIG_PCI_DOMAINS=y
-# CONFIG_PCIEPORTBUS is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
-# CONFIG_PCCARD is not set
-
-#
-# PCI Hotplug Support
-#
-# CONFIG_HOTPLUG_PCI is not set
-
-#
-# Advanced setup
-#
-# CONFIG_ADVANCED_OPTIONS is not set
-
-#
-# Default settings for advanced configuration options are used
-#
-CONFIG_HIGHMEM_START=0xfe000000
-CONFIG_LOWMEM_SIZE=0x30000000
-CONFIG_KERNEL_START=0xc0000000
-CONFIG_TASK_SIZE=0x80000000
-CONFIG_BOOT_LOAD=0x00800000
-
-#
-# Networking
-#
-CONFIG_NET=y
-
-#
-# Networking options
-#
-# CONFIG_NETDEBUG is not set
-CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
-CONFIG_UNIX=y
-CONFIG_XFRM=y
-# CONFIG_XFRM_USER is not set
-# CONFIG_XFRM_SUB_POLICY is not set
-# CONFIG_NET_KEY is not set
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-CONFIG_IP_FIB_HASH=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-# CONFIG_IP_PNP_RARP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
-CONFIG_SYN_COOKIES=y
-# CONFIG_INET_AH is not set
-# CONFIG_INET_ESP is not set
-# CONFIG_INET_IPCOMP is not set
-# CONFIG_INET_XFRM_TUNNEL is not set
-# CONFIG_INET_TUNNEL is not set
-CONFIG_INET_XFRM_MODE_TRANSPORT=y
-CONFIG_INET_XFRM_MODE_TUNNEL=y
-CONFIG_INET_XFRM_MODE_BEET=y
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-# CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
-# CONFIG_TCP_MD5SIG is not set
-# CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
-# CONFIG_NETWORK_SECMARK is not set
-# CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
-# CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
-# CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
-# CONFIG_TIPC is not set
-# CONFIG_ATM is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_VLAN_8021Q is not set
-# CONFIG_DECNET is not set
-# CONFIG_LLC2 is not set
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
-# CONFIG_NET_SCHED is not set
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_IRDA is not set
-# CONFIG_BT is not set
-# CONFIG_IEEE80211 is not set
-
-#
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-# CONFIG_FW_LOADER is not set
-# CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
-# CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-# CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_CPQ_DA is not set
-# CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_BLK_DEV_DAC960 is not set
-# CONFIG_BLK_DEV_UMEM is not set
-# CONFIG_BLK_DEV_COW_COMMON is not set
-CONFIG_BLK_DEV_LOOP=y
-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-# CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_SX8 is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CDROM_PKTCDVD is not set
-# CONFIG_ATA_OVER_ETH is not set
-
-#
-# Misc devices
-#
-# CONFIG_SGI_IOC4 is not set
-# CONFIG_TIFM_CORE is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
-# CONFIG_IDE is not set
-
-#
-# SCSI device support
-#
-# CONFIG_RAID_ATTRS is not set
-CONFIG_SCSI=y
-# CONFIG_SCSI_TGT is not set
-# CONFIG_SCSI_NETLINK is not set
-CONFIG_SCSI_PROC_FS=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-# CONFIG_BLK_DEV_SD is not set
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-# CONFIG_BLK_DEV_SR is not set
-# CONFIG_CHR_DEV_SG is not set
-# CONFIG_CHR_DEV_SCH is not set
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_CONSTANTS is not set
-# CONFIG_SCSI_LOGGING is not set
-# CONFIG_SCSI_SCAN_ASYNC is not set
-
-#
-# SCSI Transports
-#
-# CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_SCSI_FC_ATTRS is not set
-# CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
-# CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
-# CONFIG_ISCSI_TCP is not set
-# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
-# CONFIG_SCSI_3W_9XXX is not set
-# CONFIG_SCSI_ACARD is not set
-# CONFIG_SCSI_AACRAID is not set
-# CONFIG_SCSI_AIC7XXX is not set
-# CONFIG_SCSI_AIC7XXX_OLD is not set
-# CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_AIC94XX is not set
-# CONFIG_SCSI_DPT_I2O is not set
-# CONFIG_SCSI_ARCMSR is not set
-# CONFIG_MEGARAID_NEWGEN is not set
-# CONFIG_MEGARAID_LEGACY is not set
-# CONFIG_MEGARAID_SAS is not set
-# CONFIG_SCSI_HPTIOP is not set
-# CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_DMX3191D is not set
-# CONFIG_SCSI_EATA is not set
-# CONFIG_SCSI_FUTURE_DOMAIN is not set
-# CONFIG_SCSI_GDTH is not set
-# CONFIG_SCSI_IPS is not set
-# CONFIG_SCSI_INITIO is not set
-# CONFIG_SCSI_INIA100 is not set
-# CONFIG_SCSI_STEX is not set
-# CONFIG_SCSI_SYM53C8XX_2 is not set
-# CONFIG_SCSI_QLOGIC_1280 is not set
-# CONFIG_SCSI_QLA_FC is not set
-# CONFIG_SCSI_QLA_ISCSI is not set
-# CONFIG_SCSI_LPFC is not set
-# CONFIG_SCSI_DC395x is not set
-# CONFIG_SCSI_DC390T is not set
-# CONFIG_SCSI_NSP32 is not set
-# CONFIG_SCSI_DEBUG is not set
-# CONFIG_SCSI_SRP is not set
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
-# CONFIG_ATA is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-# CONFIG_IEEE1394 is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-
-#
-# Macintosh device drivers
-#
-# CONFIG_MAC_EMUMOUSEBTN is not set
-# CONFIG_WINDFARM is not set
-
-#
-# Network device support
-#
-CONFIG_NETDEVICES=y
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
-
-#
-# PHY device support
-#
-# CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=y
-# CONFIG_HAPPYMEAL is not set
-# CONFIG_SUNGEM is not set
-# CONFIG_CASSINI is not set
-# CONFIG_NET_VENDOR_3COM is not set
-
-#
-# Tulip family network device support
-#
-# CONFIG_NET_TULIP is not set
-# CONFIG_HP100 is not set
-# CONFIG_NET_PCI is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_ACENIC is not set
-# CONFIG_DL2K is not set
-# CONFIG_E1000 is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
-# CONFIG_SKGE is not set
-# CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_TIGON3 is not set
-# CONFIG_BNX2 is not set
-# CONFIG_GIANFAR is not set
-CONFIG_UCC_GETH=y
-# CONFIG_UGETH_NAPI is not set
-# CONFIG_UGETH_MAGIC_PACKET is not set
-# CONFIG_UGETH_FILTERING is not set
-# CONFIG_UGETH_TX_ON_DEMOND is not set
-# CONFIG_QLA3XXX is not set
-
-#
-# Ethernet (10000 Mbit)
-#
-# CONFIG_CHELSIO_T1 is not set
-# CONFIG_IXGB is not set
-# CONFIG_S2IO is not set
-# CONFIG_MYRI10GE is not set
-# CONFIG_NETXEN_NIC is not set
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-# CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
-# CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
-# CONFIG_PHONE is not set
-
-#
-# Input device support
-#
-CONFIG_INPUT=y
-# CONFIG_INPUT_FF_MEMLESS is not set
-
-#
-# Userland interfaces
-#
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-# CONFIG_INPUT_EVBUG is not set
-
-#
-# Input Device Drivers
-#
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
-
-#
-# Hardware I/O ports
-#
-# CONFIG_SERIO is not set
-# CONFIG_GAMEPORT is not set
-
-#
-# Character devices
-#
-# CONFIG_VT is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-
-#
-# Serial drivers
-#
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_PCI=y
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-# CONFIG_SERIAL_8250_EXTENDED is not set
-
-#
-# Non-8250 serial port support
-#
-# CONFIG_SERIAL_UARTLITE is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-# CONFIG_SERIAL_JSM is not set
-CONFIG_UNIX98_PTYS=y
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
-# CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-CONFIG_83xx_WDT=y
-
-#
-# PCI-based Watchdog Cards
-#
-# CONFIG_PCIPCWATCHDOG is not set
-# CONFIG_WDTPCI is not set
-CONFIG_HW_RANDOM=y
-# CONFIG_NVRAM is not set
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-# CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
-# CONFIG_TCG_TPM is not set
-
-#
-# I2C support
-#
-CONFIG_I2C=y
-CONFIG_I2C_CHARDEV=y
-
-#
-# I2C Algorithms
-#
-# CONFIG_I2C_ALGOBIT is not set
-# CONFIG_I2C_ALGOPCF is not set
-# CONFIG_I2C_ALGOPCA is not set
-
-#
-# I2C Hardware Bus support
-#
-# CONFIG_I2C_ALI1535 is not set
-# CONFIG_I2C_ALI1563 is not set
-# CONFIG_I2C_ALI15X3 is not set
-# CONFIG_I2C_AMD756 is not set
-# CONFIG_I2C_AMD8111 is not set
-# CONFIG_I2C_I801 is not set
-# CONFIG_I2C_I810 is not set
-# CONFIG_I2C_PIIX4 is not set
-CONFIG_I2C_MPC=y
-# CONFIG_I2C_NFORCE2 is not set
-# CONFIG_I2C_OCORES is not set
-# CONFIG_I2C_PARPORT_LIGHT is not set
-# CONFIG_I2C_PROSAVAGE is not set
-# CONFIG_I2C_SAVAGE4 is not set
-# CONFIG_I2C_SIS5595 is not set
-# CONFIG_I2C_SIS630 is not set
-# CONFIG_I2C_SIS96X is not set
-# CONFIG_I2C_STUB is not set
-# CONFIG_I2C_VIA is not set
-# CONFIG_I2C_VIAPRO is not set
-# CONFIG_I2C_VOODOO3 is not set
-# CONFIG_I2C_PCA_ISA is not set
-
-#
-# Miscellaneous I2C Chip support
-#
-# CONFIG_SENSORS_DS1337 is not set
-# CONFIG_SENSORS_DS1374 is not set
-# CONFIG_SENSORS_EEPROM is not set
-# CONFIG_SENSORS_PCF8574 is not set
-# CONFIG_SENSORS_PCA9539 is not set
-# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_SENSORS_M41T00 is not set
-# CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_I2C_DEBUG_CORE is not set
-# CONFIG_I2C_DEBUG_ALGO is not set
-# CONFIG_I2C_DEBUG_BUS is not set
-# CONFIG_I2C_DEBUG_CHIP is not set
-
-#
-# SPI support
-#
-# CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
-# CONFIG_W1 is not set
-
-#
-# Hardware Monitoring support
-#
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_ADM1025 is not set
-# CONFIG_SENSORS_ADM1026 is not set
-# CONFIG_SENSORS_ADM1031 is not set
-# CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ASB100 is not set
-# CONFIG_SENSORS_ATXP1 is not set
-# CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_FSCHER is not set
-# CONFIG_SENSORS_FSCPOS is not set
-# CONFIG_SENSORS_GL518SM is not set
-# CONFIG_SENSORS_GL520SM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM63 is not set
-# CONFIG_SENSORS_LM75 is not set
-# CONFIG_SENSORS_LM77 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM80 is not set
-# CONFIG_SENSORS_LM83 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_LM87 is not set
-# CONFIG_SENSORS_LM90 is not set
-# CONFIG_SENSORS_LM92 is not set
-# CONFIG_SENSORS_MAX1619 is not set
-# CONFIG_SENSORS_PC87360 is not set
-# CONFIG_SENSORS_PC87427 is not set
-# CONFIG_SENSORS_SIS5595 is not set
-# CONFIG_SENSORS_SMSC47M1 is not set
-# CONFIG_SENSORS_SMSC47M192 is not set
-# CONFIG_SENSORS_SMSC47B397 is not set
-# CONFIG_SENSORS_VIA686A is not set
-# CONFIG_SENSORS_VT1211 is not set
-# CONFIG_SENSORS_VT8231 is not set
-# CONFIG_SENSORS_W83781D is not set
-# CONFIG_SENSORS_W83791D is not set
-# CONFIG_SENSORS_W83792D is not set
-# CONFIG_SENSORS_W83793 is not set
-# CONFIG_SENSORS_W83L785TS is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# Digital Video Broadcasting Devices
-#
-# CONFIG_DVB is not set
-
-#
-# Graphics support
-#
-CONFIG_FIRMWARE_EDID=y
-# CONFIG_FB is not set
-# CONFIG_FB_IBM_GXT4500 is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# HID Devices
-#
-CONFIG_HID=y
-
-#
-# USB support
-#
-CONFIG_USB_ARCH_HAS_HCD=y
-CONFIG_USB_ARCH_HAS_OHCI=y
-CONFIG_USB_ARCH_HAS_EHCI=y
-# CONFIG_USB is not set
-
-#
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
-#
-
-#
-# USB Gadget Support
-#
-# CONFIG_USB_GADGET is not set
-
-#
-# MMC/SD Card support
-#
-# CONFIG_MMC is not set
-
-#
-# LED devices
-#
-# CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
-# CONFIG_INFINIBAND is not set
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
-# CONFIG_RTC_CLASS is not set
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
-#
-# Virtualization
-#
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-# CONFIG_EXT2_FS_XIP is not set
-CONFIG_EXT3_FS=y
-CONFIG_EXT3_FS_XATTR=y
-# CONFIG_EXT3_FS_POSIX_ACL is not set
-# CONFIG_EXT3_FS_SECURITY is not set
-# CONFIG_EXT4DEV_FS is not set
-CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_FS_POSIX_ACL is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_GFS2_FS is not set
-# CONFIG_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_INOTIFY=y
-CONFIG_INOTIFY_USER=y
-# CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_FUSE_FS is not set
-
-#
-# CD-ROM/DVD Filesystems
-#
-# CONFIG_ISO9660_FS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-# CONFIG_MSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_PROC_KCORE=y
-CONFIG_PROC_SYSCTL=y
-CONFIG_SYSFS=y
-CONFIG_TMPFS=y
-# CONFIG_TMPFS_POSIX_ACL is not set
-# CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
-# CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_NFS_V3_ACL is not set
-CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
-# CONFIG_NFSD is not set
-CONFIG_ROOT_NFS=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-CONFIG_SUNRPC_GSS=y
-CONFIG_RPCSEC_GSS_KRB5=y
-# CONFIG_RPCSEC_GSS_SPKM3 is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
-
-#
-# Partition Types
-#
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-# CONFIG_MAC_PARTITION is not set
-# CONFIG_MSDOS_PARTITION is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_KARMA_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
-
-#
-# Native Language Support
-#
-# CONFIG_NLS is not set
-
-#
-# Distributed Lock Manager
-#
-# CONFIG_DLM is not set
-
-#
-# QE Options
-#
-CONFIG_UCC_SLOW=y
-CONFIG_UCC_FAST=y
-CONFIG_UCC=y
-
-#
-# Library routines
-#
-CONFIG_BITREVERSE=y
-# CONFIG_CRC_CCITT is not set
-# CONFIG_CRC16 is not set
-CONFIG_CRC32=y
-# CONFIG_LIBCRC32C is not set
-CONFIG_PLIST=y
-CONFIG_IOMAP_COPY=y
-
-#
-# Instrumentation Support
-#
-# CONFIG_PROFILING is not set
-
-#
-# Kernel hacking
-#
-# CONFIG_PRINTK_TIME is not set
-CONFIG_ENABLE_MUST_CHECK=y
-# CONFIG_MAGIC_SYSRQ is not set
-# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
-# CONFIG_HEADERS_CHECK is not set
-# CONFIG_DEBUG_KERNEL is not set
-CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_BOOTX_TEXT is not set
-# CONFIG_SERIAL_TEXT_DEBUG is not set
-# CONFIG_PPC_EARLY_DEBUG is not set
-
-#
-# Security options
-#
-# CONFIG_KEYS is not set
-# CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
-CONFIG_CRYPTO=y
-CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_BLKCIPHER=y
-CONFIG_CRYPTO_MANAGER=y
-# CONFIG_CRYPTO_HMAC is not set
-# CONFIG_CRYPTO_XCBC is not set
-# CONFIG_CRYPTO_NULL is not set
-# CONFIG_CRYPTO_MD4 is not set
-CONFIG_CRYPTO_MD5=y
-# CONFIG_CRYPTO_SHA1 is not set
-# CONFIG_CRYPTO_SHA256 is not set
-# CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
-# CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=y
-# CONFIG_CRYPTO_LRW is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_AES is not set
-# CONFIG_CRYPTO_CAST5 is not set
-# CONFIG_CRYPTO_CAST6 is not set
-# CONFIG_CRYPTO_TEA is not set
-# CONFIG_CRYPTO_ARC4 is not set
-# CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_DEFLATE is not set
-# CONFIG_CRYPTO_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_TEST is not set
-
-#
-# Hardware crypto devices
-#
diff --git a/arch/powerpc/configs/mpc836x_mds_defconfig b/arch/powerpc/configs/mpc836x_mds_defconfig
new file mode 100644 (file)
index 0000000..8eb475c
--- /dev/null
@@ -0,0 +1,1099 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.20
+# Sat Feb 17 10:09:26 2007
+#
+# CONFIG_PPC64 is not set
+CONFIG_PPC32=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+
+#
+# Processor support
+#
+# CONFIG_CLASSIC32 is not set
+# CONFIG_PPC_82xx is not set
+CONFIG_PPC_83xx=y
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_86xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_6xx=y
+CONFIG_83xx=y
+CONFIG_PPC_FPU=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+# CONFIG_SMP is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+# CONFIG_EPOLL is not set
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_QUICC_ENGINE=y
+CONFIG_PPC_GEN550=y
+# CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# Platform support
+#
+# CONFIG_MPC8313_RDB is not set
+# CONFIG_MPC832x_MDS is not set
+# CONFIG_MPC834x_MDS is not set
+# CONFIG_MPC834x_ITX is not set
+CONFIG_MPC836x_MDS=y
+CONFIG_PPC_MPC836x=y
+# CONFIG_MPIC is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+CONFIG_SECCOMP=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_FSL_SOC=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=32768
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# Misc devices
+#
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+# CONFIG_BLK_DEV_SD is not set
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ARCMSR is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_SRP is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+# CONFIG_MAC_EMUMOUSEBTN is not set
+# CONFIG_WINDFARM is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_GIANFAR is not set
+CONFIG_UCC_GETH=y
+# CONFIG_UGETH_NAPI is not set
+# CONFIG_UGETH_MAGIC_PACKET is not set
+# CONFIG_UGETH_FILTERING is not set
+# CONFIG_UGETH_TX_ON_DEMOND is not set
+# CONFIG_QLA3XXX is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+# CONFIG_NETXEN_NIC is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+# CONFIG_SERIAL_OF_PLATFORM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_83xx_WDT=y
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_NVRAM is not set
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+CONFIG_I2C_MPC=y
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PASEMI is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_M41T00 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB is not set
+# CONFIG_FB_IBM_GXT4500 is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+# CONFIG_RTC_CLASS is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# Auxiliary Display support
+#
+
+#
+# Virtualization
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+# CONFIG_MSDOS_PARTITION is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+
+#
+# QE Options
+#
+CONFIG_UCC_SLOW=y
+CONFIG_UCC_FAST=y
+CONFIG_UCC=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_SERIAL_TEXT_DEBUG is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Hardware crypto devices
+#
index 058e06d88bc126da16918bd2d9a6ed40d374c018..7b3800674cbf2c7d35eaa403c6561ab60a56aa5d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20-rc5
-# Wed Feb  7 23:54:25 2007
+# Linux kernel version: 2.6.20
+# Sat Feb 17 16:26:53 2007
 #
 # CONFIG_PPC64 is not set
 CONFIG_PPC32=y
@@ -34,9 +34,9 @@ CONFIG_DEFAULT_UIMAGE=y
 # CONFIG_PPC_83xx is not set
 CONFIG_PPC_85xx=y
 # CONFIG_PPC_86xx is not set
+# CONFIG_PPC_8xx is not set
 # CONFIG_40x is not set
 # CONFIG_44x is not set
-# CONFIG_8xx is not set
 # CONFIG_E200 is not set
 CONFIG_85xx=y
 CONFIG_E500=y
@@ -63,6 +63,7 @@ CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
@@ -130,7 +131,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_MPC8540_ADS is not set
 # CONFIG_MPC8560_ADS is not set
 # CONFIG_MPC85xx_CDS is not set
-CONFIG_MPC8568_MDS=y
+CONFIG_MPC85xx_MDS=y
 CONFIG_MPC85xx=y
 CONFIG_PPC_INDIRECT_PCI_BE=y
 CONFIG_MPIC=y
@@ -162,6 +163,7 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
 # CONFIG_PM is not set
@@ -171,6 +173,7 @@ CONFIG_ISA_DMA_API=y
 #
 # Bus options
 #
+CONFIG_ZONE_DMA=y
 # CONFIG_MPIC_WEIRD is not set
 # CONFIG_PPC_I8259 is not set
 CONFIG_PPC_INDIRECT_PCI=y
@@ -216,6 +219,7 @@ CONFIG_UNIX=y
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
 # CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
@@ -301,6 +305,7 @@ CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
 
 #
@@ -341,7 +346,6 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # Misc devices
 #
-# CONFIG_TIFM_CORE is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -543,6 +547,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_UARTLITE is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_OF_PLATFORM is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -698,6 +703,7 @@ CONFIG_FIRMWARE_EDID=y
 # HID Devices
 #
 CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
 
 #
 # USB support
@@ -759,6 +765,10 @@ CONFIG_HID=y
 # DMA Devices
 #
 
+#
+# Auxiliary Display support
+#
+
 #
 # Virtualization
 #
@@ -896,7 +906,8 @@ CONFIG_BITREVERSE=y
 CONFIG_CRC32=y
 # CONFIG_LIBCRC32C is not set
 CONFIG_PLIST=y
-CONFIG_IOMAP_COPY=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
 
 #
 # Instrumentation Support
@@ -914,6 +925,7 @@ CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_DEBUG_FS is not set
 # CONFIG_HEADERS_CHECK is not set
 CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
@@ -922,7 +934,6 @@ CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_MUTEXES is not set
-# CONFIG_DEBUG_RWSEMS is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
@@ -932,6 +943,8 @@ CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_DEBUG_LIST is not set
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
 CONFIG_DEBUGGER=y
 # CONFIG_XMON is not set
 # CONFIG_BDI_SWITCH is not set
@@ -943,6 +956,8 @@ CONFIG_PPC_EARLY_DEBUG=y
 # CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
 # CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
 # CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
+# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
+# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
 
 #
 # Security options
@@ -970,8 +985,10 @@ CONFIG_CRYPTO_MD5=y
 # CONFIG_CRYPTO_GF128MUL is not set
 CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_LRW is not set
 CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_BLOWFISH is not set
 # CONFIG_CRYPTO_TWOFISH is not set
 # CONFIG_CRYPTO_SERPENT is not set
@@ -985,6 +1002,7 @@ CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
 # CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_TEST is not set
 
 #
index debac66e82589bee8e3518db45e305a06c3c503f..a8da0aea3b8751951d4c47f66d0f68d7e557b88e 100644 (file)
@@ -500,7 +500,7 @@ CONFIG_BLK_DEV_AMD74XX=y
 # CONFIG_BLK_DEV_PDC202XX_NEW is not set
 # CONFIG_BLK_DEV_SVWKS is not set
 # CONFIG_BLK_DEV_SIIMAGE is not set
-CONFIG_BLK_DEV_SL82C105=y
+# CONFIG_BLK_DEV_SL82C105 is not set
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
@@ -646,7 +646,7 @@ CONFIG_SATA_SVW=y
 # CONFIG_PATA_SIL680 is not set
 # CONFIG_PATA_SIS is not set
 # CONFIG_PATA_VIA is not set
-# CONFIG_PATA_WINBOND is not set
+CONFIG_PATA_WINBOND=y
 
 #
 # Multi-device support (RAID and LVM)
index 1c794fe718fd52dfe520d19db5f464f514b86d50..6e96e50c362d08c0ebd0443cc894a90bad090b39 100644 (file)
@@ -483,7 +483,7 @@ CONFIG_BLK_DEV_AMD74XX=y
 # CONFIG_BLK_DEV_PDC202XX_NEW is not set
 # CONFIG_BLK_DEV_SVWKS is not set
 # CONFIG_BLK_DEV_SIIMAGE is not set
-CONFIG_BLK_DEV_SL82C105=y
+# CONFIG_BLK_DEV_SL82C105 is not set
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
@@ -628,7 +628,7 @@ CONFIG_ATA=y
 # CONFIG_PATA_SIL680 is not set
 # CONFIG_PATA_SIS is not set
 # CONFIG_PATA_VIA is not set
-# CONFIG_PATA_WINBOND is not set
+CONFIG_PATA_WINBOND=y
 
 #
 # Multi-device support (RAID and LVM)
index 3e86e6e0f7782d436f8c9e57d9b59f461270633f..8d52b23348bd0b6cb2322fc9f87d626914268a51 100644 (file)
@@ -1599,6 +1599,7 @@ struct property *of_find_property(const struct device_node *np,
 
        return pp;
 }
+EXPORT_SYMBOL(of_find_property);
 
 /*
  * Find a property with a given name for a given node
index 12c51e4ad2b4b97b4468e8fca178fa435d86a025..ea6fd552c7eaf8023114958e093a172e2c2b3015 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/pci_regs.h>
 #include <linux/module.h>
 #include <linux/ioport.h>
+#include <linux/etherdevice.h>
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
 
@@ -1003,3 +1004,42 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq
        return res;
 }
 EXPORT_SYMBOL_GPL(of_irq_map_one);
+
+/**
+ * Search the device tree for the best MAC address to use.  'mac-address' is
+ * checked first, because that is supposed to contain to "most recent" MAC
+ * address. If that isn't set, then 'local-mac-address' is checked next,
+ * because that is the default address.  If that isn't set, then the obsolete
+ * 'address' is checked, just in case we're using an old device tree.
+ *
+ * Note that the 'address' property is supposed to contain a virtual address of
+ * the register set, but some DTS files have redefined that property to be the
+ * MAC address.
+ *
+ * All-zero MAC addresses are rejected, because those could be properties that
+ * exist in the device tree, but were not set by U-Boot.  For example, the
+ * DTS could define 'mac-address' and 'local-mac-address', with zero MAC
+ * addresses.  Some older U-Boots only initialized 'local-mac-address'.  In
+ * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
+ * but is all zeros.
+*/
+const void *of_get_mac_address(struct device_node *np)
+{
+       struct property *pp;
+
+       pp = of_find_property(np, "mac-address", NULL);
+       if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
+               return pp->value;
+
+       pp = of_find_property(np, "local-mac-address", NULL);
+       if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
+               return pp->value;
+
+       pp = of_find_property(np, "address", NULL);
+       if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
+               return pp->value;
+
+       return NULL;
+}
+EXPORT_SYMBOL(of_get_mac_address);
+
index 16e4ee1c2318e726c8e2bf9df3b6a9b1ec867197..1d443407423ca0b676b9bfc3bd546d3b85a2ed2e 100644 (file)
@@ -103,7 +103,7 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
                 *
                 */
                if (htab_bolt_mapping(ea, ea + PAGE_SIZE, pa, flags,
-                                     mmu_virtual_psize)) {
+                                     mmu_io_psize)) {
                        printk(KERN_ERR "Failed to do bolted mapping IO "
                               "memory at %016lx !\n", pa);
                        return -ENOMEM;
index 1aea1e69ff31c3ac562326d4a4e4900afa1d1a8c..713b31a16ce9e252e47ad25b35d8b5aa677d0d9b 100644 (file)
@@ -38,12 +38,12 @@ config MPC834x_ITX
          Be aware that PCI initialization is the bootloader's
          responsibility.
 
-config MPC8360E_PB
-       bool "Freescale MPC8360E PB"
+config MPC836x_MDS
+       bool "Freescale MPC836x MDS"
        select DEFAULT_UIMAGE
        select QUICC_ENGINE
        help
-         This option enables support for the MPC836x EMDS Processor Board.
+         This option enables support for the MPC836x MDS Processor Board.
 
 endchoice
 
@@ -69,6 +69,6 @@ config PPC_MPC836x
        bool
        select PPC_UDBG_16550
        select PPC_INDIRECT_PCI
-       default y if MPC8360E_PB
+       default y if MPC836x_MDS
 
 endmenu
index 6c8199c4c38214c1da86b58f77137b39486a1b99..dfc970d0df108250ea4c9624da495862945ce67d 100644 (file)
@@ -6,5 +6,5 @@ obj-$(CONFIG_PCI)               += pci.o
 obj-$(CONFIG_MPC8313_RDB)      += mpc8313_rdb.o
 obj-$(CONFIG_MPC834x_MDS)      += mpc834x_mds.o
 obj-$(CONFIG_MPC834x_ITX)      += mpc834x_itx.o
-obj-$(CONFIG_MPC8360E_PB)      += mpc8360e_pb.o
+obj-$(CONFIG_MPC836x_MDS)      += mpc836x_mds.o
 obj-$(CONFIG_MPC832x_MDS)      += mpc832x_mds.o
index c3b98c34eb6ba7b66434f5a4f1bbe3b0d8cec2d2..32e9e9492841ac600f68fb4bf07dfb35218837e3 100644 (file)
@@ -74,16 +74,9 @@ void __init mpc8313_rdb_init_IRQ(void)
  */
 static int __init mpc8313_rdb_probe(void)
 {
-       char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
-                                         "model", NULL);
-       if (model == NULL)
-               return 0;
-       if (strcmp(model, "MPC8313ERDB"))
-               return 0;
+        unsigned long root = of_get_flat_dt_root();
 
-       DBG("MPC8313 RDB found\n");
-
-       return 1;
+        return of_flat_dt_is_compatible(root, "MPC8313ERDB");
 }
 
 define_machine(mpc8313_rdb) {
index 3ecb55f8a6e265c8c16607e3ba9221089d42b10b..17e3a3c6d8b4e45a198c87008d757e69af51da7d 100644 (file)
@@ -57,11 +57,6 @@ unsigned long isa_mem_base = 0;
 
 static u8 *bcsr_regs = NULL;
 
-u8 *get_bcsr(void)
-{
-       return bcsr_regs;
-}
-
 /* ************************************************************************
  *
  * Setup the architecture
@@ -74,17 +69,6 @@ static void __init mpc832x_sys_setup_arch(void)
        if (ppc_md.progress)
                ppc_md.progress("mpc832x_sys_setup_arch()", 0);
 
-       np = of_find_node_by_type(NULL, "cpu");
-       if (np != 0) {
-               unsigned int *fp =
-                   (int *)get_property(np, "clock-frequency", NULL);
-               if (fp != 0)
-                       loops_per_jiffy = *fp / HZ;
-               else
-                       loops_per_jiffy = 50000000 / HZ;
-               of_node_put(np);
-       }
-
        /* Map BCSR area */
        np = of_find_node_by_name(NULL, "bcsr");
        if (np != 0) {
@@ -121,34 +105,23 @@ static void __init mpc832x_sys_setup_arch(void)
                iounmap(bcsr_regs);
                of_node_put(np);
        }
-
 #endif                         /* CONFIG_QUICC_ENGINE */
-
-#ifdef CONFIG_BLK_DEV_INITRD
-       if (initrd_start)
-               ROOT_DEV = Root_RAM0;
-       else
-#endif
-#ifdef  CONFIG_ROOT_NFS
-               ROOT_DEV = Root_NFS;
-#else
-               ROOT_DEV = Root_HDA1;
-#endif
 }
 
+static struct of_device_id mpc832x_ids[] = {
+       { .type = "soc", },
+       { .compatible = "soc", },
+       { .type = "qe", },
+       {},
+};
+
 static int __init mpc832x_declare_of_platform_devices(void)
 {
-       struct device_node *np;
-
-       for (np = NULL; (np = of_find_compatible_node(np, "network",
-                                       "ucc_geth")) != NULL;) {
-               int ucc_num;
-               char bus_id[BUS_ID_SIZE];
+       if (!machine_is(mpc832x_mds))
+               return 0;
 
-               ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1;
-               snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num);
-               of_platform_device_create(np, bus_id, NULL);
-       }
+       /* Publish the QE devices */
+       of_platform_bus_probe(NULL, mpc832x_ids, NULL);
 
        return 0;
 }
@@ -156,7 +129,6 @@ device_initcall(mpc832x_declare_of_platform_devices);
 
 static void __init mpc832x_sys_init_IRQ(void)
 {
-
        struct device_node *np;
 
        np = of_find_node_by_type(NULL, "ipic");
@@ -189,6 +161,9 @@ static int __init mpc832x_rtc_hookup(void)
 {
        struct timespec tv;
 
+       if (!machine_is(mpc832x_mds))
+               return 0;
+
        ppc_md.get_rtc_time = ds1374_get_rtc_time;
        ppc_md.set_rtc_time = ds1374_set_rtc_time;
 
@@ -207,17 +182,9 @@ late_initcall(mpc832x_rtc_hookup);
  */
 static int __init mpc832x_sys_probe(void)
 {
-       char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
-                                         "model", NULL);
-
-       if (model == NULL)
-               return 0;
-       if (strcmp(model, "MPC8323EMDS"))
-               return 0;
-
-       DBG("%s found\n", model);
+        unsigned long root = of_get_flat_dt_root();
 
-       return 1;
+        return of_flat_dt_is_compatible(root, "MPC832xMDS");
 }
 
 define_machine(mpc832x_mds) {
index 443a3172f370f96295f751e8baafbaddeb9a6acc..3c009f6d4a4f12baec689d577cba7070cb76f097 100644 (file)
@@ -55,28 +55,12 @@ static void __init mpc834x_itx_setup_arch(void)
        if (ppc_md.progress)
                ppc_md.progress("mpc834x_itx_setup_arch()", 0);
 
-       np = of_find_node_by_type(NULL, "cpu");
-       if (np != 0) {
-               const unsigned int *fp =
-                       get_property(np, "clock-frequency", NULL);
-               if (fp != 0)
-                       loops_per_jiffy = *fp / HZ;
-               else
-                       loops_per_jiffy = 50000000 / HZ;
-               of_node_put(np);
-       }
 #ifdef CONFIG_PCI
        for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
                add_bridge(np);
 
        ppc_md.pci_exclude_device = mpc83xx_exclude_device;
 #endif
-
-#ifdef  CONFIG_ROOT_NFS
-       ROOT_DEV = Root_NFS;
-#else
-       ROOT_DEV = Root_HDA1;
-#endif
 }
 
 static void __init mpc834x_itx_init_IRQ(void)
@@ -100,10 +84,9 @@ static void __init mpc834x_itx_init_IRQ(void)
  */
 static int __init mpc834x_itx_probe(void)
 {
-       /* We always match for now, eventually we should look at the flat
-          dev tree to ensure this is the board we are suppose to run on
-       */
-       return 1;
+        unsigned long root = of_get_flat_dt_root();
+
+        return of_flat_dt_is_compatible(root, "MPC834xMITX");
 }
 
 define_machine(mpc834x_itx) {
index d2736da76c46bb63ca3a1ef6e394b0bf1157a53d..e5d819166874641f39d44e64d8c95dc56d2e8121 100644 (file)
@@ -125,17 +125,6 @@ static void __init mpc834x_mds_setup_arch(void)
        if (ppc_md.progress)
                ppc_md.progress("mpc834x_mds_setup_arch()", 0);
 
-       np = of_find_node_by_type(NULL, "cpu");
-       if (np != 0) {
-               const unsigned int *fp =
-                       get_property(np, "clock-frequency", NULL);
-               if (fp != 0)
-                       loops_per_jiffy = *fp / HZ;
-               else
-                       loops_per_jiffy = 50000000 / HZ;
-               of_node_put(np);
-       }
-
 #ifdef CONFIG_PCI
        for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
                add_bridge(np);
@@ -144,12 +133,6 @@ static void __init mpc834x_mds_setup_arch(void)
 #endif
 
        mpc834x_usb_cfg();
-
-#ifdef  CONFIG_ROOT_NFS
-       ROOT_DEV = Root_NFS;
-#else
-       ROOT_DEV = Root_HDA1;
-#endif
 }
 
 static void __init mpc834x_mds_init_IRQ(void)
@@ -176,6 +159,9 @@ static int __init mpc834x_rtc_hookup(void)
 {
        struct timespec tv;
 
+       if (!machine_is(mpc834x_mds))
+               return 0;
+
        ppc_md.get_rtc_time = ds1374_get_rtc_time;
        ppc_md.set_rtc_time = ds1374_set_rtc_time;
 
@@ -194,10 +180,9 @@ late_initcall(mpc834x_rtc_hookup);
  */
 static int __init mpc834x_mds_probe(void)
 {
-       /* We always match for now, eventually we should look at the flat
-          dev tree to ensure this is the board we are suppose to run on
-       */
-       return 1;
+        unsigned long root = of_get_flat_dt_root();
+
+        return of_flat_dt_is_compatible(root, "MPC834xMDS");
 }
 
 define_machine(mpc834x_mds) {
diff --git a/arch/powerpc/platforms/83xx/mpc8360e_pb.c b/arch/powerpc/platforms/83xx/mpc8360e_pb.c
deleted file mode 100644 (file)
index ccce2f9..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved.
- *
- * Author: Li Yang <LeoLi@freescale.com>
- *        Yin Olivia <Hong-hua.Yin@freescale.com>
- *
- * Description:
- * MPC8360E MDS PB board specific routines.
- *
- * Changelog:
- * Jun 21, 2006        Initial version
- *
- * 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/stddef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
-#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/initrd.h>
-
-#include <asm/of_device.h>
-#include <asm/of_platform.h>
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
-#include <asm/ipic.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
-#include <asm/qe.h>
-#include <asm/qe_ic.h>
-
-#include "mpc83xx.h"
-
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
-#ifndef CONFIG_PCI
-unsigned long isa_io_base = 0;
-unsigned long isa_mem_base = 0;
-#endif
-
-static u8 *bcsr_regs = NULL;
-
-u8 *get_bcsr(void)
-{
-       return bcsr_regs;
-}
-
-/* ************************************************************************
- *
- * Setup the architecture
- *
- */
-static void __init mpc8360_sys_setup_arch(void)
-{
-       struct device_node *np;
-
-       if (ppc_md.progress)
-               ppc_md.progress("mpc8360_sys_setup_arch()", 0);
-
-       np = of_find_node_by_type(NULL, "cpu");
-       if (np != 0) {
-               const unsigned int *fp =
-                   get_property(np, "clock-frequency", NULL);
-               if (fp != 0)
-                       loops_per_jiffy = *fp / HZ;
-               else
-                       loops_per_jiffy = 50000000 / HZ;
-               of_node_put(np);
-       }
-
-       /* Map BCSR area */
-       np = of_find_node_by_name(NULL, "bcsr");
-       if (np != 0) {
-               struct resource res;
-
-               of_address_to_resource(np, 0, &res);
-               bcsr_regs = ioremap(res.start, res.end - res.start +1);
-               of_node_put(np);
-       }
-
-#ifdef CONFIG_PCI
-       for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-               add_bridge(np);
-       ppc_md.pci_exclude_device = mpc83xx_exclude_device;
-#endif
-
-#ifdef CONFIG_QUICC_ENGINE
-       qe_reset();
-
-       if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
-               par_io_init(np);
-               of_node_put(np);
-
-               for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;)
-                       par_io_of_config(np);
-       }
-
-       if ((np = of_find_compatible_node(NULL, "network", "ucc_geth"))
-                       != NULL){
-               /* Reset the Ethernet PHY */
-               bcsr_regs[9] &= ~0x20;
-               udelay(1000);
-               bcsr_regs[9] |= 0x20;
-               iounmap(bcsr_regs);
-               of_node_put(np);
-       }
-
-#endif                         /* CONFIG_QUICC_ENGINE */
-
-#ifdef CONFIG_BLK_DEV_INITRD
-       if (initrd_start)
-               ROOT_DEV = Root_RAM0;
-       else
-#endif
-#ifdef  CONFIG_ROOT_NFS
-               ROOT_DEV = Root_NFS;
-#else
-               ROOT_DEV = Root_HDA1;
-#endif
-}
-
-static int __init mpc8360_declare_of_platform_devices(void)
-{
-       struct device_node *np;
-
-       for (np = NULL; (np = of_find_compatible_node(np, "network",
-                                       "ucc_geth")) != NULL;) {
-               int ucc_num;
-               char bus_id[BUS_ID_SIZE];
-
-               ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1;
-               snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num);
-               of_platform_device_create(np, bus_id, NULL);
-       }
-
-       return 0;
-}
-device_initcall(mpc8360_declare_of_platform_devices);
-
-static void __init mpc8360_sys_init_IRQ(void)
-{
-
-       struct device_node *np;
-
-       np = of_find_node_by_type(NULL, "ipic");
-       if (!np)
-               return;
-
-       ipic_init(np, 0);
-
-       /* Initialize the default interrupt mapping priorities,
-        * in case the boot rom changed something on us.
-        */
-       ipic_set_default_priority();
-       of_node_put(np);
-
-#ifdef CONFIG_QUICC_ENGINE
-       np = of_find_node_by_type(NULL, "qeic");
-       if (!np)
-               return;
-
-       qe_ic_init(np, 0);
-       of_node_put(np);
-#endif                         /* CONFIG_QUICC_ENGINE */
-}
-
-#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
-extern ulong ds1374_get_rtc_time(void);
-extern int ds1374_set_rtc_time(ulong);
-
-static int __init mpc8360_rtc_hookup(void)
-{
-       struct timespec tv;
-
-       ppc_md.get_rtc_time = ds1374_get_rtc_time;
-       ppc_md.set_rtc_time = ds1374_set_rtc_time;
-
-       tv.tv_nsec = 0;
-       tv.tv_sec = (ppc_md.get_rtc_time) ();
-       do_settimeofday(&tv);
-
-       return 0;
-}
-
-late_initcall(mpc8360_rtc_hookup);
-#endif
-
-/*
- * Called very early, MMU is off, device-tree isn't unflattened
- */
-static int __init mpc8360_sys_probe(void)
-{
-       char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
-                                         "model", NULL);
-       if (model == NULL)
-               return 0;
-       if (strcmp(model, "MPC8360EPB"))
-               return 0;
-
-       DBG("MPC8360EMDS-PB found\n");
-
-       return 1;
-}
-
-define_machine(mpc8360_sys) {
-       .name           = "MPC8360E PB",
-       .probe          = mpc8360_sys_probe,
-       .setup_arch     = mpc8360_sys_setup_arch,
-       .init_IRQ       = mpc8360_sys_init_IRQ,
-       .get_irq        = ipic_get_irq,
-       .restart        = mpc83xx_restart,
-       .time_init      = mpc83xx_time_init,
-       .calibrate_decr = generic_calibrate_decr,
-       .progress       = udbg_progress,
-};
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
new file mode 100644 (file)
index 0000000..526ed09
--- /dev/null
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved.
+ *
+ * Author: Li Yang <LeoLi@freescale.com>
+ *        Yin Olivia <Hong-hua.Yin@freescale.com>
+ *
+ * Description:
+ * MPC8360E MDS board specific routines.
+ *
+ * Changelog:
+ * Jun 21, 2006        Initial version
+ *
+ * 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/stddef.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/reboot.h>
+#include <linux/pci.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/seq_file.h>
+#include <linux/root_dev.h>
+#include <linux/initrd.h>
+
+#include <asm/of_device.h>
+#include <asm/of_platform.h>
+#include <asm/system.h>
+#include <asm/atomic.h>
+#include <asm/time.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/ipic.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <sysdev/fsl_soc.h>
+#include <asm/qe.h>
+#include <asm/qe_ic.h>
+
+#include "mpc83xx.h"
+
+#undef DEBUG
+#ifdef DEBUG
+#define DBG(fmt...) udbg_printf(fmt)
+#else
+#define DBG(fmt...)
+#endif
+
+#ifndef CONFIG_PCI
+unsigned long isa_io_base = 0;
+unsigned long isa_mem_base = 0;
+#endif
+
+static u8 *bcsr_regs = NULL;
+
+/* ************************************************************************
+ *
+ * Setup the architecture
+ *
+ */
+static void __init mpc836x_mds_setup_arch(void)
+{
+       struct device_node *np;
+
+       if (ppc_md.progress)
+               ppc_md.progress("mpc836x_mds_setup_arch()", 0);
+
+       /* Map BCSR area */
+       np = of_find_node_by_name(NULL, "bcsr");
+       if (np != 0) {
+               struct resource res;
+
+               of_address_to_resource(np, 0, &res);
+               bcsr_regs = ioremap(res.start, res.end - res.start +1);
+               of_node_put(np);
+       }
+
+#ifdef CONFIG_PCI
+       for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
+               add_bridge(np);
+       ppc_md.pci_exclude_device = mpc83xx_exclude_device;
+#endif
+
+#ifdef CONFIG_QUICC_ENGINE
+       qe_reset();
+
+       if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
+               par_io_init(np);
+               of_node_put(np);
+
+               for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;)
+                       par_io_of_config(np);
+       }
+
+       if ((np = of_find_compatible_node(NULL, "network", "ucc_geth"))
+                       != NULL){
+               /* Reset the Ethernet PHY */
+               bcsr_regs[9] &= ~0x20;
+               udelay(1000);
+               bcsr_regs[9] |= 0x20;
+               iounmap(bcsr_regs);
+               of_node_put(np);
+       }
+
+#endif                         /* CONFIG_QUICC_ENGINE */
+}
+
+static struct of_device_id mpc836x_ids[] = {
+       { .type = "soc", },
+       { .compatible = "soc", },
+       { .type = "qe", },
+       {},
+};
+
+static int __init mpc836x_declare_of_platform_devices(void)
+{
+       if (!machine_is(mpc836x_mds))
+               return 0;
+
+       /* Publish the QE devices */
+       of_platform_bus_probe(NULL, mpc836x_ids, NULL);
+
+       return 0;
+}
+device_initcall(mpc836x_declare_of_platform_devices);
+
+static void __init mpc836x_mds_init_IRQ(void)
+{
+       struct device_node *np;
+
+       np = of_find_node_by_type(NULL, "ipic");
+       if (!np)
+               return;
+
+       ipic_init(np, 0);
+
+       /* Initialize the default interrupt mapping priorities,
+        * in case the boot rom changed something on us.
+        */
+       ipic_set_default_priority();
+       of_node_put(np);
+
+#ifdef CONFIG_QUICC_ENGINE
+       np = of_find_node_by_type(NULL, "qeic");
+       if (!np)
+               return;
+
+       qe_ic_init(np, 0);
+       of_node_put(np);
+#endif                         /* CONFIG_QUICC_ENGINE */
+}
+
+#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
+extern ulong ds1374_get_rtc_time(void);
+extern int ds1374_set_rtc_time(ulong);
+
+static int __init mpc8360_rtc_hookup(void)
+{
+       struct timespec tv;
+
+       if (!machine_is(mpc836x_mds))
+               return 0;
+
+       ppc_md.get_rtc_time = ds1374_get_rtc_time;
+       ppc_md.set_rtc_time = ds1374_set_rtc_time;
+
+       tv.tv_nsec = 0;
+       tv.tv_sec = (ppc_md.get_rtc_time) ();
+       do_settimeofday(&tv);
+
+       return 0;
+}
+
+late_initcall(mpc8360_rtc_hookup);
+#endif
+
+/*
+ * Called very early, MMU is off, device-tree isn't unflattened
+ */
+static int __init mpc836x_mds_probe(void)
+{
+        unsigned long root = of_get_flat_dt_root();
+
+        return of_flat_dt_is_compatible(root, "MPC836xMDS");
+}
+
+define_machine(mpc836x_mds) {
+       .name           = "MPC836x MDS",
+       .probe          = mpc836x_mds_probe,
+       .setup_arch     = mpc836x_mds_setup_arch,
+       .init_IRQ       = mpc836x_mds_init_IRQ,
+       .get_irq        = ipic_get_irq,
+       .restart        = mpc83xx_restart,
+       .time_init      = mpc83xx_time_init,
+       .calibrate_decr = generic_calibrate_decr,
+       .progress       = udbg_progress,
+};
index 0efdd2f1babe382bfdae1cd4d6f240c7895215fe..eb661ccf2dab6f80098ed485671863c5d2c66090 100644 (file)
@@ -23,12 +23,12 @@ config MPC85xx_CDS
        help
          This option enables support for the MPC85xx CDS board
 
-config MPC8568_MDS
-       bool "Freescale MPC8568 MDS"
+config MPC85xx_MDS
+       bool "Freescale MPC85xx MDS"
        select DEFAULT_UIMAGE
 #      select QUICC_ENGINE
        help
-         This option enables support for the MPC8568 MDS board
+         This option enables support for the MPC85xx MDS board
 
 endchoice
 
@@ -47,7 +47,7 @@ config MPC85xx
        bool
        select PPC_UDBG_16550
        select PPC_INDIRECT_PCI
-       default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS || MPC8568_MDS
+       default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS || MPC85xx_MDS
 
 config PPC_INDIRECT_PCI_BE
        bool
index e40e521816b8147a1d4e508ee137d69360e94f7e..4e63917ada9d4651744f0c08dfd4eeec892b8828 100644 (file)
@@ -5,4 +5,4 @@ obj-$(CONFIG_PPC_85xx)  += misc.o pci.o
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
-obj-$(CONFIG_MPC8568_MDS) += mpc8568_mds.o
+obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
diff --git a/arch/powerpc/platforms/85xx/mpc8568_mds.c b/arch/powerpc/platforms/85xx/mpc8568_mds.c
deleted file mode 100644 (file)
index 0861d11..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (C) Freescale Semicondutor, Inc. 2006-2007. All rights reserved.
- *
- * Author: Andy Fleming <afleming@freescale.com>
- *
- * Based on 83xx/mpc8360e_pb.c by:
- *        Li Yang <LeoLi@freescale.com>
- *        Yin Olivia <Hong-hua.Yin@freescale.com>
- *
- * Description:
- * MPC8568E MDS PB board specific routines.
- *
- * 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/stddef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
-#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/initrd.h>
-#include <linux/module.h>
-#include <linux/fsl_devices.h>
-
-#include <asm/of_device.h>
-#include <asm/of_platform.h>
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
-#include <asm/bootinfo.h>
-#include <asm/pci-bridge.h>
-#include <asm/mpc85xx.h>
-#include <asm/irq.h>
-#include <mm/mmu_decl.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
-#include <asm/qe.h>
-#include <asm/qe_ic.h>
-#include <asm/mpic.h>
-
-#include "mpc85xx.h"
-
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
-#ifndef CONFIG_PCI
-unsigned long isa_io_base = 0;
-unsigned long isa_mem_base = 0;
-#endif
-
-/* ************************************************************************
- *
- * Setup the architecture
- *
- */
-static void __init mpc8568_mds_setup_arch(void)
-{
-       struct device_node *np;
-       static u8 *bcsr_regs = NULL;
-
-
-       if (ppc_md.progress)
-               ppc_md.progress("mpc8568_mds_setup_arch()", 0);
-
-       np = of_find_node_by_type(NULL, "cpu");
-       if (np != NULL) {
-               const unsigned int *fp =
-                   get_property(np, "clock-frequency", NULL);
-               if (fp != NULL)
-                       loops_per_jiffy = *fp / HZ;
-               else
-                       loops_per_jiffy = 50000000 / HZ;
-               of_node_put(np);
-       }
-
-       /* Map BCSR area */
-       np = of_find_node_by_name(NULL, "bcsr");
-       if (np != NULL) {
-               struct resource res;
-
-               of_address_to_resource(np, 0, &res);
-               bcsr_regs = ioremap(res.start, res.end - res.start +1);
-               of_node_put(np);
-       }
-
-#ifdef CONFIG_PCI
-       for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
-               add_bridge(np);
-       }
-       of_node_put(np);
-#endif
-
-#ifdef CONFIG_QUICC_ENGINE
-       if ((np = of_find_node_by_name(NULL, "qe")) != NULL) {
-               qe_reset();
-               of_node_put(np);
-       }
-
-       if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
-               struct device_node *ucc = NULL;
-
-               par_io_init(np);
-               of_node_put(np);
-
-               for ( ;(ucc = of_find_node_by_name(ucc, "ucc")) != NULL;)
-                       par_io_of_config(ucc);
-
-               of_node_put(ucc);
-       }
-
-       if (bcsr_regs) {
-               u8 bcsr_phy;
-
-               /* Reset the Ethernet PHY */
-               bcsr_phy = in_be8(&bcsr_regs[9]);
-               bcsr_phy &= ~0x20;
-               out_be8(&bcsr_regs[9], bcsr_phy);
-
-               udelay(1000);
-
-               bcsr_phy = in_be8(&bcsr_regs[9]);
-               bcsr_phy |= 0x20;
-               out_be8(&bcsr_regs[9], bcsr_phy);
-
-               iounmap(bcsr_regs);
-       }
-
-#endif /* CONFIG_QUICC_ENGINE */
-}
-
-static struct of_device_id mpc8568_ids[] = {
-       { .type = "soc", },
-       { .compatible = "soc", },
-       { .type = "qe", },
-       {},
-};
-
-static int __init mpc8568_publish_devices(void)
-{
-       if (!machine_is(mpc8568_mds))
-               return 0;
-
-       /* Publish the QE devices */
-       of_platform_bus_probe(NULL,mpc8568_ids,NULL);
-
-       return 0;
-}
-device_initcall(mpc8568_publish_devices);
-
-static void __init mpc8568_mds_pic_init(void)
-{
-       struct mpic *mpic;
-       struct resource r;
-       struct device_node *np = NULL;
-
-       np = of_find_node_by_type(NULL, "open-pic");
-       if (!np)
-               return;
-
-       if (of_address_to_resource(np, 0, &r)) {
-               printk(KERN_ERR "Failed to map mpic register space\n");
-               of_node_put(np);
-               return;
-       }
-
-       mpic = mpic_alloc(np, r.start,
-                       MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
-                       4, 0, " OpenPIC  ");
-       BUG_ON(mpic == NULL);
-       of_node_put(np);
-
-       /* Internal Interrupts */
-       mpic_assign_isu(mpic, 0, r.start + 0x10200);
-       mpic_assign_isu(mpic, 1, r.start + 0x10280);
-       mpic_assign_isu(mpic, 2, r.start + 0x10300);
-       mpic_assign_isu(mpic, 3, r.start + 0x10380);
-       mpic_assign_isu(mpic, 4, r.start + 0x10400);
-       mpic_assign_isu(mpic, 5, r.start + 0x10480);
-       mpic_assign_isu(mpic, 6, r.start + 0x10500);
-       mpic_assign_isu(mpic, 7, r.start + 0x10580);
-       mpic_assign_isu(mpic, 8, r.start + 0x10600);
-       mpic_assign_isu(mpic, 9, r.start + 0x10680);
-       mpic_assign_isu(mpic, 10, r.start + 0x10700);
-       mpic_assign_isu(mpic, 11, r.start + 0x10780);
-
-       /* External Interrupts */
-       mpic_assign_isu(mpic, 12, r.start + 0x10000);
-       mpic_assign_isu(mpic, 13, r.start + 0x10080);
-       mpic_assign_isu(mpic, 14, r.start + 0x10100);
-
-       mpic_init(mpic);
-
-
-#ifdef CONFIG_QUICC_ENGINE
-       np = of_find_node_by_type(NULL, "qeic");
-       if (!np)
-               return;
-
-       qe_ic_init(np, 0);
-       of_node_put(np);
-#endif                         /* CONFIG_QUICC_ENGINE */
-}
-
-
-static int __init mpc8568_mds_probe(void)
-{
-       char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
-                                         "model", NULL);
-       if (model == NULL)
-               return 0;
-       if (strcmp(model, "MPC8568EMDS"))
-               return 0;
-
-       DBG("MPC8568EMDS found\n");
-
-       return 1;
-}
-
-
-define_machine(mpc8568_mds) {
-       .name           = "MPC8568E MDS",
-       .probe          = mpc8568_mds_probe,
-       .setup_arch     = mpc8568_mds_setup_arch,
-       .init_IRQ       = mpc8568_mds_pic_init,
-       .get_irq        = mpic_get_irq,
-       .restart        = mpc85xx_restart,
-       .calibrate_decr = generic_calibrate_decr,
-       .progress       = udbg_progress,
-};
index c56fce57621c1cb5c943fbfeb94de26c8c3e1cd8..8ed034aeca5f139acfac1875e6a3a19058b4c8e6 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/kdev_t.h>
 #include <linux/delay.h>
 #include <linux/seq_file.h>
-#include <linux/root_dev.h>
 
 #include <asm/system.h>
 #include <asm/time.h>
@@ -245,12 +244,6 @@ static void __init mpc85xx_ads_setup_arch(void)
                add_bridge(np);
        ppc_md.pci_exclude_device = mpc85xx_exclude_device;
 #endif
-
-#ifdef  CONFIG_ROOT_NFS
-       ROOT_DEV = Root_NFS;
-#else
-       ROOT_DEV = Root_HDA1;
-#endif
 }
 
 static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
@@ -279,10 +272,9 @@ static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
  */
 static int __init mpc85xx_ads_probe(void)
 {
-       /* We always match for now, eventually we should look at the flat
-          dev tree to ensure this is the board we are suppose to run on
-       */
-       return 1;
+        unsigned long root = of_get_flat_dt_root();
+
+        return of_flat_dt_is_compatible(root, "MPC85xxADS");
 }
 
 define_machine(mpc85xx_ads) {
index abc0aca6de4052760ce9b6204eec9604c0a3cef1..4232686be441b4e534777c658e2f352223546114 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/seq_file.h>
-#include <linux/root_dev.h>
 #include <linux/initrd.h>
 #include <linux/module.h>
 #include <linux/fsl_devices.h>
@@ -263,12 +262,6 @@ static void __init mpc85xx_cds_setup_arch(void)
        ppc_md.pcibios_fixup = mpc85xx_cds_pcibios_fixup;
        ppc_md.pci_exclude_device = mpc85xx_exclude_device;
 #endif
-
-#ifdef  CONFIG_ROOT_NFS
-       ROOT_DEV = Root_NFS;
-#else
-       ROOT_DEV = Root_HDA1;
-#endif
 }
 
 static void mpc85xx_cds_show_cpuinfo(struct seq_file *m)
@@ -298,11 +291,9 @@ static void mpc85xx_cds_show_cpuinfo(struct seq_file *m)
  */
 static int __init mpc85xx_cds_probe(void)
 {
-       /* We always match for now, eventually we should look at
-        * the flat dev tree to ensure this is the board we are
-        * supposed to run on
-        */
-       return 1;
+        unsigned long root = of_get_flat_dt_root();
+
+        return of_flat_dt_is_compatible(root, "MPC85xxCDS");
 }
 
 define_machine(mpc85xx_cds) {
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
new file mode 100644 (file)
index 0000000..81144d2
--- /dev/null
@@ -0,0 +1,234 @@
+/*
+ * Copyright (C) Freescale Semicondutor, Inc. 2006-2007. All rights reserved.
+ *
+ * Author: Andy Fleming <afleming@freescale.com>
+ *
+ * Based on 83xx/mpc8360e_pb.c by:
+ *        Li Yang <LeoLi@freescale.com>
+ *        Yin Olivia <Hong-hua.Yin@freescale.com>
+ *
+ * Description:
+ * MPC85xx MDS board specific routines.
+ *
+ * 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/stddef.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/reboot.h>
+#include <linux/pci.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/seq_file.h>
+#include <linux/initrd.h>
+#include <linux/module.h>
+#include <linux/fsl_devices.h>
+
+#include <asm/of_device.h>
+#include <asm/of_platform.h>
+#include <asm/system.h>
+#include <asm/atomic.h>
+#include <asm/time.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/bootinfo.h>
+#include <asm/pci-bridge.h>
+#include <asm/mpc85xx.h>
+#include <asm/irq.h>
+#include <mm/mmu_decl.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <sysdev/fsl_soc.h>
+#include <asm/qe.h>
+#include <asm/qe_ic.h>
+#include <asm/mpic.h>
+
+#include "mpc85xx.h"
+
+#undef DEBUG
+#ifdef DEBUG
+#define DBG(fmt...) udbg_printf(fmt)
+#else
+#define DBG(fmt...)
+#endif
+
+#ifndef CONFIG_PCI
+unsigned long isa_io_base = 0;
+unsigned long isa_mem_base = 0;
+#endif
+
+/* ************************************************************************
+ *
+ * Setup the architecture
+ *
+ */
+static void __init mpc85xx_mds_setup_arch(void)
+{
+       struct device_node *np;
+       static u8 *bcsr_regs = NULL;
+
+       if (ppc_md.progress)
+               ppc_md.progress("mpc85xx_mds_setup_arch()", 0);
+
+       np = of_find_node_by_type(NULL, "cpu");
+       if (np != NULL) {
+               const unsigned int *fp =
+                   get_property(np, "clock-frequency", NULL);
+               if (fp != NULL)
+                       loops_per_jiffy = *fp / HZ;
+               else
+                       loops_per_jiffy = 50000000 / HZ;
+               of_node_put(np);
+       }
+
+       /* Map BCSR area */
+       np = of_find_node_by_name(NULL, "bcsr");
+       if (np != NULL) {
+               struct resource res;
+
+               of_address_to_resource(np, 0, &res);
+               bcsr_regs = ioremap(res.start, res.end - res.start +1);
+               of_node_put(np);
+       }
+
+#ifdef CONFIG_PCI
+       for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
+               add_bridge(np);
+       }
+       of_node_put(np);
+#endif
+
+#ifdef CONFIG_QUICC_ENGINE
+       if ((np = of_find_node_by_name(NULL, "qe")) != NULL) {
+               qe_reset();
+               of_node_put(np);
+       }
+
+       if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
+               struct device_node *ucc = NULL;
+
+               par_io_init(np);
+               of_node_put(np);
+
+               for ( ;(ucc = of_find_node_by_name(ucc, "ucc")) != NULL;)
+                       par_io_of_config(ucc);
+
+               of_node_put(ucc);
+       }
+
+       if (bcsr_regs) {
+               u8 bcsr_phy;
+
+               /* Reset the Ethernet PHY */
+               bcsr_phy = in_be8(&bcsr_regs[9]);
+               bcsr_phy &= ~0x20;
+               out_be8(&bcsr_regs[9], bcsr_phy);
+
+               udelay(1000);
+
+               bcsr_phy = in_be8(&bcsr_regs[9]);
+               bcsr_phy |= 0x20;
+               out_be8(&bcsr_regs[9], bcsr_phy);
+
+               iounmap(bcsr_regs);
+       }
+
+#endif /* CONFIG_QUICC_ENGINE */
+}
+
+static struct of_device_id mpc85xx_ids[] = {
+       { .type = "soc", },
+       { .compatible = "soc", },
+       { .type = "qe", },
+       {},
+};
+
+static int __init mpc85xx_publish_devices(void)
+{
+       if (!machine_is(mpc85xx_mds))
+               return 0;
+
+       /* Publish the QE devices */
+       of_platform_bus_probe(NULL,mpc85xx_ids,NULL);
+
+       return 0;
+}
+device_initcall(mpc85xx_publish_devices);
+
+static void __init mpc85xx_mds_pic_init(void)
+{
+       struct mpic *mpic;
+       struct resource r;
+       struct device_node *np = NULL;
+
+       np = of_find_node_by_type(NULL, "open-pic");
+       if (!np)
+               return;
+
+       if (of_address_to_resource(np, 0, &r)) {
+               printk(KERN_ERR "Failed to map mpic register space\n");
+               of_node_put(np);
+               return;
+       }
+
+       mpic = mpic_alloc(np, r.start,
+                       MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
+                       4, 0, " OpenPIC  ");
+       BUG_ON(mpic == NULL);
+       of_node_put(np);
+
+       /* Internal Interrupts */
+       mpic_assign_isu(mpic, 0, r.start + 0x10200);
+       mpic_assign_isu(mpic, 1, r.start + 0x10280);
+       mpic_assign_isu(mpic, 2, r.start + 0x10300);
+       mpic_assign_isu(mpic, 3, r.start + 0x10380);
+       mpic_assign_isu(mpic, 4, r.start + 0x10400);
+       mpic_assign_isu(mpic, 5, r.start + 0x10480);
+       mpic_assign_isu(mpic, 6, r.start + 0x10500);
+       mpic_assign_isu(mpic, 7, r.start + 0x10580);
+       mpic_assign_isu(mpic, 8, r.start + 0x10600);
+       mpic_assign_isu(mpic, 9, r.start + 0x10680);
+       mpic_assign_isu(mpic, 10, r.start + 0x10700);
+       mpic_assign_isu(mpic, 11, r.start + 0x10780);
+
+       /* External Interrupts */
+       mpic_assign_isu(mpic, 12, r.start + 0x10000);
+       mpic_assign_isu(mpic, 13, r.start + 0x10080);
+       mpic_assign_isu(mpic, 14, r.start + 0x10100);
+
+       mpic_init(mpic);
+
+#ifdef CONFIG_QUICC_ENGINE
+       np = of_find_node_by_type(NULL, "qeic");
+       if (!np)
+               return;
+
+       qe_ic_init(np, 0);
+       of_node_put(np);
+#endif                         /* CONFIG_QUICC_ENGINE */
+}
+
+static int __init mpc85xx_mds_probe(void)
+{
+        unsigned long root = of_get_flat_dt_root();
+
+        return of_flat_dt_is_compatible(root, "MPC85xxMDS");
+}
+
+define_machine(mpc85xx_mds) {
+       .name           = "MPC85xx MDS",
+       .probe          = mpc85xx_mds_probe,
+       .setup_arch     = mpc85xx_mds_setup_arch,
+       .init_IRQ       = mpc85xx_mds_pic_init,
+       .get_irq        = mpic_get_irq,
+       .restart        = mpc85xx_restart,
+       .calibrate_decr = generic_calibrate_decr,
+       .progress       = udbg_progress,
+};
index f4dd5f2f8a28f262911afba39eb20016784432ab..f42f801cf84ed6af33e7ed21b3110a8a93d0629f 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/kdev_t.h>
 #include <linux/delay.h>
 #include <linux/seq_file.h>
-#include <linux/root_dev.h>
 
 #include <asm/system.h>
 #include <asm/time.h>
@@ -120,6 +119,8 @@ mpc86xx_hpcn_init_irq(void)
        DBG("mpc86xxhpcn: cascade mapped to irq %d\n", cascade_irq);
 
        i8259_init(cascade_node, 0);
+       of_node_put(cascade_node);
+
        set_irq_chained_handler(cascade_irq, mpc86xx_8259_cascade);
 #endif
 }
@@ -365,12 +366,6 @@ mpc86xx_hpcn_setup_arch(void)
 
        printk("MPC86xx HPCN board from Freescale Semiconductor\n");
 
-#ifdef  CONFIG_ROOT_NFS
-       ROOT_DEV = Root_NFS;
-#else
-       ROOT_DEV = Root_HDA1;
-#endif
-
 #ifdef CONFIG_SMP
        mpc86xx_smp_init();
 #endif
index 3baf658ac543dfa78c16f861c0baa74413505619..f4f82520dc4f59aa1d0f35d387f43637185251d8 100644 (file)
@@ -1,9 +1,8 @@
 obj-y                          += interrupt.o iommu.o setup.o \
                                   htab.o beat.o pci.o \
-                                  scc_epci.o hvCall.o
+                                  scc_epci.o scc_uhc.o hvCall.o
 
 obj-$(CONFIG_SMP)              += smp.o
 obj-$(CONFIG_PPC_UDBG_BEAT)    += udbg_beat.o
-obj-$(CONFIG_USB)              += scc_uhc.o
 obj-$(CONFIG_HAS_TXX9_SERIAL)  += scc_sio.o
 obj-$(CONFIG_SPU_BASE)         += spu_priv1.o
index 1de63acfda873ab8b893f88421eed7c4fa8135db..5f4d0d9332388e1e9455f5a0a7a6c1c49294a7d4 100644 (file)
@@ -137,10 +137,12 @@ static int celleb_check_legacy_ioport(unsigned int baseport)
        return -ENODEV;
 }
 
+#ifdef CONFIG_KEXEC
 static void celleb_kexec_cpu_down(int crash, int secondary)
 {
        beatic_deinit_IRQ();
 }
+#endif
 
 static struct of_device_id celleb_bus_ids[] = {
        { .type = "scc", },
index 4be3943d1c0dca360c13cc144969f3c459b8fdeb..d270a1e374d5981662e788f10dfd9b7f07cd2aac 100644 (file)
@@ -62,4 +62,14 @@ config PS3_PS3AV
          This support is required for graphics and sound. In
          general, all users will say Y or M.
 
+config PS3_SYS_MANAGER
+       bool "PS3 System Manager driver"
+       select PS3_VUART
+       default y
+       help
+         Include support for the PS3 System Manager.
+
+         This support is required for system control.  In
+         general, all users will say Y.
+
 endmenu
index 13d669a8ecae6d00e25fc816d163e711db8cb7f7..ac5df9688dcb9685e06434e901b0b200498dba84 100644 (file)
 #define DBG(fmt...) do{if(0)printk(fmt);}while(0)
 #endif
 
+#if !defined(CONFIG_SMP)
+static void smp_send_stop(void) {}
+#endif
+
 int ps3_get_firmware_version(union ps3_firmware_version *v)
 {
        int result = lv1_get_version_info(&v->raw);
@@ -66,22 +70,35 @@ static void ps3_power_save(void)
        lv1_pause(0);
 }
 
+static void ps3_restart(char *cmd)
+{
+       DBG("%s:%d cmd '%s'\n", __func__, __LINE__, cmd);
+
+       smp_send_stop();
+       ps3_sys_manager_restart(); /* never returns */
+}
+
+static void ps3_power_off(void)
+{
+       DBG("%s:%d\n", __func__, __LINE__);
+
+       smp_send_stop();
+       ps3_sys_manager_power_off(); /* never returns */
+}
+
 static void ps3_panic(char *str)
 {
        DBG("%s:%d %s\n", __func__, __LINE__, str);
 
-#ifdef CONFIG_SMP
        smp_send_stop();
-#endif
        printk("\n");
        printk("   System does not reboot automatically.\n");
        printk("   Please press POWER button.\n");
        printk("\n");
 
-       for (;;) ;
+       while(1);
 }
 
-
 static void prealloc(struct ps3_prealloc *p)
 {
        if (!p->size)
@@ -219,6 +236,8 @@ define_machine(ps3) {
        .get_rtc_time                   = ps3_get_rtc_time,
        .calibrate_decr                 = ps3_calibrate_decr,
        .progress                       = ps3_progress,
+       .restart                        = ps3_restart,
+       .power_off                      = ps3_power_off,
 #if defined(CONFIG_KEXEC)
        .kexec_cpu_down                 = ps3_kexec_cpu_down,
        .machine_kexec                  = ps3_machine_kexec,
index dc0583bdbc637ec769e817cab5ad68f8216f37ca..2dfd05095a25fac98734f871a9188bba1fbaa1bc 100644 (file)
@@ -4,7 +4,7 @@ endif
 
 obj-y                  := pci.o lpar.o hvCall.o nvram.o reconfig.o \
                           setup.o iommu.o ras.o rtasd.o pci_dlpar.o \
-                          firmware.o
+                          firmware.o power.o
 obj-$(CONFIG_SMP)      += smp.o
 obj-$(CONFIG_XICS)     += xics.o
 obj-$(CONFIG_SCANLOG)  += scanlog.o
diff --git a/arch/powerpc/platforms/pseries/power.c b/arch/powerpc/platforms/pseries/power.c
new file mode 100644 (file)
index 0000000..2624b71
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ *  Interface for power-management for ppc64 compliant platform
+ *
+ *  Manish Ahuja <mahuja@us.ibm.com>
+ *
+ *  Feb 2007
+ *
+ *  Copyright (C) 2007 IBM Corporation.
+ *
+ *  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.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/kobject.h>
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+
+unsigned long rtas_poweron_auto; /* default and normal state is 0 */
+
+static ssize_t auto_poweron_show(struct subsystem *subsys, char *buf)
+{
+        return sprintf(buf, "%lu\n", rtas_poweron_auto);
+}
+
+static ssize_t
+auto_poweron_store(struct subsystem *subsys, const char *buf, size_t n)
+{
+       int ret;
+       unsigned long ups_restart;
+       ret = sscanf(buf, "%lu", &ups_restart);
+
+       if ((ret == 1) && ((ups_restart == 1) || (ups_restart == 0))){
+               rtas_poweron_auto = ups_restart;
+               return n;
+       }
+       return -EINVAL;
+}
+
+static struct subsys_attribute auto_poweron_attr = {
+        .attr   = {
+                .name = __stringify(auto_poweron),
+                .mode = 0644,
+        },
+        .show   = auto_poweron_show,
+        .store  = auto_poweron_store,
+};
+
+#ifndef CONFIG_PM
+decl_subsys(power,NULL,NULL);
+
+static struct attribute *g[] = {
+        &auto_poweron_attr.attr,
+        NULL,
+};
+
+static struct attribute_group attr_group = {
+        .attrs = g,
+};
+
+static int __init pm_init(void)
+{
+        int error = subsystem_register(&power_subsys);
+        if (!error)
+                error = sysfs_create_group(&power_subsys.kset.kobj,&attr_group);
+        return error;
+}
+core_initcall(pm_init);
+#else
+extern struct subsystem power_subsys;
+
+static int __init apo_pm_init(void)
+{
+       return (subsys_create_file(&power_subsys, &auto_poweron_attr));
+}
+__initcall(apo_pm_init);
+#endif
index b43f1397a5b63eaa49dc9f3b90c8ce3579cf823f..22bc019897495b3a733b162ef8e8f7195473ee10 100644 (file)
@@ -29,8 +29,11 @@ static inline smp_init_pseries_xics(void) { };
 extern void setup_kexec_cpu_down_xics(void);
 extern void setup_kexec_cpu_down_mpic(void);
 #else
-static inline setup_kexec_cpu_down_xics(void) { };
-static inline setup_kexec_cpu_down_mpic(void) { };
+static inline void setup_kexec_cpu_down_xics(void) { }
+static inline void setup_kexec_cpu_down_mpic(void) { }
 #endif
 
+/* Poweron flag used for enabling auto ups restart */
+extern unsigned long rtas_poweron_auto;
+
 #endif /* _PSERIES_PSERIES_H */
index 435a045965261fec6bff86d23bdfe8c5212f6440..34aff47b1f551c670eca377eeb148a8f618dc946 100644 (file)
@@ -486,6 +486,34 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus)
        return PCI_PROBE_NORMAL;
 }
 
+/**
+ * pSeries_power_off - tell firmware about how to power off the system.
+ *
+ * This function calls either the power-off rtas token in normal cases
+ * or the ibm,power-off-ups token (if present & requested) in case of
+ * a power failure. If power-off token is used, power on will only be
+ * possible with power button press. If ibm,power-off-ups token is used
+ * it will allow auto poweron after power is restored.
+ */
+void pSeries_power_off(void)
+{
+       int rc;
+       int rtas_poweroff_ups_token = rtas_token("ibm,power-off-ups");
+
+       if (rtas_flash_term_hook)
+               rtas_flash_term_hook(SYS_POWER_OFF);
+
+       if (rtas_poweron_auto == 0 ||
+               rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) {
+               rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1);
+               printk(KERN_INFO "RTAS power-off returned %d\n", rc);
+       } else {
+               rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL);
+               printk(KERN_INFO "RTAS ibm,power-off-ups returned %d\n", rc);
+       }
+       for (;;);
+}
+
 define_machine(pseries) {
        .name                   = "pSeries",
        .probe                  = pSeries_probe,
@@ -496,7 +524,7 @@ define_machine(pseries) {
        .pcibios_fixup          = pSeries_final_fixup,
        .pci_probe_mode         = pSeries_pci_probe_mode,
        .restart                = rtas_restart,
-       .power_off              = rtas_power_off,
+       .power_off              = pSeries_power_off,
        .halt                   = rtas_halt,
        .panic                  = rtas_os_term,
        .get_boot_time          = rtas_get_boot_time,
index 85dcdf178415fe19ae150e1a2498c4965a183019..26ca3ffbc1dee7c12df2cf31bd002d1c937bbc45 100644 (file)
@@ -7,6 +7,7 @@ obj-$(CONFIG_PPC_INDIRECT_PCI)  += indirect_pci.o
 obj-$(CONFIG_PPC_MPC106)       += grackle.o
 obj-$(CONFIG_PPC_DCR)          += dcr.o
 obj-$(CONFIG_PPC_DCR_NATIVE)   += dcr-low.o
+obj-$(CONFIG_PPC_PMI)          += pmi.o
 obj-$(CONFIG_U3_DART)          += dart_iommu.o
 obj-$(CONFIG_MMIO_NVRAM)       += mmio_nvram.o
 obj-$(CONFIG_FSL_SOC)          += fsl_soc.o
index 34161bc5a02f6384e7baf33e24de303325025872..d20f02927f7200a83812ad929c9317241718f7b3 100644 (file)
@@ -233,14 +233,7 @@ static int __init gfar_of_init(void)
                        goto err;
                }
 
-               mac_addr = get_property(np, "local-mac-address", NULL);
-               if (mac_addr == NULL)
-                       mac_addr = get_property(np, "mac-address", NULL);
-               if (mac_addr == NULL) {
-                       /* Obsolete */
-                       mac_addr = get_property(np, "address", NULL);
-               }
-
+               mac_addr = of_get_mac_address(np);
                if (mac_addr)
                        memcpy(gfar_data.mac_addr, mac_addr, 6);
 
@@ -646,8 +639,9 @@ static int __init fs_enet_of_init(void)
                        goto unreg;
                }
 
-               mac_addr = get_property(np, "mac-address", NULL);
-               memcpy(fs_enet_data.macaddr, mac_addr, 6);
+               mac_addr = of_get_mac_address(np);
+               if (mac_addr)
+                       memcpy(fs_enet_data.macaddr, mac_addr, 6);
 
                ph = get_property(np, "phy-handle", NULL);
                phy = of_find_node_by_phandle(*ph);
@@ -931,8 +925,9 @@ static int __init fs_enet_of_init(void)
                        goto err;
                r[0].name = enet_regs;
 
-               mac_addr = (void *)get_property(np, "mac-address", NULL);
-               memcpy(fs_enet_data.macaddr, mac_addr, 6);
+               mac_addr = of_get_mac_address(np);
+               if (mac_addr)
+                       memcpy(fs_enet_data.macaddr, mac_addr, 6);
 
                ph = (phandle *) get_property(np, "phy-handle", NULL);
                if (ph != NULL)
index 4e54a09dd33b1fc0c197ad77fa4c47123ba6b0a5..bcfb900481f8fdb6180dc474ed991d1dc7dd164d 100644 (file)
@@ -1370,7 +1370,7 @@ void mpic_request_ipis(void)
                        printk(KERN_ERR "Failed to map IPI %d\n", i);
                        break;
                }
-               request_irq(vipi, mpic_ipi_action, IRQF_DISABLED,
+               request_irq(vipi, mpic_ipi_action, IRQF_DISABLED|IRQF_PERCPU,
                            ipi_names[i], mpic);
        }
 }
diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c
new file mode 100644 (file)
index 0000000..a528201
--- /dev/null
@@ -0,0 +1,305 @@
+/*
+ * pmi driver
+ *
+ * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
+ *
+ * PMI (Platform Management Interrupt) is a way to communicate
+ * with the BMC (Baseboard Management Controller) via interrupts.
+ * Unlike IPMI it is bidirectional and has a low latency.
+ *
+ * Author: Christian Krafft <krafft@de.ibm.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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/interrupt.h>
+#include <linux/completion.h>
+#include <linux/spinlock.h>
+#include <linux/workqueue.h>
+
+#include <asm/of_device.h>
+#include <asm/of_platform.h>
+#include <asm/io.h>
+#include <asm/pmi.h>
+
+
+struct pmi_data {
+       struct list_head        handler;
+       spinlock_t              handler_spinlock;
+       spinlock_t              pmi_spinlock;
+       struct mutex            msg_mutex;
+       pmi_message_t           msg;
+       struct completion       *completion;
+       struct of_device        *dev;
+       int                     irq;
+       u8 __iomem              *pmi_reg;
+       struct work_struct      work;
+};
+
+
+
+static void __iomem *of_iomap(struct device_node *np)
+{
+       struct resource res;
+
+       if (of_address_to_resource(np, 0, &res))
+               return NULL;
+
+       pr_debug("Resource start: 0x%lx\n", res.start);
+       pr_debug("Resource end: 0x%lx\n", res.end);
+
+       return ioremap(res.start, 1 + res.end - res.start);
+}
+
+
+static int pmi_irq_handler(int irq, void *dev_id)
+{
+       struct pmi_data *data;
+       u8 type;
+       int rc;
+
+       data = dev_id;
+
+       spin_lock(&data->pmi_spinlock);
+
+       type = ioread8(data->pmi_reg + PMI_READ_TYPE);
+       pr_debug("pmi: got message of type %d\n", type);
+
+       if (type & PMI_ACK && !data->completion) {
+               printk(KERN_WARNING "pmi: got unexpected ACK message.\n");
+               rc = -EIO;
+               goto unlock;
+       }
+
+       if (data->completion && !(type & PMI_ACK)) {
+               printk(KERN_WARNING "pmi: expected ACK, but got %d\n", type);
+               rc = -EIO;
+               goto unlock;
+       }
+
+       data->msg.type = type;
+       data->msg.data0 = ioread8(data->pmi_reg + PMI_READ_DATA0);
+       data->msg.data1 = ioread8(data->pmi_reg + PMI_READ_DATA1);
+       data->msg.data2 = ioread8(data->pmi_reg + PMI_READ_DATA2);
+       rc = 0;
+unlock:
+       spin_unlock(&data->pmi_spinlock);
+
+       if (rc == -EIO) {
+               rc = IRQ_HANDLED;
+               goto out;
+       }
+
+       if (data->msg.type & PMI_ACK) {
+               complete(data->completion);
+               rc = IRQ_HANDLED;
+               goto out;
+       }
+
+       schedule_work(&data->work);
+
+       rc = IRQ_HANDLED;
+out:
+       return rc;
+}
+
+
+static struct of_device_id pmi_match[] = {
+       { .type = "ibm,pmi", .name = "ibm,pmi" },
+       {},
+};
+
+MODULE_DEVICE_TABLE(of, pmi_match);
+
+static void pmi_notify_handlers(struct work_struct *work)
+{
+       struct pmi_data *data;
+       struct pmi_handler *handler;
+
+       data = container_of(work, struct pmi_data, work);
+
+       spin_lock(&data->handler_spinlock);
+       list_for_each_entry(handler, &data->handler, node) {
+               pr_debug(KERN_INFO "pmi: notifying handler %p\n", handler);
+               if (handler->type == data->msg.type)
+                       handler->handle_pmi_message(data->dev, data->msg);
+       }
+       spin_unlock(&data->handler_spinlock);
+}
+
+static int pmi_of_probe(struct of_device *dev,
+                       const struct of_device_id *match)
+{
+       struct device_node *np = dev->node;
+       struct pmi_data *data;
+       int rc;
+
+       data = kzalloc(sizeof(struct pmi_data), GFP_KERNEL);
+       if (!data) {
+               printk(KERN_ERR "pmi: could not allocate memory.\n");
+               rc = -ENOMEM;
+               goto out;
+       }
+
+       data->pmi_reg = of_iomap(np);
+       if (!data->pmi_reg) {
+               printk(KERN_ERR "pmi: invalid register address.\n");
+               rc = -EFAULT;
+               goto error_cleanup_data;
+       }
+
+       INIT_LIST_HEAD(&data->handler);
+
+       mutex_init(&data->msg_mutex);
+       spin_lock_init(&data->pmi_spinlock);
+       spin_lock_init(&data->handler_spinlock);
+
+       INIT_WORK(&data->work, pmi_notify_handlers);
+
+       dev->dev.driver_data = data;
+       data->dev = dev;
+
+       data->irq = irq_of_parse_and_map(np, 0);
+       if (data->irq == NO_IRQ) {
+               printk(KERN_ERR "pmi: invalid interrupt.\n");
+               rc = -EFAULT;
+               goto error_cleanup_iomap;
+       }
+
+       rc = request_irq(data->irq, pmi_irq_handler, 0, "pmi", data);
+       if (rc) {
+               printk(KERN_ERR "pmi: can't request IRQ %d: returned %d\n",
+                               data->irq, rc);
+               goto error_cleanup_iomap;
+       }
+
+       printk(KERN_INFO "pmi: found pmi device at addr %p.\n", data->pmi_reg);
+
+       goto out;
+
+error_cleanup_iomap:
+       iounmap(data->pmi_reg);
+
+error_cleanup_data:
+       kfree(data);
+
+out:
+       return rc;
+}
+
+static int pmi_of_remove(struct of_device *dev)
+{
+       struct pmi_data *data;
+       struct pmi_handler *handler, *tmp;
+
+       data = dev->dev.driver_data;
+
+       free_irq(data->irq, data);
+       iounmap(data->pmi_reg);
+
+       spin_lock(&data->handler_spinlock);
+
+       list_for_each_entry_safe(handler, tmp, &data->handler, node)
+               list_del(&handler->node);
+
+       spin_unlock(&data->handler_spinlock);
+
+       kfree(dev->dev.driver_data);
+
+       return 0;
+}
+
+static struct of_platform_driver pmi_of_platform_driver = {
+       .name           = "pmi",
+       .match_table    = pmi_match,
+       .probe          = pmi_of_probe,
+       .remove         = pmi_of_remove
+};
+
+static int __init pmi_module_init(void)
+{
+       return of_register_platform_driver(&pmi_of_platform_driver);
+}
+module_init(pmi_module_init);
+
+static void __exit pmi_module_exit(void)
+{
+       of_unregister_platform_driver(&pmi_of_platform_driver);
+}
+module_exit(pmi_module_exit);
+
+void pmi_send_message(struct of_device *device, pmi_message_t msg)
+{
+       struct pmi_data *data;
+       unsigned long flags;
+       DECLARE_COMPLETION_ONSTACK(completion);
+
+       data = device->dev.driver_data;
+
+       mutex_lock(&data->msg_mutex);
+
+       data->msg = msg;
+       pr_debug("pmi_send_message: msg is %08x\n", *(u32*)&msg);
+
+       data->completion = &completion;
+
+       spin_lock_irqsave(&data->pmi_spinlock, flags);
+       iowrite8(msg.data0, data->pmi_reg + PMI_WRITE_DATA0);
+       iowrite8(msg.data1, data->pmi_reg + PMI_WRITE_DATA1);
+       iowrite8(msg.data2, data->pmi_reg + PMI_WRITE_DATA2);
+       iowrite8(msg.type, data->pmi_reg + PMI_WRITE_TYPE);
+       spin_unlock_irqrestore(&data->pmi_spinlock, flags);
+
+       pr_debug("pmi_send_message: wait for completion\n");
+
+       wait_for_completion_interruptible_timeout(data->completion,
+                                                 PMI_TIMEOUT);
+
+       data->completion = NULL;
+
+       mutex_unlock(&data->msg_mutex);
+}
+EXPORT_SYMBOL_GPL(pmi_send_message);
+
+void pmi_register_handler(struct of_device *device,
+                         struct pmi_handler *handler)
+{
+       struct pmi_data *data;
+       data = device->dev.driver_data;
+
+       spin_lock(&data->handler_spinlock);
+       list_add_tail(&handler->node, &data->handler);
+       spin_unlock(&data->handler_spinlock);
+}
+EXPORT_SYMBOL_GPL(pmi_register_handler);
+
+void pmi_unregister_handler(struct of_device *device,
+                           struct pmi_handler *handler)
+{
+       struct pmi_data *data;
+
+       pr_debug("pmi: unregistering handler %p\n", handler);
+
+       data = device->dev.driver_data;
+
+       spin_lock(&data->handler_spinlock);
+       list_del(&handler->node);
+       spin_unlock(&data->handler_spinlock);
+}
+EXPORT_SYMBOL_GPL(pmi_unregister_handler);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");
+MODULE_DESCRIPTION("IBM Platform Management Interrupt driver");
index e657559bea93fdec3f80fad8e6dbdefec4ce1c5a..a457ac1c663924b030c931cfd7a28c84801b2757 100644 (file)
@@ -1,13 +1,12 @@
 /*
- * arch/powerpc/sysdev/qe_lib/ucc_fast.c
- *
- * QE UCC Fast API Set - UCC Fast specific routines implementations.
- *
  * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved.
  *
  * Authors:    Shlomi Gridish <gridish@freescale.com>
  *             Li Yang <leoli@freescale.com>
  *
+ * Description:
+ * QE UCC Fast API Set - UCC Fast specific routines implementations.
+ *
  * 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
 #include <asm/ucc.h>
 #include <asm/ucc_fast.h>
 
-#define uccf_printk(level, format, arg...) \
-       printk(level format "\n", ## arg)
-
-#define uccf_dbg(format, arg...) \
-       uccf_printk(KERN_DEBUG , format , ## arg)
-#define uccf_err(format, arg...) \
-       uccf_printk(KERN_ERR , format , ## arg)
-#define uccf_info(format, arg...) \
-       uccf_printk(KERN_INFO , format , ## arg)
-#define uccf_warn(format, arg...) \
-       uccf_printk(KERN_WARNING , format , ## arg)
-
-#ifdef UCCF_VERBOSE_DEBUG
-#define uccf_vdbg uccf_dbg
-#else
-#define uccf_vdbg(fmt, args...) do { } while (0)
-#endif                         /* UCCF_VERBOSE_DEBUG */
-
 void ucc_fast_dump_regs(struct ucc_fast_private * uccf)
 {
-       uccf_info("UCC%d Fast registers:", uccf->uf_info->ucc_num);
-       uccf_info("Base address: 0x%08x", (u32) uccf->uf_regs);
+       printk(KERN_INFO "UCC%d Fast registers:", uccf->uf_info->ucc_num);
+       printk(KERN_INFO "Base address: 0x%08x", (u32) uccf->uf_regs);
 
-       uccf_info("gumr  : addr - 0x%08x, val - 0x%08x",
+       printk(KERN_INFO "gumr  : addr - 0x%08x, val - 0x%08x",
                  (u32) & uccf->uf_regs->gumr, in_be32(&uccf->uf_regs->gumr));
-       uccf_info("upsmr : addr - 0x%08x, val - 0x%08x",
+       printk(KERN_INFO "upsmr : addr - 0x%08x, val - 0x%08x",
                  (u32) & uccf->uf_regs->upsmr, in_be32(&uccf->uf_regs->upsmr));
-       uccf_info("utodr : addr - 0x%08x, val - 0x%04x",
+       printk(KERN_INFO "utodr : addr - 0x%08x, val - 0x%04x",
                  (u32) & uccf->uf_regs->utodr, in_be16(&uccf->uf_regs->utodr));
-       uccf_info("udsr  : addr - 0x%08x, val - 0x%04x",
+       printk(KERN_INFO "udsr  : addr - 0x%08x, val - 0x%04x",
                  (u32) & uccf->uf_regs->udsr, in_be16(&uccf->uf_regs->udsr));
-       uccf_info("ucce  : addr - 0x%08x, val - 0x%08x",
+       printk(KERN_INFO "ucce  : addr - 0x%08x, val - 0x%08x",
                  (u32) & uccf->uf_regs->ucce, in_be32(&uccf->uf_regs->ucce));
-       uccf_info("uccm  : addr - 0x%08x, val - 0x%08x",
+       printk(KERN_INFO "uccm  : addr - 0x%08x, val - 0x%08x",
                  (u32) & uccf->uf_regs->uccm, in_be32(&uccf->uf_regs->uccm));
-       uccf_info("uccs  : addr - 0x%08x, val - 0x%02x",
+       printk(KERN_INFO "uccs  : addr - 0x%08x, val - 0x%02x",
                  (u32) & uccf->uf_regs->uccs, uccf->uf_regs->uccs);
-       uccf_info("urfb  : addr - 0x%08x, val - 0x%08x",
+       printk(KERN_INFO "urfb  : addr - 0x%08x, val - 0x%08x",
                  (u32) & uccf->uf_regs->urfb, in_be32(&uccf->uf_regs->urfb));
-       uccf_info("urfs  : addr - 0x%08x, val - 0x%04x",
+       printk(KERN_INFO "urfs  : addr - 0x%08x, val - 0x%04x",
                  (u32) & uccf->uf_regs->urfs, in_be16(&uccf->uf_regs->urfs));
-       uccf_info("urfet : addr - 0x%08x, val - 0x%04x",
+       printk(KERN_INFO "urfet : addr - 0x%08x, val - 0x%04x",
                  (u32) & uccf->uf_regs->urfet, in_be16(&uccf->uf_regs->urfet));
-       uccf_info("urfset: addr - 0x%08x, val - 0x%04x",
+       printk(KERN_INFO "urfset: addr - 0x%08x, val - 0x%04x",
                  (u32) & uccf->uf_regs->urfset,
                  in_be16(&uccf->uf_regs->urfset));
-       uccf_info("utfb  : addr - 0x%08x, val - 0x%08x",
+       printk(KERN_INFO "utfb  : addr - 0x%08x, val - 0x%08x",
                  (u32) & uccf->uf_regs->utfb, in_be32(&uccf->uf_regs->utfb));
-       uccf_info("utfs  : addr - 0x%08x, val - 0x%04x",
+       printk(KERN_INFO "utfs  : addr - 0x%08x, val - 0x%04x",
                  (u32) & uccf->uf_regs->utfs, in_be16(&uccf->uf_regs->utfs));
-       uccf_info("utfet : addr - 0x%08x, val - 0x%04x",
+       printk(KERN_INFO "utfet : addr - 0x%08x, val - 0x%04x",
                  (u32) & uccf->uf_regs->utfet, in_be16(&uccf->uf_regs->utfet));
-       uccf_info("utftt : addr - 0x%08x, val - 0x%04x",
+       printk(KERN_INFO "utftt : addr - 0x%08x, val - 0x%04x",
                  (u32) & uccf->uf_regs->utftt, in_be16(&uccf->uf_regs->utftt));
-       uccf_info("utpt  : addr - 0x%08x, val - 0x%04x",
+       printk(KERN_INFO "utpt  : addr - 0x%08x, val - 0x%04x",
                  (u32) & uccf->uf_regs->utpt, in_be16(&uccf->uf_regs->utpt));
-       uccf_info("urtry : addr - 0x%08x, val - 0x%08x",
+       printk(KERN_INFO "urtry : addr - 0x%08x, val - 0x%08x",
                  (u32) & uccf->uf_regs->urtry, in_be32(&uccf->uf_regs->urtry));
-       uccf_info("guemr : addr - 0x%08x, val - 0x%02x",
+       printk(KERN_INFO "guemr : addr - 0x%08x, val - 0x%02x",
                  (u32) & uccf->uf_regs->guemr, uccf->uf_regs->guemr);
 }
 
 u32 ucc_fast_get_qe_cr_subblock(int uccf_num)
 {
        switch (uccf_num) {
-       case 0: return QE_CR_SUBBLOCK_UCCFAST1;
+       case 0: return QE_CR_SUBBLOCK_UCCFAST1;
        case 1: return QE_CR_SUBBLOCK_UCCFAST2;
        case 2: return QE_CR_SUBBLOCK_UCCFAST3;
        case 3: return QE_CR_SUBBLOCK_UCCFAST4;
        case 4: return QE_CR_SUBBLOCK_UCCFAST5;
        case 5: return QE_CR_SUBBLOCK_UCCFAST6;
        case 6: return QE_CR_SUBBLOCK_UCCFAST7;
-       case 7: return QE_CR_SUBBLOCK_UCCFAST8;
+       case 7: return QE_CR_SUBBLOCK_UCCFAST8;
        default: return QE_CR_SUBBLOCK_INVALID;
        }
 }
@@ -153,84 +134,72 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 {
        struct ucc_fast_private *uccf;
        struct ucc_fast *uf_regs;
-       u32 gumr = 0;
+       u32 gumr;
        int ret;
 
-       uccf_vdbg("%s: IN", __FUNCTION__);
-
        if (!uf_info)
                return -EINVAL;
 
        /* check if the UCC port number is in range. */
        if ((uf_info->ucc_num < 0) || (uf_info->ucc_num > UCC_MAX_NUM - 1)) {
-               uccf_err("ucc_fast_init: Illegal UCC number!");
+               printk(KERN_ERR "%s: illegal UCC number", __FUNCTION__);
                return -EINVAL;
        }
 
        /* Check that 'max_rx_buf_length' is properly aligned (4). */
        if (uf_info->max_rx_buf_length & (UCC_FAST_MRBLR_ALIGNMENT - 1)) {
-               uccf_err("ucc_fast_init: max_rx_buf_length not aligned.");
+               printk(KERN_ERR "%s: max_rx_buf_length not aligned", __FUNCTION__);
                return -EINVAL;
        }
 
        /* Validate Virtual Fifo register values */
        if (uf_info->urfs < UCC_FAST_URFS_MIN_VAL) {
-               uccf_err
-                   ("ucc_fast_init: Virtual Fifo register urfs too small.");
+               printk(KERN_ERR "%s: urfs is too small", __FUNCTION__);
                return -EINVAL;
        }
 
        if (uf_info->urfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               uccf_err
-                   ("ucc_fast_init: Virtual Fifo register urfs not aligned.");
+               printk(KERN_ERR "%s: urfs is not aligned", __FUNCTION__);
                return -EINVAL;
        }
 
        if (uf_info->urfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               uccf_err
-                   ("ucc_fast_init: Virtual Fifo register urfet not aligned.");
+               printk(KERN_ERR "%s: urfet is not aligned.", __FUNCTION__);
                return -EINVAL;
        }
 
        if (uf_info->urfset & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               uccf_err
-                  ("ucc_fast_init: Virtual Fifo register urfset not aligned.");
+               printk(KERN_ERR "%s: urfset is not aligned", __FUNCTION__);
                return -EINVAL;
        }
 
        if (uf_info->utfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               uccf_err
-                   ("ucc_fast_init: Virtual Fifo register utfs not aligned.");
+               printk(KERN_ERR "%s: utfs is not aligned", __FUNCTION__);
                return -EINVAL;
        }
 
        if (uf_info->utfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               uccf_err
-                   ("ucc_fast_init: Virtual Fifo register utfet not aligned.");
+               printk(KERN_ERR "%s: utfet is not aligned", __FUNCTION__);
                return -EINVAL;
        }
 
        if (uf_info->utftt & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               uccf_err
-                   ("ucc_fast_init: Virtual Fifo register utftt not aligned.");
+               printk(KERN_ERR "%s: utftt is not aligned", __FUNCTION__);
                return -EINVAL;
        }
 
        uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL);
        if (!uccf) {
-               uccf_err
-                   ("ucc_fast_init: No memory for UCC slow data structure!");
+               printk(KERN_ERR "%s: Cannot allocate private data", __FUNCTION__);
                return -ENOMEM;
        }
 
        /* Fill fast UCC structure */
        uccf->uf_info = uf_info;
        /* Set the PHY base address */
-       uccf->uf_regs =
-           (struct ucc_fast *) ioremap(uf_info->regs, sizeof(struct ucc_fast));
+       uccf->uf_regs = ioremap(uf_info->regs, sizeof(struct ucc_fast));
        if (uccf->uf_regs == NULL) {
-               uccf_err
-                   ("ucc_fast_init: No memory map for UCC slow controller!");
+               printk(KERN_ERR "%s: Cannot map UCC registers", __FUNCTION__);
                return -ENOMEM;
        }
 
@@ -249,7 +218,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 
        /* Init Guemr register */
        if ((ret = ucc_init_guemr((struct ucc_common *) (uf_regs)))) {
-               uccf_err("ucc_fast_init: Could not init the guemr register.");
+               printk(KERN_ERR "%s: cannot init GUEMR", __FUNCTION__);
                ucc_fast_free(uccf);
                return ret;
        }
@@ -258,7 +227,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
        if ((ret = ucc_set_type(uf_info->ucc_num,
                                (struct ucc_common *) (uf_regs),
                                UCC_SPEED_TYPE_FAST))) {
-               uccf_err("ucc_fast_init: Could not set type to fast.");
+               printk(KERN_ERR "%s: cannot set UCC type", __FUNCTION__);
                ucc_fast_free(uccf);
                return ret;
        }
@@ -267,10 +236,9 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 
        /* Set GUMR */
        /* For more details see the hardware spec. */
-       /* gumr starts as zero. */
+       gumr = uf_info->ttx_trx;
        if (uf_info->tci)
                gumr |= UCC_FAST_GUMR_TCI;
-       gumr |= uf_info->ttx_trx;
        if (uf_info->cdp)
                gumr |= UCC_FAST_GUMR_CDP;
        if (uf_info->ctsp)
@@ -298,9 +266,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
        uccf->ucc_fast_tx_virtual_fifo_base_offset =
            qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
        if (IS_MURAM_ERR(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
-               uccf_err
-                   ("ucc_fast_init: Can not allocate MURAM memory for "
-                       "struct ucc_fastx_virtual_fifo_base_offset.");
+               printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO", __FUNCTION__);
                uccf->ucc_fast_tx_virtual_fifo_base_offset = 0;
                ucc_fast_free(uccf);
                return -ENOMEM;
@@ -308,14 +274,11 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 
        /* Allocate memory for Rx Virtual Fifo */
        uccf->ucc_fast_rx_virtual_fifo_base_offset =
-           qe_muram_alloc(uf_info->urfs +
-                          (u32)
+               qe_muram_alloc(uf_info->urfs +
                           UCC_FAST_RECEIVE_VIRTUAL_FIFO_SIZE_FUDGE_FACTOR,
                           UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
        if (IS_MURAM_ERR(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
-               uccf_err
-                   ("ucc_fast_init: Can not allocate MURAM memory for "
-                       "ucc_fast_rx_virtual_fifo_base_offset.");
+               printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO", __FUNCTION__);
                uccf->ucc_fast_rx_virtual_fifo_base_offset = 0;
                ucc_fast_free(uccf);
                return -ENOMEM;
@@ -342,26 +305,22 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
        /* If NMSI (not Tsa), set Tx and Rx clock. */
        if (!uf_info->tsa) {
                /* Rx clock routing */
-               if (uf_info->rx_clock != QE_CLK_NONE) {
-                       if (ucc_set_qe_mux_rxtx
-                           (uf_info->ucc_num, uf_info->rx_clock,
-                            COMM_DIR_RX)) {
-                               uccf_err
-               ("ucc_fast_init: Illegal value for parameter 'RxClock'.");
-                               ucc_fast_free(uccf);
-                               return -EINVAL;
-                       }
+               if ((uf_info->rx_clock != QE_CLK_NONE) &&
+                   ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->rx_clock,
+                                       COMM_DIR_RX)) {
+                       printk(KERN_ERR "%s: illegal value for RX clock",
+                              __FUNCTION__);
+                       ucc_fast_free(uccf);
+                       return -EINVAL;
                }
                /* Tx clock routing */
-               if (uf_info->tx_clock != QE_CLK_NONE) {
-                       if (ucc_set_qe_mux_rxtx
-                           (uf_info->ucc_num, uf_info->tx_clock,
-                            COMM_DIR_TX)) {
-                               uccf_err
-               ("ucc_fast_init: Illegal value for parameter 'TxClock'.");
-                               ucc_fast_free(uccf);
-                               return -EINVAL;
-                       }
+               if ((uf_info->tx_clock != QE_CLK_NONE) &&
+                   ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->tx_clock,
+                                       COMM_DIR_TX)) {
+                       printk(KERN_ERR "%s: illegal value for TX clock",
+                              __FUNCTION__);
+                       ucc_fast_free(uccf);
+                       return -EINVAL;
                }
        }
 
@@ -370,9 +329,9 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 
        /* First, clear anything pending at UCC level,
         * otherwise, old garbage may come through
-        * as soon as the dam is opened
-        * Writing '1' clears
-        */
+        * as soon as the dam is opened. */
+
+       /* Writing '1' clears */
        out_be32(&uf_regs->ucce, 0xffffffff);
 
        *uccf_ret = uccf;
index 0e97e5c94f8ac98e318eee16ceade00f23aac308..817df73ecf56a8a9cf2810058e9e5e3a46ff7ce2 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/stddef.h>
 #include <linux/interrupt.h>
 
-#include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/immap_qe.h>
 #include <asm/qe.h>
 #include <asm/ucc.h>
 #include <asm/ucc_slow.h>
 
-#define uccs_printk(level, format, arg...) \
-        printk(level format "\n", ## arg)
-
-#define uccs_dbg(format, arg...) \
-       uccs_printk(KERN_DEBUG , format , ## arg)
-#define uccs_err(format, arg...) \
-       uccs_printk(KERN_ERR , format , ## arg)
-#define uccs_info(format, arg...) \
-       uccs_printk(KERN_INFO , format , ## arg)
-#define uccs_warn(format, arg...) \
-       uccs_printk(KERN_WARNING , format , ## arg)
-
-#ifdef UCCS_VERBOSE_DEBUG
-#define uccs_vdbg uccs_dbg
-#else
-#define uccs_vdbg(fmt, args...) do { } while (0)
-#endif                         /* UCCS_VERBOSE_DEBUG */
-
 u32 ucc_slow_get_qe_cr_subblock(int uccs_num)
 {
        switch (uccs_num) {
@@ -135,51 +116,53 @@ void ucc_slow_disable(struct ucc_slow_private * uccs, enum comm_dir mode)
 
 int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** uccs_ret)
 {
+       struct ucc_slow_private *uccs;
        u32 i;
        struct ucc_slow *us_regs;
        u32 gumr;
-       u8 function_code = 0;
-       u8 *bd;
-       struct ucc_slow_private *uccs;
+       struct qe_bd *bd;
        u32 id;
        u32 command;
-       int ret;
-
-       uccs_vdbg("%s: IN", __FUNCTION__);
+       int ret = 0;
 
        if (!us_info)
                return -EINVAL;
 
        /* check if the UCC port number is in range. */
        if ((us_info->ucc_num < 0) || (us_info->ucc_num > UCC_MAX_NUM - 1)) {
-               uccs_err("ucc_slow_init: Illegal UCC number!");
+               printk(KERN_ERR "%s: illegal UCC number", __FUNCTION__);
                return -EINVAL;
        }
 
        /*
         * Set mrblr
         * Check that 'max_rx_buf_length' is properly aligned (4), unless
-        * rfw is 1, meaning that QE accepts one byte at a time, unlike normal
+        * rfw is 1, meaning that QE accepts one byte at a time, unlike normal
         * case when QE accepts 32 bits at a time.
         */
        if ((!us_info->rfw) &&
                (us_info->max_rx_buf_length & (UCC_SLOW_MRBLR_ALIGNMENT - 1))) {
-               uccs_err("max_rx_buf_length not aligned.");
+               printk(KERN_ERR "max_rx_buf_length not aligned.");
                return -EINVAL;
        }
 
        uccs = kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL);
        if (!uccs) {
-               uccs_err
-                   ("ucc_slow_init: No memory for UCC slow data structure!");
+               printk(KERN_ERR "%s: Cannot allocate private data", __FUNCTION__);
                return -ENOMEM;
        }
 
        /* Fill slow UCC structure */
        uccs->us_info = us_info;
+       /* Set the PHY base address */
+       uccs->us_regs = ioremap(us_info->regs, sizeof(struct ucc_slow));
+       if (uccs->us_regs == NULL) {
+               printk(KERN_ERR "%s: Cannot map UCC registers", __FUNCTION__);
+               return -ENOMEM;
+       }
+
        uccs->saved_uccm = 0;
        uccs->p_rx_frame = 0;
-       uccs->us_regs = us_info->regs;
        us_regs = uccs->us_regs;
        uccs->p_ucce = (u16 *) & (us_regs->ucce);
        uccs->p_uccm = (u16 *) & (us_regs->uccm);
@@ -190,24 +173,22 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 #endif                         /* STATISTICS */
 
        /* Get PRAM base */
-       uccs->us_pram_offset = qe_muram_alloc(UCC_SLOW_PRAM_SIZE,
-                                                ALIGNMENT_OF_UCC_SLOW_PRAM);
+       uccs->us_pram_offset =
+               qe_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM);
        if (IS_MURAM_ERR(uccs->us_pram_offset)) {
-               uccs_err
-                   ("ucc_slow_init: Can not allocate MURAM memory "
-                       "for Slow UCC.");
+               printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __FUNCTION__);
                ucc_slow_free(uccs);
                return -ENOMEM;
        }
        id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
        qe_issue_cmd(QE_ASSIGN_PAGE_TO_DEVICE, id, QE_CR_PROTOCOL_UNSPECIFIED,
-                       (u32) uccs->us_pram_offset);
+                    uccs->us_pram_offset);
 
        uccs->us_pram = qe_muram_addr(uccs->us_pram_offset);
 
        /* Init Guemr register */
        if ((ret = ucc_init_guemr((struct ucc_common *) (us_info->regs)))) {
-               uccs_err("ucc_slow_init: Could not init the guemr register.");
+               printk(KERN_ERR "%s: cannot init GUEMR", __FUNCTION__);
                ucc_slow_free(uccs);
                return ret;
        }
@@ -216,7 +197,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
        if ((ret = ucc_set_type(us_info->ucc_num,
                                (struct ucc_common *) (us_info->regs),
                                UCC_SPEED_TYPE_SLOW))) {
-               uccs_err("ucc_slow_init: Could not init the guemr register.");
+               printk(KERN_ERR "%s: cannot set UCC type", __FUNCTION__);
                ucc_slow_free(uccs);
                return ret;
        }
@@ -230,7 +211,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
                qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),
                                QE_ALIGNMENT_OF_BD);
        if (IS_MURAM_ERR(uccs->rx_base_offset)) {
-               uccs_err("ucc_slow_init: No memory for Rx BD's.");
+               printk(KERN_ERR "%s: cannot allocate RX BDs", __FUNCTION__);
                uccs->rx_base_offset = 0;
                ucc_slow_free(uccs);
                return -ENOMEM;
@@ -240,7 +221,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
                qe_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd),
                        QE_ALIGNMENT_OF_BD);
        if (IS_MURAM_ERR(uccs->tx_base_offset)) {
-               uccs_err("ucc_slow_init: No memory for Tx BD's.");
+               printk(KERN_ERR "%s: cannot allocate TX BDs", __FUNCTION__);
                uccs->tx_base_offset = 0;
                ucc_slow_free(uccs);
                return -ENOMEM;
@@ -248,34 +229,33 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 
        /* Init Tx bds */
        bd = uccs->confBd = uccs->tx_bd = qe_muram_addr(uccs->tx_base_offset);
-       for (i = 0; i < us_info->tx_bd_ring_len; i++) {
+       for (i = 0; i < us_info->tx_bd_ring_len - 1; i++) {
                /* clear bd buffer */
-               out_be32(&(((struct qe_bd *)bd)->buf), 0);
+               out_be32(&bd->buf, 0);
                /* set bd status and length */
-               out_be32((u32*)bd, 0);
-               bd += sizeof(struct qe_bd);
+               out_be32((u32 *) bd, 0);
+               bd++;
        }
-       bd -= sizeof(struct qe_bd);
-       /* set bd status and length */
-       out_be32((u32*)bd, T_W);        /* for last BD set Wrap bit */
+       /* for last BD set Wrap bit */
+       out_be32(&bd->buf, 0);
+       out_be32((u32 *) bd, cpu_to_be32(T_W));
 
        /* Init Rx bds */
        bd = uccs->rx_bd = qe_muram_addr(uccs->rx_base_offset);
-       for (i = 0; i < us_info->rx_bd_ring_len; i++) {
+       for (i = 0; i < us_info->rx_bd_ring_len - 1; i++) {
                /* set bd status and length */
                out_be32((u32*)bd, 0);
                /* clear bd buffer */
-               out_be32(&(((struct qe_bd *)bd)->buf), 0);
-               bd += sizeof(struct qe_bd);
+               out_be32(&bd->buf, 0);
+               bd++;
        }
-       bd -= sizeof(struct qe_bd);
-       /* set bd status and length */
-       out_be32((u32*)bd, R_W);        /* for last BD set Wrap bit */
+       /* for last BD set Wrap bit */
+       out_be32((u32*)bd, cpu_to_be32(R_W));
+       out_be32(&bd->buf, 0);
 
        /* Set GUMR (For more details see the hardware spec.). */
        /* gumr_h */
-       gumr = 0;
-       gumr |= us_info->tcrc;
+       gumr = us_info->tcrc;
        if (us_info->cdp)
                gumr |= UCC_SLOW_GUMR_H_CDP;
        if (us_info->ctsp)
@@ -295,7 +275,8 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
        out_be32(&us_regs->gumr_h, gumr);
 
        /* gumr_l */
-       gumr = 0;
+       gumr = us_info->tdcr | us_info->rdcr | us_info->tenc | us_info->renc |
+               us_info->diag | us_info->mode;
        if (us_info->tci)
                gumr |= UCC_SLOW_GUMR_L_TCI;
        if (us_info->rinv)
@@ -304,23 +285,14 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
                gumr |= UCC_SLOW_GUMR_L_TINV;
        if (us_info->tend)
                gumr |= UCC_SLOW_GUMR_L_TEND;
-       gumr |= us_info->tdcr;
-       gumr |= us_info->rdcr;
-       gumr |= us_info->tenc;
-       gumr |= us_info->renc;
-       gumr |= us_info->diag;
-       gumr |= us_info->mode;
        out_be32(&us_regs->gumr_l, gumr);
 
        /* Function code registers */
-       /* function_code has initial value 0 */
 
        /* if the data is in cachable memory, the 'global' */
        /* in the function code should be set. */
-       function_code |= us_info->data_mem_part;
-       function_code |= QE_BMR_BYTE_ORDER_BO_MOT;      /* Required for QE */
-       uccs->us_pram->tfcr = function_code;
-       uccs->us_pram->rfcr = function_code;
+       uccs->us_pram->tfcr = uccs->us_pram->rfcr =
+               us_info->data_mem_part | QE_BMR_BYTE_ORDER_BO_MOT;
 
        /* rbase, tbase are offsets from MURAM base */
        out_be16(&uccs->us_pram->rbase, uccs->us_pram_offset);
@@ -336,34 +308,29 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
        /* If NMSI (not Tsa), set Tx and Rx clock. */
        if (!us_info->tsa) {
                /* Rx clock routing */
-               if (ucc_set_qe_mux_rxtx
-                   (us_info->ucc_num, us_info->rx_clock, COMM_DIR_RX)) {
-                       uccs_err
-                           ("ucc_slow_init: Illegal value for parameter"
-                               " 'RxClock'.");
+               if (ucc_set_qe_mux_rxtx(us_info->ucc_num, us_info->rx_clock,
+                                       COMM_DIR_RX)) {
+                       printk(KERN_ERR "%s: illegal value for RX clock",
+                              __FUNCTION__);
                        ucc_slow_free(uccs);
                        return -EINVAL;
                }
                /* Tx clock routing */
-               if (ucc_set_qe_mux_rxtx(us_info->ucc_num,
-                                us_info->tx_clock, COMM_DIR_TX)) {
-                       uccs_err
-                           ("ucc_slow_init: Illegal value for parameter "
-                               "'TxClock'.");
+               if (ucc_set_qe_mux_rxtx(us_info->ucc_num, us_info->tx_clock,
+                                       COMM_DIR_TX)) {
+                       printk(KERN_ERR "%s: illegal value for TX clock",
+                              __FUNCTION__);
                        ucc_slow_free(uccs);
                        return -EINVAL;
                }
        }
 
-       /*
-        * INTERRUPTS
-        */
        /* Set interrupt mask register at UCC level. */
        out_be16(&us_regs->uccm, us_info->uccm_mask);
 
-       /* First, clear anything pending at UCC level, */
-       /* otherwise, old garbage may come through */
-       /* as soon as the dam is opened. */
+       /* First, clear anything pending at UCC level,
+        * otherwise, old garbage may come through
+        * as soon as the dam is opened. */
 
        /* Writing '1' clears */
        out_be16(&us_regs->ucce, 0xffff);
@@ -400,3 +367,5 @@ void ucc_slow_free(struct ucc_slow_private * uccs)
 
        kfree(uccs);
 }
+
+
index bd30d138113fa9e270a8e7974df36f185db11d50..8047ea8c2ab271e9e315547e3a77450d31edcab4 100644 (file)
@@ -53,7 +53,9 @@ static void nvidia_bugs(void)
                return;
 
        nvidia_hpet_detected = 0;
-       acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check);
+       if (acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check))
+               return;
+
        if (nvidia_hpet_detected == 0) {
                acpi_skip_timer_override = 1;
                printk(KERN_INFO "Nvidia board "
index 20eacc2c9e0e5223f27d9f979672a5ed031b350b..e942ffe8b57ee4c9a13a447bf205e3939815dfcc 100644 (file)
@@ -13,6 +13,7 @@ config ACPI
        depends on IA64 || X86
        depends on PCI
        depends on PM
+       select PNP
        default y
        ---help---
          Advanced Configuration and Power Interface (ACPI) support for 
@@ -132,15 +133,6 @@ config ACPI_VIDEO
          Note that this is an ref. implementation only.  It may or may not work
          for your integrated video device.
 
-config ACPI_HOTKEY
-       tristate "Generic Hotkey (EXPERIMENTAL)"
-       depends on EXPERIMENTAL
-       depends on X86
-       default n
-       help
-         Experimental consolidated hotkey driver.
-         If you are unsure, say N.
-
 config ACPI_FAN
        tristate "Fan"
        default y
index 856c32bccacb04024b7036282bed0c865ef7395e..5956e9f64a8bfd682754999267f99f80ba9a7558 100644 (file)
@@ -46,7 +46,6 @@ obj-$(CONFIG_ACPI_FAN)                += fan.o
 obj-$(CONFIG_ACPI_DOCK)                += dock.o
 obj-$(CONFIG_ACPI_BAY)         += bay.o
 obj-$(CONFIG_ACPI_VIDEO)       += video.o
-obj-$(CONFIG_ACPI_HOTKEY)      += hotkey.o
 obj-y                          += pci_root.o pci_link.o pci_irq.o pci_bind.o
 obj-$(CONFIG_ACPI_POWER)       += power.o
 obj-$(CONFIG_ACPI_PROCESSOR)   += processor.o
index 6daeace796a86c2b3e7892c517b5bab107ceb8a7..37c7dc4f9fe5db6d15b7bba43803790f0c0ee588 100644 (file)
@@ -35,7 +35,6 @@
 #define ACPI_AC_COMPONENT              0x00020000
 #define ACPI_AC_CLASS                  "ac_adapter"
 #define ACPI_AC_HID                    "ACPI0003"
-#define ACPI_AC_DRIVER_NAME            "ACPI AC Adapter Driver"
 #define ACPI_AC_DEVICE_NAME            "AC Adapter"
 #define ACPI_AC_FILE_STATE             "state"
 #define ACPI_AC_NOTIFY_STATUS          0x80
 #define ACPI_AC_STATUS_UNKNOWN         0xFF
 
 #define _COMPONENT             ACPI_AC_COMPONENT
-ACPI_MODULE_NAME("acpi_ac")
+ACPI_MODULE_NAME("ac");
 
-    MODULE_AUTHOR("Paul Diefenbaugh");
-MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME);
+MODULE_AUTHOR("Paul Diefenbaugh");
+MODULE_DESCRIPTION("ACPI AC Adapter Driver");
 MODULE_LICENSE("GPL");
 
 extern struct proc_dir_entry *acpi_lock_ac_dir(void);
@@ -58,7 +57,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type);
 static int acpi_ac_open_fs(struct inode *inode, struct file *file);
 
 static struct acpi_driver acpi_ac_driver = {
-       .name = ACPI_AC_DRIVER_NAME,
+       .name = "ac",
        .class = ACPI_AC_CLASS,
        .ids = ACPI_AC_HID,
        .ops = {
index cd946ed192d3e38a1539fcd58abfcfaf06258c26..c26172671fd882a175eb04cba40d6a8d1db8c304 100644 (file)
 #define ACPI_MEMORY_DEVICE_COMPONENT           0x08000000UL
 #define ACPI_MEMORY_DEVICE_CLASS               "memory"
 #define ACPI_MEMORY_DEVICE_HID                 "PNP0C80"
-#define ACPI_MEMORY_DEVICE_DRIVER_NAME         "Hotplug Mem Driver"
 #define ACPI_MEMORY_DEVICE_NAME                        "Hotplug Mem Device"
 
 #define _COMPONENT             ACPI_MEMORY_DEVICE_COMPONENT
 
-ACPI_MODULE_NAME("acpi_memory")
-    MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
-MODULE_DESCRIPTION(ACPI_MEMORY_DEVICE_DRIVER_NAME);
+ACPI_MODULE_NAME("acpi_memhotplug");
+MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
+MODULE_DESCRIPTION("Hotplug Mem Driver");
 MODULE_LICENSE("GPL");
 
 /* ACPI _STA method values */
@@ -60,7 +59,7 @@ static int acpi_memory_device_remove(struct acpi_device *device, int type);
 static int acpi_memory_device_start(struct acpi_device *device);
 
 static struct acpi_driver acpi_memory_device_driver = {
-       .name = ACPI_MEMORY_DEVICE_DRIVER_NAME,
+       .name = "acpi_memhotplug",
        .class = ACPI_MEMORY_DEVICE_CLASS,
        .ids = ACPI_MEMORY_DEVICE_HID,
        .ops = {
index 31ad70a6e22eb3074261b757fc7d831b841c9bed..772299fb5f9d97e54078f549e8241a852bbf181b 100644 (file)
@@ -141,6 +141,7 @@ struct asus_hotk {
                W5A,            //W5A
                W3V,            //W3030V
                xxN,            //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N
+               A4S,            //Z81sp
                //(Centrino)
                END_MODEL
        } model;                //Models currently supported
@@ -397,7 +398,16 @@ static struct model_data model_conf[END_MODEL] = {
         .brightness_set = "SPLV",
         .brightness_get = "GPLV",
         .display_set = "SDSP",
-        .display_get = "\\ADVG"}
+       .display_get = "\\ADVG"},
+
+       {
+               .name              = "A4S",
+               .brightness_set    = "SPLV",
+               .brightness_get    = "GPLV",
+               .mt_bt_switch      = "BLED",
+               .mt_wled           = "WLED"
+       }
+
 };
 
 /* procdir we use */
@@ -421,7 +431,7 @@ static struct asus_hotk *hotk;
 static int asus_hotk_add(struct acpi_device *device);
 static int asus_hotk_remove(struct acpi_device *device, int type);
 static struct acpi_driver asus_hotk_driver = {
-       .name = ACPI_HOTK_NAME,
+       .name = "asus_acpi",
        .class = ACPI_HOTK_CLASS,
        .ids = ACPI_HOTK_HID,
        .ops = {
@@ -1117,6 +1127,8 @@ static int asus_model_match(char *model)
                return W3V;
        else if (strncmp(model, "W5A", 3) == 0)
                return W5A;
+       else if (strncmp(model, "A4S", 3) == 0)
+               return A4S;
        else
                return END_MODEL;
 }
@@ -1365,10 +1377,6 @@ static int __init asus_acpi_init(void)
        if (acpi_disabled)
                return -ENODEV;
 
-       if (!acpi_specific_hotkey_enabled) {
-               printk(KERN_ERR "Using generic hotkey driver\n");
-               return -ENODEV;
-       }
        asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
        if (!asus_proc_dir) {
                printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n");
index 2f4521a48fe7b6e3f66726d389cbe5c436540ef6..e64c76c8b7268a56562969d48b6c940bbda09bfc 100644 (file)
@@ -42,7 +42,6 @@
 #define ACPI_BATTERY_COMPONENT         0x00040000
 #define ACPI_BATTERY_CLASS             "battery"
 #define ACPI_BATTERY_HID               "PNP0C0A"
-#define ACPI_BATTERY_DRIVER_NAME       "ACPI Battery Driver"
 #define ACPI_BATTERY_DEVICE_NAME       "Battery"
 #define ACPI_BATTERY_FILE_INFO         "info"
 #define ACPI_BATTERY_FILE_STATUS       "state"
 #define ACPI_BATTERY_UNITS_AMPS                "mA"
 
 #define _COMPONENT             ACPI_BATTERY_COMPONENT
-ACPI_MODULE_NAME("acpi_battery")
+ACPI_MODULE_NAME("battery");
 
-    MODULE_AUTHOR("Paul Diefenbaugh");
-MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME);
+MODULE_AUTHOR("Paul Diefenbaugh");
+MODULE_DESCRIPTION("ACPI Battery Driver");
 MODULE_LICENSE("GPL");
 
 extern struct proc_dir_entry *acpi_lock_battery_dir(void);
@@ -67,7 +66,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type);
 static int acpi_battery_resume(struct acpi_device *device);
 
 static struct acpi_driver acpi_battery_driver = {
-       .name = ACPI_BATTERY_DRIVER_NAME,
+       .name = "battery",
        .class = ACPI_BATTERY_CLASS,
        .ids = ACPI_BATTERY_HID,
        .ops = {
@@ -324,6 +323,13 @@ static int acpi_battery_check(struct acpi_battery *battery)
        return result;
 }
 
+static void acpi_battery_check_present(struct acpi_battery *battery)
+{
+       if (!battery->flags.present) {
+               acpi_battery_check(battery);
+       }
+}
+
 /* --------------------------------------------------------------------------
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
@@ -340,6 +346,8 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
        if (!battery)
                goto end;
 
+       acpi_battery_check_present(battery);
+
        if (battery->flags.present)
                seq_printf(seq, "present:                 yes\n");
        else {
@@ -424,6 +432,8 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
        if (!battery)
                goto end;
 
+       acpi_battery_check_present(battery);
+
        if (battery->flags.present)
                seq_printf(seq, "present:                 yes\n");
        else {
@@ -499,6 +509,8 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
        if (!battery)
                goto end;
 
+       acpi_battery_check_present(battery);
+
        if (!battery->flags.present) {
                seq_printf(seq, "present:                 no\n");
                goto end;
@@ -536,6 +548,8 @@ acpi_battery_write_alarm(struct file *file,
        if (!battery || (count > sizeof(alarm_string) - 1))
                return -EINVAL;
 
+       acpi_battery_check_present(battery);
+
        if (!battery->flags.present)
                return -ENODEV;
 
index 91082ce6f5d1de0e158704401c45d46590336afa..fb3f31b5e69f6587ff4c7cada15b2291c64fad40 100644 (file)
 #include <asm/uaccess.h>
 #include <linux/platform_device.h>
 
-#define ACPI_BAY_DRIVER_NAME "ACPI Removable Drive Bay Driver"
-
-ACPI_MODULE_NAME("bay")
+ACPI_MODULE_NAME("bay");
 MODULE_AUTHOR("Kristen Carlson Accardi");
-MODULE_DESCRIPTION(ACPI_BAY_DRIVER_NAME);
+MODULE_DESCRIPTION("ACPI Removable Drive Bay Driver");
 MODULE_LICENSE("GPL");
 #define ACPI_BAY_CLASS "bay"
 #define ACPI_BAY_COMPONENT     0x10000000
@@ -47,18 +45,6 @@ MODULE_LICENSE("GPL");
        acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);\
        printk(KERN_DEBUG PREFIX "%s: %s\n", prefix, s); }
 static void bay_notify(acpi_handle handle, u32 event, void *data);
-static int acpi_bay_add(struct acpi_device *device);
-static int acpi_bay_remove(struct acpi_device *device, int type);
-
-static struct acpi_driver acpi_bay_driver = {
-       .name = ACPI_BAY_DRIVER_NAME,
-       .class = ACPI_BAY_CLASS,
-       .ids = ACPI_BAY_HID,
-       .ops = {
-               .add = acpi_bay_add,
-               .remove = acpi_bay_remove,
-               },
-};
 
 struct bay {
        acpi_handle handle;
@@ -234,14 +220,6 @@ int eject_removable_drive(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(eject_removable_drive);
 
-static int acpi_bay_add(struct acpi_device *device)
-{
-       bay_dprintk(device->handle, "adding bay device");
-       strcpy(acpi_device_name(device), "Dockable Bay");
-       strcpy(acpi_device_class(device), "bay");
-       return 0;
-}
-
 static int acpi_bay_add_fs(struct bay *bay)
 {
        int ret;
@@ -303,7 +281,7 @@ static int bay_add(acpi_handle handle, int id)
 
        /* initialize platform device stuff */
        pdev = platform_device_register_simple(ACPI_BAY_CLASS, id, NULL, 0);
-       if (pdev == NULL) {
+       if (IS_ERR(pdev)) {
                printk(KERN_ERR PREFIX "Error registering bay device\n");
                goto bay_add_err;
        }
@@ -339,52 +317,6 @@ bay_add_err:
        return -ENODEV;
 }
 
-static int acpi_bay_remove(struct acpi_device *device, int type)
-{
-       /*** FIXME: do something here */
-       return 0;
-}
-
-/**
- * bay_create_acpi_device - add new devices to acpi
- * @handle - handle of the device to add
- *
- *  This function will create a new acpi_device for the given
- *  handle if one does not exist already.  This should cause
- *  acpi to scan for drivers for the given devices, and call
- *  matching driver's add routine.
- *
- *  Returns a pointer to the acpi_device corresponding to the handle.
- */
-static struct acpi_device * bay_create_acpi_device(acpi_handle handle)
-{
-       struct acpi_device *device = NULL;
-       struct acpi_device *parent_device;
-       acpi_handle parent;
-       int ret;
-
-       bay_dprintk(handle, "Trying to get device");
-       if (acpi_bus_get_device(handle, &device)) {
-               /*
-                * no device created for this object,
-                * so we should create one.
-                */
-               bay_dprintk(handle, "No device for handle");
-               acpi_get_parent(handle, &parent);
-               if (acpi_bus_get_device(parent, &parent_device))
-                       parent_device = NULL;
-
-               ret = acpi_bus_add(&device, parent_device, handle,
-                       ACPI_BUS_TYPE_DEVICE);
-               if (ret) {
-                       pr_debug("error adding bus, %x\n",
-                               -ret);
-                       return NULL;
-               }
-       }
-       return device;
-}
-
 /**
  * bay_notify - act upon an acpi bay notification
  * @handle: the bay handle
@@ -394,38 +326,19 @@ static struct acpi_device * bay_create_acpi_device(acpi_handle handle)
  */
 static void bay_notify(acpi_handle handle, u32 event, void *data)
 {
-       struct acpi_device *dev;
+       struct bay *bay_dev = (struct bay *)data;
+       struct device *dev = &bay_dev->pdev->dev;
 
        bay_dprintk(handle, "Bay event");
 
        switch(event) {
        case ACPI_NOTIFY_BUS_CHECK:
-               printk("Bus Check\n");
        case ACPI_NOTIFY_DEVICE_CHECK:
-               printk("Device Check\n");
-               dev = bay_create_acpi_device(handle);
-               if (dev)
-                       acpi_bus_generate_event(dev, event, 0);
-               else
-                       printk("No device for generating event\n");
-               /* wouldn't it be a good idea to just rescan SATA
-                * right here?
-                */
-               break;
        case ACPI_NOTIFY_EJECT_REQUEST:
-               printk("Eject request\n");
-               dev = bay_create_acpi_device(handle);
-               if (dev)
-                       acpi_bus_generate_event(dev, event, 0);
-               else
-                       printk("No device for generating eventn");
-
-               /* wouldn't it be a good idea to just call the
-                * eject_device here if we were a SATA device?
-                */
+               kobject_uevent(&dev->kobj, KOBJ_CHANGE);
                break;
        default:
-               printk("unknown event %d\n", event);
+               printk(KERN_ERR PREFIX "Bay: unknown event %d\n", event);
        }
 }
 
@@ -457,10 +370,6 @@ static int __init bay_init(void)
        acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
                ACPI_UINT32_MAX, find_bay, &bays, NULL);
 
-       if (bays)
-               if ((acpi_bus_register_driver(&acpi_bay_driver) < 0))
-                       printk(KERN_ERR "Unable to register bay driver\n");
-
        if (!bays)
                return -ENODEV;
 
@@ -481,8 +390,6 @@ static void __exit bay_exit(void)
                kfree(bay->name);
                kfree(bay);
        }
-
-       acpi_bus_unregister_driver(&acpi_bay_driver);
 }
 
 postcore_initcall(bay_init);
index c26468da429507be4ccef20e3f1b57165d860d85..dd49ea0d0ed3606a69dfc2a9580b64768ced7cb9 100644 (file)
@@ -39,7 +39,7 @@
 #include <acpi/acpi_drivers.h>
 
 #define _COMPONENT             ACPI_BUS_COMPONENT
-ACPI_MODULE_NAME("acpi_bus")
+ACPI_MODULE_NAME("bus");
 #ifdef CONFIG_X86
 extern void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger);
 #endif
@@ -147,7 +147,7 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
                        *state = ACPI_STATE_D0;
        } else {
                /*
-                * Get the device's power state either directly (via _PSC) or 
+                * Get the device's power state either directly (via _PSC) or
                 * indirectly (via power resources).
                 */
                if (device->power.flags.explicit_get) {
@@ -199,15 +199,14 @@ int acpi_bus_set_power(acpi_handle handle, int state)
         * Get device's current power state if it's unknown
         * This means device power state isn't initialized or previous setting failed
         */
-       if (!device->flags.force_power_state) {
-               if (device->power.state == ACPI_STATE_UNKNOWN)
-                       acpi_bus_get_power(device->handle, &device->power.state);
-               if (state == device->power.state) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
-                                         state));
-                       return 0;
-               }
+       if ((device->power.state == ACPI_STATE_UNKNOWN) || device->flags.force_power_state)
+               acpi_bus_get_power(device->handle, &device->power.state);
+       if ((state == device->power.state) && !device->flags.force_power_state) {
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
+                                 state));
+               return 0;
        }
+
        if (!device->power.states[state].flags.valid) {
                printk(KERN_WARNING PREFIX "Device does not support D%d\n", state);
                return -ENODEV;
@@ -462,7 +461,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
                                  "Received BUS CHECK notification for device [%s]\n",
                                  device->pnp.bus_id));
                result = acpi_bus_check_scope(device);
-               /* 
+               /*
                 * TBD: We'll need to outsource certain events to non-ACPI
                 *      drivers via the device manager (device.c).
                 */
@@ -473,7 +472,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
                                  "Received DEVICE CHECK notification for device [%s]\n",
                                  device->pnp.bus_id));
                result = acpi_bus_check_device(device, NULL);
-               /* 
+               /*
                 * TBD: We'll need to outsource certain events to non-ACPI
                 *      drivers via the device manager (device.c).
                 */
@@ -543,7 +542,7 @@ static int __init acpi_bus_init_irq(void)
        char *message = NULL;
 
 
-       /* 
+       /*
         * Let the system know what interrupt model we are using by
         * evaluating the \_PIC object, if exists.
         */
@@ -684,7 +683,7 @@ static int __init acpi_bus_init(void)
         * the EC device is found in the namespace (i.e. before acpi_initialize_objects()
         * is called).
         *
-        * This is accomplished by looking for the ECDT table, and getting 
+        * This is accomplished by looking for the ECDT table, and getting
         * the EC parameters out of that.
         */
        status = acpi_ec_ecdt_probe();
@@ -699,6 +698,9 @@ static int __init acpi_bus_init(void)
 
        printk(KERN_INFO PREFIX "Interpreter enabled\n");
 
+       /* Initialize sleep structures */
+       acpi_sleep_init();
+
        /*
         * Get the system interrupt model and evaluate \_PIC.
         */
index c726612fafb606a6c7869666c7cd4af9dcd374c7..cb4110b50cd0f19f15b0f6c6d124861bd62a82ef 100644 (file)
@@ -34,7 +34,6 @@
 #include <acpi/acpi_drivers.h>
 
 #define ACPI_BUTTON_COMPONENT          0x00080000
-#define ACPI_BUTTON_DRIVER_NAME                "ACPI Button Driver"
 #define ACPI_BUTTON_CLASS              "button"
 #define ACPI_BUTTON_FILE_INFO          "info"
 #define ACPI_BUTTON_FILE_STATE         "state"
 #define ACPI_BUTTON_TYPE_LID           0x05
 
 #define _COMPONENT             ACPI_BUTTON_COMPONENT
-ACPI_MODULE_NAME("acpi_button")
+ACPI_MODULE_NAME("button");
 
 MODULE_AUTHOR("Paul Diefenbaugh");
-MODULE_DESCRIPTION(ACPI_BUTTON_DRIVER_NAME);
+MODULE_DESCRIPTION("ACPI Button Driver");
 MODULE_LICENSE("GPL");
 
 static int acpi_button_add(struct acpi_device *device);
@@ -73,7 +72,7 @@ static int acpi_button_info_open_fs(struct inode *inode, struct file *file);
 static int acpi_button_state_open_fs(struct inode *inode, struct file *file);
 
 static struct acpi_driver acpi_button_driver = {
-       .name = ACPI_BUTTON_DRIVER_NAME,
+       .name = "button",
        .class = ACPI_BUTTON_CLASS,
        .ids = "button_power,button_sleep,PNP0C0D,PNP0C0C,PNP0C0E",
        .ops = {
index 4a9b7bf6f44ed79a3fff799c3a5245ed49f273a6..f9db4f444bd0f814fe4ffbec8252e4227df981dc 100644 (file)
@@ -31,7 +31,7 @@
 #include <acpi/actypes.h>
 #include <acpi/acutils.h>
 
-ACPI_MODULE_NAME("cm_sbs")
+ACPI_MODULE_NAME("cm_sbs");
 #define ACPI_AC_CLASS          "ac_adapter"
 #define ACPI_BATTERY_CLASS     "battery"
 #define ACPI_SBS_COMPONENT     0x00080000
index 69a68fd394cf6861c5e8bb9618604523fa08785d..0930d9413dfa31768e889e7150e9dd55a0691670 100644 (file)
@@ -35,7 +35,6 @@
 #include <acpi/acpi_drivers.h>
 #include <acpi/container.h>
 
-#define ACPI_CONTAINER_DRIVER_NAME     "ACPI container driver"
 #define ACPI_CONTAINER_DEVICE_NAME     "ACPI container device"
 #define ACPI_CONTAINER_CLASS           "container"
 
 
 #define ACPI_CONTAINER_COMPONENT       0x01000000
 #define _COMPONENT                     ACPI_CONTAINER_COMPONENT
-ACPI_MODULE_NAME("acpi_container")
+ACPI_MODULE_NAME("container");
 
-    MODULE_AUTHOR("Anil S Keshavamurthy");
-MODULE_DESCRIPTION(ACPI_CONTAINER_DRIVER_NAME);
+MODULE_AUTHOR("Anil S Keshavamurthy");
+MODULE_DESCRIPTION("ACPI container driver");
 MODULE_LICENSE("GPL");
 
 #define ACPI_STA_PRESENT               (0x00000001)
@@ -56,7 +55,7 @@ static int acpi_container_add(struct acpi_device *device);
 static int acpi_container_remove(struct acpi_device *device, int type);
 
 static struct acpi_driver acpi_container_driver = {
-       .name = ACPI_CONTAINER_DRIVER_NAME,
+       .name = "container",
        .class = ACPI_CONTAINER_CLASS,
        .ids = "ACPI0004,PNP0A05,PNP0A06",
        .ops = {
index d48f65a8f6587122be909ff286280203011f6bf5..bf513e07b7735738c0099171443ac05e6fcc917e 100644 (file)
@@ -12,7 +12,7 @@
 #include <acpi/acglobal.h>
 
 #define _COMPONENT             ACPI_SYSTEM_COMPONENT
-ACPI_MODULE_NAME("debug")
+ACPI_MODULE_NAME("debug");
 
 #ifdef MODULE_PARAM_PREFIX
 #undef MODULE_PARAM_PREFIX
index 1cbe6190582494ed9f3557c58a17b659644f4979..1683e5c5b94c5febc942d191489f0f30634cbe04 100644 (file)
@@ -231,10 +231,8 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
                 * Obtain the method mutex if necessary. Do not acquire mutex for a
                 * recursive call.
                 */
-               if (!walk_state ||
-                   !obj_desc->method.mutex->mutex.owner_thread ||
-                   (walk_state->thread !=
-                    obj_desc->method.mutex->mutex.owner_thread)) {
+               if (acpi_os_get_thread_id() !=
+                   obj_desc->method.mutex->mutex.owner_thread_id) {
                        /*
                         * Acquire the method mutex. This releases the interpreter if we
                         * block (and reacquires it before it returns)
@@ -248,14 +246,14 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
                        }
 
                        /* Update the mutex and walk info and save the original sync_level */
+                       obj_desc->method.mutex->mutex.owner_thread_id =
+                               acpi_os_get_thread_id();
 
                        if (walk_state) {
                                obj_desc->method.mutex->mutex.
                                    original_sync_level =
                                    walk_state->thread->current_sync_level;
 
-                               obj_desc->method.mutex->mutex.owner_thread =
-                                   walk_state->thread;
                                walk_state->thread->current_sync_level =
                                    obj_desc->method.sync_level;
                        } else {
@@ -569,7 +567,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 
                        acpi_os_release_mutex(method_desc->method.mutex->mutex.
                                              os_mutex);
-                       method_desc->method.mutex->mutex.owner_thread = NULL;
+                       method_desc->method.mutex->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED;
                }
        }
 
index 688e83a169068836c9546564bce5c8e669f8f55b..54a697f9aa1873400cd2ad1237b786e4f3f9550e 100644 (file)
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-#define ACPI_DOCK_DRIVER_NAME "ACPI Dock Station Driver"
+#define ACPI_DOCK_DRIVER_DESCRIPTION "ACPI Dock Station Driver"
 
-ACPI_MODULE_NAME("dock")
+ACPI_MODULE_NAME("dock");
 MODULE_AUTHOR("Kristen Carlson Accardi");
-MODULE_DESCRIPTION(ACPI_DOCK_DRIVER_NAME);
+MODULE_DESCRIPTION(ACPI_DOCK_DRIVER_DESCRIPTION);
 MODULE_LICENSE("GPL");
 
 static struct atomic_notifier_head dock_notifier_list;
@@ -741,7 +741,7 @@ static int dock_add(acpi_handle handle)
                goto dock_add_err;
        }
 
-       printk(KERN_INFO PREFIX "%s \n", ACPI_DOCK_DRIVER_NAME);
+       printk(KERN_INFO PREFIX "%s \n", ACPI_DOCK_DRIVER_DESCRIPTION);
 
        return 0;
 
index 743ce27fa0bbf2915c78f4d18fdefecb1fdf133a..ab688837379534b46ab194dacb41925215c3670b 100644 (file)
 #include <acpi/actypes.h>
 
 #define _COMPONENT             ACPI_EC_COMPONENT
-ACPI_MODULE_NAME("acpi_ec")
+ACPI_MODULE_NAME("ec");
 #define ACPI_EC_COMPONENT              0x00100000
 #define ACPI_EC_CLASS                  "embedded_controller"
 #define ACPI_EC_HID                    "PNP0C09"
-#define ACPI_EC_DRIVER_NAME            "ACPI Embedded Controller Driver"
 #define ACPI_EC_DEVICE_NAME            "Embedded Controller"
 #define ACPI_EC_FILE_INFO              "info"
 #undef PREFIX
@@ -80,7 +79,7 @@ static int acpi_ec_stop(struct acpi_device *device, int type);
 static int acpi_ec_add(struct acpi_device *device);
 
 static struct acpi_driver acpi_ec_driver = {
-       .name = ACPI_EC_DRIVER_NAME,
+       .name = "ec",
        .class = ACPI_EC_CLASS,
        .ids = ACPI_EC_HID,
        .ops = {
@@ -280,8 +279,10 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
        mutex_lock(&ec->lock);
        if (ec->global_lock) {
                status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
-               if (ACPI_FAILURE(status))
+               if (ACPI_FAILURE(status)) {
+                       mutex_unlock(&ec->lock);
                        return -ENODEV;
+               }
        }
 
        /* Make sure GPE is enabled before doing transaction */
index 959a893c8d1fdbd45d415c4a8a50c954ac498050..3b23562e6f92d195ea24dad4b1eb24131b6f519a 100644 (file)
@@ -13,7 +13,7 @@
 #include <acpi/acpi_drivers.h>
 
 #define _COMPONENT             ACPI_SYSTEM_COMPONENT
-ACPI_MODULE_NAME("event")
+ACPI_MODULE_NAME("event");
 
 /* Global vars for handling event proc entry */
 static DEFINE_SPINLOCK(acpi_system_event_lock);
index dfac3ecc596ebfd9314148d3a54ba80648c9d8b0..635ba449ebc2c97e98c2bc615f44e87bcaaf3092 100644 (file)
@@ -636,17 +636,6 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
                }
        }
 
-       if (!acpi_gbl_system_awake_and_running) {
-               /*
-                * We just woke up because of a wake GPE. Disable any further GPEs
-                * until we are fully up and running (Only wake GPEs should be enabled
-                * at this time, but we just brute-force disable them all.)
-                * 1) We must disable this particular wake GPE so it won't fire again
-                * 2) We want to disable all wake GPEs, since we are now awake
-                */
-               (void)acpi_hw_disable_all_gpes();
-       }
-
        /*
         * Dispatch the GPE to either an installed handler, or the control method
         * associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke
index 1b784ffe54c3d3c5976a28c1fac2301bb9f47e3d..d572700197f309d118ff302fde56c29a2c25fb1a 100644 (file)
@@ -196,12 +196,11 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
                notify_info->notify.value = (u16) notify_value;
                notify_info->notify.handler_obj = handler_obj;
 
-               status =
-                   acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch,
-                                   notify_info);
-               if (ACPI_FAILURE(status)) {
-                       acpi_ut_delete_generic_state(notify_info);
-               }
+               acpi_ex_relinquish_interpreter();
+
+               acpi_ev_notify_dispatch(notify_info);
+
+               acpi_ex_reacquire_interpreter();
        }
 
        if (!handler_obj) {
index 68d283fd60e7d254d936b0850a63950a948dbad3..1a73c14df2c5aa7d7f7cdd1c195bb1e202747139 100644 (file)
@@ -134,7 +134,7 @@ static struct acpi_exdump_info acpi_ex_dump_method[8] = {
 static struct acpi_exdump_info acpi_ex_dump_mutex[5] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_mutex), NULL},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(mutex.sync_level), "Sync Level"},
-       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"},
+       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread_id), "Owner Thread"},
        {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth),
         "Acquire Depth"},
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.os_mutex), "OsMutex"}
index 5101bad5baf8b3074d29156b8a47444b286e90f8..4eb883bda6ae7f23800decda4a549042c64c8a94 100644 (file)
@@ -66,10 +66,9 @@ acpi_ex_link_mutex(union acpi_operand_object *obj_desc,
  *
  ******************************************************************************/
 
-void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc)
+void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc,
+                         struct acpi_thread_state *thread)
 {
-       struct acpi_thread_state *thread = obj_desc->mutex.owner_thread;
-
        if (!thread) {
                return;
        }
@@ -174,16 +173,13 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 
        /* Support for multiple acquires by the owning thread */
 
-       if (obj_desc->mutex.owner_thread) {
-               if (obj_desc->mutex.owner_thread->thread_id ==
-                   walk_state->thread->thread_id) {
-                       /*
-                        * The mutex is already owned by this thread, just increment the
-                        * acquisition depth
-                        */
-                       obj_desc->mutex.acquisition_depth++;
-                       return_ACPI_STATUS(AE_OK);
-               }
+       if (obj_desc->mutex.owner_thread_id == acpi_os_get_thread_id()) {
+               /*
+                * The mutex is already owned by this thread, just increment the
+                * acquisition depth
+                */
+               obj_desc->mutex.acquisition_depth++;
+               return_ACPI_STATUS(AE_OK);
        }
 
        /* Acquire the mutex, wait if necessary. Special case for Global Lock */
@@ -206,7 +202,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 
        /* Have the mutex: update mutex and walk info and save the sync_level */
 
-       obj_desc->mutex.owner_thread = walk_state->thread;
+       obj_desc->mutex.owner_thread_id = acpi_os_get_thread_id();
        obj_desc->mutex.acquisition_depth = 1;
        obj_desc->mutex.original_sync_level =
            walk_state->thread->current_sync_level;
@@ -246,7 +242,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 
        /* The mutex must have been previously acquired in order to release it */
 
-       if (!obj_desc->mutex.owner_thread) {
+       if (!obj_desc->mutex.owner_thread_id) {
                ACPI_ERROR((AE_INFO,
                            "Cannot release Mutex [%4.4s], not acquired",
                            acpi_ut_get_node_name(obj_desc->mutex.node)));
@@ -266,14 +262,14 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
         * The Mutex is owned, but this thread must be the owner.
         * Special case for Global Lock, any thread can release
         */
-       if ((obj_desc->mutex.owner_thread->thread_id !=
+       if ((obj_desc->mutex.owner_thread_id !=
             walk_state->thread->thread_id)
            && (obj_desc->mutex.os_mutex != acpi_gbl_global_lock_mutex)) {
                ACPI_ERROR((AE_INFO,
                            "Thread %lX cannot release Mutex [%4.4s] acquired by thread %lX",
                            (unsigned long)walk_state->thread->thread_id,
                            acpi_ut_get_node_name(obj_desc->mutex.node),
-                           (unsigned long)obj_desc->mutex.owner_thread->thread_id));
+                           (unsigned long)obj_desc->mutex.owner_thread_id));
                return_ACPI_STATUS(AE_AML_NOT_OWNER);
        }
 
@@ -300,7 +296,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 
        /* Unlink the mutex from the owner's list */
 
-       acpi_ex_unlink_mutex(obj_desc);
+       acpi_ex_unlink_mutex(obj_desc, walk_state->thread);
 
        /* Release the mutex, special case for Global Lock */
 
@@ -312,7 +308,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 
        /* Update the mutex and restore sync_level */
 
-       obj_desc->mutex.owner_thread = NULL;
+       obj_desc->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED;
        walk_state->thread->current_sync_level =
            obj_desc->mutex.original_sync_level;
 
@@ -367,7 +363,7 @@ void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
 
                /* Mark mutex unowned */
 
-               obj_desc->mutex.owner_thread = NULL;
+               obj_desc->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED;
 
                /* Update Thread sync_level (Last mutex is the important one) */
 
index af22fdf73413a5c342b7ac5ae8f1aae9234a5254..ec655c53949225080bd90c76143831994f40444e 100644 (file)
 
 #define ACPI_FAN_COMPONENT             0x00200000
 #define ACPI_FAN_CLASS                 "fan"
-#define ACPI_FAN_DRIVER_NAME           "ACPI Fan Driver"
 #define ACPI_FAN_FILE_STATE            "state"
 
 #define _COMPONENT             ACPI_FAN_COMPONENT
-ACPI_MODULE_NAME("acpi_fan")
+ACPI_MODULE_NAME("fan");
 
-    MODULE_AUTHOR("Paul Diefenbaugh");
-MODULE_DESCRIPTION(ACPI_FAN_DRIVER_NAME);
+MODULE_AUTHOR("Paul Diefenbaugh");
+MODULE_DESCRIPTION("ACPI Fan Driver");
 MODULE_LICENSE("GPL");
 
 static int acpi_fan_add(struct acpi_device *device);
@@ -52,7 +51,7 @@ static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state);
 static int acpi_fan_resume(struct acpi_device *device);
 
 static struct acpi_driver acpi_fan_driver = {
-       .name = ACPI_FAN_DRIVER_NAME,
+       .name = "fan",
        .class = ACPI_FAN_CLASS,
        .ids = "PNP0C0B",
        .ops = {
index 7b6c9ff9bebe17d92cb954bc1e6d34e2fac1d946..4334c208841a3f06586ba3693b10d8437fff5b12 100644 (file)
@@ -241,3 +241,65 @@ static int __init init_acpi_device_notify(void)
 }
 
 arch_initcall(init_acpi_device_notify);
+
+
+#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE)
+
+/* Every ACPI platform has a mc146818 compatible "cmos rtc".  Here we find
+ * its device node and pass extra config data.  This helps its driver use
+ * capabilities that the now-obsolete mc146818 didn't have, and informs it
+ * that this board's RTC is wakeup-capable (per ACPI spec).
+ */
+#include <linux/mc146818rtc.h>
+
+static struct cmos_rtc_board_info rtc_info;
+
+
+/* PNP devices are registered in a subsys_initcall();
+ * ACPI specifies the PNP IDs to use.
+ */
+#include <linux/pnp.h>
+
+static int __init pnp_match(struct device *dev, void *data)
+{
+       static const char *ids[] = { "PNP0b00", "PNP0b01", "PNP0b02", };
+       struct pnp_dev *pnp = to_pnp_dev(dev);
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(ids); i++) {
+               if (compare_pnp_id(pnp->id, ids[i]) != 0)
+                       return 1;
+       }
+       return 0;
+}
+
+static struct device *__init get_rtc_dev(void)
+{
+       return bus_find_device(&pnp_bus_type, NULL, NULL, pnp_match);
+}
+
+static int __init acpi_rtc_init(void)
+{
+       struct device *dev = get_rtc_dev();
+
+       if (dev) {
+               rtc_info.rtc_day_alarm = acpi_gbl_FADT.day_alarm;
+               rtc_info.rtc_mon_alarm = acpi_gbl_FADT.month_alarm;
+               rtc_info.rtc_century = acpi_gbl_FADT.century;
+
+               /* NOTE:  acpi_gbl_FADT->rtcs4 is NOT currently useful */
+
+               dev->platform_data = &rtc_info;
+
+               /* RTC always wakes from S1/S2/S3, and often S4/STD */
+               device_init_wakeup(dev, 1);
+
+               put_device(dev);
+       } else
+               pr_debug("ACPI: RTC unavailable?\n");
+       return 0;
+}
+/* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */
+fs_initcall(acpi_rtc_init);
+
+#endif
index 57901ca3ade911fea9ae132dd7aa77844025372b..8fa93125fd4c94af822bf9b6dd1863511de16b7a 100644 (file)
@@ -235,6 +235,14 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state)
                                "While executing method _SST"));
        }
 
+       /*
+        * 1) Disable/Clear all GPEs
+        */
+       status = acpi_hw_disable_all_gpes();
+       if (ACPI_FAILURE(status)) {
+               return_ACPI_STATUS(status);
+       }
+
        return_ACPI_STATUS(AE_OK);
 }
 
@@ -290,13 +298,8 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
        }
 
        /*
-        * 1) Disable/Clear all GPEs
         * 2) Enable all wakeup GPEs
         */
-       status = acpi_hw_disable_all_gpes();
-       if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
-       }
        acpi_gbl_system_awake_and_running = FALSE;
 
        status = acpi_hw_enable_all_wakeup_gpes();
diff --git a/drivers/acpi/hotkey.c b/drivers/acpi/hotkey.c
deleted file mode 100644 (file)
index 8edfb92..0000000
+++ /dev/null
@@ -1,1042 +0,0 @@
-/*
- *  hotkey.c - ACPI Hotkey Driver ($Revision: 0.2 $)
- *
- *  Copyright (C) 2004 Luming Yu <luming.yu@intel.com>
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or (at
- *  your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/proc_fs.h>
-#include <linux/sched.h>
-#include <linux/kmod.h>
-#include <linux/seq_file.h>
-#include <acpi/acpi_drivers.h>
-#include <acpi/acpi_bus.h>
-#include <asm/uaccess.h>
-
-#define HOTKEY_ACPI_VERSION "0.1"
-
-#define HOTKEY_PROC "hotkey"
-#define HOTKEY_EV_CONFIG    "event_config"
-#define HOTKEY_PL_CONFIG    "poll_config"
-#define HOTKEY_ACTION   "action"
-#define HOTKEY_INFO "info"
-
-#define ACPI_HOTK_NAME          "Generic Hotkey Driver"
-#define ACPI_HOTK_CLASS         "Hotkey"
-#define ACPI_HOTK_DEVICE_NAME   "Hotkey"
-#define ACPI_HOTK_HID           "Unknown?"
-#define ACPI_HOTKEY_COMPONENT   0x20000000
-
-#define ACPI_HOTKEY_EVENT   0x1
-#define ACPI_HOTKEY_POLLING 0x2
-#define ACPI_UNDEFINED_EVENT    0xf
-
-#define RESULT_STR_LEN     80
-
-#define ACTION_METHOD  0
-#define POLL_METHOD    1
-
-#define IS_EVENT(e)            ((e) <= 10000 && (e) >0)
-#define IS_POLL(e)             ((e) > 10000)
-#define IS_OTHERS(e)           ((e)<=0 || (e)>=20000)
-#define _COMPONENT              ACPI_HOTKEY_COMPONENT
-ACPI_MODULE_NAME("acpi_hotkey")
-
-    MODULE_AUTHOR("luming.yu@intel.com");
-MODULE_DESCRIPTION(ACPI_HOTK_NAME);
-MODULE_LICENSE("GPL");
-
-/*  standardized internal hotkey number/event  */
-enum {
-       /* Video Extension event */
-       HK_EVENT_CYCLE_OUTPUT_DEVICE = 0x80,
-       HK_EVENT_OUTPUT_DEVICE_STATUS_CHANGE,
-       HK_EVENT_CYCLE_DISPLAY_OUTPUT,
-       HK_EVENT_NEXT_DISPLAY_OUTPUT,
-       HK_EVENT_PREVIOUS_DISPLAY_OUTPUT,
-       HK_EVENT_CYCLE_BRIGHTNESS,
-       HK_EVENT_INCREASE_BRIGHTNESS,
-       HK_EVENT_DECREASE_BRIGHTNESS,
-       HK_EVENT_ZERO_BRIGHTNESS,
-       HK_EVENT_DISPLAY_DEVICE_OFF,
-
-       /* Snd Card event */
-       HK_EVENT_VOLUME_MUTE,
-       HK_EVENT_VOLUME_INCLREASE,
-       HK_EVENT_VOLUME_DECREASE,
-
-       /* running state control */
-       HK_EVENT_ENTERRING_S3,
-       HK_EVENT_ENTERRING_S4,
-       HK_EVENT_ENTERRING_S5,
-};
-
-enum conf_entry_enum {
-       bus_handle = 0,
-       bus_method = 1,
-       action_handle = 2,
-       method = 3,
-       LAST_CONF_ENTRY
-};
-
-/*  procdir we use */
-static struct proc_dir_entry *hotkey_proc_dir;
-static struct proc_dir_entry *hotkey_config;
-static struct proc_dir_entry *hotkey_poll_config;
-static struct proc_dir_entry *hotkey_action;
-static struct proc_dir_entry *hotkey_info;
-
-/* linkage for all type of hotkey */
-struct acpi_hotkey_link {
-       struct list_head entries;
-       int hotkey_type;        /* event or polling based hotkey  */
-       int hotkey_standard_num;        /* standardized hotkey(event) number */
-};
-
-/* event based hotkey */
-struct acpi_event_hotkey {
-       struct acpi_hotkey_link hotkey_link;
-       int flag;
-       acpi_handle bus_handle; /* bus to install notify handler */
-       int external_hotkey_num;        /* external hotkey/event number */
-       acpi_handle action_handle;      /* acpi handle attached aml action method */
-       char *action_method;    /* action method */
-};
-
-/*
- * There are two ways to poll status
- * 1. directy call read_xxx method, without any arguments passed in
- * 2. call write_xxx method, with arguments passed in, you need
- * the result is saved in acpi_polling_hotkey.poll_result.
- * anthoer read command through polling interface.
- *
- */
-
-/* polling based hotkey */
-struct acpi_polling_hotkey {
-       struct acpi_hotkey_link hotkey_link;
-       int flag;
-       acpi_handle poll_handle;        /* acpi handle attached polling method */
-       char *poll_method;      /* poll method */
-       acpi_handle action_handle;      /* acpi handle attached action method */
-       char *action_method;    /* action method */
-       union acpi_object *poll_result; /* polling_result */
-       struct proc_dir_entry *proc;
-};
-
-/* hotkey object union */
-union acpi_hotkey {
-       struct list_head entries;
-       struct acpi_hotkey_link link;
-       struct acpi_event_hotkey event_hotkey;
-       struct acpi_polling_hotkey poll_hotkey;
-};
-
-/* hotkey object list */
-struct acpi_hotkey_list {
-       struct list_head *entries;
-       int count;
-};
-
-static int auto_hotkey_add(struct acpi_device *device);
-static int auto_hotkey_remove(struct acpi_device *device, int type);
-
-static struct acpi_driver hotkey_driver = {
-       .name = ACPI_HOTK_NAME,
-       .class = ACPI_HOTK_CLASS,
-       .ids = ACPI_HOTK_HID,
-       .ops = {
-               .add = auto_hotkey_add,
-               .remove = auto_hotkey_remove,
-               },
-};
-
-static void free_hotkey_device(union acpi_hotkey *key);
-static void free_hotkey_buffer(union acpi_hotkey *key);
-static void free_poll_hotkey_buffer(union acpi_hotkey *key);
-static int hotkey_open_config(struct inode *inode, struct file *file);
-static int hotkey_poll_open_config(struct inode *inode, struct file *file);
-static ssize_t hotkey_write_config(struct file *file,
-                                  const char __user * buffer,
-                                  size_t count, loff_t * data);
-static int hotkey_info_open_fs(struct inode *inode, struct file *file);
-static int hotkey_action_open_fs(struct inode *inode, struct file *file);
-static ssize_t hotkey_execute_aml_method(struct file *file,
-                                        const char __user * buffer,
-                                        size_t count, loff_t * data);
-static int hotkey_config_seq_show(struct seq_file *seq, void *offset);
-static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset);
-static int hotkey_polling_open_fs(struct inode *inode, struct file *file);
-static union acpi_hotkey *get_hotkey_by_event(struct
-                                             acpi_hotkey_list
-                                             *hotkey_list, int event);
-
-/* event based config */
-static const struct file_operations hotkey_config_fops = {
-       .open = hotkey_open_config,
-       .read = seq_read,
-       .write = hotkey_write_config,
-       .llseek = seq_lseek,
-       .release = single_release,
-};
-
-/* polling based config */
-static const struct file_operations hotkey_poll_config_fops = {
-       .open = hotkey_poll_open_config,
-       .read = seq_read,
-       .write = hotkey_write_config,
-       .llseek = seq_lseek,
-       .release = single_release,
-};
-
-/* hotkey driver info */
-static const struct file_operations hotkey_info_fops = {
-       .open = hotkey_info_open_fs,
-       .read = seq_read,
-       .llseek = seq_lseek,
-       .release = single_release,
-};
-
-/* action */
-static const struct file_operations hotkey_action_fops = {
-       .open = hotkey_action_open_fs,
-       .read = seq_read,
-       .write = hotkey_execute_aml_method,
-       .llseek = seq_lseek,
-       .release = single_release,
-};
-
-/* polling results */
-static const struct file_operations hotkey_polling_fops = {
-       .open = hotkey_polling_open_fs,
-       .read = seq_read,
-       .llseek = seq_lseek,
-       .release = single_release,
-};
-
-struct acpi_hotkey_list global_hotkey_list;    /* link all ev or pl hotkey  */
-struct list_head hotkey_entries;       /* head of the list of hotkey_list */
-
-static int hotkey_info_seq_show(struct seq_file *seq, void *offset)
-{
-
-       seq_printf(seq, "Hotkey generic driver ver: %s\n", HOTKEY_ACPI_VERSION);
-
-       return 0;
-}
-
-static int hotkey_info_open_fs(struct inode *inode, struct file *file)
-{
-       return single_open(file, hotkey_info_seq_show, PDE(inode)->data);
-}
-
-static char *format_result(union acpi_object *object)
-{
-       char *buf;
-
-       buf = kzalloc(RESULT_STR_LEN, GFP_KERNEL);
-       if (!buf)
-               return NULL;
-       /* Now, just support integer type */
-       if (object->type == ACPI_TYPE_INTEGER)
-               sprintf(buf, "%d\n", (u32) object->integer.value);
-       return buf;
-}
-
-static int hotkey_polling_seq_show(struct seq_file *seq, void *offset)
-{
-       struct acpi_polling_hotkey *poll_hotkey = seq->private;
-       char *buf;
-
-
-       if (poll_hotkey->poll_result) {
-               buf = format_result(poll_hotkey->poll_result);
-               if (buf)
-                       seq_printf(seq, "%s", buf);
-               kfree(buf);
-       }
-       return 0;
-}
-
-static int hotkey_polling_open_fs(struct inode *inode, struct file *file)
-{
-       return single_open(file, hotkey_polling_seq_show, PDE(inode)->data);
-}
-
-static int hotkey_action_open_fs(struct inode *inode, struct file *file)
-{
-       return single_open(file, hotkey_info_seq_show, PDE(inode)->data);
-}
-
-/* Mapping external hotkey number to standardized hotkey event num */
-static int hotkey_get_internal_event(int event, struct acpi_hotkey_list *list)
-{
-       struct list_head *entries;
-       int val = -1;
-
-
-       list_for_each(entries, list->entries) {
-               union acpi_hotkey *key =
-                   container_of(entries, union acpi_hotkey, entries);
-               if (key->link.hotkey_type == ACPI_HOTKEY_EVENT
-                   && key->event_hotkey.external_hotkey_num == event) {
-                       val = key->link.hotkey_standard_num;
-                       break;
-               }
-       }
-
-       return val;
-}
-
-static void
-acpi_hotkey_notify_handler(acpi_handle handle, u32 event, void *data)
-{
-       struct acpi_device *device = NULL;
-       u32 internal_event;
-
-
-       if (acpi_bus_get_device(handle, &device))
-               return;
-
-       internal_event = hotkey_get_internal_event(event, &global_hotkey_list);
-       acpi_bus_generate_event(device, internal_event, 0);
-
-       return;
-}
-
-/* Need to invent automatically hotkey add method */
-static int auto_hotkey_add(struct acpi_device *device)
-{
-       /* Implement me */
-       return 0;
-}
-
-/* Need to invent automatically hotkey remove method */
-static int auto_hotkey_remove(struct acpi_device *device, int type)
-{
-       /* Implement me */
-       return 0;
-}
-
-/* Create a proc file for each polling method */
-static int create_polling_proc(union acpi_hotkey *device)
-{
-       struct proc_dir_entry *proc;
-       char proc_name[80];
-       mode_t mode;
-
-       mode = S_IFREG | S_IRUGO | S_IWUGO;
-
-       sprintf(proc_name, "%d", device->link.hotkey_standard_num);
-       /*
-          strcat(proc_name, device->poll_hotkey.poll_method);
-        */
-       proc = create_proc_entry(proc_name, mode, hotkey_proc_dir);
-
-       if (!proc) {
-               return -ENODEV;
-       } else {
-               proc->proc_fops = &hotkey_polling_fops;
-               proc->owner = THIS_MODULE;
-               proc->data = device;
-               proc->uid = 0;
-               proc->gid = 0;
-               device->poll_hotkey.proc = proc;
-       }
-       return 0;
-}
-
-static int hotkey_add(union acpi_hotkey *device)
-{
-       int status = 0;
-       struct acpi_device *dev = NULL;
-
-
-       if (device->link.hotkey_type == ACPI_HOTKEY_EVENT) {
-               acpi_bus_get_device(device->event_hotkey.bus_handle, &dev);
-               status = acpi_install_notify_handler(dev->handle,
-                                                    ACPI_DEVICE_NOTIFY,
-                                                    acpi_hotkey_notify_handler,
-                                                    dev);
-       } else                  /* Add polling hotkey */
-               create_polling_proc(device);
-
-       global_hotkey_list.count++;
-
-       list_add_tail(&device->link.entries, global_hotkey_list.entries);
-
-       return status;
-}
-
-static int hotkey_remove(union acpi_hotkey *device)
-{
-       struct list_head *entries, *next;
-
-
-       list_for_each_safe(entries, next, global_hotkey_list.entries) {
-               union acpi_hotkey *key =
-                   container_of(entries, union acpi_hotkey, entries);
-               if (key->link.hotkey_standard_num ==
-                   device->link.hotkey_standard_num) {
-                       list_del(&key->link.entries);
-                       free_hotkey_device(key);
-                       global_hotkey_list.count--;
-                       break;
-               }
-       }
-       kfree(device);
-       return 0;
-}
-
-static int hotkey_update(union acpi_hotkey *key)
-{
-       struct list_head *entries;
-
-
-       list_for_each(entries, global_hotkey_list.entries) {
-               union acpi_hotkey *tmp =
-                   container_of(entries, union acpi_hotkey, entries);
-               if (tmp->link.hotkey_standard_num ==
-                   key->link.hotkey_standard_num) {
-                       if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) {
-                               free_hotkey_buffer(tmp);
-                               tmp->event_hotkey.bus_handle =
-                                   key->event_hotkey.bus_handle;
-                               tmp->event_hotkey.external_hotkey_num =
-                                   key->event_hotkey.external_hotkey_num;
-                               tmp->event_hotkey.action_handle =
-                                   key->event_hotkey.action_handle;
-                               tmp->event_hotkey.action_method =
-                                   key->event_hotkey.action_method;
-                               kfree(key);
-                       } else {
-                               /*
-                                  char  proc_name[80];
-
-                                  sprintf(proc_name, "%d", tmp->link.hotkey_standard_num);
-                                  strcat(proc_name, tmp->poll_hotkey.poll_method);
-                                  remove_proc_entry(proc_name,hotkey_proc_dir);
-                                */
-                               free_poll_hotkey_buffer(tmp);
-                               tmp->poll_hotkey.poll_handle =
-                                   key->poll_hotkey.poll_handle;
-                               tmp->poll_hotkey.poll_method =
-                                   key->poll_hotkey.poll_method;
-                               tmp->poll_hotkey.action_handle =
-                                   key->poll_hotkey.action_handle;
-                               tmp->poll_hotkey.action_method =
-                                   key->poll_hotkey.action_method;
-                               tmp->poll_hotkey.poll_result =
-                                   key->poll_hotkey.poll_result;
-                               /*
-                                  create_polling_proc(tmp);
-                                */
-                               kfree(key);
-                       }
-                       return 0;
-                       break;
-               }
-       }
-
-       return -ENODEV;
-}
-
-static void free_hotkey_device(union acpi_hotkey *key)
-{
-       struct acpi_device *dev;
-
-
-       if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) {
-               acpi_bus_get_device(key->event_hotkey.bus_handle, &dev);
-               if (dev->handle)
-                       acpi_remove_notify_handler(dev->handle,
-                                                  ACPI_DEVICE_NOTIFY,
-                                                  acpi_hotkey_notify_handler);
-               free_hotkey_buffer(key);
-       } else {
-               char proc_name[80];
-
-               sprintf(proc_name, "%d", key->link.hotkey_standard_num);
-               /*
-                  strcat(proc_name, key->poll_hotkey.poll_method);
-                */
-               remove_proc_entry(proc_name, hotkey_proc_dir);
-               free_poll_hotkey_buffer(key);
-       }
-       kfree(key);
-       return;
-}
-
-static void free_hotkey_buffer(union acpi_hotkey *key)
-{
-       /* key would never be null, action method could be */
-       kfree(key->event_hotkey.action_method);
-}
-
-static void free_poll_hotkey_buffer(union acpi_hotkey *key)
-{
-       /* key would never be null, others could be*/
-       kfree(key->poll_hotkey.action_method);
-       kfree(key->poll_hotkey.poll_method);
-       kfree(key->poll_hotkey.poll_result);
-}
-static int
-init_hotkey_device(union acpi_hotkey *key, char **config_entry,
-                  int std_num, int external_num)
-{
-       acpi_handle tmp_handle;
-       acpi_status status = AE_OK;
-
-       if (std_num < 0 || IS_POLL(std_num) || !key)
-               goto do_fail;
-
-       if (!config_entry[bus_handle] || !config_entry[action_handle]
-                       || !config_entry[method])
-               goto do_fail;
-
-       key->link.hotkey_type = ACPI_HOTKEY_EVENT;
-       key->link.hotkey_standard_num = std_num;
-       key->event_hotkey.flag = 0;
-       key->event_hotkey.action_method = config_entry[method];
-
-       status = acpi_get_handle(NULL, config_entry[bus_handle],
-                          &(key->event_hotkey.bus_handle));
-       if (ACPI_FAILURE(status))
-               goto do_fail_zero;
-       key->event_hotkey.external_hotkey_num = external_num;
-       status = acpi_get_handle(NULL, config_entry[action_handle],
-                           &(key->event_hotkey.action_handle));
-       if (ACPI_FAILURE(status))
-               goto do_fail_zero;
-       status = acpi_get_handle(key->event_hotkey.action_handle,
-                                config_entry[method], &tmp_handle);
-       if (ACPI_FAILURE(status))
-               goto do_fail_zero;
-       return AE_OK;
-do_fail_zero:
-       key->event_hotkey.action_method = NULL;
-do_fail:
-       return -ENODEV;
-}
-
-static int
-init_poll_hotkey_device(union acpi_hotkey *key, char **config_entry,
-                       int std_num)
-{
-       acpi_status status = AE_OK;
-       acpi_handle tmp_handle;
-
-       if (std_num < 0 || IS_EVENT(std_num) || !key)
-               goto do_fail;
-       if (!config_entry[bus_handle] ||!config_entry[bus_method] ||
-               !config_entry[action_handle] || !config_entry[method])
-               goto do_fail;
-
-       key->link.hotkey_type = ACPI_HOTKEY_POLLING;
-       key->link.hotkey_standard_num = std_num;
-       key->poll_hotkey.flag = 0;
-       key->poll_hotkey.poll_method = config_entry[bus_method];
-       key->poll_hotkey.action_method = config_entry[method];
-
-       status = acpi_get_handle(NULL, config_entry[bus_handle],
-                     &(key->poll_hotkey.poll_handle));
-       if (ACPI_FAILURE(status))
-               goto do_fail_zero;
-       status = acpi_get_handle(key->poll_hotkey.poll_handle,
-                                config_entry[bus_method], &tmp_handle);
-       if (ACPI_FAILURE(status))
-               goto do_fail_zero;
-       status =
-           acpi_get_handle(NULL, config_entry[action_handle],
-                           &(key->poll_hotkey.action_handle));
-       if (ACPI_FAILURE(status))
-               goto do_fail_zero;
-       status = acpi_get_handle(key->poll_hotkey.action_handle,
-                                config_entry[method], &tmp_handle);
-       if (ACPI_FAILURE(status))
-               goto do_fail_zero;
-       key->poll_hotkey.poll_result =
-           kmalloc(sizeof(union acpi_object), GFP_KERNEL);
-       if (!key->poll_hotkey.poll_result)
-               goto do_fail_zero;
-       return AE_OK;
-
-do_fail_zero:
-       key->poll_hotkey.poll_method = NULL;
-       key->poll_hotkey.action_method = NULL;
-do_fail:
-       return -ENODEV;
-}
-
-static int hotkey_open_config(struct inode *inode, struct file *file)
-{
-       return (single_open
-                    (file, hotkey_config_seq_show, PDE(inode)->data));
-}
-
-static int hotkey_poll_open_config(struct inode *inode, struct file *file)
-{
-       return (single_open
-                    (file, hotkey_poll_config_seq_show, PDE(inode)->data));
-}
-
-static int hotkey_config_seq_show(struct seq_file *seq, void *offset)
-{
-       struct acpi_hotkey_list *hotkey_list = &global_hotkey_list;
-       struct list_head *entries;
-       char bus_name[ACPI_PATHNAME_MAX] = { 0 };
-       char action_name[ACPI_PATHNAME_MAX] = { 0 };
-       struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name };
-       struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name };
-
-
-       list_for_each(entries, hotkey_list->entries) {
-               union acpi_hotkey *key =
-                   container_of(entries, union acpi_hotkey, entries);
-               if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) {
-                       acpi_get_name(key->event_hotkey.bus_handle,
-                                     ACPI_NAME_TYPE_MAX, &bus);
-                       acpi_get_name(key->event_hotkey.action_handle,
-                                     ACPI_NAME_TYPE_MAX, &act);
-                       seq_printf(seq, "%s:%s:%s:%d:%d\n", bus_name,
-                                  action_name,
-                                  key->event_hotkey.action_method,
-                                  key->link.hotkey_standard_num,
-                                  key->event_hotkey.external_hotkey_num);
-               }
-       }
-       seq_puts(seq, "\n");
-       return 0;
-}
-
-static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset)
-{
-       struct acpi_hotkey_list *hotkey_list = &global_hotkey_list;
-       struct list_head *entries;
-       char bus_name[ACPI_PATHNAME_MAX] = { 0 };
-       char action_name[ACPI_PATHNAME_MAX] = { 0 };
-       struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name };
-       struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name };
-
-
-       list_for_each(entries, hotkey_list->entries) {
-               union acpi_hotkey *key =
-                   container_of(entries, union acpi_hotkey, entries);
-               if (key->link.hotkey_type == ACPI_HOTKEY_POLLING) {
-                       acpi_get_name(key->poll_hotkey.poll_handle,
-                                     ACPI_NAME_TYPE_MAX, &bus);
-                       acpi_get_name(key->poll_hotkey.action_handle,
-                                     ACPI_NAME_TYPE_MAX, &act);
-                       seq_printf(seq, "%s:%s:%s:%s:%d\n", bus_name,
-                                  key->poll_hotkey.poll_method,
-                                  action_name,
-                                  key->poll_hotkey.action_method,
-                                  key->link.hotkey_standard_num);
-               }
-       }
-       seq_puts(seq, "\n");
-       return 0;
-}
-
-static int
-get_parms(char *config_record, int *cmd, char **config_entry,
-              int *internal_event_num, int *external_event_num)
-{
-/* the format of *config_record =
- * "1:\d+:*" : "cmd:internal_event_num"
- * "\d+:\w+:\w+:\w+:\w+:\d+:\d+" :
- * "cmd:bus_handle:bus_method:action_handle:method:internal_event_num:external_event_num"
- */
-       char *tmp, *tmp1, count;
-       int i;
-
-       sscanf(config_record, "%d", cmd);
-       if (*cmd == 1) {
-               if (sscanf(config_record, "%d:%d", cmd, internal_event_num) !=
-                   2)
-                       goto do_fail;
-               else
-                       return (6);
-       }
-       tmp = strchr(config_record, ':');
-       if (!tmp)
-               goto do_fail;
-       tmp++;
-       for (i = 0; i < LAST_CONF_ENTRY; i++) {
-               tmp1 = strchr(tmp, ':');
-               if (!tmp1) {
-                       goto do_fail;
-               }
-               count = tmp1 - tmp;
-               config_entry[i] = kzalloc(count + 1, GFP_KERNEL);
-               if (!config_entry[i])
-                       goto handle_failure;
-               strncpy(config_entry[i], tmp, count);
-               tmp = tmp1 + 1;
-       }
-       if (sscanf(tmp, "%d:%d", internal_event_num, external_event_num) <= 0)
-               goto handle_failure;
-       if (!IS_OTHERS(*internal_event_num)) {
-               return 6;
-       }
-handle_failure:
-       while (i-- > 0)
-               kfree(config_entry[i]);
-do_fail:
-       return -1;
-}
-
-/*  count is length for one input record */
-static ssize_t hotkey_write_config(struct file *file,
-                                  const char __user * buffer,
-                                  size_t count, loff_t * data)
-{
-       char *config_record = NULL;
-       char *config_entry[LAST_CONF_ENTRY];
-       int cmd, internal_event_num, external_event_num;
-       int ret = 0;
-       union acpi_hotkey *key = kzalloc(sizeof(union acpi_hotkey), GFP_KERNEL);
-
-       if (!key)
-               return -ENOMEM;
-
-       config_record = kzalloc(count + 1, GFP_KERNEL);
-       if (!config_record) {
-               kfree(key);
-               return -ENOMEM;
-       }
-
-       if (copy_from_user(config_record, buffer, count)) {
-               kfree(config_record);
-               kfree(key);
-               printk(KERN_ERR PREFIX "Invalid data\n");
-               return -EINVAL;
-       }
-       ret = get_parms(config_record, &cmd, config_entry,
-                      &internal_event_num, &external_event_num);
-       kfree(config_record);
-       if (ret != 6) {
-               printk(KERN_ERR PREFIX "Invalid data format ret=%d\n", ret);
-               return -EINVAL;
-       }
-
-       if (cmd == 1) {
-               union acpi_hotkey *tmp = NULL;
-               tmp = get_hotkey_by_event(&global_hotkey_list,
-                                         internal_event_num);
-               if (!tmp)
-                       printk(KERN_ERR PREFIX "Invalid key\n");
-               else
-                       memcpy(key, tmp, sizeof(union acpi_hotkey));
-               goto cont_cmd;
-       }
-       if (IS_EVENT(internal_event_num)) {
-               if (init_hotkey_device(key, config_entry,
-                       internal_event_num, external_event_num))
-                       goto init_hotkey_fail;
-       } else {
-               if (init_poll_hotkey_device(key, config_entry,
-                              internal_event_num))
-                       goto init_poll_hotkey_fail;
-       }
-cont_cmd:
-       switch (cmd) {
-       case 0:
-               if (get_hotkey_by_event(&global_hotkey_list,
-                               key->link.hotkey_standard_num))
-                       goto fail_out;
-               else
-                       hotkey_add(key);
-               break;
-       case 1:
-               hotkey_remove(key);
-               break;
-       case 2:
-               /* key is kfree()ed if matched*/
-               if (hotkey_update(key))
-                       goto fail_out;
-               break;
-       default:
-               goto fail_out;
-               break;
-       }
-       return count;
-
-init_poll_hotkey_fail:         /* failed init_poll_hotkey_device */
-       kfree(config_entry[bus_method]);
-       config_entry[bus_method] = NULL;
-init_hotkey_fail:              /* failed init_hotkey_device */
-       kfree(config_entry[method]);
-fail_out:
-       kfree(config_entry[bus_handle]);
-       kfree(config_entry[action_handle]);
-       /* No double free since elements =NULL for error cases */
-       if (IS_EVENT(internal_event_num)) {
-               if (config_entry[bus_method])
-                       kfree(config_entry[bus_method]);
-               free_hotkey_buffer(key);        /* frees [method] */
-       } else
-               free_poll_hotkey_buffer(key);  /* frees [bus_method]+[method] */
-       kfree(key);
-       printk(KERN_ERR PREFIX "invalid key\n");
-       return -EINVAL;
-}
-
-/*
- * This function evaluates an ACPI method, given an int as parameter, the
- * method is searched within the scope of the handle, can be NULL. The output
- * of the method is written is output, which can also be NULL
- *
- * returns 1 if write is successful, 0 else.
- */
-static int write_acpi_int(acpi_handle handle, const char *method, int val,
-                         struct acpi_buffer *output)
-{
-       struct acpi_object_list params; /* list of input parameters (an int here) */
-       union acpi_object in_obj;       /* the only param we use */
-       acpi_status status;
-
-       params.count = 1;
-       params.pointer = &in_obj;
-       in_obj.type = ACPI_TYPE_INTEGER;
-       in_obj.integer.value = val;
-
-       status = acpi_evaluate_object(handle, (char *)method, &params, output);
-
-       return (status == AE_OK);
-}
-
-static int read_acpi_int(acpi_handle handle, const char *method,
-                        union acpi_object *val)
-{
-       struct acpi_buffer output;
-       union acpi_object out_obj;
-       acpi_status status;
-
-       output.length = sizeof(out_obj);
-       output.pointer = &out_obj;
-
-       status = acpi_evaluate_object(handle, (char *)method, NULL, &output);
-       if (val) {
-               val->integer.value = out_obj.integer.value;
-               val->type = out_obj.type;
-       } else
-               printk(KERN_ERR PREFIX "null val pointer\n");
-       return ((status == AE_OK)
-                    && (out_obj.type == ACPI_TYPE_INTEGER));
-}
-
-static union acpi_hotkey *get_hotkey_by_event(struct
-                                             acpi_hotkey_list
-                                             *hotkey_list, int event)
-{
-       struct list_head *entries;
-
-       list_for_each(entries, hotkey_list->entries) {
-               union acpi_hotkey *key =
-                   container_of(entries, union acpi_hotkey, entries);
-               if (key->link.hotkey_standard_num == event) {
-                       return (key);
-               }
-       }
-       return (NULL);
-}
-
-/*
- * user call AML method interface:
- * Call convention:
- * echo "event_num: arg type : value"
- * example: echo "1:1:30" > /proc/acpi/action
- * Just support 1 integer arg passing to AML method
- */
-
-static ssize_t hotkey_execute_aml_method(struct file *file,
-                                        const char __user * buffer,
-                                        size_t count, loff_t * data)
-{
-       struct acpi_hotkey_list *hotkey_list = &global_hotkey_list;
-       char *arg;
-       int event, method_type, type, value;
-       union acpi_hotkey *key;
-
-
-       arg = kzalloc(count + 1, GFP_KERNEL);
-       if (!arg)
-               return -ENOMEM;
-
-       if (copy_from_user(arg, buffer, count)) {
-               kfree(arg);
-               printk(KERN_ERR PREFIX "Invalid argument 2\n");
-               return -EINVAL;
-       }
-
-       if (sscanf(arg, "%d:%d:%d:%d", &event, &method_type, &type, &value) !=
-           4) {
-               kfree(arg);
-               printk(KERN_ERR PREFIX "Invalid argument 3\n");
-               return -EINVAL;
-       }
-       kfree(arg);
-       if (type == ACPI_TYPE_INTEGER) {
-               key = get_hotkey_by_event(hotkey_list, event);
-               if (!key)
-                       goto do_fail;
-               if (IS_EVENT(event))
-                       write_acpi_int(key->event_hotkey.action_handle,
-                                      key->event_hotkey.action_method, value,
-                                      NULL);
-               else if (IS_POLL(event)) {
-                       if (method_type == POLL_METHOD)
-                               read_acpi_int(key->poll_hotkey.poll_handle,
-                                             key->poll_hotkey.poll_method,
-                                             key->poll_hotkey.poll_result);
-                       else if (method_type == ACTION_METHOD)
-                               write_acpi_int(key->poll_hotkey.action_handle,
-                                              key->poll_hotkey.action_method,
-                                              value, NULL);
-                       else
-                               goto do_fail;
-
-               }
-       } else {
-               printk(KERN_WARNING "Not supported\n");
-               return -EINVAL;
-       }
-       return count;
-      do_fail:
-       return -EINVAL;
-
-}
-
-static int __init hotkey_init(void)
-{
-       int result;
-       mode_t mode = S_IFREG | S_IRUGO | S_IWUGO;
-
-
-       if (acpi_disabled)
-               return -ENODEV;
-
-       if (acpi_specific_hotkey_enabled) {
-               printk("Using specific hotkey driver\n");
-               return -ENODEV;
-       }
-
-       hotkey_proc_dir = proc_mkdir(HOTKEY_PROC, acpi_root_dir);
-       if (!hotkey_proc_dir) {
-               return (-ENODEV);
-       }
-       hotkey_proc_dir->owner = THIS_MODULE;
-
-       hotkey_config =
-           create_proc_entry(HOTKEY_EV_CONFIG, mode, hotkey_proc_dir);
-       if (!hotkey_config) {
-               goto do_fail1;
-       } else {
-               hotkey_config->proc_fops = &hotkey_config_fops;
-               hotkey_config->data = &global_hotkey_list;
-               hotkey_config->owner = THIS_MODULE;
-               hotkey_config->uid = 0;
-               hotkey_config->gid = 0;
-       }
-
-       hotkey_poll_config =
-           create_proc_entry(HOTKEY_PL_CONFIG, mode, hotkey_proc_dir);
-       if (!hotkey_poll_config) {
-               goto do_fail2;
-       } else {
-               hotkey_poll_config->proc_fops = &hotkey_poll_config_fops;
-               hotkey_poll_config->data = &global_hotkey_list;
-               hotkey_poll_config->owner = THIS_MODULE;
-               hotkey_poll_config->uid = 0;
-               hotkey_poll_config->gid = 0;
-       }
-
-       hotkey_action = create_proc_entry(HOTKEY_ACTION, mode, hotkey_proc_dir);
-       if (!hotkey_action) {
-               goto do_fail3;
-       } else {
-               hotkey_action->proc_fops = &hotkey_action_fops;
-               hotkey_action->owner = THIS_MODULE;
-               hotkey_action->uid = 0;
-               hotkey_action->gid = 0;
-       }
-
-       hotkey_info = create_proc_entry(HOTKEY_INFO, mode, hotkey_proc_dir);
-       if (!hotkey_info) {
-               goto do_fail4;
-       } else {
-               hotkey_info->proc_fops = &hotkey_info_fops;
-               hotkey_info->owner = THIS_MODULE;
-               hotkey_info->uid = 0;
-               hotkey_info->gid = 0;
-       }
-
-       result = acpi_bus_register_driver(&hotkey_driver);
-       if (result < 0)
-               goto do_fail5;
-       global_hotkey_list.count = 0;
-       global_hotkey_list.entries = &hotkey_entries;
-
-       INIT_LIST_HEAD(&hotkey_entries);
-
-       return (0);
-
-      do_fail5:
-       remove_proc_entry(HOTKEY_INFO, hotkey_proc_dir);
-      do_fail4:
-       remove_proc_entry(HOTKEY_ACTION, hotkey_proc_dir);
-      do_fail3:
-       remove_proc_entry(HOTKEY_PL_CONFIG, hotkey_proc_dir);
-      do_fail2:
-       remove_proc_entry(HOTKEY_EV_CONFIG, hotkey_proc_dir);
-      do_fail1:
-       remove_proc_entry(HOTKEY_PROC, acpi_root_dir);
-       return (-ENODEV);
-}
-
-static void __exit hotkey_exit(void)
-{
-       struct list_head *entries, *next;
-
-
-       list_for_each_safe(entries, next, global_hotkey_list.entries) {
-               union acpi_hotkey *key =
-                   container_of(entries, union acpi_hotkey, entries);
-
-               acpi_os_wait_events_complete(NULL);
-               list_del(&key->link.entries);
-               global_hotkey_list.count--;
-               free_hotkey_device(key);
-       }
-       acpi_bus_unregister_driver(&hotkey_driver);
-       remove_proc_entry(HOTKEY_EV_CONFIG, hotkey_proc_dir);
-       remove_proc_entry(HOTKEY_PL_CONFIG, hotkey_proc_dir);
-       remove_proc_entry(HOTKEY_ACTION, hotkey_proc_dir);
-       remove_proc_entry(HOTKEY_INFO, hotkey_proc_dir);
-       remove_proc_entry(HOTKEY_PROC, acpi_root_dir);
-       return;
-}
-
-module_init(hotkey_init);
-module_exit(hotkey_exit);
index 76ec8b63e69f80ed0ef1c29fccd425df32b629a2..acab4a4818974df5487cdc27efcc3fad7d084308 100644 (file)
 #define ACPI_EC_HC_COMPONENT   0x00080000
 #define ACPI_EC_HC_CLASS       "ec_hc_smbus"
 #define ACPI_EC_HC_HID         "ACPI0001"
-#define ACPI_EC_HC_DRIVER_NAME "ACPI EC HC smbus driver"
 #define ACPI_EC_HC_DEVICE_NAME "EC HC smbus"
 
 #define _COMPONENT             ACPI_EC_HC_COMPONENT
 
-ACPI_MODULE_NAME("acpi_smbus")
+ACPI_MODULE_NAME("i2c_ec");
 
 static int acpi_ec_hc_add(struct acpi_device *device);
 static int acpi_ec_hc_remove(struct acpi_device *device, int type);
 
 static struct acpi_driver acpi_ec_hc_driver = {
-       .name = ACPI_EC_HC_DRIVER_NAME,
+       .name = "i2c_ec",
        .class = ACPI_EC_HC_CLASS,
        .ids = ACPI_EC_HC_HID,
        .ops = {
index c6144ca6663861529a65d1f7f5c5d618be1f43f3..1a0ed3dc409c8426d1e79f084a1ce0e38451bac7 100644 (file)
@@ -496,6 +496,10 @@ static int ibm_acpi_driver_init(void)
        printk(IBM_INFO "%s v%s\n", IBM_DESC, IBM_VERSION);
        printk(IBM_INFO "%s\n", IBM_URL);
 
+       if (ibm_thinkpad_ec_found)
+               printk(IBM_INFO "ThinkPad EC firmware %s\n",
+                      ibm_thinkpad_ec_found);
+
        return 0;
 }
 
@@ -2617,7 +2621,7 @@ static void __init ibm_handle_init(char *name,
        ibm_handle_init(#object, &object##_handle, *object##_parent,    \
                object##_paths, ARRAY_SIZE(object##_paths), &object##_path)
 
-static int set_ibm_param(const char *val, struct kernel_param *kp)
+static int __init set_ibm_param(const char *val, struct kernel_param *kp)
 {
        unsigned int i;
 
@@ -2659,7 +2663,8 @@ static void acpi_ibm_exit(void)
        for (i = ARRAY_SIZE(ibms) - 1; i >= 0; i--)
                ibm_exit(&ibms[i]);
 
-       remove_proc_entry(IBM_DIR, acpi_root_dir);
+       if (proc_dir)
+               remove_proc_entry(IBM_DIR, acpi_root_dir);
 
        if (ibm_thinkpad_ec_found)
                kfree(ibm_thinkpad_ec_found);
@@ -2696,11 +2701,6 @@ static int __init acpi_ibm_init(void)
        if (acpi_disabled)
                return -ENODEV;
 
-       if (!acpi_specific_hotkey_enabled) {
-               printk(IBM_ERR "using generic hotkey driver\n");
-               return -ENODEV;
-       }
-
        /* ec is required because many other handles are relative to it */
        IBM_HANDLE_INIT(ec);
        if (!ec_handle) {
@@ -2710,9 +2710,6 @@ static int __init acpi_ibm_init(void)
 
        /* Models with newer firmware report the EC in DMI */
        ibm_thinkpad_ec_found = check_dmi_for_ec();
-       if (ibm_thinkpad_ec_found)
-               printk(IBM_INFO "ThinkPad EC firmware %s\n",
-                      ibm_thinkpad_ec_found);
 
        /* these handles are not required */
        IBM_HANDLE_INIT(vid);
@@ -2742,6 +2739,7 @@ static int __init acpi_ibm_init(void)
        proc_dir = proc_mkdir(IBM_DIR, acpi_root_dir);
        if (!proc_dir) {
                printk(IBM_ERR "unable to create proc dir %s", IBM_DIR);
+               acpi_ibm_exit();
                return -ENODEV;
        }
        proc_dir->owner = THIS_MODULE;
index 4a9faff4c01dc897bd113dabd50ec961024125a8..8fcd6a15517f5810ee6b2b6f98ba33d01d8d707a 100644 (file)
@@ -33,7 +33,7 @@
 
 #define ACPI_NUMA      0x80000000
 #define _COMPONENT     ACPI_NUMA
-ACPI_MODULE_NAME("numa")
+ACPI_MODULE_NAME("numa");
 
 static nodemask_t nodes_found_map = NODE_MASK_NONE;
 #define PXM_INVAL      -1
@@ -45,12 +45,6 @@ int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS]
 int __cpuinitdata node_to_pxm_map[MAX_NUMNODES]
                                = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL };
 
-extern int __init acpi_table_parse_madt_family(char *id,
-                                              unsigned long madt_size,
-                                              int entry_id,
-                                              acpi_madt_entry_handler handler,
-                                              unsigned int max_entries);
-
 int __cpuinit pxm_to_node(int pxm)
 {
        if (pxm < 0)
@@ -208,9 +202,9 @@ static int __init acpi_parse_srat(struct acpi_table_header *table)
 
 int __init
 acpi_table_parse_srat(enum acpi_srat_type id,
-                     acpi_madt_entry_handler handler, unsigned int max_entries)
+                     acpi_table_entry_handler handler, unsigned int max_entries)
 {
-       return acpi_table_parse_madt_family(ACPI_SIG_SRAT,
+       return acpi_table_parse_entries(ACPI_SIG_SRAT,
                                            sizeof(struct acpi_table_srat), id,
                                            handler, max_entries);
 }
@@ -220,9 +214,7 @@ int __init acpi_numa_init(void)
        int result;
 
        /* SRAT: Static Resource Affinity Table */
-       result = acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat);
-
-       if (result > 0) {
+       if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
                result = acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
                                               acpi_parse_processor_affinity,
                                               NR_CPUS);
@@ -230,7 +222,7 @@ int __init acpi_numa_init(void)
        }
 
        /* SLIT: System Locality Information Table */
-       result = acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit);
+       acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit);
 
        acpi_numa_arch_fixup();
        return 0;
index 0f6f3bcbc8ebc2d4b0c06cb8f1443d1fb5e6e9b6..971eca4864fab3223bc68d97cd032a56d428f4ea 100644 (file)
@@ -46,7 +46,7 @@
 #include <linux/efi.h>
 
 #define _COMPONENT             ACPI_OS_SERVICES
-ACPI_MODULE_NAME("osl")
+ACPI_MODULE_NAME("osl");
 #define PREFIX         "ACPI: "
 struct acpi_os_dpc {
        acpi_osd_exec_callback function;
@@ -68,9 +68,6 @@ EXPORT_SYMBOL(acpi_in_debugger);
 extern char line_buf[80];
 #endif                         /*ENABLE_DEBUGGER */
 
-int acpi_specific_hotkey_enabled = TRUE;
-EXPORT_SYMBOL(acpi_specific_hotkey_enabled);
-
 static unsigned int acpi_irq_irq;
 static acpi_osd_handler acpi_irq_handler;
 static void *acpi_irq_context;
@@ -205,7 +202,7 @@ void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
 {
        if (phys > ULONG_MAX) {
                printk(KERN_ERR PREFIX "Cannot map memory that high\n");
-               return 0;
+               return NULL;
        }
        if (acpi_gbl_permanent_mmap)
                /*
@@ -890,26 +887,6 @@ u32 acpi_os_get_line(char *buffer)
 }
 #endif                         /*  ACPI_FUTURE_USAGE  */
 
-/* Assumes no unreadable holes inbetween */
-u8 acpi_os_readable(void *ptr, acpi_size len)
-{
-#if defined(__i386__) || defined(__x86_64__)
-       char tmp;
-       return !__get_user(tmp, (char __user *)ptr)
-           && !__get_user(tmp, (char __user *)ptr + len - 1);
-#endif
-       return 1;
-}
-
-#ifdef ACPI_FUTURE_USAGE
-u8 acpi_os_writable(void *ptr, acpi_size len)
-{
-       /* could do dummy write (racy) or a kernel page table lookup.
-          The later may be difficult at early boot when kmap doesn't work yet. */
-       return 1;
-}
-#endif
-
 acpi_status acpi_os_signal(u32 function, void *info)
 {
        switch (function) {
@@ -1012,14 +989,6 @@ static int __init acpi_wake_gpes_always_on_setup(char *str)
 
 __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup);
 
-static int __init acpi_hotkey_setup(char *str)
-{
-       acpi_specific_hotkey_enabled = FALSE;
-       return 1;
-}
-
-__setup("acpi_generic_hotkey", acpi_hotkey_setup);
-
 /*
  * max_cstate is defined in the base kernel so modules can
  * change it w/o depending on the state of the processor module.
index 55f57a61c55e19bab562c331473ea9abee9bc89f..028969370bbf821d9c015353f5d0d69b0cebc2c9 100644 (file)
@@ -36,7 +36,7 @@
 #include <acpi/acpi_drivers.h>
 
 #define _COMPONENT             ACPI_PCI_COMPONENT
-ACPI_MODULE_NAME("pci_bind")
+ACPI_MODULE_NAME("pci_bind");
 
 struct acpi_pci_data {
        struct acpi_pci_id id;
index fe7d007833ade1b03ba2660269bcd10d42440c54..dd3186abe07a9c464df616aae6fb05454fb53085 100644 (file)
@@ -38,7 +38,7 @@
 #include <acpi/acpi_drivers.h>
 
 #define _COMPONENT             ACPI_PCI_COMPONENT
-ACPI_MODULE_NAME("pci_irq")
+ACPI_MODULE_NAME("pci_irq");
 
 static struct acpi_prt_list acpi_prt;
 static DEFINE_SPINLOCK(acpi_prt_lock);
index 0f683c8c6fbc76676b193241e5af457118c7915f..acc594771379af521ef06a5f7a549ca781583d8d 100644 (file)
 #include <acpi/acpi_drivers.h>
 
 #define _COMPONENT             ACPI_PCI_COMPONENT
-ACPI_MODULE_NAME("pci_link")
+ACPI_MODULE_NAME("pci_link");
 #define ACPI_PCI_LINK_CLASS            "pci_irq_routing"
 #define ACPI_PCI_LINK_HID              "PNP0C0F"
-#define ACPI_PCI_LINK_DRIVER_NAME      "ACPI PCI Interrupt Link Driver"
 #define ACPI_PCI_LINK_DEVICE_NAME      "PCI Interrupt Link"
 #define ACPI_PCI_LINK_FILE_INFO                "info"
 #define ACPI_PCI_LINK_FILE_STATUS      "state"
@@ -56,7 +55,7 @@ static int acpi_pci_link_add(struct acpi_device *device);
 static int acpi_pci_link_remove(struct acpi_device *device, int type);
 
 static struct acpi_driver acpi_pci_link_driver = {
-       .name = ACPI_PCI_LINK_DRIVER_NAME,
+       .name = "pci_link",
        .class = ACPI_PCI_LINK_CLASS,
        .ids = ACPI_PCI_LINK_HID,
        .ops = {
index 4ecf701687e8768d23135796f3c818b0b68a213f..ad4145a37786d93a974455575a411b080c4aad63 100644 (file)
 #include <acpi/acpi_drivers.h>
 
 #define _COMPONENT             ACPI_PCI_COMPONENT
-ACPI_MODULE_NAME("pci_root")
+ACPI_MODULE_NAME("pci_root");
 #define ACPI_PCI_ROOT_CLASS            "pci_bridge"
 #define ACPI_PCI_ROOT_HID              "PNP0A03"
-#define ACPI_PCI_ROOT_DRIVER_NAME      "ACPI PCI Root Bridge Driver"
 #define ACPI_PCI_ROOT_DEVICE_NAME      "PCI Root Bridge"
 static int acpi_pci_root_add(struct acpi_device *device);
 static int acpi_pci_root_remove(struct acpi_device *device, int type);
 static int acpi_pci_root_start(struct acpi_device *device);
 
 static struct acpi_driver acpi_pci_root_driver = {
-       .name = ACPI_PCI_ROOT_DRIVER_NAME,
+       .name = "pci_root",
        .class = ACPI_PCI_ROOT_CLASS,
        .ids = ACPI_PCI_ROOT_HID,
        .ops = {
index 0ba7dfbbb2eebe47ad9f673d6151f605b503ef3a..1ef338545dfef977034a490d56ae9c5f043eb948 100644 (file)
 #include <acpi/acpi_drivers.h>
 
 #define _COMPONENT             ACPI_POWER_COMPONENT
-ACPI_MODULE_NAME("acpi_power")
+ACPI_MODULE_NAME("power");
 #define ACPI_POWER_COMPONENT           0x00800000
 #define ACPI_POWER_CLASS               "power_resource"
-#define ACPI_POWER_DRIVER_NAME         "ACPI Power Resource Driver"
 #define ACPI_POWER_DEVICE_NAME         "Power Resource"
 #define ACPI_POWER_FILE_INFO           "info"
 #define ACPI_POWER_FILE_STATUS         "state"
@@ -57,25 +56,33 @@ ACPI_MODULE_NAME("acpi_power")
 #define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF
 static int acpi_power_add(struct acpi_device *device);
 static int acpi_power_remove(struct acpi_device *device, int type);
+static int acpi_power_resume(struct acpi_device *device);
 static int acpi_power_open_fs(struct inode *inode, struct file *file);
 
 static struct acpi_driver acpi_power_driver = {
-       .name = ACPI_POWER_DRIVER_NAME,
+       .name = "power",
        .class = ACPI_POWER_CLASS,
        .ids = ACPI_POWER_HID,
        .ops = {
                .add = acpi_power_add,
                .remove = acpi_power_remove,
+               .resume = acpi_power_resume,
                },
 };
 
+struct acpi_power_reference {
+       struct list_head node;
+       struct acpi_device *device;
+};
+
 struct acpi_power_resource {
        struct acpi_device * device;
        acpi_bus_id name;
        u32 system_level;
        u32 order;
        int state;
-       int references;
+       struct mutex resource_lock;
+       struct list_head reference;
 };
 
 static struct list_head acpi_power_resource_list;
@@ -171,22 +178,47 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
        return result;
 }
 
-static int acpi_power_on(acpi_handle handle)
+static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
 {
        int result = 0;
+       int found = 0;
        acpi_status status = AE_OK;
-       struct acpi_device *device = NULL;
        struct acpi_power_resource *resource = NULL;
+       struct list_head *node, *next;
+       struct acpi_power_reference *ref;
 
 
        result = acpi_power_get_context(handle, &resource);
        if (result)
                return result;
 
-       resource->references++;
+       mutex_lock(&resource->resource_lock);
+       list_for_each_safe(node, next, &resource->reference) {
+               ref = container_of(node, struct acpi_power_reference, node);
+               if (dev->handle == ref->device->handle) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] already referenced by resource [%s]\n",
+                                 dev->pnp.bus_id, resource->name));
+                       found = 1;
+                       break;
+               }
+       }
+
+       if (!found) {
+               ref = kmalloc(sizeof (struct acpi_power_reference),
+                   irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
+               if (!ref) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "kmalloc() failed\n"));
+                       mutex_unlock(&resource->resource_lock);
+                       return -ENOMEM;
+               }
+               list_add_tail(&ref->node, &resource->reference);
+               ref->device = dev;
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] added to resource [%s] references\n",
+                         dev->pnp.bus_id, resource->name));
+       }
+       mutex_unlock(&resource->resource_lock);
 
-       if ((resource->references > 1)
-           || (resource->state == ACPI_POWER_RESOURCE_STATE_ON)) {
+       if (resource->state == ACPI_POWER_RESOURCE_STATE_ON) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already on\n",
                                  resource->name));
                return 0;
@@ -203,38 +235,49 @@ static int acpi_power_on(acpi_handle handle)
                return -ENOEXEC;
 
        /* Update the power resource's _device_ power state */
-       device = resource->device;
        resource->device->power.state = ACPI_STATE_D0;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n",
                          resource->name));
-
        return 0;
 }
 
-static int acpi_power_off_device(acpi_handle handle)
+static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
 {
        int result = 0;
        acpi_status status = AE_OK;
        struct acpi_power_resource *resource = NULL;
+       struct list_head *node, *next;
+       struct acpi_power_reference *ref;
+
 
        result = acpi_power_get_context(handle, &resource);
        if (result)
                return result;
 
-       if (resource->references)
-               resource->references--;
+       mutex_lock(&resource->resource_lock);
+       list_for_each_safe(node, next, &resource->reference) {
+               ref = container_of(node, struct acpi_power_reference, node);
+               if (dev->handle == ref->device->handle) {
+                       list_del(&ref->node);
+                       kfree(ref);
+                       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] removed from resource [%s] references\n",
+                           dev->pnp.bus_id, resource->name));
+                       break;
+               }
+       }
 
-       if (resource->references) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                 "Resource [%s] is still in use, dereferencing\n",
-                                 resource->device->pnp.bus_id));
+       if (!list_empty(&resource->reference)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cannot turn resource [%s] off - resource is in use\n",
+                   resource->name));
+               mutex_unlock(&resource->resource_lock);
                return 0;
        }
+       mutex_unlock(&resource->resource_lock);
 
        if (resource->state == ACPI_POWER_RESOURCE_STATE_OFF) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already off\n",
-                                 resource->device->pnp.bus_id));
+                                 resource->name));
                return 0;
        }
 
@@ -276,7 +319,7 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev)
        arg.integer.value = 1;
        /* Open power resource */
        for (i = 0; i < dev->wakeup.resources.count; i++) {
-               ret = acpi_power_on(dev->wakeup.resources.handles[i]);
+               ret = acpi_power_on(dev->wakeup.resources.handles[i], dev);
                if (ret) {
                        printk(KERN_ERR PREFIX "Transition power state\n");
                        dev->wakeup.flags.valid = 0;
@@ -323,7 +366,7 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev)
 
        /* Close power resource */
        for (i = 0; i < dev->wakeup.resources.count; i++) {
-               ret = acpi_power_off_device(dev->wakeup.resources.handles[i]);
+               ret = acpi_power_off_device(dev->wakeup.resources.handles[i], dev);
                if (ret) {
                        printk(KERN_ERR PREFIX "Transition power state\n");
                        dev->wakeup.flags.valid = 0;
@@ -407,16 +450,20 @@ int acpi_power_transition(struct acpi_device *device, int state)
         * (e.g. so the device doesn't lose power while transitioning).
         */
        for (i = 0; i < tl->count; i++) {
-               result = acpi_power_on(tl->handles[i]);
+               result = acpi_power_on(tl->handles[i], device);
                if (result)
                        goto end;
        }
 
+       if (device->power.state == state) {
+               goto end;
+       }
+
        /*
         * Then we dereference all power resources used in the current list.
         */
        for (i = 0; i < cl->count; i++) {
-               result = acpi_power_off_device(cl->handles[i]);
+               result = acpi_power_off_device(cl->handles[i], device);
                if (result)
                        goto end;
        }
@@ -439,7 +486,11 @@ static struct proc_dir_entry *acpi_power_dir;
 
 static int acpi_power_seq_show(struct seq_file *seq, void *offset)
 {
+       int count = 0;
+       int result = 0;
        struct acpi_power_resource *resource = NULL;
+       struct list_head *node, *next;
+       struct acpi_power_reference *ref;
 
 
        resource = seq->private;
@@ -447,6 +498,10 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset)
        if (!resource)
                goto end;
 
+       result = acpi_power_get_state(resource);
+       if (result)
+               goto end;
+
        seq_puts(seq, "state:                   ");
        switch (resource->state) {
        case ACPI_POWER_RESOURCE_STATE_ON:
@@ -460,11 +515,18 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset)
                break;
        }
 
+       mutex_lock(&resource->resource_lock);
+       list_for_each_safe(node, next, &resource->reference) {
+               ref = container_of(node, struct acpi_power_reference, node);
+               count++;
+       }
+       mutex_unlock(&resource->resource_lock);
+
        seq_printf(seq, "system level:            S%d\n"
                   "order:                   %d\n"
                   "reference count:         %d\n",
                   resource->system_level,
-                  resource->order, resource->references);
+                  resource->order, count);
 
       end:
        return 0;
@@ -537,6 +599,8 @@ static int acpi_power_add(struct acpi_device *device)
                return -ENOMEM;
 
        resource->device = device;
+       mutex_init(&resource->resource_lock);
+       INIT_LIST_HEAD(&resource->reference);
        strcpy(resource->name, device->pnp.bus_id);
        strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
@@ -584,6 +648,7 @@ static int acpi_power_add(struct acpi_device *device)
 static int acpi_power_remove(struct acpi_device *device, int type)
 {
        struct acpi_power_resource *resource = NULL;
+       struct list_head *node, *next;
 
 
        if (!device || !acpi_driver_data(device))
@@ -593,11 +658,54 @@ static int acpi_power_remove(struct acpi_device *device, int type)
 
        acpi_power_remove_fs(device);
 
+       mutex_lock(&resource->resource_lock);
+       list_for_each_safe(node, next, &resource->reference) {
+               struct acpi_power_reference *ref = container_of(node, struct acpi_power_reference, node);
+               list_del(&ref->node);
+               kfree(ref);
+       }
+       mutex_unlock(&resource->resource_lock);
+
        kfree(resource);
 
        return 0;
 }
 
+static int acpi_power_resume(struct acpi_device *device)
+{
+       int result = 0;
+       struct acpi_power_resource *resource = NULL;
+       struct acpi_power_reference *ref;
+
+       if (!device || !acpi_driver_data(device))
+               return -EINVAL;
+
+       resource = (struct acpi_power_resource *)acpi_driver_data(device);
+
+       result = acpi_power_get_state(resource);
+       if (result)
+               return result;
+
+       mutex_lock(&resource->resource_lock);
+       if ((resource->state == ACPI_POWER_RESOURCE_STATE_ON) &&
+           list_empty(&resource->reference)) {
+               mutex_unlock(&resource->resource_lock);
+               result = acpi_power_off_device(device->handle, NULL);
+               return result;
+       }
+
+       if ((resource->state == ACPI_POWER_RESOURCE_STATE_OFF) &&
+           !list_empty(&resource->reference)) {
+               ref = container_of(resource->reference.next, struct acpi_power_reference, node);
+               mutex_unlock(&resource->resource_lock);
+               result = acpi_power_on(device->handle, ref->device);
+               return result;
+       }
+
+       mutex_unlock(&resource->resource_lock);
+       return 0;
+}
+
 static int __init acpi_power_init(void)
 {
        int result = 0;
index 0079bc51082c723eb35ee5098159f1acf3574ba2..99d1516d1e7023c067b8485272440dab43111485 100644 (file)
@@ -60,7 +60,6 @@
 
 #define ACPI_PROCESSOR_COMPONENT       0x01000000
 #define ACPI_PROCESSOR_CLASS           "processor"
-#define ACPI_PROCESSOR_DRIVER_NAME     "ACPI Processor Driver"
 #define ACPI_PROCESSOR_DEVICE_NAME     "Processor"
 #define ACPI_PROCESSOR_FILE_INFO       "info"
 #define ACPI_PROCESSOR_FILE_THROTTLING "throttling"
 #define ACPI_STA_PRESENT 0x00000001
 
 #define _COMPONENT             ACPI_PROCESSOR_COMPONENT
-ACPI_MODULE_NAME("acpi_processor")
+ACPI_MODULE_NAME("processor_core");
 
-    MODULE_AUTHOR("Paul Diefenbaugh");
-MODULE_DESCRIPTION(ACPI_PROCESSOR_DRIVER_NAME);
+MODULE_AUTHOR("Paul Diefenbaugh");
+MODULE_DESCRIPTION("ACPI Processor Driver");
 MODULE_LICENSE("GPL");
 
 static int acpi_processor_add(struct acpi_device *device);
@@ -89,7 +88,7 @@ static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu);
 static int acpi_processor_handle_eject(struct acpi_processor *pr);
 
 static struct acpi_driver acpi_processor_driver = {
-       .name = ACPI_PROCESSOR_DRIVER_NAME,
+       .name = "processor",
        .class = ACPI_PROCESSOR_CLASS,
        .ids = ACPI_PROCESSOR_HID,
        .ops = {
@@ -404,7 +403,7 @@ static int map_lsapic_id(struct acpi_subtable_header *entry,
        if (lsapic->lapic_flags & ACPI_MADT_ENABLED) {
                /* First check against id */
                if (lsapic->processor_id == acpi_id) {
-                       *apic_id = lsapic->id;
+                       *apic_id = (lsapic->id << 8) | lsapic->eid;
                        return 1;
                /* Check against optional uid */
                } else if (entry->length >= 16 &&
@@ -1005,7 +1004,7 @@ static int __init acpi_processor_init(void)
 #ifdef CONFIG_SMP
        if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_MADT, 0,
                                (struct acpi_table_header **)&madt)))
-               madt = 0;
+               madt = NULL;
 #endif
 
        acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
index 8206fc1ecc580621a8fd5195b823829765f4492c..60773005b8afacbe24024a9ea33e96cc578ac59d 100644 (file)
 #include <asm/apic.h>
 #endif
 
+/*
+ * Include the apic definitions for x86 to have the APIC timer related defines
+ * available also for UP (on SMP it gets magically included via linux/smp.h).
+ */
+#ifdef CONFIG_X86
+#include <asm/apic.h>
+#endif
+
 #include <asm/io.h>
 #include <asm/uaccess.h>
 
@@ -59,9 +67,8 @@
 
 #define ACPI_PROCESSOR_COMPONENT        0x01000000
 #define ACPI_PROCESSOR_CLASS            "processor"
-#define ACPI_PROCESSOR_DRIVER_NAME      "ACPI Processor Driver"
 #define _COMPONENT              ACPI_PROCESSOR_COMPONENT
-ACPI_MODULE_NAME("acpi_processor")
+ACPI_MODULE_NAME("processor_idle");
 #define ACPI_PROCESSOR_FILE_POWER      "power"
 #define US_TO_PM_TIMER_TICKS(t)                ((t * (PM_TIMER_FREQUENCY/1000)) / 1000)
 #define C2_OVERHEAD                    4       /* 1us (3.579 ticks per us) */
index 058f13cf3b796208da3a801c7e81d5c6edd82e14..2f2e7964226dcc59840cec2b0e1942a251d64880 100644 (file)
 
 #define ACPI_PROCESSOR_COMPONENT       0x01000000
 #define ACPI_PROCESSOR_CLASS           "processor"
-#define ACPI_PROCESSOR_DRIVER_NAME     "ACPI Processor Driver"
 #define ACPI_PROCESSOR_FILE_PERFORMANCE        "performance"
 #define _COMPONENT             ACPI_PROCESSOR_COMPONENT
-ACPI_MODULE_NAME("acpi_processor")
+ACPI_MODULE_NAME("processor_perflib");
 
 static DEFINE_MUTEX(performance_mutex);
 
index 40fecd67ad8371674372a77c73e9e3b0fb991cdd..06e6f3fb88254d61dda243f390a7eabc509696aa 100644 (file)
@@ -41,9 +41,8 @@
 
 #define ACPI_PROCESSOR_COMPONENT        0x01000000
 #define ACPI_PROCESSOR_CLASS            "processor"
-#define ACPI_PROCESSOR_DRIVER_NAME      "ACPI Processor Driver"
 #define _COMPONENT              ACPI_PROCESSOR_COMPONENT
-ACPI_MODULE_NAME("acpi_processor")
+ACPI_MODULE_NAME("processor_thermal");
 
 /* --------------------------------------------------------------------------
                                  Limit Interface
index 89dff3639abef84e8880590d4eb1c8e742bd71b2..b33486009f41c690f1b6bed87f4818beb17a27d6 100644 (file)
@@ -41,9 +41,8 @@
 
 #define ACPI_PROCESSOR_COMPONENT        0x01000000
 #define ACPI_PROCESSOR_CLASS            "processor"
-#define ACPI_PROCESSOR_DRIVER_NAME      "ACPI Processor Driver"
 #define _COMPONENT              ACPI_PROCESSOR_COMPONENT
-ACPI_MODULE_NAME("acpi_processor")
+ACPI_MODULE_NAME("processor_throttling");
 
 /* --------------------------------------------------------------------------
                               Throttling Control
index f58fc7447ab4ee8757885d869505a629ff4efa7a..59640d9a0acceefe1ee8a4e6d9495edb4f5c5431 100644 (file)
@@ -59,7 +59,6 @@ extern void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
 #define ACPI_AC_CLASS                  "ac_adapter"
 #define ACPI_BATTERY_CLASS             "battery"
 #define ACPI_SBS_HID                   "ACPI0002"
-#define ACPI_SBS_DRIVER_NAME           "ACPI Smart Battery System Driver"
 #define ACPI_SBS_DEVICE_NAME           "Smart Battery System"
 #define ACPI_SBS_FILE_INFO             "info"
 #define ACPI_SBS_FILE_STATE            "state"
@@ -78,7 +77,7 @@ extern void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
 #define        MAX_SBS_BAT                     4
 #define        MAX_SMBUS_ERR                   1
 
-ACPI_MODULE_NAME("acpi_sbs");
+ACPI_MODULE_NAME("sbs");
 
 MODULE_AUTHOR("Rich Townsend");
 MODULE_DESCRIPTION("Smart Battery System ACPI interface driver");
@@ -110,7 +109,7 @@ static void acpi_battery_smbus_err_handler(struct acpi_ec_smbus *smbus);
 static void acpi_sbs_update_queue(void *data);
 
 static struct acpi_driver acpi_sbs_driver = {
-       .name = ACPI_SBS_DRIVER_NAME,
+       .name = "sbs",
        .class = ACPI_SBS_CLASS,
        .ids = ACPI_SBS_HID,
        .ops = {
@@ -1034,21 +1033,19 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
        } else {
                seq_printf(seq, "capacity state:          ok\n");
        }
+
+       foo = (s16) battery->state.amperage * battery->info.ipscale;
+       if (battery->info.capacity_mode) {
+               foo = foo * battery->info.design_voltage / 1000;
+       }
        if (battery->state.amperage < 0) {
                seq_printf(seq, "charging state:          discharging\n");
-               foo = battery->state.remaining_capacity * cscale * 60 /
-                   (battery->state.average_time_to_empty == 0 ? 1 :
-                    battery->state.average_time_to_empty);
-               seq_printf(seq, "present rate:            %i%s\n",
-                          foo, battery->info.capacity_mode ? "0 mW" : " mA");
+               seq_printf(seq, "present rate:            %d %s\n",
+                          -foo, battery->info.capacity_mode ? "mW" : "mA");
        } else if (battery->state.amperage > 0) {
                seq_printf(seq, "charging state:          charging\n");
-               foo = (battery->info.full_charge_capacity -
-                      battery->state.remaining_capacity) * cscale * 60 /
-                   (battery->state.average_time_to_full == 0 ? 1 :
-                    battery->state.average_time_to_full);
-               seq_printf(seq, "present rate:            %i%s\n",
-                          foo, battery->info.capacity_mode ? "0 mW" : " mA");
+               seq_printf(seq, "present rate:            %d %s\n",
+                          foo, battery->info.capacity_mode ? "mW" : "mA");
        } else {
                seq_printf(seq, "charging state:          charged\n");
                seq_printf(seq, "present rate:            0 %s\n",
index 64f26db10c8efd765fcde8e8d0eb821b3a06efc2..bb0e0da39fb15d355be664e5ae23f1dc5e632441 100644 (file)
 #include <acpi/acinterp.h>     /* for acpi_ex_eisa_id_to_string() */
 
 #define _COMPONENT             ACPI_BUS_COMPONENT
-ACPI_MODULE_NAME("scan")
+ACPI_MODULE_NAME("scan");
 #define STRUCT_TO_INT(s)       (*((int*)&s))
 extern struct acpi_device *acpi_root;
 
 #define ACPI_BUS_CLASS                 "system_bus"
 #define ACPI_BUS_HID                   "ACPI_BUS"
-#define ACPI_BUS_DRIVER_NAME           "ACPI Bus Driver"
 #define ACPI_BUS_DEVICE_NAME           "System Bus"
 
 static LIST_HEAD(acpi_device_list);
index 62ce87d7165101078aa829b73294dd6922e1519a..37a0930fc0a6ac538fbb2407e3ebb6f71a203753 100644 (file)
@@ -200,7 +200,7 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
        {},
 };
 
-static int __init acpi_sleep_init(void)
+int __init acpi_sleep_init(void)
 {
        int i = 0;
 
@@ -229,4 +229,3 @@ static int __init acpi_sleep_init(void)
        return 0;
 }
 
-late_initcall(acpi_sleep_init);
index 7147b0bdab0a83f8581d79bf192ea986deea10f5..83a8d3097904e99dbb825736ee84294bd4739de5 100644 (file)
 #include <acpi/acpi_drivers.h>
 
 #define _COMPONENT             ACPI_SYSTEM_COMPONENT
-ACPI_MODULE_NAME("acpi_system")
+ACPI_MODULE_NAME("system");
 #ifdef MODULE_PARAM_PREFIX
 #undef MODULE_PARAM_PREFIX
 #endif
 #define MODULE_PARAM_PREFIX "acpi."
 
 #define ACPI_SYSTEM_CLASS              "system"
-#define ACPI_SYSTEM_DRIVER_NAME                "ACPI System Driver"
 #define ACPI_SYSTEM_DEVICE_NAME                "System"
 #define ACPI_SYSTEM_FILE_INFO          "info"
 #define ACPI_SYSTEM_FILE_EVENT         "event"
index 45bd17313c4a8a9cc92a274cc5fbaa88cdee328e..849e2c361804bd91fbba7279e149469e1848f56f 100644 (file)
@@ -169,40 +169,40 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header * header)
 
 
 int __init
-acpi_table_parse_madt_family(char *id,
-                            unsigned long madt_size,
+acpi_table_parse_entries(char *id,
+                            unsigned long table_size,
                             int entry_id,
-                            acpi_madt_entry_handler handler,
+                            acpi_table_entry_handler handler,
                             unsigned int max_entries)
 {
-       struct acpi_table_header *madt = NULL;
+       struct acpi_table_header *table_header = NULL;
        struct acpi_subtable_header *entry;
        unsigned int count = 0;
-       unsigned long madt_end;
+       unsigned long table_end;
 
        if (!handler)
                return -EINVAL;
 
-       /* Locate the MADT (if exists). There should only be one. */
-       acpi_get_table(id, 0, &madt);
+       /* Locate the table (if exists). There should only be one. */
+       acpi_get_table(id, 0, &table_header);
 
-       if (!madt) {
+       if (!table_header) {
                printk(KERN_WARNING PREFIX "%4.4s not present\n", id);
                return -ENODEV;
        }
 
-       madt_end = (unsigned long)madt + madt->length;
+       table_end = (unsigned long)table_header + table_header->length;
 
        /* Parse all entries looking for a match. */
 
        entry = (struct acpi_subtable_header *)
-           ((unsigned long)madt + madt_size);
+           ((unsigned long)table_header + table_size);
 
        while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
-              madt_end) {
+              table_end) {
                if (entry->type == entry_id
                    && (!max_entries || count++ < max_entries))
-                       if (handler(entry, madt_end))
+                       if (handler(entry, table_end))
                                return -EINVAL;
 
                entry = (struct acpi_subtable_header *)
@@ -218,13 +218,22 @@ acpi_table_parse_madt_family(char *id,
 
 int __init
 acpi_table_parse_madt(enum acpi_madt_type id,
-                     acpi_madt_entry_handler handler, unsigned int max_entries)
+                     acpi_table_entry_handler handler, unsigned int max_entries)
 {
-       return acpi_table_parse_madt_family(ACPI_SIG_MADT,
+       return acpi_table_parse_entries(ACPI_SIG_MADT,
                                            sizeof(struct acpi_table_madt), id,
                                            handler, max_entries);
 }
 
+/**
+ * acpi_table_parse - find table with @id, run @handler on it
+ *
+ * @id: table id to find
+ * @handler: handler to run
+ *
+ * Scan the ACPI System Descriptor Table (STD) for a table matching @id,
+ * run @handler on it.  Return 0 if table found, return on if not.
+ */
 int __init acpi_table_parse(char *id, acpi_table_handler handler)
 {
        struct acpi_table_header *table = NULL;
@@ -234,9 +243,9 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
        acpi_get_table(id, 0, &table);
        if (table) {
                handler(table);
-               return 1;
-       } else
                return 0;
+       } else
+               return 1;
 }
 
 /*
index 807978d5381abb34767687de505600b0e8d6aa8a..417ef5fa7666e4a09b49f25a764778778de84cd4 100644 (file)
@@ -338,9 +338,9 @@ acpi_status acpi_unload_table_id(acpi_owner_id id)
        int i;
        acpi_status status = AE_NOT_EXIST;
 
-       ACPI_FUNCTION_TRACE(acpi_unload_table);
+       ACPI_FUNCTION_TRACE(acpi_unload_table_id);
 
-       /* Find table from the requested type list */
+       /* Find table in the global table list */
        for (i = 0; i < acpi_gbl_root_table_list.count; ++i) {
                if (id != acpi_gbl_root_table_list.tables[i].owner_id) {
                        continue;
@@ -352,8 +352,9 @@ acpi_status acpi_unload_table_id(acpi_owner_id id)
                * simply a position within the hierarchy
                */
                acpi_tb_delete_namespace_by_owner(i);
-               acpi_tb_release_owner_id(i);
+               status = acpi_tb_release_owner_id(i);
                acpi_tb_set_table_loaded_flag(i, FALSE);
+               break;
        }
        return_ACPI_STATUS(status);
 }
@@ -408,7 +409,7 @@ acpi_get_table(char *signature,
                }
 
                if (!acpi_gbl_permanent_mmap) {
-                       acpi_gbl_root_table_list.tables[i].pointer = 0;
+                       acpi_gbl_root_table_list.tables[i].pointer = NULL;
                }
 
                return (status);
index 986afd470a148fabd84911a0e65bd44184f11295..0ae8b9310cbf98d2320dc40800f08b12bb0f7f48 100644 (file)
@@ -47,7 +47,6 @@
 
 #define ACPI_THERMAL_COMPONENT         0x04000000
 #define ACPI_THERMAL_CLASS             "thermal_zone"
-#define ACPI_THERMAL_DRIVER_NAME       "ACPI Thermal Zone Driver"
 #define ACPI_THERMAL_DEVICE_NAME       "Thermal Zone"
 #define ACPI_THERMAL_FILE_STATE                "state"
 #define ACPI_THERMAL_FILE_TEMPERATURE  "temperature"
 #define CELSIUS_TO_KELVIN(t)   ((t+273)*10)
 
 #define _COMPONENT             ACPI_THERMAL_COMPONENT
-ACPI_MODULE_NAME("acpi_thermal")
+ACPI_MODULE_NAME("thermal");
 
 MODULE_AUTHOR("Paul Diefenbaugh");
-MODULE_DESCRIPTION(ACPI_THERMAL_DRIVER_NAME);
+MODULE_DESCRIPTION("ACPI Thermal Zone Driver");
 MODULE_LICENSE("GPL");
 
 static int tzp;
@@ -99,7 +98,7 @@ static ssize_t acpi_thermal_write_polling(struct file *, const char __user *,
                                          size_t, loff_t *);
 
 static struct acpi_driver acpi_thermal_driver = {
-       .name = ACPI_THERMAL_DRIVER_NAME,
+       .name = "thermal",
        .class = ACPI_THERMAL_CLASS,
        .ids = ACPI_THERMAL_HID,
        .ops = {
@@ -270,7 +269,7 @@ static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds)
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "Polling frequency set to %lu seconds\n",
-                         tz->polling_frequency));
+                         tz->polling_frequency/10));
 
        return 0;
 }
@@ -1357,28 +1356,32 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
 static int acpi_thermal_resume(struct acpi_device *device)
 {
        struct acpi_thermal *tz = NULL;
-       int i;
+       int i, j, power_state, result;
+
 
        if (!device || !acpi_driver_data(device))
                return -EINVAL;
 
        tz = acpi_driver_data(device);
 
-       acpi_thermal_get_temperature(tz);
-
        for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
-               if (tz->trips.active[i].flags.valid) {
-                       tz->temperature = tz->trips.active[i].temperature;
-                       tz->trips.active[i].flags.enabled = 0;
-
-                       acpi_thermal_active(tz);
-
-                       tz->state.active |= tz->trips.active[i].flags.enabled;
-                       tz->state.active_index = i;
+               if (!(&tz->trips.active[i]))
+                       break;
+               if (!tz->trips.active[i].flags.valid)
+                       break;
+               tz->trips.active[i].flags.enabled = 1;
+               for (j = 0; j < tz->trips.active[i].devices.count; j++) {
+                       result = acpi_bus_get_power(tz->trips.active[i].devices.
+                           handles[j], &power_state);
+                       if (result || (power_state != ACPI_STATE_D0)) {
+                               tz->trips.active[i].flags.enabled = 0;
+                               break;
+                       }
                }
+               tz->state.active |= tz->trips.active[i].flags.enabled;
        }
 
-       acpi_thermal_check(tz);
+       acpi_thermal_check(tz);
 
        return AE_OK;
 }
index d9b651ffcdc0c21335f1c15e1e7ef7e3d86361cf..faf8a5232d8e5d94d285f7c92bc4b6856ace05bb 100644 (file)
@@ -125,7 +125,7 @@ static int write_acpi_int(const char *methodName, int val)
        union acpi_object in_objs[1];
        acpi_status status;
 
-       params.count = sizeof(in_objs) / sizeof(in_objs[0]);
+       params.count = ARRAY_SIZE(in_objs);
        params.pointer = in_objs;
        in_objs[0].type = ACPI_TYPE_INTEGER;
        in_objs[0].integer.value = val;
@@ -561,10 +561,6 @@ static int __init toshiba_acpi_init(void)
        if (acpi_disabled)
                return -ENODEV;
 
-       if (!acpi_specific_hotkey_enabled) {
-               printk(MY_INFO "Using generic hotkey driver\n");
-               return -ENODEV;
-       }
        /* simple device detection: look for HCI method */
        if (is_valid_acpi_path(METHOD_HCI_1))
                method_hci = METHOD_HCI_1;
index f777cebdc46dd85f8ec66b491096f9d2f20af1a3..673a0caa4073438f3f22af2dcad6a6e9f4bdc029 100644 (file)
@@ -170,7 +170,6 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
                        acpi_os_delete_mutex(object->mutex.os_mutex);
                        acpi_gbl_global_lock_mutex = NULL;
                } else {
-                       acpi_ex_unlink_mutex(object);
                        acpi_os_delete_mutex(object->mutex.os_mutex);
                }
                break;
index 68a809fa7b19d06ef9f9457120d05fdbbecdb9b2..34f1575710807eada4cfd4ff8162b9753b4cfd1b 100644 (file)
@@ -31,7 +31,7 @@
 #include <acpi/acpi_drivers.h>
 
 #define _COMPONENT             ACPI_BUS_COMPONENT
-ACPI_MODULE_NAME("acpi_utils")
+ACPI_MODULE_NAME("utils");
 
 /* --------------------------------------------------------------------------
                             Object Evaluation Helpers
index e0b97add8c6355274cb220b04352c9927263b5d2..bf525cca3b637160a3c1b28f95269ea108c1dfd3 100644 (file)
@@ -40,7 +40,6 @@
 
 #define ACPI_VIDEO_COMPONENT           0x08000000
 #define ACPI_VIDEO_CLASS               "video"
-#define ACPI_VIDEO_DRIVER_NAME         "ACPI Video Driver"
 #define ACPI_VIDEO_BUS_NAME            "Video Bus"
 #define ACPI_VIDEO_DEVICE_NAME         "Video Device"
 #define ACPI_VIDEO_NOTIFY_SWITCH       0x80
 #define ACPI_VIDEO_DISPLAY_LCD 4
 
 #define _COMPONENT             ACPI_VIDEO_COMPONENT
-ACPI_MODULE_NAME("acpi_video")
+ACPI_MODULE_NAME("video");
 
-    MODULE_AUTHOR("Bruno Ducrot");
-MODULE_DESCRIPTION(ACPI_VIDEO_DRIVER_NAME);
+MODULE_AUTHOR("Bruno Ducrot");
+MODULE_DESCRIPTION("ACPI Video Driver");
 MODULE_LICENSE("GPL");
 
 static int acpi_video_bus_add(struct acpi_device *device);
 static int acpi_video_bus_remove(struct acpi_device *device, int type);
 
 static struct acpi_driver acpi_video_bus = {
-       .name = ACPI_VIDEO_DRIVER_NAME,
+       .name = "video",
        .class = ACPI_VIDEO_CLASS,
        .ids = ACPI_VIDEO_HID,
        .ops = {
index 3747457fee7a1f2180dbf0abf96281494c3ff050..4af0a4bb578042fc7c58c6e4448ec01e88a1622c 100644 (file)
@@ -161,6 +161,19 @@ config SATA_INTEL_COMBINED
        depends on IDE=y && !BLK_DEV_IDE_SATA && (SATA_AHCI || ATA_PIIX)
        default y
 
+config SATA_ACPI
+       bool
+       depends on ACPI && PCI
+       default y
+       help
+         This option adds support for SATA-related ACPI objects.
+         These ACPI objects add the ability to retrieve taskfiles
+         from the ACPI BIOS and write them to the disk controller.
+         These objects may be related to performance, security,
+         power management, or other areas.
+         You can disable this at kernel boot time by using the
+         option libata.noacpi=1
+
 config PATA_ALI
        tristate "ALi PATA support (Experimental)"
        depends on PCI && EXPERIMENTAL
index cd096f0c78a105c2e9a9e605e0acdc3aed82af89..74298afbbaa7c354dd21fc9067a883f4326599e6 100644 (file)
@@ -66,4 +66,4 @@ obj-$(CONFIG_ATA_GENERIC)     += ata_generic.o
 obj-$(CONFIG_PATA_LEGACY)      += pata_legacy.o
 
 libata-objs    := libata-core.o libata-scsi.o libata-sff.o libata-eh.o
-
+libata-$(CONFIG_SATA_ACPI) += libata-acpi.o
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
new file mode 100644 (file)
index 0000000..b4e8be5
--- /dev/null
@@ -0,0 +1,698 @@
+/*
+ * libata-acpi.c
+ * Provides ACPI support for PATA/SATA.
+ *
+ * Copyright (C) 2006 Intel Corp.
+ * Copyright (C) 2006 Randy Dunlap
+ */
+
+#include <linux/ata.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/acpi.h>
+#include <linux/libata.h>
+#include <linux/pci.h>
+#include "libata.h"
+
+#include <acpi/acpi_bus.h>
+#include <acpi/acnames.h>
+#include <acpi/acnamesp.h>
+#include <acpi/acparser.h>
+#include <acpi/acexcep.h>
+#include <acpi/acmacros.h>
+#include <acpi/actypes.h>
+
+#define SATA_ROOT_PORT(x)      (((x) >> 16) & 0xffff)
+#define SATA_PORT_NUMBER(x)    ((x) & 0xffff)  /* or NO_PORT_MULT */
+#define NO_PORT_MULT           0xffff
+#define SATA_ADR_RSVD          0xffffffff
+
+#define REGS_PER_GTF           7
+struct taskfile_array {
+       u8      tfa[REGS_PER_GTF];      /* regs. 0x1f1 - 0x1f7 */
+};
+
+
+/**
+ * sata_get_dev_handle - finds acpi_handle and PCI device.function
+ * @dev: device to locate
+ * @handle: returned acpi_handle for @dev
+ * @pcidevfn: return PCI device.func for @dev
+ *
+ * This function is somewhat SATA-specific.  Or at least the
+ * PATA & SATA versions of this function are different,
+ * so it's not entirely generic code.
+ *
+ * Returns 0 on success, <0 on error.
+ */
+static int sata_get_dev_handle(struct device *dev, acpi_handle *handle,
+                                       acpi_integer *pcidevfn)
+{
+       struct pci_dev  *pci_dev;
+       acpi_integer    addr;
+
+       pci_dev = to_pci_dev(dev);      /* NOTE: PCI-specific */
+       /* Please refer to the ACPI spec for the syntax of _ADR. */
+       addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn);
+       *pcidevfn = addr;
+       *handle = acpi_get_child(DEVICE_ACPI_HANDLE(dev->parent), addr);
+       if (!*handle)
+               return -ENODEV;
+       return 0;
+}
+
+/**
+ * pata_get_dev_handle - finds acpi_handle and PCI device.function
+ * @dev: device to locate
+ * @handle: returned acpi_handle for @dev
+ * @pcidevfn: return PCI device.func for @dev
+ *
+ * The PATA and SATA versions of this function are different.
+ *
+ * Returns 0 on success, <0 on error.
+ */
+static int pata_get_dev_handle(struct device *dev, acpi_handle *handle,
+                               acpi_integer *pcidevfn)
+{
+       unsigned int bus, devnum, func;
+       acpi_integer addr;
+       acpi_handle dev_handle, parent_handle;
+       struct acpi_buffer buffer = {.length = ACPI_ALLOCATE_BUFFER,
+                                       .pointer = NULL};
+       acpi_status status;
+       struct acpi_device_info *dinfo = NULL;
+       int ret = -ENODEV;
+       struct pci_dev *pdev = to_pci_dev(dev);
+
+       bus = pdev->bus->number;
+       devnum = PCI_SLOT(pdev->devfn);
+       func = PCI_FUNC(pdev->devfn);
+
+       dev_handle = DEVICE_ACPI_HANDLE(dev);
+       parent_handle = DEVICE_ACPI_HANDLE(dev->parent);
+
+       status = acpi_get_object_info(parent_handle, &buffer);
+       if (ACPI_FAILURE(status))
+               goto err;
+
+       dinfo = buffer.pointer;
+       if (dinfo && (dinfo->valid & ACPI_VALID_ADR) &&
+           dinfo->address == bus) {
+               /* ACPI spec for _ADR for PCI bus: */
+               addr = (acpi_integer)(devnum << 16 | func);
+               *pcidevfn = addr;
+               *handle = dev_handle;
+       } else {
+               goto err;
+       }
+
+       if (!*handle)
+               goto err;
+       ret = 0;
+err:
+       kfree(dinfo);
+       return ret;
+}
+
+struct walk_info {             /* can be trimmed some */
+       struct device   *dev;
+       struct acpi_device *adev;
+       acpi_handle     handle;
+       acpi_integer    pcidevfn;
+       unsigned int    drivenum;
+       acpi_handle     obj_handle;
+       struct ata_port *ataport;
+       struct ata_device *atadev;
+       u32             sata_adr;
+       int             status;
+       char            basepath[ACPI_PATHNAME_MAX];
+       int             basepath_len;
+};
+
+static acpi_status get_devices(acpi_handle handle,
+                               u32 level, void *context, void **return_value)
+{
+       acpi_status             status;
+       struct walk_info        *winfo = context;
+       struct acpi_buffer      namebuf = {ACPI_ALLOCATE_BUFFER, NULL};
+       char                    *pathname;
+       struct acpi_buffer      buffer;
+       struct acpi_device_info *dinfo;
+
+       status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &namebuf);
+       if (status)
+               goto ret;
+       pathname = namebuf.pointer;
+
+       buffer.length = ACPI_ALLOCATE_BUFFER;
+       buffer.pointer = NULL;
+       status = acpi_get_object_info(handle, &buffer);
+       if (ACPI_FAILURE(status))
+               goto out2;
+
+       dinfo = buffer.pointer;
+
+       /* find full device path name for pcidevfn */
+       if (dinfo && (dinfo->valid & ACPI_VALID_ADR) &&
+           dinfo->address == winfo->pcidevfn) {
+               if (ata_msg_probe(winfo->ataport))
+                       ata_dev_printk(winfo->atadev, KERN_DEBUG,
+                               ":%s: matches pcidevfn (0x%llx)\n",
+                               pathname, winfo->pcidevfn);
+               strlcpy(winfo->basepath, pathname,
+                       sizeof(winfo->basepath));
+               winfo->basepath_len = strlen(pathname);
+               goto out;
+       }
+
+       /* if basepath is not yet known, ignore this object */
+       if (!winfo->basepath_len)
+               goto out;
+
+       /* if this object is in scope of basepath, maybe use it */
+       if (strncmp(pathname, winfo->basepath,
+           winfo->basepath_len) == 0) {
+               if (!(dinfo->valid & ACPI_VALID_ADR))
+                       goto out;
+               if (ata_msg_probe(winfo->ataport))
+                       ata_dev_printk(winfo->atadev, KERN_DEBUG,
+                               "GOT ONE: (%s) root_port = 0x%llx,"
+                               " port_num = 0x%llx\n", pathname,
+                               SATA_ROOT_PORT(dinfo->address),
+                               SATA_PORT_NUMBER(dinfo->address));
+               /* heuristics: */
+               if (SATA_PORT_NUMBER(dinfo->address) != NO_PORT_MULT)
+                       if (ata_msg_probe(winfo->ataport))
+                               ata_dev_printk(winfo->atadev,
+                                       KERN_DEBUG, "warning: don't"
+                                       " know how to handle SATA port"
+                                       " multiplier\n");
+               if (SATA_ROOT_PORT(dinfo->address) ==
+                       winfo->ataport->port_no &&
+                   SATA_PORT_NUMBER(dinfo->address) == NO_PORT_MULT) {
+                       if (ata_msg_probe(winfo->ataport))
+                               ata_dev_printk(winfo->atadev,
+                                       KERN_DEBUG,
+                                       "THIS ^^^^^ is the requested"
+                                       " SATA drive (handle = 0x%p)\n",
+                                       handle);
+                       winfo->sata_adr = dinfo->address;
+                       winfo->obj_handle = handle;
+               }
+       }
+out:
+       kfree(dinfo);
+out2:
+       kfree(pathname);
+
+ret:
+       return status;
+}
+
+/* Get the SATA drive _ADR object. */
+static int get_sata_adr(struct device *dev, acpi_handle handle,
+                       acpi_integer pcidevfn, unsigned int drive,
+                       struct ata_port *ap,
+                       struct ata_device *atadev, u32 *dev_adr)
+{
+       acpi_status     status;
+       struct walk_info *winfo;
+       int             err = -ENOMEM;
+
+       winfo = kzalloc(sizeof(struct walk_info), GFP_KERNEL);
+       if (!winfo)
+               goto out;
+
+       winfo->dev = dev;
+       winfo->atadev = atadev;
+       winfo->ataport = ap;
+       if (acpi_bus_get_device(handle, &winfo->adev) < 0)
+               if (ata_msg_probe(ap))
+                       ata_dev_printk(winfo->atadev, KERN_DEBUG,
+                               "acpi_bus_get_device failed\n");
+       winfo->handle = handle;
+       winfo->pcidevfn = pcidevfn;
+       winfo->drivenum = drive;
+
+       status = acpi_get_devices(NULL, get_devices, winfo, NULL);
+       if (ACPI_FAILURE(status)) {
+               if (ata_msg_probe(ap))
+                       ata_dev_printk(winfo->atadev, KERN_DEBUG,
+                               "%s: acpi_get_devices failed\n",
+                               __FUNCTION__);
+               err = -ENODEV;
+       } else {
+               *dev_adr = winfo->sata_adr;
+               atadev->obj_handle = winfo->obj_handle;
+               err = 0;
+       }
+       kfree(winfo);
+out:
+       return err;
+}
+
+/**
+ * do_drive_get_GTF - get the drive bootup default taskfile settings
+ * @ap: the ata_port for the drive
+ * @ix: target ata_device (drive) index
+ * @gtf_length: number of bytes of _GTF data returned at @gtf_address
+ * @gtf_address: buffer containing _GTF taskfile arrays
+ *
+ * This applies to both PATA and SATA drives.
+ *
+ * The _GTF method has no input parameters.
+ * It returns a variable number of register set values (registers
+ * hex 1F1..1F7, taskfiles).
+ * The <variable number> is not known in advance, so have ACPI-CA
+ * allocate the buffer as needed and return it, then free it later.
+ *
+ * The returned @gtf_length and @gtf_address are only valid if the
+ * function return value is 0.
+ */
+static int do_drive_get_GTF(struct ata_port *ap, int ix,
+                       unsigned int *gtf_length, unsigned long *gtf_address,
+                       unsigned long *obj_loc)
+{
+       acpi_status                     status;
+       acpi_handle                     dev_handle = NULL;
+       acpi_handle                     chan_handle, drive_handle;
+       acpi_integer                    pcidevfn = 0;
+       u32                             dev_adr;
+       struct acpi_buffer              output;
+       union acpi_object               *out_obj;
+       struct device                   *dev = ap->host->dev;
+       struct ata_device               *atadev = &ap->device[ix];
+       int                             err = -ENODEV;
+
+       *gtf_length = 0;
+       *gtf_address = 0UL;
+       *obj_loc = 0UL;
+
+       if (noacpi)
+               return 0;
+
+       if (ata_msg_probe(ap))
+               ata_dev_printk(atadev, KERN_DEBUG,
+                       "%s: ENTER: ap->id: %d, port#: %d\n",
+                       __FUNCTION__, ap->id, ap->port_no);
+
+       if (!ata_dev_enabled(atadev) || (ap->flags & ATA_FLAG_DISABLED)) {
+               if (ata_msg_probe(ap))
+                       ata_dev_printk(atadev, KERN_DEBUG, "%s: ERR: "
+                               "ata_dev_present: %d, PORT_DISABLED: %lu\n",
+                               __FUNCTION__, ata_dev_enabled(atadev),
+                               ap->flags & ATA_FLAG_DISABLED);
+               goto out;
+       }
+
+       /* Don't continue if device has no _ADR method.
+        * _GTF is intended for known motherboard devices. */
+       if (!(ap->cbl == ATA_CBL_SATA)) {
+               err = pata_get_dev_handle(dev, &dev_handle, &pcidevfn);
+               if (err < 0) {
+                       if (ata_msg_probe(ap))
+                               ata_dev_printk(atadev, KERN_DEBUG,
+                                       "%s: pata_get_dev_handle failed (%d)\n",
+                                       __FUNCTION__, err);
+                       goto out;
+               }
+       } else {
+               err = sata_get_dev_handle(dev, &dev_handle, &pcidevfn);
+               if (err < 0) {
+                       if (ata_msg_probe(ap))
+                               ata_dev_printk(atadev, KERN_DEBUG,
+                                       "%s: sata_get_dev_handle failed (%d\n",
+                                       __FUNCTION__, err);
+                       goto out;
+               }
+       }
+
+       /* Get this drive's _ADR info. if not already known. */
+       if (!atadev->obj_handle) {
+               if (!(ap->cbl == ATA_CBL_SATA)) {
+                       /* get child objects of dev_handle == channel objects,
+                        * + _their_ children == drive objects */
+                       /* channel is ap->port_no */
+                       chan_handle = acpi_get_child(dev_handle,
+                                               ap->port_no);
+                       if (ata_msg_probe(ap))
+                               ata_dev_printk(atadev, KERN_DEBUG,
+                                       "%s: chan adr=%d: chan_handle=0x%p\n",
+                                       __FUNCTION__, ap->port_no,
+                                       chan_handle);
+                       if (!chan_handle) {
+                               err = -ENODEV;
+                               goto out;
+                       }
+                       /* TBD: could also check ACPI object VALID bits */
+                       drive_handle = acpi_get_child(chan_handle, ix);
+                       if (!drive_handle) {
+                               err = -ENODEV;
+                               goto out;
+                       }
+                       dev_adr = ix;
+                       atadev->obj_handle = drive_handle;
+               } else {        /* for SATA mode */
+                       dev_adr = SATA_ADR_RSVD;
+                       err = get_sata_adr(dev, dev_handle, pcidevfn, 0,
+                                       ap, atadev, &dev_adr);
+               }
+               if (err < 0 || dev_adr == SATA_ADR_RSVD ||
+                   !atadev->obj_handle) {
+                       if (ata_msg_probe(ap))
+                               ata_dev_printk(atadev, KERN_DEBUG,
+                                       "%s: get_sata/pata_adr failed: "
+                                       "err=%d, dev_adr=%u, obj_handle=0x%p\n",
+                                       __FUNCTION__, err, dev_adr,
+                                       atadev->obj_handle);
+                       goto out;
+               }
+       }
+
+       /* Setting up output buffer */
+       output.length = ACPI_ALLOCATE_BUFFER;
+       output.pointer = NULL;  /* ACPI-CA sets this; save/free it later */
+
+       /* _GTF has no input parameters */
+       err = -EIO;
+       status = acpi_evaluate_object(atadev->obj_handle, "_GTF",
+                                       NULL, &output);
+       if (ACPI_FAILURE(status)) {
+               if (ata_msg_probe(ap))
+                       ata_dev_printk(atadev, KERN_DEBUG,
+                               "%s: Run _GTF error: status = 0x%x\n",
+                               __FUNCTION__, status);
+               goto out;
+       }
+
+       if (!output.length || !output.pointer) {
+               if (ata_msg_probe(ap))
+                       ata_dev_printk(atadev, KERN_DEBUG, "%s: Run _GTF: "
+                               "length or ptr is NULL (0x%llx, 0x%p)\n",
+                               __FUNCTION__,
+                               (unsigned long long)output.length,
+                               output.pointer);
+               kfree(output.pointer);
+               goto out;
+       }
+
+       out_obj = output.pointer;
+       if (out_obj->type != ACPI_TYPE_BUFFER) {
+               kfree(output.pointer);
+               if (ata_msg_probe(ap))
+                       ata_dev_printk(atadev, KERN_DEBUG, "%s: Run _GTF: "
+                               "error: expected object type of "
+                               " ACPI_TYPE_BUFFER, got 0x%x\n",
+                               __FUNCTION__, out_obj->type);
+               err = -ENOENT;
+               goto out;
+       }
+
+       if (!out_obj->buffer.length || !out_obj->buffer.pointer ||
+           out_obj->buffer.length % REGS_PER_GTF) {
+               if (ata_msg_drv(ap))
+                       ata_dev_printk(atadev, KERN_ERR,
+                               "%s: unexpected GTF length (%d) or addr (0x%p)\n",
+                               __FUNCTION__, out_obj->buffer.length,
+                               out_obj->buffer.pointer);
+               err = -ENOENT;
+               goto out;
+       }
+
+       *gtf_length = out_obj->buffer.length;
+       *gtf_address = (unsigned long)out_obj->buffer.pointer;
+       *obj_loc = (unsigned long)out_obj;
+       if (ata_msg_probe(ap))
+               ata_dev_printk(atadev, KERN_DEBUG, "%s: returning "
+                       "gtf_length=%d, gtf_address=0x%lx, obj_loc=0x%lx\n",
+                       __FUNCTION__, *gtf_length, *gtf_address, *obj_loc);
+       err = 0;
+out:
+       return err;
+}
+
+/**
+ * taskfile_load_raw - send taskfile registers to host controller
+ * @ap: Port to which output is sent
+ * @gtf: raw ATA taskfile register set (0x1f1 - 0x1f7)
+ *
+ * Outputs ATA taskfile to standard ATA host controller using MMIO
+ * or PIO as indicated by the ATA_FLAG_MMIO flag.
+ * Writes the control, feature, nsect, lbal, lbam, and lbah registers.
+ * Optionally (ATA_TFLAG_LBA48) writes hob_feature, hob_nsect,
+ * hob_lbal, hob_lbam, and hob_lbah.
+ *
+ * This function waits for idle (!BUSY and !DRQ) after writing
+ * registers.  If the control register has a new value, this
+ * function also waits for idle after writing control and before
+ * writing the remaining registers.
+ *
+ * LOCKING: TBD:
+ * Inherited from caller.
+ */
+static void taskfile_load_raw(struct ata_port *ap,
+                               struct ata_device *atadev,
+                               const struct taskfile_array *gtf)
+{
+       if (ata_msg_probe(ap))
+               ata_dev_printk(atadev, KERN_DEBUG, "%s: (0x1f1-1f7): hex: "
+                       "%02x %02x %02x %02x %02x %02x %02x\n",
+                       __FUNCTION__,
+                       gtf->tfa[0], gtf->tfa[1], gtf->tfa[2],
+                       gtf->tfa[3], gtf->tfa[4], gtf->tfa[5], gtf->tfa[6]);
+
+       if ((gtf->tfa[0] == 0) && (gtf->tfa[1] == 0) && (gtf->tfa[2] == 0)
+           && (gtf->tfa[3] == 0) && (gtf->tfa[4] == 0) && (gtf->tfa[5] == 0)
+           && (gtf->tfa[6] == 0))
+               return;
+
+       if (ap->ops->qc_issue) {
+               struct ata_taskfile tf;
+               unsigned int err;
+
+               ata_tf_init(atadev, &tf);
+
+               /* convert gtf to tf */
+               tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; /* TBD */
+               tf.protocol = atadev->class == ATA_DEV_ATAPI ?
+                       ATA_PROT_ATAPI_NODATA : ATA_PROT_NODATA;
+               tf.feature = gtf->tfa[0];       /* 0x1f1 */
+               tf.nsect   = gtf->tfa[1];       /* 0x1f2 */
+               tf.lbal    = gtf->tfa[2];       /* 0x1f3 */
+               tf.lbam    = gtf->tfa[3];       /* 0x1f4 */
+               tf.lbah    = gtf->tfa[4];       /* 0x1f5 */
+               tf.device  = gtf->tfa[5];       /* 0x1f6 */
+               tf.command = gtf->tfa[6];       /* 0x1f7 */
+
+               err = ata_exec_internal(atadev, &tf, NULL, DMA_NONE, NULL, 0);
+               if (err && ata_msg_probe(ap))
+                       ata_dev_printk(atadev, KERN_ERR,
+                               "%s: ata_exec_internal failed: %u\n",
+                               __FUNCTION__, err);
+       } else
+               if (ata_msg_warn(ap))
+                       ata_dev_printk(atadev, KERN_WARNING,
+                               "%s: SATA driver is missing qc_issue function"
+                               " entry points\n",
+                               __FUNCTION__);
+}
+
+/**
+ * do_drive_set_taskfiles - write the drive taskfile settings from _GTF
+ * @ap: the ata_port for the drive
+ * @atadev: target ata_device
+ * @gtf_length: total number of bytes of _GTF taskfiles
+ * @gtf_address: location of _GTF taskfile arrays
+ *
+ * This applies to both PATA and SATA drives.
+ *
+ * Write {gtf_address, length gtf_length} in groups of
+ * REGS_PER_GTF bytes.
+ */
+static int do_drive_set_taskfiles(struct ata_port *ap,
+               struct ata_device *atadev, unsigned int gtf_length,
+               unsigned long gtf_address)
+{
+       int                     err = -ENODEV;
+       int                     gtf_count = gtf_length / REGS_PER_GTF;
+       int                     ix;
+       struct taskfile_array   *gtf;
+
+       if (ata_msg_probe(ap))
+               ata_dev_printk(atadev, KERN_DEBUG,
+                       "%s: ENTER: ap->id: %d, port#: %d\n",
+                       __FUNCTION__, ap->id, ap->port_no);
+
+       if (noacpi || !(ap->cbl == ATA_CBL_SATA))
+               return 0;
+
+       if (!ata_dev_enabled(atadev) || (ap->flags & ATA_FLAG_DISABLED))
+               goto out;
+       if (!gtf_count)         /* shouldn't be here */
+               goto out;
+
+       if (gtf_length % REGS_PER_GTF) {
+               if (ata_msg_drv(ap))
+                       ata_dev_printk(atadev, KERN_ERR,
+                               "%s: unexpected GTF length (%d)\n",
+                               __FUNCTION__, gtf_length);
+               goto out;
+       }
+
+       for (ix = 0; ix < gtf_count; ix++) {
+               gtf = (struct taskfile_array *)
+                       (gtf_address + ix * REGS_PER_GTF);
+
+               /* send all TaskFile registers (0x1f1-0x1f7) *in*that*order* */
+               taskfile_load_raw(ap, atadev, gtf);
+       }
+
+       err = 0;
+out:
+       return err;
+}
+
+/**
+ * ata_acpi_exec_tfs - get then write drive taskfile settings
+ * @ap: the ata_port for the drive
+ *
+ * This applies to both PATA and SATA drives.
+ */
+int ata_acpi_exec_tfs(struct ata_port *ap)
+{
+       int             ix;
+       int             ret =0;
+       unsigned int    gtf_length;
+       unsigned long   gtf_address;
+       unsigned long   obj_loc;
+
+       if (noacpi)
+               return 0;
+
+       for (ix = 0; ix < ATA_MAX_DEVICES; ix++) {
+               if (!ata_dev_enabled(&ap->device[ix]))
+                       continue;
+
+               ret = do_drive_get_GTF(ap, ix,
+                               &gtf_length, &gtf_address, &obj_loc);
+               if (ret < 0) {
+                       if (ata_msg_probe(ap))
+                               ata_port_printk(ap, KERN_DEBUG,
+                                       "%s: get_GTF error (%d)\n",
+                                       __FUNCTION__, ret);
+                       break;
+               }
+
+               ret = do_drive_set_taskfiles(ap, &ap->device[ix],
+                               gtf_length, gtf_address);
+               kfree((void *)obj_loc);
+               if (ret < 0) {
+                       if (ata_msg_probe(ap))
+                               ata_port_printk(ap, KERN_DEBUG,
+                                       "%s: set_taskfiles error (%d)\n",
+                                       __FUNCTION__, ret);
+                       break;
+               }
+       }
+
+       return ret;
+}
+
+/**
+ * ata_acpi_push_id - send Identify data to drive
+ * @ap: the ata_port for the drive
+ * @ix: drive index
+ *
+ * _SDD ACPI object: for SATA mode only
+ * Must be after Identify (Packet) Device -- uses its data
+ * ATM this function never returns a failure.  It is an optional
+ * method and if it fails for whatever reason, we should still
+ * just keep going.
+ */
+int ata_acpi_push_id(struct ata_port *ap, unsigned int ix)
+{
+       acpi_handle                     handle;
+       acpi_integer                    pcidevfn;
+       int                             err;
+       struct device                   *dev = ap->host->dev;
+       struct ata_device               *atadev = &ap->device[ix];
+       u32                             dev_adr;
+       acpi_status                     status;
+       struct acpi_object_list         input;
+       union acpi_object               in_params[1];
+
+       if (noacpi)
+               return 0;
+
+       if (ata_msg_probe(ap))
+               ata_dev_printk(atadev, KERN_DEBUG,
+                       "%s: ap->id: %d, ix = %d, port#: %d\n",
+                       __FUNCTION__, ap->id, ix, ap->port_no);
+
+       /* Don't continue if not a SATA device. */
+       if (!(ap->cbl == ATA_CBL_SATA)) {
+               if (ata_msg_probe(ap))
+                       ata_dev_printk(atadev, KERN_DEBUG,
+                               "%s: Not a SATA device\n", __FUNCTION__);
+               goto out;
+       }
+
+       /* Don't continue if device has no _ADR method.
+        * _SDD is intended for known motherboard devices. */
+       err = sata_get_dev_handle(dev, &handle, &pcidevfn);
+       if (err < 0) {
+               if (ata_msg_probe(ap))
+                       ata_dev_printk(atadev, KERN_DEBUG,
+                               "%s: sata_get_dev_handle failed (%d\n",
+                               __FUNCTION__, err);
+               goto out;
+       }
+
+       /* Get this drive's _ADR info, if not already known */
+       if (!atadev->obj_handle) {
+               dev_adr = SATA_ADR_RSVD;
+               err = get_sata_adr(dev, handle, pcidevfn, ix, ap, atadev,
+                                       &dev_adr);
+               if (err < 0 || dev_adr == SATA_ADR_RSVD ||
+                       !atadev->obj_handle) {
+                       if (ata_msg_probe(ap))
+                               ata_dev_printk(atadev, KERN_DEBUG,
+                                       "%s: get_sata_adr failed: "
+                                       "err=%d, dev_adr=%u, obj_handle=0x%p\n",
+                                       __FUNCTION__, err, dev_adr,
+                                       atadev->obj_handle);
+                       goto out;
+               }
+       }
+
+       /* Give the drive Identify data to the drive via the _SDD method */
+       /* _SDD: set up input parameters */
+       input.count = 1;
+       input.pointer = in_params;
+       in_params[0].type = ACPI_TYPE_BUFFER;
+       in_params[0].buffer.length = sizeof(atadev->id[0]) * ATA_ID_WORDS;
+       in_params[0].buffer.pointer = (u8 *)atadev->id;
+       /* Output buffer: _SDD has no output */
+
+       /* It's OK for _SDD to be missing too. */
+       swap_buf_le16(atadev->id, ATA_ID_WORDS);
+       status = acpi_evaluate_object(atadev->obj_handle, "_SDD", &input, NULL);
+       swap_buf_le16(atadev->id, ATA_ID_WORDS);
+
+       err = ACPI_FAILURE(status) ? -EIO : 0;
+       if (err < 0) {
+               if (ata_msg_probe(ap))
+                       ata_dev_printk(atadev, KERN_DEBUG,
+                               "ata%u(%u): %s _SDD error: status = 0x%x\n",
+                               ap->id, ap->device->devno,
+                               __FUNCTION__, status);
+       }
+
+       /* always return success */
+out:
+       return 0;
+}
+
+
index 2cf8251728d23f11d479c789b5f020dc9158da4b..e900c5edefc4a55af483513dddbfdbc1129d7101 100644 (file)
@@ -93,6 +93,10 @@ static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ;
 module_param(ata_probe_timeout, int, 0444);
 MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)");
 
+int noacpi;
+module_param(noacpi, int, 0444);
+MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set");
+
 MODULE_AUTHOR("Jeff Garzik");
 MODULE_DESCRIPTION("Library module for ATA devices");
 MODULE_LICENSE("GPL");
@@ -1564,6 +1568,16 @@ int ata_dev_configure(struct ata_device *dev)
                ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER, host %u, dev %u\n",
                               __FUNCTION__, ap->id, dev->devno);
 
+       /* set _SDD */
+       rc = ata_acpi_push_id(ap, dev->devno);
+       if (rc) {
+               ata_dev_printk(dev, KERN_WARNING, "failed to set _SDD(%d)\n",
+                       rc);
+       }
+
+       /* retrieve and execute the ATA task file of _GTF */
+       ata_acpi_exec_tfs(ap);
+
        /* print device capabilities */
        if (ata_msg_probe(ap))
                ata_dev_printk(dev, KERN_DEBUG,
index 06ccf230e3c2b97308879b87ef93b98d504902b4..0ad7781d72a3b0f4e282da04dc606f48032d60cf 100644 (file)
@@ -47,6 +47,7 @@ extern struct workqueue_struct *ata_aux_wq;
 extern int atapi_enabled;
 extern int atapi_dmadir;
 extern int libata_fua;
+extern int noacpi;
 extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev);
 extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
                           u64 block, u32 n_block, unsigned int tf_flags,
@@ -87,6 +88,20 @@ extern void ata_port_init(struct ata_port *ap, struct ata_host *host,
 extern struct ata_probe_ent *ata_probe_ent_alloc(struct device *dev,
                                                 const struct ata_port_info *port);
 
+/* libata-acpi.c */
+#ifdef CONFIG_SATA_ACPI
+extern int ata_acpi_exec_tfs(struct ata_port *ap);
+extern int ata_acpi_push_id(struct ata_port *ap, unsigned int ix);
+#else
+static inline int ata_acpi_exec_tfs(struct ata_port *ap)
+{
+       return 0;
+}
+static inline int ata_acpi_push_id(struct ata_port *ap, unsigned int ix)
+{
+       return 0;
+}
+#endif
 
 /* libata-scsi.c */
 extern struct scsi_transport_template ata_scsi_transport_template;
index db33f6f4dd2a5517302e22fc5575c43c1a28413e..8510026b690a587b175427b1508970e6492f3a5d 100644 (file)
@@ -3017,7 +3017,7 @@ read_prom_byte(struct he_dev *he_dev, int addr)
        he_writel(he_dev, val, HOST_CNTL);
        
        /* Send READ instruction */
-       for (i = 0; i < sizeof(readtab)/sizeof(readtab[0]); i++) {
+       for (i = 0; i < ARRAY_SIZE(readtab); i++) {
                he_writel(he_dev, val | readtab[i], HOST_CNTL);
                udelay(EEPROM_DELAY);
        }
index f40786121948c4bc1cbd7cea1c14291704e1c982..b4b80140c3985a25271bc82bd47be24f41893aff 100644 (file)
@@ -388,7 +388,7 @@ idt77252_eeprom_read_status(struct idt77252_dev *card)
 
        gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO);
 
-       for (i = 0; i < sizeof(rdsrtab)/sizeof(rdsrtab[0]); i++) {
+       for (i = 0; i < ARRAY_SIZE(rdsrtab); i++) {
                idt77252_write_gp(card, gp | rdsrtab[i]);
                udelay(5);
        }
@@ -422,7 +422,7 @@ idt77252_eeprom_read_byte(struct idt77252_dev *card, u8 offset)
 
        gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO);
 
-       for (i = 0; i < sizeof(rdtab)/sizeof(rdtab[0]); i++) {
+       for (i = 0; i < ARRAY_SIZE(rdtab); i++) {
                idt77252_write_gp(card, gp | rdtab[i]);
                udelay(5);
        }
@@ -469,14 +469,14 @@ idt77252_eeprom_write_byte(struct idt77252_dev *card, u8 offset, u8 data)
 
        gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO);
 
-       for (i = 0; i < sizeof(wrentab)/sizeof(wrentab[0]); i++) {
+       for (i = 0; i < ARRAY_SIZE(wrentab); i++) {
                idt77252_write_gp(card, gp | wrentab[i]);
                udelay(5);
        }
        idt77252_write_gp(card, gp | SAR_GP_EECS);
        udelay(5);
 
-       for (i = 0; i < sizeof(wrtab)/sizeof(wrtab[0]); i++) {
+       for (i = 0; i < ARRAY_SIZE(wrtab); i++) {
                idt77252_write_gp(card, gp | wrtab[i]);
                udelay(5);
        }
index 2c5e3ae77503bdbefc32714b88b82c2e7b50376c..480947f4e01e8ded8b84f243e065dcf40c423524 100644 (file)
@@ -7,6 +7,8 @@
  * Read this ForeRunner's MAC address from eprom/eeprom
  */
 
+#include <linux/kernel.h>
+
 typedef void __iomem *virt_addr_t;
 
 #define CYCLE_DELAY 5
@@ -176,7 +178,7 @@ read_eprom_byte(virt_addr_t base, u_int8_t offset)
    val = NICSTAR_REG_READ( base, NICSTAR_REG_GENERAL_PURPOSE ) & 0xFFFFFFF0;
 
    /* Send READ instruction */
-   for (i=0; i<sizeof readtab/sizeof readtab[0]; i++)
+   for (i=0; i<ARRAY_SIZE(readtab); i++)
    {
        NICSTAR_REG_WRITE( base, NICSTAR_REG_GENERAL_PURPOSE,
                (val | readtab[i]) );
index 472810f8e6e7332f13127b31a299f5712e4ffbc9..253868e03c705bbda2eec97180719597b081daf0 100644 (file)
@@ -324,27 +324,25 @@ int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
        return error;
 }
 
-static int device_add_attrs(struct bus_type * bus, struct device * dev)
+static int device_add_attrs(struct bus_type *bus, struct device *dev)
 {
        int error = 0;
        int i;
 
-       if (bus->dev_attrs) {
-               for (i = 0; attr_name(bus->dev_attrs[i]); i++) {
-                       error = device_create_file(dev,&bus->dev_attrs[i]);
-                       if (error)
-                               goto Err;
+       if (!bus->dev_attrs)
+               return 0;
+
+       for (i = 0; attr_name(bus->dev_attrs[i]); i++) {
+               error = device_create_file(dev,&bus->dev_attrs[i]);
+               if (error) {
+                       while (--i >= 0)
+                               device_remove_file(dev, &bus->dev_attrs[i]);
+                       break;
                }
        }
- Done:
        return error;
- Err:
-       while (--i >= 0)
-               device_remove_file(dev,&bus->dev_attrs[i]);
-       goto Done;
 }
 
-
 static void device_remove_attrs(struct bus_type * bus, struct device * dev)
 {
        int i;
index 96def1ddba194b50347b171f221fbdfadbd896f5..1417e5cd4c6f539544ebc686a81d7b51592e0331 100644 (file)
@@ -163,8 +163,7 @@ int class_register(struct class * cls)
 void class_unregister(struct class * cls)
 {
        pr_debug("device class '%s': unregistering\n", cls->name);
-       if (cls->virtual_dir)
-               kobject_unregister(cls->virtual_dir);
+       kobject_unregister(cls->virtual_dir);
        remove_class_attrs(cls);
        subsystem_unregister(&cls->subsys);
 }
index 20ee4f7c53a0ed75b306bece79852b74afc57851..90e2d9350c1bd12d390a2495872c837cc5959a5f 100644 (file)
@@ -83,7 +83,7 @@ iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap)
         * Every time unit enable is asserted, GPOD needs to be cleared
         * on IOP3XX to avoid data corruption on the bus.
         */
-#ifdef CONFIG_PLAT_IOP
+#if defined(CONFIG_ARCH_IOP32X) || defined(CONFIG_ARCH_IOP33X)
        if (iop3xx_adap->id == 0) {
                gpio_line_set(IOP3XX_GPIO_LINE(7), GPIO_LOW);
                gpio_line_set(IOP3XX_GPIO_LINE(6), GPIO_LOW);
index c3b1567c852a711595c1dbd4ac2575afe7d83044..14e83d0aac8c8fcc94372710f53067bd5a4ddad9 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
+#include <asm/io.h>
 #include <asm/arch/i2c.h>
 #include <asm/arch/pxa-regs.h>
 
@@ -54,8 +55,21 @@ struct pxa_i2c {
        unsigned int            irqlogidx;
        u32                     isrlog[32];
        u32                     icrlog[32];
+
+       void __iomem            *reg_base;
+
+       unsigned long           iobase;
+       unsigned long           iosize;
+
+       int                     irq;
 };
 
+#define _IBMR(i2c)     ((i2c)->reg_base + 0)
+#define _IDBR(i2c)     ((i2c)->reg_base + 8)
+#define _ICR(i2c)      ((i2c)->reg_base + 0x10)
+#define _ISR(i2c)      ((i2c)->reg_base + 0x18)
+#define _ISAR(i2c)     ((i2c)->reg_base + 0x20)
+
 /*
  * I2C Slave mode address
  */
@@ -130,7 +144,8 @@ static unsigned int i2c_debug = DEBUG;
 
 static void i2c_pxa_show_state(struct pxa_i2c *i2c, int lno, const char *fname)
 {
-       dev_dbg(&i2c->adap.dev, "state:%s:%d: ISR=%08x, ICR=%08x, IBMR=%02x\n", fname, lno, ISR, ICR, IBMR);
+       dev_dbg(&i2c->adap.dev, "state:%s:%d: ISR=%08x, ICR=%08x, IBMR=%02x\n", fname, lno,
+               readl(_ISR(i2c)), readl(_ICR(i2c)), readl(_IBMR(i2c)));
 }
 
 #define show_state(i2c) i2c_pxa_show_state(i2c, __LINE__, __FUNCTION__)
@@ -153,7 +168,7 @@ static void i2c_pxa_scream_blue_murder(struct pxa_i2c *i2c, const char *why)
        printk("i2c: msg_num: %d msg_idx: %d msg_ptr: %d\n",
                i2c->msg_num, i2c->msg_idx, i2c->msg_ptr);
        printk("i2c: ICR: %08x ISR: %08x\n"
-              "i2c: log: ", ICR, ISR);
+              "i2c: log: ", readl(_ICR(i2c)), readl(_ISR(i2c)));
        for (i = 0; i < i2c->irqlogidx; i++)
                printk("[%08x:%08x] ", i2c->isrlog[i], i2c->icrlog[i]);
        printk("\n");
@@ -161,7 +176,7 @@ static void i2c_pxa_scream_blue_murder(struct pxa_i2c *i2c, const char *why)
 
 static inline int i2c_pxa_is_slavemode(struct pxa_i2c *i2c)
 {
-       return !(ICR & ICR_SCLE);
+       return !(readl(_ICR(i2c)) & ICR_SCLE);
 }
 
 static void i2c_pxa_abort(struct pxa_i2c *i2c)
@@ -173,28 +188,29 @@ static void i2c_pxa_abort(struct pxa_i2c *i2c)
                return;
        }
 
-       while (time_before(jiffies, timeout) && (IBMR & 0x1) == 0) {
-               unsigned long icr = ICR;
+       while (time_before(jiffies, timeout) && (readl(_IBMR(i2c)) & 0x1) == 0) {
+               unsigned long icr = readl(_ICR(i2c));
 
                icr &= ~ICR_START;
                icr |= ICR_ACKNAK | ICR_STOP | ICR_TB;
 
-               ICR = icr;
+               writel(icr, _ICR(i2c));
 
                show_state(i2c);
 
                msleep(1);
        }
 
-       ICR &= ~(ICR_MA | ICR_START | ICR_STOP);
+       writel(readl(_ICR(i2c)) & ~(ICR_MA | ICR_START | ICR_STOP),
+              _ICR(i2c));
 }
 
 static int i2c_pxa_wait_bus_not_busy(struct pxa_i2c *i2c)
 {
        int timeout = DEF_TIMEOUT;
 
-       while (timeout-- && ISR & (ISR_IBB | ISR_UB)) {
-               if ((ISR & ISR_SAD) != 0)
+       while (timeout-- && readl(_ISR(i2c)) & (ISR_IBB | ISR_UB)) {
+               if ((readl(_ISR(i2c)) & ISR_SAD) != 0)
                        timeout += 4;
 
                msleep(2);
@@ -214,9 +230,9 @@ static int i2c_pxa_wait_master(struct pxa_i2c *i2c)
        while (time_before(jiffies, timeout)) {
                if (i2c_debug > 1)
                        dev_dbg(&i2c->adap.dev, "%s: %ld: ISR=%08x, ICR=%08x, IBMR=%02x\n",
-                               __func__, (long)jiffies, ISR, ICR, IBMR);
+                               __func__, (long)jiffies, readl(_ISR(i2c)), readl(_ICR(i2c)), readl(_IBMR(i2c)));
 
-               if (ISR & ISR_SAD) {
+               if (readl(_ISR(i2c)) & ISR_SAD) {
                        if (i2c_debug > 0)
                                dev_dbg(&i2c->adap.dev, "%s: Slave detected\n", __func__);
                        goto out;
@@ -226,7 +242,7 @@ static int i2c_pxa_wait_master(struct pxa_i2c *i2c)
                 * quick check of the i2c lines themselves to ensure they've
                 * gone high...
                 */
-               if ((ISR & (ISR_UB | ISR_IBB)) == 0 && IBMR == 3) {
+               if ((readl(_ISR(i2c)) & (ISR_UB | ISR_IBB)) == 0 && readl(_IBMR(i2c)) == 3) {
                        if (i2c_debug > 0)
                                dev_dbg(&i2c->adap.dev, "%s: done\n", __func__);
                        return 1;
@@ -246,7 +262,7 @@ static int i2c_pxa_set_master(struct pxa_i2c *i2c)
        if (i2c_debug)
                dev_dbg(&i2c->adap.dev, "setting to bus master\n");
 
-       if ((ISR & (ISR_UB | ISR_IBB)) != 0) {
+       if ((readl(_ISR(i2c)) & (ISR_UB | ISR_IBB)) != 0) {
                dev_dbg(&i2c->adap.dev, "%s: unit is busy\n", __func__);
                if (!i2c_pxa_wait_master(i2c)) {
                        dev_dbg(&i2c->adap.dev, "%s: error: unit busy\n", __func__);
@@ -254,7 +270,7 @@ static int i2c_pxa_set_master(struct pxa_i2c *i2c)
                }
        }
 
-       ICR |= ICR_SCLE;
+       writel(readl(_ICR(i2c)) | ICR_SCLE, _ICR(i2c));
        return 0;
 }
 
@@ -270,11 +286,11 @@ static int i2c_pxa_wait_slave(struct pxa_i2c *i2c)
        while (time_before(jiffies, timeout)) {
                if (i2c_debug > 1)
                        dev_dbg(&i2c->adap.dev, "%s: %ld: ISR=%08x, ICR=%08x, IBMR=%02x\n",
-                               __func__, (long)jiffies, ISR, ICR, IBMR);
+                               __func__, (long)jiffies, readl(_ISR(i2c)), readl(_ICR(i2c)), readl(_IBMR(i2c)));
 
-               if ((ISR & (ISR_UB|ISR_IBB)) == 0 ||
-                   (ISR & ISR_SAD) != 0 ||
-                   (ICR & ICR_SCLE) == 0) {
+               if ((readl(_ISR(i2c)) & (ISR_UB|ISR_IBB)) == 0 ||
+                   (readl(_ISR(i2c)) & ISR_SAD) != 0 ||
+                   (readl(_ICR(i2c)) & ICR_SCLE) == 0) {
                        if (i2c_debug > 1)
                                dev_dbg(&i2c->adap.dev, "%s: done\n", __func__);
                        return 1;
@@ -302,9 +318,9 @@ static void i2c_pxa_set_slave(struct pxa_i2c *i2c, int errcode)
                /* we need to wait for the stop condition to end */
 
                /* if we where in stop, then clear... */
-               if (ICR & ICR_STOP) {
+               if (readl(_ICR(i2c)) & ICR_STOP) {
                        udelay(100);
-                       ICR &= ~ICR_STOP;
+                       writel(readl(_ICR(i2c)) & ~ICR_STOP, _ICR(i2c));
                }
 
                if (!i2c_pxa_wait_slave(i2c)) {
@@ -314,12 +330,12 @@ static void i2c_pxa_set_slave(struct pxa_i2c *i2c, int errcode)
                }
        }
 
-       ICR &= ~(ICR_STOP|ICR_ACKNAK|ICR_MA);
-       ICR &= ~ICR_SCLE;
+       writel(readl(_ICR(i2c)) & ~(ICR_STOP|ICR_ACKNAK|ICR_MA), _ICR(i2c));
+       writel(readl(_ICR(i2c)) & ~ICR_SCLE, _ICR(i2c));
 
        if (i2c_debug) {
-               dev_dbg(&i2c->adap.dev, "ICR now %08x, ISR %08x\n", ICR, ISR);
-               decode_ICR(ICR);
+               dev_dbg(&i2c->adap.dev, "ICR now %08x, ISR %08x\n", readl(_ICR(i2c)), readl(_ISR(i2c)));
+               decode_ICR(readl(_ICR(i2c)));
        }
 }
 #else
@@ -334,24 +350,24 @@ static void i2c_pxa_reset(struct pxa_i2c *i2c)
        i2c_pxa_abort(i2c);
 
        /* reset according to 9.8 */
-       ICR = ICR_UR;
-       ISR = I2C_ISR_INIT;
-       ICR &= ~ICR_UR;
+       writel(ICR_UR, _ICR(i2c));
+       writel(I2C_ISR_INIT, _ISR(i2c));
+       writel(readl(_ICR(i2c)) & ~ICR_UR, _ICR(i2c));
 
-       ISAR = i2c->slave_addr;
+       writel(i2c->slave_addr, _ISAR(i2c));
 
        /* set control register values */
-       ICR = I2C_ICR_INIT;
+       writel(I2C_ICR_INIT, _ICR(i2c));
 
 #ifdef CONFIG_I2C_PXA_SLAVE
        dev_info(&i2c->adap.dev, "Enabling slave mode\n");
-       ICR |= ICR_SADIE | ICR_ALDIE | ICR_SSDIE;
+       writel(readl(_ICR(i2c)) | ICR_SADIE | ICR_ALDIE | ICR_SSDIE, _ICR(i2c));
 #endif
 
        i2c_pxa_set_slave(i2c, 0);
 
        /* enable unit */
-       ICR |= ICR_IUE;
+       writel(readl(_ICR(i2c)) | ICR_IUE, _ICR(i2c));
        udelay(100);
 }
 
@@ -371,19 +387,19 @@ static void i2c_pxa_slave_txempty(struct pxa_i2c *i2c, u32 isr)
                if (i2c->slave != NULL)
                        ret = i2c->slave->read(i2c->slave->data);
 
-               IDBR = ret;
-               ICR |= ICR_TB;   /* allow next byte */
+               writel(ret, _IDBR(i2c));
+               writel(readl(_ICR(i2c)) | ICR_TB, _ICR(i2c));   /* allow next byte */
        }
 }
 
 static void i2c_pxa_slave_rxfull(struct pxa_i2c *i2c, u32 isr)
 {
-       unsigned int byte = IDBR;
+       unsigned int byte = readl(_IDBR(i2c));
 
        if (i2c->slave != NULL)
                i2c->slave->write(i2c->slave->data, byte);
 
-       ICR |= ICR_TB;
+       writel(readl(_ICR(i2c)) | ICR_TB, _ICR(i2c));
 }
 
 static void i2c_pxa_slave_start(struct pxa_i2c *i2c, u32 isr)
@@ -403,13 +419,13 @@ static void i2c_pxa_slave_start(struct pxa_i2c *i2c, u32 isr)
         * start condition... if this happens, we'd better back off
         * and stop holding the poor thing up
         */
-       ICR &= ~(ICR_START|ICR_STOP);
-       ICR |= ICR_TB;
+       writel(readl(_ICR(i2c)) & ~(ICR_START|ICR_STOP), _ICR(i2c));
+       writel(readl(_ICR(i2c)) | ICR_TB, _ICR(i2c));
 
        timeout = 0x10000;
 
        while (1) {
-               if ((IBMR & 2) == 2)
+               if ((readl(_IBMR(i2c)) & 2) == 2)
                        break;
 
                timeout--;
@@ -420,7 +436,7 @@ static void i2c_pxa_slave_start(struct pxa_i2c *i2c, u32 isr)
                }
        }
 
-       ICR &= ~ICR_SCLE;
+       writel(readl(_ICR(i2c)) & ~ICR_SCLE, _ICR(i2c));
 }
 
 static void i2c_pxa_slave_stop(struct pxa_i2c *i2c)
@@ -447,14 +463,14 @@ static void i2c_pxa_slave_txempty(struct pxa_i2c *i2c, u32 isr)
        if (isr & ISR_BED) {
                /* what should we do here? */
        } else {
-               IDBR = 0;
-               ICR |= ICR_TB;
+               writel(0, _IDBR(i2c));
+               writel(readl(_ICR(i2c)) | ICR_TB, _ICR(i2c));
        }
 }
 
 static void i2c_pxa_slave_rxfull(struct pxa_i2c *i2c, u32 isr)
 {
-       ICR |= ICR_TB | ICR_ACKNAK;
+       writel(readl(_ICR(i2c)) | ICR_TB | ICR_ACKNAK, _ICR(i2c));
 }
 
 static void i2c_pxa_slave_start(struct pxa_i2c *i2c, u32 isr)
@@ -466,13 +482,13 @@ static void i2c_pxa_slave_start(struct pxa_i2c *i2c, u32 isr)
         * start condition... if this happens, we'd better back off
         * and stop holding the poor thing up
         */
-       ICR &= ~(ICR_START|ICR_STOP);
-       ICR |= ICR_TB | ICR_ACKNAK;
+       writel(readl(_ICR(i2c)) & ~(ICR_START|ICR_STOP), _ICR(i2c));
+       writel(readl(_ICR(i2c)) | ICR_TB | ICR_ACKNAK, _ICR(i2c));
 
        timeout = 0x10000;
 
        while (1) {
-               if ((IBMR & 2) == 2)
+               if ((readl(_IBMR(i2c)) & 2) == 2)
                        break;
 
                timeout--;
@@ -483,7 +499,7 @@ static void i2c_pxa_slave_start(struct pxa_i2c *i2c, u32 isr)
                }
        }
 
-       ICR &= ~ICR_SCLE;
+       writel(readl(_ICR(i2c)) & ~ICR_SCLE, _ICR(i2c));
 }
 
 static void i2c_pxa_slave_stop(struct pxa_i2c *i2c)
@@ -514,13 +530,13 @@ static inline void i2c_pxa_start_message(struct pxa_i2c *i2c)
        /*
         * Step 1: target slave address into IDBR
         */
-       IDBR = i2c_pxa_addr_byte(i2c->msg);
+       writel(i2c_pxa_addr_byte(i2c->msg), _IDBR(i2c));
 
        /*
         * Step 2: initiate the write.
         */
-       icr = ICR & ~(ICR_STOP | ICR_ALDIE);
-       ICR = icr | ICR_START | ICR_TB;
+       icr = readl(_ICR(i2c)) & ~(ICR_STOP | ICR_ALDIE);
+       writel(icr | ICR_START | ICR_TB, _ICR(i2c));
 }
 
 /*
@@ -594,7 +610,7 @@ static void i2c_pxa_master_complete(struct pxa_i2c *i2c, int ret)
 
 static void i2c_pxa_irq_txempty(struct pxa_i2c *i2c, u32 isr)
 {
-       u32 icr = ICR & ~(ICR_START|ICR_STOP|ICR_ACKNAK|ICR_TB);
+       u32 icr = readl(_ICR(i2c)) & ~(ICR_START|ICR_STOP|ICR_ACKNAK|ICR_TB);
 
  again:
        /*
@@ -645,7 +661,7 @@ static void i2c_pxa_irq_txempty(struct pxa_i2c *i2c, u32 isr)
                /*
                 * Write mode.  Write the next data byte.
                 */
-               IDBR = i2c->msg->buf[i2c->msg_ptr++];
+               writel(i2c->msg->buf[i2c->msg_ptr++], _IDBR(i2c));
 
                icr |= ICR_ALDIE | ICR_TB;
 
@@ -675,7 +691,7 @@ static void i2c_pxa_irq_txempty(struct pxa_i2c *i2c, u32 isr)
                /*
                 * Write the next address.
                 */
-               IDBR = i2c_pxa_addr_byte(i2c->msg);
+               writel(i2c_pxa_addr_byte(i2c->msg), _IDBR(i2c));
 
                /*
                 * And trigger a repeated start, and send the byte.
@@ -696,18 +712,18 @@ static void i2c_pxa_irq_txempty(struct pxa_i2c *i2c, u32 isr)
 
        i2c->icrlog[i2c->irqlogidx-1] = icr;
 
-       ICR = icr;
+       writel(icr, _ICR(i2c));
        show_state(i2c);
 }
 
 static void i2c_pxa_irq_rxfull(struct pxa_i2c *i2c, u32 isr)
 {
-       u32 icr = ICR & ~(ICR_START|ICR_STOP|ICR_ACKNAK|ICR_TB);
+       u32 icr = readl(_ICR(i2c)) & ~(ICR_START|ICR_STOP|ICR_ACKNAK|ICR_TB);
 
        /*
         * Read the byte.
         */
-       i2c->msg->buf[i2c->msg_ptr++] = IDBR;
+       i2c->msg->buf[i2c->msg_ptr++] = readl(_IDBR(i2c));
 
        if (i2c->msg_ptr < i2c->msg->len) {
                /*
@@ -724,17 +740,17 @@ static void i2c_pxa_irq_rxfull(struct pxa_i2c *i2c, u32 isr)
 
        i2c->icrlog[i2c->irqlogidx-1] = icr;
 
-       ICR = icr;
+       writel(icr, _ICR(i2c));
 }
 
 static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id)
 {
        struct pxa_i2c *i2c = dev_id;
-       u32 isr = ISR;
+       u32 isr = readl(_ISR(i2c));
 
        if (i2c_debug > 2 && 0) {
                dev_dbg(&i2c->adap.dev, "%s: ISR=%08x, ICR=%08x, IBMR=%02x\n",
-                       __func__, isr, ICR, IBMR);
+                       __func__, isr, readl(_ICR(i2c)), readl(_IBMR(i2c)));
                decode_ISR(isr);
        }
 
@@ -746,7 +762,7 @@ static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id)
        /*
         * Always clear all pending IRQs.
         */
-       ISR = isr & (ISR_SSD|ISR_ALD|ISR_ITE|ISR_IRF|ISR_SAD|ISR_BED);
+       writel(isr & (ISR_SSD|ISR_ALD|ISR_ITE|ISR_IRF|ISR_SAD|ISR_BED), _ISR(i2c));
 
        if (isr & ISR_SAD)
                i2c_pxa_slave_start(i2c, isr);
@@ -779,7 +795,7 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num
        /* If the I2C controller is disabled we need to reset it (probably due
           to a suspend/resume destroying state). We do this here as we can then
           avoid worrying about resuming the controller before its users. */
-       if (!(ICR & ICR_IUE))
+       if (!(readl(_ICR(i2c)) & ICR_IUE))
                i2c_pxa_reset(i2c);
 
        for (i = adap->retries; i >= 0; i--) {
@@ -810,28 +826,53 @@ static const struct i2c_algorithm i2c_pxa_algorithm = {
 
 static struct pxa_i2c i2c_pxa = {
        .lock   = SPIN_LOCK_UNLOCKED,
-       .wait   = __WAIT_QUEUE_HEAD_INITIALIZER(i2c_pxa.wait),
        .adap   = {
                .owner          = THIS_MODULE,
                .algo           = &i2c_pxa_algorithm,
-               .name           = "pxa2xx-i2c",
+               .name           = "pxa2xx-i2c.0",
                .retries        = 5,
        },
 };
 
+#define res_len(r)             ((r)->end - (r)->start + 1)
 static int i2c_pxa_probe(struct platform_device *dev)
 {
        struct pxa_i2c *i2c = &i2c_pxa;
+       struct resource *res;
 #ifdef CONFIG_I2C_PXA_SLAVE
        struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
 #endif
        int ret;
+       int irq;
 
-#ifdef CONFIG_PXA27x
-       pxa_gpio_mode(GPIO117_I2CSCL_MD);
-       pxa_gpio_mode(GPIO118_I2CSDA_MD);
-       udelay(100);
-#endif
+       res = platform_get_resource(dev, IORESOURCE_MEM, 0);
+       irq = platform_get_irq(dev, 0);
+       if (res == NULL || irq < 0)
+               return -ENODEV;
+
+       if (!request_mem_region(res->start, res_len(res), res->name))
+               return -ENOMEM;
+
+       i2c = kmalloc(sizeof(struct pxa_i2c), GFP_KERNEL);
+       if (!i2c) {
+               ret = -ENOMEM;
+               goto emalloc;
+       }
+
+       memcpy(i2c, &i2c_pxa, sizeof(struct pxa_i2c));
+       init_waitqueue_head(&i2c->wait);
+       i2c->adap.name[strlen(i2c->adap.name) - 1] = '0' + dev->id % 10;
+
+       i2c->reg_base = ioremap(res->start, res_len(res));
+       if (!i2c->reg_base) {
+               ret = -EIO;
+               goto eremap;
+       }
+
+       i2c->iobase = res->start;
+       i2c->iosize = res_len(res);
+
+       i2c->irq = irq;
 
        i2c->slave_addr = I2C_PXA_SLAVE_ADDR;
 
@@ -842,11 +883,28 @@ static int i2c_pxa_probe(struct platform_device *dev)
        }
 #endif
 
-       pxa_set_cken(CKEN14_I2C, 1);
-       ret = request_irq(IRQ_I2C, i2c_pxa_handler, IRQF_DISABLED,
-                         "pxa2xx-i2c", i2c);
+       switch (dev->id) {
+       case 0:
+#ifdef CONFIG_PXA27x
+               pxa_gpio_mode(GPIO117_I2CSCL_MD);
+               pxa_gpio_mode(GPIO118_I2CSDA_MD);
+#endif
+               pxa_set_cken(CKEN14_I2C, 1);
+               break;
+#ifdef CONFIG_PXA27x
+       case 1:
+               local_irq_disable();
+               PCFR |= PCFR_PI2CEN;
+               local_irq_enable();
+               pxa_set_cken(CKEN15_PWRI2C, 1);
+#endif
+       }
+
+       ret = request_irq(irq, i2c_pxa_handler, IRQF_DISABLED,
+                         i2c->adap.name, i2c);
        if (ret)
-               goto out;
+               goto ereqirq;
+
 
        i2c_pxa_reset(i2c);
 
@@ -856,7 +914,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
        ret = i2c_add_adapter(&i2c->adap);
        if (ret < 0) {
                printk(KERN_INFO "I2C: Failed to add bus\n");
-               goto err_irq;
+               goto eadapt;
        }
 
        platform_set_drvdata(dev, i2c);
@@ -870,9 +928,25 @@ static int i2c_pxa_probe(struct platform_device *dev)
 #endif
        return 0;
 
- err_irq:
-       free_irq(IRQ_I2C, i2c);
- out:
+eadapt:
+       free_irq(irq, i2c);
+ereqirq:
+       switch (dev->id) {
+       case 0:
+               pxa_set_cken(CKEN14_I2C, 0);
+               break;
+#ifdef CONFIG_PXA27x
+       case 1:
+               pxa_set_cken(CKEN15_PWRI2C, 0);
+               local_irq_disable();
+               PCFR &= ~PCFR_PI2CEN;
+               local_irq_enable();
+#endif
+       }
+eremap:
+       kfree(i2c);
+emalloc:
+       release_mem_region(res->start, res_len(res));
        return ret;
 }
 
@@ -883,8 +957,21 @@ static int i2c_pxa_remove(struct platform_device *dev)
        platform_set_drvdata(dev, NULL);
 
        i2c_del_adapter(&i2c->adap);
-       free_irq(IRQ_I2C, i2c);
-       pxa_set_cken(CKEN14_I2C, 0);
+       free_irq(i2c->irq, i2c);
+       switch (dev->id) {
+       case 0:
+               pxa_set_cken(CKEN14_I2C, 0);
+               break;
+#ifdef CONFIG_PXA27x
+       case 1:
+               pxa_set_cken(CKEN15_PWRI2C, 0);
+               local_irq_disable();
+               PCFR &= ~PCFR_PI2CEN;
+               local_irq_enable();
+#endif
+       }
+       release_mem_region(i2c->iobase, i2c->iosize);
+       kfree(i2c);
 
        return 0;
 }
index ec03341d2bd8c2e934478c0cbc0826216cd2576c..350764ece7feb5e474250e621b2efed704b40faa 100644 (file)
@@ -797,6 +797,14 @@ config BLK_DEV_IDEDMA_PMAC
          to transfer data to and from memory.  Saying Y is safe and improves
          performance.
 
+config BLK_DEV_IDE_CELLEB
+       bool "Toshiba's Cell Reference Set IDE support"
+       depends on PPC_CELLEB
+       help
+         This driver provides support for the built-in IDE controller on
+         Toshiba Cell Reference Board.
+         If unsure, say Y.
+
 config BLK_DEV_IDE_SWARM
        tristate "IDE for Sibyte evaluation boards"
        depends on SIBYTE_SB1xxx_SOC
index d9f029e8ff7411cdb5827d5ed889bcbd5847402d..28feedfbd21dda41123e8c6066bcdfa47e1b477f 100644 (file)
@@ -37,6 +37,7 @@ ide-core-$(CONFIG_BLK_DEV_Q40IDE)     += legacy/q40ide.o
 # built-in only drivers from ppc/
 ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE)  += ppc/mpc8xx.o
 ide-core-$(CONFIG_BLK_DEV_IDE_PMAC)    += ppc/pmac.o
+ide-core-$(CONFIG_BLK_DEV_IDE_CELLEB)  += ppc/scc_pata.o
 
 # built-in only drivers from h8300/
 ide-core-$(CONFIG_H8300)               += h8300/ide-h8300.o
index 8a1c27f28692c02c6fee0d43899eab4d000f126d..40e5c66b81ce58fea8c22c5d74b2d060cfc1c35c 100644 (file)
@@ -307,26 +307,24 @@ static int icside_set_speed(ide_drive_t *drive, u8 xfer_mode)
        return on;
 }
 
-static int icside_dma_host_off(ide_drive_t *drive)
+static void icside_dma_host_off(ide_drive_t *drive)
 {
-       return 0;
 }
 
-static int icside_dma_off_quietly(ide_drive_t *drive)
+static void icside_dma_off_quietly(ide_drive_t *drive)
 {
        drive->using_dma = 0;
-       return icside_dma_host_off(drive);
 }
 
-static int icside_dma_host_on(ide_drive_t *drive)
+static void icside_dma_host_on(ide_drive_t *drive)
 {
-       return 0;
 }
 
 static int icside_dma_on(ide_drive_t *drive)
 {
        drive->using_dma = 1;
-       return icside_dma_host_on(drive);
+
+       return 0;
 }
 
 static int icside_dma_check(ide_drive_t *drive)
@@ -365,10 +363,7 @@ static int icside_dma_check(ide_drive_t *drive)
 out:
        on = icside_set_speed(drive, xfer_mode);
 
-       if (on)
-               return icside_dma_on(drive);
-       else
-               return icside_dma_off_quietly(drive);
+       return on ? 0 : -1;
 }
 
 static int icside_dma_end(ide_drive_t *drive)
@@ -497,9 +492,9 @@ static void icside_dma_init(ide_hwif_t *hwif)
        hwif->autodma           = autodma;
 
        hwif->ide_dma_check     = icside_dma_check;
-       hwif->ide_dma_host_off  = icside_dma_host_off;
-       hwif->ide_dma_off_quietly = icside_dma_off_quietly;
-       hwif->ide_dma_host_on   = icside_dma_host_on;
+       hwif->dma_host_off      = icside_dma_host_off;
+       hwif->dma_off_quietly   = icside_dma_off_quietly;
+       hwif->dma_host_on       = icside_dma_host_on;
        hwif->ide_dma_on        = icside_dma_on;
        hwif->dma_setup         = icside_dma_setup;
        hwif->dma_exec_cmd      = icside_dma_exec_cmd;
@@ -556,7 +551,7 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
                 * Ensure we're using MMIO
                 */
                default_hwif_mmiops(hwif);
-               hwif->mmio = 2;
+               hwif->mmio = 1;
 
                for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
                        hwif->hw.io_ports[i] = port;
index 3058217767d62eb644efdf6253e530564e3fcbb1..9c6c49fdd2b14997d51d441b3ca9399cfd1d1f08 100644 (file)
@@ -46,7 +46,7 @@ rapide_locate_hwif(void __iomem *base, void __iomem *ctrl, unsigned int sz, int
        hwif->hw.io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
        hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
        hwif->hw.irq = hwif->irq = irq;
-       hwif->mmio = 2;
+       hwif->mmio = 1;
        default_hwif_mmiops(hwif);
 
        return hwif;
index 5797e0b5a1327f4e87a41e772bdd568d6180abce..6b2d152351b301f4243cb52843ed4b8e0fe7ffdb 100644 (file)
@@ -682,9 +682,12 @@ static void cris_ide_input_data (ide_drive_t *drive, void *, unsigned int);
 static void cris_ide_output_data (ide_drive_t *drive, void *, unsigned int);
 static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int);
 static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int);
-static int cris_dma_off (ide_drive_t *drive);
 static int cris_dma_on (ide_drive_t *drive);
 
+static void cris_dma_off(ide_drive_t *drive)
+{
+}
+
 static void tune_cris_ide(ide_drive_t *drive, u8 pio)
 {
        int setup, strobe, hold;
@@ -795,7 +798,7 @@ init_e100_ide (void)
                                0, 0, cris_ide_ack_intr,
                                ide_default_irq(0));
                ide_register_hw(&hw, &hwif);
-               hwif->mmio = 2;
+               hwif->mmio = 1;
                hwif->chipset = ide_etrax100;
                hwif->tuneproc = &tune_cris_ide;
                hwif->speedproc = &speed_cris_ide;
@@ -814,13 +817,16 @@ init_e100_ide (void)
                hwif->OUTBSYNC = &cris_ide_outbsync;
                hwif->INB = &cris_ide_inb;
                hwif->INW = &cris_ide_inw;
-               hwif->ide_dma_host_off = &cris_dma_off;
-               hwif->ide_dma_host_on = &cris_dma_on;
-               hwif->ide_dma_off_quietly = &cris_dma_off;
+               hwif->dma_host_off = &cris_dma_off;
+               hwif->dma_host_on = &cris_dma_on;
+               hwif->dma_off_quietly = &cris_dma_off;
                hwif->udma_four = 0;
                hwif->ultra_mask = cris_ultra_mask;
                hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */
                hwif->swdma_mask = 0x07; /* Singleword DMA 0-2 */
+               hwif->autodma = 1;
+               hwif->drives[0].autodma = 1;
+               hwif->drives[1].autodma = 1;
        }
 
        /* Reset pulse */
@@ -835,11 +841,6 @@ init_e100_ide (void)
        cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0);
 }
 
-static int cris_dma_off (ide_drive_t *drive)
-{
-       return 0;
-}
-
 static int cris_dma_on (ide_drive_t *drive)
 {
        return 0;
@@ -1045,17 +1046,10 @@ static ide_startstop_t cris_dma_intr (ide_drive_t *drive)
 
 static int cris_dma_check(ide_drive_t *drive)
 {
-       ide_hwif_t *hwif = drive->hwif;
-       struct hd_driveid* id = drive->id;
-
-       if (id && (id->capability & 1)) {
-               if (ide_use_dma(drive)) {
-                       if (cris_config_drive_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-       }
+       if (ide_use_dma(drive) && cris_config_drive_for_dma(drive))
+               return 0;
 
-       return hwif->ide_dma_off_quietly(drive);
+       return -1;
 }
 
 static int cris_dma_end(ide_drive_t *drive)
index 608ca871744b1a7e4ca81ec468e9fc8702343fe0..88750a300337dfd122509564363fcf14335f3d31 100644 (file)
@@ -76,13 +76,11 @@ static inline void hwif_setup(ide_hwif_t *hwif)
 {
        default_hwif_iops(hwif);
 
-       hwif->mmio  = 2;
+       hwif->mmio  = 1;
        hwif->OUTW  = mm_outw;
        hwif->OUTSW = mm_outsw;
        hwif->INW   = mm_inw;
        hwif->INSW  = mm_insw;
-       hwif->OUTL  = NULL;
-       hwif->INL   = NULL;
        hwif->OUTSL = NULL;
        hwif->INSL  = NULL;
 }
index 5969cec58dc155c2f21aea7e72c4b6d6aca9eb94..45a928c058cfb0b21c5b150127458d4fb9256773 100644 (file)
@@ -687,15 +687,8 @@ static void ide_dump_status_no_sense(ide_drive_t *drive, const char *msg, u8 sta
 static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
 {
        struct request *rq = HWGROUP(drive)->rq;
-       ide_hwif_t *hwif = HWIF(drive);
        int stat, err, sense_key;
        
-       /* We may have bogus DMA interrupts in PIO state here */
-       if (HWIF(drive)->dma_status && hwif->atapi_irq_bogon) {
-               stat = hwif->INB(hwif->dma_status);
-               /* Should we force the bit as well ? */
-               hwif->OUTB(stat, hwif->dma_status);
-       }
        /* Check for errors. */
        stat = HWIF(drive)->INB(IDE_STATUS_REG);
        if (stat_ret)
@@ -930,6 +923,10 @@ static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive,
                HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
  
        if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) {
+               /* waiting for CDB interrupt, not DMA yet. */
+               if (info->dma)
+                       drive->waiting_for_dma = 0;
+
                /* packet command */
                ide_execute_command(drive, WIN_PACKETCMD, handler, ATAPI_WAIT_PC, cdrom_timer_expiry);
                return ide_started;
@@ -972,6 +969,10 @@ static ide_startstop_t cdrom_transfer_packet_command (ide_drive_t *drive,
                /* Check for errors. */
                if (cdrom_decode_status(drive, DRQ_STAT, NULL))
                        return ide_stopped;
+
+               /* Ok, next interrupt will be DMA interrupt. */
+               if (info->dma)
+                       drive->waiting_for_dma = 1;
        } else {
                /* Otherwise, we must wait for DRQ to get set. */
                if (ide_wait_stat(&startstop, drive, DRQ_STAT,
@@ -1103,7 +1104,7 @@ static ide_startstop_t cdrom_read_intr (ide_drive_t *drive)
        if (dma) {
                info->dma = 0;
                if ((dma_error = HWIF(drive)->ide_dma_end(drive)))
-                       __ide_dma_off(drive);
+                       ide_dma_off(drive);
        }
 
        if (cdrom_decode_status(drive, 0, &stat))
@@ -1699,7 +1700,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
        if (dma) {
                if (dma_error) {
                        printk(KERN_ERR "ide-cd: dma error\n");
-                       __ide_dma_off(drive);
+                       ide_dma_off(drive);
                        return ide_error(drive, "dma error", stat);
                }
 
@@ -1825,7 +1826,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
                info->dma = 0;
                if ((dma_error = HWIF(drive)->ide_dma_end(drive))) {
                        printk(KERN_ERR "ide-cd: write dma error\n");
-                       __ide_dma_off(drive);
+                       ide_dma_off(drive);
                }
        }
 
@@ -3254,14 +3255,6 @@ int ide_cdrom_setup (ide_drive_t *drive)
        if (drive->autotune == IDE_TUNE_DEFAULT ||
            drive->autotune == IDE_TUNE_AUTO)
                drive->dsc_overlap = (drive->next != drive);
-#if 0
-       drive->dsc_overlap = (HWIF(drive)->no_dsc) ? 0 : 1;
-       if (HWIF(drive)->no_dsc) {
-               printk(KERN_INFO "ide-cd: %s: disabling DSC overlap\n",
-                       drive->name);
-               drive->dsc_overlap = 0;
-       }
-#endif
 
        if (ide_cdrom_register(drive, nslots)) {
                printk (KERN_ERR "%s: ide_cdrom_setup failed to register device with the cdrom driver.\n", drive->name);
@@ -3360,21 +3353,16 @@ static int idecd_open(struct inode * inode, struct file * file)
 {
        struct gendisk *disk = inode->i_bdev->bd_disk;
        struct cdrom_info *info;
-       ide_drive_t *drive;
        int rc = -ENOMEM;
 
        if (!(info = ide_cd_get(disk)))
                return -ENXIO;
 
-       drive = info->drive;
-
-       drive->usage++;
-
        if (!info->buffer)
-               info->buffer = kmalloc(SECTOR_BUFFER_SIZE,
-                                       GFP_KERNEL|__GFP_REPEAT);
-        if (!info->buffer || (rc = cdrom_open(&info->devinfo, inode, file)))
-               drive->usage--;
+               info->buffer = kmalloc(SECTOR_BUFFER_SIZE, GFP_KERNEL|__GFP_REPEAT);
+
+       if (info->buffer)
+               rc = cdrom_open(&info->devinfo, inode, file);
 
        if (rc < 0)
                ide_cd_put(info);
@@ -3386,10 +3374,8 @@ static int idecd_release(struct inode * inode, struct file * file)
 {
        struct gendisk *disk = inode->i_bdev->bd_disk;
        struct cdrom_info *info = ide_cd_g(disk);
-       ide_drive_t *drive = info->drive;
 
        cdrom_release (&info->devinfo, file);
-       drive->usage--;
 
        ide_cd_put(info);
 
index 0a05a377d66ac54a77056fd67cf484cf5bdf8fec..e2cea1889c4d350f4153146b64433cabbc72b620 100644 (file)
@@ -77,6 +77,7 @@ struct ide_disk_obj {
        ide_driver_t    *driver;
        struct gendisk  *disk;
        struct kref     kref;
+       unsigned int    openers;        /* protected by BKL for now */
 };
 
 static DEFINE_MUTEX(idedisk_ref_mutex);
@@ -1081,8 +1082,9 @@ static int idedisk_open(struct inode *inode, struct file *filp)
 
        drive = idkp->drive;
 
-       drive->usage++;
-       if (drive->removable && drive->usage == 1) {
+       idkp->openers++;
+
+       if (drive->removable && idkp->openers == 1) {
                ide_task_t args;
                memset(&args, 0, sizeof(ide_task_t));
                args.tfRegister[IDE_COMMAND_OFFSET] = WIN_DOORLOCK;
@@ -1106,9 +1108,10 @@ static int idedisk_release(struct inode *inode, struct file *filp)
        struct ide_disk_obj *idkp = ide_disk_g(disk);
        ide_drive_t *drive = idkp->drive;
 
-       if (drive->usage == 1)
+       if (idkp->openers == 1)
                ide_cacheflush_p(drive);
-       if (drive->removable && drive->usage == 1) {
+
+       if (drive->removable && idkp->openers == 1) {
                ide_task_t args;
                memset(&args, 0, sizeof(ide_task_t));
                args.tfRegister[IDE_COMMAND_OFFSET] = WIN_DOORUNLOCK;
@@ -1117,7 +1120,8 @@ static int idedisk_release(struct inode *inode, struct file *filp)
                if (drive->doorlocking && ide_raw_taskfile(drive, &args, NULL))
                        drive->doorlocking = 0;
        }
-       drive->usage--;
+
+       idkp->openers--;
 
        ide_disk_put(idkp);
 
index 56efed6742d4d32945a1072203fea57b833d1df5..08e7cd043bccc9f9a7937276431f25130b3d7509 100644 (file)
@@ -348,15 +348,14 @@ EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
 static int config_drive_for_dma (ide_drive_t *drive)
 {
        struct hd_driveid *id = drive->id;
-       ide_hwif_t *hwif = HWIF(drive);
 
-       if ((id->capability & 1) && hwif->autodma) {
+       if ((id->capability & 1) && drive->hwif->autodma) {
                /*
                 * Enable DMA on any drive that has
                 * UltraDMA (mode 0/1/2/3/4/5/6) enabled
                 */
                if ((id->field_valid & 4) && ((id->dma_ultra >> 8) & 0x7f))
-                       return hwif->ide_dma_on(drive);
+                       return 0;
                /*
                 * Enable DMA on any drive that has mode2 DMA
                 * (multi or single) enabled
@@ -364,14 +363,14 @@ static int config_drive_for_dma (ide_drive_t *drive)
                if (id->field_valid & 2)        /* regular DMA */
                        if ((id->dma_mword & 0x404) == 0x404 ||
                            (id->dma_1word & 0x404) == 0x404)
-                               return hwif->ide_dma_on(drive);
+                               return 0;
 
                /* Consult the list of known "good" drives */
                if (__ide_dma_good_drive(drive))
-                       return hwif->ide_dma_on(drive);
+                       return 0;
        }
-//     if (hwif->tuneproc != NULL) hwif->tuneproc(drive, 255);
-       return hwif->ide_dma_off_quietly(drive);
+
+       return -1;
 }
 
 /**
@@ -415,72 +414,68 @@ static int dma_timer_expiry (ide_drive_t *drive)
 }
 
 /**
- *     __ide_dma_host_off      -       Generic DMA kill
+ *     ide_dma_host_off        -       Generic DMA kill
  *     @drive: drive to control
  *
  *     Perform the generic IDE controller DMA off operation. This
  *     works for most IDE bus mastering controllers
  */
 
-int __ide_dma_host_off (ide_drive_t *drive)
+void ide_dma_host_off(ide_drive_t *drive)
 {
        ide_hwif_t *hwif        = HWIF(drive);
        u8 unit                 = (drive->select.b.unit & 0x01);
        u8 dma_stat             = hwif->INB(hwif->dma_status);
 
        hwif->OUTB((dma_stat & ~(1<<(5+unit))), hwif->dma_status);
-       return 0;
 }
 
-EXPORT_SYMBOL(__ide_dma_host_off);
+EXPORT_SYMBOL(ide_dma_host_off);
 
 /**
- *     __ide_dma_host_off_quietly      -       Generic DMA kill
+ *     ide_dma_off_quietly     -       Generic DMA kill
  *     @drive: drive to control
  *
  *     Turn off the current DMA on this IDE controller. 
  */
 
-int __ide_dma_off_quietly (ide_drive_t *drive)
+void ide_dma_off_quietly(ide_drive_t *drive)
 {
        drive->using_dma = 0;
        ide_toggle_bounce(drive, 0);
 
-       if (HWIF(drive)->ide_dma_host_off(drive))
-               return 1;
-
-       return 0;
+       drive->hwif->dma_host_off(drive);
 }
 
-EXPORT_SYMBOL(__ide_dma_off_quietly);
+EXPORT_SYMBOL(ide_dma_off_quietly);
 #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
 
 /**
- *     __ide_dma_off   -       disable DMA on a device
+ *     ide_dma_off     -       disable DMA on a device
  *     @drive: drive to disable DMA on
  *
  *     Disable IDE DMA for a device on this IDE controller.
  *     Inform the user that DMA has been disabled.
  */
 
-int __ide_dma_off (ide_drive_t *drive)
+void ide_dma_off(ide_drive_t *drive)
 {
        printk(KERN_INFO "%s: DMA disabled\n", drive->name);
-       return HWIF(drive)->ide_dma_off_quietly(drive);
+       drive->hwif->dma_off_quietly(drive);
 }
 
-EXPORT_SYMBOL(__ide_dma_off);
+EXPORT_SYMBOL(ide_dma_off);
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI
 /**
- *     __ide_dma_host_on       -       Enable DMA on a host
+ *     ide_dma_host_on -       Enable DMA on a host
  *     @drive: drive to enable for DMA
  *
  *     Enable DMA on an IDE controller following generic bus mastering
  *     IDE controller behaviour
  */
-int __ide_dma_host_on (ide_drive_t *drive)
+
+void ide_dma_host_on(ide_drive_t *drive)
 {
        if (drive->using_dma) {
                ide_hwif_t *hwif        = HWIF(drive);
@@ -488,12 +483,10 @@ int __ide_dma_host_on (ide_drive_t *drive)
                u8 dma_stat             = hwif->INB(hwif->dma_status);
 
                hwif->OUTB((dma_stat|(1<<(5+unit))), hwif->dma_status);
-               return 0;
        }
-       return 1;
 }
 
-EXPORT_SYMBOL(__ide_dma_host_on);
+EXPORT_SYMBOL(ide_dma_host_on);
 
 /**
  *     __ide_dma_on            -       Enable DMA on a device
@@ -511,8 +504,7 @@ int __ide_dma_on (ide_drive_t *drive)
        drive->using_dma = 1;
        ide_toggle_bounce(drive, 1);
 
-       if (HWIF(drive)->ide_dma_host_on(drive))
-               return 1;
+       drive->hwif->dma_host_on(drive);
 
        return 0;
 }
@@ -565,7 +557,10 @@ int ide_dma_setup(ide_drive_t *drive)
        }
 
        /* PRD table */
-       hwif->OUTL(hwif->dmatable_dma, hwif->dma_prdtable);
+       if (hwif->mmio)
+               writel(hwif->dmatable_dma, (void __iomem *)hwif->dma_prdtable);
+       else
+               outl(hwif->dmatable_dma, hwif->dma_prdtable);
 
        /* specify r/w */
        hwif->OUTB(reading, hwif->dma_command);
@@ -680,6 +675,9 @@ int ide_use_dma(ide_drive_t *drive)
        struct hd_driveid *id = drive->id;
        ide_hwif_t *hwif = drive->hwif;
 
+       if ((id->capability & 1) == 0 || drive->autodma == 0)
+               return 0;
+
        /* consult the list of known "bad" drives */
        if (__ide_dma_bad_drive(drive))
                return 0;
@@ -753,12 +751,37 @@ void ide_dma_verbose(ide_drive_t *drive)
        return;
 bug_dma_off:
        printk(", BUG DMA OFF");
-       hwif->ide_dma_off_quietly(drive);
+       hwif->dma_off_quietly(drive);
        return;
 }
 
 EXPORT_SYMBOL(ide_dma_verbose);
 
+int ide_set_dma(ide_drive_t *drive)
+{
+       ide_hwif_t *hwif = drive->hwif;
+       int rc;
+
+       rc = hwif->ide_dma_check(drive);
+
+       switch(rc) {
+       case -1: /* DMA needs to be disabled */
+               hwif->dma_off_quietly(drive);
+               return 0;
+       case  0: /* DMA needs to be enabled */
+               return hwif->ide_dma_on(drive);
+       case  1: /* DMA setting cannot be changed */
+               break;
+       default:
+               BUG();
+               break;
+       }
+
+       return rc;
+}
+
+EXPORT_SYMBOL_GPL(ide_set_dma);
+
 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI
 int __ide_dma_lostirq (ide_drive_t *drive)
 {
@@ -809,7 +832,7 @@ int ide_release_dma(ide_hwif_t *hwif)
 {
        ide_release_dma_engine(hwif);
 
-       if (hwif->mmio == 2)
+       if (hwif->mmio)
                return 1;
        else
                return ide_release_iomio_dma(hwif);
@@ -878,9 +901,9 @@ static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int port
 
 static int ide_dma_iobase(ide_hwif_t *hwif, unsigned long base, unsigned int ports)
 {
-       if (hwif->mmio == 2)
+       if (hwif->mmio)
                return ide_mapped_mmio_dma(hwif, base,ports);
-       BUG_ON(hwif->mmio == 1);
+
        return ide_iomio_dma(hwif, base, ports);
 }
 
@@ -908,14 +931,14 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
        if (!(hwif->dma_prdtable))
                hwif->dma_prdtable      = (hwif->dma_base + 4);
 
-       if (!hwif->ide_dma_off_quietly)
-               hwif->ide_dma_off_quietly = &__ide_dma_off_quietly;
-       if (!hwif->ide_dma_host_off)
-               hwif->ide_dma_host_off = &__ide_dma_host_off;
+       if (!hwif->dma_off_quietly)
+               hwif->dma_off_quietly = &ide_dma_off_quietly;
+       if (!hwif->dma_host_off)
+               hwif->dma_host_off = &ide_dma_host_off;
        if (!hwif->ide_dma_on)
                hwif->ide_dma_on = &__ide_dma_on;
-       if (!hwif->ide_dma_host_on)
-               hwif->ide_dma_host_on = &__ide_dma_host_on;
+       if (!hwif->dma_host_on)
+               hwif->dma_host_on = &ide_dma_host_on;
        if (!hwif->ide_dma_check)
                hwif->ide_dma_check = &__ide_dma_check;
        if (!hwif->dma_setup)
index d33717c8afd466731855e4a42f01d65c9ee85b2e..57cd21c5b2c1f0c0fdc7a79985f226f736a0da00 100644 (file)
@@ -279,6 +279,7 @@ typedef struct ide_floppy_obj {
        ide_driver_t    *driver;
        struct gendisk  *disk;
        struct kref     kref;
+       unsigned int    openers;        /* protected by BKL for now */
 
        /* Current packet command */
        idefloppy_pc_t *pc;
@@ -866,7 +867,7 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
        if (test_and_clear_bit(PC_DMA_IN_PROGRESS, &pc->flags)) {
                printk(KERN_ERR "ide-floppy: The floppy wants to issue "
                        "more interrupts in DMA mode\n");
-               (void)__ide_dma_off(drive);
+               ide_dma_off(drive);
                return ide_do_reset(drive);
        }
 
@@ -1096,9 +1097,9 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *p
        pc->current_position = pc->buffer;
        bcount.all = min(pc->request_transfer, 63 * 1024);
 
-       if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) {
-               (void)__ide_dma_off(drive);
-       }
+       if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags))
+               ide_dma_off(drive);
+
        feature.all = 0;
 
        if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma)
@@ -1433,7 +1434,8 @@ static int idefloppy_get_capacity (ide_drive_t *drive)
        
        drive->bios_cyl = 0;
        drive->bios_head = drive->bios_sect = 0;
-       floppy->blocks = floppy->bs_factor = 0;
+       floppy->blocks = 0;
+       floppy->bs_factor = 1;
        set_capacity(floppy->disk, 0);
 
        idefloppy_create_read_capacity_cmd(&pc);
@@ -1949,9 +1951,9 @@ static int idefloppy_open(struct inode *inode, struct file *filp)
 
        drive = floppy->drive;
 
-       drive->usage++;
+       floppy->openers++;
 
-       if (drive->usage == 1) {
+       if (floppy->openers == 1) {
                clear_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags);
                /* Just in case */
 
@@ -1969,13 +1971,11 @@ static int idefloppy_open(struct inode *inode, struct file *filp)
                    ** capacity of the drive or begin the format - Sam
                    */
                    ) {
-                       drive->usage--;
                        ret = -EIO;
                        goto out_put_floppy;
                }
 
                if (floppy->wp && (filp->f_mode & 2)) {
-                       drive->usage--;
                        ret = -EROFS;
                        goto out_put_floppy;
                }
@@ -1987,13 +1987,13 @@ static int idefloppy_open(struct inode *inode, struct file *filp)
                }
                check_disk_change(inode->i_bdev);
        } else if (test_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags)) {
-               drive->usage--;
                ret = -EBUSY;
                goto out_put_floppy;
        }
        return 0;
 
 out_put_floppy:
+       floppy->openers--;
        ide_floppy_put(floppy);
        return ret;
 }
@@ -2007,7 +2007,7 @@ static int idefloppy_release(struct inode *inode, struct file *filp)
        
        debug_log(KERN_INFO "Reached idefloppy_release\n");
 
-       if (drive->usage == 1) {
+       if (floppy->openers == 1) {
                /* IOMEGA Clik! drives do not support lock/unlock commands */
                 if (!test_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags)) {
                        idefloppy_create_prevent_cmd(&pc, 0);
@@ -2016,7 +2016,8 @@ static int idefloppy_release(struct inode *inode, struct file *filp)
 
                clear_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags);
        }
-       drive->usage--;
+
+       floppy->openers--;
 
        ide_floppy_put(floppy);
 
@@ -2050,7 +2051,7 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
                prevent = 0;
                /* fall through */
        case CDROM_LOCKDOOR:
-               if (drive->usage > 1)
+               if (floppy->openers > 1)
                        return -EBUSY;
 
                /* The IOMEGA Clik! Drive doesn't support this command - no room for an eject mechanism */
@@ -2072,7 +2073,7 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
                if (!(file->f_mode & 2))
                        return -EPERM;
 
-               if (drive->usage > 1) {
+               if (floppy->openers > 1) {
                        /* Don't format if someone is using the disk */
 
                        clear_bit(IDEFLOPPY_FORMAT_IN_PROGRESS,
index 2614f41b5074ea2d203767be2eefa6a4b5505f45..c193553f6fe749e88724e4a63f812179dde309c5 100644 (file)
@@ -226,7 +226,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
                        break;
                if (drive->hwif->ide_dma_check == NULL)
                        break;
-               drive->hwif->ide_dma_check(drive);
+               ide_set_dma(drive);
                break;
        }
        pm->pm_step = ide_pm_state_completed;
@@ -1351,7 +1351,7 @@ static ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error)
         */
        drive->retry_pio++;
        drive->state = DMA_PIO_RETRY;
-       (void) hwif->ide_dma_off_quietly(drive);
+       hwif->dma_off_quietly(drive);
 
        /*
         * un-busy drive etc (hwgroup->busy is cleared on return) and
@@ -1646,6 +1646,17 @@ irqreturn_t ide_intr (int irq, void *dev_id)
        del_timer(&hwgroup->timer);
        spin_unlock(&ide_lock);
 
+       /* Some controllers might set DMA INTR no matter DMA or PIO;
+        * bmdma status might need to be cleared even for
+        * PIO interrupts to prevent spurious/lost irq.
+        */
+       if (hwif->ide_dma_clear_irq && !(drive->waiting_for_dma))
+               /* ide_dma_end() needs bmdma status for error checking.
+                * So, skip clearing bmdma status here and leave it
+                * to ide_dma_end() if this is dma interrupt.
+                */
+               hwif->ide_dma_clear_irq(drive);
+
        if (drive->unmask)
                local_irq_enable_in_hardirq();
        /* service this interrupt, may set handler for next interrupt */
index badde6331775a12208c375fb68139b0e156d9606..c67b3b1e6f4c64b255d043220a8cdc8b72aff80b 100644 (file)
@@ -49,11 +49,6 @@ static void ide_insw (unsigned long port, void *addr, u32 count)
        insw(port, addr, count);
 }
 
-static u32 ide_inl (unsigned long port)
-{
-       return (u32) inl(port);
-}
-
 static void ide_insl (unsigned long port, void *addr, u32 count)
 {
        insl(port, addr, count);
@@ -79,11 +74,6 @@ static void ide_outsw (unsigned long port, void *addr, u32 count)
        outsw(port, addr, count);
 }
 
-static void ide_outl (u32 val, unsigned long port)
-{
-       outl(val, port);
-}
-
 static void ide_outsl (unsigned long port, void *addr, u32 count)
 {
        outsl(port, addr, count);
@@ -94,12 +84,10 @@ void default_hwif_iops (ide_hwif_t *hwif)
        hwif->OUTB      = ide_outb;
        hwif->OUTBSYNC  = ide_outbsync;
        hwif->OUTW      = ide_outw;
-       hwif->OUTL      = ide_outl;
        hwif->OUTSW     = ide_outsw;
        hwif->OUTSL     = ide_outsl;
        hwif->INB       = ide_inb;
        hwif->INW       = ide_inw;
-       hwif->INL       = ide_inl;
        hwif->INSW      = ide_insw;
        hwif->INSL      = ide_insl;
 }
@@ -123,11 +111,6 @@ static void ide_mm_insw (unsigned long port, void *addr, u32 count)
        __ide_mm_insw((void __iomem *) port, addr, count);
 }
 
-static u32 ide_mm_inl (unsigned long port)
-{
-       return (u32) readl((void __iomem *) port);
-}
-
 static void ide_mm_insl (unsigned long port, void *addr, u32 count)
 {
        __ide_mm_insl((void __iomem *) port, addr, count);
@@ -153,11 +136,6 @@ static void ide_mm_outsw (unsigned long port, void *addr, u32 count)
        __ide_mm_outsw((void __iomem *) port, addr, count);
 }
 
-static void ide_mm_outl (u32 value, unsigned long port)
-{
-       writel(value, (void __iomem *) port);
-}
-
 static void ide_mm_outsl (unsigned long port, void *addr, u32 count)
 {
        __ide_mm_outsl((void __iomem *) port, addr, count);
@@ -170,12 +148,10 @@ void default_hwif_mmiops (ide_hwif_t *hwif)
           this one is controller specific! */
        hwif->OUTBSYNC  = ide_mm_outbsync;
        hwif->OUTW      = ide_mm_outw;
-       hwif->OUTL      = ide_mm_outl;
        hwif->OUTSW     = ide_mm_outsw;
        hwif->OUTSL     = ide_mm_outsl;
        hwif->INB       = ide_mm_inb;
        hwif->INW       = ide_mm_inw;
-       hwif->INL       = ide_mm_inl;
        hwif->INSW      = ide_mm_insw;
        hwif->INSL      = ide_mm_insl;
 }
@@ -777,7 +753,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
        if (hwif->ide_dma_check)         /* check if host supports DMA */
-               hwif->ide_dma_host_off(drive);
+               hwif->dma_host_off(drive);
 #endif
 
        /*
@@ -854,9 +830,9 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
        if (speed >= XFER_SW_DMA_0)
-               hwif->ide_dma_host_on(drive);
+               hwif->dma_host_on(drive);
        else if (hwif->ide_dma_check)   /* check if host supports DMA */
-               hwif->ide_dma_off_quietly(drive);
+               hwif->dma_off_quietly(drive);
 #endif
 
        switch(speed) {
@@ -1066,12 +1042,12 @@ static void check_dma_crc(ide_drive_t *drive)
 {
 #ifdef CONFIG_BLK_DEV_IDEDMA
        if (drive->crc_count) {
-               (void) HWIF(drive)->ide_dma_off_quietly(drive);
+               drive->hwif->dma_off_quietly(drive);
                ide_set_xfer_rate(drive, ide_auto_reduce_xfer(drive));
                if (drive->current_speed >= XFER_SW_DMA_0)
                        (void) HWIF(drive)->ide_dma_on(drive);
        } else
-               (void)__ide_dma_off(drive);
+               ide_dma_off(drive);
 #endif
 }
 
index 8237d89eec6e2c3ddd735369ddef750c1ea4fad3..8afce4ceea310c6e47eea9ff1c715bdb39916591 100644 (file)
@@ -205,6 +205,21 @@ int ide_dma_enable (ide_drive_t *drive)
 
 EXPORT_SYMBOL(ide_dma_enable);
 
+int ide_use_fast_pio(ide_drive_t *drive)
+{
+       struct hd_driveid *id = drive->id;
+
+       if ((id->capability & 1) && drive->autodma)
+               return 1;
+
+       if ((id->capability & 8) || (id->field_valid & 2))
+               return 1;
+
+       return 0;
+}
+
+EXPORT_SYMBOL_GPL(ide_use_fast_pio);
+
 /*
  * Standard (generic) timings for PIO modes, from ATA2 specification.
  * These timings are for access to the IDE data port register *only*.
@@ -349,7 +364,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p
        int use_iordy = 0;
        struct hd_driveid* id = drive->id;
        int overridden  = 0;
-       int blacklisted = 0;
 
        if (mode_wanted != 255) {
                pio_mode = mode_wanted;
@@ -357,7 +371,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p
                pio_mode = 0;
        } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) {
                overridden = 1;
-               blacklisted = 1;
                use_iordy = (pio_mode > 2);
        } else {
                pio_mode = id->tPIO;
@@ -409,7 +422,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p
                d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time;
                d->use_iordy = use_iordy;
                d->overridden = overridden;
-               d->blacklisted = blacklisted;
        }
        return pio_mode;
 }
@@ -462,8 +474,6 @@ int ide_set_xfer_rate(ide_drive_t *drive, u8 rate)
                return -1;
 }
 
-EXPORT_SYMBOL_GPL(ide_set_xfer_rate);
-
 static void ide_dump_opcode(ide_drive_t *drive)
 {
        struct request *rq;
index 176bbc850d6ba8731bd5e8b89de627c5209208c2..8afbd6cb94be9ac50db17f3c62f03c4804791a1e 100644 (file)
@@ -853,11 +853,11 @@ static void probe_hwif(ide_hwif_t *hwif)
                                 * things, if not checked and cleared.
                                 *   PARANOIA!!!
                                 */
-                               hwif->ide_dma_off_quietly(drive);
+                               hwif->dma_off_quietly(drive);
 #ifdef CONFIG_IDEDMA_ONLYDISK
                                if (drive->media == ide_disk)
 #endif
-                                       hwif->ide_dma_check(drive);
+                                       ide_set_dma(drive);
                        }
                }
        }
index c6eec0413a6c5f323bf67798554a6a794747773e..4e59239fef75e1ecd7638d0dcf3f7fdc6e4a2b7b 100644 (file)
@@ -1970,7 +1970,7 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive)
                printk(KERN_ERR "ide-tape: The tape wants to issue more "
                                "interrupts in DMA mode\n");
                printk(KERN_ERR "ide-tape: DMA disabled, reverting to PIO\n");
-               (void)__ide_dma_off(drive);
+               ide_dma_off(drive);
                return ide_do_reset(drive);
        }
        /* Get the number of bytes to transfer on this interrupt. */
@@ -2176,7 +2176,7 @@ static ide_startstop_t idetape_issue_packet_command (ide_drive_t *drive, idetape
        if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) {
                printk(KERN_WARNING "ide-tape: DMA disabled, "
                                "reverting to PIO\n");
-               (void)__ide_dma_off(drive);
+               ide_dma_off(drive);
        }
        if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma)
                dma_ok = !hwif->dma_setup(drive);
@@ -4792,15 +4792,10 @@ static int idetape_open(struct inode *inode, struct file *filp)
 {
        struct gendisk *disk = inode->i_bdev->bd_disk;
        struct ide_tape_obj *tape;
-       ide_drive_t *drive;
 
        if (!(tape = ide_tape_get(disk)))
                return -ENXIO;
 
-       drive = tape->drive;
-
-       drive->usage++;
-
        return 0;
 }
 
@@ -4808,9 +4803,6 @@ static int idetape_release(struct inode *inode, struct file *filp)
 {
        struct gendisk *disk = inode->i_bdev->bd_disk;
        struct ide_tape_obj *tape = ide_tape_g(disk);
-       ide_drive_t *drive = tape->drive;
-
-       drive->usage--;
 
        ide_tape_put(tape);
 
index c750f6ce770a2ab053f1b4f515b6f81f2ed82a3e..b3c0818c5c6c592eefa9289b0e2cbe1492bf73a3 100644 (file)
@@ -389,9 +389,8 @@ int ide_hwif_request_regions(ide_hwif_t *hwif)
        unsigned long addr;
        unsigned int i;
 
-       if (hwif->mmio == 2)
+       if (hwif->mmio)
                return 0;
-       BUG_ON(hwif->mmio == 1);
        addr = hwif->io_ports[IDE_CONTROL_OFFSET];
        if (addr && !hwif_request_region(hwif, addr, 1))
                goto control_region_busy;
@@ -438,7 +437,7 @@ void ide_hwif_release_regions(ide_hwif_t *hwif)
 {
        u32 i = 0;
 
-       if (hwif->mmio == 2)
+       if (hwif->mmio)
                return;
        if (hwif->io_ports[IDE_CONTROL_OFFSET])
                release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1);
@@ -507,23 +506,22 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
        hwif->ide_dma_end               = tmp_hwif->ide_dma_end;
        hwif->ide_dma_check             = tmp_hwif->ide_dma_check;
        hwif->ide_dma_on                = tmp_hwif->ide_dma_on;
-       hwif->ide_dma_off_quietly       = tmp_hwif->ide_dma_off_quietly;
+       hwif->dma_off_quietly           = tmp_hwif->dma_off_quietly;
        hwif->ide_dma_test_irq          = tmp_hwif->ide_dma_test_irq;
-       hwif->ide_dma_host_on           = tmp_hwif->ide_dma_host_on;
-       hwif->ide_dma_host_off          = tmp_hwif->ide_dma_host_off;
+       hwif->ide_dma_clear_irq         = tmp_hwif->ide_dma_clear_irq;
+       hwif->dma_host_on               = tmp_hwif->dma_host_on;
+       hwif->dma_host_off              = tmp_hwif->dma_host_off;
        hwif->ide_dma_lostirq           = tmp_hwif->ide_dma_lostirq;
        hwif->ide_dma_timeout           = tmp_hwif->ide_dma_timeout;
 
        hwif->OUTB                      = tmp_hwif->OUTB;
        hwif->OUTBSYNC                  = tmp_hwif->OUTBSYNC;
        hwif->OUTW                      = tmp_hwif->OUTW;
-       hwif->OUTL                      = tmp_hwif->OUTL;
        hwif->OUTSW                     = tmp_hwif->OUTSW;
        hwif->OUTSL                     = tmp_hwif->OUTSL;
 
        hwif->INB                       = tmp_hwif->INB;
        hwif->INW                       = tmp_hwif->INW;
-       hwif->INL                       = tmp_hwif->INL;
        hwif->INSW                      = tmp_hwif->INSW;
        hwif->INSL                      = tmp_hwif->INSL;
 
@@ -551,7 +549,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
        hwif->extra_ports               = tmp_hwif->extra_ports;
        hwif->autodma                   = tmp_hwif->autodma;
        hwif->udma_four                 = tmp_hwif->udma_four;
-       hwif->no_dsc                    = tmp_hwif->no_dsc;
 
        hwif->hwif_data                 = tmp_hwif->hwif_data;
 }
@@ -1138,12 +1135,11 @@ static int set_using_dma (ide_drive_t *drive, int arg)
        if (HWIF(drive)->ide_dma_check == NULL)
                return -EPERM;
        if (arg) {
-               if (HWIF(drive)->ide_dma_check(drive)) return -EIO;
-               if (HWIF(drive)->ide_dma_on(drive)) return -EIO;
-       } else {
-               if (__ide_dma_off(drive))
+               if (ide_set_dma(drive))
                        return -EIO;
-       }
+               if (HWIF(drive)->ide_dma_on(drive)) return -EIO;
+       } else
+               ide_dma_off(drive);
        return 0;
 #else
        return -EPERM;
index 0391a3122878f14876c46e71e5ad403cd745348f..1ed224a01f79ddd24e371740cccc55a4065e26fc 100644 (file)
@@ -215,7 +215,7 @@ fail_base2:
                        
                        index = ide_register_hw(&hw, &hwif);
                        if (index != -1) {
-                               hwif->mmio = 2;
+                               hwif->mmio = 1;
                                printk("ide%d: ", index);
                                switch(type) {
                                case BOARD_BUDDHA:
index 64d42619ab06a1f7e4e4d576bd8f8ef329ff5ee8..dcfadbbf55d88e0ccbe56b0abc831a63d9ecaab8 100644 (file)
@@ -167,7 +167,7 @@ found:
 
        index = ide_register_hw(&hw, &hwif);
        if (index != -1) {
-           hwif->mmio = 2;
+           hwif->mmio = 1;
            switch (i) {
                case 0:
                    printk("ide%d: Gayle IDE interface (A%d style)\n", index,
index c48e87e512d38298bdc15f358a2751217e1b1615..19ccd006f205ae1a329c16ad64a76e29adae7ac1 100644 (file)
@@ -143,16 +143,16 @@ static void ht6560b_selectproc (ide_drive_t *drive)
                current_timing = timing;
                if (drive->media != ide_disk || !drive->present)
                        select |= HT_PREFETCH_MODE;
-               (void) HWIF(drive)->INB(HT_CONFIG_PORT);
-               (void) HWIF(drive)->INB(HT_CONFIG_PORT);
-               (void) HWIF(drive)->INB(HT_CONFIG_PORT);
-               (void) HWIF(drive)->INB(HT_CONFIG_PORT);
-               HWIF(drive)->OUTB(select, HT_CONFIG_PORT);
+               (void)inb(HT_CONFIG_PORT);
+               (void)inb(HT_CONFIG_PORT);
+               (void)inb(HT_CONFIG_PORT);
+               (void)inb(HT_CONFIG_PORT);
+               outb(select, HT_CONFIG_PORT);
                /*
                 * Set timing for this drive:
                 */
-               HWIF(drive)->OUTB(timing, IDE_SELECT_REG);
-               (void) HWIF(drive)->INB(IDE_STATUS_REG);
+               outb(timing, IDE_SELECT_REG);
+               (void)inb(IDE_STATUS_REG);
 #ifdef DEBUG
                printk("ht6560b: %s: select=%#x timing=%#x\n",
                        drive->name, select, timing);
index b1730d7e414c3ec1f53ad1dfa71bf855d8131cc0..4c0079ad52ac16a9dd95df58e9afdde2a29239bf 100644 (file)
@@ -141,7 +141,7 @@ void macide_init(void)
        }
 
         if (index != -1) {
-               hwif->mmio = 2;
+               hwif->mmio = 1;
                if (macintosh_config->ide_type == MAC_IDE_QUADRA)
                        printk(KERN_INFO "ide%d: Macintosh Quadra IDE interface\n", index);
                else if (macintosh_config->ide_type == MAC_IDE_PB)
index 434a94faa3b7202792ad5c05aa60144c3c59dbf3..74f08124eabb772f2d5f80abff23e4b11bfafecf 100644 (file)
@@ -145,7 +145,7 @@ void q40ide_init(void)
        index = ide_register_hw(&hw, &hwif);
        // **FIXME**
        if (index != -1)
-               hwif->mmio = 2;
+               hwif->mmio = 1;
     }
 }
 
index c7854ea57b52d42f346852f5ef8a7630306c4a4d..0a59d5ef1599e16d323bfadb051c6ae9491c9e6f 100644 (file)
@@ -181,12 +181,6 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed)
 {
        int mem_sttime;
        int mem_stcfg;
-       unsigned long mode;
-
-#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
-       if (ide_use_dma(drive))
-               mode = ide_dma_speed(drive, 0);
-#endif
 
        mem_sttime = 0;
        mem_stcfg  = au_readl(MEM_STCFG2);
@@ -195,7 +189,7 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed)
                auide_tune_drive(drive, speed - XFER_PIO_0);
                return 0;
        }
-             
+
        switch(speed) {
 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
        case XFER_MW_DMA_2:
@@ -207,7 +201,6 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed)
                mem_stcfg &= ~TOECS_MASK;
                mem_stcfg |= SBC_IDE_MDMA2_TCSOE | SBC_IDE_MDMA2_TOECS;
 
-               mode = XFER_MW_DMA_2;
                break;
        case XFER_MW_DMA_1:
                mem_sttime = SBC_IDE_TIMING(MDMA1);
@@ -218,7 +211,6 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed)
                mem_stcfg &= ~TOECS_MASK;
                mem_stcfg |= SBC_IDE_MDMA1_TCSOE | SBC_IDE_MDMA1_TOECS;
 
-               mode = XFER_MW_DMA_1;
                break;
        case XFER_MW_DMA_0:
                mem_sttime = SBC_IDE_TIMING(MDMA0);
@@ -229,14 +221,13 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed)
                mem_stcfg &= ~TOECS_MASK;
                mem_stcfg |= SBC_IDE_MDMA0_TCSOE | SBC_IDE_MDMA0_TOECS;
 
-               mode = XFER_MW_DMA_0;
                break;
 #endif
        default:
                return 1;
        }
-       
-       if (ide_config_drive_speed(drive, mode))
+
+       if (ide_config_drive_speed(drive, speed))
                return 1;
 
        au_writel(mem_sttime,MEM_STTIME2);
@@ -423,9 +414,9 @@ static int auide_dma_check(ide_drive_t *drive)
        speed = ide_find_best_mode(drive, XFER_PIO | XFER_MWDMA);
        
        if (drive->autodma && (speed & XFER_MODE) != XFER_PIO)
-               return HWIF(drive)->ide_dma_on(drive);
+               return 0;
 
-       return HWIF(drive)->ide_dma_off_quietly(drive);
+       return -1;
 }
 
 static int auide_dma_test_irq(ide_drive_t *drive)
@@ -447,27 +438,24 @@ static int auide_dma_test_irq(ide_drive_t *drive)
        return 0;
 }
 
-static int auide_dma_host_on(ide_drive_t *drive)
+static void auide_dma_host_on(ide_drive_t *drive)
 {
-       return 0;
 }
 
 static int auide_dma_on(ide_drive_t *drive)
 {
        drive->using_dma = 1;
-       return auide_dma_host_on(drive);
-}
 
+       return 0;
+}
 
-static int auide_dma_host_off(ide_drive_t *drive)
+static void auide_dma_host_off(ide_drive_t *drive)
 {
-       return 0;
 }
 
-static int auide_dma_off_quietly(ide_drive_t *drive)
+static void auide_dma_off_quietly(ide_drive_t *drive)
 {
        drive->using_dma = 0;
-       return auide_dma_host_off(drive);
 }
 
 static int auide_dma_lostirq(ide_drive_t *drive)
@@ -717,7 +705,8 @@ static int au_ide_probe(struct device *dev)
 
        /* hold should be on in all cases */
        hwif->hold                      = 1;
-       hwif->mmio                      = 2;
+
+       hwif->mmio  = 1;
 
        /* If the user has selected DDMA assisted copies,
           then set up a few local I/O function entry points 
@@ -732,7 +721,7 @@ static int au_ide_probe(struct device *dev)
        hwif->speedproc                 = &auide_tune_chipset;
 
 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
-       hwif->ide_dma_off_quietly       = &auide_dma_off_quietly;
+       hwif->dma_off_quietly           = &auide_dma_off_quietly;
        hwif->ide_dma_timeout           = &auide_dma_timeout;
 
        hwif->ide_dma_check             = &auide_dma_check;
@@ -741,8 +730,8 @@ static int au_ide_probe(struct device *dev)
        hwif->ide_dma_end               = &auide_dma_end;
        hwif->dma_setup                 = &auide_dma_setup;
        hwif->ide_dma_test_irq          = &auide_dma_test_irq;
-       hwif->ide_dma_host_off          = &auide_dma_host_off;
-       hwif->ide_dma_host_on           = &auide_dma_host_on;
+       hwif->dma_host_off              = &auide_dma_host_off;
+       hwif->dma_host_on               = &auide_dma_host_on;
        hwif->ide_dma_lostirq           = &auide_dma_lostirq;
        hwif->ide_dma_on                = &auide_dma_on;
 
index 09c9e7936b0dff79c5d44f84732a003f910ca2f5..81fa06851b27dadfd5c4d34c58aa38b6a276c5f4 100644 (file)
@@ -115,7 +115,7 @@ static int __devinit swarm_ide_probe(struct device *dev)
        /* Setup MMIO ops.  */
        default_hwif_mmiops(hwif);
        /* Prevent resource map manipulation.  */
-       hwif->mmio = 2;
+       hwif->mmio = 1;
        hwif->noprobe = 0;
 
        for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++)
index d261bfbad2227206505ae2c52fa079bf2a0c6a25..990eafe5ea1171e599efe0908fb3d0ea22ea0131 100644 (file)
@@ -94,9 +94,9 @@ static u8 aec62xx_ratemask (ide_drive_t *drive)
        switch(hwif->pci_dev->device) {
                case PCI_DEVICE_ID_ARTOP_ATP865:
                case PCI_DEVICE_ID_ARTOP_ATP865R:
-                       mode = (hwif->INB(((hwif->channel) ?
-                                       hwif->mate->dma_status :
-                                       hwif->dma_status)) & 0x10) ? 4 : 3;
+                       mode = (inb(hwif->channel ?
+                                   hwif->mate->dma_status :
+                                   hwif->dma_status) & 0x10) ? 4 : 3;
                        break;
                case PCI_DEVICE_ID_ARTOP_ATP860:
                case PCI_DEVICE_ID_ARTOP_ATP860R:
@@ -209,25 +209,13 @@ static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio)
 
 static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
-       if ((id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive))
                aec62xx_tune_drive(drive, 5);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return -1;
 }
 
 static int aec62xx_irq_timeout (ide_drive_t *drive)
@@ -286,10 +274,8 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
        hwif->tuneproc = &aec62xx_tune_drive;
        hwif->speedproc = &aec62xx_tune_chipset;
 
-       if (hwif->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) {
+       if (hwif->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF)
                hwif->serialized = hwif->channel;
-               hwif->no_dsc = 1;
-       }
 
        if (hwif->mate)
                hwif->mate->serialized = hwif->serialized;
index 68df77ec502b8aec6d5b166893d24741bf1be0bb..4debd18d52f83da057dc1e73922d196a442ce2d5 100644 (file)
@@ -507,17 +507,15 @@ static int config_chipset_for_dma (ide_drive_t *drive)
  *
  *     Configure a drive for DMA operation. If DMA is not possible we
  *     drop the drive into PIO mode instead.
- *
- *     FIXME: exactly what are we trying to return here
  */
+
 static int ali15x3_config_drive_for_dma(ide_drive_t *drive)
 {
        ide_hwif_t *hwif        = HWIF(drive);
        struct hd_driveid *id   = drive->id;
 
        if ((m5229_revision<=0x20) && (drive->media!=ide_disk))
-               return hwif->ide_dma_off_quietly(drive);
+               goto no_dma_set;
 
        drive->init_speed = 0;
 
@@ -552,9 +550,10 @@ try_dma_modes:
 ata_pio:
                hwif->tuneproc(drive, 255);
 no_dma_set:
-               return hwif->ide_dma_off_quietly(drive);
+               return -1;
        }
-       return hwif->ide_dma_on(drive);
+
+       return 0;
 }
 
 /**
@@ -852,8 +851,8 @@ static void __devinit init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase)
 {
        if (m5229_revision < 0x20)
                return;
-       if (!(hwif->channel))
-               hwif->OUTB(hwif->INB(dmabase+2) & 0x60, dmabase+2);
+       if (!hwif->channel)
+               outb(inb(dmabase + 2) & 0x60, dmabase + 2);
        ide_setup_dma(hwif, dmabase, 8);
 }
 
index a4336995a4108675d4a2f73a9af6dcde1838be04..7989bdd842a2312ae0ca21640c1bbfcf029338fb 100644 (file)
@@ -304,8 +304,9 @@ static int amd74xx_ide_dma_check(ide_drive_t *drive)
        amd_set_drive(drive, speed);
 
        if (drive->autodma && (speed & XFER_MODE) != XFER_PIO)
-               return HWIF(drive)->ide_dma_on(drive);
-       return HWIF(drive)->ide_dma_off_quietly(drive);
+               return 0;
+
+       return -1;
 }
 
 /*
index 982ac31fa9954bc09c30ede6e40a9e7f35dd1541..2d48af32e3f455dc7a67eed2e84418e4b6ae1234 100644 (file)
@@ -101,7 +101,7 @@ static u8 atiixp_dma_2_pio(u8 xfer_rate) {
        }
 }
 
-static int atiixp_ide_dma_host_on(ide_drive_t *drive)
+static void atiixp_dma_host_on(ide_drive_t *drive)
 {
        struct pci_dev *dev = drive->hwif->pci_dev;
        unsigned long flags;
@@ -118,10 +118,10 @@ static int atiixp_ide_dma_host_on(ide_drive_t *drive)
 
        spin_unlock_irqrestore(&atiixp_lock, flags);
 
-       return __ide_dma_host_on(drive);
+       ide_dma_host_on(drive);
 }
 
-static int atiixp_ide_dma_host_off(ide_drive_t *drive)
+static void atiixp_dma_host_off(ide_drive_t *drive)
 {
        struct pci_dev *dev = drive->hwif->pci_dev;
        unsigned long flags;
@@ -135,7 +135,7 @@ static int atiixp_ide_dma_host_off(ide_drive_t *drive)
 
        spin_unlock_irqrestore(&atiixp_lock, flags);
 
-       return __ide_dma_host_off(drive);
+       ide_dma_host_off(drive);
 }
 
 /**
@@ -235,11 +235,8 @@ static int atiixp_config_drive_for_dma(ide_drive_t *drive)
 {
        u8 speed = ide_dma_speed(drive, atiixp_ratemask(drive));
 
-       /* If no DMA speed was available then disable DMA and use PIO. */
-       if (!speed) {
-               u8 tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL);
-               speed = atiixp_dma_2_pio(XFER_PIO_0 + tspeed) + XFER_PIO_0;
-       }
+       if (!speed)
+               return 0;
 
        (void) atiixp_speedproc(drive, speed);
        return ide_dma_enable(drive);
@@ -255,30 +252,20 @@ static int atiixp_config_drive_for_dma(ide_drive_t *drive)
 
 static int atiixp_dma_check(ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
        u8 tspeed, speed;
 
        drive->init_speed = 0;
 
-       if ((id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (atiixp_config_drive_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && atiixp_config_drive_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive)) {
                tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL);
                speed = atiixp_dma_2_pio(XFER_PIO_0 + tspeed) + XFER_PIO_0;
-               hwif->speedproc(drive, speed);
-               return hwif->ide_dma_off_quietly(drive);
+               atiixp_speedproc(drive, speed);
        }
-       /* IORDY not supported */
-       return 0;
+
+       return -1;
 }
 
 /**
@@ -318,8 +305,8 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
        else
                hwif->udma_four = 0;
 
-       hwif->ide_dma_host_on = &atiixp_ide_dma_host_on;
-       hwif->ide_dma_host_off = &atiixp_ide_dma_host_off;
+       hwif->dma_host_on = &atiixp_dma_host_on;
+       hwif->dma_host_off = &atiixp_dma_host_off;
        hwif->ide_dma_check = &atiixp_dma_check;
        if (!noautodma)
                hwif->autodma = 1;
index aee947e8fc389ebbb44bb91ffa786b210c8cfdbd..49df27513da7add4275f42bd71a33bdbdd3bc84f 100644 (file)
@@ -466,36 +466,21 @@ static int config_chipset_for_dma (ide_drive_t *drive)
        if (!speed)
                return 0;
 
-       if(ide_set_xfer_rate(drive, speed))
-               return 0; 
-
-       if (!drive->init_speed)
-               drive->init_speed = speed;
+       if (cmd64x_tune_chipset(drive, speed))
+               return 0;
 
        return ide_dma_enable(drive);
 }
 
 static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
-       if ((id != NULL) && ((id->capability & 1) != 0) && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive))
                config_chipset_for_pio(drive, 1);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return -1;
 }
 
 static int cmd64x_alt_dma_status (struct pci_dev *dev)
@@ -518,13 +503,13 @@ static int cmd64x_ide_dma_end (ide_drive_t *drive)
 
        drive->waiting_for_dma = 0;
        /* read DMA command state */
-       dma_cmd = hwif->INB(hwif->dma_command);
+       dma_cmd = inb(hwif->dma_command);
        /* stop DMA */
-       hwif->OUTB((dma_cmd & ~1), hwif->dma_command);
+       outb(dma_cmd & ~1, hwif->dma_command);
        /* get DMA status */
-       dma_stat = hwif->INB(hwif->dma_status);
+       dma_stat = inb(hwif->dma_status);
        /* clear the INTR & ERROR bits */
-       hwif->OUTB(dma_stat|6, hwif->dma_status);
+       outb(dma_stat | 6, hwif->dma_status);
        if (cmd64x_alt_dma_status(dev)) {
                u8 dma_intr     = 0;
                u8 dma_mask     = (hwif->channel) ? ARTTIM23_INTR_CH1 :
@@ -546,7 +531,7 @@ static int cmd64x_ide_dma_test_irq (ide_drive_t *drive)
        struct pci_dev *dev             = hwif->pci_dev;
         u8 dma_alt_stat = 0, mask      = (hwif->channel) ? MRDMODE_INTR_CH1 :
                                                            MRDMODE_INTR_CH0;
-       u8 dma_stat = hwif->INB(hwif->dma_status);
+       u8 dma_stat = inb(hwif->dma_status);
 
        (void) pci_read_config_byte(dev, MRDMODE, &dma_alt_stat);
 #ifdef DEBUG
@@ -576,13 +561,13 @@ static int cmd646_1_ide_dma_end (ide_drive_t *drive)
 
        drive->waiting_for_dma = 0;
        /* get DMA status */
-       dma_stat = hwif->INB(hwif->dma_status);
+       dma_stat = inb(hwif->dma_status);
        /* read DMA command state */
-       dma_cmd = hwif->INB(hwif->dma_command);
+       dma_cmd = inb(hwif->dma_command);
        /* stop DMA */
-       hwif->OUTB((dma_cmd & ~1), hwif->dma_command);
+       outb(dma_cmd & ~1, hwif->dma_command);
        /* clear the INTR & ERROR bits */
-       hwif->OUTB(dma_stat|6, hwif->dma_status);
+       outb(dma_stat | 6, hwif->dma_status);
        /* and free any DMA resources */
        ide_destroy_dmatable(drive);
        /* verify good DMA status */
index ba6786aabf3baaf937c351fe55884537d6e31d5a..400859a839f7dcd9b1fb4c25b1796a98e87a12cb 100644 (file)
@@ -132,12 +132,11 @@ static void cs5520_tune_drive(ide_drive_t *drive, u8 pio)
 
 static int cs5520_config_drive_xfer_rate(ide_drive_t *drive)
 {
-       ide_hwif_t *hwif = HWIF(drive);
-
        /* Tune the drive for PIO modes up to PIO 4 */  
        cs5520_tune_drive(drive, 4);
+
        /* Then tell the core to use DMA operations */
-       return hwif->ide_dma_on(drive);
+       return 0;
 }
 
 /*
index 9bf5fdfc5b1fc56cca63ca623ed252871e08aee9..b2d7c132ef4b8cd3a6188e25964cb25b434450c6 100644 (file)
@@ -81,8 +81,8 @@ static void cs5530_tuneproc (ide_drive_t *drive, u8 pio)      /* pio=255 means "autot
 
        pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
        if (!cs5530_set_xfer_mode(drive, modes[pio])) {
-               format = (hwif->INL(basereg+4) >> 31) & 1;
-               hwif->OUTL(cs5530_pio_timings[format][pio],
+               format = (inl(basereg + 4) >> 31) & 1;
+               outl(cs5530_pio_timings[format][pio],
                        basereg+(drive->select.b.unit<<3));
        }
 }
@@ -103,16 +103,13 @@ static int cs5530_config_dma (ide_drive_t *drive)
        int                     unit = drive->select.b.unit;
        ide_drive_t             *mate = &hwif->drives[unit^1];
        struct hd_driveid       *id = drive->id;
-       unsigned int            reg, timings;
+       unsigned int            reg, timings = 0;
        unsigned long           basereg;
 
        /*
         * Default to DMA-off in case we run into trouble here.
         */
-       hwif->ide_dma_off_quietly(drive);
-       /* turn off DMA while we fiddle */
-       hwif->ide_dma_host_off(drive);
-       /* clear DMA_capable bit */
+       hwif->dma_off_quietly(drive);
 
        /*
         * The CS5530 specifies that two drives sharing a cable cannot
@@ -182,30 +179,24 @@ static int cs5530_config_dma (ide_drive_t *drive)
                case XFER_MW_DMA_1:     timings = 0x00012121; break;
                case XFER_MW_DMA_2:     timings = 0x00002020; break;
                default:
-                       printk(KERN_ERR "%s: cs5530_config_dma: huh? mode=%02x\n",
-                               drive->name, mode);
-                       return 1;       /* failure */
+                       BUG();
+                       break;
        }
        basereg = CS5530_BASEREG(hwif);
-       reg = hwif->INL(basereg+4);             /* get drive0 config register */
+       reg = inl(basereg + 4);                 /* get drive0 config register */
        timings |= reg & 0x80000000;            /* preserve PIO format bit */
        if (unit == 0) {                        /* are we configuring drive0? */
-               hwif->OUTL(timings, basereg+4); /* write drive0 config register */
+               outl(timings, basereg + 4);     /* write drive0 config register */
        } else {
                if (timings & 0x00100000)
                        reg |=  0x00100000;     /* enable UDMA timings for both drives */
                else
                        reg &= ~0x00100000;     /* disable UDMA timings for both drives */
-               hwif->OUTL(reg,     basereg+4); /* write drive0 config register */
-               hwif->OUTL(timings, basereg+12);        /* write drive1 config register */
+               outl(reg, basereg + 4);         /* write drive0 config register */
+               outl(timings, basereg + 12);    /* write drive1 config register */
        }
-       (void) hwif->ide_dma_host_on(drive);
-       /* set DMA_capable bit */
 
-       /*
-        * Finally, turn DMA on in software, and exit.
-        */
-       return hwif->ide_dma_on(drive); /* success */
+       return 0;       /* success */
 }
 
 /**
@@ -321,17 +312,17 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
 
        hwif->tuneproc = &cs5530_tuneproc;
        basereg = CS5530_BASEREG(hwif);
-       d0_timings = hwif->INL(basereg+0);
+       d0_timings = inl(basereg + 0);
        if (CS5530_BAD_PIO(d0_timings)) {
                /* PIO timings not initialized? */
-               hwif->OUTL(cs5530_pio_timings[(d0_timings>>31)&1][0], basereg+0);
+               outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 0);
                if (!hwif->drives[0].autotune)
                        hwif->drives[0].autotune = 1;
                        /* needs autotuning later */
        }
-       if (CS5530_BAD_PIO(hwif->INL(basereg+8))) {
-       /* PIO timings not initialized? */
-               hwif->OUTL(cs5530_pio_timings[(d0_timings>>31)&1][0], basereg+8);
+       if (CS5530_BAD_PIO(inl(basereg + 8))) {
+               /* PIO timings not initialized? */
+               outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 8);
                if (!hwif->drives[1].autotune)
                        hwif->drives[1].autotune = 1;
                        /* needs autotuning later */
index 5c5aec28e6717f3d9e7c81d243bc711ebf8b455b..45f43efbf92c856b4aaabf967cbab9ee87d33c9f 100644 (file)
@@ -195,28 +195,19 @@ static int cs5535_config_drive_for_dma(ide_drive_t *drive)
 
 static int cs5535_dma_check(ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = drive->hwif;
-       struct hd_driveid *id   = drive->id;
        u8 speed;
 
        drive->init_speed = 0;
 
-       if ((id->capability & 1) && drive->autodma) {
-               if (ide_use_dma(drive)) {
-                       if (cs5535_config_drive_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && cs5535_config_drive_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive)) {
                speed = ide_get_best_pio_mode(drive, 255, 4, NULL);
                cs5535_set_drive(drive, speed);
-               return hwif->ide_dma_off_quietly(drive);
        }
-       /* IORDY not supported */
-       return 0;
+
+       return -1;
 }
 
 static u8 __devinit cs5535_cable_detect(struct pci_dev *dev)
index 9eafcbf444f4d0cb629ae14e00f354544113444c..103b9db97853046d38550e7c496de20a47460113 100644 (file)
@@ -197,8 +197,8 @@ static void cy82c693_dma_enable (ide_drive_t *drive, int mode, int single)
 #if CY82C693_DEBUG_LOGS
        /* for debug let's show the previous values */
 
-       HWIF(drive)->OUTB(index, CY82_INDEX_PORT);
-       data = HWIF(drive)->INB(CY82_DATA_PORT);
+       outb(index, CY82_INDEX_PORT);
+       data = inb(CY82_DATA_PORT);
 
        printk (KERN_INFO "%s (ch=%d, dev=%d): DMA mode is %d (single=%d)\n",
                drive->name, HWIF(drive)->channel, drive->select.b.unit,
@@ -207,8 +207,8 @@ static void cy82c693_dma_enable (ide_drive_t *drive, int mode, int single)
 
        data = (u8)mode|(u8)(single<<2);
 
-       HWIF(drive)->OUTB(index, CY82_INDEX_PORT);
-       HWIF(drive)->OUTB(data, CY82_DATA_PORT);
+       outb(index, CY82_INDEX_PORT);
+       outb(data, CY82_DATA_PORT);
 
 #if CY82C693_DEBUG_INFO
        printk(KERN_INFO "%s (ch=%d, dev=%d): set DMA mode to %d (single=%d)\n",
@@ -227,8 +227,8 @@ static void cy82c693_dma_enable (ide_drive_t *drive, int mode, int single)
         */
 
        data = BUSMASTER_TIMEOUT;
-       HWIF(drive)->OUTB(CY82_INDEX_TIMEOUT, CY82_INDEX_PORT);
-       HWIF(drive)->OUTB(data, CY82_DATA_PORT);
+       outb(CY82_INDEX_TIMEOUT, CY82_INDEX_PORT);
+       outb(data, CY82_DATA_PORT);
 
 #if CY82C693_DEBUG_INFO        
        printk (KERN_INFO "%s: Set IDE Bus Master TimeOut Register to 0x%X\n",
@@ -478,21 +478,18 @@ static void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
        }
 }
 
-static ide_pci_device_t cy82c693_chipsets[] __devinitdata = {
-       {       /* 0 */
-               .name           = "CY82C693",
-               .init_chipset   = init_chipset_cy82c693,
-               .init_iops      = init_iops_cy82c693,
-               .init_hwif      = init_hwif_cy82c693,
-               .channels       = 1,
-               .autodma        = AUTODMA,
-               .bootable       = ON_BOARD,
-       }
+static ide_pci_device_t cy82c693_chipset __devinitdata = {
+       .name           = "CY82C693",
+       .init_chipset   = init_chipset_cy82c693,
+       .init_iops      = init_iops_cy82c693,
+       .init_hwif      = init_hwif_cy82c693,
+       .channels       = 1,
+       .autodma        = AUTODMA,
+       .bootable       = ON_BOARD,
 };
 
 static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-       ide_pci_device_t *d = &cy82c693_chipsets[id->driver_data];
        struct pci_dev *dev2;
        int ret = -ENODEV;
 
@@ -501,7 +498,7 @@ static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_dev
         if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE &&
            PCI_FUNC(dev->devfn) == 1) {
                dev2 = pci_get_slot(dev->bus, dev->devfn + 1);
-               ret = ide_setup_pci_devices(dev, dev2, d);
+               ret = ide_setup_pci_devices(dev, dev2, &cy82c693_chipset);
                /* We leak pci refs here but thats ok - we can't be unloaded */
        }
        return ret;
index ce7b08f08a0959fe428cec32ff01e1b218ed3afc..924eaa3a5708890e592dce1d7d130b769c37f25b 100644 (file)
@@ -48,19 +48,6 @@ static u8 hpt34x_ratemask (ide_drive_t *drive)
        return 1;
 }
 
-static void hpt34x_clear_chipset (ide_drive_t *drive)
-{
-       struct pci_dev *dev     = HWIF(drive)->pci_dev;
-       u32 reg1 = 0, tmp1 = 0, reg2 = 0, tmp2 = 0;
-
-       pci_read_config_dword(dev, 0x44, &reg1);
-       pci_read_config_dword(dev, 0x48, &reg2);
-       tmp1 = ((0x00 << (3*drive->dn)) | (reg1 & ~(7 << (3*drive->dn))));
-       tmp2 = (reg2 & ~(0x11 << drive->dn));
-       pci_write_config_dword(dev, 0x44, tmp1);
-       pci_write_config_dword(dev, 0x48, tmp2);
-}
-
 static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed)
 {
        struct pci_dev *dev     = HWIF(drive)->pci_dev;
@@ -81,7 +68,7 @@ static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed)
        pci_read_config_dword(dev, 0x44, &reg1);
        pci_read_config_dword(dev, 0x48, &reg2);
        tmp1 = ((lo_speed << (3*drive->dn)) | (reg1 & ~(7 << (3*drive->dn))));
-       tmp2 = ((hi_speed << drive->dn) | reg2);
+       tmp2 = ((hi_speed << drive->dn) | (reg2 & ~(0x11 << drive->dn)));
        pci_write_config_dword(dev, 0x44, tmp1);
        pci_write_config_dword(dev, 0x48, tmp2);
 
@@ -99,7 +86,6 @@ static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed)
 static void hpt34x_tune_drive (ide_drive_t *drive, u8 pio)
 {
        pio = ide_get_best_pio_mode(drive, pio, 5, NULL);
-       hpt34x_clear_chipset(drive);
        (void) hpt34x_tune_chipset(drive, (XFER_PIO_0 + pio));
 }
 
@@ -117,38 +103,25 @@ static int config_chipset_for_dma (ide_drive_t *drive)
        if (!(speed))
                return 0;
 
-       hpt34x_clear_chipset(drive);
        (void) hpt34x_tune_chipset(drive, speed);
        return ide_dma_enable(drive);
 }
 
 static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
        drive->init_speed = 0;
 
-       if (id && (id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_for_dma(drive))
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
 #ifndef CONFIG_HPT34X_AUTODMA
-                               return hwif->ide_dma_off_quietly(drive);
+               return -1;
 #else
-                               return hwif->ide_dma_on(drive);
+               return 0;
 #endif
-               }
-
-               goto fast_ata_pio;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive))
                hpt34x_tune_drive(drive, 255);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return -1;
 }
 
 /*
@@ -209,7 +182,6 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
 
        hwif->tuneproc = &hpt34x_tune_drive;
        hwif->speedproc = &hpt34x_tune_chipset;
-       hwif->no_dsc = 1;
        hwif->drives[0].autotune = 1;
        hwif->drives[1].autotune = 1;
 
index 05be8fadda7ad25c023b992c6002ec343bcf2517..60ecdc258c7cbc1272edff2082c0e97c17ba98d4 100644 (file)
@@ -736,24 +736,15 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
 
 static int hpt366_config_drive_xfer_rate(ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
        drive->init_speed = 0;
 
-       if ((id->capability & 1) && drive->autodma) {
-               if (ide_use_dma(drive) && config_chipset_for_dma(drive))
-                       return hwif->ide_dma_on(drive);
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive))
                hpt3xx_tune_drive(drive, 255);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return -1;
 }
 
 /*
@@ -841,7 +832,7 @@ static int hpt374_ide_dma_test_irq(ide_drive_t *drive)
                return 0;
        }
 
-       dma_stat = hwif->INB(hwif->dma_status);
+       dma_stat = inb(hwif->dma_status);
        /* return 1 if INTR asserted */
        if (dma_stat & 4)
                return 1;
@@ -1391,9 +1382,6 @@ static void __devinit init_dma_hpt366(ide_hwif_t *hwif, unsigned long dmabase)
        u8 dma_new      = 0, dma_old    = 0;
        unsigned long flags;
 
-       if (!dmabase)
-               return;
-               
        dma_old = hwif->INB(dmabase + 2);
 
        local_irq_save(flags);
index 63248b6909faf0ce5cc2471da359441740fd5b12..424f00bb160d6210047805002b101ca7ba3bac21 100644 (file)
@@ -244,17 +244,15 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 
 static int it8213_config_drive_for_dma (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif = drive->hwif;
+       u8 pio;
 
-       if (ide_use_dma(drive)) {
-               if (config_chipset_for_dma(drive))
-                       return hwif->ide_dma_on(drive);
-       }
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       hwif->speedproc(drive, XFER_PIO_0
-                       + ide_get_best_pio_mode(drive, 255, 4, NULL));
+       pio = ide_get_best_pio_mode(drive, 255, 4, NULL);
+       it8213_tune_chipset(drive, XFER_PIO_0 + pio);
 
-       return hwif->ide_dma_off_quietly(drive);
+       return -1;
 }
 
 /**
index e9bad185968a8e289cd28f2844ac2578b6727373..a132767f7d90cfb637e606be18a0940703932cfd 100644 (file)
@@ -520,14 +520,12 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 
 static int it821x_config_drive_for_dma (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = drive->hwif;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       if (ide_use_dma(drive)) {
-               if (config_chipset_for_dma(drive))
-                       return hwif->ide_dma_on(drive);
-       }
        config_it821x_chipset_for_pio(drive, 1);
-       return hwif->ide_dma_off_quietly(drive);
+
+       return -1;
 }
 
 /**
@@ -608,11 +606,11 @@ static void __devinit it821x_fixups(ide_hwif_t *hwif)
                                printk(".\n");
                        /* Now the core code will have wrongly decided no DMA
                           so we need to fix this */
-                       hwif->ide_dma_off_quietly(drive);
+                       hwif->dma_off_quietly(drive);
 #ifdef CONFIG_IDEDMA_ONLYDISK
                        if (drive->media == ide_disk)
 #endif
-                               hwif->ide_dma_check(drive);
+                               ide_set_dma(drive);
                } else {
                        /* Non RAID volume. Fixups to stop the core code
                           doing unsupported things */
index f07bbbed17783322627df81caeadabb49fe8d448..53f25500c22b57afdb2cc54f1daa2cd510070000 100644 (file)
@@ -147,7 +147,9 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 {
        u8 speed        = ide_dma_speed(drive, jmicron_ratemask(drive));
 
-       config_jmicron_chipset_for_pio(drive, !speed);
+       if (!speed)
+               return 0;
+
        jmicron_tune_chipset(drive, speed);
        return ide_dma_enable(drive);
 }
@@ -162,14 +164,12 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 
 static int jmicron_config_drive_for_dma (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = drive->hwif;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       if (ide_use_dma(drive)) {
-               if (config_chipset_for_dma(drive))
-                       return hwif->ide_dma_on(drive);
-       }
        config_jmicron_chipset_for_pio(drive, 1);
-       return hwif->ide_dma_off_quietly(drive);
+
+       return -1;
 }
 
 /**
index 8aaea4ea5549526c12b199d9d1bbe500509e53da..b310c4f510773c6f8aa2c9961fd72a7d7261b8ce 100644 (file)
@@ -166,10 +166,10 @@ static int ns87415_ide_dma_end (ide_drive_t *drive)
        /* get dma command mode */
        dma_cmd = hwif->INB(hwif->dma_command);
        /* stop DMA */
-       hwif->OUTB(dma_cmd & ~1, hwif->dma_command);
+       outb(dma_cmd & ~1, hwif->dma_command);
        /* from ERRATA: clear the INTR & ERROR bits */
        dma_cmd = hwif->INB(hwif->dma_command);
-       hwif->OUTB(dma_cmd|6, hwif->dma_command);
+       outb(dma_cmd | 6, hwif->dma_command);
        /* and free any DMA resources */
        ide_destroy_dmatable(drive);
        /* verify good DMA status */
@@ -190,7 +190,8 @@ static int ns87415_ide_dma_setup(ide_drive_t *drive)
 static int ns87415_ide_dma_check (ide_drive_t *drive)
 {
        if (drive->media != ide_disk)
-               return HWIF(drive)->ide_dma_off_quietly(drive);
+               return -1;
+
        return __ide_dma_check(drive);
 }
 
@@ -243,9 +244,9 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
                 *      to SELECT_DRIVE() properly during first probe_hwif().
                 */
                timeout = 10000;
-               hwif->OUTB(12, hwif->io_ports[IDE_CONTROL_OFFSET]);
+               outb(12, hwif->io_ports[IDE_CONTROL_OFFSET]);
                udelay(10);
-               hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
+               outb(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
                do {
                        udelay(50);
                        stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]);
@@ -263,7 +264,7 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
-       hwif->OUTB(0x60, hwif->dma_status);
+       outb(0x60, hwif->dma_status);
        hwif->dma_setup = &ns87415_ide_dma_setup;
        hwif->ide_dma_check = &ns87415_ide_dma_check;
        hwif->ide_dma_end = &ns87415_ide_dma_end;
index 22bbf613f94802ef74811b7907216a487d60f843..9ca60dd2185e636c70df8baa1464bae5965e3495 100644 (file)
@@ -176,34 +176,35 @@ static int cmpt_clk(int time, int bus_speed)
        return ((time*bus_speed+999)/1000);
 }
 
-static void write_reg(ide_hwif_t *hwif, u8 value, int reg)
 /* Write value to register reg, base of register
  * is at reg_base (0x1f0 primary, 0x170 secondary,
  * if not changed by PCI configuration).
  * This is from setupvic.exe program.
  */
+static void write_reg(u8 value, int reg)
 {
-       hwif->INW(reg_base+1);
-       hwif->INW(reg_base+1);
-       hwif->OUTB(3, reg_base+2);
-       hwif->OUTB(value, reg_base+reg);
-       hwif->OUTB(0x83, reg_base+2);
+       inw(reg_base + 1);
+       inw(reg_base + 1);
+       outb(3, reg_base + 2);
+       outb(value, reg_base + reg);
+       outb(0x83, reg_base + 2);
 }
 
-static u8 read_reg(ide_hwif_t *hwif, int reg)
 /* Read value from register reg, base of register
  * is at reg_base (0x1f0 primary, 0x170 secondary,
  * if not changed by PCI configuration).
  * This is from setupvic.exe program.
  */
+static u8 read_reg(int reg)
 {
        u8 ret = 0;
 
-       hwif->INW(reg_base+1);
-       hwif->INW(reg_base+1);
-       hwif->OUTB(3, reg_base+2);
-       ret = hwif->INB(reg_base+reg);
-       hwif->OUTB(0x83, reg_base+2);
+       inw(reg_base + 1);
+       inw(reg_base + 1);
+       outb(3, reg_base + 2);
+       ret = inb(reg_base + reg);
+       outb(0x83, reg_base + 2);
+
        return ret;
 }
 
@@ -286,39 +287,39 @@ static void opti621_tune_drive (ide_drive_t *drive, u8 pio)
        reg_base = hwif->io_ports[IDE_DATA_OFFSET];
 
        /* allow Register-B */
-       hwif->OUTB(0xc0, reg_base+CNTRL_REG);
+       outb(0xc0, reg_base + CNTRL_REG);
        /* hmm, setupvic.exe does this ;-) */
-       hwif->OUTB(0xff, reg_base+5);
+       outb(0xff, reg_base + 5);
        /* if reads 0xff, adapter not exist? */
-       (void) hwif->INB(reg_base+CNTRL_REG);
+       (void)inb(reg_base + CNTRL_REG);
        /* if reads 0xc0, no interface exist? */
-       read_reg(hwif, CNTRL_REG);
+       read_reg(CNTRL_REG);
        /* read version, probably 0 */
-       read_reg(hwif, STRAP_REG);
+       read_reg(STRAP_REG);
 
        /* program primary drive */
-               /* select Index-0 for Register-A */
-       write_reg(hwif, 0,      MISC_REG);
-               /* set read cycle timings */
-       write_reg(hwif, cycle1, READ_REG);
-               /* set write cycle timings */
-       write_reg(hwif, cycle1, WRITE_REG);
+       /* select Index-0 for Register-A */
+       write_reg(0, MISC_REG);
+       /* set read cycle timings */
+       write_reg(cycle1, READ_REG);
+       /* set write cycle timings */
+       write_reg(cycle1, WRITE_REG);
 
        /* program secondary drive */
-               /* select Index-1 for Register-B */
-       write_reg(hwif, 1,      MISC_REG);
-               /* set read cycle timings */
-       write_reg(hwif, cycle2, READ_REG);
-               /* set write cycle timings */
-       write_reg(hwif, cycle2, WRITE_REG);
+       /* select Index-1 for Register-B */
+       write_reg(1, MISC_REG);
+       /* set read cycle timings */
+       write_reg(cycle2, READ_REG);
+       /* set write cycle timings */
+       write_reg(cycle2, WRITE_REG);
 
        /* use Register-A for drive 0 */
        /* use Register-B for drive 1 */
-       write_reg(hwif, 0x85, CNTRL_REG);
+       write_reg(0x85, CNTRL_REG);
 
        /* set address setup, DRDY timings,   */
        /*  and read prefetch for both drives */
-       write_reg(hwif, misc, MISC_REG);
+       write_reg(misc, MISC_REG);
 
        spin_unlock_irqrestore(&ide_lock, flags);
 }
index 236a03144a2796c04e35e23ae137755e6a495abd..6ceb25bc5a7bb1109e22ff804a997dde62d66cc9 100644 (file)
@@ -101,8 +101,8 @@ static u8 get_indexed_reg(ide_hwif_t *hwif, u8 index)
 {
        u8 value;
 
-       hwif->OUTB(index, hwif->dma_vendor1);
-       value = hwif->INB(hwif->dma_vendor3);
+       outb(index, hwif->dma_vendor1);
+       value = inb(hwif->dma_vendor3);
 
        DBG("index[%02X] value[%02X]\n", index, value);
        return value;
@@ -115,8 +115,8 @@ static u8 get_indexed_reg(ide_hwif_t *hwif, u8 index)
  */
 static void set_indexed_reg(ide_hwif_t *hwif, u8 index, u8 value)
 {
-       hwif->OUTB(index, hwif->dma_vendor1);
-       hwif->OUTB(value, hwif->dma_vendor3);
+       outb(index, hwif->dma_vendor1);
+       outb(value, hwif->dma_vendor3);
        DBG("index[%02X] value[%02X]\n", index, value);
 }
 
@@ -281,25 +281,15 @@ static int config_chipset_for_dma(ide_drive_t *drive)
 
 static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
        drive->init_speed = 0;
 
-       if ((id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive) && config_chipset_for_dma(drive))
-                       return hwif->ide_dma_on(drive);
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-               goto fast_ata_pio;
+       if (ide_use_fast_pio(drive))
+               pdcnew_tune_drive(drive, 255);
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
-               hwif->tuneproc(drive, 255);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+       return -1;
 }
 
 static int pdcnew_quirkproc(ide_drive_t *drive)
index 730e8d1ec2f56327db16a1d204d3340b19b4e9e1..a7a639fe1eaff2b4540f52160afc8163f1eef35f 100644 (file)
@@ -2,6 +2,7 @@
  *  linux/drivers/ide/pci/pdc202xx_old.c       Version 0.36    Sept 11, 2002
  *
  *  Copyright (C) 1998-2002            Andre Hedrick <andre@linux-ide.org>
+ *  Copyright (C) 2006-2007            MontaVista Software, Inc.
  *
  *  Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this
  *  compiled into the kernel if you have more than one card installed.
@@ -216,21 +217,10 @@ static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed)
 }
 
 
-/*   0    1    2    3    4    5    6   7   8
- * 960, 480, 390, 300, 240, 180, 120, 90, 60
- *           180, 150, 120,  90,  60
- * DMA_Speed
- * 180, 120,  90,  90,  90,  60,  30
- *  11,   5,   4,   3,   2,   1,   0
- */
-static void config_chipset_for_pio (ide_drive_t *drive, u8 pio)
+static void pdc202xx_tune_drive(ide_drive_t *drive, u8 pio)
 {
-       u8 speed = 0;
-
-       if (pio == 5) pio = 4;
-       speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, pio, NULL);
-        
-       pdc202xx_tune_chipset(drive, speed);
+       pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
+       pdc202xx_tune_chipset(drive, XFER_PIO_0 + pio);
 }
 
 static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif)
@@ -250,17 +240,17 @@ static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif)
 static void pdc_old_enable_66MHz_clock(ide_hwif_t *hwif)
 {
        unsigned long clock_reg = hwif->dma_master + 0x11;
-       u8 clock = hwif->INB(clock_reg);
+       u8 clock = inb(clock_reg);
 
-       hwif->OUTB(clock | (hwif->channel ? 0x08 : 0x02), clock_reg);
+       outb(clock | (hwif->channel ? 0x08 : 0x02), clock_reg);
 }
 
 static void pdc_old_disable_66MHz_clock(ide_hwif_t *hwif)
 {
        unsigned long clock_reg = hwif->dma_master + 0x11;
-       u8 clock = hwif->INB(clock_reg);
+       u8 clock = inb(clock_reg);
 
-       hwif->OUTB(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg);
+       outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg);
 }
 
 static int config_chipset_for_dma (ide_drive_t *drive)
@@ -332,27 +322,15 @@ chipset_is_set:
 
 static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
        drive->init_speed = 0;
 
-       if (id && (id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-               goto fast_ata_pio;
+       if (ide_use_fast_pio(drive))
+               pdc202xx_tune_drive(drive, 255);
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
-               hwif->tuneproc(drive, 5);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+       return -1;
 }
 
 static int pdc202xx_quirkproc (ide_drive_t *drive)
@@ -375,14 +353,14 @@ static void pdc202xx_old_ide_dma_start(ide_drive_t *drive)
                unsigned long high_16   = hwif->dma_master;
                unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20);
                u32 word_count  = 0;
-               u8 clock = hwif->INB(high_16 + 0x11);
+               u8 clock = inb(high_16 + 0x11);
 
-               hwif->OUTB(clock|(hwif->channel ? 0x08 : 0x02), high_16+0x11);
+               outb(clock | (hwif->channel ? 0x08 : 0x02), high_16 + 0x11);
                word_count = (rq->nr_sectors << 8);
                word_count = (rq_data_dir(rq) == READ) ?
                                        word_count | 0x05000000 :
                                        word_count | 0x06000000;
-               hwif->OUTL(word_count, atapi_reg);
+               outl(word_count, atapi_reg);
        }
        ide_dma_start(drive);
 }
@@ -395,9 +373,9 @@ static int pdc202xx_old_ide_dma_end(ide_drive_t *drive)
                unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20);
                u8 clock                = 0;
 
-               hwif->OUTL(0, atapi_reg); /* zero out extra */
-               clock = hwif->INB(high_16 + 0x11);
-               hwif->OUTB(clock & ~(hwif->channel ? 0x08:0x02), high_16+0x11);
+               outl(0, atapi_reg); /* zero out extra */
+               clock = inb(high_16 + 0x11);
+               outb(clock & ~(hwif->channel ? 0x08:0x02), high_16 + 0x11);
        }
        if (drive->current_speed > XFER_UDMA_2)
                pdc_old_disable_66MHz_clock(drive->hwif);
@@ -408,8 +386,8 @@ static int pdc202xx_old_ide_dma_test_irq(ide_drive_t *drive)
 {
        ide_hwif_t *hwif        = HWIF(drive);
        unsigned long high_16   = hwif->dma_master;
-       u8 dma_stat             = hwif->INB(hwif->dma_status);
-       u8 sc1d                 = hwif->INB((high_16 + 0x001d));
+       u8 dma_stat             = inb(hwif->dma_status);
+       u8 sc1d                 = inb(high_16 + 0x001d);
 
        if (hwif->channel) {
                /* bit7: Error, bit6: Interrupting, bit5: FIFO Full, bit4: FIFO Empty */
@@ -445,11 +423,11 @@ static int pdc202xx_ide_dma_timeout(ide_drive_t *drive)
 static void pdc202xx_reset_host (ide_hwif_t *hwif)
 {
        unsigned long high_16   = hwif->dma_master;
-       u8 udma_speed_flag      = hwif->INB(high_16|0x001f);
+       u8 udma_speed_flag      = inb(high_16 | 0x001f);
 
-       hwif->OUTB((udma_speed_flag | 0x10), (high_16|0x001f));
+       outb(udma_speed_flag | 0x10, high_16 | 0x001f);
        mdelay(100);
-       hwif->OUTB((udma_speed_flag & ~0x10), (high_16|0x001f));
+       outb(udma_speed_flag & ~0x10, high_16 | 0x001f);
        mdelay(2000);   /* 2 seconds ?! */
 
        printk(KERN_WARNING "PDC202XX: %s channel reset.\n",
@@ -463,7 +441,7 @@ static void pdc202xx_reset (ide_drive_t *drive)
        
        pdc202xx_reset_host(hwif);
        pdc202xx_reset_host(mate);
-       hwif->tuneproc(drive, 5);
+       pdc202xx_tune_drive(drive, 255);
 }
 
 static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev,
@@ -490,7 +468,7 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
                hwif->rqsize = 256;
 
        hwif->autodma = 0;
-       hwif->tuneproc  = &config_chipset_for_pio;
+       hwif->tuneproc  = &pdc202xx_tune_drive;
        hwif->quirkproc = &pdc202xx_quirkproc;
 
        if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246)
@@ -537,9 +515,9 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
                return;
        }
 
-       udma_speed_flag = hwif->INB((dmabase|0x1f));
-       primary_mode    = hwif->INB((dmabase|0x1a));
-       secondary_mode  = hwif->INB((dmabase|0x1b));
+       udma_speed_flag = inb(dmabase | 0x1f);
+       primary_mode    = inb(dmabase | 0x1a);
+       secondary_mode  = inb(dmabase | 0x1b);
        printk(KERN_INFO "%s: (U)DMA Burst Bit %sABLED " \
                "Primary %s Mode " \
                "Secondary %s Mode.\n", hwif->cds->name,
@@ -552,30 +530,10 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
                printk(KERN_INFO "%s: FORCING BURST BIT 0x%02x->0x%02x ",
                        hwif->cds->name, udma_speed_flag,
                        (udma_speed_flag|1));
-               hwif->OUTB(udma_speed_flag|1,(dmabase|0x1f));
-               printk("%sACTIVE\n",
-                       (hwif->INB(dmabase|0x1f)&1) ? "":"IN");
+               outb(udma_speed_flag | 1, dmabase | 0x1f);
+               printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN");
        }
 #endif /* CONFIG_PDC202XX_BURST */
-#ifdef CONFIG_PDC202XX_MASTER
-       if (!(primary_mode & 1)) {
-               printk(KERN_INFO "%s: FORCING PRIMARY MODE BIT "
-                       "0x%02x -> 0x%02x ", hwif->cds->name,
-                       primary_mode, (primary_mode|1));
-               hwif->OUTB(primary_mode|1, (dmabase|0x1a));
-               printk("%s\n",
-                       (hwif->INB((dmabase|0x1a)) & 1) ? "MASTER" : "PCI");
-       }
-
-       if (!(secondary_mode & 1)) {
-               printk(KERN_INFO "%s: FORCING SECONDARY MODE BIT "
-                       "0x%02x -> 0x%02x ", hwif->cds->name,
-                       secondary_mode, (secondary_mode|1));
-               hwif->OUTB(secondary_mode|1, (dmabase|0x1b));
-               printk("%s\n",
-                       (hwif->INB((dmabase|0x1b)) & 1) ? "MASTER" : "PCI");
-       }
-#endif /* CONFIG_PDC202XX_MASTER */
 
        ide_setup_dma(hwif, dmabase, 8);
 }
index 52cfc2ac22c124bc2030025ff937de9ebb2924ce..569822f4cf55d8ba28c79f9c385db511657b8d80 100644 (file)
@@ -369,7 +369,7 @@ static int piix_config_drive_for_dma (ide_drive_t *drive)
         * If no DMA speed was available or the chipset has DMA bugs
         * then disable DMA and use PIO
         */
-       if (!speed || no_piix_dma)
+       if (!speed)
                return 0;
 
        (void) piix_tune_chipset(drive, speed);
@@ -386,41 +386,28 @@ static int piix_config_drive_for_dma (ide_drive_t *drive)
  
 static int piix_config_drive_xfer_rate (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
        drive->init_speed = 0;
 
-       if ((id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive) && piix_config_drive_for_dma(drive))
-                       return hwif->ide_dma_on(drive);
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && piix_config_drive_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive))
                /* Find best PIO mode. */
-               (void) hwif->speedproc(drive, XFER_PIO_0 +
-                                      ide_get_best_pio_mode(drive, 255, 4, NULL));
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+               piix_tune_chipset(drive, XFER_PIO_0 +
+                                 ide_get_best_pio_mode(drive, 255, 4, NULL));
+
+       return -1;
 }
 
 /**
- *     init_chipset_piix       -       set up the PIIX chipset
- *     @dev: PCI device to set up
- *     @name: Name of the device
+ *     piix_is_ichx    -       check if ICHx
+ *     @dev: PCI device to check
  *
- *     Initialize the PCI device as required. For the PIIX this turns
- *     out to be nice and simple
+ *     returns 1 if ICHx, 0 otherwise.
  */
-static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char *name)
+static int piix_is_ichx(struct pci_dev *dev)
 {
-        switch(dev->device) {
+        switch (dev->device) {
                case PCI_DEVICE_ID_INTEL_82801EB_1:
                case PCI_DEVICE_ID_INTEL_82801AA_1:
                case PCI_DEVICE_ID_INTEL_82801AB_1:
@@ -438,18 +425,60 @@ static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char
                case PCI_DEVICE_ID_INTEL_ICH7_21:
                case PCI_DEVICE_ID_INTEL_ESB2_18:
                case PCI_DEVICE_ID_INTEL_ICH8_6:
-               {
-                       unsigned int extra = 0;
-                       pci_read_config_dword(dev, 0x54, &extra);
-                       pci_write_config_dword(dev, 0x54, extra|0x400);
-               }
-               default:
-                       break;
+                       return 1;
        }
 
        return 0;
 }
 
+/**
+ *     init_chipset_piix       -       set up the PIIX chipset
+ *     @dev: PCI device to set up
+ *     @name: Name of the device
+ *
+ *     Initialize the PCI device as required. For the PIIX this turns
+ *     out to be nice and simple
+ */
+
+static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char *name)
+{
+       if (piix_is_ichx(dev)) {
+               unsigned int extra = 0;
+               pci_read_config_dword(dev, 0x54, &extra);
+               pci_write_config_dword(dev, 0x54, extra|0x400);
+       }
+
+       return 0;
+}
+
+/**
+ *     piix_dma_clear_irq      -       clear BMDMA status
+ *     @drive: IDE drive to clear
+ *
+ *     Called from ide_intr() for PIO interrupts
+ *     to clear BMDMA status as needed by ICHx
+ */
+static void piix_dma_clear_irq(ide_drive_t *drive)
+{
+       ide_hwif_t *hwif = HWIF(drive);
+       u8 dma_stat;
+
+       /* clear the INTR & ERROR bits */
+       dma_stat = hwif->INB(hwif->dma_status);
+       /* Should we force the bit as well ? */
+       hwif->OUTB(dma_stat, hwif->dma_status);
+}
+
+static int __devinit piix_cable_detect(ide_hwif_t *hwif)
+{
+       struct pci_dev *dev = hwif->pci_dev;
+       u8 reg54h = 0, mask = hwif->channel ? 0xc0 : 0x30;
+
+       pci_read_config_byte(dev, 0x54, &reg54h);
+
+       return (reg54h & mask) ? 1 : 0;
+}
+
 /**
  *     init_hwif_piix          -       fill in the hwif for the PIIX
  *     @hwif: IDE interface
@@ -460,9 +489,6 @@ static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char
 
 static void __devinit init_hwif_piix(ide_hwif_t *hwif)
 {
-       u8 reg54h = 0, reg55h = 0, ata66 = 0;
-       u8 mask = hwif->channel ? 0xc0 : 0x30;
-
 #ifndef CONFIG_IA64
        if (!hwif->irq)
                hwif->irq = hwif->channel ? 15 : 14;
@@ -472,10 +498,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
                /* This is a painful system best to let it self tune for now */
                return;
        }
-       /* ESB2 appears to generate spurious DMA interrupts in PIO mode
-          when in native mode */
-       if (hwif->pci_dev->device == PCI_DEVICE_ID_INTEL_ESB2_18)
-               hwif->atapi_irq_bogon = 1;
 
        hwif->autodma = 0;
        hwif->tuneproc = &piix_tune_drive;
@@ -486,15 +508,16 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
+       /* ICHx need to clear the bmdma status for all interrupts */
+       if (piix_is_ichx(hwif->pci_dev))
+               hwif->ide_dma_clear_irq = &piix_dma_clear_irq;
+
        hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x3f;
        hwif->mwdma_mask = 0x06;
        hwif->swdma_mask = 0x04;
 
        switch(hwif->pci_dev->device) {
-               case PCI_DEVICE_ID_INTEL_82371MX:
-                       hwif->mwdma_mask = 0x80;
-                       hwif->swdma_mask = 0x80;
                case PCI_DEVICE_ID_INTEL_82371FB_0:
                case PCI_DEVICE_ID_INTEL_82371FB_1:
                case PCI_DEVICE_ID_INTEL_82371SB_1:
@@ -507,14 +530,14 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
                        hwif->ultra_mask = 0x07;
                        break;
                default:
-                       pci_read_config_byte(hwif->pci_dev, 0x54, &reg54h);
-                       pci_read_config_byte(hwif->pci_dev, 0x55, &reg55h);
-                       ata66 = (reg54h & mask) ? 1 : 0;
+                       if (!hwif->udma_four)
+                               hwif->udma_four = piix_cable_detect(hwif);
                        break;
        }
 
-       if (!(hwif->udma_four))
-               hwif->udma_four = ata66;
+       if (no_piix_dma)
+               hwif->ultra_mask = hwif->mwdma_mask = hwif->swdma_mask = 0;
+
        hwif->ide_dma_check = &piix_config_drive_xfer_rate;
        if (!noautodma)
                hwif->autodma = 1;
index 8d762d323f8b654504a7fe85ffe499a2a14efc38..b5ae0c50e216423670508dd014bc18c68d4e9229 100644 (file)
@@ -161,7 +161,7 @@ static int sc1200_config_dma2 (ide_drive_t *drive, int mode)
        /*
         * Default to DMA-off in case we run into trouble here.
         */
-       hwif->ide_dma_off_quietly(drive);                       /* turn off DMA while we fiddle */
+       hwif->dma_off_quietly(drive);   /* turn off DMA while we fiddle */
        outb(inb(hwif->dma_base+2)&~(unit?0x40:0x20), hwif->dma_base+2); /* clear DMA_capable bit */
 
        /*
@@ -241,10 +241,7 @@ static int sc1200_config_dma2 (ide_drive_t *drive, int mode)
 
        outb(inb(hwif->dma_base+2)|(unit?0x40:0x20), hwif->dma_base+2); /* set DMA_capable bit */
 
-       /*
-        * Finally, turn DMA on in software, and exit.
-        */
-       return hwif->ide_dma_on(drive); /* success */
+       return 0;       /* success */
 }
 
 /*
@@ -442,10 +439,10 @@ static int sc1200_resume (struct pci_dev *dev)
                        ide_drive_t *drive = &(hwif->drives[d]);
                        if (drive->present && !__ide_dma_bad_drive(drive)) {
                                int was_using_dma = drive->using_dma;
-                               hwif->ide_dma_off_quietly(drive);
+                               hwif->dma_off_quietly(drive);
                                sc1200_config_dma(drive);
                                if (!was_using_dma && drive->using_dma) {
-                                       hwif->ide_dma_off_quietly(drive);
+                                       hwif->dma_off_quietly(drive);
                                }
                        }
                }
index ea9a28a45853348d21cc59e3d2f2b764556ae0e8..dbcd37a0c65217138100ad6beac91fab1cb8b306 100644 (file)
@@ -160,7 +160,7 @@ static int svwks_tune_chipset (ide_drive_t *drive, u8 xferspeed)
        if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) ||
            (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) {
                if (!drive->init_speed) {
-                       u8 dma_stat = hwif->INB(hwif->dma_status);
+                       u8 dma_stat = inb(hwif->dma_status);
 
 dma_pio:
                        if (((ultra_enable << (7-drive->dn) & 0x80) == 0x80) &&
@@ -315,35 +315,15 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 
 static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
        drive->init_speed = 0;
 
-       if ((id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive))
                config_chipset_for_pio(drive);
-               //      hwif->tuneproc(drive, 5);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
-}
-
-/* This can go soon */
 
-static int svwks_ide_dma_end (ide_drive_t *drive)
-{
-       return __ide_dma_end(drive);
+       return -1;
 }
 
 static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const char *name)
@@ -537,35 +517,20 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
        }
 
        hwif->ide_dma_check = &svwks_config_drive_xfer_rate;
-       if (hwif->pci_dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE)
-               hwif->ide_dma_end = &svwks_ide_dma_end;
-       else if (!(hwif->udma_four))
-               hwif->udma_four = ata66_svwks(hwif);
+       if (hwif->pci_dev->device != PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) {
+               if (!hwif->udma_four)
+                       hwif->udma_four = ata66_svwks(hwif);
+       }
        if (!noautodma)
                hwif->autodma = 1;
 
-       dma_stat = hwif->INB(hwif->dma_status);
+       dma_stat = inb(hwif->dma_status);
        hwif->drives[0].autodma = (dma_stat & 0x20);
        hwif->drives[1].autodma = (dma_stat & 0x40);
        hwif->drives[0].autotune = (!(dma_stat & 0x20));
        hwif->drives[1].autotune = (!(dma_stat & 0x40));
 }
 
-/*
- * We allow the BM-DMA driver to only work on enabled interfaces.
- */
-static void __devinit init_dma_svwks (ide_hwif_t *hwif, unsigned long dmabase)
-{
-       struct pci_dev *dev = hwif->pci_dev;
-
-       if (((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) ||
-            (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) &&
-           (!(PCI_FUNC(dev->devfn) & 1)) && (hwif->channel))
-               return;
-
-       ide_setup_dma(hwif, dmabase, 8);
-}
-
 static int __devinit init_setup_svwks (struct pci_dev *dev, ide_pci_device_t *d)
 {
        return ide_setup_pci_device(dev, d);
@@ -600,7 +565,6 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_setup     = init_setup_svwks,
                .init_chipset   = init_chipset_svwks,
                .init_hwif      = init_hwif_svwks,
-               .init_dma       = init_dma_svwks,
                .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
@@ -609,7 +573,6 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_setup     = init_setup_csb6,
                .init_chipset   = init_chipset_svwks,
                .init_hwif      = init_hwif_svwks,
-               .init_dma       = init_dma_svwks,
                .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
@@ -618,7 +581,6 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_setup     = init_setup_csb6,
                .init_chipset   = init_chipset_svwks,
                .init_hwif      = init_hwif_svwks,
-               .init_dma       = init_dma_svwks,
                .channels       = 1,    /* 2 */
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
@@ -627,7 +589,6 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_setup     = init_setup_svwks,
                .init_chipset   = init_chipset_svwks,
                .init_hwif      = init_hwif_svwks,
-               .init_dma       = init_dma_svwks,
                .channels       = 1,    /* 2 */
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
index b0bf01809279d976484e15a32b2f918ba303e347..fd09b295a69dd0b86c004ada223d03b289b18a14 100644 (file)
@@ -110,24 +110,24 @@ sgiioc4_init_hwif_ports(hw_regs_t * hw, unsigned long data_port,
 static void
 sgiioc4_maskproc(ide_drive_t * drive, int mask)
 {
-       ide_hwif_t *hwif = HWIF(drive);
-       hwif->OUTB(mask ? (drive->ctl | 2) : (drive->ctl & ~2),
-                  IDE_CONTROL_REG);
+       writeb(mask ? (drive->ctl | 2) : (drive->ctl & ~2),
+              (void __iomem *)IDE_CONTROL_REG);
 }
 
 
 static int
 sgiioc4_checkirq(ide_hwif_t * hwif)
 {
-       u8 intr_reg =
-           hwif->INL(hwif->io_ports[IDE_IRQ_OFFSET] + IOC4_INTR_REG * 4);
+       unsigned long intr_addr =
+               hwif->io_ports[IDE_IRQ_OFFSET] + IOC4_INTR_REG * 4;
 
-       if (intr_reg & 0x03)
+       if ((u8)readl((void __iomem *)intr_addr) & 0x03)
                return 1;
 
        return 0;
 }
 
+static u8 sgiioc4_INB(unsigned long);
 
 static int
 sgiioc4_clearirq(ide_drive_t * drive)
@@ -138,21 +138,21 @@ sgiioc4_clearirq(ide_drive_t * drive)
            hwif->io_ports[IDE_IRQ_OFFSET] + (IOC4_INTR_REG << 2);
 
        /* Code to check for PCI error conditions */
-       intr_reg = hwif->INL(other_ir);
+       intr_reg = readl((void __iomem *)other_ir);
        if (intr_reg & 0x03) { /* Valid IOC4-IDE interrupt */
                /*
-                * Using hwif->INB to read the IDE_STATUS_REG has a side effect
+                * Using sgiioc4_INB to read the IDE_STATUS_REG has a side effect
                 * of clearing the interrupt.  The first read should clear it
                 * if it is set.  The second read should return a "clear" status
                 * if it got cleared.  If not, then spin for a bit trying to
                 * clear it.
                 */
-               u8 stat = hwif->INB(IDE_STATUS_REG);
+               u8 stat = sgiioc4_INB(IDE_STATUS_REG);
                int count = 0;
-               stat = hwif->INB(IDE_STATUS_REG);
+               stat = sgiioc4_INB(IDE_STATUS_REG);
                while ((stat & 0x80) && (count++ < 100)) {
                        udelay(1);
-                       stat = hwif->INB(IDE_STATUS_REG);
+                       stat = sgiioc4_INB(IDE_STATUS_REG);
                }
 
                if (intr_reg & 0x02) {
@@ -161,9 +161,9 @@ sgiioc4_clearirq(ide_drive_t * drive)
                            pci_stat_cmd_reg;
 
                        pci_err_addr_low =
-                               hwif->INL(hwif->io_ports[IDE_IRQ_OFFSET]);
+                               readl((void __iomem *)hwif->io_ports[IDE_IRQ_OFFSET]);
                        pci_err_addr_high =
-                               hwif->INL(hwif->io_ports[IDE_IRQ_OFFSET] + 4);
+                               readl((void __iomem *)(hwif->io_ports[IDE_IRQ_OFFSET] + 4));
                        pci_read_config_dword(hwif->pci_dev, PCI_COMMAND,
                                              &pci_stat_cmd_reg);
                        printk(KERN_ERR
@@ -180,9 +180,9 @@ sgiioc4_clearirq(ide_drive_t * drive)
                }
 
                /* Clear the Interrupt, Error bits on the IOC4 */
-               hwif->OUTL(0x03, other_ir);
+               writel(0x03, (void __iomem *)other_ir);
 
-               intr_reg = hwif->INL(other_ir);
+               intr_reg = readl((void __iomem *)other_ir);
        }
 
        return intr_reg & 3;
@@ -191,23 +191,25 @@ sgiioc4_clearirq(ide_drive_t * drive)
 static void sgiioc4_ide_dma_start(ide_drive_t * drive)
 {
        ide_hwif_t *hwif = HWIF(drive);
-       unsigned int reg = hwif->INL(hwif->dma_base + IOC4_DMA_CTRL * 4);
+       unsigned long ioc4_dma_addr = hwif->dma_base + IOC4_DMA_CTRL * 4;
+       unsigned int reg = readl((void __iomem *)ioc4_dma_addr);
        unsigned int temp_reg = reg | IOC4_S_DMA_START;
 
-       hwif->OUTL(temp_reg, hwif->dma_base + IOC4_DMA_CTRL * 4);
+       writel(temp_reg, (void __iomem *)ioc4_dma_addr);
 }
 
 static u32
 sgiioc4_ide_dma_stop(ide_hwif_t *hwif, u64 dma_base)
 {
+       unsigned long ioc4_dma_addr = dma_base + IOC4_DMA_CTRL * 4;
        u32     ioc4_dma;
        int     count;
 
        count = 0;
-       ioc4_dma = hwif->INL(dma_base + IOC4_DMA_CTRL * 4);
+       ioc4_dma = readl((void __iomem *)ioc4_dma_addr);
        while ((ioc4_dma & IOC4_S_DMA_STOP) && (count++ < 200)) {
                udelay(1);
-               ioc4_dma = hwif->INL(dma_base + IOC4_DMA_CTRL * 4);
+               ioc4_dma = readl((void __iomem *)ioc4_dma_addr);
        }
        return ioc4_dma;
 }
@@ -218,11 +220,11 @@ sgiioc4_ide_dma_end(ide_drive_t * drive)
 {
        u32 ioc4_dma, bc_dev, bc_mem, num, valid = 0, cnt = 0;
        ide_hwif_t *hwif = HWIF(drive);
-       u64 dma_base = hwif->dma_base;
+       unsigned long dma_base = hwif->dma_base;
        int dma_stat = 0;
        unsigned long *ending_dma = ide_get_hwifdata(hwif);
 
-       hwif->OUTL(IOC4_S_DMA_STOP, dma_base + IOC4_DMA_CTRL * 4);
+       writel(IOC4_S_DMA_STOP, (void __iomem *)(dma_base + IOC4_DMA_CTRL * 4));
 
        ioc4_dma = sgiioc4_ide_dma_stop(hwif, dma_base);
 
@@ -254,8 +256,8 @@ sgiioc4_ide_dma_end(ide_drive_t * drive)
                dma_stat = 1;
        }
 
-       bc_dev = hwif->INL(dma_base + IOC4_BC_DEV * 4);
-       bc_mem = hwif->INL(dma_base + IOC4_BC_MEM * 4);
+       bc_dev = readl((void __iomem *)(dma_base + IOC4_BC_DEV * 4));
+       bc_mem = readl((void __iomem *)(dma_base + IOC4_BC_MEM * 4));
 
        if ((bc_dev & 0x01FF) || (bc_mem & 0x1FF)) {
                if (bc_dev > bc_mem + 8) {
@@ -273,34 +275,29 @@ sgiioc4_ide_dma_end(ide_drive_t * drive)
 }
 
 static int
-sgiioc4_ide_dma_check(ide_drive_t * drive)
+sgiioc4_ide_dma_on(ide_drive_t * drive)
 {
-       if (ide_config_drive_speed(drive, XFER_MW_DMA_2) != 0) {
-               printk(KERN_INFO
-                      "Couldnot set %s in Multimode-2 DMA mode | "
-                          "Drive %s using PIO instead\n",
-                      drive->name, drive->name);
-               drive->using_dma = 0;
-       } else
-               drive->using_dma = 1;
+       drive->using_dma = 1;
 
        return 0;
 }
 
-static int
-sgiioc4_ide_dma_on(ide_drive_t * drive)
+static void sgiioc4_dma_off_quietly(ide_drive_t *drive)
 {
-       drive->using_dma = 1;
+       drive->using_dma = 0;
 
-       return HWIF(drive)->ide_dma_host_on(drive);
+       drive->hwif->dma_host_off(drive);
 }
 
-static int
-sgiioc4_ide_dma_off_quietly(ide_drive_t * drive)
+static int sgiioc4_ide_dma_check(ide_drive_t *drive)
 {
-       drive->using_dma = 0;
-
-       return HWIF(drive)->ide_dma_host_off(drive);
+       /* FIXME: check for available DMA modes */
+       if (ide_config_drive_speed(drive, XFER_MW_DMA_2) != 0) {
+               printk(KERN_WARNING "%s: couldn't set MWDMA2 mode, "
+                                   "using PIO instead\n", drive->name);
+               return -1;
+       } else
+               return 0;
 }
 
 /* returns 1 if dma irq issued, 0 otherwise */
@@ -310,21 +307,13 @@ sgiioc4_ide_dma_test_irq(ide_drive_t * drive)
        return sgiioc4_checkirq(HWIF(drive));
 }
 
-static int
-sgiioc4_ide_dma_host_on(ide_drive_t * drive)
+static void sgiioc4_dma_host_on(ide_drive_t * drive)
 {
-       if (drive->using_dma)
-               return 0;
-
-       return 1;
 }
 
-static int
-sgiioc4_ide_dma_host_off(ide_drive_t * drive)
+static void sgiioc4_dma_host_off(ide_drive_t * drive)
 {
        sgiioc4_clearirq(drive);
-
-       return 0;
 }
 
 static int
@@ -436,16 +425,17 @@ sgiioc4_configure_for_dma(int dma_direction, ide_drive_t * drive)
 {
        u32 ioc4_dma;
        ide_hwif_t *hwif = HWIF(drive);
-       u64 dma_base = hwif->dma_base;
+       unsigned long dma_base = hwif->dma_base;
+       unsigned long ioc4_dma_addr = dma_base + IOC4_DMA_CTRL * 4;
        u32 dma_addr, ending_dma_addr;
 
-       ioc4_dma = hwif->INL(dma_base + IOC4_DMA_CTRL * 4);
+       ioc4_dma = readl((void __iomem *)ioc4_dma_addr);
 
        if (ioc4_dma & IOC4_S_DMA_ACTIVE) {
                printk(KERN_WARNING
                        "%s(%s):Warning!! DMA from previous transfer was still active\n",
                       __FUNCTION__, drive->name);
-               hwif->OUTL(IOC4_S_DMA_STOP, dma_base + IOC4_DMA_CTRL * 4);
+               writel(IOC4_S_DMA_STOP, (void __iomem *)ioc4_dma_addr);
                ioc4_dma = sgiioc4_ide_dma_stop(hwif, dma_base);
 
                if (ioc4_dma & IOC4_S_DMA_STOP)
@@ -454,13 +444,13 @@ sgiioc4_configure_for_dma(int dma_direction, ide_drive_t * drive)
                               __FUNCTION__, drive->name);
        }
 
-       ioc4_dma = hwif->INL(dma_base + IOC4_DMA_CTRL * 4);
+       ioc4_dma = readl((void __iomem *)ioc4_dma_addr);
        if (ioc4_dma & IOC4_S_DMA_ERROR) {
                printk(KERN_WARNING
                       "%s(%s) : Warning!! - DMA Error during Previous"
                       " transfer | status 0x%x\n",
                       __FUNCTION__, drive->name, ioc4_dma);
-               hwif->OUTL(IOC4_S_DMA_STOP, dma_base + IOC4_DMA_CTRL * 4);
+               writel(IOC4_S_DMA_STOP, (void __iomem *)ioc4_dma_addr);
                ioc4_dma = sgiioc4_ide_dma_stop(hwif, dma_base);
 
                if (ioc4_dma & IOC4_S_DMA_STOP)
@@ -471,14 +461,14 @@ sgiioc4_configure_for_dma(int dma_direction, ide_drive_t * drive)
 
        /* Address of the Scatter Gather List */
        dma_addr = cpu_to_le32(hwif->dmatable_dma);
-       hwif->OUTL(dma_addr, dma_base + IOC4_DMA_PTR_L * 4);
+       writel(dma_addr, (void __iomem *)(dma_base + IOC4_DMA_PTR_L * 4));
 
        /* Address of the Ending DMA */
        memset(ide_get_hwifdata(hwif), 0, IOC4_IDE_CACHELINE_SIZE);
        ending_dma_addr = cpu_to_le32(hwif->dma_status);
-       hwif->OUTL(ending_dma_addr, dma_base + IOC4_DMA_END_ADDR * 4);
+       writel(ending_dma_addr, (void __iomem *)(dma_base + IOC4_DMA_END_ADDR * 4));
 
-       hwif->OUTL(dma_direction, dma_base + IOC4_DMA_CTRL * 4);
+       writel(dma_direction, (void __iomem *)ioc4_dma_addr);
        drive->waiting_for_dma = 1;
 }
 
@@ -590,7 +580,7 @@ static int sgiioc4_ide_dma_setup(ide_drive_t *drive)
 static void __devinit
 ide_init_sgiioc4(ide_hwif_t * hwif)
 {
-       hwif->mmio = 2;
+       hwif->mmio = 1;
        hwif->autodma = 1;
        hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x0; /* Disable Ultra DMA */
@@ -613,10 +603,10 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
        hwif->ide_dma_end = &sgiioc4_ide_dma_end;
        hwif->ide_dma_check = &sgiioc4_ide_dma_check;
        hwif->ide_dma_on = &sgiioc4_ide_dma_on;
-       hwif->ide_dma_off_quietly = &sgiioc4_ide_dma_off_quietly;
+       hwif->dma_off_quietly = &sgiioc4_dma_off_quietly;
        hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq;
-       hwif->ide_dma_host_on = &sgiioc4_ide_dma_host_on;
-       hwif->ide_dma_host_off = &sgiioc4_ide_dma_host_off;
+       hwif->dma_host_on = &sgiioc4_dma_host_on;
+       hwif->dma_host_off = &sgiioc4_dma_host_off;
        hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq;
        hwif->ide_dma_timeout = &__ide_dma_timeout;
 
@@ -688,7 +678,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d)
        default_hwif_mmiops(hwif);
 
        /* Initializing chipset IRQ Registers */
-       hwif->OUTL(0x03, irqport + IOC4_INTR_SET * 4);
+       writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4));
 
        ide_init_sgiioc4(hwif);
 
@@ -729,8 +719,7 @@ out:
        return ret;
 }
 
-static ide_pci_device_t sgiioc4_chipsets[] __devinitdata = {
-       {
+static ide_pci_device_t sgiioc4_chipset __devinitdata = {
         /* Channel 0 */
         .name = "SGIIOC4",
         .init_hwif = ide_init_sgiioc4,
@@ -739,7 +728,6 @@ static ide_pci_device_t sgiioc4_chipsets[] __devinitdata = {
         .autodma = AUTODMA,
         /* SGI IOC4 doesn't have enablebits. */
         .bootable = ON_BOARD,
-       }
 };
 
 int
@@ -751,8 +739,7 @@ ioc4_ide_attach_one(struct ioc4_driver_data *idd)
        if (idd->idd_variant == IOC4_VARIANT_PCI_RT)
                return 0;
 
-       return pci_init_sgiioc4(idd->idd_pdev,
-                               &sgiioc4_chipsets[idd->idd_pci_id->driver_data]);
+       return pci_init_sgiioc4(idd->idd_pdev, &sgiioc4_chipset);
 }
 
 static struct ioc4_submodule ioc4_ide_submodule = {
index 4ff89c7d990a026c9475b6fa16a6c1eadbd6d0cd..7b4c189a9d99c81384a8500ca7c339995b495f07 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * linux/drivers/ide/pci/siimage.c             Version 1.07    Nov 30, 2003
+ * linux/drivers/ide/pci/siimage.c             Version 1.11    Jan 27, 2007
  *
  * Copyright (C) 2001-2002     Andre Hedrick <andre@linux-ide.org>
  * Copyright (C) 2003          Red Hat <alan@redhat.com>
+ * Copyright (C) 2007          MontaVista Software, Inc.
  *
  *  May be copied or modified under the terms of the GNU General Public License
  *
@@ -205,41 +206,39 @@ static void siimage_tuneproc (ide_drive_t *drive, byte mode_wanted)
        unsigned long tfaddr    = siimage_selreg(hwif, 0x02);
        
        /* cheat for now and use the docs */
-       switch(mode_wanted) {
-               case 4: 
-                       speedp = 0x10c1; 
-                       speedt = 0x10c1;
-                       break;
-               case 3: 
-                       speedp = 0x10C3; 
-                       speedt = 0x10C3;
-                       break;
-               case 2: 
-                       speedp = 0x1104; 
-                       speedt = 0x1281;
-                       break;
-               case 1:         
-                       speedp = 0x2283; 
-                       speedt = 0x1281;
-                       break;
-               case 0:
-               default:
-                       speedp = 0x328A; 
-                       speedt = 0x328A;
-                       break;
+       switch (mode_wanted) {
+       case 4:
+               speedp = 0x10c1;
+               speedt = 0x10c1;
+               break;
+       case 3:
+               speedp = 0x10c3;
+               speedt = 0x10c3;
+               break;
+       case 2:
+               speedp = 0x1104;
+               speedt = 0x1281;
+               break;
+       case 1:
+               speedp = 0x2283;
+               speedt = 0x2283;
+               break;
+       case 0:
+       default:
+               speedp = 0x328a;
+               speedt = 0x328a;
+               break;
        }
-       if (hwif->mmio)
-       {
-               hwif->OUTW(speedt, addr);
-               hwif->OUTW(speedp, tfaddr);
+
+       if (hwif->mmio) {
+               hwif->OUTW(speedp, addr);
+               hwif->OUTW(speedt, tfaddr);
                /* Now set up IORDY */
                if(mode_wanted == 3 || mode_wanted == 4)
                        hwif->OUTW(hwif->INW(tfaddr-2)|0x200, tfaddr-2);
                else
                        hwif->OUTW(hwif->INW(tfaddr-2)&~0x200, tfaddr-2);
-       }
-       else
-       {
+       } else {
                pci_write_config_word(hwif->pci_dev, addr, speedp);
                pci_write_config_word(hwif->pci_dev, tfaddr, speedt);
                pci_read_config_word(hwif->pci_dev, tfaddr-2, &speedp);
@@ -397,12 +396,9 @@ static int config_chipset_for_dma (ide_drive_t *drive)
        if (!speed)
                return 0;
 
-       if (ide_set_xfer_rate(drive, speed))
+       if (siimage_tune_chipset(drive, speed))
                return 0;
 
-       if (!drive->init_speed)
-               drive->init_speed = speed;
-
        return ide_dma_enable(drive);
 }
 
@@ -418,25 +414,13 @@ static int config_chipset_for_dma (ide_drive_t *drive)
  
 static int siimage_config_drive_for_dma (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
-       if ((id->capability & 1) != 0 && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive))
                config_chipset_for_pio(drive, 1);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return -1;
 }
 
 /* returns 1 if dma irq issued, 0 otherwise */
@@ -472,11 +456,11 @@ static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive)
        unsigned long addr      = siimage_selreg(hwif, 0x1);
 
        if (SATA_ERROR_REG) {
-               u32 ext_stat = hwif->INL(base + 0x10);
+               u32 ext_stat = readl((void __iomem *)(base + 0x10));
                u8 watchdog = 0;
                if (ext_stat & ((hwif->channel) ? 0x40 : 0x10)) {
-                       u32 sata_error = hwif->INL(SATA_ERROR_REG);
-                       hwif->OUTL(sata_error, SATA_ERROR_REG);
+                       u32 sata_error = readl((void __iomem *)SATA_ERROR_REG);
+                       writel(sata_error, (void __iomem *)SATA_ERROR_REG);
                        watchdog = (sata_error & 0x00680000) ? 1 : 0;
                        printk(KERN_WARNING "%s: sata_error = 0x%08x, "
                                "watchdog = %d, %s\n",
@@ -493,11 +477,11 @@ static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive)
        }
 
        /* return 1 if INTR asserted */
-       if ((hwif->INB(hwif->dma_status) & 0x04) == 0x04)
+       if ((readb((void __iomem *)hwif->dma_status) & 0x04) == 0x04)
                return 1;
 
        /* return 1 if Device INTR asserted */
-       if ((hwif->INB(addr) & 8) == 8)
+       if ((readb((void __iomem *)addr) & 8) == 8)
                return 0;       //return 1;
 
        return 0;
@@ -519,9 +503,9 @@ static int siimage_busproc (ide_drive_t * drive, int state)
        u32 stat_config         = 0;
        unsigned long addr      = siimage_selreg(hwif, 0);
 
-       if (hwif->mmio) {
-               stat_config = hwif->INL(addr);
-       else
+       if (hwif->mmio)
+               stat_config = readl((void __iomem *)addr);
+       else
                pci_read_config_dword(hwif->pci_dev, addr, &stat_config);
 
        switch (state) {
@@ -557,9 +541,10 @@ static int siimage_reset_poll (ide_drive_t *drive)
        if (SATA_STATUS_REG) {
                ide_hwif_t *hwif        = HWIF(drive);
 
-               if ((hwif->INL(SATA_STATUS_REG) & 0x03) != 0x03) {
+               /* SATA_STATUS_REG is valid only when in MMIO mode */
+               if ((readl((void __iomem *)SATA_STATUS_REG) & 0x03) != 0x03) {
                        printk(KERN_WARNING "%s: reset phy dead, status=0x%08x\n",
-                               hwif->name, hwif->INL(SATA_STATUS_REG));
+                               hwif->name, readl((void __iomem *)SATA_STATUS_REG));
                        HWGROUP(drive)->polling = 0;
                        return ide_started;
                }
@@ -619,7 +604,8 @@ static void siimage_reset (ide_drive_t *drive)
        }
 
        if (SATA_STATUS_REG) {
-               u32 sata_stat = hwif->INL(SATA_STATUS_REG);
+               /* SATA_STATUS_REG is valid only when in MMIO mode */
+               u32 sata_stat = readl((void __iomem *)SATA_STATUS_REG);
                printk(KERN_WARNING "%s: reset phy, status=0x%08x, %s\n",
                        hwif->name, sata_stat, __FUNCTION__);
                if (!(sata_stat)) {
@@ -898,7 +884,8 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
                base = (unsigned long) addr;
 
        hwif->dma_base                  = base + (ch ? 0x08 : 0x00);
-       hwif->mmio                      = 2;
+
+       hwif->mmio = 1;
 }
 
 static int is_dev_seagate_sata(ide_drive_t *drive)
index 1afff659ab5544e8c87918d91d595093ed1d09a2..2ba0669f36a17bd066546a56f7e49324162c91d8 100644 (file)
@@ -667,67 +667,20 @@ static int config_chipset_for_dma (ide_drive_t *drive)
        return ide_dma_enable(drive);
 }
 
-static int sis5513_config_drive_xfer_rate (ide_drive_t *drive)
+static int sis5513_config_xfer_rate(ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
+       config_art_rwp_pio(drive, 5);
 
        drive->init_speed = 0;
 
-       if (id && (id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive))
                sis5513_tune_drive(drive, 5);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
-}
-
-/* initiates/aborts (U)DMA read/write operations on a drive. */
-static int sis5513_config_xfer_rate (ide_drive_t *drive)
-{
-       config_drive_art_rwp(drive);
-       config_art_rwp_pio(drive, 5);
-       return sis5513_config_drive_xfer_rate(drive);
-}
-
-/*
-  Future simpler config_xfer_rate :
-   When ide_find_best_mode is made bad-drive aware
-   - remove config_drive_xfer_rate and config_chipset_for_dma,
-   - replace config_xfer_rate with the following
-
-static int sis5513_config_xfer_rate (ide_drive_t *drive)
-{
-       u16 w80 = HWIF(drive)->udma_four;
-       u16 speed;
-
-       config_drive_art_rwp(drive);
-       config_art_rwp_pio(drive, 5);
-
-       speed = ide_find_best_mode(drive,
-               XFER_PIO | XFER_EPIO | XFER_SWDMA | XFER_MWDMA |
-               (chipset_family >= ATA_33 ? XFER_UDMA : 0) |
-               (w80 && chipset_family >= ATA_66 ? XFER_UDMA_66 : 0) |
-               (w80 && chipset_family >= ATA_100a ? XFER_UDMA_100 : 0) |
-               (w80 && chipset_family >= ATA_133a ? XFER_UDMA_133 : 0));
-
-       sis5513_tune_chipset(drive, speed);
 
-       if (drive->autodma && (speed & XFER_MODE) != XFER_PIO)
-               return HWIF(drive)->ide_dma_on(drive);
-       return HWIF(drive)->ide_dma_off_quietly(drive);
+       return -1;
 }
-*/
 
 /* Chip detection and general config */
 static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const char *name)
index 170a261990506b5e4ed2661982d76295ca0a311e..3a8a76fc78c78b0c9e201039277d34f5252650aa 100644 (file)
@@ -161,14 +161,14 @@ static int sl82c105_check_drive (ide_drive_t *drive)
                if (id->field_valid & 2) {
                        if ((id->dma_mword & hwif->mwdma_mask) ||
                            (id->dma_1word & hwif->swdma_mask))
-                               return hwif->ide_dma_on(drive);
+                               return 0;
                }
 
-               if (__ide_dma_good_drive(drive))
-                       return hwif->ide_dma_on(drive);
+               if (__ide_dma_good_drive(drive) && id->eide_dma_time < 150)
+                       return 0;
        } while (0);
 
-       return hwif->ide_dma_off_quietly(drive);
+       return -1;
 }
 
 /*
@@ -215,7 +215,7 @@ static int sl82c105_ide_dma_lost_irq(ide_drive_t *drive)
         * Was DMA enabled?  If so, disable it - we're resetting the
         * host.  The IDE layer will be handling the drive for us.
         */
-       val = hwif->INB(dma_base);
+       val = inb(dma_base);
        if (val & 1) {
                outb(val & ~1, dma_base);
                printk("sl82c105: DMA was enabled\n");
@@ -259,28 +259,22 @@ static int sl82c105_ide_dma_on (ide_drive_t *drive)
 {
        DBG(("sl82c105_ide_dma_on(drive:%s)\n", drive->name));
 
-       if (config_for_dma(drive)) {
-               config_for_pio(drive, 4, 0, 0);
-               return HWIF(drive)->ide_dma_off_quietly(drive);
-       }
+       if (config_for_dma(drive))
+               return 1;
        printk(KERN_INFO "%s: DMA enabled\n", drive->name);
        return __ide_dma_on(drive);
 }
 
-static int sl82c105_ide_dma_off_quietly (ide_drive_t *drive)
+static void sl82c105_dma_off_quietly(ide_drive_t *drive)
 {
        u8 speed = XFER_PIO_0;
-       int rc;
-       
-       DBG(("sl82c105_ide_dma_off_quietly(drive:%s)\n", drive->name));
 
-       rc = __ide_dma_off_quietly(drive);
+       DBG(("sl82c105_dma_off_quietly(drive:%s)\n", drive->name));
+
+       ide_dma_off_quietly(drive);
        if (drive->pio_speed)
                speed = drive->pio_speed - XFER_PIO_0;
        config_for_pio(drive, speed, 0, 1);
-       drive->current_speed = drive->pio_speed;
-
-       return rc;
 }
 
 /*
@@ -401,11 +395,9 @@ static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const c
 /*
  * Initialise the chip
  */
-
 static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
 {
        unsigned int rev;
-       u8 dma_state;
 
        DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index));
 
@@ -431,7 +423,6 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
-       dma_state = hwif->INB(hwif->dma_base + 2) & ~0x60;
        rev = sl82c105_bridge_revision(hwif->pci_dev);
        if (rev <= 5) {
                /*
@@ -441,15 +432,12 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
                printk("    %s: Winbond 553 bridge revision %d, BM-DMA disabled\n",
                       hwif->name, rev);
        } else {
-               dma_state |= 0x60;
-
                hwif->atapi_dma = 1;
-               hwif->mwdma_mask = 0x07;
-               hwif->swdma_mask = 0x07;
+               hwif->mwdma_mask = 0x04;
 
                hwif->ide_dma_check = &sl82c105_check_drive;
                hwif->ide_dma_on = &sl82c105_ide_dma_on;
-               hwif->ide_dma_off_quietly = &sl82c105_ide_dma_off_quietly;
+               hwif->dma_off_quietly = &sl82c105_dma_off_quietly;
                hwif->ide_dma_lostirq = &sl82c105_ide_dma_lost_irq;
                hwif->dma_start = &sl82c105_ide_dma_start;
                hwif->ide_dma_timeout = &sl82c105_ide_dma_timeout;
@@ -462,7 +450,6 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
                if (hwif->mate)
                        hwif->serialized = hwif->mate->serialized = 1;
        }
-       hwif->OUTB(dma_state, hwif->dma_base + 2);
 }
 
 static ide_pci_device_t sl82c105_chipset __devinitdata = {
index 2663ddbd9b67408bbdb68db54eece1c2beec552b..ae7eb58d961c6f46a27c153aec56dee407befe84 100644 (file)
@@ -179,26 +179,16 @@ static int slc90e66_config_drive_for_dma (ide_drive_t *drive)
 
 static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
        drive->init_speed = 0;
 
-       if ((id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive))
-                       return hwif->ide_dma_on(drive);
+       if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive))
+               return 0;
 
-               goto fast_ata_pio;
+       if (ide_use_fast_pio(drive))
+               (void)slc90e66_tune_chipset(drive, XFER_PIO_0 +
+                               ide_get_best_pio_mode(drive, 255, 4, NULL));
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
-               (void) hwif->speedproc(drive, XFER_PIO_0 +
-                                      ide_get_best_pio_mode(drive, 255, 4, NULL));
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+       return -1;
 }
 
 static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
index 2ad72bbda34217bb3b351bda50065ee5d5385b4f..0b6d81d6ce488926dd01bcc87996559423d94bfd 100644 (file)
@@ -45,7 +45,7 @@ static int tc86c001_tune_chipset(ide_drive_t *drive, u8 speed)
 
        scr &= (speed < XFER_MW_DMA_0) ? 0xf8ff : 0xff0f;
        scr |= mode;
-       hwif->OUTW(scr, scr_port);
+       outw(scr, scr_port);
 
        return ide_config_drive_speed(drive, speed);
 }
@@ -89,15 +89,15 @@ static int tc86c001_timer_expiry(ide_drive_t *drive)
                       "attempting recovery...\n", drive->name);
 
                /* Stop DMA */
-               hwif->OUTB(dma_cmd & ~0x01, hwif->dma_command);
+               outb(dma_cmd & ~0x01, hwif->dma_command);
 
                /* Setup the dummy DMA transfer */
-               hwif->OUTW(0, sc_base + 0x0a);  /* Sector Count */
-               hwif->OUTW(0, twcr_port);       /* Transfer Word Count 1 or 2 */
+               outw(0, sc_base + 0x0a);        /* Sector Count */
+               outw(0, twcr_port);     /* Transfer Word Count 1 or 2 */
 
                /* Start the dummy DMA transfer */
-               hwif->OUTB(0x00, hwif->dma_command); /* clear R_OR_WCTR for write */
-               hwif->OUTB(0x01, hwif->dma_command); /* set START_STOPBM */
+               outb(0x00, hwif->dma_command); /* clear R_OR_WCTR for write */
+               outb(0x01, hwif->dma_command); /* set START_STOPBM */
 
                /*
                 * If an interrupt was pending, it should come thru shortly.
@@ -128,8 +128,8 @@ static void tc86c001_dma_start(ide_drive_t *drive)
         * the appropriate system control registers for DMA to work
         * with LBA48 and ATAPI devices...
         */
-       hwif->OUTW(nsectors, sc_base + 0x0a);   /* Sector Count */
-       hwif->OUTW(SECTOR_SIZE / 2, twcr_port); /* Transfer Word Count 1/2 */
+       outw(nsectors, sc_base + 0x0a); /* Sector Count */
+       outw(SECTOR_SIZE / 2, twcr_port); /* Transfer Word Count 1/2 */
 
        /* Install our timeout expiry hook, saving the current handler... */
        ide_set_hwifdata(hwif, hwgroup->expiry);
@@ -168,7 +168,7 @@ static int tc86c001_busproc(ide_drive_t *drive, int state)
        }
 
        /* System Control 1 Register bit 11 (ATA Hard Reset) write */
-       hwif->OUTW(scr1, sc_base + 0x00);
+       outw(scr1, sc_base + 0x00);
        return 0;
 }
 
@@ -185,23 +185,13 @@ static int config_chipset_for_dma(ide_drive_t *drive)
 
 static int tc86c001_config_drive_xfer_rate(ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
-       if ((id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive) && config_chipset_for_dma(drive))
-                       return hwif->ide_dma_on(drive);
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive))
                tc86c001_tune_drive(drive, 255);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return -1;
 }
 
 static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
@@ -210,13 +200,13 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
        u16 scr1                = hwif->INW(sc_base + 0x00);;
 
        /* System Control 1 Register bit 15 (Soft Reset) set */
-       hwif->OUTW(scr1 |  0x8000, sc_base + 0x00);
+       outw(scr1 |  0x8000, sc_base + 0x00);
 
        /* System Control 1 Register bit 14 (FIFO Reset) set */
-       hwif->OUTW(scr1 |  0x4000, sc_base + 0x00);
+       outw(scr1 |  0x4000, sc_base + 0x00);
 
        /* System Control 1 Register: reset clear */
-       hwif->OUTW(scr1 & ~0xc000, sc_base + 0x00);
+       outw(scr1 & ~0xc000, sc_base + 0x00);
 
        /* Store the system control register base for convenience... */
        hwif->config_data = sc_base;
@@ -234,7 +224,7 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
         * Sector Count Control Register bits 0 and 1 set:
         * software sets Sector Count Register for master and slave device
         */
-       hwif->OUTW(0x0003, sc_base + 0x0c);
+       outw(0x0003, sc_base + 0x0c);
 
        /* Sector Count Register limit */
        hwif->rqsize     = 0xffff;
index b13cce1fd1a6aa7e973b5e7d621d2af33a6984c1..5e06179c3469ed4a1fc7956d60fd95e389a630a2 100644 (file)
@@ -104,29 +104,21 @@ static int triflex_config_drive_for_dma(ide_drive_t *drive)
 {
        int speed = ide_dma_speed(drive, 0); /* No ultra speeds */
 
-       if (!speed) { 
-               u8 pspeed = ide_get_best_pio_mode(drive, 255, 4, NULL);
-               speed = XFER_PIO_0 + pspeed;
-       }
-       
+       if (!speed)
+               return 0;
+
        (void) triflex_tune_chipset(drive, speed);
         return ide_dma_enable(drive);
 }
 
 static int triflex_config_drive_xfer_rate(ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
-       if ((id->capability & 1) && drive->autodma) {
-               if (ide_use_dma(drive)) {
-                       if (triflex_config_drive_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-       }
+       if (ide_use_dma(drive) && triflex_config_drive_for_dma(drive))
+               return 0;
+
+       triflex_tune_drive(drive, 255);
 
-       hwif->tuneproc(drive, 255);
-       return hwif->ide_dma_off_quietly(drive);
+       return -1;
 }
 
 static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
index 174b88c4780ef276c363f1498efdce576915dd44..cbb1b11119a520b9b0c8db24d796fb7c931832f3 100644 (file)
@@ -157,16 +157,16 @@ static void trm290_prepare_drive (ide_drive_t *drive, unsigned int use_dma)
        if (reg != hwif->select_data) {
                hwif->select_data = reg;
                /* set PIO/DMA */
-               hwif->OUTB(0x51|(hwif->channel<<3), hwif->config_data+1);
-               hwif->OUTW(reg & 0xff, hwif->config_data);
+               outb(0x51 | (hwif->channel << 3), hwif->config_data + 1);
+               outw(reg & 0xff, hwif->config_data);
        }
 
        /* enable IRQ if not probing */
        if (drive->present) {
-               reg = hwif->INW(hwif->config_data + 3);
+               reg = inw(hwif->config_data + 3);
                reg &= 0x13;
                reg &= ~(1 << hwif->channel);
-               hwif->OUTW(reg, hwif->config_data+3);
+               outw(reg, hwif->config_data + 3);
        }
 
        local_irq_restore(flags);
@@ -177,15 +177,12 @@ static void trm290_selectproc (ide_drive_t *drive)
        trm290_prepare_drive(drive, drive->using_dma);
 }
 
-#ifdef CONFIG_BLK_DEV_IDEDMA
 static void trm290_ide_dma_exec_cmd(ide_drive_t *drive, u8 command)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-
        BUG_ON(HWGROUP(drive)->handler != NULL);        /* paranoia check */
        ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL);
        /* issue cmd to drive */
-       hwif->OUTB(command, IDE_COMMAND_REG);
+       outb(command, IDE_COMMAND_REG);
 }
 
 static int trm290_ide_dma_setup(ide_drive_t *drive)
@@ -211,10 +208,10 @@ static int trm290_ide_dma_setup(ide_drive_t *drive)
        }
        /* select DMA xfer */
        trm290_prepare_drive(drive, 1);
-       hwif->OUTL(hwif->dmatable_dma|rw, hwif->dma_command);
+       outl(hwif->dmatable_dma | rw, hwif->dma_command);
        drive->waiting_for_dma = 1;
        /* start DMA */
-       hwif->OUTW((count * 2) - 1, hwif->dma_status);
+       outw((count * 2) - 1, hwif->dma_status);
        return 0;
 }
 
@@ -230,7 +227,7 @@ static int trm290_ide_dma_end (ide_drive_t *drive)
        drive->waiting_for_dma = 0;
        /* purge DMA mappings */
        ide_destroy_dmatable(drive);
-       status = hwif->INW(hwif->dma_status);
+       status = inw(hwif->dma_status);
        return (status != 0x00ff);
 }
 
@@ -239,10 +236,9 @@ static int trm290_ide_dma_test_irq (ide_drive_t *drive)
        ide_hwif_t *hwif = HWIF(drive);
        u16 status = 0;
 
-       status = hwif->INW(hwif->dma_status);
+       status = inw(hwif->dma_status);
        return (status == 0x00ff);
 }
-#endif /* CONFIG_BLK_DEV_IDEDMA */
 
 /*
  * Invoked from ide-dma.c at boot time.
@@ -269,15 +265,15 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
 
        local_irq_save(flags);
        /* put config reg into first byte of hwif->select_data */
-       hwif->OUTB(0x51|(hwif->channel<<3), hwif->config_data+1);
+       outb(0x51 | (hwif->channel << 3), hwif->config_data + 1);
        /* select PIO as default */
        hwif->select_data = 0x21;
-       hwif->OUTB(hwif->select_data, hwif->config_data);
+       outb(hwif->select_data, hwif->config_data);
        /* get IRQ info */
-       reg = hwif->INB(hwif->config_data+3);
+       reg = inb(hwif->config_data + 3);
        /* mask IRQs for both ports */
        reg = (reg & 0x10) | 0x03;
-       hwif->OUTB(reg, hwif->config_data+3);
+       outb(reg, hwif->config_data + 3);
        local_irq_restore(flags);
 
        if ((reg & 0x10))
@@ -289,13 +285,11 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
 
        ide_setup_dma(hwif, (hwif->config_data + 4) ^ (hwif->channel ? 0x0080 : 0x0000), 3);
 
-#ifdef CONFIG_BLK_DEV_IDEDMA
        hwif->dma_setup = &trm290_ide_dma_setup;
        hwif->dma_exec_cmd = &trm290_ide_dma_exec_cmd;
        hwif->dma_start = &trm290_ide_dma_start;
        hwif->ide_dma_end = &trm290_ide_dma_end;
        hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq;
-#endif /* CONFIG_BLK_DEV_IDEDMA */
 
        hwif->selectproc = &trm290_selectproc;
        hwif->autodma = 0;              /* play it safe for now */
@@ -312,16 +306,16 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
                static u16 next_offset = 0;
                u8 old_mask;
 
-               hwif->OUTB(0x54|(hwif->channel<<3), hwif->config_data+1);
-               old = hwif->INW(hwif->config_data);
+               outb(0x54 | (hwif->channel << 3), hwif->config_data + 1);
+               old = inw(hwif->config_data);
                old &= ~1;
-               old_mask = hwif->INB(old+2);
+               old_mask = inb(old + 2);
                if (old != compat && old_mask == 0xff) {
                        /* leave lower 10 bits untouched */
                        compat += (next_offset += 0x400);
                        hwif->io_ports[IDE_CONTROL_OFFSET] = compat + 2;
-                       hwif->OUTW(compat|1, hwif->config_data);
-                       new = hwif->INW(hwif->config_data);
+                       outw(compat | 1, hwif->config_data);
+                       new = inw(hwif->config_data);
                        printk(KERN_INFO "%s: control basereg workaround: "
                                "old=0x%04x, new=0x%04x\n",
                                hwif->name, old, new & ~1);
index 6fb6e50b82312131b1b3ac45f29f927c0f6a7e07..a508550c4095cecb0a43ffb474ca4d94b531d30b 100644 (file)
@@ -240,8 +240,9 @@ static int via82cxxx_ide_dma_check (ide_drive_t *drive)
        via_set_drive(drive, speed);
 
        if (drive->autodma && (speed & XFER_MODE) != XFER_PIO)
-               return hwif->ide_dma_on(drive);
-       return hwif->ide_dma_off_quietly(drive);
+               return 0;
+
+       return -1;
 }
 
 static struct via_isa_bridge *via_config_find(struct pci_dev **isa)
index d8ea23710bf0386d25d96d7d0e2a9102c001fb47..395d35253d5d0084bb9cd823eb2cb1658abb10b4 100644 (file)
@@ -1237,7 +1237,7 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
                hwif->OUTBSYNC = pmac_outbsync;
 
        /* Tell common code _not_ to mess with resources */
-       hwif->mmio = 2;
+       hwif->mmio = 1;
        hwif->hwif_data = pmif;
        pmac_ide_init_hwif_ports(&hwif->hw, pmif->regbase, 0, &hwif->irq);
        memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
@@ -1979,16 +1979,12 @@ pmac_ide_dma_test_irq (ide_drive_t *drive)
        return 1;
 }
 
-static int
-pmac_ide_dma_host_off (ide_drive_t *drive)
+static void pmac_ide_dma_host_off(ide_drive_t *drive)
 {
-       return 0;
 }
 
-static int
-pmac_ide_dma_host_on (ide_drive_t *drive)
+static int pmac_ide_dma_host_on(ide_drive_t *drive)
 {
-       return 0;
 }
 
 static int
@@ -2034,7 +2030,7 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
                return;
        }
 
-       hwif->ide_dma_off_quietly = &__ide_dma_off_quietly;
+       hwif->dma_off_quietly = &ide_dma_off_quietly;
        hwif->ide_dma_on = &__ide_dma_on;
        hwif->ide_dma_check = &pmac_ide_dma_check;
        hwif->dma_setup = &pmac_ide_dma_setup;
@@ -2042,8 +2038,8 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
        hwif->dma_start = &pmac_ide_dma_start;
        hwif->ide_dma_end = &pmac_ide_dma_end;
        hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq;
-       hwif->ide_dma_host_off = &pmac_ide_dma_host_off;
-       hwif->ide_dma_host_on = &pmac_ide_dma_host_on;
+       hwif->dma_host_off = &pmac_ide_dma_host_off;
+       hwif->dma_host_on = &pmac_ide_dma_host_on;
        hwif->ide_dma_timeout = &__ide_dma_timeout;
        hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq;
 
diff --git a/drivers/ide/ppc/scc_pata.c b/drivers/ide/ppc/scc_pata.c
new file mode 100644 (file)
index 0000000..de64b02
--- /dev/null
@@ -0,0 +1,831 @@
+/*
+ * Support for IDE interfaces on Celleb platform
+ *
+ * (C) Copyright 2006 TOSHIBA CORPORATION
+ *
+ * This code is based on drivers/ide/pci/siimage.c:
+ * Copyright (C) 2001-2002     Andre Hedrick <andre@linux-ide.org>
+ * Copyright (C) 2003          Red Hat <alan@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/delay.h>
+#include <linux/hdreg.h>
+#include <linux/ide.h>
+#include <linux/init.h>
+
+#define PCI_DEVICE_ID_TOSHIBA_SCC_ATA            0x01b4
+
+#define SCC_PATA_NAME           "scc IDE"
+
+#define TDVHSEL_MASTER          0x00000001
+#define TDVHSEL_SLAVE           0x00000004
+
+#define MODE_JCUSFEN            0x00000080
+
+#define CCKCTRL_ATARESET        0x00040000
+#define CCKCTRL_BUFCNT          0x00020000
+#define CCKCTRL_CRST            0x00010000
+#define CCKCTRL_OCLKEN          0x00000100
+#define CCKCTRL_ATACLKOEN       0x00000002
+#define CCKCTRL_LCLKEN          0x00000001
+
+#define QCHCD_IOS_SS           0x00000001
+
+#define QCHSD_STPDIAG          0x00020000
+
+#define INTMASK_MSK             0xD1000012
+#define INTSTS_SERROR          0x80000000
+#define INTSTS_PRERR           0x40000000
+#define INTSTS_RERR            0x10000000
+#define INTSTS_ICERR           0x01000000
+#define INTSTS_BMSINT          0x00000010
+#define INTSTS_BMHE            0x00000008
+#define INTSTS_IOIRQS           0x00000004
+#define INTSTS_INTRQ            0x00000002
+#define INTSTS_ACTEINT          0x00000001
+
+#define ECMODE_VALUE 0x01
+
+static struct scc_ports {
+       unsigned long ctl, dma;
+       unsigned char hwif_id;  /* for removing hwif from system */
+} scc_ports[MAX_HWIFS];
+
+/* PIO transfer mode  table */
+/* JCHST */
+static unsigned long JCHSTtbl[2][7] = {
+       {0x0E, 0x05, 0x02, 0x03, 0x02, 0x00, 0x00},   /* 100MHz */
+       {0x13, 0x07, 0x04, 0x04, 0x03, 0x00, 0x00}    /* 133MHz */
+};
+
+/* JCHHT */
+static unsigned long JCHHTtbl[2][7] = {
+       {0x0E, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00},   /* 100MHz */
+       {0x13, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00}    /* 133MHz */
+};
+
+/* JCHCT */
+static unsigned long JCHCTtbl[2][7] = {
+       {0x1D, 0x1D, 0x1C, 0x0B, 0x06, 0x00, 0x00},   /* 100MHz */
+       {0x27, 0x26, 0x26, 0x0E, 0x09, 0x00, 0x00}    /* 133MHz */
+};
+
+
+/* DMA transfer mode  table */
+/* JCHDCTM/JCHDCTS */
+static unsigned long JCHDCTxtbl[2][7] = {
+       {0x0A, 0x06, 0x04, 0x03, 0x01, 0x00, 0x00},   /* 100MHz */
+       {0x0E, 0x09, 0x06, 0x04, 0x02, 0x01, 0x00}    /* 133MHz */
+};
+
+/* JCSTWTM/JCSTWTS  */
+static unsigned long JCSTWTxtbl[2][7] = {
+       {0x06, 0x04, 0x03, 0x02, 0x02, 0x02, 0x00},   /* 100MHz */
+       {0x09, 0x06, 0x04, 0x02, 0x02, 0x02, 0x02}    /* 133MHz */
+};
+
+/* JCTSS */
+static unsigned long JCTSStbl[2][7] = {
+       {0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x00},   /* 100MHz */
+       {0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05}    /* 133MHz */
+};
+
+/* JCENVT */
+static unsigned long JCENVTtbl[2][7] = {
+       {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00},   /* 100MHz */
+       {0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}    /* 133MHz */
+};
+
+/* JCACTSELS/JCACTSELM */
+static unsigned long JCACTSELtbl[2][7] = {
+       {0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00},   /* 100MHz */
+       {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}    /* 133MHz */
+};
+
+
+static u8 scc_ide_inb(unsigned long port)
+{
+       u32 data = in_be32((void*)port);
+       return (u8)data;
+}
+
+static u16 scc_ide_inw(unsigned long port)
+{
+       u32 data = in_be32((void*)port);
+       return (u16)data;
+}
+
+static void scc_ide_insw(unsigned long port, void *addr, u32 count)
+{
+       u16 *ptr = (u16 *)addr;
+       while (count--) {
+               *ptr++ = le16_to_cpu(in_be32((void*)port));
+       }
+}
+
+static void scc_ide_insl(unsigned long port, void *addr, u32 count)
+{
+       u16 *ptr = (u16 *)addr;
+       while (count--) {
+               *ptr++ = le16_to_cpu(in_be32((void*)port));
+               *ptr++ = le16_to_cpu(in_be32((void*)port));
+       }
+}
+
+static void scc_ide_outb(u8 addr, unsigned long port)
+{
+       out_be32((void*)port, addr);
+}
+
+static void scc_ide_outw(u16 addr, unsigned long port)
+{
+       out_be32((void*)port, addr);
+}
+
+static void
+scc_ide_outbsync(ide_drive_t * drive, u8 addr, unsigned long port)
+{
+       ide_hwif_t *hwif = HWIF(drive);
+
+       out_be32((void*)port, addr);
+       __asm__ __volatile__("eieio":::"memory");
+       in_be32((void*)(hwif->dma_base + 0x01c));
+       __asm__ __volatile__("eieio":::"memory");
+}
+
+static void
+scc_ide_outsw(unsigned long port, void *addr, u32 count)
+{
+       u16 *ptr = (u16 *)addr;
+       while (count--) {
+               out_be32((void*)port, cpu_to_le16(*ptr++));
+       }
+}
+
+static void
+scc_ide_outsl(unsigned long port, void *addr, u32 count)
+{
+       u16 *ptr = (u16 *)addr;
+       while (count--) {
+               out_be32((void*)port, cpu_to_le16(*ptr++));
+               out_be32((void*)port, cpu_to_le16(*ptr++));
+       }
+}
+
+/**
+ *     scc_ratemask    -       Compute available modes
+ *     @drive: IDE drive
+ *
+ *     Compute the available speeds for the devices on the interface.
+ *     Enforce UDMA33 as a limit if there is no 80pin cable present.
+ */
+
+static u8 scc_ratemask(ide_drive_t *drive)
+{
+       u8 mode = 4;
+
+       if (!eighty_ninty_three(drive))
+               mode = min(mode, (u8)1);
+       return mode;
+}
+
+/**
+ *     scc_tuneproc    -       tune a drive PIO mode
+ *     @drive: drive to tune
+ *     @mode_wanted: the target operating mode
+ *
+ *     Load the timing settings for this device mode into the
+ *     controller.
+ */
+
+static void scc_tuneproc(ide_drive_t *drive, byte mode_wanted)
+{
+       ide_hwif_t *hwif = HWIF(drive);
+       struct scc_ports *ports = ide_get_hwifdata(hwif);
+       unsigned long ctl_base = ports->ctl;
+       unsigned long cckctrl_port = ctl_base + 0xff0;
+       unsigned long piosht_port = ctl_base + 0x000;
+       unsigned long pioct_port = ctl_base + 0x004;
+       unsigned long reg;
+       unsigned char speed = XFER_PIO_0;
+       int offset;
+
+       mode_wanted = ide_get_best_pio_mode(drive, mode_wanted, 4, NULL);
+       switch (mode_wanted) {
+       case 4:
+               speed = XFER_PIO_4;
+               break;
+       case 3:
+               speed = XFER_PIO_3;
+               break;
+       case 2:
+               speed = XFER_PIO_2;
+               break;
+       case 1:
+               speed = XFER_PIO_1;
+               break;
+       case 0:
+       default:
+               speed = XFER_PIO_0;
+               break;
+       }
+
+       reg = in_be32((void __iomem *)cckctrl_port);
+       if (reg & CCKCTRL_ATACLKOEN) {
+               offset = 1; /* 133MHz */
+       } else {
+               offset = 0; /* 100MHz */
+       }
+       reg = JCHSTtbl[offset][mode_wanted] << 16 | JCHHTtbl[offset][mode_wanted];
+       out_be32((void __iomem *)piosht_port, reg);
+       reg = JCHCTtbl[offset][mode_wanted];
+       out_be32((void __iomem *)pioct_port, reg);
+
+       ide_config_drive_speed(drive, speed);
+}
+
+/**
+ *     scc_tune_chipset        -       tune a drive DMA mode
+ *     @drive: Drive to set up
+ *     @xferspeed: speed we want to achieve
+ *
+ *     Load the timing settings for this device mode into the
+ *     controller.
+ */
+
+static int scc_tune_chipset(ide_drive_t *drive, byte xferspeed)
+{
+       ide_hwif_t *hwif = HWIF(drive);
+       u8 speed = ide_rate_filter(scc_ratemask(drive), xferspeed);
+       struct scc_ports *ports = ide_get_hwifdata(hwif);
+       unsigned long ctl_base = ports->ctl;
+       unsigned long cckctrl_port = ctl_base + 0xff0;
+       unsigned long mdmact_port = ctl_base + 0x008;
+       unsigned long mcrcst_port = ctl_base + 0x00c;
+       unsigned long sdmact_port = ctl_base + 0x010;
+       unsigned long scrcst_port = ctl_base + 0x014;
+       unsigned long udenvt_port = ctl_base + 0x018;
+       unsigned long tdvhsel_port   = ctl_base + 0x020;
+       int is_slave = (&hwif->drives[1] == drive);
+       int offset, idx;
+       unsigned long reg;
+       unsigned long jcactsel;
+
+       reg = in_be32((void __iomem *)cckctrl_port);
+       if (reg & CCKCTRL_ATACLKOEN) {
+               offset = 1; /* 133MHz */
+       } else {
+               offset = 0; /* 100MHz */
+       }
+
+       switch (speed) {
+       case XFER_UDMA_6:
+               idx = 6;
+               break;
+       case XFER_UDMA_5:
+               idx = 5;
+               break;
+       case XFER_UDMA_4:
+               idx = 4;
+               break;
+       case XFER_UDMA_3:
+               idx = 3;
+               break;
+       case XFER_UDMA_2:
+               idx = 2;
+               break;
+       case XFER_UDMA_1:
+               idx = 1;
+               break;
+       case XFER_UDMA_0:
+               idx = 0;
+               break;
+       default:
+               return 1;
+       }
+
+       jcactsel = JCACTSELtbl[offset][idx];
+       if (is_slave) {
+               out_be32((void __iomem *)sdmact_port, JCHDCTxtbl[offset][idx]);
+               out_be32((void __iomem *)scrcst_port, JCSTWTxtbl[offset][idx]);
+               jcactsel = jcactsel << 2;
+               out_be32((void __iomem *)tdvhsel_port, (in_be32((void __iomem *)tdvhsel_port) & ~TDVHSEL_SLAVE) | jcactsel);
+       } else {
+               out_be32((void __iomem *)mdmact_port, JCHDCTxtbl[offset][idx]);
+               out_be32((void __iomem *)mcrcst_port, JCSTWTxtbl[offset][idx]);
+               out_be32((void __iomem *)tdvhsel_port, (in_be32((void __iomem *)tdvhsel_port) & ~TDVHSEL_MASTER) | jcactsel);
+       }
+       reg = JCTSStbl[offset][idx] << 16 | JCENVTtbl[offset][idx];
+       out_be32((void __iomem *)udenvt_port, reg);
+
+       return ide_config_drive_speed(drive, speed);
+}
+
+/**
+ *     scc_config_chipset_for_dma      -       configure for DMA
+ *     @drive: drive to configure
+ *
+ *     Called by scc_config_drive_for_dma().
+ */
+
+static int scc_config_chipset_for_dma(ide_drive_t *drive)
+{
+       u8 speed = ide_dma_speed(drive, scc_ratemask(drive));
+
+       if (!speed)
+               return 0;
+
+       if (scc_tune_chipset(drive, speed))
+               return 0;
+
+       return ide_dma_enable(drive);
+}
+
+/**
+ *     scc_configure_drive_for_dma     -       set up for DMA transfers
+ *     @drive: drive we are going to set up
+ *
+ *     Set up the drive for DMA, tune the controller and drive as
+ *     required.
+ *      If the drive isn't suitable for DMA or we hit other problems
+ *      then we will drop down to PIO and set up PIO appropriately.
+ *      (return 1)
+ */
+
+static int scc_config_drive_for_dma(ide_drive_t *drive)
+{
+       if (ide_use_dma(drive) && scc_config_chipset_for_dma(drive))
+               return 0;
+
+       if (ide_use_fast_pio(drive))
+               scc_tuneproc(drive, 4);
+
+       return -1;
+}
+
+/**
+ *     scc_ide_dma_setup       -       begin a DMA phase
+ *     @drive: target device
+ *
+ *     Build an IDE DMA PRD (IDE speak for scatter gather table)
+ *     and then set up the DMA transfer registers.
+ *
+ *     Returns 0 on success. If a PIO fallback is required then 1
+ *     is returned.
+ */
+
+static int scc_dma_setup(ide_drive_t *drive)
+{
+       ide_hwif_t *hwif = drive->hwif;
+       struct request *rq = HWGROUP(drive)->rq;
+       unsigned int reading;
+       u8 dma_stat;
+
+       if (rq_data_dir(rq))
+               reading = 0;
+       else
+               reading = 1 << 3;
+
+       /* fall back to pio! */
+       if (!ide_build_dmatable(drive, rq)) {
+               ide_map_sg(drive, rq);
+               return 1;
+       }
+
+       /* PRD table */
+       out_be32((void __iomem *)hwif->dma_prdtable, hwif->dmatable_dma);
+
+       /* specify r/w */
+       out_be32((void __iomem *)hwif->dma_command, reading);
+
+       /* read dma_status for INTR & ERROR flags */
+       dma_stat = in_be32((void __iomem *)hwif->dma_status);
+
+       /* clear INTR & ERROR flags */
+       out_be32((void __iomem *)hwif->dma_status, dma_stat|6);
+       drive->waiting_for_dma = 1;
+       return 0;
+}
+
+
+/**
+ *     scc_ide_dma_end -       Stop DMA
+ *     @drive: IDE drive
+ *
+ *     Check and clear INT Status register.
+ *      Then call __ide_dma_end().
+ */
+
+static int scc_ide_dma_end(ide_drive_t * drive)
+{
+       ide_hwif_t *hwif = HWIF(drive);
+       unsigned long intsts_port = hwif->dma_base + 0x014;
+       u32 reg;
+
+       while (1) {
+               reg = in_be32((void __iomem *)intsts_port);
+
+               if (reg & INTSTS_SERROR) {
+                       printk(KERN_WARNING "%s: SERROR\n", SCC_PATA_NAME);
+                       out_be32((void __iomem *)intsts_port, INTSTS_SERROR|INTSTS_BMSINT);
+
+                       out_be32((void __iomem *)hwif->dma_command, in_be32((void __iomem *)hwif->dma_command) & ~QCHCD_IOS_SS);
+                       continue;
+               }
+
+               if (reg & INTSTS_PRERR) {
+                       u32 maea0, maec0;
+                       unsigned long ctl_base = hwif->config_data;
+
+                       maea0 = in_be32((void __iomem *)(ctl_base + 0xF50));
+                       maec0 = in_be32((void __iomem *)(ctl_base + 0xF54));
+
+                       printk(KERN_WARNING "%s: PRERR [addr:%x cmd:%x]\n", SCC_PATA_NAME, maea0, maec0);
+
+                       out_be32((void __iomem *)intsts_port, INTSTS_PRERR|INTSTS_BMSINT);
+
+                       out_be32((void __iomem *)hwif->dma_command, in_be32((void __iomem *)hwif->dma_command) & ~QCHCD_IOS_SS);
+                       continue;
+               }
+
+               if (reg & INTSTS_RERR) {
+                       printk(KERN_WARNING "%s: Response Error\n", SCC_PATA_NAME);
+                       out_be32((void __iomem *)intsts_port, INTSTS_RERR|INTSTS_BMSINT);
+
+                       out_be32((void __iomem *)hwif->dma_command, in_be32((void __iomem *)hwif->dma_command) & ~QCHCD_IOS_SS);
+                       continue;
+               }
+
+               if (reg & INTSTS_ICERR) {
+                       out_be32((void __iomem *)hwif->dma_command, in_be32((void __iomem *)hwif->dma_command) & ~QCHCD_IOS_SS);
+
+                       printk(KERN_WARNING "%s: Illegal Configuration\n", SCC_PATA_NAME);
+                       out_be32((void __iomem *)intsts_port, INTSTS_ICERR|INTSTS_BMSINT);
+                       continue;
+               }
+
+               if (reg & INTSTS_BMSINT) {
+                       printk(KERN_WARNING "%s: Internal Bus Error\n", SCC_PATA_NAME);
+                       out_be32((void __iomem *)intsts_port, INTSTS_BMSINT);
+
+                       ide_do_reset(drive);
+                       continue;
+               }
+
+               if (reg & INTSTS_BMHE) {
+                       out_be32((void __iomem *)intsts_port, INTSTS_BMHE);
+                       continue;
+               }
+
+               if (reg & INTSTS_ACTEINT) {
+                       out_be32((void __iomem *)intsts_port, INTSTS_ACTEINT);
+                       continue;
+               }
+
+               if (reg & INTSTS_IOIRQS) {
+                       out_be32((void __iomem *)intsts_port, INTSTS_IOIRQS);
+                       continue;
+               }
+               break;
+       }
+
+       return __ide_dma_end(drive);
+}
+
+/**
+ *     setup_mmio_scc  -       map CTRL/BMID region
+ *     @dev: PCI device we are configuring
+ *     @name: device name
+ *
+ */
+
+static int setup_mmio_scc (struct pci_dev *dev, const char *name)
+{
+       unsigned long ctl_base = pci_resource_start(dev, 0);
+       unsigned long dma_base = pci_resource_start(dev, 1);
+       unsigned long ctl_size = pci_resource_len(dev, 0);
+       unsigned long dma_size = pci_resource_len(dev, 1);
+       void *ctl_addr;
+       void *dma_addr;
+       int i;
+
+       for (i = 0; i < MAX_HWIFS; i++) {
+               if (scc_ports[i].ctl == 0)
+                       break;
+       }
+       if (i >= MAX_HWIFS)
+               return -ENOMEM;
+
+       if (!request_mem_region(ctl_base, ctl_size, name)) {
+               printk(KERN_WARNING "%s: IDE controller MMIO ports not available.\n", SCC_PATA_NAME);
+               goto fail_0;
+       }
+
+       if (!request_mem_region(dma_base, dma_size, name)) {
+               printk(KERN_WARNING "%s: IDE controller MMIO ports not available.\n", SCC_PATA_NAME);
+               goto fail_1;
+       }
+
+       if ((ctl_addr = ioremap(ctl_base, ctl_size)) == NULL)
+               goto fail_2;
+
+       if ((dma_addr = ioremap(dma_base, dma_size)) == NULL)
+               goto fail_3;
+
+       pci_set_master(dev);
+       scc_ports[i].ctl = (unsigned long)ctl_addr;
+       scc_ports[i].dma = (unsigned long)dma_addr;
+       pci_set_drvdata(dev, (void *) &scc_ports[i]);
+
+       return 1;
+
+ fail_3:
+       iounmap(ctl_addr);
+ fail_2:
+       release_mem_region(dma_base, dma_size);
+ fail_1:
+       release_mem_region(ctl_base, ctl_size);
+ fail_0:
+       return -ENOMEM;
+}
+
+/**
+ *     init_setup_scc  -       set up an SCC PATA Controller
+ *     @dev: PCI device
+ *     @d: IDE PCI device
+ *
+ *     Perform the initial set up for this device.
+ */
+
+static int __devinit init_setup_scc(struct pci_dev *dev, ide_pci_device_t *d)
+{
+       unsigned long ctl_base;
+       unsigned long dma_base;
+       unsigned long cckctrl_port;
+       unsigned long intmask_port;
+       unsigned long mode_port;
+       unsigned long ecmode_port;
+       unsigned long dma_status_port;
+       u32 reg = 0;
+       struct scc_ports *ports;
+       int rc;
+
+       rc = setup_mmio_scc(dev, d->name);
+       if (rc < 0) {
+               return rc;
+       }
+
+       ports = pci_get_drvdata(dev);
+       ctl_base = ports->ctl;
+       dma_base = ports->dma;
+       cckctrl_port = ctl_base + 0xff0;
+       intmask_port = dma_base + 0x010;
+       mode_port = ctl_base + 0x024;
+       ecmode_port = ctl_base + 0xf00;
+       dma_status_port = dma_base + 0x004;
+
+       /* controller initialization */
+       reg = 0;
+       out_be32((void*)cckctrl_port, reg);
+       reg |= CCKCTRL_ATACLKOEN;
+       out_be32((void*)cckctrl_port, reg);
+       reg |= CCKCTRL_LCLKEN | CCKCTRL_OCLKEN;
+       out_be32((void*)cckctrl_port, reg);
+       reg |= CCKCTRL_CRST;
+       out_be32((void*)cckctrl_port, reg);
+
+       for (;;) {
+               reg = in_be32((void*)cckctrl_port);
+               if (reg & CCKCTRL_CRST)
+                       break;
+               udelay(5000);
+       }
+
+       reg |= CCKCTRL_ATARESET;
+       out_be32((void*)cckctrl_port, reg);
+
+       out_be32((void*)ecmode_port, ECMODE_VALUE);
+       out_be32((void*)mode_port, MODE_JCUSFEN);
+       out_be32((void*)intmask_port, INTMASK_MSK);
+
+       return ide_setup_pci_device(dev, d);
+}
+
+/**
+ *     init_mmio_iops_scc      -       set up the iops for MMIO
+ *     @hwif: interface to set up
+ *
+ */
+
+static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif)
+{
+       struct pci_dev *dev = hwif->pci_dev;
+       struct scc_ports *ports = pci_get_drvdata(dev);
+       unsigned long dma_base = ports->dma;
+
+       ide_set_hwifdata(hwif, ports);
+
+       hwif->INB = scc_ide_inb;
+       hwif->INW = scc_ide_inw;
+       hwif->INSW = scc_ide_insw;
+       hwif->INSL = scc_ide_insl;
+       hwif->OUTB = scc_ide_outb;
+       hwif->OUTBSYNC = scc_ide_outbsync;
+       hwif->OUTW = scc_ide_outw;
+       hwif->OUTSW = scc_ide_outsw;
+       hwif->OUTSL = scc_ide_outsl;
+
+       hwif->io_ports[IDE_DATA_OFFSET] = dma_base + 0x20;
+       hwif->io_ports[IDE_ERROR_OFFSET] = dma_base + 0x24;
+       hwif->io_ports[IDE_NSECTOR_OFFSET] = dma_base + 0x28;
+       hwif->io_ports[IDE_SECTOR_OFFSET] = dma_base + 0x2c;
+       hwif->io_ports[IDE_LCYL_OFFSET] = dma_base + 0x30;
+       hwif->io_ports[IDE_HCYL_OFFSET] = dma_base + 0x34;
+       hwif->io_ports[IDE_SELECT_OFFSET] = dma_base + 0x38;
+       hwif->io_ports[IDE_STATUS_OFFSET] = dma_base + 0x3c;
+       hwif->io_ports[IDE_CONTROL_OFFSET] = dma_base + 0x40;
+
+       hwif->irq = hwif->pci_dev->irq;
+       hwif->dma_base = dma_base;
+       hwif->config_data = ports->ctl;
+       hwif->mmio = 1;
+}
+
+/**
+ *     init_iops_scc   -       set up iops
+ *     @hwif: interface to set up
+ *
+ *     Do the basic setup for the SCC hardware interface
+ *     and then do the MMIO setup.
+ */
+
+static void __devinit init_iops_scc(ide_hwif_t *hwif)
+{
+       struct pci_dev *dev =  hwif->pci_dev;
+       hwif->hwif_data = NULL;
+       if (pci_get_drvdata(dev) == NULL)
+               return;
+       init_mmio_iops_scc(hwif);
+}
+
+/**
+ *     init_hwif_scc   -       set up hwif
+ *     @hwif: interface to set up
+ *
+ *     We do the basic set up of the interface structure. The SCC
+ *     requires several custom handlers so we override the default
+ *     ide DMA handlers appropriately.
+ */
+
+static void __devinit init_hwif_scc(ide_hwif_t *hwif)
+{
+       struct scc_ports *ports = ide_get_hwifdata(hwif);
+
+       ports->hwif_id = hwif->index;
+
+       hwif->dma_command = hwif->dma_base;
+       hwif->dma_status = hwif->dma_base + 0x04;
+       hwif->dma_prdtable = hwif->dma_base + 0x08;
+
+       /* PTERADD */
+       out_be32((void __iomem *)(hwif->dma_base + 0x018), hwif->dmatable_dma);
+
+       hwif->dma_setup = scc_dma_setup;
+       hwif->ide_dma_end = scc_ide_dma_end;
+       hwif->speedproc = scc_tune_chipset;
+       hwif->tuneproc = scc_tuneproc;
+       hwif->ide_dma_check = scc_config_drive_for_dma;
+
+       hwif->drives[0].autotune = IDE_TUNE_AUTO;
+       hwif->drives[1].autotune = IDE_TUNE_AUTO;
+
+       if (in_be32((void __iomem *)(hwif->config_data + 0xff0)) & CCKCTRL_ATACLKOEN) {
+               hwif->ultra_mask = 0x7f; /* 133MHz */
+       } else {
+               hwif->ultra_mask = 0x3f; /* 100MHz */
+       }
+       hwif->mwdma_mask = 0x00;
+       hwif->swdma_mask = 0x00;
+       hwif->atapi_dma = 1;
+
+       /* we support 80c cable only. */
+       hwif->udma_four = 1;
+
+       hwif->autodma = 0;
+       if (!noautodma)
+               hwif->autodma = 1;
+       hwif->drives[0].autodma = hwif->autodma;
+       hwif->drives[1].autodma = hwif->autodma;
+}
+
+#define DECLARE_SCC_DEV(name_str)                      \
+  {                                                    \
+      .name            = name_str,                     \
+      .init_setup      = init_setup_scc,               \
+      .init_iops       = init_iops_scc,                \
+      .init_hwif       = init_hwif_scc,                \
+      .channels        = 1,                                    \
+      .autodma = AUTODMA,                              \
+      .bootable        = ON_BOARD,                             \
+  }
+
+static ide_pci_device_t scc_chipsets[] __devinitdata = {
+       /* 0 */ DECLARE_SCC_DEV("sccIDE"),
+};
+
+/**
+ *     scc_init_one    -       pci layer discovery entry
+ *     @dev: PCI device
+ *     @id: ident table entry
+ *
+ *     Called by the PCI code when it finds an SCC PATA controller.
+ *     We then use the IDE PCI generic helper to do most of the work.
+ */
+
+static int __devinit scc_init_one(struct pci_dev *dev, const struct pci_device_id *id)
+{
+       ide_pci_device_t *d = &scc_chipsets[id->driver_data];
+       return d->init_setup(dev, d);
+}
+
+/**
+ *     scc_remove      -       pci layer remove entry
+ *     @dev: PCI device
+ *
+ *     Called by the PCI code when it removes an SCC PATA controller.
+ */
+
+static void __devexit scc_remove(struct pci_dev *dev)
+{
+       struct scc_ports *ports = pci_get_drvdata(dev);
+       ide_hwif_t *hwif = &ide_hwifs[ports->hwif_id];
+       unsigned long ctl_base = pci_resource_start(dev, 0);
+       unsigned long dma_base = pci_resource_start(dev, 1);
+       unsigned long ctl_size = pci_resource_len(dev, 0);
+       unsigned long dma_size = pci_resource_len(dev, 1);
+
+       if (hwif->dmatable_cpu) {
+               pci_free_consistent(hwif->pci_dev,
+                                   PRD_ENTRIES * PRD_BYTES,
+                                   hwif->dmatable_cpu,
+                                   hwif->dmatable_dma);
+               hwif->dmatable_cpu = NULL;
+       }
+
+       ide_unregister(hwif->index);
+
+       hwif->chipset = ide_unknown;
+       iounmap((void*)ports->dma);
+       iounmap((void*)ports->ctl);
+       release_mem_region(dma_base, dma_size);
+       release_mem_region(ctl_base, ctl_size);
+       memset(ports, 0, sizeof(*ports));
+}
+
+static struct pci_device_id scc_pci_tbl[] = {
+       { PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_SCC_ATA,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { 0, },
+};
+MODULE_DEVICE_TABLE(pci, scc_pci_tbl);
+
+static struct pci_driver driver = {
+       .name = "SCC IDE",
+       .id_table = scc_pci_tbl,
+       .probe = scc_init_one,
+       .remove = scc_remove,
+};
+
+static int scc_ide_init(void)
+{
+       return ide_pci_register_driver(&driver);
+}
+
+module_init(scc_ide_init);
+/* -- No exit code?
+static void scc_ide_exit(void)
+{
+       ide_pci_unregister_driver(&driver);
+}
+module_exit(scc_ide_exit);
+ */
+
+
+MODULE_DESCRIPTION("PCI driver module for Toshiba SCC IDE");
+MODULE_LICENSE("GPL");
index 8f207508ed1dae62dc4ba417df8a5cb14089d62a..46878fef136c24d091fa05146c54cd8e7b873c10 100644 (file)
        _IO  ('#', 0x28)
 #define RAW1394_IOC_ISO_RECV_FLUSH             \
        _IO  ('#', 0x29)
+#define RAW1394_IOC_GET_CYCLE_TIMER            \
+       _IOR ('#', 0x30, struct raw1394_cycle_timer)
 
 #endif /* __IEEE1394_IOCTL_H */
index 1521e57e124bb63119b705804f8ff81d41ed77ed..d791d08c743ce22d100ad34e440f3cdb932ca30f 100644 (file)
 #include <linux/skbuff.h>
 #include <linux/suspend.h>
 #include <linux/kthread.h>
+#include <linux/preempt.h>
+#include <linux/time.h>
 
+#include <asm/system.h>
 #include <asm/byteorder.h>
 
 #include "ieee1394_types.h"
@@ -186,6 +189,45 @@ int hpsb_reset_bus(struct hpsb_host *host, int type)
        }
 }
 
+/**
+ * hpsb_read_cycle_timer - read cycle timer register and system time
+ * @host: host whose isochronous cycle timer register is read
+ * @cycle_timer: address of bitfield to return the register contents
+ * @local_time: address to return the system time
+ *
+ * The format of * @cycle_timer, is described in OHCI 1.1 clause 5.13. This
+ * format is also read from non-OHCI controllers. * @local_time contains the
+ * system time in microseconds since the Epoch, read at the moment when the
+ * cycle timer was read.
+ *
+ * Return value: 0 for success or error number otherwise.
+ */
+int hpsb_read_cycle_timer(struct hpsb_host *host, u32 *cycle_timer,
+                         u64 *local_time)
+{
+       int ctr;
+       struct timeval tv;
+       unsigned long flags;
+
+       if (!host || !cycle_timer || !local_time)
+               return -EINVAL;
+
+       preempt_disable();
+       local_irq_save(flags);
+
+       ctr = host->driver->devctl(host, GET_CYCLE_COUNTER, 0);
+       if (ctr)
+               do_gettimeofday(&tv);
+
+       local_irq_restore(flags);
+       preempt_enable();
+
+       if (!ctr)
+               return -EIO;
+       *cycle_timer = ctr;
+       *local_time = tv.tv_sec * 1000000ULL + tv.tv_usec;
+       return 0;
+}
 
 int hpsb_bus_reset(struct hpsb_host *host)
 {
@@ -1190,6 +1232,7 @@ EXPORT_SYMBOL(hpsb_alloc_packet);
 EXPORT_SYMBOL(hpsb_free_packet);
 EXPORT_SYMBOL(hpsb_send_packet);
 EXPORT_SYMBOL(hpsb_reset_bus);
+EXPORT_SYMBOL(hpsb_read_cycle_timer);
 EXPORT_SYMBOL(hpsb_bus_reset);
 EXPORT_SYMBOL(hpsb_selfid_received);
 EXPORT_SYMBOL(hpsb_selfid_complete);
index 536ba3f580fd49995fc812353167d8cc65307570..bd29d8ef5bbd9c58c7a698901c86558421367e2f 100644 (file)
@@ -127,6 +127,9 @@ int hpsb_send_packet_and_wait(struct hpsb_packet *packet);
  * progress, 0 otherwise. */
 int hpsb_reset_bus(struct hpsb_host *host, int type);
 
+int hpsb_read_cycle_timer(struct hpsb_host *host, u32 *cycle_timer,
+                         u64 *local_time);
+
 /*
  * The following functions are exported for host driver module usage.  All of
  * them are safe to use in interrupt contexts, although some are quite
index ba9faeff4793a0a5891493380ff6fb3b5e3278fb..c5ace190bfe6719d78b290276ea92997a76b6563 100644 (file)
@@ -1681,7 +1681,8 @@ static int nodemgr_host_thread(void *__hi)
        for (;;) {
                /* Sleep until next bus reset */
                set_current_state(TASK_INTERRUPTIBLE);
-               if (get_hpsb_generation(host) == generation)
+               if (get_hpsb_generation(host) == generation &&
+                   !kthread_should_stop())
                        schedule();
                __set_current_state(TASK_RUNNING);
 
index aa9ca8385ec769304e0bc928c51d52be92641aa6..bb897a37d9f778cf2f64661c06069461d5d63fc5 100644 (file)
@@ -2669,6 +2669,18 @@ static void raw1394_iso_shutdown(struct file_info *fi)
        fi->iso_state = RAW1394_ISO_INACTIVE;
 }
 
+static int raw1394_read_cycle_timer(struct file_info *fi, void __user * uaddr)
+{
+       struct raw1394_cycle_timer ct;
+       int err;
+
+       err = hpsb_read_cycle_timer(fi->host, &ct.cycle_timer, &ct.local_time);
+       if (!err)
+               if (copy_to_user(uaddr, &ct, sizeof(ct)))
+                       err = -EFAULT;
+       return err;
+}
+
 /* mmap the rawiso xmit/recv buffer */
 static int raw1394_mmap(struct file *file, struct vm_area_struct *vma)
 {
@@ -2777,6 +2789,14 @@ static int raw1394_ioctl(struct inode *inode, struct file *file,
                break;
        }
 
+       /* state-independent commands */
+       switch(cmd) {
+       case RAW1394_IOC_GET_CYCLE_TIMER:
+               return raw1394_read_cycle_timer(fi, argp);
+       default:
+               break;
+       }
+
        return -EINVAL;
 }
 
index 35bfc38f013c25f681dda5f3a70c2fbfed6c1819..7bd22ee1afbb1d56a2a71e9c86cd86b3ad5bfc43 100644 (file)
@@ -178,4 +178,14 @@ struct raw1394_iso_status {
        __s16 xmit_cycle;
 };
 
+/* argument to RAW1394_IOC_GET_CYCLE_TIMER ioctl */
+struct raw1394_cycle_timer {
+       /* contents of Isochronous Cycle Timer register,
+          as in OHCI 1.1 clause 5.13 (also with non-OHCI hosts) */
+       __u32 cycle_timer;
+
+       /* local time in microseconds since Epoch,
+          simultaneously read with cycle timer */
+       __u64 local_time;
+};
 #endif /* IEEE1394_RAW1394_H */
index 50fb1cd447b76d80de09d6f565e737cd37101af5..189e5d4b9b17ed271027e2c015b252f929fbd32d 100644 (file)
@@ -12,7 +12,7 @@ ib_core-y :=                  packer.o ud_header.o verbs.o sysfs.o \
 
 ib_mad-y :=                    mad.o smi.o agent.o mad_rmpp.o
 
-ib_sa-y :=                     sa_query.o
+ib_sa-y :=                     sa_query.o multicast.o
 
 ib_cm-y :=                     cm.o
 
index db88e609bf429f6a1fb9f37527f0c21651d14320..f8d69b3fa30796f8c4258a858a3664c0f5bff647 100644 (file)
@@ -71,6 +71,7 @@ static struct workqueue_struct *cma_wq;
 static DEFINE_IDR(sdp_ps);
 static DEFINE_IDR(tcp_ps);
 static DEFINE_IDR(udp_ps);
+static DEFINE_IDR(ipoib_ps);
 static int next_port;
 
 struct cma_device {
@@ -116,6 +117,7 @@ struct rdma_id_private {
        struct list_head        list;
        struct list_head        listen_list;
        struct cma_device       *cma_dev;
+       struct list_head        mc_list;
 
        enum cma_state          state;
        spinlock_t              lock;
@@ -134,10 +136,23 @@ struct rdma_id_private {
        } cm_id;
 
        u32                     seq_num;
+       u32                     qkey;
        u32                     qp_num;
        u8                      srq;
 };
 
+struct cma_multicast {
+       struct rdma_id_private *id_priv;
+       union {
+               struct ib_sa_multicast *ib;
+       } multicast;
+       struct list_head        list;
+       void                    *context;
+       struct sockaddr         addr;
+       u8                      pad[sizeof(struct sockaddr_in6) -
+                                   sizeof(struct sockaddr)];
+};
+
 struct cma_work {
        struct work_struct      work;
        struct rdma_id_private  *id;
@@ -243,6 +258,11 @@ static inline void sdp_set_ip_ver(struct sdp_hh *hh, u8 ip_ver)
        hh->ip_version = (ip_ver << 4) | (hh->ip_version & 0xF);
 }
 
+static inline int cma_is_ud_ps(enum rdma_port_space ps)
+{
+       return (ps == RDMA_PS_UDP || ps == RDMA_PS_IPOIB);
+}
+
 static void cma_attach_to_dev(struct rdma_id_private *id_priv,
                              struct cma_device *cma_dev)
 {
@@ -265,19 +285,41 @@ static void cma_detach_from_dev(struct rdma_id_private *id_priv)
        id_priv->cma_dev = NULL;
 }
 
+static int cma_set_qkey(struct ib_device *device, u8 port_num,
+                       enum rdma_port_space ps,
+                       struct rdma_dev_addr *dev_addr, u32 *qkey)
+{
+       struct ib_sa_mcmember_rec rec;
+       int ret = 0;
+
+       switch (ps) {
+       case RDMA_PS_UDP:
+               *qkey = RDMA_UDP_QKEY;
+               break;
+       case RDMA_PS_IPOIB:
+               ib_addr_get_mgid(dev_addr, &rec.mgid);
+               ret = ib_sa_get_mcmember_rec(device, port_num, &rec.mgid, &rec);
+               *qkey = be32_to_cpu(rec.qkey);
+               break;
+       default:
+               break;
+       }
+       return ret;
+}
+
 static int cma_acquire_dev(struct rdma_id_private *id_priv)
 {
-       enum rdma_node_type dev_type = id_priv->id.route.addr.dev_addr.dev_type;
+       struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr;
        struct cma_device *cma_dev;
        union ib_gid gid;
        int ret = -ENODEV;
 
-       switch (rdma_node_get_transport(dev_type)) {
+       switch (rdma_node_get_transport(dev_addr->dev_type)) {
        case RDMA_TRANSPORT_IB:
-               ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr, &gid);
+               ib_addr_get_sgid(dev_addr, &gid);
                break;
        case RDMA_TRANSPORT_IWARP:
-               iw_addr_get_sgid(&id_priv->id.route.addr.dev_addr, &gid);
+               iw_addr_get_sgid(dev_addr, &gid);
                break;
        default:
                return -ENODEV;
@@ -287,7 +329,12 @@ static int cma_acquire_dev(struct rdma_id_private *id_priv)
                ret = ib_find_cached_gid(cma_dev->device, &gid,
                                         &id_priv->id.port_num, NULL);
                if (!ret) {
-                       cma_attach_to_dev(id_priv, cma_dev);
+                       ret = cma_set_qkey(cma_dev->device,
+                                          id_priv->id.port_num,
+                                          id_priv->id.ps, dev_addr,
+                                          &id_priv->qkey);
+                       if (!ret)
+                               cma_attach_to_dev(id_priv, cma_dev);
                        break;
                }
        }
@@ -325,40 +372,50 @@ struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler,
        init_waitqueue_head(&id_priv->wait_remove);
        atomic_set(&id_priv->dev_remove, 0);
        INIT_LIST_HEAD(&id_priv->listen_list);
+       INIT_LIST_HEAD(&id_priv->mc_list);
        get_random_bytes(&id_priv->seq_num, sizeof id_priv->seq_num);
 
        return &id_priv->id;
 }
 EXPORT_SYMBOL(rdma_create_id);
 
-static int cma_init_ib_qp(struct rdma_id_private *id_priv, struct ib_qp *qp)
+static int cma_init_ud_qp(struct rdma_id_private *id_priv, struct ib_qp *qp)
 {
        struct ib_qp_attr qp_attr;
-       struct rdma_dev_addr *dev_addr;
-       int ret;
+       int qp_attr_mask, ret;
 
-       dev_addr = &id_priv->id.route.addr.dev_addr;
-       ret = ib_find_cached_pkey(id_priv->id.device, id_priv->id.port_num,
-                                 ib_addr_get_pkey(dev_addr),
-                                 &qp_attr.pkey_index);
+       qp_attr.qp_state = IB_QPS_INIT;
+       ret = rdma_init_qp_attr(&id_priv->id, &qp_attr, &qp_attr_mask);
        if (ret)
                return ret;
 
-       qp_attr.qp_state = IB_QPS_INIT;
-       qp_attr.qp_access_flags = 0;
-       qp_attr.port_num = id_priv->id.port_num;
-       return ib_modify_qp(qp, &qp_attr, IB_QP_STATE | IB_QP_ACCESS_FLAGS |
-                                         IB_QP_PKEY_INDEX | IB_QP_PORT);
+       ret = ib_modify_qp(qp, &qp_attr, qp_attr_mask);
+       if (ret)
+               return ret;
+
+       qp_attr.qp_state = IB_QPS_RTR;
+       ret = ib_modify_qp(qp, &qp_attr, IB_QP_STATE);
+       if (ret)
+               return ret;
+
+       qp_attr.qp_state = IB_QPS_RTS;
+       qp_attr.sq_psn = 0;
+       ret = ib_modify_qp(qp, &qp_attr, IB_QP_STATE | IB_QP_SQ_PSN);
+
+       return ret;
 }
 
-static int cma_init_iw_qp(struct rdma_id_private *id_priv, struct ib_qp *qp)
+static int cma_init_conn_qp(struct rdma_id_private *id_priv, struct ib_qp *qp)
 {
        struct ib_qp_attr qp_attr;
+       int qp_attr_mask, ret;
 
        qp_attr.qp_state = IB_QPS_INIT;
-       qp_attr.qp_access_flags = IB_ACCESS_LOCAL_WRITE;
+       ret = rdma_init_qp_attr(&id_priv->id, &qp_attr, &qp_attr_mask);
+       if (ret)
+               return ret;
 
-       return ib_modify_qp(qp, &qp_attr, IB_QP_STATE | IB_QP_ACCESS_FLAGS);
+       return ib_modify_qp(qp, &qp_attr, qp_attr_mask);
 }
 
 int rdma_create_qp(struct rdma_cm_id *id, struct ib_pd *pd,
@@ -376,18 +433,10 @@ int rdma_create_qp(struct rdma_cm_id *id, struct ib_pd *pd,
        if (IS_ERR(qp))
                return PTR_ERR(qp);
 
-       switch (rdma_node_get_transport(id->device->node_type)) {
-       case RDMA_TRANSPORT_IB:
-               ret = cma_init_ib_qp(id_priv, qp);
-               break;
-       case RDMA_TRANSPORT_IWARP:
-               ret = cma_init_iw_qp(id_priv, qp);
-               break;
-       default:
-               ret = -ENOSYS;
-               break;
-       }
-
+       if (cma_is_ud_ps(id_priv->id.ps))
+               ret = cma_init_ud_qp(id_priv, qp);
+       else
+               ret = cma_init_conn_qp(id_priv, qp);
        if (ret)
                goto err;
 
@@ -460,23 +509,55 @@ static int cma_modify_qp_err(struct rdma_cm_id *id)
        return ib_modify_qp(id->qp, &qp_attr, IB_QP_STATE);
 }
 
+static int cma_ib_init_qp_attr(struct rdma_id_private *id_priv,
+                              struct ib_qp_attr *qp_attr, int *qp_attr_mask)
+{
+       struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr;
+       int ret;
+
+       ret = ib_find_cached_pkey(id_priv->id.device, id_priv->id.port_num,
+                                 ib_addr_get_pkey(dev_addr),
+                                 &qp_attr->pkey_index);
+       if (ret)
+               return ret;
+
+       qp_attr->port_num = id_priv->id.port_num;
+       *qp_attr_mask = IB_QP_STATE | IB_QP_PKEY_INDEX | IB_QP_PORT;
+
+       if (cma_is_ud_ps(id_priv->id.ps)) {
+               qp_attr->qkey = id_priv->qkey;
+               *qp_attr_mask |= IB_QP_QKEY;
+       } else {
+               qp_attr->qp_access_flags = 0;
+               *qp_attr_mask |= IB_QP_ACCESS_FLAGS;
+       }
+       return 0;
+}
+
 int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
                       int *qp_attr_mask)
 {
        struct rdma_id_private *id_priv;
-       int ret;
+       int ret = 0;
 
        id_priv = container_of(id, struct rdma_id_private, id);
        switch (rdma_node_get_transport(id_priv->id.device->node_type)) {
        case RDMA_TRANSPORT_IB:
-               ret = ib_cm_init_qp_attr(id_priv->cm_id.ib, qp_attr,
-                                        qp_attr_mask);
+               if (!id_priv->cm_id.ib || cma_is_ud_ps(id_priv->id.ps))
+                       ret = cma_ib_init_qp_attr(id_priv, qp_attr, qp_attr_mask);
+               else
+                       ret = ib_cm_init_qp_attr(id_priv->cm_id.ib, qp_attr,
+                                                qp_attr_mask);
                if (qp_attr->qp_state == IB_QPS_RTR)
                        qp_attr->rq_psn = id_priv->seq_num;
                break;
        case RDMA_TRANSPORT_IWARP:
-               ret = iw_cm_init_qp_attr(id_priv->cm_id.iw, qp_attr,
-                                       qp_attr_mask);
+               if (!id_priv->cm_id.iw) {
+                       qp_attr->qp_access_flags = IB_ACCESS_LOCAL_WRITE;
+                       *qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS;
+               } else
+                       ret = iw_cm_init_qp_attr(id_priv->cm_id.iw, qp_attr,
+                                                qp_attr_mask);
                break;
        default:
                ret = -ENOSYS;
@@ -698,6 +779,19 @@ static void cma_release_port(struct rdma_id_private *id_priv)
        mutex_unlock(&lock);
 }
 
+static void cma_leave_mc_groups(struct rdma_id_private *id_priv)
+{
+       struct cma_multicast *mc;
+
+       while (!list_empty(&id_priv->mc_list)) {
+               mc = container_of(id_priv->mc_list.next,
+                                 struct cma_multicast, list);
+               list_del(&mc->list);
+               ib_sa_free_multicast(mc->multicast.ib);
+               kfree(mc);
+       }
+}
+
 void rdma_destroy_id(struct rdma_cm_id *id)
 {
        struct rdma_id_private *id_priv;
@@ -722,6 +816,7 @@ void rdma_destroy_id(struct rdma_cm_id *id)
                default:
                        break;
                }
+               cma_leave_mc_groups(id_priv);
                mutex_lock(&lock);
                cma_detach_from_dev(id_priv);
        }
@@ -972,7 +1067,7 @@ static int cma_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
        memset(&event, 0, sizeof event);
        offset = cma_user_data_offset(listen_id->id.ps);
        event.event = RDMA_CM_EVENT_CONNECT_REQUEST;
-       if (listen_id->id.ps == RDMA_PS_UDP) {
+       if (cma_is_ud_ps(listen_id->id.ps)) {
                conn_id = cma_new_udp_id(&listen_id->id, ib_event);
                event.param.ud.private_data = ib_event->private_data + offset;
                event.param.ud.private_data_len =
@@ -1725,7 +1820,7 @@ static int cma_alloc_port(struct idr *ps, struct rdma_id_private *id_priv,
        struct rdma_bind_list *bind_list;
        int port, ret;
 
-       bind_list = kzalloc(sizeof *bind_list, GFP_KERNEL);
+       bind_list = kmalloc(sizeof *bind_list, GFP_KERNEL);
        if (!bind_list)
                return -ENOMEM;
 
@@ -1847,6 +1942,9 @@ static int cma_get_port(struct rdma_id_private *id_priv)
        case RDMA_PS_UDP:
                ps = &udp_ps;
                break;
+       case RDMA_PS_IPOIB:
+               ps = &ipoib_ps;
+               break;
        default:
                return -EPROTONOSUPPORT;
        }
@@ -1961,7 +2059,7 @@ static int cma_sidr_rep_handler(struct ib_cm_id *cm_id,
                        event.status = ib_event->param.sidr_rep_rcvd.status;
                        break;
                }
-               if (rep->qkey != RDMA_UD_QKEY) {
+               if (id_priv->qkey != rep->qkey) {
                        event.event = RDMA_CM_EVENT_UNREACHABLE;
                        event.status = -EINVAL;
                        break;
@@ -2160,7 +2258,7 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 
        switch (rdma_node_get_transport(id->device->node_type)) {
        case RDMA_TRANSPORT_IB:
-               if (id->ps == RDMA_PS_UDP)
+               if (cma_is_ud_ps(id->ps))
                        ret = cma_resolve_ib_udp(id_priv, conn_param);
                else
                        ret = cma_connect_ib(id_priv, conn_param);
@@ -2256,7 +2354,7 @@ static int cma_send_sidr_rep(struct rdma_id_private *id_priv,
        rep.status = status;
        if (status == IB_SIDR_SUCCESS) {
                rep.qp_num = id_priv->qp_num;
-               rep.qkey = RDMA_UD_QKEY;
+               rep.qkey = id_priv->qkey;
        }
        rep.private_data = private_data;
        rep.private_data_len = private_data_len;
@@ -2280,7 +2378,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 
        switch (rdma_node_get_transport(id->device->node_type)) {
        case RDMA_TRANSPORT_IB:
-               if (id->ps == RDMA_PS_UDP)
+               if (cma_is_ud_ps(id->ps))
                        ret = cma_send_sidr_rep(id_priv, IB_SIDR_SUCCESS,
                                                conn_param->private_data,
                                                conn_param->private_data_len);
@@ -2341,7 +2439,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
 
        switch (rdma_node_get_transport(id->device->node_type)) {
        case RDMA_TRANSPORT_IB:
-               if (id->ps == RDMA_PS_UDP)
+               if (cma_is_ud_ps(id->ps))
                        ret = cma_send_sidr_rep(id_priv, IB_SIDR_REJECT,
                                                private_data, private_data_len);
                else
@@ -2392,6 +2490,178 @@ out:
 }
 EXPORT_SYMBOL(rdma_disconnect);
 
+static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast)
+{
+       struct rdma_id_private *id_priv;
+       struct cma_multicast *mc = multicast->context;
+       struct rdma_cm_event event;
+       int ret;
+
+       id_priv = mc->id_priv;
+       atomic_inc(&id_priv->dev_remove);
+       if (!cma_comp(id_priv, CMA_ADDR_BOUND) &&
+           !cma_comp(id_priv, CMA_ADDR_RESOLVED))
+               goto out;
+
+       if (!status && id_priv->id.qp)
+               status = ib_attach_mcast(id_priv->id.qp, &multicast->rec.mgid,
+                                        multicast->rec.mlid);
+
+       memset(&event, 0, sizeof event);
+       event.status = status;
+       event.param.ud.private_data = mc->context;
+       if (!status) {
+               event.event = RDMA_CM_EVENT_MULTICAST_JOIN;
+               ib_init_ah_from_mcmember(id_priv->id.device,
+                                        id_priv->id.port_num, &multicast->rec,
+                                        &event.param.ud.ah_attr);
+               event.param.ud.qp_num = 0xFFFFFF;
+               event.param.ud.qkey = be32_to_cpu(multicast->rec.qkey);
+       } else
+               event.event = RDMA_CM_EVENT_MULTICAST_ERROR;
+
+       ret = id_priv->id.event_handler(&id_priv->id, &event);
+       if (ret) {
+               cma_exch(id_priv, CMA_DESTROYING);
+               cma_release_remove(id_priv);
+               rdma_destroy_id(&id_priv->id);
+               return 0;
+       }
+out:
+       cma_release_remove(id_priv);
+       return 0;
+}
+
+static void cma_set_mgid(struct rdma_id_private *id_priv,
+                        struct sockaddr *addr, union ib_gid *mgid)
+{
+       unsigned char mc_map[MAX_ADDR_LEN];
+       struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr;
+       struct sockaddr_in *sin = (struct sockaddr_in *) addr;
+       struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) addr;
+
+       if (cma_any_addr(addr)) {
+               memset(mgid, 0, sizeof *mgid);
+       } else if ((addr->sa_family == AF_INET6) &&
+                  ((be32_to_cpu(sin6->sin6_addr.s6_addr32[0]) & 0xFF10A01B) ==
+                                                                0xFF10A01B)) {
+               /* IPv6 address is an SA assigned MGID. */
+               memcpy(mgid, &sin6->sin6_addr, sizeof *mgid);
+       } else {
+               ip_ib_mc_map(sin->sin_addr.s_addr, mc_map);
+               if (id_priv->id.ps == RDMA_PS_UDP)
+                       mc_map[7] = 0x01;       /* Use RDMA CM signature */
+               mc_map[8] = ib_addr_get_pkey(dev_addr) >> 8;
+               mc_map[9] = (unsigned char) ib_addr_get_pkey(dev_addr);
+               *mgid = *(union ib_gid *) (mc_map + 4);
+       }
+}
+
+static int cma_join_ib_multicast(struct rdma_id_private *id_priv,
+                                struct cma_multicast *mc)
+{
+       struct ib_sa_mcmember_rec rec;
+       struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr;
+       ib_sa_comp_mask comp_mask;
+       int ret;
+
+       ib_addr_get_mgid(dev_addr, &rec.mgid);
+       ret = ib_sa_get_mcmember_rec(id_priv->id.device, id_priv->id.port_num,
+                                    &rec.mgid, &rec);
+       if (ret)
+               return ret;
+
+       cma_set_mgid(id_priv, &mc->addr, &rec.mgid);
+       if (id_priv->id.ps == RDMA_PS_UDP)
+               rec.qkey = cpu_to_be32(RDMA_UDP_QKEY);
+       ib_addr_get_sgid(dev_addr, &rec.port_gid);
+       rec.pkey = cpu_to_be16(ib_addr_get_pkey(dev_addr));
+       rec.join_state = 1;
+
+       comp_mask = IB_SA_MCMEMBER_REC_MGID | IB_SA_MCMEMBER_REC_PORT_GID |
+                   IB_SA_MCMEMBER_REC_PKEY | IB_SA_MCMEMBER_REC_JOIN_STATE |
+                   IB_SA_MCMEMBER_REC_QKEY | IB_SA_MCMEMBER_REC_SL |
+                   IB_SA_MCMEMBER_REC_FLOW_LABEL |
+                   IB_SA_MCMEMBER_REC_TRAFFIC_CLASS;
+
+       mc->multicast.ib = ib_sa_join_multicast(&sa_client, id_priv->id.device,
+                                               id_priv->id.port_num, &rec,
+                                               comp_mask, GFP_KERNEL,
+                                               cma_ib_mc_handler, mc);
+       if (IS_ERR(mc->multicast.ib))
+               return PTR_ERR(mc->multicast.ib);
+
+       return 0;
+}
+
+int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
+                       void *context)
+{
+       struct rdma_id_private *id_priv;
+       struct cma_multicast *mc;
+       int ret;
+
+       id_priv = container_of(id, struct rdma_id_private, id);
+       if (!cma_comp(id_priv, CMA_ADDR_BOUND) &&
+           !cma_comp(id_priv, CMA_ADDR_RESOLVED))
+               return -EINVAL;
+
+       mc = kmalloc(sizeof *mc, GFP_KERNEL);
+       if (!mc)
+               return -ENOMEM;
+
+       memcpy(&mc->addr, addr, ip_addr_size(addr));
+       mc->context = context;
+       mc->id_priv = id_priv;
+
+       spin_lock(&id_priv->lock);
+       list_add(&mc->list, &id_priv->mc_list);
+       spin_unlock(&id_priv->lock);
+
+       switch (rdma_node_get_transport(id->device->node_type)) {
+       case RDMA_TRANSPORT_IB:
+               ret = cma_join_ib_multicast(id_priv, mc);
+               break;
+       default:
+               ret = -ENOSYS;
+               break;
+       }
+
+       if (ret) {
+               spin_lock_irq(&id_priv->lock);
+               list_del(&mc->list);
+               spin_unlock_irq(&id_priv->lock);
+               kfree(mc);
+       }
+       return ret;
+}
+EXPORT_SYMBOL(rdma_join_multicast);
+
+void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
+{
+       struct rdma_id_private *id_priv;
+       struct cma_multicast *mc;
+
+       id_priv = container_of(id, struct rdma_id_private, id);
+       spin_lock_irq(&id_priv->lock);
+       list_for_each_entry(mc, &id_priv->mc_list, list) {
+               if (!memcmp(&mc->addr, addr, ip_addr_size(addr))) {
+                       list_del(&mc->list);
+                       spin_unlock_irq(&id_priv->lock);
+
+                       if (id->qp)
+                               ib_detach_mcast(id->qp,
+                                               &mc->multicast.ib->rec.mgid,
+                                               mc->multicast.ib->rec.mlid);
+                       ib_sa_free_multicast(mc->multicast.ib);
+                       kfree(mc);
+                       return;
+               }
+       }
+       spin_unlock_irq(&id_priv->lock);
+}
+EXPORT_SYMBOL(rdma_leave_multicast);
+
 static void cma_add_one(struct ib_device *device)
 {
        struct cma_device *cma_dev;
@@ -2522,6 +2792,7 @@ static void cma_cleanup(void)
        idr_destroy(&sdp_ps);
        idr_destroy(&tcp_ps);
        idr_destroy(&udp_ps);
+       idr_destroy(&ipoib_ps);
 }
 
 module_init(cma_init);
index 8926a2bd4a8707d7b765432253a400c3719e9860..1d796e7c81991e6845c16ff3e6d1f323286afd92 100644 (file)
@@ -301,7 +301,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd             *pd,
 
        {
                struct ib_pool_fmr *fmr;
-               struct ib_fmr_attr attr = {
+               struct ib_fmr_attr fmr_attr = {
                        .max_pages  = params->max_pages_per_fmr,
                        .max_maps   = pool->max_remaps,
                        .page_shift = params->page_shift
@@ -321,7 +321,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd             *pd,
                        fmr->ref_count        = 0;
                        INIT_HLIST_NODE(&fmr->cache_node);
 
-                       fmr->fmr = ib_alloc_fmr(pd, params->access, &attr);
+                       fmr->fmr = ib_alloc_fmr(pd, params->access, &fmr_attr);
                        if (IS_ERR(fmr->fmr)) {
                                printk(KERN_WARNING "fmr_create failed for FMR %d", i);
                                kfree(fmr);
index 1039ad57d53b4b0f3ef2d252c51fb9a47bfd68f0..891d1fa7b2eb44a3fc4edbd5dc93dcb22b02c473 100644 (file)
@@ -146,6 +146,12 @@ static int copy_private_data(struct iw_cm_event *event)
        return 0;
 }
 
+static void free_cm_id(struct iwcm_id_private *cm_id_priv)
+{
+       dealloc_work_entries(cm_id_priv);
+       kfree(cm_id_priv);
+}
+
 /*
  * Release a reference on cm_id. If the last reference is being
  * released, enable the waiting thread (in iw_destroy_cm_id) to
@@ -153,21 +159,14 @@ static int copy_private_data(struct iw_cm_event *event)
  */
 static int iwcm_deref_id(struct iwcm_id_private *cm_id_priv)
 {
-       int ret = 0;
-
        BUG_ON(atomic_read(&cm_id_priv->refcount)==0);
        if (atomic_dec_and_test(&cm_id_priv->refcount)) {
                BUG_ON(!list_empty(&cm_id_priv->work_list));
-               if (waitqueue_active(&cm_id_priv->destroy_comp.wait)) {
-                       BUG_ON(cm_id_priv->state != IW_CM_STATE_DESTROYING);
-                       BUG_ON(test_bit(IWCM_F_CALLBACK_DESTROY,
-                                       &cm_id_priv->flags));
-                       ret = 1;
-               }
                complete(&cm_id_priv->destroy_comp);
+               return 1;
        }
 
-       return ret;
+       return 0;
 }
 
 static void add_ref(struct iw_cm_id *cm_id)
@@ -181,7 +180,11 @@ static void rem_ref(struct iw_cm_id *cm_id)
 {
        struct iwcm_id_private *cm_id_priv;
        cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
-       iwcm_deref_id(cm_id_priv);
+       if (iwcm_deref_id(cm_id_priv) &&
+           test_bit(IWCM_F_CALLBACK_DESTROY, &cm_id_priv->flags)) {
+               BUG_ON(!list_empty(&cm_id_priv->work_list));
+               free_cm_id(cm_id_priv);
+       }
 }
 
 static int cm_event_handler(struct iw_cm_id *cm_id, struct iw_cm_event *event);
@@ -355,7 +358,9 @@ static void destroy_cm_id(struct iw_cm_id *cm_id)
        case IW_CM_STATE_CONN_RECV:
                /*
                 * App called destroy before/without calling accept after
-                * receiving connection request event notification.
+                * receiving connection request event notification or
+                * returned non zero from the event callback function.
+                * In either case, must tell the provider to reject.
                 */
                cm_id_priv->state = IW_CM_STATE_DESTROYING;
                break;
@@ -391,9 +396,7 @@ void iw_destroy_cm_id(struct iw_cm_id *cm_id)
 
        wait_for_completion(&cm_id_priv->destroy_comp);
 
-       dealloc_work_entries(cm_id_priv);
-
-       kfree(cm_id_priv);
+       free_cm_id(cm_id_priv);
 }
 EXPORT_SYMBOL(iw_destroy_cm_id);
 
@@ -647,10 +650,11 @@ static void cm_conn_req_handler(struct iwcm_id_private *listen_id_priv,
        /* Call the client CM handler */
        ret = cm_id->cm_handler(cm_id, iw_event);
        if (ret) {
+               iw_cm_reject(cm_id, NULL, 0);
                set_bit(IWCM_F_CALLBACK_DESTROY, &cm_id_priv->flags);
                destroy_cm_id(cm_id);
                if (atomic_read(&cm_id_priv->refcount)==0)
-                       kfree(cm_id);
+                       free_cm_id(cm_id_priv);
        }
 
 out:
@@ -854,13 +858,12 @@ static void cm_work_handler(struct work_struct *_work)
                        destroy_cm_id(&cm_id_priv->id);
                }
                BUG_ON(atomic_read(&cm_id_priv->refcount)==0);
-               if (iwcm_deref_id(cm_id_priv))
-                       return;
-
-               if (atomic_read(&cm_id_priv->refcount)==0 &&
-                   test_bit(IWCM_F_CALLBACK_DESTROY, &cm_id_priv->flags)) {
-                       dealloc_work_entries(cm_id_priv);
-                       kfree(cm_id_priv);
+               if (iwcm_deref_id(cm_id_priv)) {
+                       if (test_bit(IWCM_F_CALLBACK_DESTROY,
+                                    &cm_id_priv->flags)) {
+                               BUG_ON(!list_empty(&cm_id_priv->work_list));
+                               free_cm_id(cm_id_priv);
+                       }
                        return;
                }
                spin_lock_irqsave(&cm_id_priv->lock, flags);
diff --git a/drivers/infiniband/core/multicast.c b/drivers/infiniband/core/multicast.c
new file mode 100644 (file)
index 0000000..4a579b3
--- /dev/null
@@ -0,0 +1,837 @@
+/*
+ * Copyright (c) 2006 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <linux/completion.h>
+#include <linux/dma-mapping.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/pci.h>
+#include <linux/bitops.h>
+#include <linux/random.h>
+
+#include <rdma/ib_cache.h>
+#include "sa.h"
+
+static void mcast_add_one(struct ib_device *device);
+static void mcast_remove_one(struct ib_device *device);
+
+static struct ib_client mcast_client = {
+       .name   = "ib_multicast",
+       .add    = mcast_add_one,
+       .remove = mcast_remove_one
+};
+
+static struct ib_sa_client     sa_client;
+static struct workqueue_struct *mcast_wq;
+static union ib_gid mgid0;
+
+struct mcast_device;
+
+struct mcast_port {
+       struct mcast_device     *dev;
+       spinlock_t              lock;
+       struct rb_root          table;
+       atomic_t                refcount;
+       struct completion       comp;
+       u8                      port_num;
+};
+
+struct mcast_device {
+       struct ib_device        *device;
+       struct ib_event_handler event_handler;
+       int                     start_port;
+       int                     end_port;
+       struct mcast_port       port[0];
+};
+
+enum mcast_state {
+       MCAST_IDLE,
+       MCAST_JOINING,
+       MCAST_MEMBER,
+       MCAST_BUSY,
+       MCAST_ERROR
+};
+
+struct mcast_member;
+
+struct mcast_group {
+       struct ib_sa_mcmember_rec rec;
+       struct rb_node          node;
+       struct mcast_port       *port;
+       spinlock_t              lock;
+       struct work_struct      work;
+       struct list_head        pending_list;
+       struct list_head        active_list;
+       struct mcast_member     *last_join;
+       int                     members[3];
+       atomic_t                refcount;
+       enum mcast_state        state;
+       struct ib_sa_query      *query;
+       int                     query_id;
+};
+
+struct mcast_member {
+       struct ib_sa_multicast  multicast;
+       struct ib_sa_client     *client;
+       struct mcast_group      *group;
+       struct list_head        list;
+       enum mcast_state        state;
+       atomic_t                refcount;
+       struct completion       comp;
+};
+
+static void join_handler(int status, struct ib_sa_mcmember_rec *rec,
+                        void *context);
+static void leave_handler(int status, struct ib_sa_mcmember_rec *rec,
+                         void *context);
+
+static struct mcast_group *mcast_find(struct mcast_port *port,
+                                     union ib_gid *mgid)
+{
+       struct rb_node *node = port->table.rb_node;
+       struct mcast_group *group;
+       int ret;
+
+       while (node) {
+               group = rb_entry(node, struct mcast_group, node);
+               ret = memcmp(mgid->raw, group->rec.mgid.raw, sizeof *mgid);
+               if (!ret)
+                       return group;
+
+               if (ret < 0)
+                       node = node->rb_left;
+               else
+                       node = node->rb_right;
+       }
+       return NULL;
+}
+
+static struct mcast_group *mcast_insert(struct mcast_port *port,
+                                       struct mcast_group *group,
+                                       int allow_duplicates)
+{
+       struct rb_node **link = &port->table.rb_node;
+       struct rb_node *parent = NULL;
+       struct mcast_group *cur_group;
+       int ret;
+
+       while (*link) {
+               parent = *link;
+               cur_group = rb_entry(parent, struct mcast_group, node);
+
+               ret = memcmp(group->rec.mgid.raw, cur_group->rec.mgid.raw,
+                            sizeof group->rec.mgid);
+               if (ret < 0)
+                       link = &(*link)->rb_left;
+               else if (ret > 0)
+                       link = &(*link)->rb_right;
+               else if (allow_duplicates)
+                       link = &(*link)->rb_left;
+               else
+                       return cur_group;
+       }
+       rb_link_node(&group->node, parent, link);
+       rb_insert_color(&group->node, &port->table);
+       return NULL;
+}
+
+static void deref_port(struct mcast_port *port)
+{
+       if (atomic_dec_and_test(&port->refcount))
+               complete(&port->comp);
+}
+
+static void release_group(struct mcast_group *group)
+{
+       struct mcast_port *port = group->port;
+       unsigned long flags;
+
+       spin_lock_irqsave(&port->lock, flags);
+       if (atomic_dec_and_test(&group->refcount)) {
+               rb_erase(&group->node, &port->table);
+               spin_unlock_irqrestore(&port->lock, flags);
+               kfree(group);
+               deref_port(port);
+       } else
+               spin_unlock_irqrestore(&port->lock, flags);
+}
+
+static void deref_member(struct mcast_member *member)
+{
+       if (atomic_dec_and_test(&member->refcount))
+               complete(&member->comp);
+}
+
+static void queue_join(struct mcast_member *member)
+{
+       struct mcast_group *group = member->group;
+       unsigned long flags;
+
+       spin_lock_irqsave(&group->lock, flags);
+       list_add(&member->list, &group->pending_list);
+       if (group->state == MCAST_IDLE) {
+               group->state = MCAST_BUSY;
+               atomic_inc(&group->refcount);
+               queue_work(mcast_wq, &group->work);
+       }
+       spin_unlock_irqrestore(&group->lock, flags);
+}
+
+/*
+ * A multicast group has three types of members: full member, non member, and
+ * send only member.  We need to keep track of the number of members of each
+ * type based on their join state.  Adjust the number of members the belong to
+ * the specified join states.
+ */
+static void adjust_membership(struct mcast_group *group, u8 join_state, int inc)
+{
+       int i;
+
+       for (i = 0; i < 3; i++, join_state >>= 1)
+               if (join_state & 0x1)
+                       group->members[i] += inc;
+}
+
+/*
+ * If a multicast group has zero members left for a particular join state, but
+ * the group is still a member with the SA, we need to leave that join state.
+ * Determine which join states we still belong to, but that do not have any
+ * active members.
+ */
+static u8 get_leave_state(struct mcast_group *group)
+{
+       u8 leave_state = 0;
+       int i;
+
+       for (i = 0; i < 3; i++)
+               if (!group->members[i])
+                       leave_state |= (0x1 << i);
+
+       return leave_state & group->rec.join_state;
+}
+
+static int check_selector(ib_sa_comp_mask comp_mask,
+                         ib_sa_comp_mask selector_mask,
+                         ib_sa_comp_mask value_mask,
+                         u8 selector, u8 src_value, u8 dst_value)
+{
+       int err;
+
+       if (!(comp_mask & selector_mask) || !(comp_mask & value_mask))
+               return 0;
+
+       switch (selector) {
+       case IB_SA_GT:
+               err = (src_value <= dst_value);
+               break;
+       case IB_SA_LT:
+               err = (src_value >= dst_value);
+               break;
+       case IB_SA_EQ:
+               err = (src_value != dst_value);
+               break;
+       default:
+               err = 0;
+               break;
+       }
+
+       return err;
+}
+
+static int cmp_rec(struct ib_sa_mcmember_rec *src,
+                  struct ib_sa_mcmember_rec *dst, ib_sa_comp_mask comp_mask)
+{
+       /* MGID must already match */
+
+       if (comp_mask & IB_SA_MCMEMBER_REC_PORT_GID &&
+           memcmp(&src->port_gid, &dst->port_gid, sizeof src->port_gid))
+               return -EINVAL;
+       if (comp_mask & IB_SA_MCMEMBER_REC_QKEY && src->qkey != dst->qkey)
+               return -EINVAL;
+       if (comp_mask & IB_SA_MCMEMBER_REC_MLID && src->mlid != dst->mlid)
+               return -EINVAL;
+       if (check_selector(comp_mask, IB_SA_MCMEMBER_REC_MTU_SELECTOR,
+                          IB_SA_MCMEMBER_REC_MTU, dst->mtu_selector,
+                          src->mtu, dst->mtu))
+               return -EINVAL;
+       if (comp_mask & IB_SA_MCMEMBER_REC_TRAFFIC_CLASS &&
+           src->traffic_class != dst->traffic_class)
+               return -EINVAL;
+       if (comp_mask & IB_SA_MCMEMBER_REC_PKEY && src->pkey != dst->pkey)
+               return -EINVAL;
+       if (check_selector(comp_mask, IB_SA_MCMEMBER_REC_RATE_SELECTOR,
+                          IB_SA_MCMEMBER_REC_RATE, dst->rate_selector,
+                          src->rate, dst->rate))
+               return -EINVAL;
+       if (check_selector(comp_mask,
+                          IB_SA_MCMEMBER_REC_PACKET_LIFE_TIME_SELECTOR,
+                          IB_SA_MCMEMBER_REC_PACKET_LIFE_TIME,
+                          dst->packet_life_time_selector,
+                          src->packet_life_time, dst->packet_life_time))
+               return -EINVAL;
+       if (comp_mask & IB_SA_MCMEMBER_REC_SL && src->sl != dst->sl)
+               return -EINVAL;
+       if (comp_mask & IB_SA_MCMEMBER_REC_FLOW_LABEL &&
+           src->flow_label != dst->flow_label)
+               return -EINVAL;
+       if (comp_mask & IB_SA_MCMEMBER_REC_HOP_LIMIT &&
+           src->hop_limit != dst->hop_limit)
+               return -EINVAL;
+       if (comp_mask & IB_SA_MCMEMBER_REC_SCOPE && src->scope != dst->scope)
+               return -EINVAL;
+
+       /* join_state checked separately, proxy_join ignored */
+
+       return 0;
+}
+
+static int send_join(struct mcast_group *group, struct mcast_member *member)
+{
+       struct mcast_port *port = group->port;
+       int ret;
+
+       group->last_join = member;
+       ret = ib_sa_mcmember_rec_query(&sa_client, port->dev->device,
+                                      port->port_num, IB_MGMT_METHOD_SET,
+                                      &member->multicast.rec,
+                                      member->multicast.comp_mask,
+                                      3000, GFP_KERNEL, join_handler, group,
+                                      &group->query);
+       if (ret >= 0) {
+               group->query_id = ret;
+               ret = 0;
+       }
+       return ret;
+}
+
+static int send_leave(struct mcast_group *group, u8 leave_state)
+{
+       struct mcast_port *port = group->port;
+       struct ib_sa_mcmember_rec rec;
+       int ret;
+
+       rec = group->rec;
+       rec.join_state = leave_state;
+
+       ret = ib_sa_mcmember_rec_query(&sa_client, port->dev->device,
+                                      port->port_num, IB_SA_METHOD_DELETE, &rec,
+                                      IB_SA_MCMEMBER_REC_MGID     |
+                                      IB_SA_MCMEMBER_REC_PORT_GID |
+                                      IB_SA_MCMEMBER_REC_JOIN_STATE,
+                                      3000, GFP_KERNEL, leave_handler,
+                                      group, &group->query);
+       if (ret >= 0) {
+               group->query_id = ret;
+               ret = 0;
+       }
+       return ret;
+}
+
+static void join_group(struct mcast_group *group, struct mcast_member *member,
+                      u8 join_state)
+{
+       member->state = MCAST_MEMBER;
+       adjust_membership(group, join_state, 1);
+       group->rec.join_state |= join_state;
+       member->multicast.rec = group->rec;
+       member->multicast.rec.join_state = join_state;
+       list_move(&member->list, &group->active_list);
+}
+
+static int fail_join(struct mcast_group *group, struct mcast_member *member,
+                    int status)
+{
+       spin_lock_irq(&group->lock);
+       list_del_init(&member->list);
+       spin_unlock_irq(&group->lock);
+       return member->multicast.callback(status, &member->multicast);
+}
+
+static void process_group_error(struct mcast_group *group)
+{
+       struct mcast_member *member;
+       int ret;
+
+       spin_lock_irq(&group->lock);
+       while (!list_empty(&group->active_list)) {
+               member = list_entry(group->active_list.next,
+                                   struct mcast_member, list);
+               atomic_inc(&member->refcount);
+               list_del_init(&member->list);
+               adjust_membership(group, member->multicast.rec.join_state, -1);
+               member->state = MCAST_ERROR;
+               spin_unlock_irq(&group->lock);
+
+               ret = member->multicast.callback(-ENETRESET,
+                                                &member->multicast);
+               deref_member(member);
+               if (ret)
+                       ib_sa_free_multicast(&member->multicast);
+               spin_lock_irq(&group->lock);
+       }
+
+       group->rec.join_state = 0;
+       group->state = MCAST_BUSY;
+       spin_unlock_irq(&group->lock);
+}
+
+static void mcast_work_handler(struct work_struct *work)
+{
+       struct mcast_group *group;
+       struct mcast_member *member;
+       struct ib_sa_multicast *multicast;
+       int status, ret;
+       u8 join_state;
+
+       group = container_of(work, typeof(*group), work);
+retest:
+       spin_lock_irq(&group->lock);
+       while (!list_empty(&group->pending_list) ||
+              (group->state == MCAST_ERROR)) {
+
+               if (group->state == MCAST_ERROR) {
+                       spin_unlock_irq(&group->lock);
+                       process_group_error(group);
+                       goto retest;
+               }
+
+               member = list_entry(group->pending_list.next,
+                                   struct mcast_member, list);
+               multicast = &member->multicast;
+               join_state = multicast->rec.join_state;
+               atomic_inc(&member->refcount);
+
+               if (join_state == (group->rec.join_state & join_state)) {
+                       status = cmp_rec(&group->rec, &multicast->rec,
+                                        multicast->comp_mask);
+                       if (!status)
+                               join_group(group, member, join_state);
+                       else
+                               list_del_init(&member->list);
+                       spin_unlock_irq(&group->lock);
+                       ret = multicast->callback(status, multicast);
+               } else {
+                       spin_unlock_irq(&group->lock);
+                       status = send_join(group, member);
+                       if (!status) {
+                               deref_member(member);
+                               return;
+                       }
+                       ret = fail_join(group, member, status);
+               }
+
+               deref_member(member);
+               if (ret)
+                       ib_sa_free_multicast(&member->multicast);
+               spin_lock_irq(&group->lock);
+       }
+
+       join_state = get_leave_state(group);
+       if (join_state) {
+               group->rec.join_state &= ~join_state;
+               spin_unlock_irq(&group->lock);
+               if (send_leave(group, join_state))
+                       goto retest;
+       } else {
+               group->state = MCAST_IDLE;
+               spin_unlock_irq(&group->lock);
+               release_group(group);
+       }
+}
+
+/*
+ * Fail a join request if it is still active - at the head of the pending queue.
+ */
+static void process_join_error(struct mcast_group *group, int status)
+{
+       struct mcast_member *member;
+       int ret;
+
+       spin_lock_irq(&group->lock);
+       member = list_entry(group->pending_list.next,
+                           struct mcast_member, list);
+       if (group->last_join == member) {
+               atomic_inc(&member->refcount);
+               list_del_init(&member->list);
+               spin_unlock_irq(&group->lock);
+               ret = member->multicast.callback(status, &member->multicast);
+               deref_member(member);
+               if (ret)
+                       ib_sa_free_multicast(&member->multicast);
+       } else
+               spin_unlock_irq(&group->lock);
+}
+
+static void join_handler(int status, struct ib_sa_mcmember_rec *rec,
+                        void *context)
+{
+       struct mcast_group *group = context;
+
+       if (status)
+               process_join_error(group, status);
+       else {
+               spin_lock_irq(&group->port->lock);
+               group->rec = *rec;
+               if (!memcmp(&mgid0, &group->rec.mgid, sizeof mgid0)) {
+                       rb_erase(&group->node, &group->port->table);
+                       mcast_insert(group->port, group, 1);
+               }
+               spin_unlock_irq(&group->port->lock);
+       }
+       mcast_work_handler(&group->work);
+}
+
+static void leave_handler(int status, struct ib_sa_mcmember_rec *rec,
+                         void *context)
+{
+       struct mcast_group *group = context;
+
+       mcast_work_handler(&group->work);
+}
+
+static struct mcast_group *acquire_group(struct mcast_port *port,
+                                        union ib_gid *mgid, gfp_t gfp_mask)
+{
+       struct mcast_group *group, *cur_group;
+       unsigned long flags;
+       int is_mgid0;
+
+       is_mgid0 = !memcmp(&mgid0, mgid, sizeof mgid0);
+       if (!is_mgid0) {
+               spin_lock_irqsave(&port->lock, flags);
+               group = mcast_find(port, mgid);
+               if (group)
+                       goto found;
+               spin_unlock_irqrestore(&port->lock, flags);
+       }
+
+       group = kzalloc(sizeof *group, gfp_mask);
+       if (!group)
+               return NULL;
+
+       group->port = port;
+       group->rec.mgid = *mgid;
+       INIT_LIST_HEAD(&group->pending_list);
+       INIT_LIST_HEAD(&group->active_list);
+       INIT_WORK(&group->work, mcast_work_handler);
+       spin_lock_init(&group->lock);
+
+       spin_lock_irqsave(&port->lock, flags);
+       cur_group = mcast_insert(port, group, is_mgid0);
+       if (cur_group) {
+               kfree(group);
+               group = cur_group;
+       } else
+               atomic_inc(&port->refcount);
+found:
+       atomic_inc(&group->refcount);
+       spin_unlock_irqrestore(&port->lock, flags);
+       return group;
+}
+
+/*
+ * We serialize all join requests to a single group to make our lives much
+ * easier.  Otherwise, two users could try to join the same group
+ * simultaneously, with different configurations, one could leave while the
+ * join is in progress, etc., which makes locking around error recovery
+ * difficult.
+ */
+struct ib_sa_multicast *
+ib_sa_join_multicast(struct ib_sa_client *client,
+                    struct ib_device *device, u8 port_num,
+                    struct ib_sa_mcmember_rec *rec,
+                    ib_sa_comp_mask comp_mask, gfp_t gfp_mask,
+                    int (*callback)(int status,
+                                    struct ib_sa_multicast *multicast),
+                    void *context)
+{
+       struct mcast_device *dev;
+       struct mcast_member *member;
+       struct ib_sa_multicast *multicast;
+       int ret;
+
+       dev = ib_get_client_data(device, &mcast_client);
+       if (!dev)
+               return ERR_PTR(-ENODEV);
+
+       member = kmalloc(sizeof *member, gfp_mask);
+       if (!member)
+               return ERR_PTR(-ENOMEM);
+
+       ib_sa_client_get(client);
+       member->client = client;
+       member->multicast.rec = *rec;
+       member->multicast.comp_mask = comp_mask;
+       member->multicast.callback = callback;
+       member->multicast.context = context;
+       init_completion(&member->comp);
+       atomic_set(&member->refcount, 1);
+       member->state = MCAST_JOINING;
+
+       member->group = acquire_group(&dev->port[port_num - dev->start_port],
+                                     &rec->mgid, gfp_mask);
+       if (!member->group) {
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       /*
+        * The user will get the multicast structure in their callback.  They
+        * could then free the multicast structure before we can return from
+        * this routine.  So we save the pointer to return before queuing
+        * any callback.
+        */
+       multicast = &member->multicast;
+       queue_join(member);
+       return multicast;
+
+err:
+       ib_sa_client_put(client);
+       kfree(member);
+       return ERR_PTR(ret);
+}
+EXPORT_SYMBOL(ib_sa_join_multicast);
+
+void ib_sa_free_multicast(struct ib_sa_multicast *multicast)
+{
+       struct mcast_member *member;
+       struct mcast_group *group;
+
+       member = container_of(multicast, struct mcast_member, multicast);
+       group = member->group;
+
+       spin_lock_irq(&group->lock);
+       if (member->state == MCAST_MEMBER)
+               adjust_membership(group, multicast->rec.join_state, -1);
+
+       list_del_init(&member->list);
+
+       if (group->state == MCAST_IDLE) {
+               group->state = MCAST_BUSY;
+               spin_unlock_irq(&group->lock);
+               /* Continue to hold reference on group until callback */
+               queue_work(mcast_wq, &group->work);
+       } else {
+               spin_unlock_irq(&group->lock);
+               release_group(group);
+       }
+
+       deref_member(member);
+       wait_for_completion(&member->comp);
+       ib_sa_client_put(member->client);
+       kfree(member);
+}
+EXPORT_SYMBOL(ib_sa_free_multicast);
+
+int ib_sa_get_mcmember_rec(struct ib_device *device, u8 port_num,
+                          union ib_gid *mgid, struct ib_sa_mcmember_rec *rec)
+{
+       struct mcast_device *dev;
+       struct mcast_port *port;
+       struct mcast_group *group;
+       unsigned long flags;
+       int ret = 0;
+
+       dev = ib_get_client_data(device, &mcast_client);
+       if (!dev)
+               return -ENODEV;
+
+       port = &dev->port[port_num - dev->start_port];
+       spin_lock_irqsave(&port->lock, flags);
+       group = mcast_find(port, mgid);
+       if (group)
+               *rec = group->rec;
+       else
+               ret = -EADDRNOTAVAIL;
+       spin_unlock_irqrestore(&port->lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(ib_sa_get_mcmember_rec);
+
+int ib_init_ah_from_mcmember(struct ib_device *device, u8 port_num,
+                            struct ib_sa_mcmember_rec *rec,
+                            struct ib_ah_attr *ah_attr)
+{
+       int ret;
+       u16 gid_index;
+       u8 p;
+
+       ret = ib_find_cached_gid(device, &rec->port_gid, &p, &gid_index);
+       if (ret)
+               return ret;
+
+       memset(ah_attr, 0, sizeof *ah_attr);
+       ah_attr->dlid = be16_to_cpu(rec->mlid);
+       ah_attr->sl = rec->sl;
+       ah_attr->port_num = port_num;
+       ah_attr->static_rate = rec->rate;
+
+       ah_attr->ah_flags = IB_AH_GRH;
+       ah_attr->grh.dgid = rec->mgid;
+
+       ah_attr->grh.sgid_index = (u8) gid_index;
+       ah_attr->grh.flow_label = be32_to_cpu(rec->flow_label);
+       ah_attr->grh.hop_limit = rec->hop_limit;
+       ah_attr->grh.traffic_class = rec->traffic_class;
+
+       return 0;
+}
+EXPORT_SYMBOL(ib_init_ah_from_mcmember);
+
+static void mcast_groups_lost(struct mcast_port *port)
+{
+       struct mcast_group *group;
+       struct rb_node *node;
+       unsigned long flags;
+
+       spin_lock_irqsave(&port->lock, flags);
+       for (node = rb_first(&port->table); node; node = rb_next(node)) {
+               group = rb_entry(node, struct mcast_group, node);
+               spin_lock(&group->lock);
+               if (group->state == MCAST_IDLE) {
+                       atomic_inc(&group->refcount);
+                       queue_work(mcast_wq, &group->work);
+               }
+               group->state = MCAST_ERROR;
+               spin_unlock(&group->lock);
+       }
+       spin_unlock_irqrestore(&port->lock, flags);
+}
+
+static void mcast_event_handler(struct ib_event_handler *handler,
+                               struct ib_event *event)
+{
+       struct mcast_device *dev;
+
+       dev = container_of(handler, struct mcast_device, event_handler);
+
+       switch (event->event) {
+       case IB_EVENT_PORT_ERR:
+       case IB_EVENT_LID_CHANGE:
+       case IB_EVENT_SM_CHANGE:
+       case IB_EVENT_CLIENT_REREGISTER:
+               mcast_groups_lost(&dev->port[event->element.port_num -
+                                            dev->start_port]);
+               break;
+       default:
+               break;
+       }
+}
+
+static void mcast_add_one(struct ib_device *device)
+{
+       struct mcast_device *dev;
+       struct mcast_port *port;
+       int i;
+
+       if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
+               return;
+
+       dev = kmalloc(sizeof *dev + device->phys_port_cnt * sizeof *port,
+                     GFP_KERNEL);
+       if (!dev)
+               return;
+
+       if (device->node_type == RDMA_NODE_IB_SWITCH)
+               dev->start_port = dev->end_port = 0;
+       else {
+               dev->start_port = 1;
+               dev->end_port = device->phys_port_cnt;
+       }
+
+       for (i = 0; i <= dev->end_port - dev->start_port; i++) {
+               port = &dev->port[i];
+               port->dev = dev;
+               port->port_num = dev->start_port + i;
+               spin_lock_init(&port->lock);
+               port->table = RB_ROOT;
+               init_completion(&port->comp);
+               atomic_set(&port->refcount, 1);
+       }
+
+       dev->device = device;
+       ib_set_client_data(device, &mcast_client, dev);
+
+       INIT_IB_EVENT_HANDLER(&dev->event_handler, device, mcast_event_handler);
+       ib_register_event_handler(&dev->event_handler);
+}
+
+static void mcast_remove_one(struct ib_device *device)
+{
+       struct mcast_device *dev;
+       struct mcast_port *port;
+       int i;
+
+       dev = ib_get_client_data(device, &mcast_client);
+       if (!dev)
+               return;
+
+       ib_unregister_event_handler(&dev->event_handler);
+       flush_workqueue(mcast_wq);
+
+       for (i = 0; i <= dev->end_port - dev->start_port; i++) {
+               port = &dev->port[i];
+               deref_port(port);
+               wait_for_completion(&port->comp);
+       }
+
+       kfree(dev);
+}
+
+int mcast_init(void)
+{
+       int ret;
+
+       mcast_wq = create_singlethread_workqueue("ib_mcast");
+       if (!mcast_wq)
+               return -ENOMEM;
+
+       ib_sa_register_client(&sa_client);
+
+       ret = ib_register_client(&mcast_client);
+       if (ret)
+               goto err;
+       return 0;
+
+err:
+       ib_sa_unregister_client(&sa_client);
+       destroy_workqueue(mcast_wq);
+       return ret;
+}
+
+void mcast_cleanup(void)
+{
+       ib_unregister_client(&mcast_client);
+       ib_sa_unregister_client(&sa_client);
+       destroy_workqueue(mcast_wq);
+}
diff --git a/drivers/infiniband/core/sa.h b/drivers/infiniband/core/sa.h
new file mode 100644 (file)
index 0000000..24c93fd
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2004 Topspin Communications.  All rights reserved.
+ * Copyright (c) 2005 Voltaire, Inc.  All rights reserved.
+ * Copyright (c) 2006 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef SA_H
+#define SA_H
+
+#include <rdma/ib_sa.h>
+
+static inline void ib_sa_client_get(struct ib_sa_client *client)
+{
+       atomic_inc(&client->users);
+}
+
+static inline void ib_sa_client_put(struct ib_sa_client *client)
+{
+       if (atomic_dec_and_test(&client->users))
+               complete(&client->comp);
+}
+
+int ib_sa_mcmember_rec_query(struct ib_sa_client *client,
+                            struct ib_device *device, u8 port_num,
+                            u8 method,
+                            struct ib_sa_mcmember_rec *rec,
+                            ib_sa_comp_mask comp_mask,
+                            int timeout_ms, gfp_t gfp_mask,
+                            void (*callback)(int status,
+                                             struct ib_sa_mcmember_rec *resp,
+                                             void *context),
+                            void *context,
+                            struct ib_sa_query **sa_query);
+
+int mcast_init(void);
+void mcast_cleanup(void);
+
+#endif /* SA_H */
index e45afba75341ee86d80464406564c3492366edbd..68db633711c5dfd58711c9018ea11d599a9cc3c0 100644 (file)
@@ -47,8 +47,8 @@
 #include <linux/workqueue.h>
 
 #include <rdma/ib_pack.h>
-#include <rdma/ib_sa.h>
 #include <rdma/ib_cache.h>
+#include "sa.h"
 
 MODULE_AUTHOR("Roland Dreier");
 MODULE_DESCRIPTION("InfiniBand subnet administration query support");
@@ -425,17 +425,6 @@ void ib_sa_register_client(struct ib_sa_client *client)
 }
 EXPORT_SYMBOL(ib_sa_register_client);
 
-static inline void ib_sa_client_get(struct ib_sa_client *client)
-{
-       atomic_inc(&client->users);
-}
-
-static inline void ib_sa_client_put(struct ib_sa_client *client)
-{
-       if (atomic_dec_and_test(&client->users))
-               complete(&client->comp);
-}
-
 void ib_sa_unregister_client(struct ib_sa_client *client)
 {
        ib_sa_client_put(client);
@@ -482,6 +471,7 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
        ah_attr->sl = rec->sl;
        ah_attr->src_path_bits = be16_to_cpu(rec->slid) & 0x7f;
        ah_attr->port_num = port_num;
+       ah_attr->static_rate = rec->rate;
 
        if (rec->hop_limit > 1) {
                ah_attr->ah_flags = IB_AH_GRH;
@@ -901,7 +891,6 @@ err1:
        kfree(query);
        return ret;
 }
-EXPORT_SYMBOL(ib_sa_mcmember_rec_query);
 
 static void send_handler(struct ib_mad_agent *agent,
                         struct ib_mad_send_wc *mad_send_wc)
@@ -1053,14 +1042,27 @@ static int __init ib_sa_init(void)
        get_random_bytes(&tid, sizeof tid);
 
        ret = ib_register_client(&sa_client);
-       if (ret)
+       if (ret) {
                printk(KERN_ERR "Couldn't register ib_sa client\n");
+               goto err1;
+       }
+
+       ret = mcast_init();
+       if (ret) {
+               printk(KERN_ERR "Couldn't initialize multicast handling\n");
+               goto err2;
+       }
 
+       return 0;
+err2:
+       ib_unregister_client(&sa_client);
+err1:
        return ret;
 }
 
 static void __exit ib_sa_cleanup(void)
 {
+       mcast_cleanup();
        ib_unregister_client(&sa_client);
        idr_destroy(&query_idr);
 }
index 709323c14c5d3fff1fba12f50c6290e0a17d6a4a..000c086bf2e9bf9d6ec0e8d90e7d9c5cec7fc4ec 100644 (file)
@@ -714,8 +714,6 @@ int ib_device_register_sysfs(struct ib_device *device)
                if (ret)
                        goto err_put;
        } else {
-               int i;
-
                for (i = 1; i <= device->phys_port_cnt; ++i) {
                        ret = add_port(device, i);
                        if (ret)
index 6b81b98961c7b8014120cfd79cf939f478778e12..b516b93b85505b5a243a88ad00a670defab4c452 100644 (file)
@@ -70,10 +70,24 @@ struct ucma_context {
        u64                     uid;
 
        struct list_head        list;
+       struct list_head        mc_list;
+};
+
+struct ucma_multicast {
+       struct ucma_context     *ctx;
+       int                     id;
+       int                     events_reported;
+
+       u64                     uid;
+       struct list_head        list;
+       struct sockaddr         addr;
+       u8                      pad[sizeof(struct sockaddr_in6) -
+                                   sizeof(struct sockaddr)];
 };
 
 struct ucma_event {
        struct ucma_context     *ctx;
+       struct ucma_multicast   *mc;
        struct list_head        list;
        struct rdma_cm_id       *cm_id;
        struct rdma_ucm_event_resp resp;
@@ -81,6 +95,7 @@ struct ucma_event {
 
 static DEFINE_MUTEX(mut);
 static DEFINE_IDR(ctx_idr);
+static DEFINE_IDR(multicast_idr);
 
 static inline struct ucma_context *_ucma_find_context(int id,
                                                      struct ucma_file *file)
@@ -124,6 +139,7 @@ static struct ucma_context *ucma_alloc_ctx(struct ucma_file *file)
 
        atomic_set(&ctx->ref, 1);
        init_completion(&ctx->comp);
+       INIT_LIST_HEAD(&ctx->mc_list);
        ctx->file = file;
 
        do {
@@ -147,6 +163,37 @@ error:
        return NULL;
 }
 
+static struct ucma_multicast* ucma_alloc_multicast(struct ucma_context *ctx)
+{
+       struct ucma_multicast *mc;
+       int ret;
+
+       mc = kzalloc(sizeof(*mc), GFP_KERNEL);
+       if (!mc)
+               return NULL;
+
+       do {
+               ret = idr_pre_get(&multicast_idr, GFP_KERNEL);
+               if (!ret)
+                       goto error;
+
+               mutex_lock(&mut);
+               ret = idr_get_new(&multicast_idr, mc, &mc->id);
+               mutex_unlock(&mut);
+       } while (ret == -EAGAIN);
+
+       if (ret)
+               goto error;
+
+       mc->ctx = ctx;
+       list_add_tail(&mc->list, &ctx->mc_list);
+       return mc;
+
+error:
+       kfree(mc);
+       return NULL;
+}
+
 static void ucma_copy_conn_event(struct rdma_ucm_conn_param *dst,
                                 struct rdma_conn_param *src)
 {
@@ -180,8 +227,19 @@ static void ucma_set_event_context(struct ucma_context *ctx,
                                   struct ucma_event *uevent)
 {
        uevent->ctx = ctx;
-       uevent->resp.uid = ctx->uid;
-       uevent->resp.id = ctx->id;
+       switch (event->event) {
+       case RDMA_CM_EVENT_MULTICAST_JOIN:
+       case RDMA_CM_EVENT_MULTICAST_ERROR:
+               uevent->mc = (struct ucma_multicast *)
+                            event->param.ud.private_data;
+               uevent->resp.uid = uevent->mc->uid;
+               uevent->resp.id = uevent->mc->id;
+               break;
+       default:
+               uevent->resp.uid = ctx->uid;
+               uevent->resp.id = ctx->id;
+               break;
+       }
 }
 
 static int ucma_event_handler(struct rdma_cm_id *cm_id,
@@ -199,7 +257,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id,
        ucma_set_event_context(ctx, event, uevent);
        uevent->resp.event = event->event;
        uevent->resp.status = event->status;
-       if (cm_id->ps == RDMA_PS_UDP)
+       if (cm_id->ps == RDMA_PS_UDP || cm_id->ps == RDMA_PS_IPOIB)
                ucma_copy_ud_event(&uevent->resp.param.ud, &event->param.ud);
        else
                ucma_copy_conn_event(&uevent->resp.param.conn,
@@ -290,6 +348,8 @@ static ssize_t ucma_get_event(struct ucma_file *file, const char __user *inbuf,
 
        list_del(&uevent->list);
        uevent->ctx->events_reported++;
+       if (uevent->mc)
+               uevent->mc->events_reported++;
        kfree(uevent);
 done:
        mutex_unlock(&file->mut);
@@ -342,6 +402,19 @@ err1:
        return ret;
 }
 
+static void ucma_cleanup_multicast(struct ucma_context *ctx)
+{
+       struct ucma_multicast *mc, *tmp;
+
+       mutex_lock(&mut);
+       list_for_each_entry_safe(mc, tmp, &ctx->mc_list, list) {
+               list_del(&mc->list);
+               idr_remove(&multicast_idr, mc->id);
+               kfree(mc);
+       }
+       mutex_unlock(&mut);
+}
+
 static void ucma_cleanup_events(struct ucma_context *ctx)
 {
        struct ucma_event *uevent, *tmp;
@@ -360,6 +433,19 @@ static void ucma_cleanup_events(struct ucma_context *ctx)
        }
 }
 
+static void ucma_cleanup_mc_events(struct ucma_multicast *mc)
+{
+       struct ucma_event *uevent, *tmp;
+
+       list_for_each_entry_safe(uevent, tmp, &mc->ctx->file->event_list, list) {
+               if (uevent->mc != mc)
+                       continue;
+
+               list_del(&uevent->list);
+               kfree(uevent);
+       }
+}
+
 static int ucma_free_ctx(struct ucma_context *ctx)
 {
        int events_reported;
@@ -367,6 +453,8 @@ static int ucma_free_ctx(struct ucma_context *ctx)
        /* No new events will be generated after destroying the id. */
        rdma_destroy_id(ctx->cm_id);
 
+       ucma_cleanup_multicast(ctx);
+
        /* Cleanup events not yet reported to the user. */
        mutex_lock(&ctx->file->mut);
        ucma_cleanup_events(ctx);
@@ -731,6 +819,114 @@ static ssize_t ucma_notify(struct ucma_file *file, const char __user *inbuf,
        return ret;
 }
 
+static ssize_t ucma_join_multicast(struct ucma_file *file,
+                                  const char __user *inbuf,
+                                  int in_len, int out_len)
+{
+       struct rdma_ucm_join_mcast cmd;
+       struct rdma_ucm_create_id_resp resp;
+       struct ucma_context *ctx;
+       struct ucma_multicast *mc;
+       int ret;
+
+       if (out_len < sizeof(resp))
+               return -ENOSPC;
+
+       if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
+               return -EFAULT;
+
+       ctx = ucma_get_ctx(file, cmd.id);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
+
+       mutex_lock(&file->mut);
+       mc = ucma_alloc_multicast(ctx);
+       if (IS_ERR(mc)) {
+               ret = PTR_ERR(mc);
+               goto err1;
+       }
+
+       mc->uid = cmd.uid;
+       memcpy(&mc->addr, &cmd.addr, sizeof cmd.addr);
+       ret = rdma_join_multicast(ctx->cm_id, &mc->addr, mc);
+       if (ret)
+               goto err2;
+
+       resp.id = mc->id;
+       if (copy_to_user((void __user *)(unsigned long)cmd.response,
+                        &resp, sizeof(resp))) {
+               ret = -EFAULT;
+               goto err3;
+       }
+
+       mutex_unlock(&file->mut);
+       ucma_put_ctx(ctx);
+       return 0;
+
+err3:
+       rdma_leave_multicast(ctx->cm_id, &mc->addr);
+       ucma_cleanup_mc_events(mc);
+err2:
+       mutex_lock(&mut);
+       idr_remove(&multicast_idr, mc->id);
+       mutex_unlock(&mut);
+       list_del(&mc->list);
+       kfree(mc);
+err1:
+       mutex_unlock(&file->mut);
+       ucma_put_ctx(ctx);
+       return ret;
+}
+
+static ssize_t ucma_leave_multicast(struct ucma_file *file,
+                                   const char __user *inbuf,
+                                   int in_len, int out_len)
+{
+       struct rdma_ucm_destroy_id cmd;
+       struct rdma_ucm_destroy_id_resp resp;
+       struct ucma_multicast *mc;
+       int ret = 0;
+
+       if (out_len < sizeof(resp))
+               return -ENOSPC;
+
+       if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
+               return -EFAULT;
+
+       mutex_lock(&mut);
+       mc = idr_find(&multicast_idr, cmd.id);
+       if (!mc)
+               mc = ERR_PTR(-ENOENT);
+       else if (mc->ctx->file != file)
+               mc = ERR_PTR(-EINVAL);
+       else {
+               idr_remove(&multicast_idr, mc->id);
+               atomic_inc(&mc->ctx->ref);
+       }
+       mutex_unlock(&mut);
+
+       if (IS_ERR(mc)) {
+               ret = PTR_ERR(mc);
+               goto out;
+       }
+
+       rdma_leave_multicast(mc->ctx->cm_id, &mc->addr);
+       mutex_lock(&mc->ctx->file->mut);
+       ucma_cleanup_mc_events(mc);
+       list_del(&mc->list);
+       mutex_unlock(&mc->ctx->file->mut);
+
+       ucma_put_ctx(mc->ctx);
+       resp.events_reported = mc->events_reported;
+       kfree(mc);
+
+       if (copy_to_user((void __user *)(unsigned long)cmd.response,
+                        &resp, sizeof(resp)))
+               ret = -EFAULT;
+out:
+       return ret;
+}
+
 static ssize_t (*ucma_cmd_table[])(struct ucma_file *file,
                                   const char __user *inbuf,
                                   int in_len, int out_len) = {
@@ -750,6 +946,8 @@ static ssize_t (*ucma_cmd_table[])(struct ucma_file *file,
        [RDMA_USER_CM_CMD_GET_OPTION]   = NULL,
        [RDMA_USER_CM_CMD_SET_OPTION]   = NULL,
        [RDMA_USER_CM_CMD_NOTIFY]       = ucma_notify,
+       [RDMA_USER_CM_CMD_JOIN_MCAST]   = ucma_join_multicast,
+       [RDMA_USER_CM_CMD_LEAVE_MCAST]  = ucma_leave_multicast,
 };
 
 static ssize_t ucma_write(struct file *filp, const char __user *buf,
index 5a7306f5efae8433b2769cc59853ddc49f04b9c4..75f7b16a271d6652a9aac3326c6a56ffc18f5ffe 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 82fa72041989e54695a7bfc2b13279b4ea4fe1f2..114ac3b775dc2fb527222a0c575d782af5d7e736 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 1b97e80b87805d98f7b519f744334d1258c02337..8ab04a7c6f6eec1558546a57c8e2397e920e643c 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 997aa32cbf0794102677b448d3b03599d71e3869..65bf577311aa628af1e980f073e4c4c9268e1383 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index a6bbe8370d818c8328fbf48ff1e6c34bd93922c0..a2703a3d882d0c2279a215f0d90a6aa63ddb357f 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 103fc42d6976471a1d4b87ed51321b327d6d3c4c..90d7b8972cb46d21a554393abf88cd5d69730eff 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 4611afa5222003d9f121658116c364175920d4ef..0315c9d9fce931c680f99107c7cfc322f7d86533 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 6517ef85026feaa7b73a8b2c6ec52514b6d0b159..caf4e6007a44cc4aef2e47c08f2ebb5c0db4e875 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index a522b1baa3b40854fcdbca1b166e4052385b6024..e5442e34b788566f4adba514fa4bc332db8f8698 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 7c810d9042796c7fc87ec38cb1657bb4d94274b7..0c6f281bd4a03726c4875ccb03c75771bde28f7b 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 98b3bdb5de9e99872d8762eeed2a1b4131d42415..d7624c170ee73e16a13ef7c35c0366d37faa473a 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index a6efa8fe15d8cd000dece3cfaac93c2a86fb8469..54362afbf72f6f410b5224e8c297afb92559a6e3 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 2b6cd53bb3fc741344577cd461700c9174637627..a6c2c4ba29e69244b896849b376698a5c2ab7cd2 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 6861087d776cfecca15ab8e276f84284ede49eb4..2aef122f9955b63cce07d008aee911282cc14a40 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 61e3278fd7a88dd0cb5dc18f86399c0bbe9d7163..2af3e93b607f2a380f13b21148432e95bbd03557 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index e066727504b6db81ce4f9bfe406e43251c5b2f10..4dda2f6da2dec84869e0838e5ced54e5f86d3ff2 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -846,6 +845,8 @@ int iwch_modify_qp(struct iwch_dev *rhp, struct iwch_qp *qhp,
                        break;
                case IWCH_QP_STATE_TERMINATE:
                        qhp->attr.state = IWCH_QP_STATE_TERMINATE;
+                       if (t3b_device(qhp->rhp))
+                               cxio_set_wq_in_error(&qhp->wq);
                        if (!internal)
                                terminate = 1;
                        break;
index c4e7fbea8bbdb83d1839905c9d46b8c1772f06e4..cb7086f558c1e769ad66eee48fee14d1bbe97081 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 727b10d896868516e1776938ef5fdbafedd0cba7..1a854598e0e68d01ca4a4ede2bb765cc13e2dac5 100644 (file)
@@ -7,11 +7,3 @@ config INFINIBAND_EHCA
        To compile the driver as a module, choose M here. The module
        will be called ib_ehca.
 
-config INFINIBAND_EHCA_SCALING
-       bool "Scaling support (EXPERIMENTAL)"
-       depends on IBMEBUS && INFINIBAND_EHCA && HOTPLUG_CPU && EXPERIMENTAL
-       default y
-       ---help---
-       eHCA scaling support schedules the CQ callbacks to different CPUs.
-
-       To enable this feature choose Y here.
index cf95ee474b0f6a1105551ce69f342168d5c2034e..40404c9e28179558d45feccc83880feb8b4132b5 100644 (file)
@@ -42,8 +42,6 @@
 #ifndef __EHCA_CLASSES_H__
 #define __EHCA_CLASSES_H__
 
-#include "ehca_classes.h"
-#include "ipz_pt_fn.h"
 
 struct ehca_module;
 struct ehca_qp;
@@ -54,14 +52,22 @@ struct ehca_mw;
 struct ehca_pd;
 struct ehca_av;
 
+#include <rdma/ib_verbs.h>
+#include <rdma/ib_user_verbs.h>
+
 #ifdef CONFIG_PPC64
 #include "ehca_classes_pSeries.h"
 #endif
+#include "ipz_pt_fn.h"
+#include "ehca_qes.h"
+#include "ehca_irq.h"
 
-#include <rdma/ib_verbs.h>
-#include <rdma/ib_user_verbs.h>
+#define EHCA_EQE_CACHE_SIZE 20
 
-#include "ehca_irq.h"
+struct ehca_eqe_cache_entry {
+       struct ehca_eqe *eqe;
+       struct ehca_cq *cq;
+};
 
 struct ehca_eq {
        u32 length;
@@ -74,6 +80,8 @@ struct ehca_eq {
        spinlock_t spinlock;
        struct tasklet_struct interrupt_task;
        u32 ist;
+       spinlock_t irq_spinlock;
+       struct ehca_eqe_cache_entry eqe_cache[EHCA_EQE_CACHE_SIZE];
 };
 
 struct ehca_sport {
@@ -269,6 +277,7 @@ extern struct idr ehca_cq_idr;
 extern int ehca_static_rate;
 extern int ehca_port_act_time;
 extern int ehca_use_hp_mr;
+extern int ehca_scaling_code;
 
 struct ipzu_queue_resp {
        u32 qe_size;      /* queue entry size */
index 24ceab0bae4a5b9407e6a2b82ff115668830c04d..4961eb88827cd85bb6438a5777c1458297f349e0 100644 (file)
@@ -61,6 +61,7 @@ int ehca_create_eq(struct ehca_shca *shca,
        struct ib_device *ib_dev = &shca->ib_device;
 
        spin_lock_init(&eq->spinlock);
+       spin_lock_init(&eq->irq_spinlock);
        eq->is_initialized = 0;
 
        if (type != EHCA_EQ && type != EHCA_NEQ) {
index b7be950ab47c3a700737feae370d8bd09a2d2b69..30eb45df9f0b8d8207173c0023b481af89e6a95f 100644 (file)
@@ -162,6 +162,9 @@ int ehca_query_port(struct ib_device *ibdev,
        props->active_width    = IB_WIDTH_12X;
        props->active_speed    = 0x1;
 
+       /* at the moment (logical) link state is always LINK_UP */
+       props->phys_state      = 0x5;
+
 query_port1:
        ehca_free_fw_ctrlblock(rblock);
 
index 6c4f9f91b15df3e10f9e417f3deac51abcfd4077..3ec53c687d0823c2eb0e7d34409f8684d7bdbe5e 100644 (file)
 #define ERROR_DATA_LENGTH      EHCA_BMASK_IBM(52,63)
 #define ERROR_DATA_TYPE        EHCA_BMASK_IBM(0,7)
 
-#ifdef CONFIG_INFINIBAND_EHCA_SCALING
-
 static void queue_comp_task(struct ehca_cq *__cq);
 
 static struct ehca_comp_pool* pool;
 static struct notifier_block comp_pool_callback_nb;
 
-#endif
-
 static inline void comp_event_callback(struct ehca_cq *cq)
 {
        if (!cq->ib_cq.comp_handler)
@@ -206,7 +202,7 @@ static void qp_event_callback(struct ehca_shca *shca,
 }
 
 static void cq_event_callback(struct ehca_shca *shca,
-                                         u64 eqe)
+                             u64 eqe)
 {
        struct ehca_cq *cq;
        unsigned long flags;
@@ -318,7 +314,7 @@ static void parse_ec(struct ehca_shca *shca, u64 eqe)
                          "disruptive port %x configuration change", port);
 
                ehca_info(&shca->ib_device,
-                        "port %x is inactive.", port);
+                         "port %x is inactive.", port);
                event.device = &shca->ib_device;
                event.event = IB_EVENT_PORT_ERR;
                event.element.port_num = port;
@@ -326,7 +322,7 @@ static void parse_ec(struct ehca_shca *shca, u64 eqe)
                ib_dispatch_event(&event);
 
                ehca_info(&shca->ib_device,
-                        "port %x is active.", port);
+                         "port %x is active.", port);
                event.device = &shca->ib_device;
                event.event = IB_EVENT_PORT_ACTIVE;
                event.element.port_num = port;
@@ -401,115 +397,170 @@ irqreturn_t ehca_interrupt_eq(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-void ehca_tasklet_eq(unsigned long data)
-{
-       struct ehca_shca *shca = (struct ehca_shca*)data;
-       struct ehca_eqe *eqe;
-       int int_state;
-       int query_cnt = 0;
 
-       do {
-               eqe = (struct ehca_eqe *)ehca_poll_eq(shca, &shca->eq);
+static inline void process_eqe(struct ehca_shca *shca, struct ehca_eqe *eqe)
+{
+       u64 eqe_value;
+       u32 token;
+       unsigned long flags;
+       struct ehca_cq *cq;
+       eqe_value = eqe->entry;
+       ehca_dbg(&shca->ib_device, "eqe_value=%lx", eqe_value);
+       if (EHCA_BMASK_GET(EQE_COMPLETION_EVENT, eqe_value)) {
+               ehca_dbg(&shca->ib_device, "... completion event");
+               token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe_value);
+               spin_lock_irqsave(&ehca_cq_idr_lock, flags);
+               cq = idr_find(&ehca_cq_idr, token);
+               if (cq == NULL) {
+                       spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
+                       ehca_err(&shca->ib_device,
+                                "Invalid eqe for non-existing cq token=%x",
+                                token);
+                       return;
+               }
+               reset_eq_pending(cq);
+               if (ehca_scaling_code) {
+                       queue_comp_task(cq);
+                       spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
+               } else {
+                       spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
+                       comp_event_callback(cq);
+               }
+       } else {
+               ehca_dbg(&shca->ib_device,
+                        "Got non completion event");
+               parse_identifier(shca, eqe_value);
+       }
+}
 
-               if ((shca->hw_level >= 2) && eqe)
-                       int_state = 1;
-               else
-                       int_state = 0;
-
-               while ((int_state == 1) || eqe) {
-                       while (eqe) {
-                               u64 eqe_value = eqe->entry;
-
-                               ehca_dbg(&shca->ib_device,
-                                        "eqe_value=%lx", eqe_value);
-
-                               /* TODO: better structure */
-                               if (EHCA_BMASK_GET(EQE_COMPLETION_EVENT,
-                                                  eqe_value)) {
-                                       unsigned long flags;
-                                       u32 token;
-                                       struct ehca_cq *cq;
-
-                                       ehca_dbg(&shca->ib_device,
-                                                "... completion event");
-                                       token =
-                                               EHCA_BMASK_GET(EQE_CQ_TOKEN,
-                                                              eqe_value);
-                                       spin_lock_irqsave(&ehca_cq_idr_lock,
-                                                         flags);
-                                       cq = idr_find(&ehca_cq_idr, token);
-
-                                       if (cq == NULL) {
-                                               spin_unlock_irqrestore(&ehca_cq_idr_lock,
-                                                                      flags);
-                                               break;
-                                       }
-
-                                       reset_eq_pending(cq);
-#ifdef CONFIG_INFINIBAND_EHCA_SCALING
-                                       queue_comp_task(cq);
-                                       spin_unlock_irqrestore(&ehca_cq_idr_lock,
-                                                              flags);
-#else
-                                       spin_unlock_irqrestore(&ehca_cq_idr_lock,
-                                                              flags);
-                                       comp_event_callback(cq);
-#endif
-                               } else {
-                                       ehca_dbg(&shca->ib_device,
-                                                "... non completion event");
-                                       parse_identifier(shca, eqe_value);
-                               }
-                               eqe =
-                                       (struct ehca_eqe *)ehca_poll_eq(shca,
-                                                                   &shca->eq);
-                       }
+void ehca_process_eq(struct ehca_shca *shca, int is_irq)
+{
+       struct ehca_eq *eq = &shca->eq;
+       struct ehca_eqe_cache_entry *eqe_cache = eq->eqe_cache;
+       u64 eqe_value;
+       unsigned long flags;
+       int eqe_cnt, i;
+       int eq_empty = 0;
+
+       spin_lock_irqsave(&eq->irq_spinlock, flags);
+       if (is_irq) {
+               const int max_query_cnt = 100;
+               int query_cnt = 0;
+               int int_state = 1;
+               do {
+                       int_state = hipz_h_query_int_state(
+                               shca->ipz_hca_handle, eq->ist);
+                       query_cnt++;
+                       iosync();
+               } while (int_state && query_cnt < max_query_cnt);
+               if (unlikely((query_cnt == max_query_cnt)))
+                       ehca_dbg(&shca->ib_device, "int_state=%x query_cnt=%x",
+                                int_state, query_cnt);
+       }
 
-                       if (shca->hw_level >= 2) {
-                               int_state =
-                                   hipz_h_query_int_state(shca->ipz_hca_handle,
-                                                          shca->eq.ist);
-                               query_cnt++;
-                               iosync();
-                               if (query_cnt >= 100) {
-                                       query_cnt = 0;
-                                       int_state = 0;
-                               }
+       /* read out all eqes */
+       eqe_cnt = 0;
+       do {
+               u32 token;
+               eqe_cache[eqe_cnt].eqe =
+                       (struct ehca_eqe *)ehca_poll_eq(shca, eq);
+               if (!eqe_cache[eqe_cnt].eqe)
+                       break;
+               eqe_value = eqe_cache[eqe_cnt].eqe->entry;
+               if (EHCA_BMASK_GET(EQE_COMPLETION_EVENT, eqe_value)) {
+                       token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe_value);
+                       spin_lock(&ehca_cq_idr_lock);
+                       eqe_cache[eqe_cnt].cq = idr_find(&ehca_cq_idr, token);
+                       if (!eqe_cache[eqe_cnt].cq) {
+                               spin_unlock(&ehca_cq_idr_lock);
+                               ehca_err(&shca->ib_device,
+                                        "Invalid eqe for non-existing cq "
+                                        "token=%x", token);
+                               continue;
                        }
-                       eqe = (struct ehca_eqe *)ehca_poll_eq(shca, &shca->eq);
-
+                       spin_unlock(&ehca_cq_idr_lock);
+               } else
+                       eqe_cache[eqe_cnt].cq = NULL;
+               eqe_cnt++;
+       } while (eqe_cnt < EHCA_EQE_CACHE_SIZE);
+       if (!eqe_cnt) {
+               if (is_irq)
+                       ehca_dbg(&shca->ib_device,
+                                "No eqe found for irq event");
+               goto unlock_irq_spinlock;
+       } else if (!is_irq)
+               ehca_dbg(&shca->ib_device, "deadman found %x eqe", eqe_cnt);
+       if (unlikely(eqe_cnt == EHCA_EQE_CACHE_SIZE))
+               ehca_dbg(&shca->ib_device, "too many eqes for one irq event");
+       /* enable irq for new packets */
+       for (i = 0; i < eqe_cnt; i++) {
+               if (eq->eqe_cache[i].cq)
+                       reset_eq_pending(eq->eqe_cache[i].cq);
+       }
+       /* check eq */
+       spin_lock(&eq->spinlock);
+       eq_empty = (!ipz_eqit_eq_peek_valid(&shca->eq.ipz_queue));
+       spin_unlock(&eq->spinlock);
+       /* call completion handler for cached eqes */
+       for (i = 0; i < eqe_cnt; i++)
+               if (eq->eqe_cache[i].cq) {
+                       if (ehca_scaling_code) {
+                               spin_lock(&ehca_cq_idr_lock);
+                               queue_comp_task(eq->eqe_cache[i].cq);
+                               spin_unlock(&ehca_cq_idr_lock);
+                       } else
+                               comp_event_callback(eq->eqe_cache[i].cq);
+               } else {
+                       ehca_dbg(&shca->ib_device, "Got non completion event");
+                       parse_identifier(shca, eq->eqe_cache[i].eqe->entry);
                }
-       } while (int_state != 0);
-
-       return;
+       /* poll eq if not empty */
+       if (eq_empty)
+               goto unlock_irq_spinlock;
+       do {
+               struct ehca_eqe *eqe;
+               eqe = (struct ehca_eqe *)ehca_poll_eq(shca, &shca->eq);
+               if (!eqe)
+                       break;
+               process_eqe(shca, eqe);
+               eqe_cnt++;
+       } while (1);
+
+unlock_irq_spinlock:
+       spin_unlock_irqrestore(&eq->irq_spinlock, flags);
 }
 
-#ifdef CONFIG_INFINIBAND_EHCA_SCALING
+void ehca_tasklet_eq(unsigned long data)
+{
+       ehca_process_eq((struct ehca_shca*)data, 1);
+}
 
 static inline int find_next_online_cpu(struct ehca_comp_pool* pool)
 {
-       unsigned long flags_last_cpu;
+       int cpu;
+       unsigned long flags;
 
+       WARN_ON_ONCE(!in_interrupt());
        if (ehca_debug_level)
                ehca_dmp(&cpu_online_map, sizeof(cpumask_t), "");
 
-       spin_lock_irqsave(&pool->last_cpu_lock, flags_last_cpu);
-       pool->last_cpu = next_cpu(pool->last_cpu, cpu_online_map);
-       if (pool->last_cpu == NR_CPUS)
-               pool->last_cpu = first_cpu(cpu_online_map);
-       spin_unlock_irqrestore(&pool->last_cpu_lock, flags_last_cpu);
+       spin_lock_irqsave(&pool->last_cpu_lock, flags);
+       cpu = next_cpu(pool->last_cpu, cpu_online_map);
+       if (cpu == NR_CPUS)
+               cpu = first_cpu(cpu_online_map);
+       pool->last_cpu = cpu;
+       spin_unlock_irqrestore(&pool->last_cpu_lock, flags);
 
-       return pool->last_cpu;
+       return cpu;
 }
 
 static void __queue_comp_task(struct ehca_cq *__cq,
                              struct ehca_cpu_comp_task *cct)
 {
-       unsigned long flags_cct;
-       unsigned long flags_cq;
+       unsigned long flags;
 
-       spin_lock_irqsave(&cct->task_lock, flags_cct);
-       spin_lock_irqsave(&__cq->task_lock, flags_cq);
+       spin_lock_irqsave(&cct->task_lock, flags);
+       spin_lock(&__cq->task_lock);
 
        if (__cq->nr_callbacks == 0) {
                __cq->nr_callbacks++;
@@ -520,8 +571,8 @@ static void __queue_comp_task(struct ehca_cq *__cq,
        else
                __cq->nr_callbacks++;
 
-       spin_unlock_irqrestore(&__cq->task_lock, flags_cq);
-       spin_unlock_irqrestore(&cct->task_lock, flags_cct);
+       spin_unlock(&__cq->task_lock);
+       spin_unlock_irqrestore(&cct->task_lock, flags);
 }
 
 static void queue_comp_task(struct ehca_cq *__cq)
@@ -532,69 +583,69 @@ static void queue_comp_task(struct ehca_cq *__cq)
 
        cpu = get_cpu();
        cpu_id = find_next_online_cpu(pool);
-
        BUG_ON(!cpu_online(cpu_id));
 
        cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id);
+       BUG_ON(!cct);
 
        if (cct->cq_jobs > 0) {
                cpu_id = find_next_online_cpu(pool);
                cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id);
+               BUG_ON(!cct);
        }
 
        __queue_comp_task(__cq, cct);
-
-       put_cpu();
-
-       return;
 }
 
 static void run_comp_task(struct ehca_cpu_comp_task* cct)
 {
        struct ehca_cq *cq;
-       unsigned long flags_cct;
-       unsigned long flags_cq;
+       unsigned long flags;
 
-       spin_lock_irqsave(&cct->task_lock, flags_cct);
+       spin_lock_irqsave(&cct->task_lock, flags);
 
        while (!list_empty(&cct->cq_list)) {
                cq = list_entry(cct->cq_list.next, struct ehca_cq, entry);
-               spin_unlock_irqrestore(&cct->task_lock, flags_cct);
+               spin_unlock_irqrestore(&cct->task_lock, flags);
                comp_event_callback(cq);
-               spin_lock_irqsave(&cct->task_lock, flags_cct);
+               spin_lock_irqsave(&cct->task_lock, flags);
 
-               spin_lock_irqsave(&cq->task_lock, flags_cq);
+               spin_lock(&cq->task_lock);
                cq->nr_callbacks--;
                if (cq->nr_callbacks == 0) {
                        list_del_init(cct->cq_list.next);
                        cct->cq_jobs--;
                }
-               spin_unlock_irqrestore(&cq->task_lock, flags_cq);
-
+               spin_unlock(&cq->task_lock);
        }
 
-       spin_unlock_irqrestore(&cct->task_lock, flags_cct);
-
-       return;
+       spin_unlock_irqrestore(&cct->task_lock, flags);
 }
 
 static int comp_task(void *__cct)
 {
        struct ehca_cpu_comp_task* cct = __cct;
+       int cql_empty;
        DECLARE_WAITQUEUE(wait, current);
 
        set_current_state(TASK_INTERRUPTIBLE);
        while(!kthread_should_stop()) {
                add_wait_queue(&cct->wait_queue, &wait);
 
-               if (list_empty(&cct->cq_list))
+               spin_lock_irq(&cct->task_lock);
+               cql_empty = list_empty(&cct->cq_list);
+               spin_unlock_irq(&cct->task_lock);
+               if (cql_empty)
                        schedule();
                else
                        __set_current_state(TASK_RUNNING);
 
                remove_wait_queue(&cct->wait_queue, &wait);
 
-               if (!list_empty(&cct->cq_list))
+               spin_lock_irq(&cct->task_lock);
+               cql_empty = list_empty(&cct->cq_list);
+               spin_unlock_irq(&cct->task_lock);
+               if (!cql_empty)
                        run_comp_task(__cct);
 
                set_current_state(TASK_INTERRUPTIBLE);
@@ -637,8 +688,6 @@ static void destroy_comp_task(struct ehca_comp_pool *pool,
 
        if (task)
                kthread_stop(task);
-
-       return;
 }
 
 static void take_over_work(struct ehca_comp_pool *pool,
@@ -654,11 +703,11 @@ static void take_over_work(struct ehca_comp_pool *pool,
        list_splice_init(&cct->cq_list, &list);
 
        while(!list_empty(&list)) {
-              cq = list_entry(cct->cq_list.next, struct ehca_cq, entry);
+               cq = list_entry(cct->cq_list.next, struct ehca_cq, entry);
 
-              list_del(&cq->entry);
-              __queue_comp_task(cq, per_cpu_ptr(pool->cpu_comp_tasks,
-                                                smp_processor_id()));
+               list_del(&cq->entry);
+               __queue_comp_task(cq, per_cpu_ptr(pool->cpu_comp_tasks,
+                                                 smp_processor_id()));
        }
 
        spin_unlock_irqrestore(&cct->task_lock, flags_cct);
@@ -708,14 +757,14 @@ static int comp_pool_callback(struct notifier_block *nfb,
        return NOTIFY_OK;
 }
 
-#endif
-
 int ehca_create_comp_pool(void)
 {
-#ifdef CONFIG_INFINIBAND_EHCA_SCALING
        int cpu;
        struct task_struct *task;
 
+       if (!ehca_scaling_code)
+               return 0;
+
        pool = kzalloc(sizeof(struct ehca_comp_pool), GFP_KERNEL);
        if (pool == NULL)
                return -ENOMEM;
@@ -740,16 +789,19 @@ int ehca_create_comp_pool(void)
        comp_pool_callback_nb.notifier_call = comp_pool_callback;
        comp_pool_callback_nb.priority =0;
        register_cpu_notifier(&comp_pool_callback_nb);
-#endif
+
+       printk(KERN_INFO "eHCA scaling code enabled\n");
 
        return 0;
 }
 
 void ehca_destroy_comp_pool(void)
 {
-#ifdef CONFIG_INFINIBAND_EHCA_SCALING
        int i;
 
+       if (!ehca_scaling_code)
+               return;
+
        unregister_cpu_notifier(&comp_pool_callback_nb);
 
        for (i = 0; i < NR_CPUS; i++) {
@@ -758,7 +810,4 @@ void ehca_destroy_comp_pool(void)
        }
        free_percpu(pool->cpu_comp_tasks);
        kfree(pool);
-#endif
-
-       return;
 }
index be579cc0adf632f23283aedf74668a5714a0a2c9..6ed06ee033ed2f326a6674d21701eed3479fa2df 100644 (file)
@@ -56,6 +56,7 @@ void ehca_tasklet_neq(unsigned long data);
 
 irqreturn_t ehca_interrupt_eq(int irq, void *dev_id);
 void ehca_tasklet_eq(unsigned long data);
+void ehca_process_eq(struct ehca_shca *shca, int is_irq);
 
 struct ehca_cpu_comp_task {
        wait_queue_head_t wait_queue;
index 1155bcf48212ef33da22d188a4530d7545e92661..c1835121a82223612195fce09369ba0b58173e4a 100644 (file)
@@ -52,7 +52,7 @@
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>");
 MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver");
-MODULE_VERSION("SVNEHCA_0020");
+MODULE_VERSION("SVNEHCA_0021");
 
 int ehca_open_aqp1     = 0;
 int ehca_debug_level   = 0;
@@ -62,6 +62,7 @@ int ehca_use_hp_mr     = 0;
 int ehca_port_act_time = 30;
 int ehca_poll_all_eqs  = 1;
 int ehca_static_rate   = -1;
+int ehca_scaling_code  = 1;
 
 module_param_named(open_aqp1,     ehca_open_aqp1,     int, 0);
 module_param_named(debug_level,   ehca_debug_level,   int, 0);
@@ -71,6 +72,7 @@ module_param_named(use_hp_mr,     ehca_use_hp_mr,     int, 0);
 module_param_named(port_act_time, ehca_port_act_time, int, 0);
 module_param_named(poll_all_eqs,  ehca_poll_all_eqs,  int, 0);
 module_param_named(static_rate,   ehca_static_rate,   int, 0);
+module_param_named(scaling_code,   ehca_scaling_code,   int, 0);
 
 MODULE_PARM_DESC(open_aqp1,
                 "AQP1 on startup (0: no (default), 1: yes)");
@@ -91,6 +93,8 @@ MODULE_PARM_DESC(poll_all_eqs,
                 " (0: no, 1: yes (default))");
 MODULE_PARM_DESC(static_rate,
                 "set permanent static rate (default: disabled)");
+MODULE_PARM_DESC(scaling_code,
+                "set scaling code (0: disabled, 1: enabled/default)");
 
 spinlock_t ehca_qp_idr_lock;
 spinlock_t ehca_cq_idr_lock;
@@ -432,8 +436,8 @@ static int ehca_destroy_aqp1(struct ehca_sport *sport)
 
 static ssize_t ehca_show_debug_level(struct device_driver *ddp, char *buf)
 {
-       return  snprintf(buf, PAGE_SIZE, "%d\n",
-                        ehca_debug_level);
+       return snprintf(buf, PAGE_SIZE, "%d\n",
+                       ehca_debug_level);
 }
 
 static ssize_t ehca_store_debug_level(struct device_driver *ddp,
@@ -778,8 +782,24 @@ void ehca_poll_eqs(unsigned long data)
 
        spin_lock(&shca_list_lock);
        list_for_each_entry(shca, &shca_list, shca_list) {
-               if (shca->eq.is_initialized)
-                       ehca_tasklet_eq((unsigned long)(void*)shca);
+               if (shca->eq.is_initialized) {
+                       /* call deadman proc only if eq ptr does not change */
+                       struct ehca_eq *eq = &shca->eq;
+                       int max = 3;
+                       volatile u64 q_ofs, q_ofs2;
+                       u64 flags;
+                       spin_lock_irqsave(&eq->spinlock, flags);
+                       q_ofs = eq->ipz_queue.current_q_offset;
+                       spin_unlock_irqrestore(&eq->spinlock, flags);
+                       do {
+                               spin_lock_irqsave(&eq->spinlock, flags);
+                               q_ofs2 = eq->ipz_queue.current_q_offset;
+                               spin_unlock_irqrestore(&eq->spinlock, flags);
+                               max--;
+                       } while (q_ofs == q_ofs2 && max > 0);
+                       if (q_ofs == q_ofs2)
+                               ehca_process_eq(shca, 0);
+               }
        }
        mod_timer(&poll_eqs_timer, jiffies + HZ);
        spin_unlock(&shca_list_lock);
@@ -790,7 +810,7 @@ int __init ehca_module_init(void)
        int ret;
 
        printk(KERN_INFO "eHCA Infiniband Device Driver "
-                        "(Rel.: SVNEHCA_0020)\n");
+              "(Rel.: SVNEHCA_0021)\n");
        idr_init(&ehca_qp_idr);
        idr_init(&ehca_cq_idr);
        spin_lock_init(&ehca_qp_idr_lock);
index dc3bda2634b7dfcbd5fd3db3e791249c1d0cbe22..8199c45768a321a9c89d54f18d0d03c759a5a7e0 100644 (file)
@@ -79,7 +79,7 @@ static inline void *ipz_qeit_calc(struct ipz_queue *queue, u64 q_offset)
        if (q_offset >= queue->queue_length)
                return NULL;
        current_page = (queue->queue_pages)[q_offset >> EHCA_PAGESHIFT];
-       return  &current_page->entries[q_offset & (EHCA_PAGESIZE - 1)];
+       return &current_page->entries[q_offset & (EHCA_PAGESIZE - 1)];
 }
 
 /*
@@ -247,6 +247,15 @@ static inline void *ipz_eqit_eq_get_inc_valid(struct ipz_queue *queue)
        return ret;
 }
 
+static inline void *ipz_eqit_eq_peek_valid(struct ipz_queue *queue)
+{
+       void *ret = ipz_qeit_get(queue);
+       u32 qe = *(u8 *) ret;
+       if ((qe >> 7) != (queue->toggle_state & 1))
+               return NULL;
+       return ret;
+}
+
 /* returns address (GX) of first queue entry */
 static inline u64 ipz_qpt_get_firstpage(struct ipz_qpt *qpt)
 {
index 6e0f2b8918ce893ce746fba86726e9140185df32..f6f9490408258da1c8e49b09a54a362e48930ff0 100644 (file)
@@ -96,8 +96,8 @@ static void ipath_dma_unmap_page(struct ib_device *dev,
        BUG_ON(!valid_dma_direction(direction));
 }
 
-int ipath_map_sg(struct ib_device *dev, struct scatterlist *sg, int nents,
-                enum dma_data_direction direction)
+static int ipath_map_sg(struct ib_device *dev, struct scatterlist *sg, int nents,
+                       enum dma_data_direction direction)
 {
        u64 addr;
        int i;
index 0b9d053a599d2c3a328913aceccafb5721ed5698..48f7c65e9aedb372336ec0db1e299276f94e01e8 100644 (file)
@@ -175,7 +175,9 @@ struct mthca_icm *mthca_alloc_icm(struct mthca_dev *dev, int npages,
                if (!ret) {
                        ++chunk->npages;
 
-                       if (!coherent && chunk->npages == MTHCA_ICM_CHUNK_LEN) {
+                       if (coherent)
+                               ++chunk->nsg;
+                       else if (chunk->npages == MTHCA_ICM_CHUNK_LEN) {
                                chunk->nsg = pci_map_sg(dev->pdev, chunk->mem,
                                                        chunk->npages,
                                                        PCI_DMA_BIDIRECTIONAL);
index 224c93dd29eb7ecd9c56e8df0044aaa5c6609277..71dc84bd425498cd968a33cfa6e005804861474f 100644 (file)
@@ -573,6 +573,11 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
                goto out;
        }
 
+       if (cur_state == new_state && cur_state == IB_QPS_RESET) {
+               err = 0;
+               goto out;
+       }
+
        if ((attr_mask & IB_QP_PKEY_INDEX) &&
             attr->pkey_index >= dev->limits.pkey_table_len) {
                mthca_dbg(dev, "P_Key index (%u) too large. max is %d\n",
index 2d483874a58909ca77d359c1d201067dea7cb450..4d59682f7d4a39084e61361925c6b7dc0041047c 100644 (file)
@@ -145,7 +145,7 @@ partial_error:
        for (; i >= 0; --i)
                ib_dma_unmap_single(priv->ca, mapping[i + 1], PAGE_SIZE, DMA_FROM_DEVICE);
 
-       kfree_skb(skb);
+       dev_kfree_skb_any(skb);
        return -ENOMEM;
 }
 
@@ -1138,7 +1138,7 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr,
        return -EINVAL;
 }
 
-static DEVICE_ATTR(mode, S_IWUGO | S_IRUGO, show_mode, set_mode);
+static DEVICE_ATTR(mode, S_IWUSR | S_IRUGO, show_mode, set_mode);
 
 int ipoib_cm_add_mode_attr(struct net_device *dev)
 {
index fea737f520fdfeae5a8a7b85765799552406b379..b303ce6bc21ee6664d1471a3a99d2455e11aef2e 100644 (file)
@@ -60,14 +60,11 @@ static DEFINE_MUTEX(mcast_mutex);
 /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */
 struct ipoib_mcast {
        struct ib_sa_mcmember_rec mcmember;
+       struct ib_sa_multicast   *mc;
        struct ipoib_ah          *ah;
 
        struct rb_node    rb_node;
        struct list_head  list;
-       struct completion done;
-
-       int                 query_id;
-       struct ib_sa_query *query;
 
        unsigned long created;
        unsigned long backoff;
@@ -299,18 +296,22 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
        return 0;
 }
 
-static void
+static int
 ipoib_mcast_sendonly_join_complete(int status,
-                                  struct ib_sa_mcmember_rec *mcmember,
-                                  void *mcast_ptr)
+                                  struct ib_sa_multicast *multicast)
 {
-       struct ipoib_mcast *mcast = mcast_ptr;
+       struct ipoib_mcast *mcast = multicast->context;
        struct net_device *dev = mcast->dev;
        struct ipoib_dev_priv *priv = netdev_priv(dev);
 
+       /* We trap for port events ourselves. */
+       if (status == -ENETRESET)
+               return 0;
+
        if (!status)
-               ipoib_mcast_join_finish(mcast, mcmember);
-       else {
+               status = ipoib_mcast_join_finish(mcast, &multicast->rec);
+
+       if (status) {
                if (mcast->logcount++ < 20)
                        ipoib_dbg_mcast(netdev_priv(dev), "multicast join failed for "
                                        IPOIB_GID_FMT ", status %d\n",
@@ -325,11 +326,10 @@ ipoib_mcast_sendonly_join_complete(int status,
                spin_unlock_irq(&priv->tx_lock);
 
                /* Clear the busy flag so we try again */
-               clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags);
-               mcast->query = NULL;
+               status = test_and_clear_bit(IPOIB_MCAST_FLAG_BUSY,
+                                           &mcast->flags);
        }
-
-       complete(&mcast->done);
+       return status;
 }
 
 static int ipoib_mcast_sendonly_join(struct ipoib_mcast *mcast)
@@ -359,35 +359,33 @@ static int ipoib_mcast_sendonly_join(struct ipoib_mcast *mcast)
        rec.port_gid = priv->local_gid;
        rec.pkey     = cpu_to_be16(priv->pkey);
 
-       init_completion(&mcast->done);
-
-       ret = ib_sa_mcmember_rec_set(&ipoib_sa_client, priv->ca, priv->port, &rec,
-                                    IB_SA_MCMEMBER_REC_MGID            |
-                                    IB_SA_MCMEMBER_REC_PORT_GID        |
-                                    IB_SA_MCMEMBER_REC_PKEY            |
-                                    IB_SA_MCMEMBER_REC_JOIN_STATE,
-                                    1000, GFP_ATOMIC,
-                                    ipoib_mcast_sendonly_join_complete,
-                                    mcast, &mcast->query);
-       if (ret < 0) {
-               ipoib_warn(priv, "ib_sa_mcmember_rec_set failed (ret = %d)\n",
+       mcast->mc = ib_sa_join_multicast(&ipoib_sa_client, priv->ca,
+                                        priv->port, &rec,
+                                        IB_SA_MCMEMBER_REC_MGID        |
+                                        IB_SA_MCMEMBER_REC_PORT_GID    |
+                                        IB_SA_MCMEMBER_REC_PKEY        |
+                                        IB_SA_MCMEMBER_REC_JOIN_STATE,
+                                        GFP_ATOMIC,
+                                        ipoib_mcast_sendonly_join_complete,
+                                        mcast);
+       if (IS_ERR(mcast->mc)) {
+               ret = PTR_ERR(mcast->mc);
+               clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags);
+               ipoib_warn(priv, "ib_sa_join_multicast failed (ret = %d)\n",
                           ret);
        } else {
                ipoib_dbg_mcast(priv, "no multicast record for " IPOIB_GID_FMT
                                ", starting join\n",
                                IPOIB_GID_ARG(mcast->mcmember.mgid));
-
-               mcast->query_id = ret;
        }
 
        return ret;
 }
 
-static void ipoib_mcast_join_complete(int status,
-                                     struct ib_sa_mcmember_rec *mcmember,
-                                     void *mcast_ptr)
+static int ipoib_mcast_join_complete(int status,
+                                    struct ib_sa_multicast *multicast)
 {
-       struct ipoib_mcast *mcast = mcast_ptr;
+       struct ipoib_mcast *mcast = multicast->context;
        struct net_device *dev = mcast->dev;
        struct ipoib_dev_priv *priv = netdev_priv(dev);
 
@@ -395,24 +393,25 @@ static void ipoib_mcast_join_complete(int status,
                        " (status %d)\n",
                        IPOIB_GID_ARG(mcast->mcmember.mgid), status);
 
-       if (!status && !ipoib_mcast_join_finish(mcast, mcmember)) {
+       /* We trap for port events ourselves. */
+       if (status == -ENETRESET)
+               return 0;
+
+       if (!status)
+               status = ipoib_mcast_join_finish(mcast, &multicast->rec);
+
+       if (!status) {
                mcast->backoff = 1;
                mutex_lock(&mcast_mutex);
                if (test_bit(IPOIB_MCAST_RUN, &priv->flags))
                        queue_delayed_work(ipoib_workqueue,
                                           &priv->mcast_task, 0);
                mutex_unlock(&mcast_mutex);
-               complete(&mcast->done);
-               return;
-       }
-
-       if (status == -EINTR) {
-               complete(&mcast->done);
-               return;
+               return 0;
        }
 
-       if (status && mcast->logcount++ < 20) {
-               if (status == -ETIMEDOUT || status == -EINTR) {
+       if (mcast->logcount++ < 20) {
+               if (status == -ETIMEDOUT) {
                        ipoib_dbg_mcast(priv, "multicast join failed for " IPOIB_GID_FMT
                                        ", status %d\n",
                                        IPOIB_GID_ARG(mcast->mcmember.mgid),
@@ -429,24 +428,18 @@ static void ipoib_mcast_join_complete(int status,
        if (mcast->backoff > IPOIB_MAX_BACKOFF_SECONDS)
                mcast->backoff = IPOIB_MAX_BACKOFF_SECONDS;
 
-       mutex_lock(&mcast_mutex);
+       /* Clear the busy flag so we try again */
+       status = test_and_clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags);
 
+       mutex_lock(&mcast_mutex);
        spin_lock_irq(&priv->lock);
-       mcast->query = NULL;
-
-       if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) {
-               if (status == -ETIMEDOUT)
-                       queue_delayed_work(ipoib_workqueue, &priv->mcast_task,
-                                          0);
-               else
-                       queue_delayed_work(ipoib_workqueue, &priv->mcast_task,
-                                          mcast->backoff * HZ);
-       } else
-               complete(&mcast->done);
+       if (test_bit(IPOIB_MCAST_RUN, &priv->flags))
+               queue_delayed_work(ipoib_workqueue, &priv->mcast_task,
+                                  mcast->backoff * HZ);
        spin_unlock_irq(&priv->lock);
        mutex_unlock(&mcast_mutex);
 
-       return;
+       return status;
 }
 
 static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast,
@@ -495,15 +488,14 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast,
                rec.hop_limit     = priv->broadcast->mcmember.hop_limit;
        }
 
-       init_completion(&mcast->done);
-
-       ret = ib_sa_mcmember_rec_set(&ipoib_sa_client, priv->ca, priv->port,
-                                    &rec, comp_mask, mcast->backoff * 1000,
-                                    GFP_ATOMIC, ipoib_mcast_join_complete,
-                                    mcast, &mcast->query);
-
-       if (ret < 0) {
-               ipoib_warn(priv, "ib_sa_mcmember_rec_set failed, status %d\n", ret);
+       set_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags);
+       mcast->mc = ib_sa_join_multicast(&ipoib_sa_client, priv->ca, priv->port,
+                                        &rec, comp_mask, GFP_KERNEL,
+                                        ipoib_mcast_join_complete, mcast);
+       if (IS_ERR(mcast->mc)) {
+               clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags);
+               ret = PTR_ERR(mcast->mc);
+               ipoib_warn(priv, "ib_sa_join_multicast failed, status %d\n", ret);
 
                mcast->backoff *= 2;
                if (mcast->backoff > IPOIB_MAX_BACKOFF_SECONDS)
@@ -515,8 +507,7 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast,
                                           &priv->mcast_task,
                                           mcast->backoff * HZ);
                mutex_unlock(&mcast_mutex);
-       } else
-               mcast->query_id = ret;
+       }
 }
 
 void ipoib_mcast_join_task(struct work_struct *work)
@@ -541,7 +532,7 @@ void ipoib_mcast_join_task(struct work_struct *work)
                        priv->local_rate = attr.active_speed *
                                ib_width_enum_to_int(attr.active_width);
                } else
-               ipoib_warn(priv, "ib_query_port failed\n");
+                       ipoib_warn(priv, "ib_query_port failed\n");
        }
 
        if (!priv->broadcast) {
@@ -568,7 +559,8 @@ void ipoib_mcast_join_task(struct work_struct *work)
        }
 
        if (!test_bit(IPOIB_MCAST_FLAG_ATTACHED, &priv->broadcast->flags)) {
-               ipoib_mcast_join(dev, priv->broadcast, 0);
+               if (!test_bit(IPOIB_MCAST_FLAG_BUSY, &priv->broadcast->flags))
+                       ipoib_mcast_join(dev, priv->broadcast, 0);
                return;
        }
 
@@ -625,26 +617,9 @@ int ipoib_mcast_start_thread(struct net_device *dev)
        return 0;
 }
 
-static void wait_for_mcast_join(struct ipoib_dev_priv *priv,
-                               struct ipoib_mcast *mcast)
-{
-       spin_lock_irq(&priv->lock);
-       if (mcast && mcast->query) {
-               ib_sa_cancel_query(mcast->query_id, mcast->query);
-               mcast->query = NULL;
-               spin_unlock_irq(&priv->lock);
-               ipoib_dbg_mcast(priv, "waiting for MGID " IPOIB_GID_FMT "\n",
-                               IPOIB_GID_ARG(mcast->mcmember.mgid));
-               wait_for_completion(&mcast->done);
-       }
-       else
-               spin_unlock_irq(&priv->lock);
-}
-
 int ipoib_mcast_stop_thread(struct net_device *dev, int flush)
 {
        struct ipoib_dev_priv *priv = netdev_priv(dev);
-       struct ipoib_mcast *mcast;
 
        ipoib_dbg_mcast(priv, "stopping multicast thread\n");
 
@@ -660,52 +635,27 @@ int ipoib_mcast_stop_thread(struct net_device *dev, int flush)
        if (flush)
                flush_workqueue(ipoib_workqueue);
 
-       wait_for_mcast_join(priv, priv->broadcast);
-
-       list_for_each_entry(mcast, &priv->multicast_list, list)
-               wait_for_mcast_join(priv, mcast);
-
        return 0;
 }
 
 static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast)
 {
        struct ipoib_dev_priv *priv = netdev_priv(dev);
-       struct ib_sa_mcmember_rec rec = {
-               .join_state = 1
-       };
        int ret = 0;
 
-       if (!test_and_clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags))
-               return 0;
-
-       ipoib_dbg_mcast(priv, "leaving MGID " IPOIB_GID_FMT "\n",
-                       IPOIB_GID_ARG(mcast->mcmember.mgid));
-
-       rec.mgid     = mcast->mcmember.mgid;
-       rec.port_gid = priv->local_gid;
-       rec.pkey     = cpu_to_be16(priv->pkey);
+       if (test_and_clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) {
+               ipoib_dbg_mcast(priv, "leaving MGID " IPOIB_GID_FMT "\n",
+                               IPOIB_GID_ARG(mcast->mcmember.mgid));
 
-       /* Remove ourselves from the multicast group */
-       ret = ipoib_mcast_detach(dev, be16_to_cpu(mcast->mcmember.mlid),
-                                &mcast->mcmember.mgid);
-       if (ret)
-               ipoib_warn(priv, "ipoib_mcast_detach failed (result = %d)\n", ret);
+               /* Remove ourselves from the multicast group */
+               ret = ipoib_mcast_detach(dev, be16_to_cpu(mcast->mcmember.mlid),
+                                        &mcast->mcmember.mgid);
+               if (ret)
+                       ipoib_warn(priv, "ipoib_mcast_detach failed (result = %d)\n", ret);
+       }
 
-       /*
-        * Just make one shot at leaving and don't wait for a reply;
-        * if we fail, too bad.
-        */
-       ret = ib_sa_mcmember_rec_delete(&ipoib_sa_client, priv->ca, priv->port, &rec,
-                                       IB_SA_MCMEMBER_REC_MGID         |
-                                       IB_SA_MCMEMBER_REC_PORT_GID     |
-                                       IB_SA_MCMEMBER_REC_PKEY         |
-                                       IB_SA_MCMEMBER_REC_JOIN_STATE,
-                                       0, GFP_ATOMIC, NULL,
-                                       mcast, &mcast->query);
-       if (ret < 0)
-               ipoib_warn(priv, "ib_sa_mcmember_rec_delete failed "
-                          "for leave (result = %d)\n", ret);
+       if (test_and_clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags))
+               ib_sa_free_multicast(mcast->mc);
 
        return 0;
 }
@@ -758,7 +708,7 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb)
                        dev_kfree_skb_any(skb);
                }
 
-               if (mcast->query)
+               if (test_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags))
                        ipoib_dbg_mcast(priv, "no address vector, "
                                        "but multicast join already started\n");
                else if (test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags))
@@ -916,7 +866,6 @@ void ipoib_mcast_restart_task(struct work_struct *work)
 
        /* We have to cancel outside of the spinlock */
        list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {
-               wait_for_mcast_join(priv, mcast);
                ipoib_mcast_leave(mcast->dev, mcast);
                ipoib_mcast_free(mcast);
        }
index bedae4ad3f74f1d916a0e2a7b555e39474244b31..80b199fa0aa9b7173fc684b1866de7c1c2e46b2f 100644 (file)
@@ -107,4 +107,19 @@ config MSI_LAPTOP
 
          If you have an MSI S270 laptop, say Y or M here.
 
+config SONY_LAPTOP
+       tristate "Sony Laptop Extras"
+       depends on X86 && ACPI
+       select BACKLIGHT_CLASS_DEVICE
+         ---help---
+         This mini-driver drives the SNC device present in the ACPI BIOS of
+         the Sony Vaio laptops.
+
+         It gives access to some extra laptop functionalities. In its current
+         form, this driver let the user set or query the screen brightness
+         through the backlight subsystem and remove/apply power to some
+         devices.
+
+         Read <file:Documentation/sony-laptop.txt> for more information.
+
 endmenu
index 35da53c409c02c8f43b0bf81539e7988c2387c08..7793ccd7904962c699340c53e8ef1cfa6389e9b1 100644 (file)
@@ -11,3 +11,4 @@ obj-$(CONFIG_LKDTM)           += lkdtm.o
 obj-$(CONFIG_TIFM_CORE)        += tifm_core.o
 obj-$(CONFIG_TIFM_7XX1)        += tifm_7xx1.o
 obj-$(CONFIG_SGI_IOC4)         += ioc4.o
+obj-$(CONFIG_SONY_LAPTOP)      += sony-laptop.o
index 861c39935f99f7127e48a6d15527e412343f6e28..e4e2b707a3531f0ae8371ac7f730ce27917f65ee 100644 (file)
@@ -1088,11 +1088,6 @@ static int __init asus_laptop_init(void)
        if (acpi_disabled)
                return -ENODEV;
 
-       if (!acpi_specific_hotkey_enabled) {
-               printk(ASUS_ERR "Using generic hotkey driver\n");
-               return -ENODEV;
-       }
-
        result = acpi_bus_register_driver(&asus_hotk_driver);
        if (result < 0)
                return result;
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
new file mode 100644 (file)
index 0000000..cabbed0
--- /dev/null
@@ -0,0 +1,562 @@
+/*
+ * ACPI Sony Notebook Control Driver (SNC)
+ *
+ * Copyright (C) 2004-2005 Stelian Pop <stelian@popies.net>
+ * Copyright (C) 2007 Mattia Dongili <malattia@linux.it>
+ *
+ * Parts of this driver inspired from asus_acpi.c and ibm_acpi.c
+ * which are copyrighted by their respective authors.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/backlight.h>
+#include <linux/platform_device.h>
+#include <linux/err.h>
+#include <acpi/acpi_drivers.h>
+#include <acpi/acpi_bus.h>
+#include <asm/uaccess.h>
+
+#define ACPI_SNC_CLASS         "sony"
+#define ACPI_SNC_HID           "SNY5001"
+#define ACPI_SNC_DRIVER_NAME   "ACPI Sony Notebook Control Driver v0.4"
+
+/* the device uses 1-based values, while the backlight subsystem uses
+   0-based values */
+#define SONY_MAX_BRIGHTNESS    8
+
+#define LOG_PFX                        KERN_WARNING "sony-laptop: "
+
+MODULE_AUTHOR("Stelian Pop, Mattia Dongili");
+MODULE_DESCRIPTION(ACPI_SNC_DRIVER_NAME);
+MODULE_LICENSE("GPL");
+
+static int debug;
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "set this to 1 (and RTFM) if you want to help "
+                "the development of this driver");
+
+static ssize_t sony_acpi_show(struct device *, struct device_attribute *,
+                             char *);
+static ssize_t sony_acpi_store(struct device *, struct device_attribute *,
+                              const char *, size_t);
+static int boolean_validate(const int, const int);
+static int brightness_default_validate(const int, const int);
+
+#define SNC_VALIDATE_IN                0
+#define SNC_VALIDATE_OUT       1
+
+struct sony_acpi_value {
+       char *name;             /* name of the entry */
+       char **acpiget;         /* names of the ACPI get function */
+       char **acpiset;         /* names of the ACPI set function */
+       int (*validate)(const int, const int);  /* input/output validation */
+       int value;              /* current setting */
+       int valid;              /* Has ever been set */
+       int debug;              /* active only in debug mode ? */
+       struct device_attribute devattr;        /* sysfs atribute */
+};
+
+#define HANDLE_NAMES(_name, _values...) \
+       static char *snc_##_name[] = { _values, NULL }
+
+#define SONY_ACPI_VALUE(_name, _getters, _setters, _validate, _debug) \
+       { \
+               .name           = __stringify(_name), \
+               .acpiget        = _getters, \
+               .acpiset        = _setters, \
+               .validate       = _validate, \
+               .debug          = _debug, \
+               .devattr        = __ATTR(_name, 0, sony_acpi_show, sony_acpi_store), \
+       }
+
+#define SONY_ACPI_VALUE_NULL   { .name = NULL }
+
+HANDLE_NAMES(fnkey_get, "GHKE");
+
+HANDLE_NAMES(brightness_def_get, "GPBR");
+HANDLE_NAMES(brightness_def_set, "SPBR");
+
+HANDLE_NAMES(cdpower_get, "GCDP");
+HANDLE_NAMES(cdpower_set, "SCDP", "CDPW");
+
+HANDLE_NAMES(audiopower_get, "GAZP");
+HANDLE_NAMES(audiopower_set, "AZPW");
+
+HANDLE_NAMES(lanpower_get, "GLNP");
+HANDLE_NAMES(lanpower_set, "LNPW");
+
+HANDLE_NAMES(PID_get, "GPID");
+
+HANDLE_NAMES(CTR_get, "GCTR");
+HANDLE_NAMES(CTR_set, "SCTR");
+
+HANDLE_NAMES(PCR_get, "GPCR");
+HANDLE_NAMES(PCR_set, "SPCR");
+
+HANDLE_NAMES(CMI_get, "GCMI");
+HANDLE_NAMES(CMI_set, "SCMI");
+
+static struct sony_acpi_value sony_acpi_values[] = {
+       SONY_ACPI_VALUE(brightness_default, snc_brightness_def_get,
+                       snc_brightness_def_set, brightness_default_validate, 0),
+       SONY_ACPI_VALUE(fnkey, snc_fnkey_get, NULL, NULL, 0),
+       SONY_ACPI_VALUE(cdpower, snc_cdpower_get, snc_cdpower_set, boolean_validate, 0),
+       SONY_ACPI_VALUE(audiopower, snc_audiopower_get, snc_audiopower_set,
+                       boolean_validate, 0),
+       SONY_ACPI_VALUE(lanpower, snc_lanpower_get, snc_lanpower_set,
+                       boolean_validate, 1),
+       /* unknown methods */
+       SONY_ACPI_VALUE(PID, snc_PID_get, NULL, NULL, 1),
+       SONY_ACPI_VALUE(CTR, snc_CTR_get, snc_CTR_set, NULL, 1),
+       SONY_ACPI_VALUE(PCR, snc_PCR_get, snc_PCR_set, NULL, 1),
+       SONY_ACPI_VALUE(CMI, snc_CMI_get, snc_CMI_set, NULL, 1),
+       SONY_ACPI_VALUE_NULL
+};
+
+static acpi_handle sony_acpi_handle;
+static struct acpi_device *sony_acpi_acpi_device = NULL;
+
+/*
+ * acpi_evaluate_object wrappers
+ */
+static int acpi_callgetfunc(acpi_handle handle, char *name, int *result)
+{
+       struct acpi_buffer output;
+       union acpi_object out_obj;
+       acpi_status status;
+
+       output.length = sizeof(out_obj);
+       output.pointer = &out_obj;
+
+       status = acpi_evaluate_object(handle, name, NULL, &output);
+       if ((status == AE_OK) && (out_obj.type == ACPI_TYPE_INTEGER)) {
+               *result = out_obj.integer.value;
+               return 0;
+       }
+
+       printk(LOG_PFX "acpi_callreadfunc failed\n");
+
+       return -1;
+}
+
+static int acpi_callsetfunc(acpi_handle handle, char *name, int value,
+                           int *result)
+{
+       struct acpi_object_list params;
+       union acpi_object in_obj;
+       struct acpi_buffer output;
+       union acpi_object out_obj;
+       acpi_status status;
+
+       params.count = 1;
+       params.pointer = &in_obj;
+       in_obj.type = ACPI_TYPE_INTEGER;
+       in_obj.integer.value = value;
+
+       output.length = sizeof(out_obj);
+       output.pointer = &out_obj;
+
+       status = acpi_evaluate_object(handle, name, &params, &output);
+       if (status == AE_OK) {
+               if (result != NULL) {
+                       if (out_obj.type != ACPI_TYPE_INTEGER) {
+                               printk(LOG_PFX "acpi_evaluate_object bad "
+                                      "return type\n");
+                               return -1;
+                       }
+                       *result = out_obj.integer.value;
+               }
+               return 0;
+       }
+
+       printk(LOG_PFX "acpi_evaluate_object failed\n");
+
+       return -1;
+}
+
+/*
+ * sony_acpi_values input/output validate functions
+ */
+
+/* brightness_default_validate:
+ *
+ * manipulate input output values to keep consistency with the
+ * backlight framework for which brightness values are 0-based.
+ */
+static int brightness_default_validate(const int direction, const int value)
+{
+       switch (direction) {
+               case SNC_VALIDATE_OUT:
+                       return value - 1;
+               case SNC_VALIDATE_IN:
+                       if (value >= 0 && value < SONY_MAX_BRIGHTNESS)
+                               return value + 1;
+       }
+       return -EINVAL;
+}
+
+/* boolean_validate:
+ *
+ * on input validate boolean values 0/1, on output just pass the
+ * received value.
+ */
+static int boolean_validate(const int direction, const int value)
+{
+       if (direction == SNC_VALIDATE_IN) {
+               if (value != 0 && value != 1)
+                       return -EINVAL;
+       }
+       return value;
+}
+
+/*
+ * Sysfs show/store common to all sony_acpi_values
+ */
+static ssize_t sony_acpi_show(struct device *dev, struct device_attribute *attr,
+                             char *buffer)
+{
+       int value;
+       struct sony_acpi_value *item =
+           container_of(attr, struct sony_acpi_value, devattr);
+
+       if (!*item->acpiget)
+               return -EIO;
+
+       if (acpi_callgetfunc(sony_acpi_handle, *item->acpiget, &value) < 0)
+               return -EIO;
+
+       if (item->validate)
+               value = item->validate(SNC_VALIDATE_OUT, value);
+
+       return snprintf(buffer, PAGE_SIZE, "%d\n", value);
+}
+
+static ssize_t sony_acpi_store(struct device *dev,
+                              struct device_attribute *attr,
+                              const char *buffer, size_t count)
+{
+       int value;
+       struct sony_acpi_value *item =
+           container_of(attr, struct sony_acpi_value, devattr);
+
+       if (!item->acpiset)
+               return -EIO;
+
+       if (count > 31)
+               return -EINVAL;
+
+       value = simple_strtoul(buffer, NULL, 10);
+
+       if (item->validate)
+               value = item->validate(SNC_VALIDATE_IN, value);
+
+       if (value < 0)
+               return value;
+
+       if (acpi_callsetfunc(sony_acpi_handle, *item->acpiset, value, NULL) < 0)
+               return -EIO;
+       item->value = value;
+       item->valid = 1;
+       return count;
+}
+
+/*
+ * Platform device
+ */
+static struct platform_driver sncpf_driver = {
+       .driver = {
+                  .name = "sony-laptop",
+                  .owner = THIS_MODULE,
+                  }
+};
+static struct platform_device *sncpf_device;
+
+static int sony_snc_pf_add(void)
+{
+       acpi_handle handle;
+       struct sony_acpi_value *item;
+       int ret = 0;
+
+       ret = platform_driver_register(&sncpf_driver);
+       if (ret)
+               goto out;
+
+       sncpf_device = platform_device_alloc("sony-laptop", -1);
+       if (!sncpf_device) {
+               ret = -ENOMEM;
+               goto out_platform_registered;
+       }
+
+       ret = platform_device_add(sncpf_device);
+       if (ret)
+               goto out_platform_alloced;
+
+       for (item = sony_acpi_values; item->name; ++item) {
+
+               if (!debug && item->debug)
+                       continue;
+
+               /* find the available acpiget as described in the DSDT */
+               for (; item->acpiget && *item->acpiget; ++item->acpiget) {
+                       if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle,
+                                                        *item->acpiget,
+                                                        &handle))) {
+                               if (debug)
+                                       printk(LOG_PFX "Found %s getter: %s\n",
+                                              item->name, *item->acpiget);
+                               item->devattr.attr.mode |= S_IRUGO;
+                               break;
+                       }
+               }
+
+               /* find the available acpiset as described in the DSDT */
+               for (; item->acpiset && *item->acpiset; ++item->acpiset) {
+                       if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle,
+                                                        *item->acpiset,
+                                                        &handle))) {
+                               if (debug)
+                                       printk(LOG_PFX "Found %s setter: %s\n",
+                                              item->name, *item->acpiset);
+                               item->devattr.attr.mode |= S_IWUSR;
+                               break;
+                       }
+               }
+
+               if (item->devattr.attr.mode != 0) {
+                       ret =
+                           device_create_file(&sncpf_device->dev,
+                                              &item->devattr);
+                       if (ret)
+                               goto out_sysfs;
+               }
+       }
+
+       return 0;
+
+      out_sysfs:
+       for (item = sony_acpi_values; item->name; ++item) {
+               device_remove_file(&sncpf_device->dev, &item->devattr);
+       }
+       platform_device_del(sncpf_device);
+      out_platform_alloced:
+       platform_device_put(sncpf_device);
+      out_platform_registered:
+       platform_driver_unregister(&sncpf_driver);
+      out:
+       return ret;
+}
+
+static void sony_snc_pf_remove(void)
+{
+       struct sony_acpi_value *item;
+
+       for (item = sony_acpi_values; item->name; ++item) {
+               device_remove_file(&sncpf_device->dev, &item->devattr);
+       }
+
+       platform_device_del(sncpf_device);
+       platform_device_put(sncpf_device);
+       platform_driver_unregister(&sncpf_driver);
+}
+
+/*
+ * Backlight device
+ */
+static int sony_backlight_update_status(struct backlight_device *bd)
+{
+       return acpi_callsetfunc(sony_acpi_handle, "SBRT",
+                               bd->props->brightness + 1, NULL);
+}
+
+static int sony_backlight_get_brightness(struct backlight_device *bd)
+{
+       int value;
+
+       if (acpi_callgetfunc(sony_acpi_handle, "GBRT", &value))
+               return 0;
+       /* brightness levels are 1-based, while backlight ones are 0-based */
+       return value - 1;
+}
+
+static struct backlight_device *sony_backlight_device;
+static struct backlight_properties sony_backlight_properties = {
+       .owner = THIS_MODULE,
+       .update_status = sony_backlight_update_status,
+       .get_brightness = sony_backlight_get_brightness,
+       .max_brightness = SONY_MAX_BRIGHTNESS - 1,
+};
+
+/*
+ * ACPI callbacks
+ */
+static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
+{
+       if (debug)
+               printk(LOG_PFX "sony_acpi_notify, event: %d\n", event);
+       acpi_bus_generate_event(sony_acpi_acpi_device, 1, event);
+}
+
+static acpi_status sony_walk_callback(acpi_handle handle, u32 level,
+                                     void *context, void **return_value)
+{
+       struct acpi_namespace_node *node;
+       union acpi_operand_object *operand;
+
+       node = (struct acpi_namespace_node *)handle;
+       operand = (union acpi_operand_object *)node->object;
+
+       printk(LOG_PFX "method: name: %4.4s, args %X\n", node->name.ascii,
+              (u32) operand->method.param_count);
+
+       return AE_OK;
+}
+
+/*
+ * ACPI device
+ */
+static int sony_acpi_resume(struct acpi_device *device)
+{
+       struct sony_acpi_value *item;
+
+       for (item = sony_acpi_values; item->name; item++) {
+               int ret;
+
+               if (!item->valid)
+                       continue;
+               ret = acpi_callsetfunc(sony_acpi_handle, *item->acpiset,
+                                      item->value, NULL);
+               if (ret < 0) {
+                       printk("%s: %d\n", __FUNCTION__, ret);
+                       break;
+               }
+       }
+       return 0;
+}
+
+static int sony_acpi_add(struct acpi_device *device)
+{
+       acpi_status status;
+       int result;
+       acpi_handle handle;
+
+       sony_acpi_acpi_device = device;
+
+       sony_acpi_handle = device->handle;
+
+       if (debug) {
+               status = acpi_walk_namespace(ACPI_TYPE_METHOD, sony_acpi_handle,
+                                            1, sony_walk_callback, NULL, NULL);
+               if (ACPI_FAILURE(status)) {
+                       printk(LOG_PFX "unable to walk acpi resources\n");
+                       result = -ENODEV;
+                       goto outwalk;
+               }
+       }
+
+       status = acpi_install_notify_handler(sony_acpi_handle,
+                                            ACPI_DEVICE_NOTIFY,
+                                            sony_acpi_notify, NULL);
+       if (ACPI_FAILURE(status)) {
+               printk(LOG_PFX "unable to install notify handler\n");
+               result = -ENODEV;
+               goto outwalk;
+       }
+
+       if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle, "GBRT", &handle))) {
+               sony_backlight_device = backlight_device_register("sony", NULL,
+                                                                 NULL,
+                                                                 &sony_backlight_properties);
+
+               if (IS_ERR(sony_backlight_device)) {
+                       printk(LOG_PFX "unable to register backlight device\n");
+                       sony_backlight_device = NULL;
+               } else
+                       sony_backlight_properties.brightness =
+                           sony_backlight_get_brightness
+                           (sony_backlight_device);
+       }
+
+       if (sony_snc_pf_add())
+               goto outbacklight;
+
+       printk(KERN_INFO ACPI_SNC_DRIVER_NAME " successfully installed\n");
+
+       return 0;
+
+      outbacklight:
+       if (sony_backlight_device)
+               backlight_device_unregister(sony_backlight_device);
+
+       status = acpi_remove_notify_handler(sony_acpi_handle,
+                                           ACPI_DEVICE_NOTIFY,
+                                           sony_acpi_notify);
+       if (ACPI_FAILURE(status))
+               printk(LOG_PFX "unable to remove notify handler\n");
+      outwalk:
+       return result;
+}
+
+static int sony_acpi_remove(struct acpi_device *device, int type)
+{
+       acpi_status status;
+
+       if (sony_backlight_device)
+               backlight_device_unregister(sony_backlight_device);
+
+       sony_acpi_acpi_device = NULL;
+
+       status = acpi_remove_notify_handler(sony_acpi_handle,
+                                           ACPI_DEVICE_NOTIFY,
+                                           sony_acpi_notify);
+       if (ACPI_FAILURE(status))
+               printk(LOG_PFX "unable to remove notify handler\n");
+
+       sony_snc_pf_remove();
+
+       printk(KERN_INFO ACPI_SNC_DRIVER_NAME " successfully removed\n");
+
+       return 0;
+}
+
+static struct acpi_driver sony_acpi_driver = {
+       .name = ACPI_SNC_DRIVER_NAME,
+       .class = ACPI_SNC_CLASS,
+       .ids = ACPI_SNC_HID,
+       .ops = {
+               .add = sony_acpi_add,
+               .remove = sony_acpi_remove,
+               .resume = sony_acpi_resume,
+               },
+};
+
+static int __init sony_acpi_init(void)
+{
+       return acpi_bus_register_driver(&sony_acpi_driver);
+}
+
+static void __exit sony_acpi_exit(void)
+{
+       acpi_bus_unregister_driver(&sony_acpi_driver);
+}
+
+module_init(sony_acpi_init);
+module_exit(sony_acpi_exit);
index 2ce50f38e3c7d21c54d22b2be788bd6f4fc0acbd..459f4b4feded9f9302c493083c116bcaa85cc00c 100644 (file)
@@ -64,6 +64,7 @@
 #include <linux/err.h>
 #include <linux/dma-mapping.h>
 #include <linux/clk.h>
+#include <linux/atmel_pdc.h>
 
 #include <linux/mmc/host.h>
 #include <linux/mmc/protocol.h>
@@ -75,7 +76,6 @@
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91_mci.h>
-#include <asm/arch/at91_pdc.h>
 
 #define DRIVER_NAME "at91_mci"
 
@@ -211,13 +211,13 @@ static void at91mci_pre_dma_read(struct at91mci_host *host)
 
                /* Check to see if this needs filling */
                if (i == 0) {
-                       if (at91_mci_read(host, AT91_PDC_RCR) != 0) {
+                       if (at91_mci_read(host, ATMEL_PDC_RCR) != 0) {
                                pr_debug("Transfer active in current\n");
                                continue;
                        }
                }
                else {
-                       if (at91_mci_read(host, AT91_PDC_RNCR) != 0) {
+                       if (at91_mci_read(host, ATMEL_PDC_RNCR) != 0) {
                                pr_debug("Transfer active in next\n");
                                continue;
                        }
@@ -234,12 +234,12 @@ static void at91mci_pre_dma_read(struct at91mci_host *host)
                pr_debug("dma address = %08X, length = %d\n", sg->dma_address, sg->length);
 
                if (i == 0) {
-                       at91_mci_write(host, AT91_PDC_RPR, sg->dma_address);
-                       at91_mci_write(host, AT91_PDC_RCR, sg->length / 4);
+                       at91_mci_write(host, ATMEL_PDC_RPR, sg->dma_address);
+                       at91_mci_write(host, ATMEL_PDC_RCR, sg->length / 4);
                }
                else {
-                       at91_mci_write(host, AT91_PDC_RNPR, sg->dma_address);
-                       at91_mci_write(host, AT91_PDC_RNCR, sg->length / 4);
+                       at91_mci_write(host, ATMEL_PDC_RNPR, sg->dma_address);
+                       at91_mci_write(host, ATMEL_PDC_RNCR, sg->length / 4);
                }
        }
 
@@ -303,7 +303,7 @@ static void at91mci_post_dma_read(struct at91mci_host *host)
                at91mci_pre_dma_read(host);
        else {
                at91_mci_write(host, AT91_MCI_IER, AT91_MCI_RXBUFF);
-               at91_mci_write(host, AT91_PDC_PTCR, AT91_PDC_RXTDIS | AT91_PDC_TXTDIS);
+               at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
        }
 
        pr_debug("post dma read done\n");
@@ -320,7 +320,7 @@ static void at91_mci_handle_transmitted(struct at91mci_host *host)
        pr_debug("Handling the transmit\n");
 
        /* Disable the transfer */
-       at91_mci_write(host, AT91_PDC_PTCR, AT91_PDC_RXTDIS | AT91_PDC_TXTDIS);
+       at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
 
        /* Now wait for cmd ready */
        at91_mci_write(host, AT91_MCI_IDR, AT91_MCI_TXBUFE);
@@ -431,15 +431,15 @@ static unsigned int at91_mci_send_command(struct at91mci_host *host, struct mmc_
                cmd->opcode, cmdr, cmd->arg, blocks, block_length, at91_mci_read(host, AT91_MCI_MR));
 
        if (!data) {
-               at91_mci_write(host, AT91_PDC_PTCR, AT91_PDC_TXTDIS | AT91_PDC_RXTDIS);
-               at91_mci_write(host, AT91_PDC_RPR, 0);
-               at91_mci_write(host, AT91_PDC_RCR, 0);
-               at91_mci_write(host, AT91_PDC_RNPR, 0);
-               at91_mci_write(host, AT91_PDC_RNCR, 0);
-               at91_mci_write(host, AT91_PDC_TPR, 0);
-               at91_mci_write(host, AT91_PDC_TCR, 0);
-               at91_mci_write(host, AT91_PDC_TNPR, 0);
-               at91_mci_write(host, AT91_PDC_TNCR, 0);
+               at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_TXTDIS | ATMEL_PDC_RXTDIS);
+               at91_mci_write(host, ATMEL_PDC_RPR, 0);
+               at91_mci_write(host, ATMEL_PDC_RCR, 0);
+               at91_mci_write(host, ATMEL_PDC_RNPR, 0);
+               at91_mci_write(host, ATMEL_PDC_RNCR, 0);
+               at91_mci_write(host, ATMEL_PDC_TPR, 0);
+               at91_mci_write(host, ATMEL_PDC_TCR, 0);
+               at91_mci_write(host, ATMEL_PDC_TNPR, 0);
+               at91_mci_write(host, ATMEL_PDC_TNCR, 0);
 
                at91_mci_write(host, AT91_MCI_ARGR, cmd->arg);
                at91_mci_write(host, AT91_MCI_CMDR, cmdr);
@@ -452,7 +452,7 @@ static unsigned int at91_mci_send_command(struct at91mci_host *host, struct mmc_
        /*
         * Disable the PDC controller
         */
-       at91_mci_write(host, AT91_PDC_PTCR, AT91_PDC_RXTDIS | AT91_PDC_TXTDIS);
+       at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
 
        if (cmdr & AT91_MCI_TRCMD_START) {
                data->bytes_xfered = 0;
@@ -481,8 +481,8 @@ static unsigned int at91_mci_send_command(struct at91mci_host *host, struct mmc_
 
                        pr_debug("Transmitting %d bytes\n", host->total_length);
 
-                       at91_mci_write(host, AT91_PDC_TPR, host->physical_address);
-                       at91_mci_write(host, AT91_PDC_TCR, host->total_length / 4);
+                       at91_mci_write(host, ATMEL_PDC_TPR, host->physical_address);
+                       at91_mci_write(host, ATMEL_PDC_TCR, host->total_length / 4);
                        ier = AT91_MCI_TXBUFE;
                }
        }
@@ -497,9 +497,9 @@ static unsigned int at91_mci_send_command(struct at91mci_host *host, struct mmc_
 
        if (cmdr & AT91_MCI_TRCMD_START) {
                if (cmdr & AT91_MCI_TRDIR)
-                       at91_mci_write(host, AT91_PDC_PTCR, AT91_PDC_RXTEN);
+                       at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTEN);
                else
-                       at91_mci_write(host, AT91_PDC_PTCR, AT91_PDC_TXTEN);
+                       at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_TXTEN);
        }
        return ier;
 }
index 38f41a593b1269961e8ce8040751c644a46fa9f6..d9400ef87195d9ba7a114726436d21d26f9e16c7 100644 (file)
@@ -1284,8 +1284,8 @@ config PCNET32
          will be called pcnet32.
 
 config PCNET32_NAPI
-       bool "Use RX polling (NAPI) (EXPERIMENTAL)"
-       depends on PCNET32 && EXPERIMENTAL
+       bool "Use RX polling (NAPI)"
+       depends on PCNET32
        help
          NAPI is a new driver API designed to reduce CPU and interrupt load
          when the driver is receiving lots of packets from the card. It is
@@ -2125,14 +2125,16 @@ config SKY2
          will be called sky2.  This is recommended.
 
 config SK98LIN
-       tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support"
+       tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support (DEPRECATED)"
        depends on PCI
        ---help---
          Say Y here if you have a Marvell Yukon or SysKonnect SK-98xx/SK-95xx
          compliant Gigabit Ethernet Adapter.
 
-         This driver supports the original Yukon chipset. A cleaner driver is 
-         also available (skge) which seems to work better than this one.
+         This driver supports the original Yukon chipset. This driver is
+         deprecated and will be removed from the kernel in the near future,
+         it has been replaced by the skge driver. skge is cleaner and
+         seems to work better.
 
          This driver does not support the newer Yukon2 chipset. A separate
          driver, sky2, is provided to support Yukon2-based adapters.
@@ -2337,7 +2339,7 @@ config QLA3XXX
 
 config ATL1
        tristate "Attansic L1 Gigabit Ethernet support (EXPERIMENTAL)"
-       depends on NET_PCI && PCI && EXPERIMENTAL
+       depends on PCI && EXPERIMENTAL
        select CRC32
        select MII
        help
index e7555d4e6ff1c98e44cae1de1cc1048e33d4816c..6318814a11a8a7a3294ee371e2d4017f48900afa 100644 (file)
@@ -94,7 +94,7 @@ static void rx(struct net_device *dev, int bufnum,
 
        BUGMSG(D_DURING, "it's a raw packet (length=%d)\n", length);
 
-       if (length >= MinTU)
+       if (length > MTU)
                ofs = 512 - length;
        else
                ofs = 256 - length;
@@ -183,7 +183,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
                       length, XMTU);
                length = XMTU;
        }
-       if (length > MinTU) {
+       if (length >= MinTU) {
                hard->offset[0] = 0;
                hard->offset[1] = ofs = 512 - length;
        } else if (length > MTU) {
index 4e91dab1f17f330ee4c5108e22c62e20f17c09d0..83004fdab0a4d29e0fc6a798e2d9501c46516e9f 100644 (file)
@@ -41,7 +41,7 @@
  *     <jojo@repas.de>
  */
 
-#define VERSION "arcnet: v3.93 BETA 2000/04/29 - by Avery Pennarun et al.\n"
+#define VERSION "arcnet: v3.94 BETA 2007/02/08 - by Avery Pennarun et al.\n"
 
 #include <linux/module.h>
 #include <linux/types.h>
index 98d326b23c92bd3fd9b2fbea95805bfaf7b6eea2..b8c0fa6d401db146998c21c29b7928806a5fe9f3 100644 (file)
@@ -155,6 +155,7 @@ static struct pci_device_id com20020pci_id_table[] = {
        { 0x1571, 0xa00b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
        { 0x1571, 0xa00c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
        { 0x1571, 0xa00d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
+       { 0x1571, 0xa00e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
        { 0x1571, 0xa201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
        { 0x1571, 0xa202, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
        { 0x1571, 0xa203, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
@@ -163,6 +164,8 @@ static struct pci_device_id com20020pci_id_table[] = {
        { 0x1571, 0xa206, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
        { 0x10B5, 0x9030, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
        { 0x10B5, 0x9050, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
+       { 0x14BA, 0x6000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
+       { 0x10B5, 0x2200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
        {0,}
 };
 
index 4218075c8aa38e47b878386c9627169659cbbb54..7cf0a2511697fbe0aedc6b619c243b6b8d2269ef 100644 (file)
@@ -104,7 +104,7 @@ int com20020_check(struct net_device *dev)
        SET_SUBADR(SUB_SETUP1);
        outb(lp->setup, _XREG);
 
-       if (lp->card_flags & ARC_CAN_10MBIT)
+       if (lp->clockm != 0)
        {
                SET_SUBADR(SUB_SETUP2);
                outb(lp->setup2, _XREG);
index 08b2d785469d13ae524b60d3092b676900980da5..314dbaabb642454a1e2389caeef97fcc87995eb8 100644 (file)
@@ -243,14 +243,8 @@ static int atl1_get_permanent_address(struct atl1_hw *hw)
                        i += 4;
                }
 
-/*
- * The following 2 lines are the Attansic originals.  Saving for posterity.
- *             *(u32 *) & eth_addr[2] = LONGSWAP(addr[0]);
- *             *(u16 *) & eth_addr[0] = SHORTSWAP(*(u16 *) & addr[1]);
- */
-               *(u32 *) & eth_addr[2] = swab32(addr[0]);
-               *(u16 *) & eth_addr[0] = swab16(*(u16 *) & addr[1]);
-
+               *(u32 *) &eth_addr[2] = swab32(addr[0]);
+               *(u16 *) &eth_addr[0] = swab16(*(u16 *) &addr[1]);
                if (is_valid_ether_addr(eth_addr)) {
                        memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
                        return 0;
@@ -281,17 +275,28 @@ static int atl1_get_permanent_address(struct atl1_hw *hw)
                i += 4;
        }
 
-/*
- * The following 2 lines are the Attansic originals.  Saving for posterity.
- *     *(u32 *) & eth_addr[2] = LONGSWAP(addr[0]);
- *     *(u16 *) & eth_addr[0] = SHORTSWAP(*(u16 *) & addr[1]);
- */
-       *(u32 *) & eth_addr[2] = swab32(addr[0]);
-       *(u16 *) & eth_addr[0] = swab16(*(u16 *) & addr[1]);
+       *(u32 *) &eth_addr[2] = swab32(addr[0]);
+       *(u16 *) &eth_addr[0] = swab16(*(u16 *) &addr[1]);
        if (is_valid_ether_addr(eth_addr)) {
                memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
                return 0;
        }
+
+       /*
+        * On some motherboards, the MAC address is written by the
+        * BIOS directly to the MAC register during POST, and is
+        * not stored in eeprom.  If all else thus far has failed
+        * to fetch the permanent MAC address, try reading it directly.
+        */
+       addr[0] = ioread32(hw->hw_addr + REG_MAC_STA_ADDR);
+       addr[1] = ioread16(hw->hw_addr + (REG_MAC_STA_ADDR + 4));
+       *(u32 *) &eth_addr[2] = swab32(addr[0]);
+       *(u16 *) &eth_addr[0] = swab16(*(u16 *) &addr[1]);
+       if (is_valid_ether_addr(eth_addr)) {
+               memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
+               return 0;
+       }
+
        return 1;
 }
 
@@ -357,7 +362,7 @@ void atl1_hash_set(struct atl1_hw *hw, u32 hash_value)
         */
        hash_reg = (hash_value >> 31) & 0x1;
        hash_bit = (hash_value >> 26) & 0x1F;
-       mta = ioread32((hw + REG_RX_HASH_TABLE) + (hash_reg << 2));
+       mta = ioread32((hw->hw_addr + REG_RX_HASH_TABLE) + (hash_reg << 2));
        mta |= (1 << hash_bit);
        iowrite32(mta, (hw->hw_addr + REG_RX_HASH_TABLE) + (hash_reg << 2));
 }
index 6655640eb4ca130e6fe03da5dda3681cfdf6d167..65673485bb6b35c1f1e457261a14a7740d5b9389 100644 (file)
@@ -82,8 +82,7 @@
 
 #include "atl1.h"
 
-#define RUN_REALTIME 0
-#define DRIVER_VERSION "2.0.6"
+#define DRIVER_VERSION "2.0.7"
 
 char atl1_driver_name[] = "atl1";
 static const char atl1_driver_string[] = "Attansic L1 Ethernet Network Driver";
@@ -100,7 +99,7 @@ MODULE_VERSION(DRIVER_VERSION);
  * atl1_pci_tbl - PCI Device ID Table
  */
 static const struct pci_device_id atl1_pci_tbl[] = {
-       {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, 0x1048)},
+       {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATTANSIC_L1)},
        /* required last entry */
        {0,}
 };
index 5ff7882297d66910c15db46406eda5e8a4a33e50..aaada572732a87fd3c8fd2d03898861d834c2c86 100644 (file)
@@ -59,7 +59,6 @@
 #define B44_DEF_TX_RING_PENDING                (B44_TX_RING_SIZE - 1)
 #define B44_TX_RING_BYTES      (sizeof(struct dma_desc) * \
                                 B44_TX_RING_SIZE)
-#define B44_DMA_MASK 0x3fffffff
 
 #define TX_RING_GAP(BP)        \
        (B44_TX_RING_SIZE - (BP)->tx_pending)
@@ -665,7 +664,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
        /* Hardware bug work-around, the chip is unable to do PCI DMA
           to/from anything above 1GB :-( */
        if (dma_mapping_error(mapping) ||
-               mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) {
+               mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) {
                /* Sigh... */
                if (!dma_mapping_error(mapping))
                        pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
@@ -677,7 +676,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
                                         RX_PKT_BUF_SZ,
                                         PCI_DMA_FROMDEVICE);
                if (dma_mapping_error(mapping) ||
-                       mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) {
+                       mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) {
                        if (!dma_mapping_error(mapping))
                                pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
                        dev_kfree_skb_any(skb);
@@ -988,7 +987,7 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE);
-       if (dma_mapping_error(mapping) || mapping + len > B44_DMA_MASK) {
+       if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) {
                /* Chip can't handle DMA to/from >1GB, use bounce buffer */
                if (!dma_mapping_error(mapping))
                        pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE);
@@ -1000,7 +999,7 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
                mapping = pci_map_single(bp->pdev, bounce_skb->data,
                                         len, PCI_DMA_TODEVICE);
-               if (dma_mapping_error(mapping) || mapping + len > B44_DMA_MASK) {
+               if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) {
                        if (!dma_mapping_error(mapping))
                                pci_unmap_single(bp->pdev, mapping,
                                         len, PCI_DMA_TODEVICE);
@@ -1227,7 +1226,7 @@ static int b44_alloc_consistent(struct b44 *bp)
                                             DMA_BIDIRECTIONAL);
 
                if (dma_mapping_error(rx_ring_dma) ||
-                       rx_ring_dma + size > B44_DMA_MASK) {
+                       rx_ring_dma + size > DMA_30BIT_MASK) {
                        kfree(rx_ring);
                        goto out_err;
                }
@@ -1254,7 +1253,7 @@ static int b44_alloc_consistent(struct b44 *bp)
                                             DMA_TO_DEVICE);
 
                if (dma_mapping_error(tx_ring_dma) ||
-                       tx_ring_dma + size > B44_DMA_MASK) {
+                       tx_ring_dma + size > DMA_30BIT_MASK) {
                        kfree(tx_ring);
                        goto out_err;
                }
@@ -1289,7 +1288,7 @@ static void b44_chip_reset(struct b44 *bp)
        if (ssb_is_core_up(bp)) {
                bw32(bp, B44_RCV_LAZY, 0);
                bw32(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE);
-               b44_wait_bit(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE, 100, 1);
+               b44_wait_bit(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE, 200, 1);
                bw32(bp, B44_DMATX_CTRL, 0);
                bp->tx_prod = bp->tx_cons = 0;
                if (br32(bp, B44_DMARX_STAT) & DMARX_STAT_EMASK) {
@@ -2151,13 +2150,13 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
 
        pci_set_master(pdev);
 
-       err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK);
+       err = pci_set_dma_mask(pdev, (u64) DMA_30BIT_MASK);
        if (err) {
                dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n");
                goto err_out_free_res;
        }
 
-       err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK);
+       err = pci_set_consistent_dma_mask(pdev, (u64) DMA_30BIT_MASK);
        if (err) {
                dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n");
                goto err_out_free_res;
index 16e004990c597d9da1ce1a248e417c2e66a14b74..e14862b43d174041845086e35e5b617627c69980 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006-2007 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006-2007 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index c6b72664318571f81d5ad09b3f0c3f6600bf21f4..b2cf5f6feb4a4ada3b8ab4bacd48943efdb4d9af 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006-2007 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006-2007 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 0e6beb69ba17bd75eba6fddf08658584a673402e..f15446a32efca176c2c1c0ddfb442a399bcd046e 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006-2007 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006-2007 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 3c0cb8557058bfbd70009e6c7a7c289849f7f41e..d660af74606e4abbb20f9d964c0080367425662e 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2003-2007 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006-2007 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index ba5d2cbd7241c716b013d9a510c96fa51b2ad6de..d79001336cfdcaf6e4c0afdb9ac32aa7223519ec 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2003-2007 Chelsio, Inc. All rights reserved.
- * Copyright (c) 2006-2007 Open Grid Computing, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 9af3bcd64b3b011c11d166ac71ba2e3c9ba1d432..fa4099bc0416a0220c6d80a29b9c01a22188f4db 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (C) 2006-2007 Chelsio Communications.  All rights reserved.
- * Copyright (C) 2006-2007 Open Grid Computing, Inc.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
index 689f158a469eb78d6146f98231e0f36b69680f5d..dd4b728ac4b58712ceb88658c1fa82807fccda39 100644 (file)
@@ -337,7 +337,6 @@ struct e1000_adapter {
        struct e1000_rx_ring test_rx_ring;
 
 
-       uint32_t *config_space;
        int msg_enable;
 #ifdef CONFIG_PCI_MSI
        boolean_t have_msi;
index 44ebc72962dc47d6e434f8153b21f4932985cac1..6777887295f538822d006aa582986cac6eeb94a7 100644 (file)
@@ -166,7 +166,7 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
                        ecmd->transceiver = XCVR_EXTERNAL;
        }
 
-       if (netif_carrier_ok(adapter->netdev)) {
+       if (E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU) {
 
                e1000_get_speed_and_duplex(hw, &adapter->link_speed,
                                                   &adapter->link_duplex);
index 619c89218b4bcb0cd113bfdadf11206c1bf7e027..a71023741c3af8b3acb1c61ecd90bab11b3faaab 100644 (file)
@@ -1417,10 +1417,6 @@ e1000_open(struct net_device *netdev)
        if ((err = e1000_setup_all_rx_resources(adapter)))
                goto err_setup_rx;
 
-       err = e1000_request_irq(adapter);
-       if (err)
-               goto err_req_irq;
-
        e1000_power_up_phy(adapter);
 
        if ((err = e1000_up(adapter)))
@@ -1431,6 +1427,10 @@ e1000_open(struct net_device *netdev)
                e1000_update_mng_vlan(adapter);
        }
 
+       err = e1000_request_irq(adapter);
+       if (err)
+               goto err_req_irq;
+
        /* If AMT is enabled, let the firmware know that the network
         * interface is now open */
        if (adapter->hw.mac_type == e1000_82573 &&
@@ -1439,10 +1439,10 @@ e1000_open(struct net_device *netdev)
 
        return E1000_SUCCESS;
 
+err_req_irq:
+       e1000_down(adapter);
 err_up:
        e1000_power_down_phy(adapter);
-       e1000_free_irq(adapter);
-err_req_irq:
        e1000_free_all_rx_resources(adapter);
 err_setup_rx:
        e1000_free_all_tx_resources(adapter);
@@ -5071,58 +5071,6 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx)
        return 0;
 }
 
-#ifdef CONFIG_PM
-/* Save/restore 16 or 64 dwords of PCI config space depending on which
- * bus we're on (PCI(X) vs. PCI-E)
- */
-#define PCIE_CONFIG_SPACE_LEN 256
-#define PCI_CONFIG_SPACE_LEN 64
-static int
-e1000_pci_save_state(struct e1000_adapter *adapter)
-{
-       struct pci_dev *dev = adapter->pdev;
-       int size;
-       int i;
-
-       if (adapter->hw.mac_type >= e1000_82571)
-               size = PCIE_CONFIG_SPACE_LEN;
-       else
-               size = PCI_CONFIG_SPACE_LEN;
-
-       WARN_ON(adapter->config_space != NULL);
-
-       adapter->config_space = kmalloc(size, GFP_KERNEL);
-       if (!adapter->config_space) {
-               DPRINTK(PROBE, ERR, "unable to allocate %d bytes\n", size);
-               return -ENOMEM;
-       }
-       for (i = 0; i < (size / 4); i++)
-               pci_read_config_dword(dev, i * 4, &adapter->config_space[i]);
-       return 0;
-}
-
-static void
-e1000_pci_restore_state(struct e1000_adapter *adapter)
-{
-       struct pci_dev *dev = adapter->pdev;
-       int size;
-       int i;
-
-       if (adapter->config_space == NULL)
-               return;
-
-       if (adapter->hw.mac_type >= e1000_82571)
-               size = PCIE_CONFIG_SPACE_LEN;
-       else
-               size = PCI_CONFIG_SPACE_LEN;
-       for (i = 0; i < (size / 4); i++)
-               pci_write_config_dword(dev, i * 4, adapter->config_space[i]);
-       kfree(adapter->config_space);
-       adapter->config_space = NULL;
-       return;
-}
-#endif /* CONFIG_PM */
-
 static int
 e1000_suspend(struct pci_dev *pdev, pm_message_t state)
 {
@@ -5142,9 +5090,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
        }
 
 #ifdef CONFIG_PM
-       /* Implement our own version of pci_save_state(pdev) because pci-
-        * express adapters have 256-byte config spaces. */
-       retval = e1000_pci_save_state(adapter);
+       retval = pci_save_state(pdev);
        if (retval)
                return retval;
 #endif
@@ -5231,7 +5177,7 @@ e1000_resume(struct pci_dev *pdev)
        uint32_t err;
 
        pci_set_power_state(pdev, PCI_D0);
-       e1000_pci_restore_state(adapter);
+       pci_restore_state(pdev);
        if ((err = pci_enable_device(pdev))) {
                printk(KERN_ERR "e1000: Cannot enable PCI device from suspend\n");
                return err;
index 272e1ec51aa2b4202c5ea93980d9026039ef6a05..42295d61ecd847791f6a8c04513940c471732790 100644 (file)
@@ -39,7 +39,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME       "ehea"
-#define DRV_VERSION    "EHEA_0045"
+#define DRV_VERSION    "EHEA_0046"
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
        | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
index 38b2fa424b2d9bdd756565a3c1c49eaa0da6aa3a..88ad1c8bcee49d2a34f1d00aac8a0292a17deaab 100644 (file)
@@ -76,7 +76,7 @@ void ehea_dump(void *adr, int len, char *msg) {
        int x;
        unsigned char *deb = adr;
        for (x = 0; x < len; x += 16) {
-               printk(DRV_NAME "%s adr=%p ofs=%04x %016lx %016lx\n", msg,
+               printk(DRV_NAME " %s adr=%p ofs=%04x %016lx %016lx\n", msg,
                          deb, x, *((u64*)&deb[0]), *((u64*)&deb[8]));
                deb += 16;
        }
@@ -555,6 +555,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param)
 {
        struct ehea_port *port = param;
        struct ehea_eqe *eqe;
+       struct ehea_qp *qp;
        u32 qp_token;
 
        eqe = ehea_poll_eq(port->qp_eq);
@@ -563,9 +564,14 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param)
                qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry);
                ehea_error("QP aff_err: entry=0x%lx, token=0x%x",
                           eqe->entry, qp_token);
+
+               qp = port->port_res[qp_token].qp;
+               ehea_error_data(port->adapter, qp->fw_handle);
                eqe = ehea_poll_eq(port->qp_eq);
        }
 
+       queue_work(port->adapter->ehea_wq, &port->reset_task);
+
        return IRQ_HANDLED;
 }
 
index 37716e05e808fe50e777da3490331bf60ea9a64e..bc3c005472642af53f72627c666911cf380c60f0 100644 (file)
@@ -612,3 +612,13 @@ u64 ehea_h_reset_events(const u64 adapter_handle, const u64 neq_handle,
                                       event_mask,              /* R6 */
                                       0, 0, 0, 0);             /* R7-R12 */
 }
+
+u64 ehea_h_error_data(const u64 adapter_handle, const u64 ressource_handle,
+                     void *rblock)
+{
+       return ehea_plpar_hcall_norets(H_ERROR_DATA,
+                                      adapter_handle,          /* R4 */
+                                      ressource_handle,        /* R5 */
+                                      virt_to_abs(rblock),     /* R6 */
+                                      0, 0, 0, 0);             /* R7-R12 */
+}
index 919f94b759336e95cd25afe54b1217ae22bde9bf..90acddb068a1ab819938631675c4db83ab01bda3 100644 (file)
@@ -454,4 +454,7 @@ u64 ehea_h_reg_dereg_bcmc(const u64 adapter_handle, const u16 port_num,
 u64 ehea_h_reset_events(const u64 adapter_handle, const u64 neq_handle,
                        const u64 event_mask);
 
+u64 ehea_h_error_data(const u64 adapter_handle, const u64 ressource_handle,
+                     void *rblock);
+
 #endif /* __EHEA_PHYP_H__ */
index f143e13b229dda570b10f84142398aad43ee8699..96ff3b6799969d50c2cd9f13e6899c1f3f1e8993 100644 (file)
@@ -486,6 +486,7 @@ int ehea_destroy_qp(struct ehea_qp *qp)
        if (!qp)
                return 0;
 
+       ehea_h_disable_and_get_hea(qp->adapter->handle, qp->fw_handle);
        hret = ehea_h_free_resource(qp->adapter->handle, qp->fw_handle);
        if (hret != H_SUCCESS) {
                ehea_error("destroy_qp failed");
@@ -581,4 +582,45 @@ out:
        return ret;
 }
 
+void print_error_data(u64 *data)
+{
+       int length;
+       u64 type = EHEA_BMASK_GET(ERROR_DATA_TYPE, data[2]);
+       u64 resource = data[1];
+
+       length = EHEA_BMASK_GET(ERROR_DATA_LENGTH, data[0]);
+
+       if (length > EHEA_PAGESIZE)
+               length = EHEA_PAGESIZE;
+
+       if (type == 0x8) /* Queue Pair */
+               ehea_error("QP (resource=%lX) state: AER=0x%lX, AERR=0x%lX, "
+                          "port=%lX", resource, data[6], data[12], data[22]);
+
+       ehea_dump(data, length, "error data");
+}
+
+void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle)
+{
+       unsigned long ret;
+       u64 *rblock;
+
+       rblock = kzalloc(PAGE_SIZE, GFP_KERNEL);
+       if (!rblock) {
+               ehea_error("Cannot allocate rblock memory.");
+               return;
+       }
 
+       ret = ehea_h_error_data(adapter->handle,
+                               res_handle,
+                               rblock);
+
+       if (ret == H_R_STATE)
+               ehea_error("No error data is available: %lX.", res_handle);
+       else if (ret == H_SUCCESS)
+               print_error_data(rblock);
+       else
+               ehea_error("Error data could not be fetched: %lX", res_handle);
+
+       kfree(rblock);
+}
index 7efdc96919ca606a5920ff8aca7a95b909265484..1ff60983504d07385bed88e72dc3c7c65a3dd018 100644 (file)
@@ -180,6 +180,9 @@ struct ehea_eqe {
        u64 entry;
 };
 
+#define ERROR_DATA_LENGTH  EHEA_BMASK_IBM(52,63)
+#define ERROR_DATA_TYPE    EHEA_BMASK_IBM(0,7)
+
 static inline void *hw_qeit_calc(struct hw_queue *queue, u64 q_offset)
 {
        struct ehea_page *current_page;
@@ -355,4 +358,6 @@ int ehea_destroy_qp(struct ehea_qp *qp);
 
 int ehea_reg_mr_adapter(struct ehea_adapter *adapter);
 
+void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle);
+
 #endif /* __EHEA_QMR_H__ */
index 1be4a84dce0edc84207261b08ceb9bc5bf860ae9..1f83988a6a640c3b40f882e48fef8e11669d32e1 100644 (file)
@@ -10,6 +10,7 @@
  * Maintainer: Kumar Gala
  *
  * Copyright (c) 2002-2006 Freescale Semiconductor, Inc.
+ * Copyright (c) 2007 MontaVista Software, Inc.
  *
  * 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
@@ -1612,71 +1613,17 @@ static irqreturn_t gfar_interrupt(int irq, void *dev_id)
        /* Save ievent for future reference */
        u32 events = gfar_read(&priv->regs->ievent);
 
-       /* Clear IEVENT */
-       gfar_write(&priv->regs->ievent, events);
-
        /* Check for reception */
-       if ((events & IEVENT_RXF0) || (events & IEVENT_RXB0))
+       if (events & IEVENT_RX_MASK)
                gfar_receive(irq, dev_id);
 
        /* Check for transmit completion */
-       if ((events & IEVENT_TXF) || (events & IEVENT_TXB))
+       if (events & IEVENT_TX_MASK)
                gfar_transmit(irq, dev_id);
 
-       /* Update error statistics */
-       if (events & IEVENT_TXE) {
-               priv->stats.tx_errors++;
-
-               if (events & IEVENT_LC)
-                       priv->stats.tx_window_errors++;
-               if (events & IEVENT_CRL)
-                       priv->stats.tx_aborted_errors++;
-               if (events & IEVENT_XFUN) {
-                       if (netif_msg_tx_err(priv))
-                               printk(KERN_WARNING "%s: tx underrun. dropped packet\n", dev->name);
-                       priv->stats.tx_dropped++;
-                       priv->extra_stats.tx_underrun++;
-
-                       /* Reactivate the Tx Queues */
-                       gfar_write(&priv->regs->tstat, TSTAT_CLEAR_THALT);
-               }
-       }
-       if (events & IEVENT_BSY) {
-               priv->stats.rx_errors++;
-               priv->extra_stats.rx_bsy++;
-
-               gfar_receive(irq, dev_id);
-
-#ifndef CONFIG_GFAR_NAPI
-               /* Clear the halt bit in RSTAT */
-               gfar_write(&priv->regs->rstat, RSTAT_CLEAR_RHALT);
-#endif
-
-               if (netif_msg_rx_err(priv))
-                       printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n",
-                                       dev->name,
-                                       gfar_read(&priv->regs->rstat));
-       }
-       if (events & IEVENT_BABR) {
-               priv->stats.rx_errors++;
-               priv->extra_stats.rx_babr++;
-
-               if (netif_msg_rx_err(priv))
-                       printk(KERN_DEBUG "%s: babbling error\n", dev->name);
-       }
-       if (events & IEVENT_EBERR) {
-               priv->extra_stats.eberr++;
-               if (netif_msg_rx_err(priv))
-                       printk(KERN_DEBUG "%s: EBERR\n", dev->name);
-       }
-       if ((events & IEVENT_RXC) && (netif_msg_rx_err(priv)))
-                       printk(KERN_DEBUG "%s: control frame\n", dev->name);
-
-       if (events & IEVENT_BABT) {
-               priv->extra_stats.tx_babt++;
-               if (netif_msg_rx_err(priv))
-                       printk(KERN_DEBUG "%s: babt error\n", dev->name);
-       }
+       /* Check for errors */
+       if (events & IEVENT_ERR_MASK)
+               gfar_error(irq, dev_id);
 
        return IRQ_HANDLED;
 }
@@ -1938,7 +1885,7 @@ static irqreturn_t gfar_error(int irq, void *dev_id)
        /* Hmm... */
        if (netif_msg_rx_err(priv) || netif_msg_tx_err(priv))
                printk(KERN_DEBUG "%s: error interrupt (ievent=0x%08x imask=0x%08x)\n",
-                               dev->name, events, gfar_read(&priv->regs->imask));
+                      dev->name, events, gfar_read(&priv->regs->imask));
 
        /* Update the error counters */
        if (events & IEVENT_TXE) {
@@ -1950,8 +1897,8 @@ static irqreturn_t gfar_error(int irq, void *dev_id)
                        priv->stats.tx_aborted_errors++;
                if (events & IEVENT_XFUN) {
                        if (netif_msg_tx_err(priv))
-                               printk(KERN_DEBUG "%s: underrun.  packet dropped.\n",
-                                               dev->name);
+                               printk(KERN_DEBUG "%s: TX FIFO underrun, "
+                                      "packet dropped.\n", dev->name);
                        priv->stats.tx_dropped++;
                        priv->extra_stats.tx_underrun++;
 
@@ -1973,30 +1920,28 @@ static irqreturn_t gfar_error(int irq, void *dev_id)
 #endif
 
                if (netif_msg_rx_err(priv))
-                       printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n",
-                                       dev->name,
-                                       gfar_read(&priv->regs->rstat));
+                       printk(KERN_DEBUG "%s: busy error (rstat: %x)\n",
+                              dev->name, gfar_read(&priv->regs->rstat));
        }
        if (events & IEVENT_BABR) {
                priv->stats.rx_errors++;
                priv->extra_stats.rx_babr++;
 
                if (netif_msg_rx_err(priv))
-                       printk(KERN_DEBUG "%s: babbling error\n", dev->name);
+                       printk(KERN_DEBUG "%s: babbling RX error\n", dev->name);
        }
        if (events & IEVENT_EBERR) {
                priv->extra_stats.eberr++;
                if (netif_msg_rx_err(priv))
-                       printk(KERN_DEBUG "%s: EBERR\n", dev->name);
+                       printk(KERN_DEBUG "%s: bus error\n", dev->name);
        }
        if ((events & IEVENT_RXC) && netif_msg_rx_status(priv))
-               if (netif_msg_rx_status(priv))
-                       printk(KERN_DEBUG "%s: control frame\n", dev->name);
+               printk(KERN_DEBUG "%s: control frame\n", dev->name);
 
        if (events & IEVENT_BABT) {
                priv->extra_stats.tx_babt++;
                if (netif_msg_tx_err(priv))
-                       printk(KERN_DEBUG "%s: babt error\n", dev->name);
+                       printk(KERN_DEBUG "%s: babbling TX error\n", dev->name);
        }
        return IRQ_HANDLED;
 }
index 45ffb5d0ca33d54ec64c020dd2bf01ab44df0d15..aec9ab17a9a5884df180ac4e26ec59b3ec82185c 100644 (file)
 #include "gianfar.h"
 
 #define GFAR_ATTR(_name) \
-static ssize_t gfar_show_##_name(struct class_device *cdev, char *buf); \
-static ssize_t gfar_set_##_name(struct class_device *cdev, \
+static ssize_t gfar_show_##_name(struct device *dev, \
+        struct device_attribute *attr, char *buf); \
+static ssize_t gfar_set_##_name(struct device *dev, \
+               struct device_attribute *attr, \
                const char *buf, size_t count); \
-static CLASS_DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)
+static DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)
 
 #define GFAR_CREATE_FILE(_dev, _name) \
-       class_device_create_file(&_dev->class_dev, &class_device_attr_##_name)
+       device_create_file(&_dev->dev, &dev_attr_##_name)
 
 GFAR_ATTR(bd_stash);
 GFAR_ATTR(rx_stash_size);
@@ -53,29 +55,28 @@ GFAR_ATTR(fifo_threshold);
 GFAR_ATTR(fifo_starve);
 GFAR_ATTR(fifo_starve_off);
 
-#define to_net_dev(cd) container_of(cd, struct net_device, class_dev)
-
-static ssize_t gfar_show_bd_stash(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_bd_stash(struct device *dev,
+                                 struct device_attribute *attr, char *buf)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
 
-       return sprintf(buf, "%s\n", priv->bd_stash_en? "on" : "off");
+       return sprintf(buf, "%s\n", priv->bd_stash_en ? "on" : "off");
 }
 
-static ssize_t gfar_set_bd_stash(struct class_device *cdev,
-               const char *buf, size_t count)
+static ssize_t gfar_set_bd_stash(struct device *dev,
+                                struct device_attribute *attr,
+                                const char *buf, size_t count)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
        int new_setting = 0;
        u32 temp;
        unsigned long flags;
 
        /* Find out the new setting */
-       if (!strncmp("on", buf, count-1) || !strncmp("1", buf, count-1))
+       if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1))
                new_setting = 1;
-       else if (!strncmp("off", buf, count-1) || !strncmp("0", buf, count-1))
+       else if (!strncmp("off", buf, count - 1)
+                || !strncmp("0", buf, count - 1))
                new_setting = 0;
        else
                return count;
@@ -99,19 +100,19 @@ static ssize_t gfar_set_bd_stash(struct class_device *cdev,
        return count;
 }
 
-static ssize_t gfar_show_rx_stash_size(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_rx_stash_size(struct device *dev,
+                                      struct device_attribute *attr, char *buf)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
 
        return sprintf(buf, "%d\n", priv->rx_stash_size);
 }
 
-static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
-               const char *buf, size_t count)
+static ssize_t gfar_set_rx_stash_size(struct device *dev,
+                                     struct device_attribute *attr,
+                                     const char *buf, size_t count)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
        unsigned int length = simple_strtoul(buf, NULL, 0);
        u32 temp;
        unsigned long flags;
@@ -145,21 +146,21 @@ static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
        return count;
 }
 
-
 /* Stashing will only be enabled when rx_stash_size != 0 */
-static ssize_t gfar_show_rx_stash_index(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_rx_stash_index(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
 
        return sprintf(buf, "%d\n", priv->rx_stash_index);
 }
 
-static ssize_t gfar_set_rx_stash_index(struct class_device *cdev,
-               const char *buf, size_t count)
+static ssize_t gfar_set_rx_stash_index(struct device *dev,
+                                      struct device_attribute *attr,
+                                      const char *buf, size_t count)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
        unsigned short index = simple_strtoul(buf, NULL, 0);
        u32 temp;
        unsigned long flags;
@@ -183,19 +184,20 @@ static ssize_t gfar_set_rx_stash_index(struct class_device *cdev,
        return count;
 }
 
-static ssize_t gfar_show_fifo_threshold(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_fifo_threshold(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
 
        return sprintf(buf, "%d\n", priv->fifo_threshold);
 }
 
-static ssize_t gfar_set_fifo_threshold(struct class_device *cdev,
-               const char *buf, size_t count)
+static ssize_t gfar_set_fifo_threshold(struct device *dev,
+                                      struct device_attribute *attr,
+                                      const char *buf, size_t count)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
        unsigned int length = simple_strtoul(buf, NULL, 0);
        u32 temp;
        unsigned long flags;
@@ -217,20 +219,19 @@ static ssize_t gfar_set_fifo_threshold(struct class_device *cdev,
        return count;
 }
 
-static ssize_t gfar_show_fifo_starve(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_fifo_starve(struct device *dev,
+                                    struct device_attribute *attr, char *buf)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
 
        return sprintf(buf, "%d\n", priv->fifo_starve);
 }
 
-
-static ssize_t gfar_set_fifo_starve(struct class_device *cdev,
-               const char *buf, size_t count)
+static ssize_t gfar_set_fifo_starve(struct device *dev,
+                                   struct device_attribute *attr,
+                                   const char *buf, size_t count)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
        unsigned int num = simple_strtoul(buf, NULL, 0);
        u32 temp;
        unsigned long flags;
@@ -252,19 +253,20 @@ static ssize_t gfar_set_fifo_starve(struct class_device *cdev,
        return count;
 }
 
-static ssize_t gfar_show_fifo_starve_off(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_fifo_starve_off(struct device *dev,
+                                        struct device_attribute *attr,
+                                        char *buf)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
 
        return sprintf(buf, "%d\n", priv->fifo_starve_off);
 }
 
-static ssize_t gfar_set_fifo_starve_off(struct class_device *cdev,
-               const char *buf, size_t count)
+static ssize_t gfar_set_fifo_starve_off(struct device *dev,
+                                       struct device_attribute *attr,
+                                       const char *buf, size_t count)
 {
-       struct net_device *dev = to_net_dev(cdev);
-       struct gfar_private *priv = netdev_priv(dev);
+       struct gfar_private *priv = netdev_priv(to_net_dev(dev));
        unsigned int num = simple_strtoul(buf, NULL, 0);
        u32 temp;
        unsigned long flags;
index f0d30cf67b5f6ba8b09746d72f41256ac09e93ba..4ad780719a848de644fb503a2f2e3f8dabfcb2dd 100644 (file)
@@ -836,13 +836,17 @@ static int ioc3_mii_init(struct ioc3_private *ip)
        }
 
        ip->mii.phy_id = i;
+
+out:
+       return res;
+}
+
+static void ioc3_mii_start(struct ioc3_private *ip)
+{
        ip->ioc3_timer.expires = jiffies + (12 * HZ)/10;  /* 1.2 sec. */
        ip->ioc3_timer.data = (unsigned long) ip;
        ip->ioc3_timer.function = &ioc3_timer;
        add_timer(&ip->ioc3_timer);
-
-out:
-       return res;
 }
 
 static inline void ioc3_clean_rx_ring(struct ioc3_private *ip)
@@ -1071,6 +1075,7 @@ static int ioc3_open(struct net_device *dev)
        ip->ehar_h = 0;
        ip->ehar_l = 0;
        ioc3_init(dev);
+       ioc3_mii_start(ip);
 
        netif_start_queue(dev);
        return 0;
@@ -1274,6 +1279,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto out_stop;
        }
 
+       ioc3_mii_start(ip);
        ioc3_ssram_disc(ip);
        ioc3_get_eaddr(ip);
 
@@ -1314,6 +1320,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 out_stop:
        ioc3_stop(ip);
+       del_timer_sync(&ip->ioc3_timer);
        ioc3_free_rings(ip);
 out_res:
        pci_release_regions(pdev);
@@ -1335,6 +1342,8 @@ static void __devexit ioc3_remove_one (struct pci_dev *pdev)
        struct ioc3 *ioc3 = ip->regs;
 
        unregister_netdev(dev);
+       del_timer_sync(&ip->ioc3_timer);
+
        iounmap(ioc3);
        pci_release_regions(pdev);
        free_netdev(dev);
@@ -1492,6 +1501,7 @@ static void ioc3_timeout(struct net_device *dev)
        ioc3_stop(ip);
        ioc3_init(dev);
        ioc3_mii_init(ip);
+       ioc3_mii_start(ip);
 
        spin_unlock_irq(&ip->ioc3_lock);
 
index a41418b3c518ae2d54346ec89738fa5680ead3a4..2e9571bf0736391a6cf425039793c5443f6da52e 100644 (file)
@@ -881,27 +881,15 @@ static struct net_device_stats *macb_get_stats(struct net_device *dev)
 static int macb_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
        struct macb *bp = netdev_priv(dev);
-       int ret;
-       unsigned long flags;
-
-       spin_lock_irqsave(&bp->lock, flags);
-       ret = mii_ethtool_gset(&bp->mii, cmd);
-       spin_unlock_irqrestore(&bp->lock, flags);
 
-       return ret;
+       return mii_ethtool_gset(&bp->mii, cmd);
 }
 
 static int macb_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
        struct macb *bp = netdev_priv(dev);
-       int ret;
-       unsigned long flags;
-
-       spin_lock_irqsave(&bp->lock, flags);
-       ret = mii_ethtool_sset(&bp->mii, cmd);
-       spin_unlock_irqrestore(&bp->lock, flags);
 
-       return ret;
+       return mii_ethtool_sset(&bp->mii, cmd);
 }
 
 static void macb_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
@@ -930,17 +918,11 @@ static struct ethtool_ops macb_ethtool_ops = {
 static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
        struct macb *bp = netdev_priv(dev);
-       int ret;
-       unsigned long flags;
 
        if (!netif_running(dev))
                return -EINVAL;
 
-       spin_lock_irqsave(&bp->lock, flags);
-       ret = generic_mii_ioctl(&bp->mii, if_mii(rq), cmd, NULL);
-       spin_unlock_irqrestore(&bp->lock, flags);
-
-       return ret;
+       return generic_mii_ioctl(&bp->mii, if_mii(rq), cmd, NULL);
 }
 
 static ssize_t macb_mii_show(const struct device *_dev, char *buf,
index d38b7c723620af0f23b904b2750a11767b5e4231..7e69ca6edd91a0a443c4f9f1349d9381ed0f4eb1 100644 (file)
@@ -170,7 +170,7 @@ static int mdio_probe(struct meth_private *priv)
 
 static void meth_check_link(struct net_device *dev)
 {
-       struct meth_private *priv = (struct meth_private *) dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
        unsigned long mii_advertising = mdio_read(priv, 4);
        unsigned long mii_partner = mdio_read(priv, 5);
        unsigned long negotiated = mii_advertising & mii_partner;
@@ -268,7 +268,7 @@ static void meth_free_rx_ring(struct meth_private *priv)
 
 int meth_reset(struct net_device *dev)
 {
-       struct meth_private *priv = (struct meth_private *) dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
 
        /* Reset card */
        mace->eth.mac_ctrl = SGI_MAC_RESET;
@@ -310,7 +310,7 @@ int meth_reset(struct net_device *dev)
  */
 static int meth_open(struct net_device *dev)
 {
-       struct meth_private *priv = dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
        int ret;
 
        priv->phy_addr = -1;    /* No PHY is known yet... */
@@ -354,7 +354,7 @@ out_free_tx_ring:
 
 static int meth_release(struct net_device *dev)
 {
-       struct meth_private *priv = dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
 
        DPRINTK("Stopping queue\n");
        netif_stop_queue(dev); /* can't transmit any more */
@@ -376,7 +376,7 @@ static void meth_rx(struct net_device* dev, unsigned long int_status)
 {
        struct sk_buff *skb;
        unsigned long status;
-       struct meth_private *priv = (struct meth_private *) dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
        unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8;
 
        spin_lock(&priv->meth_lock);
@@ -466,14 +466,14 @@ static void meth_rx(struct net_device* dev, unsigned long int_status)
 
 static int meth_tx_full(struct net_device *dev)
 {
-       struct meth_private *priv = (struct meth_private *) dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
 
        return (priv->tx_count >= TX_RING_ENTRIES - 1);
 }
 
 static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status)
 {
-       struct meth_private *priv = dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
        unsigned long status;
        struct sk_buff *skb;
        unsigned long rptr = (int_status&TX_INFO_RPTR) >> 16;
@@ -536,7 +536,7 @@ static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status)
 
 static void meth_error(struct net_device* dev, unsigned status)
 {
-       struct meth_private *priv = (struct meth_private *) dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
 
        printk(KERN_WARNING "meth: error status: 0x%08x\n",status);
        /* check for errors too... */
@@ -570,7 +570,7 @@ static void meth_error(struct net_device* dev, unsigned status)
 static irqreturn_t meth_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *)dev_id;
-       struct meth_private *priv = (struct meth_private *) dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
        unsigned long status;
 
        status = mace->eth.int_stat;
@@ -695,7 +695,7 @@ static void meth_add_to_tx_ring(struct meth_private *priv, struct sk_buff *skb)
  */
 static int meth_tx(struct sk_buff *skb, struct net_device *dev)
 {
-       struct meth_private *priv = (struct meth_private *) dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
        unsigned long flags;
 
        spin_lock_irqsave(&priv->meth_lock, flags);
@@ -726,7 +726,7 @@ static int meth_tx(struct sk_buff *skb, struct net_device *dev)
  */
 static void meth_tx_timeout(struct net_device *dev)
 {
-       struct meth_private *priv = (struct meth_private *) dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
        unsigned long flags;
 
        printk(KERN_WARNING "%s: transmit timed out\n", dev->name);
@@ -778,7 +778,7 @@ static int meth_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
  */
 static struct net_device_stats *meth_stats(struct net_device *dev)
 {
-       struct meth_private *priv = (struct meth_private *) dev->priv;
+       struct meth_private *priv = netdev_priv(dev);
        return &priv->stats;
 }
 
@@ -807,7 +807,7 @@ static struct net_device *meth_init(void)
        dev->irq             = MACE_ETHERNET_IRQ;
        dev->base_addr       = (unsigned long)&mace->eth;
 
-       priv = (struct meth_private *) dev->priv;
+       priv = netdev_priv(dev);
        spin_lock_init(&priv->meth_lock);
 
        ret = register_netdev(dev);
index 3f3896e988790ab9a5484c6f267902bc56f03612..2807ef400fb583ecdb5c248e8cc05b2330ec3fff 100644 (file)
@@ -252,7 +252,7 @@ typedef u32 netxen_ctx_msg;
 #define netxen_set_msg_ctxid(config_word, val) \
        ((config_word) &= ~(0x3ff<<18), (config_word) |= (val & 0x3ff) << 18)
 #define netxen_set_msg_opcode(config_word, val)        \
-       ((config_word) &= ~(0xf<<24), (config_word) |= (val & 0xf) << 24)
+       ((config_word) &= ~(0xf<<28), (config_word) |= (val & 0xf) << 28)
 
 struct netxen_rcv_context {
        __le64 rcv_ring_addr;
@@ -303,14 +303,14 @@ struct netxen_ring_ctx {
        (cmd_desc)->flags_opcode |= cpu_to_le16((val) & 0x7f))
 #define netxen_set_cmd_desc_opcode(cmd_desc, val)      \
        ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x3f<<7), \
-       (cmd_desc)->flags_opcode |= cpu_to_le16((val) & (0x3f<<7)))
+       (cmd_desc)->flags_opcode |= cpu_to_le16(((val & 0x3f)<<7)))
 
 #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \
        ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \
        (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff))
 #define netxen_set_cmd_desc_totallength(cmd_desc, val) \
-       ((cmd_desc)->num_of_buffers_total_length &= cpu_to_le32(0xff), \
-       (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 24))
+       ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xffffff00), \
+       (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 8))
 
 #define netxen_get_cmd_desc_opcode(cmd_desc)   \
        ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F)
@@ -1040,6 +1040,7 @@ int netxen_flash_unlock(struct netxen_adapter *adapter);
 int netxen_backup_crbinit(struct netxen_adapter *adapter);
 int netxen_flash_erase_secondary(struct netxen_adapter *adapter);
 int netxen_flash_erase_primary(struct netxen_adapter *adapter);
+void netxen_halt_pegs(struct netxen_adapter *adapter);
 
 int netxen_rom_fast_write(struct netxen_adapter *adapter, int addr, int data);
 int netxen_rom_se(struct netxen_adapter *adapter, int addr);
index cc0efe213e01f84b95af13e4bbf81dceb3c02a47..6252e9a8727854719cf2323fe5f5f61a867ea54f 100644 (file)
@@ -402,7 +402,7 @@ netxen_nic_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
        wol->wolopts = 0;
 }
 
-static u32 netxen_nic_get_link(struct net_device *dev)
+static u32 netxen_nic_test_link(struct net_device *dev)
 {
        struct netxen_port *port = netdev_priv(dev);
        struct netxen_adapter *adapter = port->adapter;
@@ -459,6 +459,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
        int ret;
 
        if (flash_start == 0) {
+               netxen_halt_pegs(adapter);
                ret = netxen_flash_unlock(adapter);
                if (ret < 0) {
                        printk(KERN_ERR "%s: Flash unlock failed.\n",
@@ -712,7 +713,7 @@ netxen_nic_diag_test(struct net_device *dev, struct ethtool_test *eth_test,
 {
        if (eth_test->flags == ETH_TEST_FL_OFFLINE) {   /* offline tests */
                /* link test */
-               if (!(data[4] = (u64) netxen_nic_get_link(dev)))
+               if (!(data[4] = (u64) netxen_nic_test_link(dev)))
                        eth_test->flags |= ETH_TEST_FL_FAILED;
 
                if (netif_running(dev))
@@ -727,7 +728,7 @@ netxen_nic_diag_test(struct net_device *dev, struct ethtool_test *eth_test,
                        dev->open(dev);
        } else {                /* online tests */
                /* link test */
-               if (!(data[4] = (u64) netxen_nic_get_link(dev)))
+               if (!(data[4] = (u64) netxen_nic_test_link(dev)))
                        eth_test->flags |= ETH_TEST_FL_FAILED;
 
                /* other tests pass by default */
@@ -783,7 +784,7 @@ struct ethtool_ops netxen_nic_ethtool_ops = {
        .get_regs_len = netxen_nic_get_regs_len,
        .get_regs = netxen_nic_get_regs,
        .get_wol = netxen_nic_get_wol,
-       .get_link = netxen_nic_get_link,
+       .get_link = ethtool_op_get_link,
        .get_eeprom_len = netxen_nic_get_eeprom_len,
        .get_eeprom = netxen_nic_get_eeprom,
        .set_eeprom = netxen_nic_set_eeprom,
index f263232f499fdc56fc7cc0837bc4783d12d62c0f..7195af3e8f3ddb1182d5b81d1debe33adc44be1c 100644 (file)
@@ -420,6 +420,7 @@ static int netxen_get_flash_block(struct netxen_adapter *adapter, int base,
        for (i = 0; i < size / sizeof(u32); i++) {
                if (netxen_rom_fast_read(adapter, addr, ptr32) == -1)
                        return -1;
+               *ptr32 = cpu_to_le32(*ptr32);
                ptr32++;
                addr += sizeof(u32);
        }
@@ -428,6 +429,7 @@ static int netxen_get_flash_block(struct netxen_adapter *adapter, int base,
 
                if (netxen_rom_fast_read(adapter, addr, &local) == -1)
                        return -1;
+               local = cpu_to_le32(local);
                memcpy(ptr32, &local, (char *)buf + size - (char *)ptr32);
        }
 
index f7bb8c90537cd9880603b0abd41ae24907fb2c1c..2f324366784d9e9a3509dddb56bb1864d423e6ba 100644 (file)
@@ -717,6 +717,14 @@ netxen_flash_erase_primary(struct netxen_adapter *adapter)
        return ret;
 }
 
+void netxen_halt_pegs(struct netxen_adapter *adapter)
+{
+        netxen_crb_writelit_adapter(adapter, NETXEN_CRB_PEG_NET_0 + 0x3c, 1);
+        netxen_crb_writelit_adapter(adapter, NETXEN_CRB_PEG_NET_1 + 0x3c, 1);
+        netxen_crb_writelit_adapter(adapter, NETXEN_CRB_PEG_NET_2 + 0x3c, 1);
+        netxen_crb_writelit_adapter(adapter, NETXEN_CRB_PEG_NET_3 + 0x3c, 1);
+}
+
 int netxen_flash_unlock(struct netxen_adapter *adapter)
 {
        int ret = 0;
@@ -1246,7 +1254,7 @@ int netxen_process_cmd_ring(unsigned long data)
         * the netdev which is associated with that device.
         */
 
-       consumer = *(adapter->cmd_consumer);
+       consumer = le32_to_cpu(*(adapter->cmd_consumer));
        if (last_consumer == consumer) {        /* Ring is empty    */
                DPRINTK(INFO, "last_consumer %d == consumer %d\n",
                        last_consumer, consumer);
@@ -1340,7 +1348,7 @@ int netxen_process_cmd_ring(unsigned long data)
        if (adapter->last_cmd_consumer == consumer &&
            (((adapter->cmd_producer + 1) %
              adapter->max_tx_desc_count) == adapter->last_cmd_consumer)) {
-               consumer = *(adapter->cmd_consumer);
+               consumer = le32_to_cpu(*(adapter->cmd_consumer));
        }
        done = (adapter->last_cmd_consumer == consumer);
 
index 36ba6a1aa3637f08da4f736fa37ce17e9cceba6f..225ff55527c447f1e0955eac185cec895e951548 100644 (file)
@@ -434,12 +434,13 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                adapter->port_count++;
                adapter->port[i] = port;
        }
-
+#ifndef CONFIG_PPC64
        writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE));
        netxen_pinit_from_rom(adapter, 0);
        udelay(500);
        netxen_load_firmware(adapter);
        netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
+#endif
        /*
         * delay a while to ensure that the Pegs are up & running.
         * Otherwise, we might see some flaky behaviour.
index 40d7003a371caf4d06dd9d0cd91aa84ce1845bc7..d5d95074e56942a93a171671de337e36b6e9ce5c 100644 (file)
@@ -458,7 +458,7 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port)
 
 int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port)
 {
-       long reg = 0, ret = 0;
+       u32 reg = 0, ret = 0;
 
        if (adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) {
                netxen_crb_writelit_adapter(adapter,
index 448bf4a780163751bc154d543b7289e1d50dcf67..c7bd9c1c7f31a0aeed77ff659ee2c6d81151e736 100644 (file)
@@ -915,7 +915,7 @@ static void media_check(unsigned long arg)
        if ((inw(ioaddr + EL3_STATUS) & IntLatch) && (inb(ioaddr + Timer) == 0xff)) {
                if (!lp->fast_poll)
                        printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name);
-               el3_interrupt(dev->irq, lp);
+               el3_interrupt(dev->irq, dev);
                lp->fast_poll = HZ;
        }
        if (lp->fast_poll) {
index 530df8883fe5a207a7d6465604ad11ce7327e1b5..2561f76033eab60ec944dd04f06a8d22f2d3b7d7 100644 (file)
@@ -1927,7 +1927,7 @@ static void media_check(u_long arg)
     if (smc->watchdog++ && ((i>>8) & i)) {
        if (!smc->fast_poll)
            printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name);
-       smc_interrupt(dev->irq, smc);
+       smc_interrupt(dev->irq, dev);
        smc->fast_poll = HZ;
     }
     if (smc->fast_poll) {
index f4d4eb659cadec5ba3d58b145711bb043fb5193d..22aec5cce68310ab6e4128b2ec30435fcff5c375 100644 (file)
 #define MII_M1011_IMASK_INIT           0x6400
 #define MII_M1011_IMASK_CLEAR          0x0000
 
+#define MII_M1011_PHY_SCR              0x10
+#define MII_M1011_PHY_SCR_AUTO_CROSS   0x0060
+
+#define MII_M1145_PHY_EXT_CR           0x14
+#define MII_M1145_RGMII_RX_DELAY       0x0080
+#define MII_M1145_RGMII_TX_DELAY       0x0002
+
+#define M1145_DEV_FLAGS_RESISTANCE     0x00000001
+
+#define MII_M1111_PHY_LED_CONTROL      0x18
+#define MII_M1111_PHY_LED_DIRECT       0x4100
+#define MII_M1111_PHY_LED_COMBINE      0x411c
+
 MODULE_DESCRIPTION("Marvell PHY driver");
 MODULE_AUTHOR("Andy Fleming");
 MODULE_LICENSE("GPL");
@@ -63,7 +76,7 @@ static int marvell_config_intr(struct phy_device *phydev)
 {
        int err;
 
-       if(phydev->interrupts == PHY_INTERRUPT_ENABLED)
+       if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
                err = phy_write(phydev, MII_M1011_IMASK, MII_M1011_IMASK_INIT);
        else
                err = phy_write(phydev, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR);
@@ -103,34 +116,153 @@ static int marvell_config_aneg(struct phy_device *phydev)
        if (err < 0)
                return err;
 
+       err = phy_write(phydev, MII_M1011_PHY_SCR,
+                       MII_M1011_PHY_SCR_AUTO_CROSS);
+       if (err < 0)
+               return err;
+
+       err = phy_write(phydev, MII_M1111_PHY_LED_CONTROL,
+                       MII_M1111_PHY_LED_DIRECT);
+       if (err < 0)
+               return err;
 
        err = genphy_config_aneg(phydev);
 
        return err;
 }
 
+static int m88e1145_config_init(struct phy_device *phydev)
+{
+       int err;
+
+       /* Take care of errata E0 & E1 */
+       err = phy_write(phydev, 0x1d, 0x001b);
+       if (err < 0)
+               return err;
+
+       err = phy_write(phydev, 0x1e, 0x418f);
+       if (err < 0)
+               return err;
+
+       err = phy_write(phydev, 0x1d, 0x0016);
+       if (err < 0)
+               return err;
+
+       err = phy_write(phydev, 0x1e, 0xa2da);
+       if (err < 0)
+               return err;
+
+       if (phydev->interface == PHY_INTERFACE_MODE_RGMII) {
+               int temp = phy_read(phydev, MII_M1145_PHY_EXT_CR);
+               if (temp < 0)
+                       return temp;
+
+               temp |= (MII_M1145_RGMII_RX_DELAY | MII_M1145_RGMII_TX_DELAY);
+
+               err = phy_write(phydev, MII_M1145_PHY_EXT_CR, temp);
+               if (err < 0)
+                       return err;
+
+               if (phydev->dev_flags & M1145_DEV_FLAGS_RESISTANCE) {
+                       err = phy_write(phydev, 0x1d, 0x0012);
+                       if (err < 0)
+                               return err;
+
+                       temp = phy_read(phydev, 0x1e);
+                       if (temp < 0)
+                               return temp;
+
+                       temp &= 0xf03f;
+                       temp |= 2 << 9; /* 36 ohm */
+                       temp |= 2 << 6; /* 39 ohm */
+
+                       err = phy_write(phydev, 0x1e, temp);
+                       if (err < 0)
+                               return err;
+
+                       err = phy_write(phydev, 0x1d, 0x3);
+                       if (err < 0)
+                               return err;
+
+                       err = phy_write(phydev, 0x1e, 0x8000);
+                       if (err < 0)
+                               return err;
+               }
+       }
+
+       return 0;
+}
 
 static struct phy_driver m88e1101_driver = {
-       .phy_id         = 0x01410c00,
-       .phy_id_mask    = 0xffffff00,
-       .name           = "Marvell 88E1101",
-       .features       = PHY_GBIT_FEATURES,
-       .flags          = PHY_HAS_INTERRUPT,
-       .config_aneg    = &marvell_config_aneg,
-       .read_status    = &genphy_read_status,
-       .ack_interrupt  = &marvell_ack_interrupt,
-       .config_intr    = &marvell_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
+       .phy_id = 0x01410c60,
+       .phy_id_mask = 0xfffffff0,
+       .name = "Marvell 88E1101",
+       .features = PHY_GBIT_FEATURES,
+       .flags = PHY_HAS_INTERRUPT,
+       .config_aneg = &marvell_config_aneg,
+       .read_status = &genphy_read_status,
+       .ack_interrupt = &marvell_ack_interrupt,
+       .config_intr = &marvell_config_intr,
+       .driver = {.owner = THIS_MODULE,},
+};
+
+static struct phy_driver m88e1111s_driver = {
+       .phy_id = 0x01410cc0,
+       .phy_id_mask = 0xfffffff0,
+       .name = "Marvell 88E1111",
+       .features = PHY_GBIT_FEATURES,
+       .flags = PHY_HAS_INTERRUPT,
+       .config_aneg = &marvell_config_aneg,
+       .read_status = &genphy_read_status,
+       .ack_interrupt = &marvell_ack_interrupt,
+       .config_intr = &marvell_config_intr,
+       .driver = {.owner = THIS_MODULE,},
+};
+
+static struct phy_driver m88e1145_driver = {
+       .phy_id = 0x01410cd0,
+       .phy_id_mask = 0xfffffff0,
+       .name = "Marvell 88E1145",
+       .features = PHY_GBIT_FEATURES,
+       .flags = PHY_HAS_INTERRUPT,
+       .config_init = &m88e1145_config_init,
+       .config_aneg = &marvell_config_aneg,
+       .read_status = &genphy_read_status,
+       .ack_interrupt = &marvell_ack_interrupt,
+       .config_intr = &marvell_config_intr,
+       .driver = {.owner = THIS_MODULE,},
 };
 
 static int __init marvell_init(void)
 {
-       return phy_driver_register(&m88e1101_driver);
+       int ret;
+
+       ret = phy_driver_register(&m88e1101_driver);
+       if (ret)
+               return ret;
+
+       ret = phy_driver_register(&m88e1111s_driver);
+       if (ret)
+               goto err1111s;
+
+       ret = phy_driver_register(&m88e1145_driver);
+       if (ret)
+               goto err1145;
+
+       return 0;
+
+      err1145:
+       phy_driver_unregister(&m88e1111s_driver);
+      err1111s:
+       phy_driver_unregister(&m88e1101_driver);
+       return ret;
 }
 
 static void __exit marvell_exit(void)
 {
        phy_driver_unregister(&m88e1101_driver);
+       phy_driver_unregister(&m88e1111s_driver);
+       phy_driver_unregister(&m88e1145_driver);
 }
 
 module_init(marvell_init);
index fdf45fdb67319255e6220f4c72c7c042c55155e2..7d5b6d1838c8ddc56563ec0aba05aed388778e0e 100644 (file)
@@ -138,7 +138,7 @@ void phy_prepare_link(struct phy_device *phydev,
  */
 struct phy_device * phy_connect(struct net_device *dev, const char *phy_id,
                void (*handler)(struct net_device *), u32 flags,
-               u32 interface)
+               phy_interface_t interface)
 {
        struct phy_device *phydev;
 
@@ -187,7 +187,7 @@ static int phy_compare_id(struct device *dev, void *data)
 }
 
 struct phy_device *phy_attach(struct net_device *dev,
-               const char *phy_id, u32 flags, u32 interface)
+               const char *phy_id, u32 flags, phy_interface_t interface)
 {
        struct bus_type *bus = &mdio_bus_type;
        struct phy_device *phydev;
index 92d11b961db88bd81133ce89eb7fec03365f1f40..e94ab256b5406afc5b4a80559e880c5680b54bc6 100644 (file)
@@ -5188,6 +5188,9 @@ static struct pci_driver skge_driver = {
 
 static int __init skge_init(void)
 {
+       printk(KERN_NOTICE "sk98lin: driver has been replaced by the skge driver"
+              " and is scheduled for removal\n");
+
        return pci_register_driver(&skge_driver);
 }
 
index f2ab3d56e5653663040190dd91dcdfbc3e38ed70..52edbd7ac17e6a134e2af1ca4fe3abd9e42c46ac 100644 (file)
@@ -49,7 +49,7 @@
 #include "sky2.h"
 
 #define DRV_NAME               "sky2"
-#define DRV_VERSION            "1.12"
+#define DRV_VERSION            "1.13"
 #define PFX                    DRV_NAME " "
 
 /*
@@ -1742,13 +1742,6 @@ static void sky2_link_down(struct sky2_port *sky2)
        reg &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA);
        gma_write16(hw, port, GM_GP_CTRL, reg);
 
-       if (sky2->flow_status == FC_RX) {
-               /* restore Asymmetric Pause bit */
-               gm_phy_write(hw, port, PHY_MARV_AUNE_ADV,
-                            gm_phy_read(hw, port, PHY_MARV_AUNE_ADV)
-                            | PHY_M_AN_ASP);
-       }
-
        netif_carrier_off(sky2->netdev);
        netif_stop_queue(sky2->netdev);
 
@@ -1773,10 +1766,10 @@ static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux)
 {
        struct sky2_hw *hw = sky2->hw;
        unsigned port = sky2->port;
-       u16 lpa;
+       u16 advert, lpa;
 
+       advert = gm_phy_read(hw, port, PHY_MARV_AUNE_ADV);
        lpa = gm_phy_read(hw, port, PHY_MARV_AUNE_LP);
-
        if (lpa & PHY_M_AN_RF) {
                printk(KERN_ERR PFX "%s: remote fault", sky2->netdev->name);
                return -1;
@@ -1791,20 +1784,40 @@ static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux)
        sky2->speed = sky2_phy_speed(hw, aux);
        sky2->duplex = (aux & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF;
 
-       /* Pause bits are offset (9..8) */
-       if (hw->chip_id == CHIP_ID_YUKON_XL
-           || hw->chip_id == CHIP_ID_YUKON_EC_U
-           || hw->chip_id == CHIP_ID_YUKON_EX)
-               aux >>= 6;
-
-       sky2->flow_status = sky2_flow(aux & PHY_M_PS_RX_P_EN,
-                                     aux & PHY_M_PS_TX_P_EN);
+       /* Since the pause result bits seem to in different positions on
+        * different chips. look at registers.
+        */
+       if (!sky2_is_copper(hw)) {
+               /* Shift for bits in fiber PHY */
+               advert &= ~(ADVERTISE_PAUSE_CAP|ADVERTISE_PAUSE_ASYM);
+               lpa &= ~(LPA_PAUSE_CAP|LPA_PAUSE_ASYM);
+
+               if (advert & ADVERTISE_1000XPAUSE)
+                       advert |= ADVERTISE_PAUSE_CAP;
+               if (advert & ADVERTISE_1000XPSE_ASYM)
+                       advert |= ADVERTISE_PAUSE_ASYM;
+               if (lpa & LPA_1000XPAUSE)
+                       lpa |= LPA_PAUSE_CAP;
+               if (lpa & LPA_1000XPAUSE_ASYM)
+                       lpa |= LPA_PAUSE_ASYM;
+       }
+
+       sky2->flow_status = FC_NONE;
+       if (advert & ADVERTISE_PAUSE_CAP) {
+               if (lpa & LPA_PAUSE_CAP)
+                       sky2->flow_status = FC_BOTH;
+               else if (advert & ADVERTISE_PAUSE_ASYM)
+                       sky2->flow_status = FC_RX;
+       } else if (advert & ADVERTISE_PAUSE_ASYM) {
+               if ((lpa & LPA_PAUSE_CAP) && (lpa & LPA_PAUSE_ASYM))
+                       sky2->flow_status = FC_TX;
+       }
 
        if (sky2->duplex == DUPLEX_HALF && sky2->speed < SPEED_1000
            && !(hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_EX))
                sky2->flow_status = FC_NONE;
 
-       if (aux & PHY_M_PS_RX_P_EN)
+       if (sky2->flow_status & FC_TX)
                sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_ON);
        else
                sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
@@ -1853,16 +1866,13 @@ out:
        spin_unlock(&sky2->phy_lock);
 }
 
-
 /* Transmit timeout is only called if we are running, carrier is up
  * and tx queue is full (stopped).
- * Called with netif_tx_lock held.
  */
 static void sky2_tx_timeout(struct net_device *dev)
 {
        struct sky2_port *sky2 = netdev_priv(dev);
        struct sky2_hw *hw = sky2->hw;
-       u32 imask;
 
        if (netif_msg_timer(sky2))
                printk(KERN_ERR PFX "%s: tx timeout\n", dev->name);
@@ -1872,19 +1882,8 @@ static void sky2_tx_timeout(struct net_device *dev)
               sky2_read16(hw, sky2->port == 0 ? STAT_TXA1_RIDX : STAT_TXA2_RIDX),
               sky2_read16(hw, Q_ADDR(txqaddr[sky2->port], Q_DONE)));
 
-       imask = sky2_read32(hw, B0_IMSK);       /* block IRQ in hw */
-       sky2_write32(hw, B0_IMSK, 0);
-       sky2_read32(hw, B0_IMSK);
-
-       netif_poll_disable(hw->dev[0]);         /* stop NAPI poll */
-       synchronize_irq(hw->pdev->irq);
-
-       netif_start_queue(dev);                 /* don't wakeup during flush */
-       sky2_tx_complete(sky2, sky2->tx_prod);  /* Flush transmit queue */
-
-       sky2_write32(hw, B0_IMSK, imask);
-
-       sky2_phy_reinit(sky2);                  /* this clears flow control etc */
+       /* can't restart safely under softirq */
+       schedule_work(&hw->restart_work);
 }
 
 static int sky2_change_mtu(struct net_device *dev, int new_mtu)
@@ -2057,9 +2056,6 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
        if (!(status & GMR_FS_RX_OK))
                goto resubmit;
 
-       if (length > dev->mtu + ETH_HLEN)
-               goto oversize;
-
        if (length < copybreak)
                skb = receive_copy(sky2, re, length);
        else
@@ -2069,14 +2065,10 @@ resubmit:
 
        return skb;
 
-oversize:
-       ++sky2->net_stats.rx_over_errors;
-       goto resubmit;
-
 error:
        ++sky2->net_stats.rx_errors;
        if (status & GMR_FS_RX_FF_OV) {
-               sky2->net_stats.rx_fifo_errors++;
+               sky2->net_stats.rx_over_errors++;
                goto resubmit;
        }
 
@@ -2638,6 +2630,49 @@ static void sky2_reset(struct sky2_hw *hw)
        sky2_write8(hw, STAT_ISR_TIMER_CTRL, TIM_START);
 }
 
+static void sky2_restart(struct work_struct *work)
+{
+       struct sky2_hw *hw = container_of(work, struct sky2_hw, restart_work);
+       struct net_device *dev;
+       int i, err;
+
+       dev_dbg(&hw->pdev->dev, "restarting\n");
+
+       del_timer_sync(&hw->idle_timer);
+
+       rtnl_lock();
+       sky2_write32(hw, B0_IMSK, 0);
+       sky2_read32(hw, B0_IMSK);
+
+       netif_poll_disable(hw->dev[0]);
+
+       for (i = 0; i < hw->ports; i++) {
+               dev = hw->dev[i];
+               if (netif_running(dev))
+                       sky2_down(dev);
+       }
+
+       sky2_reset(hw);
+       sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
+       netif_poll_enable(hw->dev[0]);
+
+       for (i = 0; i < hw->ports; i++) {
+               dev = hw->dev[i];
+               if (netif_running(dev)) {
+                       err = sky2_up(dev);
+                       if (err) {
+                               printk(KERN_INFO PFX "%s: could not restart %d\n",
+                                      dev->name, err);
+                               dev_close(dev);
+                       }
+               }
+       }
+
+       sky2_idle_start(hw);
+
+       rtnl_unlock();
+}
+
 static inline u8 sky2_wol_supported(const struct sky2_hw *hw)
 {
        return sky2_is_copper(hw) ? (WAKE_PHY | WAKE_MAGIC) : 0;
@@ -3600,6 +3635,8 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
        }
 
        setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw);
+       INIT_WORK(&hw->restart_work, sky2_restart);
+
        sky2_idle_start(hw);
 
        pci_set_drvdata(pdev, hw);
@@ -3636,6 +3673,8 @@ static void __devexit sky2_remove(struct pci_dev *pdev)
 
        del_timer_sync(&hw->idle_timer);
 
+       flush_scheduled_work();
+
        sky2_write32(hw, B0_IMSK, 0);
        synchronize_irq(hw->pdev->irq);
 
index 3b0189569d525dce17eeac1d2cfdc826113713fc..ac24bdc429761da6f584259b5ef4f4f6337c571f 100644 (file)
@@ -1589,7 +1589,7 @@ enum {
 
        GMR_FS_ANY_ERR  = GMR_FS_RX_FF_OV | GMR_FS_CRC_ERR |
                          GMR_FS_FRAGMENT | GMR_FS_LONG_ERR |
-                         GMR_FS_MII_ERR | GMR_FS_GOOD_FC | GMR_FS_BAD_FC |
+                         GMR_FS_MII_ERR | GMR_FS_BAD_FC |
                          GMR_FS_UN_SIZE | GMR_FS_JABBER,
 };
 
@@ -1933,6 +1933,7 @@ struct sky2_hw {
        dma_addr_t           st_dma;
 
        struct timer_list    idle_timer;
+       struct work_struct   restart_work;
        int                  msi;
        wait_queue_head_t    msi_wait;
 };
index 61708cf4c85df29fe27829d27483f69cd24ccfe5..8897f538a7c788f6c2b7a7a65f7f7414e12ab6be 100644 (file)
@@ -26,7 +26,7 @@ config WAN
 # There is no way to detect a comtrol sv11 - force it modular for now.
 config HOSTESS_SV11
        tristate "Comtrol Hostess SV-11 support"
-       depends on WAN && ISA && m && ISA_DMA_API
+       depends on WAN && ISA && m && ISA_DMA_API && INET
        help
          Driver for Comtrol Hostess SV-11 network card which
          operates on low speed synchronous serial links at up to
index bc156b51678ac18bf3225d3b817ac773793f689d..aff05dba720ab023983212dba42172ca65b9d53f 100644 (file)
@@ -542,7 +542,7 @@ static int __init pc300_init_module(void)
 
        CLOCK_BASE = use_crystal_clock ? 24576000 : pci_clock_freq;
 
-       return pci_module_init(&pc300_pci_driver);
+       return pci_register_driver(&pc300_pci_driver);
 }
 
 
index 3a064def162e70d7e37547b1e3c97a9b6bc74b33..0e790efae683cfdbe2e17e204ad7667af56871ed 100644 (file)
@@ -771,6 +771,7 @@ struct bcm43xx_private {
         * This is currently always BCM43xx_BUSTYPE_PCI
         */
        u8 bustype;
+       u64 dma_mask;
 
        u16 board_vendor;
        u16 board_type;
index 978ed099e2852e45fa20c08a3bebf2011b927a0e..6e0dc76400e5e309a331d62e7620ed63afac49dd 100644 (file)
@@ -145,16 +145,14 @@ dma_addr_t map_descbuffer(struct bcm43xx_dmaring *ring,
                          int tx)
 {
        dma_addr_t dmaaddr;
+       int direction = PCI_DMA_FROMDEVICE;
 
-       if (tx) {
-               dmaaddr = dma_map_single(&ring->bcm->pci_dev->dev,
-                                        buf, len,
-                                        DMA_TO_DEVICE);
-       } else {
-               dmaaddr = dma_map_single(&ring->bcm->pci_dev->dev,
+       if (tx)
+               direction = PCI_DMA_TODEVICE;
+
+       dmaaddr = pci_map_single(ring->bcm->pci_dev,
                                         buf, len,
-                                        DMA_FROM_DEVICE);
-       }
+                                        direction);
 
        return dmaaddr;
 }
@@ -166,13 +164,13 @@ void unmap_descbuffer(struct bcm43xx_dmaring *ring,
                      int tx)
 {
        if (tx) {
-               dma_unmap_single(&ring->bcm->pci_dev->dev,
+               pci_unmap_single(ring->bcm->pci_dev,
                                 addr, len,
-                                DMA_TO_DEVICE);
+                                PCI_DMA_TODEVICE);
        } else {
-               dma_unmap_single(&ring->bcm->pci_dev->dev,
+               pci_unmap_single(ring->bcm->pci_dev,
                                 addr, len,
-                                DMA_FROM_DEVICE);
+                                PCI_DMA_FROMDEVICE);
        }
 }
 
@@ -183,8 +181,8 @@ void sync_descbuffer_for_cpu(struct bcm43xx_dmaring *ring,
 {
        assert(!ring->tx);
 
-       dma_sync_single_for_cpu(&ring->bcm->pci_dev->dev,
-                               addr, len, DMA_FROM_DEVICE);
+       pci_dma_sync_single_for_cpu(ring->bcm->pci_dev,
+                                   addr, len, PCI_DMA_FROMDEVICE);
 }
 
 static inline
@@ -194,8 +192,8 @@ void sync_descbuffer_for_device(struct bcm43xx_dmaring *ring,
 {
        assert(!ring->tx);
 
-       dma_sync_single_for_device(&ring->bcm->pci_dev->dev,
-                                  addr, len, DMA_FROM_DEVICE);
+       pci_dma_sync_single_for_cpu(ring->bcm->pci_dev,
+                                   addr, len, PCI_DMA_TODEVICE);
 }
 
 /* Unmap and free a descriptor buffer. */
@@ -214,17 +212,53 @@ void free_descriptor_buffer(struct bcm43xx_dmaring *ring,
 
 static int alloc_ringmemory(struct bcm43xx_dmaring *ring)
 {
-       struct device *dev = &(ring->bcm->pci_dev->dev);
-
-       ring->descbase = dma_alloc_coherent(dev, BCM43xx_DMA_RINGMEMSIZE,
-                                           &(ring->dmabase), GFP_KERNEL);
+       ring->descbase = pci_alloc_consistent(ring->bcm->pci_dev, BCM43xx_DMA_RINGMEMSIZE,
+                                           &(ring->dmabase));
        if (!ring->descbase) {
-               printk(KERN_ERR PFX "DMA ringmemory allocation failed\n");
-               return -ENOMEM;
+               /* Allocation may have failed due to pci_alloc_consistent
+                  insisting on use of GFP_DMA, which is more restrictive
+                  than necessary...  */
+               struct dma_desc *rx_ring;
+               dma_addr_t rx_ring_dma;
+
+               rx_ring = kzalloc(BCM43xx_DMA_RINGMEMSIZE, GFP_KERNEL);
+               if (!rx_ring)
+                       goto out_err;
+
+               rx_ring_dma = pci_map_single(ring->bcm->pci_dev, rx_ring,
+                                            BCM43xx_DMA_RINGMEMSIZE,
+                                            PCI_DMA_BIDIRECTIONAL);
+
+               if (pci_dma_mapping_error(rx_ring_dma) ||
+                   rx_ring_dma + BCM43xx_DMA_RINGMEMSIZE > ring->bcm->dma_mask) {
+                       /* Sigh... */
+                       if (!pci_dma_mapping_error(rx_ring_dma))
+                               pci_unmap_single(ring->bcm->pci_dev,
+                                                rx_ring_dma, BCM43xx_DMA_RINGMEMSIZE,
+                                                PCI_DMA_BIDIRECTIONAL);
+                       rx_ring_dma = pci_map_single(ring->bcm->pci_dev,
+                                                rx_ring, BCM43xx_DMA_RINGMEMSIZE,
+                                                PCI_DMA_BIDIRECTIONAL);
+                       if (pci_dma_mapping_error(rx_ring_dma) ||
+                           rx_ring_dma + BCM43xx_DMA_RINGMEMSIZE > ring->bcm->dma_mask) {
+                               assert(0);
+                               if (!pci_dma_mapping_error(rx_ring_dma))
+                                       pci_unmap_single(ring->bcm->pci_dev,
+                                                        rx_ring_dma, BCM43xx_DMA_RINGMEMSIZE,
+                                                        PCI_DMA_BIDIRECTIONAL);
+                               goto out_err;
+                       }
+                }
+
+                ring->descbase = rx_ring;
+                ring->dmabase = rx_ring_dma;
        }
        memset(ring->descbase, 0, BCM43xx_DMA_RINGMEMSIZE);
 
        return 0;
+out_err:
+       printk(KERN_ERR PFX "DMA ringmemory allocation failed\n");
+       return -ENOMEM;
 }
 
 static void free_ringmemory(struct bcm43xx_dmaring *ring)
@@ -407,6 +441,29 @@ static int setup_rx_descbuffer(struct bcm43xx_dmaring *ring,
        if (unlikely(!skb))
                return -ENOMEM;
        dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0);
+       /* This hardware bug work-around adapted from the b44 driver.
+          The chip may be unable to do PCI DMA to/from anything above 1GB */
+       if (pci_dma_mapping_error(dmaaddr) ||
+           dmaaddr + ring->rx_buffersize > ring->bcm->dma_mask) {
+               /* This one has 30-bit addressing... */
+               if (!pci_dma_mapping_error(dmaaddr))
+                       pci_unmap_single(ring->bcm->pci_dev,
+                                        dmaaddr, ring->rx_buffersize,
+                                        PCI_DMA_FROMDEVICE);
+               dev_kfree_skb_any(skb);
+               skb = __dev_alloc_skb(ring->rx_buffersize,GFP_DMA);
+               if (skb == NULL)
+                       return -ENOMEM;
+               dmaaddr = pci_map_single(ring->bcm->pci_dev,
+                                        skb->data, ring->rx_buffersize,
+                                        PCI_DMA_FROMDEVICE);
+               if (pci_dma_mapping_error(dmaaddr) ||
+                   dmaaddr + ring->rx_buffersize > ring->bcm->dma_mask) {
+                       assert(0);
+                       dev_kfree_skb_any(skb);
+                       return -ENOMEM;
+               }
+       }
        meta->skb = skb;
        meta->dmaaddr = dmaaddr;
        skb->dev = ring->bcm->net_dev;
@@ -636,8 +693,10 @@ struct bcm43xx_dmaring * bcm43xx_setup_dmaring(struct bcm43xx_private *bcm,
        err = dmacontroller_setup(ring);
        if (err)
                goto err_free_ringmemory;
+       return ring;
 
 out:
+       printk(KERN_ERR PFX "Error in bcm43xx_setup_dmaring\n");
        return ring;
 
 err_free_ringmemory:
@@ -705,30 +764,16 @@ int bcm43xx_dma_init(struct bcm43xx_private *bcm)
        struct bcm43xx_dmaring *ring;
        int err = -ENOMEM;
        int dma64 = 0;
-       u64 mask = bcm43xx_get_supported_dma_mask(bcm);
-       int nobits;
 
-       if (mask == DMA_64BIT_MASK) {
+       bcm->dma_mask = bcm43xx_get_supported_dma_mask(bcm);
+       if (bcm->dma_mask == DMA_64BIT_MASK)
                dma64 = 1;
-               nobits = 64;
-       } else if (mask == DMA_32BIT_MASK)
-               nobits = 32;
-       else
-               nobits = 30;
-       err = pci_set_dma_mask(bcm->pci_dev, mask);
-       err |= pci_set_consistent_dma_mask(bcm->pci_dev, mask);
-       if (err) {
-#ifdef CONFIG_BCM43XX_PIO
-               printk(KERN_WARNING PFX "DMA not supported on this device."
-                                       " Falling back to PIO.\n");
-               bcm->__using_pio = 1;
-               return -ENOSYS;
-#else
-               printk(KERN_ERR PFX "FATAL: DMA not supported and PIO not configured. "
-                                   "Please recompile the driver with PIO support.\n");
-               return -ENODEV;
-#endif /* CONFIG_BCM43XX_PIO */
-       }
+       err = pci_set_dma_mask(bcm->pci_dev, bcm->dma_mask);
+       if (err)
+               goto no_dma;
+       err = pci_set_consistent_dma_mask(bcm->pci_dev, bcm->dma_mask);
+       if (err)
+               goto no_dma;
 
        /* setup TX DMA channels. */
        ring = bcm43xx_setup_dmaring(bcm, 0, 1, dma64);
@@ -774,7 +819,9 @@ int bcm43xx_dma_init(struct bcm43xx_private *bcm)
                dma->rx_ring3 = ring;
        }
 
-       dprintk(KERN_INFO PFX "%d-bit DMA initialized\n", nobits);
+       dprintk(KERN_INFO PFX "%d-bit DMA initialized\n",
+               (bcm->dma_mask == DMA_64BIT_MASK) ? 64 :
+               (bcm->dma_mask == DMA_32BIT_MASK) ? 32 : 30);
        err = 0;
 out:
        return err;
@@ -800,7 +847,17 @@ err_destroy_tx1:
 err_destroy_tx0:
        bcm43xx_destroy_dmaring(dma->tx_ring0);
        dma->tx_ring0 = NULL;
-       goto out;
+no_dma:
+#ifdef CONFIG_BCM43XX_PIO
+       printk(KERN_WARNING PFX "DMA not supported on this device."
+                               " Falling back to PIO.\n");
+       bcm->__using_pio = 1;
+       return -ENOSYS;
+#else
+       printk(KERN_ERR PFX "FATAL: DMA not supported and PIO not configured. "
+                           "Please recompile the driver with PIO support.\n");
+       return -ENODEV;
+#endif /* CONFIG_BCM43XX_PIO */
 }
 
 /* Generate a cookie for the TX header. */
@@ -905,6 +962,7 @@ static void dma_tx_fragment(struct bcm43xx_dmaring *ring,
        struct bcm43xx_dmadesc_generic *desc;
        struct bcm43xx_dmadesc_meta *meta;
        dma_addr_t dmaaddr;
+       struct sk_buff *bounce_skb;
 
        assert(skb_shinfo(skb)->nr_frags == 0);
 
@@ -924,9 +982,28 @@ static void dma_tx_fragment(struct bcm43xx_dmaring *ring,
                               skb->len - sizeof(struct bcm43xx_txhdr),
                               (cur_frag == 0),
                               generate_cookie(ring, slot));
+       dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
+       if (dma_mapping_error(dmaaddr) || dmaaddr + skb->len > ring->bcm->dma_mask) {
+               /* chip cannot handle DMA to/from > 1GB, use bounce buffer (copied from b44 driver) */
+               if (!dma_mapping_error(dmaaddr))
+                       unmap_descbuffer(ring, dmaaddr, skb->len, 1);
+               bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC|GFP_DMA);
+               if (!bounce_skb)
+                       return;
+               dmaaddr = map_descbuffer(ring, bounce_skb->data, bounce_skb->len, 1);
+               if (dma_mapping_error(dmaaddr) || dmaaddr + skb->len > ring->bcm->dma_mask) {
+                       if (!dma_mapping_error(dmaaddr))
+                               unmap_descbuffer(ring, dmaaddr, skb->len, 1);
+                       dev_kfree_skb_any(bounce_skb);
+                       assert(0);
+                       return;
+               }
+               memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len);
+               dev_kfree_skb_any(skb);
+               skb = bounce_skb;
+       }
 
        meta->skb = skb;
-       dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
        meta->dmaaddr = dmaaddr;
 
        fill_descriptor(ring, desc, dmaaddr,
index 23aaf1ed8541d925bf1d453a43536b7766fc843d..2e400aacc436e2a72d10ab2f18a7875a15e0bfa5 100644 (file)
@@ -95,13 +95,9 @@ static int modparam_noleds;
 module_param_named(noleds, modparam_noleds, int, 0444);
 MODULE_PARM_DESC(noleds, "Turn off all LED activity");
 
-#ifdef CONFIG_BCM43XX_DEBUG
 static char modparam_fwpostfix[64];
 module_param_string(fwpostfix, modparam_fwpostfix, 64, 0444);
-MODULE_PARM_DESC(fwpostfix, "Postfix for .fw files. Useful for debugging.");
-#else
-# define modparam_fwpostfix  ""
-#endif /* CONFIG_BCM43XX_DEBUG*/
+MODULE_PARM_DESC(fwpostfix, "Postfix for .fw files. Useful for using multiple firmware image versions.");
 
 
 /* If you want to debug with just a single device, enable this,
@@ -2983,8 +2979,10 @@ static int bcm43xx_chipset_attach(struct bcm43xx_private *bcm)
        err = bcm43xx_pctl_set_crystal(bcm, 1);
        if (err)
                goto out;
-       bcm43xx_pci_read_config16(bcm, PCI_STATUS, &pci_status);
-       bcm43xx_pci_write_config16(bcm, PCI_STATUS, pci_status & ~PCI_STATUS_SIG_TARGET_ABORT);
+       err = bcm43xx_pci_read_config16(bcm, PCI_STATUS, &pci_status);
+       if (err)
+               goto out;
+       err = bcm43xx_pci_write_config16(bcm, PCI_STATUS, pci_status & ~PCI_STATUS_SIG_TARGET_ABORT);
 
 out:
        return err;
@@ -3796,12 +3794,18 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm)
        }
        net_dev->base_addr = (unsigned long)bcm->mmio_addr;
 
-       bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID,
+       err = bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID,
                                  &bcm->board_vendor);
-       bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_ID,
+       if (err)
+               goto err_iounmap;
+       err = bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_ID,
                                  &bcm->board_type);
-       bcm43xx_pci_read_config16(bcm, PCI_REVISION_ID,
+       if (err)
+               goto err_iounmap;
+       err = bcm43xx_pci_read_config16(bcm, PCI_REVISION_ID,
                                  &bcm->board_revision);
+       if (err)
+               goto err_iounmap;
 
        err = bcm43xx_chipset_attach(bcm);
        if (err)
@@ -3892,6 +3896,7 @@ err_pci_release:
        pci_release_regions(pci_dev);
 err_pci_disable:
        pci_disable_device(pci_dev);
+       printk(KERN_ERR PFX "Unable to attach board\n");
        goto out;
 }
 
index d2ca949174fe925c1b5a75a698e0ef27a8537bd5..7b665e2386a8caaa888b355e80e58510d7e3a201 100644 (file)
@@ -260,22 +260,22 @@ static int bcm43xx_wx_get_rangeparams(struct net_device *net_dev,
        if (phy->type == BCM43xx_PHYTYPE_A ||
            phy->type == BCM43xx_PHYTYPE_G) {
                range->num_bitrates = 8;
-               range->bitrate[i++] = IEEE80211_OFDM_RATE_6MB;
-               range->bitrate[i++] = IEEE80211_OFDM_RATE_9MB;
-               range->bitrate[i++] = IEEE80211_OFDM_RATE_12MB;
-               range->bitrate[i++] = IEEE80211_OFDM_RATE_18MB;
-               range->bitrate[i++] = IEEE80211_OFDM_RATE_24MB;
-               range->bitrate[i++] = IEEE80211_OFDM_RATE_36MB;
-               range->bitrate[i++] = IEEE80211_OFDM_RATE_48MB;
-               range->bitrate[i++] = IEEE80211_OFDM_RATE_54MB;
+               range->bitrate[i++] = IEEE80211_OFDM_RATE_6MB * 500000;
+               range->bitrate[i++] = IEEE80211_OFDM_RATE_9MB * 500000;
+               range->bitrate[i++] = IEEE80211_OFDM_RATE_12MB * 500000;
+               range->bitrate[i++] = IEEE80211_OFDM_RATE_18MB * 500000;
+               range->bitrate[i++] = IEEE80211_OFDM_RATE_24MB * 500000;
+               range->bitrate[i++] = IEEE80211_OFDM_RATE_36MB * 500000;
+               range->bitrate[i++] = IEEE80211_OFDM_RATE_48MB * 500000;
+               range->bitrate[i++] = IEEE80211_OFDM_RATE_54MB * 500000;
        }
        if (phy->type == BCM43xx_PHYTYPE_B ||
            phy->type == BCM43xx_PHYTYPE_G) {
                range->num_bitrates += 4;
-               range->bitrate[i++] = IEEE80211_CCK_RATE_1MB;
-               range->bitrate[i++] = IEEE80211_CCK_RATE_2MB;
-               range->bitrate[i++] = IEEE80211_CCK_RATE_5MB;
-               range->bitrate[i++] = IEEE80211_CCK_RATE_11MB;
+               range->bitrate[i++] = IEEE80211_CCK_RATE_1MB * 500000;
+               range->bitrate[i++] = IEEE80211_CCK_RATE_2MB * 500000;
+               range->bitrate[i++] = IEEE80211_CCK_RATE_5MB * 500000;
+               range->bitrate[i++] = IEEE80211_CCK_RATE_11MB * 500000;
        }
 
        geo = ieee80211_get_geo(bcm->ieee);
@@ -285,7 +285,7 @@ static int bcm43xx_wx_get_rangeparams(struct net_device *net_dev,
                if (j == IW_MAX_FREQUENCIES)
                        break;
                range->freq[j].i = j + 1;
-               range->freq[j].m = geo->a[i].freq;//FIXME?
+               range->freq[j].m = geo->a[i].freq * 100000;
                range->freq[j].e = 1;
                j++;
        }
@@ -293,7 +293,7 @@ static int bcm43xx_wx_get_rangeparams(struct net_device *net_dev,
                if (j == IW_MAX_FREQUENCIES)
                        break;
                range->freq[j].i = j + 1;
-               range->freq[j].m = geo->bg[i].freq;//FIXME?
+               range->freq[j].m = geo->bg[i].freq * 100000;
                range->freq[j].e = 1;
                j++;
        }
index b85857a848706fcde3c25d251fac7d280aea9201..d0639a45cd2c4fbc083695b2ed4a6bf657e4f9f4 100644 (file)
@@ -175,7 +175,7 @@ that only one external action is invoked at a time.
 
 /* Debugging stuff */
 #ifdef CONFIG_IPW2100_DEBUG
-#define CONFIG_IPW2100_RX_DEBUG        /* Reception debugging */
+#define IPW2100_RX_DEBUG       /* Reception debugging */
 #endif
 
 MODULE_DESCRIPTION(DRV_DESCRIPTION);
@@ -2239,7 +2239,7 @@ static void ipw2100_snapshot_free(struct ipw2100_priv *priv)
        priv->snapshot[0] = NULL;
 }
 
-#ifdef CONFIG_IPW2100_DEBUG_C3
+#ifdef IPW2100_DEBUG_C3
 static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv)
 {
        int i;
@@ -2314,13 +2314,13 @@ static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf,
  * The size of the constructed ethernet
  *
  */
-#ifdef CONFIG_IPW2100_RX_DEBUG
+#ifdef IPW2100_RX_DEBUG
 static u8 packet_data[IPW_RX_NIC_BUFFER_LENGTH];
 #endif
 
 static void ipw2100_corruption_detected(struct ipw2100_priv *priv, int i)
 {
-#ifdef CONFIG_IPW2100_DEBUG_C3
+#ifdef IPW2100_DEBUG_C3
        struct ipw2100_status *status = &priv->status_queue.drv[i];
        u32 match, reg;
        int j;
@@ -2342,7 +2342,7 @@ static void ipw2100_corruption_detected(struct ipw2100_priv *priv, int i)
        }
 #endif
 
-#ifdef CONFIG_IPW2100_DEBUG_C3
+#ifdef IPW2100_DEBUG_C3
        /* Halt the fimrware so we can get a good image */
        write_register(priv->net_dev, IPW_REG_RESET_REG,
                       IPW_AUX_HOST_RESET_REG_STOP_MASTER);
@@ -2413,7 +2413,7 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
 
        skb_put(packet->skb, status->frame_size);
 
-#ifdef CONFIG_IPW2100_RX_DEBUG
+#ifdef IPW2100_RX_DEBUG
        /* Make a copy of the frame so we can dump it to the logs if
         * ieee80211_rx fails */
        memcpy(packet_data, packet->skb->data,
@@ -2421,7 +2421,7 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
 #endif
 
        if (!ieee80211_rx(priv->ieee, packet->skb, stats)) {
-#ifdef CONFIG_IPW2100_RX_DEBUG
+#ifdef IPW2100_RX_DEBUG
                IPW_DEBUG_DROP("%s: Non consumed packet:\n",
                               priv->net_dev->name);
                printk_buf(IPW_DL_DROP, packet_data, status->frame_size);
@@ -4912,7 +4912,7 @@ static int ipw2100_set_power_mode(struct ipw2100_priv *priv, int power_level)
        else
                priv->power_mode = IPW_POWER_ENABLED | power_level;
 
-#ifdef CONFIG_IPW2100_TX_POWER
+#ifdef IPW2100_TX_POWER
        if (priv->port_type == IBSS && priv->adhoc_power != DFTL_IBSS_TX_POWER) {
                /* Set beacon interval */
                cmd.host_command = TX_POWER_INDEX;
index a08524191b5d837d0f24c92e8a37374f5a2e5d24..4c5f78eac349a4f77d5d897a9936618c0dc562a3 100644 (file)
@@ -156,7 +156,7 @@ void zd_mac_clear(struct zd_mac *mac)
 static int reset_mode(struct zd_mac *mac)
 {
        struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
-       struct zd_ioreq32 ioreqs[3] = {
+       struct zd_ioreq32 ioreqs[] = {
                { CR_RX_FILTER, STA_RX_FILTER },
                { CR_SNIFFER_ON, 0U },
        };
@@ -164,10 +164,9 @@ static int reset_mode(struct zd_mac *mac)
        if (ieee->iw_mode == IW_MODE_MONITOR) {
                ioreqs[0].value = 0xffffffff;
                ioreqs[1].value = 0x1;
-               ioreqs[2].value = ENC_SNIFFER;
        }
 
-       return zd_iowrite32a(&mac->chip, ioreqs, 3);
+       return zd_iowrite32a(&mac->chip, ioreqs, ARRAY_SIZE(ioreqs));
 }
 
 int zd_mac_open(struct net_device *netdev)
@@ -904,16 +903,21 @@ static int fill_ctrlset(struct zd_mac *mac,
 static int zd_mac_tx(struct zd_mac *mac, struct ieee80211_txb *txb, int pri)
 {
        int i, r;
+       struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
 
        for (i = 0; i < txb->nr_frags; i++) {
                struct sk_buff *skb = txb->fragments[i];
 
                r = fill_ctrlset(mac, txb, i);
-               if (r)
+               if (r) {
+                       ieee->stats.tx_dropped++;
                        return r;
+               }
                r = zd_usb_tx(&mac->chip.usb, skb->data, skb->len);
-               if (r)
+               if (r) {
+                       ieee->stats.tx_dropped++;
                        return r;
+               }
        }
 
        /* FIXME: shouldn't this be handled by the upper layers? */
@@ -1063,9 +1067,23 @@ static int fill_rx_stats(struct ieee80211_rx_stats *stats,
 
        *pstatus = status = zd_tail(buffer, length, sizeof(struct rx_status));
        if (status->frame_status & ZD_RX_ERROR) {
-               /* FIXME: update? */
+               struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
+               ieee->stats.rx_errors++;
+               if (status->frame_status & ZD_RX_TIMEOUT_ERROR)
+                       ieee->stats.rx_missed_errors++;
+               else if (status->frame_status & ZD_RX_FIFO_OVERRUN_ERROR)
+                       ieee->stats.rx_fifo_errors++;
+               else if (status->frame_status & ZD_RX_DECRYPTION_ERROR)
+                       ieee->ieee_stats.rx_discards_undecryptable++;
+               else if (status->frame_status & ZD_RX_CRC32_ERROR) {
+                       ieee->stats.rx_crc_errors++;
+                       ieee->ieee_stats.rx_fcs_errors++;
+               }
+               else if (status->frame_status & ZD_RX_CRC16_ERROR)
+                       ieee->stats.rx_crc_errors++;
                return -EINVAL;
        }
+
        memset(stats, 0, sizeof(struct ieee80211_rx_stats));
        stats->len = length - (ZD_PLCP_HEADER_SIZE + IEEE80211_FCS_LEN +
                               + sizeof(struct rx_status));
@@ -1094,14 +1112,16 @@ static void zd_mac_rx(struct zd_mac *mac, struct sk_buff *skb)
        if (skb->len < ZD_PLCP_HEADER_SIZE + IEEE80211_1ADDR_LEN +
                       IEEE80211_FCS_LEN + sizeof(struct rx_status))
        {
-               dev_dbg_f(zd_mac_dev(mac), "Packet with length %u to small.\n",
-                        skb->len);
+               ieee->stats.rx_errors++;
+               ieee->stats.rx_length_errors++;
                goto free_skb;
        }
 
        r = fill_rx_stats(&stats, &status, mac, skb->data, skb->len);
        if (r) {
-               /* Only packets with rx errors are included here. */
+               /* Only packets with rx errors are included here.
+                * The error stats have already been set in fill_rx_stats.
+                */
                goto free_skb;
        }
 
@@ -1114,8 +1134,10 @@ static void zd_mac_rx(struct zd_mac *mac, struct sk_buff *skb)
 
        r = filter_rx(ieee, skb->data, skb->len, &stats);
        if (r <= 0) {
-               if (r < 0)
+               if (r < 0) {
+                       ieee->stats.rx_errors++;
                        dev_dbg_f(zd_mac_dev(mac), "Error in packet.\n");
+               }
                goto free_skb;
        }
 
@@ -1146,7 +1168,9 @@ int zd_mac_rx_irq(struct zd_mac *mac, const u8 *buffer, unsigned int length)
 
        skb = dev_alloc_skb(sizeof(struct zd_rt_hdr) + length);
        if (!skb) {
+               struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
                dev_warn(zd_mac_dev(mac), "Could not allocate skb.\n");
+               ieee->stats.rx_dropped++;
                return -ENOMEM;
        }
        skb_reserve(skb, sizeof(struct zd_rt_hdr));
index 75ef55624d7fd2cf15820e79127beff3e6e393dd..aac8a1c5ba08fb94e7919fc4e6b930e4b55ea595 100644 (file)
@@ -313,6 +313,12 @@ out:
 
 static inline void handle_retry_failed_int(struct urb *urb)
 {
+       struct zd_usb *usb = urb->context;
+       struct zd_mac *mac = zd_usb_to_mac(usb);
+       struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
+
+       ieee->stats.tx_errors++;
+       ieee->ieee_stats.tx_retry_limit_exceeded++;
        dev_dbg_f(urb_dev(urb), "retry failed interrupt\n");
 }
 
@@ -487,6 +493,9 @@ static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer,
 
        if (length < sizeof(struct rx_length_info)) {
                /* It's not a complete packet anyhow. */
+               struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
+               ieee->stats.rx_errors++;
+               ieee->stats.rx_length_errors++;
                return;
        }
        length_info = (struct rx_length_info *)
@@ -923,6 +932,8 @@ static int probe(struct usb_interface *intf, const struct usb_device_id *id)
                goto error;
        }
 
+       usb_reset_device(interface_to_usbdev(intf));
+
        netdev = zd_netdev_alloc(intf);
        if (netdev == NULL) {
                r = -ENOMEM;
@@ -1024,6 +1035,7 @@ static int __init usb_init(void)
 
        r = usb_register(&driver);
        if (r) {
+               destroy_workqueue(zd_workqueue);
                printk(KERN_ERR "%s usb_register() failed. Error number %d\n",
                       driver.name, r);
                return r;
index 4438ae1ede4fa5034ad8085c51819fec4252e7b9..a3c1755b2f28329313eaf6c088190470b918d7b0 100644 (file)
@@ -415,6 +415,7 @@ static struct kobj_type pci_driver_kobj_type = {
  * __pci_register_driver - register a new pci driver
  * @drv: the driver structure to register
  * @owner: owner module of drv
+ * @mod_name: module name string
  * 
  * Adds the driver structure to the list of registered drivers.
  * Returns a negative value on error, otherwise 0. 
index 7a94076752d047125d4b72b876afeb28c034a344..cd913a2a416f08e6cd705d030a36c718fbe9df39 100644 (file)
@@ -143,6 +143,14 @@ static ssize_t is_enabled_show(struct device *dev,
        return sprintf (buf, "%u\n", atomic_read(&pdev->enable_cnt));
 }
 
+#ifdef CONFIG_NUMA
+static ssize_t
+numa_node_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       return sprintf (buf, "%d\n", dev->numa_node);
+}
+#endif
+
 static ssize_t
 msi_bus_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
@@ -194,6 +202,9 @@ struct device_attribute pci_dev_attrs[] = {
        __ATTR_RO(irq),
        __ATTR_RO(local_cpus),
        __ATTR_RO(modalias),
+#ifdef CONFIG_NUMA
+       __ATTR_RO(numa_node),
+#endif
        __ATTR(enable, 0600, is_enabled_show, is_enabled_store),
        __ATTR(broken_parity_status,(S_IRUGO|S_IWUSR),
                broken_parity_status_show,broken_parity_status_store),
index 8b44cff2c1767f3bef0287eb394b68c9988b9d60..1e74e1ee8bd89a4f90c4579e50dc033eace44028 100644 (file)
 
 unsigned int pci_pm_d3_delay = 10;
 
+#define DEFAULT_CARDBUS_IO_SIZE                (256)
+#define DEFAULT_CARDBUS_MEM_SIZE       (64*1024*1024)
+/* pci=cbmemsize=nnM,cbiosize=nn can override this */
+unsigned long pci_cardbus_io_size = DEFAULT_CARDBUS_IO_SIZE;
+unsigned long pci_cardbus_mem_size = DEFAULT_CARDBUS_MEM_SIZE;
+
 /**
  * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
  * @bus: pointer to PCI bus structure to search
@@ -1300,7 +1306,7 @@ pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
 
 /**
  * pci_select_bars - Make BAR mask from the type of resource
- * @pdev: the PCI device for which BAR mask is made
+ * @dev: the PCI device for which BAR mask is made
  * @flags: resource type mask to be selected
  *
  * This helper routine makes bar mask from the type of resource.
@@ -1333,6 +1339,10 @@ static int __devinit pci_setup(char *str)
                if (*str && (str = pcibios_setup(str)) && *str) {
                        if (!strcmp(str, "nomsi")) {
                                pci_no_msi();
+                       } else if (!strncmp(str, "cbiosize=", 9)) {
+                               pci_cardbus_io_size = memparse(str + 9, &str);
+                       } else if (!strncmp(str, "cbmemsize=", 10)) {
+                               pci_cardbus_mem_size = memparse(str + 10, &str);
                        } else {
                                printk(KERN_ERR "PCI: Unknown option `%s'\n",
                                                str);
index 89f3036f0de8866d46081fca800e146c3376b32b..3554f3948814aee7f23ea9db72523dc0fde9eeb1 100644 (file)
 
 #define ROUND_UP(x, a)         (((x) + (a) - 1) & ~((a) - 1))
 
-/*
- * FIXME: IO should be max 256 bytes.  However, since we may
- * have a P2P bridge below a cardbus bridge, we need 4K.
- */
-#define CARDBUS_IO_SIZE                (256)
-#define CARDBUS_MEM_SIZE       (64*1024*1024)
-
 static void __devinit
 pbus_assign_resources_sorted(struct pci_bus *bus)
 {
@@ -415,12 +408,12 @@ pci_bus_size_cardbus(struct pci_bus *bus)
         * Reserve some resources for CardBus.  We reserve
         * a fixed amount of bus space for CardBus bridges.
         */
-       b_res[0].start = CARDBUS_IO_SIZE;
-       b_res[0].end = b_res[0].start + CARDBUS_IO_SIZE - 1;
+       b_res[0].start = pci_cardbus_io_size;
+       b_res[0].end = b_res[0].start + pci_cardbus_io_size - 1;
        b_res[0].flags |= IORESOURCE_IO;
 
-       b_res[1].start = CARDBUS_IO_SIZE;
-       b_res[1].end = b_res[1].start + CARDBUS_IO_SIZE - 1;
+       b_res[1].start = pci_cardbus_io_size;
+       b_res[1].end = b_res[1].start + pci_cardbus_io_size - 1;
        b_res[1].flags |= IORESOURCE_IO;
 
        /*
@@ -440,16 +433,16 @@ pci_bus_size_cardbus(struct pci_bus *bus)
         * twice the size.
         */
        if (ctrl & PCI_CB_BRIDGE_CTL_PREFETCH_MEM0) {
-               b_res[2].start = CARDBUS_MEM_SIZE;
-               b_res[2].end = b_res[2].start + CARDBUS_MEM_SIZE - 1;
+               b_res[2].start = pci_cardbus_mem_size;
+               b_res[2].end = b_res[2].start + pci_cardbus_mem_size - 1;
                b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH;
 
-               b_res[3].start = CARDBUS_MEM_SIZE;
-               b_res[3].end = b_res[3].start + CARDBUS_MEM_SIZE - 1;
+               b_res[3].start = pci_cardbus_mem_size;
+               b_res[3].end = b_res[3].start + pci_cardbus_mem_size - 1;
                b_res[3].flags |= IORESOURCE_MEM;
        } else {
-               b_res[3].start = CARDBUS_MEM_SIZE * 2;
-               b_res[3].end = b_res[3].start + CARDBUS_MEM_SIZE * 2 - 1;
+               b_res[3].start = pci_cardbus_mem_size * 2;
+               b_res[3].end = b_res[3].start + pci_cardbus_mem_size * 2 - 1;
                b_res[3].flags |= IORESOURCE_MEM;
        }
 }
index a251289c9958e846ebc50d45254ec2bea6b14cf5..568f1877315c5532d39052e4e615f1304a48cb93 100644 (file)
@@ -24,7 +24,7 @@ pdev_fixup_irq(struct pci_dev *dev,
               int (*map_irq)(struct pci_dev *, u8, u8))
 {
        u8 pin, slot;
-       int irq;
+       int irq = 0;
 
        /* If this device is not on the primary bus, we need to figure out
           which interrupt pin it will come in on.   We know which slot it
@@ -33,16 +33,18 @@ pdev_fixup_irq(struct pci_dev *dev,
           apply the swizzle function.  */
 
        pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
-       /* Cope with 0 and illegal. */
-       if (pin == 0 || pin > 4)
+       /* Cope with illegal. */
+       if (pin > 4)
                pin = 1;
 
-       /* Follow the chain of bridges, swizzling as we go.  */
-       slot = (*swizzle)(dev, &pin);
+       if (pin != 0) {
+               /* Follow the chain of bridges, swizzling as we go.  */
+               slot = (*swizzle)(dev, &pin);
 
-       irq = (*map_irq)(dev, slot, pin);
-       if (irq == -1)
-               irq = 0;
+               irq = (*map_irq)(dev, slot, pin);
+               if (irq == -1)
+                       irq = 0;
+       }
        dev->irq = irq;
 
        pr_debug("PCI: fixup irq: (%s) got %d\n",
index b3186283753423971255294795b76b329841f5c3..99baabc23599129179fc814a519ba35b089135be 100644 (file)
@@ -277,7 +277,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
                board->det_pin, board->irq_pin);
 
        cf->socket.owner = THIS_MODULE;
-       cf->socket.dev.dev = &pdev->dev;
+       cf->socket.dev.parent = &pdev->dev;
        cf->socket.ops = &at91_cf_ops;
        cf->socket.resource_ops = &pccard_static_ops;
        cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
index d2a3bea55de20058a42d6775980c0c09cc0d896f..aa7779d89752681a05e5d10d0aa76c19ff08a648 100644 (file)
@@ -478,7 +478,7 @@ dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, i
  *
  * Returns: the number of characters added to the buffer
  */
-static ssize_t show_status(struct device *dev, char *buf)
+static ssize_t show_status(struct device *dev, struct device_attribute *attr, char *buf)
 {
        struct soc_pcmcia_socket *skt =
                container_of(dev, struct soc_pcmcia_socket, socket.dev);
@@ -501,7 +501,7 @@ static ssize_t show_status(struct device *dev, char *buf)
 
        return p-buf;
 }
-static CLASS_DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
+static DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
 
 
 static struct pccard_operations soc_common_pcmcia_operations = {
@@ -660,7 +660,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
 
                skt->socket.ops = &soc_common_pcmcia_operations;
                skt->socket.owner = ops->owner;
-               skt->socket.dev.dev = dev;
+               skt->socket.dev.parent = dev;
 
                init_timer(&skt->poll_timer);
                skt->poll_timer.function = soc_common_pcmcia_poll_event;
@@ -747,7 +747,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
 
                add_timer(&skt->poll_timer);
 
-               device_create_file(&skt->socket.dev, &device_attr_status);
+               device_create_file(&skt->socket.dev, &dev_attr_status);
        }
 
        dev_set_drvdata(dev, sinfo);
index ad27e5e0101fd178bc9dbeeb84a94e855f0fc89e..b04767ce273e977d873cf19726afff22b6f87cb3 100644 (file)
@@ -2,17 +2,5 @@
 # Plug and Play ACPI configuration
 #
 config PNPACPI
-       bool "Plug and Play ACPI support"
-       depends on PNP && ACPI
-       default y
-       ---help---
-         Linux uses the PNPACPI to autodetect built-in
-         mainboard resources (e.g. parallel port resources).
-
-          Some features (e.g. real hotplug) are not currently
-          implemented.
-
-          If you would like the kernel to detect and allocate resources to
-          your mainboard devices (on some systems they are disabled by the
-          BIOS) say Y here.  Also the PNPACPI can help prevent resource
-          conflicts between mainboard devices and other bus devices.
+       bool
+       default (PNP && ACPI)
index 96958c03cf61f54fa8be4c54d4a8acfcb91d5541..e251d1c1171c18592e469105ee588346c02ae03e 100644 (file)
@@ -1,2 +1,3 @@
 obj-$(CONFIG_PS3_VUART) += vuart.o
 obj-$(CONFIG_PS3_PS3AV) += ps3av.o ps3av_cmd.o
+obj-$(CONFIG_PS3_SYS_MANAGER) += sys-manager.o
diff --git a/drivers/ps3/sys-manager.c b/drivers/ps3/sys-manager.c
new file mode 100644 (file)
index 0000000..0fc30be
--- /dev/null
@@ -0,0 +1,604 @@
+/*
+ *  PS3 System Manager.
+ *
+ *  Copyright (C) 2007 Sony Computer Entertainment Inc.
+ *  Copyright 2007 Sony Corp.
+ *
+ *  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.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/workqueue.h>
+#include <linux/reboot.h>
+#include <asm/ps3.h>
+#include "vuart.h"
+
+MODULE_AUTHOR("Sony Corporation");
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 System Manager");
+
+/**
+ * ps3_sys_manager - PS3 system manager driver.
+ *
+ * The system manager provides an asyncronous system event notification
+ * mechanism for reporting events like thermal alert and button presses to
+ * guests.  It also provides support to control system shutdown and startup.
+ *
+ * The actual system manager is implemented as an application running in the
+ * system policy module in lpar_1.  Guests communicate with the system manager
+ * through port 2 of the vuart using a simple packet message protocol.
+ * Messages are comprised of a fixed field header followed by a message
+ * specific payload.
+ */
+
+/**
+ * struct ps3_sys_manager_header - System manager message header.
+ * @version: Header version, currently 1.
+ * @size: Header size in bytes, curently 16.
+ * @payload_size: Message payload size in bytes.
+ * @service_id: Message type, one of enum ps3_sys_manager_service_id.
+ */
+
+struct ps3_sys_manager_header {
+       /* version 1 */
+       u8 version;
+       u8 size;
+       u16 reserved_1;
+       u32 payload_size;
+       u16 service_id;
+       u16 reserved_2[3];
+};
+
+/**
+ * @PS3_SM_RX_MSG_LEN - System manager received message length.
+ *
+ * Currently all messages received from the system manager are the same length
+ * (16 bytes header + 16 bytes payload = 32 bytes).  This knowlege is used to
+ * simplify the logic.
+ */
+
+enum {
+       PS3_SM_RX_MSG_LEN = 32,
+};
+
+/**
+ * enum ps3_sys_manager_service_id - Message header service_id.
+ * @PS3_SM_SERVICE_ID_REQUEST:      guest --> sys_manager.
+ * @PS3_SM_SERVICE_ID_COMMAND:      guest <-- sys_manager.
+ * @PS3_SM_SERVICE_ID_RESPONSE:     guest --> sys_manager.
+ * @PS3_SM_SERVICE_ID_SET_ATTR:     guest --> sys_manager.
+ * @PS3_SM_SERVICE_ID_EXTERN_EVENT: guest <-- sys_manager.
+ * @PS3_SM_SERVICE_ID_SET_NEXT_OP:  guest --> sys_manager.
+ */
+
+enum ps3_sys_manager_service_id {
+       /* version 1 */
+       PS3_SM_SERVICE_ID_REQUEST = 1,
+       PS3_SM_SERVICE_ID_RESPONSE = 2,
+       PS3_SM_SERVICE_ID_COMMAND = 3,
+       PS3_SM_SERVICE_ID_EXTERN_EVENT = 4,
+       PS3_SM_SERVICE_ID_SET_NEXT_OP = 5,
+       PS3_SM_SERVICE_ID_SET_ATTR = 8,
+};
+
+/**
+ * enum ps3_sys_manager_attr - Notification attribute (bit position mask).
+ * @PS3_SM_ATTR_POWER: Power button.
+ * @PS3_SM_ATTR_RESET: Reset button, not available on retail console.
+ * @PS3_SM_ATTR_THERMAL: Sytem thermal alert.
+ * @PS3_SM_ATTR_CONTROLLER: Remote controller event.
+ * @PS3_SM_ATTR_ALL: Logical OR of all.
+ *
+ * The guest tells the system manager which events it is interested in receiving
+ * notice of by sending the system manager a logical OR of notification
+ * attributes via the ps3_sys_manager_send_attr() routine.
+ */
+
+enum ps3_sys_manager_attr {
+       /* version 1 */
+       PS3_SM_ATTR_POWER = 1,
+       PS3_SM_ATTR_RESET = 2,
+       PS3_SM_ATTR_THERMAL = 4,
+       PS3_SM_ATTR_CONTROLLER = 8, /* bogus? */
+       PS3_SM_ATTR_ALL = 0x0f,
+};
+
+/**
+ * enum ps3_sys_manager_event - External event type, reported by system manager.
+ * @PS3_SM_EVENT_POWER_PRESSED: payload.value not used.
+ * @PS3_SM_EVENT_POWER_RELEASED: payload.value = time pressed in millisec.
+ * @PS3_SM_EVENT_RESET_PRESSED: payload.value not used.
+ * @PS3_SM_EVENT_RESET_RELEASED: payload.value = time pressed in millisec.
+ * @PS3_SM_EVENT_THERMAL_ALERT: payload.value = thermal zone id.
+ * @PS3_SM_EVENT_THERMAL_CLEARED: payload.value = thermal zone id.
+ */
+
+enum ps3_sys_manager_event {
+       /* version 1 */
+       PS3_SM_EVENT_POWER_PRESSED = 3,
+       PS3_SM_EVENT_POWER_RELEASED = 4,
+       PS3_SM_EVENT_RESET_PRESSED = 5,
+       PS3_SM_EVENT_RESET_RELEASED = 6,
+       PS3_SM_EVENT_THERMAL_ALERT = 7,
+       PS3_SM_EVENT_THERMAL_CLEARED = 8,
+       /* no info on controller events */
+};
+
+/**
+ * enum ps3_sys_manager_next_op - Operation to perform after lpar is destroyed.
+ */
+
+enum ps3_sys_manager_next_op {
+       /* version 3 */
+       PS3_SM_NEXT_OP_SYS_SHUTDOWN = 1,
+       PS3_SM_NEXT_OP_SYS_REBOOT = 2,
+       PS3_SM_NEXT_OP_LPAR_REBOOT = 0x82,
+};
+
+/**
+ * enum ps3_sys_manager_wake_source - Next-op wakeup source (bit position mask).
+ * @PS3_SM_WAKE_DEFAULT: Disk insert, power button, eject button, IR
+ * controller, and bluetooth controller.
+ * @PS3_SM_WAKE_RTC:
+ * @PS3_SM_WAKE_RTC_ERROR:
+ * @PS3_SM_WAKE_P_O_R: Power on reset.
+ *
+ * Additional wakeup sources when specifying PS3_SM_NEXT_OP_SYS_SHUTDOWN.
+ * System will always wake from the PS3_SM_WAKE_DEFAULT sources.
+ */
+
+enum ps3_sys_manager_wake_source {
+       /* version 3 */
+       PS3_SM_WAKE_DEFAULT   = 0,
+       PS3_SM_WAKE_RTC       = 0x00000040,
+       PS3_SM_WAKE_RTC_ERROR = 0x00000080,
+       PS3_SM_WAKE_P_O_R     = 0x10000000,
+};
+
+/**
+ * enum ps3_sys_manager_cmd - Command from system manager to guest.
+ *
+ * The guest completes the actions needed, then acks or naks the command via
+ * ps3_sys_manager_send_response().  In the case of @PS3_SM_CMD_SHUTDOWN,
+ * the guest must be fully prepared for a system poweroff prior to acking the
+ * command.
+ */
+
+enum ps3_sys_manager_cmd {
+       /* version 1 */
+       PS3_SM_CMD_SHUTDOWN = 1, /* shutdown guest OS */
+};
+
+/**
+ * ps3_sys_manager_write - Helper to write a two part message to the vuart.
+ *
+ */
+
+static int ps3_sys_manager_write(struct ps3_vuart_port_device *dev,
+       const struct ps3_sys_manager_header *header, const void *payload)
+{
+       int result;
+
+       BUG_ON(header->version != 1);
+       BUG_ON(header->size != 16);
+       BUG_ON(header->payload_size != 8 && header->payload_size != 16);
+       BUG_ON(header->service_id > 8);
+
+       result = ps3_vuart_write(dev, header,
+               sizeof(struct ps3_sys_manager_header));
+
+       if (!result)
+               result = ps3_vuart_write(dev, payload, header->payload_size);
+
+       return result;
+}
+
+/**
+ * ps3_sys_manager_send_attr - Send a 'set attribute' to the system manager.
+ *
+ */
+
+static int ps3_sys_manager_send_attr(struct ps3_vuart_port_device *dev,
+       enum ps3_sys_manager_attr attr)
+{
+       static const struct ps3_sys_manager_header header = {
+               .version = 1,
+               .size = 16,
+               .payload_size = 16,
+               .service_id = PS3_SM_SERVICE_ID_SET_ATTR,
+       };
+       struct {
+               u8 version;
+               u8 reserved_1[3];
+               u32 attribute;
+       } payload;
+
+       BUILD_BUG_ON(sizeof(payload) != 8);
+
+       dev_dbg(&dev->core, "%s:%d: %xh\n", __func__, __LINE__, attr);
+
+       memset(&payload, 0, sizeof(payload));
+       payload.version = 1;
+       payload.attribute = attr;
+
+       return ps3_sys_manager_write(dev, &header, &payload);
+}
+
+/**
+ * ps3_sys_manager_send_next_op - Send a 'set next op' to the system manager.
+ *
+ * Tell the system manager what to do after this lpar is destroyed.
+ */
+
+static int ps3_sys_manager_send_next_op(struct ps3_vuart_port_device *dev,
+       enum ps3_sys_manager_next_op op,
+       enum ps3_sys_manager_wake_source wake_source)
+{
+       static const struct ps3_sys_manager_header header = {
+               .version = 1,
+               .size = 16,
+               .payload_size = 16,
+               .service_id = PS3_SM_SERVICE_ID_SET_NEXT_OP,
+       };
+       struct {
+               u8 version;
+               u8 type;
+               u8 gos_id;
+               u8 reserved_1;
+               u32 wake_source;
+               u8 reserved_2[8];
+       } payload;
+
+       BUILD_BUG_ON(sizeof(payload) != 16);
+
+       dev_dbg(&dev->core, "%s:%d: (%xh)\n", __func__, __LINE__, op);
+
+       memset(&payload, 0, sizeof(payload));
+       payload.version = 3;
+       payload.type = op;
+       payload.gos_id = 3; /* other os */
+       payload.wake_source = wake_source;
+
+       return ps3_sys_manager_write(dev, &header, &payload);
+}
+
+/**
+ * ps3_sys_manager_send_request_shutdown - Send 'request' to the system manager.
+ *
+ * The guest sends this message to request an operation or action of the system
+ * manager.  The reply is a command message from the system manager.  In the
+ * command handler the guest performs the requested operation.  The result of
+ * the command is then communicated back to the system manager with a response
+ * message.
+ *
+ * Currently, the only supported request it the 'shutdown self' request.
+ */
+
+static int ps3_sys_manager_send_request_shutdown(struct ps3_vuart_port_device *dev)
+{
+       static const struct ps3_sys_manager_header header = {
+               .version = 1,
+               .size = 16,
+               .payload_size = 16,
+               .service_id = PS3_SM_SERVICE_ID_REQUEST,
+       };
+       struct {
+               u8 version;
+               u8 type;
+               u8 gos_id;
+               u8 reserved_1[13];
+       } static const payload = {
+               .version = 1,
+               .type = 1, /* shutdown */
+               .gos_id = 0, /* self */
+       };
+
+       BUILD_BUG_ON(sizeof(payload) != 16);
+
+       dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+
+       return ps3_sys_manager_write(dev, &header, &payload);
+}
+
+/**
+ * ps3_sys_manager_send_response - Send a 'response' to the system manager.
+ * @status: zero = success, others fail.
+ *
+ * The guest sends this message to the system manager to acnowledge success or
+ * failure of a command sent by the system manager.
+ */
+
+static int ps3_sys_manager_send_response(struct ps3_vuart_port_device *dev,
+       u64 status)
+{
+       static const struct ps3_sys_manager_header header = {
+               .version = 1,
+               .size = 16,
+               .payload_size = 16,
+               .service_id = PS3_SM_SERVICE_ID_RESPONSE,
+       };
+       struct {
+               u8 version;
+               u8 reserved_1[3];
+               u8 status;
+               u8 reserved_2[11];
+       } payload;
+
+       BUILD_BUG_ON(sizeof(payload) != 16);
+
+       dev_dbg(&dev->core, "%s:%d: (%s)\n", __func__, __LINE__,
+               (status ? "nak" : "ack"));
+
+       memset(&payload, 0, sizeof(payload));
+       payload.version = 1;
+       payload.status = status;
+
+       return ps3_sys_manager_write(dev, &header, &payload);
+}
+
+/**
+ * ps3_sys_manager_handle_event - Second stage event msg handler.
+ *
+ */
+
+static int ps3_sys_manager_handle_event(struct ps3_vuart_port_device *dev)
+{
+       int result;
+       struct {
+               u8 version;
+               u8 type;
+               u8 reserved_1[2];
+               u32 value;
+               u8 reserved_2[8];
+       } event;
+
+       BUILD_BUG_ON(sizeof(event) != 16);
+
+       result = ps3_vuart_read(dev, &event, sizeof(event));
+       BUG_ON(result);
+
+       if (event.version != 1) {
+               dev_dbg(&dev->core, "%s:%d: unsupported event version (%u)\n",
+                       __func__, __LINE__, event.version);
+               return -EIO;
+       }
+
+       switch (event.type) {
+       case PS3_SM_EVENT_POWER_PRESSED:
+               dev_dbg(&dev->core, "%s:%d: POWER_PRESSED\n",
+                       __func__, __LINE__);
+               break;
+       case PS3_SM_EVENT_POWER_RELEASED:
+               dev_dbg(&dev->core, "%s:%d: POWER_RELEASED (%u ms)\n",
+                       __func__, __LINE__, event.value);
+               kill_cad_pid(SIGINT, 1);
+               break;
+       case PS3_SM_EVENT_THERMAL_ALERT:
+               dev_dbg(&dev->core, "%s:%d: THERMAL_ALERT (zone %u)\n",
+                       __func__, __LINE__, event.value);
+               printk(KERN_INFO "PS3 Thermal Alert Zone %u\n", event.value);
+               break;
+       case PS3_SM_EVENT_THERMAL_CLEARED:
+               dev_dbg(&dev->core, "%s:%d: THERMAL_CLEARED (zone %u)\n",
+                       __func__, __LINE__, event.value);
+               break;
+       default:
+               dev_dbg(&dev->core, "%s:%d: unknown event (%u)\n",
+                       __func__, __LINE__, event.type);
+               return -EIO;
+       }
+
+       return 0;
+}
+/**
+ * ps3_sys_manager_handle_cmd - Second stage command msg handler.
+ *
+ * The system manager sends this in reply to a 'request' message from the guest.
+ */
+
+static int ps3_sys_manager_handle_cmd(struct ps3_vuart_port_device *dev)
+{
+       int result;
+       struct {
+               u8 version;
+               u8 type;
+               u8 reserved_1[14];
+       } cmd;
+
+       BUILD_BUG_ON(sizeof(cmd) != 16);
+
+       dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+
+       result = ps3_vuart_read(dev, &cmd, sizeof(cmd));
+
+       if(result)
+               return result;
+
+       if (cmd.version != 1) {
+               dev_dbg(&dev->core, "%s:%d: unsupported cmd version (%u)\n",
+                       __func__, __LINE__, cmd.version);
+               return -EIO;
+       }
+
+       if (cmd.type != PS3_SM_CMD_SHUTDOWN) {
+               dev_dbg(&dev->core, "%s:%d: unknown cmd (%u)\n",
+                       __func__, __LINE__, cmd.type);
+               return -EIO;
+       }
+
+       ps3_sys_manager_send_response(dev, 0);
+       return 0;
+}
+
+/**
+ * ps3_sys_manager_handle_msg - First stage msg handler.
+ *
+ */
+
+static int ps3_sys_manager_handle_msg(struct ps3_vuart_port_device *dev)
+{
+       int result;
+       struct ps3_sys_manager_header header;
+
+       result = ps3_vuart_read(dev, &header,
+               sizeof(struct ps3_sys_manager_header));
+
+       if(result)
+               return result;
+
+       if (header.version != 1) {
+               dev_dbg(&dev->core, "%s:%d: unsupported header version (%u)\n",
+                       __func__, __LINE__, header.version);
+               goto fail_header;
+       }
+
+       BUILD_BUG_ON(sizeof(header) != 16);
+       BUG_ON(header.size != 16);
+       BUG_ON(header.payload_size != 16);
+
+       switch (header.service_id) {
+       case PS3_SM_SERVICE_ID_EXTERN_EVENT:
+               dev_dbg(&dev->core, "%s:%d: EVENT\n", __func__, __LINE__);
+               return ps3_sys_manager_handle_event(dev);
+       case PS3_SM_SERVICE_ID_COMMAND:
+               dev_dbg(&dev->core, "%s:%d: COMMAND\n", __func__, __LINE__);
+               return ps3_sys_manager_handle_cmd(dev);
+       default:
+               dev_dbg(&dev->core, "%s:%d: unknown service_id (%u)\n",
+                       __func__, __LINE__, header.service_id);
+               break;
+       }
+       goto fail_id;
+
+fail_header:
+       ps3_vuart_clear_rx_bytes(dev, 0);
+       return -EIO;
+fail_id:
+       ps3_vuart_clear_rx_bytes(dev, header.payload_size);
+       return -EIO;
+}
+
+/**
+ * ps3_sys_manager_work - Asyncronous read handler.
+ *
+ * Signaled when a complete message arrives at the vuart port.
+ */
+
+static void ps3_sys_manager_work(struct work_struct *work)
+{
+       struct ps3_vuart_port_device *dev = ps3_vuart_work_to_port_device(work);
+
+       ps3_sys_manager_handle_msg(dev);
+       ps3_vuart_read_async(dev, ps3_sys_manager_work, PS3_SM_RX_MSG_LEN);
+}
+
+struct {
+       struct ps3_vuart_port_device *dev;
+} static drv_priv;
+
+/**
+ * ps3_sys_manager_restart - The final platform machine_restart routine.
+ *
+ * This routine never returns.  The routine disables asyncronous vuart reads
+ * then spins calling ps3_sys_manager_handle_msg() to receive and acknowledge
+ * the shutdown command sent from the system manager.  Soon after the
+ * acknowledgement is sent the lpar is destroyed by the HV.  This routine
+ * should only be called from ps3_restart().
+ */
+
+void ps3_sys_manager_restart(void)
+{
+       struct ps3_vuart_port_device *dev = drv_priv.dev;
+
+       BUG_ON(!drv_priv.dev);
+
+       dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+
+       ps3_vuart_cancel_async(dev);
+
+       ps3_sys_manager_send_attr(dev, 0);
+       ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_LPAR_REBOOT,
+               PS3_SM_WAKE_DEFAULT);
+       ps3_sys_manager_send_request_shutdown(dev);
+
+       printk(KERN_EMERG "System Halted, OK to turn off power\n");
+
+       while(1)
+               ps3_sys_manager_handle_msg(dev);
+}
+
+/**
+ * ps3_sys_manager_power_off - The final platform machine_power_off routine.
+ *
+ * This routine never returns.  The routine disables asyncronous vuart reads
+ * then spins calling ps3_sys_manager_handle_msg() to receive and acknowledge
+ * the shutdown command sent from the system manager.  Soon after the
+ * acknowledgement is sent the lpar is destroyed by the HV.  This routine
+ * should only be called from ps3_power_off().
+ */
+
+void ps3_sys_manager_power_off(void)
+{
+       struct ps3_vuart_port_device *dev = drv_priv.dev;
+
+       BUG_ON(!drv_priv.dev);
+
+       dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+
+       ps3_vuart_cancel_async(dev);
+
+       ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_SHUTDOWN,
+               PS3_SM_WAKE_DEFAULT);
+       ps3_sys_manager_send_request_shutdown(dev);
+
+       printk(KERN_EMERG "System Halted, OK to turn off power\n");
+
+       while(1)
+               ps3_sys_manager_handle_msg(dev);
+}
+
+static int ps3_sys_manager_probe(struct ps3_vuart_port_device *dev)
+{
+       int result;
+
+       dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+
+       BUG_ON(drv_priv.dev);
+       drv_priv.dev = dev;
+
+       result = ps3_sys_manager_send_attr(dev, PS3_SM_ATTR_ALL);
+       BUG_ON(result);
+
+       result = ps3_vuart_read_async(dev, ps3_sys_manager_work,
+               PS3_SM_RX_MSG_LEN);
+       BUG_ON(result);
+
+       return result;
+}
+
+static struct ps3_vuart_port_driver ps3_sys_manager = {
+       .match_id = PS3_MATCH_ID_SYSTEM_MANAGER,
+       .core = {
+               .name = "ps3_sys_manager",
+       },
+       .probe = ps3_sys_manager_probe,
+};
+
+static int __init ps3_sys_manager_init(void)
+{
+       return ps3_vuart_port_driver_register(&ps3_sys_manager);
+}
+
+module_init(ps3_sys_manager_init);
index ef8fd4c308757d34efc524d276055aeaaa4c653b..746298107d6fa97d5611f05a0e33d58b717281ed 100644 (file)
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
+#include <linux/workqueue.h>
 #include <asm/ps3.h>
 
+#include <asm/firmware.h>
 #include <asm/lv1call.h>
 #include <asm/bitops.h>
 
@@ -30,7 +32,7 @@
 
 MODULE_AUTHOR("Sony Corporation");
 MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("ps3 vuart");
+MODULE_DESCRIPTION("PS3 vuart");
 
 /**
  * vuart - An inter-partition data link service.
@@ -157,7 +159,7 @@ int ps3_vuart_get_triggers(struct ps3_vuart_port_device *dev,
        unsigned long size;
        unsigned long val;
 
-       result = lv1_get_virtual_uart_param(dev->port_number,
+       result = lv1_get_virtual_uart_param(dev->priv->port_number,
                PARAM_TX_TRIGGER, &trig->tx);
 
        if (result) {
@@ -166,7 +168,7 @@ int ps3_vuart_get_triggers(struct ps3_vuart_port_device *dev,
                return result;
        }
 
-       result = lv1_get_virtual_uart_param(dev->port_number,
+       result = lv1_get_virtual_uart_param(dev->priv->port_number,
                PARAM_RX_BUF_SIZE, &size);
 
        if (result) {
@@ -175,7 +177,7 @@ int ps3_vuart_get_triggers(struct ps3_vuart_port_device *dev,
                return result;
        }
 
-       result = lv1_get_virtual_uart_param(dev->port_number,
+       result = lv1_get_virtual_uart_param(dev->priv->port_number,
                PARAM_RX_TRIGGER, &val);
 
        if (result) {
@@ -198,7 +200,7 @@ int ps3_vuart_set_triggers(struct ps3_vuart_port_device *dev, unsigned int tx,
        int result;
        unsigned long size;
 
-       result = lv1_set_virtual_uart_param(dev->port_number,
+       result = lv1_set_virtual_uart_param(dev->priv->port_number,
                PARAM_TX_TRIGGER, tx);
 
        if (result) {
@@ -207,7 +209,7 @@ int ps3_vuart_set_triggers(struct ps3_vuart_port_device *dev, unsigned int tx,
                return result;
        }
 
-       result = lv1_get_virtual_uart_param(dev->port_number,
+       result = lv1_get_virtual_uart_param(dev->priv->port_number,
                PARAM_RX_BUF_SIZE, &size);
 
        if (result) {
@@ -216,7 +218,7 @@ int ps3_vuart_set_triggers(struct ps3_vuart_port_device *dev, unsigned int tx,
                return result;
        }
 
-       result = lv1_set_virtual_uart_param(dev->port_number,
+       result = lv1_set_virtual_uart_param(dev->priv->port_number,
                PARAM_RX_TRIGGER, size - rx);
 
        if (result) {
@@ -232,9 +234,9 @@ int ps3_vuart_set_triggers(struct ps3_vuart_port_device *dev, unsigned int tx,
 }
 
 static int ps3_vuart_get_rx_bytes_waiting(struct ps3_vuart_port_device *dev,
-       unsigned long *bytes_waiting)
+       u64 *bytes_waiting)
 {
-       int result = lv1_get_virtual_uart_param(dev->port_number,
+       int result = lv1_get_virtual_uart_param(dev->priv->port_number,
                PARAM_RX_BYTES, bytes_waiting);
 
        if (result)
@@ -253,10 +255,10 @@ static int ps3_vuart_set_interrupt_mask(struct ps3_vuart_port_device *dev,
 
        dev_dbg(&dev->core, "%s:%d: %lxh\n", __func__, __LINE__, mask);
 
-       dev->interrupt_mask = mask;
+       dev->priv->interrupt_mask = mask;
 
-       result = lv1_set_virtual_uart_param(dev->port_number,
-               PARAM_INTERRUPT_MASK, dev->interrupt_mask);
+       result = lv1_set_virtual_uart_param(dev->priv->port_number,
+               PARAM_INTERRUPT_MASK, dev->priv->interrupt_mask);
 
        if (result)
                dev_dbg(&dev->core, "%s:%d: interrupt_mask failed: %s\n",
@@ -265,62 +267,64 @@ static int ps3_vuart_set_interrupt_mask(struct ps3_vuart_port_device *dev,
        return result;
 }
 
-static int ps3_vuart_get_interrupt_mask(struct ps3_vuart_port_device *dev,
+static int ps3_vuart_get_interrupt_status(struct ps3_vuart_port_device *dev,
        unsigned long *status)
 {
-       int result = lv1_get_virtual_uart_param(dev->port_number,
-               PARAM_INTERRUPT_STATUS, status);
+       u64 tmp;
+       int result = lv1_get_virtual_uart_param(dev->priv->port_number,
+               PARAM_INTERRUPT_STATUS, &tmp);
 
        if (result)
                dev_dbg(&dev->core, "%s:%d: interrupt_status failed: %s\n",
                        __func__, __LINE__, ps3_result(result));
 
+       *status = tmp & dev->priv->interrupt_mask;
+
        dev_dbg(&dev->core, "%s:%d: m %lxh, s %lxh, m&s %lxh\n",
-               __func__, __LINE__, dev->interrupt_mask, *status,
-               dev->interrupt_mask & *status);
+               __func__, __LINE__, dev->priv->interrupt_mask, tmp, *status);
 
        return result;
 }
 
 int ps3_vuart_enable_interrupt_tx(struct ps3_vuart_port_device *dev)
 {
-       return (dev->interrupt_mask & INTERRUPT_MASK_TX) ? 0
-               : ps3_vuart_set_interrupt_mask(dev, dev->interrupt_mask
+       return (dev->priv->interrupt_mask & INTERRUPT_MASK_TX) ? 0
+               : ps3_vuart_set_interrupt_mask(dev, dev->priv->interrupt_mask
                | INTERRUPT_MASK_TX);
 }
 
 int ps3_vuart_enable_interrupt_rx(struct ps3_vuart_port_device *dev)
 {
-       return (dev->interrupt_mask & INTERRUPT_MASK_RX) ? 0
-               : ps3_vuart_set_interrupt_mask(dev, dev->interrupt_mask
+       return (dev->priv->interrupt_mask & INTERRUPT_MASK_RX) ? 0
+               : ps3_vuart_set_interrupt_mask(dev, dev->priv->interrupt_mask
                | INTERRUPT_MASK_RX);
 }
 
 int ps3_vuart_enable_interrupt_disconnect(struct ps3_vuart_port_device *dev)
 {
-       return (dev->interrupt_mask & INTERRUPT_MASK_DISCONNECT) ? 0
-               : ps3_vuart_set_interrupt_mask(dev, dev->interrupt_mask
+       return (dev->priv->interrupt_mask & INTERRUPT_MASK_DISCONNECT) ? 0
+               : ps3_vuart_set_interrupt_mask(dev, dev->priv->interrupt_mask
                | INTERRUPT_MASK_DISCONNECT);
 }
 
 int ps3_vuart_disable_interrupt_tx(struct ps3_vuart_port_device *dev)
 {
-       return (dev->interrupt_mask & INTERRUPT_MASK_TX)
-               ? ps3_vuart_set_interrupt_mask(dev, dev->interrupt_mask
+       return (dev->priv->interrupt_mask & INTERRUPT_MASK_TX)
+               ? ps3_vuart_set_interrupt_mask(dev, dev->priv->interrupt_mask
                & ~INTERRUPT_MASK_TX) : 0;
 }
 
 int ps3_vuart_disable_interrupt_rx(struct ps3_vuart_port_device *dev)
 {
-       return (dev->interrupt_mask & INTERRUPT_MASK_RX)
-               ? ps3_vuart_set_interrupt_mask(dev, dev->interrupt_mask
+       return (dev->priv->interrupt_mask & INTERRUPT_MASK_RX)
+               ? ps3_vuart_set_interrupt_mask(dev, dev->priv->interrupt_mask
                & ~INTERRUPT_MASK_RX) : 0;
 }
 
 int ps3_vuart_disable_interrupt_disconnect(struct ps3_vuart_port_device *dev)
 {
-       return (dev->interrupt_mask & INTERRUPT_MASK_DISCONNECT)
-               ? ps3_vuart_set_interrupt_mask(dev, dev->interrupt_mask
+       return (dev->priv->interrupt_mask & INTERRUPT_MASK_DISCONNECT)
+               ? ps3_vuart_set_interrupt_mask(dev, dev->priv->interrupt_mask
                & ~INTERRUPT_MASK_DISCONNECT) : 0;
 }
 
@@ -335,9 +339,7 @@ static int ps3_vuart_raw_write(struct ps3_vuart_port_device *dev,
 {
        int result;
 
-       dev_dbg(&dev->core, "%s:%d: %xh\n", __func__, __LINE__, bytes);
-
-       result = lv1_write_virtual_uart(dev->port_number,
+       result = lv1_write_virtual_uart(dev->priv->port_number,
                ps3_mm_phys_to_lpar(__pa(buf)), bytes, bytes_written);
 
        if (result) {
@@ -346,10 +348,10 @@ static int ps3_vuart_raw_write(struct ps3_vuart_port_device *dev,
                return result;
        }
 
-       dev->stats.bytes_written += *bytes_written;
+       dev->priv->stats.bytes_written += *bytes_written;
 
-       dev_dbg(&dev->core, "%s:%d: wrote %lxh/%xh=>%lxh\n", __func__,
-               __LINE__, *bytes_written, bytes, dev->stats.bytes_written);
+       dev_dbg(&dev->core, "%s:%d: wrote %lxh/%xh=>%lxh\n", __func__, __LINE__,
+               *bytes_written, bytes, dev->priv->stats.bytes_written);
 
        return result;
 }
@@ -367,7 +369,7 @@ static int ps3_vuart_raw_read(struct ps3_vuart_port_device *dev, void* buf,
 
        dev_dbg(&dev->core, "%s:%d: %xh\n", __func__, __LINE__, bytes);
 
-       result = lv1_read_virtual_uart(dev->port_number,
+       result = lv1_read_virtual_uart(dev->priv->port_number,
                ps3_mm_phys_to_lpar(__pa(buf)), bytes, bytes_read);
 
        if (result) {
@@ -376,14 +378,57 @@ static int ps3_vuart_raw_read(struct ps3_vuart_port_device *dev, void* buf,
                return result;
        }
 
-       dev->stats.bytes_read += *bytes_read;
+       dev->priv->stats.bytes_read += *bytes_read;
 
        dev_dbg(&dev->core, "%s:%d: read %lxh/%xh=>%lxh\n", __func__, __LINE__,
-               *bytes_read, bytes, dev->stats.bytes_read);
+               *bytes_read, bytes, dev->priv->stats.bytes_read);
 
        return result;
 }
 
+/**
+ * ps3_vuart_clear_rx_bytes - Discard bytes received.
+ * @bytes: Max byte count to discard, zero = all pending.
+ *
+ * Used to clear pending rx interrupt source.  Will not block.
+ */
+
+void ps3_vuart_clear_rx_bytes(struct ps3_vuart_port_device *dev,
+       unsigned int bytes)
+{
+       int result;
+       u64 bytes_waiting;
+       void* tmp;
+
+       result = ps3_vuart_get_rx_bytes_waiting(dev, &bytes_waiting);
+
+       BUG_ON(result);
+
+       bytes = bytes ? min(bytes, (unsigned int)bytes_waiting) : bytes_waiting;
+
+       dev_dbg(&dev->core, "%s:%d: %u\n", __func__, __LINE__, bytes);
+
+       if (!bytes)
+               return;
+
+       /* Add some extra space for recently arrived data. */
+
+       bytes += 128;
+
+       tmp = kmalloc(bytes, GFP_KERNEL);
+
+       if (!tmp)
+               return;
+
+       ps3_vuart_raw_read(dev, tmp, bytes, &bytes_waiting);
+
+       kfree(tmp);
+
+       /* Don't include these bytes in the stats. */
+
+       dev->priv->stats.bytes_read -= bytes_waiting;
+}
+
 /**
  * struct list_buffer - An element for a port device fifo buffer list.
  */
@@ -416,14 +461,14 @@ int ps3_vuart_write(struct ps3_vuart_port_device *dev, const void* buf,
        dev_dbg(&dev->core, "%s:%d: %u(%xh) bytes\n", __func__, __LINE__,
                bytes, bytes);
 
-       spin_lock_irqsave(&dev->tx_list.lock, flags);
+       spin_lock_irqsave(&dev->priv->tx_list.lock, flags);
 
-       if (list_empty(&dev->tx_list.head)) {
+       if (list_empty(&dev->priv->tx_list.head)) {
                unsigned long bytes_written;
 
                result = ps3_vuart_raw_write(dev, buf, bytes, &bytes_written);
 
-               spin_unlock_irqrestore(&dev->tx_list.lock, flags);
+               spin_unlock_irqrestore(&dev->priv->tx_list.lock, flags);
 
                if (result) {
                        dev_dbg(&dev->core,
@@ -441,7 +486,7 @@ int ps3_vuart_write(struct ps3_vuart_port_device *dev, const void* buf,
                bytes -= bytes_written;
                buf += bytes_written;
        } else
-               spin_unlock_irqrestore(&dev->tx_list.lock, flags);
+               spin_unlock_irqrestore(&dev->priv->tx_list.lock, flags);
 
        lb = kmalloc(sizeof(struct list_buffer) + bytes, GFP_KERNEL);
 
@@ -454,10 +499,10 @@ int ps3_vuart_write(struct ps3_vuart_port_device *dev, const void* buf,
        lb->tail = lb->data + bytes;
        lb->dbg_number = ++dbg_number;
 
-       spin_lock_irqsave(&dev->tx_list.lock, flags);
-       list_add_tail(&lb->link, &dev->tx_list.head);
+       spin_lock_irqsave(&dev->priv->tx_list.lock, flags);
+       list_add_tail(&lb->link, &dev->priv->tx_list.head);
        ps3_vuart_enable_interrupt_tx(dev);
-       spin_unlock_irqrestore(&dev->tx_list.lock, flags);
+       spin_unlock_irqrestore(&dev->priv->tx_list.lock, flags);
 
        dev_dbg(&dev->core, "%s:%d: queued buf_%lu, %xh bytes\n",
                __func__, __LINE__, lb->dbg_number, bytes);
@@ -484,47 +529,83 @@ int ps3_vuart_read(struct ps3_vuart_port_device *dev, void* buf,
        dev_dbg(&dev->core, "%s:%d: %u(%xh) bytes\n", __func__, __LINE__,
                bytes, bytes);
 
-       spin_lock_irqsave(&dev->rx_list.lock, flags);
+       spin_lock_irqsave(&dev->priv->rx_list.lock, flags);
 
-       if (dev->rx_list.bytes_held < bytes) {
-               spin_unlock_irqrestore(&dev->rx_list.lock, flags);
+       if (dev->priv->rx_list.bytes_held < bytes) {
+               spin_unlock_irqrestore(&dev->priv->rx_list.lock, flags);
                dev_dbg(&dev->core, "%s:%d: starved for %lxh bytes\n",
-                       __func__, __LINE__, bytes - dev->rx_list.bytes_held);
+                       __func__, __LINE__,
+                       bytes - dev->priv->rx_list.bytes_held);
                return -EAGAIN;
        }
 
-       list_for_each_entry_safe(lb, n, &dev->rx_list.head, link) {
+       list_for_each_entry_safe(lb, n, &dev->priv->rx_list.head, link) {
                bytes_read = min((unsigned int)(lb->tail - lb->head), bytes);
 
                memcpy(buf, lb->head, bytes_read);
                buf += bytes_read;
                bytes -= bytes_read;
-               dev->rx_list.bytes_held -= bytes_read;
+               dev->priv->rx_list.bytes_held -= bytes_read;
 
                if (bytes_read < lb->tail - lb->head) {
                        lb->head += bytes_read;
-                       spin_unlock_irqrestore(&dev->rx_list.lock, flags);
-
-                       dev_dbg(&dev->core,
-                               "%s:%d: dequeued buf_%lu, %lxh bytes\n",
-                               __func__, __LINE__, lb->dbg_number, bytes_read);
+                       dev_dbg(&dev->core, "%s:%d: buf_%lu: dequeued %lxh "
+                               "bytes\n", __func__, __LINE__, lb->dbg_number,
+                               bytes_read);
+                       spin_unlock_irqrestore(&dev->priv->rx_list.lock, flags);
                        return 0;
                }
 
-               dev_dbg(&dev->core, "%s:%d free buf_%lu\n", __func__, __LINE__,
-                       lb->dbg_number);
+               dev_dbg(&dev->core, "%s:%d: buf_%lu: free, dequeued %lxh "
+                       "bytes\n", __func__, __LINE__, lb->dbg_number,
+                       bytes_read);
 
                list_del(&lb->link);
                kfree(lb);
        }
-       spin_unlock_irqrestore(&dev->rx_list.lock, flags);
 
-       dev_dbg(&dev->core, "%s:%d: dequeued buf_%lu, %xh bytes\n",
-               __func__, __LINE__, lb->dbg_number, bytes);
+       spin_unlock_irqrestore(&dev->priv->rx_list.lock, flags);
+       return 0;
+}
+
+int ps3_vuart_read_async(struct ps3_vuart_port_device *dev, work_func_t func,
+       unsigned int bytes)
+{
+       unsigned long flags;
+
+       if(dev->priv->work.trigger) {
+               dev_dbg(&dev->core, "%s:%d: warning, multiple calls\n",
+                       __func__, __LINE__);
+               return -EAGAIN;
+       }
+
+       BUG_ON(!bytes);
+
+       PREPARE_WORK(&dev->priv->work.work, func);
+
+       spin_lock_irqsave(&dev->priv->work.lock, flags);
+       if(dev->priv->rx_list.bytes_held >= bytes) {
+               dev_dbg(&dev->core, "%s:%d: schedule_work %xh bytes\n",
+                       __func__, __LINE__, bytes);
+               schedule_work(&dev->priv->work.work);
+               spin_unlock_irqrestore(&dev->priv->work.lock, flags);
+               return 0;
+       }
+
+       dev->priv->work.trigger = bytes;
+       spin_unlock_irqrestore(&dev->priv->work.lock, flags);
+
+       dev_dbg(&dev->core, "%s:%d: waiting for %u(%xh) bytes\n", __func__,
+               __LINE__, bytes, bytes);
 
        return 0;
 }
 
+void ps3_vuart_cancel_async(struct ps3_vuart_port_device *dev)
+{
+       dev->priv->work.trigger = 0;
+}
+
 /**
  * ps3_vuart_handle_interrupt_tx - third stage transmit interrupt handler
  *
@@ -542,9 +623,9 @@ static int ps3_vuart_handle_interrupt_tx(struct ps3_vuart_port_device *dev)
 
        dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
 
-       spin_lock_irqsave(&dev->tx_list.lock, flags);
+       spin_lock_irqsave(&dev->priv->tx_list.lock, flags);
 
-       list_for_each_entry_safe(lb, n, &dev->tx_list.head, link) {
+       list_for_each_entry_safe(lb, n, &dev->priv->tx_list.head, link) {
 
                unsigned long bytes_written;
 
@@ -578,7 +659,7 @@ static int ps3_vuart_handle_interrupt_tx(struct ps3_vuart_port_device *dev)
 
        ps3_vuart_disable_interrupt_tx(dev);
 port_full:
-       spin_unlock_irqrestore(&dev->tx_list.lock, flags);
+       spin_unlock_irqrestore(&dev->priv->tx_list.lock, flags);
        dev_dbg(&dev->core, "%s:%d wrote %lxh bytes total\n",
                __func__, __LINE__, bytes_total);
        return result;
@@ -609,7 +690,7 @@ static int ps3_vuart_handle_interrupt_rx(struct ps3_vuart_port_device *dev)
 
        BUG_ON(!bytes);
 
-       /* add some extra space for recently arrived data */
+       /* Add some extra space for recently arrived data. */
 
        bytes += 128;
 
@@ -624,14 +705,23 @@ static int ps3_vuart_handle_interrupt_rx(struct ps3_vuart_port_device *dev)
        lb->tail = lb->data + bytes;
        lb->dbg_number = ++dbg_number;
 
-       spin_lock_irqsave(&dev->rx_list.lock, flags);
-       list_add_tail(&lb->link, &dev->rx_list.head);
-       dev->rx_list.bytes_held += bytes;
-       spin_unlock_irqrestore(&dev->rx_list.lock, flags);
+       spin_lock_irqsave(&dev->priv->rx_list.lock, flags);
+       list_add_tail(&lb->link, &dev->priv->rx_list.head);
+       dev->priv->rx_list.bytes_held += bytes;
+       spin_unlock_irqrestore(&dev->priv->rx_list.lock, flags);
 
-       dev_dbg(&dev->core, "%s:%d: queued buf_%lu, %lxh bytes\n",
+       dev_dbg(&dev->core, "%s:%d: buf_%lu: queued %lxh bytes\n",
                __func__, __LINE__, lb->dbg_number, bytes);
 
+       spin_lock_irqsave(&dev->priv->work.lock, flags);
+       if(dev->priv->work.trigger
+               && dev->priv->rx_list.bytes_held >= dev->priv->work.trigger) {
+               dev_dbg(&dev->core, "%s:%d: schedule_work %lxh bytes\n",
+                       __func__, __LINE__, dev->priv->work.trigger);
+               dev->priv->work.trigger = 0;
+               schedule_work(&dev->priv->work.work);
+       }
+       spin_unlock_irqrestore(&dev->priv->work.lock, flags);
        return 0;
 }
 
@@ -656,7 +746,7 @@ static int ps3_vuart_handle_port_interrupt(struct ps3_vuart_port_device *dev)
        int result;
        unsigned long status;
 
-       result = ps3_vuart_get_interrupt_mask(dev, &status);
+       result = ps3_vuart_get_interrupt_status(dev, &status);
 
        if (result)
                return result;
@@ -665,21 +755,21 @@ static int ps3_vuart_handle_port_interrupt(struct ps3_vuart_port_device *dev)
                status);
 
        if (status & INTERRUPT_MASK_DISCONNECT) {
-               dev->stats.disconnect_interrupts++;
+               dev->priv->stats.disconnect_interrupts++;
                result = ps3_vuart_handle_interrupt_disconnect(dev);
                if (result)
                        ps3_vuart_disable_interrupt_disconnect(dev);
        }
 
        if (status & INTERRUPT_MASK_TX) {
-               dev->stats.tx_interrupts++;
+               dev->priv->stats.tx_interrupts++;
                result = ps3_vuart_handle_interrupt_tx(dev);
                if (result)
                        ps3_vuart_disable_interrupt_tx(dev);
        }
 
        if (status & INTERRUPT_MASK_RX) {
-               dev->stats.rx_interrupts++;
+               dev->priv->stats.rx_interrupts++;
                result = ps3_vuart_handle_interrupt_rx(dev);
                if (result)
                        ps3_vuart_disable_interrupt_rx(dev);
@@ -688,12 +778,13 @@ static int ps3_vuart_handle_port_interrupt(struct ps3_vuart_port_device *dev)
        return 0;
 }
 
-struct vuart_private {
-       unsigned int in_use;
+struct vuart_bus_priv {
+       const struct ports_bmp bmp;
        unsigned int virq;
+       struct semaphore probe_mutex;
+       int use_count;
        struct ps3_vuart_port_device *devices[PORT_COUNT];
-       const struct ports_bmp bmp;
-};
+} static vuart_bus_priv;
 
 /**
  * ps3_vuart_irq_handler - first stage interrupt handler
@@ -705,25 +796,25 @@ struct vuart_private {
 
 static irqreturn_t ps3_vuart_irq_handler(int irq, void *_private)
 {
-       struct vuart_private *private;
+       struct vuart_bus_priv *bus_priv;
 
        BUG_ON(!_private);
-       private = (struct vuart_private *)_private;
+       bus_priv = (struct vuart_bus_priv *)_private;
 
        while (1) {
                unsigned int port;
 
-               dump_ports_bmp(&private->bmp);
+               dump_ports_bmp(&bus_priv->bmp);
 
-               port = (BITS_PER_LONG - 1) - __ilog2(private->bmp.status);
+               port = (BITS_PER_LONG - 1) - __ilog2(bus_priv->bmp.status);
 
                if (port == BITS_PER_LONG)
                        break;
 
                BUG_ON(port >= PORT_COUNT);
-               BUG_ON(!private->devices[port]);
+               BUG_ON(!bus_priv->devices[port]);
 
-               ps3_vuart_handle_port_interrupt(private->devices[port]);
+               ps3_vuart_handle_port_interrupt(bus_priv->devices[port]);
        }
 
        return IRQ_HANDLED;
@@ -744,12 +835,10 @@ static int ps3_vuart_match(struct device *_dev, struct device_driver *_drv)
        return result;
 }
 
-static struct vuart_private vuart_private;
-
 static int ps3_vuart_probe(struct device *_dev)
 {
        int result;
-       unsigned long tmp;
+       unsigned int port_number;
        struct ps3_vuart_port_device *dev = to_ps3_vuart_port_device(_dev);
        struct ps3_vuart_port_driver *drv =
                to_ps3_vuart_port_driver(_dev->driver);
@@ -758,7 +847,12 @@ static int ps3_vuart_probe(struct device *_dev)
 
        BUG_ON(!drv);
 
-       result = ps3_vuart_match_id_to_port(dev->match_id, &dev->port_number);
+       down(&vuart_bus_priv.probe_mutex);
+
+       /* Setup vuart_bus_priv.devices[]. */
+
+       result = ps3_vuart_match_id_to_port(dev->match_id,
+               &port_number);
 
        if (result) {
                dev_dbg(&dev->core, "%s:%d: unknown match_id (%d)\n",
@@ -767,24 +861,41 @@ static int ps3_vuart_probe(struct device *_dev)
                goto fail_match;
        }
 
-       if (vuart_private.devices[dev->port_number]) {
+       if (vuart_bus_priv.devices[port_number]) {
                dev_dbg(&dev->core, "%s:%d: port busy (%d)\n", __func__,
-                       __LINE__, dev->port_number);
+                       __LINE__, port_number);
                result = -EBUSY;
                goto fail_match;
        }
 
-       vuart_private.devices[dev->port_number] = dev;
+       vuart_bus_priv.devices[port_number] = dev;
+
+       /* Setup dev->priv. */
+
+       dev->priv = kzalloc(sizeof(struct ps3_vuart_port_priv), GFP_KERNEL);
+
+       if (!dev->priv) {
+               result = -ENOMEM;
+               goto fail_alloc;
+       }
 
-       INIT_LIST_HEAD(&dev->tx_list.head);
-       spin_lock_init(&dev->tx_list.lock);
-       INIT_LIST_HEAD(&dev->rx_list.head);
-       spin_lock_init(&dev->rx_list.lock);
+       dev->priv->port_number = port_number;
+
+       INIT_LIST_HEAD(&dev->priv->tx_list.head);
+       spin_lock_init(&dev->priv->tx_list.lock);
+
+       INIT_LIST_HEAD(&dev->priv->rx_list.head);
+       spin_lock_init(&dev->priv->rx_list.lock);
+
+       INIT_WORK(&dev->priv->work.work, NULL);
+       spin_lock_init(&dev->priv->work.lock);
+       dev->priv->work.trigger = 0;
+       dev->priv->work.dev = dev;
+
+       if (++vuart_bus_priv.use_count == 1) {
 
-       vuart_private.in_use++;
-       if (vuart_private.in_use == 1) {
                result = ps3_alloc_vuart_irq(PS3_BINDING_CPU_ANY,
-                       (void*)&vuart_private.bmp.status, &vuart_private.virq);
+                       (void*)&vuart_bus_priv.bmp.status, &vuart_bus_priv.virq);
 
                if (result) {
                        dev_dbg(&dev->core,
@@ -794,8 +905,8 @@ static int ps3_vuart_probe(struct device *_dev)
                        goto fail_alloc_irq;
                }
 
-               result = request_irq(vuart_private.virq, ps3_vuart_irq_handler,
-                       IRQF_DISABLED, "vuart", &vuart_private);
+               result = request_irq(vuart_bus_priv.virq, ps3_vuart_irq_handler,
+                       IRQF_DISABLED, "vuart", &vuart_bus_priv);
 
                if (result) {
                        dev_info(&dev->core, "%s:%d: request_irq failed (%d)\n",
@@ -804,10 +915,11 @@ static int ps3_vuart_probe(struct device *_dev)
                }
        }
 
-       ps3_vuart_set_interrupt_mask(dev, INTERRUPT_MASK_RX);
-
        /* clear stale pending interrupts */
-       ps3_vuart_get_interrupt_mask(dev, &tmp);
+
+       ps3_vuart_clear_rx_bytes(dev, 0);
+
+       ps3_vuart_set_interrupt_mask(dev, INTERRUPT_MASK_RX);
 
        ps3_vuart_set_triggers(dev, 1, 1);
 
@@ -822,20 +934,27 @@ static int ps3_vuart_probe(struct device *_dev)
        if (result) {
                dev_dbg(&dev->core, "%s:%d: drv->probe failed\n",
                        __func__, __LINE__);
+               down(&vuart_bus_priv.probe_mutex);
                goto fail_probe;
        }
 
+       up(&vuart_bus_priv.probe_mutex);
+
        return result;
 
 fail_probe:
+       ps3_vuart_set_interrupt_mask(dev, 0);
 fail_request_irq:
-       vuart_private.in_use--;
-       if (!vuart_private.in_use) {
-               ps3_free_vuart_irq(vuart_private.virq);
-               vuart_private.virq = NO_IRQ;
-       }
+       ps3_free_vuart_irq(vuart_bus_priv.virq);
+       vuart_bus_priv.virq = NO_IRQ;
 fail_alloc_irq:
+       --vuart_bus_priv.use_count;
+       kfree(dev->priv);
+       dev->priv = NULL;
+fail_alloc:
+       vuart_bus_priv.devices[port_number] = 0;
 fail_match:
+       up(&vuart_bus_priv.probe_mutex);
        dev_dbg(&dev->core, "%s:%d failed\n", __func__, __LINE__);
        return result;
 }
@@ -846,10 +965,12 @@ static int ps3_vuart_remove(struct device *_dev)
        struct ps3_vuart_port_driver *drv =
                to_ps3_vuart_port_driver(_dev->driver);
 
+       down(&vuart_bus_priv.probe_mutex);
+
        dev_dbg(&dev->core, "%s:%d: %s\n", __func__, __LINE__,
                dev->core.bus_id);
 
-       BUG_ON(vuart_private.in_use < 1);
+       BUG_ON(vuart_bus_priv.use_count < 1);
 
        if (drv->remove)
                drv->remove(dev);
@@ -857,13 +978,19 @@ static int ps3_vuart_remove(struct device *_dev)
                dev_dbg(&dev->core, "%s:%d: %s no remove method\n", __func__,
                        __LINE__, dev->core.bus_id);
 
-       vuart_private.in_use--;
+       vuart_bus_priv.devices[dev->priv->port_number] = 0;
 
-       if (!vuart_private.in_use) {
-               free_irq(vuart_private.virq, &vuart_private);
-               ps3_free_vuart_irq(vuart_private.virq);
-               vuart_private.virq = NO_IRQ;
+       if (--vuart_bus_priv.use_count == 0) {
+               BUG();
+               free_irq(vuart_bus_priv.virq, &vuart_bus_priv);
+               ps3_free_vuart_irq(vuart_bus_priv.virq);
+               vuart_bus_priv.virq = NO_IRQ;
        }
+
+       kfree(dev->priv);
+       dev->priv = NULL;
+
+       up(&vuart_bus_priv.probe_mutex);
        return 0;
 }
 
@@ -884,12 +1011,12 @@ static void ps3_vuart_shutdown(struct device *_dev)
 }
 
 /**
- * ps3_vuart - The vuart instance.
+ * ps3_vuart_bus - The vuart bus instance.
  *
  * The vuart is managed as a bus that port devices connect to.
  */
 
-struct bus_type ps3_vuart = {
+struct bus_type ps3_vuart_bus = {
         .name = "ps3_vuart",
        .match = ps3_vuart_match,
        .probe = ps3_vuart_probe,
@@ -897,24 +1024,30 @@ struct bus_type ps3_vuart = {
        .shutdown = ps3_vuart_shutdown,
 };
 
-int __init ps3_vuart_init(void)
+int __init ps3_vuart_bus_init(void)
 {
        int result;
 
        pr_debug("%s:%d:\n", __func__, __LINE__);
-       result = bus_register(&ps3_vuart);
+
+       if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
+               return 0;
+
+       init_MUTEX(&vuart_bus_priv.probe_mutex);
+       result = bus_register(&ps3_vuart_bus);
        BUG_ON(result);
+
        return result;
 }
 
-void __exit ps3_vuart_exit(void)
+void __exit ps3_vuart_bus_exit(void)
 {
        pr_debug("%s:%d:\n", __func__, __LINE__);
-       bus_unregister(&ps3_vuart);
+       bus_unregister(&ps3_vuart_bus);
 }
 
-core_initcall(ps3_vuart_init);
-module_exit(ps3_vuart_exit);
+core_initcall(ps3_vuart_bus_init);
+module_exit(ps3_vuart_bus_exit);
 
 /**
  * ps3_vuart_port_release_device - Remove a vuart port device.
@@ -922,11 +1055,14 @@ module_exit(ps3_vuart_exit);
 
 static void ps3_vuart_port_release_device(struct device *_dev)
 {
-       struct ps3_vuart_port_device *dev = to_ps3_vuart_port_device(_dev);
 #if defined(DEBUG)
-       memset(dev, 0xad, sizeof(struct ps3_vuart_port_device));
+       struct ps3_vuart_port_device *dev = to_ps3_vuart_port_device(_dev);
+
+       dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+
+       BUG_ON(dev->priv && "forgot to free");
+       memset(&dev->core, 0, sizeof(dev->core));
 #endif
-       kfree(dev);
 }
 
 /**
@@ -935,11 +1071,12 @@ static void ps3_vuart_port_release_device(struct device *_dev)
 
 int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev)
 {
-       int result;
        static unsigned int dev_count = 1;
 
+       BUG_ON(dev->priv && "forgot to free");
+
        dev->core.parent = NULL;
-       dev->core.bus = &ps3_vuart;
+       dev->core.bus = &ps3_vuart_bus;
        dev->core.release = ps3_vuart_port_release_device;
 
        snprintf(dev->core.bus_id, sizeof(dev->core.bus_id), "vuart_%02x",
@@ -947,9 +1084,7 @@ int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev)
 
        dev_dbg(&dev->core, "%s:%d register\n", __func__, __LINE__);
 
-       result = device_register(&dev->core);
-
-       return result;
+       return device_register(&dev->core);
 }
 
 EXPORT_SYMBOL_GPL(ps3_vuart_port_device_register);
@@ -963,7 +1098,7 @@ int ps3_vuart_port_driver_register(struct ps3_vuart_port_driver *drv)
        int result;
 
        pr_debug("%s:%d: (%s)\n", __func__, __LINE__, drv->core.name);
-       drv->core.bus = &ps3_vuart;
+       drv->core.bus = &ps3_vuart_bus;
        result = driver_register(&drv->core);
        return result;
 }
@@ -976,6 +1111,7 @@ EXPORT_SYMBOL_GPL(ps3_vuart_port_driver_register);
 
 void ps3_vuart_port_driver_unregister(struct ps3_vuart_port_driver *drv)
 {
+       pr_debug("%s:%d: (%s)\n", __func__, __LINE__, drv->core.name);
        driver_unregister(&drv->core);
 }
 
index 2cbf728a3a0bfaec295ea31a1d580390d13ed4a4..1be992d568c8344afe0d280886ae7e869ea9fcb8 100644 (file)
 #if !defined(_PS3_VUART_H)
 #define _PS3_VUART_H
 
+#include <asm/ps3.h>
+
+struct ps3_vuart_stats {
+       unsigned long bytes_written;
+       unsigned long bytes_read;
+       unsigned long tx_interrupts;
+       unsigned long rx_interrupts;
+       unsigned long disconnect_interrupts;
+};
+
+struct ps3_vuart_work {
+       struct work_struct work;
+       unsigned long trigger;
+       spinlock_t lock;
+       struct ps3_vuart_port_device* dev; /* to convert work to device */
+};
+
+/**
+ * struct ps3_vuart_port_priv - private vuart device data.
+ */
+
+struct ps3_vuart_port_priv {
+       unsigned int port_number;
+       u64 interrupt_mask;
+
+       struct {
+               spinlock_t lock;
+               struct list_head head;
+       } tx_list;
+       struct {
+               unsigned long bytes_held;
+               spinlock_t lock;
+               struct list_head head;
+       } rx_list;
+       struct ps3_vuart_stats stats;
+       struct ps3_vuart_work work;
+};
+
 /**
  * struct ps3_vuart_port_driver - a driver for a device on a vuart port
  */
@@ -41,10 +79,6 @@ struct ps3_vuart_port_driver {
 int ps3_vuart_port_driver_register(struct ps3_vuart_port_driver *drv);
 void ps3_vuart_port_driver_unregister(struct ps3_vuart_port_driver *drv);
 
-int ps3_vuart_write(struct ps3_vuart_port_device *dev,
-       const void* buf, unsigned int bytes);
-int ps3_vuart_read(struct ps3_vuart_port_device *dev, void* buf,
-       unsigned int bytes);
 static inline struct ps3_vuart_port_driver *to_ps3_vuart_port_driver(
        struct device_driver *_drv)
 {
@@ -55,5 +89,22 @@ static inline struct ps3_vuart_port_device *to_ps3_vuart_port_device(
 {
        return container_of(_dev, struct ps3_vuart_port_device, core);
 }
+static inline struct ps3_vuart_port_device *ps3_vuart_work_to_port_device(
+       struct work_struct *_work)
+{
+       struct ps3_vuart_work *vw = container_of(_work, struct ps3_vuart_work,
+               work);
+       return vw->dev;
+}
+
+int ps3_vuart_write(struct ps3_vuart_port_device *dev, const void* buf,
+       unsigned int bytes);
+int ps3_vuart_read(struct ps3_vuart_port_device *dev, void* buf,
+       unsigned int bytes);
+int ps3_vuart_read_async(struct ps3_vuart_port_device *dev, work_func_t func,
+       unsigned int bytes);
+void ps3_vuart_cancel_async(struct ps3_vuart_port_device *dev);
+void ps3_vuart_clear_rx_bytes(struct ps3_vuart_port_device *dev,
+       unsigned int bytes);
 
 #endif
index 8f6b5bf580f6757fdcace40c5a41eb5359827d98..2b5b8a93bc10756ed801eb7ea06f31265cb0ecbb 100644 (file)
@@ -801,15 +801,10 @@ static int idescsi_ide_open(struct inode *inode, struct file *filp)
 {
        struct gendisk *disk = inode->i_bdev->bd_disk;
        struct ide_scsi_obj *scsi;
-       ide_drive_t *drive;
 
        if (!(scsi = ide_scsi_get(disk)))
                return -ENXIO;
 
-       drive = scsi->drive;
-
-       drive->usage++;
-
        return 0;
 }
 
@@ -817,9 +812,6 @@ static int idescsi_ide_release(struct inode *inode, struct file *filp)
 {
        struct gendisk *disk = inode->i_bdev->bd_disk;
        struct ide_scsi_obj *scsi = ide_scsi_g(disk);
-       ide_drive_t *drive = scsi->drive;
-
-       drive->usage--;
 
        ide_scsi_put(scsi);
 
index 3f048bd6326ddc5ff70b8f031e0ce1e1b4c06404..5a8f55fea5ff3da628eaed926786b0713d1a8565 100644 (file)
@@ -1269,9 +1269,18 @@ repeat:
 
        /* Some devices return the total number of sectors, not the
         * highest sector number.  Make the necessary adjustment. */
-       if (sdp->fix_capacity)
+       if (sdp->fix_capacity) {
                --sdkp->capacity;
 
+       /* Some devices have version which report the correct sizes
+        * and others which do not. We guess size according to a heuristic
+        * and err on the side of lowering the capacity. */
+       } else {
+               if (sdp->guess_capacity)
+                       if (sdkp->capacity & 0x01) /* odd sizes are odd */
+                               --sdkp->capacity;
+       }
+
 got_data:
        if (sector_size == 0) {
                sector_size = 512;
index e8dd71df91651badcfe7c86ea3b08db5c0b340d5..ad9f321968e1d24061272ece20db34b0b12d3084 100644 (file)
@@ -262,7 +262,8 @@ config SERIAL_AMBA_PL010
        select SERIAL_CORE
        help
          This selects the ARM(R) AMBA(R) PrimeCell PL010 UART.  If you have
-         an Integrator/AP or Integrator/PP2 platform, say Y or M here.
+         an Integrator/AP or Integrator/PP2 platform, or if you have a
+         Cirrus Logic EP93xx CPU, say Y or M here.
 
          If unsure, say N.
 
index df45a7ac773f8fd5b7409b64bc4b764480dbe0fa..935f48fa501d5b398a3913281b5740e160ec4b85 100644 (file)
 #include <linux/sysrq.h>
 #include <linux/tty_flip.h>
 #include <linux/platform_device.h>
+#include <linux/atmel_pdc.h>
 
 #include <asm/io.h>
 
 #include <asm/mach/serial_at91.h>
 #include <asm/arch/board.h>
-#include <asm/arch/at91_pdc.h>
+
 #ifdef CONFIG_ARM
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
index 787a8f134677c0a1b7f0f8ab17778bb267dd247a..fa455996ad8fb30b46004f16bf4feaa2f7a76efc 100644 (file)
@@ -285,7 +285,7 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
 int __init cpm_uart_init_portdesc(void)
 {
 #if defined(CONFIG_SERIAL_CPM_SMC1) || defined(CONFIG_SERIAL_CPM_SMC2)
-       u32 addr;
+       u16 *addr;
 #endif
        pr_debug("CPM uart[-]:init portdesc\n");
 
index e216dcf29376582776418cf2ccfb825885a91124..04cc88cc528cec7eb742eee9e5e952e3662be502 100644 (file)
@@ -154,7 +154,7 @@ static inline void imx_transmit_buffer(struct imx_port *sport)
 {
        struct circ_buf *xmit = &sport->port.info->xmit;
 
-       do {
+       while (!(UTS((u32)sport->port.membase) & UTS_TXFULL)) {
                /* send xmit->buf[xmit->tail]
                 * out the port here */
                URTX0((u32)sport->port.membase) = xmit->buf[xmit->tail];
@@ -163,7 +163,7 @@ static inline void imx_transmit_buffer(struct imx_port *sport)
                sport->port.icount.tx++;
                if (uart_circ_empty(xmit))
                        break;
-       } while (!(UTS((u32)sport->port.membase) & UTS_TXFULL));
+       }
 
        if (uart_circ_empty(xmit))
                imx_stop_tx(&sport->port);
@@ -178,8 +178,7 @@ static void imx_start_tx(struct uart_port *port)
 
        UCR1((u32)sport->port.membase) |= UCR1_TXMPTYEN;
 
-       if(UTS((u32)sport->port.membase) & UTS_TXEMPTY)
-               imx_transmit_buffer(sport);
+       imx_transmit_buffer(sport);
 }
 
 static irqreturn_t imx_rtsint(int irq, void *dev_id)
@@ -404,7 +403,8 @@ static int imx_startup(struct uart_port *port)
        if (retval) goto error_out2;
 
        retval = request_irq(sport->rtsirq, imx_rtsint,
-                            IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
+                            (sport->rtsirq < IMX_IRQS) ? 0 :
+                              IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
                             DRIVER_NAME, sport);
        if (retval) goto error_out3;
 
@@ -678,7 +678,7 @@ static struct imx_port imx_ports[] = {
                .mapbase        = IMX_UART1_BASE, /* FIXME */
                .irq            = UART1_MINT_RX,
                .uartclk        = 16000000,
-               .fifosize       = 8,
+               .fifosize       = 32,
                .flags          = UPF_BOOT_AUTOCONF,
                .ops            = &imx_pops,
                .line           = 0,
@@ -694,7 +694,7 @@ static struct imx_port imx_ports[] = {
                .mapbase        = IMX_UART2_BASE, /* FIXME */
                .irq            = UART2_MINT_RX,
                .uartclk        = 16000000,
-               .fifosize       = 8,
+               .fifosize       = 32,
                .flags          = UPF_BOOT_AUTOCONF,
                .ops            = &imx_pops,
                .line           = 1,
index 955bbd653e22c0c94764c1503c7f3c1818bcdb9a..8d24cd521056793828df902ce864210653ca408d 100644 (file)
@@ -995,8 +995,10 @@ mpc52xx_uart_of_remove(struct of_device *op)
        struct uart_port *port = dev_get_drvdata(&op->dev);
        dev_set_drvdata(&op->dev, NULL);
 
-       if (port)
+       if (port) {
                uart_remove_one_port(&mpc52xx_uart_driver, port);
+               irq_dispose_mapping(port->irq);
+       }
 
        return 0;
 }
index c2f1012449da7f46cb0291d19ed6b54070128324..6b76babc7fbf5ece40cce4444c7c9438f76e7597 100644 (file)
@@ -246,6 +246,10 @@ static const struct serial_quirk quirks[] = {
                .manfid = MANFID_QUATECH,
                .prodid = PRODID_QUATECH_DUAL_RS232_D1,
                .multi  = 2,
+       }, {
+               .manfid = MANFID_QUATECH,
+               .prodid = PRODID_QUATECH_DUAL_RS232_G,
+               .multi  = 2,
        }, {
                .manfid = MANFID_QUATECH,
                .prodid = PRODID_QUATECH_QUAD_RS232,
@@ -891,6 +895,7 @@ static struct pcmcia_device_id serial_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("OEM      ", "C288MX     ", 0xb572d360, 0xd2385b7a),
        PCMCIA_DEVICE_PROD_ID12("PCMCIA   ", "C336MX     ", 0x99bcafe9, 0xaa25bcab),
        PCMCIA_DEVICE_PROD_ID12("Quatech Inc", "PCMCIA Dual RS-232 Serial Port Card", 0xc4420b35, 0x92abc92f),
+       PCMCIA_DEVICE_PROD_ID12("Quatech Inc", "Dual RS-232 Serial Port PC Card", 0xc4420b35, 0x031a380d),
        PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "PCMCIA", "EN2218-LAN/MODEM", 0x281f1c5d, 0x570f348e, "PCMLM28.cis"),
        PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "PCMCIA", "UE2218-LAN/MODEM", 0x281f1c5d, 0x6fdcacee, "PCMLM28.cis"),
        PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "Psion Dacom", "Gold Card V34 Ethernet", 0xf5f025c2, 0x338e8155, "PCMLM28.cis"),
index 825bf884537a2204ecdd6019093be9f52bfe4e96..8b7ff467d26242a2b08a55a4055e25d26bf17d49 100644 (file)
@@ -51,6 +51,7 @@ obj-$(CONFIG_USB_SERIAL)      += serial/
 obj-$(CONFIG_USB_ADUTUX)       += misc/
 obj-$(CONFIG_USB_APPLEDISPLAY) += misc/
 obj-$(CONFIG_USB_AUERSWALD)    += misc/
+obj-$(CONFIG_USB_BERRY_CHARGE) += misc/
 obj-$(CONFIG_USB_CYPRESS_CY7C63)+= misc/
 obj-$(CONFIG_USB_CYTHERM)      += misc/
 obj-$(CONFIG_USB_EMI26)                += misc/
index dae4ef1e8fe592f6338a3d75917134c3198f5e4c..4973e147bc79ea441e6a48875cfa00c60cc15d3a 100644 (file)
@@ -61,6 +61,7 @@
 #include <linux/usb.h>
 #include <linux/firmware.h>
 #include <linux/ctype.h>
+#include <linux/sched.h>
 #include <linux/kthread.h>
 #include <linux/version.h>
 #include <linux/mutex.h>
index 98199628e394e66df0e3c1c7a42e0874d420d3c4..d38a25f36ea5839557b0328cd72940962d2d0dda 100644 (file)
@@ -326,10 +326,16 @@ static void acm_rx_tasklet(unsigned long _acm)
        struct tty_struct *tty = acm->tty;
        struct acm_ru *rcv;
        unsigned long flags;
-       int i = 0;
+       unsigned char throttled;
        dbg("Entering acm_rx_tasklet");
 
-       if (!ACM_READY(acm) || acm->throttle)
+       if (!ACM_READY(acm))
+               return;
+
+       spin_lock(&acm->throttle_lock);
+       throttled = acm->throttle;
+       spin_unlock(&acm->throttle_lock);
+       if (throttled)
                return;
 
 next_buffer:
@@ -346,22 +352,20 @@ next_buffer:
        dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size);
 
        tty_buffer_request_room(tty, buf->size);
-       if (!acm->throttle)
+       spin_lock(&acm->throttle_lock);
+       throttled = acm->throttle;
+       spin_unlock(&acm->throttle_lock);
+       if (!throttled)
                tty_insert_flip_string(tty, buf->base, buf->size);
        tty_flip_buffer_push(tty);
 
-       spin_lock(&acm->throttle_lock);
-       if (acm->throttle) {
-               dbg("Throtteling noticed");
-               memmove(buf->base, buf->base + i, buf->size - i);
-               buf->size -= i;
-               spin_unlock(&acm->throttle_lock);
+       if (throttled) {
+               dbg("Throttling noticed");
                spin_lock_irqsave(&acm->read_lock, flags);
                list_add(&buf->list, &acm->filled_read_bufs);
                spin_unlock_irqrestore(&acm->read_lock, flags);
                return;
        }
-       spin_unlock(&acm->throttle_lock);
 
        spin_lock_irqsave(&acm->read_lock, flags);
        list_add(&buf->list, &acm->spare_read_bufs);
@@ -467,7 +471,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
                goto bail_out;
        }
 
-       if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS))
+       if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS) &&
+           (acm->ctrl_caps & USB_CDC_CAP_LINE))
                goto full_bailout;
 
        INIT_LIST_HEAD(&acm->spare_read_urbs);
@@ -480,6 +485,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
                list_add(&(acm->rb[i].list), &acm->spare_read_bufs);
        }
 
+       acm->throttle = 0;
+
        tasklet_schedule(&acm->urb_task);
 
 done:
@@ -1092,6 +1099,10 @@ static struct usb_device_id acm_ids[] = {
        { USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */
        .driver_info = SINGLE_RX_URB, /* firmware bug */
        },
+       { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */
+       .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
+       },
+
        /* control interfaces with various AT-command sets */
        { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
                USB_CDC_ACM_PROTO_AT_V25TER) },
index a47c30b2d7645cfc1cdde964a31753596961c5e1..aefc7987120d37bfa4d67c11bfb37f84b5dc18bc 100644 (file)
@@ -604,10 +604,6 @@ static unsigned int usb_device_poll(struct file *file, struct poll_table_struct
        lock_kernel();
        if (!st) {
                st = kmalloc(sizeof(struct usb_device_status), GFP_KERNEL);
-               if (!st) {
-                       unlock_kernel();
-                       return POLLIN;
-               }
 
                /* we may have dropped BKL - need to check for having lost the race */
                if (file->private_data) {
@@ -615,6 +611,11 @@ static unsigned int usb_device_poll(struct file *file, struct poll_table_struct
                        st = file->private_data;
                        goto lost_race;
                }
+               /* we haven't lost - check for allocation failure now */
+               if (!st) {
+                       unlock_kernel();
+                       return POLLIN;
+               }
 
                /*
                 * need to prevent the module from being unloaded, since
index 2087766f9e88e059aa240c89e77f7e7d93939602..274f14f1633e8f348baff7c4ff8f138b3b2a803c 100644 (file)
@@ -857,11 +857,11 @@ static int proc_setintf(struct dev_state *ps, void __user *arg)
 
 static int proc_setconfig(struct dev_state *ps, void __user *arg)
 {
-       unsigned int u;
+       int u;
        int status = 0;
        struct usb_host_config *actconfig;
 
-       if (get_user(u, (unsigned int __user *)arg))
+       if (get_user(u, (int __user *)arg))
                return -EFAULT;
 
        actconfig = ps->dev->actconfig;
index 600d1bc8272a9503caf399171775c3bf05bb4ff9..2aded261f42c3acb5ffdd8a605a6c36b70049a6e 100644 (file)
@@ -743,6 +743,7 @@ EXPORT_SYMBOL_GPL(usb_deregister_device_driver);
  * usb_register_driver - register a USB interface driver
  * @new_driver: USB operations for the interface driver
  * @owner: module owner of this driver.
+ * @mod_name: module name string
  *
  * Registers a USB interface driver with the USB core.  The list of
  * unattached interfaces will be rescanned whenever a new driver is
index 5e628ae3aec714ba9469df02ed3f2bae4989c129..e0ec7045e865d93772edc95bd6ccc6e1e0176786 100644 (file)
@@ -229,7 +229,7 @@ static int init_endpoint_class(void)
        kref_init(&ep_class->kref);
        ep_class->class = class_create(THIS_MODULE, "usb_endpoint");
        if (IS_ERR(ep_class->class)) {
-               result = IS_ERR(ep_class->class);
+               result = PTR_ERR(ep_class->class);
                goto class_create_error;
        }
 
index b531a4fd30c228b47fda66611fa304c75657eea2..9bbcb20e2d94c3bf5ca96f77d0c1050d87d14eb2 100644 (file)
@@ -184,7 +184,7 @@ static void generic_disconnect(struct usb_device *udev)
        /* if this is only an unbind, not a physical disconnect, then
         * unconfigure the device */
        if (udev->actconfig)
-               usb_set_configuration(udev, 0);
+               usb_set_configuration(udev, -1);
 
        usb_remove_sysfs_dev_files(udev);
 }
index 590ec82d051514e02fc15c415c8ee8aa6ed3fd8d..50c0db15304aef513c30262b585b41db670c567e 100644 (file)
@@ -44,6 +44,7 @@ struct usb_hub {
                struct usb_hub_status   hub;
                struct usb_port_status  port;
        }                       *status;        /* buffer for status reports */
+       struct mutex            status_mutex;   /* for the status buffer */
 
        int                     error;          /* last reported error */
        int                     nerrors;        /* track consecutive errors */
@@ -535,6 +536,7 @@ static int hub_hub_status(struct usb_hub *hub,
 {
        int ret;
 
+       mutex_lock(&hub->status_mutex);
        ret = get_hub_status(hub->hdev, &hub->status->hub);
        if (ret < 0)
                dev_err (hub->intfdev,
@@ -544,6 +546,7 @@ static int hub_hub_status(struct usb_hub *hub,
                *change = le16_to_cpu(hub->status->hub.wHubChange); 
                ret = 0;
        }
+       mutex_unlock(&hub->status_mutex);
        return ret;
 }
 
@@ -617,6 +620,7 @@ static int hub_configure(struct usb_hub *hub,
                ret = -ENOMEM;
                goto fail;
        }
+       mutex_init(&hub->status_mutex);
 
        hub->descriptor = kmalloc(sizeof(*hub->descriptor), GFP_KERNEL);
        if (!hub->descriptor) {
@@ -1396,6 +1400,7 @@ static int hub_port_status(struct usb_hub *hub, int port1,
 {
        int ret;
 
+       mutex_lock(&hub->status_mutex);
        ret = get_port_status(hub->hdev, port1, &hub->status->port);
        if (ret < 4) {
                dev_err (hub->intfdev,
@@ -1407,6 +1412,7 @@ static int hub_port_status(struct usb_hub *hub, int port1,
                *change = le16_to_cpu(hub->status->port.wPortChange); 
                ret = 0;
        }
+       mutex_unlock(&hub->status_mutex);
        return ret;
 }
 
@@ -1904,6 +1910,7 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
        struct usb_hub          *hub = usb_get_intfdata (intf);
        struct usb_device       *hdev = hub->hdev;
        unsigned                port1;
+       int                     status = 0;
 
        /* fail if children aren't already suspended */
        for (port1 = 1; port1 <= hdev->maxchild; port1++) {
@@ -1927,24 +1934,18 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
 
        dev_dbg(&intf->dev, "%s\n", __FUNCTION__);
 
+       /* stop khubd and related activity */
+       hub_quiesce(hub);
+
        /* "global suspend" of the downstream HC-to-USB interface */
        if (!hdev->parent) {
-               struct usb_bus  *bus = hdev->bus;
-               if (bus) {
-                       int     status = hcd_bus_suspend (bus);
-
-                       if (status != 0) {
-                               dev_dbg(&hdev->dev, "'global' suspend %d\n",
-                                       status);
-                               return status;
-                       }
-               } else
-                       return -EOPNOTSUPP;
+               status = hcd_bus_suspend(hdev->bus);
+               if (status != 0) {
+                       dev_dbg(&hdev->dev, "'global' suspend %d\n", status);
+                       hub_activate(hub);
+               }
        }
-
-       /* stop khubd and related activity */
-       hub_quiesce(hub);
-       return 0;
+       return status;
 }
 
 static int hub_resume(struct usb_interface *intf)
index 8aca3574c2b5f4c715e5ea70052c0fea328695d7..74edaea5665d58367f6f62e48cec2d4a2b63313e 100644 (file)
@@ -1316,6 +1316,14 @@ static void release_interface(struct device *dev)
  * use this kind of configurability; many devices only have one
  * configuration.
  *
+ * @configuration is the value of the configuration to be installed.
+ * According to the USB spec (e.g. section 9.1.1.5), configuration values
+ * must be non-zero; a value of zero indicates that the device in
+ * unconfigured.  However some devices erroneously use 0 as one of their
+ * configuration values.  To help manage such devices, this routine will
+ * accept @configuration = -1 as indicating the device should be put in
+ * an unconfigured state.
+ *
  * USB device configurations may affect Linux interoperability,
  * power consumption and the functionality available.  For example,
  * the default configuration is limited to using 100mA of bus power,
@@ -1347,10 +1355,15 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
        struct usb_interface **new_interfaces = NULL;
        int n, nintf;
 
-       for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
-               if (dev->config[i].desc.bConfigurationValue == configuration) {
-                       cp = &dev->config[i];
-                       break;
+       if (configuration == -1)
+               configuration = 0;
+       else {
+               for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
+                       if (dev->config[i].desc.bConfigurationValue ==
+                                       configuration) {
+                               cp = &dev->config[i];
+                               break;
+                       }
                }
        }
        if ((!cp && configuration != 0))
@@ -1359,6 +1372,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
        /* The USB spec says configuration 0 means unconfigured.
         * But if a device includes a configuration numbered 0,
         * we will accept it as a correctly configured state.
+        * Use -1 if you really want to unconfigure the device.
         */
        if (cp && configuration == 0)
                dev_warn(&dev->dev, "config 0 descriptor??\n");
index 627a5a2fc9cf340e5320df56af3857b880ca3f5d..7f31a495a25d31f327f3bbf63239a9cd5d6a5349 100644 (file)
@@ -31,7 +31,7 @@ static struct usb_device_id whitelist_table [] = {
 { USB_DEVICE_INFO(7, 1, 3) },
 #endif
 
-#ifdef CONFIG_USB_CDCETHER
+#ifdef CONFIG_USB_NET_CDCETHER
 /* Linux-USB CDC Ethernet gadget */
 { USB_DEVICE(0x0525, 0xa4a1), },
 /* Linux-USB CDC Ethernet + RNDIS gadget */
index 4eaa0ee8e72f6186f8b5996631f57fd29f3e0b10..0edfbafd702cced2fcda7638f2002be4c055fb52 100644 (file)
@@ -63,7 +63,7 @@ set_bConfigurationValue(struct device *dev, struct device_attribute *attr,
        struct usb_device       *udev = to_usb_device(dev);
        int                     config, value;
 
-       if (sscanf(buf, "%u", &config) != 1 || config > 255)
+       if (sscanf(buf, "%d", &config) != 1 || config < -1 || config > 255)
                return -EINVAL;
        usb_lock_device(udev);
        value = usb_set_configuration(udev, config);
index 36b36e0175fc2bc50b3e75f6bb149d421e95de37..a4677802fb208dde66c4be9cd85500acfa9074e1 100644 (file)
@@ -784,7 +784,7 @@ static int at91_ep_set_halt(struct usb_ep *_ep, int value)
        return status;
 }
 
-static struct usb_ep_ops at91_ep_ops = {
+static const struct usb_ep_ops at91_ep_ops = {
        .enable         = at91_ep_enable,
        .disable        = at91_ep_disable,
        .alloc_request  = at91_ep_alloc_request,
@@ -912,7 +912,7 @@ static void pullup(struct at91_udc *udc, int is_on)
                at91_udp_write(udc, AT91_UDP_TXVC, 0);
                if (cpu_is_at91rm9200())
                        at91_set_gpio_value(udc->board.pullup_pin, 1);
-               else if (cpu_is_at91sam9260()) {
+               else if (cpu_is_at91sam9260() || cpu_is_at91sam9263()) {
                        u32     txvc = at91_udp_read(udc, AT91_UDP_TXVC);
 
                        txvc |= AT91_UDP_TXVC_PUON;
@@ -929,7 +929,7 @@ static void pullup(struct at91_udc *udc, int is_on)
                at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);
                if (cpu_is_at91rm9200())
                        at91_set_gpio_value(udc->board.pullup_pin, 0);
-               else if (cpu_is_at91sam9260()) {
+               else if (cpu_is_at91sam9260() || cpu_is_at91sam9263()) {
                        u32     txvc = at91_udp_read(udc, AT91_UDP_TXVC);
 
                        txvc &= ~AT91_UDP_TXVC_PUON;
@@ -1651,7 +1651,7 @@ static void at91udc_shutdown(struct platform_device *dev)
        pullup(platform_get_drvdata(dev), 0);
 }
 
-static int __devinit at91udc_probe(struct platform_device *pdev)
+static int __init at91udc_probe(struct platform_device *pdev)
 {
        struct device   *dev = &pdev->dev;
        struct at91_udc *udc;
@@ -1762,7 +1762,7 @@ fail0:
        return retval;
 }
 
-static int __devexit at91udc_remove(struct platform_device *pdev)
+static int __exit at91udc_remove(struct platform_device *pdev)
 {
        struct at91_udc *udc = platform_get_drvdata(pdev);
        struct resource *res;
@@ -1836,8 +1836,7 @@ static int at91udc_resume(struct platform_device *pdev)
 #endif
 
 static struct platform_driver at91_udc = {
-       .probe          = at91udc_probe,
-       .remove         = __devexit_p(at91udc_remove),
+       .remove         = __exit_p(at91udc_remove),
        .shutdown       = at91udc_shutdown,
        .suspend        = at91udc_suspend,
        .resume         = at91udc_resume,
@@ -1847,13 +1846,13 @@ static struct platform_driver at91_udc = {
        },
 };
 
-static int __devinit udc_init_module(void)
+static int __init udc_init_module(void)
 {
-       return platform_driver_register(&at91_udc);
+       return platform_driver_probe(&at91_udc, at91udc_probe);
 }
 module_init(udc_init_module);
 
-static void __devexit udc_exit_module(void)
+static void __exit udc_exit_module(void)
 {
        platform_driver_unregister(&at91_udc);
 }
index 27904a56494ba6c614e1e44fef49d01e559d431f..f01890dc87515493393dcbf1ea05a8dd0dcd418f 100644 (file)
@@ -155,7 +155,7 @@ static int is_vbus_present(void)
        struct pxa2xx_udc_mach_info             *mach = the_controller->mach;
 
        if (mach->gpio_vbus)
-               return pxa_gpio_get(mach->gpio_vbus);
+               return udc_gpio_get(mach->gpio_vbus);
        if (mach->udc_is_connected)
                return mach->udc_is_connected();
        return 1;
@@ -167,7 +167,7 @@ static void pullup_off(void)
        struct pxa2xx_udc_mach_info             *mach = the_controller->mach;
 
        if (mach->gpio_pullup)
-               pxa_gpio_set(mach->gpio_pullup, 0);
+               udc_gpio_set(mach->gpio_pullup, 0);
        else if (mach->udc_command)
                mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
 }
@@ -177,7 +177,7 @@ static void pullup_on(void)
        struct pxa2xx_udc_mach_info             *mach = the_controller->mach;
 
        if (mach->gpio_pullup)
-               pxa_gpio_set(mach->gpio_pullup, 1);
+               udc_gpio_set(mach->gpio_pullup, 1);
        else if (mach->udc_command)
                mach->udc_command(PXA2XX_UDC_CMD_CONNECT);
 }
@@ -1755,7 +1755,7 @@ lubbock_vbus_irq(int irq, void *_dev)
 static irqreturn_t udc_vbus_irq(int irq, void *_dev)
 {
        struct pxa2xx_udc       *dev = _dev;
-       int                     vbus = pxa_gpio_get(dev->mach->gpio_vbus);
+       int                     vbus = udc_gpio_get(dev->mach->gpio_vbus);
 
        pxa2xx_udc_vbus_session(&dev->gadget, vbus);
        return IRQ_HANDLED;
@@ -2545,15 +2545,13 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
        dev->dev = &pdev->dev;
        dev->mach = pdev->dev.platform_data;
        if (dev->mach->gpio_vbus) {
-               vbus_irq = IRQ_GPIO(dev->mach->gpio_vbus & GPIO_MD_MASK_NR);
-               pxa_gpio_mode((dev->mach->gpio_vbus & GPIO_MD_MASK_NR)
-                               | GPIO_IN);
+               udc_gpio_init_vbus(dev->mach->gpio_vbus);
+               vbus_irq = udc_gpio_to_irq(dev->mach->gpio_vbus);
                set_irq_type(vbus_irq, IRQT_BOTHEDGE);
        } else
                vbus_irq = 0;
        if (dev->mach->gpio_pullup)
-               pxa_gpio_mode((dev->mach->gpio_pullup & GPIO_MD_MASK_NR)
-                               | GPIO_OUT | GPIO_DFLT_LOW);
+               udc_gpio_init_pullup(dev->mach->gpio_pullup);
 
        init_timer(&dev->timer);
        dev->timer.function = udc_watchdog;
index 8e598c8bf4e388da20c6672b3a0f54a95e296e6e..773e549aff3f721eb1f7b0ace82b45ff51b4c470 100644 (file)
@@ -177,21 +177,6 @@ struct pxa2xx_udc {
 
 static struct pxa2xx_udc *the_controller;
 
-static inline int pxa_gpio_get(unsigned gpio)
-{
-       return (GPLR(gpio) & GPIO_bit(gpio)) != 0;
-}
-
-static inline void pxa_gpio_set(unsigned gpio, int is_on)
-{
-       int mask = GPIO_bit(gpio);
-
-       if (is_on)
-               GPSR(gpio) = mask;
-       else
-               GPCR(gpio) = mask;
-}
-
 /*-------------------------------------------------------------------------*/
 
 /*
index e6c19aa4bef3320be4d2d52d7070cac4da68e6d2..e552668d36b323a3ad06941cefe1c66a196b8353 100644 (file)
@@ -1699,6 +1699,7 @@ static int gs_setup_class(struct usb_gadget *gadget,
                        memcpy(&port->port_line_coding, req->buf, ret);
                        spin_unlock(&port->port_lock);
                }
+               ret = 0;
                break;
 
        case USB_CDC_REQ_GET_LINE_CODING:
index 185721dba42be006384012184eb38bf256b257c8..a740564882347c301fe1d2050bb9263261c3365c 100644 (file)
@@ -42,6 +42,9 @@
 #include <asm/irq.h>
 #include <asm/system.h>
 #include <asm/unaligned.h>
+#ifdef CONFIG_PPC_PS3
+#include <asm/firmware.h>
+#endif
 
 
 /*-------------------------------------------------------------------------*/
@@ -299,6 +302,19 @@ static void ehci_watchdog (unsigned long param)
        spin_unlock_irqrestore (&ehci->lock, flags);
 }
 
+/* On some systems, leaving remote wakeup enabled prevents system shutdown.
+ * The firmware seems to think that powering off is a wakeup event!
+ * This routine turns off remote wakeup and everything else, on all ports.
+ */
+static void ehci_turn_off_all_ports(struct ehci_hcd *ehci)
+{
+       int     port = HCS_N_PORTS(ehci->hcs_params);
+
+       while (port--)
+               ehci_writel(ehci, PORT_RWC_BITS,
+                               &ehci->regs->port_status[port]);
+}
+
 /* ehci_shutdown kick in for silicon on any bus (not just pci, etc).
  * This forcibly disables dma and IRQs, helping kexec and other cases
  * where the next system software may expect clean state.
@@ -310,9 +326,13 @@ ehci_shutdown (struct usb_hcd *hcd)
 
        ehci = hcd_to_ehci (hcd);
        (void) ehci_halt (ehci);
+       ehci_turn_off_all_ports(ehci);
 
        /* make BIOS/etc use companion controller during reboot */
        ehci_writel(ehci, 0, &ehci->regs->configured_flag);
+
+       /* unblock posted writes */
+       ehci_readl(ehci, &ehci->regs->configured_flag);
 }
 
 static void ehci_port_power (struct ehci_hcd *ehci, int is_on)
@@ -951,15 +971,18 @@ static int __init ehci_hcd_init(void)
 #endif
 
 #ifdef PS3_SYSTEM_BUS_DRIVER
-       retval = ps3_system_bus_driver_register(&PS3_SYSTEM_BUS_DRIVER);
-       if (retval < 0) {
+       if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
+               retval = ps3_system_bus_driver_register(
+                               &PS3_SYSTEM_BUS_DRIVER);
+               if (retval < 0) {
 #ifdef PLATFORM_DRIVER
-               platform_driver_unregister(&PLATFORM_DRIVER);
+                       platform_driver_unregister(&PLATFORM_DRIVER);
 #endif
 #ifdef PCI_DRIVER
-               pci_unregister_driver(&PCI_DRIVER);
+                       pci_unregister_driver(&PCI_DRIVER);
 #endif
-               return retval;
+                       return retval;
+               }
        }
 #endif
 
@@ -976,7 +999,8 @@ static void __exit ehci_hcd_cleanup(void)
        pci_unregister_driver(&PCI_DRIVER);
 #endif
 #ifdef PS3_SYSTEM_BUS_DRIVER
-       ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
+       if (firmware_has_feature(FW_FEATURE_PS3_LV1))
+               ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
 #endif
 }
 module_exit(ehci_hcd_cleanup);
index 0d83c6df1a3b2554272ed4680365cdfee09a4d4a..9af529d22b3e609ee8af02b5fa9fc5c03021f13a 100644 (file)
@@ -36,6 +36,8 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
        int                     port;
        int                     mask;
 
+       ehci_dbg(ehci, "suspend root hub\n");
+
        if (time_before (jiffies, ehci->next_statechange))
                msleep(5);
 
index 2718b5dc4ec1d9825cd0fe6a38fea384c17b1b4e..46873f2534b5d152d3b277e424a5c046ae402b3f 100644 (file)
@@ -1577,7 +1577,7 @@ static int isp116x_remove(struct platform_device *pdev)
 
 #define resource_len(r) (((r)->end - (r)->start) + 1)
 
-static int __init isp116x_probe(struct platform_device *pdev)
+static int __devinit isp116x_probe(struct platform_device *pdev)
 {
        struct usb_hcd *hcd;
        struct isp116x *isp116x;
index 930346487278e7598618cc16c62ebf8b62eccb0c..d849c809acbdca97394fa7b8dcd8225733a91f5a 100644 (file)
 #include <asm/mach-types.h>
 #include <asm/hardware.h>
 #include <asm/arch/board.h>
+#include <asm/arch/cpu.h>
 
 #ifndef CONFIG_ARCH_AT91
 #error "CONFIG_ARCH_AT91 must be defined."
 #endif
 
-/* interface and function clocks */
-static struct clk *iclk, *fclk;
+/* interface and function clocks; sometimes also an AHB clock */
+static struct clk *iclk, *fclk, *hclk;
 static int clocked;
 
 extern int usb_disabled(void);
 
 /*-------------------------------------------------------------------------*/
 
+static void at91_start_clock(void)
+{
+       if (cpu_is_at91sam9261())
+               clk_enable(hclk);
+       clk_enable(iclk);
+       clk_enable(fclk);
+       clocked = 1;
+}
+
+static void at91_stop_clock(void)
+{
+       clk_disable(fclk);
+       clk_disable(iclk);
+       if (cpu_is_at91sam9261())
+               clk_disable(hclk);
+       clocked = 0;
+}
+
 static void at91_start_hc(struct platform_device *pdev)
 {
        struct usb_hcd *hcd = platform_get_drvdata(pdev);
@@ -41,9 +60,7 @@ static void at91_start_hc(struct platform_device *pdev)
        /*
         * Start the USB clocks.
         */
-       clk_enable(iclk);
-       clk_enable(fclk);
-       clocked = 1;
+       at91_start_clock();
 
        /*
         * The USB host controller must remain in reset.
@@ -66,9 +83,7 @@ static void at91_stop_hc(struct platform_device *pdev)
        /*
         * Stop the USB clocks.
         */
-       clk_disable(fclk);
-       clk_disable(iclk);
-       clocked = 0;
+       at91_stop_clock();
 }
 
 
@@ -126,6 +141,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
 
        iclk = clk_get(&pdev->dev, "ohci_clk");
        fclk = clk_get(&pdev->dev, "uhpck");
+       if (cpu_is_at91sam9261())
+               hclk = clk_get(&pdev->dev, "hck0");
 
        at91_start_hc(pdev);
        ohci_hcd_init(hcd_to_ohci(hcd));
@@ -137,6 +154,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
        /* Error handling */
        at91_stop_hc(pdev);
 
+       if (cpu_is_at91sam9261())
+               clk_put(hclk);
        clk_put(fclk);
        clk_put(iclk);
 
@@ -171,9 +190,11 @@ static int usb_hcd_at91_remove(struct usb_hcd *hcd,
        iounmap(hcd->regs);
        release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
 
+       if (cpu_is_at91sam9261())
+               clk_put(hclk);
        clk_put(fclk);
        clk_put(iclk);
-       fclk = iclk = NULL;
+       fclk = iclk = hclk = NULL;
 
        dev_set_drvdata(&pdev->dev, NULL);
        return 0;
@@ -280,9 +301,7 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
         */
        if (at91_suspend_entering_slow_clock()) {
                ohci_usb_reset (ohci);
-               clk_disable(fclk);
-               clk_disable(iclk);
-               clocked = 0;
+               at91_stop_clock();
        }
 
        return 0;
@@ -295,11 +314,8 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
        if (device_may_wakeup(&pdev->dev))
                disable_irq_wake(hcd->irq);
 
-       if (!clocked) {
-               clk_enable(iclk);
-               clk_enable(fclk);
-               clocked = 1;
-       }
+       if (!clocked)
+               at91_start_clock();
 
        return 0;
 }
index fa6a7ceaa0db0a28330b0ff8c644d063538cf2fb..f0d29eda3c6da72ede3d82a2937e1d3ccbf98de8 100644 (file)
@@ -42,6 +42,9 @@
 #include <asm/system.h>
 #include <asm/unaligned.h>
 #include <asm/byteorder.h>
+#ifdef CONFIG_PPC_PS3
+#include <asm/firmware.h>
+#endif
 
 #include "../core/hcd.h"
 
@@ -944,9 +947,12 @@ static int __init ohci_hcd_mod_init(void)
                sizeof (struct ed), sizeof (struct td));
 
 #ifdef PS3_SYSTEM_BUS_DRIVER
-       retval = ps3_system_bus_driver_register(&PS3_SYSTEM_BUS_DRIVER);
-       if (retval < 0)
-               goto error_ps3;
+       if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
+               retval = ps3_system_bus_driver_register(
+                               &PS3_SYSTEM_BUS_DRIVER);
+               if (retval < 0)
+                       goto error_ps3;
+       }
 #endif
 
 #ifdef PLATFORM_DRIVER
@@ -992,7 +998,8 @@ static int __init ohci_hcd_mod_init(void)
  error_platform:
 #endif
 #ifdef PS3_SYSTEM_BUS_DRIVER
-       ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
+       if (firmware_has_feature(FW_FEATURE_PS3_LV1))
+               ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
  error_ps3:
 #endif
        return retval;
@@ -1014,7 +1021,8 @@ static void __exit ohci_hcd_mod_exit(void)
        platform_driver_unregister(&PLATFORM_DRIVER);
 #endif
 #ifdef PS3_SYSTEM_BUS_DRIVER
-       ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
+       if (firmware_has_feature(FW_FEATURE_PS3_LV1))
+               ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
 #endif
 }
 module_exit(ohci_hcd_mod_exit);
index 4d8ed3d71a15652ec21939d8b5803ddcfb0995c3..ef09952f20393aea387a031be84b45f3fcc6f99f 100644 (file)
@@ -515,6 +515,7 @@ void usbhid_close(struct hid_device *hid)
 
 #define USB_VENDOR_ID_TURBOX           0x062a
 #define USB_DEVICE_ID_TURBOX_KEYBOARD  0x0201
+#define USB_VENDOR_ID_CIDC             0x1677
 
 /*
  * Initialize all reports
@@ -548,7 +549,6 @@ void usbhid_init_reports(struct hid_device *hid)
 }
 
 #define USB_VENDOR_ID_GTCO             0x078c
-#define USB_VENDOR_ID_GTCO_IPANEL_2     0x5543
 #define USB_DEVICE_ID_GTCO_90          0x0090
 #define USB_DEVICE_ID_GTCO_100         0x0100
 #define USB_DEVICE_ID_GTCO_101         0x0101
@@ -594,8 +594,6 @@ void usbhid_init_reports(struct hid_device *hid)
 #define USB_DEVICE_ID_GTCO_1004                0x1004
 #define USB_DEVICE_ID_GTCO_1005                0x1005
 #define USB_DEVICE_ID_GTCO_1006                0x1006
-#define USB_DEVICE_ID_GTCO_8           0x0008
-#define USB_DEVICE_ID_GTCO_d            0x000d
 
 #define USB_VENDOR_ID_WACOM            0x056a
 
@@ -854,8 +852,6 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE },
@@ -953,6 +949,8 @@ static const struct hid_blacklist {
 
        { USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER, HID_QUIRK_SONY_PS3_CONTROLLER },
 
+       { USB_VENDOR_ID_CIDC, 0x0103, HID_QUIRK_IGNORE },
+
        { 0, 0 }
 };
 
index a74bf8617e7f3f11cbb67397e0bd6cef9b160483..4907e8b8007087b37a3141135312acd43b2b4f90 100644 (file)
@@ -88,6 +88,17 @@ config USB_LCD
          To compile this driver as a module, choose M here: the
          module will be called usblcd.
 
+config USB_BERRY_CHARGE
+       tristate "USB BlackBerry recharge support"
+       depends on USB
+       help
+         Say Y here if you want to connect a BlackBerry device to your
+         computer's USB port and have it automatically switch to "recharge"
+         mode.
+
+         To compile this driver as a module, choose M here: the
+         module will be called berry_charge.
+
 config USB_LED
        tristate "USB LED driver support"
        depends on USB
index 2cba07d31971abdef2483f0a4501e1e3e4b2e683..dac2d5b715666492aa75d446d4b2acd16bcef067 100644 (file)
@@ -6,6 +6,7 @@
 obj-$(CONFIG_USB_ADUTUX)       += adutux.o
 obj-$(CONFIG_USB_APPLEDISPLAY) += appledisplay.o
 obj-$(CONFIG_USB_AUERSWALD)    += auerswald.o
+obj-$(CONFIG_USB_BERRY_CHARGE) += berry_charge.o
 obj-$(CONFIG_USB_CYPRESS_CY7C63)+= cypress_cy7c63.o
 obj-$(CONFIG_USB_CYTHERM)      += cytherm.o
 obj-$(CONFIG_USB_EMI26)                += emi26.o
index 32f0e3a5b022390a8551c087855e5f11ad853fe3..e573c8ba978545d164095dc634407daf4f859c2a 100644 (file)
@@ -281,8 +281,8 @@ static int appledisplay_probe(struct usb_interface *iface,
        /* Register backlight device */
        snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
                atomic_inc_return(&count_displays) - 1);
-       pdata->bd = backlight_device_register(bl_name, NULL,
-               pdata, &appledisplay_bl_data);
+       pdata->bd = backlight_device_register(bl_name, NULL, pdata,
+                                               &appledisplay_bl_data);
        if (IS_ERR(pdata->bd)) {
                err("appledisplay: Backlight registration failed");
                goto error;
diff --git a/drivers/usb/misc/berry_charge.c b/drivers/usb/misc/berry_charge.c
new file mode 100644 (file)
index 0000000..60893c6
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * USB BlackBerry charging module
+ *
+ * Copyright (C) 2007 Greg Kroah-Hartman <gregkh@suse.de>
+ *
+ *     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.
+ *
+ * Information on how to switch configs was taken by the bcharge.cc file
+ * created by the barry.sf.net project.
+ *
+ * bcharge.cc has the following copyright:
+ *     Copyright (C) 2006, Net Direct Inc. (http://www.netdirect.ca/)
+ * and is released under the GPLv2.
+ *
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+
+#define RIM_VENDOR             0x0fca
+#define BLACKBERRY             0x0001
+
+static int debug;
+
+#ifdef dbg
+#undef dbg
+#endif
+#define dbg(dev, format, arg...)                               \
+       if (debug)                                              \
+               dev_printk(KERN_DEBUG , dev , format , ## arg)
+
+static struct usb_device_id id_table [] = {
+       { USB_DEVICE(RIM_VENDOR, BLACKBERRY) },
+       { },                                    /* Terminating entry */
+};
+MODULE_DEVICE_TABLE(usb, id_table);
+
+static int magic_charge(struct usb_device *udev)
+{
+       char *dummy_buffer = kzalloc(2, GFP_KERNEL);
+       int retval;
+
+       if (!dummy_buffer)
+               return -ENOMEM;
+
+       /* send two magic commands and then set the configuration.  The device
+        * will then reset itself with the new power usage and should start
+        * charging. */
+
+       /* Note, with testing, it only seems that the first message is really
+        * needed (at least for the 8700c), but to be safe, we emulate what
+        * other operating systems seem to be sending to their device.  We
+        * really need to get some specs for this device to be sure about what
+        * is going on here.
+        */
+       dbg(&udev->dev, "Sending first magic command\n");
+       retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+                                0xa5, 0xc0, 0, 1, dummy_buffer, 2, 100);
+       if (retval != 2) {
+               dev_err(&udev->dev, "First magic command failed: %d.\n",
+                       retval);
+               return retval;
+       }
+
+       dbg(&udev->dev, "Sending first magic command\n");
+       retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+                                0xa2, 0x40, 0, 1, dummy_buffer, 0, 100);
+       if (retval != 0) {
+               dev_err(&udev->dev, "Second magic command failed: %d.\n",
+                       retval);
+               return retval;
+       }
+
+       dbg(&udev->dev, "Calling set_configuration\n");
+       retval = usb_driver_set_configuration(udev, 1);
+       if (retval)
+               dev_err(&udev->dev, "Set Configuration failed :%d.\n", retval);
+
+       return retval;
+}
+
+static int berry_probe(struct usb_interface *intf,
+                      const struct usb_device_id *id)
+{
+       struct usb_device *udev = interface_to_usbdev(intf);
+
+       dbg(&udev->dev, "Power is set to %dmA\n",
+           udev->actconfig->desc.bMaxPower * 2);
+
+       /* check the power usage so we don't try to enable something that is
+        * already enabled */
+       if ((udev->actconfig->desc.bMaxPower * 2) == 500) {
+               dbg(&udev->dev, "device is already charging, power is "
+                   "set to %dmA\n", udev->actconfig->desc.bMaxPower * 2);
+               return -ENODEV;
+       }
+
+       /* turn the power on */
+       magic_charge(udev);
+
+       /* we don't really want to bind to the device, userspace programs can
+        * handle the syncing just fine, so get outta here. */
+       return -ENODEV;
+}
+
+static void berry_disconnect(struct usb_interface *intf)
+{
+}
+
+static struct usb_driver berry_driver = {
+       .name =         "berry_charge",
+       .probe =        berry_probe,
+       .disconnect =   berry_disconnect,
+       .id_table =     id_table,
+};
+
+static int __init berry_init(void)
+{
+       return usb_register(&berry_driver);
+}
+
+static void __exit berry_exit(void)
+{
+       usb_deregister(&berry_driver);
+}
+
+module_init(berry_init);
+module_exit(berry_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@suse.de>");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug enabled or not");
index a2b94ef512bce95551add149d0edc0ec9f7acd67..0f3d7dbb537f43dca627e3544606562c5ff07e16 100644 (file)
@@ -84,6 +84,7 @@ config USB_PEGASUS
 config USB_RTL8150
        tristate "USB RTL8150 based ethernet device support (EXPERIMENTAL)"
        depends on EXPERIMENTAL
+       select MII
        help
          Say Y here if you have RTL8150 based usb-ethernet adapter.
          Send me <petkan@users.sourceforge.net> any comments you may have.
@@ -98,7 +99,7 @@ config USB_USBNET_MII
 
 config USB_USBNET
        tristate "Multi-purpose USB Networking Framework"
-       select MII if USBNET_MII != n
+       select MII if USB_USBNET_MII != n
        ---help---
          This driver supports several kinds of network links over USB,
          with "minidrivers" built around a common network driver core
@@ -239,6 +240,7 @@ config USB_NET_RNDIS_HOST
 config USB_NET_CDC_SUBSET
        tristate "Simple USB Network Links (CDC Ethernet subset)"
        depends on USB_USBNET
+       default y
        help
          This driver module supports USB network devices that can work
          without any device-specific information.  Select it if you have
@@ -298,6 +300,13 @@ config USB_EPSON2888
          Choose this option to support the usb networking links used
          by some sample firmware from Epson.
 
+config USB_KC2190
+       boolean "KT Technology KC2190 based cables (InstaNet)"
+       depends on USB_NET_CDC_SUBSET && EXPERIMENTAL
+       help
+        Â Choose this option if you're using a host-to-host cable
+        Â with one of these chips.
+
 config USB_NET_ZAURUS
        tristate "Sharp Zaurus (stock ROMs) and compatible"
        depends on USB_USBNET
index bd357e178e557548b464ed4187055b3be54970d3..7ef2e4b5e39bf986d559854458df5d6ea5bd5257 100644 (file)
@@ -351,9 +351,11 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
 
        skb_push(skb, 4);
        packet_len = (((skb->len - 4) ^ 0x0000ffff) << 16) + (skb->len - 4);
+       cpu_to_le32s(&packet_len);
        memcpy(skb->data, &packet_len, sizeof(packet_len));
 
        if ((skb->len % 512) == 0) {
+               cpu_to_le32s(&padbytes);
                memcpy( skb->tail, &padbytes, sizeof(padbytes));
                skb_put(skb, sizeof(padbytes));
        }
index ae8fb06cf38e2d1eba4bb31267f489eb9366e2ab..bc62b012602b0a6a85bd6dda00d7702743b8a98e 100644 (file)
@@ -79,13 +79,19 @@ static int always_connected (struct usbnet *dev)
  *
  * ALi M5632 driver ... does high speed
  *
+ * NOTE that the MS-Windows drivers for this chip use some funky and
+ * (naturally) undocumented 7-byte prefix to each packet, so this is a
+ * case where we don't currently interoperate.  Also, once you unplug
+ * one end of the cable, you need to replug the other end too ... since
+ * chip docs are unavailable, there's no way to reset the relevant state
+ * short of a power cycle.
+ *
  *-------------------------------------------------------------------------*/
 
 static const struct driver_info        ali_m5632_info = {
        .description =  "ALi M5632",
 };
 
-
 #endif
 
 \f
@@ -159,6 +165,11 @@ static const struct driver_info    epson2888_info = {
 #endif /* CONFIG_USB_EPSON2888 */
 
 \f
+/*-------------------------------------------------------------------------
+ *
+ * info from Jonathan McDowell <noodles@earth.li>
+ *
+ *-------------------------------------------------------------------------*/
 #ifdef CONFIG_USB_KC2190
 #define HAVE_HARDWARE
 static const struct driver_info kc2190_info = {
@@ -223,6 +234,10 @@ static const struct usb_device_id  products [] = {
        USB_DEVICE (0x0402, 0x5632),    // ALi defaults
        .driver_info =  (unsigned long) &ali_m5632_info,
 },
+{
+       USB_DEVICE (0x182d,0x207c),     // SiteCom CN-124
+       .driver_info =  (unsigned long) &ali_m5632_info,
+},
 #endif
 
 #ifdef CONFIG_USB_AN2720
@@ -314,13 +329,13 @@ static struct usb_driver cdc_subset_driver = {
 
 static int __init cdc_subset_init(void)
 {
-       return usb_register(&cdc_subset_driver);
+       return usb_register(&cdc_subset_driver);
 }
 module_init(cdc_subset_init);
 
 static void __exit cdc_subset_exit(void)
 {
-       usb_deregister(&cdc_subset_driver);
+       usb_deregister(&cdc_subset_driver);
 }
 module_exit(cdc_subset_exit);
 
index 43ba61abfcc53283ad352973599b1dbdcf16fbfe..de69b183bd2f96d714a68f94c0bb07785d65c1d9 100644 (file)
@@ -147,7 +147,7 @@ int usbnet_get_endpoints(struct usbnet *dev, struct usb_interface *intf)
                if (tmp < 0)
                        return tmp;
        }
-       
+
        dev->in = usb_rcvbulkpipe (dev->udev,
                        in->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK);
        dev->out = usb_sndbulkpipe (dev->udev,
@@ -327,7 +327,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
        if (netif_running (dev->net)
                        && netif_device_present (dev->net)
                        && !test_bit (EVENT_RX_HALT, &dev->flags)) {
-               switch (retval = usb_submit_urb (urb, GFP_ATOMIC)){ 
+               switch (retval = usb_submit_urb (urb, GFP_ATOMIC)){
                case -EPIPE:
                        usbnet_defer_kevent (dev, EVENT_RX_HALT);
                        break;
@@ -443,7 +443,7 @@ block:
            case -EOVERFLOW:
                dev->stats.rx_over_errors++;
                // FALLTHROUGH
-           
+
            default:
                entry->state = rx_cleanup;
                dev->stats.rx_errors++;
@@ -560,7 +560,7 @@ static int usbnet_stop (struct net_device *net)
 
        if (netif_msg_ifdown (dev))
                devinfo (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld",
-                       dev->stats.rx_packets, dev->stats.tx_packets, 
+                       dev->stats.rx_packets, dev->stats.tx_packets,
                        dev->stats.rx_errors, dev->stats.tx_errors
                        );
 
@@ -578,7 +578,7 @@ static int usbnet_stop (struct net_device *net)
                        devdbg (dev, "waited for %d urb completions", temp);
        }
        dev->wait = NULL;
-       remove_wait_queue (&unlink_wakeup, &wait); 
+       remove_wait_queue (&unlink_wakeup, &wait);
 
        usb_kill_urb(dev->interrupt);
 
@@ -834,7 +834,7 @@ kevent (struct work_struct *work)
        }
 
        if (test_bit (EVENT_LINK_RESET, &dev->flags)) {
-               struct driver_info      *info = dev->driver_info;
+               struct driver_info      *info = dev->driver_info;
                int                     retval = 0;
 
                clear_bit (EVENT_LINK_RESET, &dev->flags);
@@ -1066,7 +1066,7 @@ static void usbnet_bh (unsigned long param)
  * USB Device Driver support
  *
  *-------------------------------------------------------------------------*/
+
 // precondition: never called in_interrupt
 
 void usbnet_disconnect (struct usb_interface *intf)
@@ -1087,7 +1087,7 @@ void usbnet_disconnect (struct usb_interface *intf)
                        intf->dev.driver->name,
                        xdev->bus->bus_name, xdev->devpath,
                        dev->driver_info->description);
-       
+
        net = dev->net;
        unregister_netdev (net);
 
@@ -1111,7 +1111,7 @@ int
 usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 {
        struct usbnet                   *dev;
-       struct net_device               *net;
+       struct net_device               *net;
        struct usb_host_interface       *interface;
        struct driver_info              *info;
        struct usb_device               *xdev;
@@ -1181,6 +1181,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
        // NOTE net->name still not usable ...
        if (info->bind) {
                status = info->bind (dev, udev);
+               if (status < 0)
+                       goto out1;
+
                // heuristic:  "usb%d" for links we know are two-host,
                // else "eth%d" when there's reasonable doubt.  userspace
                // can rename the link if it knows better.
@@ -1207,12 +1210,12 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
        if (status == 0 && dev->status)
                status = init_status (dev, udev);
        if (status < 0)
-               goto out1;
+               goto out3;
 
        if (!dev->rx_urb_size)
                dev->rx_urb_size = dev->hard_mtu;
        dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
-       
+
        SET_NETDEV_DEV(net, &udev->dev);
        status = register_netdev (net);
        if (status)
@@ -1255,7 +1258,7 @@ EXPORT_SYMBOL_GPL(usbnet_probe);
 int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
 {
        struct usbnet           *dev = usb_get_intfdata(intf);
-       
+
        /* accelerate emptying of the rx and queues, to avoid
         * having everything error out.
         */
@@ -1286,7 +1289,7 @@ static int __init usbnet_init(void)
                        < sizeof (struct skb_data));
 
        random_ether_addr(node_id);
-       return 0;
+       return 0;
 }
 module_init(usbnet_init);
 
index 0af42e32fa0a9d1673940e0fe4155d62d9d00447..18816bf96a4d6152da19a062c5f21d3247eaca60 100644 (file)
@@ -58,11 +58,6 @@ static void airprime_read_bulk_callback(struct urb *urb)
        if (urb->status) {
                dbg("%s - nonzero read bulk status received: %d",
                    __FUNCTION__, urb->status);
-               /* something happened, so free up the memory for this urb */
-               if (urb->transfer_buffer) {
-                       kfree (urb->transfer_buffer);
-                       urb->transfer_buffer = NULL;
-               }
                return;
        }
        usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
@@ -146,6 +141,8 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp)
                                  airprime_read_bulk_callback, port);
                result = usb_submit_urb(urb, GFP_KERNEL);
                if (result) {
+                       usb_free_urb(urb);
+                       kfree(buffer);
                        dev_err(&port->dev,
                                "%s - failed submitting read urb %d for port %d, error %d\n",
                                __FUNCTION__, i, port->number, result);
@@ -160,27 +157,12 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp)
        /* some error happened, cancel any submitted urbs and clean up anything that
           got allocated successfully */
 
-       for ( ; i >= 0; --i) {
+       while (i-- != 0) {
                urb = priv->read_urbp[i];
-               if (urb) {
-                       /* This urb was submitted successfully. So we have to
-                          cancel it.
-                          Unlinking the urb will invoke read_bulk_callback()
-                          with an error status, so its transfer buffer will
-                          be freed there */
-                       if (usb_unlink_urb (urb) != -EINPROGRESS) {
-                               /* comments in drivers/usb/core/urb.c say this
-                                  can only happen if the urb was never submitted,
-                                  or has completed already.
-                                  Either way we may have to free the transfer
-                                  buffer here. */
-                               if (urb->transfer_buffer) {
-                                       kfree (urb->transfer_buffer);
-                                       urb->transfer_buffer = NULL;
-                               }
-                       }
-                       usb_free_urb (urb);
-               }
+               buffer = urb->transfer_buffer;
+               usb_kill_urb (urb);
+               usb_free_urb (urb);
+               kfree (buffer);
        }
 
  out:
@@ -194,10 +176,9 @@ static void airprime_close(struct usb_serial_port *port, struct file * filp)
 
        dbg("%s - port %d", __FUNCTION__, port->number);
 
-       /* killing the urb will invoke read_bulk_callback() with an error status,
-          so the transfer buffer will be freed there */
        for (i = 0; i < NUM_READ_URBS; ++i) {
                usb_kill_urb (priv->read_urbp[i]);
+               kfree (priv->read_urbp[i]->transfer_buffer);
                usb_free_urb (priv->read_urbp[i]);
        }
 
index 3ec24870bca995edfd1c180ae7f1781c452ada5e..db623e754899859bc88e043a23ee593bdd3a14cf 100644 (file)
@@ -69,6 +69,7 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */
        { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
        { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
+       { USB_DEVICE(0x10C5, 0xEA61) }, /* Silicon Labs MobiData GPRS USB Modem */
        { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */
        { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */
        { } /* Terminating Entry */
index 601e0648dec68fbaaa4ecc10e3306820ed9ae154..53baeec8f265a041bc45ae3a3010cd6c30d71c7d 100644 (file)
@@ -66,6 +66,8 @@ struct usb_serial_driver usb_serial_generic_device = {
        .num_bulk_out =         NUM_DONT_CARE,
        .num_ports =            1,
        .shutdown =             usb_serial_generic_shutdown,
+       .throttle =             usb_serial_generic_throttle,
+       .unthrottle =           usb_serial_generic_unthrottle,
 };
 
 static int generic_probe(struct usb_interface *interface,
@@ -115,6 +117,7 @@ int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp)
 {
        struct usb_serial *serial = port->serial;
        int result = 0;
+       unsigned long flags;
 
        dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -124,7 +127,13 @@ int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp)
        if (port->tty)
                port->tty->low_latency = 1;
 
-       /* if we have a bulk interrupt, start reading from it */
+       /* clear the throttle flags */
+       spin_lock_irqsave(&port->lock, flags);
+       port->throttled = 0;
+       port->throttle_req = 0;
+       spin_unlock_irqrestore(&port->lock, flags);
+
+       /* if we have a bulk endpoint, start reading from it */
        if (serial->num_bulk_in) {
                /* Start reading from the device */
                usb_fill_bulk_urb (port->read_urb, serial->dev,
@@ -253,31 +262,22 @@ int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port)
        return (chars);
 }
 
-void usb_serial_generic_read_bulk_callback (struct urb *urb)
+/* Push data to tty layer and resubmit the bulk read URB */
+static void flush_and_resubmit_read_urb (struct usb_serial_port *port)
 {
-       struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
        struct usb_serial *serial = port->serial;
-       struct tty_struct *tty;
-       unsigned char *data = urb->transfer_buffer;
+       struct urb *urb = port->read_urb;
+       struct tty_struct *tty = port->tty;
        int result;
 
-       dbg("%s - port %d", __FUNCTION__, port->number);
-
-       if (urb->status) {
-               dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
-               return;
-       }
-
-       usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
-
-       tty = port->tty;
+       /* Push data to tty */
        if (tty && urb->actual_length) {
                tty_buffer_request_room(tty, urb->actual_length);
-               tty_insert_flip_string(tty, data, urb->actual_length);
-               tty_flip_buffer_push(tty);
+               tty_insert_flip_string(tty, urb->transfer_buffer, urb->actual_length);
+               tty_flip_buffer_push(tty); /* is this allowed from an URB callback ? */
        }
 
-       /* Continue trying to always read  */
+       /* Continue reading from device */
        usb_fill_bulk_urb (port->read_urb, serial->dev,
                           usb_rcvbulkpipe (serial->dev,
                                            port->bulk_in_endpointAddress),
@@ -290,6 +290,40 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb)
        if (result)
                dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
 }
+
+void usb_serial_generic_read_bulk_callback (struct urb *urb)
+{
+       struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
+       unsigned char *data = urb->transfer_buffer;
+       int is_throttled;
+       unsigned long flags;
+
+       dbg("%s - port %d", __FUNCTION__, port->number);
+
+       if (urb->status) {
+               dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
+               return;
+       }
+
+       usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
+
+       /* Throttle the device if requested by tty */
+       if (urb->actual_length) {
+               spin_lock_irqsave(&port->lock, flags);
+               is_throttled = port->throttled = port->throttle_req;
+               spin_unlock_irqrestore(&port->lock, flags);
+               if (is_throttled) {
+                       /* Let the received data linger in the read URB;
+                        * usb_serial_generic_unthrottle() will pick it
+                        * up later. */
+                       dbg("%s - throttling device", __FUNCTION__);
+                       return;
+               }
+       }
+
+       /* Handle data and continue reading from device */
+       flush_and_resubmit_read_urb(port);
+}
 EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback);
 
 void usb_serial_generic_write_bulk_callback (struct urb *urb)
@@ -308,6 +342,38 @@ void usb_serial_generic_write_bulk_callback (struct urb *urb)
 }
 EXPORT_SYMBOL_GPL(usb_serial_generic_write_bulk_callback);
 
+void usb_serial_generic_throttle (struct usb_serial_port *port)
+{
+       unsigned long flags;
+
+       dbg("%s - port %d", __FUNCTION__, port->number);
+
+       /* Set the throttle request flag. It will be picked up
+        * by usb_serial_generic_read_bulk_callback(). */
+       spin_lock_irqsave(&port->lock, flags);
+       port->throttle_req = 1;
+       spin_unlock_irqrestore(&port->lock, flags);
+}
+
+void usb_serial_generic_unthrottle (struct usb_serial_port *port)
+{
+       int was_throttled;
+       unsigned long flags;
+
+       dbg("%s - port %d", __FUNCTION__, port->number);
+
+       /* Clear the throttle flags */
+       spin_lock_irqsave(&port->lock, flags);
+       was_throttled = port->throttled;
+       port->throttled = port->throttle_req = 0;
+       spin_unlock_irqrestore(&port->lock, flags);
+
+       if (was_throttled) {
+               /* Handle pending data and resume reading from device */
+               flush_and_resubmit_read_urb(port);
+       }
+}
+
 void usb_serial_generic_shutdown (struct usb_serial *serial)
 {
        int i;
index ced9f32b29d9eb0a5f30b715e98e1318153aed65..9963a8b758401aed14435230348c8f9a07e41fab 100644 (file)
@@ -69,7 +69,6 @@ static int  option_send_setup(struct usb_serial_port *port);
 /* Vendor and product IDs */
 #define OPTION_VENDOR_ID                0x0AF0
 #define HUAWEI_VENDOR_ID                0x12D1
-#define AUDIOVOX_VENDOR_ID              0x0F3D
 #define NOVATELWIRELESS_VENDOR_ID       0x1410
 #define ANYDATA_VENDOR_ID               0x16d5
 
@@ -81,7 +80,6 @@ static int  option_send_setup(struct usb_serial_port *port);
 #define OPTION_PRODUCT_GTMAX36          0x6701
 #define HUAWEI_PRODUCT_E600             0x1001
 #define HUAWEI_PRODUCT_E220             0x1003
-#define AUDIOVOX_PRODUCT_AIRCARD        0x0112
 #define NOVATELWIRELESS_PRODUCT_U740    0x1400
 #define ANYDATA_PRODUCT_ID              0x6501
 
@@ -94,7 +92,6 @@ static struct usb_device_id option_ids[] = {
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) },
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) },
-       { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },
        { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },
        { } /* Terminating entry */
@@ -109,7 +106,6 @@ static struct usb_device_id option_ids1[] = {
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) },
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) },
-       { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },
        { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },
        { } /* Terminating entry */
index 6c083d4e2c9b854b9f0f73dc3b0edac29e1eec81..83dfae93a45db37278ee130e3b99fb30a2328a23 100644 (file)
@@ -83,6 +83,7 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(BELKIN_VENDOR_ID, BELKIN_PRODUCT_ID) },
        { USB_DEVICE(ALCOR_VENDOR_ID, ALCOR_PRODUCT_ID) },
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ID) },
+       { USB_DEVICE(WS002IN_VENDOR_ID, WS002IN_PRODUCT_ID) },
        { }                                     /* Terminating entry */
 };
 
index 65a5039665e71d31610d5d73645321dd6389b0f0..f9a71d0c102e7c54cafd3edb7747dbf5ceea0eb9 100644 (file)
@@ -97,3 +97,8 @@
 /* Huawei E620 UMTS/HSDPA card (ID: 12d1:1001) */
 #define HUAWEI_VENDOR_ID       0x12d1
 #define HUAWEI_PRODUCT_ID      0x1001
+
+/* Willcom WS002IN Data Driver (by NetIndex Inc.) */
+#define WS002IN_VENDOR_ID      0x11f6
+#define WS002IN_PRODUCT_ID     0x2001
+
index 70234f5dbeeb473f60ab08da59e07438a1977033..e227f64d5641be64dc009c34da147be8c0a61a69 100644 (file)
@@ -153,6 +153,12 @@ static int slave_configure(struct scsi_device *sdev)
                if (us->flags & US_FL_FIX_CAPACITY)
                        sdev->fix_capacity = 1;
 
+               /* A few disks have two indistinguishable version, one of
+                * which reports the correct capacity and the other does not.
+                * The sd driver has to guess which is the case. */
+               if (us->flags & US_FL_CAPACITY_HEURISTICS)
+                       sdev->guess_capacity = 1;
+
                /* Some devices report a SCSI revision level above 2 but are
                 * unable to handle the REPORT LUNS command (for which
                 * support is mandatory at level 3).  Since we already have
index f49a62fc32d2cfe0daf546027c43f59693d6c2a9..9644a8ea4aa71adfe794abf9cc75bdae12122b98 100644 (file)
@@ -1101,6 +1101,15 @@ UNUSUAL_DEV(  0x08bd, 0x1100, 0x0000, 0x0000,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_SINGLE_LUN),
 
+/* Submitted by Dylan Taft <d13f00l@gmail.com>
+ * US_FL_IGNORE_RESIDUE Needed
+ */
+UNUSUAL_DEV(  0x08ca, 0x3103, 0x0100, 0x0100,
+                "AIPTEK",
+                "Aiptek USB Keychain MP3 Player",
+                US_SC_DEVICE, US_PR_DEVICE, NULL,
+                US_FL_IGNORE_RESIDUE),
+
 /* Entry needed for flags. Moreover, all devices with this ID use
  * bulk-only transport, but _some_ falsely report Control/Bulk instead.
  * One example is "Trumpion Digital Research MYMP3".
@@ -1311,12 +1320,13 @@ UNUSUAL_DEV(  0x0fce, 0xd008, 0x0000, 0x0000,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_NO_WP_DETECT ),
 
-/* Reported by Jan Mate <mate@fiit.stuba.sk> */
+/* Reported by Jan Mate <mate@fiit.stuba.sk>
+ * and by Soeren Sonnenburg <kernel@nn7.de> */
 UNUSUAL_DEV(  0x0fce, 0xe030, 0x0000, 0x0000,
                "Sony Ericsson",
                "P990i",
                US_SC_DEVICE, US_PR_DEVICE, NULL,
-               US_FL_FIX_CAPACITY ),
+               US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ),
 
 /* Reported by Emmanuel Vasilakis <evas@forthnet.gr> */
 UNUSUAL_DEV(  0x0fce, 0xe031, 0x0000, 0x0000,
@@ -1385,6 +1395,16 @@ UNUSUAL_DEV(  0x1652, 0x6600, 0x0201, 0x0201,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE ),
 
+/* Reported by Thomas Baechler <thomas@archlinux.org>
+ * Fixes I/O errors with Teac HD-35PU devices
+ */
+
+UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201,
+               "Super Top",
+               "USB 2.0  IDE DEVICE",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_IGNORE_RESIDUE),
+
 /* patch submitted by Davide Perini <perini.davide@dpsoftware.org>
  * and Renato Perini <rperini@email.it>
  */
@@ -1423,7 +1443,7 @@ UNUSUAL_DEV(  0xed06, 0x4500, 0x0001, 0x0001,
                "DataStor",
                "USB4500 FW1.04",
                US_SC_DEVICE, US_PR_DEVICE, NULL,
-               US_FL_FIX_CAPACITY),
+               US_FL_CAPACITY_HEURISTICS),
 
 /* Control/Bulk transport for all SubClass values */
 USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR),
index 296b091cf168c7e460ec70db19ac7dcc18a777c1..46929a1b6f24e44ba8566c46d0db993dfd113439 100644 (file)
@@ -90,13 +90,15 @@ static int skel_open(struct inode *inode, struct file *file)
                goto exit;
        }
 
+       /* increment our usage count for the device */
+       kref_get(&dev->kref);
+
        /* prevent the device from being autosuspended */
        retval = usb_autopm_get_interface(interface);
-       if (retval)
+       if (retval) {
+               kref_put(&dev->kref, skel_delete);
                goto exit;
-
-       /* increment our usage count for the device */
-       kref_get(&dev->kref);
+       }
 
        /* save our object in the file's private structure */
        file->private_data = dev;
index 8d130cc8532248893f2bf5e9af3cf152ad08d3b5..682f928b7f4d09e1950ff185f0447dea0869a466 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/pagemap.h>
+#include <linux/namei.h>
 #include <linux/debugfs.h>
 
 static ssize_t default_read_file(struct file *file, char __user *buf,
@@ -44,6 +45,17 @@ const struct file_operations debugfs_file_operations = {
        .open =         default_open,
 };
 
+static void *debugfs_follow_link(struct dentry *dentry, struct nameidata *nd)
+{
+       nd_set_link(nd, dentry->d_inode->i_private);
+       return NULL;
+}
+
+const struct inode_operations debugfs_link_operations = {
+       .readlink       = generic_readlink,
+       .follow_link    = debugfs_follow_link,
+};
+
 static void debugfs_u8_set(void *data, u64 val)
 {
        *(u8 *)data = val;
index c692487346eaa324fb1f1d5950a4af5a5503d184..7b324cfebcb1e3782a9b1a329e54ffd2aec5a795 100644 (file)
 #include <linux/namei.h>
 #include <linux/debugfs.h>
 #include <linux/fsnotify.h>
+#include <linux/string.h>
 
 #define DEBUGFS_MAGIC  0x64626720
 
 /* declared over in file.c */
 extern struct file_operations debugfs_file_operations;
+extern struct inode_operations debugfs_link_operations;
 
 static struct vfsmount *debugfs_mount;
 static int debugfs_mount_count;
@@ -51,6 +53,9 @@ static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t d
                case S_IFREG:
                        inode->i_fop = &debugfs_file_operations;
                        break;
+               case S_IFLNK:
+                       inode->i_op = &debugfs_link_operations;
+                       break;
                case S_IFDIR:
                        inode->i_op = &simple_dir_inode_operations;
                        inode->i_fop = &simple_dir_operations;
@@ -96,6 +101,12 @@ static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        return res;
 }
 
+static int debugfs_link(struct inode *dir, struct dentry *dentry, int mode)
+{
+       mode = (mode & S_IALLUGO) | S_IFLNK;
+       return debugfs_mknod(dir, dentry, mode, 0);
+}
+
 static int debugfs_create(struct inode *dir, struct dentry *dentry, int mode)
 {
        int res;
@@ -158,10 +169,17 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
        mutex_lock(&parent->d_inode->i_mutex);
        *dentry = lookup_one_len(name, parent, strlen(name));
        if (!IS_ERR(*dentry)) {
-               if ((mode & S_IFMT) == S_IFDIR)
+               switch (mode & S_IFMT) {
+               case S_IFDIR:
                        error = debugfs_mkdir(parent->d_inode, *dentry, mode);
-               else 
+                       break;
+               case S_IFLNK:
+                       error = debugfs_link(parent->d_inode, *dentry, mode);
+                       break;
+               default:
                        error = debugfs_create(parent->d_inode, *dentry, mode);
+                       break;
+               }
                dput(*dentry);
        } else
                error = PTR_ERR(*dentry);
@@ -194,9 +212,7 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
  * you are responsible here.)  If an error occurs, %NULL will be returned.
  *
  * If debugfs is not enabled in the kernel, the value -%ENODEV will be
- * returned.  It is not wise to check for this value, but rather, check for
- * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
- * code.
+ * returned.
  */
 struct dentry *debugfs_create_file(const char *name, mode_t mode,
                                   struct dentry *parent, void *data,
@@ -246,9 +262,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_file);
  * you are responsible here.)  If an error occurs, %NULL will be returned.
  *
  * If debugfs is not enabled in the kernel, the value -%ENODEV will be
- * returned.  It is not wise to check for this value, but rather, check for
- * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
- * code.
+ * returned.
  */
 struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
 {
@@ -258,6 +272,47 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
 }
 EXPORT_SYMBOL_GPL(debugfs_create_dir);
 
+/**
+ * debugfs_create_symlink- create a symbolic link in the debugfs filesystem
+ * @name: a pointer to a string containing the name of the symbolic link to
+ *        create.
+ * @parent: a pointer to the parent dentry for this symbolic link.  This
+ *          should be a directory dentry if set.  If this paramater is NULL,
+ *          then the symbolic link will be created in the root of the debugfs
+ *          filesystem.
+ * @target: a pointer to a string containing the path to the target of the
+ *          symbolic link.
+ *
+ * This function creates a symbolic link with the given name in debugfs that
+ * links to the given target path.
+ *
+ * This function will return a pointer to a dentry if it succeeds.  This
+ * pointer must be passed to the debugfs_remove() function when the symbolic
+ * link is to be removed (no automatic cleanup happens if your module is
+ * unloaded, you are responsible here.)  If an error occurs, %NULL will be
+ * returned.
+ *
+ * If debugfs is not enabled in the kernel, the value -%ENODEV will be
+ * returned.
+ */
+struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
+                                     const char *target)
+{
+       struct dentry *result;
+       char *link;
+
+       link = kstrdup(target, GFP_KERNEL);
+       if (!link)
+               return NULL;
+
+       result = debugfs_create_file(name, S_IFLNK | S_IRWXUGO, parent, link,
+                                    NULL);
+       if (!result)
+               kfree(link);
+       return result;
+}
+EXPORT_SYMBOL_GPL(debugfs_create_symlink);
+
 /**
  * debugfs_remove - removes a file or directory from the debugfs filesystem
  * @dentry: a pointer to a the dentry of the file or directory to be
@@ -287,15 +342,22 @@ void debugfs_remove(struct dentry *dentry)
        if (debugfs_positive(dentry)) {
                if (dentry->d_inode) {
                        dget(dentry);
-                       if (S_ISDIR(dentry->d_inode->i_mode)) {
+                       switch (dentry->d_inode->i_mode & S_IFMT) {
+                       case S_IFDIR:
                                ret = simple_rmdir(parent->d_inode, dentry);
                                if (ret)
                                        printk(KERN_ERR
                                                "DebugFS rmdir on %s failed : "
                                                "directory not empty.\n",
                                                dentry->d_name.name);
-                       } else
+                               break;
+                       case S_IFLNK:
+                               kfree(dentry->d_inode->i_private);
+                               /* fall through */
+                       default:
                                simple_unlink(parent->d_inode, dentry);
+                               break;
+                       }
                        if (!ret)
                                d_delete(dentry);
                        dput(dentry);
index ac32a2e8540c4fb2ac34c1c27286f1a0d624fbd1..22d38ffc9ef0b892c65e8c380f6f6682bacb398a 100644 (file)
@@ -358,8 +358,7 @@ void delete_partition(struct gendisk *disk, int part)
        p->ios[0] = p->ios[1] = 0;
        p->sectors[0] = p->sectors[1] = 0;
        sysfs_remove_link(&p->kobj, "subsystem");
-       if (p->holder_dir)
-               kobject_unregister(p->holder_dir);
+       kobject_unregister(p->holder_dir);
        kobject_uevent(&p->kobj, KOBJ_REMOVE);
        kobject_del(&p->kobj);
        kobject_put(&p->kobj);
@@ -603,10 +602,8 @@ void del_gendisk(struct gendisk *disk)
        disk->stamp = 0;
 
        kobject_uevent(&disk->kobj, KOBJ_REMOVE);
-       if (disk->holder_dir)
-               kobject_unregister(disk->holder_dir);
-       if (disk->slave_dir)
-               kobject_unregister(disk->slave_dir);
+       kobject_unregister(disk->holder_dir);
+       kobject_unregister(disk->slave_dir);
        if (disk->driverfs_dev) {
                char *disk_name = make_block_name(disk);
                sysfs_remove_link(&disk->kobj, "device");
index c0e117649a4dd4dd1bc06f47ebfa22941f9bf866..98b0910ad80c43795456d56bd061966499bf7fa7 100644 (file)
@@ -54,7 +54,7 @@ static struct sysfs_ops subsys_sysfs_ops = {
 /**
  *     add_to_collection - add buffer to a collection
  *     @buffer:        buffer to be added
- *     @node           inode of set to add to
+ *     @node:          inode of set to add to
  */
 
 static inline void
index ce7c9d653910598c29cce2baa2dcbb28b8cbb83b..73967c8152d325012db1f690f9cd6744caec2f76 100644 (file)
@@ -253,7 +253,8 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 
 void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread);
 
-void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc);
+void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc,
+                         struct acpi_thread_state *thread);
 
 /*
  * exprep - ACPI AML execution - prep utilities
index 04e9735a674214fb49aab10f3b75d273e3f44e0d..5206d61d74a6039eac0852145eb956b842554d6a 100644 (file)
@@ -155,7 +155,7 @@ struct acpi_object_event {
 struct acpi_object_mutex {
        ACPI_OBJECT_COMMON_HEADER u8 sync_level;        /* 0-15, specified in Mutex() call */
        u16 acquisition_depth;  /* Allow multiple Acquires, same thread */
-       struct acpi_thread_state *owner_thread; /* Current owner of the mutex */
+       acpi_thread_id owner_thread_id; /* Current owner of the mutex */
        acpi_mutex os_mutex;    /* Actual OS synchronization object */
        union acpi_operand_object *prev;        /* Link for list of acquired mutexes */
        union acpi_operand_object *next;        /* Link for list of acquired mutexes */
index 4dc8a5043ef033fd35042be6ad0999233c8db0ad..f6275b0e66dd34bbd5e3fde2be186eeda43ebba4 100644 (file)
@@ -105,12 +105,6 @@ int acpi_ec_ecdt_probe(void);
 
 int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
 
-/* --------------------------------------------------------------------------
-                                    Hot Keys
-   -------------------------------------------------------------------------- */
-
-extern int acpi_specific_hotkey_enabled;
-
 /*--------------------------------------------------------------------------
                                   Dock Station
   -------------------------------------------------------------------------- */
@@ -122,10 +116,34 @@ extern int register_hotplug_dock_device(acpi_handle handle,
        acpi_notify_handler handler, void *context);
 extern void unregister_hotplug_dock_device(acpi_handle handle);
 #else
-#define is_dock_device(h)                      (0)
-#define register_dock_notifier(nb)             (-ENODEV)
-#define unregister_dock_notifier(nb)                   do { } while(0)
-#define register_hotplug_dock_device(h1, h2, c)        (-ENODEV)
-#define unregister_hotplug_dock_device(h)       do { } while(0)
+static inline int is_dock_device(acpi_handle handle)
+{
+       return 0;
+}
+static inline int register_dock_notifier(struct notifier_block *nb)
+{
+       return -ENODEV;
+}
+static inline void unregister_dock_notifier(struct notifier_block *nb)
+{
+}
+static inline int register_hotplug_dock_device(acpi_handle handle,
+                               acpi_notify_handler handler, void *context)
+{
+       return -ENODEV;
+}
+static inline void unregister_hotplug_dock_device(acpi_handle handle)
+{
+}
+#endif
+
+/*--------------------------------------------------------------------------
+                                  Suspend/Resume
+  -------------------------------------------------------------------------- */
+#ifdef CONFIG_ACPI_SLEEP
+extern int acpi_sleep_init(void);
+#else
+#define acpi_sleep_init() do {} while (0)
 #endif
+
 #endif /*__ACPI_DRIVERS_H__*/
index 781394b9efe0b630621e246450f4bc575f754b94..2785058c82ab0621991b54a243473e49ff3bc2a8 100644 (file)
@@ -240,12 +240,6 @@ acpi_status
 acpi_os_validate_address(u8 space_id,
                         acpi_physical_address address, acpi_size length);
 
-u8 acpi_os_readable(void *pointer, acpi_size length);
-
-#ifdef ACPI_FUTURE_USAGE
-u8 acpi_os_writable(void *pointer, acpi_size length);
-#endif
-
 u64 acpi_os_get_timer(void);
 
 acpi_status acpi_os_signal(u32 function, void *info);
diff --git a/include/asm-arm/.gitignore b/include/asm-arm/.gitignore
new file mode 100644 (file)
index 0000000..e02c15d
--- /dev/null
@@ -0,0 +1,2 @@
+arch
+mach-types.h
diff --git a/include/asm-arm/arch-at91/at91_aic.h b/include/asm-arm/arch-at91/at91_aic.h
new file mode 100644 (file)
index 0000000..df44c12
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * include/asm-arm/arch-at91/at91_aic.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Advanced Interrupt Controller (AIC) - System peripherals registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91_AIC_H
+#define AT91_AIC_H
+
+#define AT91_AIC_SMR(n)                (AT91_AIC + ((n) * 4))  /* Source Mode Registers 0-31 */
+#define                AT91_AIC_PRIOR          (7 << 0)                /* Priority Level */
+#define                AT91_AIC_SRCTYPE        (3 << 5)                /* Interrupt Source Type */
+#define                        AT91_AIC_SRCTYPE_LOW            (0 << 5)
+#define                        AT91_AIC_SRCTYPE_FALLING        (1 << 5)
+#define                        AT91_AIC_SRCTYPE_HIGH           (2 << 5)
+#define                        AT91_AIC_SRCTYPE_RISING         (3 << 5)
+
+#define AT91_AIC_SVR(n)                (AT91_AIC + 0x80 + ((n) * 4))   /* Source Vector Registers 0-31 */
+#define AT91_AIC_IVR           (AT91_AIC + 0x100)      /* Interrupt Vector Register */
+#define AT91_AIC_FVR           (AT91_AIC + 0x104)      /* Fast Interrupt Vector Register */
+#define AT91_AIC_ISR           (AT91_AIC + 0x108)      /* Interrupt Status Register */
+#define                AT91_AIC_IRQID          (0x1f << 0)             /* Current Interrupt Identifier */
+
+#define AT91_AIC_IPR           (AT91_AIC + 0x10c)      /* Interrupt Pending Register */
+#define AT91_AIC_IMR           (AT91_AIC + 0x110)      /* Interrupt Mask Register */
+#define AT91_AIC_CISR          (AT91_AIC + 0x114)      /* Core Interrupt Status Register */
+#define                AT91_AIC_NFIQ           (1 << 0)                /* nFIQ Status */
+#define                AT91_AIC_NIRQ           (1 << 1)                /* nIRQ Status */
+
+#define AT91_AIC_IECR          (AT91_AIC + 0x120)      /* Interrupt Enable Command Register */
+#define AT91_AIC_IDCR          (AT91_AIC + 0x124)      /* Interrupt Disable Command Register */
+#define AT91_AIC_ICCR          (AT91_AIC + 0x128)      /* Interrupt Clear Command Register */
+#define AT91_AIC_ISCR          (AT91_AIC + 0x12c)      /* Interrupt Set Command Register */
+#define AT91_AIC_EOICR         (AT91_AIC + 0x130)      /* End of Interrupt Command Register */
+#define AT91_AIC_SPU           (AT91_AIC + 0x134)      /* Spurious Interrupt Vector Register */
+#define AT91_AIC_DCR           (AT91_AIC + 0x138)      /* Debug Control Register */
+#define                AT91_AIC_DCR_PROT       (1 << 0)                /* Protection Mode */
+#define                AT91_AIC_DCR_GMSK       (1 << 1)                /* General Mask */
+
+#define AT91_AIC_FFER          (AT91_AIC + 0x140)      /* Fast Forcing Enable Register [SAM9 only] */
+#define AT91_AIC_FFDR          (AT91_AIC + 0x144)      /* Fast Forcing Disable Register [SAM9 only] */
+#define AT91_AIC_FFSR          (AT91_AIC + 0x148)      /* Fast Forcing Status Register [SAM9 only] */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_dbgu.h b/include/asm-arm/arch-at91/at91_dbgu.h
new file mode 100644 (file)
index 0000000..b0369e1
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * include/asm-arm/arch-at91/at91_dbgu.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Debug Unit (DBGU) - System peripherals registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91_DBGU_H
+#define AT91_DBGU_H
+
+#define AT91_DBGU_CR           (AT91_DBGU + 0x00)      /* Control Register */
+#define AT91_DBGU_MR           (AT91_DBGU + 0x04)      /* Mode Register */
+#define AT91_DBGU_IER          (AT91_DBGU + 0x08)      /* Interrupt Enable Register */
+#define                AT91_DBGU_TXRDY         (1 << 1)                /* Transmitter Ready */
+#define                AT91_DBGU_TXEMPTY       (1 << 9)                /* Transmitter Empty */
+#define AT91_DBGU_IDR          (AT91_DBGU + 0x0c)      /* Interrupt Disable Register */
+#define AT91_DBGU_IMR          (AT91_DBGU + 0x10)      /* Interrupt Mask Register */
+#define AT91_DBGU_SR           (AT91_DBGU + 0x14)      /* Status Register */
+#define AT91_DBGU_RHR          (AT91_DBGU + 0x18)      /* Receiver Holding Register */
+#define AT91_DBGU_THR          (AT91_DBGU + 0x1c)      /* Transmitter Holding Register */
+#define AT91_DBGU_BRGR         (AT91_DBGU + 0x20)      /* Baud Rate Generator Register */
+
+#define AT91_DBGU_CIDR         (AT91_DBGU + 0x40)      /* Chip ID Register */
+#define AT91_DBGU_EXID         (AT91_DBGU + 0x44)      /* Chip ID Extension Register */
+#define                AT91_CIDR_VERSION       (0x1f << 0)             /* Version of the Device */
+#define                AT91_CIDR_EPROC         (7    << 5)             /* Embedded Processor */
+#define                AT91_CIDR_NVPSIZ        (0xf  << 8)             /* Nonvolatile Program Memory Size */
+#define                AT91_CIDR_NVPSIZ2       (0xf  << 12)            /* Second Nonvolatile Program Memory Size */
+#define                AT91_CIDR_SRAMSIZ       (0xf  << 16)            /* Internal SRAM Size */
+#define                        AT91_CIDR_SRAMSIZ_1K    (1 << 16)
+#define                        AT91_CIDR_SRAMSIZ_2K    (2 << 16)
+#define                        AT91_CIDR_SRAMSIZ_112K  (4 << 16)
+#define                        AT91_CIDR_SRAMSIZ_4K    (5 << 16)
+#define                        AT91_CIDR_SRAMSIZ_80K   (6 << 16)
+#define                        AT91_CIDR_SRAMSIZ_160K  (7 << 16)
+#define                        AT91_CIDR_SRAMSIZ_8K    (8 << 16)
+#define                        AT91_CIDR_SRAMSIZ_16K   (9 << 16)
+#define                        AT91_CIDR_SRAMSIZ_32K   (10 << 16)
+#define                        AT91_CIDR_SRAMSIZ_64K   (11 << 16)
+#define                        AT91_CIDR_SRAMSIZ_128K  (12 << 16)
+#define                        AT91_CIDR_SRAMSIZ_256K  (13 << 16)
+#define                        AT91_CIDR_SRAMSIZ_96K   (14 << 16)
+#define                        AT91_CIDR_SRAMSIZ_512K  (15 << 16)
+#define                AT91_CIDR_ARCH          (0xff << 20)            /* Architecture Identifier */
+#define                AT91_CIDR_NVPTYP        (7    << 28)            /* Nonvolatile Program Memory Type */
+#define                AT91_CIDR_EXT           (1    << 31)            /* Extension Flag */
+
+#define AT91_DBGU_FNR          (AT91_DBGU + 0x48)      /* Force NTRST Register [SAM9 only] */
+#define                AT91_DBGU_FNTRST        (1 << 0)                /* Force NTRST */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_ecc.h b/include/asm-arm/arch-at91/at91_ecc.h
new file mode 100644 (file)
index 0000000..ff93df5
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * include/asm-arm/arch-at91/at91_ecc.h
+ *
+ * Error Corrected Code Controller (ECC) - System peripherals regsters.
+ * Based on AT91SAM9260 datasheet revision B.
+ *
+ * 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 AT91_ECC_H
+#define AT91_ECC_H
+
+#define AT91_ECC_CR            (AT91_ECC + 0x00)       /* Control register */
+#define                AT91_ECC_RST            (1 << 0)                /* Reset parity */
+
+#define AT91_ECC_MR            (AT91_ECC + 0x04)       /* Mode register */
+#define                AT91_ECC_PAGESIZE       (3 << 0)                /* Page Size */
+#define                        AT91_ECC_PAGESIZE_528           (0)
+#define                        AT91_ECC_PAGESIZE_1056          (1)
+#define                        AT91_ECC_PAGESIZE_2112          (2)
+#define                        AT91_ECC_PAGESIZE_4224          (3)
+
+#define AT91_ECC_SR            (AT91_ECC + 0x08)       /* Status register */
+#define                AT91_ECC_RECERR         (1 << 0)                /* Recoverable Error */
+#define                AT91_ECC_ECCERR         (1 << 1)                /* ECC Single Bit Error */
+#define                AT91_ECC_MULERR         (1 << 2)                /* Multiple Errors */
+
+#define AT91_ECC_PR            (AT91_ECC + 0x0c)       /* Parity register */
+#define                AT91_ECC_BITADDR        (0xf << 0)              /* Bit Error Address */
+#define                AT91_ECC_WORDADDR       (0xfff << 4)            /* Word Error Address */
+
+#define AT91_ECC_NPR           (AT91_ECC + 0x10)       /* NParity register */
+#define                AT91_ECC_NPARITY        (0xffff << 0)           /* NParity */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_lcdc.h b/include/asm-arm/arch-at91/at91_lcdc.h
new file mode 100644 (file)
index 0000000..ab040a4
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * include/asm-arm/arch-at91/at91_lcdc.h
+ *
+ * LCD Controller (LCDC).
+ * Based on AT91SAM9261 datasheet revision E.
+ *
+ * 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 AT91_LCDC_H
+#define AT91_LCDC_H
+
+#define AT91_LCDC_DMABADDR1    0x00            /* DMA Base Address Register 1 */
+#define AT91_LCDC_DMABADDR2    0x04            /* DMA Base Address Register 2 */
+#define AT91_LCDC_DMAFRMPT1    0x08            /* DMA Frame Pointer Register 1 */
+#define AT91_LCDC_DMAFRMPT2    0x0c            /* DMA Frame Pointer Register 2 */
+#define AT91_LCDC_DMAFRMADD1   0x10            /* DMA Frame Address Register 1 */
+#define AT91_LCDC_DMAFRMADD2   0x14            /* DMA Frame Address Register 2 */
+
+#define AT91_LCDC_DMAFRMCFG    0x18            /* DMA Frame Configuration Register */
+#define                AT91_LCDC_FRSIZE        (0x7fffff <<  0)        /* Frame Size */
+#define                AT91_LCDC_BLENGTH       (0x7f     << 24)        /* Burst Length */
+
+#define AT91_LCDC_DMACON       0x1c            /* DMA Control Register */
+#define                AT91_LCDC_DMAEN         (0x1 << 0)      /* DMA Enable */
+#define                AT91_LCDC_DMARST        (0x1 << 1)      /* DMA Reset */
+#define                AT91_LCDC_DMABUSY       (0x1 << 2)      /* DMA Busy */
+
+#define AT91_LCDC_LCDCON1      0x0800          /* LCD Control Register 1 */
+#define                AT91_LCDC_BYPASS        (1     <<  0)   /* Bypass lcd_dotck divider */
+#define                AT91_LCDC_CLKVAL        (0x1ff << 12)   /* Clock Divider */
+#define                AT91_LCDC_LINCNT        (0x7ff << 21)   /* Line Counter */
+
+#define AT91_LCDC_LCDCON2      0x0804          /* LCD Control Register 2 */
+#define                AT91_LCDC_DISTYPE       (3 << 0)        /* Display Type */
+#define                        AT91_LCDC_DISTYPE_STNMONO       (0 << 0)
+#define                        AT91_LCDC_DISTYPE_STNCOLOR      (1 << 0)
+#define                        AT91_LCDC_DISTYPE_TFT           (2 << 0)
+#define                AT91_LCDC_SCANMOD       (1 << 2)        /* Scan Mode */
+#define                        AT91_LCDC_SCANMOD_SINGLE        (0 << 2)
+#define                        AT91_LCDC_SCANMOD_DUAL          (1 << 2)
+#define                AT91_LCDC_IFWIDTH       (3 << 3)        /*Interface Width */
+#define                        AT91_LCDC_IFWIDTH_4             (0 << 3)
+#define                        AT91_LCDC_IFWIDTH_8             (1 << 3)
+#define                        AT91_LCDC_IFWIDTH_16            (2 << 3)
+#define                AT91_LCDC_PIXELSIZE     (7 << 5)        /* Bits per pixel */
+#define                        AT91_LCDC_PIXELSIZE_1           (0 << 5)
+#define                        AT91_LCDC_PIXELSIZE_2           (1 << 5)
+#define                        AT91_LCDC_PIXELSIZE_4           (2 << 5)
+#define                        AT91_LCDC_PIXELSIZE_8           (3 << 5)
+#define                        AT91_LCDC_PIXELSIZE_16          (4 << 5)
+#define                        AT91_LCDC_PIXELSIZE_24          (5 << 5)
+#define                AT91_LCDC_INVVD         (1 << 8)        /* LCD Data polarity */
+#define                        AT91_LCDC_INVVD_NORMAL          (0 << 8)
+#define                        AT91_LCDC_INVVD_INVERTED        (1 << 8)
+#define                AT91_LCDC_INVFRAME      (1 << 9 )       /* LCD VSync polarity */
+#define                        AT91_LCDC_INVFRAME_NORMAL       (0 << 9)
+#define                        AT91_LCDC_INVFRAME_INVERTED     (1 << 9)
+#define                AT91_LCDC_INVLINE       (1 << 10)       /* LCD HSync polarity */
+#define                        AT91_LCDC_INVLINE_NORMAL        (0 << 10)
+#define                        AT91_LCDC_INVLINE_INVERTED      (1 << 10)
+#define                AT91_LCDC_INVCLK        (1 << 11)       /* LCD dotclk polarity */
+#define                        AT91_LCDC_INVCLK_NORMAL         (0 << 11)
+#define                        AT91_LCDC_INVCLK_INVERTED       (1 << 11)
+#define                AT91_LCDC_INVDVAL       (1 << 12)       /* LCD dval polarity */
+#define                        AT91_LCDC_INVDVAL_NORMAL        (0 << 12)
+#define                        AT91_LCDC_INVDVAL_INVERTED      (1 << 12)
+#define                AT91_LCDC_CLKMOD        (1 << 15)       /* LCD dotclk mode */
+#define                        AT91_LCDC_CLKMOD_ACTIVEDISPLAY  (0 << 15)
+#define                        AT91_LCDC_CLKMOD_ALWAYSACTIVE   (1 << 15)
+#define                AT91_LCDC_MEMOR         (1 << 31)       /* Memory Ordering Format */
+#define                        AT91_LCDC_MEMOR_BIG             (0 << 31)
+#define                        AT91_LCDC_MEMOR_LITTLE          (1 << 31)
+
+#define AT91_LCDC_TIM1         0x0808          /* LCD Timing Register 1 */
+#define                AT91_LCDC_VFP           (0xff <<  0)    /* Vertical Front Porch */
+#define                AT91_LCDC_VBP           (0xff <<  8)    /* Vertical Back Porch */
+#define                AT91_LCDC_VPW           (0x3f << 16)    /* Vertical Synchronization Pulse Width */
+#define                AT91_LCDC_VHDLY         (0xf  << 24)    /* Vertical to Horizontal Delay */
+
+#define AT91_LCDC_TIM2         0x080c          /* LCD Timing Register 2 */
+#define                AT91_LCDC_HBP           (0xff  <<  0)   /* Horizontal Back Porch */
+#define                AT91_LCDC_HPW           (0x3f  <<  8)   /* Horizontal Synchronization Pulse Width */
+#define                AT91_LCDC_HFP           (0x7ff << 21)   /* Horizontal Front Porch */
+
+#define AT91_LCDC_LCDFRMCFG    0x0810          /* LCD Frame Configuration Register */
+#define                AT91_LCDC_LINEVAL       (0x7ff <<  0)   /* Vertical Size of LCD Module */
+#define                AT91_LCDC_HOZVAL        (0x7ff << 21)   /* Horizontal Size of LCD Module */
+
+#define AT91_LCDC_FIFO         0x0814          /* LCD FIFO Register */
+#define                AT91_LCDC_FIFOTH        (0xffff)        /* FIFO Threshold */
+
+#define AT91_LCDC_DP1_2                0x081c          /* Dithering Pattern DP1_2 Register */
+#define AT91_LCDC_DP4_7                0x0820          /* Dithering Pattern DP4_7 Register */
+#define AT91_LCDC_DP3_5                0x0824          /* Dithering Pattern DP3_5 Register */
+#define AT91_LCDC_DP2_3                0x0828          /* Dithering Pattern DP2_3 Register */
+#define AT91_LCDC_DP5_7                0x082c          /* Dithering Pattern DP5_7 Register */
+#define AT91_LCDC_DP3_4                0x0830          /* Dithering Pattern DP3_4 Register */
+#define AT91_LCDC_DP4_5                0x0834          /* Dithering Pattern DP4_5 Register */
+#define AT91_LCDC_DP6_7                0x0838          /* Dithering Pattern DP6_7 Register */
+#define                AT91_LCDC_DP1_2_VAL     (0xff)
+#define                AT91_LCDC_DP4_7_VAL     (0xfffffff)
+#define                AT91_LCDC_DP3_5_VAL     (0xfffff)
+#define                AT91_LCDC_DP2_3_VAL     (0xfff)
+#define                AT91_LCDC_DP5_7_VAL     (0xfffffff)
+#define                AT91_LCDC_DP3_4_VAL     (0xffff)
+#define                AT91_LCDC_DP4_5_VAL     (0xfffff)
+#define                AT91_LCDC_DP6_7_VAL     (0xfffffff)
+
+#define AT91_LCDC_PWRCON       0x083c          /* Power Control Register */
+#define                AT91_LCDC_PWR           (1    <<  0)    /* LCD Module Power Control */
+#define                AT91_LCDC_GUARDT        (0x7f <<  1)    /* Delay in Frame Period */
+#define                AT91_LCDC_BUSY          (1    << 31)    /* LCD Busy */
+
+#define AT91_LCDC_CONTRAST_CTR 0x0840          /* Contrast Control Register */
+#define                AT91_LCDC_PS            (3 << 0)        /* Contrast Counter Prescaler */
+#define                        AT91_LCDC_PS_DIV1               (0 << 0)
+#define                        AT91_LCDC_PS_DIV2               (1 << 0)
+#define                        AT91_LCDC_PS_DIV4               (2 << 0)
+#define                        AT91_LCDC_PS_DIV8               (3 << 0)
+#define                AT91_LCDC_POL           (1 << 2)        /* Polarity of output Pulse */
+#define                        AT91_LCDC_POL_NEGATIVE          (0 << 2)
+#define                        AT91_LCDC_POL_POSITIVE          (1 << 2)
+#define                AT91_LCDC_ENA           (1 << 3)        /* PWM generator Control */
+#define                        AT91_LCDC_ENA_PWMDISABLE        (0 << 3)
+#define                        AT91_LCDC_ENA_PWMENABLE         (1 << 3)
+
+#define AT91_LCDC_CONTRAST_VAL 0x0844          /* Contrast Value Register */
+#define                AT91_LCDC_CVAL          (0xff)          /* PWM compare value */
+
+#define AT91_LCDC_IER          0x0848          /* Interrupt Enable Register */
+#define AT91_LCDC_IDR          0x084c          /* Interrupt Disable Register */
+#define AT91_LCDC_IMR          0x0850          /* Interrupt Mask Register */
+#define AT91_LCDC_ISR          0x0854          /* Interrupt Enable Register */
+#define AT91_LCDC_ICR          0x0858          /* Interrupt Clear Register */
+#define                AT91_LCDC_LNI           (1 << 0)        /* Line Interrupt */
+#define                AT91_LCDC_LSTLNI        (1 << 1)        /* Last Line Interrupt */
+#define                AT91_LCDC_EOFI          (1 << 2)        /* DMA End Of Frame Interrupt */
+#define                AT91_LCDC_UFLWI         (1 << 4)        /* FIFO Underflow Interrupt */
+#define                AT91_LCDC_OWRI          (1 << 5)        /* FIFO Overwrite Interrupt */
+#define                AT91_LCDC_MERI          (1 << 6)        /* DMA Memory Error Interrupt */
+
+#define AT91_LCDC_LUT_(n)      (0x0c00 + ((n)*4))      /* Palette Entry 0..255 */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_mci.h b/include/asm-arm/arch-at91/at91_mci.h
new file mode 100644 (file)
index 0000000..40a9876
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * include/asm-arm/arch-at91/at91_mci.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * MultiMedia Card Interface (MCI) registers.
+ * Based on AT91RM9200 datasheet revision F.
+ *
+ * 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 AT91_MCI_H
+#define AT91_MCI_H
+
+#define AT91_MCI_CR            0x00            /* Control Register */
+#define                AT91_MCI_MCIEN          (1 <<  0)       /* Multi-Media Interface Enable */
+#define                AT91_MCI_MCIDIS         (1 <<  1)       /* Multi-Media Interface Disable */
+#define                AT91_MCI_PWSEN          (1 <<  2)       /* Power Save Mode Enable */
+#define                AT91_MCI_PWSDIS         (1 <<  3)       /* Power Save Mode Disable */
+#define                AT91_MCI_SWRST          (1 <<  7)       /* Software Reset */
+
+#define AT91_MCI_MR            0x04            /* Mode Register */
+#define                AT91_MCI_CLKDIV         (0xff  <<  0)   /* Clock Divider */
+#define                AT91_MCI_PWSDIV         (7     <<  8)   /* Power Saving Divider */
+#define                AT91_MCI_PDCPADV        (1     << 14)   /* PDC Padding Value */
+#define                AT91_MCI_PDCMODE        (1     << 15)   /* PDC-orientated Mode */
+#define                AT91_MCI_BLKLEN         (0xfff << 18)   /* Data Block Length */
+
+#define AT91_MCI_DTOR          0x08            /* Data Timeout Register */
+#define                AT91_MCI_DTOCYC         (0xf << 0)      /* Data Timeout Cycle Number */
+#define                AT91_MCI_DTOMUL         (7   << 4)      /* Data Timeout Multiplier */
+#define                AT91_MCI_DTOMUL_1               (0 <<  4)
+#define                AT91_MCI_DTOMUL_16              (1 <<  4)
+#define                AT91_MCI_DTOMUL_128             (2 <<  4)
+#define                AT91_MCI_DTOMUL_256             (3 <<  4)
+#define                AT91_MCI_DTOMUL_1K              (4 <<  4)
+#define                AT91_MCI_DTOMUL_4K              (5 <<  4)
+#define                AT91_MCI_DTOMUL_64K             (6 <<  4)
+#define                AT91_MCI_DTOMUL_1M              (7 <<  4)
+
+#define AT91_MCI_SDCR          0x0c            /* SD Card Register */
+#define                AT91_MCI_SDCSEL         (3 << 0)        /* SD Card Selector */
+#define                AT91_MCI_SDCBUS         (1 << 7)        /* 1-bit or 4-bit bus */
+
+#define AT91_MCI_ARGR          0x10            /* Argument Register */
+
+#define AT91_MCI_CMDR          0x14            /* Command Register */
+#define                AT91_MCI_CMDNB          (0x3f << 0)     /* Command Number */
+#define                AT91_MCI_RSPTYP         (3    << 6)     /* Response Type */
+#define                        AT91_MCI_RSPTYP_NONE    (0 <<  6)
+#define                        AT91_MCI_RSPTYP_48      (1 <<  6)
+#define                        AT91_MCI_RSPTYP_136     (2 <<  6)
+#define                AT91_MCI_SPCMD          (7    << 8)     /* Special Command */
+#define                        AT91_MCI_SPCMD_NONE     (0 <<  8)
+#define                        AT91_MCI_SPCMD_INIT     (1 <<  8)
+#define                        AT91_MCI_SPCMD_SYNC     (2 <<  8)
+#define                        AT91_MCI_SPCMD_ICMD     (4 <<  8)
+#define                        AT91_MCI_SPCMD_IRESP    (5 <<  8)
+#define                AT91_MCI_OPDCMD         (1 << 11)       /* Open Drain Command */
+#define                AT91_MCI_MAXLAT         (1 << 12)       /* Max Latency for Command to Response */
+#define                AT91_MCI_TRCMD          (3 << 16)       /* Transfer Command */
+#define                        AT91_MCI_TRCMD_NONE     (0 << 16)
+#define                        AT91_MCI_TRCMD_START    (1 << 16)
+#define                        AT91_MCI_TRCMD_STOP     (2 << 16)
+#define                AT91_MCI_TRDIR          (1 << 18)       /* Transfer Direction */
+#define                AT91_MCI_TRTYP          (3 << 19)       /* Transfer Type */
+#define                        AT91_MCI_TRTYP_BLOCK    (0 << 19)
+#define                        AT91_MCI_TRTYP_MULTIPLE (1 << 19)
+#define                        AT91_MCI_TRTYP_STREAM   (2 << 19)
+
+#define AT91_MCI_RSPR(n)       (0x20 + ((n) * 4))      /* Response Registers 0-3 */
+#define AT91_MCR_RDR           0x30            /* Receive Data Register */
+#define AT91_MCR_TDR           0x34            /* Transmit Data Register */
+
+#define AT91_MCI_SR            0x40            /* Status Register */
+#define                AT91_MCI_CMDRDY         (1 <<  0)       /* Command Ready */
+#define                AT91_MCI_RXRDY          (1 <<  1)       /* Receiver Ready */
+#define                AT91_MCI_TXRDY          (1 <<  2)       /* Transmit Ready */
+#define                AT91_MCI_BLKE           (1 <<  3)       /* Data Block Ended */
+#define                AT91_MCI_DTIP           (1 <<  4)       /* Data Transfer in Progress */
+#define                AT91_MCI_NOTBUSY        (1 <<  5)       /* Data Not Busy */
+#define                AT91_MCI_ENDRX          (1 <<  6)       /* End of RX Buffer */
+#define                AT91_MCI_ENDTX          (1 <<  7)       /* End fo TX Buffer */
+#define                AT91_MCI_SDIOIRQA       (1 <<  8)       /* SDIO Interrupt for Slot A */
+#define                At91_MCI_SDIOIRQB       (1 <<  9)       /* SDIO Interrupt for Slot B [AT91RM9200 only] */
+#define                AT91_MCI_RXBUFF         (1 << 14)       /* RX Buffer Full */
+#define                AT91_MCI_TXBUFE         (1 << 15)       /* TX Buffer Empty */
+#define                AT91_MCI_RINDE          (1 << 16)       /* Response Index Error */
+#define                AT91_MCI_RDIRE          (1 << 17)       /* Response Direction Error */
+#define                AT91_MCI_RCRCE          (1 << 18)       /* Response CRC Error */
+#define                AT91_MCI_RENDE          (1 << 19)       /* Response End Bit Error */
+#define                AT91_MCI_RTOE           (1 << 20)       /* Reponse Time-out Error */
+#define                AT91_MCI_DCRCE          (1 << 21)       /* Data CRC Error */
+#define                AT91_MCI_DTOE           (1 << 22)       /* Data Time-out Error */
+#define                AT91_MCI_OVRE           (1 << 30)       /* Overrun */
+#define                AT91_MCI_UNRE           (1 << 31)       /* Underrun */
+
+#define AT91_MCI_IER           0x44            /* Interrupt Enable Register */
+#define AT91_MCI_IDR           0x48            /* Interrupt Disable Register */
+#define AT91_MCI_IMR           0x4c            /* Interrupt Mask Register */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_pio.h b/include/asm-arm/arch-at91/at91_pio.h
new file mode 100644 (file)
index 0000000..84c3866
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * include/asm-arm/arch-at91/at91_pio.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Parallel I/O Controller (PIO) - System peripherals registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91_PIO_H
+#define AT91_PIO_H
+
+#define PIO_PER                0x00    /* Enable Register */
+#define PIO_PDR                0x04    /* Disable Register */
+#define PIO_PSR                0x08    /* Status Register */
+#define PIO_OER                0x10    /* Output Enable Register */
+#define PIO_ODR                0x14    /* Output Disable Register */
+#define PIO_OSR                0x18    /* Output Status Register */
+#define PIO_IFER       0x20    /* Glitch Input Filter Enable */
+#define PIO_IFDR       0x24    /* Glitch Input Filter Disable */
+#define PIO_IFSR       0x28    /* Glitch Input Filter Status */
+#define PIO_SODR       0x30    /* Set Output Data Register */
+#define PIO_CODR       0x34    /* Clear Output Data Register */
+#define PIO_ODSR       0x38    /* Output Data Status Register */
+#define PIO_PDSR       0x3c    /* Pin Data Status Register */
+#define PIO_IER                0x40    /* Interrupt Enable Register */
+#define PIO_IDR                0x44    /* Interrupt Disable Register */
+#define PIO_IMR                0x48    /* Interrupt Mask Register */
+#define PIO_ISR                0x4c    /* Interrupt Status Register */
+#define PIO_MDER       0x50    /* Multi-driver Enable Register */
+#define PIO_MDDR       0x54    /* Multi-driver Disable Register */
+#define PIO_MDSR       0x58    /* Multi-driver Status Register */
+#define PIO_PUDR       0x60    /* Pull-up Disable Register */
+#define PIO_PUER       0x64    /* Pull-up Enable Register */
+#define PIO_PUSR       0x68    /* Pull-up Status Register */
+#define PIO_ASR                0x70    /* Peripheral A Select Register */
+#define PIO_BSR                0x74    /* Peripheral B Select Register */
+#define PIO_ABSR       0x78    /* AB Status Register */
+#define PIO_OWER       0xa0    /* Output Write Enable Register */
+#define PIO_OWDR       0xa4    /* Output Write Disable Register */
+#define PIO_OWSR       0xa8    /* Output Write Status Register */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_pit.h b/include/asm-arm/arch-at91/at91_pit.h
new file mode 100644 (file)
index 0000000..5026325
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * include/asm-arm/arch-at91/at91_pit.h
+ *
+ * Periodic Interval Timer (PIT) - System peripherals regsters.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * 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 AT91_PIT_H
+#define AT91_PIT_H
+
+#define AT91_PIT_MR            (AT91_PIT + 0x00)       /* Mode Register */
+#define                AT91_PIT_PITIEN         (1 << 25)               /* Timer Interrupt Enable */
+#define                AT91_PIT_PITEN          (1 << 24)               /* Timer Enabled */
+#define                AT91_PIT_PIV            (0xfffff)               /* Periodic Interval Value */
+
+#define AT91_PIT_SR            (AT91_PIT + 0x04)       /* Status Register */
+#define                AT91_PIT_PITS           (1 << 0)                /* Timer Status */
+
+#define AT91_PIT_PIVR          (AT91_PIT + 0x08)       /* Periodic Interval Value Register */
+#define AT91_PIT_PIIR          (AT91_PIT + 0x0c)       /* Periodic Interval Image Register */
+#define                AT91_PIT_PICNT          (0xfff << 20)           /* Interval Counter */
+#define                AT91_PIT_CPIV           (0xfffff)               /* Inverval Value */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_pmc.h b/include/asm-arm/arch-at91/at91_pmc.h
new file mode 100644 (file)
index 0000000..33ff5b6
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * include/asm-arm/arch-at91/at91_pmc.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Power Management Controller (PMC) - System peripherals registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91_PMC_H
+#define AT91_PMC_H
+
+#define        AT91_PMC_SCER           (AT91_PMC + 0x00)       /* System Clock Enable Register */
+#define        AT91_PMC_SCDR           (AT91_PMC + 0x04)       /* System Clock Disable Register */
+
+#define        AT91_PMC_SCSR           (AT91_PMC + 0x08)       /* System Clock Status Register */
+#define                AT91_PMC_PCK            (1 <<  0)               /* Processor Clock */
+#define                AT91RM9200_PMC_UDP      (1 <<  1)               /* USB Devcice Port Clock [AT91RM9200 only] */
+#define                AT91RM9200_PMC_MCKUDP   (1 <<  2)               /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */
+#define                AT91RM9200_PMC_UHP      (1 <<  4)               /* USB Host Port Clock [AT91RM9200 only] */
+#define                AT91SAM926x_PMC_UHP     (1 <<  6)               /* USB Host Port Clock [AT91SAM926x only] */
+#define                AT91SAM926x_PMC_UDP     (1 <<  7)               /* USB Devcice Port Clock [AT91SAM926x only] */
+#define                AT91_PMC_PCK0           (1 <<  8)               /* Programmable Clock 0 */
+#define                AT91_PMC_PCK1           (1 <<  9)               /* Programmable Clock 1 */
+#define                AT91_PMC_PCK2           (1 << 10)               /* Programmable Clock 2 */
+#define                AT91_PMC_PCK3           (1 << 11)               /* Programmable Clock 3 */
+#define                AT91_PMC_HCK0           (1 << 16)               /* AHB Clock (USB host) [AT91SAM9261 only] */
+#define                AT91_PMC_HCK1           (1 << 17)               /* AHB Clock (LCD) [AT91SAM9261 only] */
+
+#define        AT91_PMC_PCER           (AT91_PMC + 0x10)       /* Peripheral Clock Enable Register */
+#define        AT91_PMC_PCDR           (AT91_PMC + 0x14)       /* Peripheral Clock Disable Register */
+#define        AT91_PMC_PCSR           (AT91_PMC + 0x18)       /* Peripheral Clock Status Register */
+
+#define        AT91_CKGR_MOR           (AT91_PMC + 0x20)       /* Main Oscillator Register */
+#define                AT91_PMC_MOSCEN         (1    << 0)             /* Main Oscillator Enable */
+#define                AT91_PMC_OSCBYPASS      (1    << 1)             /* Oscillator Bypass [AT91SAM926x only] */
+#define                AT91_PMC_OSCOUNT        (0xff << 8)             /* Main Oscillator Start-up Time */
+
+#define        AT91_CKGR_MCFR          (AT91_PMC + 0x24)       /* Main Clock Frequency Register */
+#define                AT91_PMC_MAINF          (0xffff <<  0)          /* Main Clock Frequency */
+#define                AT91_PMC_MAINRDY        (1      << 16)          /* Main Clock Ready */
+
+#define        AT91_CKGR_PLLAR         (AT91_PMC + 0x28)       /* PLL A Register */
+#define        AT91_CKGR_PLLBR         (AT91_PMC + 0x2c)       /* PLL B Register */
+#define                AT91_PMC_DIV            (0xff  <<  0)           /* Divider */
+#define                AT91_PMC_PLLCOUNT       (0x3f  <<  8)           /* PLL Counter */
+#define                AT91_PMC_OUT            (3     << 14)           /* PLL Clock Frequency Range */
+#define                AT91_PMC_MUL            (0x7ff << 16)           /* PLL Multiplier */
+#define                AT91_PMC_USB96M         (1     << 28)           /* Divider by 2 Enable (PLLB only) */
+
+#define        AT91_PMC_MCKR           (AT91_PMC + 0x30)       /* Master Clock Register */
+#define                AT91_PMC_CSS            (3 <<  0)               /* Master Clock Selection */
+#define                        AT91_PMC_CSS_SLOW               (0 << 0)
+#define                        AT91_PMC_CSS_MAIN               (1 << 0)
+#define                        AT91_PMC_CSS_PLLA               (2 << 0)
+#define                        AT91_PMC_CSS_PLLB               (3 << 0)
+#define                AT91_PMC_PRES           (7 <<  2)               /* Master Clock Prescaler */
+#define                        AT91_PMC_PRES_1                 (0 << 2)
+#define                        AT91_PMC_PRES_2                 (1 << 2)
+#define                        AT91_PMC_PRES_4                 (2 << 2)
+#define                        AT91_PMC_PRES_8                 (3 << 2)
+#define                        AT91_PMC_PRES_16                (4 << 2)
+#define                        AT91_PMC_PRES_32                (5 << 2)
+#define                        AT91_PMC_PRES_64                (6 << 2)
+#define                AT91_PMC_MDIV           (3 <<  8)               /* Master Clock Division */
+#define                        AT91_PMC_MDIV_1                 (0 << 8)
+#define                        AT91_PMC_MDIV_2                 (1 << 8)
+#define                        AT91_PMC_MDIV_3                 (2 << 8)
+#define                        AT91_PMC_MDIV_4                 (3 << 8)
+
+#define        AT91_PMC_PCKR(n)        (AT91_PMC + 0x40 + ((n) * 4))   /* Programmable Clock 0-3 Registers */
+
+#define        AT91_PMC_IER            (AT91_PMC + 0x60)       /* Interrupt Enable Register */
+#define        AT91_PMC_IDR            (AT91_PMC + 0x64)       /* Interrupt Disable Register */
+#define        AT91_PMC_SR             (AT91_PMC + 0x68)       /* Status Register */
+#define                AT91_PMC_MOSCS          (1 <<  0)               /* MOSCS Flag */
+#define                AT91_PMC_LOCKA          (1 <<  1)               /* PLLA Lock */
+#define                AT91_PMC_LOCKB          (1 <<  2)               /* PLLB Lock */
+#define                AT91_PMC_MCKRDY         (1 <<  3)               /* Master Clock */
+#define                AT91_PMC_PCK0RDY        (1 <<  8)               /* Programmable Clock 0 */
+#define                AT91_PMC_PCK1RDY        (1 <<  9)               /* Programmable Clock 1 */
+#define                AT91_PMC_PCK2RDY        (1 << 10)               /* Programmable Clock 2 */
+#define                AT91_PMC_PCK3RDY        (1 << 11)               /* Programmable Clock 3 */
+#define        AT91_PMC_IMR            (AT91_PMC + 0x6c)       /* Interrupt Mask Register */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_rstc.h b/include/asm-arm/arch-at91/at91_rstc.h
new file mode 100644 (file)
index 0000000..fb8d161
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * include/asm-arm/arch-at91/at91_rstc.h
+ *
+ * Reset Controller (RSTC) - System peripherals regsters.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * 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 AT91_RSTC_H
+#define AT91_RSTC_H
+
+#define AT91_RSTC_CR           (AT91_RSTC + 0x00)      /* Reset Controller Control Register */
+#define                AT91_RSTC_PROCRST       (1 << 0)                /* Processor Reset */
+#define                AT91_RSTC_PERRST        (1 << 2)                /* Peripheral Reset */
+#define                AT91_RSTC_EXTRST        (1 << 3)                /* External Reset */
+#define                AT91_RSTC_KEY           (0xa5 << 24)            /* KEY Password */
+
+#define AT91_RSTC_SR           (AT91_RSTC + 0x04)      /* Reset Controller Status Register */
+#define                AT91_RSTC_URSTS         (1 << 0)                /* User Reset Status */
+#define                AT91_RSTC_RSTTYP        (7 << 8)                /* Reset Type */
+#define                        AT91_RSTC_RSTTYP_GENERAL        (0 << 8)
+#define                        AT91_RSTC_RSTTYP_WAKEUP         (1 << 8)
+#define                        AT91_RSTC_RSTTYP_WATCHDOG       (2 << 8)
+#define                        AT91_RSTC_RSTTYP_SOFTWARE       (3 << 8)
+#define                        AT91_RSTC_RSTTYP_USER   (4 << 8)
+#define                AT91_RSTC_NRSTL         (1 << 16)               /* NRST Pin Level */
+#define                AT91_RSTC_SRCMP         (1 << 17)               /* Software Reset Command in Progress */
+
+#define AT91_RSTC_MR           (AT91_RSTC + 0x08)      /* Reset Controller Mode Register */
+#define                AT91_RSTC_URSTEN        (1 << 0)                /* User Reset Enable */
+#define                AT91_RSTC_URSTIEN       (1 << 4)                /* User Reset Interrupt Enable */
+#define                AT91_RSTC_ERSTL         (0xf << 8)              /* External Reset Length */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_rtc.h b/include/asm-arm/arch-at91/at91_rtc.h
new file mode 100644 (file)
index 0000000..af9bd28
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * include/asm-arm/arch-at91/at91_rtc.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Real Time Clock (RTC) - System peripheral registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91_RTC_H
+#define AT91_RTC_H
+
+#define        AT91_RTC_CR             (AT91_RTC + 0x00)       /* Control Register */
+#define                AT91_RTC_UPDTIM         (1 <<  0)               /* Update Request Time Register */
+#define                AT91_RTC_UPDCAL         (1 <<  1)               /* Update Request Calendar Register */
+#define                AT91_RTC_TIMEVSEL       (3 <<  8)               /* Time Event Selection */
+#define                        AT91_RTC_TIMEVSEL_MINUTE        (0 << 8)
+#define                        AT91_RTC_TIMEVSEL_HOUR          (1 << 8)
+#define                        AT91_RTC_TIMEVSEL_DAY24         (2 << 8)
+#define                        AT91_RTC_TIMEVSEL_DAY12         (3 << 8)
+#define                AT91_RTC_CALEVSEL       (3 << 16)               /* Calendar Event Selection */
+#define                        AT91_RTC_CALEVSEL_WEEK          (0 << 16)
+#define                        AT91_RTC_CALEVSEL_MONTH         (1 << 16)
+#define                        AT91_RTC_CALEVSEL_YEAR          (2 << 16)
+
+#define        AT91_RTC_MR             (AT91_RTC + 0x04)       /* Mode Register */
+#define                        AT91_RTC_HRMOD          (1 <<  0)               /* 12/24 Hour Mode */
+
+#define        AT91_RTC_TIMR           (AT91_RTC + 0x08)       /* Time Register */
+#define                AT91_RTC_SEC            (0x7f <<  0)            /* Current Second */
+#define                AT91_RTC_MIN            (0x7f <<  8)            /* Current Minute */
+#define                AT91_RTC_HOUR           (0x3f << 16)            /* Current Hour */
+#define                AT91_RTC_AMPM           (1    << 22)            /* Ante Meridiem Post Meridiem Indicator */
+
+#define        AT91_RTC_CALR           (AT91_RTC + 0x0c)       /* Calendar Register */
+#define                AT91_RTC_CENT           (0x7f <<  0)            /* Current Century */
+#define                AT91_RTC_YEAR           (0xff <<  8)            /* Current Year */
+#define                AT91_RTC_MONTH          (0x1f << 16)            /* Current Month */
+#define                AT91_RTC_DAY            (7    << 21)            /* Current Day */
+#define                AT91_RTC_DATE           (0x3f << 24)            /* Current Date */
+
+#define        AT91_RTC_TIMALR         (AT91_RTC + 0x10)       /* Time Alarm Register */
+#define                AT91_RTC_SECEN          (1 <<  7)               /* Second Alarm Enable */
+#define                AT91_RTC_MINEN          (1 << 15)               /* Minute Alarm Enable */
+#define                AT91_RTC_HOUREN         (1 << 23)               /* Hour Alarm Enable */
+
+#define        AT91_RTC_CALALR         (AT91_RTC + 0x14)       /* Calendar Alarm Register */
+#define                AT91_RTC_MTHEN          (1 << 23)               /* Month Alarm Enable */
+#define                AT91_RTC_DATEEN         (1 << 31)               /* Date Alarm Enable */
+
+#define        AT91_RTC_SR             (AT91_RTC + 0x18)       /* Status Register */
+#define                AT91_RTC_ACKUPD         (1 <<  0)               /* Acknowledge for Update */
+#define                AT91_RTC_ALARM          (1 <<  1)               /* Alarm Flag */
+#define                AT91_RTC_SECEV          (1 <<  2)               /* Second Event */
+#define                AT91_RTC_TIMEV          (1 <<  3)               /* Time Event */
+#define                AT91_RTC_CALEV          (1 <<  4)               /* Calendar Event */
+
+#define        AT91_RTC_SCCR           (AT91_RTC + 0x1c)       /* Status Clear Command Register */
+#define        AT91_RTC_IER            (AT91_RTC + 0x20)       /* Interrupt Enable Register */
+#define        AT91_RTC_IDR            (AT91_RTC + 0x24)       /* Interrupt Disable Register */
+#define        AT91_RTC_IMR            (AT91_RTC + 0x28)       /* Interrupt Mask Register */
+
+#define        AT91_RTC_VER            (AT91_RTC + 0x2c)       /* Valid Entry Register */
+#define                AT91_RTC_NVTIM          (1 <<  0)               /* Non valid Time */
+#define                AT91_RTC_NVCAL          (1 <<  1)               /* Non valid Calendar */
+#define                AT91_RTC_NVTIMALR       (1 <<  2)               /* Non valid Time Alarm */
+#define                AT91_RTC_NVCALALR       (1 <<  3)               /* Non valid Calendar Alarm */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_rtt.h b/include/asm-arm/arch-at91/at91_rtt.h
new file mode 100644 (file)
index 0000000..bae1103
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * include/asm-arm/arch-at91/at91_rtt.h
+ *
+ * Real-time Timer (RTT) - System peripherals regsters.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * 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 AT91_RTT_H
+#define AT91_RTT_H
+
+#define AT91_RTT_MR            (AT91_RTT + 0x00)       /* Real-time Mode Register */
+#define                AT91_RTT_RTPRES         (0xffff << 0)           /* Real-time Timer Prescaler Value */
+#define                AT91_RTT_ALMIEN         (1 << 16)               /* Alarm Interrupt Enable */
+#define                AT91_RTT_RTTINCIEN      (1 << 17)               /* Real Time Timer Increment Interrupt Enable */
+#define                AT91_RTT_RTTRST         (1 << 18)               /* Real Time Timer Restart */
+
+#define AT91_RTT_AR            (AT91_RTT + 0x04)       /* Real-time Alarm Register */
+#define                AT91_RTT_ALMV           (0xffffffff)            /* Alarm Value */
+
+#define AT91_RTT_VR            (AT91_RTT + 0x08)       /* Real-time Value Register */
+#define                AT91_RTT_CRTV           (0xffffffff)            /* Current Real-time Value */
+
+#define AT91_RTT_SR            (AT91_RTT + 0x0c)       /* Real-time Status Register */
+#define                AT91_RTT_ALMS           (1 << 0)                /* Real-time Alarm Status */
+#define                AT91_RTT_RTTINC         (1 << 1)                /* Real-time Timer Increment */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_shdwc.h b/include/asm-arm/arch-at91/at91_shdwc.h
new file mode 100644 (file)
index 0000000..795fcc2
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * include/asm-arm/arch-at91/at91_shdwc.h
+ *
+ * Shutdown Controller (SHDWC) - System peripherals regsters.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * 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 AT91_SHDWC_H
+#define AT91_SHDWC_H
+
+#define AT91_SHDW_CR           (AT91_SHDWC + 0x00)     /* Shut Down Control Register */
+#define                AT91_SHDW_SHDW          (1    << 0)             /* Processor Reset */
+#define                AT91_SHDW_KEY           (0xff << 24)            /* KEY Password */
+
+#define AT91_SHDW_MR           (AT91_SHDWC + 0x04)     /* Shut Down Mode Register */
+#define                AT91_SHDW_WKMODE0       (3 << 0)                /* Wake-up 0 Mode Selection */
+#define                        AT91_SHDW_WKMODE0_NONE          0
+#define                        AT91_SHDW_WKMODE0_HIGH          1
+#define                        AT91_SHDW_WKMODE0_LOW           2
+#define                        AT91_SHDW_WKMODE0_ANYLEVEL      3
+#define                AT91_SHDW_CPTWK0        (0xf << 4)              /* Counter On Wake Up 0 */
+#define                AT91_SHDW_RTTWKEN       (1   << 16)             /* Real Time Timer Wake-up Enable */
+
+#define AT91_SHDW_SR           (AT91_SHDWC + 0x08)     /* Shut Down Status Register */
+#define                AT91_SHDW_WAKEUP0       (1 <<  0)               /* Wake-up 0 Status */
+#define                AT91_SHDW_RTTWK         (1 << 16)               /* Real-time Timer Wake-up */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_spi.h b/include/asm-arm/arch-at91/at91_spi.h
new file mode 100644 (file)
index 0000000..f9b9a84
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * include/asm-arm/arch-at91/at91_spi.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Serial Peripheral Interface (SPI) registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91_SPI_H
+#define AT91_SPI_H
+
+#define AT91_SPI_CR                    0x00            /* Control Register */
+#define                AT91_SPI_SPIEN          (1 <<  0)               /* SPI Enable */
+#define                AT91_SPI_SPIDIS         (1 <<  1)               /* SPI Disable */
+#define                AT91_SPI_SWRST          (1 <<  7)               /* SPI Software Reset */
+#define                AT91_SPI_LASTXFER       (1 << 24)               /* Last Transfer [SAM9261 only] */
+
+#define AT91_SPI_MR                    0x04            /* Mode Register */
+#define                AT91_SPI_MSTR           (1    <<  0)            /* Master/Slave Mode */
+#define                AT91_SPI_PS             (1    <<  1)            /* Peripheral Select */
+#define                        AT91_SPI_PS_FIXED       (0 << 1)
+#define                        AT91_SPI_PS_VARIABLE    (1 << 1)
+#define                AT91_SPI_PCSDEC         (1    <<  2)            /* Chip Select Decode */
+#define                AT91_SPI_DIV32          (1    <<  3)            /* Clock Selection [AT91RM9200 only] */
+#define                AT91_SPI_MODFDIS        (1    <<  4)            /* Mode Fault Detection */
+#define                AT91_SPI_LLB            (1    <<  7)            /* Local Loopback Enable */
+#define                AT91_SPI_PCS            (0xf  << 16)            /* Peripheral Chip Select */
+#define                AT91_SPI_DLYBCS         (0xff << 24)            /* Delay Between Chip Selects */
+
+#define AT91_SPI_RDR           0x08                    /* Receive Data Register */
+#define                AT91_SPI_RD             (0xffff <<  0)          /* Receive Data */
+#define                AT91_SPI_PCS            (0xf    << 16)          /* Peripheral Chip Select */
+
+#define AT91_SPI_TDR           0x0c                    /* Transmit Data Register */
+#define                AT91_SPI_TD             (0xffff <<  0)          /* Transmit Data */
+#define                AT91_SPI_PCS            (0xf    << 16)          /* Peripheral Chip Select */
+#define                AT91_SPI_LASTXFER       (1      << 24)          /* Last Transfer [SAM9261 only] */
+
+#define AT91_SPI_SR            0x10                    /* Status Register */
+#define                AT91_SPI_RDRF           (1 <<  0)               /* Receive Data Register Full */
+#define                AT91_SPI_TDRE           (1 <<  1)               /* Transmit Data Register Full */
+#define                AT91_SPI_MODF           (1 <<  2)               /* Mode Fault Error */
+#define                AT91_SPI_OVRES          (1 <<  3)               /* Overrun Error Status */
+#define                AT91_SPI_ENDRX          (1 <<  4)               /* End of RX buffer */
+#define                AT91_SPI_ENDTX          (1 <<  5)               /* End of TX buffer */
+#define                AT91_SPI_RXBUFF         (1 <<  6)               /* RX Buffer Full */
+#define                AT91_SPI_TXBUFE         (1 <<  7)               /* TX Buffer Empty */
+#define                AT91_SPI_NSSR           (1 <<  8)               /* NSS Rising [SAM9261 only] */
+#define                AT91_SPI_TXEMPTY        (1 <<  9)               /* Transmission Register Empty [SAM9261 only] */
+#define                AT91_SPI_SPIENS         (1 << 16)               /* SPI Enable Status */
+
+#define AT91_SPI_IER           0x14                    /* Interrupt Enable Register */
+#define AT91_SPI_IDR           0x18                    /* Interrupt Disable Register */
+#define AT91_SPI_IMR           0x1c                    /* Interrupt Mask Register */
+
+#define AT91_SPI_CSR(n)                (0x30 + ((n) * 4))      /* Chip Select Registers 0-3 */
+#define                AT91_SPI_CPOL           (1    <<  0)            /* Clock Polarity */
+#define                AT91_SPI_NCPHA          (1    <<  1)            /* Clock Phase */
+#define                AT91_SPI_CSAAT          (1    <<  3)            /* Chip Select Active After Transfer [SAM9261 only] */
+#define                AT91_SPI_BITS           (0xf  <<  4)            /* Bits Per Transfer */
+#define                        AT91_SPI_BITS_8         (0 << 4)
+#define                        AT91_SPI_BITS_9         (1 << 4)
+#define                        AT91_SPI_BITS_10        (2 << 4)
+#define                        AT91_SPI_BITS_11        (3 << 4)
+#define                        AT91_SPI_BITS_12        (4 << 4)
+#define                        AT91_SPI_BITS_13        (5 << 4)
+#define                        AT91_SPI_BITS_14        (6 << 4)
+#define                        AT91_SPI_BITS_15        (7 << 4)
+#define                        AT91_SPI_BITS_16        (8 << 4)
+#define                AT91_SPI_SCBR           (0xff <<  8)            /* Serial Clock Baud Rate */
+#define                AT91_SPI_DLYBS          (0xff << 16)            /* Delay before SPCK */
+#define                AT91_SPI_DLYBCT         (0xff << 24)            /* Delay between Consecutive Transfers */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_ssc.h b/include/asm-arm/arch-at91/at91_ssc.h
new file mode 100644 (file)
index 0000000..0ecc734
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * include/asm-arm/arch-at91/at91_ssc.h
+ *
+ * Copyright (C) SAN People
+ *
+ * Serial Synchronous Controller (SSC) registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91_SSC_H
+#define AT91_SSC_H
+
+#define AT91_SSC_CR            0x00    /* Control Register */
+#define                AT91_SSC_RXEN           (1 <<  0)       /* Receive Enable */
+#define                AT91_SSC_RXDIS          (1 <<  1)       /* Receive Disable */
+#define                AT91_SSC_TXEN           (1 <<  8)       /* Transmit Enable */
+#define                AT91_SSC_TXDIS          (1 <<  9)       /* Transmit Disable */
+#define                AT91_SSC_SWRST          (1 << 15)       /* Software Reset */
+
+#define AT91_SSC_CMR           0x04    /* Clock Mode Register */
+#define                AT91_SSC_CMR_DIV        (0xfff << 0)    /* Clock Divider */
+
+#define AT91_SSC_RCMR          0x10    /* Receive Clock Mode Register */
+#define                AT91_SSC_CKS            (3    <<  0)    /* Clock Selection */
+#define                        AT91_SSC_CKS_DIV                (0 << 0)
+#define                        AT91_SSC_CKS_CLOCK              (1 << 0)
+#define                        AT91_SSC_CKS_PIN                (2 << 0)
+#define                AT91_SSC_CKO            (7    <<  2)    /* Clock Output Mode Selection */
+#define                        AT91_SSC_CKO_NONE               (0 << 2)
+#define                        AT91_SSC_CKO_CONTINUOUS         (1 << 2)
+#define                AT91_SSC_CKI            (1    <<  5)    /* Clock Inversion */
+#define                        AT91_SSC_CKI_FALLING            (0 << 5)
+#define                        AT91_SSC_CK_RISING              (1 << 5)
+#define                AT91_SSC_CKG            (1    <<  6)    /* Receive Clock Gating Selection [AT91SAM9261 only] */
+#define                        AT91_SSC_CKG_NONE               (0 << 6)
+#define                        AT91_SSC_CKG_RFLOW              (1 << 6)
+#define                        AT91_SSC_CKG_RFHIGH             (2 << 6)
+#define                AT91_SSC_START          (0xf  <<  8)    /* Start Selection */
+#define                        AT91_SSC_START_CONTINUOUS       (0 << 8)
+#define                        AT91_SSC_START_TX_RX            (1 << 8)
+#define                        AT91_SSC_START_LOW_RF           (2 << 8)
+#define                        AT91_SSC_START_HIGH_RF          (3 << 8)
+#define                        AT91_SSC_START_FALLING_RF       (4 << 8)
+#define                        AT91_SSC_START_RISING_RF        (5 << 8)
+#define                        AT91_SSC_START_LEVEL_RF         (6 << 8)
+#define                        AT91_SSC_START_EDGE_RF          (7 << 8)
+#define                AT91_SSC_STOP           (1    << 12)    /* Receive Stop Selection [AT91SAM9261 only] */
+#define                AT91_SSC_STTDLY         (0xff << 16)    /* Start Delay */
+#define                AT91_SSC_PERIOD         (0xff << 24)    /* Period Divider Selection */
+
+#define AT91_SSC_RFMR          0x14    /* Receive Frame Mode Register */
+#define                AT91_SSC_DATALEN        (0x1f <<  0)    /* Data Length */
+#define                AT91_SSC_LOOP           (1    <<  5)    /* Loop Mode */
+#define                AT91_SSC_MSBF           (1    <<  7)    /* Most Significant Bit First */
+#define                AT91_SSC_DATNB          (0xf  <<  8)    /* Data Number per Frame */
+#define                AT91_SSC_FSLEN          (0xf  << 16)    /* Frame Sync Length */
+#define                AT91_SSC_FSOS           (7    << 20)    /* Frame Sync Output Selection */
+#define                        AT91_SSC_FSOS_NONE              (0 << 20)
+#define                        AT91_SSC_FSOS_NEGATIVE          (1 << 20)
+#define                        AT91_SSC_FSOS_POSITIVE          (2 << 20)
+#define                        AT91_SSC_FSOS_LOW               (3 << 20)
+#define                        AT91_SSC_FSOS_HIGH              (4 << 20)
+#define                        AT91_SSC_FSOS_TOGGLE            (5 << 20)
+#define                AT91_SSC_FSEDGE         (1    << 24)    /* Frame Sync Edge Detection */
+#define                        AT91_SSC_FSEDGE_POSITIVE        (0 << 24)
+#define                        AT91_SSC_FSEDGE_NEGATIVE        (1 << 24)
+
+#define AT91_SSC_TCMR          0x18    /* Transmit Clock Mode Register */
+#define AT91_SSC_TFMR          0x1c    /* Transmit Fram Mode Register */
+#define                AT91_SSC_DATDEF         (1 <<  5)       /* Data Default Value */
+#define                AT91_SSC_FSDEN          (1 << 23)       /* Frame Sync Data Enable */
+
+#define AT91_SSC_RHR           0x20    /* Receive Holding Register */
+#define AT91_SSC_THR           0x24    /* Transmit Holding Register */
+#define AT91_SSC_RSHR          0x30    /* Receive Sync Holding Register */
+#define AT91_SSC_TSHR          0x34    /* Transmit Sync Holding Register */
+
+#define AT91_SSC_RC0R          0x38    /* Receive Compare 0 Register [AT91SAM9261 only] */
+#define AT91_SSC_RC1R          0x3c    /* Receive Compare 1 Register [AT91SAM9261 only] */
+
+#define AT91_SSC_SR            0x40    /* Status Register */
+#define                AT91_SSC_TXRDY          (1 <<  0)       /* Transmit Ready */
+#define                AT91_SSC_TXEMPTY        (1 <<  1)       /* Transmit Empty */
+#define                AT91_SSC_ENDTX          (1 <<  2)       /* End of Transmission */
+#define                AT91_SSC_TXBUFE         (1 <<  3)       /* Transmit Buffer Empty */
+#define                AT91_SSC_RXRDY          (1 <<  4)       /* Receive Ready */
+#define                AT91_SSC_OVRUN          (1 <<  5)       /* Receive Overrun */
+#define                AT91_SSC_ENDRX          (1 <<  6)       /* End of Reception */
+#define                AT91_SSC_RXBUFF         (1 <<  7)       /* Receive Buffer Full */
+#define                AT91_SSC_CP0            (1 <<  8)       /* Compare 0 [AT91SAM9261 only] */
+#define                AT91_SSC_CP1            (1 <<  9)       /* Compare 1 [AT91SAM9261 only] */
+#define                AT91_SSC_TXSYN          (1 << 10)       /* Transmit Sync */
+#define                AT91_SSC_RXSYN          (1 << 11)       /* Receive Sync */
+#define                AT91_SSC_TXENA          (1 << 16)       /* Transmit Enable */
+#define                AT91_SSC_RXENA          (1 << 17)       /* Receive Enable */
+
+#define AT91_SSC_IER           0x44    /* Interrupt Enable Register */
+#define AT91_SSC_IDR           0x48    /* Interrupt Disable Register */
+#define AT91_SSC_IMR           0x4c    /* Interrupt Mask Register */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_st.h b/include/asm-arm/arch-at91/at91_st.h
new file mode 100644 (file)
index 0000000..30446e2
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * include/asm-arm/arch-at91/at91_st.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * System Timer (ST) - System peripherals registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91_ST_H
+#define AT91_ST_H
+
+#define        AT91_ST_CR              (AT91_ST + 0x00)        /* Control Register */
+#define        AT91_ST_WDRST           (1 << 0)                /* Watchdog Timer Restart */
+
+#define        AT91_ST_PIMR            (AT91_ST + 0x04)        /* Period Interval Mode Register */
+#define                AT91_ST_PIV             (0xffff <<  0)          /* Period Interval Value */
+
+#define        AT91_ST_WDMR            (AT91_ST + 0x08)        /* Watchdog Mode Register */
+#define                AT91_ST_WDV             (0xffff <<  0)          /* Watchdog Counter Value */
+#define                AT91_ST_RSTEN           (1      << 16)          /* Reset Enable */
+#define                AT91_ST_EXTEN           (1      << 17)          /* External Signal Assertion Enable */
+
+#define        AT91_ST_RTMR            (AT91_ST + 0x0c)        /* Real-time Mode Register */
+#define                AT91_ST_RTPRES          (0xffff <<  0)          /* Real-time Prescalar Value */
+
+#define        AT91_ST_SR              (AT91_ST + 0x10)        /* Status Register */
+#define                AT91_ST_PITS            (1 << 0)                /* Period Interval Timer Status */
+#define                AT91_ST_WDOVF           (1 << 1)                /* Watchdog Overflow */
+#define                AT91_ST_RTTINC          (1 << 2)                /* Real-time Timer Increment */
+#define                AT91_ST_ALMS            (1 << 3)                /* Alarm Status */
+
+#define        AT91_ST_IER             (AT91_ST + 0x14)        /* Interrupt Enable Register */
+#define        AT91_ST_IDR             (AT91_ST + 0x18)        /* Interrupt Disable Register */
+#define        AT91_ST_IMR             (AT91_ST + 0x1c)        /* Interrupt Mask Register */
+
+#define        AT91_ST_RTAR            (AT91_ST + 0x20)        /* Real-time Alarm Register */
+#define                AT91_ST_ALMV            (0xfffff << 0)          /* Alarm Value */
+
+#define        AT91_ST_CRTR            (AT91_ST + 0x24)        /* Current Real-time Register */
+#define                AT91_ST_CRTV            (0xfffff << 0)          /* Current Real-Time Value */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_tc.h b/include/asm-arm/arch-at91/at91_tc.h
new file mode 100644 (file)
index 0000000..b85d3fa
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * include/asm-arm/arch-at91/at91_tc.h
+ *
+ * Copyright (C) SAN People
+ *
+ * Timer/Counter Unit (TC) registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91_TC_H
+#define AT91_TC_H
+
+#define AT91_TC_BCR            0xc0            /* TC Block Control Register */
+#define                AT91_TC_SYNC            (1 << 0)        /* Synchro Command */
+
+#define AT91_TC_BMR            0xc4            /* TC Block Mode Register */
+#define                AT91_TC_TC0XC0S         (3 << 0)        /* External Clock Signal 0 Selection */
+#define                        AT91_TC_TC0XC0S_TCLK0           (0 << 0)
+#define                        AT91_TC_TC0XC0S_NONE            (1 << 0)
+#define                        AT91_TC_TC0XC0S_TIOA1           (2 << 0)
+#define                        AT91_TC_TC0XC0S_TIOA2           (3 << 0)
+#define                AT91_TC_TC1XC1S         (3 << 2)        /* External Clock Signal 1 Selection */
+#define                        AT91_TC_TC1XC1S_TCLK1           (0 << 2)
+#define                        AT91_TC_TC1XC1S_NONE            (1 << 2)
+#define                        AT91_TC_TC1XC1S_TIOA0           (2 << 2)
+#define                        AT91_TC_TC1XC1S_TIOA2           (3 << 2)
+#define                AT91_TC_TC2XC2S         (3 << 4)        /* External Clock Signal 2 Selection */
+#define                        AT91_TC_TC2XC2S_TCLK2           (0 << 4)
+#define                        AT91_TC_TC2XC2S_NONE            (1 << 4)
+#define                        AT91_TC_TC2XC2S_TIOA0           (2 << 4)
+#define                        AT91_TC_TC2XC2S_TIOA1           (3 << 4)
+
+
+#define AT91_TC_CCR            0x00            /* Channel Control Register */
+#define                AT91_TC_CLKEN           (1 << 0)        /* Counter Clock Enable Command */
+#define                AT91_TC_CLKDIS          (1 << 1)        /* Counter CLock Disable Command */
+#define                AT91_TC_SWTRG           (1 << 2)        /* Software Trigger Command */
+
+#define AT91_TC_CMR            0x04            /* Channel Mode Register */
+#define                AT91_TC_TCCLKS          (7 << 0)        /* Capture/Waveform Mode: Clock Selection */
+#define                        AT91_TC_TIMER_CLOCK1            (0 << 0)
+#define                        AT91_TC_TIMER_CLOCK2            (1 << 0)
+#define                        AT91_TC_TIMER_CLOCK3            (2 << 0)
+#define                        AT91_TC_TIMER_CLOCK4            (3 << 0)
+#define                        AT91_TC_TIMER_CLOCK5            (4 << 0)
+#define                        AT91_TC_XC0                     (5 << 0)
+#define                        AT91_TC_XC1                     (6 << 0)
+#define                        AT91_TC_XC2                     (7 << 0)
+#define                AT91_TC_CLKI            (1 << 3)        /* Capture/Waveform Mode: Clock Invert */
+#define                AT91_TC_BURST           (3 << 4)        /* Capture/Waveform Mode: Burst Signal Selection */
+#define                AT91_TC_LDBSTOP         (1 << 6)        /* Capture Mode: Counter Clock Stopped with TB Loading */
+#define                AT91_TC_LDBDIS          (1 << 7)        /* Capture Mode: Counter Clock Disable with RB Loading */
+#define                AT91_TC_ETRGEDG         (3 << 8)        /* Capture Mode: External Trigger Edge Selection */
+#define                AT91_TC_ABETRG          (1 << 10)       /* Capture Mode: TIOA or TIOB External Trigger Selection */
+#define                AT91_TC_CPCTRG          (1 << 14)       /* Capture Mode: RC Compare Trigger Enable */
+#define                AT91_TC_WAVE            (1 << 15)       /* Capture/Waveform mode */
+#define                AT91_TC_LDRA            (3 << 16)       /* Capture Mode: RA Loading Selection */
+#define                AT91_TC_LDRB            (3 << 18)       /* Capture Mode: RB Loading Selection */
+
+#define                AT91_TC_CPCSTOP         (1 <<  6)       /* Waveform Mode: Counter Clock Stopped with RC Compare */
+#define                AT91_TC_CPCDIS          (1 <<  7)       /* Waveform Mode: Counter Clock Disable with RC Compare */
+#define                AT91_TC_EEVTEDG         (3 <<  8)       /* Waveform Mode: External Event Edge Selection */
+#define                        AT91_TC_EEVTEDG_NONE            (0 << 8)
+#define                        AT91_TC_EEVTEDG_RISING          (1 << 8)
+#define                        AT91_TC_EEVTEDG_FALLING         (2 << 8)
+#define                        AT91_TC_EEVTEDG_BOTH            (3 << 8)
+#define                AT91_TC_EEVT            (3 << 10)       /* Waveform Mode: External Event Selection */
+#define                        AT91_TC_EEVT_TIOB               (0 << 10)
+#define                        AT91_TC_EEVT_XC0                (1 << 10)
+#define                        AT91_TC_EEVT_XC1                (2 << 10)
+#define                        AT91_TC_EEVT_XC2                (3 << 10)
+#define                AT91_TC_ENETRG          (1 << 12)       /* Waveform Mode: External Event Trigger Enable */
+#define                AT91_TC_WAVESEL         (3 << 13)       /* Waveform Mode: Waveform Selection */
+#define                        AT91_TC_WAVESEL_UP              (0 << 13)
+#define                        AT91_TC_WAVESEL_UP_AUTO         (2 << 13)
+#define                        AT91_TC_WAVESEL_UPDOWN          (1 << 13)
+#define                        AT91_TC_WAVESEL_UPDOWN_AUTO     (3 << 13)
+#define                AT91_TC_ACPA            (3 << 16)       /* Waveform Mode: RA Compare Effect on TIOA */
+#define                        AT91_TC_ACPA_NONE               (0 << 16)
+#define                        AT91_TC_ACPA_SET                (1 << 16)
+#define                        AT91_TC_ACPA_CLEAR              (2 << 16)
+#define                        AT91_TC_ACPA_TOGGLE             (3 << 16)
+#define                AT91_TC_ACPC            (3 << 18)       /* Waveform Mode: RC Compre Effect on TIOA */
+#define                        AT91_TC_ACPC_NONE               (0 << 18)
+#define                        AT91_TC_ACPC_SET                (1 << 18)
+#define                        AT91_TC_ACPC_CLEAR              (2 << 18)
+#define                        AT91_TC_ACPC_TOGGLE             (3 << 18)
+#define                AT91_TC_AEEVT           (3 << 20)       /* Waveform Mode: External Event Effect on TIOA */
+#define                        AT91_TC_AEEVT_NONE              (0 << 20)
+#define                        AT91_TC_AEEVT_SET               (1 << 20)
+#define                        AT91_TC_AEEVT_CLEAR             (2 << 20)
+#define                        AT91_TC_AEEVT_TOGGLE            (3 << 20)
+#define                AT91_TC_ASWTRG          (3 << 22)       /* Waveform Mode: Software Trigger Effect on TIOA */
+#define                        AT91_TC_ASWTRG_NONE             (0 << 22)
+#define                        AT91_TC_ASWTRG_SET              (1 << 22)
+#define                        AT91_TC_ASWTRG_CLEAR            (2 << 22)
+#define                        AT91_TC_ASWTRG_TOGGLE           (3 << 22)
+#define                AT91_TC_BCPB            (3 << 24)       /* Waveform Mode: RB Compare Effect on TIOB */
+#define                        AT91_TC_BCPB_NONE               (0 << 24)
+#define                        AT91_TC_BCPB_SET                (1 << 24)
+#define                        AT91_TC_BCPB_CLEAR              (2 << 24)
+#define                        AT91_TC_BCPB_TOGGLE             (3 << 24)
+#define                AT91_TC_BCPC            (3 << 26)       /* Waveform Mode: RC Compare Effect on TIOB */
+#define                        AT91_TC_BCPC_NONE               (0 << 26)
+#define                        AT91_TC_BCPC_SET                (1 << 26)
+#define                        AT91_TC_BCPC_CLEAR              (2 << 26)
+#define                        AT91_TC_BCPC_TOGGLE             (3 << 26)
+#define                AT91_TC_BEEVT           (3 << 28)       /* Waveform Mode: External Event Effect on TIOB */
+#define                        AT91_TC_BEEVT_NONE              (0 << 28)
+#define                        AT91_TC_BEEVT_SET               (1 << 28)
+#define                        AT91_TC_BEEVT_CLEAR             (2 << 28)
+#define                        AT91_TC_BEEVT_TOGGLE            (3 << 28)
+#define                AT91_TC_BSWTRG          (3 << 30)       /* Waveform Mode: Software Trigger Effect on TIOB */
+#define                        AT91_TC_BSWTRG_NONE             (0 << 30)
+#define                        AT91_TC_BSWTRG_SET              (1 << 30)
+#define                        AT91_TC_BSWTRG_CLEAR            (2 << 30)
+#define                        AT91_TC_BSWTRG_TOGGLE           (3 << 30)
+
+#define AT91_TC_CV             0x10            /* Counter Value */
+#define AT91_TC_RA             0x14            /* Register A */
+#define AT91_TC_RB             0x18            /* Register B */
+#define AT91_TC_RC             0x1c            /* Register C */
+
+#define AT91_TC_SR             0x20            /* Status Register */
+#define                AT91_TC_COVFS           (1 <<  0)       /* Counter Overflow Status */
+#define                AT91_TC_LOVRS           (1 <<  1)       /* Load Overrun Status */
+#define                AT91_TC_CPAS            (1 <<  2)       /* RA Compare Status */
+#define                AT91_TC_CPBS            (1 <<  3)       /* RB Compare Status */
+#define                AT91_TC_CPCS            (1 <<  4)       /* RC Compare Status */
+#define                AT91_TC_LDRAS           (1 <<  5)       /* RA Loading Status */
+#define                AT91_TC_LDRBS           (1 <<  6)       /* RB Loading Status */
+#define                AT91_TC_ETRGS           (1 <<  7)       /* External Trigger Status */
+#define                AT91_TC_CLKSTA          (1 << 16)       /* Clock Enabling Status */
+#define                AT91_TC_MTIOA           (1 << 17)       /* TIOA Mirror */
+#define                AT91_TC_MTIOB           (1 << 18)       /* TIOB Mirror */
+
+#define AT91_TC_IER            0x24            /* Interrupt Enable Register */
+#define AT91_TC_IDR            0x28            /* Interrupt Disable Register */
+#define AT91_TC_IMR            0x2c            /* Interrupt Mask Register */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91_twi.h b/include/asm-arm/arch-at91/at91_twi.h
new file mode 100644 (file)
index 0000000..ca9a907
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * include/asm-arm/arch-at91/at91_twi.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Two-wire Interface (TWI) registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91_TWI_H
+#define AT91_TWI_H
+
+#define        AT91_TWI_CR             0x00            /* Control Register */
+#define                AT91_TWI_START          (1 <<  0)       /* Send a Start Condition */
+#define                AT91_TWI_STOP           (1 <<  1)       /* Send a Stop Condition */
+#define                AT91_TWI_MSEN           (1 <<  2)       /* Master Transfer Enable */
+#define                AT91_TWI_MSDIS          (1 <<  3)       /* Master Transfer Disable */
+#define                AT91_TWI_SWRST          (1 <<  7)       /* Software Reset */
+
+#define        AT91_TWI_MMR            0x04            /* Master Mode Register */
+#define                AT91_TWI_IADRSZ         (3    <<  8)    /* Internal Device Address Size */
+#define                        AT91_TWI_IADRSZ_NO              (0 << 8)
+#define                        AT91_TWI_IADRSZ_1               (1 << 8)
+#define                        AT91_TWI_IADRSZ_2               (2 << 8)
+#define                        AT91_TWI_IADRSZ_3               (3 << 8)
+#define                AT91_TWI_MREAD          (1    << 12)    /* Master Read Direction */
+#define                AT91_TWI_DADR           (0x7f << 16)    /* Device Address */
+
+#define        AT91_TWI_IADR           0x0c            /* Internal Address Register */
+
+#define        AT91_TWI_CWGR           0x10            /* Clock Waveform Generator Register */
+#define                AT91_TWI_CLDIV          (0xff <<  0)    /* Clock Low Divisor */
+#define                AT91_TWI_CHDIV          (0xff <<  8)    /* Clock High Divisor */
+#define                AT91_TWI_CKDIV          (7    << 16)    /* Clock Divider */
+
+#define        AT91_TWI_SR             0x20            /* Status Register */
+#define                AT91_TWI_TXCOMP         (1 <<  0)       /* Transmission Complete */
+#define                AT91_TWI_RXRDY          (1 <<  1)       /* Receive Holding Register Ready */
+#define                AT91_TWI_TXRDY          (1 <<  2)       /* Transmit Holding Register Ready */
+#define                AT91_TWI_OVRE           (1 <<  6)       /* Overrun Error [AT91RM9200 only] */
+#define                AT91_TWI_UNRE           (1 <<  7)       /* Underrun Error [AT91RM9200 only] */
+#define                AT91_TWI_NACK           (1 <<  8)       /* Not Acknowledged */
+
+#define        AT91_TWI_IER            0x24            /* Interrupt Enable Register */
+#define        AT91_TWI_IDR            0x28            /* Interrupt Disable Register */
+#define        AT91_TWI_IMR            0x2c            /* Interrupt Mask Register */
+#define        AT91_TWI_RHR            0x30            /* Receive Holding Register */
+#define        AT91_TWI_THR            0x34            /* Transmit Holding Register */
+
+#endif
+
diff --git a/include/asm-arm/arch-at91/at91_wdt.h b/include/asm-arm/arch-at91/at91_wdt.h
new file mode 100644 (file)
index 0000000..7251a34
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * include/asm-arm/arch-at91/at91_wdt.h
+ *
+ * Watchdog Timer (WDT) - System peripherals regsters.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * 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 AT91_WDT_H
+#define AT91_WDT_H
+
+#define AT91_WDT_CR            (AT91_WDT + 0x00)       /* Watchdog Control Register */
+#define                AT91_WDT_WDRSTT         (1    << 0)             /* Restart */
+#define                AT91_WDT_KEY            (0xff << 24)            /* KEY Password */
+
+#define AT91_WDT_MR            (AT91_WDT + 0x04)       /* Watchdog Mode Register */
+#define                AT91_WDT_WDV            (0xfff << 0)            /* Counter Value */
+#define                AT91_WDT_WDFIEN         (1     << 12)           /* Fault Interrupt Enable */
+#define                AT91_WDT_WDRSTEN        (1     << 13)           /* Reset Processor */
+#define                AT91_WDT_WDRPROC        (1     << 14)           /* Timer Restart */
+#define                AT91_WDT_WDDIS          (1     << 15)           /* Watchdog Disable */
+#define                AT91_WDT_WDD            (0xfff << 16)           /* Delta Value */
+#define                AT91_WDT_WDDBGHLT       (1     << 28)           /* Debug Halt */
+#define                AT91_WDT_WDIDLEHLT      (1     << 29)           /* Idle Halt */
+
+#define AT91_WDT_SR            (AT91_WDT + 0x08)       /* Watchdog Status Register */
+#define                AT91_WDT_WDUNF          (1 << 0)                /* Watchdog Underflow */
+#define                AT91_WDT_WDERR          (1 << 1)                /* Watchdog Error */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91rm9200.h b/include/asm-arm/arch-at91/at91rm9200.h
new file mode 100644 (file)
index 0000000..a12ac8a
--- /dev/null
@@ -0,0 +1,291 @@
+/*
+ * include/asm-arm/arch-at91/at91rm9200.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Common definitions.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91RM9200_H
+#define AT91RM9200_H
+
+/*
+ * Peripheral identifiers/interrupts.
+ */
+#define AT91_ID_FIQ            0       /* Advanced Interrupt Controller (FIQ) */
+#define AT91_ID_SYS            1       /* System Peripheral */
+#define AT91RM9200_ID_PIOA     2       /* Parallel IO Controller A */
+#define AT91RM9200_ID_PIOB     3       /* Parallel IO Controller B */
+#define AT91RM9200_ID_PIOC     4       /* Parallel IO Controller C */
+#define AT91RM9200_ID_PIOD     5       /* Parallel IO Controller D */
+#define AT91RM9200_ID_US0      6       /* USART 0 */
+#define AT91RM9200_ID_US1      7       /* USART 1 */
+#define AT91RM9200_ID_US2      8       /* USART 2 */
+#define AT91RM9200_ID_US3      9       /* USART 3 */
+#define AT91RM9200_ID_MCI      10      /* Multimedia Card Interface */
+#define AT91RM9200_ID_UDP      11      /* USB Device Port */
+#define AT91RM9200_ID_TWI      12      /* Two-Wire Interface */
+#define AT91RM9200_ID_SPI      13      /* Serial Peripheral Interface */
+#define AT91RM9200_ID_SSC0     14      /* Serial Synchronous Controller 0 */
+#define AT91RM9200_ID_SSC1     15      /* Serial Synchronous Controller 1 */
+#define AT91RM9200_ID_SSC2     16      /* Serial Synchronous Controller 2 */
+#define AT91RM9200_ID_TC0      17      /* Timer Counter 0 */
+#define AT91RM9200_ID_TC1      18      /* Timer Counter 1 */
+#define AT91RM9200_ID_TC2      19      /* Timer Counter 2 */
+#define AT91RM9200_ID_TC3      20      /* Timer Counter 3 */
+#define AT91RM9200_ID_TC4      21      /* Timer Counter 4 */
+#define AT91RM9200_ID_TC5      22      /* Timer Counter 5 */
+#define AT91RM9200_ID_UHP      23      /* USB Host port */
+#define AT91RM9200_ID_EMAC     24      /* Ethernet MAC */
+#define AT91RM9200_ID_IRQ0     25      /* Advanced Interrupt Controller (IRQ0) */
+#define AT91RM9200_ID_IRQ1     26      /* Advanced Interrupt Controller (IRQ1) */
+#define AT91RM9200_ID_IRQ2     27      /* Advanced Interrupt Controller (IRQ2) */
+#define AT91RM9200_ID_IRQ3     28      /* Advanced Interrupt Controller (IRQ3) */
+#define AT91RM9200_ID_IRQ4     29      /* Advanced Interrupt Controller (IRQ4) */
+#define AT91RM9200_ID_IRQ5     30      /* Advanced Interrupt Controller (IRQ5) */
+#define AT91RM9200_ID_IRQ6     31      /* Advanced Interrupt Controller (IRQ6) */
+
+
+/*
+ * Peripheral physical base addresses.
+ */
+#define AT91RM9200_BASE_TCB0   0xfffa0000
+#define AT91RM9200_BASE_TC0    0xfffa0000
+#define AT91RM9200_BASE_TC1    0xfffa0040
+#define AT91RM9200_BASE_TC2    0xfffa0080
+#define AT91RM9200_BASE_TCB1   0xfffa4000
+#define AT91RM9200_BASE_TC3    0xfffa4000
+#define AT91RM9200_BASE_TC4    0xfffa4040
+#define AT91RM9200_BASE_TC5    0xfffa4080
+#define AT91RM9200_BASE_UDP    0xfffb0000
+#define AT91RM9200_BASE_MCI    0xfffb4000
+#define AT91RM9200_BASE_TWI    0xfffb8000
+#define AT91RM9200_BASE_EMAC   0xfffbc000
+#define AT91RM9200_BASE_US0    0xfffc0000
+#define AT91RM9200_BASE_US1    0xfffc4000
+#define AT91RM9200_BASE_US2    0xfffc8000
+#define AT91RM9200_BASE_US3    0xfffcc000
+#define AT91RM9200_BASE_SSC0   0xfffd0000
+#define AT91RM9200_BASE_SSC1   0xfffd4000
+#define AT91RM9200_BASE_SSC2   0xfffd8000
+#define AT91RM9200_BASE_SPI    0xfffe0000
+#define AT91_BASE_SYS          0xfffff000
+
+
+/*
+ * System Peripherals (offset from AT91_BASE_SYS)
+ */
+#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)    /* Advanced Interrupt Controller */
+#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)    /* Debug Unit */
+#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)    /* PIO Controller A */
+#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)    /* PIO Controller B */
+#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)    /* PIO Controller C */
+#define AT91_PIOD      (0xfffffa00 - AT91_BASE_SYS)    /* PIO Controller D */
+#define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)    /* Power Management Controller */
+#define AT91_ST                (0xfffffd00 - AT91_BASE_SYS)    /* System Timer */
+#define AT91_RTC       (0xfffffe00 - AT91_BASE_SYS)    /* Real-Time Clock */
+#define AT91_MC                (0xffffff00 - AT91_BASE_SYS)    /* Memory Controllers */
+
+#define AT91_MATRIX    0       /* not supported */
+
+/*
+ * Internal Memory.
+ */
+#define AT91RM9200_ROM_BASE    0x00100000      /* Internal ROM base address */
+#define AT91RM9200_ROM_SIZE    SZ_128K         /* Internal ROM size (128Kb) */
+
+#define AT91RM9200_SRAM_BASE   0x00200000      /* Internal SRAM base address */
+#define AT91RM9200_SRAM_SIZE   SZ_16K          /* Internal SRAM size (16Kb) */
+
+#define AT91RM9200_UHP_BASE    0x00300000      /* USB Host controller */
+
+
+#if 0
+/*
+ * PIO pin definitions (peripheral A/B multiplexing).
+ */
+#define AT91_PA0_MISO          (1 <<  0)       /* A: SPI Master-In Slave-Out */
+#define AT91_PA0_PCK3          (1 <<  0)       /* B: PMC Programmable Clock Output 3 */
+#define AT91_PA1_MOSI          (1 <<  1)       /* A: SPI Master-Out Slave-In */
+#define AT91_PA1_PCK0          (1 <<  1)       /* B: PMC Programmable Clock Output 0 */
+#define AT91_PA2_SPCK          (1 <<  2)       /* A: SPI Serial Clock */
+#define AT91_PA2_IRQ4          (1 <<  2)       /* B: External Interrupt 4 */
+#define AT91_PA3_NPCS0         (1 <<  3)       /* A: SPI Peripheral Chip Select 0 */
+#define AT91_PA3_IRQ5          (1 <<  3)       /* B: External Interrupt 5 */
+#define AT91_PA4_NPCS1         (1 <<  4)       /* A: SPI Peripheral Chip Select 1 */
+#define AT91_PA4_PCK1          (1 <<  4)       /* B: PMC Programmable Clock Output 1 */
+#define AT91_PA5_NPCS2         (1 <<  5)       /* A: SPI Peripheral Chip Select 2 */
+#define AT91_PA5_TXD3          (1 <<  5)       /* B: USART Transmit Data 3 */
+#define AT91_PA6_NPCS3         (1 <<  6)       /* A: SPI Peripheral Chip Select 3 */
+#define AT91_PA6_RXD3          (1 <<  6)       /* B: USART Receive Data 3 */
+#define AT91_PA7_ETXCK_EREFCK  (1 <<  7)       /* A: Ethernet Reference Clock / Transmit Clock */
+#define AT91_PA7_PCK2          (1 <<  7)       /* B: PMC Programmable Clock Output 2 */
+#define AT91_PA8_ETXEN         (1 <<  8)       /* A: Ethernet Transmit Enable */
+#define AT91_PA8_MCCDB         (1 <<  8)       /* B: MMC Multimedia Card B Command */
+#define AT91_PA9_ETX0          (1 <<  9)       /* A: Ethernet Transmit Data 0 */
+#define AT91_PA9_MCDB0         (1 <<  9)       /* B: MMC Multimedia Card B Data 0 */
+#define AT91_PA10_ETX1         (1 << 10)       /* A: Ethernet Transmit Data 1 */
+#define AT91_PA10_MCDB1                (1 << 10)       /* B: MMC Multimedia Card B Data 1 */
+#define AT91_PA11_ECRS_ECRSDV  (1 << 11)       /* A: Ethernet Carrier Sense / Data Valid */
+#define AT91_PA11_MCDB2                (1 << 11)       /* B: MMC Multimedia Card B Data 2 */
+#define AT91_PA12_ERX0         (1 << 12)       /* A: Ethernet Receive Data 0 */
+#define AT91_PA12_MCDB3                (1 << 12)       /* B: MMC Multimedia Card B Data 3 */
+#define AT91_PA13_ERX1         (1 << 13)       /* A: Ethernet Receive Data 1 */
+#define AT91_PA13_TCLK0                (1 << 13)       /* B: TC External Clock Input 0 */
+#define AT91_PA14_ERXER                (1 << 14)       /* A: Ethernet Receive Error */
+#define AT91_PA14_TCLK1                (1 << 14)       /* B: TC External Clock Input 1 */
+#define AT91_PA15_EMDC         (1 << 15)       /* A: Ethernet Management Data Clock */
+#define AT91_PA15_TCLK2                (1 << 15)       /* B: TC External Clock Input 2 */
+#define AT91_PA16_EMDIO                (1 << 16)       /* A: Ethernet Management Data I/O */
+#define AT91_PA16_IRQ6         (1 << 16)       /* B: External Interrupt 6 */
+#define AT91_PA17_TXD0         (1 << 17)       /* A: USART Transmit Data 0 */
+#define AT91_PA17_TIOA0                (1 << 17)       /* B: TC I/O Line A 0 */
+#define AT91_PA18_RXD0         (1 << 18)       /* A: USART Receive Data 0 */
+#define AT91_PA18_TIOB0                (1 << 18)       /* B: TC I/O Line B 0 */
+#define AT91_PA19_SCK0         (1 << 19)       /* A: USART Serial Clock 0 */
+#define AT91_PA19_TIOA1                (1 << 19)       /* B: TC I/O Line A 1 */
+#define AT91_PA20_CTS0         (1 << 20)       /* A: USART Clear To Send 0 */
+#define AT91_PA20_TIOB1                (1 << 20)       /* B: TC I/O Line B 1 */
+#define AT91_PA21_RTS0         (1 << 21)       /* A: USART Ready To Send 0 */
+#define AT91_PA21_TIOA2                (1 << 21)       /* B: TC I/O Line A 2 */
+#define AT91_PA22_RXD2         (1 << 22)       /* A: USART Receive Data 2 */
+#define AT91_PA22_TIOB2                (1 << 22)       /* B: TC I/O Line B 2 */
+#define AT91_PA23_TXD2         (1 << 23)       /* A: USART Transmit Data 2 */
+#define AT91_PA23_IRQ3         (1 << 23)       /* B: External Interrupt 3 */
+#define AT91_PA24_SCK2         (1 << 24)       /* A: USART Serial Clock 2 */
+#define AT91_PA24_PCK1         (1 << 24)       /* B: PMC Programmable Clock Output 1 */
+#define AT91_PA25_TWD          (1 << 25)       /* A: TWI Two-wire Serial Data */
+#define AT91_PA25_IRQ2         (1 << 25)       /* B: External Interrupt 2 */
+#define AT91_PA26_TWCK         (1 << 26)       /* A: TWI Two-wire Serial Clock */
+#define AT91_PA26_IRQ1         (1 << 26)       /* B: External Interrupt 1 */
+#define AT91_PA27_MCCK         (1 << 27)       /* A: MMC Multimedia Card Clock */
+#define AT91_PA27_TCLK3                (1 << 27)       /* B: TC External Clock Input 3 */
+#define AT91_PA28_MCCDA                (1 << 28)       /* A: MMC Multimedia Card A Command */
+#define AT91_PA28_TCLK4                (1 << 28)       /* B: TC External Clock Input 4 */
+#define AT91_PA29_MCDA0                (1 << 29)       /* A: MMC Multimedia Card A Data 0 */
+#define AT91_PA29_TCLK5                (1 << 29)       /* B: TC External Clock Input 5 */
+#define AT91_PA30_DRXD         (1 << 30)       /* A: DBGU Receive Data */
+#define AT91_PA30_CTS2         (1 << 30)       /* B: USART Clear To Send 2 */
+#define AT91_PA31_DTXD         (1 << 31)       /* A: DBGU Transmit Data */
+#define AT91_PA31_RTS2         (1 << 31)       /* B: USART Ready To Send 2 */
+
+#define AT91_PB0_TF0           (1 <<  0)       /* A: SSC Transmit Frame Sync 0 */
+#define AT91_PB0_RTS3          (1 <<  0)       /* B: USART Ready To Send 3 */
+#define AT91_PB1_TK0           (1 <<  1)       /* A: SSC Transmit Clock 0 */
+#define AT91_PB1_CTS3          (1 <<  1)       /* B: USART Clear To Send 3 */
+#define AT91_PB2_TD0           (1 <<  2)       /* A: SSC Transmit Data 0 */
+#define AT91_PB2_SCK3          (1 <<  2)       /* B: USART Serial Clock 3 */
+#define AT91_PB3_RD0           (1 <<  3)       /* A: SSC Receive Data 0 */
+#define AT91_PB3_MCDA1         (1 <<  3)       /* B: MMC Multimedia Card A Data 1 */
+#define AT91_PB4_RK0           (1 <<  4)       /* A: SSC Receive Clock 0 */
+#define AT91_PB4_MCDA2         (1 <<  4)       /* B: MMC Multimedia Card A Data 2 */
+#define AT91_PB5_RF0           (1 <<  5)       /* A: SSC Receive Frame Sync 0 */
+#define AT91_PB5_MCDA3         (1 <<  5)       /* B: MMC Multimedia Card A Data 3 */
+#define AT91_PB6_TF1           (1 <<  6)       /* A: SSC Transmit Frame Sync 1 */
+#define AT91_PB6_TIOA3         (1 <<  6)       /* B: TC I/O Line A 3 */
+#define AT91_PB7_TK1           (1 <<  7)       /* A: SSC Transmit Clock 1 */
+#define AT91_PB7_TIOB3         (1 <<  7)       /* B: TC I/O Line B 3 */
+#define AT91_PB8_TD1           (1 <<  8)       /* A: SSC Transmit Data 1 */
+#define AT91_PB8_TIOA4         (1 <<  8)       /* B: TC I/O Line A 4 */
+#define AT91_PB9_RD1           (1 <<  9)       /* A: SSC Receive Data 1 */
+#define AT91_PB9_TIOB4         (1 <<  9)       /* B: TC I/O Line B 4 */
+#define AT91_PB10_RK1          (1 << 10)       /* A: SSC Receive Clock 1 */
+#define AT91_PB10_TIOA5                (1 << 10)       /* B: TC I/O Line A 5 */
+#define AT91_PB11_RF1          (1 << 11)       /* A: SSC Receive Frame Sync 1 */
+#define AT91_PB11_TIOB5                (1 << 11)       /* B: TC I/O Line B 5 */
+#define AT91_PB12_TF2          (1 << 12)       /* A: SSC Transmit Frame Sync 2 */
+#define AT91_PB12_ETX2         (1 << 12)       /* B: Ethernet Transmit Data 2 */
+#define AT91_PB13_TK2          (1 << 13)       /* A: SSC Transmit Clock 3 */
+#define AT91_PB13_ETX3         (1 << 13)       /* B: Ethernet Transmit Data 3 */
+#define AT91_PB14_TD2          (1 << 14)       /* A: SSC Transmit Data 2 */
+#define AT91_PB14_ETXER                (1 << 14)       /* B: Ethernet Transmit Coding Error */
+#define AT91_PB15_RD2          (1 << 15)       /* A: SSC Receive Data 2 */
+#define AT91_PB15_ERX2         (1 << 15)       /* B: Ethernet Receive Data 2 */
+#define AT91_PB16_RK2          (1 << 16)       /* A: SSC Receive Clock 2 */
+#define AT91_PB16_ERX3         (1 << 16)       /* B: Ethernet Receive Data 3 */
+#define AT91_PB17_RF2          (1 << 17)       /* A: SSC Receive Frame Sync 2 */
+#define AT91_PB17_ERXDV                (1 << 17)       /* B: Ethernet Receive Data Valid */
+#define AT91_PB18_RI1          (1 << 18)       /* A: USART Ring Indicator 1 */
+#define AT91_PB18_ECOL         (1 << 18)       /* B: Ethernet Collision Detected */
+#define AT91_PB19_DTR1         (1 << 19)       /* A: USART Data Terminal Ready 1 */
+#define AT91_PB19_ERXCK                (1 << 19)       /* B: Ethernet Receive Clock */
+#define AT91_PB20_TXD1         (1 << 20)       /* A: USART Transmit Data 1 */
+#define AT91_PB21_RXD1         (1 << 21)       /* A: USART Receive Data 1 */
+#define AT91_PB22_SCK1         (1 << 22)       /* A: USART Serial Clock 1 */
+#define AT91_PB23_DCD1         (1 << 23)       /* A: USART Data Carrier Detect 1 */
+#define AT91_PB24_CTS1         (1 << 24)       /* A: USART Clear To Send 1 */
+#define AT91_PB25_DSR1         (1 << 25)       /* A: USART Data Set Ready 1 */
+#define AT91_PB25_EF100                (1 << 25)       /* B: Ethernet Force 100 Mbit */
+#define AT91_PB26_RTS1         (1 << 26)       /* A: USART Ready To Send 1 */
+#define AT91_PB27_PCK0         (1 << 27)       /* B: PMC Programmable Clock Output 0 */
+#define AT91_PB28_FIQ          (1 << 28)       /* A: Fast Interrupt */
+#define AT91_PB29_IRQ0         (1 << 29)       /* A: External Interrupt 0 */
+
+#define AT91_PC0_BFCK          (1 <<  0)       /* A: Burst Flash Clock */
+#define AT91_PC1_BFRDY_SMOE    (1 <<  1)       /* A: Burst Flash Ready / SmartMedia Output Enable */
+#define AT91_PC2_BFAVD         (1 <<  2)       /* A: Burst Flash Address Valid */
+#define AT91_PC3_BFBAA_SMWE    (1 <<  3)       /* A: Burst Flash Address Advance / SmartMedia Write Enable */
+#define AT91_PC4_BFOE          (1 <<  4)       /* A: Burst Flash Output Enable */
+#define AT91_PC5_BFWE          (1 <<  5)       /* A: Burst Flash Write Enable */
+#define AT91_PC6_NWAIT         (1 <<  6)       /* A: SMC Wait Signal */
+#define AT91_PC7_A23           (1 <<  7)       /* A: Address Bus 23 */
+#define AT91_PC8_A24           (1 <<  8)       /* A: Address Bus 24 */
+#define AT91_PC9_A25_CFRNW     (1 <<  9)       /* A: Address Bus 25 / Compact Flash Read Not Write */
+#define AT91_PC10_NCS4_CFCS    (1 << 10)       /* A: SMC Chip Select 4 / Compact Flash Chip Select */
+#define AT91_PC11_NCS5_CFCE1   (1 << 11)       /* A: SMC Chip Select 5 / Compact Flash Chip Enable 1 */
+#define AT91_PC12_NCS6_CFCE2   (1 << 12)       /* A: SMC Chip Select 6 / Compact Flash Chip Enable 2 */
+#define AT91_PC13_NCS7         (1 << 13)       /* A: Chip Select 7 */
+
+#define AT91_PD0_ETX0          (1 <<  0)       /* A: Ethernet Transmit Data 0 */
+#define AT91_PD1_ETX1          (1 <<  1)       /* A: Ethernet Transmit Data 1 */
+#define AT91_PD2_ETX2          (1 <<  2)       /* A: Ethernet Transmit Data 2 */
+#define AT91_PD3_ETX3          (1 <<  3)       /* A: Ethernet Transmit Data 3 */
+#define AT91_PD4_ETXEN         (1 <<  4)       /* A: Ethernet Transmit Enable */
+#define AT91_PD5_ETXER         (1 <<  5)       /* A: Ethernet Transmit Coding Error */
+#define AT91_PD6_DTXD          (1 <<  6)       /* A: DBGU Transmit Data */
+#define AT91_PD7_PCK0          (1 <<  7)       /* A: PMC Programmable Clock Output 0 */
+#define AT91_PD7_TSYNC         (1 <<  7)       /* B: ETM Trace Synchronization Signal */
+#define AT91_PD8_PCK1          (1 <<  8)       /* A: PMC Programmable Clock Output 1 */
+#define AT91_PD8_TCLK          (1 <<  8)       /* B: ETM Trace Clock */
+#define AT91_PD9_PCK2          (1 <<  9)       /* A: PMC Programmable Clock Output 2 */
+#define AT91_PD9_TPS0          (1 <<  9)       /* B: ETM Trace ARM Pipeline Status 0 */
+#define AT91_PD10_PCK3         (1 << 10)       /* A: PMC Programmable Clock Output 3 */
+#define AT91_PD10_TPS1         (1 << 10)       /* B: ETM Trace ARM Pipeline Status 1 */
+#define AT91_PD11_TPS2         (1 << 11)       /* B: ETM Trace ARM Pipeline Status 2 */
+#define AT91_PD12_TPK0         (1 << 12)       /* B: ETM Trace Packet Port 0 */
+#define AT91_PD13_TPK1         (1 << 13)       /* B: ETM Trace Packet Port 1 */
+#define AT91_PD14_TPK2         (1 << 14)       /* B: ETM Trace Packet Port 2 */
+#define AT91_PD15_TD0          (1 << 15)       /* A: SSC Transmit Data 0 */
+#define AT91_PD15_TPK3         (1 << 15)       /* B: ETM Trace Packet Port 3 */
+#define AT91_PD16_TD1          (1 << 16)       /* A: SSC Transmit Data 1 */
+#define AT91_PD16_TPK4         (1 << 16)       /* B: ETM Trace Packet Port 4 */
+#define AT91_PD17_TD2          (1 << 17)       /* A: SSC Transmit Data 2 */
+#define AT91_PD17_TPK5         (1 << 17)       /* B: ETM Trace Packet Port 5 */
+#define AT91_PD18_NPCS1                (1 << 18)       /* A: SPI Peripheral Chip Select 1 */
+#define AT91_PD18_TPK6         (1 << 18)       /* B: ETM Trace Packet Port 6 */
+#define AT91_PD19_NPCS2                (1 << 19)       /* A: SPI Peripheral Chip Select 2 */
+#define AT91_PD19_TPK7         (1 << 19)       /* B: ETM Trace Packet Port 7 */
+#define AT91_PD20_NPCS3                (1 << 20)       /* A: SPI Peripheral Chip Select 3 */
+#define AT91_PD20_TPK8         (1 << 20)       /* B: ETM Trace Packet Port 8 */
+#define AT91_PD21_RTS0         (1 << 21)       /* A: USART Ready To Send 0 */
+#define AT91_PD21_TPK9         (1 << 21)       /* B: ETM Trace Packet Port 9 */
+#define AT91_PD22_RTS1         (1 << 22)       /* A: USART Ready To Send 1 */
+#define AT91_PD22_TPK10                (1 << 22)       /* B: ETM Trace Packet Port 10 */
+#define AT91_PD23_RTS2         (1 << 23)       /* A: USART Ready To Send 2 */
+#define AT91_PD23_TPK11                (1 << 23)       /* B: ETM Trace Packet Port 11 */
+#define AT91_PD24_RTS3         (1 << 24)       /* A: USART Ready To Send 3 */
+#define AT91_PD24_TPK12                (1 << 24)       /* B: ETM Trace Packet Port 12 */
+#define AT91_PD25_DTR1         (1 << 25)       /* A: USART Data Terminal Ready 1 */
+#define AT91_PD25_TPK13                (1 << 25)       /* B: ETM Trace Packet Port 13 */
+#define AT91_PD26_TPK14                (1 << 26)       /* B: ETM Trace Packet Port 14 */
+#define AT91_PD27_TPK15                (1 << 27)       /* B: ETM Trace Packet Port 15 */
+#endif
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91rm9200_emac.h b/include/asm-arm/arch-at91/at91rm9200_emac.h
new file mode 100644 (file)
index 0000000..0c417af
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * include/asm-arm/arch-at91/at91rm9200_emac.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Ethernet MAC registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91RM9200_EMAC_H
+#define AT91RM9200_EMAC_H
+
+#define        AT91_EMAC_CTL           0x00    /* Control Register */
+#define                AT91_EMAC_LB            (1 <<  0)       /* Loopback */
+#define                AT91_EMAC_LBL           (1 <<  1)       /* Loopback Local */
+#define                AT91_EMAC_RE            (1 <<  2)       /* Receive Enable */
+#define                AT91_EMAC_TE            (1 <<  3)       /* Transmit Enable */
+#define                AT91_EMAC_MPE           (1 <<  4)       /* Management Port Enable */
+#define                AT91_EMAC_CSR           (1 <<  5)       /* Clear Statistics Registers */
+#define                AT91_EMAC_INCSTAT       (1 <<  6)       /* Increment Statistics Registers */
+#define                AT91_EMAC_WES           (1 <<  7)       /* Write Enable for Statistics Registers */
+#define                AT91_EMAC_BP            (1 <<  8)       /* Back Pressure */
+
+#define        AT91_EMAC_CFG           0x04    /* Configuration Register */
+#define                AT91_EMAC_SPD           (1 <<  0)       /* Speed */
+#define                AT91_EMAC_FD            (1 <<  1)       /* Full Duplex */
+#define                AT91_EMAC_BR            (1 <<  2)       /* Bit Rate */
+#define                AT91_EMAC_CAF           (1 <<  4)       /* Copy All Frames */
+#define                AT91_EMAC_NBC           (1 <<  5)       /* No Broadcast */
+#define                AT91_EMAC_MTI           (1 <<  6)       /* Multicast Hash Enable */
+#define                AT91_EMAC_UNI           (1 <<  7)       /* Unicast Hash Enable */
+#define                AT91_EMAC_BIG           (1 <<  8)       /* Receive 1522 Bytes */
+#define                AT91_EMAC_EAE           (1 <<  9)       /* External Address Match Enable */
+#define                AT91_EMAC_CLK           (3 << 10)       /* MDC Clock Divisor */
+#define                AT91_EMAC_CLK_DIV8              (0 << 10)
+#define                AT91_EMAC_CLK_DIV16             (1 << 10)
+#define                AT91_EMAC_CLK_DIV32             (2 << 10)
+#define                AT91_EMAC_CLK_DIV64             (3 << 10)
+#define                AT91_EMAC_RTY           (1 << 12)       /* Retry Test */
+#define                AT91_EMAC_RMII          (1 << 13)       /* Reduce MII (RMII) */
+
+#define        AT91_EMAC_SR            0x08    /* Status Register */
+#define                AT91_EMAC_SR_LINK       (1 <<  0)       /* Link */
+#define                AT91_EMAC_SR_MDIO       (1 <<  1)       /* MDIO pin */
+#define                AT91_EMAC_SR_IDLE       (1 <<  2)       /* PHY idle */
+
+#define        AT91_EMAC_TAR           0x0c    /* Transmit Address Register */
+
+#define        AT91_EMAC_TCR           0x10    /* Transmit Control Register */
+#define                AT91_EMAC_LEN           (0x7ff << 0)    /* Transmit Frame Length */
+#define                AT91_EMAC_NCRC          (1     << 15)   /* No CRC */
+
+#define        AT91_EMAC_TSR           0x14    /* Transmit Status Register */
+#define                AT91_EMAC_TSR_OVR       (1 <<  0)       /* Transmit Buffer Overrun */
+#define                AT91_EMAC_TSR_COL       (1 <<  1)       /* Collision Occurred */
+#define                AT91_EMAC_TSR_RLE       (1 <<  2)       /* Retry Limit Exceeded */
+#define                AT91_EMAC_TSR_IDLE      (1 <<  3)       /* Transmitter Idle */
+#define                AT91_EMAC_TSR_BNQ       (1 <<  4)       /* Transmit Buffer not Queued */
+#define                AT91_EMAC_TSR_COMP      (1 <<  5)       /* Transmit Complete */
+#define                AT91_EMAC_TSR_UND       (1 <<  6)       /* Transmit Underrun */
+
+#define        AT91_EMAC_RBQP          0x18    /* Receive Buffer Queue Pointer */
+
+#define        AT91_EMAC_RSR           0x20    /* Receive Status Register */
+#define                AT91_EMAC_RSR_BNA       (1 <<  0)       /* Buffer Not Available */
+#define                AT91_EMAC_RSR_REC       (1 <<  1)       /* Frame Received */
+#define                AT91_EMAC_RSR_OVR       (1 <<  2)       /* RX Overrun */
+
+#define        AT91_EMAC_ISR           0x24    /* Interrupt Status Register */
+#define                AT91_EMAC_DONE          (1 <<  0)       /* Management Done */
+#define                AT91_EMAC_RCOM          (1 <<  1)       /* Receive Complete */
+#define                AT91_EMAC_RBNA          (1 <<  2)       /* Receive Buffer Not Available */
+#define                AT91_EMAC_TOVR          (1 <<  3)       /* Transmit Buffer Overrun */
+#define                AT91_EMAC_TUND          (1 <<  4)       /* Transmit Buffer Underrun */
+#define                AT91_EMAC_RTRY          (1 <<  5)       /* Retry Limit */
+#define                AT91_EMAC_TBRE          (1 <<  6)       /* Transmit Buffer Register Empty */
+#define                AT91_EMAC_TCOM          (1 <<  7)       /* Transmit Complete */
+#define                AT91_EMAC_TIDLE         (1 <<  8)       /* Transmit Idle */
+#define                AT91_EMAC_LINK          (1 <<  9)       /* Link */
+#define                AT91_EMAC_ROVR          (1 << 10)       /* RX Overrun */
+#define                AT91_EMAC_ABT           (1 << 11)       /* Abort */
+
+#define        AT91_EMAC_IER           0x28    /* Interrupt Enable Register */
+#define        AT91_EMAC_IDR           0x2c    /* Interrupt Disable Register */
+#define        AT91_EMAC_IMR           0x30    /* Interrupt Mask Register */
+
+#define        AT91_EMAC_MAN           0x34    /* PHY Maintenance Register */
+#define                AT91_EMAC_DATA          (0xffff << 0)   /* MDIO Data */
+#define                AT91_EMAC_REGA          (0x1f   << 18)  /* MDIO Register */
+#define                AT91_EMAC_PHYA          (0x1f   << 23)  /* MDIO PHY Address */
+#define                AT91_EMAC_RW            (3      << 28)  /* Read/Write operation */
+#define                        AT91_EMAC_RW_W          (1 << 28)
+#define                        AT91_EMAC_RW_R          (2 << 28)
+#define                AT91_EMAC_MAN_802_3     0x40020000      /* IEEE 802.3 value */
+
+/*
+ * Statistics Registers.
+ */
+#define AT91_EMAC_FRA          0x40    /* Frames Transmitted OK */
+#define AT91_EMAC_SCOL         0x44    /* Single Collision Frame */
+#define AT91_EMAC_MCOL         0x48    /* Multiple Collision Frame */
+#define AT91_EMAC_OK           0x4c    /* Frames Received OK */
+#define AT91_EMAC_SEQE         0x50    /* Frame Check Sequence Error */
+#define AT91_EMAC_ALE          0x54    /* Alignmemt Error */
+#define AT91_EMAC_DTE          0x58    /* Deffered Transmission Frame */
+#define AT91_EMAC_LCOL         0x5c    /* Late Collision */
+#define AT91_EMAC_ECOL         0x60    /* Excessive Collision */
+#define AT91_EMAC_TUE          0x64    /* Transmit Underrun Error */
+#define AT91_EMAC_CSE          0x68    /* Carrier Sense Error */
+#define AT91_EMAC_DRFC         0x6c    /* Discard RX Frame */
+#define AT91_EMAC_ROV          0x70    /* Receive Overrun */
+#define AT91_EMAC_CDE          0x74    /* Code Error */
+#define AT91_EMAC_ELR          0x78    /* Excessive Length Error */
+#define AT91_EMAC_RJB          0x7c    /* Receive Jabber */
+#define AT91_EMAC_USF          0x80    /* Undersize Frame */
+#define AT91_EMAC_SQEE         0x84    /* SQE Test Error */
+
+/*
+ * Address Registers.
+ */
+#define AT91_EMAC_HSL          0x90    /* Hash Address Low [31:0] */
+#define AT91_EMAC_HSH          0x94    /* Hash Address High [63:32] */
+#define AT91_EMAC_SA1L         0x98    /* Specific Address 1 Low, bytes 0-3 */
+#define AT91_EMAC_SA1H         0x9c    /* Specific Address 1 High, bytes 4-5 */
+#define AT91_EMAC_SA2L         0xa0    /* Specific Address 2 Low, bytes 0-3 */
+#define AT91_EMAC_SA2H         0xa4    /* Specific Address 2 High, bytes 4-5 */
+#define AT91_EMAC_SA3L         0xa8    /* Specific Address 3 Low, bytes 0-3 */
+#define AT91_EMAC_SA3H         0xac    /* Specific Address 3 High, bytes 4-5 */
+#define AT91_EMAC_SA4L         0xb0    /* Specific Address 4 Low, bytes 0-3 */
+#define AT91_EMAC_SA4H         0xb4    /* Specific Address 4 High, bytes 4-5 */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91rm9200_mc.h b/include/asm-arm/arch-at91/at91rm9200_mc.h
new file mode 100644 (file)
index 0000000..24d0129
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * include/asm-arm/arch-at91/at91rm9200_mc.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Memory Controllers (MC, EBI, SMC, SDRAMC, BFC) - System peripherals registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 AT91RM9200_MC_H
+#define AT91RM9200_MC_H
+
+/* Memory Controller */
+#define AT91_MC_RCR            (AT91_MC + 0x00)        /* MC Remap Control Register */
+#define                AT91_MC_RCB             (1 <<  0)               /* Remap Command Bit */
+
+#define AT91_MC_ASR            (AT91_MC + 0x04)        /* MC Abort Status Register */
+#define                AT91_MC_UNADD           (1 <<  0)               /* Undefined Address Abort Status */
+#define                AT91_MC_MISADD          (1 <<  1)               /* Misaligned Address Abort Status */
+#define                AT91_MC_ABTSZ           (3 <<  8)               /* Abort Size Status */
+#define                        AT91_MC_ABTSZ_BYTE              (0 << 8)
+#define                        AT91_MC_ABTSZ_HALFWORD          (1 << 8)
+#define                        AT91_MC_ABTSZ_WORD              (2 << 8)
+#define                AT91_MC_ABTTYP          (3 << 10)               /* Abort Type Status */
+#define                        AT91_MC_ABTTYP_DATAREAD         (0 << 10)
+#define                        AT91_MC_ABTTYP_DATAWRITE        (1 << 10)
+#define                        AT91_MC_ABTTYP_FETCH            (2 << 10)
+#define                AT91_MC_MST0            (1 << 16)               /* ARM920T Abort Source */
+#define                AT91_MC_MST1            (1 << 17)               /* PDC Abort Source */
+#define                AT91_MC_MST2            (1 << 18)               /* UHP Abort Source */
+#define                AT91_MC_MST3            (1 << 19)               /* EMAC Abort Source */
+#define                AT91_MC_SVMST0          (1 << 24)               /* Saved ARM920T Abort Source */
+#define                AT91_MC_SVMST1          (1 << 25)               /* Saved PDC Abort Source */
+#define                AT91_MC_SVMST2          (1 << 26)               /* Saved UHP Abort Source */
+#define                AT91_MC_SVMST3          (1 << 27)               /* Saved EMAC Abort Source */
+
+#define AT91_MC_AASR           (AT91_MC + 0x08)        /* MC Abort Address Status Register */
+
+#define AT91_MC_MPR            (AT91_MC + 0x0c)        /* MC Master Priority Register */
+#define                AT91_MPR_MSTP0          (7 <<  0)               /* ARM920T Priority */
+#define                AT91_MPR_MSTP1          (7 <<  4)               /* PDC Priority */
+#define                AT91_MPR_MSTP2          (7 <<  8)               /* UHP Priority */
+#define                AT91_MPR_MSTP3          (7 << 12)               /* EMAC Priority */
+
+/* External Bus Interface (EBI) registers */
+#define AT91_EBI_CSA           (AT91_MC + 0x60)        /* Chip Select Assignment Register */
+#define                AT91_EBI_CS0A           (1 << 0)                /* Chip Select 0 Assignment */
+#define                        AT91_EBI_CS0A_SMC               (0 << 0)
+#define                        AT91_EBI_CS0A_BFC               (1 << 0)
+#define                AT91_EBI_CS1A           (1 << 1)                /* Chip Select 1 Assignment */
+#define                        AT91_EBI_CS1A_SMC               (0 << 1)
+#define                        AT91_EBI_CS1A_SDRAMC            (1 << 1)
+#define                AT91_EBI_CS3A           (1 << 3)                /* Chip Select 2 Assignment */
+#define                        AT91_EBI_CS3A_SMC               (0 << 3)
+#define                        AT91_EBI_CS3A_SMC_SMARTMEDIA    (1 << 3)
+#define                AT91_EBI_CS4A           (1 << 4)                /* Chip Select 3 Assignment */
+#define                        AT91_EBI_CS4A_SMC               (0 << 4)
+#define                        AT91_EBI_CS4A_SMC_COMPACTFLASH  (1 << 4)
+#define AT91_EBI_CFGR          (AT91_MC + 0x64)        /* Configuration Register */
+#define                AT91_EBI_DBPUC          (1 << 0)                /* Data Bus Pull-Up Configuration */
+
+/* Static Memory Controller (SMC) registers */
+#define        AT91_SMC_CSR(n)         (AT91_MC + 0x70 + ((n) * 4))/* SMC Chip Select Register */
+#define                AT91_SMC_NWS            (0x7f <<  0)            /* Number of Wait States */
+#define                        AT91_SMC_NWS_(x)        ((x) << 0)
+#define                AT91_SMC_WSEN           (1    <<  7)            /* Wait State Enable */
+#define                AT91_SMC_TDF            (0xf  <<  8)            /* Data Float Time */
+#define                        AT91_SMC_TDF_(x)        ((x) << 8)
+#define                AT91_SMC_BAT            (1    << 12)            /* Byte Access Type */
+#define                AT91_SMC_DBW            (3    << 13)            /* Data Bus Width */
+#define                        AT91_SMC_DBW_16         (1 << 13)
+#define                        AT91_SMC_DBW_8          (2 << 13)
+#define                AT91_SMC_DPR            (1 << 15)               /* Data Read Protocol */
+#define                AT91_SMC_ACSS           (3 << 16)               /* Address to Chip Select Setup */
+#define                        AT91_SMC_ACSS_STD       (0 << 16)
+#define                        AT91_SMC_ACSS_1         (1 << 16)
+#define                        AT91_SMC_ACSS_2         (2 << 16)
+#define                        AT91_SMC_ACSS_3         (3 << 16)
+#define                AT91_SMC_RWSETUP        (7 << 24)               /* Read & Write Signal Time Setup */
+#define                        AT91_SMC_RWSETUP_(x)    ((x) << 24)
+#define                AT91_SMC_RWHOLD         (7 << 28)               /* Read & Write Signal Hold Time */
+#define                        AT91_SMC_RWHOLD_(x)     ((x) << 28)
+
+/* SDRAM Controller registers */
+#define AT91_SDRAMC_MR         (AT91_MC + 0x90)        /* Mode Register */
+#define                AT91_SDRAMC_MODE        (0xf << 0)              /* Command Mode */
+#define                        AT91_SDRAMC_MODE_NORMAL         (0 << 0)
+#define                        AT91_SDRAMC_MODE_NOP            (1 << 0)
+#define                        AT91_SDRAMC_MODE_PRECHARGE      (2 << 0)
+#define                        AT91_SDRAMC_MODE_LMR            (3 << 0)
+#define                        AT91_SDRAMC_MODE_REFRESH        (4 << 0)
+#define                AT91_SDRAMC_DBW         (1   << 4)              /* Data Bus Width */
+#define                        AT91_SDRAMC_DBW_32      (0 << 4)
+#define                        AT91_SDRAMC_DBW_16      (1 << 4)
+
+#define AT91_SDRAMC_TR         (AT91_MC + 0x94)        /* Refresh Timer Register */
+#define                AT91_SDRAMC_COUNT       (0xfff << 0)            /* Refresh Timer Count */
+
+#define AT91_SDRAMC_CR         (AT91_MC + 0x98)        /* Configuration Register */
+#define                AT91_SDRAMC_NC          (3   <<  0)             /* Number of Column Bits */
+#define                        AT91_SDRAMC_NC_8        (0 << 0)
+#define                        AT91_SDRAMC_NC_9        (1 << 0)
+#define                        AT91_SDRAMC_NC_10       (2 << 0)
+#define                        AT91_SDRAMC_NC_11       (3 << 0)
+#define                AT91_SDRAMC_NR          (3   <<  2)             /* Number of Row Bits */
+#define                        AT91_SDRAMC_NR_11       (0 << 2)
+#define                        AT91_SDRAMC_NR_12       (1 << 2)
+#define                        AT91_SDRAMC_NR_13       (2 << 2)
+#define                AT91_SDRAMC_NB          (1   <<  4)             /* Number of Banks */
+#define                        AT91_SDRAMC_NB_2        (0 << 4)
+#define                        AT91_SDRAMC_NB_4        (1 << 4)
+#define                AT91_SDRAMC_CAS         (3   <<  5)             /* CAS Latency */
+#define                        AT91_SDRAMC_CAS_2       (2 << 5)
+#define                AT91_SDRAMC_TWR         (0xf <<  7)             /* Write Recovery Delay */
+#define                AT91_SDRAMC_TRC         (0xf << 11)             /* Row Cycle Delay */
+#define                AT91_SDRAMC_TRP         (0xf << 15)             /* Row Precharge Delay */
+#define                AT91_SDRAMC_TRCD        (0xf << 19)             /* Row to Column Delay */
+#define                AT91_SDRAMC_TRAS        (0xf << 23)             /* Active to Precharge Delay */
+#define                AT91_SDRAMC_TXSR        (0xf << 27)             /* Exit Self Refresh to Active Delay */
+
+#define AT91_SDRAMC_SRR                (AT91_MC + 0x9c)        /* Self Refresh Register */
+#define AT91_SDRAMC_LPR                (AT91_MC + 0xa0)        /* Low Power Register */
+#define AT91_SDRAMC_IER                (AT91_MC + 0xa4)        /* Interrupt Enable Register */
+#define AT91_SDRAMC_IDR                (AT91_MC + 0xa8)        /* Interrupt Disable Register */
+#define AT91_SDRAMC_IMR                (AT91_MC + 0xac)        /* Interrupt Mask Register */
+#define AT91_SDRAMC_ISR                (AT91_MC + 0xb0)        /* Interrupt Status Register */
+
+/* Burst Flash Controller register */
+#define AT91_BFC_MR            (AT91_MC + 0xc0)        /* Mode Register */
+#define                AT91_BFC_BFCOM          (3   <<  0)             /* Burst Flash Controller Operating Mode */
+#define                        AT91_BFC_BFCOM_DISABLED (0 << 0)
+#define                        AT91_BFC_BFCOM_ASYNC    (1 << 0)
+#define                        AT91_BFC_BFCOM_BURST    (2 << 0)
+#define                AT91_BFC_BFCC           (3   <<  2)             /* Burst Flash Controller Clock */
+#define                        AT91_BFC_BFCC_MCK       (1 << 2)
+#define                        AT91_BFC_BFCC_DIV2      (2 << 2)
+#define                        AT91_BFC_BFCC_DIV4      (3 << 2)
+#define                AT91_BFC_AVL            (0xf <<  4)             /* Address Valid Latency */
+#define                AT91_BFC_PAGES          (7   <<  8)             /* Page Size */
+#define                        AT91_BFC_PAGES_NO_PAGE  (0 << 8)
+#define                        AT91_BFC_PAGES_16       (1 << 8)
+#define                        AT91_BFC_PAGES_32       (2 << 8)
+#define                        AT91_BFC_PAGES_64       (3 << 8)
+#define                        AT91_BFC_PAGES_128      (4 << 8)
+#define                        AT91_BFC_PAGES_256      (5 << 8)
+#define                        AT91_BFC_PAGES_512      (6 << 8)
+#define                        AT91_BFC_PAGES_1024     (7 << 8)
+#define                AT91_BFC_OEL            (3   << 12)             /* Output Enable Latency */
+#define                AT91_BFC_BAAEN          (1   << 16)             /* Burst Address Advance Enable */
+#define                AT91_BFC_BFOEH          (1   << 17)             /* Burst Flash Output Enable Handling */
+#define                AT91_BFC_MUXEN          (1   << 18)             /* Multiplexed Bus Enable */
+#define                AT91_BFC_RDYEN          (1   << 19)             /* Ready Enable Mode */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91sam9260.h b/include/asm-arm/arch-at91/at91sam9260.h
new file mode 100644 (file)
index 0000000..2cadebc
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9260.h
+ *
+ * (C) 2006 Andrew Victor
+ *
+ * Common definitions.
+ * Based on AT91SAM9260 datasheet revision A (Preliminary).
+ *
+ * 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 AT91SAM9260_H
+#define AT91SAM9260_H
+
+/*
+ * Peripheral identifiers/interrupts.
+ */
+#define AT91_ID_FIQ            0       /* Advanced Interrupt Controller (FIQ) */
+#define AT91_ID_SYS            1       /* System Peripherals */
+#define AT91SAM9260_ID_PIOA    2       /* Parallel IO Controller A */
+#define AT91SAM9260_ID_PIOB    3       /* Parallel IO Controller B */
+#define AT91SAM9260_ID_PIOC    4       /* Parallel IO Controller C */
+#define AT91SAM9260_ID_ADC     5       /* Analog-to-Digital Converter */
+#define AT91SAM9260_ID_US0     6       /* USART 0 */
+#define AT91SAM9260_ID_US1     7       /* USART 1 */
+#define AT91SAM9260_ID_US2     8       /* USART 2 */
+#define AT91SAM9260_ID_MCI     9       /* Multimedia Card Interface */
+#define AT91SAM9260_ID_UDP     10      /* USB Device Port */
+#define AT91SAM9260_ID_TWI     11      /* Two-Wire Interface */
+#define AT91SAM9260_ID_SPI0    12      /* Serial Peripheral Interface 0 */
+#define AT91SAM9260_ID_SPI1    13      /* Serial Peripheral Interface 1 */
+#define AT91SAM9260_ID_SSC     14      /* Serial Synchronous Controller */
+#define AT91SAM9260_ID_TC0     17      /* Timer Counter 0 */
+#define AT91SAM9260_ID_TC1     18      /* Timer Counter 1 */
+#define AT91SAM9260_ID_TC2     19      /* Timer Counter 2 */
+#define AT91SAM9260_ID_UHP     20      /* USB Host port */
+#define AT91SAM9260_ID_EMAC    21      /* Ethernet */
+#define AT91SAM9260_ID_ISI     22      /* Image Sensor Interface */
+#define AT91SAM9260_ID_US3     23      /* USART 3 */
+#define AT91SAM9260_ID_US4     24      /* USART 4 */
+#define AT91SAM9260_ID_US5     25      /* USART 5 */
+#define AT91SAM9260_ID_TC3     26      /* Timer Counter 3 */
+#define AT91SAM9260_ID_TC4     27      /* Timer Counter 4 */
+#define AT91SAM9260_ID_TC5     28      /* Timer Counter 5 */
+#define AT91SAM9260_ID_IRQ0    29      /* Advanced Interrupt Controller (IRQ0) */
+#define AT91SAM9260_ID_IRQ1    30      /* Advanced Interrupt Controller (IRQ1) */
+#define AT91SAM9260_ID_IRQ2    31      /* Advanced Interrupt Controller (IRQ2) */
+
+
+/*
+ * User Peripheral physical base addresses.
+ */
+#define AT91SAM9260_BASE_TCB0          0xfffa0000
+#define AT91SAM9260_BASE_TC0           0xfffa0000
+#define AT91SAM9260_BASE_TC1           0xfffa0040
+#define AT91SAM9260_BASE_TC2           0xfffa0080
+#define AT91SAM9260_BASE_UDP           0xfffa4000
+#define AT91SAM9260_BASE_MCI           0xfffa8000
+#define AT91SAM9260_BASE_TWI           0xfffac000
+#define AT91SAM9260_BASE_US0           0xfffb0000
+#define AT91SAM9260_BASE_US1           0xfffb4000
+#define AT91SAM9260_BASE_US2           0xfffb8000
+#define AT91SAM9260_BASE_SSC           0xfffbc000
+#define AT91SAM9260_BASE_ISI           0xfffc0000
+#define AT91SAM9260_BASE_EMAC          0xfffc4000
+#define AT91SAM9260_BASE_SPI0          0xfffc8000
+#define AT91SAM9260_BASE_SPI1          0xfffcc000
+#define AT91SAM9260_BASE_US3           0xfffd0000
+#define AT91SAM9260_BASE_US4           0xfffd4000
+#define AT91SAM9260_BASE_US5           0xfffd8000
+#define AT91SAM9260_BASE_TCB1          0xfffdc000
+#define AT91SAM9260_BASE_TC3           0xfffdc000
+#define AT91SAM9260_BASE_TC4           0xfffdc040
+#define AT91SAM9260_BASE_TC5           0xfffdc080
+#define AT91SAM9260_BASE_ADC           0xfffe0000
+#define AT91_BASE_SYS                  0xffffe800
+
+/*
+ * System Peripherals (offset from AT91_BASE_SYS)
+ */
+#define AT91_ECC       (0xffffe800 - AT91_BASE_SYS)
+#define AT91_SDRAMC    (0xffffea00 - AT91_BASE_SYS)
+#define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
+#define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
+#define AT91_CCFG      (0xffffef10 - AT91_BASE_SYS)
+#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
+#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)
+#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)
+#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)
+#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)
+#define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
+#define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
+#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
+#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
+#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
+#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
+#define AT91_GPBR      (0xfffffd50 - AT91_BASE_SYS)
+
+
+/*
+ * Internal Memory.
+ */
+#define AT91SAM9260_ROM_BASE   0x00100000      /* Internal ROM base address */
+#define AT91SAM9260_ROM_SIZE   SZ_32K          /* Internal ROM size (32Kb) */
+
+#define AT91SAM9260_SRAM0_BASE 0x00200000      /* Internal SRAM 0 base address */
+#define AT91SAM9260_SRAM0_SIZE SZ_4K           /* Internal SRAM 0 size (4Kb) */
+#define AT91SAM9260_SRAM1_BASE 0x00300000      /* Internal SRAM 1 base address */
+#define AT91SAM9260_SRAM1_SIZE SZ_4K           /* Internal SRAM 1 size (4Kb) */
+
+#define AT91SAM9260_UHP_BASE   0x00500000      /* USB Host controller */
+
+#define AT91SAM9XE_FLASH_BASE  0x00200000      /* Internal FLASH base address */
+#define AT91SAM9XE_SRAM_BASE   0x00300000      /* Internal SRAM base address */
+
+
+#if 0
+/*
+ * PIO pin definitions (peripheral A/B multiplexing).
+ */
+
+// TODO: Add
+
+#endif
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91sam9260_matrix.h b/include/asm-arm/arch-at91/at91sam9260_matrix.h
new file mode 100644 (file)
index 0000000..aacb1e9
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9260_matrix.h
+ *
+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
+ * Based on AT91SAM9260 datasheet revision B.
+ *
+ * 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 AT91SAM9260_MATRIX_H
+#define AT91SAM9260_MATRIX_H
+
+#define AT91_MATRIX_MCFG0      (AT91_MATRIX + 0x00)    /* Master Configuration Register 0 */
+#define AT91_MATRIX_MCFG1      (AT91_MATRIX + 0x04)    /* Master Configuration Register 1 */
+#define AT91_MATRIX_MCFG2      (AT91_MATRIX + 0x08)    /* Master Configuration Register 2 */
+#define AT91_MATRIX_MCFG3      (AT91_MATRIX + 0x0C)    /* Master Configuration Register 3 */
+#define AT91_MATRIX_MCFG4      (AT91_MATRIX + 0x10)    /* Master Configuration Register 4 */
+#define AT91_MATRIX_MCFG5      (AT91_MATRIX + 0x14)    /* Master Configuration Register 5 */
+#define                AT91_MATRIX_ULBT                (7 << 0)        /* Undefined Length Burst Type */
+#define                        AT91_MATRIX_ULBT_INFINITE       (0 << 0)
+#define                        AT91_MATRIX_ULBT_SINGLE         (1 << 0)
+#define                        AT91_MATRIX_ULBT_FOUR           (2 << 0)
+#define                        AT91_MATRIX_ULBT_EIGHT          (3 << 0)
+#define                        AT91_MATRIX_ULBT_SIXTEEN        (4 << 0)
+
+#define AT91_MATRIX_SCFG0      (AT91_MATRIX + 0x40)    /* Slave Configuration Register 0 */
+#define AT91_MATRIX_SCFG1      (AT91_MATRIX + 0x44)    /* Slave Configuration Register 1 */
+#define AT91_MATRIX_SCFG2      (AT91_MATRIX + 0x48)    /* Slave Configuration Register 2 */
+#define AT91_MATRIX_SCFG3      (AT91_MATRIX + 0x4C)    /* Slave Configuration Register 3 */
+#define AT91_MATRIX_SCFG4      (AT91_MATRIX + 0x50)    /* Slave Configuration Register 4 */
+#define                AT91_MATRIX_SLOT_CYCLE          (0xff <<  0)    /* Maximum Number of Allowed Cycles for a Burst */
+#define                AT91_MATRIX_DEFMSTR_TYPE        (3    << 16)    /* Default Master Type */
+#define                        AT91_MATRIX_DEFMSTR_TYPE_NONE   (0 << 16)
+#define                        AT91_MATRIX_DEFMSTR_TYPE_LAST   (1 << 16)
+#define                        AT91_MATRIX_DEFMSTR_TYPE_FIXED  (2 << 16)
+#define                AT91_MATRIX_FIXED_DEFMSTR       (7    << 18)    /* Fixed Index of Default Master */
+#define                AT91_MATRIX_ARBT                (3    << 24)    /* Arbitration Type */
+#define                        AT91_MATRIX_ARBT_ROUND_ROBIN    (0 << 24)
+#define                        AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24)
+
+#define AT91_MATRIX_PRAS0      (AT91_MATRIX + 0x80)    /* Priority Register A for Slave 0 */
+#define AT91_MATRIX_PRAS1      (AT91_MATRIX + 0x88)    /* Priority Register A for Slave 1 */
+#define AT91_MATRIX_PRAS2      (AT91_MATRIX + 0x90)    /* Priority Register A for Slave 2 */
+#define AT91_MATRIX_PRAS3      (AT91_MATRIX + 0x98)    /* Priority Register A for Slave 3 */
+#define AT91_MATRIX_PRAS4      (AT91_MATRIX + 0xA0)    /* Priority Register A for Slave 4 */
+#define                AT91_MATRIX_M0PR                (3 << 0)        /* Master 0 Priority */
+#define                AT91_MATRIX_M1PR                (3 << 4)        /* Master 1 Priority */
+#define                AT91_MATRIX_M2PR                (3 << 8)        /* Master 2 Priority */
+#define                AT91_MATRIX_M3PR                (3 << 12)       /* Master 3 Priority */
+#define                AT91_MATRIX_M4PR                (3 << 16)       /* Master 4 Priority */
+#define                AT91_MATRIX_M5PR                (3 << 20)       /* Master 5 Priority */
+
+#define AT91_MATRIX_MRCR       (AT91_MATRIX + 0x100)   /* Master Remap Control Register */
+#define                AT91_MATRIX_RCB0                (1 << 0)        /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
+#define                AT91_MATRIX_RCB1                (1 << 1)        /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
+
+#define AT91_MATRIX_EBICSA     (AT91_MATRIX + 0x11C)   /* EBI Chip Select Assignment Register */
+#define                AT91_MATRIX_CS1A                (1 << 1)        /* Chip Select 1 Assignment */
+#define                        AT91_MATRIX_CS1A_SMC            (0 << 1)
+#define                        AT91_MATRIX_CS1A_SDRAMC         (1 << 1)
+#define                AT91_MATRIX_CS3A                (1 << 3)        /* Chip Select 3 Assignment */
+#define                        AT91_MATRIX_CS3A_SMC            (0 << 3)
+#define                        AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3)
+#define                AT91_MATRIX_CS4A                (1 << 4)        /* Chip Select 4 Assignment */
+#define                        AT91_MATRIX_CS4A_SMC            (0 << 4)
+#define                        AT91_MATRIX_CS4A_SMC_CF1        (1 << 4)
+#define                AT91_MATRIX_CS5A                (1 << 5 )       /* Chip Select 5 Assignment */
+#define                        AT91_MATRIX_CS5A_SMC            (0 << 5)
+#define                        AT91_MATRIX_CS5A_SMC_CF2        (1 << 5)
+#define                AT91_MATRIX_DBPUC               (1 << 8)        /* Data Bus Pull-up Configuration */
+#define                AT91_MATRIX_VDDIOMSEL           (1 << 16)       /* Memory voltage selection */
+#define                        AT91_MATRIX_VDDIOMSEL_1_8V      (0 << 16)
+#define                        AT91_MATRIX_VDDIOMSEL_3_3V      (1 << 16)
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91sam9261.h b/include/asm-arm/arch-at91/at91sam9261.h
new file mode 100644 (file)
index 0000000..01b58ff
--- /dev/null
@@ -0,0 +1,292 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9261.h
+ *
+ * Copyright (C) SAN People
+ *
+ * Common definitions.
+ * Based on AT91SAM9261 datasheet revision E. (Preliminary)
+ *
+ * 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 AT91SAM9261_H
+#define AT91SAM9261_H
+
+/*
+ * Peripheral identifiers/interrupts.
+ */
+#define AT91_ID_FIQ            0       /* Advanced Interrupt Controller (FIQ) */
+#define AT91_ID_SYS            1       /* System Peripherals */
+#define AT91SAM9261_ID_PIOA    2       /* Parallel IO Controller A */
+#define AT91SAM9261_ID_PIOB    3       /* Parallel IO Controller B */
+#define AT91SAM9261_ID_PIOC    4       /* Parallel IO Controller C */
+#define AT91SAM9261_ID_US0     6       /* USART 0 */
+#define AT91SAM9261_ID_US1     7       /* USART 1 */
+#define AT91SAM9261_ID_US2     8       /* USART 2 */
+#define AT91SAM9261_ID_MCI     9       /* Multimedia Card Interface */
+#define AT91SAM9261_ID_UDP     10      /* USB Device Port */
+#define AT91SAM9261_ID_TWI     11      /* Two-Wire Interface */
+#define AT91SAM9261_ID_SPI0    12      /* Serial Peripheral Interface 0 */
+#define AT91SAM9261_ID_SPI1    13      /* Serial Peripheral Interface 1 */
+#define AT91SAM9261_ID_SSC0    14      /* Serial Synchronous Controller 0 */
+#define AT91SAM9261_ID_SSC1    15      /* Serial Synchronous Controller 1 */
+#define AT91SAM9261_ID_SSC2    16      /* Serial Synchronous Controller 2 */
+#define AT91SAM9261_ID_TC0     17      /* Timer Counter 0 */
+#define AT91SAM9261_ID_TC1     18      /* Timer Counter 1 */
+#define AT91SAM9261_ID_TC2     19      /* Timer Counter 2 */
+#define AT91SAM9261_ID_UHP     20      /* USB Host port */
+#define AT91SAM9261_ID_LCDC    21      /* LDC Controller */
+#define AT91SAM9261_ID_IRQ0    29      /* Advanced Interrupt Controller (IRQ0) */
+#define AT91SAM9261_ID_IRQ1    30      /* Advanced Interrupt Controller (IRQ1) */
+#define AT91SAM9261_ID_IRQ2    31      /* Advanced Interrupt Controller (IRQ2) */
+
+
+/*
+ * User Peripheral physical base addresses.
+ */
+#define AT91SAM9261_BASE_TCB0          0xfffa0000
+#define AT91SAM9261_BASE_TC0           0xfffa0000
+#define AT91SAM9261_BASE_TC1           0xfffa0040
+#define AT91SAM9261_BASE_TC2           0xfffa0080
+#define AT91SAM9261_BASE_UDP           0xfffa4000
+#define AT91SAM9261_BASE_MCI           0xfffa8000
+#define AT91SAM9261_BASE_TWI           0xfffac000
+#define AT91SAM9261_BASE_US0           0xfffb0000
+#define AT91SAM9261_BASE_US1           0xfffb4000
+#define AT91SAM9261_BASE_US2           0xfffb8000
+#define AT91SAM9261_BASE_SSC0          0xfffbc000
+#define AT91SAM9261_BASE_SSC1          0xfffc0000
+#define AT91SAM9261_BASE_SSC2          0xfffc4000
+#define AT91SAM9261_BASE_SPI0          0xfffc8000
+#define AT91SAM9261_BASE_SPI1          0xfffcc000
+#define AT91_BASE_SYS                  0xffffea00
+
+
+/*
+ * System Peripherals (offset from AT91_BASE_SYS)
+ */
+#define AT91_SDRAMC    (0xffffea00 - AT91_BASE_SYS)
+#define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
+#define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
+#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
+#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)
+#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)
+#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)
+#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)
+#define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
+#define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
+#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
+#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
+#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
+#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
+#define AT91_GPBR      (0xfffffd50 - AT91_BASE_SYS)
+
+
+/*
+ * Internal Memory.
+ */
+#define AT91SAM9261_SRAM_BASE  0x00300000      /* Internal SRAM base address */
+#define AT91SAM9261_SRAM_SIZE  0x00028000      /* Internal SRAM size (160Kb) */
+
+#define AT91SAM9261_ROM_BASE   0x00400000      /* Internal ROM base address */
+#define AT91SAM9261_ROM_SIZE   SZ_32K          /* Internal ROM size (32Kb) */
+
+#define AT91SAM9261_UHP_BASE   0x00500000      /* USB Host controller */
+#define AT91SAM9261_LCDC_BASE  0x00600000      /* LDC controller */
+
+
+#if 0
+/*
+ * PIO pin definitions (peripheral A/B multiplexing).
+ */
+#define AT91_PA0_SPI0_MISO     (1 <<  0)       /* A: SPI0 Master In Slave */
+#define AT91_PA0_MCDA0         (1 <<  0)       /* B: Multimedia Card A Data 0 */
+#define AT91_PA1_SPI0_MOSI     (1 <<  1)       /* A: SPI0 Master Out Slave */
+#define AT91_PA1_MCCDA         (1 <<  1)       /* B: Multimedia Card A Command */
+#define AT91_PA2_SPI0_SPCK     (1 <<  2)       /* A: SPI0 Serial Clock */
+#define AT91_PA2_MCCK          (1 <<  2)       /* B: Multimedia Card Clock */
+#define AT91_PA3_SPI0_NPCS0    (1 <<  3)       /* A: SPI0 Peripheral Chip Select 0 */
+#define AT91_PA4_SPI0_NPCS1    (1 <<  4)       /* A: SPI0 Peripheral Chip Select 1 */
+#define AT91_PA4_MCDA1         (1 <<  4)       /* B: Multimedia Card A Data 1 */
+#define AT91_PA5_SPI0_NPCS2    (1 <<  5)       /* A: SPI0 Peripheral Chip Select 2 */
+#define AT91_PA5_MCDA2         (1 <<  5)       /* B: Multimedia Card A Data 2 */
+#define AT91_PA6_SPI0_NPCS3    (1 <<  6)       /* A: SPI0 Peripheral Chip Select 3 */
+#define AT91_PA6_MCDA3         (1 <<  6)       /* B: Multimedia Card A Data 3 */
+#define AT91_PA7_TWD           (1 <<  7)       /* A: TWI Two-wire Serial Data */
+#define AT91_PA7_PCK0          (1 <<  7)       /* B: PMC Programmable clock Output 0 */
+#define AT91_PA8_TWCK          (1 <<  8)       /* A: TWI Two-wire Serial Clock */
+#define AT91_PA8_PCK1          (1 <<  8)       /* B: PMC Programmable clock Output 1 */
+#define AT91_PA9_DRXD          (1 <<  9)       /* A: DBGU Debug Receive Data */
+#define AT91_PA9_PCK2          (1 <<  9)       /* B: PMC Programmable clock Output 2 */
+#define AT91_PA10_DTXD         (1 << 10)       /* A: DBGU Debug Transmit Data */
+#define AT91_PA10_PCK3         (1 << 10)       /* B: PMC Programmable clock Output 3 */
+#define AT91_PA11_TSYNC                (1 << 11)       /* A: Trace Synchronization Signal */
+#define AT91_PA11_SCK1         (1 << 11)       /* B: USART1 Serial Clock */
+#define AT91_PA12_TCLK         (1 << 12)       /* A: Trace Clock */
+#define AT91_PA12_RTS1         (1 << 12)       /* B: USART1 Ready To Send */
+#define AT91_PA13_TPS0         (1 << 13)       /* A: Trace ARM Pipeline Status 0 */
+#define AT91_PA13_CTS1         (1 << 13)       /* B: USART1 Clear To Send */
+#define AT91_PA14_TPS1         (1 << 14)       /* A: Trace ARM Pipeline Status 1 */
+#define AT91_PA14_SCK2         (1 << 14)       /* B: USART2 Serial Clock */
+#define AT91_PA15_TPS2         (1 << 15)       /* A: Trace ARM Pipeline Status 2 */
+#define AT91_PA15_RTS2         (1 << 15)       /* B: USART2 Ready To Send */
+#define AT91_PA16_TPK0         (1 << 16)       /* A: Trace Packet Port 0 */
+#define AT91_PA16_CTS2         (1 << 16)       /* B: USART2 Clear To Send */
+#define AT91_PA17_TPK1         (1 << 17)       /* A: Trace Packet Port 1 */
+#define AT91_PA17_TF1          (1 << 17)       /* B: SSC1 Transmit Frame Sync */
+#define AT91_PA18_TPK2         (1 << 18)       /* A: Trace Packet Port 2 */
+#define AT91_PA18_TK1          (1 << 18)       /* B: SSC1 Transmit Clock */
+#define AT91_PA19_TPK3         (1 << 19)       /* A: Trace Packet Port 3 */
+#define AT91_PA19_TD1          (1 << 19)       /* B: SSC1 Transmit Data */
+#define AT91_PA20_TPK4         (1 << 20)       /* A: Trace Packet Port 4 */
+#define AT91_PA20_RD1          (1 << 20)       /* B: SSC1 Receive Data */
+#define AT91_PA21_TPK5         (1 << 21)       /* A: Trace Packet Port 5 */
+#define AT91_PA21_RK1          (1 << 21)       /* B: SSC1 Receive Clock */
+#define AT91_PA22_TPK6         (1 << 22)       /* A: Trace Packet Port 6 */
+#define AT91_PA22_RF1          (1 << 22)       /* B: SSC1 Receive Frame Sync */
+#define AT91_PA23_TPK7         (1 << 23)       /* A: Trace Packet Port 7 */
+#define AT91_PA23_RTS0         (1 << 23)       /* B: USART0 Ready To Send */
+#define AT91_PA24_TPK8         (1 << 24)       /* A: Trace Packet Port 8 */
+#define AT91_PA24_SPI1_NPCS1   (1 << 24)       /* B: SPI1 Peripheral Chip Select 1 */
+#define AT91_PA25_TPK9         (1 << 25)       /* A: Trace Packet Port 9 */
+#define AT91_PA25_SPI1_NPCS2   (1 << 25)       /* B: SPI1 Peripheral Chip Select 2 */
+#define AT91_PA26_TPK10                (1 << 26)       /* A: Trace Packet Port 10 */
+#define AT91_PA26_SPI1_NPCS3   (1 << 26)       /* B: SPI1 Peripheral Chip Select 3 */
+#define AT91_PA27_TPK11                (1 << 27)       /* A: Trace Packet Port 11 */
+#define AT91_PA27_SPI0_NPCS1   (1 << 27)       /* B: SPI0 Peripheral Chip Select 1 */
+#define AT91_PA28_TPK12                (1 << 28)       /* A: Trace Packet Port 12 */
+#define AT91_PA28_SPI0_NPCS2   (1 << 28)       /* B: SPI0 Peripheral Chip Select 2 */
+#define AT91_PA29_TPK13                (1 << 29)       /* A: Trace Packet Port 13 */
+#define AT91_PA29_SPI0_NPCS3   (1 << 29)       /* B: SPI0 Peripheral Chip Select 3 */
+#define AT91_PA30_TPK14                (1 << 30)       /* A: Trace Packet Port 14 */
+#define AT91_PA30_A23          (1 << 30)       /* B: Address Bus bit 23 */
+#define AT91_PA31_TPK15                (1 << 31)       /* A: Trace Packet Port 15 */
+#define AT91_PA31_A24          (1 << 31)       /* B: Address Bus bit 24 */
+
+#define AT91_PB0_LCDVSYNC      (1 <<  0)       /* A: LCD Vertical Synchronization */
+#define AT91_PB1_LCDHSYNC      (1 <<  1)       /* A: LCD Horizontal Synchronization */
+#define AT91_PB2_LCDDOTCK      (1 <<  2)       /* A: LCD Dot Clock */
+#define AT91_PB2_PCK0          (1 <<  2)       /* B: PMC Programmable clock Output 0 */
+#define AT91_PB3_LCDDEN                (1 <<  3)       /* A: LCD Data Enable */
+#define AT91_PB4_LCDCC         (1 <<  4)       /* A: LCD Contrast Control */
+#define AT91_PB4_LCDD2         (1 <<  4)       /* B: LCD Data Bus Bit 2 */
+#define AT91_PB5_LCDD0         (1 <<  5)       /* A: LCD Data Bus Bit 0 */
+#define AT91_PB5_LCDD3         (1 <<  5)       /* B: LCD Data Bus Bit 3 */
+#define AT91_PB6_LCDD1         (1 <<  6)       /* A: LCD Data Bus Bit 1 */
+#define AT91_PB6_LCDD4         (1 <<  6)       /* B: LCD Data Bus Bit 4 */
+#define AT91_PB7_LCDD2         (1 <<  7)       /* A: LCD Data Bus Bit 2 */
+#define AT91_PB7_LCDD5         (1 <<  7)       /* B: LCD Data Bus Bit 5 */
+#define AT91_PB8_LCDD3         (1 <<  8)       /* A: LCD Data Bus Bit 3 */
+#define AT91_PB8_LCDD6         (1 <<  8)       /* B: LCD Data Bus Bit 6 */
+#define AT91_PB9_LCDD4         (1 <<  9)       /* A: LCD Data Bus Bit 4 */
+#define AT91_PB9_LCDD7         (1 <<  9)       /* B: LCD Data Bus Bit 7 */
+#define AT91_PB10_LCDD5                (1 << 10)       /* A: LCD Data Bus Bit 5 */
+#define AT91_PB10_LCDD10       (1 << 10)       /* B: LCD Data Bus Bit 10 */
+#define AT91_PB11_LCDD6                (1 << 11)       /* A: LCD Data Bus Bit 6 */
+#define AT91_PB11_LCDD11       (1 << 11)       /* B: LCD Data Bus Bit 11 */
+#define AT91_PB12_LCDD7                (1 << 12)       /* A: LCD Data Bus Bit 7 */
+#define AT91_PB12_LCDD12       (1 << 12)       /* B: LCD Data Bus Bit 12 */
+#define AT91_PB13_LCDD8                (1 << 13)       /* A: LCD Data Bus Bit 8 */
+#define AT91_PB13_LCDD13       (1 << 13)       /* B: LCD Data Bus Bit 13 */
+#define AT91_PB14_LCDD9                (1 << 14)       /* A: LCD Data Bus Bit 9 */
+#define AT91_PB14_LCDD14       (1 << 14)       /* B: LCD Data Bus Bit 14 */
+#define AT91_PB15_LCDD10       (1 << 15)       /* A: LCD Data Bus Bit 10 */
+#define AT91_PB15_LCDD15       (1 << 15)       /* B: LCD Data Bus Bit 15 */
+#define AT91_PB16_LCDD11       (1 << 16)       /* A: LCD Data Bus Bit 11 */
+#define AT91_PB16_LCDD19       (1 << 16)       /* B: LCD Data Bus Bit 19 */
+#define AT91_PB17_LCDD12       (1 << 17)       /* A: LCD Data Bus Bit 12 */
+#define AT91_PB17_LCDD20       (1 << 17)       /* B: LCD Data Bus Bit 20 */
+#define AT91_PB18_LCDD13       (1 << 18)       /* A: LCD Data Bus Bit 13 */
+#define AT91_PB18_LCDD21       (1 << 18)       /* B: LCD Data Bus Bit 21 */
+#define AT91_PB19_LCDD14       (1 << 19)       /* A: LCD Data Bus Bit 14 */
+#define AT91_PB19_LCDD22       (1 << 19)       /* B: LCD Data Bus Bit 22 */
+#define AT91_PB20_LCDD15       (1 << 20)       /* A: LCD Data Bus Bit 15 */
+#define AT91_PB20_LCDD23       (1 << 20)       /* B: LCD Data Bus Bit 23 */
+#define AT91_PB21_TF0          (1 << 21)       /* A: SSC0 Transmit Frame Sync */
+#define AT91_PB21_LCDD16       (1 << 21)       /* B: LCD Data Bus Bit 16 */
+#define AT91_PB22_TK0          (1 << 22)       /* A: SSC0 Transmit Clock */
+#define AT91_PB22_LCDD17       (1 << 22)       /* B: LCD Data Bus Bit 17 */
+#define AT91_PB23_TD0          (1 << 23)       /* A: SSC0 Transmit Data */
+#define AT91_PB23_LCDD18       (1 << 23)       /* B: LCD Data Bus Bit 18 */
+#define AT91_PB24_RD0          (1 << 24)       /* A: SSC0 Receive Data */
+#define AT91_PB24_LCDD19       (1 << 24)       /* B: LCD Data Bus Bit 19 */
+#define AT91_PB25_RK0          (1 << 25)       /* A: SSC0 Receive Clock */
+#define AT91_PB25_LCDD20       (1 << 25)       /* B: LCD Data Bus Bit 20 */
+#define AT91_PB26_RF0          (1 << 26)       /* A: SSC0 Receive Frame Sync */
+#define AT91_PB26_LCDD21       (1 << 26)       /* B: LCD Data Bus Bit 21 */
+#define AT91_PB27_SPI1_NPCS1   (1 << 27)       /* A: SPI1 Peripheral Chip Select 1 */
+#define AT91_PB27_LCDD22       (1 << 27)       /* B: LCD Data Bus Bit 22 */
+#define AT91_PB28_SPI1_NPCS0   (1 << 28)       /* A: SPI1 Peripheral Chip Select 0 */
+#define AT91_PB28_LCDD23       (1 << 28)       /* B: LCD Data Bus Bit 23 */
+#define AT91_PB29_SPI1_SPCK    (1 << 29)       /* A: SPI1 Serial Clock */
+#define AT91_PB29_IRQ2         (1 << 29)       /* B: Interrupt input 2 */
+#define AT91_PB30_SPI1_MISO    (1 << 30)       /* A: SPI1 Master In Slave */
+#define AT91_PB30_IRQ1         (1 << 30)       /* B: Interrupt input 1 */
+#define AT91_PB31_SPI1_MOSI    (1 << 31)       /* A: SPI1 Master Out Slave */
+#define AT91_PB31_PCK2         (1 << 31)       /* B: PMC Programmable clock Output 2 */
+
+#define AT91_PC0_SMOE          (1 << 0)        /* A: SmartMedia Output Enable */
+#define AT91_PC0_NCS6          (1 << 0)        /* B: Chip Select 6 */
+#define AT91_PC1_SMWE          (1 << 1)        /* A: SmartMedia Write Enable */
+#define AT91_PC1_NCS7          (1 << 1)        /* B: Chip Select 7 */
+#define AT91_PC2_NWAIT         (1 << 2)        /* A: NWAIT */
+#define AT91_PC2_IRQ0          (1 << 2)        /* B: Interrupt input 0 */
+#define AT91_PC3_A25_CFRNW     (1 << 3)        /* A: Address Bus[25] / Compact Flash Read Not Write */
+#define AT91_PC4_NCS4_CFCS0    (1 << 4)        /* A: Chip Select 4 / CompactFlash Chip Select 0 */
+#define AT91_PC5_NCS5_CFCS1    (1 << 5)        /* A: Chip Select 5 / CompactFlash Chip Select 1 */
+#define AT91_PC6_CFCE1         (1 << 6)        /* A: CompactFlash Chip Enable 1 */
+#define AT91_PC7_CFCE2         (1 << 7)        /* A: CompactFlash Chip Enable 2 */
+#define AT91_PC8_TXD0          (1 << 8)        /* A: USART0 Transmit Data */
+#define AT91_PC8_PCK2          (1 << 8)        /* B: PMC Programmable clock Output 2 */
+#define AT91_PC9_RXD0          (1 << 9)        /* A: USART0 Receive Data */
+#define AT91_PC9_PCK3          (1 << 9)        /* B: PMC Programmable clock Output 3 */
+#define AT91_PC10_RTS0         (1 << 10)       /* A: USART0 Ready To Send */
+#define AT91_PC10_SCK0         (1 << 10)       /* B: USART0 Serial Clock */
+#define AT91_PC11_CTS0         (1 << 11)       /* A: USART0 Clear To Send */
+#define AT91_PC11_FIQ          (1 << 11)       /* B: AIC Fast Interrupt Input */
+#define AT91_PC12_TXD1         (1 << 12)       /* A: USART1 Transmit Data */
+#define AT91_PC12_NCS6         (1 << 12)       /* B: Chip Select 6 */
+#define AT91_PC13_RXD1         (1 << 13)       /* A: USART1 Receive Data */
+#define AT91_PC13_NCS7         (1 << 13)       /* B: Chip Select 7 */
+#define AT91_PC14_TXD2         (1 << 14)       /* A: USART2 Transmit Data */
+#define AT91_PC14_SPI1_NPCS2   (1 << 14)       /* B: SPI1 Peripheral Chip Select 2 */
+#define AT91_PC15_RXD2         (1 << 15)       /* A: USART2 Receive Data */
+#define AT91_PC15_SPI1_NPCS3   (1 << 15)       /* B: SPI1 Peripheral Chip Select 3 */
+#define AT91_PC16_D16          (1 << 16)       /* A: Data Bus [16] */
+#define AT91_PC16_TCLK0                (1 << 16)       /* B: Timer Counter 0 external clock input */
+#define AT91_PC17_D17          (1 << 17)       /* A: Data Bus [17] */
+#define AT91_PC17_TCLK1                (1 << 17)       /* B: Timer Counter 1 external clock input */
+#define AT91_PC18_D18          (1 << 18)       /* A: Data Bus [18] */
+#define AT91_PC18_TCLK2                (1 << 18)       /* B: Timer Counter 2 external clock input */
+#define AT91_PC19_D19          (1 << 19)       /* A: Data Bus [19] */
+#define AT91_PC19_TIOA0                (1 << 19)       /* B: Timer Counter 0 Multipurpose Timer I/O Pin A */
+#define AT91_PC20_D20          (1 << 20)       /* A: Data Bus [20] */
+#define AT91_PC20_TIOB0                (1 << 20)       /* B: Timer Counter 0 Multipurpose Timer I/O Pin B */
+#define AT91_PC21_D21          (1 << 21)       /* A: Data Bus [21] */
+#define AT91_PC21_TIOA1                (1 << 21)       /* B: Timer Counter 1 Multipurpose Timer I/O Pin A */
+#define AT91_PC22_D22          (1 << 22)       /* A: Data Bus [22] */
+#define AT91_PC22_TIOB1                (1 << 22)       /* B: Timer Counter 1 Multipurpose Timer I/O Pin B */
+#define AT91_PC23_D23          (1 << 23)       /* A: Data Bus [23] */
+#define AT91_PC23_TIOA2                (1 << 23)       /* B: Timer Counter 2 Multipurpose Timer I/O Pin A */
+#define AT91_PC24_D24          (1 << 24)       /* A: Data Bus [24] */
+#define AT91_PC24_TIOB2                (1 << 24)       /* B: Timer Counter 2 Multipurpose Timer I/O Pin B */
+#define AT91_PC25_D25          (1 << 25)       /* A: Data Bus [25] */
+#define AT91_PC25_TF2          (1 << 25)       /* B: SSC2 Transmit Frame Sync */
+#define AT91_PC26_D26          (1 << 26)       /* A: Data Bus [26] */
+#define AT91_PC26_TK2          (1 << 26)       /* B: SSC2 Transmit Clock */
+#define AT91_PC27_D27          (1 << 27)       /* A: Data Bus [27] */
+#define AT91_PC27_TD2          (1 << 27)       /* B: SSC2 Transmit Data */
+#define AT91_PC28_D28          (1 << 28)       /* A: Data Bus [28] */
+#define AT91_PC28_RD2          (1 << 28)       /* B: SSC2 Receive Data */
+#define AT91_PC29_D29          (1 << 29)       /* A: Data Bus [29] */
+#define AT91_PC29_RK2          (1 << 29)       /* B: SSC2 Receive Clock */
+#define AT91_PC30_D30          (1 << 30)       /* A: Data Bus [30] */
+#define AT91_PC30_RF2          (1 << 30)       /* B: SSC2 Receive Frame Sync */
+#define AT91_PC31_D31          (1 << 31)       /* A: Data Bus [31] */
+#define AT91_PC31_PCK1         (1 << 31)       /* B: PMC Programmable clock Output 1 */
+#endif
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91sam9261_matrix.h b/include/asm-arm/arch-at91/at91sam9261_matrix.h
new file mode 100644 (file)
index 0000000..6f07242
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9261_matrix.h
+ *
+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * 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 AT91SAM9261_MATRIX_H
+#define AT91SAM9261_MATRIX_H
+
+#define AT91_MATRIX_MCFG       (AT91_MATRIX + 0x00)    /* Master Configuration Register */
+#define                AT91_MATRIX_RCB0        (1 << 0)                /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
+#define                AT91_MATRIX_RCB1        (1 << 1)                /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
+
+#define AT91_MATRIX_SCFG0      (AT91_MATRIX + 0x04)    /* Slave Configuration Register 0 */
+#define AT91_MATRIX_SCFG1      (AT91_MATRIX + 0x08)    /* Slave Configuration Register 1 */
+#define AT91_MATRIX_SCFG2      (AT91_MATRIX + 0x0C)    /* Slave Configuration Register 2 */
+#define AT91_MATRIX_SCFG3      (AT91_MATRIX + 0x10)    /* Slave Configuration Register 3 */
+#define AT91_MATRIX_SCFG4      (AT91_MATRIX + 0x14)    /* Slave Configuration Register 4 */
+#define                AT91_MATRIX_SLOT_CYCLE          (0xff << 0)     /* Maximum Number of Allowed Cycles for a Burst */
+#define                AT91_MATRIX_DEFMSTR_TYPE        (3    << 16)    /* Default Master Type */
+#define                        AT91_MATRIX_DEFMSTR_TYPE_NONE   (0 << 16)
+#define                        AT91_MATRIX_DEFMSTR_TYPE_LAST   (1 << 16)
+#define                        AT91_MATRIX_DEFMSTR_TYPE_FIXED  (2 << 16)
+#define                AT91_MATRIX_FIXED_DEFMSTR       (7    << 18)    /* Fixed Index of Default Master */
+
+#define AT91_MATRIX_TCR                (AT91_MATRIX + 0x24)    /* TCM Configuration Register */
+#define                AT91_MATRIX_ITCM_SIZE           (0xf << 0)      /* Size of ITCM enabled memory block */
+#define                        AT91_MATRIX_ITCM_0              (0 << 0)
+#define                        AT91_MATRIX_ITCM_16             (5 << 0)
+#define                        AT91_MATRIX_ITCM_32             (6 << 0)
+#define                        AT91_MATRIX_ITCM_64             (7 << 0)
+#define                AT91_MATRIX_DTCM_SIZE           (0xf << 4)      /* Size of DTCM enabled memory block */
+#define                        AT91_MATRIX_DTCM_0              (0 << 4)
+#define                        AT91_MATRIX_DTCM_16             (5 << 4)
+#define                        AT91_MATRIX_DTCM_32             (6 << 4)
+#define                        AT91_MATRIX_DTCM_64             (7 << 4)
+
+#define AT91_MATRIX_EBICSA     (AT91_MATRIX + 0x30)    /* EBI Chip Select Assignment Register */
+#define                AT91_MATRIX_CS1A                (1 << 1)        /* Chip Select 1 Assignment */
+#define                        AT91_MATRIX_CS1A_SMC            (0 << 1)
+#define                        AT91_MATRIX_CS1A_SDRAMC         (1 << 1)
+#define                AT91_MATRIX_CS3A                (1 << 3)        /* Chip Select 3 Assignment */
+#define                        AT91_MATRIX_CS3A_SMC            (0 << 3)
+#define                        AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3)
+#define                AT91_MATRIX_CS4A                (1 << 4)        /* Chip Select 4 Assignment */
+#define                        AT91_MATRIX_CS4A_SMC            (0 << 4)
+#define                        AT91_MATRIX_CS4A_SMC_CF1        (1 << 4)
+#define                AT91_MATRIX_CS5A                (1 << 5)        /* Chip Select 5 Assignment */
+#define                        AT91_MATRIX_CS5A_SMC            (0 << 5)
+#define                        AT91_MATRIX_CS5A_SMC_CF2        (1 << 5)
+#define                AT91_MATRIX_DBPUC               (1 << 8)        /* Data Bus Pull-up Configuration */
+
+#define AT91_MATRIX_USBPUCR    (AT91_MATRIX + 0x34)    /* USB Pad Pull-Up Control Register */
+#define                AT91_MATRIX_USBPUCR_PUON        (1 << 30)       /* USB Device PAD Pull-up Enable */
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91sam9263.h b/include/asm-arm/arch-at91/at91sam9263.h
new file mode 100644 (file)
index 0000000..f4af68a
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9263.h
+ *
+ * (C) 2007 Atmel Corporation.
+ *
+ * Common definitions.
+ * Based on AT91SAM9263 datasheet revision B (Preliminary).
+ *
+ * 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 AT91SAM9263_H
+#define AT91SAM9263_H
+
+/*
+ * Peripheral identifiers/interrupts.
+ */
+#define AT91_ID_FIQ            0       /* Advanced Interrupt Controller (FIQ) */
+#define AT91_ID_SYS            1       /* System Peripherals */
+#define AT91SAM9263_ID_PIOA    2       /* Parallel IO Controller A */
+#define AT91SAM9263_ID_PIOB    3       /* Parallel IO Controller B */
+#define AT91SAM9263_ID_PIOCDE  4       /* Parallel IO Controller C, D and E */
+#define AT91SAM9263_ID_US0     7       /* USART 0 */
+#define AT91SAM9263_ID_US1     8       /* USART 1 */
+#define AT91SAM9263_ID_US2     9       /* USART 2 */
+#define AT91SAM9263_ID_MCI0    10      /* Multimedia Card Interface 0 */
+#define AT91SAM9263_ID_MCI1    11      /* Multimedia Card Interface 1 */
+#define AT91SAM9263_ID_CAN     12      /* CAN */
+#define AT91SAM9263_ID_TWI     13      /* Two-Wire Interface */
+#define AT91SAM9263_ID_SPI0    14      /* Serial Peripheral Interface 0 */
+#define AT91SAM9263_ID_SPI1    15      /* Serial Peripheral Interface 1 */
+#define AT91SAM9263_ID_SSC0    16      /* Serial Synchronous Controller 0 */
+#define AT91SAM9263_ID_SSC1    17      /* Serial Synchronous Controller 1 */
+#define AT91SAM9263_ID_AC97C   18      /* AC97 Controller */
+#define AT91SAM9263_ID_TCB     19      /* Timer Counter 0, 1 and 2 */
+#define AT91SAM9263_ID_PWMC    20      /* Pulse Width Modulation Controller */
+#define AT91SAM9263_ID_EMAC    21      /* Ethernet */
+#define AT91SAM9263_ID_2DGE    23      /* 2D Graphic Engine */
+#define AT91SAM9263_ID_UDP     24      /* USB Device Port */
+#define AT91SAM9263_ID_ISI     25      /* Image Sensor Interface */
+#define AT91SAM9263_ID_LCDC    26      /* LCD Controller */
+#define AT91SAM9263_ID_DMA     27      /* DMA Controller */
+#define AT91SAM9263_ID_UHP     29      /* USB Host port */
+#define AT91SAM9263_ID_IRQ0    30      /* Advanced Interrupt Controller (IRQ0) */
+#define AT91SAM9263_ID_IRQ1    31      /* Advanced Interrupt Controller (IRQ1) */
+
+
+/*
+ * User Peripheral physical base addresses.
+ */
+#define AT91SAM9263_BASE_UDP           0xfff78000
+#define AT91SAM9263_BASE_TCB0          0xfff7c000
+#define AT91SAM9263_BASE_TC0           0xfff7c000
+#define AT91SAM9263_BASE_TC1           0xfff7c040
+#define AT91SAM9263_BASE_TC2           0xfff7c080
+#define AT91SAM9263_BASE_MCI0          0xfff80000
+#define AT91SAM9263_BASE_MCI1          0xfff84000
+#define AT91SAM9263_BASE_TWI           0xfff88000
+#define AT91SAM9263_BASE_US0           0xfff8c000
+#define AT91SAM9263_BASE_US1           0xfff90000
+#define AT91SAM9263_BASE_US2           0xfff94000
+#define AT91SAM9263_BASE_SSC0          0xfff98000
+#define AT91SAM9263_BASE_SSC1          0xfff9c000
+#define AT91SAM9263_BASE_AC97C         0xfffa0000
+#define AT91SAM9263_BASE_SPI0          0xfffa4000
+#define AT91SAM9263_BASE_SPI1          0xfffa8000
+#define AT91SAM9263_BASE_CAN           0xfffac000
+#define AT91SAM9263_BASE_PWMC          0xfffb8000
+#define AT91SAM9263_BASE_EMAC          0xfffbc000
+#define AT91SAM9263_BASE_ISI           0xfffc4000
+#define AT91SAM9263_BASE_2DGE          0xfffc8000
+#define AT91_BASE_SYS                  0xffffe000
+
+/*
+ * System Peripherals (offset from AT91_BASE_SYS)
+ */
+#define AT91_ECC0      (0xffffe000 - AT91_BASE_SYS)
+#define AT91_SDRAMC0   (0xffffe200 - AT91_BASE_SYS)
+#define AT91_SMC0      (0xffffe400 - AT91_BASE_SYS)
+#define AT91_ECC1      (0xffffe600 - AT91_BASE_SYS)
+#define AT91_SDRAMC1   (0xffffe800 - AT91_BASE_SYS)
+#define AT91_SMC1      (0xffffea00 - AT91_BASE_SYS)
+#define AT91_MATRIX    (0xffffec00 - AT91_BASE_SYS)
+#define AT91_CCFG      (0xffffed10 - AT91_BASE_SYS)
+#define AT91_DBGU      (0xffffee00 - AT91_BASE_SYS)
+#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
+#define AT91_PIOA      (0xfffff200 - AT91_BASE_SYS)
+#define AT91_PIOB      (0xfffff400 - AT91_BASE_SYS)
+#define AT91_PIOC      (0xfffff600 - AT91_BASE_SYS)
+#define AT91_PIOD      (0xfffff800 - AT91_BASE_SYS)
+#define AT91_PIOE      (0xfffffa00 - AT91_BASE_SYS)
+#define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
+#define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
+#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
+#define AT91_RTT0      (0xfffffd20 - AT91_BASE_SYS)
+#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
+#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
+#define AT91_RTT1      (0xfffffd50 - AT91_BASE_SYS)
+#define AT91_GPBR      (0xfffffd60 - AT91_BASE_SYS)
+
+#define AT91_SMC       AT91_SMC0
+
+/*
+ * Internal Memory.
+ */
+#define AT91SAM9263_SRAM0_BASE 0x00300000      /* Internal SRAM 0 base address */
+#define AT91SAM9263_SRAM0_SIZE (80 * SZ_1K)    /* Internal SRAM 0 size (80Kb) */
+
+#define AT91SAM9263_ROM_BASE   0x00400000      /* Internal ROM base address */
+#define AT91SAM9263_ROM_SIZE   SZ_128K         /* Internal ROM size (128Kb) */
+
+#define AT91SAM9263_SRAM1_BASE 0x00500000      /* Internal SRAM 1 base address */
+#define AT91SAM9263_SRAM1_SIZE SZ_16K          /* Internal SRAM 1 size (16Kb) */
+
+#define AT91SAM9263_LCDC_BASE  0x00700000      /* LCD Controller */
+#define AT91SAM9263_DMAC_BASE  0x00800000      /* DMA Controller */
+#define AT91SAM9263_UHP_BASE   0x00a00000      /* USB Host controller */
+
+#if 0
+/*
+ * PIO pin definitions (peripheral A/B multiplexing).
+ */
+
+// TODO: Add
+
+#endif
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91sam9263_matrix.h b/include/asm-arm/arch-at91/at91sam9263_matrix.h
new file mode 100644 (file)
index 0000000..6fc6e4b
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9263_matrix.h
+ *
+ *  Copyright (C) 2006 Atmel Corporation.
+ *
+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
+ * Based on AT91SAM9263 datasheet revision B (Preliminary).
+ *
+ * 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 AT91SAM9263_MATRIX_H
+#define AT91SAM9263_MATRIX_H
+
+#define AT91_MATRIX_MCFG0      (AT91_MATRIX + 0x00)    /* Master Configuration Register 0 */
+#define AT91_MATRIX_MCFG1      (AT91_MATRIX + 0x04)    /* Master Configuration Register 1 */
+#define AT91_MATRIX_MCFG2      (AT91_MATRIX + 0x08)    /* Master Configuration Register 2 */
+#define AT91_MATRIX_MCFG3      (AT91_MATRIX + 0x0C)    /* Master Configuration Register 3 */
+#define AT91_MATRIX_MCFG4      (AT91_MATRIX + 0x10)    /* Master Configuration Register 4 */
+#define AT91_MATRIX_MCFG5      (AT91_MATRIX + 0x14)    /* Master Configuration Register 5 */
+#define AT91_MATRIX_MCFG6      (AT91_MATRIX + 0x18)    /* Master Configuration Register 6 */
+#define AT91_MATRIX_MCFG7      (AT91_MATRIX + 0x1C)    /* Master Configuration Register 7 */
+#define AT91_MATRIX_MCFG8      (AT91_MATRIX + 0x20)    /* Master Configuration Register 8 */
+#define                AT91_MATRIX_ULBT        (7 << 0)        /* Undefined Length Burst Type */
+#define                        AT91_MATRIX_ULBT_INFINITE       (0 << 0)
+#define                        AT91_MATRIX_ULBT_SINGLE         (1 << 0)
+#define                        AT91_MATRIX_ULBT_FOUR           (2 << 0)
+#define                        AT91_MATRIX_ULBT_EIGHT          (3 << 0)
+#define                        AT91_MATRIX_ULBT_SIXTEEN        (4 << 0)
+
+#define AT91_MATRIX_SCFG0      (AT91_MATRIX + 0x40)    /* Slave Configuration Register 0 */
+#define AT91_MATRIX_SCFG1      (AT91_MATRIX + 0x44)    /* Slave Configuration Register 1 */
+#define AT91_MATRIX_SCFG2      (AT91_MATRIX + 0x48)    /* Slave Configuration Register 2 */
+#define AT91_MATRIX_SCFG3      (AT91_MATRIX + 0x4C)    /* Slave Configuration Register 3 */
+#define AT91_MATRIX_SCFG4      (AT91_MATRIX + 0x50)    /* Slave Configuration Register 4 */
+#define AT91_MATRIX_SCFG5      (AT91_MATRIX + 0x54)    /* Slave Configuration Register 5 */
+#define AT91_MATRIX_SCFG6      (AT91_MATRIX + 0x58)    /* Slave Configuration Register 6 */
+#define AT91_MATRIX_SCFG7      (AT91_MATRIX + 0x5C)    /* Slave Configuration Register 7 */
+#define                AT91_MATRIX_SLOT_CYCLE          (0xff << 0)     /* Maximum Number of Allowed Cycles for a Burst */
+#define                AT91_MATRIX_DEFMSTR_TYPE        (3    << 16)    /* Default Master Type */
+#define                        AT91_MATRIX_DEFMSTR_TYPE_NONE   (0 << 16)
+#define                        AT91_MATRIX_DEFMSTR_TYPE_LAST   (1 << 16)
+#define                        AT91_MATRIX_DEFMSTR_TYPE_FIXED  (2 << 16)
+#define                AT91_MATRIX_FIXED_DEFMSTR       (7    << 18)    /* Fixed Index of Default Master */
+#define                AT91_MATRIX_ARBT                (3    << 24)    /* Arbitration Type */
+#define                        AT91_MATRIX_ARBT_ROUND_ROBIN    (0 << 24)
+#define                        AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24)
+
+#define AT91_MATRIX_PRAS0      (AT91_MATRIX + 0x80)    /* Priority Register A for Slave 0 */
+#define AT91_MATRIX_PRBS0      (AT91_MATRIX + 0x84)    /* Priority Register B for Slave 0 */
+#define AT91_MATRIX_PRAS1      (AT91_MATRIX + 0x88)    /* Priority Register A for Slave 1 */
+#define AT91_MATRIX_PRBS1      (AT91_MATRIX + 0x8C)    /* Priority Register B for Slave 1 */
+#define AT91_MATRIX_PRAS2      (AT91_MATRIX + 0x90)    /* Priority Register A for Slave 2 */
+#define AT91_MATRIX_PRBS2      (AT91_MATRIX + 0x94)    /* Priority Register B for Slave 2 */
+#define AT91_MATRIX_PRAS3      (AT91_MATRIX + 0x98)    /* Priority Register A for Slave 3 */
+#define AT91_MATRIX_PRBS3      (AT91_MATRIX + 0x9C)    /* Priority Register B for Slave 3 */
+#define AT91_MATRIX_PRAS4      (AT91_MATRIX + 0xA0)    /* Priority Register A for Slave 4 */
+#define AT91_MATRIX_PRBS4      (AT91_MATRIX + 0xA4)    /* Priority Register B for Slave 4 */
+#define AT91_MATRIX_PRAS5      (AT91_MATRIX + 0xA8)    /* Priority Register A for Slave 5 */
+#define AT91_MATRIX_PRBS5      (AT91_MATRIX + 0xAC)    /* Priority Register B for Slave 5 */
+#define AT91_MATRIX_PRAS6      (AT91_MATRIX + 0xB0)    /* Priority Register A for Slave 6 */
+#define AT91_MATRIX_PRBS6      (AT91_MATRIX + 0xB4)    /* Priority Register B for Slave 6 */
+#define AT91_MATRIX_PRAS7      (AT91_MATRIX + 0xB8)    /* Priority Register A for Slave 7 */
+#define AT91_MATRIX_PRBS7      (AT91_MATRIX + 0xBC)    /* Priority Register B for Slave 7 */
+#define                AT91_MATRIX_M0PR                (3 << 0)        /* Master 0 Priority */
+#define                AT91_MATRIX_M1PR                (3 << 4)        /* Master 1 Priority */
+#define                AT91_MATRIX_M2PR                (3 << 8)        /* Master 2 Priority */
+#define                AT91_MATRIX_M3PR                (3 << 12)       /* Master 3 Priority */
+#define                AT91_MATRIX_M4PR                (3 << 16)       /* Master 4 Priority */
+#define                AT91_MATRIX_M5PR                (3 << 20)       /* Master 5 Priority */
+#define                AT91_MATRIX_M6PR                (3 << 24)       /* Master 6 Priority */
+#define                AT91_MATRIX_M7PR                (3 << 28)       /* Master 7 Priority */
+#define                AT91_MATRIX_M8PR                (3 << 0)        /* Master 8 Priority (in Register B) */
+
+#define AT91_MATRIX_MRCR       (AT91_MATRIX + 0x100)   /* Master Remap Control Register */
+#define                AT91_MATRIX_RCB0                (1 << 0)        /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
+#define                AT91_MATRIX_RCB1                (1 << 1)        /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
+#define                AT91_MATRIX_RCB2                (1 << 2)
+#define                AT91_MATRIX_RCB3                (1 << 3)
+#define                AT91_MATRIX_RCB4                (1 << 4)
+#define                AT91_MATRIX_RCB5                (1 << 5)
+#define                AT91_MATRIX_RCB6                (1 << 6)
+#define                AT91_MATRIX_RCB7                (1 << 7)
+#define                AT91_MATRIX_RCB8                (1 << 8)
+
+#define AT91_MATRIX_TCMR       (AT91_MATRIX + 0x114)   /* TCM Configuration Register */
+#define                AT91_MATRIX_ITCM_SIZE           (0xf << 0)      /* Size of ITCM enabled memory block */
+#define                        AT91_MATRIX_ITCM_0              (0 << 0)
+#define                        AT91_MATRIX_ITCM_16             (5 << 0)
+#define                        AT91_MATRIX_ITCM_32             (6 << 0)
+#define                AT91_MATRIX_DTCM_SIZE           (0xf << 4)      /* Size of DTCM enabled memory block */
+#define                        AT91_MATRIX_DTCM_0              (0 << 4)
+#define                        AT91_MATRIX_DTCM_16             (5 << 4)
+#define                        AT91_MATRIX_DTCM_32             (6 << 4)
+
+#define AT91_MATRIX_EBI0CSA    (AT91_MATRIX + 0x120)   /* EBI0 Chip Select Assignment Register */
+#define                AT91_MATRIX_EBI0_CS1A           (1 << 1)        /* Chip Select 1 Assignment */
+#define                        AT91_MATRIX_EBI0_CS1A_SMC               (0 << 1)
+#define                        AT91_MATRIX_EBI0_CS1A_SDRAMC            (1 << 1)
+#define                AT91_MATRIX_EBI0_CS3A           (1 << 3)        /* Chip Select 3 Assignment */
+#define                        AT91_MATRIX_EBI0_CS3A_SMC               (0 << 3)
+#define                        AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA    (1 << 3)
+#define                AT91_MATRIX_EBI0_CS4A           (1 << 4)        /* Chip Select 4 Assignment */
+#define                        AT91_MATRIX_EBI0_CS4A_SMC               (0 << 4)
+#define                        AT91_MATRIX_EBI0_CS4A_SMC_CF1           (1 << 4)
+#define                AT91_MATRIX_EBI0_CS5A           (1 << 5)        /* Chip Select 5 Assignment */
+#define                        AT91_MATRIX_EBI0_CS5A_SMC               (0 << 5)
+#define                        AT91_MATRIX_EBI0_CS5A_SMC_CF2           (1 << 5)
+#define                AT91_MATRIX_EBI0_DBPUC          (1 << 8)        /* Data Bus Pull-up Configuration */
+#define                AT91_MATRIX_EBI0_VDDIOMSEL      (1 << 16)       /* Memory voltage selection */
+#define                        AT91_MATRIX_EBI0_VDDIOMSEL_1_8V         (0 << 16)
+#define                        AT91_MATRIX_EBI0_VDDIOMSEL_3_3V         (1 << 16)
+
+#define AT91_MATRIX_EBI1CSA    (AT91_MATRIX + 0x124)   /* EBI1 Chip Select Assignment Register */
+#define                AT91_MATRIX_EBI1_CS1A           (1 << 1)        /* Chip Select 1 Assignment */
+#define                        AT91_MATRIX_EBI1_CS1A_SMC               (0 << 1)
+#define                        AT91_MATRIX_EBI1_CS1A_SDRAMC            (1 << 1)
+#define                AT91_MATRIX_EBI1_CS2A           (1 << 3)        /* Chip Select 3 Assignment */
+#define                        AT91_MATRIX_EBI1_CS2A_SMC               (0 << 3)
+#define                        AT91_MATRIX_EBI1_CS2A_SMC_SMARTMEDIA    (1 << 3)
+#define                AT91_MATRIX_EBI1_DBPUC          (1 << 8)        /* Data Bus Pull-up Configuration */
+#define                AT91_MATRIX_EBI1_VDDIOMSEL      (1 << 16)       /* Memory voltage selection */
+#define                        AT91_MATRIX_EBI1_VDDIOMSEL_1_8V         (0 << 16)
+#define                        AT91_MATRIX_EBI1_VDDIOMSEL_3_3V         (1 << 16)
+
+#endif
diff --git a/include/asm-arm/arch-at91/at91sam926x_mc.h b/include/asm-arm/arch-at91/at91sam926x_mc.h
new file mode 100644 (file)
index 0000000..d82631c
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * include/asm-arm/arch-at91/at91sam926x_mc.h
+ *
+ * Memory Controllers (SMC, SDRAMC) - System peripherals registers.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * 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 AT91SAM926x_MC_H
+#define AT91SAM926x_MC_H
+
+/* SDRAM Controller (SDRAMC) registers */
+#define AT91_SDRAMC_MR         (AT91_SDRAMC + 0x00)    /* SDRAM Controller Mode Register */
+#define                AT91_SDRAMC_MODE        (0xf << 0)              /* Command Mode */
+#define                        AT91_SDRAMC_MODE_NORMAL         0
+#define                        AT91_SDRAMC_MODE_NOP            1
+#define                        AT91_SDRAMC_MODE_PRECHARGE      2
+#define                        AT91_SDRAMC_MODE_LMR            3
+#define                        AT91_SDRAMC_MODE_REFRESH        4
+#define                        AT91_SDRAMC_MODE_EXT_LMR        5
+#define                        AT91_SDRAMC_MODE_DEEP           6
+
+#define AT91_SDRAMC_TR         (AT91_SDRAMC + 0x04)    /* SDRAM Controller Refresh Timer Register */
+#define                AT91_SDRAMC_COUNT       (0xfff << 0)            /* Refresh Timer Counter */
+
+#define AT91_SDRAMC_CR         (AT91_SDRAMC + 0x08)    /* SDRAM Controller Configuration Register */
+#define                AT91_SDRAMC_NC          (3 << 0)                /* Number of Column Bits */
+#define                        AT91_SDRAMC_NC_8        (0 << 0)
+#define                        AT91_SDRAMC_NC_9        (1 << 0)
+#define                        AT91_SDRAMC_NC_10       (2 << 0)
+#define                        AT91_SDRAMC_NC_11       (3 << 0)
+#define                AT91_SDRAMC_NR          (3 << 2)                /* Number of Row Bits */
+#define                        AT91_SDRAMC_NR_11       (0 << 2)
+#define                        AT91_SDRAMC_NR_12       (1 << 2)
+#define                        AT91_SDRAMC_NR_13       (2 << 2)
+#define                AT91_SDRAMC_NB          (1 << 4)                /* Number of Banks */
+#define                        AT91_SDRAMC_NB_2        (0 << 4)
+#define                        AT91_SDRAMC_NB_4        (1 << 4)
+#define                AT91_SDRAMC_CAS         (3 << 5)                /* CAS Latency */
+#define                        AT91_SDRAMC_CAS_1       (1 << 5)
+#define                        AT91_SDRAMC_CAS_2       (2 << 5)
+#define                        AT91_SDRAMC_CAS_3       (3 << 5)
+#define                AT91_SDRAMC_DBW         (1 << 7)                /* Data Bus Width */
+#define                        AT91_SDRAMC_DBW_32      (0 << 7)
+#define                        AT91_SDRAMC_DBW_16      (1 << 7)
+#define                AT91_SDRAMC_TWR         (0xf <<  8)             /* Write Recovery Delay */
+#define                AT91_SDRAMC_TRC         (0xf << 12)             /* Row Cycle Delay */
+#define                AT91_SDRAMC_TRP         (0xf << 16)             /* Row Precharge Delay */
+#define                AT91_SDRAMC_TRCD        (0xf << 20)             /* Row to Column Delay */
+#define                AT91_SDRAMC_TRAS        (0xf << 24)             /* Active to Precharge Delay */
+#define                AT91_SDRAMC_TXSR        (0xf << 28)             /* Exit Self Refresh to Active Delay */
+
+#define AT91_SDRAMC_LPR                (AT91_SDRAMC + 0x10)    /* SDRAM Controller Low Power Register */
+#define                AT91_SDRAMC_LPCB                (3 << 0)        /* Low-power Configurations */
+#define                        AT91_SDRAMC_LPCB_DISABLE                0
+#define                        AT91_SDRAMC_LPCB_SELF_REFRESH           1
+#define                        AT91_SDRAMC_LPCB_POWER_DOWN             2
+#define                        AT91_SDRAMC_LPCB_DEEP_POWER_DOWN        3
+#define                AT91_SDRAMC_PASR                (7 << 4)        /* Partial Array Self Refresh */
+#define                AT91_SDRAMC_TCSR                (3 << 8)        /* Temperature Compensated Self Refresh */
+#define                AT91_SDRAMC_DS                  (3 << 10)       /* Drive Strenght */
+#define                AT91_SDRAMC_TIMEOUT             (3 << 12)       /* Time to define when Low Power Mode is enabled */
+#define                        AT91_SDRAMC_TIMEOUT_0_CLK_CYCLES        (0 << 12)
+#define                        AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES       (1 << 12)
+#define                        AT91_SDRAMC_TIMEOUT_128_CLK_CYCLES      (2 << 12)
+
+#define AT91_SDRAMC_IER                (AT91_SDRAMC + 0x14)    /* SDRAM Controller Interrupt Enable Register */
+#define AT91_SDRAMC_IDR                (AT91_SDRAMC + 0x18)    /* SDRAM Controller Interrupt Disable Register */
+#define AT91_SDRAMC_IMR                (AT91_SDRAMC + 0x1C)    /* SDRAM Controller Interrupt Mask Register */
+#define AT91_SDRAMC_ISR                (AT91_SDRAMC + 0x20)    /* SDRAM Controller Interrupt Status Register */
+#define                AT91_SDRAMC_RES         (1 << 0)                /* Refresh Error Status */
+
+#define AT91_SDRAMC_MDR                (AT91_SDRAMC + 0x24)    /* SDRAM Memory Device Register */
+#define                AT91_SDRAMC_MD          (3 << 0)                /* Memory Device Type */
+#define                        AT91_SDRAMC_MD_SDRAM            0
+#define                        AT91_SDRAMC_MD_LOW_POWER_SDRAM  1
+
+
+/* Static Memory Controller (SMC) registers */
+#define AT91_SMC_SETUP(n)      (AT91_SMC + 0x00 + ((n)*0x10))  /* Setup Register for CS n */
+#define                AT91_SMC_NWESETUP       (0x3f << 0)                     /* NWE Setup Length */
+#define                        AT91_SMC_NWESETUP_(x)   ((x) << 0)
+#define                AT91_SMC_NCS_WRSETUP    (0x3f << 8)                     /* NCS Setup Length in Write Access */
+#define                        AT91_SMC_NCS_WRSETUP_(x)        ((x) << 8)
+#define                AT91_SMC_NRDSETUP       (0x3f << 16)                    /* NRD Setup Length */
+#define                        AT91_SMC_NRDSETUP_(x)   ((x) << 16)
+#define                AT91_SMC_NCS_RDSETUP    (0x3f << 24)                    /* NCS Setup Length in Read Access */
+#define                        AT91_SMC_NCS_RDSETUP_(x)        ((x) << 24)
+
+#define AT91_SMC_PULSE(n)      (AT91_SMC + 0x04 + ((n)*0x10))  /* Pulse Register for CS n */
+#define                AT91_SMC_NWEPULSE       (0x7f <<  0)                    /* NWE Pulse Length */
+#define                        AT91_SMC_NWEPULSE_(x)   ((x) << 0)
+#define                AT91_SMC_NCS_WRPULSE    (0x7f <<  8)                    /* NCS Pulse Length in Write Access */
+#define                        AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
+#define                AT91_SMC_NRDPULSE       (0x7f << 16)                    /* NRD Pulse Length */
+#define                        AT91_SMC_NRDPULSE_(x)   ((x) << 16)
+#define                AT91_SMC_NCS_RDPULSE    (0x7f << 24)                    /* NCS Pulse Length in Read Access */
+#define                        AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
+
+#define AT91_SMC_CYCLE(n)      (AT91_SMC + 0x08 + ((n)*0x10))  /* Cycle Register for CS n */
+#define                AT91_SMC_NWECYCLE       (0x1ff << 0 )                   /* Total Write Cycle Length */
+#define                        AT91_SMC_NWECYCLE_(x)   ((x) << 0)
+#define                AT91_SMC_NRDCYCLE       (0x1ff << 16)                   /* Total Read Cycle Length */
+#define                        AT91_SMC_NRDCYCLE_(x)   ((x) << 16)
+
+#define AT91_SMC_MODE(n)       (AT91_SMC + 0x0c + ((n)*0x10))  /* Mode Register for CS n */
+#define                AT91_SMC_READMODE       (1 <<  0)                       /* Read Mode */
+#define                AT91_SMC_WRITEMODE      (1 <<  1)                       /* Write Mode */
+#define                AT91_SMC_EXNWMODE       (3 <<  4)                       /* NWAIT Mode */
+#define                        AT91_SMC_EXNWMODE_DISABLE       (0 << 4)
+#define                        AT91_SMC_EXNWMODE_FROZEN        (2 << 4)
+#define                        AT91_SMC_EXNWMODE_READY         (3 << 4)
+#define                AT91_SMC_BAT            (1 <<  8)                       /* Byte Access Type */
+#define                        AT91_SMC_BAT_SELECT             (0 << 8)
+#define                        AT91_SMC_BAT_WRITE              (1 << 8)
+#define                AT91_SMC_DBW            (3 << 12)                       /* Data Bus Width */
+#define                        AT91_SMC_DBW_8                  (0 << 12)
+#define                        AT91_SMC_DBW_16                 (1 << 12)
+#define                        AT91_SMC_DBW_32                 (2 << 12)
+#define                AT91_SMC_TDF            (0xf << 16)                     /* Data Float Time. */
+#define                        AT91_SMC_TDF_(x)                ((x) << 16)
+#define                AT91_SMC_TDFMODE        (1 << 20)                       /* TDF Optimization - Enabled */
+#define                AT91_SMC_PMEN           (1 << 24)                       /* Page Mode Enabled */
+#define                AT91_SMC_PS             (3 << 28)                       /* Page Size */
+#define                        AT91_SMC_PS_4                   (0 << 28)
+#define                        AT91_SMC_PS_8                   (1 << 28)
+#define                        AT91_SMC_PS_16                  (2 << 28)
+#define                        AT91_SMC_PS_32                  (3 << 28)
+
+#if defined(AT91_SMC1)         /* The AT91SAM9263 has 2 Static Memory contollers */
+#define AT91_SMC1_SETUP(n)     (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
+#define AT91_SMC1_PULSE(n)     (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
+#define AT91_SMC1_CYCLE(n)     (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
+#define AT91_SMC1_MODE(n)      (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
+#endif
+
+#endif
diff --git a/include/asm-arm/arch-at91/board.h b/include/asm-arm/arch-at91/board.h
new file mode 100644 (file)
index 0000000..7b9903c
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * include/asm-arm/arch-at91/board.h
+ *
+ *  Copyright (C) 2005 HP Labs
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/*
+ * These are data structures found in platform_device.dev.platform_data,
+ * and describing board-specific data needed by drivers.  For example,
+ * which pin is used for a given GPIO role.
+ *
+ * In 2.6, drivers should strongly avoid board-specific knowledge so
+ * that supporting new boards normally won't require driver patches.
+ * Most board-specific knowledge should be in arch/.../board-*.c files.
+ */
+
+#ifndef __ASM_ARCH_BOARD_H
+#define __ASM_ARCH_BOARD_H
+
+#include <linux/mtd/partitions.h>
+#include <linux/device.h>
+#include <linux/spi/spi.h>
+
+ /* USB Device */
+struct at91_udc_data {
+       u8      vbus_pin;               /* high == host powering us */
+       u8      pullup_pin;             /* high == D+ pulled up */
+};
+extern void __init at91_add_device_udc(struct at91_udc_data *data);
+
+ /* Compact Flash */
+struct at91_cf_data {
+       u8      irq_pin;                /* I/O IRQ */
+       u8      det_pin;                /* Card detect */
+       u8      vcc_pin;                /* power switching */
+       u8      rst_pin;                /* card reset */
+       u8      chipselect;             /* EBI Chip Select number */
+};
+extern void __init at91_add_device_cf(struct at91_cf_data *data);
+
+ /* MMC / SD */
+struct at91_mmc_data {
+       u8              det_pin;        /* card detect IRQ */
+       unsigned        slot_b:1;       /* uses Slot B */
+       unsigned        wire4:1;        /* (SD) supports DAT0..DAT3 */
+       u8              wp_pin;         /* (SD) writeprotect detect */
+       u8              vcc_pin;        /* power switching (high == on) */
+};
+extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data);
+
+ /* Ethernet */
+struct at91_eth_data {
+       u8              phy_irq_pin;    /* PHY IRQ */
+       u8              is_rmii;        /* using RMII interface? */
+};
+extern void __init at91_add_device_eth(struct at91_eth_data *data);
+
+#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263)
+#define eth_platform_data      at91_eth_data
+#endif
+
+ /* USB Host */
+struct at91_usbh_data {
+       u8              ports;          /* number of ports on root hub */
+       u8              vbus_pin[];     /* port power-control pin */
+};
+extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
+
+ /* NAND / SmartMedia */
+struct at91_nand_data {
+       u8              enable_pin;     /* chip enable */
+       u8              det_pin;        /* card detect */
+       u8              rdy_pin;        /* ready/busy */
+       u8              ale;            /* address line number connected to ALE */
+       u8              cle;            /* address line number connected to CLE */
+       u8              bus_width_16;   /* buswidth is 16 bit */
+       struct mtd_partition* (*partition_info)(int, int*);
+};
+extern void __init at91_add_device_nand(struct at91_nand_data *data);
+
+ /* I2C*/
+extern void __init at91_add_device_i2c(void);
+
+ /* SPI */
+extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices);
+
+ /* Serial */
+struct at91_uart_config {
+       unsigned short  console_tty;    /* tty number of serial console */
+       unsigned short  nr_tty;         /* number of serial tty's */
+       short           tty_map[];      /* map UART to tty number */
+};
+extern struct platform_device *atmel_default_console_device;
+extern void __init at91_init_serial(struct at91_uart_config *config);
+
+struct atmel_uart_data {
+       short           use_dma_tx;     /* use transmit DMA? */
+       short           use_dma_rx;     /* use receive DMA? */
+       void __iomem    *regs;          /* virtual base address, if any */
+};
+extern void __init at91_add_device_serial(void);
+
+ /* LEDs */
+extern u8 at91_leds_cpu;
+extern u8 at91_leds_timer;
+extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
+
+#endif
diff --git a/include/asm-arm/arch-at91/cpu.h b/include/asm-arm/arch-at91/cpu.h
new file mode 100644 (file)
index 0000000..d464ca5
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * include/asm-arm/arch-at91/cpu.h
+ *
+ *  Copyright (C) 2006 SAN People
+ *
+ * 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_CPU_H
+#define __ASM_ARCH_CPU_H
+
+#include <asm/hardware.h>
+#include <asm/arch/at91_dbgu.h>
+
+
+#define ARCH_ID_AT91RM9200     0x09290780
+#define ARCH_ID_AT91SAM9260    0x019803a0
+#define ARCH_ID_AT91SAM9261    0x019703a0
+#define ARCH_ID_AT91SAM9263    0x019607a0
+
+#define ARCH_ID_AT91SAM9XE128  0x329973a0
+#define ARCH_ID_AT91SAM9XE256  0x329a93a0
+#define ARCH_ID_AT91SAM9XE512  0x329aa3a0
+
+static inline unsigned long at91_cpu_identify(void)
+{
+       return (at91_sys_read(AT91_DBGU_CIDR) & ~AT91_CIDR_VERSION);
+}
+
+
+#define ARCH_FAMILY_AT91X92    0x09200000
+#define ARCH_FAMILY_AT91SAM9   0x01900000
+#define ARCH_FAMILY_AT91SAM9XE 0x02900000
+
+static inline unsigned long at91_arch_identify(void)
+{
+       return (at91_sys_read(AT91_DBGU_CIDR) & AT91_CIDR_ARCH);
+}
+
+
+#ifdef CONFIG_ARCH_AT91RM9200
+#define cpu_is_at91rm9200()    (at91_cpu_identify() == ARCH_ID_AT91RM9200)
+#else
+#define cpu_is_at91rm9200()    (0)
+#endif
+
+#ifdef CONFIG_ARCH_AT91SAM9260
+#define cpu_is_at91sam9xe()    (at91_arch_identify() == ARCH_FAMILY_AT91SAM9XE)
+#define cpu_is_at91sam9260()   ((at91_cpu_identify() == ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe())
+#else
+#define cpu_is_at91sam9xe()    (0)
+#define cpu_is_at91sam9260()   (0)
+#endif
+
+#ifdef CONFIG_ARCH_AT91SAM9261
+#define cpu_is_at91sam9261()   (at91_cpu_identify() == ARCH_ID_AT91SAM9261)
+#else
+#define cpu_is_at91sam9261()   (0)
+#endif
+
+#ifdef CONFIG_ARCH_AT91SAM9263
+#define cpu_is_at91sam9263()   (at91_cpu_identify() == ARCH_ID_AT91SAM9263)
+#else
+#define cpu_is_at91sam9263()   (0)
+#endif
+
+#endif
diff --git a/include/asm-arm/arch-at91/debug-macro.S b/include/asm-arm/arch-at91/debug-macro.S
new file mode 100644 (file)
index 0000000..13e9f5e
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * include/asm-arm/arch-at91/debug-macro.S
+ *
+ *  Copyright (C) 2003-2005 SAN People
+ *
+ * Debugging macro include header
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+#include <asm/hardware.h>
+#include <asm/arch/at91_dbgu.h>
+
+       .macro  addruart,rx
+       mrc     p15, 0, \rx, c1, c0
+       tst     \rx, #1                                         @ MMU enabled?
+       ldreq   \rx, =(AT91_BASE_SYS + AT91_DBGU)               @ System peripherals (phys address)
+       ldrne   \rx, =(AT91_VA_BASE_SYS + AT91_DBGU)            @ System peripherals (virt address)
+       .endm
+
+       .macro  senduart,rd,rx
+       strb    \rd, [\rx, #(AT91_DBGU_THR - AT91_DBGU)]        @ Write to Transmitter Holding Register
+       .endm
+
+       .macro  waituart,rd,rx
+1001:  ldr     \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)]         @ Read Status Register
+       tst     \rd, #AT91_DBGU_TXRDY                           @ DBGU_TXRDY = 1 when ready to transmit
+       beq     1001b
+       .endm
+
+       .macro  busyuart,rd,rx
+1001:  ldr     \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)]         @ Read Status Register
+       tst     \rd, #AT91_DBGU_TXEMPTY                         @ DBGU_TXEMPTY = 1 when transmission complete
+       beq     1001b
+       .endm
+
diff --git a/include/asm-arm/arch-at91/dma.h b/include/asm-arm/arch-at91/dma.h
new file mode 100644 (file)
index 0000000..7745654
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * include/asm-arm/arch-at91/dma.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
diff --git a/include/asm-arm/arch-at91/entry-macro.S b/include/asm-arm/arch-at91/entry-macro.S
new file mode 100644 (file)
index 0000000..76c8ccc
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * include/asm-arm/arch-at91/entry-macro.S
+ *
+ *  Copyright (C) 2003-2005 SAN People
+ *
+ * Low-level IRQ helper macros for AT91RM9200 platforms
+ *
+ * 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 <asm/hardware.h>
+#include <asm/arch/at91_aic.h>
+
+       .macro  disable_fiq
+       .endm
+
+       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
+       ldr     \base, =(AT91_VA_BASE_SYS + AT91_AIC)           @ base virtual address of AIC peripheral
+       ldr     \irqnr, [\base, #(AT91_AIC_IVR - AT91_AIC)]     @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt)
+       ldr     \irqstat, [\base, #(AT91_AIC_ISR - AT91_AIC)]   @ read interrupt source number
+       teq     \irqstat, #0                                    @ ISR is 0 when no current interrupt, or spurious interrupt
+       streq   \tmp, [\base, #(AT91_AIC_EOICR - AT91_AIC)]     @ not going to be handled further, then ACK it now.
+       .endm
+
diff --git a/include/asm-arm/arch-at91/gpio.h b/include/asm-arm/arch-at91/gpio.h
new file mode 100644 (file)
index 0000000..98ad211
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+ * include/asm-arm/arch-at91/gpio.h
+ *
+ *  Copyright (C) 2005 HP Labs
+ *
+ * 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_AT91RM9200_GPIO_H
+#define __ASM_ARCH_AT91RM9200_GPIO_H
+
+#include <asm/irq.h>
+
+#define PIN_BASE               NR_AIC_IRQS
+
+#define MAX_GPIO_BANKS         5
+
+/* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */
+
+#define        AT91_PIN_PA0    (PIN_BASE + 0x00 + 0)
+#define        AT91_PIN_PA1    (PIN_BASE + 0x00 + 1)
+#define        AT91_PIN_PA2    (PIN_BASE + 0x00 + 2)
+#define        AT91_PIN_PA3    (PIN_BASE + 0x00 + 3)
+#define        AT91_PIN_PA4    (PIN_BASE + 0x00 + 4)
+#define        AT91_PIN_PA5    (PIN_BASE + 0x00 + 5)
+#define        AT91_PIN_PA6    (PIN_BASE + 0x00 + 6)
+#define        AT91_PIN_PA7    (PIN_BASE + 0x00 + 7)
+#define        AT91_PIN_PA8    (PIN_BASE + 0x00 + 8)
+#define        AT91_PIN_PA9    (PIN_BASE + 0x00 + 9)
+#define        AT91_PIN_PA10   (PIN_BASE + 0x00 + 10)
+#define        AT91_PIN_PA11   (PIN_BASE + 0x00 + 11)
+#define        AT91_PIN_PA12   (PIN_BASE + 0x00 + 12)
+#define        AT91_PIN_PA13   (PIN_BASE + 0x00 + 13)
+#define        AT91_PIN_PA14   (PIN_BASE + 0x00 + 14)
+#define        AT91_PIN_PA15   (PIN_BASE + 0x00 + 15)
+#define        AT91_PIN_PA16   (PIN_BASE + 0x00 + 16)
+#define        AT91_PIN_PA17   (PIN_BASE + 0x00 + 17)
+#define        AT91_PIN_PA18   (PIN_BASE + 0x00 + 18)
+#define        AT91_PIN_PA19   (PIN_BASE + 0x00 + 19)
+#define        AT91_PIN_PA20   (PIN_BASE + 0x00 + 20)
+#define        AT91_PIN_PA21   (PIN_BASE + 0x00 + 21)
+#define        AT91_PIN_PA22   (PIN_BASE + 0x00 + 22)
+#define        AT91_PIN_PA23   (PIN_BASE + 0x00 + 23)
+#define        AT91_PIN_PA24   (PIN_BASE + 0x00 + 24)
+#define        AT91_PIN_PA25   (PIN_BASE + 0x00 + 25)
+#define        AT91_PIN_PA26   (PIN_BASE + 0x00 + 26)
+#define        AT91_PIN_PA27   (PIN_BASE + 0x00 + 27)
+#define        AT91_PIN_PA28   (PIN_BASE + 0x00 + 28)
+#define        AT91_PIN_PA29   (PIN_BASE + 0x00 + 29)
+#define        AT91_PIN_PA30   (PIN_BASE + 0x00 + 30)
+#define        AT91_PIN_PA31   (PIN_BASE + 0x00 + 31)
+
+#define        AT91_PIN_PB0    (PIN_BASE + 0x20 + 0)
+#define        AT91_PIN_PB1    (PIN_BASE + 0x20 + 1)
+#define        AT91_PIN_PB2    (PIN_BASE + 0x20 + 2)
+#define        AT91_PIN_PB3    (PIN_BASE + 0x20 + 3)
+#define        AT91_PIN_PB4    (PIN_BASE + 0x20 + 4)
+#define        AT91_PIN_PB5    (PIN_BASE + 0x20 + 5)
+#define        AT91_PIN_PB6    (PIN_BASE + 0x20 + 6)
+#define        AT91_PIN_PB7    (PIN_BASE + 0x20 + 7)
+#define        AT91_PIN_PB8    (PIN_BASE + 0x20 + 8)
+#define        AT91_PIN_PB9    (PIN_BASE + 0x20 + 9)
+#define        AT91_PIN_PB10   (PIN_BASE + 0x20 + 10)
+#define        AT91_PIN_PB11   (PIN_BASE + 0x20 + 11)
+#define        AT91_PIN_PB12   (PIN_BASE + 0x20 + 12)
+#define        AT91_PIN_PB13   (PIN_BASE + 0x20 + 13)
+#define        AT91_PIN_PB14   (PIN_BASE + 0x20 + 14)
+#define        AT91_PIN_PB15   (PIN_BASE + 0x20 + 15)
+#define        AT91_PIN_PB16   (PIN_BASE + 0x20 + 16)
+#define        AT91_PIN_PB17   (PIN_BASE + 0x20 + 17)
+#define        AT91_PIN_PB18   (PIN_BASE + 0x20 + 18)
+#define        AT91_PIN_PB19   (PIN_BASE + 0x20 + 19)
+#define        AT91_PIN_PB20   (PIN_BASE + 0x20 + 20)
+#define        AT91_PIN_PB21   (PIN_BASE + 0x20 + 21)
+#define        AT91_PIN_PB22   (PIN_BASE + 0x20 + 22)
+#define        AT91_PIN_PB23   (PIN_BASE + 0x20 + 23)
+#define        AT91_PIN_PB24   (PIN_BASE + 0x20 + 24)
+#define        AT91_PIN_PB25   (PIN_BASE + 0x20 + 25)
+#define        AT91_PIN_PB26   (PIN_BASE + 0x20 + 26)
+#define        AT91_PIN_PB27   (PIN_BASE + 0x20 + 27)
+#define        AT91_PIN_PB28   (PIN_BASE + 0x20 + 28)
+#define        AT91_PIN_PB29   (PIN_BASE + 0x20 + 29)
+#define        AT91_PIN_PB30   (PIN_BASE + 0x20 + 30)
+#define        AT91_PIN_PB31   (PIN_BASE + 0x20 + 31)
+
+#define        AT91_PIN_PC0    (PIN_BASE + 0x40 + 0)
+#define        AT91_PIN_PC1    (PIN_BASE + 0x40 + 1)
+#define        AT91_PIN_PC2    (PIN_BASE + 0x40 + 2)
+#define        AT91_PIN_PC3    (PIN_BASE + 0x40 + 3)
+#define        AT91_PIN_PC4    (PIN_BASE + 0x40 + 4)
+#define        AT91_PIN_PC5    (PIN_BASE + 0x40 + 5)
+#define        AT91_PIN_PC6    (PIN_BASE + 0x40 + 6)
+#define        AT91_PIN_PC7    (PIN_BASE + 0x40 + 7)
+#define        AT91_PIN_PC8    (PIN_BASE + 0x40 + 8)
+#define        AT91_PIN_PC9    (PIN_BASE + 0x40 + 9)
+#define        AT91_PIN_PC10   (PIN_BASE + 0x40 + 10)
+#define        AT91_PIN_PC11   (PIN_BASE + 0x40 + 11)
+#define        AT91_PIN_PC12   (PIN_BASE + 0x40 + 12)
+#define        AT91_PIN_PC13   (PIN_BASE + 0x40 + 13)
+#define        AT91_PIN_PC14   (PIN_BASE + 0x40 + 14)
+#define        AT91_PIN_PC15   (PIN_BASE + 0x40 + 15)
+#define        AT91_PIN_PC16   (PIN_BASE + 0x40 + 16)
+#define        AT91_PIN_PC17   (PIN_BASE + 0x40 + 17)
+#define        AT91_PIN_PC18   (PIN_BASE + 0x40 + 18)
+#define        AT91_PIN_PC19   (PIN_BASE + 0x40 + 19)
+#define        AT91_PIN_PC20   (PIN_BASE + 0x40 + 20)
+#define        AT91_PIN_PC21   (PIN_BASE + 0x40 + 21)
+#define        AT91_PIN_PC22   (PIN_BASE + 0x40 + 22)
+#define        AT91_PIN_PC23   (PIN_BASE + 0x40 + 23)
+#define        AT91_PIN_PC24   (PIN_BASE + 0x40 + 24)
+#define        AT91_PIN_PC25   (PIN_BASE + 0x40 + 25)
+#define        AT91_PIN_PC26   (PIN_BASE + 0x40 + 26)
+#define        AT91_PIN_PC27   (PIN_BASE + 0x40 + 27)
+#define        AT91_PIN_PC28   (PIN_BASE + 0x40 + 28)
+#define        AT91_PIN_PC29   (PIN_BASE + 0x40 + 29)
+#define        AT91_PIN_PC30   (PIN_BASE + 0x40 + 30)
+#define        AT91_PIN_PC31   (PIN_BASE + 0x40 + 31)
+
+#define        AT91_PIN_PD0    (PIN_BASE + 0x60 + 0)
+#define        AT91_PIN_PD1    (PIN_BASE + 0x60 + 1)
+#define        AT91_PIN_PD2    (PIN_BASE + 0x60 + 2)
+#define        AT91_PIN_PD3    (PIN_BASE + 0x60 + 3)
+#define        AT91_PIN_PD4    (PIN_BASE + 0x60 + 4)
+#define        AT91_PIN_PD5    (PIN_BASE + 0x60 + 5)
+#define        AT91_PIN_PD6    (PIN_BASE + 0x60 + 6)
+#define        AT91_PIN_PD7    (PIN_BASE + 0x60 + 7)
+#define        AT91_PIN_PD8    (PIN_BASE + 0x60 + 8)
+#define        AT91_PIN_PD9    (PIN_BASE + 0x60 + 9)
+#define        AT91_PIN_PD10   (PIN_BASE + 0x60 + 10)
+#define        AT91_PIN_PD11   (PIN_BASE + 0x60 + 11)
+#define        AT91_PIN_PD12   (PIN_BASE + 0x60 + 12)
+#define        AT91_PIN_PD13   (PIN_BASE + 0x60 + 13)
+#define        AT91_PIN_PD14   (PIN_BASE + 0x60 + 14)
+#define        AT91_PIN_PD15   (PIN_BASE + 0x60 + 15)
+#define        AT91_PIN_PD16   (PIN_BASE + 0x60 + 16)
+#define        AT91_PIN_PD17   (PIN_BASE + 0x60 + 17)
+#define        AT91_PIN_PD18   (PIN_BASE + 0x60 + 18)
+#define        AT91_PIN_PD19   (PIN_BASE + 0x60 + 19)
+#define        AT91_PIN_PD20   (PIN_BASE + 0x60 + 20)
+#define        AT91_PIN_PD21   (PIN_BASE + 0x60 + 21)
+#define        AT91_PIN_PD22   (PIN_BASE + 0x60 + 22)
+#define        AT91_PIN_PD23   (PIN_BASE + 0x60 + 23)
+#define        AT91_PIN_PD24   (PIN_BASE + 0x60 + 24)
+#define        AT91_PIN_PD25   (PIN_BASE + 0x60 + 25)
+#define        AT91_PIN_PD26   (PIN_BASE + 0x60 + 26)
+#define        AT91_PIN_PD27   (PIN_BASE + 0x60 + 27)
+#define        AT91_PIN_PD28   (PIN_BASE + 0x60 + 28)
+#define        AT91_PIN_PD29   (PIN_BASE + 0x60 + 29)
+#define        AT91_PIN_PD30   (PIN_BASE + 0x60 + 30)
+#define        AT91_PIN_PD31   (PIN_BASE + 0x60 + 31)
+
+#define        AT91_PIN_PE0    (PIN_BASE + 0x80 + 0)
+#define        AT91_PIN_PE1    (PIN_BASE + 0x80 + 1)
+#define        AT91_PIN_PE2    (PIN_BASE + 0x80 + 2)
+#define        AT91_PIN_PE3    (PIN_BASE + 0x80 + 3)
+#define        AT91_PIN_PE4    (PIN_BASE + 0x80 + 4)
+#define        AT91_PIN_PE5    (PIN_BASE + 0x80 + 5)
+#define        AT91_PIN_PE6    (PIN_BASE + 0x80 + 6)
+#define        AT91_PIN_PE7    (PIN_BASE + 0x80 + 7)
+#define        AT91_PIN_PE8    (PIN_BASE + 0x80 + 8)
+#define        AT91_PIN_PE9    (PIN_BASE + 0x80 + 9)
+#define        AT91_PIN_PE10   (PIN_BASE + 0x80 + 10)
+#define        AT91_PIN_PE11   (PIN_BASE + 0x80 + 11)
+#define        AT91_PIN_PE12   (PIN_BASE + 0x80 + 12)
+#define        AT91_PIN_PE13   (PIN_BASE + 0x80 + 13)
+#define        AT91_PIN_PE14   (PIN_BASE + 0x80 + 14)
+#define        AT91_PIN_PE15   (PIN_BASE + 0x80 + 15)
+#define        AT91_PIN_PE16   (PIN_BASE + 0x80 + 16)
+#define        AT91_PIN_PE17   (PIN_BASE + 0x80 + 17)
+#define        AT91_PIN_PE18   (PIN_BASE + 0x80 + 18)
+#define        AT91_PIN_PE19   (PIN_BASE + 0x80 + 19)
+#define        AT91_PIN_PE20   (PIN_BASE + 0x80 + 20)
+#define        AT91_PIN_PE21   (PIN_BASE + 0x80 + 21)
+#define        AT91_PIN_PE22   (PIN_BASE + 0x80 + 22)
+#define        AT91_PIN_PE23   (PIN_BASE + 0x80 + 23)
+#define        AT91_PIN_PE24   (PIN_BASE + 0x80 + 24)
+#define        AT91_PIN_PE25   (PIN_BASE + 0x80 + 25)
+#define        AT91_PIN_PE26   (PIN_BASE + 0x80 + 26)
+#define        AT91_PIN_PE27   (PIN_BASE + 0x80 + 27)
+#define        AT91_PIN_PE28   (PIN_BASE + 0x80 + 28)
+#define        AT91_PIN_PE29   (PIN_BASE + 0x80 + 29)
+#define        AT91_PIN_PE30   (PIN_BASE + 0x80 + 30)
+#define        AT91_PIN_PE31   (PIN_BASE + 0x80 + 31)
+
+#ifndef __ASSEMBLY__
+/* setup setup routines, called from board init or driver probe() */
+extern int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup);
+extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup);
+extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup);
+extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup);
+extern int __init_or_module at91_set_gpio_output(unsigned pin, int value);
+extern int __init_or_module at91_set_deglitch(unsigned pin, int is_on);
+extern int __init_or_module at91_set_multi_drive(unsigned pin, int is_on);
+
+/* callable at any time */
+extern int at91_set_gpio_value(unsigned pin, int value);
+extern int at91_get_gpio_value(unsigned pin);
+
+/* callable only from core power-management code */
+extern void at91_gpio_suspend(void);
+extern void at91_gpio_resume(void);
+
+/*-------------------------------------------------------------------------*/
+
+/* wrappers for "new style" GPIO calls. the old AT91-specfic ones should
+ * eventually be removed (along with this errno.h inclusion), and the
+ * gpio request/free calls should probably be implemented.
+ */
+
+#include <asm/errno.h>
+
+static inline int gpio_request(unsigned gpio, const char *label)
+{
+       return 0;
+}
+
+static inline void gpio_free(unsigned gpio)
+{
+}
+
+extern int gpio_direction_input(unsigned gpio);
+extern int gpio_direction_output(unsigned gpio);
+
+static inline int gpio_get_value(unsigned gpio)
+{
+       return at91_get_gpio_value(gpio);
+}
+
+static inline void gpio_set_value(unsigned gpio, int value)
+{
+       at91_set_gpio_value(gpio, value);
+}
+
+#include <asm-generic/gpio.h>          /* cansleep wrappers */
+
+static inline int gpio_to_irq(unsigned gpio)
+{
+       return gpio;
+}
+
+static inline int irq_to_gpio(unsigned irq)
+{
+       return irq;
+}
+
+#endif /* __ASSEMBLY__ */
+
+#endif
diff --git a/include/asm-arm/arch-at91/hardware.h b/include/asm-arm/arch-at91/hardware.h
new file mode 100644 (file)
index 0000000..eaaf1c1
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * include/asm-arm/arch-at91/hardware.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *  Copyright (C) 2003 ATMEL
+ *
+ * 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>
+
+#if defined(CONFIG_ARCH_AT91RM9200)
+#include <asm/arch/at91rm9200.h>
+#elif defined(CONFIG_ARCH_AT91SAM9260)
+#include <asm/arch/at91sam9260.h>
+#elif defined(CONFIG_ARCH_AT91SAM9261)
+#include <asm/arch/at91sam9261.h>
+#elif defined(CONFIG_ARCH_AT91SAM9263)
+#include <asm/arch/at91sam9263.h>
+#else
+#error "Unsupported AT91 processor"
+#endif
+
+
+/*
+ * Remap the peripherals from address 0xFFF78000 .. 0xFFFFFFFF
+ * to 0xFEF78000 .. 0xFF000000.  (5444Kb)
+ */
+#define AT91_IO_PHYS_BASE      0xFFF78000
+#define AT91_IO_SIZE           (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1)
+#define AT91_IO_VIRT_BASE      (0xFF000000 - AT91_IO_SIZE)
+
+ /* Convert a physical IO address to virtual IO address */
+#define AT91_IO_P2V(x)         ((x) - AT91_IO_PHYS_BASE + AT91_IO_VIRT_BASE)
+
+/*
+ * Virtual to Physical Address mapping for IO devices.
+ */
+#define AT91_VA_BASE_SYS       AT91_IO_P2V(AT91_BASE_SYS)
+#define AT91_VA_BASE_EMAC      AT91_IO_P2V(AT91RM9200_BASE_EMAC)
+
+ /* Internal SRAM is mapped below the IO devices */
+#define AT91_SRAM_MAX          SZ_1M
+#define AT91_VIRT_BASE         (AT91_IO_VIRT_BASE - AT91_SRAM_MAX)
+
+/* Serial ports */
+#define ATMEL_MAX_UART         7               /* 6 USART3's and one DBGU port (SAM9260) */
+
+/* External Memory Map */
+#define AT91_CHIPSELECT_0      0x10000000
+#define AT91_CHIPSELECT_1      0x20000000
+#define AT91_CHIPSELECT_2      0x30000000
+#define AT91_CHIPSELECT_3      0x40000000
+#define AT91_CHIPSELECT_4      0x50000000
+#define AT91_CHIPSELECT_5      0x60000000
+#define AT91_CHIPSELECT_6      0x70000000
+#define AT91_CHIPSELECT_7      0x80000000
+
+/* SDRAM */
+#define AT91_SDRAM_BASE                AT91_CHIPSELECT_1
+
+/* Clocks */
+#define AT91_SLOW_CLOCK                32768           /* slow clock */
+
+#ifndef __ASSEMBLY__
+#include <asm/io.h>
+
+static inline unsigned int at91_sys_read(unsigned int reg_offset)
+{
+       void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
+
+       return __raw_readl(addr + reg_offset);
+}
+
+static inline void at91_sys_write(unsigned int reg_offset, unsigned long value)
+{
+       void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
+
+       __raw_writel(value, addr + reg_offset);
+}
+#endif
+
+#endif
diff --git a/include/asm-arm/arch-at91/io.h b/include/asm-arm/arch-at91/io.h
new file mode 100644 (file)
index 0000000..401f327
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * include/asm-arm/arch-at91/io.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_IO_H
+#define __ASM_ARCH_IO_H
+
+#include <asm/io.h>
+
+#define IO_SPACE_LIMIT         0xFFFFFFFF
+
+#define __io(a)                        ((void __iomem *)(a))
+#define __mem_pci(a)           (a)
+
+
+#endif
diff --git a/include/asm-arm/arch-at91/irqs.h b/include/asm-arm/arch-at91/irqs.h
new file mode 100644 (file)
index 0000000..1ffa3bb
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * include/asm-arm/arch-at91/irqs.h
+ *
+ *  Copyright (C) 2004 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_IRQS_H
+#define __ASM_ARCH_IRQS_H
+
+#include <asm/arch/at91_aic.h>
+
+#define NR_AIC_IRQS 32
+
+
+/*
+ * Acknowledge interrupt with AIC after interrupt has been handled.
+ *   (by kernel/irq.c)
+ */
+#define irq_finish(irq) do { at91_sys_write(AT91_AIC_EOICR, 0); } while (0)
+
+
+/*
+ * IRQ interrupt symbols are the AT91xxx_ID_* symbols
+ * for IRQs handled directly through the AIC, or else the AT91_PIN_*
+ * symbols in gpio.h for ones handled indirectly as GPIOs.
+ * We make provision for 5 banks of GPIO.
+ */
+#define        NR_IRQS         (NR_AIC_IRQS + (5 * 32))
+
+#endif
diff --git a/include/asm-arm/arch-at91/memory.h b/include/asm-arm/arch-at91/memory.h
new file mode 100644 (file)
index 0000000..4835d67
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * include/asm-arm/arch-at91/memory.h
+ *
+ *  Copyright (C) 2004 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+#include <asm/hardware.h>
+
+#define PHYS_OFFSET    (AT91_SDRAM_BASE)
+
+
+/*
+ * Virtual view <-> DMA view memory address translations
+ * virt_to_bus: Used to translate the virtual address to an
+ *              address suitable to be passed to set_dma_addr
+ * bus_to_virt: Used to convert an address for DMA operations
+ *              to an address that the kernel can use.
+ */
+#define __virt_to_bus(x) __virt_to_phys(x)
+#define __bus_to_virt(x) __phys_to_virt(x)
+
+#endif
diff --git a/include/asm-arm/arch-at91/system.h b/include/asm-arm/arch-at91/system.h
new file mode 100644 (file)
index 0000000..6bf8460
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * include/asm-arm/arch-at91/system.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+#include <asm/hardware.h>
+#include <asm/arch/at91_st.h>
+#include <asm/arch/at91_dbgu.h>
+
+static inline void arch_idle(void)
+{
+       /*
+        * Disable the processor clock.  The processor will be automatically
+        * re-enabled by an interrupt or by a reset.
+        */
+//     at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
+
+       /*
+        * Set the processor (CP15) into 'Wait for Interrupt' mode.
+        * Unlike disabling the processor clock via the PMC (above)
+        *  this allows the processor to be woken via JTAG.
+        */
+       cpu_do_idle();
+}
+
+void (*at91_arch_reset)(void);
+
+static inline void arch_reset(char mode)
+{
+       /* call the CPU-specific reset function */
+       if (at91_arch_reset)
+               (at91_arch_reset)();
+}
+
+#endif
diff --git a/include/asm-arm/arch-at91/timex.h b/include/asm-arm/arch-at91/timex.h
new file mode 100644 (file)
index 0000000..f41636d
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * include/asm-arm/arch-at91/timex.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_TIMEX_H
+#define __ASM_ARCH_TIMEX_H
+
+#include <asm/hardware.h>
+
+#if defined(CONFIG_ARCH_AT91RM9200)
+
+#define CLOCK_TICK_RATE                (AT91_SLOW_CLOCK)
+
+#elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9261)
+
+#define AT91SAM9_MASTER_CLOCK  99300000
+#define CLOCK_TICK_RATE                (AT91SAM9_MASTER_CLOCK/16)
+
+#elif defined(CONFIG_ARCH_AT91SAM9263)
+
+#define AT91SAM9_MASTER_CLOCK  99959500
+#define CLOCK_TICK_RATE                (AT91SAM9_MASTER_CLOCK/16)
+
+#endif
+
+#endif
diff --git a/include/asm-arm/arch-at91/uncompress.h b/include/asm-arm/arch-at91/uncompress.h
new file mode 100644 (file)
index 0000000..a193d28
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * include/asm-arm/arch-at91/uncompress.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_UNCOMPRESS_H
+#define __ASM_ARCH_UNCOMPRESS_H
+
+#include <asm/hardware.h>
+#include <asm/arch/at91_dbgu.h>
+
+/*
+ * The following code assumes the serial port has already been
+ * initialized by the bootloader.  If you didn't setup a port in
+ * your bootloader then nothing will appear (which might be desired).
+ *
+ * This does not append a newline
+ */
+static void putc(int c)
+{
+       void __iomem *sys = (void __iomem *) AT91_BASE_SYS;     /* physical address */
+
+       while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXRDY))
+               barrier();
+       __raw_writel(c, sys + AT91_DBGU_THR);
+}
+
+static inline void flush(void)
+{
+       void __iomem *sys = (void __iomem *) AT91_BASE_SYS;     /* physical address */
+
+       /* wait for transmission to complete */
+       while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXEMPTY))
+               barrier();
+}
+
+#define arch_decomp_setup()
+
+#define arch_decomp_wdog()
+
+#endif
diff --git a/include/asm-arm/arch-at91/vmalloc.h b/include/asm-arm/arch-at91/vmalloc.h
new file mode 100644 (file)
index 0000000..bb05e70
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * include/asm-arm/arch-at91/vmalloc.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_VMALLOC_H
+#define __ASM_ARCH_VMALLOC_H
+
+#define VMALLOC_END            (AT91_VIRT_BASE & PGDIR_MASK)
+
+#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_aic.h b/include/asm-arm/arch-at91rm9200/at91_aic.h
deleted file mode 100644 (file)
index 267e698..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_aic.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Advanced Interrupt Controller (AIC) - System peripherals registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_AIC_H
-#define AT91_AIC_H
-
-#define AT91_AIC_SMR(n)                (AT91_AIC + ((n) * 4))  /* Source Mode Registers 0-31 */
-#define                AT91_AIC_PRIOR          (7 << 0)                /* Priority Level */
-#define                AT91_AIC_SRCTYPE        (3 << 5)                /* Interrupt Source Type */
-#define                        AT91_AIC_SRCTYPE_LOW            (0 << 5)
-#define                        AT91_AIC_SRCTYPE_FALLING        (1 << 5)
-#define                        AT91_AIC_SRCTYPE_HIGH           (2 << 5)
-#define                        AT91_AIC_SRCTYPE_RISING         (3 << 5)
-
-#define AT91_AIC_SVR(n)                (AT91_AIC + 0x80 + ((n) * 4))   /* Source Vector Registers 0-31 */
-#define AT91_AIC_IVR           (AT91_AIC + 0x100)      /* Interrupt Vector Register */
-#define AT91_AIC_FVR           (AT91_AIC + 0x104)      /* Fast Interrupt Vector Register */
-#define AT91_AIC_ISR           (AT91_AIC + 0x108)      /* Interrupt Status Register */
-#define                AT91_AIC_IRQID          (0x1f << 0)             /* Current Interrupt Identifier */
-
-#define AT91_AIC_IPR           (AT91_AIC + 0x10c)      /* Interrupt Pending Register */
-#define AT91_AIC_IMR           (AT91_AIC + 0x110)      /* Interrupt Mask Register */
-#define AT91_AIC_CISR          (AT91_AIC + 0x114)      /* Core Interrupt Status Register */
-#define                AT91_AIC_NFIQ           (1 << 0)                /* nFIQ Status */
-#define                AT91_AIC_NIRQ           (1 << 1)                /* nIRQ Status */
-
-#define AT91_AIC_IECR          (AT91_AIC + 0x120)      /* Interrupt Enable Command Register */
-#define AT91_AIC_IDCR          (AT91_AIC + 0x124)      /* Interrupt Disable Command Register */
-#define AT91_AIC_ICCR          (AT91_AIC + 0x128)      /* Interrupt Clear Command Register */
-#define AT91_AIC_ISCR          (AT91_AIC + 0x12c)      /* Interrupt Set Command Register */
-#define AT91_AIC_EOICR         (AT91_AIC + 0x130)      /* End of Interrupt Command Register */
-#define AT91_AIC_SPU           (AT91_AIC + 0x134)      /* Spurious Interrupt Vector Register */
-#define AT91_AIC_DCR           (AT91_AIC + 0x138)      /* Debug Control Register */
-#define                AT91_AIC_DCR_PROT       (1 << 0)                /* Protection Mode */
-#define                AT91_AIC_DCR_GMSK       (1 << 1)                /* General Mask */
-
-#define AT91_AIC_FFER          (AT91_AIC + 0x140)      /* Fast Forcing Enable Register [SAM9 only] */
-#define AT91_AIC_FFDR          (AT91_AIC + 0x144)      /* Fast Forcing Disable Register [SAM9 only] */
-#define AT91_AIC_FFSR          (AT91_AIC + 0x148)      /* Fast Forcing Status Register [SAM9 only] */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_dbgu.h b/include/asm-arm/arch-at91rm9200/at91_dbgu.h
deleted file mode 100644 (file)
index e4b8b27..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_dbgu.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Debug Unit (DBGU) - System peripherals registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_DBGU_H
-#define AT91_DBGU_H
-
-#define AT91_DBGU_CR           (AT91_DBGU + 0x00)      /* Control Register */
-#define AT91_DBGU_MR           (AT91_DBGU + 0x04)      /* Mode Register */
-#define AT91_DBGU_IER          (AT91_DBGU + 0x08)      /* Interrupt Enable Register */
-#define                AT91_DBGU_TXRDY         (1 << 1)                /* Transmitter Ready */
-#define                AT91_DBGU_TXEMPTY       (1 << 9)                /* Transmitter Empty */
-#define AT91_DBGU_IDR          (AT91_DBGU + 0x0c)      /* Interrupt Disable Register */
-#define AT91_DBGU_IMR          (AT91_DBGU + 0x10)      /* Interrupt Mask Register */
-#define AT91_DBGU_SR           (AT91_DBGU + 0x14)      /* Status Register */
-#define AT91_DBGU_RHR          (AT91_DBGU + 0x18)      /* Receiver Holding Register */
-#define AT91_DBGU_THR          (AT91_DBGU + 0x1c)      /* Transmitter Holding Register */
-#define AT91_DBGU_BRGR         (AT91_DBGU + 0x20)      /* Baud Rate Generator Register */
-
-#define AT91_DBGU_CIDR         (AT91_DBGU + 0x40)      /* Chip ID Register */
-#define AT91_DBGU_EXID         (AT91_DBGU + 0x44)      /* Chip ID Extension Register */
-#define                AT91_CIDR_VERSION       (0x1f << 0)             /* Version of the Device */
-#define                AT91_CIDR_EPROC         (7    << 5)             /* Embedded Processor */
-#define                AT91_CIDR_NVPSIZ        (0xf  << 8)             /* Nonvolatile Program Memory Size */
-#define                AT91_CIDR_NVPSIZ2       (0xf  << 12)            /* Second Nonvolatile Program Memory Size */
-#define                AT91_CIDR_SRAMSIZ       (0xf  << 16)            /* Internal SRAM Size */
-#define                AT91_CIDR_ARCH          (0xff << 20)            /* Architecture Identifier */
-#define                AT91_CIDR_NVPTYP        (7    << 28)            /* Nonvolatile Program Memory Type */
-#define                AT91_CIDR_EXT           (1    << 31)            /* Extension Flag */
-
-#define AT91_DBGU_FNR          (AT91_DBGU + 0x48)      /* Force NTRST Register [SAM9 only] */
-#define                AT91_DBGU_FNTRST        (1 << 0)                /* Force NTRST */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_ecc.h b/include/asm-arm/arch-at91rm9200/at91_ecc.h
deleted file mode 100644 (file)
index 5c564ed..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_ecc.h
- *
- * Error Corrected Code Controller (ECC) - System peripherals regsters.
- * Based on AT91SAM9260 datasheet revision B.
- *
- * 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 AT91_ECC_H
-#define AT91_ECC_H
-
-#define AT91_ECC_CR            (AT91_ECC + 0x00)       /* Control register */
-#define                AT91_ECC_RST            (1 << 0)                /* Reset parity */
-
-#define AT91_ECC_MR            (AT91_ECC + 0x04)       /* Mode register */
-#define                AT91_ECC_PAGESIZE       (3 << 0)                /* Page Size */
-#define                        AT91_ECC_PAGESIZE_528           (0)
-#define                        AT91_ECC_PAGESIZE_1056          (1)
-#define                        AT91_ECC_PAGESIZE_2112          (2)
-#define                        AT91_ECC_PAGESIZE_4224          (3)
-
-#define AT91_ECC_SR            (AT91_ECC + 0x08)       /* Status register */
-#define                AT91_ECC_RECERR         (1 << 0)                /* Recoverable Error */
-#define                AT91_ECC_ECCERR         (1 << 1)                /* ECC Single Bit Error */
-#define                AT91_ECC_MULERR         (1 << 2)                /* Multiple Errors */
-
-#define AT91_ECC_PR            (AT91_ECC + 0x0c)       /* Parity register */
-#define                AT91_ECC_BITADDR        (0xf << 0)              /* Bit Error Address */
-#define                AT91_ECC_WORDADDR       (0xfff << 4)            /* Word Error Address */
-
-#define AT91_ECC_NPR           (AT91_ECC + 0x10)       /* NParity register */
-#define                AT91_ECC_NPARITY        (0xffff << 0)           /* NParity */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_lcdc.h b/include/asm-arm/arch-at91rm9200/at91_lcdc.h
deleted file mode 100644 (file)
index 9cbfcdd..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_lcdc.h
- *
- * LCD Controller (LCDC).
- * Based on AT91SAM9261 datasheet revision E.
- *
- * 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 AT91_LCDC_H
-#define AT91_LCDC_H
-
-#define AT91_LCDC_DMABADDR1    0x00            /* DMA Base Address Register 1 */
-#define AT91_LCDC_DMABADDR2    0x04            /* DMA Base Address Register 2 */
-#define AT91_LCDC_DMAFRMPT1    0x08            /* DMA Frame Pointer Register 1 */
-#define AT91_LCDC_DMAFRMPT2    0x0c            /* DMA Frame Pointer Register 2 */
-#define AT91_LCDC_DMAFRMADD1   0x10            /* DMA Frame Address Register 1 */
-#define AT91_LCDC_DMAFRMADD2   0x14            /* DMA Frame Address Register 2 */
-
-#define AT91_LCDC_DMAFRMCFG    0x18            /* DMA Frame Configuration Register */
-#define                AT91_LCDC_FRSIZE        (0x7fffff <<  0)        /* Frame Size */
-#define                AT91_LCDC_BLENGTH       (0x7f     << 24)        /* Burst Length */
-
-#define AT91_LCDC_DMACON       0x1c            /* DMA Control Register */
-#define                AT91_LCDC_DMAEN         (0x1 << 0)      /* DMA Enable */
-#define                AT91_LCDC_DMARST        (0x1 << 1)      /* DMA Reset */
-#define                AT91_LCDC_DMABUSY       (0x1 << 2)      /* DMA Busy */
-
-#define AT91_LCDC_LCDCON1      0x0800          /* LCD Control Register 1 */
-#define                AT91_LCDC_BYPASS        (1     <<  0)   /* Bypass lcd_dotck divider */
-#define                AT91_LCDC_CLKVAL        (0x1ff << 12)   /* Clock Divider */
-#define                AT91_LCDC_LINCNT        (0x7ff << 21)   /* Line Counter */
-
-#define AT91_LCDC_LCDCON2      0x0804          /* LCD Control Register 2 */
-#define                AT91_LCDC_DISTYPE       (3 << 0)        /* Display Type */
-#define                        AT91_LCDC_DISTYPE_STNMONO       (0 << 0)
-#define                        AT91_LCDC_DISTYPE_STNCOLOR      (1 << 0)
-#define                        AT91_LCDC_DISTYPE_TFT           (2 << 0)
-#define                AT91_LCDC_SCANMOD       (1 << 2)        /* Scan Mode */
-#define                        AT91_LCDC_SCANMOD_SINGLE        (0 << 2)
-#define                        AT91_LCDC_SCANMOD_DUAL          (1 << 2)
-#define                AT91_LCDC_IFWIDTH       (3 << 3)        /*Interface Width */
-#define                        AT91_LCDC_IFWIDTH_4             (0 << 3)
-#define                        AT91_LCDC_IFWIDTH_8             (1 << 3)
-#define                        AT91_LCDC_IFWIDTH_16            (2 << 3)
-#define                AT91_LCDC_PIXELSIZE     (7 << 5)        /* Bits per pixel */
-#define                        AT91_LCDC_PIXELSIZE_1           (0 << 5)
-#define                        AT91_LCDC_PIXELSIZE_2           (1 << 5)
-#define                        AT91_LCDC_PIXELSIZE_4           (2 << 5)
-#define                        AT91_LCDC_PIXELSIZE_8           (3 << 5)
-#define                        AT91_LCDC_PIXELSIZE_16          (4 << 5)
-#define                        AT91_LCDC_PIXELSIZE_24          (5 << 5)
-#define                AT91_LCDC_INVVD         (1 << 8)        /* LCD Data polarity */
-#define                        AT91_LCDC_INVVD_NORMAL          (0 << 8)
-#define                        AT91_LCDC_INVVD_INVERTED        (1 << 8)
-#define                AT91_LCDC_INVFRAME      (1 << 9 )       /* LCD VSync polarity */
-#define                        AT91_LCDC_INVFRAME_NORMAL       (0 << 9)
-#define                        AT91_LCDC_INVFRAME_INVERTED     (1 << 9)
-#define                AT91_LCDC_INVLINE       (1 << 10)       /* LCD HSync polarity */
-#define                        AT91_LCDC_INVLINE_NORMAL        (0 << 10)
-#define                        AT91_LCDC_INVLINE_INVERTED      (1 << 10)
-#define                AT91_LCDC_INVCLK        (1 << 11)       /* LCD dotclk polarity */
-#define                        AT91_LCDC_INVCLK_NORMAL         (0 << 11)
-#define                        AT91_LCDC_INVCLK_INVERTED       (1 << 11)
-#define                AT91_LCDC_INVDVAL       (1 << 12)       /* LCD dval polarity */
-#define                        AT91_LCDC_INVDVAL_NORMAL        (0 << 12)
-#define                        AT91_LCDC_INVDVAL_INVERTED      (1 << 12)
-#define                AT91_LCDC_CLKMOD        (1 << 15)       /* LCD dotclk mode */
-#define                        AT91_LCDC_CLKMOD_ACTIVEDISPLAY  (0 << 15)
-#define                        AT91_LCDC_CLKMOD_ALWAYSACTIVE   (1 << 15)
-#define                AT91_LCDC_MEMOR         (1 << 31)       /* Memory Ordering Format */
-#define                        AT91_LCDC_MEMOR_BIG             (0 << 31)
-#define                        AT91_LCDC_MEMOR_LITTLE          (1 << 31)
-
-#define AT91_LCDC_TIM1         0x0808          /* LCD Timing Register 1 */
-#define                AT91_LCDC_VFP           (0xff <<  0)    /* Vertical Front Porch */
-#define                AT91_LCDC_VBP           (0xff <<  8)    /* Vertical Back Porch */
-#define                AT91_LCDC_VPW           (0x3f << 16)    /* Vertical Synchronization Pulse Width */
-#define                AT91_LCDC_VHDLY         (0xf  << 24)    /* Vertical to Horizontal Delay */
-
-#define AT91_LCDC_TIM2         0x080c          /* LCD Timing Register 2 */
-#define                AT91_LCDC_HBP           (0xff  <<  0)   /* Horizontal Back Porch */
-#define                AT91_LCDC_HPW           (0x3f  <<  8)   /* Horizontal Synchronization Pulse Width */
-#define                AT91_LCDC_HFP           (0x7ff << 21)   /* Horizontal Front Porch */
-
-#define AT91_LCDC_LCDFRMCFG    0x0810          /* LCD Frame Configuration Register */
-#define                AT91_LCDC_LINEVAL       (0x7ff <<  0)   /* Vertical Size of LCD Module */
-#define                AT91_LCDC_HOZVAL        (0x7ff << 21)   /* Horizontal Size of LCD Module */
-
-#define AT91_LCDC_FIFO         0x0814          /* LCD FIFO Register */
-#define                AT91_LCDC_FIFOTH        (0xffff)        /* FIFO Threshold */
-
-#define AT91_LCDC_DP1_2                0x081c          /* Dithering Pattern DP1_2 Register */
-#define AT91_LCDC_DP4_7                0x0820          /* Dithering Pattern DP4_7 Register */
-#define AT91_LCDC_DP3_5                0x0824          /* Dithering Pattern DP3_5 Register */
-#define AT91_LCDC_DP2_3                0x0828          /* Dithering Pattern DP2_3 Register */
-#define AT91_LCDC_DP5_7                0x082c          /* Dithering Pattern DP5_7 Register */
-#define AT91_LCDC_DP3_4                0x0830          /* Dithering Pattern DP3_4 Register */
-#define AT91_LCDC_DP4_5                0x0834          /* Dithering Pattern DP4_5 Register */
-#define AT91_LCDC_DP6_7                0x0838          /* Dithering Pattern DP6_7 Register */
-#define                AT91_LCDC_DP1_2_VAL     (0xff)
-#define                AT91_LCDC_DP4_7_VAL     (0xfffffff)
-#define                AT91_LCDC_DP3_5_VAL     (0xfffff)
-#define                AT91_LCDC_DP2_3_VAL     (0xfff)
-#define                AT91_LCDC_DP5_7_VAL     (0xfffffff)
-#define                AT91_LCDC_DP3_4_VAL     (0xffff)
-#define                AT91_LCDC_DP4_5_VAL     (0xfffff)
-#define                AT91_LCDC_DP6_7_VAL     (0xfffffff)
-
-#define AT91_LCDC_PWRCON       0x083c          /* Power Control Register */
-#define                AT91_LCDC_PWR           (1    <<  0)    /* LCD Module Power Control */
-#define                AT91_LCDC_GUARDT        (0x7f <<  1)    /* Delay in Frame Period */
-#define                AT91_LCDC_BUSY          (1    << 31)    /* LCD Busy */
-
-#define AT91_LCDC_CONTRAST_CTR 0x0840          /* Contrast Control Register */
-#define                AT91_LCDC_PS            (3 << 0)        /* Contrast Counter Prescaler */
-#define                        AT91_LCDC_PS_DIV1               (0 << 0)
-#define                        AT91_LCDC_PS_DIV2               (1 << 0)
-#define                        AT91_LCDC_PS_DIV4               (2 << 0)
-#define                        AT91_LCDC_PS_DIV8               (3 << 0)
-#define                AT91_LCDC_POL           (1 << 2)        /* Polarity of output Pulse */
-#define                        AT91_LCDC_POL_NEGATIVE          (0 << 2)
-#define                        AT91_LCDC_POL_POSITIVE          (1 << 2)
-#define                AT91_LCDC_ENA           (1 << 3)        /* PWM generator Control */
-#define                        AT91_LCDC_ENA_PWMDISABLE        (0 << 3)
-#define                        AT91_LCDC_ENA_PWMENABLE         (1 << 3)
-
-#define AT91_LCDC_CONTRAST_VAL 0x0844          /* Contrast Value Register */
-#define                AT91_LCDC_CVAL          (0xff)          /* PWM compare value */
-
-#define AT91_LCDC_IER          0x0848          /* Interrupt Enable Register */
-#define AT91_LCDC_IDR          0x084c          /* Interrupt Disable Register */
-#define AT91_LCDC_IMR          0x0850          /* Interrupt Mask Register */
-#define AT91_LCDC_ISR          0x0854          /* Interrupt Enable Register */
-#define AT91_LCDC_ICR          0x0858          /* Interrupt Clear Register */
-#define                AT91_LCDC_LNI           (1 << 0)        /* Line Interrupt */
-#define                AT91_LCDC_LSTLNI        (1 << 1)        /* Last Line Interrupt */
-#define                AT91_LCDC_EOFI          (1 << 2)        /* DMA End Of Frame Interrupt */
-#define                AT91_LCDC_UFLWI         (1 << 4)        /* FIFO Underflow Interrupt */
-#define                AT91_LCDC_OWRI          (1 << 5)        /* FIFO Overwrite Interrupt */
-#define                AT91_LCDC_MERI          (1 << 6)        /* DMA Memory Error Interrupt */
-
-#define AT91_LCDC_LUT_(n)      (0x0c00 + ((n)*4))      /* Palette Entry 0..255 */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_mci.h b/include/asm-arm/arch-at91rm9200/at91_mci.h
deleted file mode 100644 (file)
index 9a552cb..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_mci.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * MultiMedia Card Interface (MCI) registers.
- * Based on AT91RM9200 datasheet revision F.
- *
- * 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 AT91_MCI_H
-#define AT91_MCI_H
-
-#define AT91_MCI_CR            0x00            /* Control Register */
-#define                AT91_MCI_MCIEN          (1 <<  0)       /* Multi-Media Interface Enable */
-#define                AT91_MCI_MCIDIS         (1 <<  1)       /* Multi-Media Interface Disable */
-#define                AT91_MCI_PWSEN          (1 <<  2)       /* Power Save Mode Enable */
-#define                AT91_MCI_PWSDIS         (1 <<  3)       /* Power Save Mode Disable */
-#define                AT91_MCI_SWRST          (1 <<  7)       /* Software Reset */
-
-#define AT91_MCI_MR            0x04            /* Mode Register */
-#define                AT91_MCI_CLKDIV         (0xff  <<  0)   /* Clock Divider */
-#define                AT91_MCI_PWSDIV         (7     <<  8)   /* Power Saving Divider */
-#define                AT91_MCI_PDCPADV        (1     << 14)   /* PDC Padding Value */
-#define                AT91_MCI_PDCMODE        (1     << 15)   /* PDC-orientated Mode */
-#define                AT91_MCI_BLKLEN         (0xfff << 18)   /* Data Block Length */
-
-#define AT91_MCI_DTOR          0x08            /* Data Timeout Register */
-#define                AT91_MCI_DTOCYC         (0xf << 0)      /* Data Timeout Cycle Number */
-#define                AT91_MCI_DTOMUL         (7   << 4)      /* Data Timeout Multiplier */
-#define                AT91_MCI_DTOMUL_1               (0 <<  4)
-#define                AT91_MCI_DTOMUL_16              (1 <<  4)
-#define                AT91_MCI_DTOMUL_128             (2 <<  4)
-#define                AT91_MCI_DTOMUL_256             (3 <<  4)
-#define                AT91_MCI_DTOMUL_1K              (4 <<  4)
-#define                AT91_MCI_DTOMUL_4K              (5 <<  4)
-#define                AT91_MCI_DTOMUL_64K             (6 <<  4)
-#define                AT91_MCI_DTOMUL_1M              (7 <<  4)
-
-#define AT91_MCI_SDCR          0x0c            /* SD Card Register */
-#define                AT91_MCI_SDCSEL         (3 << 0)        /* SD Card Selector */
-#define                AT91_MCI_SDCBUS         (1 << 7)        /* 1-bit or 4-bit bus */
-
-#define AT91_MCI_ARGR          0x10            /* Argument Register */
-
-#define AT91_MCI_CMDR          0x14            /* Command Register */
-#define                AT91_MCI_CMDNB          (0x3f << 0)     /* Command Number */
-#define                AT91_MCI_RSPTYP         (3    << 6)     /* Response Type */
-#define                        AT91_MCI_RSPTYP_NONE    (0 <<  6)
-#define                        AT91_MCI_RSPTYP_48      (1 <<  6)
-#define                        AT91_MCI_RSPTYP_136     (2 <<  6)
-#define                AT91_MCI_SPCMD          (7    << 8)     /* Special Command */
-#define                        AT91_MCI_SPCMD_NONE     (0 <<  8)
-#define                        AT91_MCI_SPCMD_INIT     (1 <<  8)
-#define                        AT91_MCI_SPCMD_SYNC     (2 <<  8)
-#define                        AT91_MCI_SPCMD_ICMD     (4 <<  8)
-#define                        AT91_MCI_SPCMD_IRESP    (5 <<  8)
-#define                AT91_MCI_OPDCMD         (1 << 11)       /* Open Drain Command */
-#define                AT91_MCI_MAXLAT         (1 << 12)       /* Max Latency for Command to Response */
-#define                AT91_MCI_TRCMD          (3 << 16)       /* Transfer Command */
-#define                        AT91_MCI_TRCMD_NONE     (0 << 16)
-#define                        AT91_MCI_TRCMD_START    (1 << 16)
-#define                        AT91_MCI_TRCMD_STOP     (2 << 16)
-#define                AT91_MCI_TRDIR          (1 << 18)       /* Transfer Direction */
-#define                AT91_MCI_TRTYP          (3 << 19)       /* Transfer Type */
-#define                        AT91_MCI_TRTYP_BLOCK    (0 << 19)
-#define                        AT91_MCI_TRTYP_MULTIPLE (1 << 19)
-#define                        AT91_MCI_TRTYP_STREAM   (2 << 19)
-
-#define AT91_MCI_RSPR(n)       (0x20 + ((n) * 4))      /* Response Registers 0-3 */
-#define AT91_MCR_RDR           0x30            /* Receive Data Register */
-#define AT91_MCR_TDR           0x34            /* Transmit Data Register */
-
-#define AT91_MCI_SR            0x40            /* Status Register */
-#define                AT91_MCI_CMDRDY         (1 <<  0)       /* Command Ready */
-#define                AT91_MCI_RXRDY          (1 <<  1)       /* Receiver Ready */
-#define                AT91_MCI_TXRDY          (1 <<  2)       /* Transmit Ready */
-#define                AT91_MCI_BLKE           (1 <<  3)       /* Data Block Ended */
-#define                AT91_MCI_DTIP           (1 <<  4)       /* Data Transfer in Progress */
-#define                AT91_MCI_NOTBUSY        (1 <<  5)       /* Data Not Busy */
-#define                AT91_MCI_ENDRX          (1 <<  6)       /* End of RX Buffer */
-#define                AT91_MCI_ENDTX          (1 <<  7)       /* End fo TX Buffer */
-#define                AT91_MCI_SDIOIRQA       (1 <<  8)       /* SDIO Interrupt for Slot A */
-#define                At91_MCI_SDIOIRQB       (1 <<  9)       /* SDIO Interrupt for Slot B [AT91RM9200 only] */
-#define                AT91_MCI_RXBUFF         (1 << 14)       /* RX Buffer Full */
-#define                AT91_MCI_TXBUFE         (1 << 15)       /* TX Buffer Empty */
-#define                AT91_MCI_RINDE          (1 << 16)       /* Response Index Error */
-#define                AT91_MCI_RDIRE          (1 << 17)       /* Response Direction Error */
-#define                AT91_MCI_RCRCE          (1 << 18)       /* Response CRC Error */
-#define                AT91_MCI_RENDE          (1 << 19)       /* Response End Bit Error */
-#define                AT91_MCI_RTOE           (1 << 20)       /* Reponse Time-out Error */
-#define                AT91_MCI_DCRCE          (1 << 21)       /* Data CRC Error */
-#define                AT91_MCI_DTOE           (1 << 22)       /* Data Time-out Error */
-#define                AT91_MCI_OVRE           (1 << 30)       /* Overrun */
-#define                AT91_MCI_UNRE           (1 << 31)       /* Underrun */
-
-#define AT91_MCI_IER           0x44            /* Interrupt Enable Register */
-#define AT91_MCI_IDR           0x48            /* Interrupt Disable Register */
-#define AT91_MCI_IMR           0x4c            /* Interrupt Mask Register */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_pdc.h b/include/asm-arm/arch-at91rm9200/at91_pdc.h
deleted file mode 100644 (file)
index 79d6e02..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_pdc.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Peripheral Data Controller (PDC) registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_PDC_H
-#define AT91_PDC_H
-
-#define AT91_PDC_RPR           0x100   /* Receive Pointer Register */
-#define AT91_PDC_RCR           0x104   /* Receive Counter Register */
-#define AT91_PDC_TPR           0x108   /* Transmit Pointer Register */
-#define AT91_PDC_TCR           0x10c   /* Transmit Counter Register */
-#define AT91_PDC_RNPR          0x110   /* Receive Next Pointer Register */
-#define AT91_PDC_RNCR          0x114   /* Receive Next Counter Register */
-#define AT91_PDC_TNPR          0x118   /* Transmit Next Pointer Register */
-#define AT91_PDC_TNCR          0x11c   /* Transmit Next Counter Register */
-
-#define AT91_PDC_PTCR          0x120   /* Transfer Control Register */
-#define                AT91_PDC_RXTEN          (1 << 0)        /* Receiver Transfer Enable */
-#define                AT91_PDC_RXTDIS         (1 << 1)        /* Receiver Transfer Disable */
-#define                AT91_PDC_TXTEN          (1 << 8)        /* Transmitter Transfer Enable */
-#define                AT91_PDC_TXTDIS         (1 << 9)        /* Transmitter Transfer Disable */
-
-#define AT91_PDC_PTSR          0x124   /* Transfer Status Register */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_pio.h b/include/asm-arm/arch-at91rm9200/at91_pio.h
deleted file mode 100644 (file)
index 680eaa1..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_pio.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Parallel I/O Controller (PIO) - System peripherals registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_PIO_H
-#define AT91_PIO_H
-
-#define PIO_PER                0x00    /* Enable Register */
-#define PIO_PDR                0x04    /* Disable Register */
-#define PIO_PSR                0x08    /* Status Register */
-#define PIO_OER                0x10    /* Output Enable Register */
-#define PIO_ODR                0x14    /* Output Disable Register */
-#define PIO_OSR                0x18    /* Output Status Register */
-#define PIO_IFER       0x20    /* Glitch Input Filter Enable */
-#define PIO_IFDR       0x24    /* Glitch Input Filter Disable */
-#define PIO_IFSR       0x28    /* Glitch Input Filter Status */
-#define PIO_SODR       0x30    /* Set Output Data Register */
-#define PIO_CODR       0x34    /* Clear Output Data Register */
-#define PIO_ODSR       0x38    /* Output Data Status Register */
-#define PIO_PDSR       0x3c    /* Pin Data Status Register */
-#define PIO_IER                0x40    /* Interrupt Enable Register */
-#define PIO_IDR                0x44    /* Interrupt Disable Register */
-#define PIO_IMR                0x48    /* Interrupt Mask Register */
-#define PIO_ISR                0x4c    /* Interrupt Status Register */
-#define PIO_MDER       0x50    /* Multi-driver Enable Register */
-#define PIO_MDDR       0x54    /* Multi-driver Disable Register */
-#define PIO_MDSR       0x58    /* Multi-driver Status Register */
-#define PIO_PUDR       0x60    /* Pull-up Disable Register */
-#define PIO_PUER       0x64    /* Pull-up Enable Register */
-#define PIO_PUSR       0x68    /* Pull-up Status Register */
-#define PIO_ASR                0x70    /* Peripheral A Select Register */
-#define PIO_BSR                0x74    /* Peripheral B Select Register */
-#define PIO_ABSR       0x78    /* AB Status Register */
-#define PIO_OWER       0xa0    /* Output Write Enable Register */
-#define PIO_OWDR       0xa4    /* Output Write Disable Register */
-#define PIO_OWSR       0xa8    /* Output Write Status Register */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_pit.h b/include/asm-arm/arch-at91rm9200/at91_pit.h
deleted file mode 100644 (file)
index 4a30d00..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_pit.h
- *
- * Periodic Interval Timer (PIT) - System peripherals regsters.
- * Based on AT91SAM9261 datasheet revision D.
- *
- * 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 AT91_PIT_H
-#define AT91_PIT_H
-
-#define AT91_PIT_MR            (AT91_PIT + 0x00)       /* Mode Register */
-#define                AT91_PIT_PITIEN         (1 << 25)               /* Timer Interrupt Enable */
-#define                AT91_PIT_PITEN          (1 << 24)               /* Timer Enabled */
-#define                AT91_PIT_PIV            (0xfffff)               /* Periodic Interval Value */
-
-#define AT91_PIT_SR            (AT91_PIT + 0x04)       /* Status Register */
-#define                AT91_PIT_PITS           (1 << 0)                /* Timer Status */
-
-#define AT91_PIT_PIVR          (AT91_PIT + 0x08)       /* Periodic Interval Value Register */
-#define AT91_PIT_PIIR          (AT91_PIT + 0x0c)       /* Periodic Interval Image Register */
-#define                AT91_PIT_PICNT          (0xfff << 20)           /* Interval Counter */
-#define                AT91_PIT_CPIV           (0xfffff)               /* Inverval Value */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_pmc.h b/include/asm-arm/arch-at91rm9200/at91_pmc.h
deleted file mode 100644 (file)
index c3b489d..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_pmc.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Power Management Controller (PMC) - System peripherals registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_PMC_H
-#define AT91_PMC_H
-
-#define        AT91_PMC_SCER           (AT91_PMC + 0x00)       /* System Clock Enable Register */
-#define        AT91_PMC_SCDR           (AT91_PMC + 0x04)       /* System Clock Disable Register */
-
-#define        AT91_PMC_SCSR           (AT91_PMC + 0x08)       /* System Clock Status Register */
-#define                AT91_PMC_PCK            (1 <<  0)               /* Processor Clock */
-#define                AT91RM9200_PMC_UDP      (1 <<  1)               /* USB Devcice Port Clock [AT91RM9200 only] */
-#define                AT91RM9200_PMC_MCKUDP   (1 <<  2)               /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */
-#define                AT91RM9200_PMC_UHP      (1 <<  4)               /* USB Host Port Clock [AT91RM9200 only] */
-#define                AT91SAM926x_PMC_UHP     (1 <<  6)               /* USB Host Port Clock [AT91SAM926x only] */
-#define                AT91SAM926x_PMC_UDP     (1 <<  7)               /* USB Devcice Port Clock [AT91SAM926x only] */
-#define                AT91_PMC_PCK0           (1 <<  8)               /* Programmable Clock 0 */
-#define                AT91_PMC_PCK1           (1 <<  9)               /* Programmable Clock 1 */
-#define                AT91_PMC_PCK2           (1 << 10)               /* Programmable Clock 2 */
-#define                AT91_PMC_PCK3           (1 << 11)               /* Programmable Clock 3 */
-#define                AT91_PMC_HCK0           (1 << 16)               /* AHB Clock (USB host) [AT91SAM9261 only] */
-#define                AT91_PMC_HCK1           (1 << 17)               /* AHB Clock (LCD) [AT91SAM9261 only] */
-
-#define        AT91_PMC_PCER           (AT91_PMC + 0x10)       /* Peripheral Clock Enable Register */
-#define        AT91_PMC_PCDR           (AT91_PMC + 0x14)       /* Peripheral Clock Disable Register */
-#define        AT91_PMC_PCSR           (AT91_PMC + 0x18)       /* Peripheral Clock Status Register */
-
-#define        AT91_CKGR_MOR           (AT91_PMC + 0x20)       /* Main Oscillator Register */
-#define                AT91_PMC_MOSCEN         (1    << 0)             /* Main Oscillator Enable */
-#define                AT91_PMC_OSCBYPASS      (1    << 1)             /* Oscillator Bypass [AT91SAM926x only] */
-#define                AT91_PMC_OSCOUNT        (0xff << 8)             /* Main Oscillator Start-up Time */
-
-#define        AT91_CKGR_MCFR          (AT91_PMC + 0x24)       /* Main Clock Frequency Register */
-#define                AT91_PMC_MAINF          (0xffff <<  0)          /* Main Clock Frequency */
-#define                AT91_PMC_MAINRDY        (1      << 16)          /* Main Clock Ready */
-
-#define        AT91_CKGR_PLLAR         (AT91_PMC + 0x28)       /* PLL A Register */
-#define        AT91_CKGR_PLLBR         (AT91_PMC + 0x2c)       /* PLL B Register */
-#define                AT91_PMC_DIV            (0xff  <<  0)           /* Divider */
-#define                AT91_PMC_PLLCOUNT       (0x3f  <<  8)           /* PLL Counter */
-#define                AT91_PMC_OUT            (3     << 14)           /* PLL Clock Frequency Range */
-#define                AT91_PMC_MUL            (0x7ff << 16)           /* PLL Multiplier */
-#define                AT91_PMC_USB96M         (1     << 28)           /* Divider by 2 Enable (PLLB only) */
-
-#define        AT91_PMC_MCKR           (AT91_PMC + 0x30)       /* Master Clock Register */
-#define                AT91_PMC_CSS            (3 <<  0)               /* Master Clock Selection */
-#define                        AT91_PMC_CSS_SLOW               (0 << 0)
-#define                        AT91_PMC_CSS_MAIN               (1 << 0)
-#define                        AT91_PMC_CSS_PLLA               (2 << 0)
-#define                        AT91_PMC_CSS_PLLB               (3 << 0)
-#define                AT91_PMC_PRES           (7 <<  2)               /* Master Clock Prescaler */
-#define                        AT91_PMC_PRES_1                 (0 << 2)
-#define                        AT91_PMC_PRES_2                 (1 << 2)
-#define                        AT91_PMC_PRES_4                 (2 << 2)
-#define                        AT91_PMC_PRES_8                 (3 << 2)
-#define                        AT91_PMC_PRES_16                (4 << 2)
-#define                        AT91_PMC_PRES_32                (5 << 2)
-#define                        AT91_PMC_PRES_64                (6 << 2)
-#define                AT91_PMC_MDIV           (3 <<  8)               /* Master Clock Division */
-#define                        AT91_PMC_MDIV_1                 (0 << 8)
-#define                        AT91_PMC_MDIV_2                 (1 << 8)
-#define                        AT91_PMC_MDIV_3                 (2 << 8)
-#define                        AT91_PMC_MDIV_4                 (3 << 8)
-
-#define        AT91_PMC_PCKR(n)        (AT91_PMC + 0x40 + ((n) * 4))   /* Programmable Clock 0-3 Registers */
-
-#define        AT91_PMC_IER            (AT91_PMC + 0x60)       /* Interrupt Enable Register */
-#define        AT91_PMC_IDR            (AT91_PMC + 0x64)       /* Interrupt Disable Register */
-#define        AT91_PMC_SR             (AT91_PMC + 0x68)       /* Status Register */
-#define                AT91_PMC_MOSCS          (1 <<  0)               /* MOSCS Flag */
-#define                AT91_PMC_LOCKA          (1 <<  1)               /* PLLA Lock */
-#define                AT91_PMC_LOCKB          (1 <<  2)               /* PLLB Lock */
-#define                AT91_PMC_MCKRDY         (1 <<  3)               /* Master Clock */
-#define                AT91_PMC_PCK0RDY        (1 <<  8)               /* Programmable Clock 0 */
-#define                AT91_PMC_PCK1RDY        (1 <<  9)               /* Programmable Clock 1 */
-#define                AT91_PMC_PCK2RDY        (1 << 10)               /* Programmable Clock 2 */
-#define                AT91_PMC_PCK3RDY        (1 << 11)               /* Programmable Clock 3 */
-#define        AT91_PMC_IMR            (AT91_PMC + 0x6c)       /* Interrupt Mask Register */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_rstc.h b/include/asm-arm/arch-at91rm9200/at91_rstc.h
deleted file mode 100644 (file)
index 237d3c4..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_rstc.h
- *
- * Reset Controller (RSTC) - System peripherals regsters.
- * Based on AT91SAM9261 datasheet revision D.
- *
- * 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 AT91_RSTC_H
-#define AT91_RSTC_H
-
-#define AT91_RSTC_CR           (AT91_RSTC + 0x00)      /* Reset Controller Control Register */
-#define                AT91_RSTC_PROCRST       (1 << 0)                /* Processor Reset */
-#define                AT91_RSTC_PERRST        (1 << 2)                /* Peripheral Reset */
-#define                AT91_RSTC_EXTRST        (1 << 3)                /* External Reset */
-#define                AT91_RSTC_KEY           (0xff << 24)            /* KEY Password */
-
-#define AT91_RSTC_SR           (AT91_RSTC + 0x04)      /* Reset Controller Status Register */
-#define                AT91_RSTC_URSTS         (1 << 0)                /* User Reset Status */
-#define                AT91_RSTC_RSTTYP        (7 << 8)                /* Reset Type */
-#define                        AT91_RSTC_RSTTYP_GENERAL        (0 << 8)
-#define                        AT91_RSTC_RSTTYP_WAKEUP         (1 << 8)
-#define                        AT91_RSTC_RSTTYP_WATCHDOG       (2 << 8)
-#define                        AT91_RSTC_RSTTYP_SOFTWARE       (3 << 8)
-#define                        AT91_RSTC_RSTTYP_USER   (4 << 8)
-#define                AT91_RSTC_NRSTL         (1 << 16)               /* NRST Pin Level */
-#define                AT91_RSTC_SRCMP         (1 << 17)               /* Software Reset Command in Progress */
-
-#define AT91_RSTC_MR           (AT91_RSTC + 0x08)      /* Reset Controller Mode Register */
-#define                AT91_RSTC_URSTEN        (1 << 0)                /* User Reset Enable */
-#define                AT91_RSTC_URSTIEN       (1 << 4)                /* User Reset Interrupt Enable */
-#define                AT91_RSTC_ERSTL         (0xf << 8)              /* External Reset Length */
-#define                AT91_RSTC_KEY           (0xff << 24)            /* KEY Password */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_rtc.h b/include/asm-arm/arch-at91rm9200/at91_rtc.h
deleted file mode 100644 (file)
index 095fe08..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_rtc.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Real Time Clock (RTC) - System peripheral registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_RTC_H
-#define AT91_RTC_H
-
-#define        AT91_RTC_CR             (AT91_RTC + 0x00)       /* Control Register */
-#define                AT91_RTC_UPDTIM         (1 <<  0)               /* Update Request Time Register */
-#define                AT91_RTC_UPDCAL         (1 <<  1)               /* Update Request Calendar Register */
-#define                AT91_RTC_TIMEVSEL       (3 <<  8)               /* Time Event Selection */
-#define                        AT91_RTC_TIMEVSEL_MINUTE        (0 << 8)
-#define                        AT91_RTC_TIMEVSEL_HOUR          (1 << 8)
-#define                        AT91_RTC_TIMEVSEL_DAY24         (2 << 8)
-#define                        AT91_RTC_TIMEVSEL_DAY12         (3 << 8)
-#define                AT91_RTC_CALEVSEL       (3 << 16)               /* Calendar Event Selection */
-#define                        AT91_RTC_CALEVSEL_WEEK          (0 << 16)
-#define                        AT91_RTC_CALEVSEL_MONTH         (1 << 16)
-#define                        AT91_RTC_CALEVSEL_YEAR          (2 << 16)
-
-#define        AT91_RTC_MR             (AT91_RTC + 0x04)       /* Mode Register */
-#define                        AT91_RTC_HRMOD          (1 <<  0)               /* 12/24 Hour Mode */
-
-#define        AT91_RTC_TIMR           (AT91_RTC + 0x08)       /* Time Register */
-#define                AT91_RTC_SEC            (0x7f <<  0)            /* Current Second */
-#define                AT91_RTC_MIN            (0x7f <<  8)            /* Current Minute */
-#define                AT91_RTC_HOUR           (0x3f << 16)            /* Current Hour */
-#define                AT91_RTC_AMPM           (1    << 22)            /* Ante Meridiem Post Meridiem Indicator */
-
-#define        AT91_RTC_CALR           (AT91_RTC + 0x0c)       /* Calendar Register */
-#define                AT91_RTC_CENT           (0x7f <<  0)            /* Current Century */
-#define                AT91_RTC_YEAR           (0xff <<  8)            /* Current Year */
-#define                AT91_RTC_MONTH          (0x1f << 16)            /* Current Month */
-#define                AT91_RTC_DAY            (7    << 21)            /* Current Day */
-#define                AT91_RTC_DATE           (0x3f << 24)            /* Current Date */
-
-#define        AT91_RTC_TIMALR         (AT91_RTC + 0x10)       /* Time Alarm Register */
-#define                AT91_RTC_SECEN          (1 <<  7)               /* Second Alarm Enable */
-#define                AT91_RTC_MINEN          (1 << 15)               /* Minute Alarm Enable */
-#define                AT91_RTC_HOUREN         (1 << 23)               /* Hour Alarm Enable */
-
-#define        AT91_RTC_CALALR         (AT91_RTC + 0x14)       /* Calendar Alarm Register */
-#define                AT91_RTC_MTHEN          (1 << 23)               /* Month Alarm Enable */
-#define                AT91_RTC_DATEEN         (1 << 31)               /* Date Alarm Enable */
-
-#define        AT91_RTC_SR             (AT91_RTC + 0x18)       /* Status Register */
-#define                AT91_RTC_ACKUPD         (1 <<  0)               /* Acknowledge for Update */
-#define                AT91_RTC_ALARM          (1 <<  1)               /* Alarm Flag */
-#define                AT91_RTC_SECEV          (1 <<  2)               /* Second Event */
-#define                AT91_RTC_TIMEV          (1 <<  3)               /* Time Event */
-#define                AT91_RTC_CALEV          (1 <<  4)               /* Calendar Event */
-
-#define        AT91_RTC_SCCR           (AT91_RTC + 0x1c)       /* Status Clear Command Register */
-#define        AT91_RTC_IER            (AT91_RTC + 0x20)       /* Interrupt Enable Register */
-#define        AT91_RTC_IDR            (AT91_RTC + 0x24)       /* Interrupt Disable Register */
-#define        AT91_RTC_IMR            (AT91_RTC + 0x28)       /* Interrupt Mask Register */
-
-#define        AT91_RTC_VER            (AT91_RTC + 0x2c)       /* Valid Entry Register */
-#define                AT91_RTC_NVTIM          (1 <<  0)               /* Non valid Time */
-#define                AT91_RTC_NVCAL          (1 <<  1)               /* Non valid Calendar */
-#define                AT91_RTC_NVTIMALR       (1 <<  2)               /* Non valid Time Alarm */
-#define                AT91_RTC_NVCALALR       (1 <<  3)               /* Non valid Calendar Alarm */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_rtt.h b/include/asm-arm/arch-at91rm9200/at91_rtt.h
deleted file mode 100644 (file)
index c6751ba..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_rtt.h
- *
- * Real-time Timer (RTT) - System peripherals regsters.
- * Based on AT91SAM9261 datasheet revision D.
- *
- * 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 AT91_RTT_H
-#define AT91_RTT_H
-
-#define AT91_RTT_MR            (AT91_RTT + 0x00)       /* Real-time Mode Register */
-#define                AT91_RTT_RTPRES         (0xffff << 0)           /* Real-time Timer Prescaler Value */
-#define                AT91_RTT_ALMIEN         (1 << 16)               /* Alarm Interrupt Enable */
-#define                AT91_RTT_RTTINCIEN      (1 << 17)               /* Real Time Timer Increment Interrupt Enable */
-#define                AT91_RTT_RTTRST         (1 << 18)               /* Real Time Timer Restart */
-
-#define AT91_RTT_AR            (AT91_RTT + 0x04)       /* Real-time Alarm Register */
-#define                AT91_RTT_ALMV           (0xffffffff)            /* Alarm Value */
-
-#define AT91_RTT_VR            (AT91_RTT + 0x08)       /* Real-time Value Register */
-#define                AT91_RTT_CRTV           (0xffffffff)            /* Current Real-time Value */
-
-#define AT91_RTT_SR            (AT91_RTT + 0x0c)       /* Real-time Status Register */
-#define                AT91_RTT_ALMS           (1 << 0)                /* Real-time Alarm Status */
-#define                AT91_RTT_RTTINC         (1 << 1)                /* Real-time Timer Increment */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_shdwc.h b/include/asm-arm/arch-at91rm9200/at91_shdwc.h
deleted file mode 100644 (file)
index 0439250..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_shdwc.h
- *
- * Shutdown Controller (SHDWC) - System peripherals regsters.
- * Based on AT91SAM9261 datasheet revision D.
- *
- * 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 AT91_SHDWC_H
-#define AT91_SHDWC_H
-
-#define AT91_SHDW_CR           (AT91_SHDWC + 0x00)     /* Shut Down Control Register */
-#define                AT91_SHDW_SHDW          (1    << 0)             /* Processor Reset */
-#define                AT91_SHDW_KEY           (0xff << 24)            /* KEY Password */
-
-#define AT91_SHDW_MR           (AT91_SHDWC + 0x04)     /* Shut Down Mode Register */
-#define                AT91_SHDW_WKMODE0       (3 << 0)                /* Wake-up 0 Mode Selection */
-#define                        AT91_SHDW_WKMODE0_NONE          0
-#define                        AT91_SHDW_WKMODE0_HIGH          1
-#define                        AT91_SHDW_WKMODE0_LOW           2
-#define                        AT91_SHDW_WKMODE0_ANYLEVEL      3
-#define                AT91_SHDW_CPTWK0        (0xf << 4)              /* Counter On Wake Up 0 */
-#define                AT91_SHDW_RTTWKEN       (1   << 16)             /* Real Time Timer Wake-up Enable */
-
-#define AT91_SHDW_SR           (AT91_SHDWC + 0x08)     /* Shut Down Status Register */
-#define                AT91_SHDW_WAKEUP0       (1 <<  0)               /* Wake-up 0 Status */
-#define                AT91_SHDW_RTTWK         (1 << 16)               /* Real-time Timer Wake-up */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_spi.h b/include/asm-arm/arch-at91rm9200/at91_spi.h
deleted file mode 100644 (file)
index bec48ca..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_spi.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Serial Peripheral Interface (SPI) registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_SPI_H
-#define AT91_SPI_H
-
-#define AT91_SPI_CR                    0x00            /* Control Register */
-#define                AT91_SPI_SPIEN          (1 <<  0)               /* SPI Enable */
-#define                AT91_SPI_SPIDIS         (1 <<  1)               /* SPI Disable */
-#define                AT91_SPI_SWRST          (1 <<  7)               /* SPI Software Reset */
-#define                AT91_SPI_LASTXFER       (1 << 24)               /* Last Transfer [SAM9261 only] */
-
-#define AT91_SPI_MR                    0x04            /* Mode Register */
-#define                AT91_SPI_MSTR           (1    <<  0)            /* Master/Slave Mode */
-#define                AT91_SPI_PS             (1    <<  1)            /* Peripheral Select */
-#define                        AT91_SPI_PS_FIXED       (0 << 1)
-#define                        AT91_SPI_PS_VARIABLE    (1 << 1)
-#define                AT91_SPI_PCSDEC         (1    <<  2)            /* Chip Select Decode */
-#define                AT91_SPI_DIV32          (1    <<  3)            /* Clock Selection [AT91RM9200 only] */
-#define                AT91_SPI_MODFDIS        (1    <<  4)            /* Mode Fault Detection */
-#define                AT91_SPI_LLB            (1    <<  7)            /* Local Loopback Enable */
-#define                AT91_SPI_PCS            (0xf  << 16)            /* Peripheral Chip Select */
-#define                AT91_SPI_DLYBCS         (0xff << 24)            /* Delay Between Chip Selects */
-
-#define AT91_SPI_RDR           0x08                    /* Receive Data Register */
-#define                AT91_SPI_RD             (0xffff <<  0)          /* Receive Data */
-#define                AT91_SPI_PCS            (0xf    << 16)          /* Peripheral Chip Select */
-
-#define AT91_SPI_TDR           0x0c                    /* Transmit Data Register */
-#define                AT91_SPI_TD             (0xffff <<  0)          /* Transmit Data */
-#define                AT91_SPI_PCS            (0xf    << 16)          /* Peripheral Chip Select */
-#define                AT91_SPI_LASTXFER       (1      << 24)          /* Last Transfer [SAM9261 only] */
-
-#define AT91_SPI_SR            0x10                    /* Status Register */
-#define                AT91_SPI_RDRF           (1 <<  0)               /* Receive Data Register Full */
-#define                AT91_SPI_TDRE           (1 <<  1)               /* Transmit Data Register Full */
-#define                AT91_SPI_MODF           (1 <<  2)               /* Mode Fault Error */
-#define                AT91_SPI_OVRES          (1 <<  3)               /* Overrun Error Status */
-#define                AT91_SPI_ENDRX          (1 <<  4)               /* End of RX buffer */
-#define                AT91_SPI_ENDTX          (1 <<  5)               /* End of TX buffer */
-#define                AT91_SPI_RXBUFF         (1 <<  6)               /* RX Buffer Full */
-#define                AT91_SPI_TXBUFE         (1 <<  7)               /* TX Buffer Empty */
-#define                AT91_SPI_NSSR           (1 <<  8)               /* NSS Rising [SAM9261 only] */
-#define                AT91_SPI_TXEMPTY        (1 <<  9)               /* Transmission Register Empty [SAM9261 only] */
-#define                AT91_SPI_SPIENS         (1 << 16)               /* SPI Enable Status */
-
-#define AT91_SPI_IER           0x14                    /* Interrupt Enable Register */
-#define AT91_SPI_IDR           0x18                    /* Interrupt Disable Register */
-#define AT91_SPI_IMR           0x1c                    /* Interrupt Mask Register */
-
-#define AT91_SPI_CSR(n)                (0x30 + ((n) * 4))      /* Chip Select Registers 0-3 */
-#define                AT91_SPI_CPOL           (1    <<  0)            /* Clock Polarity */
-#define                AT91_SPI_NCPHA          (1    <<  1)            /* Clock Phase */
-#define                AT91_SPI_CSAAT          (1    <<  3)            /* Chip Select Active After Transfer [SAM9261 only] */
-#define                AT91_SPI_BITS           (0xf  <<  4)            /* Bits Per Transfer */
-#define                        AT91_SPI_BITS_8         (0 << 4)
-#define                        AT91_SPI_BITS_9         (1 << 4)
-#define                        AT91_SPI_BITS_10        (2 << 4)
-#define                        AT91_SPI_BITS_11        (3 << 4)
-#define                        AT91_SPI_BITS_12        (4 << 4)
-#define                        AT91_SPI_BITS_13        (5 << 4)
-#define                        AT91_SPI_BITS_14        (6 << 4)
-#define                        AT91_SPI_BITS_15        (7 << 4)
-#define                        AT91_SPI_BITS_16        (8 << 4)
-#define                AT91_SPI_SCBR           (0xff <<  8)            /* Serial Clock Baud Rate */
-#define                AT91_SPI_DLYBS          (0xff << 16)            /* Delay before SPCK */
-#define                AT91_SPI_DLYBCT         (0xff << 24)            /* Delay between Consecutive Transfers */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_ssc.h b/include/asm-arm/arch-at91rm9200/at91_ssc.h
deleted file mode 100644 (file)
index 694bcaa..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_ssc.h
- *
- * Copyright (C) SAN People
- *
- * Serial Synchronous Controller (SSC) registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_SSC_H
-#define AT91_SSC_H
-
-#define AT91_SSC_CR            0x00    /* Control Register */
-#define                AT91_SSC_RXEN           (1 <<  0)       /* Receive Enable */
-#define                AT91_SSC_RXDIS          (1 <<  1)       /* Receive Disable */
-#define                AT91_SSC_TXEN           (1 <<  8)       /* Transmit Enable */
-#define                AT91_SSC_TXDIS          (1 <<  9)       /* Transmit Disable */
-#define                AT91_SSC_SWRST          (1 << 15)       /* Software Reset */
-
-#define AT91_SSC_CMR           0x04    /* Clock Mode Register */
-#define                AT91_SSC_CMR_DIV        (0xfff << 0)    /* Clock Divider */
-
-#define AT91_SSC_RCMR          0x10    /* Receive Clock Mode Register */
-#define                AT91_SSC_CKS            (3    <<  0)    /* Clock Selection */
-#define                        AT91_SSC_CKS_DIV                (0 << 0)
-#define                        AT91_SSC_CKS_CLOCK              (1 << 0)
-#define                        AT91_SSC_CKS_PIN                (2 << 0)
-#define                AT91_SSC_CKO            (7    <<  2)    /* Clock Output Mode Selection */
-#define                        AT91_SSC_CKO_NONE               (0 << 2)
-#define                        AT91_SSC_CKO_CONTINUOUS         (1 << 2)
-#define                AT91_SSC_CKI            (1    <<  5)    /* Clock Inversion */
-#define                        AT91_SSC_CKI_FALLING            (0 << 5)
-#define                        AT91_SSC_CK_RISING              (1 << 5)
-#define                AT91_SSC_CKG            (1    <<  6)    /* Receive Clock Gating Selection [AT91SAM9261 only] */
-#define                        AT91_SSC_CKG_NONE               (0 << 6)
-#define                        AT91_SSC_CKG_RFLOW              (1 << 6)
-#define                        AT91_SSC_CKG_RFHIGH             (2 << 6)
-#define                AT91_SSC_START          (0xf  <<  8)    /* Start Selection */
-#define                        AT91_SSC_START_CONTINUOUS       (0 << 8)
-#define                        AT91_SSC_START_TX_RX            (1 << 8)
-#define                        AT91_SSC_START_LOW_RF           (2 << 8)
-#define                        AT91_SSC_START_HIGH_RF          (3 << 8)
-#define                        AT91_SSC_START_FALLING_RF       (4 << 8)
-#define                        AT91_SSC_START_RISING_RF        (5 << 8)
-#define                        AT91_SSC_START_LEVEL_RF         (6 << 8)
-#define                        AT91_SSC_START_EDGE_RF          (7 << 8)
-#define                AT91_SSC_STOP           (1    << 12)    /* Receive Stop Selection [AT91SAM9261 only] */
-#define                AT91_SSC_STTDLY         (0xff << 16)    /* Start Delay */
-#define                AT91_SSC_PERIOD         (0xff << 24)    /* Period Divider Selection */
-
-#define AT91_SSC_RFMR          0x14    /* Receive Frame Mode Register */
-#define                AT91_SSC_DATALEN        (0x1f <<  0)    /* Data Length */
-#define                AT91_SSC_LOOP           (1    <<  5)    /* Loop Mode */
-#define                AT91_SSC_MSBF           (1    <<  7)    /* Most Significant Bit First */
-#define                AT91_SSC_DATNB          (0xf  <<  8)    /* Data Number per Frame */
-#define                AT91_SSC_FSLEN          (0xf  << 16)    /* Frame Sync Length */
-#define                AT91_SSC_FSOS           (7    << 20)    /* Frame Sync Output Selection */
-#define                        AT91_SSC_FSOS_NONE              (0 << 20)
-#define                        AT91_SSC_FSOS_NEGATIVE          (1 << 20)
-#define                        AT91_SSC_FSOS_POSITIVE          (2 << 20)
-#define                        AT91_SSC_FSOS_LOW               (3 << 20)
-#define                        AT91_SSC_FSOS_HIGH              (4 << 20)
-#define                        AT91_SSC_FSOS_TOGGLE            (5 << 20)
-#define                AT91_SSC_FSEDGE         (1    << 24)    /* Frame Sync Edge Detection */
-#define                        AT91_SSC_FSEDGE_POSITIVE        (0 << 24)
-#define                        AT91_SSC_FSEDGE_NEGATIVE        (1 << 24)
-
-#define AT91_SSC_TCMR          0x18    /* Transmit Clock Mode Register */
-#define AT91_SSC_TFMR          0x1c    /* Transmit Fram Mode Register */
-#define                AT91_SSC_DATDEF         (1 <<  5)       /* Data Default Value */
-#define                AT91_SSC_FSDEN          (1 << 23)       /* Frame Sync Data Enable */
-
-#define AT91_SSC_RHR           0x20    /* Receive Holding Register */
-#define AT91_SSC_THR           0x24    /* Transmit Holding Register */
-#define AT91_SSC_RSHR          0x30    /* Receive Sync Holding Register */
-#define AT91_SSC_TSHR          0x34    /* Transmit Sync Holding Register */
-
-#define AT91_SSC_RC0R          0x38    /* Receive Compare 0 Register [AT91SAM9261 only] */
-#define AT91_SSC_RC1R          0x3c    /* Receive Compare 1 Register [AT91SAM9261 only] */
-
-#define AT91_SSC_SR            0x40    /* Status Register */
-#define                AT91_SSC_TXRDY          (1 <<  0)       /* Transmit Ready */
-#define                AT91_SSC_TXEMPTY        (1 <<  1)       /* Transmit Empty */
-#define                AT91_SSC_ENDTX          (1 <<  2)       /* End of Transmission */
-#define                AT91_SSC_TXBUFE         (1 <<  3)       /* Transmit Buffer Empty */
-#define                AT91_SSC_RXRDY          (1 <<  4)       /* Receive Ready */
-#define                AT91_SSC_OVRUN          (1 <<  5)       /* Receive Overrun */
-#define                AT91_SSC_ENDRX          (1 <<  6)       /* End of Reception */
-#define                AT91_SSC_RXBUFF         (1 <<  7)       /* Receive Buffer Full */
-#define                AT91_SSC_CP0            (1 <<  8)       /* Compare 0 [AT91SAM9261 only] */
-#define                AT91_SSC_CP1            (1 <<  9)       /* Compare 1 [AT91SAM9261 only] */
-#define                AT91_SSC_TXSYN          (1 << 10)       /* Transmit Sync */
-#define                AT91_SSC_RXSYN          (1 << 11)       /* Receive Sync */
-#define                AT91_SSC_TXENA          (1 << 16)       /* Transmit Enable */
-#define                AT91_SSC_RXENA          (1 << 17)       /* Receive Enable */
-
-#define AT91_SSC_IER           0x44    /* Interrupt Enable Register */
-#define AT91_SSC_IDR           0x48    /* Interrupt Disable Register */
-#define AT91_SSC_IMR           0x4c    /* Interrupt Mask Register */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_st.h b/include/asm-arm/arch-at91rm9200/at91_st.h
deleted file mode 100644 (file)
index 2432ddf..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_st.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * System Timer (ST) - System peripherals registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_ST_H
-#define AT91_ST_H
-
-#define        AT91_ST_CR              (AT91_ST + 0x00)        /* Control Register */
-#define        AT91_ST_WDRST           (1 << 0)                /* Watchdog Timer Restart */
-
-#define        AT91_ST_PIMR            (AT91_ST + 0x04)        /* Period Interval Mode Register */
-#define                AT91_ST_PIV             (0xffff <<  0)          /* Period Interval Value */
-
-#define        AT91_ST_WDMR            (AT91_ST + 0x08)        /* Watchdog Mode Register */
-#define                AT91_ST_WDV             (0xffff <<  0)          /* Watchdog Counter Value */
-#define                AT91_ST_RSTEN           (1      << 16)          /* Reset Enable */
-#define                AT91_ST_EXTEN           (1      << 17)          /* External Signal Assertion Enable */
-
-#define        AT91_ST_RTMR            (AT91_ST + 0x0c)        /* Real-time Mode Register */
-#define                AT91_ST_RTPRES          (0xffff <<  0)          /* Real-time Prescalar Value */
-
-#define        AT91_ST_SR              (AT91_ST + 0x10)        /* Status Register */
-#define                AT91_ST_PITS            (1 << 0)                /* Period Interval Timer Status */
-#define                AT91_ST_WDOVF           (1 << 1)                /* Watchdog Overflow */
-#define                AT91_ST_RTTINC          (1 << 2)                /* Real-time Timer Increment */
-#define                AT91_ST_ALMS            (1 << 3)                /* Alarm Status */
-
-#define        AT91_ST_IER             (AT91_ST + 0x14)        /* Interrupt Enable Register */
-#define        AT91_ST_IDR             (AT91_ST + 0x18)        /* Interrupt Disable Register */
-#define        AT91_ST_IMR             (AT91_ST + 0x1c)        /* Interrupt Mask Register */
-
-#define        AT91_ST_RTAR            (AT91_ST + 0x20)        /* Real-time Alarm Register */
-#define                AT91_ST_ALMV            (0xfffff << 0)          /* Alarm Value */
-
-#define        AT91_ST_CRTR            (AT91_ST + 0x24)        /* Current Real-time Register */
-#define                AT91_ST_CRTV            (0xfffff << 0)          /* Current Real-Time Value */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_tc.h b/include/asm-arm/arch-at91rm9200/at91_tc.h
deleted file mode 100644 (file)
index 8d06eb0..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_tc.h
- *
- * Copyright (C) SAN People
- *
- * Timer/Counter Unit (TC) registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_TC_H
-#define AT91_TC_H
-
-#define AT91_TC_BCR            0xc0            /* TC Block Control Register */
-#define                AT91_TC_SYNC            (1 << 0)        /* Synchro Command */
-
-#define AT91_TC_BMR            0xc4            /* TC Block Mode Register */
-#define                AT91_TC_TC0XC0S         (3 << 0)        /* External Clock Signal 0 Selection */
-#define                        AT91_TC_TC0XC0S_TCLK0           (0 << 0)
-#define                        AT91_TC_TC0XC0S_NONE            (1 << 0)
-#define                        AT91_TC_TC0XC0S_TIOA1           (2 << 0)
-#define                        AT91_TC_TC0XC0S_TIOA2           (3 << 0)
-#define                AT91_TC_TC1XC1S         (3 << 2)        /* External Clock Signal 1 Selection */
-#define                        AT91_TC_TC1XC1S_TCLK1           (0 << 2)
-#define                        AT91_TC_TC1XC1S_NONE            (1 << 2)
-#define                        AT91_TC_TC1XC1S_TIOA0           (2 << 2)
-#define                        AT91_TC_TC1XC1S_TIOA2           (3 << 2)
-#define                AT91_TC_TC2XC2S         (3 << 4)        /* External Clock Signal 2 Selection */
-#define                        AT91_TC_TC2XC2S_TCLK2           (0 << 4)
-#define                        AT91_TC_TC2XC2S_NONE            (1 << 4)
-#define                        AT91_TC_TC2XC2S_TIOA0           (2 << 4)
-#define                        AT91_TC_TC2XC2S_TIOA1           (3 << 4)
-
-
-#define AT91_TC_CCR            0x00            /* Channel Control Register */
-#define                AT91_TC_CLKEN           (1 << 0)        /* Counter Clock Enable Command */
-#define                AT91_TC_CLKDIS          (1 << 1)        /* Counter CLock Disable Command */
-#define                AT91_TC_SWTRG           (1 << 2)        /* Software Trigger Command */
-
-#define AT91_TC_CMR            0x04            /* Channel Mode Register */
-#define                AT91_TC_TCCLKS          (7 << 0)        /* Capture/Waveform Mode: Clock Selection */
-#define                        AT91_TC_TIMER_CLOCK1            (0 << 0)
-#define                        AT91_TC_TIMER_CLOCK2            (1 << 0)
-#define                        AT91_TC_TIMER_CLOCK3            (2 << 0)
-#define                        AT91_TC_TIMER_CLOCK4            (3 << 0)
-#define                        AT91_TC_TIMER_CLOCK5            (4 << 0)
-#define                        AT91_TC_XC0                     (5 << 0)
-#define                        AT91_TC_XC1                     (6 << 0)
-#define                        AT91_TC_XC2                     (7 << 0)
-#define                AT91_TC_CLKI            (1 << 3)        /* Capture/Waveform Mode: Clock Invert */
-#define                AT91_TC_BURST           (3 << 4)        /* Capture/Waveform Mode: Burst Signal Selection */
-#define                AT91_TC_LDBSTOP         (1 << 6)        /* Capture Mode: Counter Clock Stopped with TB Loading */
-#define                AT91_TC_LDBDIS          (1 << 7)        /* Capture Mode: Counter Clock Disable with RB Loading */
-#define                AT91_TC_ETRGEDG         (3 << 8)        /* Capture Mode: External Trigger Edge Selection */
-#define                AT91_TC_ABETRG          (1 << 10)       /* Capture Mode: TIOA or TIOB External Trigger Selection */
-#define                AT91_TC_CPCTRG          (1 << 14)       /* Capture Mode: RC Compare Trigger Enable */
-#define                AT91_TC_WAVE            (1 << 15)       /* Capture/Waveform mode */
-#define                AT91_TC_LDRA            (3 << 16)       /* Capture Mode: RA Loading Selection */
-#define                AT91_TC_LDRB            (3 << 18)       /* Capture Mode: RB Loading Selection */
-
-#define                AT91_TC_CPCSTOP         (1 <<  6)       /* Waveform Mode: Counter Clock Stopped with RC Compare */
-#define                AT91_TC_CPCDIS          (1 <<  7)       /* Waveform Mode: Counter Clock Disable with RC Compare */
-#define                AT91_TC_EEVTEDG         (3 <<  8)       /* Waveform Mode: External Event Edge Selection */
-#define                        AT91_TC_EEVTEDG_NONE            (0 << 8)
-#define                        AT91_TC_EEVTEDG_RISING          (1 << 8)
-#define                        AT91_TC_EEVTEDG_FALLING         (2 << 8)
-#define                        AT91_TC_EEVTEDG_BOTH            (3 << 8)
-#define                AT91_TC_EEVT            (3 << 10)       /* Waveform Mode: External Event Selection */
-#define                        AT91_TC_EEVT_TIOB               (0 << 10)
-#define                        AT91_TC_EEVT_XC0                (1 << 10)
-#define                        AT91_TC_EEVT_XC1                (2 << 10)
-#define                        AT91_TC_EEVT_XC2                (3 << 10)
-#define                AT91_TC_ENETRG          (1 << 12)       /* Waveform Mode: External Event Trigger Enable */
-#define                AT91_TC_WAVESEL         (3 << 13)       /* Waveform Mode: Waveform Selection */
-#define                        AT91_TC_WAVESEL_UP              (0 << 13)
-#define                        AT91_TC_WAVESEL_UP_AUTO         (2 << 13)
-#define                        AT91_TC_WAVESEL_UPDOWN          (1 << 13)
-#define                        AT91_TC_WAVESEL_UPDOWN_AUTO     (3 << 13)
-#define                AT91_TC_ACPA            (3 << 16)       /* Waveform Mode: RA Compare Effect on TIOA */
-#define                        AT91_TC_ACPA_NONE               (0 << 16)
-#define                        AT91_TC_ACPA_SET                (1 << 16)
-#define                        AT91_TC_ACPA_CLEAR              (2 << 16)
-#define                        AT91_TC_ACPA_TOGGLE             (3 << 16)
-#define                AT91_TC_ACPC            (3 << 18)       /* Waveform Mode: RC Compre Effect on TIOA */
-#define                        AT91_TC_ACPC_NONE               (0 << 18)
-#define                        AT91_TC_ACPC_SET                (1 << 18)
-#define                        AT91_TC_ACPC_CLEAR              (2 << 18)
-#define                        AT91_TC_ACPC_TOGGLE             (3 << 18)
-#define                AT91_TC_AEEVT           (3 << 20)       /* Waveform Mode: External Event Effect on TIOA */
-#define                        AT91_TC_AEEVT_NONE              (0 << 20)
-#define                        AT91_TC_AEEVT_SET               (1 << 20)
-#define                        AT91_TC_AEEVT_CLEAR             (2 << 20)
-#define                        AT91_TC_AEEVT_TOGGLE            (3 << 20)
-#define                AT91_TC_ASWTRG          (3 << 22)       /* Waveform Mode: Software Trigger Effect on TIOA */
-#define                        AT91_TC_ASWTRG_NONE             (0 << 22)
-#define                        AT91_TC_ASWTRG_SET              (1 << 22)
-#define                        AT91_TC_ASWTRG_CLEAR            (2 << 22)
-#define                        AT91_TC_ASWTRG_TOGGLE           (3 << 22)
-#define                AT91_TC_BCPB            (3 << 24)       /* Waveform Mode: RB Compare Effect on TIOB */
-#define                        AT91_TC_BCPB_NONE               (0 << 24)
-#define                        AT91_TC_BCPB_SET                (1 << 24)
-#define                        AT91_TC_BCPB_CLEAR              (2 << 24)
-#define                        AT91_TC_BCPB_TOGGLE             (3 << 24)
-#define                AT91_TC_BCPC            (3 << 26)       /* Waveform Mode: RC Compare Effect on TIOB */
-#define                        AT91_TC_BCPC_NONE               (0 << 26)
-#define                        AT91_TC_BCPC_SET                (1 << 26)
-#define                        AT91_TC_BCPC_CLEAR              (2 << 26)
-#define                        AT91_TC_BCPC_TOGGLE             (3 << 26)
-#define                AT91_TC_BEEVT           (3 << 28)       /* Waveform Mode: External Event Effect on TIOB */
-#define                        AT91_TC_BEEVT_NONE              (0 << 28)
-#define                        AT91_TC_BEEVT_SET               (1 << 28)
-#define                        AT91_TC_BEEVT_CLEAR             (2 << 28)
-#define                        AT91_TC_BEEVT_TOGGLE            (3 << 28)
-#define                AT91_TC_BSWTRG          (3 << 30)       /* Waveform Mode: Software Trigger Effect on TIOB */
-#define                        AT91_TC_BSWTRG_NONE             (0 << 30)
-#define                        AT91_TC_BSWTRG_SET              (1 << 30)
-#define                        AT91_TC_BSWTRG_CLEAR            (2 << 30)
-#define                        AT91_TC_BSWTRG_TOGGLE           (3 << 30)
-
-#define AT91_TC_CV             0x10            /* Counter Value */
-#define AT91_TC_RA             0x14            /* Register A */
-#define AT91_TC_RB             0x18            /* Register B */
-#define AT91_TC_RC             0x1c            /* Register C */
-
-#define AT91_TC_SR             0x20            /* Status Register */
-#define                AT91_TC_COVFS           (1 <<  0)       /* Counter Overflow Status */
-#define                AT91_TC_LOVRS           (1 <<  1)       /* Load Overrun Status */
-#define                AT91_TC_CPAS            (1 <<  2)       /* RA Compare Status */
-#define                AT91_TC_CPBS            (1 <<  3)       /* RB Compare Status */
-#define                AT91_TC_CPCS            (1 <<  4)       /* RC Compare Status */
-#define                AT91_TC_LDRAS           (1 <<  5)       /* RA Loading Status */
-#define                AT91_TC_LDRBS           (1 <<  6)       /* RB Loading Status */
-#define                AT91_TC_ETRGS           (1 <<  7)       /* External Trigger Status */
-#define                AT91_TC_CLKSTA          (1 << 16)       /* Clock Enabling Status */
-#define                AT91_TC_MTIOA           (1 << 17)       /* TIOA Mirror */
-#define                AT91_TC_MTIOB           (1 << 18)       /* TIOB Mirror */
-
-#define AT91_TC_IER            0x24            /* Interrupt Enable Register */
-#define AT91_TC_IDR            0x28            /* Interrupt Disable Register */
-#define AT91_TC_IMR            0x2c            /* Interrupt Mask Register */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_twi.h b/include/asm-arm/arch-at91rm9200/at91_twi.h
deleted file mode 100644 (file)
index cda914f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_twi.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Two-wire Interface (TWI) registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_TWI_H
-#define AT91_TWI_H
-
-#define        AT91_TWI_CR             0x00            /* Control Register */
-#define                AT91_TWI_START          (1 <<  0)       /* Send a Start Condition */
-#define                AT91_TWI_STOP           (1 <<  1)       /* Send a Stop Condition */
-#define                AT91_TWI_MSEN           (1 <<  2)       /* Master Transfer Enable */
-#define                AT91_TWI_MSDIS          (1 <<  3)       /* Master Transfer Disable */
-#define                AT91_TWI_SWRST          (1 <<  7)       /* Software Reset */
-
-#define        AT91_TWI_MMR            0x04            /* Master Mode Register */
-#define                AT91_TWI_IADRSZ         (3    <<  8)    /* Internal Device Address Size */
-#define                        AT91_TWI_IADRSZ_NO              (0 << 8)
-#define                        AT91_TWI_IADRSZ_1               (1 << 8)
-#define                        AT91_TWI_IADRSZ_2               (2 << 8)
-#define                        AT91_TWI_IADRSZ_3               (3 << 8)
-#define                AT91_TWI_MREAD          (1    << 12)    /* Master Read Direction */
-#define                AT91_TWI_DADR           (0x7f << 16)    /* Device Address */
-
-#define        AT91_TWI_IADR           0x0c            /* Internal Address Register */
-
-#define        AT91_TWI_CWGR           0x10            /* Clock Waveform Generator Register */
-#define                AT91_TWI_CLDIV          (0xff <<  0)    /* Clock Low Divisor */
-#define                AT91_TWI_CHDIV          (0xff <<  8)    /* Clock High Divisor */
-#define                AT91_TWI_CKDIV          (7    << 16)    /* Clock Divider */
-
-#define        AT91_TWI_SR             0x20            /* Status Register */
-#define                AT91_TWI_TXCOMP         (1 <<  0)       /* Transmission Complete */
-#define                AT91_TWI_RXRDY          (1 <<  1)       /* Receive Holding Register Ready */
-#define                AT91_TWI_TXRDY          (1 <<  2)       /* Transmit Holding Register Ready */
-#define                AT91_TWI_OVRE           (1 <<  6)       /* Overrun Error [AT91RM9200 only] */
-#define                AT91_TWI_UNRE           (1 <<  7)       /* Underrun Error [AT91RM9200 only] */
-#define                AT91_TWI_NACK           (1 <<  8)       /* Not Acknowledged */
-
-#define        AT91_TWI_IER            0x24            /* Interrupt Enable Register */
-#define        AT91_TWI_IDR            0x28            /* Interrupt Disable Register */
-#define        AT91_TWI_IMR            0x2c            /* Interrupt Mask Register */
-#define        AT91_TWI_RHR            0x30            /* Receive Holding Register */
-#define        AT91_TWI_THR            0x34            /* Transmit Holding Register */
-
-#endif
-
diff --git a/include/asm-arm/arch-at91rm9200/at91_wdt.h b/include/asm-arm/arch-at91rm9200/at91_wdt.h
deleted file mode 100644 (file)
index ac63e77..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_wdt.h
- *
- * Watchdog Timer (WDT) - System peripherals regsters.
- * Based on AT91SAM9261 datasheet revision D.
- *
- * 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 AT91_WDT_H
-#define AT91_WDT_H
-
-#define AT91_WDT_CR            (AT91_WDT + 0x00)       /* Watchdog Control Register */
-#define                AT91_WDT_WDRSTT         (1    << 0)             /* Restart */
-#define                AT91_WDT_KEY            (0xff << 24)            /* KEY Password */
-
-#define AT91_WDT_MR            (AT91_WDT + 0x04)       /* Watchdog Mode Register */
-#define                AT91_WDT_WDV            (0xfff << 0)            /* Counter Value */
-#define                AT91_WDT_WDFIEN         (1     << 12)           /* Fault Interrupt Enable */
-#define                AT91_WDT_WDRSTEN        (1     << 13)           /* Reset Processor */
-#define                AT91_WDT_WDRPROC        (1     << 14)           /* Timer Restart */
-#define                AT91_WDT_WDDIS          (1     << 15)           /* Watchdog Disable */
-#define                AT91_WDT_WDD            (0xfff << 16)           /* Delta Value */
-#define                AT91_WDT_WDDBGHLT       (1     << 28)           /* Debug Halt */
-#define                AT91_WDT_WDIDLEHLT      (1     << 29)           /* Idle Halt */
-
-#define AT91_WDT_SR            (AT91_WDT + 0x08)       /* Watchdog Status Register */
-#define                AT91_WDT_WDUNF          (1 << 0)                /* Watchdog Underflow */
-#define                AT91_WDT_WDERR          (1 << 1)                /* Watchdog Error */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200.h b/include/asm-arm/arch-at91rm9200/at91rm9200.h
deleted file mode 100644 (file)
index c569b6a..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91rm9200.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Common definitions.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91RM9200_H
-#define AT91RM9200_H
-
-/*
- * Peripheral identifiers/interrupts.
- */
-#define AT91_ID_FIQ            0       /* Advanced Interrupt Controller (FIQ) */
-#define AT91_ID_SYS            1       /* System Peripheral */
-#define AT91RM9200_ID_PIOA     2       /* Parallel IO Controller A */
-#define AT91RM9200_ID_PIOB     3       /* Parallel IO Controller B */
-#define AT91RM9200_ID_PIOC     4       /* Parallel IO Controller C */
-#define AT91RM9200_ID_PIOD     5       /* Parallel IO Controller D */
-#define AT91RM9200_ID_US0      6       /* USART 0 */
-#define AT91RM9200_ID_US1      7       /* USART 1 */
-#define AT91RM9200_ID_US2      8       /* USART 2 */
-#define AT91RM9200_ID_US3      9       /* USART 3 */
-#define AT91RM9200_ID_MCI      10      /* Multimedia Card Interface */
-#define AT91RM9200_ID_UDP      11      /* USB Device Port */
-#define AT91RM9200_ID_TWI      12      /* Two-Wire Interface */
-#define AT91RM9200_ID_SPI      13      /* Serial Peripheral Interface */
-#define AT91RM9200_ID_SSC0     14      /* Serial Synchronous Controller 0 */
-#define AT91RM9200_ID_SSC1     15      /* Serial Synchronous Controller 1 */
-#define AT91RM9200_ID_SSC2     16      /* Serial Synchronous Controller 2 */
-#define AT91RM9200_ID_TC0      17      /* Timer Counter 0 */
-#define AT91RM9200_ID_TC1      18      /* Timer Counter 1 */
-#define AT91RM9200_ID_TC2      19      /* Timer Counter 2 */
-#define AT91RM9200_ID_TC3      20      /* Timer Counter 3 */
-#define AT91RM9200_ID_TC4      21      /* Timer Counter 4 */
-#define AT91RM9200_ID_TC5      22      /* Timer Counter 5 */
-#define AT91RM9200_ID_UHP      23      /* USB Host port */
-#define AT91RM9200_ID_EMAC     24      /* Ethernet MAC */
-#define AT91RM9200_ID_IRQ0     25      /* Advanced Interrupt Controller (IRQ0) */
-#define AT91RM9200_ID_IRQ1     26      /* Advanced Interrupt Controller (IRQ1) */
-#define AT91RM9200_ID_IRQ2     27      /* Advanced Interrupt Controller (IRQ2) */
-#define AT91RM9200_ID_IRQ3     28      /* Advanced Interrupt Controller (IRQ3) */
-#define AT91RM9200_ID_IRQ4     29      /* Advanced Interrupt Controller (IRQ4) */
-#define AT91RM9200_ID_IRQ5     30      /* Advanced Interrupt Controller (IRQ5) */
-#define AT91RM9200_ID_IRQ6     31      /* Advanced Interrupt Controller (IRQ6) */
-
-
-/*
- * Peripheral physical base addresses.
- */
-#define AT91RM9200_BASE_TCB0   0xfffa0000
-#define AT91RM9200_BASE_TC0    0xfffa0000
-#define AT91RM9200_BASE_TC1    0xfffa0040
-#define AT91RM9200_BASE_TC2    0xfffa0080
-#define AT91RM9200_BASE_TCB1   0xfffa4000
-#define AT91RM9200_BASE_TC3    0xfffa4000
-#define AT91RM9200_BASE_TC4    0xfffa4040
-#define AT91RM9200_BASE_TC5    0xfffa4080
-#define AT91RM9200_BASE_UDP    0xfffb0000
-#define AT91RM9200_BASE_MCI    0xfffb4000
-#define AT91RM9200_BASE_TWI    0xfffb8000
-#define AT91RM9200_BASE_EMAC   0xfffbc000
-#define AT91RM9200_BASE_US0    0xfffc0000
-#define AT91RM9200_BASE_US1    0xfffc4000
-#define AT91RM9200_BASE_US2    0xfffc8000
-#define AT91RM9200_BASE_US3    0xfffcc000
-#define AT91RM9200_BASE_SSC0   0xfffd0000
-#define AT91RM9200_BASE_SSC1   0xfffd4000
-#define AT91RM9200_BASE_SSC2   0xfffd8000
-#define AT91RM9200_BASE_SPI    0xfffe0000
-#define AT91_BASE_SYS          0xfffff000
-
-
-/*
- * System Peripherals (offset from AT91_BASE_SYS)
- */
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)    /* Advanced Interrupt Controller */
-#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)    /* Debug Unit */
-#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)    /* PIO Controller A */
-#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)    /* PIO Controller B */
-#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)    /* PIO Controller C */
-#define AT91_PIOD      (0xfffffa00 - AT91_BASE_SYS)    /* PIO Controller D */
-#define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)    /* Power Management Controller */
-#define AT91_ST                (0xfffffd00 - AT91_BASE_SYS)    /* System Timer */
-#define AT91_RTC       (0xfffffe00 - AT91_BASE_SYS)    /* Real-Time Clock */
-#define AT91_MC                (0xffffff00 - AT91_BASE_SYS)    /* Memory Controllers */
-
-#define AT91_MATRIX    0       /* not supported */
-
-/*
- * Internal Memory.
- */
-#define AT91RM9200_ROM_BASE    0x00100000      /* Internal ROM base address */
-#define AT91RM9200_ROM_SIZE    SZ_128K         /* Internal ROM size (128Kb) */
-
-#define AT91RM9200_SRAM_BASE   0x00200000      /* Internal SRAM base address */
-#define AT91RM9200_SRAM_SIZE   SZ_16K          /* Internal SRAM size (16Kb) */
-
-#define AT91RM9200_UHP_BASE    0x00300000      /* USB Host controller */
-
-
-#if 0
-/*
- * PIO pin definitions (peripheral A/B multiplexing).
- */
-#define AT91_PA0_MISO          (1 <<  0)       /* A: SPI Master-In Slave-Out */
-#define AT91_PA0_PCK3          (1 <<  0)       /* B: PMC Programmable Clock Output 3 */
-#define AT91_PA1_MOSI          (1 <<  1)       /* A: SPI Master-Out Slave-In */
-#define AT91_PA1_PCK0          (1 <<  1)       /* B: PMC Programmable Clock Output 0 */
-#define AT91_PA2_SPCK          (1 <<  2)       /* A: SPI Serial Clock */
-#define AT91_PA2_IRQ4          (1 <<  2)       /* B: External Interrupt 4 */
-#define AT91_PA3_NPCS0         (1 <<  3)       /* A: SPI Peripheral Chip Select 0 */
-#define AT91_PA3_IRQ5          (1 <<  3)       /* B: External Interrupt 5 */
-#define AT91_PA4_NPCS1         (1 <<  4)       /* A: SPI Peripheral Chip Select 1 */
-#define AT91_PA4_PCK1          (1 <<  4)       /* B: PMC Programmable Clock Output 1 */
-#define AT91_PA5_NPCS2         (1 <<  5)       /* A: SPI Peripheral Chip Select 2 */
-#define AT91_PA5_TXD3          (1 <<  5)       /* B: USART Transmit Data 3 */
-#define AT91_PA6_NPCS3         (1 <<  6)       /* A: SPI Peripheral Chip Select 3 */
-#define AT91_PA6_RXD3          (1 <<  6)       /* B: USART Receive Data 3 */
-#define AT91_PA7_ETXCK_EREFCK  (1 <<  7)       /* A: Ethernet Reference Clock / Transmit Clock */
-#define AT91_PA7_PCK2          (1 <<  7)       /* B: PMC Programmable Clock Output 2 */
-#define AT91_PA8_ETXEN         (1 <<  8)       /* A: Ethernet Transmit Enable */
-#define AT91_PA8_MCCDB         (1 <<  8)       /* B: MMC Multimedia Card B Command */
-#define AT91_PA9_ETX0          (1 <<  9)       /* A: Ethernet Transmit Data 0 */
-#define AT91_PA9_MCDB0         (1 <<  9)       /* B: MMC Multimedia Card B Data 0 */
-#define AT91_PA10_ETX1         (1 << 10)       /* A: Ethernet Transmit Data 1 */
-#define AT91_PA10_MCDB1                (1 << 10)       /* B: MMC Multimedia Card B Data 1 */
-#define AT91_PA11_ECRS_ECRSDV  (1 << 11)       /* A: Ethernet Carrier Sense / Data Valid */
-#define AT91_PA11_MCDB2                (1 << 11)       /* B: MMC Multimedia Card B Data 2 */
-#define AT91_PA12_ERX0         (1 << 12)       /* A: Ethernet Receive Data 0 */
-#define AT91_PA12_MCDB3                (1 << 12)       /* B: MMC Multimedia Card B Data 3 */
-#define AT91_PA13_ERX1         (1 << 13)       /* A: Ethernet Receive Data 1 */
-#define AT91_PA13_TCLK0                (1 << 13)       /* B: TC External Clock Input 0 */
-#define AT91_PA14_ERXER                (1 << 14)       /* A: Ethernet Receive Error */
-#define AT91_PA14_TCLK1                (1 << 14)       /* B: TC External Clock Input 1 */
-#define AT91_PA15_EMDC         (1 << 15)       /* A: Ethernet Management Data Clock */
-#define AT91_PA15_TCLK2                (1 << 15)       /* B: TC External Clock Input 2 */
-#define AT91_PA16_EMDIO                (1 << 16)       /* A: Ethernet Management Data I/O */
-#define AT91_PA16_IRQ6         (1 << 16)       /* B: External Interrupt 6 */
-#define AT91_PA17_TXD0         (1 << 17)       /* A: USART Transmit Data 0 */
-#define AT91_PA17_TIOA0                (1 << 17)       /* B: TC I/O Line A 0 */
-#define AT91_PA18_RXD0         (1 << 18)       /* A: USART Receive Data 0 */
-#define AT91_PA18_TIOB0                (1 << 18)       /* B: TC I/O Line B 0 */
-#define AT91_PA19_SCK0         (1 << 19)       /* A: USART Serial Clock 0 */
-#define AT91_PA19_TIOA1                (1 << 19)       /* B: TC I/O Line A 1 */
-#define AT91_PA20_CTS0         (1 << 20)       /* A: USART Clear To Send 0 */
-#define AT91_PA20_TIOB1                (1 << 20)       /* B: TC I/O Line B 1 */
-#define AT91_PA21_RTS0         (1 << 21)       /* A: USART Ready To Send 0 */
-#define AT91_PA21_TIOA2                (1 << 21)       /* B: TC I/O Line A 2 */
-#define AT91_PA22_RXD2         (1 << 22)       /* A: USART Receive Data 2 */
-#define AT91_PA22_TIOB2                (1 << 22)       /* B: TC I/O Line B 2 */
-#define AT91_PA23_TXD2         (1 << 23)       /* A: USART Transmit Data 2 */
-#define AT91_PA23_IRQ3         (1 << 23)       /* B: External Interrupt 3 */
-#define AT91_PA24_SCK2         (1 << 24)       /* A: USART Serial Clock 2 */
-#define AT91_PA24_PCK1         (1 << 24)       /* B: PMC Programmable Clock Output 1 */
-#define AT91_PA25_TWD          (1 << 25)       /* A: TWI Two-wire Serial Data */
-#define AT91_PA25_IRQ2         (1 << 25)       /* B: External Interrupt 2 */
-#define AT91_PA26_TWCK         (1 << 26)       /* A: TWI Two-wire Serial Clock */
-#define AT91_PA26_IRQ1         (1 << 26)       /* B: External Interrupt 1 */
-#define AT91_PA27_MCCK         (1 << 27)       /* A: MMC Multimedia Card Clock */
-#define AT91_PA27_TCLK3                (1 << 27)       /* B: TC External Clock Input 3 */
-#define AT91_PA28_MCCDA                (1 << 28)       /* A: MMC Multimedia Card A Command */
-#define AT91_PA28_TCLK4                (1 << 28)       /* B: TC External Clock Input 4 */
-#define AT91_PA29_MCDA0                (1 << 29)       /* A: MMC Multimedia Card A Data 0 */
-#define AT91_PA29_TCLK5                (1 << 29)       /* B: TC External Clock Input 5 */
-#define AT91_PA30_DRXD         (1 << 30)       /* A: DBGU Receive Data */
-#define AT91_PA30_CTS2         (1 << 30)       /* B: USART Clear To Send 2 */
-#define AT91_PA31_DTXD         (1 << 31)       /* A: DBGU Transmit Data */
-#define AT91_PA31_RTS2         (1 << 31)       /* B: USART Ready To Send 2 */
-
-#define AT91_PB0_TF0           (1 <<  0)       /* A: SSC Transmit Frame Sync 0 */
-#define AT91_PB0_RTS3          (1 <<  0)       /* B: USART Ready To Send 3 */
-#define AT91_PB1_TK0           (1 <<  1)       /* A: SSC Transmit Clock 0 */
-#define AT91_PB1_CTS3          (1 <<  1)       /* B: USART Clear To Send 3 */
-#define AT91_PB2_TD0           (1 <<  2)       /* A: SSC Transmit Data 0 */
-#define AT91_PB2_SCK3          (1 <<  2)       /* B: USART Serial Clock 3 */
-#define AT91_PB3_RD0           (1 <<  3)       /* A: SSC Receive Data 0 */
-#define AT91_PB3_MCDA1         (1 <<  3)       /* B: MMC Multimedia Card A Data 1 */
-#define AT91_PB4_RK0           (1 <<  4)       /* A: SSC Receive Clock 0 */
-#define AT91_PB4_MCDA2         (1 <<  4)       /* B: MMC Multimedia Card A Data 2 */
-#define AT91_PB5_RF0           (1 <<  5)       /* A: SSC Receive Frame Sync 0 */
-#define AT91_PB5_MCDA3         (1 <<  5)       /* B: MMC Multimedia Card A Data 3 */
-#define AT91_PB6_TF1           (1 <<  6)       /* A: SSC Transmit Frame Sync 1 */
-#define AT91_PB6_TIOA3         (1 <<  6)       /* B: TC I/O Line A 3 */
-#define AT91_PB7_TK1           (1 <<  7)       /* A: SSC Transmit Clock 1 */
-#define AT91_PB7_TIOB3         (1 <<  7)       /* B: TC I/O Line B 3 */
-#define AT91_PB8_TD1           (1 <<  8)       /* A: SSC Transmit Data 1 */
-#define AT91_PB8_TIOA4         (1 <<  8)       /* B: TC I/O Line A 4 */
-#define AT91_PB9_RD1           (1 <<  9)       /* A: SSC Receive Data 1 */
-#define AT91_PB9_TIOB4         (1 <<  9)       /* B: TC I/O Line B 4 */
-#define AT91_PB10_RK1          (1 << 10)       /* A: SSC Receive Clock 1 */
-#define AT91_PB10_TIOA5                (1 << 10)       /* B: TC I/O Line A 5 */
-#define AT91_PB11_RF1          (1 << 11)       /* A: SSC Receive Frame Sync 1 */
-#define AT91_PB11_TIOB5                (1 << 11)       /* B: TC I/O Line B 5 */
-#define AT91_PB12_TF2          (1 << 12)       /* A: SSC Transmit Frame Sync 2 */
-#define AT91_PB12_ETX2         (1 << 12)       /* B: Ethernet Transmit Data 2 */
-#define AT91_PB13_TK2          (1 << 13)       /* A: SSC Transmit Clock 3 */
-#define AT91_PB13_ETX3         (1 << 13)       /* B: Ethernet Transmit Data 3 */
-#define AT91_PB14_TD2          (1 << 14)       /* A: SSC Transmit Data 2 */
-#define AT91_PB14_ETXER                (1 << 14)       /* B: Ethernet Transmit Coding Error */
-#define AT91_PB15_RD2          (1 << 15)       /* A: SSC Receive Data 2 */
-#define AT91_PB15_ERX2         (1 << 15)       /* B: Ethernet Receive Data 2 */
-#define AT91_PB16_RK2          (1 << 16)       /* A: SSC Receive Clock 2 */
-#define AT91_PB16_ERX3         (1 << 16)       /* B: Ethernet Receive Data 3 */
-#define AT91_PB17_RF2          (1 << 17)       /* A: SSC Receive Frame Sync 2 */
-#define AT91_PB17_ERXDV                (1 << 17)       /* B: Ethernet Receive Data Valid */
-#define AT91_PB18_RI1          (1 << 18)       /* A: USART Ring Indicator 1 */
-#define AT91_PB18_ECOL         (1 << 18)       /* B: Ethernet Collision Detected */
-#define AT91_PB19_DTR1         (1 << 19)       /* A: USART Data Terminal Ready 1 */
-#define AT91_PB19_ERXCK                (1 << 19)       /* B: Ethernet Receive Clock */
-#define AT91_PB20_TXD1         (1 << 20)       /* A: USART Transmit Data 1 */
-#define AT91_PB21_RXD1         (1 << 21)       /* A: USART Receive Data 1 */
-#define AT91_PB22_SCK1         (1 << 22)       /* A: USART Serial Clock 1 */
-#define AT91_PB23_DCD1         (1 << 23)       /* A: USART Data Carrier Detect 1 */
-#define AT91_PB24_CTS1         (1 << 24)       /* A: USART Clear To Send 1 */
-#define AT91_PB25_DSR1         (1 << 25)       /* A: USART Data Set Ready 1 */
-#define AT91_PB25_EF100                (1 << 25)       /* B: Ethernet Force 100 Mbit */
-#define AT91_PB26_RTS1         (1 << 26)       /* A: USART Ready To Send 1 */
-#define AT91_PB27_PCK0         (1 << 27)       /* B: PMC Programmable Clock Output 0 */
-#define AT91_PB28_FIQ          (1 << 28)       /* A: Fast Interrupt */
-#define AT91_PB29_IRQ0         (1 << 29)       /* A: External Interrupt 0 */
-
-#define AT91_PC0_BFCK          (1 <<  0)       /* A: Burst Flash Clock */
-#define AT91_PC1_BFRDY_SMOE    (1 <<  1)       /* A: Burst Flash Ready / SmartMedia Output Enable */
-#define AT91_PC2_BFAVD         (1 <<  2)       /* A: Burst Flash Address Valid */
-#define AT91_PC3_BFBAA_SMWE    (1 <<  3)       /* A: Burst Flash Address Advance / SmartMedia Write Enable */
-#define AT91_PC4_BFOE          (1 <<  4)       /* A: Burst Flash Output Enable */
-#define AT91_PC5_BFWE          (1 <<  5)       /* A: Burst Flash Write Enable */
-#define AT91_PC6_NWAIT         (1 <<  6)       /* A: SMC Wait Signal */
-#define AT91_PC7_A23           (1 <<  7)       /* A: Address Bus 23 */
-#define AT91_PC8_A24           (1 <<  8)       /* A: Address Bus 24 */
-#define AT91_PC9_A25_CFRNW     (1 <<  9)       /* A: Address Bus 25 / Compact Flash Read Not Write */
-#define AT91_PC10_NCS4_CFCS    (1 << 10)       /* A: SMC Chip Select 4 / Compact Flash Chip Select */
-#define AT91_PC11_NCS5_CFCE1   (1 << 11)       /* A: SMC Chip Select 5 / Compact Flash Chip Enable 1 */
-#define AT91_PC12_NCS6_CFCE2   (1 << 12)       /* A: SMC Chip Select 6 / Compact Flash Chip Enable 2 */
-#define AT91_PC13_NCS7         (1 << 13)       /* A: Chip Select 7 */
-
-#define AT91_PD0_ETX0          (1 <<  0)       /* A: Ethernet Transmit Data 0 */
-#define AT91_PD1_ETX1          (1 <<  1)       /* A: Ethernet Transmit Data 1 */
-#define AT91_PD2_ETX2          (1 <<  2)       /* A: Ethernet Transmit Data 2 */
-#define AT91_PD3_ETX3          (1 <<  3)       /* A: Ethernet Transmit Data 3 */
-#define AT91_PD4_ETXEN         (1 <<  4)       /* A: Ethernet Transmit Enable */
-#define AT91_PD5_ETXER         (1 <<  5)       /* A: Ethernet Transmit Coding Error */
-#define AT91_PD6_DTXD          (1 <<  6)       /* A: DBGU Transmit Data */
-#define AT91_PD7_PCK0          (1 <<  7)       /* A: PMC Programmable Clock Output 0 */
-#define AT91_PD7_TSYNC         (1 <<  7)       /* B: ETM Trace Synchronization Signal */
-#define AT91_PD8_PCK1          (1 <<  8)       /* A: PMC Programmable Clock Output 1 */
-#define AT91_PD8_TCLK          (1 <<  8)       /* B: ETM Trace Clock */
-#define AT91_PD9_PCK2          (1 <<  9)       /* A: PMC Programmable Clock Output 2 */
-#define AT91_PD9_TPS0          (1 <<  9)       /* B: ETM Trace ARM Pipeline Status 0 */
-#define AT91_PD10_PCK3         (1 << 10)       /* A: PMC Programmable Clock Output 3 */
-#define AT91_PD10_TPS1         (1 << 10)       /* B: ETM Trace ARM Pipeline Status 1 */
-#define AT91_PD11_TPS2         (1 << 11)       /* B: ETM Trace ARM Pipeline Status 2 */
-#define AT91_PD12_TPK0         (1 << 12)       /* B: ETM Trace Packet Port 0 */
-#define AT91_PD13_TPK1         (1 << 13)       /* B: ETM Trace Packet Port 1 */
-#define AT91_PD14_TPK2         (1 << 14)       /* B: ETM Trace Packet Port 2 */
-#define AT91_PD15_TD0          (1 << 15)       /* A: SSC Transmit Data 0 */
-#define AT91_PD15_TPK3         (1 << 15)       /* B: ETM Trace Packet Port 3 */
-#define AT91_PD16_TD1          (1 << 16)       /* A: SSC Transmit Data 1 */
-#define AT91_PD16_TPK4         (1 << 16)       /* B: ETM Trace Packet Port 4 */
-#define AT91_PD17_TD2          (1 << 17)       /* A: SSC Transmit Data 2 */
-#define AT91_PD17_TPK5         (1 << 17)       /* B: ETM Trace Packet Port 5 */
-#define AT91_PD18_NPCS1                (1 << 18)       /* A: SPI Peripheral Chip Select 1 */
-#define AT91_PD18_TPK6         (1 << 18)       /* B: ETM Trace Packet Port 6 */
-#define AT91_PD19_NPCS2                (1 << 19)       /* A: SPI Peripheral Chip Select 2 */
-#define AT91_PD19_TPK7         (1 << 19)       /* B: ETM Trace Packet Port 7 */
-#define AT91_PD20_NPCS3                (1 << 20)       /* A: SPI Peripheral Chip Select 3 */
-#define AT91_PD20_TPK8         (1 << 20)       /* B: ETM Trace Packet Port 8 */
-#define AT91_PD21_RTS0         (1 << 21)       /* A: USART Ready To Send 0 */
-#define AT91_PD21_TPK9         (1 << 21)       /* B: ETM Trace Packet Port 9 */
-#define AT91_PD22_RTS1         (1 << 22)       /* A: USART Ready To Send 1 */
-#define AT91_PD22_TPK10                (1 << 22)       /* B: ETM Trace Packet Port 10 */
-#define AT91_PD23_RTS2         (1 << 23)       /* A: USART Ready To Send 2 */
-#define AT91_PD23_TPK11                (1 << 23)       /* B: ETM Trace Packet Port 11 */
-#define AT91_PD24_RTS3         (1 << 24)       /* A: USART Ready To Send 3 */
-#define AT91_PD24_TPK12                (1 << 24)       /* B: ETM Trace Packet Port 12 */
-#define AT91_PD25_DTR1         (1 << 25)       /* A: USART Data Terminal Ready 1 */
-#define AT91_PD25_TPK13                (1 << 25)       /* B: ETM Trace Packet Port 13 */
-#define AT91_PD26_TPK14                (1 << 26)       /* B: ETM Trace Packet Port 14 */
-#define AT91_PD27_TPK15                (1 << 27)       /* B: ETM Trace Packet Port 15 */
-#endif
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_emac.h b/include/asm-arm/arch-at91rm9200/at91rm9200_emac.h
deleted file mode 100644 (file)
index fbc091e..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91rm9200_emac.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Ethernet MAC registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91RM9200_EMAC_H
-#define AT91RM9200_EMAC_H
-
-#define        AT91_EMAC_CTL           0x00    /* Control Register */
-#define                AT91_EMAC_LB            (1 <<  0)       /* Loopback */
-#define                AT91_EMAC_LBL           (1 <<  1)       /* Loopback Local */
-#define                AT91_EMAC_RE            (1 <<  2)       /* Receive Enable */
-#define                AT91_EMAC_TE            (1 <<  3)       /* Transmit Enable */
-#define                AT91_EMAC_MPE           (1 <<  4)       /* Management Port Enable */
-#define                AT91_EMAC_CSR           (1 <<  5)       /* Clear Statistics Registers */
-#define                AT91_EMAC_INCSTAT       (1 <<  6)       /* Increment Statistics Registers */
-#define                AT91_EMAC_WES           (1 <<  7)       /* Write Enable for Statistics Registers */
-#define                AT91_EMAC_BP            (1 <<  8)       /* Back Pressure */
-
-#define        AT91_EMAC_CFG           0x04    /* Configuration Register */
-#define                AT91_EMAC_SPD           (1 <<  0)       /* Speed */
-#define                AT91_EMAC_FD            (1 <<  1)       /* Full Duplex */
-#define                AT91_EMAC_BR            (1 <<  2)       /* Bit Rate */
-#define                AT91_EMAC_CAF           (1 <<  4)       /* Copy All Frames */
-#define                AT91_EMAC_NBC           (1 <<  5)       /* No Broadcast */
-#define                AT91_EMAC_MTI           (1 <<  6)       /* Multicast Hash Enable */
-#define                AT91_EMAC_UNI           (1 <<  7)       /* Unicast Hash Enable */
-#define                AT91_EMAC_BIG           (1 <<  8)       /* Receive 1522 Bytes */
-#define                AT91_EMAC_EAE           (1 <<  9)       /* External Address Match Enable */
-#define                AT91_EMAC_CLK           (3 << 10)       /* MDC Clock Divisor */
-#define                AT91_EMAC_CLK_DIV8              (0 << 10)
-#define                AT91_EMAC_CLK_DIV16             (1 << 10)
-#define                AT91_EMAC_CLK_DIV32             (2 << 10)
-#define                AT91_EMAC_CLK_DIV64             (3 << 10)
-#define                AT91_EMAC_RTY           (1 << 12)       /* Retry Test */
-#define                AT91_EMAC_RMII          (1 << 13)       /* Reduce MII (RMII) */
-
-#define        AT91_EMAC_SR            0x08    /* Status Register */
-#define                AT91_EMAC_SR_LINK       (1 <<  0)       /* Link */
-#define                AT91_EMAC_SR_MDIO       (1 <<  1)       /* MDIO pin */
-#define                AT91_EMAC_SR_IDLE       (1 <<  2)       /* PHY idle */
-
-#define        AT91_EMAC_TAR           0x0c    /* Transmit Address Register */
-
-#define        AT91_EMAC_TCR           0x10    /* Transmit Control Register */
-#define                AT91_EMAC_LEN           (0x7ff << 0)    /* Transmit Frame Length */
-#define                AT91_EMAC_NCRC          (1     << 15)   /* No CRC */
-
-#define        AT91_EMAC_TSR           0x14    /* Transmit Status Register */
-#define                AT91_EMAC_TSR_OVR       (1 <<  0)       /* Transmit Buffer Overrun */
-#define                AT91_EMAC_TSR_COL       (1 <<  1)       /* Collision Occurred */
-#define                AT91_EMAC_TSR_RLE       (1 <<  2)       /* Retry Limit Exceeded */
-#define                AT91_EMAC_TSR_IDLE      (1 <<  3)       /* Transmitter Idle */
-#define                AT91_EMAC_TSR_BNQ       (1 <<  4)       /* Transmit Buffer not Queued */
-#define                AT91_EMAC_TSR_COMP      (1 <<  5)       /* Transmit Complete */
-#define                AT91_EMAC_TSR_UND       (1 <<  6)       /* Transmit Underrun */
-
-#define        AT91_EMAC_RBQP          0x18    /* Receive Buffer Queue Pointer */
-
-#define        AT91_EMAC_RSR           0x20    /* Receive Status Register */
-#define                AT91_EMAC_RSR_BNA       (1 <<  0)       /* Buffer Not Available */
-#define                AT91_EMAC_RSR_REC       (1 <<  1)       /* Frame Received */
-#define                AT91_EMAC_RSR_OVR       (1 <<  2)       /* RX Overrun */
-
-#define        AT91_EMAC_ISR           0x24    /* Interrupt Status Register */
-#define                AT91_EMAC_DONE          (1 <<  0)       /* Management Done */
-#define                AT91_EMAC_RCOM          (1 <<  1)       /* Receive Complete */
-#define                AT91_EMAC_RBNA          (1 <<  2)       /* Receive Buffer Not Available */
-#define                AT91_EMAC_TOVR          (1 <<  3)       /* Transmit Buffer Overrun */
-#define                AT91_EMAC_TUND          (1 <<  4)       /* Transmit Buffer Underrun */
-#define                AT91_EMAC_RTRY          (1 <<  5)       /* Retry Limit */
-#define                AT91_EMAC_TBRE          (1 <<  6)       /* Transmit Buffer Register Empty */
-#define                AT91_EMAC_TCOM          (1 <<  7)       /* Transmit Complete */
-#define                AT91_EMAC_TIDLE         (1 <<  8)       /* Transmit Idle */
-#define                AT91_EMAC_LINK          (1 <<  9)       /* Link */
-#define                AT91_EMAC_ROVR          (1 << 10)       /* RX Overrun */
-#define                AT91_EMAC_ABT           (1 << 11)       /* Abort */
-
-#define        AT91_EMAC_IER           0x28    /* Interrupt Enable Register */
-#define        AT91_EMAC_IDR           0x2c    /* Interrupt Disable Register */
-#define        AT91_EMAC_IMR           0x30    /* Interrupt Mask Register */
-
-#define        AT91_EMAC_MAN           0x34    /* PHY Maintenance Register */
-#define                AT91_EMAC_DATA          (0xffff << 0)   /* MDIO Data */
-#define                AT91_EMAC_REGA          (0x1f   << 18)  /* MDIO Register */
-#define                AT91_EMAC_PHYA          (0x1f   << 23)  /* MDIO PHY Address */
-#define                AT91_EMAC_RW            (3      << 28)  /* Read/Write operation */
-#define                        AT91_EMAC_RW_W          (1 << 28)
-#define                        AT91_EMAC_RW_R          (2 << 28)
-#define                AT91_EMAC_MAN_802_3     0x40020000      /* IEEE 802.3 value */
-
-/*
- * Statistics Registers.
- */
-#define AT91_EMAC_FRA          0x40    /* Frames Transmitted OK */
-#define AT91_EMAC_SCOL         0x44    /* Single Collision Frame */
-#define AT91_EMAC_MCOL         0x48    /* Multiple Collision Frame */
-#define AT91_EMAC_OK           0x4c    /* Frames Received OK */
-#define AT91_EMAC_SEQE         0x50    /* Frame Check Sequence Error */
-#define AT91_EMAC_ALE          0x54    /* Alignmemt Error */
-#define AT91_EMAC_DTE          0x58    /* Deffered Transmission Frame */
-#define AT91_EMAC_LCOL         0x5c    /* Late Collision */
-#define AT91_EMAC_ECOL         0x60    /* Excessive Collision */
-#define AT91_EMAC_TUE          0x64    /* Transmit Underrun Error */
-#define AT91_EMAC_CSE          0x68    /* Carrier Sense Error */
-#define AT91_EMAC_DRFC         0x6c    /* Discard RX Frame */
-#define AT91_EMAC_ROV          0x70    /* Receive Overrun */
-#define AT91_EMAC_CDE          0x74    /* Code Error */
-#define AT91_EMAC_ELR          0x78    /* Excessive Length Error */
-#define AT91_EMAC_RJB          0x7c    /* Receive Jabber */
-#define AT91_EMAC_USF          0x80    /* Undersize Frame */
-#define AT91_EMAC_SQEE         0x84    /* SQE Test Error */
-
-/*
- * Address Registers.
- */
-#define AT91_EMAC_HSL          0x90    /* Hash Address Low [31:0] */
-#define AT91_EMAC_HSH          0x94    /* Hash Address High [63:32] */
-#define AT91_EMAC_SA1L         0x98    /* Specific Address 1 Low, bytes 0-3 */
-#define AT91_EMAC_SA1H         0x9c    /* Specific Address 1 High, bytes 4-5 */
-#define AT91_EMAC_SA2L         0xa0    /* Specific Address 2 Low, bytes 0-3 */
-#define AT91_EMAC_SA2H         0xa4    /* Specific Address 2 High, bytes 4-5 */
-#define AT91_EMAC_SA3L         0xa8    /* Specific Address 3 Low, bytes 0-3 */
-#define AT91_EMAC_SA3H         0xac    /* Specific Address 3 High, bytes 4-5 */
-#define AT91_EMAC_SA4L         0xb0    /* Specific Address 4 Low, bytes 0-3 */
-#define AT91_EMAC_SA4H         0xb4    /* Specific Address 4 High, bytes 4-5 */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_mc.h b/include/asm-arm/arch-at91rm9200/at91rm9200_mc.h
deleted file mode 100644 (file)
index 0c0d814..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91rm9200_mc.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Memory Controllers (MC, EBI, SMC, SDRAMC, BFC) - System peripherals registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91RM9200_MC_H
-#define AT91RM9200_MC_H
-
-/* Memory Controller */
-#define AT91_MC_RCR            (AT91_MC + 0x00)        /* MC Remap Control Register */
-#define                AT91_MC_RCB             (1 <<  0)               /* Remap Command Bit */
-
-#define AT91_MC_ASR            (AT91_MC + 0x04)        /* MC Abort Status Register */
-#define                AT91_MC_UNADD           (1 <<  0)               /* Undefined Address Abort Status */
-#define                AT91_MC_MISADD          (1 <<  1)               /* Misaligned Address Abort Status */
-#define                AT91_MC_ABTSZ           (3 <<  8)               /* Abort Size Status */
-#define                        AT91_MC_ABTSZ_BYTE              (0 << 8)
-#define                        AT91_MC_ABTSZ_HALFWORD          (1 << 8)
-#define                        AT91_MC_ABTSZ_WORD              (2 << 8)
-#define                AT91_MC_ABTTYP          (3 << 10)               /* Abort Type Status */
-#define                        AT91_MC_ABTTYP_DATAREAD         (0 << 10)
-#define                        AT91_MC_ABTTYP_DATAWRITE        (1 << 10)
-#define                        AT91_MC_ABTTYP_FETCH            (2 << 10)
-#define                AT91_MC_MST0            (1 << 16)               /* ARM920T Abort Source */
-#define                AT91_MC_MST1            (1 << 17)               /* PDC Abort Source */
-#define                AT91_MC_MST2            (1 << 18)               /* UHP Abort Source */
-#define                AT91_MC_MST3            (1 << 19)               /* EMAC Abort Source */
-#define                AT91_MC_SVMST0          (1 << 24)               /* Saved ARM920T Abort Source */
-#define                AT91_MC_SVMST1          (1 << 25)               /* Saved PDC Abort Source */
-#define                AT91_MC_SVMST2          (1 << 26)               /* Saved UHP Abort Source */
-#define                AT91_MC_SVMST3          (1 << 27)               /* Saved EMAC Abort Source */
-
-#define AT91_MC_AASR           (AT91_MC + 0x08)        /* MC Abort Address Status Register */
-
-#define AT91_MC_MPR            (AT91_MC + 0x0c)        /* MC Master Priority Register */
-#define                AT91_MPR_MSTP0          (7 <<  0)               /* ARM920T Priority */
-#define                AT91_MPR_MSTP1          (7 <<  4)               /* PDC Priority */
-#define                AT91_MPR_MSTP2          (7 <<  8)               /* UHP Priority */
-#define                AT91_MPR_MSTP3          (7 << 12)               /* EMAC Priority */
-
-/* External Bus Interface (EBI) registers */
-#define AT91_EBI_CSA           (AT91_MC + 0x60)        /* Chip Select Assignment Register */
-#define                AT91_EBI_CS0A           (1 << 0)                /* Chip Select 0 Assignment */
-#define                        AT91_EBI_CS0A_SMC               (0 << 0)
-#define                        AT91_EBI_CS0A_BFC               (1 << 0)
-#define                AT91_EBI_CS1A           (1 << 1)                /* Chip Select 1 Assignment */
-#define                        AT91_EBI_CS1A_SMC               (0 << 1)
-#define                        AT91_EBI_CS1A_SDRAMC            (1 << 1)
-#define                AT91_EBI_CS3A           (1 << 3)                /* Chip Select 2 Assignment */
-#define                        AT91_EBI_CS3A_SMC               (0 << 3)
-#define                        AT91_EBI_CS3A_SMC_SMARTMEDIA    (1 << 3)
-#define                AT91_EBI_CS4A           (1 << 4)                /* Chip Select 3 Assignment */
-#define                        AT91_EBI_CS4A_SMC               (0 << 4)
-#define                        AT91_EBI_CS4A_SMC_COMPACTFLASH  (1 << 4)
-#define AT91_EBI_CFGR          (AT91_MC + 0x64)        /* Configuration Register */
-#define                AT91_EBI_DBPUC          (1 << 0)                /* Data Bus Pull-Up Configuration */
-
-/* Static Memory Controller (SMC) registers */
-#define        AT91_SMC_CSR(n)         (AT91_MC + 0x70 + ((n) * 4))/* SMC Chip Select Register */
-#define                AT91_SMC_NWS            (0x7f <<  0)            /* Number of Wait States */
-#define                        AT91_SMC_NWS_(x)        ((x) << 0)
-#define                AT91_SMC_WSEN           (1    <<  7)            /* Wait State Enable */
-#define                AT91_SMC_TDF            (0xf  <<  8)            /* Data Float Time */
-#define                        AT91_SMC_TDF_(x)        ((x) << 8)
-#define                AT91_SMC_BAT            (1    << 12)            /* Byte Access Type */
-#define                AT91_SMC_DBW            (3    << 13)            /* Data Bus Width */
-#define                        AT91_SMC_DBW_16         (1 << 13)
-#define                        AT91_SMC_DBW_8          (2 << 13)
-#define                AT91_SMC_DPR            (1 << 15)               /* Data Read Protocol */
-#define                AT91_SMC_ACSS           (3 << 16)               /* Address to Chip Select Setup */
-#define                        AT91_SMC_ACSS_STD       (0 << 16)
-#define                        AT91_SMC_ACSS_1         (1 << 16)
-#define                        AT91_SMC_ACSS_2         (2 << 16)
-#define                        AT91_SMC_ACSS_3         (3 << 16)
-#define                AT91_SMC_RWSETUP        (7 << 24)               /* Read & Write Signal Time Setup */
-#define                        AT91_SMC_RWSETUP_(x)    ((x) << 24)
-#define                AT91_SMC_RWHOLD         (7 << 28)               /* Read & Write Signal Hold Time */
-#define                        AT91_SMC_RWHOLD_(x)     ((x) << 28)
-
-/* SDRAM Controller registers */
-#define AT91_SDRAMC_MR         (AT91_MC + 0x90)        /* Mode Register */
-#define                AT91_SDRAMC_MODE        (0xf << 0)              /* Command Mode */
-#define                        AT91_SDRAMC_MODE_NORMAL         (0 << 0)
-#define                        AT91_SDRAMC_MODE_NOP            (1 << 0)
-#define                        AT91_SDRAMC_MODE_PRECHARGE      (2 << 0)
-#define                        AT91_SDRAMC_MODE_LMR            (3 << 0)
-#define                        AT91_SDRAMC_MODE_REFRESH        (4 << 0)
-#define                AT91_SDRAMC_DBW         (1   << 4)              /* Data Bus Width */
-#define                        AT91_SDRAMC_DBW_32      (0 << 4)
-#define                        AT91_SDRAMC_DBW_16      (1 << 4)
-
-#define AT91_SDRAMC_TR         (AT91_MC + 0x94)        /* Refresh Timer Register */
-#define                AT91_SDRAMC_COUNT       (0xfff << 0)            /* Refresh Timer Count */
-
-#define AT91_SDRAMC_CR         (AT91_MC + 0x98)        /* Configuration Register */
-#define                AT91_SDRAMC_NC          (3   <<  0)             /* Number of Column Bits */
-#define                        AT91_SDRAMC_NC_8        (0 << 0)
-#define                        AT91_SDRAMC_NC_9        (1 << 0)
-#define                        AT91_SDRAMC_NC_10       (2 << 0)
-#define                        AT91_SDRAMC_NC_11       (3 << 0)
-#define                AT91_SDRAMC_NR          (3   <<  2)             /* Number of Row Bits */
-#define                        AT91_SDRAMC_NR_11       (0 << 2)
-#define                        AT91_SDRAMC_NR_12       (1 << 2)
-#define                        AT91_SDRAMC_NR_13       (2 << 2)
-#define                AT91_SDRAMC_NB          (1   <<  4)             /* Number of Banks */
-#define                        AT91_SDRAMC_NB_2        (0 << 4)
-#define                        AT91_SDRAMC_NB_4        (1 << 4)
-#define                AT91_SDRAMC_CAS         (3   <<  5)             /* CAS Latency */
-#define                        AT91_SDRAMC_CAS_2       (2 << 5)
-#define                AT91_SDRAMC_TWR         (0xf <<  7)             /* Write Recovery Delay */
-#define                AT91_SDRAMC_TRC         (0xf << 11)             /* Row Cycle Delay */
-#define                AT91_SDRAMC_TRP         (0xf << 15)             /* Row Precharge Delay */
-#define                AT91_SDRAMC_TRCD        (0xf << 19)             /* Row to Column Delay */
-#define                AT91_SDRAMC_TRAS        (0xf << 23)             /* Active to Precharge Delay */
-#define                AT91_SDRAMC_TXSR        (0xf << 27)             /* Exit Self Refresh to Active Delay */
-
-#define AT91_SDRAMC_SRR                (AT91_MC + 0x9c)        /* Self Refresh Register */
-#define AT91_SDRAMC_LPR                (AT91_MC + 0xa0)        /* Low Power Register */
-#define AT91_SDRAMC_IER                (AT91_MC + 0xa4)        /* Interrupt Enable Register */
-#define AT91_SDRAMC_IDR                (AT91_MC + 0xa8)        /* Interrupt Disable Register */
-#define AT91_SDRAMC_IMR                (AT91_MC + 0xac)        /* Interrupt Mask Register */
-#define AT91_SDRAMC_ISR                (AT91_MC + 0xb0)        /* Interrupt Status Register */
-
-/* Burst Flash Controller register */
-#define AT91_BFC_MR            (AT91_MC + 0xc0)        /* Mode Register */
-#define                AT91_BFC_BFCOM          (3   <<  0)             /* Burst Flash Controller Operating Mode */
-#define                        AT91_BFC_BFCOM_DISABLED (0 << 0)
-#define                        AT91_BFC_BFCOM_ASYNC    (1 << 0)
-#define                        AT91_BFC_BFCOM_BURST    (2 << 0)
-#define                AT91_BFC_BFCC           (3   <<  2)             /* Burst Flash Controller Clock */
-#define                        AT91_BFC_BFCC_MCK       (1 << 2)
-#define                        AT91_BFC_BFCC_DIV2      (2 << 2)
-#define                        AT91_BFC_BFCC_DIV4      (3 << 2)
-#define                AT91_BFC_AVL            (0xf <<  4)             /* Address Valid Latency */
-#define                AT91_BFC_PAGES          (7   <<  8)             /* Page Size */
-#define                        AT91_BFC_PAGES_NO_PAGE  (0 << 8)
-#define                        AT91_BFC_PAGES_16       (1 << 8)
-#define                        AT91_BFC_PAGES_32       (2 << 8)
-#define                        AT91_BFC_PAGES_64       (3 << 8)
-#define                        AT91_BFC_PAGES_128      (4 << 8)
-#define                        AT91_BFC_PAGES_256      (5 << 8)
-#define                        AT91_BFC_PAGES_512      (6 << 8)
-#define                        AT91_BFC_PAGES_1024     (7 << 8)
-#define                AT91_BFC_OEL            (3   << 12)             /* Output Enable Latency */
-#define                AT91_BFC_BAAEN          (1   << 16)             /* Burst Address Advance Enable */
-#define                AT91_BFC_BFOEH          (1   << 17)             /* Burst Flash Output Enable Handling */
-#define                AT91_BFC_MUXEN          (1   << 18)             /* Multiplexed Bus Enable */
-#define                AT91_BFC_RDYEN          (1   << 19)             /* Ready Enable Mode */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91sam9260.h b/include/asm-arm/arch-at91rm9200/at91sam9260.h
deleted file mode 100644 (file)
index 46f4dd6..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91sam9260.h
- *
- * (C) 2006 Andrew Victor
- *
- * Common definitions.
- * Based on AT91SAM9260 datasheet revision A (Preliminary).
- *
- * 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 AT91SAM9260_H
-#define AT91SAM9260_H
-
-/*
- * Peripheral identifiers/interrupts.
- */
-#define AT91_ID_FIQ            0       /* Advanced Interrupt Controller (FIQ) */
-#define AT91_ID_SYS            1       /* System Peripherals */
-#define AT91SAM9260_ID_PIOA    2       /* Parallel IO Controller A */
-#define AT91SAM9260_ID_PIOB    3       /* Parallel IO Controller B */
-#define AT91SAM9260_ID_PIOC    4       /* Parallel IO Controller C */
-#define AT91SAM9260_ID_ADC     5       /* Analog-to-Digital Converter */
-#define AT91SAM9260_ID_US0     6       /* USART 0 */
-#define AT91SAM9260_ID_US1     7       /* USART 1 */
-#define AT91SAM9260_ID_US2     8       /* USART 2 */
-#define AT91SAM9260_ID_MCI     9       /* Multimedia Card Interface */
-#define AT91SAM9260_ID_UDP     10      /* USB Device Port */
-#define AT91SAM9260_ID_TWI     11      /* Two-Wire Interface */
-#define AT91SAM9260_ID_SPI0    12      /* Serial Peripheral Interface 0 */
-#define AT91SAM9260_ID_SPI1    13      /* Serial Peripheral Interface 1 */
-#define AT91SAM9260_ID_SSC     14      /* Serial Synchronous Controller */
-#define AT91SAM9260_ID_TC0     17      /* Timer Counter 0 */
-#define AT91SAM9260_ID_TC1     18      /* Timer Counter 1 */
-#define AT91SAM9260_ID_TC2     19      /* Timer Counter 2 */
-#define AT91SAM9260_ID_UHP     20      /* USB Host port */
-#define AT91SAM9260_ID_EMAC    21      /* Ethernet */
-#define AT91SAM9260_ID_ISI     22      /* Image Sensor Interface */
-#define AT91SAM9260_ID_US3     23      /* USART 3 */
-#define AT91SAM9260_ID_US4     24      /* USART 4 */
-#define AT91SAM9260_ID_US5     25      /* USART 5 */
-#define AT91SAM9260_ID_TC3     26      /* Timer Counter 3 */
-#define AT91SAM9260_ID_TC4     27      /* Timer Counter 4 */
-#define AT91SAM9260_ID_TC5     28      /* Timer Counter 5 */
-#define AT91SAM9260_ID_IRQ0    29      /* Advanced Interrupt Controller (IRQ0) */
-#define AT91SAM9260_ID_IRQ1    30      /* Advanced Interrupt Controller (IRQ1) */
-#define AT91SAM9260_ID_IRQ2    31      /* Advanced Interrupt Controller (IRQ2) */
-
-
-/*
- * User Peripheral physical base addresses.
- */
-#define AT91SAM9260_BASE_TCB0          0xfffa0000
-#define AT91SAM9260_BASE_TC0           0xfffa0000
-#define AT91SAM9260_BASE_TC1           0xfffa0040
-#define AT91SAM9260_BASE_TC2           0xfffa0080
-#define AT91SAM9260_BASE_UDP           0xfffa4000
-#define AT91SAM9260_BASE_MCI           0xfffa8000
-#define AT91SAM9260_BASE_TWI           0xfffac000
-#define AT91SAM9260_BASE_US0           0xfffb0000
-#define AT91SAM9260_BASE_US1           0xfffb4000
-#define AT91SAM9260_BASE_US2           0xfffb8000
-#define AT91SAM9260_BASE_SSC           0xfffbc000
-#define AT91SAM9260_BASE_ISI           0xfffc0000
-#define AT91SAM9260_BASE_EMAC          0xfffc4000
-#define AT91SAM9260_BASE_SPI0          0xfffc8000
-#define AT91SAM9260_BASE_SPI1          0xfffcc000
-#define AT91SAM9260_BASE_US3           0xfffd0000
-#define AT91SAM9260_BASE_US4           0xfffd4000
-#define AT91SAM9260_BASE_US5           0xfffd8000
-#define AT91SAM9260_BASE_TCB1          0xfffdc000
-#define AT91SAM9260_BASE_TC3           0xfffdc000
-#define AT91SAM9260_BASE_TC4           0xfffdc040
-#define AT91SAM9260_BASE_TC5           0xfffdc080
-#define AT91SAM9260_BASE_ADC           0xfffe0000
-#define AT91_BASE_SYS                  0xffffe800
-
-/*
- * System Peripherals (offset from AT91_BASE_SYS)
- */
-#define AT91_ECC       (0xffffe800 - AT91_BASE_SYS)
-#define AT91_SDRAMC    (0xffffea00 - AT91_BASE_SYS)
-#define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
-#define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
-#define AT91_CCFG      (0xffffef10 - AT91_BASE_SYS)
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
-#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)
-#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)
-#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)
-#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)
-#define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
-#define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
-#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
-#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
-#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
-#define AT91_GPBR      (0xfffffd50 - AT91_BASE_SYS)
-
-
-/*
- * Internal Memory.
- */
-#define AT91SAM9260_ROM_BASE   0x00100000      /* Internal ROM base address */
-#define AT91SAM9260_ROM_SIZE   SZ_32K          /* Internal ROM size (32Kb) */
-
-#define AT91SAM9260_SRAM0_BASE 0x00200000      /* Internal SRAM 0 base address */
-#define AT91SAM9260_SRAM0_SIZE SZ_4K           /* Internal SRAM 0 size (4Kb) */
-#define AT91SAM9260_SRAM1_BASE 0x00300000      /* Internal SRAM 1 base address */
-#define AT91SAM9260_SRAM1_SIZE SZ_4K           /* Internal SRAM 1 size (4Kb) */
-
-#define AT91SAM9260_UHP_BASE   0x00500000      /* USB Host controller */
-
-#if 0
-/*
- * PIO pin definitions (peripheral A/B multiplexing).
- */
-
-// TODO: Add
-
-#endif
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h b/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h
deleted file mode 100644 (file)
index 78f6b49..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9260 datasheet revision B.
- *
- * 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 AT91SAM9260_MATRIX_H
-#define AT91SAM9260_MATRIX_H
-
-#define AT91_MATRIX_MCFG0      (AT91_MATRIX + 0x00)    /* Master Configuration Register 0 */
-#define AT91_MATRIX_MCFG1      (AT91_MATRIX + 0x04)    /* Master Configuration Register 1 */
-#define AT91_MATRIX_MCFG2      (AT91_MATRIX + 0x08)    /* Master Configuration Register 2 */
-#define AT91_MATRIX_MCFG3      (AT91_MATRIX + 0x0C)    /* Master Configuration Register 3 */
-#define AT91_MATRIX_MCFG4      (AT91_MATRIX + 0x10)    /* Master Configuration Register 4 */
-#define AT91_MATRIX_MCFG5      (AT91_MATRIX + 0x04)    /* Master Configuration Register 5 */
-#define                AT91_MATRIX_ULBT                (7 << 0)        /* Undefined Length Burst Type */
-#define                        AT91_MATRIX_ULBT_INFINITE       (0 << 0)
-#define                        AT91_MATRIX_ULBT_SINGLE         (1 << 0)
-#define                        AT91_MATRIX_ULBT_FOUR           (2 << 0)
-#define                        AT91_MATRIX_ULBT_EIGHT          (3 << 0)
-#define                        AT91_MATRIX_ULBT_SIXTEEN        (4 << 0)
-
-#define AT91_MATRIX_SCFG0      (AT91_MATRIX + 0x40)    /* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1      (AT91_MATRIX + 0x44)    /* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2      (AT91_MATRIX + 0x48)    /* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3      (AT91_MATRIX + 0x4C)    /* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4      (AT91_MATRIX + 0x50)    /* Slave Configuration Register 4 */
-#define                AT91_MATRIX_SLOT_CYCLE          (0xff <<  0)    /* Maximum Number of Allowed Cycles for a Burst */
-#define                AT91_MATRIX_DEFMSTR_TYPE        (3    << 16)    /* Default Master Type */
-#define                        AT91_MATRIX_DEFMSTR_TYPE_NONE   (0 << 16)
-#define                        AT91_MATRIX_DEFMSTR_TYPE_LAST   (1 << 16)
-#define                        AT91_MATRIX_DEFMSTR_TYPE_FIXED  (2 << 16)
-#define                AT91_MATRIX_FIXED_DEFMSTR       (7    << 18)    /* Fixed Index of Default Master */
-#define                AT91_MATRIX_ARBT                (3    << 24)    /* Arbitration Type */
-#define                        AT91_MATRIX_ARBT_ROUND_ROBIN    (0 << 24)
-#define                        AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24)
-
-#define AT91_MATRIX_PRAS0      (AT91_MATRIX + 0x80)    /* Priority Register A for Slave 0 */
-#define AT91_MATRIX_PRAS1      (AT91_MATRIX + 0x88)    /* Priority Register A for Slave 1 */
-#define AT91_MATRIX_PRAS2      (AT91_MATRIX + 0x90)    /* Priority Register A for Slave 2 */
-#define AT91_MATRIX_PRAS3      (AT91_MATRIX + 0x98)    /* Priority Register A for Slave 3 */
-#define AT91_MATRIX_PRAS4      (AT91_MATRIX + 0xA0)    /* Priority Register A for Slave 4 */
-#define                AT91_MATRIX_M0PR                (3 << 0)        /* Master 0 Priority */
-#define                AT91_MATRIX_M1PR                (3 << 4)        /* Master 1 Priority */
-#define                AT91_MATRIX_M2PR                (3 << 8)        /* Master 2 Priority */
-#define                AT91_MATRIX_M3PR                (3 << 12)       /* Master 3 Priority */
-#define                AT91_MATRIX_M4PR                (3 << 16)       /* Master 4 Priority */
-#define                AT91_MATRIX_M5PR                (3 << 20)       /* Master 5 Priority */
-
-#define AT91_MATRIX_MRCR       (AT91_MATRIX + 0x100)   /* Master Remap Control Register */
-#define                AT91_MATRIX_RCB0                (1 << 0)        /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define                AT91_MATRIX_RCB1                (1 << 1)        /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-
-#define AT91_MATRIX_EBICSA     (AT91_MATRIX + 0x11C)   /* EBI Chip Select Assignment Register */
-#define                AT91_MATRIX_CS1A                (1 << 1)        /* Chip Select 1 Assignment */
-#define                        AT91_MATRIX_CS1A_SMC            (0 << 1)
-#define                        AT91_MATRIX_CS1A_SDRAMC         (1 << 1)
-#define                AT91_MATRIX_CS3A                (1 << 3)        /* Chip Select 3 Assignment */
-#define                        AT91_MATRIX_CS3A_SMC            (0 << 3)
-#define                        AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3)
-#define                AT91_MATRIX_CS4A                (1 << 4)        /* Chip Select 4 Assignment */
-#define                        AT91_MATRIX_CS4A_SMC            (0 << 4)
-#define                        AT91_MATRIX_CS4A_SMC_CF1        (1 << 4)
-#define                AT91_MATRIX_CS5A                (1 << 5 )       /* Chip Select 5 Assignment */
-#define                        AT91_MATRIX_CS5A_SMC            (0 << 5)
-#define                        AT91_MATRIX_CS5A_SMC_CF2        (1 << 5)
-#define                AT91_MATRIX_DBPUC               (1 << 8)        /* Data Bus Pull-up Configuration */
-#define                AT91_MATRIX_VDDIOMSEL           (1 << 16)       /* Memory voltage selection */
-#define                        AT91_MATRIX_VDDIOMSEL_1_8V      (0 << 16)
-#define                        AT91_MATRIX_VDDIOMSEL_3_3V      (1 << 16)
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91sam9261.h b/include/asm-arm/arch-at91rm9200/at91sam9261.h
deleted file mode 100644 (file)
index 8d39672..0000000
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91sam9261.h
- *
- * Copyright (C) SAN People
- *
- * Common definitions.
- * Based on AT91SAM9261 datasheet revision E. (Preliminary)
- *
- * 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 AT91SAM9261_H
-#define AT91SAM9261_H
-
-/*
- * Peripheral identifiers/interrupts.
- */
-#define AT91_ID_FIQ            0       /* Advanced Interrupt Controller (FIQ) */
-#define AT91_ID_SYS            1       /* System Peripherals */
-#define AT91SAM9261_ID_PIOA    2       /* Parallel IO Controller A */
-#define AT91SAM9261_ID_PIOB    3       /* Parallel IO Controller B */
-#define AT91SAM9261_ID_PIOC    4       /* Parallel IO Controller C */
-#define AT91SAM9261_ID_US0     6       /* USART 0 */
-#define AT91SAM9261_ID_US1     7       /* USART 1 */
-#define AT91SAM9261_ID_US2     8       /* USART 2 */
-#define AT91SAM9261_ID_MCI     9       /* Multimedia Card Interface */
-#define AT91SAM9261_ID_UDP     10      /* USB Device Port */
-#define AT91SAM9261_ID_TWI     11      /* Two-Wire Interface */
-#define AT91SAM9261_ID_SPI0    12      /* Serial Peripheral Interface 0 */
-#define AT91SAM9261_ID_SPI1    13      /* Serial Peripheral Interface 1 */
-#define AT91SAM9261_ID_SSC0    14      /* Serial Synchronous Controller 0 */
-#define AT91SAM9261_ID_SSC1    15      /* Serial Synchronous Controller 1 */
-#define AT91SAM9261_ID_SSC2    16      /* Serial Synchronous Controller 2 */
-#define AT91SAM9261_ID_TC0     17      /* Timer Counter 0 */
-#define AT91SAM9261_ID_TC1     18      /* Timer Counter 1 */
-#define AT91SAM9261_ID_TC2     19      /* Timer Counter 2 */
-#define AT91SAM9261_ID_UHP     20      /* USB Host port */
-#define AT91SAM9261_ID_LCDC    21      /* LDC Controller */
-#define AT91SAM9261_ID_IRQ0    29      /* Advanced Interrupt Controller (IRQ0) */
-#define AT91SAM9261_ID_IRQ1    30      /* Advanced Interrupt Controller (IRQ1) */
-#define AT91SAM9261_ID_IRQ2    31      /* Advanced Interrupt Controller (IRQ2) */
-
-
-/*
- * User Peripheral physical base addresses.
- */
-#define AT91SAM9261_BASE_TCB0          0xfffa0000
-#define AT91SAM9261_BASE_TC0           0xfffa0000
-#define AT91SAM9261_BASE_TC1           0xfffa0040
-#define AT91SAM9261_BASE_TC2           0xfffa0080
-#define AT91SAM9261_BASE_UDP           0xfffa4000
-#define AT91SAM9261_BASE_MCI           0xfffa8000
-#define AT91SAM9261_BASE_TWI           0xfffac000
-#define AT91SAM9261_BASE_US0           0xfffb0000
-#define AT91SAM9261_BASE_US1           0xfffb4000
-#define AT91SAM9261_BASE_US2           0xfffb8000
-#define AT91SAM9261_BASE_SSC0          0xfffbc000
-#define AT91SAM9261_BASE_SSC1          0xfffc0000
-#define AT91SAM9261_BASE_SSC2          0xfffc4000
-#define AT91SAM9261_BASE_SPI0          0xfffc8000
-#define AT91SAM9261_BASE_SPI1          0xfffcc000
-#define AT91_BASE_SYS                  0xffffea00
-
-
-/*
- * System Peripherals (offset from AT91_BASE_SYS)
- */
-#define AT91_SDRAMC    (0xffffea00 - AT91_BASE_SYS)
-#define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
-#define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
-#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)
-#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)
-#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)
-#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)
-#define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
-#define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
-#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
-#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
-#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
-#define AT91_GPBR      (0xfffffd50 - AT91_BASE_SYS)
-
-
-/*
- * Internal Memory.
- */
-#define AT91SAM9261_SRAM_BASE  0x00300000      /* Internal SRAM base address */
-#define AT91SAM9261_SRAM_SIZE  0x00028000      /* Internal SRAM size (160Kb) */
-
-#define AT91SAM9261_ROM_BASE   0x00400000      /* Internal ROM base address */
-#define AT91SAM9261_ROM_SIZE   SZ_32K          /* Internal ROM size (32Kb) */
-
-#define AT91SAM9261_UHP_BASE   0x00500000      /* USB Host controller */
-#define AT91SAM9261_LCDC_BASE  0x00600000      /* LDC controller */
-
-
-#if 0
-/*
- * PIO pin definitions (peripheral A/B multiplexing).
- */
-#define AT91_PA0_SPI0_MISO     (1 <<  0)       /* A: SPI0 Master In Slave */
-#define AT91_PA0_MCDA0         (1 <<  0)       /* B: Multimedia Card A Data 0 */
-#define AT91_PA1_SPI0_MOSI     (1 <<  1)       /* A: SPI0 Master Out Slave */
-#define AT91_PA1_MCCDA         (1 <<  1)       /* B: Multimedia Card A Command */
-#define AT91_PA2_SPI0_SPCK     (1 <<  2)       /* A: SPI0 Serial Clock */
-#define AT91_PA2_MCCK          (1 <<  2)       /* B: Multimedia Card Clock */
-#define AT91_PA3_SPI0_NPCS0    (1 <<  3)       /* A: SPI0 Peripheral Chip Select 0 */
-#define AT91_PA4_SPI0_NPCS1    (1 <<  4)       /* A: SPI0 Peripheral Chip Select 1 */
-#define AT91_PA4_MCDA1         (1 <<  4)       /* B: Multimedia Card A Data 1 */
-#define AT91_PA5_SPI0_NPCS2    (1 <<  5)       /* A: SPI0 Peripheral Chip Select 2 */
-#define AT91_PA5_MCDA2         (1 <<  5)       /* B: Multimedia Card A Data 2 */
-#define AT91_PA6_SPI0_NPCS3    (1 <<  6)       /* A: SPI0 Peripheral Chip Select 3 */
-#define AT91_PA6_MCDA3         (1 <<  6)       /* B: Multimedia Card A Data 3 */
-#define AT91_PA7_TWD           (1 <<  7)       /* A: TWI Two-wire Serial Data */
-#define AT91_PA7_PCK0          (1 <<  7)       /* B: PMC Programmable clock Output 0 */
-#define AT91_PA8_TWCK          (1 <<  8)       /* A: TWI Two-wire Serial Clock */
-#define AT91_PA8_PCK1          (1 <<  8)       /* B: PMC Programmable clock Output 1 */
-#define AT91_PA9_DRXD          (1 <<  9)       /* A: DBGU Debug Receive Data */
-#define AT91_PA9_PCK2          (1 <<  9)       /* B: PMC Programmable clock Output 2 */
-#define AT91_PA10_DTXD         (1 << 10)       /* A: DBGU Debug Transmit Data */
-#define AT91_PA10_PCK3         (1 << 10)       /* B: PMC Programmable clock Output 3 */
-#define AT91_PA11_TSYNC                (1 << 11)       /* A: Trace Synchronization Signal */
-#define AT91_PA11_SCK1         (1 << 11)       /* B: USART1 Serial Clock */
-#define AT91_PA12_TCLK         (1 << 12)       /* A: Trace Clock */
-#define AT91_PA12_RTS1         (1 << 12)       /* B: USART1 Ready To Send */
-#define AT91_PA13_TPS0         (1 << 13)       /* A: Trace ARM Pipeline Status 0 */
-#define AT91_PA13_CTS1         (1 << 13)       /* B: USART1 Clear To Send */
-#define AT91_PA14_TPS1         (1 << 14)       /* A: Trace ARM Pipeline Status 1 */
-#define AT91_PA14_SCK2         (1 << 14)       /* B: USART2 Serial Clock */
-#define AT91_PA15_TPS2         (1 << 15)       /* A: Trace ARM Pipeline Status 2 */
-#define AT91_PA15_RTS2         (1 << 15)       /* B: USART2 Ready To Send */
-#define AT91_PA16_TPK0         (1 << 16)       /* A: Trace Packet Port 0 */
-#define AT91_PA16_CTS2         (1 << 16)       /* B: USART2 Clear To Send */
-#define AT91_PA17_TPK1         (1 << 17)       /* A: Trace Packet Port 1 */
-#define AT91_PA17_TF1          (1 << 17)       /* B: SSC1 Transmit Frame Sync */
-#define AT91_PA18_TPK2         (1 << 18)       /* A: Trace Packet Port 2 */
-#define AT91_PA18_TK1          (1 << 18)       /* B: SSC1 Transmit Clock */
-#define AT91_PA19_TPK3         (1 << 19)       /* A: Trace Packet Port 3 */
-#define AT91_PA19_TD1          (1 << 19)       /* B: SSC1 Transmit Data */
-#define AT91_PA20_TPK4         (1 << 20)       /* A: Trace Packet Port 4 */
-#define AT91_PA20_RD1          (1 << 20)       /* B: SSC1 Receive Data */
-#define AT91_PA21_TPK5         (1 << 21)       /* A: Trace Packet Port 5 */
-#define AT91_PA21_RK1          (1 << 21)       /* B: SSC1 Receive Clock */
-#define AT91_PA22_TPK6         (1 << 22)       /* A: Trace Packet Port 6 */
-#define AT91_PA22_RF1          (1 << 22)       /* B: SSC1 Receive Frame Sync */
-#define AT91_PA23_TPK7         (1 << 23)       /* A: Trace Packet Port 7 */
-#define AT91_PA23_RTS0         (1 << 23)       /* B: USART0 Ready To Send */
-#define AT91_PA24_TPK8         (1 << 24)       /* A: Trace Packet Port 8 */
-#define AT91_PA24_SPI1_NPCS1   (1 << 24)       /* B: SPI1 Peripheral Chip Select 1 */
-#define AT91_PA25_TPK9         (1 << 25)       /* A: Trace Packet Port 9 */
-#define AT91_PA25_SPI1_NPCS2   (1 << 25)       /* B: SPI1 Peripheral Chip Select 2 */
-#define AT91_PA26_TPK10                (1 << 26)       /* A: Trace Packet Port 10 */
-#define AT91_PA26_SPI1_NPCS3   (1 << 26)       /* B: SPI1 Peripheral Chip Select 3 */
-#define AT91_PA27_TPK11                (1 << 27)       /* A: Trace Packet Port 11 */
-#define AT91_PA27_SPI0_NPCS1   (1 << 27)       /* B: SPI0 Peripheral Chip Select 1 */
-#define AT91_PA28_TPK12                (1 << 28)       /* A: Trace Packet Port 12 */
-#define AT91_PA28_SPI0_NPCS2   (1 << 28)       /* B: SPI0 Peripheral Chip Select 2 */
-#define AT91_PA29_TPK13                (1 << 29)       /* A: Trace Packet Port 13 */
-#define AT91_PA29_SPI0_NPCS3   (1 << 29)       /* B: SPI0 Peripheral Chip Select 3 */
-#define AT91_PA30_TPK14                (1 << 30)       /* A: Trace Packet Port 14 */
-#define AT91_PA30_A23          (1 << 30)       /* B: Address Bus bit 23 */
-#define AT91_PA31_TPK15                (1 << 31)       /* A: Trace Packet Port 15 */
-#define AT91_PA31_A24          (1 << 31)       /* B: Address Bus bit 24 */
-
-#define AT91_PB0_LCDVSYNC      (1 <<  0)       /* A: LCD Vertical Synchronization */
-#define AT91_PB1_LCDHSYNC      (1 <<  1)       /* A: LCD Horizontal Synchronization */
-#define AT91_PB2_LCDDOTCK      (1 <<  2)       /* A: LCD Dot Clock */
-#define AT91_PB2_PCK0          (1 <<  2)       /* B: PMC Programmable clock Output 0 */
-#define AT91_PB3_LCDDEN                (1 <<  3)       /* A: LCD Data Enable */
-#define AT91_PB4_LCDCC         (1 <<  4)       /* A: LCD Contrast Control */
-#define AT91_PB4_LCDD2         (1 <<  4)       /* B: LCD Data Bus Bit 2 */
-#define AT91_PB5_LCDD0         (1 <<  5)       /* A: LCD Data Bus Bit 0 */
-#define AT91_PB5_LCDD3         (1 <<  5)       /* B: LCD Data Bus Bit 3 */
-#define AT91_PB6_LCDD1         (1 <<  6)       /* A: LCD Data Bus Bit 1 */
-#define AT91_PB6_LCDD4         (1 <<  6)       /* B: LCD Data Bus Bit 4 */
-#define AT91_PB7_LCDD2         (1 <<  7)       /* A: LCD Data Bus Bit 2 */
-#define AT91_PB7_LCDD5         (1 <<  7)       /* B: LCD Data Bus Bit 5 */
-#define AT91_PB8_LCDD3         (1 <<  8)       /* A: LCD Data Bus Bit 3 */
-#define AT91_PB8_LCDD6         (1 <<  8)       /* B: LCD Data Bus Bit 6 */
-#define AT91_PB9_LCDD4         (1 <<  9)       /* A: LCD Data Bus Bit 4 */
-#define AT91_PB9_LCDD7         (1 <<  9)       /* B: LCD Data Bus Bit 7 */
-#define AT91_PB10_LCDD5                (1 << 10)       /* A: LCD Data Bus Bit 5 */
-#define AT91_PB10_LCDD10       (1 << 10)       /* B: LCD Data Bus Bit 10 */
-#define AT91_PB11_LCDD6                (1 << 11)       /* A: LCD Data Bus Bit 6 */
-#define AT91_PB11_LCDD11       (1 << 11)       /* B: LCD Data Bus Bit 11 */
-#define AT91_PB12_LCDD7                (1 << 12)       /* A: LCD Data Bus Bit 7 */
-#define AT91_PB12_LCDD12       (1 << 12)       /* B: LCD Data Bus Bit 12 */
-#define AT91_PB13_LCDD8                (1 << 13)       /* A: LCD Data Bus Bit 8 */
-#define AT91_PB13_LCDD13       (1 << 13)       /* B: LCD Data Bus Bit 13 */
-#define AT91_PB14_LCDD9                (1 << 14)       /* A: LCD Data Bus Bit 9 */
-#define AT91_PB14_LCDD14       (1 << 14)       /* B: LCD Data Bus Bit 14 */
-#define AT91_PB15_LCDD10       (1 << 15)       /* A: LCD Data Bus Bit 10 */
-#define AT91_PB15_LCDD15       (1 << 15)       /* B: LCD Data Bus Bit 15 */
-#define AT91_PB16_LCDD11       (1 << 16)       /* A: LCD Data Bus Bit 11 */
-#define AT91_PB16_LCDD19       (1 << 16)       /* B: LCD Data Bus Bit 19 */
-#define AT91_PB17_LCDD12       (1 << 17)       /* A: LCD Data Bus Bit 12 */
-#define AT91_PB17_LCDD20       (1 << 17)       /* B: LCD Data Bus Bit 20 */
-#define AT91_PB18_LCDD13       (1 << 18)       /* A: LCD Data Bus Bit 13 */
-#define AT91_PB18_LCDD21       (1 << 18)       /* B: LCD Data Bus Bit 21 */
-#define AT91_PB19_LCDD14       (1 << 19)       /* A: LCD Data Bus Bit 14 */
-#define AT91_PB19_LCDD22       (1 << 19)       /* B: LCD Data Bus Bit 22 */
-#define AT91_PB20_LCDD15       (1 << 20)       /* A: LCD Data Bus Bit 15 */
-#define AT91_PB20_LCDD23       (1 << 20)       /* B: LCD Data Bus Bit 23 */
-#define AT91_PB21_TF0          (1 << 21)       /* A: SSC0 Transmit Frame Sync */
-#define AT91_PB21_LCDD16       (1 << 21)       /* B: LCD Data Bus Bit 16 */
-#define AT91_PB22_TK0          (1 << 22)       /* A: SSC0 Transmit Clock */
-#define AT91_PB22_LCDD17       (1 << 22)       /* B: LCD Data Bus Bit 17 */
-#define AT91_PB23_TD0          (1 << 23)       /* A: SSC0 Transmit Data */
-#define AT91_PB23_LCDD18       (1 << 23)       /* B: LCD Data Bus Bit 18 */
-#define AT91_PB24_RD0          (1 << 24)       /* A: SSC0 Receive Data */
-#define AT91_PB24_LCDD19       (1 << 24)       /* B: LCD Data Bus Bit 19 */
-#define AT91_PB25_RK0          (1 << 25)       /* A: SSC0 Receive Clock */
-#define AT91_PB25_LCDD20       (1 << 25)       /* B: LCD Data Bus Bit 20 */
-#define AT91_PB26_RF0          (1 << 26)       /* A: SSC0 Receive Frame Sync */
-#define AT91_PB26_LCDD21       (1 << 26)       /* B: LCD Data Bus Bit 21 */
-#define AT91_PB27_SPI1_NPCS1   (1 << 27)       /* A: SPI1 Peripheral Chip Select 1 */
-#define AT91_PB27_LCDD22       (1 << 27)       /* B: LCD Data Bus Bit 22 */
-#define AT91_PB28_SPI1_NPCS0   (1 << 28)       /* A: SPI1 Peripheral Chip Select 0 */
-#define AT91_PB28_LCDD23       (1 << 28)       /* B: LCD Data Bus Bit 23 */
-#define AT91_PB29_SPI1_SPCK    (1 << 29)       /* A: SPI1 Serial Clock */
-#define AT91_PB29_IRQ2         (1 << 29)       /* B: Interrupt input 2 */
-#define AT91_PB30_SPI1_MISO    (1 << 30)       /* A: SPI1 Master In Slave */
-#define AT91_PB30_IRQ1         (1 << 30)       /* B: Interrupt input 1 */
-#define AT91_PB31_SPI1_MOSI    (1 << 31)       /* A: SPI1 Master Out Slave */
-#define AT91_PB31_PCK2         (1 << 31)       /* B: PMC Programmable clock Output 2 */
-
-#define AT91_PC0_SMOE          (1 << 0)        /* A: SmartMedia Output Enable */
-#define AT91_PC0_NCS6          (1 << 0)        /* B: Chip Select 6 */
-#define AT91_PC1_SMWE          (1 << 1)        /* A: SmartMedia Write Enable */
-#define AT91_PC1_NCS7          (1 << 1)        /* B: Chip Select 7 */
-#define AT91_PC2_NWAIT         (1 << 2)        /* A: NWAIT */
-#define AT91_PC2_IRQ0          (1 << 2)        /* B: Interrupt input 0 */
-#define AT91_PC3_A25_CFRNW     (1 << 3)        /* A: Address Bus[25] / Compact Flash Read Not Write */
-#define AT91_PC4_NCS4_CFCS0    (1 << 4)        /* A: Chip Select 4 / CompactFlash Chip Select 0 */
-#define AT91_PC5_NCS5_CFCS1    (1 << 5)        /* A: Chip Select 5 / CompactFlash Chip Select 1 */
-#define AT91_PC6_CFCE1         (1 << 6)        /* A: CompactFlash Chip Enable 1 */
-#define AT91_PC7_CFCE2         (1 << 7)        /* A: CompactFlash Chip Enable 2 */
-#define AT91_PC8_TXD0          (1 << 8)        /* A: USART0 Transmit Data */
-#define AT91_PC8_PCK2          (1 << 8)        /* B: PMC Programmable clock Output 2 */
-#define AT91_PC9_RXD0          (1 << 9)        /* A: USART0 Receive Data */
-#define AT91_PC9_PCK3          (1 << 9)        /* B: PMC Programmable clock Output 3 */
-#define AT91_PC10_RTS0         (1 << 10)       /* A: USART0 Ready To Send */
-#define AT91_PC10_SCK0         (1 << 10)       /* B: USART0 Serial Clock */
-#define AT91_PC11_CTS0         (1 << 11)       /* A: USART0 Clear To Send */
-#define AT91_PC11_FIQ          (1 << 11)       /* B: AIC Fast Interrupt Input */
-#define AT91_PC12_TXD1         (1 << 12)       /* A: USART1 Transmit Data */
-#define AT91_PC12_NCS6         (1 << 12)       /* B: Chip Select 6 */
-#define AT91_PC13_RXD1         (1 << 13)       /* A: USART1 Receive Data */
-#define AT91_PC13_NCS7         (1 << 13)       /* B: Chip Select 7 */
-#define AT91_PC14_TXD2         (1 << 14)       /* A: USART2 Transmit Data */
-#define AT91_PC14_SPI1_NPCS2   (1 << 14)       /* B: SPI1 Peripheral Chip Select 2 */
-#define AT91_PC15_RXD2         (1 << 15)       /* A: USART2 Receive Data */
-#define AT91_PC15_SPI1_NPCS3   (1 << 15)       /* B: SPI1 Peripheral Chip Select 3 */
-#define AT91_PC16_D16          (1 << 16)       /* A: Data Bus [16] */
-#define AT91_PC16_TCLK0                (1 << 16)       /* B: Timer Counter 0 external clock input */
-#define AT91_PC17_D17          (1 << 17)       /* A: Data Bus [17] */
-#define AT91_PC17_TCLK1                (1 << 17)       /* B: Timer Counter 1 external clock input */
-#define AT91_PC18_D18          (1 << 18)       /* A: Data Bus [18] */
-#define AT91_PC18_TCLK2                (1 << 18)       /* B: Timer Counter 2 external clock input */
-#define AT91_PC19_D19          (1 << 19)       /* A: Data Bus [19] */
-#define AT91_PC19_TIOA0                (1 << 19)       /* B: Timer Counter 0 Multipurpose Timer I/O Pin A */
-#define AT91_PC20_D20          (1 << 20)       /* A: Data Bus [20] */
-#define AT91_PC20_TIOB0                (1 << 20)       /* B: Timer Counter 0 Multipurpose Timer I/O Pin B */
-#define AT91_PC21_D21          (1 << 21)       /* A: Data Bus [21] */
-#define AT91_PC21_TIOA1                (1 << 21)       /* B: Timer Counter 1 Multipurpose Timer I/O Pin A */
-#define AT91_PC22_D22          (1 << 22)       /* A: Data Bus [22] */
-#define AT91_PC22_TIOB1                (1 << 22)       /* B: Timer Counter 1 Multipurpose Timer I/O Pin B */
-#define AT91_PC23_D23          (1 << 23)       /* A: Data Bus [23] */
-#define AT91_PC23_TIOA2                (1 << 23)       /* B: Timer Counter 2 Multipurpose Timer I/O Pin A */
-#define AT91_PC24_D24          (1 << 24)       /* A: Data Bus [24] */
-#define AT91_PC24_TIOB2                (1 << 24)       /* B: Timer Counter 2 Multipurpose Timer I/O Pin B */
-#define AT91_PC25_D25          (1 << 25)       /* A: Data Bus [25] */
-#define AT91_PC25_TF2          (1 << 25)       /* B: SSC2 Transmit Frame Sync */
-#define AT91_PC26_D26          (1 << 26)       /* A: Data Bus [26] */
-#define AT91_PC26_TK2          (1 << 26)       /* B: SSC2 Transmit Clock */
-#define AT91_PC27_D27          (1 << 27)       /* A: Data Bus [27] */
-#define AT91_PC27_TD2          (1 << 27)       /* B: SSC2 Transmit Data */
-#define AT91_PC28_D28          (1 << 28)       /* A: Data Bus [28] */
-#define AT91_PC28_RD2          (1 << 28)       /* B: SSC2 Receive Data */
-#define AT91_PC29_D29          (1 << 29)       /* A: Data Bus [29] */
-#define AT91_PC29_RK2          (1 << 29)       /* B: SSC2 Receive Clock */
-#define AT91_PC30_D30          (1 << 30)       /* A: Data Bus [30] */
-#define AT91_PC30_RF2          (1 << 30)       /* B: SSC2 Receive Frame Sync */
-#define AT91_PC31_D31          (1 << 31)       /* A: Data Bus [31] */
-#define AT91_PC31_PCK1         (1 << 31)       /* B: PMC Programmable clock Output 1 */
-#endif
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h b/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h
deleted file mode 100644 (file)
index ec88efa..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9261 datasheet revision D.
- *
- * 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 AT91SAM9261_MATRIX_H
-#define AT91SAM9261_MATRIX_H
-
-#define AT91_MATRIX_MCFG       (AT91_MATRIX + 0x00)    /* Master Configuration Register */
-#define                AT91_MATRIX_RCB0        (1 << 0)                /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define                AT91_MATRIX_RCB1        (1 << 1)                /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-
-#define AT91_MATRIX_SCFG0      (AT91_MATRIX + 0x04)    /* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1      (AT91_MATRIX + 0x08)    /* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2      (AT91_MATRIX + 0x0C)    /* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3      (AT91_MATRIX + 0x10)    /* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4      (AT91_MATRIX + 0x14)    /* Slave Configuration Register 4 */
-#define                AT91_MATRIX_SLOT_CYCLE          (0xff << 0)     /* Maximum Number of Allowed Cycles for a Burst */
-#define                AT91_MATRIX_DEFMSTR_TYPE        (3    << 16)    /* Default Master Type */
-#define                        AT91_MATRIX_DEFMSTR_TYPE_NONE   (0 << 16)
-#define                        AT91_MATRIX_DEFMSTR_TYPE_LAST   (1 << 16)
-#define                        AT91_MATRIX_DEFMSTR_TYPE_FIXED  (2 << 16)
-#define                AT91_MATRIX_FIXED_DEFMSTR       (7    << 18)    /* Fixed Index of Default Master */
-
-#define AT91_MATRIX_TCR                (AT91_MATRIX + 0x24)    /* TCM Configuration Register */
-#define                AT91_MATRIX_ITCM_SIZE           (0xf << 0)      /* Size of ITCM enabled memory block */
-#define                        AT91_MATRIX_ITCM_0              (0 << 0)
-#define                        AT91_MATRIX_ITCM_16             (5 << 0)
-#define                        AT91_MATRIX_ITCM_32             (6 << 0)
-#define                        AT91_MATRIX_ITCM_64             (7 << 0)
-#define                AT91_MATRIX_DTCM_SIZE           (0xf << 4)      /* Size of DTCM enabled memory block */
-#define                        AT91_MATRIX_DTCM_0              (0 << 4)
-#define                        AT91_MATRIX_DTCM_16             (5 << 4)
-#define                        AT91_MATRIX_DTCM_32             (6 << 4)
-#define                        AT91_MATRIX_DTCM_64             (7 << 4)
-
-#define AT91_MATRIX_EBICSA     (AT91_MATRIX + 0x30)    /* EBI Chip Select Assignment Register */
-#define                AT91_MATRIX_CS1A                (1 << 1)        /* Chip Select 1 Assignment */
-#define                        AT91_MATRIX_CS1A_SMC            (0 << 1)
-#define                        AT91_MATRIX_CS1A_SDRAMC         (1 << 1)
-#define                AT91_MATRIX_CS3A                (1 << 3)        /* Chip Select 3 Assignment */
-#define                        AT91_MATRIX_CS3A_SMC            (0 << 3)
-#define                        AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3)
-#define                AT91_MATRIX_CS4A                (1 << 4)        /* Chip Select 4 Assignment */
-#define                        AT91_MATRIX_CS4A_SMC            (0 << 4)
-#define                        AT91_MATRIX_CS4A_SMC_CF1        (1 << 4)
-#define                AT91_MATRIX_CS5A                (1 << 5)        /* Chip Select 5 Assignment */
-#define                        AT91_MATRIX_CS5A_SMC            (0 << 5)
-#define                        AT91_MATRIX_CS5A_SMC_CF2        (1 << 5)
-#define                AT91_MATRIX_DBPUC               (1 << 8)        /* Data Bus Pull-up Configuration */
-
-#define AT91_MATRIX_USBPUCR    (AT91_MATRIX + 0x34)    /* USB Pad Pull-Up Control Register */
-#define                AT91_MATRIX_USBPUCR_PUON        (1 << 30)       /* USB Device PAD Pull-up Enable */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h b/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h
deleted file mode 100644 (file)
index 972e753..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91sam926x_mc.h
- *
- * Memory Controllers (SMC, SDRAMC) - System peripherals registers.
- * Based on AT91SAM9261 datasheet revision D.
- *
- * 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 AT91SAM926x_MC_H
-#define AT91SAM926x_MC_H
-
-/* SDRAM Controller (SDRAMC) registers */
-#define AT91_SDRAMC_MR         (AT91_SDRAMC + 0x00)    /* SDRAM Controller Mode Register */
-#define                AT91_SDRAMC_MODE        (0xf << 0)              /* Command Mode */
-#define                        AT91_SDRAMC_MODE_NORMAL         0
-#define                        AT91_SDRAMC_MODE_NOP            1
-#define                        AT91_SDRAMC_MODE_PRECHARGE      2
-#define                        AT91_SDRAMC_MODE_LMR            3
-#define                        AT91_SDRAMC_MODE_REFRESH        4
-#define                        AT91_SDRAMC_MODE_EXT_LMR        5
-#define                        AT91_SDRAMC_MODE_DEEP           6
-
-#define AT91_SDRAMC_TR         (AT91_SDRAMC + 0x04)    /* SDRAM Controller Refresh Timer Register */
-#define                AT91_SDRAMC_COUNT       (0xfff << 0)            /* Refresh Timer Counter */
-
-#define AT91_SDRAMC_CR         (AT91_SDRAMC + 0x08)    /* SDRAM Controller Configuration Register */
-#define                AT91_SDRAMC_NC          (3 << 0)                /* Number of Column Bits */
-#define                        AT91_SDRAMC_NC_8        (0 << 0)
-#define                        AT91_SDRAMC_NC_9        (1 << 0)
-#define                        AT91_SDRAMC_NC_10       (2 << 0)
-#define                        AT91_SDRAMC_NC_11       (3 << 0)
-#define                AT91_SDRAMC_NR          (3 << 2)                /* Number of Row Bits */
-#define                        AT91_SDRAMC_NR_11       (0 << 2)
-#define                        AT91_SDRAMC_NR_12       (1 << 2)
-#define                        AT91_SDRAMC_NR_13       (2 << 2)
-#define                AT91_SDRAMC_NB          (1 << 4)                /* Number of Banks */
-#define                        AT91_SDRAMC_NB_2        (0 << 4)
-#define                        AT91_SDRAMC_NB_4        (1 << 4)
-#define                AT91_SDRAMC_CAS         (3 << 5)                /* CAS Latency */
-#define                        AT91_SDRAMC_CAS_1       (1 << 5)
-#define                        AT91_SDRAMC_CAS_2       (2 << 5)
-#define                        AT91_SDRAMC_CAS_3       (3 << 5)
-#define                AT91_SDRAMC_DBW         (1 << 7)                /* Data Bus Width */
-#define                        AT91_SDRAMC_DBW_32      (0 << 7)
-#define                        AT91_SDRAMC_DBW_16      (1 << 7)
-#define                AT91_SDRAMC_TWR         (0xf <<  8)             /* Write Recovery Delay */
-#define                AT91_SDRAMC_TRC         (0xf << 12)             /* Row Cycle Delay */
-#define                AT91_SDRAMC_TRP         (0xf << 16)             /* Row Precharge Delay */
-#define                AT91_SDRAMC_TRCD        (0xf << 20)             /* Row to Column Delay */
-#define                AT91_SDRAMC_TRAS        (0xf << 24)             /* Active to Precharge Delay */
-#define                AT91_SDRAMC_TXSR        (0xf << 28)             /* Exit Self Refresh to Active Delay */
-
-#define AT91_SDRAMC_LPR                (AT91_SDRAMC + 0x10)    /* SDRAM Controller Low Power Register */
-#define                AT91_SDRAMC_LPCB                (3 << 0)        /* Low-power Configurations */
-#define                        AT91_SDRAMC_LPCB_DISABLE                0
-#define                        AT91_SDRAMC_LPCB_SELF_REFRESH           1
-#define                        AT91_SDRAMC_LPCB_POWER_DOWN             2
-#define                        AT91_SDRAMC_LPCB_DEEP_POWER_DOWN        3
-#define                AT91_SDRAMC_PASR                (7 << 4)        /* Partial Array Self Refresh */
-#define                AT91_SDRAMC_TCSR                (3 << 8)        /* Temperature Compensated Self Refresh */
-#define                AT91_SDRAMC_DS                  (3 << 10)       /* Drive Strenght */
-#define                AT91_SDRAMC_TIMEOUT             (3 << 12)       /* Time to define when Low Power Mode is enabled */
-#define                        AT91_SDRAMC_TIMEOUT_0_CLK_CYCLES        (0 << 12)
-#define                        AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES       (1 << 12)
-#define                        AT91_SDRAMC_TIMEOUT_128_CLK_CYCLES      (2 << 12)
-
-#define AT91_SDRAMC_IER                (AT91_SDRAMC + 0x14)    /* SDRAM Controller Interrupt Enable Register */
-#define AT91_SDRAMC_IDR                (AT91_SDRAMC + 0x18)    /* SDRAM Controller Interrupt Disable Register */
-#define AT91_SDRAMC_IMR                (AT91_SDRAMC + 0x1C)    /* SDRAM Controller Interrupt Mask Register */
-#define AT91_SDRAMC_ISR                (AT91_SDRAMC + 0x20)    /* SDRAM Controller Interrupt Status Register */
-#define                AT91_SDRAMC_RES         (1 << 0)                /* Refresh Error Status */
-
-#define AT91_SDRAMC_MDR                (AT91_SDRAMC + 0x24)    /* SDRAM Memory Device Register */
-#define                AT91_SDRAMC_MD          (3 << 0)                /* Memory Device Type */
-#define                        AT91_SDRAMC_MD_SDRAM            0
-#define                        AT91_SDRAMC_MD_LOW_POWER_SDRAM  1
-
-
-/* Static Memory Controller (SMC) registers */
-#define AT91_SMC_SETUP(n)      (AT91_SMC + 0x00 + ((n)*0x10))  /* Setup Register for CS n */
-#define                AT91_SMC_NWESETUP       (0x3f << 0)                     /* NWE Setup Length */
-#define                        AT91_SMC_NWESETUP_(x)   ((x) << 0)
-#define                AT91_SMC_NCS_WRSETUP    (0x3f << 8)                     /* NCS Setup Length in Write Access */
-#define                        AT91_SMC_NCS_WRSETUP_(x)        ((x) << 8)
-#define                AT91_SMC_NRDSETUP       (0x3f << 16)                    /* NRD Setup Length */
-#define                        AT91_SMC_NRDSETUP_(x)   ((x) << 16)
-#define                AT91_SMC_NCS_RDSETUP    (0x3f << 24)                    /* NCS Setup Length in Read Access */
-#define                        AT91_SMC_NCS_RDSETUP_(x)        ((x) << 24)
-
-#define AT91_SMC_PULSE(n)      (AT91_SMC + 0x04 + ((n)*0x10))  /* Pulse Register for CS n */
-#define                AT91_SMC_NWEPULSE       (0x7f <<  0)                    /* NWE Pulse Length */
-#define                        AT91_SMC_NWEPULSE_(x)   ((x) << 0)
-#define                AT91_SMC_NCS_WRPULSE    (0x7f <<  8)                    /* NCS Pulse Length in Write Access */
-#define                        AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
-#define                AT91_SMC_NRDPULSE       (0x7f << 16)                    /* NRD Pulse Length */
-#define                        AT91_SMC_NRDPULSE_(x)   ((x) << 16)
-#define                AT91_SMC_NCS_RDPULSE    (0x7f << 24)                    /* NCS Pulse Length in Read Access */
-#define                        AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
-
-#define AT91_SMC_CYCLE(n)      (AT91_SMC + 0x08 + ((n)*0x10))  /* Cycle Register for CS n */
-#define                AT91_SMC_NWECYCLE       (0x1ff << 0 )                   /* Total Write Cycle Length */
-#define                        AT91_SMC_NWECYCLE_(x)   ((x) << 0)
-#define                AT91_SMC_NRDCYCLE       (0x1ff << 16)                   /* Total Read Cycle Length */
-#define                        AT91_SMC_NRDCYCLE_(x)   ((x) << 16)
-
-#define AT91_SMC_MODE(n)       (AT91_SMC + 0x0c + ((n)*0x10))  /* Mode Register for CS n */
-#define                AT91_SMC_READMODE       (1 <<  0)                       /* Read Mode */
-#define                AT91_SMC_WRITEMODE      (1 <<  1)                       /* Write Mode */
-#define                AT91_SMC_EXNWMODE       (3 <<  4)                       /* NWAIT Mode */
-#define                        AT91_SMC_EXNWMODE_DISABLE       (0 << 4)
-#define                        AT91_SMC_EXNWMODE_FROZEN        (2 << 4)
-#define                        AT91_SMC_EXNWMODE_READY         (3 << 4)
-#define                AT91_SMC_BAT            (1 <<  8)                       /* Byte Access Type */
-#define                        AT91_SMC_BAT_SELECT             (0 << 8)
-#define                        AT91_SMC_BAT_WRITE              (1 << 8)
-#define                AT91_SMC_DBW            (3 << 12)                       /* Data Bus Width */
-#define                        AT91_SMC_DBW_8                  (0 << 12)
-#define                        AT91_SMC_DBW_16                 (1 << 12)
-#define                        AT91_SMC_DBW_32                 (2 << 12)
-#define                AT91_SMC_TDF            (0xf << 16)                     /* Data Float Time. */
-#define                        AT91_SMC_TDF_(x)                ((x) << 16)
-#define                AT91_SMC_TDFMODE        (1 << 20)                       /* TDF Optimization - Enabled */
-#define                AT91_SMC_PMEN           (1 << 24)                       /* Page Mode Enabled */
-#define                AT91_SMC_PS             (3 << 28)                       /* Page Size */
-#define                        AT91_SMC_PS_4                   (0 << 28)
-#define                        AT91_SMC_PS_8                   (1 << 28)
-#define                        AT91_SMC_PS_16                  (2 << 28)
-#define                        AT91_SMC_PS_32                  (3 << 28)
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/board.h b/include/asm-arm/arch-at91rm9200/board.h
deleted file mode 100644 (file)
index 768e0fc..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/board.h
- *
- *  Copyright (C) 2005 HP Labs
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-/*
- * These are data structures found in platform_device.dev.platform_data,
- * and describing board-specific data needed by drivers.  For example,
- * which pin is used for a given GPIO role.
- *
- * In 2.6, drivers should strongly avoid board-specific knowledge so
- * that supporting new boards normally won't require driver patches.
- * Most board-specific knowledge should be in arch/.../board-*.c files.
- */
-
-#ifndef __ASM_ARCH_BOARD_H
-#define __ASM_ARCH_BOARD_H
-
-#include <linux/mtd/partitions.h>
-#include <linux/device.h>
-#include <linux/spi/spi.h>
-
- /* USB Device */
-struct at91_udc_data {
-       u8      vbus_pin;               /* high == host powering us */
-       u8      pullup_pin;             /* high == D+ pulled up */
-};
-extern void __init at91_add_device_udc(struct at91_udc_data *data);
-
- /* Compact Flash */
-struct at91_cf_data {
-       u8      irq_pin;                /* I/O IRQ */
-       u8      det_pin;                /* Card detect */
-       u8      vcc_pin;                /* power switching */
-       u8      rst_pin;                /* card reset */
-       u8      chipselect;             /* EBI Chip Select number */
-};
-extern void __init at91_add_device_cf(struct at91_cf_data *data);
-
- /* MMC / SD */
-struct at91_mmc_data {
-       u8              det_pin;        /* card detect IRQ */
-       unsigned        slot_b:1;       /* uses Slot B */
-       unsigned        wire4:1;        /* (SD) supports DAT0..DAT3 */
-       u8              wp_pin;         /* (SD) writeprotect detect */
-       u8              vcc_pin;        /* power switching (high == on) */
-};
-extern void __init at91_add_device_mmc(struct at91_mmc_data *data);
-
- /* Ethernet */
-struct at91_eth_data {
-       u8              phy_irq_pin;    /* PHY IRQ */
-       u8              is_rmii;        /* using RMII interface? */
-};
-extern void __init at91_add_device_eth(struct at91_eth_data *data);
-
- /* USB Host */
-struct at91_usbh_data {
-       u8              ports;          /* number of ports on root hub */
-};
-extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
-
- /* NAND / SmartMedia */
-struct at91_nand_data {
-       u8              enable_pin;     /* chip enable */
-       u8              det_pin;        /* card detect */
-       u8              rdy_pin;        /* ready/busy */
-       u8              ale;            /* address line number connected to ALE */
-       u8              cle;            /* address line number connected to CLE */
-       u8              bus_width_16;   /* buswidth is 16 bit */
-       struct mtd_partition* (*partition_info)(int, int*);
-};
-extern void __init at91_add_device_nand(struct at91_nand_data *data);
-
- /* I2C*/
-extern void __init at91_add_device_i2c(void);
-
- /* SPI */
-extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices);
-
- /* Serial */
-struct at91_uart_config {
-       unsigned short  console_tty;    /* tty number of serial console */
-       unsigned short  nr_tty;         /* number of serial tty's */
-       short           tty_map[];      /* map UART to tty number */
-};
-extern struct platform_device *atmel_default_console_device;
-extern void __init at91_init_serial(struct at91_uart_config *config);
-
-struct atmel_uart_data {
-       short           use_dma_tx;     /* use transmit DMA? */
-       short           use_dma_rx;     /* use receive DMA? */
-       void __iomem    *regs;          /* virtual base address, if any */
-};
-extern void __init at91_add_device_serial(void);
-
- /* LEDs */
-extern u8 at91_leds_cpu;
-extern u8 at91_leds_timer;
-extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/cpu.h b/include/asm-arm/arch-at91rm9200/cpu.h
deleted file mode 100644 (file)
index 6f8d09b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/cpu.h
- *
- *  Copyright (C) 2006 SAN People
- *
- * 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_CPU_H
-#define __ASM_ARCH_CPU_H
-
-#include <asm/hardware.h>
-#include <asm/arch/at91_dbgu.h>
-
-
-#define ARCH_ID_AT91RM9200     0x09290780
-#define ARCH_ID_AT91SAM9260    0x019803a0
-#define ARCH_ID_AT91SAM9261    0x019703a0
-
-
-static inline unsigned long at91_cpu_identify(void)
-{
-       return (at91_sys_read(AT91_DBGU_CIDR) & ~AT91_CIDR_VERSION);
-}
-
-
-#ifdef CONFIG_ARCH_AT91RM9200
-#define cpu_is_at91rm9200()    (at91_cpu_identify() == ARCH_ID_AT91RM9200)
-#else
-#define cpu_is_at91rm9200()    (0)
-#endif
-
-#ifdef CONFIG_ARCH_AT91SAM9260
-#define cpu_is_at91sam9260()   (at91_cpu_identify() == ARCH_ID_AT91SAM9260)
-#else
-#define cpu_is_at91sam9260()   (0)
-#endif
-
-#ifdef CONFIG_ARCH_AT91SAM9261
-#define cpu_is_at91sam9261()   (at91_cpu_identify() == ARCH_ID_AT91SAM9261)
-#else
-#define cpu_is_at91sam9261()   (0)
-#endif
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/debug-macro.S b/include/asm-arm/arch-at91rm9200/debug-macro.S
deleted file mode 100644 (file)
index 85cdadf..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/debug-macro.S
- *
- *  Copyright (C) 2003-2005 SAN People
- *
- * Debugging macro include header
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
-*/
-
-#include <asm/hardware.h>
-#include <asm/arch/at91_dbgu.h>
-
-       .macro  addruart,rx
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                         @ MMU enabled?
-       ldreq   \rx, =AT91_BASE_SYS             @ System peripherals (phys address)
-       ldrne   \rx, =AT91_VA_BASE_SYS          @ System peripherals (virt address)
-       .endm
-
-       .macro  senduart,rd,rx
-       strb    \rd, [\rx, #AT91_DBGU_THR]      @ Write to Transmitter Holding Register
-       .endm
-
-       .macro  waituart,rd,rx
-1001:  ldr     \rd, [\rx, #AT91_DBGU_SR]       @ Read Status Register
-       tst     \rd, #AT91_DBGU_TXRDY           @ DBGU_TXRDY = 1 when ready to transmit
-       beq     1001b
-       .endm
-
-       .macro  busyuart,rd,rx
-1001:  ldr     \rd, [\rx, #AT91_DBGU_SR]       @ Read Status Register
-       tst     \rd, #AT91_DBGU_TXEMPTY         @ DBGU_TXEMPTY = 1 when transmission complete
-       beq     1001b
-       .endm
-
diff --git a/include/asm-arm/arch-at91rm9200/dma.h b/include/asm-arm/arch-at91rm9200/dma.h
deleted file mode 100644 (file)
index 22c1dfd..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/dma.h
- *
- *  Copyright (C) 2003 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
diff --git a/include/asm-arm/arch-at91rm9200/entry-macro.S b/include/asm-arm/arch-at91rm9200/entry-macro.S
deleted file mode 100644 (file)
index 57248a7..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/entry-macro.S
- *
- *  Copyright (C) 2003-2005 SAN People
- *
- * Low-level IRQ helper macros for AT91RM9200 platforms
- *
- * 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 <asm/hardware.h>
-#include <asm/arch/at91_aic.h>
-
-       .macro  disable_fiq
-       .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-       ldr     \base, =(AT91_VA_BASE_SYS)              @ base virtual address of SYS peripherals
-       ldr     \irqnr, [\base, #AT91_AIC_IVR]          @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt)
-       ldr     \irqstat, [\base, #AT91_AIC_ISR]        @ read interrupt source number
-       teq     \irqstat, #0                            @ ISR is 0 when no current interrupt, or spurious interrupt
-       streq   \tmp, [\base, #AT91_AIC_EOICR]          @ not going to be handled further, then ACK it now.
-       .endm
-
diff --git a/include/asm-arm/arch-at91rm9200/gpio.h b/include/asm-arm/arch-at91rm9200/gpio.h
deleted file mode 100644 (file)
index e09d652..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/gpio.h
- *
- *  Copyright (C) 2005 HP Labs
- *
- * 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_AT91RM9200_GPIO_H
-#define __ASM_ARCH_AT91RM9200_GPIO_H
-
-#include <asm/irq.h>
-
-#define PIN_BASE               NR_AIC_IRQS
-
-#define MAX_GPIO_BANKS         4
-
-/* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */
-
-#define        AT91_PIN_PA0    (PIN_BASE + 0x00 + 0)
-#define        AT91_PIN_PA1    (PIN_BASE + 0x00 + 1)
-#define        AT91_PIN_PA2    (PIN_BASE + 0x00 + 2)
-#define        AT91_PIN_PA3    (PIN_BASE + 0x00 + 3)
-#define        AT91_PIN_PA4    (PIN_BASE + 0x00 + 4)
-
-#define        AT91_PIN_PA5    (PIN_BASE + 0x00 + 5)
-#define        AT91_PIN_PA6    (PIN_BASE + 0x00 + 6)
-#define        AT91_PIN_PA7    (PIN_BASE + 0x00 + 7)
-#define        AT91_PIN_PA8    (PIN_BASE + 0x00 + 8)
-#define        AT91_PIN_PA9    (PIN_BASE + 0x00 + 9)
-
-#define        AT91_PIN_PA10   (PIN_BASE + 0x00 + 10)
-#define        AT91_PIN_PA11   (PIN_BASE + 0x00 + 11)
-#define        AT91_PIN_PA12   (PIN_BASE + 0x00 + 12)
-#define        AT91_PIN_PA13   (PIN_BASE + 0x00 + 13)
-#define        AT91_PIN_PA14   (PIN_BASE + 0x00 + 14)
-
-#define        AT91_PIN_PA15   (PIN_BASE + 0x00 + 15)
-#define        AT91_PIN_PA16   (PIN_BASE + 0x00 + 16)
-#define        AT91_PIN_PA17   (PIN_BASE + 0x00 + 17)
-#define        AT91_PIN_PA18   (PIN_BASE + 0x00 + 18)
-#define        AT91_PIN_PA19   (PIN_BASE + 0x00 + 19)
-
-#define        AT91_PIN_PA20   (PIN_BASE + 0x00 + 20)
-#define        AT91_PIN_PA21   (PIN_BASE + 0x00 + 21)
-#define        AT91_PIN_PA22   (PIN_BASE + 0x00 + 22)
-#define        AT91_PIN_PA23   (PIN_BASE + 0x00 + 23)
-#define        AT91_PIN_PA24   (PIN_BASE + 0x00 + 24)
-
-#define        AT91_PIN_PA25   (PIN_BASE + 0x00 + 25)
-#define        AT91_PIN_PA26   (PIN_BASE + 0x00 + 26)
-#define        AT91_PIN_PA27   (PIN_BASE + 0x00 + 27)
-#define        AT91_PIN_PA28   (PIN_BASE + 0x00 + 28)
-#define        AT91_PIN_PA29   (PIN_BASE + 0x00 + 29)
-
-#define        AT91_PIN_PA30   (PIN_BASE + 0x00 + 30)
-#define        AT91_PIN_PA31   (PIN_BASE + 0x00 + 31)
-
-#define        AT91_PIN_PB0    (PIN_BASE + 0x20 + 0)
-#define        AT91_PIN_PB1    (PIN_BASE + 0x20 + 1)
-#define        AT91_PIN_PB2    (PIN_BASE + 0x20 + 2)
-#define        AT91_PIN_PB3    (PIN_BASE + 0x20 + 3)
-#define        AT91_PIN_PB4    (PIN_BASE + 0x20 + 4)
-
-#define        AT91_PIN_PB5    (PIN_BASE + 0x20 + 5)
-#define        AT91_PIN_PB6    (PIN_BASE + 0x20 + 6)
-#define        AT91_PIN_PB7    (PIN_BASE + 0x20 + 7)
-#define        AT91_PIN_PB8    (PIN_BASE + 0x20 + 8)
-#define        AT91_PIN_PB9    (PIN_BASE + 0x20 + 9)
-
-#define        AT91_PIN_PB10   (PIN_BASE + 0x20 + 10)
-#define        AT91_PIN_PB11   (PIN_BASE + 0x20 + 11)
-#define        AT91_PIN_PB12   (PIN_BASE + 0x20 + 12)
-#define        AT91_PIN_PB13   (PIN_BASE + 0x20 + 13)
-#define        AT91_PIN_PB14   (PIN_BASE + 0x20 + 14)
-
-#define        AT91_PIN_PB15   (PIN_BASE + 0x20 + 15)
-#define        AT91_PIN_PB16   (PIN_BASE + 0x20 + 16)
-#define        AT91_PIN_PB17   (PIN_BASE + 0x20 + 17)
-#define        AT91_PIN_PB18   (PIN_BASE + 0x20 + 18)
-#define        AT91_PIN_PB19   (PIN_BASE + 0x20 + 19)
-
-#define        AT91_PIN_PB20   (PIN_BASE + 0x20 + 20)
-#define        AT91_PIN_PB21   (PIN_BASE + 0x20 + 21)
-#define        AT91_PIN_PB22   (PIN_BASE + 0x20 + 22)
-#define        AT91_PIN_PB23   (PIN_BASE + 0x20 + 23)
-#define        AT91_PIN_PB24   (PIN_BASE + 0x20 + 24)
-
-#define        AT91_PIN_PB25   (PIN_BASE + 0x20 + 25)
-#define        AT91_PIN_PB26   (PIN_BASE + 0x20 + 26)
-#define        AT91_PIN_PB27   (PIN_BASE + 0x20 + 27)
-#define        AT91_PIN_PB28   (PIN_BASE + 0x20 + 28)
-#define        AT91_PIN_PB29   (PIN_BASE + 0x20 + 29)
-
-#define        AT91_PIN_PB30   (PIN_BASE + 0x20 + 30)
-#define        AT91_PIN_PB31   (PIN_BASE + 0x20 + 31)
-
-#define        AT91_PIN_PC0    (PIN_BASE + 0x40 + 0)
-#define        AT91_PIN_PC1    (PIN_BASE + 0x40 + 1)
-#define        AT91_PIN_PC2    (PIN_BASE + 0x40 + 2)
-#define        AT91_PIN_PC3    (PIN_BASE + 0x40 + 3)
-#define        AT91_PIN_PC4    (PIN_BASE + 0x40 + 4)
-
-#define        AT91_PIN_PC5    (PIN_BASE + 0x40 + 5)
-#define        AT91_PIN_PC6    (PIN_BASE + 0x40 + 6)
-#define        AT91_PIN_PC7    (PIN_BASE + 0x40 + 7)
-#define        AT91_PIN_PC8    (PIN_BASE + 0x40 + 8)
-#define        AT91_PIN_PC9    (PIN_BASE + 0x40 + 9)
-
-#define        AT91_PIN_PC10   (PIN_BASE + 0x40 + 10)
-#define        AT91_PIN_PC11   (PIN_BASE + 0x40 + 11)
-#define        AT91_PIN_PC12   (PIN_BASE + 0x40 + 12)
-#define        AT91_PIN_PC13   (PIN_BASE + 0x40 + 13)
-#define        AT91_PIN_PC14   (PIN_BASE + 0x40 + 14)
-
-#define        AT91_PIN_PC15   (PIN_BASE + 0x40 + 15)
-#define        AT91_PIN_PC16   (PIN_BASE + 0x40 + 16)
-#define        AT91_PIN_PC17   (PIN_BASE + 0x40 + 17)
-#define        AT91_PIN_PC18   (PIN_BASE + 0x40 + 18)
-#define        AT91_PIN_PC19   (PIN_BASE + 0x40 + 19)
-
-#define        AT91_PIN_PC20   (PIN_BASE + 0x40 + 20)
-#define        AT91_PIN_PC21   (PIN_BASE + 0x40 + 21)
-#define        AT91_PIN_PC22   (PIN_BASE + 0x40 + 22)
-#define        AT91_PIN_PC23   (PIN_BASE + 0x40 + 23)
-#define        AT91_PIN_PC24   (PIN_BASE + 0x40 + 24)
-
-#define        AT91_PIN_PC25   (PIN_BASE + 0x40 + 25)
-#define        AT91_PIN_PC26   (PIN_BASE + 0x40 + 26)
-#define        AT91_PIN_PC27   (PIN_BASE + 0x40 + 27)
-#define        AT91_PIN_PC28   (PIN_BASE + 0x40 + 28)
-#define        AT91_PIN_PC29   (PIN_BASE + 0x40 + 29)
-
-#define        AT91_PIN_PC30   (PIN_BASE + 0x40 + 30)
-#define        AT91_PIN_PC31   (PIN_BASE + 0x40 + 31)
-
-#define        AT91_PIN_PD0    (PIN_BASE + 0x60 + 0)
-#define        AT91_PIN_PD1    (PIN_BASE + 0x60 + 1)
-#define        AT91_PIN_PD2    (PIN_BASE + 0x60 + 2)
-#define        AT91_PIN_PD3    (PIN_BASE + 0x60 + 3)
-#define        AT91_PIN_PD4    (PIN_BASE + 0x60 + 4)
-
-#define        AT91_PIN_PD5    (PIN_BASE + 0x60 + 5)
-#define        AT91_PIN_PD6    (PIN_BASE + 0x60 + 6)
-#define        AT91_PIN_PD7    (PIN_BASE + 0x60 + 7)
-#define        AT91_PIN_PD8    (PIN_BASE + 0x60 + 8)
-#define        AT91_PIN_PD9    (PIN_BASE + 0x60 + 9)
-
-#define        AT91_PIN_PD10   (PIN_BASE + 0x60 + 10)
-#define        AT91_PIN_PD11   (PIN_BASE + 0x60 + 11)
-#define        AT91_PIN_PD12   (PIN_BASE + 0x60 + 12)
-#define        AT91_PIN_PD13   (PIN_BASE + 0x60 + 13)
-#define        AT91_PIN_PD14   (PIN_BASE + 0x60 + 14)
-
-#define        AT91_PIN_PD15   (PIN_BASE + 0x60 + 15)
-#define        AT91_PIN_PD16   (PIN_BASE + 0x60 + 16)
-#define        AT91_PIN_PD17   (PIN_BASE + 0x60 + 17)
-#define        AT91_PIN_PD18   (PIN_BASE + 0x60 + 18)
-#define        AT91_PIN_PD19   (PIN_BASE + 0x60 + 19)
-
-#define        AT91_PIN_PD20   (PIN_BASE + 0x60 + 20)
-#define        AT91_PIN_PD21   (PIN_BASE + 0x60 + 21)
-#define        AT91_PIN_PD22   (PIN_BASE + 0x60 + 22)
-#define        AT91_PIN_PD23   (PIN_BASE + 0x60 + 23)
-#define        AT91_PIN_PD24   (PIN_BASE + 0x60 + 24)
-
-#define        AT91_PIN_PD25   (PIN_BASE + 0x60 + 25)
-#define        AT91_PIN_PD26   (PIN_BASE + 0x60 + 26)
-#define        AT91_PIN_PD27   (PIN_BASE + 0x60 + 27)
-#define        AT91_PIN_PD28   (PIN_BASE + 0x60 + 28)
-#define        AT91_PIN_PD29   (PIN_BASE + 0x60 + 29)
-
-#define        AT91_PIN_PD30   (PIN_BASE + 0x60 + 30)
-#define        AT91_PIN_PD31   (PIN_BASE + 0x60 + 31)
-
-#ifndef __ASSEMBLY__
-/* setup setup routines, called from board init or driver probe() */
-extern int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup);
-extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup);
-extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup);
-extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup);
-extern int __init_or_module at91_set_gpio_output(unsigned pin, int value);
-extern int __init_or_module at91_set_deglitch(unsigned pin, int is_on);
-extern int __init_or_module at91_set_multi_drive(unsigned pin, int is_on);
-
-/* callable at any time */
-extern int at91_set_gpio_value(unsigned pin, int value);
-extern int at91_get_gpio_value(unsigned pin);
-
-/* callable only from core power-management code */
-extern void at91_gpio_suspend(void);
-extern void at91_gpio_resume(void);
-
-/*-------------------------------------------------------------------------*/
-
-/* wrappers for "new style" GPIO calls. the old AT91-specfic ones should
- * eventually be removed (along with this errno.h inclusion), and the
- * gpio request/free calls should probably be implemented.
- */
-
-#include <asm/errno.h>
-
-static inline int gpio_request(unsigned gpio, const char *label)
-{
-       return 0;
-}
-
-static inline void gpio_free(unsigned gpio)
-{
-}
-
-extern int gpio_direction_input(unsigned gpio);
-extern int gpio_direction_output(unsigned gpio);
-
-static inline int gpio_get_value(unsigned gpio)
-{
-       return at91_get_gpio_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned gpio, int value)
-{
-       at91_set_gpio_value(gpio, value);
-}
-
-#include <asm-generic/gpio.h>          /* cansleep wrappers */
-
-static inline int gpio_to_irq(unsigned gpio)
-{
-       return gpio;
-}
-
-static inline int irq_to_gpio(unsigned irq)
-{
-       return irq;
-}
-
-#endif /* __ASSEMBLY__ */
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91rm9200/hardware.h
deleted file mode 100644 (file)
index 9ea5bfe..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/hardware.h
- *
- *  Copyright (C) 2003 SAN People
- *  Copyright (C) 2003 ATMEL
- *
- * 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>
-
-#if defined(CONFIG_ARCH_AT91RM9200)
-#include <asm/arch/at91rm9200.h>
-#elif defined(CONFIG_ARCH_AT91SAM9260)
-#include <asm/arch/at91sam9260.h>
-#elif defined(CONFIG_ARCH_AT91SAM9261)
-#include <asm/arch/at91sam9261.h>
-#else
-#error "Unsupported AT91 processor"
-#endif
-
-
-/*
- * Remap the peripherals from address 0xFFFA0000 .. 0xFFFFFFFF
- * to 0xFEFA0000 .. 0xFF000000.  (384Kb)
- */
-#define AT91_IO_PHYS_BASE      0xFFFA0000
-#define AT91_IO_SIZE           (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1)
-#define AT91_IO_VIRT_BASE      (0xFF000000 - AT91_IO_SIZE)
-
- /* Convert a physical IO address to virtual IO address */
-#define AT91_IO_P2V(x) ((x) - AT91_IO_PHYS_BASE + AT91_IO_VIRT_BASE)
-
-/*
- * Virtual to Physical Address mapping for IO devices.
- */
-#define AT91_VA_BASE_SYS       AT91_IO_P2V(AT91_BASE_SYS)
-#define AT91_VA_BASE_EMAC      AT91_IO_P2V(AT91RM9200_BASE_EMAC)
-
- /* Internal SRAM is mapped below the IO devices */
-#define AT91_SRAM_MAX          SZ_1M
-#define AT91_VIRT_BASE         (AT91_IO_VIRT_BASE - AT91_SRAM_MAX)
-
-/* Serial ports */
-#define ATMEL_MAX_UART         7               /* 6 USART3's and one DBGU port (SAM9260) */
-
-/* External Memory Map */
-#define AT91_CHIPSELECT_0      0x10000000
-#define AT91_CHIPSELECT_1      0x20000000
-#define AT91_CHIPSELECT_2      0x30000000
-#define AT91_CHIPSELECT_3      0x40000000
-#define AT91_CHIPSELECT_4      0x50000000
-#define AT91_CHIPSELECT_5      0x60000000
-#define AT91_CHIPSELECT_6      0x70000000
-#define AT91_CHIPSELECT_7      0x80000000
-
-/* SDRAM */
-#define AT91_SDRAM_BASE                AT91_CHIPSELECT_1
-
-/* Clocks */
-#define AT91_SLOW_CLOCK                32768           /* slow clock */
-
-#ifndef __ASSEMBLY__
-#include <asm/io.h>
-
-static inline unsigned int at91_sys_read(unsigned int reg_offset)
-{
-       void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
-
-       return __raw_readl(addr + reg_offset);
-}
-
-static inline void at91_sys_write(unsigned int reg_offset, unsigned long value)
-{
-       void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
-
-       __raw_writel(value, addr + reg_offset);
-}
-#endif
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/io.h b/include/asm-arm/arch-at91rm9200/io.h
deleted file mode 100644 (file)
index 88fd1be..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/io.h
- *
- *  Copyright (C) 2003 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __ASM_ARCH_IO_H
-#define __ASM_ARCH_IO_H
-
-#include <asm/io.h>
-
-#define IO_SPACE_LIMIT         0xFFFFFFFF
-
-#define __io(a)                        ((void __iomem *)(a))
-#define __mem_pci(a)           (a)
-
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/irqs.h b/include/asm-arm/arch-at91rm9200/irqs.h
deleted file mode 100644 (file)
index c0679ea..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/irqs.h
- *
- *  Copyright (C) 2004 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __ASM_ARCH_IRQS_H
-#define __ASM_ARCH_IRQS_H
-
-#include <asm/arch/at91_aic.h>
-
-#define NR_AIC_IRQS 32
-
-
-/*
- * Acknowledge interrupt with AIC after interrupt has been handled.
- *   (by kernel/irq.c)
- */
-#define irq_finish(irq) do { at91_sys_write(AT91_AIC_EOICR, 0); } while (0)
-
-
-/*
- * IRQ interrupt symbols are the AT91xxx_ID_* symbols
- * for IRQs handled directly through the AIC, or else the AT91_PIN_*
- * symbols in gpio.h for ones handled indirectly as GPIOs.
- * We make provision for 4 banks of GPIO.
- */
-#define        NR_IRQS         (NR_AIC_IRQS + (4 * 32))
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/memory.h b/include/asm-arm/arch-at91rm9200/memory.h
deleted file mode 100644 (file)
index f985069..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/memory.h
- *
- *  Copyright (C) 2004 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __ASM_ARCH_MEMORY_H
-#define __ASM_ARCH_MEMORY_H
-
-#include <asm/hardware.h>
-
-#define PHYS_OFFSET    (AT91_SDRAM_BASE)
-
-
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *              address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *              to an address that the kernel can use.
- */
-#define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt(x) __phys_to_virt(x)
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/system.h b/include/asm-arm/arch-at91rm9200/system.h
deleted file mode 100644 (file)
index 9c67130..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/system.h
- *
- *  Copyright (C) 2003 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __ASM_ARCH_SYSTEM_H
-#define __ASM_ARCH_SYSTEM_H
-
-#include <asm/hardware.h>
-#include <asm/arch/at91_st.h>
-#include <asm/arch/at91_dbgu.h>
-
-static inline void arch_idle(void)
-{
-       /*
-        * Disable the processor clock.  The processor will be automatically
-        * re-enabled by an interrupt or by a reset.
-        */
-//     at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
-
-       /*
-        * Set the processor (CP15) into 'Wait for Interrupt' mode.
-        * Unlike disabling the processor clock via the PMC (above)
-        *  this allows the processor to be woken via JTAG.
-        */
-       cpu_do_idle();
-}
-
-void (*at91_arch_reset)(void);
-
-static inline void arch_reset(char mode)
-{
-       /* call the CPU-specific reset function */
-       if (at91_arch_reset)
-               (at91_arch_reset)();
-}
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/timex.h b/include/asm-arm/arch-at91rm9200/timex.h
deleted file mode 100644 (file)
index faeca45..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/timex.h
- *
- *  Copyright (C) 2003 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __ASM_ARCH_TIMEX_H
-#define __ASM_ARCH_TIMEX_H
-
-#include <asm/hardware.h>
-
-#if defined(CONFIG_ARCH_AT91RM9200)
-
-#define CLOCK_TICK_RATE                (AT91_SLOW_CLOCK)
-
-#elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9261)
-
-#define AT91SAM9_MASTER_CLOCK  99300000
-#define CLOCK_TICK_RATE                (AT91SAM9_MASTER_CLOCK/16)
-
-#endif
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/uncompress.h b/include/asm-arm/arch-at91rm9200/uncompress.h
deleted file mode 100644 (file)
index 34b4b93..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/uncompress.h
- *
- *  Copyright (C) 2003 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
-#include <asm/hardware.h>
-#include <asm/arch/at91_dbgu.h>
-
-/*
- * The following code assumes the serial port has already been
- * initialized by the bootloader.  If you didn't setup a port in
- * your bootloader then nothing will appear (which might be desired).
- *
- * This does not append a newline
- */
-static void putc(int c)
-{
-       void __iomem *sys = (void __iomem *) AT91_BASE_SYS;     /* physical address */
-
-       while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXRDY))
-               barrier();
-       __raw_writel(c, sys + AT91_DBGU_THR);
-}
-
-static inline void flush(void)
-{
-       void __iomem *sys = (void __iomem *) AT91_BASE_SYS;     /* physical address */
-
-       /* wait for transmission to complete */
-       while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXEMPTY))
-               barrier();
-}
-
-#define arch_decomp_setup()
-
-#define arch_decomp_wdog()
-
-#endif
diff --git a/include/asm-arm/arch-at91rm9200/vmalloc.h b/include/asm-arm/arch-at91rm9200/vmalloc.h
deleted file mode 100644 (file)
index 0a23b8c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/vmalloc.h
- *
- *  Copyright (C) 2003 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __ASM_ARCH_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H
-
-#define VMALLOC_END            (AT91_VIRT_BASE & PGDIR_MASK)
-
-#endif
index 593f562f85c35ab08cede727f564f51f3622b813..625c6f0abc030c50b5fab0f1014dae6deaeebd3b 100644 (file)
 
 #define EP93XX_GPIO_BASE               (EP93XX_APB_VIRT_BASE + 0x00040000)
 #define EP93XX_GPIO_REG(x)             (EP93XX_GPIO_BASE + (x))
+#define EP93XX_GPIO_F_INT_TYPE1                EP93XX_GPIO_REG(0x4c)
+#define EP93XX_GPIO_F_INT_TYPE2                EP93XX_GPIO_REG(0x50)
+#define EP93XX_GPIO_F_INT_ACK          EP93XX_GPIO_REG(0x54)
+#define EP93XX_GPIO_F_INT_ENABLE       EP93XX_GPIO_REG(0x58)
+#define EP93XX_GPIO_F_INT_STATUS       EP93XX_GPIO_REG(0x5c)
 #define EP93XX_GPIO_A_INT_TYPE1                EP93XX_GPIO_REG(0x90)
 #define EP93XX_GPIO_A_INT_TYPE2                EP93XX_GPIO_REG(0x94)
 #define EP93XX_GPIO_A_INT_ACK          EP93XX_GPIO_REG(0x98)
index ae532e304bf1f2b182e1e1430c350c57c7089e2d..2a8c63638c5e824cd30aa2a612d185263ba28f05 100644 (file)
 #define IRQ_EP93XX_SAI                 60
 #define EP93XX_VIC2_VALID_IRQ_MASK     0x1fffffff
 
-#define IRQ_EP93XX_GPIO(x)             (64 + (x))
+/*
+ * Map GPIO A0..A7 to irq 64..71, B0..B7 to 72..79, and
+ * F0..F7 to 80..87.
+ */
+#define IRQ_EP93XX_GPIO(x)             (64 + (((x) + (((x) >> 2) & 8)) & 0x1f))
 
-#define NR_EP93XX_IRQS                 IRQ_EP93XX_GPIO(16)
+#define NR_EP93XX_IRQS                 (64 + 24)
 
 #define EP93XX_BOARD_IRQ(x)            (NR_EP93XX_IRQS + (x))
 #define EP93XX_BOARD_IRQS              32
index b4a8deb8bdef8c4aae9c08c50ca29702d2ea15eb..44eccec2cba45d36f69a6ac11e097feb250ca307 100644 (file)
@@ -8,7 +8,6 @@ void ep93xx_map_io(void);
 void ep93xx_init_irq(void);
 void ep93xx_init_time(unsigned long);
 void ep93xx_init_devices(void);
-void ep93xx_clock_init(void);
 extern struct sys_timer ep93xx_timer;
 
 struct ep93xx_eth_data
index 3b9ef69146275a68929602e67f773b238f676348..61bb0bdc1b1651744c0b888a5ffd73a8461dd50c 100644 (file)
                .endm
 #define AITC_NIVECSR   0x40
                .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldr     \irqstat, =IO_ADDRESS(IMX_AITC_BASE)
+               ldr     \base, =IO_ADDRESS(IMX_AITC_BASE)
                @ Load offset & priority of the highest priority
                @ interrupt pending.
-               ldr     \irqnr, [\irqstat, #AITC_NIVECSR]
+               ldr     \irqstat, [\base, #AITC_NIVECSR]
                @ Shift off the priority leaving the offset or
-               @ "interrupt number"
-               mov     \irqnr, \irqnr, lsr #16
-               ldr     \irqstat, =1    @ dummy compare
-               ldr     \base, =0xFFFF          // invalid interrupt
-               cmp     \irqnr, \base
-               bne     1001f
-               ldr     \irqstat, =0
-1001:
-               tst     \irqstat, #1    @ to make the condition code = TRUE
+               @ "interrupt number", use arithmetic shift to
+               @ transform illegal source (0xffff) as -1
+               mov     \irqnr, \irqstat, asr #16
+               adds    \tmp, \irqnr, #1
                .endm
-
index 12d9ee02cde31c26c8421c38a70c140f97ac14a7..5f570a598a376919ba839da1750a7fe3f6bbe2ec 100644 (file)
 
 #include <asm/hardware.h>
 
-#define IO_SPACE_LIMIT         0xffffffff
+extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
+extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
+       unsigned long flags);
+extern void __iop3xx_iounmap(void __iomem *addr);
 
-#define __io(p)                        ((void __iomem *)(p))
+#define IO_SPACE_LIMIT         0xffffffff
+#define __io(p)                ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
 #define __mem_pci(a)           (a)
 
+#define __arch_ioremap(a, s, f) __iop3xx_ioremap(a, s, f)
+#define __arch_iounmap(a)       __iop3xx_iounmap(a)
 
 #endif
index c017402bab965d52fcdc88f10aadd233e27f3004..1bb5071e1fa8b98b4c1549a6797aa1083cc21905 100644 (file)
 
 #include <asm/hardware.h>
 
+extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
+extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
+       unsigned long flags);
+extern void __iop3xx_iounmap(void __iomem *addr);
+
 #define IO_SPACE_LIMIT         0xffffffff
-#define __io(p)                        ((void __iomem *)(p))
+#define __io(p)                ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
 #define __mem_pci(a)           (a)
 
+#define __arch_ioremap(a, s, f) __iop3xx_ioremap(a, s, f)
+#define __arch_iounmap(a)       __iop3xx_iounmap(a)
 
 #endif
diff --git a/include/asm-arm/arch-ixp4xx/avila.h b/include/asm-arm/arch-ixp4xx/avila.h
new file mode 100644 (file)
index 0000000..0dfea0c
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * include/asm-arm/arch-ixp4xx/avila.h
+ *
+ * Gateworks Avila platform specific definitions
+ *
+ * Author: Michael-Luke Jones <mlj28@cam.ac.uk>
+ *
+ * Based on ixdp425.h
+ * Author: Deepak Saxena <dsaxena@plexity.net>
+ *
+ * Copyright 2004 (c) MontaVista, Software, Inc.
+ *
+ * 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.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H__
+#error "Do not include this directly, instead #include <asm/hardware.h>"
+#endif
+
+#define        AVILA_SDA_PIN           7
+#define        AVILA_SCL_PIN           6
+
+/*
+ * AVILA PCI IRQs
+ */
+#define AVILA_PCI_MAX_DEV      4
+#define LOFT_PCI_MAX_DEV    6
+#define AVILA_PCI_IRQ_LINES    4
+
+
+/* PCI controller GPIO to IRQ pin mappings */
+#define AVILA_PCI_INTA_PIN     11
+#define AVILA_PCI_INTB_PIN     10
+#define AVILA_PCI_INTC_PIN     9
+#define AVILA_PCI_INTD_PIN     8
+
+
index 6acb69c95ef9cfebf262034fc7a0c1998a410420..88fd0877dcc13928ca5808a696dc8ca52f474e9b 100644 (file)
@@ -42,6 +42,7 @@ extern unsigned int processor_id;
 
 /* Platform specific details */
 #include "ixdp425.h"
+#include "avila.h"
 #include "coyote.h"
 #include "prpmc1100.h"
 #include "nslu2.h"
index f24b763ca18e406cf698d7096534ddb1f0282137..e44a563d00ffcf48c569031aac44975540544e05 100644 (file)
 #define        IRQ_IXDP425_PCI_INTC    IRQ_IXP4XX_GPIO9
 #define        IRQ_IXDP425_PCI_INTD    IRQ_IXP4XX_GPIO8
 
+/*
+ * Gateworks Avila board IRQs
+ */
+#define        IRQ_AVILA_PCI_INTA      IRQ_IXP4XX_GPIO11
+#define        IRQ_AVILA_PCI_INTB      IRQ_IXP4XX_GPIO10
+#define        IRQ_AVILA_PCI_INTC      IRQ_IXP4XX_GPIO9
+#define        IRQ_AVILA_PCI_INTD      IRQ_IXP4XX_GPIO8
+
+
 /*
  * PrPMC1100 Board IRQs
  */
index dbdec36ff0d1bc7642dd64c662ea17262a52a13a..79b850a3be475cdb96422c85be26d3170d8e8307 100644 (file)
@@ -6,3 +6,25 @@
 
 extern void ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info);
 
+static inline int udc_gpio_to_irq(unsigned gpio)
+{
+       return 0;
+}
+
+static inline void udc_gpio_init_vbus(unsigned gpio)
+{
+}
+
+static inline void udc_gpio_init_pullup(unsigned gpio)
+{
+}
+
+static inline int udc_gpio_get(unsigned gpio)
+{
+       return 0;
+}
+
+static inline void udc_gpio_set(unsigned gpio, int is_on)
+{
+}
+
diff --git a/include/asm-arm/arch-ns9xxx/board.h b/include/asm-arm/arch-ns9xxx/board.h
new file mode 100644 (file)
index 0000000..91dc8fb
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * include/asm-arm/arch-ns9xxx/board.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_BOARD_H
+#define __ASM_ARCH_BOARD_H
+
+#include <asm/mach-types.h>
+
+#define board_is_a9m9750dev()  (machine_is_cc9p9360dev())
+
+#endif /* ifndef __ASM_ARCH_BOARD_H */
diff --git a/include/asm-arm/arch-ns9xxx/clock.h b/include/asm-arm/arch-ns9xxx/clock.h
new file mode 100644 (file)
index 0000000..4371a48
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * include/asm-arm/arch-ns9xxx/clock.h
+ *
+ * Copyright (C) 2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_CLOCK_H
+#define __ASM_ARCH_CLOCK_H
+
+static inline u32 ns9xxx_systemclock(void)
+{
+       /*
+        * This should be a multiple of HZ * TIMERCLOCKSELECT (in time.c)
+        */
+       return 353894400;
+}
+
+static inline const u32 ns9xxx_cpuclock(void)
+{
+       return ns9xxx_systemclock() / 2;
+}
+
+static inline const u32 ns9xxx_ahbclock(void)
+{
+       return ns9xxx_systemclock() / 4;
+}
+
+static inline const u32 ns9xxx_bbusclock(void)
+{
+       return ns9xxx_systemclock() / 8;
+}
+
+#endif /* ifndef __ASM_ARCH_CLOCK_H */
diff --git a/include/asm-arm/arch-ns9xxx/debug-macro.S b/include/asm-arm/arch-ns9xxx/debug-macro.S
new file mode 100644 (file)
index 0000000..b21b93e
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * include/asm-arm/arch-ns9xxx/debug-macro.S
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <asm/hardware.h>
+
+#include <asm/arch-ns9xxx/regs-board-a9m9750dev.h>
+
+               .macro  addruart,rx
+               mrc     p15, 0, \rx, c1, c0
+               tst     \rx, #1
+               ldreq   \rx, =NS9XXX_CSxSTAT_PHYS(0)
+               ldrne   \rx, =io_p2v(NS9XXX_CSxSTAT_PHYS(0))
+               .endm
+
+#define UART_SHIFT     2
+#include <asm/hardware/debug-8250.S>
diff --git a/include/asm-arm/arch-ns9xxx/dma.h b/include/asm-arm/arch-ns9xxx/dma.h
new file mode 100644 (file)
index 0000000..a67cbbe
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * include/asm-arm/arch-ns9xxx/dma.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_DMA_H
+#define __ASM_ARCH_DMA_H
+
+#endif /* ifndef __ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-ns9xxx/entry-macro.S b/include/asm-arm/arch-ns9xxx/entry-macro.S
new file mode 100644 (file)
index 0000000..467a198
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * include/asm-arm/arch-ns9xxx/entry-macro.S
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <asm/hardware.h>
+#include <asm/arch-ns9xxx/regs-sys.h>
+
+               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
+               ldr     \base, =SYS_ISRADDR
+               ldr     \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)]
+               cmp     \irqstat, #0
+               ldrne   \irqnr, [\base]
+               .endm
+
+               .macro  disable_fiq
+               .endm
diff --git a/include/asm-arm/arch-ns9xxx/hardware.h b/include/asm-arm/arch-ns9xxx/hardware.h
new file mode 100644 (file)
index 0000000..6819da7
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * include/asm-arm/arch-ns9xxx/hardware.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+#include <asm/memory.h>
+
+/*
+ * NetSilicon NS9xxx internal mapping:
+ *
+ * physical                <--> virtual
+ * 0x90000000 - 0x906fffff <--> 0xf9000000 - 0xf96fffff
+ * 0xa0100000 - 0xa0afffff <--> 0xfa100000 - 0xfaafffff
+ */
+#define io_p2v(x)      (0xf0000000 \
+                        + (((x) & 0xf0000000) >> 4) \
+                        + ((x) & 0x00ffffff))
+
+#define io_v2p(x)      ((((x) & 0x0f000000) << 4) \
+                        + ((x) & 0x00ffffff))
+
+#define __REGBIT(bit)          ((u32)1 << (bit))
+#define __REGBITS(hbit, lbit)  ((((u32)1 << ((hbit) - (lbit) + 1)) - 1) << (lbit))
+#define __REGVAL(mask, value)  (((value) * ((mask) & (-(mask))) & (mask)))
+
+#ifndef __ASSEMBLY__
+
+#  define __REG(x)     (*((volatile u32 *)io_p2v((x))))
+#  define __REG2(x, y) (*((volatile u32 *)io_p2v((x)) + (y)))
+
+#  define __REGB(x)    (*((volatile u8 *)io_p2v((x))))
+#  define __REGB2(x)   (*((volatile u8 *)io_p2v((x)) + (y)))
+
+#  define REGSET(var, reg, field, value)                               \
+       ((var) = (((var)                                                \
+                  & ~(reg ## _ ## field &                              \
+                      ~ reg ## _ ## field ## _ ## value))              \
+                 | (reg ## _ ## field ## _ ## value)))
+
+#  define REGSETIM(var, reg, field, value)                             \
+       ((var) = (((var)                                                \
+                  & ~(reg ## _ ## field &                              \
+                      ~(__REGVAL(reg ## _ ## field, value))))          \
+                 | (__REGVAL(reg ## _ ## field, value))))
+
+#  define REGGET(reg, field)                                           \
+       ((reg & (reg ## _ ## field)) / (field & (-field)))
+
+#else
+
+#  define __REG(x)     io_p2v(x)
+#  define __REG2(x, y) io_p2v((x) + (y))
+
+#  define __REGB(x)    __REG((x))
+#  define __REGB2(x, y)        __REG2((x), (y))
+
+#endif
+
+#endif /* ifndef __ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-ns9xxx/io.h b/include/asm-arm/arch-ns9xxx/io.h
new file mode 100644 (file)
index 0000000..6f82d28
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * include/asm-arm/arch-ns9xxx/io.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_IO_H
+#define __ASM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT  0xffffffff /* XXX */
+
+#define __io(a)         ((void __iomem *)(a))
+#define __mem_pci(a)    (a)
+#define __mem_isa(a)    (IO_BASE + (a))
+
+#endif /* ifndef __ASM_ARCH_IO_H */
diff --git a/include/asm-arm/arch-ns9xxx/irqs.h b/include/asm-arm/arch-ns9xxx/irqs.h
new file mode 100644 (file)
index 0000000..25d8d28
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * include/asm-arm/arch-ns9xxx/irqs.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_IRQS_H
+#define __ASM_ARCH_IRQS_H
+
+#define IRQ_WATCHDOG   0
+#define IRQ_AHBBUSERR  1
+#define IRQ_BBUSAGG    2
+/* irq 3 is reserved for NS9360 */
+#define IRQ_ETHRX      4
+#define IRQ_ETHTX      5
+#define IRQ_ETHPHY     6
+#define IRQ_LCD                7
+#define IRQ_SERBRX     8
+#define IRQ_SERBTX     9
+#define IRQ_SERARX     10
+#define IRQ_SERATX     11
+#define IRQ_SERCRX     12
+#define IRQ_SERCTX     13
+#define IRQ_I2C                14
+#define IRQ_BBUSDMA    15
+#define IRQ_TIMER0     16
+#define IRQ_TIMER1     17
+#define IRQ_TIMER2     18
+#define IRQ_TIMER3     19
+#define IRQ_TIMER4     20
+#define IRQ_TIMER5     21
+#define IRQ_TIMER6     22
+#define IRQ_TIMER7     23
+#define IRQ_RTC                24
+#define IRQ_USBHOST    25
+#define IRQ_USBDEVICE  26
+#define IRQ_IEEE1284   27
+#define IRQ_EXT0       28
+#define IRQ_EXT1       29
+#define IRQ_EXT2       30
+#define IRQ_EXT3       31
+
+#define BBUS_IRQ(irq)  (32 + irq)
+
+#define IRQ_BBUS_DMA           BBUS_IRQ(0)
+#define IRQ_BBUS_SERBRX                BBUS_IRQ(2)
+#define IRQ_BBUS_SERBTX                BBUS_IRQ(3)
+#define IRQ_BBUS_SERARX                BBUS_IRQ(4)
+#define IRQ_BBUS_SERATX                BBUS_IRQ(5)
+#define IRQ_BBUS_SERCRX                BBUS_IRQ(6)
+#define IRQ_BBUS_SERCTX                BBUS_IRQ(7)
+#define IRQ_BBUS_SERDRX                BBUS_IRQ(8)
+#define IRQ_BBUS_SERDTX                BBUS_IRQ(9)
+#define IRQ_BBUS_I2C           BBUS_IRQ(10)
+#define IRQ_BBUS_1284          BBUS_IRQ(11)
+#define IRQ_BBUS_UTIL          BBUS_IRQ(12)
+#define IRQ_BBUS_RTC           BBUS_IRQ(13)
+#define IRQ_BBUS_USBHST                BBUS_IRQ(14)
+#define IRQ_BBUS_USBDEV                BBUS_IRQ(15)
+#define IRQ_BBUS_AHBDMA1       BBUS_IRQ(24)
+#define IRQ_BBUS_AHBDMA2       BBUS_IRQ(25)
+
+/*
+ * these Interrupts are specific for the a9m9750dev board.
+ * They are generated by an FPGA that interrupts the CPU on
+ * IRQ_EXT2
+ */
+#define FPGA_IRQ(irq)  (64 + irq)
+
+#define IRQ_FPGA_UARTA         FPGA_IRQ(0)
+#define IRQ_FPGA_UARTB         FPGA_IRQ(1)
+#define IRQ_FPGA_UARTC         FPGA_IRQ(2)
+#define IRQ_FPGA_UARTD         FPGA_IRQ(3)
+#define IRQ_FPGA_TOUCH         FPGA_IRQ(4)
+#define IRQ_FPGA_CF            FPGA_IRQ(5)
+#define IRQ_FPGA_CAN0          FPGA_IRQ(6)
+#define IRQ_FPGA_CAN1          FPGA_IRQ(7)
+
+#define NR_IRQS        72
+
+#endif /* __ASM_ARCH_IRQS_H */
diff --git a/include/asm-arm/arch-ns9xxx/memory.h b/include/asm-arm/arch-ns9xxx/memory.h
new file mode 100644 (file)
index 0000000..ce1343e
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * include/asm-arm/arch-ns9xxx/memory.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+*/
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+/* x in [0..3] */
+#define NS9XXX_CSxSTAT_PHYS(x) UL(((x) + 4) << 28)
+
+#define NS9XXX_CS0STAT_LENGTH  UL(0x1000)
+#define NS9XXX_CS1STAT_LENGTH  UL(0x1000)
+#define NS9XXX_CS2STAT_LENGTH  UL(0x1000)
+#define NS9XXX_CS3STAT_LENGTH  UL(0x1000)
+
+#define PHYS_OFFSET    UL(0x00000000)
+
+#define __virt_to_bus(x) __virt_to_phys(x)
+#define __bus_to_virt(x) __phys_to_virt(x)
+
+#endif
diff --git a/include/asm-arm/arch-ns9xxx/processor.h b/include/asm-arm/arch-ns9xxx/processor.h
new file mode 100644 (file)
index 0000000..716c106
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * include/asm-arm/arch-ns9xxx/processor.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_PROCESSOR_H
+#define __ASM_ARCH_PROCESSOR_H
+
+#include <asm/mach-types.h>
+
+#define processor_is_ns9360()  (machine_is_cc9p9360dev())
+
+#endif /* ifndef __ASM_ARCH_PROCESSOR_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-bbu.h b/include/asm-arm/arch-ns9xxx/regs-bbu.h
new file mode 100644 (file)
index 0000000..e262695
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * include/asm-arm/arch-ns9xxx/regs-bbu.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_REGSBBU_H
+#define __ASM_ARCH_REGSBBU_H
+
+#include <asm/hardware.h>
+
+/* BBus Utility */
+
+/* GPIO Configuration Register */
+#define BBU_GC(x)      __REG2(0x9060000c, (x))
+
+#endif /* ifndef __ASM_ARCH_REGSBBU_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h b/include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h
new file mode 100644 (file)
index 0000000..c3dc532
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_REGSBOARDA9M9750_H
+#define __ASM_ARCH_REGSBOARDA9M9750_H
+
+#include <asm/hardware.h>
+
+#define FPGA_UARTA_BASE        io_p2v(NS9XXX_CSxSTAT_PHYS(0))
+#define FPGA_UARTB_BASE        io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x08)
+#define FPGA_UARTC_BASE        io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x10)
+#define FPGA_UARTD_BASE        io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x18)
+
+#define FPGA_IER       __REGB(NS9XXX_CSxSTAT_PHYS(0) + 0x50)
+#define FPGA_ISR       __REGB(NS9XXX_CSxSTAT_PHYS(0) + 0x60)
+
+#endif /* ifndef __ASM_ARCH_REGSBOARDA9M9750_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-mem.h b/include/asm-arm/arch-ns9xxx/regs-mem.h
new file mode 100644 (file)
index 0000000..8ed8448
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * include/asm-arm/arch-ns9xxx/regs-mem.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_REGSMEM_H
+#define __ASM_ARCH_REGSMEM_H
+
+#include <asm/hardware.h>
+
+/* Memory Module */
+
+/* Control register */
+#define MEM_CTRL       __REG(0xa0700000)
+
+/* Status register */
+#define MEM_STAT       __REG(0xa0700004)
+
+/* Configuration register */
+#define MEM_CONF       __REG(0xa0700008)
+
+/* Dynamic Memory Control register */
+#define MEM_DMCTRL     __REG(0xa0700020)
+
+/* Dynamic Memory Refresh Timer */
+#define MEM_DMRT       __REG(0xa0700024)
+
+/* Dynamic Memory Read Configuration register */
+#define MEM_DMRC       __REG(0xa0700028)
+
+/* Dynamic Memory Precharge Command Period (tRP) */
+#define MEM_DMPCP      __REG(0xa0700030)
+
+/* Dynamic Memory Active to Precharge Command Period (tRAS) */
+#define MEM_DMAPCP     __REG(0xa0700034)
+
+/* Dynamic Memory Self-Refresh Exit Time (tSREX) */
+#define MEM_DMSRET     __REG(0xa0700038)
+
+/* Dynamic Memory Last Data Out to Active Time (tAPR) */
+#define MEM_DMLDOAT    __REG(0xa070003c)
+
+/* Dynamic Memory Data-in to Active Command Time (tDAL or TAPW) */
+#define MEM_DMDIACT    __REG(0xa0700040)
+
+/* Dynamic Memory Write Recovery Time (tWR, tDPL, tRWL, tRDL) */
+#define MEM_DMWRT      __REG(0xa0700044)
+
+/* Dynamic Memory Active to Active Command Period (tRC) */
+#define MEM_DMAACP     __REG(0xa0700048)
+
+/* Dynamic Memory Auto Refresh Period, and Auto Refresh to Active Command Period (tRFC) */
+#define MEM_DMARP      __REG(0xa070004c)
+
+/* Dynamic Memory Exit Self-Refresh to Active Command (tXSR) */
+#define MEM_DMESRAC    __REG(0xa0700050)
+
+/* Dynamic Memory Active Bank A to Active B Time (tRRD) */
+#define MEM_DMABAABT   __REG(0xa0700054)
+
+/* Dynamic Memory Load Mode register to Active Command Time (tMRD) */
+#define MEM_DMLMACT    __REG(0xa0700058)
+
+/* Static Memory Extended Wait */
+#define MEM_SMEW       __REG(0xa0700080)
+
+/* Dynamic Memory Configuration Register x */
+#define MEM_DMCONF(x)  __REG2(0xa0700100, (x) << 3)
+
+/* Dynamic Memory RAS and CAS Delay x */
+#define MEM_DMRCD(x)   __REG2(0xa0700104, (x) << 3)
+
+/* Static Memory Configuration Register x */
+#define MEM_SMC(x)     __REG2(0xa0700200, (x) << 3)
+
+/* Static Memory Configuration Register x: Write protect */
+#define MEM_SMC_WSMC           __REGBIT(20)
+#define MEM_SMC_WSMC_OFF               __REGVAL(MEM_SMC_WSMC, 0)
+#define MEM_SMC_WSMC_ON                        __REGVAL(MEM_SMC_WSMC, 1)
+
+/* Static Memory Configuration Register x: Buffer enable */
+#define MEM_SMC_BSMC           __REGBIT(19)
+#define MEM_SMC_BSMC_OFF               __REGVAL(MEM_SMC_BSMC, 0)
+#define MEM_SMC_BSMC_ON                        __REGVAL(MEM_SMC_BSMC, 1)
+
+/* Static Memory Configuration Register x: Extended Wait */
+#define MEM_SMC_EW             __REGBIT(8)
+#define MEM_SMC_EW_OFF                 __REGVAL(MEM_SMC_EW, 0)
+#define MEM_SMC_EW_ON                  __REGVAL(MEM_SMC_EW, 1)
+
+/* Static Memory Configuration Register x: Byte lane state */
+#define MEM_SMC_PB             __REGBIT(7)
+#define MEM_SMC_PB_0                   __REGVAL(MEM_SMC_PB, 0)
+#define MEM_SMC_PB_1                   __REGVAL(MEM_SMC_PB, 1)
+
+/* Static Memory Configuration Register x: Chip select polarity */
+#define MEM_SMC_PC             __REGBIT(6)
+#define MEM_SMC_PC_AL                  __REGVAL(MEM_SMC_PC, 0)
+#define MEM_SMC_PC_AH                  __REGVAL(MEM_SMC_PC, 1)
+
+/* static memory configuration register x: page mode*/
+#define MEM_SMC_PM             __REGBIT(3)
+#define MEM_SMC_PM_DIS                 __REGVAL(MEM_SMC_PM, 0)
+#define MEM_SMC_PM_ASYNC               __REGVAL(MEM_SMC_PM, 1)
+
+/* static memory configuration register x: Memory width */
+#define MEM_SMC_MW             __REGBITS(1, 0)
+#define MEM_SMC_MW_8                   __REGVAL(MEM_SMC_MW, 0)
+#define MEM_SMC_MW_16                  __REGVAL(MEM_SMC_MW, 1)
+#define MEM_SMC_MW_32                  __REGVAL(MEM_SMC_MW, 2)
+
+/* Static Memory Write Enable Delay x */
+#define MEM_SMWED(x)   __REG2(0xa0700204, (x) << 3)
+
+/* Static Memory Output Enable Delay x */
+#define MEM_SMOED(x)   __REG2(0xa0700208, (x) << 3)
+
+/* Static Memory Read Delay x */
+#define MEM_SMRD(x)    __REG2(0xa070020c, (x) << 3)
+
+/* Static Memory Page Mode Read Delay 0 */
+#define MEM_SMPMRD(x)  __REG2(0xa0700210, (x) << 3)
+
+/* Static Memory Write Delay */
+#define MEM_SMWD(x)    __REG2(0xa0700214, (x) << 3)
+
+/* Static Memory Turn Round Delay x */
+#define MEM_SWT(x)     __REG2(0xa0700218, (x) << 3)
+
+#endif /* ifndef __ASM_ARCH_REGSMEM_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys.h b/include/asm-arm/arch-ns9xxx/regs-sys.h
new file mode 100644 (file)
index 0000000..8162a50
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * include/asm-arm/arch-ns9xxx/regs-sys.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_REGSSYS_H
+#define __ASM_ARCH_REGSSYS_H
+
+#include <asm/hardware.h>
+
+/* System Control Module */
+
+/* AHB Arbiter Gen Configuration */
+#define SYS_AHBAGENCONF        __REG(0xa0900000)
+
+/* BRC */
+#define SYS_BRC(x)     __REG2(0xa0900004, (x))
+
+/* Timer x Reload Count register */
+#define SYS_TRC(x)     __REG2(0xa0900044, (x))
+
+/* Timer x Read register */
+#define SYS_TR(x)      __REG2(0xa0900084, (x))
+
+/* Interrupt Vector Address Register Level x */
+#define SYS_IVA(x)     __REG2(0xa09000c4, (x))
+
+/* Interrupt Configuration registers */
+#define SYS_IC(x)      __REG2(0xa0900144, (x))
+
+/* ISRADDR */
+#define SYS_ISRADDR    __REG(0xa0900164)
+
+/* Interrupt Status Active */
+#define SYS_ISA                __REG(0xa0900168)
+
+/* Interrupt Status Raw */
+#define SYS_ISR                __REG(0xa090016c)
+
+/* Timer Interrupt Status register */
+#define SYS_TIS                __REG(0xa0900170)
+
+/* PLL Configuration register */
+#define SYS_PLL                __REG(0xa0900188)
+
+/* PLL Configuration register: PLL SW change */
+#define SYS_PLL_SWC            __REGBIT(15)
+#define SYS_PLL_SWC_NO                 __REGVAL(SYS_PLL_SWC, 0)
+#define SYS_PLL_SWC_YES                        __REGVAL(SYS_PLL_SWC, 1)
+
+/* Timer x Control register */
+#define SYS_TC(x)      __REG2(0xa0900190, (x))
+
+/* Timer x Control register: Timer enable */
+#define SYS_TCx_TEN            __REGBIT(15)
+#define SYS_TCx_TEN_DIS                        __REGVAL(SYS_TCx_TEN, 1)
+#define SYS_TCx_TEN_EN                 __REGVAL(SYS_TCx_TEN, 1)
+
+/* Timer x Control register: CPU debug mode */
+#define SYS_TCx_TDBG           __REGBIT(10)
+#define SYS_TCx_TDBG_CONT              __REGVAL(SYS_TCx_TDBG, 0)
+#define SYS_TCx_TDBG_STOP              __REGVAL(SYS_TCx_TDBG, 1)
+
+/* Timer x Control register: Interrupt clear */
+#define SYS_TCx_INTC           __REGBIT(9)
+#define SYS_TCx_INTC_UNSET             __REGVAL(SYS_TCx_INTC, 0)
+#define SYS_TCx_INTC_SET               __REGVAL(SYS_TCx_INTC, 1)
+
+/* Timer x Control register: Timer clock select */
+#define SYS_TCx_TLCS           __REGBITS(8, 6)
+#define SYS_TCx_TLCS_CPU               __REGVAL(SYS_TCx_TLCS, 0)       /* CPU clock */
+#define SYS_TCx_TLCS_DIV2              __REGVAL(SYS_TCx_TLCS, 1)       /* CPU clock / 2 */
+#define SYS_TCx_TLCS_DIV4              __REGVAL(SYS_TCx_TLCS, 2)       /* CPU clock / 4 */
+#define SYS_TCx_TLCS_DIV8              __REGVAL(SYS_TCx_TLCS, 3)       /* CPU clock / 8 */
+#define SYS_TCx_TLCS_DIV16             __REGVAL(SYS_TCx_TLCS, 4)       /* CPU clock / 16 */
+#define SYS_TCx_TLCS_DIV32             __REGVAL(SYS_TCx_TLCS, 5)       /* CPU clock / 32 */
+#define SYS_TCx_TLCS_DIV64             __REGVAL(SYS_TCx_TLCS, 6)       /* CPU clock / 64 */
+#define SYS_TCx_TLCS_EXT               __REGVAL(SYS_TCx_TLCS, 7)
+
+/* Timer x Control register: Timer mode */
+#define SYS_TCx_TM             __REGBITS(5, 4)
+#define SYS_TCx_TM_IEE                 __REGVAL(SYS_TCx_TM, 0)         /* Internal timer or external event */
+#define SYS_TCx_TM_ELL                 __REGVAL(SYS_TCx_TM, 1)         /* External low-level, gated timer */
+#define SYS_TCx_TM_EHL                 __REGVAL(SYS_TCx_TM, 2)         /* External high-level, gated timer */
+#define SYS_TCx_TM_CONCAT              __REGVAL(SYS_TCx_TM, 3)         /* Concatenate the lower timer. */
+
+/* Timer x Control register: Interrupt select */
+#define SYS_TCx_INTS           __REGBIT(3)
+#define SYS_TCx_INTS_DIS               __REGVAL(SYS_TCx_INTS, 0)
+#define SYS_TCx_INTS_EN                        __REGVAL(SYS_TCx_INTS, 1)
+
+/* Timer x Control register: Up/down select */
+#define SYS_TCx_UDS            __REGBIT(2)
+#define SYS_TCx_UDS_UP                 __REGVAL(SYS_TCx_UDS, 0)
+#define SYS_TCx_UDS_DOWN               __REGVAL(SYS_TCx_UDS, 1)
+
+/* Timer x Control register: 32- or 16-bit timer */
+#define SYS_TCx_TSZ            __REGBIT(1)
+#define SYS_TCx_TSZ_16                 __REGVAL(SYS_TCx_TSZ, 0)
+#define SYS_TCx_TSZ_32                 __REGVAL(SYS_TCx_TSZ, 1)
+
+/* Timer x Control register: Reload enable */
+#define SYS_TCx_REN            __REGBIT(0)
+#define SYS_TCx_REN_DIS                        __REGVAL(SYS_TCx_REN, 0)
+#define SYS_TCx_REN_EN                 __REGVAL(SYS_TCx_REN, 1)
+
+/* System Memory Chip Select x Dynamic Memory Base */
+#define SYS_SMCSDMB(x) __REG2(0xa09001d0, (x) << 1)
+
+/* System Memory Chip Select x Dynamic Memory Mask */
+#define SYS_SMCSDMM(x) __REG2(0xa09001d4, (x) << 1)
+
+/* System Memory Chip Select x Static Memory Base */
+#define SYS_SMCSSMB(x) __REG2(0xa09001f0, (x) << 1)
+
+/* System Memory Chip Select x Static Memory Base: Chip select x base */
+#define SYS_SMCSSMB_CSxB       __REGBITS(31, 12)
+
+/* System Memory Chip Select x Static Memory Mask */
+#define SYS_SMCSSMM(x) __REG2(0xa09001f4, (x) << 1)
+
+/* System Memory Chip Select x Static Memory Mask: Chip select x mask */
+#define SYS_SMCSSMM_CSxM       __REGBITS(31, 12)
+
+/* System Memory Chip Select x Static Memory Mask: Chip select x enable */
+#define SYS_SMCSSMM_CSEx       __REGBIT(0)
+#define SYS_SMCSSMM_CSEx_DIS           __REGVAL(SYS_SMCSSMM_CSEx, 0)
+#define SYS_SMCSSMM_CSEx_EN            __REGVAL(SYS_SMCSSMM_CSEx, 1)
+
+/* General purpose, user-defined ID register */
+#define SYS_GENID      __REG(0xa0900210)
+
+/* External Interrupt x Control register */
+#define SYS_EIC(x)     __REG2(0xa0900214, (x))
+
+/* External Interrupt x Control register: Status */
+#define SYS_EIC_STS            __REGBIT(3)
+
+/* External Interrupt x Control register: Clear */
+#define SYS_EIC_CLR            __REGBIT(2)
+
+/* External Interrupt x Control register: Polarity */
+#define SYS_EIC_PLTY           __REGBIT(1)
+#define SYS_EIC_PLTY_AH                        __REGVAL(SYS_EIC_PLTY, 0)
+#define SYS_EIC_PLTY_AL                        __REGVAL(SYS_EIC_PLTY, 1)
+
+/* External Interrupt x Control register: Level edge */
+#define SYS_EIC_LVEDG          __REGBIT(0)
+#define SYS_EIC_LVEDG_LEVEL            __REGVAL(SYS_EIC_LVEDG, 0)
+#define SYS_EIC_LVEDG_EDGE             __REGVAL(SYS_EIC_LVEDG, 1)
+
+#endif /* ifndef __ASM_ARCH_REGSSYS_H */
diff --git a/include/asm-arm/arch-ns9xxx/system.h b/include/asm-arm/arch-ns9xxx/system.h
new file mode 100644 (file)
index 0000000..e3cd4d3
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * include/asm-arm/arch-ns9xxx/system.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+#include <asm/proc-fns.h>
+#include <asm/arch-ns9xxx/regs-sys.h>
+#include <asm/mach-types.h>
+
+static inline void arch_idle(void)
+{
+       cpu_do_idle();
+}
+
+static inline void arch_reset(char mode)
+{
+       u32 reg;
+
+       reg = SYS_PLL >> 16;
+       REGSET(reg, SYS_PLL, SWC, YES);
+       SYS_PLL = reg;
+
+       BUG();
+}
+
+#endif /* ifndef __ASM_ARCH_SYSTEM_H */
diff --git a/include/asm-arm/arch-ns9xxx/timex.h b/include/asm-arm/arch-ns9xxx/timex.h
new file mode 100644 (file)
index 0000000..f776cbd
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * include/asm-arm/arch-ns9xxx/timex.h
+ *
+ * Copyright (C) 2005-2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_TIMEX_H
+#define __ASM_ARCH_TIMEX_H
+
+/*
+ * value for CLOCK_TICK_RATE stolen from include/asm-arm/arch-s3c2410/timex.h.
+ * See there for an explanation.
+ */
+#define CLOCK_TICK_RATE         12000000
+
+#endif /* ifndef __ASM_ARCH_TIMEX_H */
diff --git a/include/asm-arm/arch-ns9xxx/uncompress.h b/include/asm-arm/arch-ns9xxx/uncompress.h
new file mode 100644 (file)
index 0000000..961ca7d
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * include/asm-arm/arch-ns9xxx/uncompress.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_UNCOMPRESS_H
+#define __ASM_ARCH_UNCOMPRESS_H
+
+static void putc(char c)
+{
+       volatile u8 *base = (volatile u8 *)0x40000000;
+       int t = 0x10000;
+
+       do {
+               if (base[5] & 0x20) {
+                       base[0] = c;
+                       break;
+               }
+       } while (--t);
+}
+
+#define arch_decomp_setup()
+#define arch_decomp_wdog()
+
+static void flush(void)
+{
+       /* nothing */
+}
+
+#endif /* ifndef __ASM_ARCH_UNCOMPRESS_H */
diff --git a/include/asm-arm/arch-ns9xxx/vmalloc.h b/include/asm-arm/arch-ns9xxx/vmalloc.h
new file mode 100644 (file)
index 0000000..2f3cb6f
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * include/asm-arm/arch-ns9xxx/vmalloc.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_VMALLOC_H
+#define __ASM_ARCH_VMALLOC_H
+
+#define VMALLOC_END     (0xf0000000)
+
+#endif /* ifndef __ASM_ARCH_VMALLOC_H */
index e24f6b6c79ae763f97bd9806d01e55628357c531..aec835b6f057e52bc1edd16cafeb8494dbb7d37f 100644 (file)
  * Serial Audio Controller
  */
 
-/* FIXME: This clash with SA1111 defines */
-#ifndef _ASM_ARCH_SA1111
-
 #define SACR0          __REG(0x40400000)  /* Global Control Register */
 #define SACR1          __REG(0x40400004)  /* Serial Audio I 2 S/MSB-Justified Control Register */
 #define SASR0          __REG(0x4040000C)  /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */
 #define SADIV          __REG(0x40400060)  /* Audio Clock Divider Register. */
 #define SADR           __REG(0x40400080)  /* Serial Audio Data Register (TX and RX FIFO access Register). */
 
-#define SACR0_RFTH(x)  (x << 12)       /* Rx FIFO Interrupt or DMA Trigger Threshold */
-#define SACR0_TFTH(x)  (x << 8)        /* Tx FIFO Interrupt or DMA Trigger Threshold */
+#define SACR0_RFTH(x)  ((x) << 12)     /* Rx FIFO Interrupt or DMA Trigger Threshold */
+#define SACR0_TFTH(x)  ((x) << 8)      /* Tx FIFO Interrupt or DMA Trigger Threshold */
 #define SACR0_STRF     (1 << 5)        /* FIFO Select for EFWR Special Function */
 #define SACR0_EFWR     (1 << 4)        /* Enable EFWR Function  */
 #define SACR0_RST      (1 << 3)        /* FIFO, i2s Register Reset */
 #define SAIMR_RFS      (1 << 4)        /* Enable Rx FIFO Service Interrupt */
 #define SAIMR_TFS      (1 << 3)        /* Enable Tx FIFO Service Interrupt */
 
-#endif
-
 /*
  * AC97 Controller registers
  */
 #define SSSR_PINT              (1 << 18)       /* Peripheral Trailing Byte Interrupt */
 
 #define SSPSP_FSRT             (1 << 25)       /* Frame Sync Relative Timing */
-#define SSPSP_DMYSTOP(x)       (x << 23)       /* Dummy Stop */
-#define SSPSP_SFRMWDTH(x)      (x << 16)       /* Serial Frame Width */
-#define SSPSP_SFRMDLY(x)       (x << 9)        /* Serial Frame Delay */
-#define SSPSP_DMYSTRT(x)       (x << 7)        /* Dummy Start */
-#define SSPSP_STRTDLY(x)       (x << 4)        /* Start Delay */
+#define SSPSP_DMYSTOP(x)       ((x) << 23)     /* Dummy Stop */
+#define SSPSP_SFRMWDTH(x)      ((x) << 16)     /* Serial Frame Width */
+#define SSPSP_SFRMDLY(x)       ((x) << 9)      /* Serial Frame Delay */
+#define SSPSP_DMYSTRT(x)       ((x) << 7)      /* Dummy Start */
+#define SSPSP_STRTDLY(x)       ((x) << 4)      /* Start Delay */
 #define SSPSP_ETDS                     (1 << 3)        /* End of Transfer data State */
 #define SSPSP_SFRMP                    (1 << 2)        /* Serial Frame Polarity */
-#define SSPSP_SCMODE(x)                (x << 0)        /* Serial Bit Rate Clock Mode */
+#define SSPSP_SCMODE(x)                ((x) << 0)      /* Serial Bit Rate Clock Mode */
 
+#define SSACD_SCDB             (1 << 3)        /* SSPSYSCLK Divider Bypass */
+#define SSACD_ACPS(x)          ((x) << 4)      /* Audio clock PLL select */
+#define SSACD_ACDS(x)          ((x) << 0)      /* Audio clock divider select */
 
 #define SSCR0_P1       __REG(0x41000000)  /* SSP Port 1 Control Register 0 */
 #define SSCR1_P1       __REG(0x41000004)  /* SSP Port 1 Control Register 1 */
index 646480d37256a067146db1a6202c734f06ad60d7..8bc6f9c3e3ea2c130b271b46359e7b0a34f7d3bc 100644 (file)
@@ -9,3 +9,33 @@
 
 extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info);
 
+static inline int udc_gpio_to_irq(unsigned gpio)
+{
+       return IRQ_GPIO(gpio & GPIO_MD_MASK_NR);
+}
+
+static inline void udc_gpio_init_vbus(unsigned gpio)
+{
+       pxa_gpio_mode((gpio & GPIO_MD_MASK_NR) | GPIO_IN);
+}
+
+static inline void udc_gpio_init_pullup(unsigned gpio)
+{
+       pxa_gpio_mode((gpio & GPIO_MD_MASK_NR) | GPIO_OUT | GPIO_DFLT_LOW);
+}
+
+static inline int udc_gpio_get(unsigned gpio)
+{
+       return (GPLR(gpio) & GPIO_bit(gpio)) != 0;
+}
+
+static inline void udc_gpio_set(unsigned gpio, int is_on)
+{
+       int mask = GPIO_bit(gpio);
+
+       if (is_on)
+               GPSR(gpio) = mask;
+       else
+               GPCR(gpio) = mask;
+}
+
index 9ca76dc3a7af8ef39fbb6af750a3882ada9e5231..aa78fe087ab2a39cf9ed841aac5e97f42e318ab1 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/arch/platform.h>
 
 /* macro to get at IO space when running virtually */
-#define IO_ADDRESS(x)          (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
+#define IO_ADDRESS(x)          ((((x) & 0x0effffff) | (((x) >> 4) & 0x0f000000)) + 0xf0000000)
 #define __io_address(n)                __io(IO_ADDRESS(n))
 
 #endif
index c16223c9588d88bf4f96d2ab5d7670d85df9e3d1..5a5db56f86b8cd9a712dc31fc8b630c4cf075e4f 100644 (file)
 #define IRQ_AACI               (IRQ_GIC_START + INT_AACI)
 #define IRQ_ETH                        (IRQ_GIC_START + INT_ETH)
 #define IRQ_USB                        (IRQ_GIC_START + INT_USB)
+#define IRQ_PMU_CPU0           (IRQ_GIC_START + INT_PMU_CPU0)
+#define IRQ_PMU_CPU1           (IRQ_GIC_START + INT_PMU_CPU1)
+#define IRQ_PMU_CPU2           (IRQ_GIC_START + INT_PMU_CPU2)
+#define IRQ_PMU_CPU3           (IRQ_GIC_START + INT_PMU_CPU3)
+#define IRQ_PMU_SCU0           (IRQ_GIC_START + INT_PMU_SCU0)
+#define IRQ_PMU_SCU1           (IRQ_GIC_START + INT_PMU_SCU1)
+#define IRQ_PMU_SCU2           (IRQ_GIC_START + INT_PMU_SCU2)
+#define IRQ_PMU_SCU3           (IRQ_GIC_START + INT_PMU_SCU3)
+#define IRQ_PMU_SCU4           (IRQ_GIC_START + INT_PMU_SCU4)
+#define IRQ_PMU_SCU5           (IRQ_GIC_START + INT_PMU_SCU5)
+#define IRQ_PMU_SCU6           (IRQ_GIC_START + INT_PMU_SCU6)
+#define IRQ_PMU_SCU7           (IRQ_GIC_START + INT_PMU_SCU7)
+
+#define IRQ_EB_IRQ1            (IRQ_GIC_START + INT_EB_IRQ1)
+#define IRQ_EB_IRQ2            (IRQ_GIC_START + INT_EB_IRQ2)
 
 #define IRQMASK_WDOGINT                INTMASK_WDOGINT
 #define IRQMASK_SOFTINT                INTMASK_SOFTINT
 #define IRQMASK_ETH            INTMASK_ETH
 #define IRQMASK_USB            INTMASK_USB
 
-#define NR_IRQS                        (IRQ_GIC_START + 64)
+#define NR_IRQS                        (IRQ_GIC_START + 96)
index 18d7c18b738c7941501063283de1061c31a33959..6e0eab95a3a2ed3b8de1a0ae9044e5bc78c193c9 100644 (file)
 #define REALVIEW_GIC_CPU_BASE         0x10040000       /* Generic interrupt controller CPU interface */
 #define REALVIEW_GIC_DIST_BASE        0x10041000       /* Generic interrupt controller distributor */
 #else
+#ifdef CONFIG_REALVIEW_MPCORE_REVB
 #define REALVIEW_MPCORE_SCU_BASE       0x10100000      /*  SCU registers */
 #define REALVIEW_GIC_CPU_BASE          0x10100100      /* Generic interrupt controller CPU interface */
 #define REALVIEW_TWD_BASE              0x10100700
 #define REALVIEW_TWD_SIZE              0x00000100
 #define REALVIEW_GIC_DIST_BASE         0x10101000      /* Generic interrupt controller distributor */
+#define REALVIEW_MPCORE_L220_BASE      0x10102000      /* L220 registers */
+#define REALVIEW_MPCORE_SYS_PLD_CTRL1 0xD8             /*  Register offset for MPCore sysctl */
+#else
+#define REALVIEW_MPCORE_SCU_BASE      0x1F000000       /*  SCU registers */
+#define REALVIEW_GIC_CPU_BASE         0x1F000100       /* Generic interrupt controller CPU interface */
+#define REALVIEW_TWD_BASE             0x1F000700
+#define REALVIEW_TWD_SIZE             0x00000100
+#define REALVIEW_GIC_DIST_BASE        0x1F001000       /* Generic interrupt controller distributor */
+#define REALVIEW_MPCORE_L220_BASE     0x1F002000       /* L220 registers */
+#define REALVIEW_MPCORE_SYS_PLD_CTRL1 0x74             /*  Register offset for MPCore sysctl */
+#endif
+#define REALVIEW_GIC1_CPU_BASE        0x10040000       /* Generic interrupt controller CPU interface */
+#define REALVIEW_GIC1_DIST_BASE       0x10041000       /* Generic interrupt controller distributor */
 #endif
 #define REALVIEW_SMC_BASE             0x10080000       /* SMC */
        /* Reserved 0x10090000 - 0x100EFFFF */
 #define INT_USB                                29      /* USB controller */
 #define INT_TSPENINT                   30      /* Touchscreen pen */
 #define INT_TSKPADINT                  31      /* Touchscreen keypad */
+
 #else
+
+#define MAX_GIC_NR                     2
+
 #define INT_AACI                       0
 #define INT_TIMERINT0_1                        1
 #define INT_TIMERINT2_3                        2
diff --git a/include/asm-arm/arch-realview/scu.h b/include/asm-arm/arch-realview/scu.h
new file mode 100644 (file)
index 0000000..cc29364
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef __ASMARM_ARCH_SCU_H
+#define __ASMARM_ARCH_SCU_H
+
+#include <asm/arch/platform.h>
+
+#define SCU_BASE       REALVIEW_MPCORE_SCU_BASE
+
+#endif
index 58ffa7ba3c88dc68728794225220f14f297cd7e7..c6e8d8f64938e4e3aa0af3fb6119ec47ae8202ee 100644 (file)
@@ -51,13 +51,19 @@ enum dma_ch {
        DMACH_UART0_SRC2,       /* s3c2412 second uart sources */
        DMACH_UART1_SRC2,
        DMACH_UART2_SRC2,
+       DMACH_UART3,            /* s3c2443 has extra uart */
+       DMACH_UART3_SRC2,
        DMACH_MAX,              /* the end entry */
 };
 
 #define DMACH_LOW_LEVEL        (1<<28) /* use this to specifiy hardware ch no */
 
 /* we have 4 dma channels */
-#define S3C2410_DMA_CHANNELS        (4)
+#ifndef CONFIG_CPU_S3C2443
+#define S3C2410_DMA_CHANNELS           (4)
+#else
+#define S3C2410_DMA_CHANNELS           (6)
+#endif
 
 /* types */
 
@@ -321,6 +327,7 @@ extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn);
 #define S3C2410_DMA_DCDST       (0x1C)
 #define S3C2410_DMA_DMASKTRIG   (0x20)
 #define S3C2412_DMA_DMAREQSEL  (0x24)
+#define S3C2443_DMA_DMAREQSEL  (0x24)
 
 #define S3C2410_DISRCC_INC     (1<<0)
 #define S3C2410_DISRCC_APB     (1<<1)
@@ -415,4 +422,31 @@ extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn);
 #define S3C2412_DMAREQSEL_UART2_1      S3C2412_DMAREQSEL_SRC(24)
 
 #endif
+
+#define S3C2443_DMAREQSEL_SRC(x)       ((x)<<1)
+
+#define S3C2443_DMAREQSEL_HW           (1)
+
+#define S3C2443_DMAREQSEL_SPI0TX       S3C2443_DMAREQSEL_SRC(0)
+#define S3C2443_DMAREQSEL_SPI0RX       S3C2443_DMAREQSEL_SRC(1)
+#define S3C2443_DMAREQSEL_SPI1TX       S3C2443_DMAREQSEL_SRC(2)
+#define S3C2443_DMAREQSEL_SPI1RX       S3C2443_DMAREQSEL_SRC(3)
+#define S3C2443_DMAREQSEL_I2STX                S3C2443_DMAREQSEL_SRC(4)
+#define S3C2443_DMAREQSEL_I2SRX                S3C2443_DMAREQSEL_SRC(5)
+#define S3C2443_DMAREQSEL_TIMER                S3C2443_DMAREQSEL_SRC(9)
+#define S3C2443_DMAREQSEL_SDI          S3C2443_DMAREQSEL_SRC(10)
+#define S3C2443_DMAREQSEL_XDREQ0       S3C2443_DMAREQSEL_SRC(17)
+#define S3C2443_DMAREQSEL_XDREQ1       S3C2443_DMAREQSEL_SRC(18)
+#define S3C2443_DMAREQSEL_UART0_0      S3C2443_DMAREQSEL_SRC(19)
+#define S3C2443_DMAREQSEL_UART0_1      S3C2443_DMAREQSEL_SRC(20)
+#define S3C2443_DMAREQSEL_UART1_0      S3C2443_DMAREQSEL_SRC(21)
+#define S3C2443_DMAREQSEL_UART1_1      S3C2443_DMAREQSEL_SRC(22)
+#define S3C2443_DMAREQSEL_UART2_0      S3C2443_DMAREQSEL_SRC(23)
+#define S3C2443_DMAREQSEL_UART2_1      S3C2443_DMAREQSEL_SRC(24)
+#define S3C2443_DMAREQSEL_UART3_0      S3C2443_DMAREQSEL_SRC(25)
+#define S3C2443_DMAREQSEL_UART3_1      S3C2443_DMAREQSEL_SRC(26)
+#define S3C2443_DMAREQSEL_PCMOUT       S3C2443_DMAREQSEL_SRC(27)
+#define S3C2443_DMAREQSEL_PCMIN        S3C2443_DMAREQSEL_SRC(28)
+#define S3C2443_DMAREQSEL_MICIN                S3C2443_DMAREQSEL_SRC(29)
+
 #endif /* __ASM_ARCH_DMA_H */
index 4b7cff456c4e04f935acfb3b07f87554101d62b1..c79cb18199138e18f20f33b86041e06c4a1390ff 100644 (file)
 #define IRQ_EINT4t7    S3C2410_IRQ(4)      /* 20 */
 #define IRQ_EINT8t23   S3C2410_IRQ(5)
 #define IRQ_RESERVED6  S3C2410_IRQ(6)      /* for s3c2410 */
-#define IRQ_CAM        S3C2410_IRQ(6)      /* for s3c2440 */
+#define IRQ_CAM        S3C2410_IRQ(6)      /* for s3c2440,s3c2443 */
 #define IRQ_BATT_FLT   S3C2410_IRQ(7)
 #define IRQ_TICK       S3C2410_IRQ(8)      /* 24 */
-#define IRQ_WDT               S3C2410_IRQ(9)
+#define IRQ_WDT               S3C2410_IRQ(9)       /* WDT/AC97 for s3c2443 */
 #define IRQ_TIMER0     S3C2410_IRQ(10)
 #define IRQ_TIMER1     S3C2410_IRQ(11)
 #define IRQ_TIMER2     S3C2410_IRQ(12)
@@ -45,7 +45,7 @@
 #define IRQ_TIMER4     S3C2410_IRQ(14)
 #define IRQ_UART2      S3C2410_IRQ(15)
 #define IRQ_LCD               S3C2410_IRQ(16)      /* 32 */
-#define IRQ_DMA0       S3C2410_IRQ(17)
+#define IRQ_DMA0       S3C2410_IRQ(17)     /* IRQ_DMA for s3c2443 */
 #define IRQ_DMA1       S3C2410_IRQ(18)
 #define IRQ_DMA2       S3C2410_IRQ(19)
 #define IRQ_DMA3       S3C2410_IRQ(20)
  * these need to be ordered in number of appearance in the
  * SUBSRC mask register
 */
-#define IRQ_S3CUART_RX0  S3C2410_IRQ(54)   /* 70 */
-#define IRQ_S3CUART_TX0  S3C2410_IRQ(55)   /* 71 */
-#define IRQ_S3CUART_ERR0 S3C2410_IRQ(56)
 
-#define IRQ_S3CUART_RX1  S3C2410_IRQ(57)
-#define IRQ_S3CUART_TX1  S3C2410_IRQ(58)
-#define IRQ_S3CUART_ERR1 S3C2410_IRQ(59)
+#define S3C2410_IRQSUB(x)      S3C2410_IRQ((x)+54)
 
-#define IRQ_S3CUART_RX2  S3C2410_IRQ(60)
-#define IRQ_S3CUART_TX2  S3C2410_IRQ(61)
-#define IRQ_S3CUART_ERR2 S3C2410_IRQ(62)
+#define IRQ_S3CUART_RX0                S3C2410_IRQSUB(0)       /* 70 */
+#define IRQ_S3CUART_TX0                S3C2410_IRQSUB(1)
+#define IRQ_S3CUART_ERR0       S3C2410_IRQSUB(2)
 
-#define IRQ_TC          S3C2410_IRQ(63)
-#define IRQ_ADC                 S3C2410_IRQ(64)
+#define IRQ_S3CUART_RX1                S3C2410_IRQSUB(3)       /* 73 */
+#define IRQ_S3CUART_TX1                S3C2410_IRQSUB(4)
+#define IRQ_S3CUART_ERR1       S3C2410_IRQSUB(5)
 
-/* extra irqs for s3c2440 */
+#define IRQ_S3CUART_RX2                S3C2410_IRQSUB(6)       /* 76 */
+#define IRQ_S3CUART_TX2                S3C2410_IRQSUB(7)
+#define IRQ_S3CUART_ERR2       S3C2410_IRQSUB(8)
 
-#define IRQ_S3C2440_CAM_C      S3C2410_IRQ(65)
-#define IRQ_S3C2440_CAM_P      S3C2410_IRQ(66)
-#define IRQ_S3C2440_WDT                S3C2410_IRQ(67)
-#define IRQ_S3C2440_AC97       S3C2410_IRQ(68)
+#define IRQ_TC                 S3C2410_IRQSUB(9)
+#define IRQ_ADC                        S3C2410_IRQSUB(10)
 
-#define NR_IRQS (IRQ_S3C2440_AC97+1)
+/* extra irqs for s3c2440 */
 
+#define IRQ_S3C2440_CAM_C      S3C2410_IRQSUB(11)      /* S3C2443 too */
+#define IRQ_S3C2440_CAM_P      S3C2410_IRQSUB(12)      /* S3C2443 too */
+#define IRQ_S3C2440_WDT                S3C2410_IRQSUB(13)
+#define IRQ_S3C2440_AC97       S3C2410_IRQSUB(14)
+
+/* irqs for s3c2443 */
+
+#define IRQ_S3C2443_DMA                S3C2410_IRQ(17)         /* IRQ_DMA1 */
+#define IRQ_S3C2443_UART3      S3C2410_IRQ(18)         /* IRQ_DMA2 */
+#define IRQ_S3C2443_CFCON      S3C2410_IRQ(19)         /* IRQ_DMA3 */
+#define IRQ_S3C2443_SDI1       S3C2410_IRQ(20)         /* IRQ_SDI */
+#define IRQ_S3C2443_NAND       S3C2410_IRQ(24)         /* reserved */
+
+#define IRQ_S3C2443_LCD1       S3C2410_IRQSUB(14)
+#define IRQ_S3C2443_LCD2       S3C2410_IRQSUB(15)
+#define IRQ_S3C2443_LCD3       S3C2410_IRQSUB(16)
+#define IRQ_S3C2443_LCD4       S3C2410_IRQSUB(17)
+
+#define IRQ_S3C2443_DMA0       S3C2410_IRQSUB(18)
+#define IRQ_S3C2443_DMA1       S3C2410_IRQSUB(19)
+#define IRQ_S3C2443_DMA2       S3C2410_IRQSUB(20)
+#define IRQ_S3C2443_DMA3       S3C2410_IRQSUB(21)
+#define IRQ_S3C2443_DMA4       S3C2410_IRQSUB(22)
+#define IRQ_S3C2443_DMA5       S3C2410_IRQSUB(23)
+
+/* UART3 */
+#define IRQ_S3C2443_RX3                S3C2410_IRQSUB(24)
+#define IRQ_S3C2443_TX3                S3C2410_IRQSUB(25)
+#define IRQ_S3C2443_ERR3       S3C2410_IRQSUB(26)
+
+#define IRQ_S3C2443_WDT                S3C2410_IRQSUB(27)
+#define IRQ_S3C2443_AC97       S3C2410_IRQSUB(28)
+
+#ifdef CONFIG_CPU_S3C2443
+#define NR_IRQS (IRQ_S3C2443_AC97+1)
+#else
+#define NR_IRQS (IRQ_S3C2440_AC97+1)
+#endif
 
 #endif /* __ASM_ARCH_IRQ_H */
index 3196a2849e8ae508061339b45ff4e2426d84698a..c7f231963e7607b30a108bb5526d1d7885ef5ccf 100644 (file)
@@ -41,7 +41,7 @@
 #define S3C2410_ADCTSC_XP_SEN          (1<<4)
 #define S3C2410_ADCTSC_PULL_UP_DISABLE (1<<3)
 #define S3C2410_ADCTSC_AUTO_PST                (1<<2)
-#define S3C2410_ADCTSC_XY_PST          (0x3<<0)
+#define S3C2410_ADCTSC_XY_PST(x)       (((x)&0x3)<<0)
 
 /* ADCDAT0 Bits */
 #define S3C2410_ADCDAT0_UPDOWN         (1<<15)
index eae91694edcdf61939eacbdd99225d440572e7bd..dea578b8f7f66e1b035bc07b03baa3764e8c2d7e 100644 (file)
 #define S3C2400_GPBDAT    S3C2410_GPIOREG(0x0C)
 #define S3C2400_GPBUP     S3C2410_GPIOREG(0x10)
 
-/* no i/o pin in port b can have value 3! */
+/* no i/o pin in port b can have value 3 (unless it is a s3c2443) ! */
 
 #define S3C2410_GPB0         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0)
 #define S3C2410_GPB0_INP     (0x00 << 0)
 #define S3C2410_GPB5_INP     (0x00 << 10)
 #define S3C2410_GPB5_OUTP    (0x01 << 10)
 #define S3C2410_GPB5_nXBACK  (0x02 << 10)
+#define S3C2443_GPB5_XBACK   (0x03 << 10)
 #define S3C2400_GPB5_DATA21  (0x02 << 10)
 #define S3C2400_GPB5_nCTS1   (0x03 << 10)
 
 #define S3C2410_GPB6_INP     (0x00 << 12)
 #define S3C2410_GPB6_OUTP    (0x01 << 12)
 #define S3C2410_GPB6_nXBREQ  (0x02 << 12)
+#define S3C2443_GPB6_XBREQ   (0x03 << 12)
 #define S3C2400_GPB6_DATA22  (0x02 << 12)
 #define S3C2400_GPB6_nRTS1   (0x03 << 12)
 
 #define S3C2410_GPB7_INP     (0x00 << 14)
 #define S3C2410_GPB7_OUTP    (0x01 << 14)
 #define S3C2410_GPB7_nXDACK1 (0x02 << 14)
+#define S3C2443_GPB7_XDACK1  (0x03 << 14)
 #define S3C2400_GPB7_DATA23  (0x02 << 14)
 
 #define S3C2410_GPB8         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8)
 #define S3C2410_GPB9_INP     (0x00 << 18)
 #define S3C2410_GPB9_OUTP    (0x01 << 18)
 #define S3C2410_GPB9_nXDACK0 (0x02 << 18)
+#define S3C2443_GPB9_XDACK0  (0x03 << 18)
 #define S3C2400_GPB9_DATA25  (0x02 << 18)
 #define S3C2400_GPB9_I2SSDI  (0x03 << 18)
 
 #define S3C2410_GPB10_INP    (0x00 << 20)
 #define S3C2410_GPB10_OUTP   (0x01 << 20)
 #define S3C2410_GPB10_nXDRE0 (0x02 << 20)
+#define S3C2443_GPB10_XDREQ0 (0x03 << 20)
 #define S3C2400_GPB10_DATA26 (0x02 << 20)
 #define S3C2400_GPB10_nSS    (0x03 << 20)
 
 #define S3C2410_GPE0_INP       (0x00 << 0)
 #define S3C2410_GPE0_OUTP      (0x01 << 0)
 #define S3C2410_GPE0_I2SLRCK   (0x02 << 0)
+#define S3C2443_GPE0_AC_nRESET (0x03 << 0)
 #define S3C2400_GPE0_EINT0     (0x02 << 0)
 #define S3C2410_GPE0_MASK      (0x03 << 0)
 
 #define S3C2410_GPE1_INP       (0x00 << 2)
 #define S3C2410_GPE1_OUTP      (0x01 << 2)
 #define S3C2410_GPE1_I2SSCLK   (0x02 << 2)
+#define S3C2443_GPE1_AC_SYNC   (0x03 << 2)
 #define S3C2400_GPE1_EINT1     (0x02 << 2)
 #define S3C2400_GPE1_nSS       (0x03 << 2)
 #define S3C2410_GPE1_MASK      (0x03 << 2)
 #define S3C2410_GPE2_INP       (0x00 << 4)
 #define S3C2410_GPE2_OUTP      (0x01 << 4)
 #define S3C2410_GPE2_CDCLK     (0x02 << 4)
+#define S3C2443_GPE2_AC_BITCLK (0x03 << 4)
 #define S3C2400_GPE2_EINT2     (0x02 << 4)
 #define S3C2400_GPE2_I2SSDI    (0x03 << 4)
 
 #define S3C2410_GPE3_INP       (0x00 << 6)
 #define S3C2410_GPE3_OUTP      (0x01 << 6)
 #define S3C2410_GPE3_I2SSDI    (0x02 << 6)
+#define S3C2443_GPE3_AC_SDI    (0x03 << 6)
 #define S3C2400_GPE3_EINT3     (0x02 << 6)
 #define S3C2400_GPE3_nCTS1     (0x03 << 6)
 #define S3C2410_GPE3_nSS0      (0x03 << 6)
 #define S3C2410_GPE4_INP       (0x00 << 8)
 #define S3C2410_GPE4_OUTP      (0x01 << 8)
 #define S3C2410_GPE4_I2SSDO    (0x02 << 8)
+#define S3C2443_GPE4_AC_SDO    (0x03 << 8)
 #define S3C2400_GPE4_EINT4     (0x02 << 8)
 #define S3C2400_GPE4_nRTS1     (0x03 << 8)
 #define S3C2410_GPE4_I2SSDI    (0x03 << 8)
 #define S3C2410_GPE5_INP       (0x00 << 10)
 #define S3C2410_GPE5_OUTP      (0x01 << 10)
 #define S3C2410_GPE5_SDCLK     (0x02 << 10)
+#define S3C2443_GPE5_SD1_CLK   (0x02 << 10)
 #define S3C2400_GPE5_EINT5     (0x02 << 10)
 #define S3C2400_GPE5_TCLK1     (0x03 << 10)
 
 #define S3C2410_GPE6_INP       (0x00 << 12)
 #define S3C2410_GPE6_OUTP      (0x01 << 12)
 #define S3C2410_GPE6_SDCMD     (0x02 << 12)
+#define S3C2443_GPE6_SD1_CMD   (0x02 << 12)
+#define S3C2443_GPE6_AC_BITCLK (0x03 << 12)
 #define S3C2400_GPE6_EINT6     (0x02 << 12)
 
 #define S3C2410_GPE7           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7)
 #define S3C2410_GPE7_INP       (0x00 << 14)
 #define S3C2410_GPE7_OUTP      (0x01 << 14)
 #define S3C2410_GPE7_SDDAT0    (0x02 << 14)
+#define S3C2443_GPE5_SD1_DAT0  (0x02 << 14)
+#define S3C2443_GPE7_AC_SDI    (0x03 << 14)
 #define S3C2400_GPE7_EINT7     (0x02 << 14)
 
 #define S3C2410_GPE8           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8)
 #define S3C2410_GPE8_INP       (0x00 << 16)
 #define S3C2410_GPE8_OUTP      (0x01 << 16)
 #define S3C2410_GPE8_SDDAT1    (0x02 << 16)
+#define S3C2443_GPE8_SD1_DAT1  (0x02 << 16)
+#define S3C2443_GPE8_AC_SDO    (0x03 << 16)
 #define S3C2400_GPE8_nXDACK0   (0x02 << 16)
 
 #define S3C2410_GPE9           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9)
 #define S3C2410_GPE9_INP       (0x00 << 18)
 #define S3C2410_GPE9_OUTP      (0x01 << 18)
 #define S3C2410_GPE9_SDDAT2    (0x02 << 18)
+#define S3C2443_GPE9_SD1_DAT2  (0x02 << 18)
+#define S3C2443_GPE9_AC_SYNC   (0x03 << 18)
 #define S3C2400_GPE9_nXDACK1   (0x02 << 18)
 #define S3C2400_GPE9_nXBACK    (0x03 << 18)
 
 #define S3C2410_GPE10_INP      (0x00 << 20)
 #define S3C2410_GPE10_OUTP     (0x01 << 20)
 #define S3C2410_GPE10_SDDAT3   (0x02 << 20)
+#define S3C2443_GPE10_SD1_DAT3 (0x02 << 20)
+#define S3C2443_GPE10_AC_nRESET (0x03 << 20)
 #define S3C2400_GPE10_nXDREQ0  (0x02 << 20)
 
 #define S3C2410_GPE11          S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11)
 #define S3C2400_GPG4_MMCCLK   (0x02 << 8)
 #define S3C2400_GPG4_I2SSDI   (0x03 << 8)
 #define S3C2410_GPG4_LCDPWREN (0x03 << 8)
+#define S3C2443_GPG4_LCDPWRDN (0x03 << 8)
 
 #define S3C2410_GPG5          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5)
 #define S3C2410_GPG5_INP      (0x00 << 10)
 #define S3C2410_GPG5_EINT13   (0x02 << 10)
 #define S3C2400_GPG5_MMCCMD   (0x02 << 10)
 #define S3C2400_GPG5_IICSDA   (0x03 << 10)
-#define S3C2410_GPG5_SPIMISO1 (0x03 << 10)
+#define S3C2410_GPG5_SPIMISO1 (0x03 << 10)     /* not s3c2443 */
 
 #define S3C2410_GPG6          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6)
 #define S3C2410_GPG6_INP      (0x00 << 12)
 #define S3C2410_GPG11_OUTP    (0x01 << 22)
 #define S3C2410_GPG11_EINT19  (0x02 << 22)
 #define S3C2410_GPG11_TCLK1   (0x03 << 22)
+#define S3C2443_GPG11_CF_nIREQ (0x03 << 22)
 
 #define S3C2410_GPG12         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 12)
 #define S3C2410_GPG12_INP     (0x00 << 24)
 #define S3C2410_GPG12_EINT20  (0x02 << 24)
 #define S3C2410_GPG12_XMON    (0x03 << 24)
 #define S3C2442_GPG12_nSPICS0 (0x03 << 24)
+#define S3C2443_GPG12_nINPACK (0x03 << 24)
 
 #define S3C2410_GPG13         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 13)
 #define S3C2410_GPG13_INP     (0x00 << 26)
 #define S3C2410_GPG13_OUTP    (0x01 << 26)
 #define S3C2410_GPG13_EINT21  (0x02 << 26)
 #define S3C2410_GPG13_nXPON   (0x03 << 26)
+#define S3C2443_GPG13_CF_nREG (0x03 << 26)
 
 #define S3C2410_GPG14         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 14)
 #define S3C2410_GPG14_INP     (0x00 << 28)
 #define S3C2410_GPG14_OUTP    (0x01 << 28)
 #define S3C2410_GPG14_EINT22  (0x02 << 28)
 #define S3C2410_GPG14_YMON    (0x03 << 28)
+#define S3C2443_GPG14_CF_RESET (0x03 << 28)
 
 #define S3C2410_GPG15         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 15)
 #define S3C2410_GPG15_INP     (0x00 << 30)
 #define S3C2410_GPG15_OUTP    (0x01 << 30)
 #define S3C2410_GPG15_EINT23  (0x02 << 30)
 #define S3C2410_GPG15_nYPON   (0x03 << 30)
-
+#define S3C2443_GPG15_CF_PWR  (0x03 << 30)
 
 #define S3C2410_GPG_PUPDIS(x)  (1<<(x))
 
diff --git a/include/asm-arm/arch-s3c2410/regs-s3c2443-clock.h b/include/asm-arm/arch-s3c2410/regs-s3c2443-clock.h
new file mode 100644 (file)
index 0000000..ff0536d
--- /dev/null
@@ -0,0 +1,194 @@
+/* linux/include/asm-arm/arch-s3c2410/regs-clock.h
+ *
+ * Copyright (c) 2007 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *     http://armlinux.simtec.co.uk/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * S3C2443 clock register definitions
+*/
+
+#ifndef __ASM_ARM_REGS_S3C2443_CLOCK
+#define __ASM_ARM_REGS_S3C2443_CLOCK
+
+#define S3C2443_CLKREG(x)              ((x) + S3C24XX_VA_CLKPWR)
+
+#define S3C2443_PLLCON_MDIVSHIFT       16
+#define S3C2443_PLLCON_PDIVSHIFT       8
+#define S3C2443_PLLCON_SDIVSHIFT       0
+#define S3C2443_PLLCON_MDIVMASK                ((1<<(1+(23-16)))-1)
+#define S3C2443_PLLCON_PDIVMASK                ((1<<(1+(9-8)))-1)
+#define S3C2443_PLLCON_SDIVMASK                (3)
+
+#define S3C2443_MPLLCON                        S3C2443_CLKREG(0x10)
+#define S3C2443_EPLLCON                        S3C2443_CLKREG(0x18)
+#define S3C2443_CLKSRC                 S3C2443_CLKREG(0x20)
+#define S3C2443_CLKDIV0                        S3C2443_CLKREG(0x24)
+#define S3C2443_CLKDIV1                        S3C2443_CLKREG(0x28)
+#define S3C2443_HCLKCON                        S3C2443_CLKREG(0x30)
+#define S3C2443_PCLKCON                        S3C2443_CLKREG(0x34)
+#define S3C2443_SCLKCON                        S3C2443_CLKREG(0x38)
+#define S3C2443_PWRMODE                        S3C2443_CLKREG(0x40)
+#define S3C2443_SWRST                  S3C2443_CLKREG(0x44)
+#define S3C2443_BUSPRI0                        S3C2443_CLKREG(0x50)
+#define S3C2443_SYSID                  S3C2443_CLKREG(0x5C)
+#define S3C2443_PWRCFG                 S3C2443_CLKREG(0x60)
+#define S3C2443_RSTCON                 S3C2443_CLKREG(0x64)
+
+#define S3C2443_SWRST_RESET            (0x533c2443)
+
+#define S3C2443_PLLCON_OFF             (1<<24)
+
+#define S3C2443_CLKSRC_I2S_EXT         (1<<14)
+#define S3C2443_CLKSRC_I2S_EPLLDIV     (0<<14)
+#define S3C2443_CLKSRC_I2S_EPLLREF     (2<<14)
+#define S3C2443_CLKSRC_I2S_EPLLREF3    (3<<14)
+#define S3C2443_CLKSRC_I2S_MASK                (3<<14)
+
+#define S3C2443_CLKSRC_EPLLREF_XTAL    (2<<8)
+#define S3C2443_CLKSRC_EPLLREF_EXTCLK  (3<<8)
+#define S3C2443_CLKSRC_EPLLREF_MPLLREF (0<<8)
+#define S3C2443_CLKSRC_EPLLREF_MPLLREF2        (1<<8)
+#define S3C2443_CLKSRC_EPLLREF_MASK    (3<<8)
+
+#define S3C2443_CLKSRC_ESYSCLK_EPLL    (1<<6)
+#define S3C2443_CLKSRC_MSYSCLK_MPLL    (1<<4)
+#define S3C2443_CLKSRC_EXTCLK_DIV      (1<<3)
+
+#define S3C2443_CLKDIV0_DVS            (1<<13)
+#define S3C2443_CLKDIV0_HALF_HCLK      (1<<3)
+#define S3C2443_CLKDIV0_HALF_PCLK      (1<<2)
+
+#define S3C2443_CLKDIV0_HCLKDIV_MASK   (3<<0)
+
+#define S3C2443_CLKDIV0_EXTDIV_MASK    (3<<6)
+#define S3C2443_CLKDIV0_EXTDIV_SHIFT   (6)
+
+#define S3C2443_CLKDIV0_PREDIV_MASK    (3<<4)
+#define S3C2443_CLKDIV0_PREDIV_SHIFT   (4)
+
+#define S3C2443_CLKDIV0_ARMDIV_MASK    (15<<9)
+#define S3C2443_CLKDIV0_ARMDIV_SHIFT   (9)
+#define S3C2443_CLKDIV0_ARMDIV_1       (0<<9)
+#define S3C2443_CLKDIV0_ARMDIV_2       (8<<9)
+#define S3C2443_CLKDIV0_ARMDIV_3       (2<<9)
+#define S3C2443_CLKDIV0_ARMDIV_4       (9<<9)
+#define S3C2443_CLKDIV0_ARMDIV_6       (10<<9)
+#define S3C2443_CLKDIV0_ARMDIV_8       (11<<9)
+#define S3C2443_CLKDIV0_ARMDIV_12      (13<<9)
+#define S3C2443_CLKDIV0_ARMDIV_16      (15<<9)
+
+/* S3C2443_CLKDIV1 */
+
+#define S3C2443_CLKDIV1_CAMDIV_MASK    (15<<26)
+#define S3C2443_CLKDIV1_CAMDIV_SHIFT   (26)
+
+#define S3C2443_CLKDIV1_HSSPIDIV_MASK  (3<<24)
+#define S3C2443_CLKDIV1_HSSPIDIV_SHIFT (24)
+
+#define S3C2443_CLKDIV1_DISPDIV_MASK   (0xff<<16)
+#define S3C2443_CLKDIV1_DISPDIV_SHIFT  (16)
+
+#define S3C2443_CLKDIV1_I2SDIV_MASK    (15<<12)
+#define S3C2443_CLKDIV1_I2SDIV_SHIFT   (12)
+
+#define S3C2443_CLKDIV1_UARTDIV_MASK   (15<<8)
+#define S3C2443_CLKDIV1_UARTDIV_SHIFT  (8)
+
+#define S3C2443_CLKDIV1_HSMMCDIV_MASK  (3<<6)
+#define S3C2443_CLKDIV1_HSMMCDIV_SHIFT (6)
+
+#define S3C2443_CLKDIV1_USBHOSTDIV_MASK        (3<<4)
+#define S3C2443_CLKDIV1_USBHOSTDIV_SHIFT (4)
+
+#define S3C2443_CLKCON_NAND
+
+#define S3C2443_HCLKCON_DMA0           (1<<0)
+#define S3C2443_HCLKCON_DMA1           (1<<1)
+#define S3C2443_HCLKCON_DMA2           (1<<2)
+#define S3C2443_HCLKCON_DMA3           (1<<3)
+#define S3C2443_HCLKCON_DMA4           (1<<4)
+#define S3C2443_HCLKCON_DMA5           (1<<5)
+#define S3C2443_HCLKCON_CAMIF          (1<<8)
+#define S3C2443_HCLKCON_DISP           (1<<9)
+#define S3C2443_HCLKCON_LCDC           (1<<10)
+#define S3C2443_HCLKCON_USBH           (1<<11)
+#define S3C2443_HCLKCON_USBD           (1<<12)
+#define S3C2443_HCLKCON_HSMMC          (1<<16)
+#define S3C2443_HCLKCON_CFC            (1<<17)
+#define S3C2443_HCLKCON_SSMC           (1<<18)
+#define S3C2443_HCLKCON_DRAMC          (1<<19)
+
+#define S3C2443_PCLKCON_UART0          (1<<0)
+#define S3C2443_PCLKCON_UART1          (1<<1)
+#define S3C2443_PCLKCON_UART2          (1<<2)
+#define S3C2443_PCLKCON_UART3          (1<<3)
+#define S3C2443_PCLKCON_IIC            (1<<4)
+#define S3C2443_PCLKCON_SDI            (1<<5)
+#define S3C2443_PCLKCON_ADC            (1<<7)
+#define S3C2443_PCLKCON_IIS            (1<<9)
+#define S3C2443_PCLKCON_PWMT           (1<<10)
+#define S3C2443_PCLKCON_WDT            (1<<11)
+#define S3C2443_PCLKCON_RTC            (1<<12)
+#define S3C2443_PCLKCON_GPIO           (1<<13)
+#define S3C2443_PCLKCON_SPI0           (1<<14)
+#define S3C2443_PCLKCON_SPI1           (1<<15)
+
+#define S3C2443_SCLKCON_DDRCLK         (1<<16)
+#define S3C2443_SCLKCON_SSMCCLK                (1<<15)
+#define S3C2443_SCLKCON_HSSPICLK       (1<<14)
+#define S3C2443_SCLKCON_HSMMCCLK_EXT   (1<<13)
+#define S3C2443_SCLKCON_HSMMCCLK_EPLL  (1<<12)
+#define S3C2443_SCLKCON_CAMCLK         (1<<11)
+#define S3C2443_SCLKCON_DISPCLK                (1<<10)
+#define S3C2443_SCLKCON_I2SCLK         (1<<9)
+#define S3C2443_SCLKCON_UARTCLK                (1<<8)
+#define S3C2443_SCLKCON_USBHOST                (1<<1)
+
+#include <asm/div64.h>
+
+static inline unsigned int
+s3c2443_get_mpll(unsigned int pllval, unsigned int baseclk)
+{
+       unsigned int mdiv, pdiv, sdiv;
+       uint64_t fvco;
+
+       mdiv = pllval >> S3C2443_PLLCON_MDIVSHIFT;
+       pdiv = pllval >> S3C2443_PLLCON_PDIVSHIFT;
+       sdiv = pllval >> S3C2443_PLLCON_SDIVSHIFT;
+
+       mdiv &= S3C2443_PLLCON_MDIVMASK;
+       pdiv &= S3C2443_PLLCON_PDIVMASK;
+       sdiv &= S3C2443_PLLCON_SDIVMASK;
+
+       fvco = (uint64_t)baseclk * (2 * (mdiv + 8));
+       do_div(fvco, pdiv << sdiv);
+
+       return (unsigned int)fvco;
+}
+
+static inline unsigned int
+s3c2443_get_epll(unsigned int pllval, unsigned int baseclk)
+{
+       unsigned int mdiv, pdiv, sdiv;
+       uint64_t fvco;
+
+       mdiv = pllval >> S3C2443_PLLCON_MDIVSHIFT;
+       pdiv = pllval >> S3C2443_PLLCON_PDIVSHIFT;
+       sdiv = pllval >> S3C2443_PLLCON_SDIVSHIFT;
+
+       mdiv &= S3C2443_PLLCON_MDIVMASK;
+       pdiv &= S3C2443_PLLCON_PDIVMASK;
+       sdiv &= S3C2443_PLLCON_SDIVMASK;
+
+       fvco = (uint64_t)baseclk * (mdiv + 8);
+       do_div(fvco, (pdiv + 2) << sdiv);
+
+       return (unsigned int)fvco;
+}
+
+#endif /*  __ASM_ARM_REGS_S3C2443_CLOCK */
+
index 46f52401d132f9e2baacd635d12bd475e4a51701..8946702a87f506f7f3c7066fa18b049a69e991c9 100644 (file)
 #define S3C24XX_VA_UART0      (S3C24XX_VA_UART)
 #define S3C24XX_VA_UART1      (S3C24XX_VA_UART + 0x4000 )
 #define S3C24XX_VA_UART2      (S3C24XX_VA_UART + 0x8000 )
+#define S3C24XX_VA_UART3      (S3C24XX_VA_UART + 0xC000 )
 
 #define S3C2410_PA_UART0      (S3C24XX_PA_UART)
 #define S3C2410_PA_UART1      (S3C24XX_PA_UART + 0x4000 )
 #define S3C2410_PA_UART2      (S3C24XX_PA_UART + 0x8000 )
+#define S3C2443_PA_UART3      (S3C24XX_PA_UART + 0xC000 )
 
 #define S3C2410_URXH     (0x24)
 #define S3C2410_UTXH     (0x20)
@@ -73,6 +75,8 @@
 #define S3C2440_UCON_UCLK        (1<<10)
 #define S3C2440_UCON_PCLK2       (2<<10)
 #define S3C2440_UCON_FCLK        (3<<10)
+#define S3C2443_UCON_EPLL        (3<<10)
+
 #define S3C2440_UCON2_FCLK_EN    (1<<15)
 #define S3C2440_UCON0_DIVMASK    (15 << 12)
 #define S3C2440_UCON1_DIVMASK    (15 << 12)
@@ -93,6 +97,8 @@
 #define S3C2410_UCON_TXIRQMODE   (1<<2)
 #define S3C2410_UCON_RXIRQMODE   (1<<0)
 #define S3C2410_UCON_RXFIFO_TOI          (1<<7)
+#define S3C2443_UCON_RXERR_IRQEN  (1<<6)
+#define S3C2443_UCON_LOOPBACK    (1<<5)
 
 #define S3C2410_UCON_DEFAULT     (S3C2410_UCON_TXILEVEL  | \
                                   S3C2410_UCON_RXILEVEL  | \
 #define        S3C2410_UMCOM_AFC         (1<<4)
 #define        S3C2410_UMCOM_RTS_LOW     (1<<0)
 
-#define S3C2412_UMCON_AFC_63   (0<<5)
+#define S3C2412_UMCON_AFC_63   (0<<5)          /* same as s3c2443 */
 #define S3C2412_UMCON_AFC_56   (1<<5)
 #define S3C2412_UMCON_AFC_48   (2<<5)
 #define S3C2412_UMCON_AFC_40   (3<<5)
 #define S3C2410_UFSTAT_RXMASK    (15<<0)
 #define S3C2410_UFSTAT_RXSHIFT   (0)
 
+/* UFSTAT S3C2443 same as S3C2440 */
 #define S3C2440_UFSTAT_TXFULL    (1<<14)
 #define S3C2440_UFSTAT_RXFULL    (1<<6)
 #define S3C2440_UFSTAT_TXSHIFT   (8)
 #define S3C2410_UERSTAT_OVERRUN          (1<<0)
 #define S3C2410_UERSTAT_FRAME    (1<<2)
 #define S3C2410_UERSTAT_BREAK    (1<<3)
+#define S3C2443_UERSTAT_PARITY   (1<<1)
+
 #define S3C2410_UERSTAT_ANY      (S3C2410_UERSTAT_OVERRUN | \
                                   S3C2410_UERSTAT_FRAME | \
                                   S3C2410_UERSTAT_BREAK)
 #define S3C2410_UMSTAT_CTS       (1<<0)
 #define S3C2410_UMSTAT_DeltaCTS          (1<<2)
 
+#define S3C2443_DIVSLOT                  (0x2C)
+
 #ifndef __ASSEMBLY__
 
 /* struct s3c24xx_uart_clksrc
diff --git a/include/asm-arm/arch-s3c2410/reset.h b/include/asm-arm/arch-s3c2410/reset.h
new file mode 100644 (file)
index 0000000..4f866cd
--- /dev/null
@@ -0,0 +1,22 @@
+/* linux/include/asm-arm/arch-s3c2410/reset.h
+ *
+ * Copyright (c) 2007 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *     http://armlinux.simtec.co.uk/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * S3C2410 CPU reset controls
+*/
+
+#ifndef __ASM_ARCH_RESET_H
+#define __ASM_ARCH_RESET_H __FILE__
+
+/* This allows the over-ride of the default reset code
+*/
+
+extern void (*s3c24xx_reset_hook)(void);
+
+#endif /* __ASM_ARCH_RESET_H */
index ecf250db45fbc613dd892f1595e39850a2c898e0..1c74ef17da3363eda55e8dcf8fee51c84d502148 100644 (file)
 
 #include <asm/arch/map.h>
 #include <asm/arch/idle.h>
+#include <asm/arch/reset.h>
 
 #include <asm/arch/regs-watchdog.h>
 #include <asm/arch/regs-clock.h>
 
 void (*s3c24xx_idle)(void);
+void (*s3c24xx_reset_hook)(void);
 
 void s3c24xx_default_idle(void)
 {
-       void __iomem *reg = S3C2410_CLKCON;
        unsigned long tmp;
        int i;
 
@@ -33,16 +34,18 @@ void s3c24xx_default_idle(void)
 
        /* Warning: going into idle state upsets jtag scanning */
 
-       __raw_writel(__raw_readl(reg) | (1<<2), reg);
+       __raw_writel(__raw_readl(S3C2410_CLKCON) | S3C2410_CLKCON_IDLE,
+                    S3C2410_CLKCON);
 
        /* the samsung port seems to do a loop and then unset idle.. */
        for (i = 0; i < 50; i++) {
-               tmp += __raw_readl(reg); /* ensure loop not optimised out */
+               tmp += __raw_readl(S3C2410_CLKCON); /* ensure loop not optimised out */
        }
 
        /* this bit is not cleared on re-start... */
 
-       __raw_writel(__raw_readl(reg) & ~(1<<2), reg);
+       __raw_writel(__raw_readl(S3C2410_CLKCON) & ~S3C2410_CLKCON_IDLE,
+                    S3C2410_CLKCON);
 }
 
 static void arch_idle(void)
@@ -53,7 +56,6 @@ static void arch_idle(void)
                s3c24xx_default_idle();
 }
 
-
 static void
 arch_reset(char mode)
 {
@@ -61,6 +63,9 @@ arch_reset(char mode)
                cpu_reset(0);
        }
 
+       if (s3c24xx_reset_hook)
+               s3c24xx_reset_hook();
+
        printk("arch_reset: attempting watchdog reset\n");
 
        __raw_writel(0, S3C2410_WTCON);   /* disable watchdog, to be safe  */
diff --git a/include/asm-arm/arch-s3c2410/udc.h b/include/asm-arm/arch-s3c2410/udc.h
new file mode 100644 (file)
index 0000000..e59ec33
--- /dev/null
@@ -0,0 +1,36 @@
+/* linux/include/asm/arch-s3c2410/udc.h
+ *
+ * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *
+ *  Changelog:
+ *     14-Mar-2005     RTP     Created file
+ *     02-Aug-2005     RTP     File rename
+ *     07-Sep-2005     BJD     Minor cleanups, changed cmd to enum
+ *     18-Jan-2007     HMW     Add per-platform vbus_draw function
+*/
+
+#ifndef __ASM_ARM_ARCH_UDC_H
+#define __ASM_ARM_ARCH_UDC_H
+
+enum s3c2410_udc_cmd_e {
+       S3C2410_UDC_P_ENABLE    = 1,    /* Pull-up enable        */
+       S3C2410_UDC_P_DISABLE   = 2,    /* Pull-up disable       */
+       S3C2410_UDC_P_RESET     = 3,    /* UDC reset, in case of */
+};
+
+struct s3c2410_udc_mach_info {
+       void    (*udc_command)(enum s3c2410_udc_cmd_e);
+       void    (*vbus_draw)(unsigned int ma);
+       unsigned int vbus_pin;
+       unsigned char vbus_pin_inverted;
+};
+
+extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *);
+
+#endif /* __ASM_ARM_ARCH_UDC_H */
index 5f531ea03059d003bab3e86643ed2580a36133cf..afad32c76e6c964df908c6493441139ccb328977 100644 (file)
@@ -185,9 +185,15 @@ struct cpu_cache_fns {
        void (*coherent_user_range)(unsigned long, unsigned long);
        void (*flush_kern_dcache_page)(void *);
 
-       void (*dma_inv_range)(unsigned long, unsigned long);
-       void (*dma_clean_range)(unsigned long, unsigned long);
-       void (*dma_flush_range)(unsigned long, unsigned long);
+       void (*dma_inv_range)(const void *, const void *);
+       void (*dma_clean_range)(const void *, const void *);
+       void (*dma_flush_range)(const void *, const void *);
+};
+
+struct outer_cache_fns {
+       void (*inv_range)(unsigned long, unsigned long);
+       void (*clean_range)(unsigned long, unsigned long);
+       void (*flush_range)(unsigned long, unsigned long);
 };
 
 /*
@@ -240,9 +246,40 @@ extern void __cpuc_flush_dcache_page(void *);
 #define dmac_clean_range               __glue(_CACHE,_dma_clean_range)
 #define dmac_flush_range               __glue(_CACHE,_dma_flush_range)
 
-extern void dmac_inv_range(unsigned long, unsigned long);
-extern void dmac_clean_range(unsigned long, unsigned long);
-extern void dmac_flush_range(unsigned long, unsigned long);
+extern void dmac_inv_range(const void *, const void *);
+extern void dmac_clean_range(const void *, const void *);
+extern void dmac_flush_range(const void *, const void *);
+
+#endif
+
+#ifdef CONFIG_OUTER_CACHE
+
+extern struct outer_cache_fns outer_cache;
+
+static inline void outer_inv_range(unsigned long start, unsigned long end)
+{
+       if (outer_cache.inv_range)
+               outer_cache.inv_range(start, end);
+}
+static inline void outer_clean_range(unsigned long start, unsigned long end)
+{
+       if (outer_cache.clean_range)
+               outer_cache.clean_range(start, end);
+}
+static inline void outer_flush_range(unsigned long start, unsigned long end)
+{
+       if (outer_cache.flush_range)
+               outer_cache.flush_range(start, end);
+}
+
+#else
+
+static inline void outer_inv_range(unsigned long start, unsigned long end)
+{ }
+static inline void outer_clean_range(unsigned long start, unsigned long end)
+{ }
+static inline void outer_flush_range(unsigned long start, unsigned long end)
+{ }
 
 #endif
 
index 8c0bb5bb14ee610df1db55f28714fa18aced21db..eaa0efd8d0d47e39ce6b5087a9eb60d1bc61811b 100644 (file)
@@ -39,6 +39,19 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
 __wsum
 csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr);
 
+/*
+ *     Fold a partial checksum without adding pseudo headers
+ */
+static inline __sum16 csum_fold(__wsum sum)
+{
+       __asm__(
+       "add    %0, %1, %1, ror #16     @ csum_fold"
+       : "=r" (sum)
+       : "r" (sum)
+       : "cc");
+       return (__force __sum16)(~(__force u32)sum >> 16);
+}
+
 /*
  *     This is a version of ip_compute_csum() optimized for IP headers,
  *     which always checksum on 4 octet boundaries.
@@ -46,7 +59,8 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum s
 static inline __sum16
 ip_fast_csum(const void *iph, unsigned int ihl)
 {
-       unsigned int sum, tmp1;
+       unsigned int tmp1;
+       __wsum sum;
 
        __asm__ __volatile__(
        "ldr    %0, [%1], #4            @ ip_fast_csum          \n\
@@ -62,29 +76,11 @@ ip_fast_csum(const void *iph, unsigned int ihl)
        subne   %2, %2, #1              @ without destroying    \n\
        bne     1b                      @ the carry flag        \n\
        adcs    %0, %0, %3                                      \n\
-       adc     %0, %0, #0                                      \n\
-       adds    %0, %0, %0, lsl #16                             \n\
-       addcs   %0, %0, #0x10000                                \n\
-       mvn     %0, %0                                          \n\
-       mov     %0, %0, lsr #16"
+       adc     %0, %0, #0"
        : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
        : "1" (iph), "2" (ihl)
        : "cc", "memory");
-       return (__force __sum16)sum;
-}
-
-/*
- *     Fold a partial checksum without adding pseudo headers
- */
-static inline __sum16 csum_fold(__wsum sum)
-{
-       __asm__(
-       "adds   %0, %1, %1, lsl #16     @ csum_fold             \n\
-       addcs   %0, %0, #0x10000"
-       : "=r" (sum)
-       : "r" (sum)
-       : "cc");
-       return (__force __sum16)(~(__force u32)sum >> 16);
+       return csum_fold(sum);
 }
 
 static inline __wsum
@@ -114,23 +110,7 @@ static inline __sum16
 csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
                  unsigned short proto, __wsum sum)
 {
-       __asm__(
-       "adds   %0, %1, %2              @ csum_tcpudp_magic     \n\
-       adcs    %0, %0, %3                                      \n"
-#ifdef __ARMEB__
-       "adcs   %0, %0, %4                                      \n"
-#else
-       "adcs   %0, %0, %4, lsl #8                              \n"
-#endif
-       "adcs   %0, %0, %5                                      \n\
-       adc     %0, %0, #0                                      \n\
-       adds    %0, %0, %0, lsl #16                             \n\
-       addcs   %0, %0, #0x10000                                \n\
-       mvn     %0, %0"
-       : "=&r"(sum)
-       : "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto))
-       : "cc");
-       return (__force __sum16)((__force u32)sum >> 16);
+       return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
 }
 
 
index d8f9872b0e2dc3587a9e658adc957f093b7906fb..c61642b406033659db06494a75fcb4c8d8914477 100644 (file)
@@ -3,5 +3,13 @@
  *
  * This file is released under the GPLv2
  */
-#include <asm-generic/device.h>
+#ifndef ASMARM_DEVICE_H
+#define ASMARM_DEVICE_H
 
+struct dev_archdata {
+#ifdef CONFIG_DMABOUNCE
+       struct dmabounce_device_info *dmabounce;
+#endif
+};
+
+#endif
index 9bc46b486afba7a5970e93b5c938a3be33c4684e..abfb75b654c7df7f8795b1f0db4ea4aa173fd0e8 100644 (file)
@@ -17,7 +17,7 @@
  * platforms with CONFIG_DMABOUNCE.
  * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
  */
-extern void consistent_sync(void *kaddr, size_t size, int rw);
+extern void consistent_sync(const void *kaddr, size_t size, int rw);
 
 /*
  * Return whether the given device DMA address mask can be supported
@@ -61,6 +61,22 @@ static inline int dma_mapping_error(dma_addr_t dma_addr)
        return dma_addr == ~0;
 }
 
+/*
+ * Dummy noncoherent implementation.  We don't provide a dma_cache_sync
+ * function so drivers using this API are highlighted with build warnings.
+ */
+static inline void *
+dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
+{
+       return NULL;
+}
+
+static inline void
+dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr,
+                    dma_addr_t handle)
+{
+}
+
 /**
  * dma_alloc_coherent - allocate consistent memory for DMA
  * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
index 4c2885abbe6c950f04d06c6345bb6358f591421b..3c12a7625304d24d19bcb9e469c5b5bbcca8faef 100644 (file)
@@ -57,6 +57,7 @@
        __asm__ __volatile__(                           \
        "mcr    p15, 0, %0, c3, c0      @ set domain"   \
          : : "r" (x));                                 \
+       isb();                                          \
        } while (0)
 
 #define modify_domain(dom,type)                                        \
index 9903f60c84b713fdde431f61e33c87ba8f683be4..7d28eb5a17587ed0b4dbc3219d75e50fd52c5a4f 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef ASMARM_HARDWARE_ARM_SCU_H
 #define ASMARM_HARDWARE_ARM_SCU_H
 
+#include <asm/arch/scu.h>
+
 /*
  * SCU registers
  */
diff --git a/include/asm-arm/hardware/cache-l2x0.h b/include/asm-arm/hardware/cache-l2x0.h
new file mode 100644 (file)
index 0000000..54029a7
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * include/asm-arm/hardware/cache-l2x0.h
+ *
+ * Copyright (C) 2007 ARM Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARM_HARDWARE_L2X0_H
+#define __ASM_ARM_HARDWARE_L2X0_H
+
+#define L2X0_CACHE_ID                  0x000
+#define L2X0_CACHE_TYPE                        0x004
+#define L2X0_CTRL                      0x100
+#define L2X0_AUX_CTRL                  0x104
+#define L2X0_EVENT_CNT_CTRL            0x200
+#define L2X0_EVENT_CNT1_CFG            0x204
+#define L2X0_EVENT_CNT0_CFG            0x208
+#define L2X0_EVENT_CNT1_VAL            0x20C
+#define L2X0_EVENT_CNT0_VAL            0x210
+#define L2X0_INTR_MASK                 0x214
+#define L2X0_MASKED_INTR_STAT          0x218
+#define L2X0_RAW_INTR_STAT             0x21C
+#define L2X0_INTR_CLEAR                        0x220
+#define L2X0_CACHE_SYNC                        0x730
+#define L2X0_INV_LINE_PA               0x770
+#define L2X0_INV_WAY                   0x77C
+#define L2X0_CLEAN_LINE_PA             0x7B0
+#define L2X0_CLEAN_LINE_IDX            0x7B8
+#define L2X0_CLEAN_WAY                 0x7BC
+#define L2X0_CLEAN_INV_LINE_PA         0x7F0
+#define L2X0_CLEAN_INV_LINE_IDX                0x7F8
+#define L2X0_CLEAN_INV_WAY             0x7FC
+#define L2X0_LOCKDOWN_WAY_D            0x900
+#define L2X0_LOCKDOWN_WAY_I            0x904
+#define L2X0_TEST_OPERATION            0xF00
+#define L2X0_LINE_DATA                 0xF10
+#define L2X0_LINE_TAG                  0xF30
+#define L2X0_DEBUG_CTRL                        0xF40
+
+#ifndef __ASSEMBLY__
+extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask);
+#endif
+
+#endif
index 3fa5eb70f64ed7926f0a41584a338e9279045289..966e428ad32c858aec9870a9cb72491effa7b3f3 100644 (file)
@@ -33,8 +33,9 @@
 #define GIC_DIST_SOFTINT               0xf00
 
 #ifndef __ASSEMBLY__
-void gic_dist_init(void __iomem *base);
-void gic_cpu_init(void __iomem *base);
+void gic_dist_init(unsigned int gic_nr, void __iomem *base, unsigned int irq_start);
+void gic_cpu_init(unsigned int gic_nr, void __iomem *base);
+void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
 void gic_raise_softirq(cpumask_t cpumask, unsigned int irq);
 #endif
 
index 13ac8a4cd01f6ba7fc070d88a6aa9023ac442f4f..c91b546e20ef8040419fbd86cb9170192581d915 100644 (file)
@@ -37,6 +37,13 @@ extern void gpio_line_set(int line, int value);
 #define IOP3XX_PERIPHERAL_PHYS_BASE    0xffffe000
 #define IOP3XX_PERIPHERAL_VIRT_BASE    0xfeffe000
 #define IOP3XX_PERIPHERAL_SIZE         0x00002000
+#define IOP3XX_PERIPHERAL_UPPER_PA (IOP3XX_PERIPHERAL_PHYS_BASE +\
+                                       IOP3XX_PERIPHERAL_SIZE - 1)
+#define IOP3XX_PERIPHERAL_UPPER_VA (IOP3XX_PERIPHERAL_VIRT_BASE +\
+                                       IOP3XX_PERIPHERAL_SIZE - 1)
+#define IOP3XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
+                                       (IOP3XX_PERIPHERAL_PHYS_BASE\
+                                       - IOP3XX_PERIPHERAL_VIRT_BASE))
 #define IOP3XX_REG_ADDR(reg)           (IOP3XX_PERIPHERAL_VIRT_BASE + (reg))
 
 /* Address Translation Unit  */
@@ -258,12 +265,20 @@ extern void gpio_line_set(int line, int value);
 #define IOP3XX_PCI_LOWER_IO_PA         0x90000000
 #define IOP3XX_PCI_LOWER_IO_VA         0xfe000000
 #define IOP3XX_PCI_LOWER_IO_BA         (*IOP3XX_OIOWTVR)
+#define IOP3XX_PCI_UPPER_IO_PA         (IOP3XX_PCI_LOWER_IO_PA +\
+                                       IOP3XX_PCI_IO_WINDOW_SIZE - 1)
+#define IOP3XX_PCI_UPPER_IO_VA         (IOP3XX_PCI_LOWER_IO_VA +\
+                                       IOP3XX_PCI_IO_WINDOW_SIZE - 1)
+#define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) addr -\
+                                       IOP3XX_PCI_LOWER_IO_PA) +\
+                                       IOP3XX_PCI_LOWER_IO_VA)
 
 
 #ifndef __ASSEMBLY__
 void iop3xx_map_io(void);
 void iop3xx_init_time(unsigned long);
 unsigned long iop3xx_gettimeoffset(void);
+void iop_init_cp6_handler(void);
 
 extern struct platform_device iop3xx_i2c0_device;
 extern struct platform_device iop3xx_i2c1_device;
index 6aa0a5b75b69dc9bc5f72266f8df5763f9c561eb..61b1d05c7df74772f95cd581cd06c05ee81cbdf8 100644 (file)
@@ -29,6 +29,9 @@
 #define _SA1111(x)     ((x) + sa1111->resource.start)
 #endif
 
+#define sa1111_writel(val,addr)        __raw_writel(val, addr)
+#define sa1111_readl(addr)     __raw_readl(addr)
+
 /*
  * 26 bits of the SA-1110 address bus are available to the SA-1111.
  * Use these when feeding target addresses to the DMA engines.
 
 #define SA1111_SAC_DMA_MIN_XFER        (0x800)
 
-/*
- * SA1111 register definitions.
- */
-#define __CCREG(x)     __REGP(SA1111_VBASE + (x))
-
-#define sa1111_writel(val,addr)        __raw_writel(val, addr)
-#define sa1111_readl(addr)     __raw_readl(addr)
-
 /*
  * System Bus Interface (SBI)
  *
  *    SADR              Serial Audio Data Register (16 x 32-bit)
  */
 
-#define _SACR0          _SA1111( 0x0600 )
-#define _SACR1          _SA1111( 0x0604 )
-#define _SACR2          _SA1111( 0x0608 )
-#define _SASR0          _SA1111( 0x060c )
-#define _SASR1          _SA1111( 0x0610 )
-#define _SASCR          _SA1111( 0x0618 )
-#define _L3_CAR         _SA1111( 0x061c )
-#define _L3_CDR         _SA1111( 0x0620 )
-#define _ACCAR          _SA1111( 0x0624 )
-#define _ACCDR          _SA1111( 0x0628 )
-#define _ACSAR          _SA1111( 0x062c )
-#define _ACSDR          _SA1111( 0x0630 )
-#define _SADTCS         _SA1111( 0x0634 )
-#define _SADTSA         _SA1111( 0x0638 )
-#define _SADTCA         _SA1111( 0x063c )
-#define _SADTSB         _SA1111( 0x0640 )
-#define _SADTCB         _SA1111( 0x0644 )
-#define _SADRCS         _SA1111( 0x0648 )
-#define _SADRSA         _SA1111( 0x064c )
-#define _SADRCA         _SA1111( 0x0650 )
-#define _SADRSB         _SA1111( 0x0654 )
-#define _SADRCB         _SA1111( 0x0658 )
-#define _SAITR          _SA1111( 0x065c )
-#define _SADR           _SA1111( 0x0680 )
-
-#define SACR0          __CCREG(0x0600)
-#define SACR1          __CCREG(0x0604)
-#define SACR2          __CCREG(0x0608)
-#define SASR0          __CCREG(0x060c)
-#define SASR1          __CCREG(0x0610)
-#define SASCR          __CCREG(0x0618)
-#define L3_CAR         __CCREG(0x061c)
-#define L3_CDR         __CCREG(0x0620)
-#define ACCAR          __CCREG(0x0624)
-#define ACCDR          __CCREG(0x0628)
-#define ACSAR          __CCREG(0x062c)
-#define ACSDR          __CCREG(0x0630)
-#define SADTCS         __CCREG(0x0634)
-#define SADTSA         __CCREG(0x0638)
-#define SADTCA         __CCREG(0x063c)
-#define SADTSB         __CCREG(0x0640)
-#define SADTCB         __CCREG(0x0644)
-#define SADRCS         __CCREG(0x0648)
-#define SADRSA         __CCREG(0x064c)
-#define SADRCA         __CCREG(0x0650)
-#define SADRSB         __CCREG(0x0654)
-#define SADRCB         __CCREG(0x0658)
-#define SAITR          __CCREG(0x065c)
-#define SADR           __CCREG(0x0680)
+#define SA1111_SERAUDIO                0x0600
+
+/*
+ * These are offsets from the above base.
+ */
+#define SA1111_SACR0           0x00
+#define SA1111_SACR1           0x04
+#define SA1111_SACR2           0x08
+#define SA1111_SASR0           0x0c
+#define SA1111_SASR1           0x10
+#define SA1111_SASCR           0x18
+#define SA1111_L3_CAR          0x1c
+#define SA1111_L3_CDR          0x20
+#define SA1111_ACCAR           0x24
+#define SA1111_ACCDR           0x28
+#define SA1111_ACSAR           0x2c
+#define SA1111_ACSDR           0x30
+#define SA1111_SADTCS          0x34
+#define SA1111_SADTSA          0x38
+#define SA1111_SADTCA          0x3c
+#define SA1111_SADTSB          0x40
+#define SA1111_SADTCB          0x44
+#define SA1111_SADRCS          0x48
+#define SA1111_SADRSA          0x4c
+#define SA1111_SADRCA          0x50
+#define SA1111_SADRSB          0x54
+#define SA1111_SADRCB          0x58
+#define SA1111_SAITR           0x5c
+#define SA1111_SADR            0x80
+
+#ifndef CONFIG_ARCH_PXA
 
 #define SACR0_ENB      (1<<0)
 #define SACR0_BCKD     (1<<2)
 #define SAITR_RDBDA    (1<<10)
 #define SAITR_RDBDB    (1<<11)
 
+#endif  /* !CONFIG_ARCH_PXA */
+
 /*
  * General-Purpose I/O Interface
  *
diff --git a/include/asm-arm/kexec.h b/include/asm-arm/kexec.h
new file mode 100644 (file)
index 0000000..8c1c616
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef _ARM_KEXEC_H
+#define _ARM_KEXEC_H
+
+#ifdef CONFIG_KEXEC
+
+/* Maximum physical address we can use pages from */
+#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
+/* Maximum address we can reach in physical address mode */
+#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
+/* Maximum address we can use for the control code buffer */
+#define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
+
+#define KEXEC_CONTROL_CODE_SIZE        4096
+
+#define KEXEC_ARCH KEXEC_ARCH_ARM
+
+#ifndef __ASSEMBLY__
+
+#define MAX_NOTE_BYTES 1024
+
+struct kimage;
+/* Provide a dummy definition to avoid build failures. */
+static inline void crash_setup_regs(struct pt_regs *newregs,
+                                        struct pt_regs *oldregs) { }
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* CONFIG_KEXEC */
+
+#endif /* _ARM_KEXEC_H */
index b8cf2d5ec3041c7e3c5ff32a46078bca6b10e4aa..7b2bafce21a254924cdedcd17dfaf4e0e721e7f9 100644 (file)
@@ -175,19 +175,29 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
 #ifndef __ASSEMBLY__
 
 /*
- * The following macros handle the cache and bufferable bits...
+ * The pgprot_* and protection_map entries will be fixed up in runtime
+ * to include the cachable and bufferable bits based on memory policy,
+ * as well as any architecture dependent bits like global/ASID and SMP
+ * shared mapping bits.
  */
 #define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_CACHEABLE | L_PTE_BUFFERABLE
 #define _L_PTE_READ    L_PTE_USER | L_PTE_EXEC
 
+extern pgprot_t                pgprot_user;
 extern pgprot_t                pgprot_kernel;
 
-#define PAGE_NONE       __pgprot(_L_PTE_DEFAULT)
-#define PAGE_COPY       __pgprot(_L_PTE_DEFAULT | _L_PTE_READ)
-#define PAGE_SHARED     __pgprot(_L_PTE_DEFAULT | _L_PTE_READ | L_PTE_WRITE)
-#define PAGE_READONLY   __pgprot(_L_PTE_DEFAULT | _L_PTE_READ)
+#define PAGE_NONE      pgprot_user
+#define PAGE_COPY      __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ)
+#define PAGE_SHARED    __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ | \
+                                L_PTE_WRITE)
+#define PAGE_READONLY  __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ)
 #define PAGE_KERNEL    pgprot_kernel
 
+#define __PAGE_NONE    __pgprot(_L_PTE_DEFAULT)
+#define __PAGE_COPY    __pgprot(_L_PTE_DEFAULT | _L_PTE_READ)
+#define __PAGE_SHARED  __pgprot(_L_PTE_DEFAULT | _L_PTE_READ | L_PTE_WRITE)
+#define __PAGE_READONLY        __pgprot(_L_PTE_DEFAULT | _L_PTE_READ)
+
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -198,23 +208,23 @@ extern pgprot_t           pgprot_kernel;
  *  2) If we could do execute protection, then read is implied
  *  3) write implies read permissions
  */
-#define __P000  PAGE_NONE
-#define __P001  PAGE_READONLY
-#define __P010  PAGE_COPY
-#define __P011  PAGE_COPY
-#define __P100  PAGE_READONLY
-#define __P101  PAGE_READONLY
-#define __P110  PAGE_COPY
-#define __P111  PAGE_COPY
-
-#define __S000  PAGE_NONE
-#define __S001  PAGE_READONLY
-#define __S010  PAGE_SHARED
-#define __S011  PAGE_SHARED
-#define __S100  PAGE_READONLY
-#define __S101  PAGE_READONLY
-#define __S110  PAGE_SHARED
-#define __S111  PAGE_SHARED
+#define __P000  __PAGE_NONE
+#define __P001  __PAGE_READONLY
+#define __P010  __PAGE_COPY
+#define __P011  __PAGE_COPY
+#define __P100  __PAGE_READONLY
+#define __P101  __PAGE_READONLY
+#define __P110  __PAGE_COPY
+#define __P111  __PAGE_COPY
+
+#define __S000  __PAGE_NONE
+#define __S001  __PAGE_READONLY
+#define __S010  __PAGE_SHARED
+#define __S011  __PAGE_SHARED
+#define __S100  __PAGE_READONLY
+#define __S101  __PAGE_READONLY
+#define __S110  __PAGE_SHARED
+#define __S111  __PAGE_SHARED
 
 #ifndef __ASSEMBLY__
 /*
diff --git a/include/asm-arm/plat-s3c24xx/clock.h b/include/asm-arm/plat-s3c24xx/clock.h
new file mode 100644 (file)
index 0000000..f6135db
--- /dev/null
@@ -0,0 +1,63 @@
+/* linux/include/asm-arm/plat-s3c24xx/clock.h
+ * linux/arch/arm/mach-s3c2410/clock.h
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     http://www.simtec.co.uk/products/SWLINUX/
+ *     Written by Ben Dooks, <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+struct clk {
+       struct list_head      list;
+       struct module        *owner;
+       struct clk           *parent;
+       const char           *name;
+       int                   id;
+       int                   usage;
+       unsigned long         rate;
+       unsigned long         ctrlbit;
+
+       int                 (*enable)(struct clk *, int enable);
+       int                 (*set_rate)(struct clk *c, unsigned long rate);
+       unsigned long       (*get_rate)(struct clk *c);
+       unsigned long       (*round_rate)(struct clk *c, unsigned long rate);
+       int                 (*set_parent)(struct clk *c, struct clk *parent);
+};
+
+/* other clocks which may be registered by board support */
+
+extern struct clk s3c24xx_dclk0;
+extern struct clk s3c24xx_dclk1;
+extern struct clk s3c24xx_clkout0;
+extern struct clk s3c24xx_clkout1;
+extern struct clk s3c24xx_uclk;
+
+extern struct clk clk_usb_bus;
+
+/* core clock support */
+
+extern struct clk clk_f;
+extern struct clk clk_h;
+extern struct clk clk_p;
+extern struct clk clk_mpll;
+extern struct clk clk_upll;
+extern struct clk clk_xtal;
+
+/* exports for arch/arm/mach-s3c2410
+ *
+ * Please DO NOT use these outside of arch/arm/mach-s3c2410
+*/
+
+extern struct mutex clocks_mutex;
+
+extern int s3c2410_clkcon_enable(struct clk *clk, int enable);
+
+extern int s3c24xx_register_clock(struct clk *clk);
+
+extern int s3c24xx_setup_clocks(unsigned long xtal,
+                               unsigned long fclk,
+                               unsigned long hclk,
+                               unsigned long pclk);
diff --git a/include/asm-arm/plat-s3c24xx/common-smdk.h b/include/asm-arm/plat-s3c24xx/common-smdk.h
new file mode 100644 (file)
index 0000000..58d9094
--- /dev/null
@@ -0,0 +1,15 @@
+/* linux/include/asm-arm/plat-s3c24xx/common-smdk.h
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Common code for SMDK2410 and SMDK2440 boards
+ *
+ * http://www.fluff.org/ben/smdk2440/
+ *
+ * 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.
+*/
+
+extern void smdk_machine_init(void);
diff --git a/include/asm-arm/plat-s3c24xx/cpu.h b/include/asm-arm/plat-s3c24xx/cpu.h
new file mode 100644 (file)
index 0000000..15dd188
--- /dev/null
@@ -0,0 +1,70 @@
+/* linux/include/asm-arm/plat-s3c24xx/cpu.h
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for S3C24XX CPU support
+ *
+ * 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.
+*/
+
+/* todo - fix when rmk changes iodescs to use `void __iomem *` */
+
+#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
+
+#ifndef MHZ
+#define MHZ (1000*1000)
+#endif
+
+#define print_mhz(m) ((m) / MHZ), ((m / 1000) % 1000)
+
+/* forward declaration */
+struct s3c24xx_uart_resources;
+struct platform_device;
+struct s3c2410_uartcfg;
+struct map_desc;
+
+/* core initialisation functions */
+
+extern void s3c24xx_init_irq(void);
+
+extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
+
+extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+
+extern void s3c24xx_init_clocks(int xtal);
+
+extern void s3c24xx_init_uartdevs(char *name,
+                                 struct s3c24xx_uart_resources *res,
+                                 struct s3c2410_uartcfg *cfg, int no);
+
+/* the board structure is used at first initialsation time
+ * to get info such as the devices to register for this
+ * board. This is done because platfrom_add_devices() cannot
+ * be called from the map_io entry.
+*/
+
+struct s3c24xx_board {
+       struct platform_device  **devices;
+       unsigned int              devices_count;
+
+       struct clk              **clocks;
+       unsigned int              clocks_count;
+};
+
+extern void s3c24xx_set_board(struct s3c24xx_board *board);
+
+/* timer for 2410/2440 */
+
+struct sys_timer;
+extern struct sys_timer s3c24xx_timer;
+
+/* system device classes */
+
+extern struct sysdev_class s3c2410_sysclass;
+extern struct sysdev_class s3c2412_sysclass;
+extern struct sysdev_class s3c2440_sysclass;
+extern struct sysdev_class s3c2442_sysclass;
+extern struct sysdev_class s3c2443_sysclass;
diff --git a/include/asm-arm/plat-s3c24xx/devs.h b/include/asm-arm/plat-s3c24xx/devs.h
new file mode 100644 (file)
index 0000000..dddf485
--- /dev/null
@@ -0,0 +1,51 @@
+/* linux/include/asm-arm/plat-s3c24xx/devs.h
+ *
+ * Copyright (c) 2004 Simtec Electronics
+ * Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for s3c2410 standard platform devices
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+#include <linux/platform_device.h>
+
+struct s3c24xx_uart_resources {
+       struct resource         *resources;
+       unsigned long            nr_resources;
+};
+
+extern struct s3c24xx_uart_resources s3c2410_uart_resources[];
+
+extern struct platform_device *s3c24xx_uart_devs[];
+extern struct platform_device *s3c24xx_uart_src[];
+
+extern struct platform_device s3c_device_usb;
+extern struct platform_device s3c_device_lcd;
+extern struct platform_device s3c_device_wdt;
+extern struct platform_device s3c_device_i2c;
+extern struct platform_device s3c_device_iis;
+extern struct platform_device s3c_device_rtc;
+extern struct platform_device s3c_device_adc;
+extern struct platform_device s3c_device_sdi;
+
+extern struct platform_device s3c_device_spi0;
+extern struct platform_device s3c_device_spi1;
+
+extern struct platform_device s3c_device_nand;
+
+extern struct platform_device s3c_device_timer0;
+extern struct platform_device s3c_device_timer1;
+extern struct platform_device s3c_device_timer2;
+extern struct platform_device s3c_device_timer3;
+
+extern struct platform_device s3c_device_usbgadget;
+
+/* s3c2440 specific devices */
+
+#ifdef CONFIG_CPU_S3C2440
+
+extern struct platform_device s3c_device_camif;
+
+#endif
diff --git a/include/asm-arm/plat-s3c24xx/dma.h b/include/asm-arm/plat-s3c24xx/dma.h
new file mode 100644 (file)
index 0000000..2c59406
--- /dev/null
@@ -0,0 +1,77 @@
+/* linux/include/asm-arm/plat-s3c24xx/dma.h
+ *
+ * Copyright (C) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Samsung S3C24XX DMA support
+ *
+ * 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.
+*/
+
+extern struct sysdev_class dma_sysclass;
+extern struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS];
+
+#define DMA_CH_VALID           (1<<31)
+#define DMA_CH_NEVER           (1<<30)
+
+struct s3c24xx_dma_addr {
+       unsigned long           from;
+       unsigned long           to;
+};
+
+/* struct s3c24xx_dma_map
+ *
+ * this holds the mapping information for the channel selected
+ * to be connected to the specified device
+*/
+
+struct s3c24xx_dma_map {
+       const char              *name;
+       struct s3c24xx_dma_addr  hw_addr;
+
+       unsigned long            channels[S3C2410_DMA_CHANNELS];
+};
+
+struct s3c24xx_dma_selection {
+       struct s3c24xx_dma_map  *map;
+       unsigned long            map_size;
+       unsigned long            dcon_mask;
+
+       void    (*select)(struct s3c2410_dma_chan *chan,
+                         struct s3c24xx_dma_map *map);
+};
+
+extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel);
+
+/* struct s3c24xx_dma_order_ch
+ *
+ * channel map for one of the `enum dma_ch` dma channels. the list
+ * entry contains a set of low-level channel numbers, orred with
+ * DMA_CH_VALID, which are checked in the order in the array.
+*/
+
+struct s3c24xx_dma_order_ch {
+       unsigned int    list[S3C2410_DMA_CHANNELS];     /* list of channels */
+       unsigned int    flags;                          /* flags */
+};
+
+/* struct s3c24xx_dma_order
+ *
+ * information provided by either the core or the board to give the
+ * dma system a hint on how to allocate channels
+*/
+
+struct s3c24xx_dma_order {
+       struct s3c24xx_dma_order_ch     channels[DMACH_MAX];
+};
+
+extern int s3c24xx_dma_order_set(struct s3c24xx_dma_order *map);
+
+/* DMA init code, called from the cpu support code */
+
+extern int s3c2410_dma_init(void);
+
+extern int s3c24xx_dma_init(unsigned int channels, unsigned int irq,
+                           unsigned int stride);
diff --git a/include/asm-arm/plat-s3c24xx/irq.h b/include/asm-arm/plat-s3c24xx/irq.h
new file mode 100644 (file)
index 0000000..8af6d95
--- /dev/null
@@ -0,0 +1,107 @@
+/* linux/include/asm-arm/plat-s3c24xx/irq.h
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for S3C24XX CPU IRQ support
+ *
+ * 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 irqdbf(x...)
+#define irqdbf2(x...)
+
+#define EXTINT_OFF (IRQ_EINT4 - 4)
+
+extern struct irq_chip s3c_irq_level_chip;
+
+static inline void
+s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
+               int subcheck)
+{
+       unsigned long mask;
+       unsigned long submask;
+
+       submask = __raw_readl(S3C2410_INTSUBMSK);
+       mask = __raw_readl(S3C2410_INTMSK);
+
+       submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
+
+       /* check to see if we need to mask the parent IRQ */
+
+       if ((submask  & subcheck) == subcheck) {
+               __raw_writel(mask | parentbit, S3C2410_INTMSK);
+       }
+
+       /* write back masks */
+       __raw_writel(submask, S3C2410_INTSUBMSK);
+
+}
+
+static inline void
+s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
+{
+       unsigned long mask;
+       unsigned long submask;
+
+       submask = __raw_readl(S3C2410_INTSUBMSK);
+       mask = __raw_readl(S3C2410_INTMSK);
+
+       submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
+       mask &= ~parentbit;
+
+       /* write back masks */
+       __raw_writel(submask, S3C2410_INTSUBMSK);
+       __raw_writel(mask, S3C2410_INTMSK);
+}
+
+
+static inline void
+s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
+{
+       unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
+
+       s3c_irqsub_mask(irqno, parentmask, group);
+
+       __raw_writel(bit, S3C2410_SUBSRCPND);
+
+       /* only ack parent if we've got all the irqs (seems we must
+        * ack, all and hope that the irq system retriggers ok when
+        * the interrupt goes off again)
+        */
+
+       if (1) {
+               __raw_writel(parentmask, S3C2410_SRCPND);
+               __raw_writel(parentmask, S3C2410_INTPND);
+       }
+}
+
+static inline void
+s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
+{
+       unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
+
+       __raw_writel(bit, S3C2410_SUBSRCPND);
+
+       /* only ack parent if we've got all the irqs (seems we must
+        * ack, all and hope that the irq system retriggers ok when
+        * the interrupt goes off again)
+        */
+
+       if (1) {
+               __raw_writel(parentmask, S3C2410_SRCPND);
+               __raw_writel(parentmask, S3C2410_INTPND);
+       }
+}
+
+/* exported for use in arch/arm/mach-s3c2410 */
+
+#ifdef CONFIG_PM
+extern int s3c_irq_wake(unsigned int irqno, unsigned int state);
+#else
+#define s3c_irq_wake NULL
+#endif
+
+extern int s3c_irqext_type(unsigned int irq, unsigned int type);
diff --git a/include/asm-arm/plat-s3c24xx/pm.h b/include/asm-arm/plat-s3c24xx/pm.h
new file mode 100644 (file)
index 0000000..cc62366
--- /dev/null
@@ -0,0 +1,73 @@
+/* linux/include/asm-arm/plat-s3c24xx/pm.h
+ *
+ * Copyright (c) 2004 Simtec Electronics
+ *     Written by Ben Dooks, <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+/* s3c2410_pm_init
+ *
+ * called from board at initialisation time to setup the power
+ * management
+*/
+
+#ifdef CONFIG_PM
+
+extern __init int s3c2410_pm_init(void);
+
+#else
+
+static inline int s3c2410_pm_init(void)
+{
+       return 0;
+}
+#endif
+
+/* configuration for the IRQ mask over sleep */
+extern unsigned long s3c_irqwake_intmask;
+extern unsigned long s3c_irqwake_eintmask;
+
+/* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
+extern unsigned long s3c_irqwake_intallow;
+extern unsigned long s3c_irqwake_eintallow;
+
+/* per-cpu sleep functions */
+
+extern void (*pm_cpu_prep)(void);
+extern void (*pm_cpu_sleep)(void);
+
+/* Flags for PM Control */
+
+extern unsigned long s3c_pm_flags;
+
+/* from sleep.S */
+
+extern int  s3c2410_cpu_save(unsigned long *saveblk);
+extern void s3c2410_cpu_suspend(void);
+extern void s3c2410_cpu_resume(void);
+
+extern unsigned long s3c2410_sleep_save_phys;
+
+/* sleep save info */
+
+struct sleep_save {
+       void __iomem    *reg;
+       unsigned long   val;
+};
+
+#define SAVE_ITEM(x) \
+       { .reg = (x) }
+
+extern void s3c2410_pm_do_save(struct sleep_save *ptr, int count);
+extern void s3c2410_pm_do_restore(struct sleep_save *ptr, int count);
+
+#ifdef CONFIG_PM
+extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
+extern int s3c24xx_irq_resume(struct sys_device *dev);
+#else
+#define s3c24xx_irq_suspend NULL
+#define s3c24xx_irq_resume  NULL
+#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2400.h b/include/asm-arm/plat-s3c24xx/s3c2400.h
new file mode 100644 (file)
index 0000000..3a5a168
--- /dev/null
@@ -0,0 +1,31 @@
+/* linux/include/asm-arm/plat-s3c24xx/s3c2400.h
+ *
+ * Copyright (c) 2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for S3C2400 cpu support
+ *
+ * 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.
+ *
+ * Modifications:
+ *     09-Fev-2006 LCVR  First version, based on s3c2410.h
+*/
+
+#ifdef CONFIG_CPU_S3C2400
+
+extern  int s3c2400_init(void);
+
+extern void s3c2400_map_io(struct map_desc *mach_desc, int size);
+
+extern void s3c2400_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+
+extern void s3c2400_init_clocks(int xtal);
+
+#else
+#define s3c2400_init_clocks NULL
+#define s3c2400_init_uarts NULL
+#define s3c2400_map_io NULL
+#define s3c2400_init NULL
+#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2410.h b/include/asm-arm/plat-s3c24xx/s3c2410.h
new file mode 100644 (file)
index 0000000..36de0b8
--- /dev/null
@@ -0,0 +1,31 @@
+/* linux/include/asm-arm/plat-s3c24xx/s3c2410.h
+ *
+ * Copyright (c) 2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for s3c2410 machine directory
+ *
+ * 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.
+ *
+*/
+
+#ifdef CONFIG_CPU_S3C2410
+
+extern  int s3c2410_init(void);
+
+extern void s3c2410_map_io(struct map_desc *mach_desc, int size);
+
+extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+
+extern void s3c2410_init_clocks(int xtal);
+
+extern  int s3c2410_baseclk_add(void);
+
+#else
+#define s3c2410_init_clocks NULL
+#define s3c2410_init_uarts NULL
+#define s3c2410_map_io NULL
+#define s3c2410_init NULL
+#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2412.h b/include/asm-arm/plat-s3c24xx/s3c2412.h
new file mode 100644 (file)
index 0000000..3ec9768
--- /dev/null
@@ -0,0 +1,29 @@
+/* linux/include/asm-arm/plat-s3c24xx/s3c2412.h
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for s3c2412 cpu support
+ *
+ * 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.
+*/
+
+#ifdef CONFIG_CPU_S3C2412
+
+extern  int s3c2412_init(void);
+
+extern void s3c2412_map_io(struct map_desc *mach_desc, int size);
+
+extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+
+extern void s3c2412_init_clocks(int xtal);
+
+extern  int s3c2412_baseclk_add(void);
+#else
+#define s3c2412_init_clocks NULL
+#define s3c2412_init_uarts NULL
+#define s3c2412_map_io NULL
+#define s3c2412_init NULL
+#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2440.h b/include/asm-arm/plat-s3c24xx/s3c2440.h
new file mode 100644 (file)
index 0000000..107853b
--- /dev/null
@@ -0,0 +1,17 @@
+/* linux/include/asm-arm/plat-s3c24xx/s3c2440.h
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for s3c2440 cpu support
+ *
+ * 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.
+*/
+
+#ifdef CONFIG_CPU_S3C2440
+extern  int s3c2440_init(void);
+#else
+#define s3c2440_init NULL
+#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2442.h b/include/asm-arm/plat-s3c24xx/s3c2442.h
new file mode 100644 (file)
index 0000000..451a23a
--- /dev/null
@@ -0,0 +1,17 @@
+/* linux/include/asm-arm/plat-s3c24xx/s3c2442.h
+ *
+ * Copyright (c) 2006 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for s3c2442 cpu support
+ *
+ * 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.
+*/
+
+#ifdef CONFIG_CPU_S3C2442
+extern  int s3c2442_init(void);
+#else
+#define s3c2442_init NULL
+#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2443.h b/include/asm-arm/plat-s3c24xx/s3c2443.h
new file mode 100644 (file)
index 0000000..11d83b5
--- /dev/null
@@ -0,0 +1,32 @@
+/* linux/include/asm-arm/plat-s3c24xx/s3c2443.h
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for s3c2443 cpu support
+ *
+ * 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.
+*/
+
+#ifdef CONFIG_CPU_S3C2443
+
+struct s3c2410_uartcfg;
+
+extern  int s3c2443_init(void);
+
+extern void s3c2443_map_io(struct map_desc *mach_desc, int size);
+
+extern void s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+
+extern void s3c2443_init_clocks(int xtal);
+
+extern  int s3c2443_baseclk_add(void);
+
+#else
+#define s3c2443_init_clocks NULL
+#define s3c2443_init_uarts NULL
+#define s3c2443_map_io NULL
+#define s3c2443_init NULL
+#endif
index aa223fc546afdee10d5b0d74bae41014122a07fe..f4386906b200002d6d6a3612f4037382a9ba9cef 100644 (file)
@@ -140,6 +140,40 @@ static inline int cpu_is_xsc3(void)
 #define        cpu_is_xscale() 1
 #endif
 
+#define UDBG_UNDEFINED (1 << 0)
+#define UDBG_SYSCALL   (1 << 1)
+#define UDBG_BADABORT  (1 << 2)
+#define UDBG_SEGV      (1 << 3)
+#define UDBG_BUS       (1 << 4)
+
+extern unsigned int user_debug;
+
+#if __LINUX_ARM_ARCH__ >= 4
+#define vectors_high() (cr_alignment & CR_V)
+#else
+#define vectors_high() (0)
+#endif
+
+#if __LINUX_ARM_ARCH__ >= 6
+#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
+                                   : : "r" (0) : "memory")
+#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
+                                   : : "r" (0) : "memory")
+#define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
+                                   : : "r" (0) : "memory")
+#else
+#define isb() __asm__ __volatile__ ("" : : : "memory")
+#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
+                                   : : "r" (0) : "memory")
+#define dmb() __asm__ __volatile__ ("" : : : "memory")
+#endif
+#define mb() dmb()
+#define rmb() mb()
+#define wmb() mb()
+#define read_barrier_depends() do { } while(0)
+#define set_mb(var, value)  do { var = value; mb(); } while (0)
+#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
+
 extern unsigned long cr_no_alignment;  /* defined in entry-armv.S */
 extern unsigned long cr_alignment;     /* defined in entry-armv.S */
 
@@ -154,6 +188,7 @@ static inline void set_cr(unsigned int val)
 {
        asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR"
          : : "r" (val) : "cc");
+       isb();
 }
 
 #ifndef CONFIG_SMP
@@ -176,34 +211,9 @@ static inline void set_copro_access(unsigned int val)
 {
        asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access"
          : : "r" (val) : "cc");
+       isb();
 }
 
-#define UDBG_UNDEFINED (1 << 0)
-#define UDBG_SYSCALL   (1 << 1)
-#define UDBG_BADABORT  (1 << 2)
-#define UDBG_SEGV      (1 << 3)
-#define UDBG_BUS       (1 << 4)
-
-extern unsigned int user_debug;
-
-#if __LINUX_ARM_ARCH__ >= 4
-#define vectors_high() (cr_alignment & CR_V)
-#else
-#define vectors_high() (0)
-#endif
-
-#if __LINUX_ARM_ARCH__ >= 6
-#define mb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
-                                   : : "r" (0) : "memory")
-#else
-#define mb() __asm__ __volatile__ ("" : : : "memory")
-#endif
-#define rmb() mb()
-#define wmb() mb()
-#define read_barrier_depends() do { } while(0)
-#define set_mb(var, value)  do { var = value; mb(); } while (0)
-#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
-
 /*
  * switch_mm() may do a full cache flush over the context switch,
  * so enable interrupts over the context switch to avoid high
index cd10a0b5f8ae77510234c15c9295f80944f59f4a..08c6991dc9c9925a36e5057047fdf3956639078f 100644 (file)
@@ -247,7 +247,7 @@ static inline void local_flush_tlb_all(void)
        const unsigned int __tlb_flag = __cpu_tlb_flags;
 
        if (tlb_flag(TLB_WB))
-               asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc");
+               dsb();
 
        if (tlb_flag(TLB_V3_FULL))
                asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc");
@@ -257,6 +257,15 @@ static inline void local_flush_tlb_all(void)
                asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc");
        if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL))
                asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
+
+       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
+                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
+                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
+               /* flush the branch target cache */
+               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
+               dsb();
+               isb();
+       }
 }
 
 static inline void local_flush_tlb_mm(struct mm_struct *mm)
@@ -266,7 +275,7 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm)
        const unsigned int __tlb_flag = __cpu_tlb_flags;
 
        if (tlb_flag(TLB_WB))
-               asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc");
+               dsb();
 
        if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) {
                if (tlb_flag(TLB_V3_FULL))
@@ -285,6 +294,14 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm)
                asm("mcr p15, 0, %0, c8, c6, 2" : : "r" (asid) : "cc");
        if (tlb_flag(TLB_V6_I_ASID))
                asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc");
+
+       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
+                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
+                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
+               /* flush the branch target cache */
+               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
+               dsb();
+       }
 }
 
 static inline void
@@ -296,7 +313,7 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
        uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm);
 
        if (tlb_flag(TLB_WB))
-               asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero));
+               dsb();
 
        if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
                if (tlb_flag(TLB_V3_PAGE))
@@ -317,6 +334,14 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
                asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc");
        if (tlb_flag(TLB_V6_I_PAGE))
                asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
+
+       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
+                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
+                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
+               /* flush the branch target cache */
+               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
+               dsb();
+       }
 }
 
 static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
@@ -327,7 +352,7 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
        kaddr &= PAGE_MASK;
 
        if (tlb_flag(TLB_WB))
-               asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc");
+               dsb();
 
        if (tlb_flag(TLB_V3_PAGE))
                asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (kaddr) : "cc");
@@ -347,11 +372,14 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
        if (tlb_flag(TLB_V6_I_PAGE))
                asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
 
-       /* The ARM ARM states that the completion of a TLB maintenance
-        * operation is only guaranteed by a DSB instruction
-        */
-       if (tlb_flag(TLB_V6_U_PAGE | TLB_V6_D_PAGE | TLB_V6_I_PAGE))
-               asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc");
+       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
+                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
+                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
+               /* flush the branch target cache */
+               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
+               dsb();
+               isb();
+       }
 }
 
 /*
@@ -369,15 +397,13 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
  */
 static inline void flush_pmd_entry(pmd_t *pmd)
 {
-       const unsigned int zero = 0;
        const unsigned int __tlb_flag = __cpu_tlb_flags;
 
        if (tlb_flag(TLB_DCLEAN))
                asm("mcr        p15, 0, %0, c7, c10, 1  @ flush_pmd"
                        : : "r" (pmd) : "cc");
        if (tlb_flag(TLB_WB))
-               asm("mcr        p15, 0, %0, c7, c10, 4  @ flush_pmd"
-                       : : "r" (zero) : "cc");
+               dsb();
 }
 
 static inline void clean_pmd_entry(pmd_t *pmd)
index 97e7060000cf9170fe376bf689681ef2c1f303f7..0991b7bc3f78dc0acac510de92668d818e6cc897 100644 (file)
 #define __NR_move_pages                        (__NR_SYSCALL_BASE+344)
 #define __NR_getcpu                    (__NR_SYSCALL_BASE+345)
                                        /* 346 for epoll_pwait */
+#define __NR_sys_kexec_load            (__NR_SYSCALL_BASE+347)
 
 /*
  * The following SWIs are ARM private.
diff --git a/include/asm-avr32/arch-at32ap/at91_pdc.h b/include/asm-avr32/arch-at32ap/at91_pdc.h
deleted file mode 100644 (file)
index 79d6e02..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91_pdc.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Peripheral Data Controller (PDC) registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91_PDC_H
-#define AT91_PDC_H
-
-#define AT91_PDC_RPR           0x100   /* Receive Pointer Register */
-#define AT91_PDC_RCR           0x104   /* Receive Counter Register */
-#define AT91_PDC_TPR           0x108   /* Transmit Pointer Register */
-#define AT91_PDC_TCR           0x10c   /* Transmit Counter Register */
-#define AT91_PDC_RNPR          0x110   /* Receive Next Pointer Register */
-#define AT91_PDC_RNCR          0x114   /* Receive Next Counter Register */
-#define AT91_PDC_TNPR          0x118   /* Transmit Next Pointer Register */
-#define AT91_PDC_TNCR          0x11c   /* Transmit Next Counter Register */
-
-#define AT91_PDC_PTCR          0x120   /* Transfer Control Register */
-#define                AT91_PDC_RXTEN          (1 << 0)        /* Receiver Transfer Enable */
-#define                AT91_PDC_RXTDIS         (1 << 1)        /* Receiver Transfer Disable */
-#define                AT91_PDC_TXTEN          (1 << 8)        /* Transmitter Transfer Enable */
-#define                AT91_PDC_TXTDIS         (1 << 9)        /* Transmitter Transfer Disable */
-
-#define AT91_PDC_PTSR          0x124   /* Transfer Status Register */
-
-#endif
index 5e657eb8946c953bc0b58846344653cc9d1eaa9c..449f3f272e070753c25877e5b23445ffbd75ac4f 100644 (file)
@@ -127,6 +127,7 @@ extern int acpi_irq_balance_set(char *str);
 #define acpi_ioapic 0
 static inline void acpi_noirq_set(void) { }
 static inline void acpi_disable_pci(void) { }
+static inline void disable_acpi(void) { }
 
 #endif /* !CONFIG_ACPI */
 
index f038e33e6d48677d0da1d5150dfc0b5f1f8a6931..2ce4b6b7b34887456961fdc9227a184bcec535b8 100644 (file)
@@ -165,7 +165,8 @@ static __inline__ int atomic_dec_return(atomic_t *v)
        return t;
 }
 
-#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
+#define atomic_cmpxchg(v, o, n) \
+       ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
 #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 
 /**
@@ -413,6 +414,43 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v)
        return t;
 }
 
+#define atomic64_cmpxchg(v, o, n) \
+       ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
+#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
+
+/**
+ * atomic64_add_unless - add unless the number is a given value
+ * @v: pointer of type atomic64_t
+ * @a: the amount to add to v...
+ * @u: ...unless v is equal to u.
+ *
+ * Atomically adds @a to @v, so long as it was not @u.
+ * Returns non-zero if @v was not @u, and zero otherwise.
+ */
+static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
+{
+       long t;
+
+       __asm__ __volatile__ (
+       LWSYNC_ON_SMP
+"1:    ldarx   %0,0,%1         # atomic_add_unless\n\
+       cmpd    0,%0,%3 \n\
+       beq-    2f \n\
+       add     %0,%2,%0 \n"
+"      stdcx.  %0,0,%1 \n\
+       bne-    1b \n"
+       ISYNC_ON_SMP
+"      subf    %0,%2,%0 \n\
+2:"
+       : "=&r" (t)
+       : "r" (&v->counter), "r" (a), "r" (u)
+       : "cc", "memory");
+
+       return t != u;
+}
+
+#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
+
 #endif /* __powerpc64__ */
 
 #include <asm-generic/atomic.h>
index d7a1bc1551c603086c97a2ee1c85f9ad53803172..05af081222f6ba7c0a1ac8f8cf90b4def3cbb487 100644 (file)
@@ -26,8 +26,8 @@ typedef struct {} dcr_host_t;
 
 #define DCR_MAP_OK(host)       (1)
 
-#define dcr_map(dev, dcr_n, dcr_c)     {}
-#define dcr_unmap(host, dcr_n, dcr_c)  {}
+#define dcr_map(dev, dcr_n, dcr_c)     ((dcr_host_t){})
+#define dcr_unmap(host, dcr_n, dcr_c)  do {} while (0)
 #define dcr_read(host, dcr_n)          mfdcr(dcr_n)
 #define dcr_write(host, dcr_n, value)  mtdcr(dcr_n, value)
 
diff --git a/include/asm-powerpc/pmi.h b/include/asm-powerpc/pmi.h
new file mode 100644 (file)
index 0000000..cb0f8aa
--- /dev/null
@@ -0,0 +1,67 @@
+#ifndef _POWERPC_PMI_H
+#define _POWERPC_PMI_H
+
+/*
+ * Definitions for talking with PMI device on PowerPC
+ *
+ * PMI (Platform Management Interrupt) is a way to communicate
+ * with the BMC (Baseboard Management Controller) via interrupts.
+ * Unlike IPMI it is bidirectional and has a low latency.
+ *
+ * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
+ *
+ * Author: Christian Krafft <krafft@de.ibm.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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifdef __KERNEL__
+
+#include <asm/of_device.h>
+
+#define PMI_TYPE_FREQ_CHANGE   0x01
+#define PMI_READ_TYPE          0
+#define PMI_READ_DATA0         1
+#define PMI_READ_DATA1         2
+#define PMI_READ_DATA2         3
+#define PMI_WRITE_TYPE         4
+#define PMI_WRITE_DATA0                5
+#define PMI_WRITE_DATA1                6
+#define PMI_WRITE_DATA2                7
+
+#define PMI_ACK                        0x80
+
+#define PMI_TIMEOUT            100
+
+typedef struct {
+       u8      type;
+       u8      data0;
+       u8      data1;
+       u8      data2;
+} pmi_message_t;
+
+struct pmi_handler {
+       struct list_head node;
+       u8 type;
+       void (*handle_pmi_message) (struct of_device *, pmi_message_t);
+};
+
+void pmi_register_handler(struct of_device *, struct pmi_handler *);
+void pmi_unregister_handler(struct of_device *, struct pmi_handler *);
+
+void pmi_send_message(struct of_device *, pmi_message_t);
+
+#endif /* __KERNEL__ */
+#endif /* _POWERPC_PMI_H */
index 0afee17f33b4f5de4e8ad6cc70b171383809cff9..020ed015a94b4fef829b20f20d1db6d58372e279 100644 (file)
@@ -255,6 +255,8 @@ extern void kdump_move_device_tree(void);
 /* CPU OF node matching */
 struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
 
+/* Get the MAC address */
+extern const void *of_get_mac_address(struct device_node *np);
 
 /*
  * OF interrupt mapping
index e5982ad465763b2052e55f20d20b5b135e284f17..821581a8b643c23e63f55cb517a1cc81a255dfc8 100644 (file)
@@ -355,13 +355,7 @@ extern struct bus_type ps3_system_bus_type;
 
 /* vuart routines */
 
-struct ps3_vuart_stats {
-       unsigned long bytes_written;
-       unsigned long bytes_read;
-       unsigned long tx_interrupts;
-       unsigned long rx_interrupts;
-       unsigned long disconnect_interrupts;
-};
+struct ps3_vuart_port_priv;
 
 /**
  * struct ps3_vuart_port_device - a device on a vuart port
@@ -370,24 +364,17 @@ struct ps3_vuart_stats {
 struct ps3_vuart_port_device {
        enum ps3_match_id match_id;
        struct device core;
+       struct ps3_vuart_port_priv* priv; /* private driver variables */
 
-       /* private driver variables */
-       unsigned int port_number;
-       u64 interrupt_mask;
-       struct {
-               spinlock_t lock;
-               struct list_head head;
-       } tx_list;
-       struct {
-               unsigned long bytes_held;
-               spinlock_t lock;
-               struct list_head head;
-       } rx_list;
-       struct ps3_vuart_stats stats;
 };
 
 int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev);
 
+/* system manager */
+
+void ps3_sys_manager_restart(void);
+void ps3_sys_manager_power_off(void);
+
 struct ps3_prealloc {
     const char *name;
     void *address;
index 1babad99c719ba908919f97389479b248585fd8e..fdaac9d762bb5d5e101365be102f7e23ac7e032d 100644 (file)
@@ -150,7 +150,7 @@ struct ucc_slow_info {
        int ucc_num;
        enum qe_clock rx_clock;
        enum qe_clock tx_clock;
-       struct ucc_slow *regs;
+       u32 regs;
        int irq;
        u16 uccm_mask;
        int data_mem_part;
@@ -199,9 +199,9 @@ struct ucc_slow_private {
                                   and length for first BD in a frame */
        u32 tx_base_offset;     /* first BD in Tx BD table offset (In MURAM) */
        u32 rx_base_offset;     /* first BD in Rx BD table offset (In MURAM) */
-       u8 *confBd;             /* next BD for confirm after Tx */
-       u8 *tx_bd;              /* next BD for new Tx request */
-       u8 *rx_bd;              /* next BD to collect after Rx */
+       struct qe_bd *confBd;   /* next BD for confirm after Tx */
+       struct qe_bd *tx_bd;    /* next BD for new Tx request */
+       struct qe_bd *rx_bd;    /* next BD to collect after Rx */
        void *p_rx_frame;       /* accumulating receive frame */
        u16 *p_ucce;            /* a pointer to the event register in memory.
                                 */
index 815f1fb4ce211302a334d447ae61b72d4c25053a..8bcfaa4c66ae78705ed128297d0069cd9f460752 100644 (file)
@@ -75,7 +75,7 @@ enum acpi_address_range_id {
 
 typedef int (*acpi_table_handler) (struct acpi_table_header *table);
 
-typedef int (*acpi_madt_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
+typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
 
 char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
 unsigned long acpi_find_rsdp (void);
@@ -85,8 +85,10 @@ int acpi_numa_init (void);
 
 int acpi_table_init (void);
 int acpi_table_parse (char *id, acpi_table_handler handler);
-int acpi_table_parse_madt (enum acpi_madt_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
-int acpi_table_parse_srat (enum acpi_srat_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
+int __init acpi_table_parse_entries(char *id, unsigned long table_size,
+       int entry_id, acpi_table_entry_handler handler, unsigned int max_entries);
+int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries);
+int acpi_table_parse_srat (enum acpi_srat_type id, acpi_table_entry_handler handler, unsigned int max_entries);
 int acpi_parse_mcfg (struct acpi_table_header *header);
 void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
 void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
diff --git a/include/linux/atmel_pdc.h b/include/linux/atmel_pdc.h
new file mode 100644 (file)
index 0000000..5058a31
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * include/linux/atmel_pdc.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Peripheral Data Controller (PDC) registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 ATMEL_PDC_H
+#define ATMEL_PDC_H
+
+#define ATMEL_PDC_RPR          0x100   /* Receive Pointer Register */
+#define ATMEL_PDC_RCR          0x104   /* Receive Counter Register */
+#define ATMEL_PDC_TPR          0x108   /* Transmit Pointer Register */
+#define ATMEL_PDC_TCR          0x10c   /* Transmit Counter Register */
+#define ATMEL_PDC_RNPR         0x110   /* Receive Next Pointer Register */
+#define ATMEL_PDC_RNCR         0x114   /* Receive Next Counter Register */
+#define ATMEL_PDC_TNPR         0x118   /* Transmit Next Pointer Register */
+#define ATMEL_PDC_TNCR         0x11c   /* Transmit Next Counter Register */
+
+#define ATMEL_PDC_PTCR         0x120   /* Transfer Control Register */
+#define                ATMEL_PDC_RXTEN         (1 << 0)        /* Receiver Transfer Enable */
+#define                ATMEL_PDC_RXTDIS        (1 << 1)        /* Receiver Transfer Disable */
+#define                ATMEL_PDC_TXTEN         (1 << 8)        /* Transmitter Transfer Enable */
+#define                ATMEL_PDC_TXTDIS        (1 << 9)        /* Transmitter Transfer Disable */
+
+#define ATMEL_PDC_PTSR         0x124   /* Transfer Status Register */
+
+#endif
index 047567d34ca77e5da470f7a954e3799a217e14a9..9fa0983d1aa8b70823cc160383f4e0b0b03a1eba 100644 (file)
@@ -33,6 +33,9 @@ struct dentry *debugfs_create_file(const char *name, mode_t mode,
 
 struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
 
+struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
+                                     const char *dest);
+
 void debugfs_remove(struct dentry *dentry);
 
 struct dentry *debugfs_create_u8(const char *name, mode_t mode,
@@ -70,6 +73,13 @@ static inline struct dentry *debugfs_create_dir(const char *name,
        return ERR_PTR(-ENODEV);
 }
 
+static inline struct dentry *debugfs_create_symlink(const char *name,
+                                                   struct dentry *parent,
+                                                   const char *dest)
+{
+       return ERR_PTR(-ENODEV);
+}
+
 static inline void debugfs_remove(struct dentry *dentry)
 { }
 
index 26e4692f2d1a185c7c3bbe986e970eb1928721d7..d5b1b7b3558ef70c2e352522d658322eb9df5449 100644 (file)
@@ -2,6 +2,7 @@
  * device.h - generic, centralized driver model
  *
  * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
+ * Copyright (c) 2004-2007 Greg Kroah-Hartman <gregkh@suse.de>
  *
  * This file is released under the GPLv2
  *
index 04e0fa97ac99aa1ae25a928aa6b49ab82875e93a..79c028251c70c29458110f9b4319164d505b7670 100644 (file)
@@ -636,7 +636,6 @@ typedef struct ide_drive_s {
        unsigned int    bios_cyl;       /* BIOS/fdisk/LILO number of cyls */
        unsigned int    cyl;            /* "real" number of cyls */
        unsigned int    drive_data;     /* use by tuneproc/selectproc */
-       unsigned int    usage;          /* current "open()" count for drive */
        unsigned int    failures;       /* current failure count */
        unsigned int    max_failures;   /* maximum allowed failure count */
        u64             probed_capacity;/* initial reported media capacity (ide-cd only currently) */
@@ -736,23 +735,22 @@ typedef struct hwif_s {
        int (*ide_dma_end)(ide_drive_t *drive);
        int (*ide_dma_check)(ide_drive_t *drive);
        int (*ide_dma_on)(ide_drive_t *drive);
-       int (*ide_dma_off_quietly)(ide_drive_t *drive);
+       void (*dma_off_quietly)(ide_drive_t *drive);
        int (*ide_dma_test_irq)(ide_drive_t *drive);
-       int (*ide_dma_host_on)(ide_drive_t *drive);
-       int (*ide_dma_host_off)(ide_drive_t *drive);
+       void (*ide_dma_clear_irq)(ide_drive_t *drive);
+       void (*dma_host_on)(ide_drive_t *drive);
+       void (*dma_host_off)(ide_drive_t *drive);
        int (*ide_dma_lostirq)(ide_drive_t *drive);
        int (*ide_dma_timeout)(ide_drive_t *drive);
 
        void (*OUTB)(u8 addr, unsigned long port);
        void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port);
        void (*OUTW)(u16 addr, unsigned long port);
-       void (*OUTL)(u32 addr, unsigned long port);
        void (*OUTSW)(unsigned long port, void *addr, u32 count);
        void (*OUTSL)(unsigned long port, void *addr, u32 count);
 
        u8  (*INB)(unsigned long port);
        u16 (*INW)(unsigned long port);
-       u32 (*INL)(unsigned long port);
        void (*INSW)(unsigned long port, void *addr, u32 count);
        void (*INSL)(unsigned long port, void *addr, u32 count);
 
@@ -774,7 +772,6 @@ typedef struct hwif_s {
        unsigned int cursg;
        unsigned int cursg_ofs;
 
-       int             mmio;           /* hosts iomio (0) or custom (2) select */
        int             rqsize;         /* max sectors per request */
        int             irq;            /* our irq number */
 
@@ -802,12 +799,11 @@ typedef struct hwif_s {
        unsigned        udma_four  : 1; /* 1=ATA-66 capable, 0=default */
        unsigned        no_lba48   : 1; /* 1 = cannot do LBA48 */
        unsigned        no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */
-       unsigned        no_dsc     : 1; /* 0 default, 1 dsc_overlap disabled */
        unsigned        auto_poll  : 1; /* supports nop auto-poll */
        unsigned        sg_mapped  : 1; /* sg_table and sg_nents are ready */
        unsigned        no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
        unsigned        err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */
-       unsigned        atapi_irq_bogon : 1; /* Generates spurious DMA interrupts in PIO mode */
+       unsigned        mmio       : 1; /* host uses MMIO */
 
        struct device   gendev;
        struct completion gendev_rel_comp; /* To deal with device release() */
@@ -1280,8 +1276,9 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
 int __ide_dma_bad_drive(ide_drive_t *);
 int __ide_dma_good_drive(ide_drive_t *);
 int ide_use_dma(ide_drive_t *);
-int __ide_dma_off(ide_drive_t *);
+void ide_dma_off(ide_drive_t *);
 void ide_dma_verbose(ide_drive_t *);
+int ide_set_dma(ide_drive_t *);
 ide_startstop_t ide_dma_intr(ide_drive_t *);
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI
@@ -1291,9 +1288,9 @@ extern void ide_destroy_dmatable(ide_drive_t *);
 extern int ide_release_dma(ide_hwif_t *);
 extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int);
 
-extern int __ide_dma_host_off(ide_drive_t *);
-extern int __ide_dma_off_quietly(ide_drive_t *);
-extern int __ide_dma_host_on(ide_drive_t *);
+void ide_dma_host_off(ide_drive_t *);
+void ide_dma_off_quietly(ide_drive_t *);
+void ide_dma_host_on(ide_drive_t *);
 extern int __ide_dma_on(ide_drive_t *);
 extern int __ide_dma_check(ide_drive_t *);
 extern int ide_dma_setup(ide_drive_t *);
@@ -1305,8 +1302,9 @@ extern int __ide_dma_timeout(ide_drive_t *);
 
 #else
 static inline int ide_use_dma(ide_drive_t *drive) { return 0; }
-static inline int __ide_dma_off(ide_drive_t *drive) { return 0; }
+static inline void ide_dma_off(ide_drive_t *drive) { ; }
 static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
+static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
 #endif /* CONFIG_BLK_DEV_IDEDMA */
 
 #ifndef CONFIG_BLK_DEV_IDEDMA_PCI
@@ -1354,6 +1352,7 @@ extern int ide_dma_enable(ide_drive_t *drive);
 extern char *ide_xfer_verbose(u8 xfer_rate);
 extern void ide_toggle_bounce(ide_drive_t *drive, int on);
 extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
+int ide_use_fast_pio(ide_drive_t *);
 
 u8 ide_dump_status(ide_drive_t *, const char *, u8);
 
@@ -1367,7 +1366,6 @@ typedef struct ide_pio_data_s {
        u8 pio_mode;
        u8 use_iordy;
        u8 overridden;
-       u8 blacklisted;
        unsigned int cycle_time;
 } ide_pio_data_t;
 
index d02425cdd801c28d94cef85666bdc564ae6c867e..696e5ec63f77b83fdb81cf35299783633637736a 100644 (file)
@@ -125,6 +125,7 @@ extern struct kimage *kexec_crash_image;
 #define KEXEC_ARCH_PPC     (20 << 16)
 #define KEXEC_ARCH_PPC64   (21 << 16)
 #define KEXEC_ARCH_IA_64   (50 << 16)
+#define KEXEC_ARCH_ARM     (40 << 16)
 #define KEXEC_ARCH_S390    (22 << 16)
 #define KEXEC_ARCH_SH      (42 << 16)
 #define KEXEC_ARCH_MIPS_LE (10 << 16)
index 10f505c8431dc320f46d77a88095df20cb475cb8..cc8e674ae27ad3b7a4414773d9bf010e7c91cde8 100644 (file)
 #ifdef CONFIG_KMOD
 /* modprobe exit status on success, -ve on error.  Return value
  * usually useless though. */
+extern void kmod_sysfs_init(void);
 extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2)));
 #else
+static inline void kmod_sysfs_init(void) {};
 static inline int request_module(const char * name, ...) { return -ENOSYS; }
 #endif
 
index b870b20df43c6abb43fdf5973091201130841d59..86762a9f52ba19bb4622662264750d8c6b943646 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/ata.h>
 #include <linux/workqueue.h>
 #include <scsi/scsi_host.h>
+#include <linux/acpi.h>
 
 /*
  * Define if arch has non-standard setup.  This is a _PCI_ standard
@@ -495,6 +496,10 @@ struct ata_device {
        /* error history */
        struct ata_ering        ering;
        unsigned int            horkage;        /* List of broken features */
+#ifdef CONFIG_SATA_ACPI
+       /* ACPI objects info */
+       acpi_handle obj_handle;
+#endif
 };
 
 /* Offset into struct ata_device.  Fields above it are maintained
index 419d3ef293dd996ba4ee3fda9501feebdd13e0aa..95679eb8571e25534c88729bd5b86654944729d1 100644 (file)
@@ -76,8 +76,6 @@ void sort_extable(struct exception_table_entry *start,
                  struct exception_table_entry *finish);
 void sort_main_extable(void);
 
-extern struct subsystem module_subsys;
-
 #ifdef MODULE
 #define MODULE_GENERIC_TABLE(gtype,name)                       \
 extern const struct gtype##_id __mod_##gtype##_table           \
@@ -467,10 +465,6 @@ int unregister_module_notifier(struct notifier_block * nb);
 
 extern void print_modules(void);
 
-struct device_driver;
-void module_add_driver(struct module *, struct device_driver *);
-void module_remove_driver(struct device_driver *);
-
 #else /* !CONFIG_MODULES... */
 #define EXPORT_SYMBOL(sym)
 #define EXPORT_SYMBOL_GPL(sym)
@@ -568,18 +562,59 @@ static inline void print_modules(void)
 {
 }
 
+#endif /* CONFIG_MODULES */
+
 struct device_driver;
+#ifdef CONFIG_SYSFS
 struct module;
 
-static inline void module_add_driver(struct module *module, struct device_driver *driver)
+extern struct subsystem module_subsys;
+
+int mod_sysfs_init(struct module *mod);
+int mod_sysfs_setup(struct module *mod,
+                          struct kernel_param *kparam,
+                          unsigned int num_params);
+int module_add_modinfo_attrs(struct module *mod);
+void module_remove_modinfo_attrs(struct module *mod);
+
+#else /* !CONFIG_SYSFS */
+
+static inline int mod_sysfs_init(struct module *mod)
 {
+       return 0;
 }
 
-static inline void module_remove_driver(struct device_driver *driver)
+static inline int mod_sysfs_setup(struct module *mod,
+                          struct kernel_param *kparam,
+                          unsigned int num_params)
 {
+       return 0;
 }
 
-#endif /* CONFIG_MODULES */
+static inline int module_add_modinfo_attrs(struct module *mod)
+{
+       return 0;
+}
+
+static inline void module_remove_modinfo_attrs(struct module *mod)
+{ }
+
+#endif /* CONFIG_SYSFS */
+
+#if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES)
+
+void module_add_driver(struct module *mod, struct device_driver *drv);
+void module_remove_driver(struct device_driver *drv);
+
+#else /* not both CONFIG_SYSFS && CONFIG_MODULES */
+
+static inline void module_add_driver(struct module *mod, struct device_driver *drv)
+{ }
+
+static inline void module_remove_driver(struct device_driver *drv)
+{ }
+
+#endif
 
 #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
 
index 4a189dadb1607a0984cb41cac9f389d2a86afc65..b26b2e5fedc7146f3c21db9c8e5e382b3164f718 100644 (file)
@@ -169,10 +169,22 @@ extern int param_get_string(char *buffer, struct kernel_param *kp);
 
 struct module;
 
+#if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES)
 extern int module_param_sysfs_setup(struct module *mod,
                                    struct kernel_param *kparam,
                                    unsigned int num_params);
 
 extern void module_param_sysfs_remove(struct module *mod);
+#else
+static inline int module_param_sysfs_setup(struct module *mod,
+                            struct kernel_param *kparam,
+                            unsigned int num_params)
+{
+       return 0;
+}
+
+static inline void module_param_sysfs_remove(struct module *mod)
+{ }
+#endif
 
 #endif /* _LINUX_MODULE_PARAMS_H */
index 98c8765a488e831cad0e35adef583fcf0c93cbe2..2c4b6842dfb91950d5007a3947aa4a0306a8940d 100644 (file)
@@ -854,5 +854,8 @@ extern int pci_pci_problems;
 #define PCIPCI_ALIMAGIK                32      /* Need low latency setting */
 #define PCIAGP_FAIL            64      /* No PCI to AGP DMA */
 
+extern unsigned long pci_cardbus_io_size;
+extern unsigned long pci_cardbus_mem_size;
+
 #endif /* __KERNEL__ */
 #endif /* LINUX_PCI_H */
index 182a96f77c8437d28987bd93a12dcb2eccef98ab..600308fdf9ce31b6ece7efc34dbbc6fe633888e6 100644 (file)
 #define PCI_VENDOR_ID_PASEMI           0x1959
 
 #define PCI_VENDOR_ID_ATTANSIC         0x1969
+#define PCI_DEVICE_ID_ATTANSIC_L1      0x1048
 
 #define PCI_VENDOR_ID_JMICRON          0x197B
 #define PCI_DEVICE_ID_JMICRON_JMB360   0x2360
index b5c226a87ed87640252139a6dda2f701aa4636bc..a8e8d1ecebb17b4bbcd6e36c93d18947e78624b1 100644 (file)
@@ -935,7 +935,7 @@ struct usb_iso_packet_descriptor {
        unsigned int offset;
        unsigned int length;            /* expected length */
        unsigned int actual_length;
-       unsigned int status;
+       int status;
 };
 
 struct urb;
index ba617c3724552a91bca0147b8150b8ddad549691..956edf3bbecb3d13769bc7e21e7053a16161e346 100644 (file)
@@ -73,6 +73,13 @@ struct usb_cdc_acm_descriptor {
        __u8    bmCapabilities;
 } __attribute__ ((packed));
 
+/* capabilities from 5.2.3.3 */
+
+#define USB_CDC_COMM_FEATURE   0x01
+#define USB_CDC_CAP_LINE       0x02
+#define USB_CDC_CAP_BRK        0x04
+#define USB_CDC_CAP_NOTIFY     0x08
+
 /* "Union Functional Descriptor" from CDC spec 5.2.3.8 */
 struct usb_cdc_union_desc {
        __u8    bLength;
index ae7833749fa2c3b0f6e0cbc69744efe6734dcdff..245c72531228346982598506248d68fa03d16461 100644 (file)
@@ -367,7 +367,7 @@ struct usb_debug_descriptor {
        /* bulk endpoints with 8 byte maxpacket */
        __u8  bDebugInEndpoint;
        __u8  bDebugOutEndpoint;
-};
+} __attribute__((packed));
 
 /*-------------------------------------------------------------------------*/
 
@@ -396,7 +396,7 @@ struct usb_security_descriptor {
 
        __le16 wTotalLength;
        __u8  bNumEncryptionTypes;
-};
+} __attribute__((packed));
 
 /*-------------------------------------------------------------------------*/
 
@@ -410,7 +410,7 @@ struct usb_key_descriptor {
        __u8  tTKID[3];
        __u8  bReserved;
        __u8  bKeyData[0];
-};
+} __attribute__((packed));
 
 /*-------------------------------------------------------------------------*/
 
@@ -426,7 +426,7 @@ struct usb_encryption_descriptor {
 #define        USB_ENC_TYPE_RSA_1              3       /* rsa3072/sha1 auth */
        __u8  bEncryptionValue;         /* use in SET_ENCRYPTION */
        __u8  bAuthKeyIndex;
-};
+} __attribute__((packed));
 
 
 /*-------------------------------------------------------------------------*/
@@ -438,7 +438,7 @@ struct usb_bos_descriptor {
 
        __le16 wTotalLength;
        __u8  bNumDeviceCaps;
-};
+} __attribute__((packed));
 
 /*-------------------------------------------------------------------------*/
 
@@ -447,7 +447,7 @@ struct usb_dev_cap_header {
        __u8  bLength;
        __u8  bDescriptorType;
        __u8  bDevCapabilityType;
-};
+} __attribute__((packed));
 
 #define        USB_CAP_TYPE_WIRELESS_USB       1
 
@@ -475,7 +475,7 @@ struct usb_wireless_cap_descriptor {        /* Ultra Wide Band */
        __u8  bmFFITXPowerInfo; /* FFI power levels */
        __le16 bmBandGroup;
        __u8  bReserved;
-};
+} __attribute__((packed));
 
 /*-------------------------------------------------------------------------*/
 
@@ -496,7 +496,7 @@ struct usb_wireless_ep_comp_descriptor {
 #define USB_ENDPOINT_SWITCH_NO         0
 #define USB_ENDPOINT_SWITCH_SWITCH     1
 #define USB_ENDPOINT_SWITCH_SCALE      2
-};
+} __attribute__((packed));
 
 /*-------------------------------------------------------------------------*/
 
@@ -512,7 +512,7 @@ struct usb_handshake {
        __u8 CDID[16];
        __u8 nonce[16];
        __u8 MIC[8];
-};
+} __attribute__((packed));
 
 /*-------------------------------------------------------------------------*/
 
@@ -524,7 +524,7 @@ struct usb_connection_context {
        __u8 CHID[16];          /* persistent host id */
        __u8 CDID[16];          /* device id (unique w/in host context) */
        __u8 CK[16];            /* connection key */
-};
+} __attribute__((packed));
 
 /*-------------------------------------------------------------------------*/
 
index 33dcd857669643309f4f17ae206555f782160545..32acbae28d24d34a1ea9d011945e7cc5e9e3ee06 100644 (file)
@@ -54,6 +54,8 @@
  * @write_wait: a wait_queue_head_t used by the port.
  * @work: work queue entry for the line discipline waking up.
  * @open_count: number of times this port has been opened.
+ * @throttled: nonzero if the read urb is inactive to throttle the device
+ * @throttle_req: nonzero if the tty wants to throttle us
  *
  * This structure is used by the usb-serial core and drivers for the specific
  * ports of a device.
@@ -88,6 +90,8 @@ struct usb_serial_port {
        wait_queue_head_t       write_wait;
        struct work_struct      work;
        int                     open_count;
+       char                    throttled;
+       char                    throttle_req;
        struct device           dev;
 };
 #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev)
@@ -269,6 +273,8 @@ extern int usb_serial_generic_write_room (struct usb_serial_port *port);
 extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port);
 extern void usb_serial_generic_read_bulk_callback (struct urb *urb);
 extern void usb_serial_generic_write_bulk_callback (struct urb *urb);
+extern void usb_serial_generic_throttle (struct usb_serial_port *port);
+extern void usb_serial_generic_unthrottle (struct usb_serial_port *port);
 extern void usb_serial_generic_shutdown (struct usb_serial *serial);
 extern int usb_serial_generic_register (int debug);
 extern void usb_serial_generic_deregister (void);
index 2ae76fe52ff75e483806cd48c2f3e29fadfd89ac..1b792b9286bae2a499fd5aa46ff1b4ccc1a5aeec 100644 (file)
@@ -46,7 +46,9 @@
        US_FLAG(MAX_SECTORS_64, 0x00000400)                     \
                /* Sets max_sectors to 64    */                 \
        US_FLAG(IGNORE_DEVICE,  0x00000800)                     \
-               /* Don't claim device */
+               /* Don't claim device */                        \
+       US_FLAG(CAPACITY_HEURISTICS,    0x00001000)             \
+               /* sometimes sizes is too big */
 
 #define US_FLAG(name, value)   US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };
index 617d8a1c59aeb0c38b82cb6e06ec201f43091f4b..342dd5a7e8bb822f139955bb91ba9cab069b3e2f 100644 (file)
@@ -159,9 +159,9 @@ struct usbdevfs_ioctl32 {
 #define USBDEVFS_SUBMITURB32       _IOR('U', 10, struct usbdevfs_urb32)
 #define USBDEVFS_DISCARDURB        _IO('U', 11)
 #define USBDEVFS_REAPURB           _IOW('U', 12, void *)
-#define USBDEVFS_REAPURB32         _IOW('U', 12, u32)
+#define USBDEVFS_REAPURB32         _IOW('U', 12, __u32)
 #define USBDEVFS_REAPURBNDELAY     _IOW('U', 13, void *)
-#define USBDEVFS_REAPURBNDELAY32   _IOW('U', 13, u32)
+#define USBDEVFS_REAPURBNDELAY32   _IOW('U', 13, __u32)
 #define USBDEVFS_DISCSIGNAL        _IOR('U', 14, struct usbdevfs_disconnectsignal)
 #define USBDEVFS_CLAIMINTERFACE    _IOR('U', 15, unsigned int)
 #define USBDEVFS_RELEASEINTERFACE  _IOR('U', 16, unsigned int)
index c1da8558339a266e7c1d0fecf7c20c22379edd44..eae7e2e844974b903dd3b0094a5ead23da7546ac 100644 (file)
@@ -95,6 +95,7 @@
 #define PRODID_QUATECH_DUAL_RS232      0x0012
 #define PRODID_QUATECH_DUAL_RS232_D1   0x0007
 #define PRODID_QUATECH_DUAL_RS232_D2   0x0052
+#define PRODID_QUATECH_DUAL_RS232_G    0x004d
 #define PRODID_QUATECH_QUAD_RS232      0x001b
 #define PRODID_QUATECH_DUAL_RS422      0x000e
 #define PRODID_QUATECH_QUAD_RS422      0x0045
index c094e501286229bbc699bc74534c088235a7a436..c36750ff6ae82caf596aaee36d25de55e9d4316a 100644 (file)
@@ -110,6 +110,12 @@ static inline void ib_addr_set_pkey(struct rdma_dev_addr *dev_addr, u16 pkey)
        dev_addr->broadcast[9] = (unsigned char) pkey;
 }
 
+static inline void ib_addr_get_mgid(struct rdma_dev_addr *dev_addr,
+                                   union ib_gid *gid)
+{
+       memcpy(gid, dev_addr->broadcast + 4, sizeof *gid);
+}
+
 static inline void ib_addr_get_sgid(struct rdma_dev_addr *dev_addr,
                                    union ib_gid *gid)
 {
index 97715b0c20b69f6e50b75b2c03e24fa50758fdb6..5e26b2f53f86e198f1c8893c72d460d624a4c419 100644 (file)
@@ -285,18 +285,6 @@ int ib_sa_path_rec_get(struct ib_sa_client *client,
                       void *context,
                       struct ib_sa_query **query);
 
-int ib_sa_mcmember_rec_query(struct ib_sa_client *client,
-                            struct ib_device *device, u8 port_num,
-                            u8 method,
-                            struct ib_sa_mcmember_rec *rec,
-                            ib_sa_comp_mask comp_mask,
-                            int timeout_ms, gfp_t gfp_mask,
-                            void (*callback)(int status,
-                                             struct ib_sa_mcmember_rec *resp,
-                                             void *context),
-                            void *context,
-                            struct ib_sa_query **query);
-
 int ib_sa_service_rec_query(struct ib_sa_client *client,
                         struct ib_device *device, u8 port_num,
                         u8 method,
@@ -309,93 +297,82 @@ int ib_sa_service_rec_query(struct ib_sa_client *client,
                         void *context,
                         struct ib_sa_query **sa_query);
 
+struct ib_sa_multicast {
+       struct ib_sa_mcmember_rec rec;
+       ib_sa_comp_mask         comp_mask;
+       int                     (*callback)(int status,
+                                           struct ib_sa_multicast *multicast);
+       void                    *context;
+};
+
 /**
- * ib_sa_mcmember_rec_set - Start an MCMember set query
- * @client:SA client
- * @device:device to send query on
- * @port_num: port number to send query on
- * @rec:MCMember Record to send in query
- * @comp_mask:component mask to send in query
- * @timeout_ms:time to wait for response
- * @gfp_mask:GFP mask to use for internal allocations
- * @callback:function called when query completes, times out or is
- * canceled
- * @context:opaque user context passed to callback
- * @sa_query:query context, used to cancel query
+ * ib_sa_join_multicast - Initiates a join request to the specified multicast
+ *   group.
+ * @client: SA client
+ * @device: Device associated with the multicast group.
+ * @port_num: Port on the specified device to associate with the multicast
+ *   group.
+ * @rec: SA multicast member record specifying group attributes.
+ * @comp_mask: Component mask indicating which group attributes of %rec are
+ *   valid.
+ * @gfp_mask: GFP mask for memory allocations.
+ * @callback: User callback invoked once the join operation completes.
+ * @context: User specified context stored with the ib_sa_multicast structure.
  *
- * Send an MCMember Set query to the SA (eg to join a multicast
- * group).  The callback function will be called when the query
- * completes (or fails); status is 0 for a successful response, -EINTR
- * if the query is canceled, -ETIMEDOUT is the query timed out, or
- * -EIO if an error occurred sending the query.  The resp parameter of
- * the callback is only valid if status is 0.
+ * This call initiates a multicast join request with the SA for the specified
+ * multicast group.  If the join operation is started successfully, it returns
+ * an ib_sa_multicast structure that is used to track the multicast operation.
+ * Users must free this structure by calling ib_free_multicast, even if the
+ * join operation later fails.  (The callback status is non-zero.)
  *
- * If the return value of ib_sa_mcmember_rec_set() is negative, it is
- * an error code.  Otherwise it is a query ID that can be used to
- * cancel the query.
+ * If the join operation fails; status will be non-zero, with the following
+ * failures possible:
+ * -ETIMEDOUT: The request timed out.
+ * -EIO: An error occurred sending the query.
+ * -EINVAL: The MCMemberRecord values differed from the existing group's.
+ * -ENETRESET: Indicates that an fatal error has occurred on the multicast
+ *   group, and the user must rejoin the group to continue using it.
  */
-static inline int
-ib_sa_mcmember_rec_set(struct ib_sa_client *client,
-                      struct ib_device *device, u8 port_num,
-                      struct ib_sa_mcmember_rec *rec,
-                      ib_sa_comp_mask comp_mask,
-                      int timeout_ms, gfp_t gfp_mask,
-                      void (*callback)(int status,
-                                       struct ib_sa_mcmember_rec *resp,
-                                       void *context),
-                      void *context,
-                      struct ib_sa_query **query)
-{
-       return ib_sa_mcmember_rec_query(client, device, port_num,
-                                       IB_MGMT_METHOD_SET,
-                                       rec, comp_mask,
-                                       timeout_ms, gfp_mask, callback,
-                                       context, query);
-}
+struct ib_sa_multicast *ib_sa_join_multicast(struct ib_sa_client *client,
+                                            struct ib_device *device, u8 port_num,
+                                            struct ib_sa_mcmember_rec *rec,
+                                            ib_sa_comp_mask comp_mask, gfp_t gfp_mask,
+                                            int (*callback)(int status,
+                                                            struct ib_sa_multicast
+                                                                   *multicast),
+                                            void *context);
 
 /**
- * ib_sa_mcmember_rec_delete - Start an MCMember delete query
- * @client:SA client
- * @device:device to send query on
- * @port_num: port number to send query on
- * @rec:MCMember Record to send in query
- * @comp_mask:component mask to send in query
- * @timeout_ms:time to wait for response
- * @gfp_mask:GFP mask to use for internal allocations
- * @callback:function called when query completes, times out or is
- * canceled
- * @context:opaque user context passed to callback
- * @sa_query:query context, used to cancel query
- *
- * Send an MCMember Delete query to the SA (eg to leave a multicast
- * group).  The callback function will be called when the query
- * completes (or fails); status is 0 for a successful response, -EINTR
- * if the query is canceled, -ETIMEDOUT is the query timed out, or
- * -EIO if an error occurred sending the query.  The resp parameter of
- * the callback is only valid if status is 0.
+ * ib_free_multicast - Frees the multicast tracking structure, and releases
+ *    any reference on the multicast group.
+ * @multicast: Multicast tracking structure allocated by ib_join_multicast.
  *
- * If the return value of ib_sa_mcmember_rec_delete() is negative, it
- * is an error code.  Otherwise it is a query ID that can be used to
- * cancel the query.
+ * This call blocks until the multicast identifier is destroyed.  It may
+ * not be called from within the multicast callback; however, returning a non-
+ * zero value from the callback will result in destroying the multicast
+ * tracking structure.
+ */
+void ib_sa_free_multicast(struct ib_sa_multicast *multicast);
+
+/**
+ * ib_get_mcmember_rec - Looks up a multicast member record by its MGID and
+ *   returns it if found.
+ * @device: Device associated with the multicast group.
+ * @port_num: Port on the specified device to associate with the multicast
+ *   group.
+ * @mgid: MGID of multicast group.
+ * @rec: Location to copy SA multicast member record.
  */
-static inline int
-ib_sa_mcmember_rec_delete(struct ib_sa_client *client,
-                         struct ib_device *device, u8 port_num,
-                         struct ib_sa_mcmember_rec *rec,
-                         ib_sa_comp_mask comp_mask,
-                         int timeout_ms, gfp_t gfp_mask,
-                         void (*callback)(int status,
-                                          struct ib_sa_mcmember_rec *resp,
-                                          void *context),
-                         void *context,
-                         struct ib_sa_query **query)
-{
-       return ib_sa_mcmember_rec_query(client, device, port_num,
-                                       IB_SA_METHOD_DELETE,
-                                       rec, comp_mask,
-                                       timeout_ms, gfp_mask, callback,
-                                       context, query);
-}
+int ib_sa_get_mcmember_rec(struct ib_device *device, u8 port_num,
+                          union ib_gid *mgid, struct ib_sa_mcmember_rec *rec);
+
+/**
+ * ib_init_ah_from_mcmember - Initialize address handle attributes based on
+ * an SA multicast member record.
+ */
+int ib_init_ah_from_mcmember(struct ib_device *device, u8 port_num,
+                            struct ib_sa_mcmember_rec *rec,
+                            struct ib_ah_attr *ah_attr);
 
 /**
  * ib_init_ah_from_path - Initialize address handle attributes based on an SA
index 36cd8a8526a06f39b40af1b5106967ec67394f97..2d6a7705eae7fbafbbaab4a8a9d8d6c9fde8ceac 100644 (file)
@@ -52,10 +52,13 @@ enum rdma_cm_event_type {
        RDMA_CM_EVENT_ESTABLISHED,
        RDMA_CM_EVENT_DISCONNECTED,
        RDMA_CM_EVENT_DEVICE_REMOVAL,
+       RDMA_CM_EVENT_MULTICAST_JOIN,
+       RDMA_CM_EVENT_MULTICAST_ERROR
 };
 
 enum rdma_port_space {
        RDMA_PS_SDP  = 0x0001,
+       RDMA_PS_IPOIB= 0x0002,
        RDMA_PS_TCP  = 0x0106,
        RDMA_PS_UDP  = 0x0111,
        RDMA_PS_SCTP = 0x0183
@@ -294,5 +297,21 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
  */
 int rdma_disconnect(struct rdma_cm_id *id);
 
-#endif /* RDMA_CM_H */
+/**
+ * rdma_join_multicast - Join the multicast group specified by the given
+ *   address.
+ * @id: Communication identifier associated with the request.
+ * @addr: Multicast address identifying the group to join.
+ * @context: User-defined context associated with the join request, returned
+ * to the user through the private_data pointer in multicast events.
+ */
+int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
+                       void *context);
 
+/**
+ * rdma_leave_multicast - Leave the multicast group specified by the given
+ *   address.
+ */
+void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr);
+
+#endif /* RDMA_CM_H */
index 9b176df1d66706d2eef11daff8409a93464365fa..950424b38f1605b17adc6d41a961e7f629cf0c01 100644 (file)
@@ -44,7 +44,7 @@
 int rdma_set_ib_paths(struct rdma_cm_id *id,
                      struct ib_sa_path_rec *path_rec, int num_paths);
 
-/* Global qkey for UD QPs and multicast groups. */
-#define RDMA_UD_QKEY 0x01234567
+/* Global qkey for UDP QPs and multicast groups. */
+#define RDMA_UDP_QKEY 0x01234567
 
 #endif /* RDMA_CM_IB_H */
index 9572ab8eeac19e74fbd393c4b34d90fca23dc8ab..f632b0c007c9808eb0f50e60bdab3b30c0775e38 100644 (file)
@@ -38,7 +38,7 @@
 #include <rdma/ib_user_verbs.h>
 #include <rdma/ib_user_sa.h>
 
-#define RDMA_USER_CM_ABI_VERSION       3
+#define RDMA_USER_CM_ABI_VERSION       4
 
 #define RDMA_MAX_PRIVATE_DATA          256
 
@@ -58,7 +58,9 @@ enum {
        RDMA_USER_CM_CMD_GET_EVENT,
        RDMA_USER_CM_CMD_GET_OPTION,
        RDMA_USER_CM_CMD_SET_OPTION,
-       RDMA_USER_CM_CMD_NOTIFY
+       RDMA_USER_CM_CMD_NOTIFY,
+       RDMA_USER_CM_CMD_JOIN_MCAST,
+       RDMA_USER_CM_CMD_LEAVE_MCAST
 };
 
 /*
@@ -188,6 +190,13 @@ struct rdma_ucm_notify {
        __u32 event;
 };
 
+struct rdma_ucm_join_mcast {
+       __u64 response;         /* rdma_ucm_create_id_resp */
+       __u64 uid;
+       struct sockaddr_in6 addr;
+       __u32 id;
+};
+
 struct rdma_ucm_get_event {
        __u64 response;
 };
index ebf31b16dc49eee41786123bad30f36405faae20..9dd37e2f5a84df84deb91554f85372966cf2e6d8 100644 (file)
@@ -122,6 +122,7 @@ struct scsi_device {
        unsigned no_uld_attach:1; /* disable connecting to upper level drivers */
        unsigned select_no_atn:1;
        unsigned fix_capacity:1;        /* READ_CAPACITY is too high by 1 */
+       unsigned guess_capacity:1;      /* READ_CAPACITY might be too high by 1 */
        unsigned retry_hwerror:1;       /* Retry HARDWARE_ERROR */
 
        unsigned int device_blocked;    /* Device returned QUEUE_FULL. */
index 796276141e51902bd466b1f5b81b5220c109ca4a..9f923f8ce6a0cd3c225f73eb79c865777ac60967 100644 (file)
@@ -36,6 +36,8 @@
 #include <linux/resource.h>
 #include <asm/uaccess.h>
 
+extern int delete_module(const char *name, unsigned int flags);
+
 extern int max_threads;
 
 static struct workqueue_struct *khelper_wq;
@@ -46,6 +48,7 @@ static struct workqueue_struct *khelper_wq;
        modprobe_path is set via /proc/sys.
 */
 char modprobe_path[KMOD_PATH_LEN] = "/sbin/modprobe";
+struct module_kobject kmod_mk;
 
 /**
  * request_module - try to load a kernel module
@@ -75,6 +78,11 @@ int request_module(const char *fmt, ...)
        static atomic_t kmod_concurrent = ATOMIC_INIT(0);
 #define MAX_KMOD_CONCURRENT 50 /* Completely arbitrary value - KAO */
        static int kmod_loop_msg;
+       char modalias[16 + MODULE_NAME_LEN] = "MODALIAS=";
+       char *uevent_envp[2] = {
+               modalias,
+               NULL
+       };
 
        va_start(args, fmt);
        ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
@@ -82,6 +90,12 @@ int request_module(const char *fmt, ...)
        if (ret >= MODULE_NAME_LEN)
                return -ENAMETOOLONG;
 
+       strcpy(&modalias[strlen("MODALIAS=")], module_name);
+       kobject_uevent_env(&kmod_mk.kobj, KOBJ_CHANGE, uevent_envp);
+
+       if (modprobe_path[0] == '\0')
+               goto out;
+
        /* If modprobe needs a service that is in a module, we get a recursive
         * loop.  Limit the number of running kmod threads to max_threads/2 or
         * MAX_KMOD_CONCURRENT, whichever is the smaller.  A cleaner method
@@ -108,9 +122,115 @@ int request_module(const char *fmt, ...)
 
        ret = call_usermodehelper(modprobe_path, argv, envp, 1);
        atomic_dec(&kmod_concurrent);
+out:
        return ret;
 }
 EXPORT_SYMBOL(request_module);
+
+static ssize_t store_mod_request(struct module_attribute *mattr,
+                                struct module *mod,
+                             const char *buffer, size_t count)
+{
+       char name[MODULE_NAME_LEN];
+       int ret;
+
+       if (count < 1 || count+1 > MODULE_NAME_LEN)
+               return -EINVAL;
+       memcpy(name, buffer, count);
+       name[count] = '\0';
+       if (name[count-1] == '\n')
+               name[count-1] = '\0';
+
+       ret = request_module(name);
+       if (ret < 0)
+               return ret;
+       return count;
+}
+
+static struct module_attribute mod_request = {
+       .attr = { .name = "mod_request", .mode = S_IWUSR, .owner = THIS_MODULE },
+       .store = store_mod_request,
+};
+
+#ifdef CONFIG_MODULE_UNLOAD
+static ssize_t store_mod_unload(struct module_attribute *mattr,
+                           struct module *mod,
+                           const char *buffer, size_t count)
+{
+       char name[MODULE_NAME_LEN];
+       int ret;
+
+       if (count < 1 || count+1 > MODULE_NAME_LEN)
+               return -EINVAL;
+       memcpy(name, buffer, count);
+       name[count] = '\0';
+       if (name[count-1] == '\n')
+               name[count-1] = '\0';
+
+       ret = delete_module(name, O_NONBLOCK);
+       if (ret < 0)
+               return ret;
+       return count;
+}
+
+static struct module_attribute mod_unload = {
+       .attr = { .name = "mod_unload", .mode = S_IWUSR, .owner = THIS_MODULE },
+       .store = store_mod_unload,
+};
+#endif
+
+static ssize_t show_mod_request_helper(struct module_attribute *mattr,
+                                      struct module *mod,
+                                      char *buffer)
+{
+       return sprintf(buffer, "%s\n", modprobe_path);
+}
+
+static ssize_t store_mod_request_helper(struct module_attribute *mattr,
+                                       struct module *mod,
+                                       const char *buffer, size_t count)
+{
+       if (count < 1 || count+1 > KMOD_PATH_LEN)
+               return -EINVAL;
+       memcpy(modprobe_path, buffer, count);
+       modprobe_path[count] = '\0';
+       if (modprobe_path[count-1] == '\n')
+               modprobe_path[count-1] = '\0';
+       return count;
+}
+
+static struct module_attribute mod_request_helper = {
+       .attr = {
+               .name = "mod_request_helper",
+               .mode = S_IWUSR | S_IRUGO,
+               .owner = THIS_MODULE
+       },
+       .show = show_mod_request_helper,
+       .store = store_mod_request_helper,
+};
+
+void __init kmod_sysfs_init(void)
+{
+       int ret;
+
+       kmod_mk.mod = THIS_MODULE;
+       kobj_set_kset_s(&kmod_mk, module_subsys);
+       kobject_set_name(&kmod_mk.kobj, "kmod");
+       kobject_init(&kmod_mk.kobj);
+       ret = kobject_add(&kmod_mk.kobj);
+       if (ret < 0)
+               goto out;
+
+       ret = sysfs_create_file(&kmod_mk.kobj, &mod_request_helper.attr);
+       ret = sysfs_create_file(&kmod_mk.kobj, &mod_request.attr);
+#ifdef CONFIG_MODULE_UNLOAD
+       ret = sysfs_create_file(&kmod_mk.kobj, &mod_unload.attr);
+#endif
+
+       kobject_uevent(&kmod_mk.kobj, KOBJ_ADD);
+out:
+       return;
+}
 #endif /* CONFIG_KMOD */
 
 struct subprocess_info {
index 8a94e054230c07abb5371c8e8b4e369f3e8476bd..8c25b1a04fa6d8f3dbbda8f57a045cc2d32714bd 100644 (file)
@@ -653,20 +653,11 @@ static void wait_for_zero_refcount(struct module *mod)
        mutex_lock(&module_mutex);
 }
 
-asmlinkage long
-sys_delete_module(const char __user *name_user, unsigned int flags)
+int delete_module(const char *name, unsigned int flags)
 {
        struct module *mod;
-       char name[MODULE_NAME_LEN];
        int ret, forced = 0;
 
-       if (!capable(CAP_SYS_MODULE))
-               return -EPERM;
-
-       if (strncpy_from_user(name, name_user, MODULE_NAME_LEN-1) < 0)
-               return -EFAULT;
-       name[MODULE_NAME_LEN-1] = '\0';
-
        if (mutex_lock_interruptible(&module_mutex) != 0)
                return -EINTR;
 
@@ -727,6 +718,21 @@ sys_delete_module(const char __user *name_user, unsigned int flags)
        return ret;
 }
 
+asmlinkage long
+sys_delete_module(const char __user *name_user, unsigned int flags)
+{
+       char name[MODULE_NAME_LEN];
+
+       if (!capable(CAP_SYS_MODULE))
+               return -EPERM;
+
+       if (strncpy_from_user(name, name_user, MODULE_NAME_LEN-1) < 0)
+               return -EFAULT;
+       name[MODULE_NAME_LEN-1] = '\0';
+
+       return delete_module(name, flags);
+}
+
 static void print_unload_info(struct seq_file *m, struct module *mod)
 {
        struct module_use *use;
@@ -1068,7 +1074,8 @@ static inline void remove_sect_attrs(struct module *mod)
 }
 #endif /* CONFIG_KALLSYMS */
 
-static int module_add_modinfo_attrs(struct module *mod)
+#ifdef CONFIG_SYSFS
+int module_add_modinfo_attrs(struct module *mod)
 {
        struct module_attribute *attr;
        struct module_attribute *temp_attr;
@@ -1094,7 +1101,7 @@ static int module_add_modinfo_attrs(struct module *mod)
        return error;
 }
 
-static void module_remove_modinfo_attrs(struct module *mod)
+void module_remove_modinfo_attrs(struct module *mod)
 {
        struct module_attribute *attr;
        int i;
@@ -1109,8 +1116,10 @@ static void module_remove_modinfo_attrs(struct module *mod)
        }
        kfree(mod->modinfo_attrs);
 }
+#endif
 
-static int mod_sysfs_init(struct module *mod)
+#ifdef CONFIG_SYSFS
+int mod_sysfs_init(struct module *mod)
 {
        int err;
 
@@ -1133,7 +1142,7 @@ out:
        return err;
 }
 
-static int mod_sysfs_setup(struct module *mod,
+int mod_sysfs_setup(struct module *mod,
                           struct kernel_param *kparam,
                           unsigned int num_params)
 {
@@ -1169,16 +1178,14 @@ out_unreg:
 out:
        return err;
 }
+#endif
 
 static void mod_kobject_remove(struct module *mod)
 {
        module_remove_modinfo_attrs(mod);
        module_param_sysfs_remove(mod);
-       if (mod->mkobj.drivers_dir)
-               kobject_unregister(mod->mkobj.drivers_dir);
-       if (mod->holders_dir)
-               kobject_unregister(mod->holders_dir);
-
+       kobject_unregister(mod->mkobj.drivers_dir);
+       kobject_unregister(mod->holders_dir);
        kobject_unregister(&mod->mkobj.kobj);
 }
 
@@ -2345,6 +2352,7 @@ void print_modules(void)
        printk("\n");
 }
 
+#ifdef CONFIG_SYSFS
 static char *make_driver_name(struct device_driver *drv)
 {
        char *driver_name;
@@ -2419,6 +2427,7 @@ void module_remove_driver(struct device_driver *drv)
        }
 }
 EXPORT_SYMBOL(module_remove_driver);
+#endif
 
 #ifdef CONFIG_MODVERSIONS
 /* Generate the signature for struct module here, too, for modversions. */
index 553cf7d6a4be113f0dcb89f1be51aa9989d51453..7a751570b56d78222d9f2510938834f3391bfc45 100644 (file)
@@ -30,8 +30,6 @@
 #define DEBUGP(fmt, a...)
 #endif
 
-static struct kobj_type module_ktype;
-
 static inline char dash2underscore(char c)
 {
        if (c == '-')
@@ -391,6 +389,7 @@ struct module_param_attrs
        struct param_attribute attrs[0];
 };
 
+#ifdef CONFIG_SYSFS
 #define to_param_attr(n) container_of(n, struct param_attribute, mattr);
 
 static ssize_t param_attr_show(struct module_attribute *mattr,
@@ -426,6 +425,7 @@ static ssize_t param_attr_store(struct module_attribute *mattr,
                return len;
        return err;
 }
+#endif
 
 #ifdef CONFIG_MODULES
 #define __modinit
@@ -433,6 +433,7 @@ static ssize_t param_attr_store(struct module_attribute *mattr,
 #define __modinit __init
 #endif
 
+#ifdef CONFIG_SYSFS
 /*
  * param_sysfs_setup - setup sysfs support for one module or KBUILD_MODNAME
  * @mk: struct module_kobject (contains parent kobject)
@@ -500,9 +501,7 @@ param_sysfs_setup(struct module_kobject *mk,
        return mp;
 }
 
-
 #ifdef CONFIG_MODULES
-
 /*
  * module_param_sysfs_setup - setup sysfs support for one module
  * @mod: module
@@ -625,7 +624,6 @@ static void __init param_sysfs_builtin(void)
 
 
 /* module-related sysfs stuff */
-#ifdef CONFIG_SYSFS
 
 #define to_module_attr(n) container_of(n, struct module_attribute, attr);
 #define to_module_kobject(n) container_of(n, struct module_kobject, kobj);
@@ -673,6 +671,8 @@ static struct sysfs_ops module_sysfs_ops = {
        .store = module_attr_store,
 };
 
+static struct kobj_type module_ktype;
+
 static int uevent_filter(struct kset *kset, struct kobject *kobj)
 {
        struct kobj_type *ktype = get_ktype(kobj);
@@ -686,19 +686,12 @@ static struct kset_uevent_ops module_uevent_ops = {
        .filter = uevent_filter,
 };
 
-#else
-static struct sysfs_ops module_sysfs_ops = {
-       .show = NULL,
-       .store = NULL,
-};
-#endif
+decl_subsys(module, &module_ktype, &module_uevent_ops);
 
 static struct kobj_type module_ktype = {
        .sysfs_ops =    &module_sysfs_ops,
 };
 
-decl_subsys(module, &module_ktype, &module_uevent_ops);
-
 /*
  * param_sysfs_init - wrapper for built-in params support
  */
@@ -714,11 +707,21 @@ static int __init param_sysfs_init(void)
        }
 
        param_sysfs_builtin();
+       kmod_sysfs_init();
 
        return 0;
 }
 subsys_initcall(param_sysfs_init);
 
+#else
+#if 0
+static struct sysfs_ops module_sysfs_ops = {
+       .show = NULL,
+       .store = NULL,
+};
+#endif
+#endif
+
 EXPORT_SYMBOL(param_set_byte);
 EXPORT_SYMBOL(param_get_byte);
 EXPORT_SYMBOL(param_set_short);
index 2782f49e906ec3e2315028041ca54681239e55a7..f4f6176dcd1286313c57ae80239ec1f0f7bbf65e 100644 (file)
@@ -171,7 +171,7 @@ int kobject_shadow_add(struct kobject * kobj, struct dentry *shadow_parent)
                return -ENOENT;
        if (!kobj->k_name)
                kobj->k_name = kobj->name;
-       if (!kobj->k_name) {
+       if (!*kobj->k_name) {
                pr_debug("kobject attempted to be registered with no name!\n");
                WARN_ON(1);
                return -EINVAL;
@@ -326,6 +326,7 @@ int kobject_rename(struct kobject * kobj, const char *new_name)
 /**
  *     kobject_rename - change the name of an object
  *     @kobj:  object in question.
+ *     @new_parent: object's new parent
  *     @new_name: object's new name
  */
 
index 6189dc03108d2da67aad2a155a3d53011a30daa0..4cbb1290a6a34707c93b0ddfa040a06f1d1d47bf 100644 (file)
@@ -340,7 +340,7 @@ static struct attribute_group netstat_group = {
        .attrs  = netstat_attrs,
 };
 
-#ifdef WIRELESS_EXT
+#ifdef CONFIG_WIRELESS_EXT
 /* helper function that does all the locking etc for wireless stats */
 static ssize_t wireless_show(struct device *d, char *buf,
                             ssize_t (*format)(const struct iw_statistics *,
@@ -473,7 +473,7 @@ int netdev_register_sysfs(struct net_device *net)
        if (net->get_stats)
                *groups++ = &netstat_group;
 
-#ifdef WIRELESS_EXT
+#ifdef CONFIG_WIRELESS_EXT
        if (net->wireless_handlers && net->wireless_handlers->get_wireless_stats)
                *groups++ = &wireless_group;
 #endif
index c55949e5c58a990b923e747977e8e536c0f7a5fd..0292d6348e1268671ad71cba02931271122a531e 100644 (file)
@@ -502,9 +502,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
                if (host_encrypt)
                        ieee80211_encrypt_fragment(ieee, skb_frag, hdr_len);
                else if (host_build_iv) {
-                       struct ieee80211_crypt_data *crypt;
-
-                       crypt = ieee->crypt[ieee->tx_keyidx];
                        atomic_inc(&crypt->refcnt);
                        if (crypt->ops->build_iv)
                                crypt->ops->build_iv(skb_frag, hdr_len,
index 53675cf4de44c1bc4968c3227f45ab46fb573921..5190d7acdb9fd6306761c8a7da2a689d561e1f0c 100644 (file)
@@ -65,10 +65,12 @@ static void aaci_ac97_select_codec(struct aaci *aaci, struct snd_ac97 *ac97)
  *  SI1TxEn, SI2TxEn and SI12TxEn bits are set in the AACI_MAINCR
  *  register.
  */
-static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val)
+static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
+                           unsigned short val)
 {
        struct aaci *aaci = ac97->private_data;
        u32 v;
+       int timeout = 5000;
 
        if (ac97->num >= 4)
                return;
@@ -89,7 +91,11 @@ static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned
         */
        do {
                v = readl(aaci->base + AACI_SLFR);
-       } while (v & (SLFR_1TXB|SLFR_2TXB));
+       } while ((v & (SLFR_1TXB|SLFR_2TXB)) && timeout--);
+
+       if (!timeout)
+               dev_err(&aaci->dev->dev,
+                       "timeout waiting for write to complete\n");
 
        mutex_unlock(&aaci->ac97_sem);
 }
@@ -101,6 +107,8 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
 {
        struct aaci *aaci = ac97->private_data;
        u32 v;
+       int timeout = 5000;
+       int retries = 10;
 
        if (ac97->num >= 4)
                return ~0;
@@ -119,7 +127,13 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
         */
        do {
                v = readl(aaci->base + AACI_SLFR);
-       } while (v & SLFR_1TXB);
+       } while ((v & SLFR_1TXB) && timeout--);
+
+       if (!timeout) {
+               dev_err(&aaci->dev->dev, "timeout on slot 1 TX busy\n");
+               v = ~0;
+               goto out;
+       }
 
        /*
         * Give the AC'97 codec more than enough time
@@ -130,21 +144,35 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
        /*
         * Wait for slot 2 to indicate data.
         */
+       timeout = 5000;
        do {
                cond_resched();
                v = readl(aaci->base + AACI_SLFR) & (SLFR_1RXV|SLFR_2RXV);
-       } while (v != (SLFR_1RXV|SLFR_2RXV));
+       } while ((v != (SLFR_1RXV|SLFR_2RXV)) && timeout--);
 
-       v = readl(aaci->base + AACI_SL1RX) >> 12;
-       if (v == reg) {
-               v = readl(aaci->base + AACI_SL2RX) >> 4;
-       } else {
-               dev_err(&aaci->dev->dev,
-                       "wrong ac97 register read back (%x != %x)\n",
-                       v, reg);
+       if (!timeout) {
+               dev_err(&aaci->dev->dev, "timeout on RX valid\n");
                v = ~0;
+               goto out;
        }
 
+       do {
+               v = readl(aaci->base + AACI_SL1RX) >> 12;
+               if (v == reg) {
+                       v = readl(aaci->base + AACI_SL2RX) >> 4;
+                       break;
+               } else if (--retries) {
+                       dev_warn(&aaci->dev->dev,
+                                "ac97 read back fail.  retry\n");
+                       continue;
+               } else {
+                       dev_warn(&aaci->dev->dev,
+                               "wrong ac97 register read back (%x != %x)\n",
+                               v, reg);
+                       v = ~0;
+               }
+       } while (retries);
+ out:
        mutex_unlock(&aaci->ac97_sem);
        return v;
 }
@@ -164,10 +192,70 @@ static inline void aaci_chan_wait_ready(struct aaci_runtime *aacirun)
 /*
  * Interrupt support.
  */
-static void aaci_fifo_irq(struct aaci *aaci, u32 mask)
+static void aaci_fifo_irq(struct aaci *aaci, int channel, u32 mask)
 {
+       if (mask & ISR_ORINTR) {
+               dev_warn(&aaci->dev->dev, "RX overrun on chan %d\n", channel);
+               writel(ICLR_RXOEC1 << channel, aaci->base + AACI_INTCLR);
+       }
+
+       if (mask & ISR_RXTOINTR) {
+               dev_warn(&aaci->dev->dev, "RX timeout on chan %d\n", channel);
+               writel(ICLR_RXTOFEC1 << channel, aaci->base + AACI_INTCLR);
+       }
+
+       if (mask & ISR_RXINTR) {
+               struct aaci_runtime *aacirun = &aaci->capture;
+               void *ptr;
+
+               if (!aacirun->substream || !aacirun->start) {
+                       dev_warn(&aaci->dev->dev, "RX interrupt???");
+                       writel(0, aacirun->base + AACI_IE);
+                       return;
+               }
+               ptr = aacirun->ptr;
+
+               do {
+                       unsigned int len = aacirun->fifosz;
+                       u32 val;
+
+                       if (aacirun->bytes <= 0) {
+                               aacirun->bytes += aacirun->period;
+                               aacirun->ptr = ptr;
+                               spin_unlock(&aaci->lock);
+                               snd_pcm_period_elapsed(aacirun->substream);
+                               spin_lock(&aaci->lock);
+                       }
+                       if (!(aacirun->cr & CR_EN))
+                               break;
+
+                       val = readl(aacirun->base + AACI_SR);
+                       if (!(val & SR_RXHF))
+                               break;
+                       if (!(val & SR_RXFF))
+                               len >>= 1;
+
+                       aacirun->bytes -= len;
+
+                       /* reading 16 bytes at a time */
+                       for( ; len > 0; len -= 16) {
+                               asm(
+                                       "ldmia  %1, {r0, r1, r2, r3}\n\t"
+                                       "stmia  %0!, {r0, r1, r2, r3}"
+                                       : "+r" (ptr)
+                                       : "r" (aacirun->fifo)
+                                       : "r0", "r1", "r2", "r3", "cc");
+
+                               if (ptr >= aacirun->end)
+                                       ptr = aacirun->start;
+                       }
+               } while(1);
+               aacirun->ptr = ptr;
+       }
+
        if (mask & ISR_URINTR) {
-               writel(ICLR_TXUEC1, aaci->base + AACI_INTCLR);
+               dev_dbg(&aaci->dev->dev, "TX underrun on chan %d\n", channel);
+               writel(ICLR_TXUEC1 << channel, aaci->base + AACI_INTCLR);
        }
 
        if (mask & ISR_TXINTR) {
@@ -192,7 +280,7 @@ static void aaci_fifo_irq(struct aaci *aaci, u32 mask)
                                snd_pcm_period_elapsed(aacirun->substream);
                                spin_lock(&aaci->lock);
                        }
-                       if (!(aacirun->cr & TXCR_TXEN))
+                       if (!(aacirun->cr & CR_EN))
                                break;
 
                        val = readl(aacirun->base + AACI_SR);
@@ -233,7 +321,7 @@ static irqreturn_t aaci_irq(int irq, void *devid)
                u32 m = mask;
                for (i = 0; i < 4; i++, m >>= 7) {
                        if (m & 0x7f) {
-                               aaci_fifo_irq(aaci, m);
+                               aaci_fifo_irq(aaci, i, m);
                        }
                }
        }
@@ -330,8 +418,9 @@ static struct snd_pcm_hardware aaci_hw_info = {
        .periods_max            = PAGE_SIZE / 16,
 };
 
-static int aaci_pcm_open(struct aaci *aaci, struct snd_pcm_substream *substream,
-                        struct aaci_runtime *aacirun)
+static int __aaci_pcm_open(struct aaci *aaci,
+                          struct snd_pcm_substream *substream,
+                          struct aaci_runtime *aacirun)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        int ret;
@@ -380,7 +469,7 @@ static int aaci_pcm_close(struct snd_pcm_substream *substream)
        struct aaci *aaci = substream->private_data;
        struct aaci_runtime *aacirun = substream->runtime->private_data;
 
-       WARN_ON(aacirun->cr & TXCR_TXEN);
+       WARN_ON(aacirun->cr & CR_EN);
 
        aacirun->substream = NULL;
        free_irq(aaci->dev->irq[0], aaci);
@@ -395,7 +484,7 @@ static int aaci_pcm_hw_free(struct snd_pcm_substream *substream)
        /*
         * This must not be called with the device enabled.
         */
-       WARN_ON(aacirun->cr & TXCR_TXEN);
+       WARN_ON(aacirun->cr & CR_EN);
 
        if (aacirun->pcm_open)
                snd_ac97_pcm_close(aacirun->pcm);
@@ -422,9 +511,15 @@ static int aaci_pcm_hw_params(struct snd_pcm_substream *substream,
        if (err < 0)
                goto out;
 
-       err = snd_ac97_pcm_open(aacirun->pcm, params_rate(params),
-                               params_channels(params),
-                               aacirun->pcm->r[0].slots);
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               err = snd_ac97_pcm_open(aacirun->pcm, params_rate(params),
+                                       params_channels(params),
+                                       aacirun->pcm->r[0].slots);
+       else
+               err = snd_ac97_pcm_open(aacirun->pcm, params_rate(params),
+                                       params_channels(params),
+                                       aacirun->pcm->r[1].slots);
+
        if (err)
                goto out;
 
@@ -467,9 +562,9 @@ static int aaci_pcm_mmap(struct snd_pcm_substream *substream, struct vm_area_str
  * Playback specific ALSA stuff
  */
 static const u32 channels_to_txmask[] = {
-       [2] = TXCR_TX3 | TXCR_TX4,
-       [4] = TXCR_TX3 | TXCR_TX4 | TXCR_TX7 | TXCR_TX8,
-       [6] = TXCR_TX3 | TXCR_TX4 | TXCR_TX7 | TXCR_TX8 | TXCR_TX6 | TXCR_TX9,
+       [2] = CR_SL3 | CR_SL4,
+       [4] = CR_SL3 | CR_SL4 | CR_SL7 | CR_SL8,
+       [6] = CR_SL3 | CR_SL4 | CR_SL7 | CR_SL8 | CR_SL6 | CR_SL9,
 };
 
 /*
@@ -504,7 +599,7 @@ aaci_rule_channels(struct snd_pcm_hw_params *p, struct snd_pcm_hw_rule *rule)
                                 chan_mask);
 }
 
-static int aaci_pcm_playback_open(struct snd_pcm_substream *substream)
+static int aaci_pcm_open(struct snd_pcm_substream *substream)
 {
        struct aaci *aaci = substream->private_data;
        int ret;
@@ -519,7 +614,12 @@ static int aaci_pcm_playback_open(struct snd_pcm_substream *substream)
        if (ret)
                return ret;
 
-       return aaci_pcm_open(aaci, substream, &aaci->playback);
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+               ret = __aaci_pcm_open(aaci, substream, &aaci->playback);
+       } else {
+               ret = __aaci_pcm_open(aaci, substream, &aaci->capture);
+       }
+       return ret;
 }
 
 static int aaci_pcm_playback_hw_params(struct snd_pcm_substream *substream,
@@ -540,11 +640,11 @@ static int aaci_pcm_playback_hw_params(struct snd_pcm_substream *substream,
         * FIXME: double rate slots?
         */
        if (ret >= 0) {
-               aacirun->cr = TXCR_FEN | TXCR_COMPACT | TXCR_TSZ16;
+               aacirun->cr = CR_FEN | CR_COMPACT | CR_SZ16;
                aacirun->cr |= channels_to_txmask[channels];
 
                aacirun->fifosz = aaci->fifosize * 4;
-               if (aacirun->cr & TXCR_COMPACT)
+               if (aacirun->cr & CR_COMPACT)
                        aacirun->fifosz >>= 1;
        }
        return ret;
@@ -557,7 +657,7 @@ static void aaci_pcm_playback_stop(struct aaci_runtime *aacirun)
        ie = readl(aacirun->base + AACI_IE);
        ie &= ~(IE_URIE|IE_TXIE);
        writel(ie, aacirun->base + AACI_IE);
-       aacirun->cr &= ~TXCR_TXEN;
+       aacirun->cr &= ~CR_EN;
        aaci_chan_wait_ready(aacirun);
        writel(aacirun->cr, aacirun->base + AACI_TXCR);
 }
@@ -567,7 +667,7 @@ static void aaci_pcm_playback_start(struct aaci_runtime *aacirun)
        u32 ie;
 
        aaci_chan_wait_ready(aacirun);
-       aacirun->cr |= TXCR_TXEN;
+       aacirun->cr |= CR_EN;
 
        ie = readl(aacirun->base + AACI_IE);
        ie |= IE_URIE | IE_TXIE;
@@ -615,7 +715,7 @@ static int aaci_pcm_playback_trigger(struct snd_pcm_substream *substream, int cm
 }
 
 static struct snd_pcm_ops aaci_playback_ops = {
-       .open           = aaci_pcm_playback_open,
+       .open           = aaci_pcm_open,
        .close          = aaci_pcm_close,
        .ioctl          = snd_pcm_lib_ioctl,
        .hw_params      = aaci_pcm_playback_hw_params,
@@ -626,7 +726,133 @@ static struct snd_pcm_ops aaci_playback_ops = {
        .mmap           = aaci_pcm_mmap,
 };
 
+static int aaci_pcm_capture_hw_params(snd_pcm_substream_t *substream,
+                                     snd_pcm_hw_params_t *params)
+{
+       struct aaci *aaci = substream->private_data;
+       struct aaci_runtime *aacirun = substream->runtime->private_data;
+       int ret;
+
+       ret = aaci_pcm_hw_params(substream, aacirun, params);
+
+       if (ret >= 0) {
+               aacirun->cr = CR_FEN | CR_COMPACT | CR_SZ16;
+
+               /* Line in record: slot 3 and 4 */
+               aacirun->cr |= CR_SL3 | CR_SL4;
+
+               aacirun->fifosz = aaci->fifosize * 4;
+
+               if (aacirun->cr & CR_COMPACT)
+                       aacirun->fifosz >>= 1;
+       }
+       return ret;
+}
+
+static void aaci_pcm_capture_stop(struct aaci_runtime *aacirun)
+{
+       u32 ie;
+
+       aaci_chan_wait_ready(aacirun);
+
+       ie = readl(aacirun->base + AACI_IE);
+       ie &= ~(IE_ORIE | IE_RXIE);
+       writel(ie, aacirun->base+AACI_IE);
+
+       aacirun->cr &= ~CR_EN;
+
+       writel(aacirun->cr, aacirun->base + AACI_RXCR);
+}
+
+static void aaci_pcm_capture_start(struct aaci_runtime *aacirun)
+{
+       u32 ie;
+
+       aaci_chan_wait_ready(aacirun);
+
+#ifdef DEBUG
+       /* RX Timeout value: bits 28:17 in RXCR */
+       aacirun->cr |= 0xf << 17;
+#endif
+
+       aacirun->cr |= CR_EN;
+       writel(aacirun->cr, aacirun->base + AACI_RXCR);
+
+       ie = readl(aacirun->base + AACI_IE);
+       ie |= IE_ORIE |IE_RXIE; // overrun and rx interrupt -- half full
+       writel(ie, aacirun->base + AACI_IE);
+}
+
+static int aaci_pcm_capture_trigger(snd_pcm_substream_t *substream, int cmd){
+
+       struct aaci *aaci = substream->private_data;
+       struct aaci_runtime *aacirun = substream->runtime->private_data;
+       unsigned long flags;
+       int ret = 0;
+
+       spin_lock_irqsave(&aaci->lock, flags);
+
+       switch (cmd) {
+       case SNDRV_PCM_TRIGGER_START:
+               aaci_pcm_capture_start(aacirun);
+               break;
+
+       case SNDRV_PCM_TRIGGER_RESUME:
+               aaci_pcm_capture_start(aacirun);
+               break;
+
+       case SNDRV_PCM_TRIGGER_STOP:
+               aaci_pcm_capture_stop(aacirun);
+               break;
+
+       case SNDRV_PCM_TRIGGER_SUSPEND:
+               aaci_pcm_capture_stop(aacirun);
+               break;
+
+       case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+               break;
+
+       case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+               break;
+
+       default:
+               ret = -EINVAL;
+       }
+
+       spin_unlock_irqrestore(&aaci->lock, flags);
+
+       return ret;
+}
 
+static int aaci_pcm_capture_prepare(snd_pcm_substream_t *substream)
+{
+       struct snd_pcm_runtime *runtime = substream->runtime;
+       struct aaci *aaci = substream->private_data;
+
+       aaci_pcm_prepare(substream);
+
+       /* allow changing of sample rate */
+       aaci_ac97_write(aaci->ac97, AC97_EXTENDED_STATUS, 0x0001); /* VRA */
+       aaci_ac97_write(aaci->ac97, AC97_PCM_LR_ADC_RATE, runtime->rate);
+       aaci_ac97_write(aaci->ac97, AC97_PCM_MIC_ADC_RATE, runtime->rate);
+
+       /* Record select: Mic: 0, Aux: 3, Line: 4 */
+       aaci_ac97_write(aaci->ac97, AC97_REC_SEL, 0x0404);
+
+       return 0;
+}
+
+static snd_pcm_ops_t aaci_capture_ops = {
+       .open           = aaci_pcm_open,
+       .close          = aaci_pcm_close,
+       .ioctl          = snd_pcm_lib_ioctl,
+       .hw_params      = aaci_pcm_capture_hw_params,
+       .hw_free        = aaci_pcm_hw_free,
+       .prepare        = aaci_pcm_capture_prepare,
+       .trigger        = aaci_pcm_capture_trigger,
+       .pointer        = aaci_pcm_pointer,
+       .mmap           = aaci_pcm_mmap,
+};
 
 /*
  * Power Management.
@@ -666,7 +892,7 @@ static int aaci_resume(struct amba_device *dev)
 
 
 static struct ac97_pcm ac97_defs[] __devinitdata = {
-       [0] = {         /* Front PCM */
+       [0] = { /* Front PCM */
                .exclusive = 1,
                .r = {
                        [0] = {
@@ -740,6 +966,7 @@ static int __devinit aaci_probe_ac97(struct aaci *aaci)
        ret = snd_ac97_mixer(ac97_bus, &ac97_template, &ac97);
        if (ret)
                goto out;
+       aaci->ac97 = ac97;
 
        /*
         * Disable AC97 PC Beep input on audio codecs.
@@ -752,6 +979,7 @@ static int __devinit aaci_probe_ac97(struct aaci *aaci)
                goto out;
 
        aaci->playback.pcm = &ac97_bus->pcms[0];
+       aaci->capture.pcm  = &ac97_bus->pcms[1];
 
  out:
        return ret;
@@ -801,7 +1029,7 @@ static int __devinit aaci_init_pcm(struct aaci *aaci)
        struct snd_pcm *pcm;
        int ret;
 
-       ret = snd_pcm_new(aaci->card, "AACI AC'97", 0, 1, 0, &pcm);
+       ret = snd_pcm_new(aaci->card, "AACI AC'97", 0, 1, 1, &pcm);
        if (ret == 0) {
                aaci->pcm = pcm;
                pcm->private_data = aaci;
@@ -810,6 +1038,7 @@ static int __devinit aaci_init_pcm(struct aaci *aaci)
                strlcpy(pcm->name, DRIVER_NAME, sizeof(pcm->name));
 
                snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &aaci_playback_ops);
+               snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &aaci_capture_ops);
        }
 
        return ret;
@@ -817,15 +1046,15 @@ static int __devinit aaci_init_pcm(struct aaci *aaci)
 
 static unsigned int __devinit aaci_size_fifo(struct aaci *aaci)
 {
-       void __iomem *base = aaci->base + AACI_CSCH1;
+       struct aaci_runtime *aacirun = &aaci->playback;
        int i;
 
-       writel(TXCR_FEN | TXCR_TSZ16 | TXCR_TXEN, base + AACI_TXCR);
+       writel(CR_FEN | CR_SZ16 | CR_EN, aacirun->base + AACI_TXCR);
 
-       for (i = 0; !(readl(base + AACI_SR) & SR_TXFF) && i < 4096; i++)
-               writel(0, aaci->base + AACI_DR1);
+       for (i = 0; !(readl(aacirun->base + AACI_SR) & SR_TXFF) && i < 4096; i++)
+               writel(0, aacirun->fifo);
 
-       writel(0, base + AACI_TXCR);
+       writel(0, aacirun->base + AACI_TXCR);
 
        /*
         * Re-initialise the AACI after the FIFO depth test, to
@@ -872,6 +1101,12 @@ static int __devinit aaci_probe(struct amba_device *dev, void *id)
        aaci->playback.base = aaci->base + AACI_CSCH1;
        aaci->playback.fifo = aaci->base + AACI_DR1;
 
+       /*
+        * Capture uses AACI channel 0
+        */
+       aaci->capture.base = aaci->base + AACI_CSCH1;
+       aaci->capture.fifo = aaci->base + AACI_DR1;
+
        for (i = 0; i < 4; i++) {
                void __iomem *base = aaci->base + i * 0x14;
 
@@ -907,7 +1142,7 @@ static int __devinit aaci_probe(struct amba_device *dev, void *id)
        ret = snd_card_register(aaci->card);
        if (ret == 0) {
                dev_info(&dev->dev, "%s, fifo %d\n", aaci->card->longname,
-                       aaci->fifosize);
+                        aaci->fifosize);
                amba_set_drvdata(dev, aaci->card);
                return ret;
        }
index 9175ff9ded0165500514d630edd4e1603ad34d16..924f69c1c44c4bd39340c006db12572ab80a341e 100644 (file)
 #define AACI_DR4       0x0f0   /* data read/written fifo 4 */
 
 /*
- * transmit fifo control register. P48
+ * TX/RX fifo control register (CR). P48
  */
-#define TXCR_FEN       (1 << 16)       /* fifo enable */
-#define TXCR_COMPACT   (1 << 15)       /* compact mode */
-#define TXCR_TSZ16     (0 << 13)       /* 16 bits */
-#define TXCR_TSZ18     (1 << 13)       /* 18 bits */
-#define TXCR_TSZ20     (2 << 13)       /* 20 bits */
-#define TXCR_TSZ12     (3 << 13)       /* 12 bits */
-#define TXCR_TX12      (1 << 12)       /* transmits slot 12 */
-#define TXCR_TX11      (1 << 11)       /* transmits slot 12 */
-#define TXCR_TX10      (1 << 10)       /* transmits slot 12 */
-#define TXCR_TX9       (1 << 9)        /* transmits slot 12 */
-#define TXCR_TX8       (1 << 8)        /* transmits slot 12 */
-#define TXCR_TX7       (1 << 7)        /* transmits slot 12 */
-#define TXCR_TX6       (1 << 6)        /* transmits slot 12 */
-#define TXCR_TX5       (1 << 5)        /* transmits slot 12 */
-#define TXCR_TX4       (1 << 4)        /* transmits slot 12 */
-#define TXCR_TX3       (1 << 3)        /* transmits slot 12 */
-#define TXCR_TX2       (1 << 2)        /* transmits slot 12 */
-#define TXCR_TX1       (1 << 1)        /* transmits slot 12 */
-#define TXCR_TXEN      (1 << 0)        /* transmit enable */
+#define CR_FEN         (1 << 16)       /* fifo enable */
+#define CR_COMPACT     (1 << 15)       /* compact mode */
+#define CR_SZ16                (0 << 13)       /* 16 bits */
+#define CR_SZ18                (1 << 13)       /* 18 bits */
+#define CR_SZ20                (2 << 13)       /* 20 bits */
+#define CR_SZ12                (3 << 13)       /* 12 bits */
+#define CR_SL12                (1 << 12)
+#define CR_SL11                (1 << 11)
+#define CR_SL10                (1 << 10)
+#define CR_SL9         (1 << 9)
+#define CR_SL8         (1 << 8)
+#define CR_SL7         (1 << 7)
+#define CR_SL6         (1 << 6)
+#define CR_SL5         (1 << 5)
+#define CR_SL4         (1 << 4)
+#define CR_SL3         (1 << 3)
+#define CR_SL2         (1 << 2)
+#define CR_SL1         (1 << 1)
+#define CR_EN          (1 << 0)        /* transmit enable */
 
 /*
  * status register bits. P49
@@ -229,6 +229,7 @@ struct aaci {
        /* AC'97 */
        struct mutex            ac97_sem;
        struct snd_ac97_bus     *ac97_bus;
+       struct snd_ac97         *ac97;
 
        u32                     maincr;
        spinlock_t              lock;