]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Merge branch 'master' of git://git.denx.de/u-boot-mpc83xx
authorWolfgang Denk <wd@denx.de>
Tue, 10 May 2011 20:30:07 +0000 (22:30 +0200)
committerWolfgang Denk <wd@denx.de>
Tue, 10 May 2011 20:30:07 +0000 (22:30 +0200)
821 files changed:
MAINTAINERS
MAKEALL
Makefile
README
arch/arm/config.mk
arch/arm/cpu/arm1136/mx31/devices.c
arch/arm/cpu/arm1136/mx31/generic.c
arch/arm/cpu/arm1136/mx31/timer.c
arch/arm/cpu/arm920t/a320/Makefile
arch/arm/cpu/arm920t/a320/timer.c
arch/arm/cpu/arm920t/at91rm9200/ether.c
arch/arm/cpu/arm926ejs/armada100/cpu.c
arch/arm/cpu/arm926ejs/mx25/generic.c
arch/arm/cpu/arm926ejs/orion5x/Makefile
arch/arm/cpu/arm926ejs/orion5x/cpu.c
arch/arm/cpu/arm926ejs/orion5x/dram.c
arch/arm/cpu/arm926ejs/orion5x/lowlevel_init.S
arch/arm/cpu/arm926ejs/orion5x/timer.c
arch/arm/cpu/arm926ejs/pantheon/cpu.c
arch/arm/cpu/arm926ejs/start.S
arch/arm/cpu/arm946es/start.S
arch/arm/cpu/armv7/mx5/soc.c
arch/arm/cpu/armv7/omap3/clock.c
arch/arm/cpu/armv7/omap3/lowlevel_init.S
arch/arm/cpu/armv7/omap3/mem.c
arch/arm/cpu/armv7/start.S
arch/arm/cpu/armv7/tegra2/Makefile
arch/arm/cpu/armv7/tegra2/ap20.c [new file with mode: 0644]
arch/arm/cpu/armv7/tegra2/ap20.h [new file with mode: 0644]
arch/arm/cpu/armv7/tegra2/lowlevel_init.S
arch/arm/cpu/pxa/Makefile
arch/arm/cpu/pxa/cpu.c
arch/arm/include/asm/arch-armada100/config.h
arch/arm/include/asm/arch-armada100/mfp.h
arch/arm/include/asm/arch-mx31/clock.h [moved from arch/arm/include/asm/arch-mx31/mx31.h with 92% similarity]
arch/arm/include/asm/arch-mx31/imx-regs.h [moved from arch/arm/include/asm/arch-mx31/mx31-regs.h with 97% similarity]
arch/arm/include/asm/arch-omap3/clocks.h
arch/arm/include/asm/arch-omap3/clocks_omap3.h
arch/arm/include/asm/arch-omap3/cpu.h
arch/arm/include/asm/arch-omap3/ehci_omap3.h [new file with mode: 0644]
arch/arm/include/asm/arch-omap3/omap3-regs.h [new file with mode: 0644]
arch/arm/include/asm/arch-omap3/omap3.h
arch/arm/include/asm/arch-orion5x/cpu.h
arch/arm/include/asm/arch-orion5x/mv88f5182.h
arch/arm/include/asm/arch-orion5x/orion5x.h
arch/arm/include/asm/arch-pantheon/config.h
arch/arm/include/asm/arch-pantheon/cpu.h
arch/arm/include/asm/arch-pantheon/mfp.h
arch/arm/include/asm/arch-pxa/pxa-regs.h
arch/arm/include/asm/arch-tegra2/clk_rst.h
arch/arm/include/asm/arch-tegra2/gpio.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra2/pmc.h
arch/arm/include/asm/arch-tegra2/scu.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra2/tegra2.h
arch/arm/include/asm/assembler.h [new file with mode: 0644]
arch/arm/include/asm/string.h
arch/arm/lib/Makefile
arch/arm/lib/board.c
arch/arm/lib/bootm.c
arch/arm/lib/memcpy.S [new file with mode: 0644]
arch/arm/lib/memset.S [new file with mode: 0644]
arch/avr32/config.mk
arch/blackfin/config.mk
arch/blackfin/cpu/Makefile
arch/blackfin/cpu/cmd_gpio.c [deleted file]
arch/blackfin/cpu/cpu.h
arch/blackfin/cpu/gpio.c
arch/blackfin/cpu/initcode.c
arch/blackfin/cpu/reset.c
arch/blackfin/cpu/serial.h
arch/blackfin/cpu/start.S
arch/blackfin/cpu/traps.c
arch/blackfin/include/asm/blackfin_cdef.h
arch/blackfin/include/asm/blackfin_def.h
arch/blackfin/include/asm/config.h
arch/blackfin/include/asm/gpio.h
arch/blackfin/include/asm/mach-bf506/BF504_cdef.h [new file with mode: 0644]
arch/blackfin/include/asm/mach-bf506/BF504_def.h [new file with mode: 0644]
arch/blackfin/include/asm/mach-bf506/BF506_cdef.h [new file with mode: 0644]
arch/blackfin/include/asm/mach-bf506/BF506_def.h [new file with mode: 0644]
arch/blackfin/include/asm/mach-bf506/anomaly.h [new file with mode: 0644]
arch/blackfin/include/asm/mach-bf506/def_local.h [new file with mode: 0644]
arch/blackfin/include/asm/mach-bf506/gpio.h [new file with mode: 0644]
arch/blackfin/include/asm/mach-bf506/portmux.h [new file with mode: 0644]
arch/blackfin/include/asm/mach-bf506/ports.h [new file with mode: 0644]
arch/blackfin/include/asm/mach-bf518/BF512_def.h
arch/blackfin/include/asm/mach-bf527/ADSP-EDN-BF52x-extended_cdef.h [deleted file]
arch/blackfin/include/asm/mach-bf527/ADSP-EDN-BF52x-extended_def.h [deleted file]
arch/blackfin/include/asm/mach-bf527/BF522_cdef.h
arch/blackfin/include/asm/mach-bf527/BF522_def.h
arch/blackfin/include/asm/mach-bf527/BF524_cdef.h
arch/blackfin/include/asm/mach-bf527/BF524_def.h
arch/blackfin/include/asm/mach-bf527/BF526_cdef.h
arch/blackfin/include/asm/mach-bf527/BF526_def.h
arch/blackfin/include/asm/mach-bf533/BF531_def.h
arch/blackfin/include/asm/mach-bf533/BF532_def.h
arch/blackfin/include/asm/mach-bf533/BF533_def.h
arch/blackfin/include/asm/mach-bf537/ADSP-EDN-BF534-extended_cdef.h [deleted file]
arch/blackfin/include/asm/mach-bf537/ADSP-EDN-BF534-extended_def.h [deleted file]
arch/blackfin/include/asm/mach-bf537/BF534_cdef.h
arch/blackfin/include/asm/mach-bf537/BF534_def.h
arch/blackfin/include/asm/mach-bf538/BF538_def.h
arch/blackfin/include/asm/mach-bf561/BF561_def.h
arch/blackfin/include/asm/mach-common/bits/bootrom.h
arch/blackfin/lib/board.c
arch/blackfin/lib/u-boot.lds.S
arch/m68k/config.mk
arch/m68k/lib/board.c
arch/m68k/lib/bootm.c
arch/microblaze/config.mk
arch/mips/config.mk
arch/mips/cpu/mips32/Makefile [moved from arch/mips/cpu/Makefile with 87% similarity]
arch/mips/cpu/mips32/au1x00/Makefile [new file with mode: 0644]
arch/mips/cpu/mips32/au1x00/au1x00_eth.c [moved from arch/mips/cpu/au1x00_eth.c with 100% similarity]
arch/mips/cpu/mips32/au1x00/au1x00_serial.c [moved from arch/mips/cpu/au1x00_serial.c with 100% similarity]
arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c [moved from arch/mips/cpu/au1x00_usb_ohci.c with 100% similarity]
arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.h [moved from arch/mips/cpu/au1x00_usb_ohci.h with 100% similarity]
arch/mips/cpu/mips32/au1x00/config.mk [moved from board/eNET/config.mk with 87% similarity]
arch/mips/cpu/mips32/cache.S [moved from arch/mips/cpu/cache.S with 98% similarity]
arch/mips/cpu/mips32/config.mk [moved from arch/mips/cpu/config.mk with 83% similarity]
arch/mips/cpu/mips32/cpu.c [moved from arch/mips/cpu/cpu.c with 100% similarity]
arch/mips/cpu/mips32/incaip/Makefile [moved from board/purple/Makefile with 83% similarity]
arch/mips/cpu/mips32/incaip/asc_serial.c [moved from arch/mips/cpu/asc_serial.c with 77% similarity]
arch/mips/cpu/mips32/incaip/asc_serial.h [moved from arch/mips/cpu/asc_serial.h with 100% similarity]
arch/mips/cpu/mips32/incaip/config.mk [moved from board/st/nhk8815/config.mk with 85% similarity]
arch/mips/cpu/mips32/incaip/incaip_clock.c [moved from arch/mips/cpu/incaip_clock.c with 100% similarity]
arch/mips/cpu/mips32/incaip/incaip_wdt.S [moved from arch/mips/cpu/incaip_wdt.S with 100% similarity]
arch/mips/cpu/mips32/interrupts.c [moved from arch/mips/cpu/interrupts.c with 100% similarity]
arch/mips/cpu/mips32/start.S [moved from arch/mips/cpu/start.S with 92% similarity]
arch/mips/include/asm/inca-ip.h
arch/mips/lib/board.c
arch/nios2/config.mk
arch/powerpc/config.mk
arch/powerpc/cpu/74xx_7xx/config.mk
arch/powerpc/cpu/mpc512x/config.mk
arch/powerpc/cpu/mpc512x/diu.c
arch/powerpc/cpu/mpc5xx/config.mk
arch/powerpc/cpu/mpc5xxx/config.mk
arch/powerpc/cpu/mpc8220/config.mk
arch/powerpc/cpu/mpc824x/config.mk
arch/powerpc/cpu/mpc8260/config.mk
arch/powerpc/cpu/mpc83xx/config.mk
arch/powerpc/cpu/mpc83xx/fdt.c
arch/powerpc/cpu/mpc85xx/Makefile
arch/powerpc/cpu/mpc85xx/cmd_errata.c
arch/powerpc/cpu/mpc85xx/config.mk
arch/powerpc/cpu/mpc85xx/cpu.c
arch/powerpc/cpu/mpc85xx/cpu_init.c
arch/powerpc/cpu/mpc85xx/cpu_init_nand.c
arch/powerpc/cpu/mpc85xx/fdt.c
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.h
arch/powerpc/cpu/mpc85xx/p1010_serdes.c [new file with mode: 0644]
arch/powerpc/cpu/mpc85xx/p1023_serdes.c [new file with mode: 0644]
arch/powerpc/cpu/mpc85xx/p3041_ids.c
arch/powerpc/cpu/mpc85xx/p4080_ids.c
arch/powerpc/cpu/mpc85xx/p5020_ids.c
arch/powerpc/cpu/mpc85xx/portals.c
arch/powerpc/cpu/mpc85xx/speed.c
arch/powerpc/cpu/mpc85xx/tlb.c
arch/powerpc/cpu/mpc86xx/config.mk
arch/powerpc/cpu/mpc8xx/config.mk
arch/powerpc/cpu/mpc8xxx/Makefile
arch/powerpc/cpu/mpc8xxx/cpu.c
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c
arch/powerpc/cpu/mpc8xxx/ddr/ddr.h
arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c
arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c
arch/powerpc/cpu/mpc8xxx/ddr/main.c
arch/powerpc/cpu/mpc8xxx/ddr/util.c
arch/powerpc/cpu/mpc8xxx/fdt.c
arch/powerpc/cpu/mpc8xxx/fsl_ifc.c [new file with mode: 0644]
arch/powerpc/cpu/ppc4xx/config.mk
arch/powerpc/include/asm/config.h
arch/powerpc/include/asm/config_mpc85xx.h
arch/powerpc/include/asm/fsl_ddr_sdram.h
arch/powerpc/include/asm/fsl_enet.h
arch/powerpc/include/asm/fsl_ifc.h [new file with mode: 0644]
arch/powerpc/include/asm/fsl_law.h
arch/powerpc/include/asm/fsl_liodn.h
arch/powerpc/include/asm/fsl_pci.h
arch/powerpc/include/asm/fsl_portals.h
arch/powerpc/include/asm/fsl_serdes.h
arch/powerpc/include/asm/immap_85xx.h
arch/powerpc/include/asm/immap_qe.h
arch/powerpc/include/asm/io.h
arch/powerpc/include/asm/processor.h
arch/powerpc/lib/board.c
arch/powerpc/lib/bootcount.c
arch/powerpc/lib/bootm.c
arch/sh/config.mk
arch/sparc/config.mk
arch/sparc/cpu/leon2/cpu_init.c
arch/sparc/cpu/leon3/cpu_init.c
arch/x86/config.mk [moved from arch/i386/config.mk with 95% similarity]
arch/x86/cpu/Makefile [moved from arch/i386/cpu/Makefile with 100% similarity]
arch/x86/cpu/config.mk [moved from arch/i386/cpu/config.mk with 94% similarity]
arch/x86/cpu/cpu.c [moved from arch/i386/cpu/cpu.c with 89% similarity]
arch/x86/cpu/interrupts.c [moved from arch/i386/cpu/interrupts.c with 99% similarity]
arch/x86/cpu/resetvec.S [moved from arch/i386/cpu/resetvec.S with 89% similarity]
arch/x86/cpu/sc520/Makefile [moved from arch/i386/cpu/sc520/Makefile with 96% similarity]
arch/x86/cpu/sc520/sc520.c [moved from arch/i386/cpu/sc520/sc520.c with 82% similarity]
arch/x86/cpu/sc520/sc520_car.S [moved from arch/i386/cpu/sc520/sc520_car.S with 97% similarity]
arch/x86/cpu/sc520/sc520_pci.c [moved from arch/i386/cpu/sc520/sc520_pci.c with 94% similarity]
arch/x86/cpu/sc520/sc520_reset.c [moved from board/purple/sconsole.h with 54% similarity]
arch/x86/cpu/sc520/sc520_sdram.c [moved from arch/i386/cpu/sc520/sc520_sdram.c with 99% similarity]
arch/x86/cpu/sc520/sc520_ssi.c [moved from arch/i386/cpu/sc520/sc520_ssi.c with 94% similarity]
arch/x86/cpu/sc520/sc520_timer.c [moved from arch/i386/cpu/sc520/sc520_timer.c with 94% similarity]
arch/x86/cpu/start.S [moved from arch/i386/cpu/start.S with 84% similarity]
arch/x86/cpu/start16.S [moved from arch/i386/cpu/start16.S with 93% similarity]
arch/x86/cpu/u-boot.lds [moved from arch/i386/cpu/u-boot.lds with 90% similarity]
arch/x86/include/asm/bitops.h [moved from arch/i386/include/asm/bitops.h with 100% similarity]
arch/x86/include/asm/bootparam.h [moved from arch/i386/include/asm/bootparam.h with 100% similarity]
arch/x86/include/asm/byteorder.h [moved from arch/i386/include/asm/byteorder.h with 100% similarity]
arch/x86/include/asm/config.h [moved from arch/i386/include/asm/config.h with 100% similarity]
arch/x86/include/asm/e820.h [moved from arch/i386/include/asm/e820.h with 100% similarity]
arch/x86/include/asm/errno.h [moved from arch/i386/include/asm/errno.h with 100% similarity]
arch/x86/include/asm/global_data.h [moved from arch/i386/include/asm/global_data.h with 100% similarity]
arch/x86/include/asm/i8254.h [moved from arch/i386/include/asm/i8254.h with 100% similarity]
arch/x86/include/asm/i8259.h [moved from arch/i386/include/asm/i8259.h with 100% similarity]
arch/x86/include/asm/ibmpc.h [moved from arch/i386/include/asm/ibmpc.h with 100% similarity]
arch/x86/include/asm/ic/pci.h [moved from arch/i386/include/asm/ic/pci.h with 100% similarity]
arch/x86/include/asm/ic/sc520.h [moved from arch/i386/include/asm/ic/sc520.h with 100% similarity]
arch/x86/include/asm/ic/ssi.h [moved from arch/i386/include/asm/ic/ssi.h with 100% similarity]
arch/x86/include/asm/interrupt.h [moved from arch/i386/include/asm/interrupt.h with 95% similarity]
arch/x86/include/asm/io.h [moved from arch/i386/include/asm/io.h with 100% similarity]
arch/x86/include/asm/ioctl.h [moved from arch/i386/include/asm/ioctl.h with 100% similarity]
arch/x86/include/asm/ist.h [moved from arch/i386/include/asm/ist.h with 100% similarity]
arch/x86/include/asm/pci.h [moved from arch/i386/include/asm/pci.h with 100% similarity]
arch/x86/include/asm/posix_types.h [moved from arch/i386/include/asm/posix_types.h with 100% similarity]
arch/x86/include/asm/processor-flags.h [moved from arch/i386/include/asm/processor-flags.h with 100% similarity]
arch/x86/include/asm/processor.h [moved from arch/i386/include/asm/processor.h with 100% similarity]
arch/x86/include/asm/ptrace.h [moved from arch/i386/include/asm/ptrace.h with 100% similarity]
arch/x86/include/asm/realmode.h [moved from arch/i386/include/asm/realmode.h with 100% similarity]
arch/x86/include/asm/string.h [moved from arch/i386/include/asm/string.h with 100% similarity]
arch/x86/include/asm/types.h [moved from arch/i386/include/asm/types.h with 100% similarity]
arch/x86/include/asm/u-boot-x86.h [moved from arch/i386/include/asm/u-boot-i386.h with 93% similarity]
arch/x86/include/asm/u-boot.h [moved from arch/i386/include/asm/u-boot.h with 100% similarity]
arch/x86/include/asm/unaligned.h [moved from arch/i386/include/asm/unaligned.h with 100% similarity]
arch/x86/include/asm/video/edid.h [moved from arch/i386/include/asm/video/edid.h with 100% similarity]
arch/x86/include/asm/zimage.h [moved from arch/i386/include/asm/zimage.h with 100% similarity]
arch/x86/lib/Makefile [moved from arch/i386/lib/Makefile with 100% similarity]
arch/x86/lib/bios.S [moved from arch/i386/lib/bios.S with 99% similarity]
arch/x86/lib/bios.h [moved from arch/i386/lib/bios.h with 81% similarity]
arch/x86/lib/bios_pci.S [moved from arch/i386/lib/bios_pci.S with 100% similarity]
arch/x86/lib/bios_setup.c [moved from arch/i386/lib/bios_setup.c with 99% similarity]
arch/x86/lib/board.c [moved from arch/i386/lib/board.c with 95% similarity]
arch/x86/lib/bootm.c [moved from arch/i386/lib/bootm.c with 86% similarity]
arch/x86/lib/interrupts.c [moved from arch/i386/lib/interrupts.c with 88% similarity]
arch/x86/lib/pcat_interrupts.c [moved from arch/i386/lib/pcat_interrupts.c with 96% similarity]
arch/x86/lib/pcat_timer.c [moved from arch/i386/lib/pcat_timer.c with 97% similarity]
arch/x86/lib/pci.c [moved from arch/i386/lib/pci.c with 94% similarity]
arch/x86/lib/pci_type1.c [moved from arch/i386/lib/pci_type1.c with 61% similarity]
arch/x86/lib/realmode.c [moved from arch/i386/lib/realmode.c with 95% similarity]
arch/x86/lib/realmode_switch.S [moved from arch/i386/lib/realmode_switch.S with 99% similarity]
arch/x86/lib/timer.c [moved from arch/i386/lib/timer.c with 94% similarity]
arch/x86/lib/video.c [moved from arch/i386/lib/video.c with 86% similarity]
arch/x86/lib/video_bios.c [moved from arch/i386/lib/video_bios.c with 99% similarity]
arch/x86/lib/zimage.c [moved from arch/i386/lib/zimage.c with 98% similarity]
board/LEOX/elpt860/u-boot.lds
board/LaCie/edminiv2/Makefile
board/LaCie/edminiv2/config.mk
board/LaCie/edminiv2/edminiv2.c
board/Marvell/aspenite/aspenite.c
board/Marvell/dkb/dkb.c
board/RPXClassic/u-boot.lds
board/RPXlite/u-boot.lds
board/RPXlite_dw/u-boot.lds
board/RRvision/u-boot.lds
board/actux1/config.mk
board/actux2/config.mk
board/actux3/config.mk
board/adder/u-boot.lds
board/altera/nios2-generic/config.mk
board/altera/nios2-generic/nios2-generic.c
board/amcc/acadia/config.mk
board/amcc/bamboo/config.mk
board/amcc/canyonlands/config.mk
board/amcc/kilauea/config.mk
board/amcc/sequoia/config.mk
board/amirix/ap1000/u-boot.lds
board/armltd/vexpress/ca9x4_ct_vxp.c
board/armltd/vexpress/config.mk [deleted file]
board/atmel/atstk1000/config.mk
board/avnet/fx12mm/config.mk [deleted file]
board/avnet/v5fx30teval/config.mk [deleted file]
board/bct-brettl2/config.mk
board/bf506f-ezkit/Makefile [new file with mode: 0644]
board/bf506f-ezkit/bf506f-ezkit.c [new file with mode: 0644]
board/bf518f-ezbrd/bf518f-ezbrd.c
board/bf518f-ezbrd/config.mk
board/bf525-ucr2/Makefile [new file with mode: 0644]
board/bf525-ucr2/bf525-ucr2.c [new file with mode: 0644]
board/bf526-ezbrd/bf526-ezbrd.c
board/bf526-ezbrd/config.mk
board/bf527-ad7160-eval/config.mk
board/bf527-ezkit/config.mk
board/bf527-sdp/config.mk
board/bf533-ezkit/config.mk
board/bf533-stamp/config.mk
board/bf537-minotaur/config.mk
board/bf537-pnav/config.mk [deleted file]
board/bf537-srv1/config.mk
board/bf537-stamp/config.mk
board/bf538f-ezkit/config.mk
board/bf548-ezkit/config.mk
board/bf561-acvilon/config.mk
board/bf561-ezkit/config.mk
board/blackstamp/config.mk [deleted file]
board/blackvme/config.mk [deleted file]
board/c2mon/u-boot.lds
board/cm-bf527/config.mk
board/cm-bf533/config.mk
board/cm-bf537e/config.mk
board/cm-bf537u/config.mk
board/cm-bf548/config.mk
board/cm-bf561/config.mk
board/cm5200/u-boot.lds [deleted file]
board/cm_t35/Makefile
board/cm_t35/cm_t35.c
board/cm_t35/leds.c [new file with mode: 0644]
board/cogent/config.mk
board/cogent/u-boot.lds
board/comelit/dig297/Makefile [moved from board/mp2usb/Makefile with 89% similarity]
board/comelit/dig297/dig297.c [new file with mode: 0644]
board/comelit/dig297/dig297.h [new file with mode: 0644]
board/dave/PPChameleonEVB/u-boot.lds
board/davedenx/qong/fpga.c
board/davedenx/qong/lowlevel_init.S
board/davedenx/qong/qong.c
board/davinci/ea20/Makefile
board/digsy_mtc/digsy_mtc.c
board/dnp5370/Makefile [new file with mode: 0644]
board/dnp5370/dnp5370.c [new file with mode: 0644]
board/eNET/eNET.c
board/eNET/eNET_pci.c
board/earthlcd/favr-32-ezkit/config.mk
board/eltec/mhpc/u-boot.lds
board/emk/top860/u-boot.lds
board/ep88x/u-boot.lds
board/esd/dasa_sim/u-boot.lds
board/esteem192e/u-boot.lds
board/etx094/u-boot.lds
board/eukrea/cpu9260/config.mk [deleted file]
board/eukrea/cpu9260/cpu9260.c
board/eukrea/cpu9260/led.c
board/eukrea/cpuat91/Makefile
board/eukrea/cpuat91/config.mk [deleted file]
board/eukrea/cpuat91/cpuat91.c
board/evb64260/u-boot.lds
board/fads/u-boot.lds
board/faraday/a320evb/a320evb.c
board/faraday/a320evb/lowlevel_init.S
board/flagadm/u-boot.lds
board/freescale/common/Makefile
board/freescale/common/ngpixis.c
board/freescale/common/ngpixis.h
board/freescale/common/sdhc_boot.c [new file with mode: 0644]
board/freescale/common/sys_eeprom.c
board/freescale/corenet_ds/Makefile
board/freescale/corenet_ds/corenet_ds.c
board/freescale/corenet_ds/ddr.c
board/freescale/corenet_ds/law.c
board/freescale/corenet_ds/p3041ds_ddr.c [new file with mode: 0644]
board/freescale/corenet_ds/p4080ds_ddr.c
board/freescale/corenet_ds/p5020ds_ddr.c [new file with mode: 0644]
board/freescale/corenet_ds/tlb.c
board/freescale/mpc8360emds/mpc8360emds.c
board/freescale/mpc837xemds/mpc837xemds.c
board/freescale/mpc8536ds/config.mk [deleted file]
board/freescale/mpc8536ds/ddr.c
board/freescale/mpc8536ds/mpc8536ds.c
board/freescale/mpc8540ads/ddr.c
board/freescale/mpc8541cds/ddr.c
board/freescale/mpc8544ds/ddr.c
board/freescale/mpc8544ds/mpc8544ds.c
board/freescale/mpc8548cds/ddr.c
board/freescale/mpc8555cds/ddr.c
board/freescale/mpc8560ads/ddr.c
board/freescale/mpc8568mds/ddr.c
board/freescale/mpc8569mds/config.mk [deleted file]
board/freescale/mpc8569mds/ddr.c
board/freescale/mpc8569mds/mpc8569mds.c
board/freescale/mpc8572ds/config.mk [deleted file]
board/freescale/mpc8572ds/ddr.c
board/freescale/mpc8572ds/mpc8572ds.c
board/freescale/mpc8610hpcd/ddr.c
board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
board/freescale/mpc8641hpcn/ddr.c
board/freescale/mpc8641hpcn/mpc8641hpcn.c
board/freescale/mx31ads/config.mk
board/freescale/mx31ads/lowlevel_init.S
board/freescale/mx31ads/mx31ads.c
board/freescale/mx31pdk/lowlevel_init.S
board/freescale/mx31pdk/mx31pdk.c
board/freescale/mx51evk/config.mk [deleted file]
board/freescale/mx53evk/config.mk [deleted file]
board/freescale/p1022ds/ddr.c
board/freescale/p1022ds/diu.c
board/freescale/p1022ds/p1022ds.c
board/freescale/p1_p2_rdb/config.mk [deleted file]
board/freescale/p1_p2_rdb/ddr.c
board/freescale/p1_p2_rdb/p1_p2_rdb.c
board/freescale/p1_p2_rdb/tlb.c
board/freescale/p2020ds/ddr.c
board/freescale/p2020ds/p2020ds.c
board/freescale/p2020ds/tlb.c
board/gdsys/405ep/405ep.c
board/gdsys/405ep/dlvision-10g.c
board/gdsys/common/osd.c
board/gen860t/u-boot.lds
board/genietv/u-boot.lds
board/hermes/u-boot.lds
board/hymod/config.mk
board/hymod/u-boot.lds
board/ibf-dsp561/config.mk
board/icu862/u-boot.lds
board/imx31_phycore/imx31_phycore.c
board/imx31_phycore/lowlevel_init.S
board/innokom/innokom.c
board/ip04/config.mk
board/ip860/u-boot.lds
board/ivm/u-boot.lds
board/karo/tx25/tx25.c
board/keymile/common/common.c
board/keymile/common/common.h
board/keymile/km83xx/Makefile [moved from board/keymile/kmeter1/Makefile with 100% similarity]
board/keymile/km83xx/km83xx.c [new file with mode: 0644]
board/keymile/km_arm/km_arm.c
board/keymile/km_arm/kwbimage.cfg
board/keymile/kmeter1/kmeter1.c [deleted file]
board/keymile/mgcoge/mgcoge.c
board/kup/kup4k/u-boot.lds
board/kup/kup4x/u-boot.lds
board/lantec/u-boot.lds
board/logicpd/imx31_litekit/imx31_litekit.c
board/logicpd/imx31_litekit/lowlevel_init.S
board/lwmon/u-boot.lds
board/manroland/uc100/u-boot.lds
board/matrix_vision/mvsmr/u-boot.lds
board/mbx8xx/u-boot.lds
board/ml2/u-boot.lds
board/mousse/u-boot.lds
board/mp2usb/config.mk [deleted file]
board/mp2usb/flash.c [deleted file]
board/mp2usb/mp2usb.c [deleted file]
board/munices/u-boot.lds [deleted file]
board/mvblue/u-boot.lds
board/netphone/u-boot.lds
board/netta/u-boot.lds
board/netta2/u-boot.lds
board/netvia/u-boot.lds
board/nvidia/common/board.c
board/nvidia/common/board.h [moved from board/purple/lowlevel_init.S with 73% similarity]
board/nvidia/harmony/Makefile
board/nvidia/harmony/harmony.c [new file with mode: 0644]
board/nvidia/seaboard/Makefile
board/nvidia/seaboard/seaboard.c [new file with mode: 0644]
board/nx823/u-boot.lds
board/purple/config.mk [deleted file]
board/purple/flash.c [deleted file]
board/purple/purple.c [deleted file]
board/purple/sconsole.c [deleted file]
board/purple/u-boot.lds [deleted file]
board/quantum/u-boot.lds
board/r360mpi/u-boot.lds
board/rbc823/u-boot.lds
board/rmu/u-boot.lds
board/rsdproto/u-boot.lds
board/samsung/smdk6400/config.mk
board/sandpoint/u-boot.lds
board/sbc8548/ddr.c
board/sbc8560/ddr.c
board/sbc8641d/ddr.c
board/sbc8641d/sbc8641d.c
board/sc3/u-boot.lds [deleted file]
board/siemens/IAD210/u-boot.lds
board/sixnet/u-boot.lds
board/snmc/qs850/u-boot.lds
board/snmc/qs860t/u-boot.lds
board/socrates/ddr.c
board/spc1920/u-boot.lds
board/spd8xx/u-boot.lds
board/st/nhk8815/Makefile
board/st/nhk8815/nhk8815.c
board/st/nhk8815/platform.S [deleted file]
board/stx/stxgp3/ddr.c
board/stx/stxssa/ddr.c
board/stx/stxxtc/u-boot.lds
board/svm_sc8xx/u-boot.lds
board/tcm-bf518/config.mk
board/tcm-bf537/config.mk
board/ti/am3517crane/Makefile [new file with mode: 0644]
board/ti/am3517crane/am3517crane.c [new file with mode: 0644]
board/ti/am3517crane/am3517crane.h [new file with mode: 0644]
board/ti/am3517crane/config.mk [new file with mode: 0644]
board/ti/beagle/Makefile
board/ti/beagle/beagle.c
board/ti/beagle/beagle.h
board/ti/beagle/led.c [new file with mode: 0644]
board/tqc/tqm8xx/u-boot.lds
board/trab/config.mk
board/v37/u-boot.lds
board/westel/amx860/u-boot.lds
board/xes/xpedite517x/ddr.c
board/xes/xpedite517x/xpedite517x.c
board/xes/xpedite520x/ddr.c
board/xes/xpedite537x/ddr.c
board/xes/xpedite537x/xpedite537x.c
board/xes/xpedite550x/ddr.c
board/xes/xpedite550x/xpedite550x.c
board/xilinx/ml507/config.mk [deleted file]
board/xilinx/ppc405-generic/config.mk [deleted file]
board/xilinx/ppc440-generic/config.mk [deleted file]
boards.cfg
common/Makefile
common/cmd_bdinfo.c
common/cmd_boot.c
common/cmd_bootldr.c
common/cmd_bootm.c
common/cmd_gpio.c [new file with mode: 0644]
common/cmd_i2c.c
common/cmd_ide.c
common/cmd_ldrinfo.c [new file with mode: 0644]
common/cmd_led.c [new file with mode: 0644]
common/cmd_md5sum.c [new file with mode: 0644]
common/cmd_mdio.c [new file with mode: 0644]
common/cmd_mem.c
common/cmd_mmc.c
common/cmd_mmc_spi.c [new file with mode: 0644]
common/cmd_nvedit.c
common/cmd_sf.c
common/cmd_sha1sum.c [new file with mode: 0644]
common/cmd_unzip.c [new file with mode: 0644]
common/cmd_usb.c
common/ddr_spd.c
common/env_mmc.c
common/env_sf.c
common/exports.c
common/fdt_support.c
common/image.c
common/miiphyutil.c
common/usb_storage.c
config.mk
disk/part.c
doc/README-i386 [deleted file]
doc/README.Purple [deleted file]
doc/README.dnp5370 [new file with mode: 0644]
doc/README.p1022ds [new file with mode: 0644]
doc/README.p4080ds [new file with mode: 0644]
doc/README.video
doc/TODO-i386 [deleted file]
drivers/block/mvsata_ide.c
drivers/gpio/mxc_gpio.c
drivers/i2c/Makefile
drivers/i2c/mv_i2c.c [moved from arch/arm/cpu/pxa/i2c.c with 65% similarity]
drivers/i2c/mv_i2c.h [new file with mode: 0644]
drivers/i2c/mvtwsi.c
drivers/i2c/mxc_i2c.c
drivers/i2c/omap24xx_i2c.c
drivers/i2c/soft_i2c.c
drivers/misc/fsl_law.c
drivers/mmc/Makefile
drivers/mmc/arm_pl180_mmci.c [new file with mode: 0644]
drivers/mmc/arm_pl180_mmci.h [new file with mode: 0644]
drivers/mmc/bfin_sdh.c
drivers/mmc/davinci_mmc.c
drivers/mmc/fsl_esdhc.c
drivers/mmc/gen_atmel_mci.c
drivers/mmc/mmc.c
drivers/mmc/mmc_spi.c [new file with mode: 0644]
drivers/mmc/mxcmmc.c
drivers/mmc/omap_hsmmc.c
drivers/mmc/s5p_mmc.c
drivers/mtd/Makefile
drivers/mtd/cfi_flash.c
drivers/mtd/ftsmc020.c [moved from arch/arm/cpu/arm920t/a320/ftsmc020.c with 97% similarity]
drivers/mtd/nand/nand_base.c
drivers/mtd/spi/atmel.c
drivers/mtd/spi/eon.c
drivers/mtd/spi/macronix.c
drivers/mtd/spi/ramtron.c
drivers/mtd/spi/spansion.c
drivers/mtd/spi/spi_flash.c
drivers/mtd/spi/spi_flash_internal.h
drivers/mtd/spi/sst.c
drivers/mtd/spi/stmicro.c
drivers/mtd/spi/winbond.c
drivers/net/Makefile
drivers/net/at91_emac.c
drivers/net/davinci_emac.c
drivers/net/dm9000x.c
drivers/net/e1000.c
drivers/net/e1000.h
drivers/net/enc28j60.c
drivers/net/fsl_mdio.c [new file with mode: 0644]
drivers/net/phy/Makefile
drivers/net/phy/atheros.c [new file with mode: 0644]
drivers/net/phy/broadcom.c [new file with mode: 0644]
drivers/net/phy/davicom.c [new file with mode: 0644]
drivers/net/phy/generic_10g.c [new file with mode: 0644]
drivers/net/phy/lxt.c [new file with mode: 0644]
drivers/net/phy/marvell.c [new file with mode: 0644]
drivers/net/phy/micrel.c [new file with mode: 0644]
drivers/net/phy/natsemi.c [new file with mode: 0644]
drivers/net/phy/phy.c [new file with mode: 0644]
drivers/net/phy/realtek.c [new file with mode: 0644]
drivers/net/phy/teranetics.c [new file with mode: 0644]
drivers/net/phy/vitesse.c [new file with mode: 0644]
drivers/net/tsec.c
drivers/net/uli526x.c
drivers/pci/fsl_pci_init.c
drivers/power/ftpmu010.c
drivers/qe/uec.c
drivers/qe/uec.h
drivers/qe/uec_phy.c
drivers/rtc/rv3029.c
drivers/serial/serial_mxc.c
drivers/spi/Makefile
drivers/spi/bfin_spi.c
drivers/spi/cf_spi.c
drivers/spi/fsl_espi.c [new file with mode: 0644]
drivers/spi/mxc_spi.c
drivers/spi/oc_tiny_spi.c [new file with mode: 0644]
drivers/usb/host/ehci-mxc.c
drivers/usb/host/ehci-pci.c
drivers/usb/musb/blackfin_usb.c
drivers/video/Makefile
drivers/video/cfb_console.c
drivers/video/fsl_diu_fb.c
drivers/video/mx3fb.c
drivers/video/videomodes.c
drivers/video/videomodes.h
drivers/watchdog/Makefile
drivers/watchdog/ftwdt010_wdt.c [new file with mode: 0644]
examples/standalone/Makefile
examples/standalone/stubs.c
fs/fat/fat.c
fs/jffs2/jffs2_1pass.c
fs/jffs2/jffs2_nand_1pass.c
include/common.h
include/config_cmd_defaults.h
include/config_defaults.h
include/config_phylib_all_drivers.h [new file with mode: 0644]
include/configs/MPC8323ERDB.h
include/configs/MPC832XEMDS.h
include/configs/MPC8360EMDS.h
include/configs/MPC8360ERDK.h
include/configs/MPC8536DS.h
include/configs/MPC8540ADS.h
include/configs/MPC8541CDS.h
include/configs/MPC8544DS.h
include/configs/MPC8548CDS.h
include/configs/MPC8555CDS.h
include/configs/MPC8560ADS.h
include/configs/MPC8568MDS.h
include/configs/MPC8569MDS.h
include/configs/MPC8572DS.h
include/configs/MPC8610HPCD.h
include/configs/MPC8641HPCN.h
include/configs/P1022DS.h
include/configs/P1_P2_RDB.h
include/configs/P2020DS.h
include/configs/P3041DS.h [new file with mode: 0644]
include/configs/P5020DS.h [new file with mode: 0644]
include/configs/a320evb.h
include/configs/am3517_crane.h [new file with mode: 0644]
include/configs/am3517_evm.h
include/configs/aspenite.h
include/configs/bct-brettl2.h
include/configs/bf506f-ezkit.h [new file with mode: 0644]
include/configs/bf518f-ezbrd.h
include/configs/bf525-ucr2.h [new file with mode: 0644]
include/configs/bf526-ezbrd.h
include/configs/bf527-ad7160-eval.h
include/configs/bf527-ezkit.h
include/configs/bf527-sdp.h
include/configs/bf533-ezkit.h
include/configs/bf533-stamp.h
include/configs/bf537-minotaur.h
include/configs/bf537-pnav.h
include/configs/bf537-srv1.h
include/configs/bf537-stamp.h
include/configs/bf538f-ezkit.h
include/configs/bf548-ezkit.h
include/configs/bf561-acvilon.h
include/configs/bf561-ezkit.h
include/configs/bfin_adi_common.h
include/configs/blackstamp.h
include/configs/blackvme.h
include/configs/ca9x4_ct_vxp.h
include/configs/cm-bf527.h
include/configs/cm-bf533.h
include/configs/cm-bf537e.h
include/configs/cm-bf537u.h
include/configs/cm-bf548.h
include/configs/cm-bf561.h
include/configs/cm_t35.h
include/configs/corenet_ds.h
include/configs/cpu9260.h
include/configs/cpuat91.h
include/configs/devkit8000.h
include/configs/dig297.h [new file with mode: 0644]
include/configs/digsy_mtc.h
include/configs/dkb.h
include/configs/dlvision-10g.h
include/configs/dnp5370.h [new file with mode: 0644]
include/configs/eNET.h
include/configs/edminiv2.h
include/configs/efikamx.h
include/configs/harmony.h
include/configs/ibf-dsp561.h
include/configs/igep0020.h
include/configs/igep0030.h
include/configs/imx31_litekit.h
include/configs/innokom.h
include/configs/ip04.h
include/configs/keymile-common.h
include/configs/km-powerpc.h [new file with mode: 0644]
include/configs/km82xx-common.h [new file with mode: 0644]
include/configs/km8321-common.h [new file with mode: 0644]
include/configs/km83xx-common.h [new file with mode: 0644]
include/configs/km_arm.h
include/configs/kmeter1.h
include/configs/kmsupx5.h [new file with mode: 0644]
include/configs/mgcoge.h
include/configs/mgcoge2ne.h [new file with mode: 0644]
include/configs/mgcoge2un.h [new file with mode: 0644]
include/configs/mp2usb.h [deleted file]
include/configs/mpc5121ads.h
include/configs/mx31ads.h
include/configs/mx31pdk.h
include/configs/mx51evk.h
include/configs/mx53evk.h
include/configs/nhk8815.h
include/configs/omap2420h4.h
include/configs/omap3_beagle.h
include/configs/omap3_evm.h
include/configs/omap3_overo.h
include/configs/omap3_pandora.h
include/configs/omap3_sdp3430.h
include/configs/omap3_zoom1.h
include/configs/omap3_zoom2.h
include/configs/omap4_panda.h
include/configs/omap4_sdp4430.h
include/configs/pdm360ng.h
include/configs/purple.h [deleted file]
include/configs/qong.h
include/configs/seaboard.h
include/configs/suen3.h
include/configs/suen8.h [new file with mode: 0644]
include/configs/suvd3.h [new file with mode: 0644]
include/configs/tcm-bf518.h
include/configs/tcm-bf537.h
include/configs/tegra2-common.h
include/configs/tuda1.h [new file with mode: 0644]
include/configs/tuxa1.h [new file with mode: 0644]
include/configs/xm250.h
include/configs/xpedite550x.h
include/ddr_spd.h
include/exports.h
include/faraday/ftpmu010.h [moved from drivers/power/ftpmu010.h with 56% similarity]
include/faraday/ftsdmc020.h [moved from arch/arm/include/asm/arch-a320/ftsdmc020.h with 100% similarity]
include/faraday/ftsmc020.h [moved from arch/arm/include/asm/arch-a320/ftsmc020.h with 100% similarity]
include/faraday/fttmr010.h [moved from arch/arm/include/asm/arch-a320/fttmr010.h with 100% similarity]
include/faraday/ftwdt010_wdt.h [new file with mode: 0644]
include/flash.h
include/fsl_diu_fb.h
include/fsl_esdhc.h
include/fsl_mdio.h [new file with mode: 0644]
include/gdsys_fpga.h
include/i2c.h
include/ide.h
include/image.h
include/linux/ethtool.h [new file with mode: 0644]
include/linux/mdio.h [new file with mode: 0644]
include/miiphy.h
include/mmc.h
include/pci_ids.h
include/phy.h [new file with mode: 0644]
include/search.h
include/spi.h
include/spi_flash.h
include/tsec.h
lib/Makefile
lib/gunzip.c
lib/hashtable.c
lib/zlib.c [deleted file]
lib/zlib/Makefile [new file with mode: 0644]
lib/zlib/adler32.c [new file with mode: 0644]
lib/zlib/inffast.c [new file with mode: 0644]
lib/zlib/inffast.h [new file with mode: 0644]
lib/zlib/inffixed.h [new file with mode: 0644]
lib/zlib/inflate.c [new file with mode: 0644]
lib/zlib/inflate.h [new file with mode: 0644]
lib/zlib/inftrees.c [new file with mode: 0644]
lib/zlib/inftrees.h [new file with mode: 0644]
lib/zlib/zlib.c [new file with mode: 0644]
lib/zlib/zlib.h [new file with mode: 0644]
lib/zlib/zutil.c [new file with mode: 0644]
lib/zlib/zutil.h [new file with mode: 0644]
nand_spl/board/davinci/da8xxevm/u-boot.lds
nand_spl/board/freescale/mpc8536ds/Makefile
nand_spl/board/freescale/mpc8569mds/Makefile
nand_spl/board/freescale/mpc8572ds/Makefile
nand_spl/board/freescale/mx31pdk/u-boot.lds
nand_spl/board/freescale/p1_p2_rdb/Makefile
nand_spl/board/karo/tx25/u-boot.lds
nand_spl/nand_boot.c
nand_spl/nand_boot_fsl_elbc.c
nand_spl/nand_boot_fsl_nfc.c
net/bootp.c
net/eth.c
net/net.c
tools/env/README
tools/env/fw_env.c
tools/env/fw_env.config
tools/env/fw_env.h
tools/imximage.h
tools/mkimage.c

index 4756f14d19b505bfc39d9ddd0464f2a33840b3b5..e2a4ba931b6180b8576d1ed872ddd167fd3ceb3b 100644 (file)
@@ -427,12 +427,19 @@ Heiko Schocher <hs@denx.de>
        ids8247         MPC8247
        jupiter         MPC5200
        kmeter1         MPC8360
+       kmsupx5         MPC8321
        mgcoge          MPC8247
+       mgcoge2ne       MPC8247
+       mgcoge2un       ARM926EJS (Kirkwood SoC)
        mucmc52         MPC5200
        muas3001        MPC8270
        municse         MPC5200
        sc3             PPC405GP
        suen3           ARM926EJS (Kirkwood SoC)
+       suen8           ARM926EJS (Kirkwood SoC)
+       suvd3           MPC8321
+       tuda1           MPC8321
+       tuxa1           MPC8321
        uc101           MPC5200
        ve8313          MPC8313
 
@@ -547,7 +554,7 @@ Unknown / orphaned boards:
 #      Board           CPU                                             #
 #########################################################################
 
-Albert ARIBAUD <albert.aribaud@free.fr>
+Albert ARIBAUD <albert.u.boot@aribaud.net>
 
        edminiv2        ARM926EJS (Orion5x SoC)
 
@@ -599,6 +606,10 @@ Rick Bronson <rick@efn.org>
 
        AT91RM9200DK    at91rm9200
 
+Luca Ceresoli <luca.ceresoli@comelit.it>
+
+       dig297          ARM ARMV7 (OMAP3530 SoC)
+
 Po-Yu Chuang <ratbert@faraday-tech.com>
 
        a320evb         FA526 (ARM920T-like) (a320 SoC)
@@ -624,7 +635,7 @@ Kristoffer Ericson <kristoffer.ericson@gmail.com>
 
        jornada SA1110
 
-Fabio Estevam <Fabio.Estevam@freescale.com>
+Fabio Estevam <fabio.estevam@freescale.com>
 
        mx31pdk         i.MX31
 
@@ -646,6 +657,10 @@ Marius Gr
        impa7           ARM720T (EP7211)
        ep7312          ARM720T (EP7312)
 
+Igor Grinberg <grinberg@compulab.co.il>
+
+       cm-t35          ARM ARMV7 (OMAP3xx Soc)
+
 Kshitij Gupta <kshitij@ti.com>
 
        omap1510inn     ARM925T
@@ -726,6 +741,10 @@ Eric Millbrandt <emillbrandt@dekaresearch.com>
 
        galaxy5200      mpc5200
 
+Nagendra T S  <nagendra@mistralsolutions.com>
+
+   am3517_crane    ARM ARMV7 (AM35x SoC)
+
 Rolf Offermanns <rof@sysgo.de>
 
        shannon         SA1100
@@ -763,10 +782,6 @@ Stelian Pop <stelian.pop@leadtechdesign.com>
        at91sam9263ek   ARM926EJS (AT91SAM9263 SoC)
        at91sam9rlek    ARM926EJS (AT91SAM9RL SoC)
 
-Mike Rapoport <mike@compulab.co.il>
-
-       cm_t35          ARM ARMV7 (OMAP3xx SoC)
-
 Tom Rix <Tom.Rix@windriver.com>
 
        omap3_zoom2     ARM ARMV7 (OMAP3xx SoC)
@@ -905,9 +920,9 @@ Unknown / orphaned boards:
 #      Board           CPU                                             #
 #########################################################################
 
-Daniel Engström <daniel@omicron.se>
+Graeme Russ <graeme.russ@gmail.com>
 
-       sc520_cdp       x86
+       eNET            AMD SC520
 
 #########################################################################
 # MIPS Systems:                                                                #
@@ -919,7 +934,6 @@ Daniel Engstr
 Wolfgang Denk <wd@denx.de>
 
        incaip          MIPS32 4Kc
-       purple          MIPS64 5Kc
 
 Thomas Lange <thomas@corelatus.se>
        dbau1x00        MIPS32 Au1000
@@ -1059,6 +1073,7 @@ Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
 Mike Frysinger <vapier@gentoo.org>
 Blackfin Team <u-boot-devel@blackfin.uclinux.org>
 
+       BF506F-EZKIT    BF506
        BF518F-EZBRD    BF518
        BF526-EZBRD     BF526
        BF527-AD7160-EVAL       BF527
@@ -1073,6 +1088,10 @@ Blackfin Team <u-boot-devel@blackfin.uclinux.org>
        BF548-EZKIT     BF548
        BF561-EZKIT     BF561
 
+M.Hasewinkel (MHA) <info@ssv-embedded.de>
+
+       dnp5370         BF537
+
 Brent Kandetzki <brentk@teleco.com>
 
        IP04            BF532
@@ -1113,6 +1132,11 @@ Anton Shurpin <shurpin.aa@niistt.ru>
 
        BF561-ACVILON   BF561
 
+Haitao Zhang <hzhang@ucrobotics.com>
+Chong Huang <chuang@ucrobotics.com>
+
+       bf525-ucr2      BF525
+
 #########################################################################
 # End of MAINTAINERS list                                              #
 #########################################################################
diff --git a/MAKEALL b/MAKEALL
index a732e6adc384089172b66478ad4eb7609ce2a660..c3df6575e2fd4cdd76c9eac0d2476ba9df173d79 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -418,9 +418,11 @@ LIST_ARM11="                       \
 ## ARMV7 Systems
 #########################################################################
 LIST_ARMV7="           \
+       am3517_crane            \
        am3517_evm              \
        ca9x4_ct_vxp            \
        devkit8000              \
+       dig297                  \
        igep0020                \
        igep0030                \
        mx51evk                 \
@@ -507,9 +509,7 @@ LIST_mips4kc="              \
        vct_premium_onenand_small       \
 "
 
-LIST_mips5kc="         \
-       purple          \
-"
+LIST_mips5kc=""
 
 LIST_au1xx0="          \
        dbau1000        \
@@ -546,10 +546,10 @@ LIST_mips_el="                    \
 "
 
 #########################################################################
-## i386 Systems
+## x86 Systems
 #########################################################################
 
-LIST_x86="$(boards_by_arch i386)"
+LIST_x86="$(boards_by_arch x86)"
 
 #########################################################################
 ## Nios-II Systems
index 10a856a56246dbdaafd663eb5bbbe45a66fce242..384a59e803d677d4c2fae1e4a302556785b11b7c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h
 VERSION_FILE = $(obj)include/version_autogenerated.h
 
 HOSTARCH := $(shell uname -m | \
-       sed -e s/i.86/i386/ \
+       sed -e s/i.86/x86/ \
            -e s/sun4u/sparc64/ \
            -e s/arm.*/arm/ \
            -e s/sa110/arm/ \
@@ -167,7 +167,7 @@ include $(TOPDIR)/config.mk
 # U-Boot objects....order is important (i.e. start must be first)
 
 OBJS  = $(CPUDIR)/start.o
-ifeq ($(CPU),i386)
+ifeq ($(CPU),x86)
 OBJS += $(CPUDIR)/start16.o
 OBJS += $(CPUDIR)/resetvec.o
 endif
@@ -183,6 +183,7 @@ OBJS := $(addprefix $(obj),$(OBJS))
 LIBS  = lib/libgeneric.o
 LIBS += lib/lzma/liblzma.o
 LIBS += lib/lzo/liblzo.o
+LIBS += lib/zlib/libz.o
 LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
        "board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
 LIBS += $(CPUDIR)/lib$(CPU).o
@@ -352,7 +353,7 @@ $(obj)u-boot.img:   $(obj)u-boot.bin
                -d $< $@
 
 $(obj)u-boot.imx:       $(obj)u-boot.bin
-               $(obj)tools/mkimage -n $(IMX_CONFIG) -T imximage \
+               $(obj)tools/mkimage -n  $(CONFIG_IMX_CONFIG) -T imximage \
                -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
 
 $(obj)u-boot.kwb:       $(obj)u-boot.bin
@@ -413,8 +414,12 @@ $(obj)u-boot-onenand.bin:  onenand_ipl $(obj)u-boot.bin
                cat $(ONENAND_BIN) $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
 
 $(VERSION_FILE):
-               @( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \
-                '$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ) > $@.tmp
+               @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
+                  printf '#define PLAIN_VERSION "%s%s"\n' \
+                       "$(U_BOOT_VERSION)" "$${localvers}" ; \
+                  printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
+                       "$(U_BOOT_VERSION)" "$${localvers}" ; \
+               ) > $@.tmp
                @( printf '#define CC_VERSION_STRING "%s"\n' \
                 '$(shell $(CC) --version | head -n 1)' )>>  $@.tmp
                @( printf '#define LD_VERSION_STRING "%s"\n' \
@@ -748,16 +753,6 @@ M5485HFE_config :  unconfig
 # ARM
 #========================================================================
 
-#########################################################################
-## Atmel AT91RM9200 Systems
-#########################################################################
-
-CPUAT91_RAM_config \
-CPUAT91_config :       unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_$(@:_config=) 1"  >$(obj)include/config.h
-       @$(MKCONFIG) -n $@ -a cpuat91 arm arm920t cpuat91 eukrea at91
-
 #########################################################################
 ## ARM926EJ-S Systems
 #########################################################################
@@ -929,15 +924,6 @@ cp922_XA10_config  \
 cp1026_config: unconfig
        @board/armltd/integrator/split_by_variant.sh cp $@
 
-nhk8815_config \
-nhk8815_onenand_config:        unconfig
-       @mkdir -p $(obj)include
-       @ > $(obj)include/config.h
-       @if [ "$(findstring _onenand, $@)" ] ; then \
-               echo "#define CONFIG_BOOT_ONENAND" >> $(obj)include/config.h; \
-       fi
-       @$(MKCONFIG) -n $@ -a nhk8815 arm arm926ejs nhk8815 st nomadik
-
 xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$(subst _config,,$1))))
 
 omap1610inn_config \
diff --git a/README b/README
index 21cd71b297854b36c8777d644b8790aa14a9be4b..76b150005f8d1f63ea36fd92e02c06411fdb3eda 100644 (file)
--- a/README
+++ b/README
@@ -164,7 +164,7 @@ Directory Hierarchy:
   /blackfin            Files generic to Analog Devices Blackfin architecture
     /cpu               CPU specific files
     /lib               Architecture specific library files
-  /i386                        Files generic to i386 architecture
+  /x86                 Files generic to x86 architecture
     /cpu               CPU specific files
     /lib               Architecture specific library files
   /m68k                        Files generic to m68k architecture
@@ -356,6 +356,13 @@ The following options need to be configured:
                Define this option if you want to enable the
                ICache only when Code runs from RAM.
 
+- 85xx CPU Options:
+               CONFIG_SYS_FSL_TBCLK_DIV
+
+               Defines the core time base clock divider ratio compared to the
+               system clock.  On most PQ3 devices this is 8, on newer QorIQ
+               devices it can be 16 or 32.  The ratio varies from SoC to Soc.
+
 - Intel Monahans options:
                CONFIG_SYS_MONAHANS_RUN_MODE_OSC_RATIO
 
@@ -625,6 +632,7 @@ The following options need to be configured:
                CONFIG_CMD_BOOTD          bootd
                CONFIG_CMD_CACHE        * icache, dcache
                CONFIG_CMD_CONSOLE        coninfo
+               CONFIG_CMD_CRC32        * crc32
                CONFIG_CMD_DATE         * support for RTC, date/time...
                CONFIG_CMD_DHCP         * DHCP support
                CONFIG_CMD_DIAG         * Diagnostics
@@ -637,22 +645,27 @@ The following options need to be configured:
                CONFIG_CMD_EDITENV        edit env variable
                CONFIG_CMD_EEPROM       * EEPROM read/write support
                CONFIG_CMD_ELF          * bootelf, bootvx
+               CONFIG_CMD_EXPORTENV    * export the environment
                CONFIG_CMD_SAVEENV        saveenv
                CONFIG_CMD_FDC          * Floppy Disk Support
                CONFIG_CMD_FAT          * FAT partition support
                CONFIG_CMD_FDOS         * Dos diskette Support
                CONFIG_CMD_FLASH          flinfo, erase, protect
                CONFIG_CMD_FPGA           FPGA device initialization support
+               CONFIG_CMD_GO           * the 'go' command (exec code)
+               CONFIG_CMD_GREPENV      * search environment
                CONFIG_CMD_HWFLOW       * RTS/CTS hw flow control
                CONFIG_CMD_I2C          * I2C serial bus support
                CONFIG_CMD_IDE          * IDE harddisk support
                CONFIG_CMD_IMI            iminfo
                CONFIG_CMD_IMLS           List all found images
                CONFIG_CMD_IMMAP        * IMMR dump support
+               CONFIG_CMD_IMPORTENV    * import an environment
                CONFIG_CMD_IRQ          * irqinfo
                CONFIG_CMD_ITEST          Integer/string test of 2 values
                CONFIG_CMD_JFFS2        * JFFS2 Support
                CONFIG_CMD_KGDB         * kgdb
+               CONFIG_CMD_LDRINFO        ldrinfo (display Blackfin loader)
                CONFIG_CMD_LOADB          loadb
                CONFIG_CMD_LOADS          loads
                CONFIG_CMD_MD5SUM         print md5 message digest
@@ -743,6 +756,8 @@ The following options need to be configured:
                CONFIG_RTC_ISL1208      - use Intersil ISL1208 RTC
                CONFIG_RTC_MAX6900      - use Maxim, Inc. MAX6900 RTC
                CONFIG_SYS_RTC_DS1337_NOOSC     - Turn off the OSC output for DS1337
+               CONFIG_SYS_RV3029_TCR   - enable trickle charger on
+                                         RV3029 RTC.
 
                Note that if the RTC uses I2C, then the I2C interface
                must also be configured. See I2C Support, below.
@@ -1074,6 +1089,25 @@ The following options need to be configured:
                and 16bpp modes defined by CONFIG_VIDEO_SED13806_8BPP
                or CONFIG_VIDEO_SED13806_16BPP
 
+               CONFIG_FSL_DIU_FB
+               Enable the Freescale DIU video driver.  Reference boards for
+               SOCs that have a DIU should define this macro to enable DIU
+               support, and should also define these other macros:
+
+                       CONFIG_SYS_DIU_ADDR
+                       CONFIG_VIDEO
+                       CONFIG_CMD_BMP
+                       CONFIG_CFB_CONSOLE
+                       CONFIG_VIDEO_SW_CURSOR
+                       CONFIG_VGA_AS_SINGLE_DEVICE
+                       CONFIG_VIDEO_LOGO
+                       CONFIG_VIDEO_BMP_LOGO
+
+               The DIU driver will look for the 'video-mode' environment
+               variable, and if defined, enable the DIU as a console during
+               boot.  See the documentation file README.video for a
+               description of this variable.
+
 - Keyboard Support:
                CONFIG_KEYBOARD
 
@@ -1974,6 +2008,28 @@ The following options need to be configured:
                example, some LED's) on your board. At the moment,
                the following checkpoints are implemented:
 
+- Standalone program support:
+               CONFIG_STANDALONE_LOAD_ADDR
+
+               This option allows to define board specific values
+               for the address where standalone program gets loaded,
+               thus overwriting the architecutre dependent default
+               settings.
+
+- Frame Buffer Address:
+       CONFIG_FB_ADDR
+
+       Define CONFIG_FB_ADDR if you want to use specific address for
+       frame buffer.
+       Then system will reserve the frame buffer address to defined address
+       instead of lcd_setmem (this function grab the memory for frame buffer
+       by panel's size).
+
+       Please see board_init_f function.
+
+       If you want this config option then,
+       please define it at your board config file
+
 Legacy uImage format:
 
   Arg  Where                   When
@@ -2311,7 +2367,10 @@ Configuration Settings:
                used) must be put below this limit, unless "bootm_low"
                enviroment variable is defined and non-zero. In such case
                all data for the Linux kernel must be between "bootm_low"
-               and "bootm_low" + CONFIG_SYS_BOOTMAPSZ.
+               and "bootm_low" + CONFIG_SYS_BOOTMAPSZ.  The environment
+               variable "bootm_mapsize" will override the value of
+               CONFIG_SYS_BOOTMAPSZ.  If CONFIG_SYS_BOOTMAPSZ is undefined,
+               then the value in "bootm_size" will be used instead.
 
 - CONFIG_SYS_BOOT_RAMDISK_HIGH:
                Enable initrd_high functionality.  If defined then the
@@ -2699,6 +2758,14 @@ Low Level (hardware related) configuration options:
                source code. It is used to make hardware dependant
                initializations.
 
+- CONFIG_IDE_AHB:
+               Most IDE controllers were designed to be connected with PCI
+               interface. Only few of them were designed for AHB interface.
+               When software is doing ATA command and data transfer to
+               IDE devices through IDE-AHB controller, some additional
+               registers accessing to these kind of IDE-AHB controller
+               is requierd.
+
 - CONFIG_SYS_IMMR:     Physical address of the Internal Memory.
                DO NOT CHANGE unless you know exactly what you're
                doing! (11-4) [MPC8xx/82xx systems only]
@@ -2907,6 +2974,12 @@ Low Level (hardware related) configuration options:
                that is executed before the actual U-Boot. E.g. when
                compiling a NAND SPL.
 
+- CONFIG_USE_ARCH_MEMCPY
+  CONFIG_USE_ARCH_MEMSET
+               If these options are used a optimized version of memcpy/memset will
+               be used if available. These functions may be faster under some
+               conditions but may increase the binary size.
+
 Building the Software:
 ======================
 
@@ -3147,7 +3220,16 @@ List of environment variables (most likely not complete):
                  for use by the bootm command. See also "bootm_size"
                  environment variable. Address defined by "bootm_low" is
                  also the base of the initial memory mapping for the Linux
-                 kernel -- see the description of CONFIG_SYS_BOOTMAPSZ.
+                 kernel -- see the description of CONFIG_SYS_BOOTMAPSZ and
+                 bootm_mapsize.
+
+  bootm_mapsize        - Size of the initial memory mapping for the Linux kernel.
+                 This variable is given as a hexadecimal number and it
+                 defines the size of the memory region starting at base
+                 address bootm_low that is accessible by the Linux kernel
+                 during early boot.  If unset, CONFIG_SYS_BOOTMAPSZ is used
+                 as the default value if it is defined, and bootm_size is
+                 used otherwise.
 
   bootm_size   - Memory range available for image processing in the bootm
                  command can be restricted. This variable is given as
index a6a47424518d1a2c5169377a6c8b714eef268a81..ec1b4209518cdef8bd4a1bf979e363be7f708d3c 100644 (file)
 
 CROSS_COMPILE ?= arm-linux-
 
-ifeq ($(BOARD),omap2420h4)
-STANDALONE_LOAD_ADDR = 0x80300000
-else
+ifndef CONFIG_STANDALONE_LOAD_ADDR
 ifeq ($(SOC),omap3)
-STANDALONE_LOAD_ADDR = 0x80300000
+CONFIG_STANDALONE_LOAD_ADDR = 0x80300000
 else
-STANDALONE_LOAD_ADDR = 0xc100000
+CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
 endif
 endif
 
@@ -63,7 +61,6 @@ ifeq (,$(findstring arch/arm/lib/eabi_compat.o,$(PLATFORM_LIBS)))
 PLATFORM_LIBS += $(OBJTREE)/arch/arm/lib/eabi_compat.o
 endif
 endif
-LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
 
 # needed for relocation
 ifndef CONFIG_NAND_SPL
index 1f4ca7eb44336ea5a3ba1f8665e41265c29ab06b..1e7d48f8fb440928d0d6ec24e7a936676e826c81 100644 (file)
@@ -24,8 +24,8 @@
  */
 
 #include <common.h>
-#include <asm/arch/mx31-regs.h>
-#include <asm/arch/mx31.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/clock.h>
 
 #ifdef CONFIG_SYS_MX31_UART1
 void mx31_uart1_hw_init(void)
index 8bd23ee870573c95d829ddd4e7f5cf98069bed04..18572b9d37eff80fc9a16da7606a55d8e429ad27 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #include <common.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 #include <asm/io.h>
 
 static u32 mx31_decode_pll(u32 reg, u32 infreq)
@@ -106,11 +106,64 @@ void mx31_set_pad(enum iomux_pins pin, u32 config)
 
 }
 
+struct mx3_cpu_type mx31_cpu_type[] = {
+       { .srev = 0x00, .v = "1.0"  },
+       { .srev = 0x10, .v = "1.1"  },
+       { .srev = 0x11, .v = "1.1"  },
+       { .srev = 0x12, .v = "1.15" },
+       { .srev = 0x13, .v = "1.15" },
+       { .srev = 0x14, .v = "1.2"  },
+       { .srev = 0x15, .v = "1.2"  },
+       { .srev = 0x28, .v = "2.0"  },
+       { .srev = 0x29, .v = "2.0"  },
+};
+
+char *get_cpu_rev(void)
+{
+       u32 i, srev;
+
+       /* read SREV register from IIM module */
+       struct iim_regs *iim = (struct iim_regs *)MX31_IIM_BASE_ADDR;
+       srev = readl(&iim->iim_srev);
+
+       for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++)
+               if (srev == mx31_cpu_type[i].srev)
+                       return mx31_cpu_type[i].v;
+               return "unknown";
+}
+
+char *get_reset_cause(void)
+{
+       /* read RCSR register from CCM module */
+       struct clock_control_regs *ccm =
+               (struct clock_control_regs *)CCM_BASE;
+
+       u32 cause = readl(&ccm->rcsr) & 0x07;
+
+       switch (cause) {
+       case 0x0000:
+               return "POR";
+               break;
+       case 0x0001:
+               return "RST";
+               break;
+       case 0x0002:
+               return "WDOG";
+               break;
+       case 0x0006:
+               return "JTAG";
+               break;
+       default:
+               return "unknown reset";
+       }
+}
+
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo (void)
 {
-       printf("CPU:   Freescale i.MX31 at %d MHz\n",
-               mx31_get_mcu_main_clk() / 1000000);
+       printf("CPU:   Freescale i.MX31 rev %s at %d MHz.",
+                       get_cpu_rev(), mx31_get_mcu_main_clk() / 1000000);
+       printf("Reset cause: %s\n", get_reset_cause());
        return 0;
 }
 #endif
index f6be3b94a4f3b969570be04231da6427b77aafd8..c4bc3b35210fe5d1c1c8d6cc504c936fb225b0d0 100644 (file)
  */
 
 #include <common.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 #include <div64.h>
+#include <watchdog.h>
+#include <asm/io.h>
 
 #define TIMER_BASE 0x53f90000 /* General purpose timer 1 */
 
@@ -165,5 +167,39 @@ void __udelay (unsigned long usec)
 
 void reset_cpu (ulong addr)
 {
-       __REG16(WDOG_BASE) = 4;
+       struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE;
+       wdog->wcr = WDOG_ENABLE;
+       while (1)
+               ;
 }
+
+#ifdef CONFIG_HW_WATCHDOG
+void mxc_hw_watchdog_enable(void)
+{
+       struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE;
+       u16 secs;
+
+       /*
+        * The timer watchdog can be set between
+        * 0.5 and 128 Seconds. If not defined
+        * in configuration file, sets 64 Seconds
+        */
+#ifdef CONFIG_SYS_WD_TIMER_SECS
+       secs = (CONFIG_SYS_WD_TIMER_SECS << 1) & 0xFF;
+       if (!secs) secs = 1;
+#else
+       secs = 64;
+#endif
+       writew(readw(&wdog->wcr) | (secs << WDOG_WT_SHIFT) | WDOG_ENABLE,
+               &wdog->wcr);
+}
+
+
+void mxc_hw_watchdog_reset(void)
+{
+       struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE;
+
+       writew(0x5555, &wdog->wsr);
+       writew(0xAAAA, &wdog->wsr);
+}
+#endif
index 31da706e593644f8c5a2e25e9d6e81a0bb955c13..50eb26566593e80a8a08ad2ad0ecf00a22208e82 100644 (file)
@@ -27,7 +27,6 @@ LIB   = $(obj)lib$(SOC).o
 
 SOBJS  += reset.o
 COBJS  += timer.o
-COBJS  += ftsmc020.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
index d2e316fd54cf5f1c5ebf99f3c59023b679ab9fb2..95cb8fd19fe19eabb419197818ebdf3bc3abcca3 100644 (file)
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/ftpmu010.h>
-#include <asm/arch/fttmr010.h>
+#include <faraday/ftpmu010.h>
+#include <faraday/fttmr010.h>
 
 static ulong timestamp;
 static ulong lastdec;
 
 static struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
-static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
 
 #define TIMER_CLOCK    32768
 #define TIMER_LOAD_VAL 0xffffffff
 
 int timer_init(void)
 {
-       unsigned int oscc;
        unsigned int cr;
 
        debug("%s()\n", __func__);
@@ -41,23 +39,8 @@ int timer_init(void)
        /* disable timers */
        writel(0, &tmr->cr);
 
-       /*
-        * use 32768Hz oscillator for RTC, WDT, TIMER
-        */
-
-       /* enable the 32768Hz oscillator */
-       oscc = readl(&pmu->OSCC);
-       oscc &= ~(FTPMU010_OSCC_OSCL_OFF | FTPMU010_OSCC_OSCL_TRI);
-       writel(oscc, &pmu->OSCC);
-
-       /* wait until ready */
-       while (!(readl(&pmu->OSCC) & FTPMU010_OSCC_OSCL_STABLE))
-               ;
-
-       /* select 32768Hz oscillator */
-       oscc = readl(&pmu->OSCC);
-       oscc |= FTPMU010_OSCC_OSCL_RTCLSEL;
-       writel(oscc, &pmu->OSCC);
+       /* use 32768Hz oscillator for RTC, WDT, TIMER */
+       ftpmu010_32768osc_enable();
 
        /* setup timer */
        writel(TIMER_LOAD_VAL, &tmr->timer3_load);
index e1cdebab9d8bfc7eb75c392d6c7bc93a6a2380fe..d7135c57d5d4539a5cd8ff18ebbc08cbaa706552 100644 (file)
@@ -39,7 +39,7 @@ typedef struct {
 #define RBF_MULTICAST (1<<30)
 #define RBF_UNICAST   (1<<29)
 #define RBF_EXTERNAL  (1<<28)
-#define RBF_UNKOWN    (1<<27)
+#define RBF_UNKNOWN   (1<<27)
 #define RBF_SIZE      0x07ff
 #define RBF_LOCAL4    (1<<26)
 #define RBF_LOCAL3    (1<<25)
index 62aa1753ce022354cfb7acd2cf19065bf213b26b..c21938e31fa28fc9269e771856c82d1bbb235655 100644 (file)
@@ -62,6 +62,16 @@ int arch_cpu_init(void)
        /* Enable GPIO clock */
        writel(APBC_APBCLK, &apb1clkres->gpio);
 
+#ifdef CONFIG_I2C_MV
+       /* Enable general I2C clock */
+       writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi0);
+       writel(APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi0);
+
+       /* Enable power I2C clock */
+       writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi1);
+       writel(APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi1);
+#endif
+
        /*
         * Enable Functional and APB clock at 14.7456MHz
         * for configured UART console
@@ -90,3 +100,9 @@ int print_cpuinfo(void)
        return 0;
 }
 #endif
+
+#ifdef CONFIG_I2C_MV
+void i2c_clk_enable(void)
+{
+}
+#endif
index c6e114634aba58d5c4c064323bd2a77d054d12c2..76e4b5c39734964beb58df289b1e2710bf01cb5f 100644 (file)
@@ -145,7 +145,7 @@ int cpu_mmc_init (bd_t * bis)
 }
 
 #ifdef CONFIG_MXC_UART
-void mx25_uart_init_pins (void)
+void mx25_uart1_init_pins(void)
 {
        struct iomuxc_mux_ctl *muxctl;
        struct iomuxc_pad_ctl *padctl;
index e5a9994e6bc072ba604025fcaa0a35790dd43985..a4298b4b9c292dc9fb8b1ecefe2036e480e07a35 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+# Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
 #
 # Based on original Kirkwood support which is
 # (C) Copyright 2009
index 1894b52fbf13043bd192954c11665a4bfea01036..05bd45c3f61927d56b3b0cee1181dc54e6989738 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+ * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
  * Based on original Kirkwood support which is
  * (C) Copyright 2009
index b749282099061f0210bf71fdcc5c2adac90e5b11..3e1ff7d8ea66bed3bd02946a684ba4ffee84bb2d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+ * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
  * Based on original Kirkwood support which is
  * (C) Copyright 2009
@@ -38,7 +38,7 @@ u32 orion5x_sdram_bar(enum memory_bank bank)
 {
        struct orion5x_ddr_addr_decode_registers *winregs =
                (struct orion5x_ddr_addr_decode_registers *)
-               ORION5X_CPU_WIN_BASE;
+               ORION5X_DRAM_BASE;
 
        u32 result = 0;
        u32 enable = 0x01 & winregs[bank].size;
index 0523bd468a114be63457312aa68d33eadc1d6ab3..a2de3cf710f595715fb585f86f61e21b651e0570 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+ * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
  * (C) Copyright 2009
  * Marvell Semiconductor <www.marvell.com>
index bbab2269ddab85ecd83fd3729708731d01d5929e..9d452606122838efcbdd730e323cae4355ad4279 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  * Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+  * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
  * Based on original Kirkwood support which is
  * Copyright (C) Marvell International Ltd. and its affiliates
index 9ddc77c0718c4ffb489f87e82a13ed0894a94ffb..8b2eafa40b466dc5f058643ce4a9cd1a09644911 100644 (file)
@@ -59,6 +59,12 @@ int arch_cpu_init(void)
        /* Enable GPIO clock */
        writel(APBC_APBCLK, &apbclkres->gpio);
 
+#ifdef CONFIG_I2C_MV
+       /* Enable I2C clock */
+       writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apbclkres->twsi);
+       writel(APBC_FNCLK | APBC_APBCLK, &apbclkres->twsi);
+#endif
+
        icache_enable();
 
        return 0;
@@ -76,3 +82,9 @@ int print_cpuinfo(void)
        return 0;
 }
 #endif
+
+#ifdef CONFIG_I2C_MV
+void i2c_clk_enable(void)
+{
+}
+#endif
index fefcfa2f886819d9e07c21a435c5fdd2db2870e6..09409370c94facf3a738d58b8344af80274b77c4 100644 (file)
@@ -10,7 +10,7 @@
  *  Copyright (c) 2002 Gary Jennejohn <garyj@denx.de>
  *  Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
  *  Copyright (c) 2003 Kshitij <kshitij@ti.com>
- *  Copyright (c) 2010 Albert Aribaud <albert.aribaud@free.fr>
+ *  Copyright (c) 2010 Albert Aribaud <albert.u.boot@aribaud.net>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
index 00914f42e9cde5829426cb21f1a6eff66acf2889..0054b22e4a801bf1d1646f9a39c990888407e762 100644 (file)
@@ -10,7 +10,7 @@
  *  Copyright (c) 2002 Gary Jennejohn <garyj@denx.de>
  *  Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
  *  Copyright (c) 2003 Kshitij <kshitij@ti.com>
- *  Copyright (c) 2010 Albert Aribaud <albert.aribaud@free.fr>
+ *  Copyright (c) 2010 Albert Aribaud <albert.u.boot@aribaud.net>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
index 09500b3b9f4d0eaa5a98dfaf62e19f10a82425f6..6f4e8db74d0ffa589e40274230b2fe93c465aa8e 100644 (file)
@@ -77,6 +77,33 @@ u32 get_cpu_rev(void)
        return system_rev;
 }
 
+static char *get_reset_cause(void)
+{
+       u32 cause;
+       struct src *src_regs = (struct src *)SRC_BASE_ADDR;
+
+       cause = readl(&src_regs->srsr);
+       writel(cause, &src_regs->srsr);
+
+       switch (cause) {
+       case 0x00001:
+               return "POR";
+       case 0x00004:
+               return "CSU";
+       case 0x00008:
+               return "IPP USER";
+       case 0x00010:
+               return "WDOG";
+       case 0x00020:
+               return "JTAG HIGH-Z";
+       case 0x00040:
+               return "JTAG SW";
+       case 0x10000:
+               return "WARM BOOT";
+       default:
+               return "unknown reset";
+       }
+}
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo(void)
@@ -89,6 +116,7 @@ int print_cpuinfo(void)
                (cpurev & 0x000F0) >> 4,
                (cpurev & 0x0000F) >> 0,
                mxc_get_clock(MXC_ARM_CLK) / 1000000);
+       printf("Reset cause: %s\n", get_reset_cause());
        return 0;
 }
 #endif
index 2238c52e3bec7c23d0c97546cba293788d2db7de..3d38d08ccbfee81062c442a65deb1dd3af0c1f5d 100644 (file)
@@ -278,6 +278,25 @@ static void dpll4_init_34xx(u32 sil_index, u32 clk_index)
        wait_on_value(ST_PERIPH_CLK, 2, &prcm_base->idlest_ckgen, LDELAY);
 }
 
+static void dpll5_init_34xx(u32 sil_index, u32 clk_index)
+{
+       struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
+       dpll_param *ptr = (dpll_param *) get_per2_dpll_param();
+
+       /* Moving it to the right sysclk base */
+       ptr = ptr + clk_index;
+
+       /* PER2 DPLL (DPLL5) */
+       sr32(&prcm_base->clken2_pll, 0, 3, PLL_STOP);
+       wait_on_value(1, 0, &prcm_base->idlest2_ckgen, LDELAY);
+       sr32(&prcm_base->clksel5_pll, 0, 5, ptr->m2); /* set M2 (usbtll_fck) */
+       sr32(&prcm_base->clksel4_pll, 8, 11, ptr->m); /* set m (11-bit multiplier) */
+       sr32(&prcm_base->clksel4_pll, 0, 7, ptr->n); /* set n (7-bit divider)*/
+       sr32(&prcm_base->clken_pll, 4, 4, ptr->fsel);   /* FREQSEL */
+       sr32(&prcm_base->clken2_pll, 0, 3, PLL_LOCK);   /* lock mode */
+       wait_on_value(1, 1, &prcm_base->idlest2_ckgen, LDELAY);
+}
+
 static void mpu_init_34xx(u32 sil_index, u32 clk_index)
 {
        struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
@@ -587,6 +606,7 @@ void prcm_init(void)
 
                dpll3_init_34xx(sil_index, clk_index);
                dpll4_init_34xx(sil_index, clk_index);
+               dpll5_init_34xx(sil_index, clk_index);
                iva_init_34xx(sil_index, clk_index);
                mpu_init_34xx(sil_index, clk_index);
 
index 109481e1c6d4527c42ba45e5f0e92c3f132db8dc..14580729bbb562bbc3d3a2563d84a02067c23beb 100644 (file)
@@ -360,6 +360,28 @@ get_per_dpll_param:
        adr     r0, per_dpll_param
        mov     pc, lr
 
+/* PER2 DPLL values */
+per2_dpll_param:
+/* 12MHz */
+.word PER2_M_12, PER2_N_12, PER2_FSEL_12, PER2_M2_12
+
+/* 13MHz */
+.word PER2_M_13, PER2_N_13, PER2_FSEL_13, PER2_M2_13
+
+/* 19.2MHz */
+.word PER2_M_19P2, PER2_N_19P2, PER2_FSEL_19P2, PER2_M2_19P2
+
+/* 26MHz */
+.word PER2_M_26, PER2_N_26, PER2_FSEL_26, PER2_M2_26
+
+/* 38.4MHz */
+.word PER2_M_38P4, PER2_N_38P4, PER2_FSEL_38P4, PER2_M2_38P4
+
+.globl get_per2_dpll_param
+get_per2_dpll_param:
+       adr     r0, per2_dpll_param
+       mov     pc, lr
+
 /*
  * Tables for 36XX/37XX devices
  *
index bd914b0ee559ea15adeee62ea084af849269b9c5..a01c303e719afd71b5153a519119b522726908a1 100644 (file)
 #include <asm/arch/sys_proto.h>
 #include <command.h>
 
-/*
- * Only One NAND allowed on board at a time.
- * The GPMC CS Base for the same
- */
-unsigned int boot_flash_base;
-unsigned int boot_flash_off;
-unsigned int boot_flash_sec;
-unsigned int boot_flash_type;
-volatile unsigned int boot_flash_env_addr;
-
 struct gpmc *gpmc_cfg;
 
 #if defined(CONFIG_CMD_NAND)
@@ -134,10 +124,6 @@ void gpmc_init(void)
        const u32 *gpmc_config = NULL;
        u32 base = 0;
        u32 size = 0;
-#if defined(CONFIG_ENV_IS_IN_NAND) || defined(CONFIG_ENV_IS_IN_ONENAND)
-       u32 f_off = CONFIG_SYS_MONITOR_LEN;
-       u32 f_sec = 0;
-#endif
 #endif
        u32 config = 0;
 
@@ -162,15 +148,6 @@ void gpmc_init(void)
        base = PISMO1_NAND_BASE;
        size = PISMO1_NAND_SIZE;
        enable_gpmc_cs_config(gpmc_config, &gpmc_cfg->cs[0], base, size);
-#if defined(CONFIG_ENV_IS_IN_NAND)
-       f_off = SMNAND_ENV_OFFSET;
-       f_sec = (128 << 10);    /* 128 KiB */
-       /* env setup */
-       boot_flash_base = base;
-       boot_flash_off = f_off;
-       boot_flash_sec = f_sec;
-       boot_flash_env_addr = f_off;
-#endif
 #endif
 
 #if defined(CONFIG_CMD_ONENAND)
@@ -178,14 +155,5 @@ void gpmc_init(void)
        base = PISMO1_ONEN_BASE;
        size = PISMO1_ONEN_SIZE;
        enable_gpmc_cs_config(gpmc_config, &gpmc_cfg->cs[0], base, size);
-#if defined(CONFIG_ENV_IS_IN_ONENAND)
-       f_off = ONENAND_ENV_OFFSET;
-       f_sec = (128 << 10);    /* 128 KiB */
-       /* env setup */
-       boot_flash_base = base;
-       boot_flash_off = f_off;
-       boot_flash_sec = f_sec;
-       boot_flash_env_addr = f_off;
-#endif
 #endif
 }
index d83d50183796ed29e509cb2e2695d529a095f6b6..2929fc7e32b216279104feb60e5e833301d7e014 100644 (file)
@@ -70,6 +70,18 @@ _end_vect:
 _TEXT_BASE:
        .word   CONFIG_SYS_TEXT_BASE
 
+#ifdef CONFIG_TEGRA2
+/*
+ * Tegra2 uses 2 separate CPUs - the AVP (ARM7TDMI) and the CPU (dual A9s).
+ * U-Boot runs on the AVP first, setting things up for the CPU (PLLs,
+ * muxes, clocks, clamps, etc.). Then the AVP halts, and expects the CPU
+ * to pick up its reset vector, which points here.
+ */
+.globl _armboot_start
+_armboot_start:
+        .word _start
+#endif
+
 /*
  * These are defined in the board-specific linker script.
  */
@@ -115,7 +127,7 @@ reset:
        orr     r0, r0, #0xd3
        msr     cpsr,r0
 
-#if (CONFIG_OMAP34XX)
+#if defined(CONFIG_OMAP34XX)
        /* Copy vectors to mask ROM indirect addr */
        adr     r0, _start              @ r0 <- current position of code
        add     r0, r0, #4              @ skip reset vector
index 687c8871c52b65b1aaf5ec8209262f8fc1445d02..f1ea9158516dc6a6e08e260acc27bd227fc9c041 100644 (file)
@@ -28,7 +28,7 @@ include $(TOPDIR)/config.mk
 LIB    =  $(obj)lib$(SOC).o
 
 SOBJS  := lowlevel_init.o
-COBJS  := board.o sys_info.o timer.o
+COBJS  := ap20.o board.o sys_info.o timer.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/arch/arm/cpu/armv7/tegra2/ap20.c b/arch/arm/cpu/armv7/tegra2/ap20.c
new file mode 100644 (file)
index 0000000..60dd5df
--- /dev/null
@@ -0,0 +1,358 @@
+/*
+* (C) Copyright 2010-2011
+* NVIDIA Corporation <www.nvidia.com>
+*
+* See file CREDITS for list of people who contributed to this
+* project.
+*
+* 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 "ap20.h"
+#include <asm/io.h>
+#include <asm/arch/tegra2.h>
+#include <asm/arch/clk_rst.h>
+#include <asm/arch/pmc.h>
+#include <asm/arch/pinmux.h>
+#include <asm/arch/scu.h>
+#include <common.h>
+
+u32 s_first_boot = 1;
+
+void init_pllx(void)
+{
+       struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+       u32 reg;
+
+       /* If PLLX is already enabled, just return */
+       reg = readl(&clkrst->crc_pllx_base);
+       if (reg & PLL_ENABLE)
+               return;
+
+       /* Set PLLX_MISC */
+       reg = CPCON;                            /* CPCON[11:8]  = 0001 */
+       writel(reg, &clkrst->crc_pllx_misc);
+
+       /* Use 12MHz clock here */
+       reg = (PLL_BYPASS | PLL_DIVM);
+       reg |= (1000 << 8);                     /* DIVN = 0x3E8 */
+       writel(reg, &clkrst->crc_pllx_base);
+
+       reg |= PLL_ENABLE;
+       writel(reg, &clkrst->crc_pllx_base);
+
+       reg &= ~PLL_BYPASS;
+       writel(reg, &clkrst->crc_pllx_base);
+}
+
+static void enable_cpu_clock(int enable)
+{
+       struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+       u32 reg, clk;
+
+       /*
+        * NOTE:
+        * Regardless of whether the request is to enable or disable the CPU
+        * clock, every processor in the CPU complex except the master (CPU 0)
+        * will have it's clock stopped because the AVP only talks to the
+        * master. The AVP does not know (nor does it need to know) that there
+        * are multiple processors in the CPU complex.
+        */
+
+       if (enable) {
+               /* Initialize PLLX */
+               init_pllx();
+
+               /* Wait until all clocks are stable */
+               udelay(PLL_STABILIZATION_DELAY);
+
+               writel(CCLK_BURST_POLICY, &clkrst->crc_cclk_brst_pol);
+               writel(SUPER_CCLK_DIVIDER, &clkrst->crc_super_cclk_div);
+       }
+
+       /* Fetch the register containing the main CPU complex clock enable */
+       reg = readl(&clkrst->crc_clk_out_enb_l);
+       reg |= CLK_ENB_CPU;
+
+       /*
+        * Read the register containing the individual CPU clock enables and
+        * always stop the clock to CPU 1.
+        */
+       clk = readl(&clkrst->crc_clk_cpu_cmplx);
+       clk |= CPU1_CLK_STP;
+
+       if (enable) {
+               /* Unstop the CPU clock */
+               clk &= ~CPU0_CLK_STP;
+       } else {
+               /* Stop the CPU clock */
+               clk |= CPU0_CLK_STP;
+       }
+
+       writel(clk, &clkrst->crc_clk_cpu_cmplx);
+       writel(reg, &clkrst->crc_clk_out_enb_l);
+}
+
+static int is_cpu_powered(void)
+{
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+
+       return (readl(&pmc->pmc_pwrgate_status) & CPU_PWRED) ? 1 : 0;
+}
+
+static void remove_cpu_io_clamps(void)
+{
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+       u32 reg;
+
+       /* Remove the clamps on the CPU I/O signals */
+       reg = readl(&pmc->pmc_remove_clamping);
+       reg |= CPU_CLMP;
+       writel(reg, &pmc->pmc_remove_clamping);
+
+       /* Give I/O signals time to stabilize */
+       udelay(IO_STABILIZATION_DELAY);
+}
+
+static void powerup_cpu(void)
+{
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+       u32 reg;
+       int timeout = IO_STABILIZATION_DELAY;
+
+       if (!is_cpu_powered()) {
+               /* Toggle the CPU power state (OFF -> ON) */
+               reg = readl(&pmc->pmc_pwrgate_toggle);
+               reg &= PARTID_CP;
+               reg |= START_CP;
+               writel(reg, &pmc->pmc_pwrgate_toggle);
+
+               /* Wait for the power to come up */
+               while (!is_cpu_powered()) {
+                       if (timeout-- == 0)
+                               printf("CPU failed to power up!\n");
+                       else
+                               udelay(10);
+               }
+
+               /*
+                * Remove the I/O clamps from CPU power partition.
+                * Recommended only on a Warm boot, if the CPU partition gets
+                * power gated. Shouldn't cause any harm when called after a
+                * cold boot according to HW, probably just redundant.
+                */
+               remove_cpu_io_clamps();
+       }
+}
+
+static void enable_cpu_power_rail(void)
+{
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+       u32 reg;
+
+       reg = readl(&pmc->pmc_cntrl);
+       reg |= CPUPWRREQ_OE;
+       writel(reg, &pmc->pmc_cntrl);
+
+       /*
+        * The TI PMU65861C needs a 3.75ms delay between enabling
+        * the power rail and enabling the CPU clock.  This delay
+        * between SM1EN and SM1 is for switching time + the ramp
+        * up of the voltage to the CPU (VDD_CPU from PMU).
+        */
+       udelay(3750);
+}
+
+static void reset_A9_cpu(int reset)
+{
+       struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+       u32 reg, cpu;
+
+       /*
+       * NOTE:  Regardless of whether the request is to hold the CPU in reset
+       *        or take it out of reset, every processor in the CPU complex
+       *        except the master (CPU 0) will be held in reset because the
+       *        AVP only talks to the master. The AVP does not know that there
+       *        are multiple processors in the CPU complex.
+       */
+
+       /* Hold CPU 1 in reset */
+       cpu = SET_DBGRESET1 | SET_DERESET1 | SET_CPURESET1;
+       writel(cpu, &clkrst->crc_cpu_cmplx_set);
+
+       reg = readl(&clkrst->crc_rst_dev_l);
+       if (reset) {
+               /* Now place CPU0 into reset */
+               cpu |= SET_DBGRESET0 | SET_DERESET0 | SET_CPURESET0;
+               writel(cpu, &clkrst->crc_cpu_cmplx_set);
+
+               /* Enable master CPU reset */
+               reg |= SWR_CPU_RST;
+       } else {
+               /* Take CPU0 out of reset */
+               cpu = CLR_DBGRESET0 | CLR_DERESET0 | CLR_CPURESET0;
+               writel(cpu, &clkrst->crc_cpu_cmplx_clr);
+
+               /* Disable master CPU reset */
+               reg &= ~SWR_CPU_RST;
+       }
+
+       writel(reg, &clkrst->crc_rst_dev_l);
+}
+
+static void clock_enable_coresight(int enable)
+{
+       struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+       u32 rst, clk, src;
+
+       rst = readl(&clkrst->crc_rst_dev_u);
+       clk = readl(&clkrst->crc_clk_out_enb_u);
+
+       if (enable) {
+               rst &= ~SWR_CSITE_RST;
+               clk |= CLK_ENB_CSITE;
+       } else {
+               rst |= SWR_CSITE_RST;
+               clk &= ~CLK_ENB_CSITE;
+       }
+
+       writel(clk, &clkrst->crc_clk_out_enb_u);
+       writel(rst, &clkrst->crc_rst_dev_u);
+
+       if (enable) {
+               /*
+                * Put CoreSight on PLLP_OUT0 (216 MHz) and divide it down by
+                *  1.5, giving an effective frequency of 144MHz.
+                * Set PLLP_OUT0 [bits31:30 = 00], and use a 7.1 divisor
+                *  (bits 7:0), so 00000001b == 1.5 (n+1 + .5)
+                */
+               src = CLK_DIVIDER(NVBL_PLLP_KHZ, 144000);
+               writel(src, &clkrst->crc_clk_src_csite);
+
+               /* Unlock the CPU CoreSight interfaces */
+               rst = 0xC5ACCE55;
+               writel(rst, CSITE_CPU_DBG0_LAR);
+               writel(rst, CSITE_CPU_DBG1_LAR);
+       }
+}
+
+void start_cpu(u32 reset_vector)
+{
+       /* Enable VDD_CPU */
+       enable_cpu_power_rail();
+
+       /* Hold the CPUs in reset */
+       reset_A9_cpu(1);
+
+       /* Disable the CPU clock */
+       enable_cpu_clock(0);
+
+       /* Enable CoreSight */
+       clock_enable_coresight(1);
+
+       /*
+        * Set the entry point for CPU execution from reset,
+        *  if it's a non-zero value.
+        */
+       if (reset_vector)
+               writel(reset_vector, EXCEP_VECTOR_CPU_RESET_VECTOR);
+
+       /* Enable the CPU clock */
+       enable_cpu_clock(1);
+
+       /* If the CPU doesn't already have power, power it up */
+       powerup_cpu();
+
+       /* Take the CPU out of reset */
+       reset_A9_cpu(0);
+}
+
+
+void halt_avp(void)
+{
+       for (;;) {
+               writel((HALT_COP_EVENT_JTAG | HALT_COP_EVENT_IRQ_1 \
+                       | HALT_COP_EVENT_FIQ_1 | (FLOW_MODE_STOP<<29)),
+                       FLOW_CTLR_HALT_COP_EVENTS);
+       }
+}
+
+void enable_scu(void)
+{
+       struct scu_ctlr *scu = (struct scu_ctlr *)NV_PA_ARM_PERIPHBASE;
+       u32 reg;
+
+       /* If SCU already setup/enabled, return */
+       if (readl(&scu->scu_ctrl) & SCU_CTRL_ENABLE)
+               return;
+
+       /* Invalidate all ways for all processors */
+       writel(0xFFFF, &scu->scu_inv_all);
+
+       /* Enable SCU - bit 0 */
+       reg = readl(&scu->scu_ctrl);
+       reg |= SCU_CTRL_ENABLE;
+       writel(reg, &scu->scu_ctrl);
+}
+
+void init_pmc_scratch(void)
+{
+       struct pmc_ctlr *const pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+       int i;
+
+       /* SCRATCH0 is initialized by the boot ROM and shouldn't be cleared */
+       for (i = 0; i < 23; i++)
+               writel(0, &pmc->pmc_scratch1+i);
+
+       /* ODMDATA is for kernel use to determine RAM size, LP config, etc. */
+       writel(CONFIG_SYS_BOARD_ODMDATA, &pmc->pmc_scratch20);
+}
+
+void cpu_start(void)
+{
+       struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
+
+       /* enable JTAG */
+       writel(0xC0, &pmt->pmt_cfg_ctl);
+
+       if (s_first_boot) {
+               /*
+                * Need to set this before cold-booting,
+                *  otherwise we'll end up in an infinite loop.
+                */
+               s_first_boot = 0;
+               cold_boot();
+       }
+}
+
+void tegra2_start()
+{
+       if (s_first_boot) {
+               /* Init Debug UART Port (115200 8n1) */
+               uart_init();
+
+               /* Init PMC scratch memory */
+               init_pmc_scratch();
+       }
+
+#ifdef CONFIG_ENABLE_CORTEXA9
+       /* take the mpcore out of reset */
+       cpu_start();
+
+       /* configure cache */
+       cache_configure();
+#endif
+}
diff --git a/arch/arm/cpu/armv7/tegra2/ap20.h b/arch/arm/cpu/armv7/tegra2/ap20.h
new file mode 100644 (file)
index 0000000..49fe340
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * (C) Copyright 2010-2011
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 <asm/types.h>
+
+/* Stabilization delays, in usec */
+#define PLL_STABILIZATION_DELAY (300)
+#define IO_STABILIZATION_DELAY (1000)
+
+#define NVBL_PLLP_KHZ  (216000)
+
+#define PLLX_ENABLED           (1 << 30)
+#define CCLK_BURST_POLICY      0x20008888
+#define SUPER_CCLK_DIVIDER     0x80000000
+
+/* Calculate clock fractional divider value from ref and target frequencies */
+#define CLK_DIVIDER(REF, FREQ)  ((((REF) * 2) / FREQ) - 2)
+
+/* Calculate clock frequency value from reference and clock divider value */
+#define CLK_FREQUENCY(REF, REG)  (((REF) * 2) / (REG + 2))
+
+/* AVP/CPU ID */
+#define PG_UP_TAG_0_PID_CPU    0x55555555      /* CPU aka "a9" aka "mpcore" */
+#define PG_UP_TAG_0             0x0
+
+#define CORESIGHT_UNLOCK       0xC5ACCE55;
+
+/* AP20-Specific Base Addresses */
+
+/* AP20 Base physical address of SDRAM. */
+#define AP20_BASE_PA_SDRAM      0x00000000
+/* AP20 Base physical address of internal SRAM. */
+#define AP20_BASE_PA_SRAM       0x40000000
+/* AP20 Size of internal SRAM (256KB). */
+#define AP20_BASE_PA_SRAM_SIZE  0x00040000
+/* AP20 Base physical address of flash. */
+#define AP20_BASE_PA_NOR_FLASH  0xD0000000
+/* AP20 Base physical address of boot information table. */
+#define AP20_BASE_PA_BOOT_INFO  AP20_BASE_PA_SRAM
+
+/*
+ * Super-temporary stacks for EXTREMELY early startup. The values chosen for
+ * these addresses must be valid on ALL SOCs because this value is used before
+ * we are able to differentiate between the SOC types.
+ *
+ * NOTE: The since CPU's stack will eventually be moved from IRAM to SDRAM, its
+ *       stack is placed below the AVP stack. Once the CPU stack has been moved,
+ *       the AVP is free to use the IRAM the CPU stack previously occupied if
+ *       it should need to do so.
+ *
+ * NOTE: In multi-processor CPU complex configurations, each processor will have
+ *       its own stack of size CPU_EARLY_BOOT_STACK_SIZE. CPU 0 will have a
+ *       limit of CPU_EARLY_BOOT_STACK_LIMIT. Each successive CPU will have a
+ *       stack limit that is CPU_EARLY_BOOT_STACK_SIZE less then the previous
+ *       CPU.
+ */
+
+/* Common AVP early boot stack limit */
+#define AVP_EARLY_BOOT_STACK_LIMIT     \
+       (AP20_BASE_PA_SRAM + (AP20_BASE_PA_SRAM_SIZE/2))
+/* Common AVP early boot stack size */
+#define AVP_EARLY_BOOT_STACK_SIZE      0x1000
+/* Common CPU early boot stack limit */
+#define CPU_EARLY_BOOT_STACK_LIMIT     \
+       (AVP_EARLY_BOOT_STACK_LIMIT - AVP_EARLY_BOOT_STACK_SIZE)
+/* Common CPU early boot stack size */
+#define CPU_EARLY_BOOT_STACK_SIZE      0x1000
+
+#define EXCEP_VECTOR_CPU_RESET_VECTOR  (NV_PA_EVP_BASE + 0x100)
+#define CSITE_CPU_DBG0_LAR             (NV_PA_CSITE_BASE + 0x10FB0)
+#define CSITE_CPU_DBG1_LAR             (NV_PA_CSITE_BASE + 0x12FB0)
+
+#define FLOW_CTLR_HALT_COP_EVENTS      (NV_PA_FLOW_BASE + 4)
+#define FLOW_MODE_STOP                 2
+#define HALT_COP_EVENT_JTAG            (1 << 28)
+#define HALT_COP_EVENT_IRQ_1           (1 << 11)
+#define HALT_COP_EVENT_FIQ_1           (1 << 9)
+
+/* Prototypes */
+
+void tegra2_start(void);
+void uart_init(void);
+void udelay(unsigned long);
+void cold_boot(void);
+void cache_configure(void);
index 7f15746861c51c3fc8a59d987407bb0e89ecc591..f24a2ff57d33894f97ad7898b9eb6eee3bd1705e 100644 (file)
@@ -26,6 +26,7 @@
 #include <config.h>
 #include <version.h>
 
+
 _TEXT_BASE:
        .word   CONFIG_SYS_TEXT_BASE    @ sdram load addr from config file
 
@@ -58,8 +59,101 @@ lowlevel_init:
 
        mov     pc, lr                          @ back to arch calling code
 
+
+.globl startup_cpu
+startup_cpu:
+       @ Initialize the AVP, clocks, and memory controller
+       @ SDRAM is guaranteed to be on at this point
+
+       ldr     r0, =cold_boot                  @ R0 = reset vector for CPU
+       bl      start_cpu                       @ start the CPU
+
+       @ Transfer control to the AVP code
+       bl      halt_avp
+
+       @ Should never get here
+_loop_forever2:
+       b       _loop_forever2
+
+.globl cache_configure
+cache_configure:
+       stmdb   r13!,{r14}
+       @ invalidate instruction cache
+       mov     r1, #0
+       mcr     p15, 0, r1, c7, c5, 0
+
+       @ invalidate the i&d tlb entries
+       mcr     p15, 0, r1, c8, c5, 0
+       mcr     p15, 0, r1, c8, c6, 0
+
+       @ enable instruction cache
+       mrc     p15, 0, r1, c1, c0, 0
+       orr     r1, r1, #(1<<12)
+       mcr     p15, 0, r1, c1, c0, 0
+
+       bl      enable_scu
+
+       @ enable SMP mode and FW for CPU0, by writing to Auxiliary Ctl reg
+       mrc     p15, 0, r0, c1, c0, 1
+       orr     r0, r0, #0x41
+       mcr     p15, 0, r0, c1, c0, 1
+
+       @ Now flush the Dcache
+       mov     r0, #0
+       @ 256 cache lines
+       mov     r1, #256
+
+invalidate_loop:
+       add     r1, r1, #-1
+       mov     r0, r1, lsl #5
+       @ invalidate d-cache using line (way0)
+       mcr     p15, 0, r0, c7, c6, 2
+
+       orr     r2, r0, #(1<<30)
+       @ invalidate d-cache using line (way1)
+       mcr     p15, 0, r2, c7, c6, 2
+
+       orr     r2, r0, #(2<<30)
+       @ invalidate d-cache using line (way2)
+       mcr     p15, 0, r2, c7, c6, 2
+
+       orr     r2, r0, #(3<<30)
+       @ invalidate d-cache using line (way3)
+       mcr     p15, 0, r2, c7, c6, 2
+       cmp     r1, #0
+       bne     invalidate_loop
+
+       @ FIXME: should have ap20's L2 disabled too?
+invalidate_done:
+       ldmia   r13!,{pc}
+
+.globl cold_boot
+cold_boot:
+       msr     cpsr_c, #0xD3
+       @ Check current processor: CPU or AVP?
+       @  If CPU, go to CPU boot code, else continue on AVP path
+
+       ldr     r0, =NV_PA_PG_UP_BASE
+       ldr     r1, [r0]
+       ldr     r2, =PG_UP_TAG_AVP
+
+       @ are we the CPU?
+       ldr     sp, CPU_STACK
+       cmp     r1, r2
+       @ yep, we are the CPU
+       bne     _armboot_start
+
+       @ AVP initialization follows this path
+       ldr     sp, AVP_STACK
+       @ Init AVP and start CPU
+       b       startup_cpu
+
        @ the literal pools origin
        .ltorg
 
 SRAM_STACK:
        .word LOW_LEVEL_SRAM_STACK
+AVP_STACK:
+       .word EARLY_AVP_STACK
+CPU_STACK:
+       .word EARLY_CPU_STACK
index 49a6ed3c74d73ff5085c1b62a8eceaeaa260b393..e8b59a30c9b0b9c29dae1aa6741e6e96d10ffb52 100644 (file)
@@ -28,7 +28,6 @@ LIB   = $(obj)lib$(CPU).o
 START  = start.o
 
 COBJS  += cpu.o
-COBJS  += i2c.o
 COBJS  += pxafb.o
 COBJS  += timer.o
 COBJS  += usb.o
index 7d49cbb4fd9af1a33e425e33267213fc497addc2..9970a4b45bb7f516cff1b55cdee47652aef9eb83 100644 (file)
@@ -318,3 +318,13 @@ int arch_cpu_init(void)
        pxa_clock_setup();
        return 0;
 }
+
+void i2c_clk_enable(void)
+{
+       /* set the global I2C clock on */
+#ifdef CONFIG_CPU_MONAHANS
+       writel(readl(CKENB) | (CKENB_4_I2C), CKENB);
+#else
+       writel(readl(CKEN) | CKEN14_I2C, CKEN);
+#endif
+}
index d8040025ed250fabc2c0cc9522df18dd284a7183..1126b38a27b6c6f277a088bf2196a0477c5ecd31 100644 (file)
 #define MV_UART_CONSOLE_BASE   ARMD1_UART1_BASE
 #define CONFIG_SYS_NS16550_IER (1 << 6)        /* Bit 6 in UART_IER register
                                                represents UART Unit Enable */
+/*
+ * I2C definition
+ */
+#ifdef CONFIG_CMD_I2C
+#define CONFIG_I2C_MV          1
+#define CONFIG_MV_I2C_NUM      2
+#define CONFIG_I2C_MULTI_BUS   1
+#define CONFIG_MV_I2C_REG      {0xd4011000, 0xd4025000}
+#define CONFIG_HARD_I2C                1
+#define CONFIG_SYS_I2C_SPEED   0
+#define CONFIG_SYS_I2C_SLAVE   0xfe
+#endif
 
 #endif /* _ARMD1_CONFIG_H */
index d21a79fa1fc87fd4a64ba71874fa2e32ef6dba57..73783a7647220f3a65f06e284b530d52d27e0c30 100644 (file)
  *                                 offset, pull,pF, drv,dF, edge,eF ,afn,aF
  */
 /* UART1 */
-#define MFP107_UART1_TXD       MFP_REG(0x01ac) | MFP_AF1 | MFP_DRIVE_FAST
-#define MFP107_UART1_RXD       MFP_REG(0x01ac) | MFP_AF2 | MFP_DRIVE_FAST
-#define MFP108_UART1_RXD       MFP_REG(0x01b0) | MFP_AF1 | MFP_DRIVE_FAST
-#define MFP108_UART1_TXD       MFP_REG(0x01b0) | MFP_AF2 | MFP_DRIVE_FAST
-#define MFP109_UART1_CTS       MFP_REG(0x01b4) | MFP_AF1 | MFP_DRIVE_MEDIUM
-#define MFP109_UART1_RTS       MFP_REG(0x01b4) | MFP_AF2 | MFP_DRIVE_MEDIUM
-#define MFP110_UART1_RTS       MFP_REG(0x01b8) | MFP_AF1 | MFP_DRIVE_MEDIUM
-#define MFP110_UART1_CTS       MFP_REG(0x01b8) | MFP_AF2 | MFP_DRIVE_MEDIUM
-#define MFP111_UART1_RI                MFP_REG(0x01bc) | MFP_AF1 | MFP_DRIVE_MEDIUM
-#define MFP111_UART1_DSR       MFP_REG(0x01bc) | MFP_AF2 | MFP_DRIVE_MEDIUM
-#define MFP112_UART1_DTR       MFP_REG(0x01c0) | MFP_AF1 | MFP_DRIVE_MEDIUM
-#define MFP112_UART1_DCD       MFP_REG(0x01c0) | MFP_AF2 | MFP_DRIVE_MEDIUM
+#define MFP107_UART1_TXD       (MFP_REG(0x01ac) | MFP_AF1 | MFP_DRIVE_FAST)
+#define MFP107_UART1_RXD       (MFP_REG(0x01ac) | MFP_AF2 | MFP_DRIVE_FAST)
+#define MFP108_UART1_RXD       (MFP_REG(0x01b0) | MFP_AF1 | MFP_DRIVE_FAST)
+#define MFP108_UART1_TXD       (MFP_REG(0x01b0) | MFP_AF2 | MFP_DRIVE_FAST)
+#define MFP109_UART1_CTS       (MFP_REG(0x01b4) | MFP_AF1 | MFP_DRIVE_MEDIUM)
+#define MFP109_UART1_RTS       (MFP_REG(0x01b4) | MFP_AF2 | MFP_DRIVE_MEDIUM)
+#define MFP110_UART1_RTS       (MFP_REG(0x01b8) | MFP_AF1 | MFP_DRIVE_MEDIUM)
+#define MFP110_UART1_CTS       (MFP_REG(0x01b8) | MFP_AF2 | MFP_DRIVE_MEDIUM)
+#define MFP111_UART1_RI                (MFP_REG(0x01bc) | MFP_AF1 | MFP_DRIVE_MEDIUM)
+#define MFP111_UART1_DSR       (MFP_REG(0x01bc) | MFP_AF2 | MFP_DRIVE_MEDIUM)
+#define MFP112_UART1_DTR       (MFP_REG(0x01c0) | MFP_AF1 | MFP_DRIVE_MEDIUM)
+#define MFP112_UART1_DCD       (MFP_REG(0x01c0) | MFP_AF2 | MFP_DRIVE_MEDIUM)
 
 /* UART2 */
-#define MFP47_UART2_RXD                MFP_REG(0x0028) | MFP_AF6 | MFP_DRIVE_MEDIUM
-#define MFP48_UART2_TXD                MFP_REG(0x002c) | MFP_AF6 | MFP_DRIVE_MEDIUM
-#define MFP88_UART2_RXD                MFP_REG(0x0160) | MFP_AF2 | MFP_DRIVE_MEDIUM
-#define MFP89_UART2_TXD                MFP_REG(0x0164) | MFP_AF2 | MFP_DRIVE_MEDIUM
+#define MFP47_UART2_RXD                (MFP_REG(0x0028) | MFP_AF6 | MFP_DRIVE_MEDIUM)
+#define MFP48_UART2_TXD                (MFP_REG(0x002c) | MFP_AF6 | MFP_DRIVE_MEDIUM)
+#define MFP88_UART2_RXD                (MFP_REG(0x0160) | MFP_AF2 | MFP_DRIVE_MEDIUM)
+#define MFP89_UART2_TXD                (MFP_REG(0x0164) | MFP_AF2 | MFP_DRIVE_MEDIUM)
 
 /* UART3 */
-#define MFPO8_UART3_RXD                MFP_REG(0x06c) | MFP_AF2 | MFP_DRIVE_MEDIUM
-#define MFPO9_UART3_TXD                MFP_REG(0x070) | MFP_AF2 | MFP_DRIVE_MEDIUM
+#define MFPO8_UART3_RXD                (MFP_REG(0x06c) | MFP_AF2 | MFP_DRIVE_MEDIUM)
+#define MFPO9_UART3_TXD                (MFP_REG(0x070) | MFP_AF2 | MFP_DRIVE_MEDIUM)
+
+/* I2c */
+#define MFP105_CI2C_SDA                (MFP_REG(0x1a4) | MFP_AF1 | MFP_DRIVE_MEDIUM)
+#define MFP106_CI2C_SCL                (MFP_REG(0x1a8) | MFP_AF1 | MFP_DRIVE_MEDIUM)
 
 /* More macros can be defined here... */
 
similarity index 92%
rename from arch/arm/include/asm/arch-mx31/mx31.h
rename to arch/arm/include/asm/arch-mx31/clock.h
index a755212f0d062b6b1fcb2644e91ce3acdcf37551..8dc6e82bc6787a221b27396aaf90a3cab74dd7c9 100644 (file)
@@ -21,8 +21,8 @@
  * MA 02111-1307 USA
  */
 
-#ifndef __ASM_ARCH_MX31_H
-#define __ASM_ARCH_MX31_H
+#ifndef __ASM_ARCH_CLOCK_H
+#define __ASM_ARCH_CLOCK_H
 
 extern u32 mx31_get_ipg_clk(void);
 #define imx_get_uartclk mx31_get_ipg_clk
@@ -32,4 +32,4 @@ extern void mx31_set_pad(enum iomux_pins pin, u32 config);
 void mx31_uart1_hw_init(void);
 void mx31_spi2_hw_init(void);
 
-#endif /* __ASM_ARCH_MX31_H */
+#endif /* __ASM_ARCH_CLOCK_H */
similarity index 97%
rename from arch/arm/include/asm/arch-mx31/mx31-regs.h
rename to arch/arm/include/asm/arch-mx31/imx-regs.h
index 105f7d8be5ea9d1c4189f91bfe4c1fa0f20893ee..c830a0374e86ba5133b5b0a511214827a0317a5e 100644 (file)
@@ -21,8 +21,8 @@
  * MA 02111-1307 USA
  */
 
-#ifndef __ASM_ARCH_MX31_REGS_H
-#define __ASM_ARCH_MX31_REGS_H
+#ifndef __ASM_ARCH_MX31_IMX_REGS_H
+#define __ASM_ARCH_MX31_IMX_REGS_H
 
 #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
 #include <asm/types.h>
@@ -75,6 +75,39 @@ struct cspi_regs {
        u32 test;
 };
 
+/* Watchdog Timer (WDOG) registers */
+#define WDOG_ENABLE    (1 << 2)
+#define WDOG_WT_SHIFT  8
+struct wdog_regs {
+       u16 wcr;        /* Control */
+       u16 wsr;        /* Service */
+       u16 wrsr;       /* Reset Status */
+};
+
+/* IIM Control Registers */
+struct iim_regs {
+       u32 iim_stat;
+       u32 iim_statm;
+       u32 iim_err;
+       u32 iim_emask;
+       u32 iim_fctl;
+       u32 iim_ua;
+       u32 iim_la;
+       u32 iim_sdat;
+       u32 iim_prev;
+       u32 iim_srev;
+       u32 iim_prog_p;
+       u32 iim_scs0;
+       u32 iim_scs1;
+       u32 iim_scs2;
+       u32 iim_scs3;
+};
+
+struct mx3_cpu_type {
+       u8 srev;
+       char *v;
+};
+
 #define IOMUX_PADNUM_MASK      0x1ff
 #define IOMUX_PIN(gpionum, padnum) ((padnum) & IOMUX_PADNUM_MASK)
 
@@ -470,6 +503,8 @@ enum iomux_pins {
 #define CCMR_FPM       (1 << 1)
 #define CCMR_CKIH      (2 << 1)
 
+#define MX31_IIM_BASE_ADDR     0x5001C000
+
 #define PDR0_CSI_PODF(x)       (((x) & 0x1ff) << 23)
 #define PDR0_PER_PODF(x)       (((x) & 0x1f) << 16)
 #define PDR0_HSP_PODF(x)       (((x) & 0x7) << 11)
@@ -739,4 +774,4 @@ enum iomux_pins {
 #define MXC_EHCI_IPPUE_DOWN            (1 << 8)
 #define MXC_EHCI_IPPUE_UP              (1 << 9)
 
-#endif /* __ASM_ARCH_MX31_REGS_H */
+#endif /* __ASM_ARCH_MX31_IMX_REGS_H */
index 40f80baf61c5e0c024c9c862da5199d385598a92..bed0002ec0a5aa27979a6f27ee94a90aebdde908 100644 (file)
@@ -68,6 +68,7 @@ extern dpll_param *get_mpu_dpll_param(void);
 extern dpll_param *get_iva_dpll_param(void);
 extern dpll_param *get_core_dpll_param(void);
 extern dpll_param *get_per_dpll_param(void);
+extern dpll_param *get_per2_dpll_param(void);
 
 extern dpll_param *get_36x_mpu_dpll_param(void);
 extern dpll_param *get_36x_iva_dpll_param(void);
index 30ef690fa2a1b7c0056f9a5563e393c3a4285ce2..ef600dd9db868aa651001067a3e39a25e75c4131 100644 (file)
 #define PER_FSEL_38P4          0x07
 #define PER_M2_38P4            0x09
 
+/* PER2 DPLL */
+#define PER2_M_12              0x78
+#define PER2_N_12              0x0B
+#define PER2_FSEL_12           0x03
+#define PER2_M2_12             0x01
+
+#define PER2_M_13              0x78
+#define PER2_N_13              0x0C
+#define PER2_FSEL_13           0x03
+#define PER2_M2_13             0x01
+
+#define PER2_M_19P2            0x2EE
+#define PER2_N_19P2            0x0B
+#define PER2_FSEL_19P2         0x06
+#define PER2_M2_19P2           0x0A
+
+#define PER2_M_26              0x78
+#define PER2_N_26              0x0C
+#define PER2_FSEL_26           0x03
+#define PER2_M2_26             0x01
+
+#define PER2_M_38P4            0x2EE
+#define PER2_N_38P4            0x0B
+#define PER2_FSEL_38P4         0x06
+#define PER2_M2_38P4           0x0A
+
 /* 36XX PER DPLL */
 
 #define PER_36XX_M_12          0x1B0
index 962d6d40aa8c3a5a7d947b4dc4eb49ea25a7a12e..e944de7192ca0cb4e1eebae458d71ec59c681ebc 100644 (file)
@@ -347,10 +347,13 @@ struct prcm {
        u32 clksel2_pll_mpu;    /* 0x944 */
        u8 res6[0xb8];
        u32 fclken1_core;       /* 0xa00 */
-       u8 res7[0xc];
+       u32 res_fclken2_core;
+       u32 fclken3_core;       /* 0xa08 */
+       u8 res7[0x4];
        u32 iclken1_core;       /* 0xa10 */
        u32 iclken2_core;       /* 0xa14 */
-       u8 res8[0x28];
+       u32 iclken3_core;       /* 0xa18 */
+       u8 res8[0x24];
        u32 clksel_core;        /* 0xa40 */
        u8 res9[0xbc];
        u32 fclken_gfx;         /* 0xb00 */
@@ -368,13 +371,17 @@ struct prcm {
        u32 clksel_wkup;        /* 0xc40 */
        u8 res16[0xbc];
        u32 clken_pll;          /* 0xd00 */
-       u8 res17[0x1c];
+       u32 clken2_pll;         /* 0xd04 */
+       u8 res17[0x18];
        u32 idlest_ckgen;       /* 0xd20 */
-       u8 res18[0x1c];
+       u32 idlest2_ckgen;      /* 0xd24 */
+       u8 res18[0x18];
        u32 clksel1_pll;        /* 0xd40 */
        u32 clksel2_pll;        /* 0xd44 */
        u32 clksel3_pll;        /* 0xd48 */
-       u8 res19[0xb4];
+       u32 clksel4_pll;        /* 0xd4c */
+       u32 clksel5_pll;        /* 0xd50 */
+       u8 res19[0xac];
        u32 fclken_dss;         /* 0xe00 */
        u8 res20[0xc];
        u32 iclken_dss;         /* 0xe10 */
@@ -394,6 +401,10 @@ struct prcm {
        u32 clksel_per;         /* 0x1040 */
        u8 res28[0xfc];
        u32 clksel1_emu;        /* 0x1140 */
+       u8 res29[0x2bc];
+       u32 fclken_usbhost;     /* 0x1400 */
+       u8 res30[0xc];
+       u32 iclken_usbhost;     /* 0x1410 */
 };
 #else /* __ASSEMBLY__ */
 #define CM_CLKSEL_CORE         0x48004a40
diff --git a/arch/arm/include/asm/arch-omap3/ehci_omap3.h b/arch/arm/include/asm/arch-omap3/ehci_omap3.h
new file mode 100644 (file)
index 0000000..cd01f50
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * (C) Copyright 2011
+ * Alexander Holler <holler@ahsoftware.de>
+ *
+ * Based on "drivers/usb/host/ehci-omap.c" from Linux 2.6.37
+ *
+ * See there for additional Copyrights.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+#ifndef _EHCI_OMAP3_H_
+#define _EHCI_OMAP3_H_
+
+/* USB/EHCI registers */
+#define OMAP3_USBTLL_BASE                              0x48062000UL
+#define OMAP3_UHH_BASE                                 0x48064000UL
+#define OMAP3_EHCI_BASE                                        0x48064800UL
+
+/* TLL Register Set */
+#define        OMAP_USBTLL_SYSCONFIG                           (0x10)
+#define        OMAP_USBTLL_SYSCONFIG_SOFTRESET                 (1 << 1)
+#define        OMAP_USBTLL_SYSCONFIG_ENAWAKEUP                 (1 << 2)
+#define        OMAP_USBTLL_SYSCONFIG_SIDLEMODE                 (1 << 3)
+#define        OMAP_USBTLL_SYSCONFIG_CACTIVITY                 (1 << 8)
+
+#define        OMAP_USBTLL_SYSSTATUS                           (0x14)
+#define        OMAP_USBTLL_SYSSTATUS_RESETDONE                 (1 << 0)
+
+/* UHH Register Set */
+#define        OMAP_UHH_SYSCONFIG                              (0x10)
+#define        OMAP_UHH_SYSCONFIG_SOFTRESET                    (1 << 1)
+#define        OMAP_UHH_SYSCONFIG_CACTIVITY                    (1 << 8)
+#define        OMAP_UHH_SYSCONFIG_SIDLEMODE                    (1 << 3)
+#define        OMAP_UHH_SYSCONFIG_ENAWAKEUP                    (1 << 2)
+#define        OMAP_UHH_SYSCONFIG_MIDLEMODE                    (1 << 12)
+
+#define        OMAP_UHH_HOSTCONFIG                             (0x40)
+#define OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN             (1 << 2)
+#define OMAP_UHH_HOSTCONFIG_INCR8_BURST_EN             (1 << 3)
+#define OMAP_UHH_HOSTCONFIG_INCR16_BURST_EN            (1 << 4)
+
+#endif /* _EHCI_OMAP3_H_ */
diff --git a/arch/arm/include/asm/arch-omap3/omap3-regs.h b/arch/arm/include/asm/arch-omap3/omap3-regs.h
new file mode 100644 (file)
index 0000000..818214f
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * (c) 2011 Comelit Group SpA, Luca Ceresoli <luca.ceresoli@comelit.it>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 _OMAP3_REGS_H
+#define _OMAP3_REGS_H
+
+/*
+ * Register definitions for OMAP3 processors.
+ */
+
+/*
+ * GPMC_CONFIG1 - GPMC_CONFIG7
+ */
+
+/* Values for GPMC_CONFIG1 - signal control parameters */
+#define WRAPBURST                     (1 << 31)
+#define READMULTIPLE                  (1 << 30)
+#define READTYPE                      (1 << 29)
+#define WRITEMULTIPLE                 (1 << 28)
+#define WRITETYPE                     (1 << 27)
+#define CLKACTIVATIONTIME(x)          (((x) & 3) << 25)
+#define ATTACHEDDEVICEPAGELENGTH(x)   (((x) & 3) << 23)
+#define WAITREADMONITORING            (1 << 22)
+#define WAITWRITEMONITORING           (1 << 21)
+#define WAITMONITORINGTIME(x)         (((x) & 3) << 18)
+#define WAITPINSELECT(x)              (((x) & 3) << 16)
+#define DEVICESIZE(x)                 (((x) & 3) << 12)
+#define DEVICESIZE_8BIT               DEVICESIZE(0)
+#define DEVICESIZE_16BIT              DEVICESIZE(1)
+#define DEVICETYPE(x)                 (((x) & 3) << 10)
+#define DEVICETYPE_NOR                DEVICETYPE(0)
+#define DEVICETYPE_NAND               DEVICETYPE(2)
+#define MUXADDDATA                    (1 << 9)
+#define TIMEPARAGRANULARITY           (1 << 4)
+#define GPMCFCLKDIVIDER(x)            (((x) & 3) << 0)
+
+/* Values for GPMC_CONFIG2 - CS timing */
+#define CSWROFFTIME(x)   (((x) & 0x1f) << 16)
+#define CSRDOFFTIME(x)   (((x) & 0x1f) <<  8)
+#define CSEXTRADELAY     (1 << 7)
+#define CSONTIME(x)      (((x) &  0xf) <<  0)
+
+/* Values for GPMC_CONFIG3 - nADV timing */
+#define ADVWROFFTIME(x)  (((x) & 0x1f) << 16)
+#define ADVRDOFFTIME(x)  (((x) & 0x1f) <<  8)
+#define ADVEXTRADELAY    (1 << 7)
+#define ADVONTIME(x)     (((x) &  0xf) <<  0)
+
+/* Values for GPMC_CONFIG4 - nWE and nOE timing */
+#define WEOFFTIME(x)     (((x) & 0x1f) << 24)
+#define WEEXTRADELAY     (1 << 23)
+#define WEONTIME(x)      (((x) &  0xf) << 16)
+#define OEOFFTIME(x)     (((x) & 0x1f) <<  8)
+#define OEEXTRADELAY     (1 << 7)
+#define OEONTIME(x)      (((x) &  0xf) <<  0)
+
+/* Values for GPMC_CONFIG5 - RdAccessTime and CycleTime timing */
+#define PAGEBURSTACCESSTIME(x)  (((x) &  0xf) << 24)
+#define RDACCESSTIME(x)         (((x) & 0x1f) << 16)
+#define WRCYCLETIME(x)          (((x) & 0x1f) <<  8)
+#define RDCYCLETIME(x)          (((x) & 0x1f) <<  0)
+
+/* Values for GPMC_CONFIG6 - misc timings */
+#define WRACCESSTIME(x)        (((x) & 0x1f) << 24)
+#define WRDATAONADMUXBUS(x)    (((x) &  0xf) << 16)
+#define CYCLE2CYCLEDELAY(x)    (((x) &  0xf) <<  8)
+#define CYCLE2CYCLESAMECSEN    (1 << 7)
+#define CYCLE2CYCLEDIFFCSEN    (1 << 6)
+#define BUSTURNAROUND(x)       (((x) &  0xf) <<  0)
+
+/* Values for GPMC_CONFIG7 - CS address mapping configuration */
+#define MASKADDRESS(x)         (((x) &  0xf) <<  8)
+#define CSVALID                (1 << 6)
+#define BASEADDRESS(x)         (((x) & 0x3f) <<  0)
+
+#endif /* _OMAP3_REGS_H */
index 3957c796f2263dced3236b69db04c25096d6d0c7..cc2b5415c12e9f15b61c3631449c1bf515b76b66 100644 (file)
 /* CONTROL */
 #define OMAP34XX_CTRL_BASE             (OMAP34XX_L4_IO_BASE + 0x2000)
 
+#ifndef __ASSEMBLY__
+/* Signal Integrity Parameter Control Registers */
+struct control_prog_io {
+       unsigned char res[0x408];
+       unsigned int io2;               /* 0x408 */
+       unsigned char res2[0x38];
+       unsigned int io0;               /* 0x444 */
+       unsigned int io1;               /* 0x448 */
+};
+#endif /* __ASSEMBLY__ */
+
+/* Bit definition for CONTROL_PROG_IO1 */
+#define PRG_I2C2_PULLUPRESX            0x00000001
+
 /* UART */
 #define OMAP34XX_UART1                 (OMAP34XX_L4_IO_BASE + 0x6a000)
 #define OMAP34XX_UART2                 (OMAP34XX_L4_IO_BASE + 0x6c000)
index c84efaf02bd8a55b9a8bc9c68f1a23abfa9c7c3e..2f52ca8407a2d6187ff8d6cd8617551c23f31975 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+ * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
  * Based on original Kirorion5x_ood support which is
  * (C) Copyright 2009
index 86ba08deba163a7fdda97ab0caeed8a8636a5f12..0b46aef0015f320a9e2911b67c7c2918737e6c1f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+ * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
  * Based on original Kirkwood 88F6182 support which is
  * (C) Copyright 2009
index e3d3f76dbb519b94381c0aa114302bf28e6af021..9aeef88f36eb4af372e563aba6d42765ac180800 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+ * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
  * Based on original Kirkwood support which is
  * (C) Copyright 2009
@@ -42,6 +42,7 @@
 #define ORION5X_REGISTER(x)                    (ORION5X_REGS_PHY_BASE + x)
 
 /* Documented registers */
+#define ORION5X_DRAM_BASE                      (ORION5X_REGISTER(0x01500))
 #define ORION5X_TWSI_BASE                      (ORION5X_REGISTER(0x11000))
 #define ORION5X_UART0_BASE                     (ORION5X_REGISTER(0x12000))
 #define ORION5X_UART1_BASE                     (ORION5X_REGISTER(0x12100))
index 710b3862ca3cb434a07a79ca301c31d5a72cb4af..5658592f838f5cf3421dc24edabe7e4bfa947f7a 100644 (file)
 #define MV_UART_CONSOLE_BASE   PANTHEON_UART1_BASE
 #define CONFIG_SYS_NS16550_IER (1 << 6)        /* Bit 6 in UART_IER register
                                                represents UART Unit Enable */
+/*
+ * I2C definition
+ */
+#ifdef CONFIG_CMD_I2C
+#define CONFIG_I2C_MV                  1
+#define CONFIG_MV_I2C_REG              0xd4011000
+#define CONFIG_HARD_I2C                        1
+#define CONFIG_SYS_I2C_SPEED           0
+#define CONFIG_SYS_I2C_SLAVE           0xfe
+#endif
 
 #endif /* _PANTHEON_CONFIG_H */
index 30f4393050caad893bf341056751843f900e06be..60955c5a55eae50e70b7e885a2c61fd65f90d1e7 100644 (file)
@@ -50,7 +50,9 @@ struct panthapb_registers {
        u32 uart0;      /*0x000*/
        u32 uart1;      /*0x004*/
        u32 gpio;       /*0x008*/
-       u8 pad0[0x034 - 0x08 - 4];
+       u8 pad0[0x02c - 0x08 - 4];
+       u32 twsi;       /*0x02c*/
+       u8 pad1[0x034 - 0x2c - 4];
        u32 timers;     /*0x034*/
 };
 
index fb291cf5543951d0b197e89ea49cab34690234e9..e9391961b17cb64a3a10becf9b8fcad50a8e9212 100644 (file)
  * offset, pull,pF, drv,dF, edge,eF ,afn,aF
  */
 /* UART2 */
-#define MFP47_UART2_RXD                MFP_REG(0x198) | MFP_AF6 | MFP_DRIVE_MEDIUM
-#define MFP48_UART2_TXD                MFP_REG(0x19c) | MFP_AF6 | MFP_DRIVE_MEDIUM
+#define MFP47_UART2_RXD                (MFP_REG(0x198) | MFP_AF6 | MFP_DRIVE_MEDIUM)
+#define MFP48_UART2_TXD                (MFP_REG(0x19c) | MFP_AF6 | MFP_DRIVE_MEDIUM)
+#define MFP53_CI2C_SCL         (MFP_REG(0x1b0) | MFP_AF2 | MFP_DRIVE_MEDIUM)
+#define MFP54_CI2C_SDA         (MFP_REG(0x1b4) | MFP_AF2 | MFP_DRIVE_MEDIUM)
 
 /* More macros can be defined here... */
 
index 65a387f9fc9b4e8b4e5e85a3042f6e5014452d34..109fdc06aac151274f63ad91fc45115aaff166cf 100644 (file)
@@ -455,62 +455,6 @@ typedef void               (*ExcpHndlr) (void) ;
                IrSR_RCVEIR_UART_MODE | \
                IrSR_XMITIR_IR_MODE)
 
-/*
- * I2C registers
- */
-#define IBMR           0x40301680  /* I2C Bus Monitor Register - IBMR */
-#define IDBR           0x40301688  /* I2C Data Buffer Register - IDBR */
-#define ICR            0x40301690  /* I2C Control Register - ICR */
-#define ISR            0x40301698  /* I2C Status Register - ISR */
-#define ISAR           0x403016A0  /* I2C Slave Address Register - ISAR */
-
-#ifdef CONFIG_CPU_MONAHANS
-#define PWRIBMR                0x40f500C0  /* Power I2C Bus Monitor Register-IBMR */
-#define PWRIDBR                0x40f500C4  /* Power I2C Data Buffer Register-IDBR */
-#define PWRICR         0x40f500C8  /* Power I2C Control Register - ICR */
-#define PWRISR         0x40f500CC  /* Power I2C Status Register - ISR */
-#define PWRISAR                0x40f500D0  /* Power I2C Slave Address Register-ISAR */
-#else
-#define PWRIBMR                0x40f00180  /* Power I2C Bus Monitor Register-IBMR */
-#define PWRIDBR                0x40f00188  /* Power I2C Data Buffer Register-IDBR */
-#define PWRICR         0x40f00190  /* Power I2C Control Register - ICR */
-#define PWRISR         0x40f00198  /* Power I2C Status Register - ISR */
-#define PWRISAR                0x40f001A0  /* Power I2C Slave Address Register-ISAR */
-#endif
-
-/* ----- Control register bits ---------------------------------------- */
-
-#define ICR_START      0x1             /* start bit */
-#define ICR_STOP       0x2             /* stop bit */
-#define ICR_ACKNAK     0x4             /* send ACK(0) or NAK(1) */
-#define ICR_TB         0x8             /* transfer byte bit */
-#define ICR_MA         0x10            /* master abort */
-#define ICR_SCLE       0x20            /* master clock enable, mona SCLEA */
-#define ICR_IUE                0x40            /* unit enable */
-#define ICR_GCD                0x80            /* general call disable */
-#define ICR_ITEIE      0x100           /* enable tx interrupts */
-#define ICR_IRFIE      0x200           /* enable rx interrupts, mona: DRFIE */
-#define ICR_BEIE       0x400           /* enable bus error ints */
-#define ICR_SSDIE      0x800           /* slave STOP detected int enable */
-#define ICR_ALDIE      0x1000          /* enable arbitration interrupt */
-#define ICR_SADIE      0x2000          /* slave address detected int enable */
-#define ICR_UR         0x4000          /* unit reset */
-#define ICR_FM         0x8000          /* Fast Mode */
-
-/* ----- Status register bits ----------------------------------------- */
-
-#define ISR_RWM                0x1             /* read/write mode */
-#define ISR_ACKNAK     0x2             /* ack/nak status */
-#define ISR_UB         0x4             /* unit busy */
-#define ISR_IBB                0x8             /* bus busy */
-#define ISR_SSD                0x10            /* slave stop detected */
-#define ISR_ALD                0x20            /* arbitration loss detected */
-#define ISR_ITE                0x40            /* tx buffer empty */
-#define ISR_IRF                0x80            /* rx buffer full */
-#define ISR_GCAD       0x100           /* general call address detected */
-#define ISR_SAD                0x200           /* slave address detected */
-#define ISR_BED                0x400           /* bus error no ACK/NAK */
-
 /*
  * Serial Audio Controller
  */
index 6d573bf46581e059a5ea2d28a7c8995ff65685e1..bd8ad2ca0499118db3de5ee8e094af2e35d4b3a7 100644 (file)
@@ -149,6 +149,9 @@ struct clk_rst_ctlr {
        uint crc_clk_src_csite;         /*_CSITE_0,             0x1D4 */
        uint crc_reserved19[9];         /*                      0x1D8-1F8 */
        uint crc_clk_src_osc;           /*_OSC_0,               0x1FC */
+       uint crc_reserved20[80];        /*                      0x200-33C */
+       uint crc_cpu_cmplx_set;         /* _CPU_CMPLX_SET_0,    0x340 */
+       uint crc_cpu_cmplx_clr;         /* _CPU_CMPLX_CLR_0,    0x344 */
 };
 
 #define PLL_BYPASS             (1 << 31)
@@ -157,9 +160,35 @@ struct clk_rst_ctlr {
 #define PLL_DIVP               (1 << 20)       /* post divider, b22:20 */
 #define PLL_DIVM               0x0C            /* input divider, b4:0 */
 
-#define SWR_UARTD_RST          (1 << 2)
-#define CLK_ENB_UARTD          (1 << 2)
+#define SWR_UARTD_RST          (1 << 1)
+#define CLK_ENB_UARTD          (1 << 1)
 #define SWR_UARTA_RST          (1 << 6)
 #define CLK_ENB_UARTA          (1 << 6)
 
+#define SWR_CPU_RST            (1 << 0)
+#define CLK_ENB_CPU            (1 << 0)
+#define SWR_CSITE_RST          (1 << 9)
+#define CLK_ENB_CSITE          (1 << 9)
+
+#define SET_CPURESET0          (1 << 0)
+#define SET_DERESET0           (1 << 4)
+#define SET_DBGRESET0          (1 << 12)
+
+#define SET_CPURESET1          (1 << 1)
+#define SET_DERESET1           (1 << 5)
+#define SET_DBGRESET1          (1 << 13)
+
+#define CLR_CPURESET0          (1 << 0)
+#define CLR_DERESET0           (1 << 4)
+#define CLR_DBGRESET0          (1 << 12)
+
+#define CLR_CPURESET1          (1 << 1)
+#define CLR_DERESET1           (1 << 5)
+#define CLR_DBGRESET1          (1 << 13)
+
+#define CPU0_CLK_STP           (1 << 8)
+#define CPU1_CLK_STP           (1 << 9)
+
+#define CPCON                  (1 << 8)
+
 #endif /* CLK_RST_H */
diff --git a/arch/arm/include/asm/arch-tegra2/gpio.h b/arch/arm/include/asm/arch-tegra2/gpio.h
new file mode 100644 (file)
index 0000000..0fb8f0d
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2011, Google Inc. All rights reserved.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 _TEGRA2_GPIO_H_
+#define _TEGRA2_GPIO_H_
+
+/*
+ * The Tegra 2x GPIO controller has 222 GPIOs arranged in 8 banks of 4 ports,
+ * each with 8 GPIOs.
+ */
+#define TEGRA_GPIO_PORTS 4   /* The number of ports per bank */
+#define TEGRA_GPIO_BANKS 8   /* The number of banks */
+
+/* GPIO Controller registers for a single bank */
+struct gpio_ctlr_bank {
+       uint gpio_config[TEGRA_GPIO_PORTS];
+       uint gpio_dir_out[TEGRA_GPIO_PORTS];
+       uint gpio_out[TEGRA_GPIO_PORTS];
+       uint gpio_in[TEGRA_GPIO_PORTS];
+       uint gpio_int_status[TEGRA_GPIO_PORTS];
+       uint gpio_int_enable[TEGRA_GPIO_PORTS];
+       uint gpio_int_level[TEGRA_GPIO_PORTS];
+       uint gpio_int_clear[TEGRA_GPIO_PORTS];
+};
+
+struct gpio_ctlr {
+       struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
+};
+
+#define GPIO_BANK(x)   ((x) >> 5)
+#define GPIO_PORT(x)   (((x) >> 3) & 0x3)
+#define GPIO_BIT(x)    ((x) & 0x7)
+
+/*
+ * GPIO_PI3 = Port I = 8, bit = 3.
+ * Seaboard: used for UART/SPI selection
+ * Harmony: not used
+ */
+#define GPIO_PI3       ((8 << 3) | 3)
+
+#endif /* TEGRA2_GPIO_H_ */
index 7ec9eeba1c854bfefdac499ea8ad55aacd8ae57c..b1d47cd2e3ef24949ce9f475bd2618a992056e99 100644 (file)
@@ -121,4 +121,12 @@ struct pmc_ctlr {
        uint pmc_gate;                  /* _GATE_0, offset 15C */
 };
 
+#define CPU_PWRED      1
+#define CPU_CLMP       1
+
+#define PARTID_CP      0xFFFFFFF8
+#define START_CP       (1 << 8)
+
+#define CPUPWRREQ_OE   (1 << 16)
+
 #endif /* PMC_H */
diff --git a/arch/arm/include/asm/arch-tegra2/scu.h b/arch/arm/include/asm/arch-tegra2/scu.h
new file mode 100644 (file)
index 0000000..787ded0
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ *  (C) Copyright 2010,2011
+ *  NVIDIA Corporation <www.nvidia.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 _SCU_H_
+#define _SCU_H_
+
+/* ARM Snoop Control Unit (SCU) registers */
+struct scu_ctlr {
+       uint scu_ctrl;          /* SCU Control Register, offset 00 */
+       uint scu_cfg;           /* SCU Config Register, offset 04 */
+       uint scu_cpu_pwr_stat;  /* SCU CPU Power Status Register, offset 08 */
+       uint scu_inv_all;       /* SCU Invalidate All Register, offset 0C */
+       uint scu_reserved0[12]; /* reserved, offset 10-3C */
+       uint scu_filt_start;    /* SCU Filtering Start Address Reg, offset 40 */
+       uint scu_filt_end;      /* SCU Filtering End Address Reg, offset 44 */
+       uint scu_reserved1[2];  /* reserved, offset 48-4C */
+       uint scu_acc_ctl;       /* SCU Access Control Register, offset 50 */
+       uint scu_ns_acc_ctl;    /* SCU Non-secure Access Cntrl Reg, offset 54 */
+};
+
+#define SCU_CTRL_ENABLE                (1 << 0)
+
+#endif /* SCU_H */
index 9001b68994adc68683149f4ce3400dc12a821b5c..742a75a0dac3ab27163a2983db9e8ad4d2f6e0f9 100644 (file)
 #define _TEGRA2_H_
 
 #define NV_PA_SDRAM_BASE       0x00000000
+#define NV_PA_ARM_PERIPHBASE   0x50040000
+#define NV_PA_PG_UP_BASE       0x60000000
 #define NV_PA_TMRUS_BASE       0x60005010
 #define NV_PA_CLK_RST_BASE     0x60006000
+#define NV_PA_FLOW_BASE                0x60007000
+#define NV_PA_GPIO_BASE                0x6000D000
+#define NV_PA_EVP_BASE         0x6000F000
 #define NV_PA_APB_MISC_BASE    0x70000000
 #define NV_PA_APB_UARTA_BASE   (NV_PA_APB_MISC_BASE + 0x6000)
 #define NV_PA_APB_UARTB_BASE   (NV_PA_APB_MISC_BASE + 0x6040)
 #define NV_PA_APB_UARTD_BASE   (NV_PA_APB_MISC_BASE + 0x6300)
 #define NV_PA_APB_UARTE_BASE   (NV_PA_APB_MISC_BASE + 0x6400)
 #define NV_PA_PMC_BASE         0x7000E400
+#define NV_PA_CSITE_BASE       0x70040000
 
 #define TEGRA2_SDRC_CS0                NV_PA_SDRAM_BASE
 #define LOW_LEVEL_SRAM_STACK   0x4000FFFC
+#define EARLY_AVP_STACK                (NV_PA_SDRAM_BASE + 0x20000)
+#define EARLY_CPU_STACK                (EARLY_AVP_STACK - 4096)
+#define PG_UP_TAG_AVP          0xAAAAAAAA
 
 #ifndef __ASSEMBLY__
 struct timerus {
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
new file mode 100644 (file)
index 0000000..5e4789b
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ *  arch/arm/include/asm/assembler.h
+ *
+ *  Copyright (C) 1996-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  This file contains arm architecture specific defines
+ *  for the different processors.
+ *
+ *  Do not include any C declarations in this file - it is included by
+ *  assembler source.
+ */
+
+/*
+ * Endian independent macros for shifting bytes within registers.
+ */
+#ifndef __ARMEB__
+#define pull           lsr
+#define push           lsl
+#define get_byte_0     lsl #0
+#define get_byte_1     lsr #8
+#define get_byte_2     lsr #16
+#define get_byte_3     lsr #24
+#define put_byte_0     lsl #0
+#define put_byte_1     lsl #8
+#define put_byte_2     lsl #16
+#define put_byte_3     lsl #24
+#else
+#define pull           lsl
+#define push           lsr
+#define get_byte_0     lsr #24
+#define get_byte_1     lsr #16
+#define get_byte_2     lsr #8
+#define get_byte_3      lsl #0
+#define put_byte_0     lsl #24
+#define put_byte_1     lsl #16
+#define put_byte_2     lsl #8
+#define put_byte_3      lsl #0
+#endif
+
+/*
+ * Data preload for architectures that support it
+ */
+#if defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) || \
+       defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
+       defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || \
+       defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_7A__) || \
+       defined(__ARM_ARCH_7R__)
+#define PLD(code...)   code
+#else
+#define PLD(code...)
+#endif
+
+/*
+ * Cache alligned
+ */
+#define CALGN(code...) code
index c3ea582cab22bf7571e976a6d3203c7e09ec8c78..c6dfb254b5e4c61692215467b0da414d5bc81ce0 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __ASM_ARM_STRING_H
 #define __ASM_ARM_STRING_H
 
+#include <config.h>
+
 /*
  * We don't do inline string functions, since the
  * optimised inline asm versions are not small.
@@ -12,7 +14,9 @@ extern char * strrchr(const char * s, int c);
 #undef __HAVE_ARCH_STRCHR
 extern char * strchr(const char * s, int c);
 
-#undef __HAVE_ARCH_MEMCPY
+#ifdef CONFIG_USE_ARCH_MEMCPY
+#define __HAVE_ARCH_MEMCPY
+#endif
 extern void * memcpy(void *, const void *, __kernel_size_t);
 
 #undef __HAVE_ARCH_MEMMOVE
@@ -22,7 +26,9 @@ extern void * memmove(void *, const void *, __kernel_size_t);
 extern void * memchr(const void *, int, __kernel_size_t);
 
 #undef __HAVE_ARCH_MEMZERO
-#undef __HAVE_ARCH_MEMSET
+#ifdef CONFIG_USE_ARCH_MEMSET
+#define __HAVE_ARCH_MEMSET
+#endif
 extern void * memset(void *, int, __kernel_size_t);
 
 #if 0
index 454440c057af917936dca02cf6b6f04f326b1238..03b1b5e4af803a029b7ca24660365d77dce49f4f 100644 (file)
@@ -44,6 +44,8 @@ COBJS-y       += cache-cp15.o
 endif
 COBJS-y        += interrupts.o
 COBJS-y        += reset.o
+SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
+SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 
 SRCS   := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
           $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
index dc46e21dba521a532af1ac2a6dd83e28bfccc626..1a784a1e1958328251b283e4ed14d149e3eb5e6d 100644 (file)
@@ -356,9 +356,13 @@ void board_init_f (ulong bootflag)
 #endif /* CONFIG_VFD */
 
 #ifdef CONFIG_LCD
+#ifdef CONFIG_FB_ADDR
+       gd->fb_base = CONFIG_FB_ADDR;
+#else
        /* reserve memory for LCD display (always full pages) */
        addr = lcd_setmem (addr);
        gd->fb_base = addr;
+#endif /* CONFIG_FB_ADDR */
 #endif /* CONFIG_LCD */
 
        /*
@@ -399,7 +403,7 @@ void board_init_f (ulong bootflag)
                CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ, addr_sp);
 #endif
        /* leave 3 words for abort-stack    */
-       addr_sp -= 3;
+       addr_sp -= 12;
 
        /* 8-byte alignment for ABI compliance */
        addr_sp &= ~0x07;
index 77349530f02e10cc324aa43b90cf36db71f00493..802e833a2ed584fe1365dacd4a033665eeb2f5d7 100644 (file)
@@ -178,7 +178,6 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images)
 {
        ulong rd_len;
        void (*kernel_entry)(int zero, int dt_machid, void *dtblob);
-       ulong bootmap_base = getenv_bootm_low();
        ulong of_size = images->ft_len;
        char **of_flat_tree = &images->ft_addr;
        ulong *initrd_start = &images->initrd_start;
@@ -188,13 +187,15 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images)
 
        kernel_entry = (void (*)(int, int, void *))images->ep;
 
+       boot_fdt_add_mem_rsv_regions(lmb, *of_flat_tree);
+
        rd_len = images->rd_end - images->rd_start;
        ret = boot_ramdisk_high(lmb, images->rd_start, rd_len,
                                initrd_start, initrd_end);
        if (ret)
                return ret;
 
-       ret = boot_relocate_fdt(lmb, bootmap_base, of_flat_tree, &of_size);
+       ret = boot_relocate_fdt(lmb, of_flat_tree, &of_size);
        if (ret)
                return ret;
 
diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
new file mode 100644 (file)
index 0000000..40db90e
--- /dev/null
@@ -0,0 +1,241 @@
+/*
+ *  linux/arch/arm/lib/memcpy.S
+ *
+ *  Author:    Nicolas Pitre
+ *  Created:   Sep 28, 2005
+ *  Copyright: 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.
+ */
+
+#include <asm/assembler.h>
+
+#define W(instr)       instr
+
+#define LDR1W_SHIFT    0
+#define STR1W_SHIFT    0
+
+       .macro ldr1w ptr reg abort
+       W(ldr) \reg, [\ptr], #4
+       .endm
+
+       .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
+       ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
+       .endm
+
+       .macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
+       ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
+       .endm
+
+       .macro ldr1b ptr reg cond=al abort
+       ldr\cond\()b \reg, [\ptr], #1
+       .endm
+
+       .macro str1w ptr reg abort
+       W(str) \reg, [\ptr], #4
+       .endm
+
+       .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
+       stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
+       .endm
+
+       .macro str1b ptr reg cond=al abort
+       str\cond\()b \reg, [\ptr], #1
+       .endm
+
+       .macro enter reg1 reg2
+       stmdb sp!, {r0, \reg1, \reg2}
+       .endm
+
+       .macro exit reg1 reg2
+       ldmfd sp!, {r0, \reg1, \reg2}
+       .endm
+
+       .text
+
+/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
+
+.globl memcpy
+memcpy:
+
+               enter   r4, lr
+
+               subs    r2, r2, #4
+               blt     8f
+               ands    ip, r0, #3
+       PLD(    pld     [r1, #0]                )
+               bne     9f
+               ands    ip, r1, #3
+               bne     10f
+
+1:             subs    r2, r2, #(28)
+               stmfd   sp!, {r5 - r8}
+               blt     5f
+
+       CALGN(  ands    ip, r0, #31             )
+       CALGN(  rsb     r3, ip, #32             )
+       CALGN(  sbcnes  r4, r3, r2              )  @ C is always set here
+       CALGN(  bcs     2f                      )
+       CALGN(  adr     r4, 6f                  )
+       CALGN(  subs    r2, r2, r3              )  @ C gets set
+       CALGN(  add     pc, r4, ip              )
+
+       PLD(    pld     [r1, #0]                )
+2:     PLD(    subs    r2, r2, #96             )
+       PLD(    pld     [r1, #28]               )
+       PLD(    blt     4f                      )
+       PLD(    pld     [r1, #60]               )
+       PLD(    pld     [r1, #92]               )
+
+3:     PLD(    pld     [r1, #124]              )
+4:             ldr8w   r1, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f
+               subs    r2, r2, #32
+               str8w   r0, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f
+               bge     3b
+       PLD(    cmn     r2, #96                 )
+       PLD(    bge     4b                      )
+
+5:             ands    ip, r2, #28
+               rsb     ip, ip, #32
+#if LDR1W_SHIFT > 0
+               lsl     ip, ip, #LDR1W_SHIFT
+#endif
+               addne   pc, pc, ip              @ C is always clear here
+               b       7f
+6:
+               .rept   (1 << LDR1W_SHIFT)
+               W(nop)
+               .endr
+               ldr1w   r1, r3, abort=20f
+               ldr1w   r1, r4, abort=20f
+               ldr1w   r1, r5, abort=20f
+               ldr1w   r1, r6, abort=20f
+               ldr1w   r1, r7, abort=20f
+               ldr1w   r1, r8, abort=20f
+               ldr1w   r1, lr, abort=20f
+
+#if LDR1W_SHIFT < STR1W_SHIFT
+               lsl     ip, ip, #STR1W_SHIFT - LDR1W_SHIFT
+#elif LDR1W_SHIFT > STR1W_SHIFT
+               lsr     ip, ip, #LDR1W_SHIFT - STR1W_SHIFT
+#endif
+               add     pc, pc, ip
+               nop
+               .rept   (1 << STR1W_SHIFT)
+               W(nop)
+               .endr
+               str1w   r0, r3, abort=20f
+               str1w   r0, r4, abort=20f
+               str1w   r0, r5, abort=20f
+               str1w   r0, r6, abort=20f
+               str1w   r0, r7, abort=20f
+               str1w   r0, r8, abort=20f
+               str1w   r0, lr, abort=20f
+
+       CALGN(  bcs     2b                      )
+
+7:             ldmfd   sp!, {r5 - r8}
+
+8:             movs    r2, r2, lsl #31
+               ldr1b   r1, r3, ne, abort=21f
+               ldr1b   r1, r4, cs, abort=21f
+               ldr1b   r1, ip, cs, abort=21f
+               str1b   r0, r3, ne, abort=21f
+               str1b   r0, r4, cs, abort=21f
+               str1b   r0, ip, cs, abort=21f
+
+               exit    r4, pc
+
+9:             rsb     ip, ip, #4
+               cmp     ip, #2
+               ldr1b   r1, r3, gt, abort=21f
+               ldr1b   r1, r4, ge, abort=21f
+               ldr1b   r1, lr, abort=21f
+               str1b   r0, r3, gt, abort=21f
+               str1b   r0, r4, ge, abort=21f
+               subs    r2, r2, ip
+               str1b   r0, lr, abort=21f
+               blt     8b
+               ands    ip, r1, #3
+               beq     1b
+
+10:            bic     r1, r1, #3
+               cmp     ip, #2
+               ldr1w   r1, lr, abort=21f
+               beq     17f
+               bgt     18f
+
+
+               .macro  forward_copy_shift pull push
+
+               subs    r2, r2, #28
+               blt     14f
+
+       CALGN(  ands    ip, r0, #31             )
+       CALGN(  rsb     ip, ip, #32             )
+       CALGN(  sbcnes  r4, ip, r2              )  @ C is always set here
+       CALGN(  subcc   r2, r2, ip              )
+       CALGN(  bcc     15f                     )
+
+11:            stmfd   sp!, {r5 - r9}
+
+       PLD(    pld     [r1, #0]                )
+       PLD(    subs    r2, r2, #96             )
+       PLD(    pld     [r1, #28]               )
+       PLD(    blt     13f                     )
+       PLD(    pld     [r1, #60]               )
+       PLD(    pld     [r1, #92]               )
+
+12:    PLD(    pld     [r1, #124]              )
+13:            ldr4w   r1, r4, r5, r6, r7, abort=19f
+               mov     r3, lr, pull #\pull
+               subs    r2, r2, #32
+               ldr4w   r1, r8, r9, ip, lr, abort=19f
+               orr     r3, r3, r4, push #\push
+               mov     r4, r4, pull #\pull
+               orr     r4, r4, r5, push #\push
+               mov     r5, r5, pull #\pull
+               orr     r5, r5, r6, push #\push
+               mov     r6, r6, pull #\pull
+               orr     r6, r6, r7, push #\push
+               mov     r7, r7, pull #\pull
+               orr     r7, r7, r8, push #\push
+               mov     r8, r8, pull #\pull
+               orr     r8, r8, r9, push #\push
+               mov     r9, r9, pull #\pull
+               orr     r9, r9, ip, push #\push
+               mov     ip, ip, pull #\pull
+               orr     ip, ip, lr, push #\push
+               str8w   r0, r3, r4, r5, r6, r7, r8, r9, ip, , abort=19f
+               bge     12b
+       PLD(    cmn     r2, #96                 )
+       PLD(    bge     13b                     )
+
+               ldmfd   sp!, {r5 - r9}
+
+14:            ands    ip, r2, #28
+               beq     16f
+
+15:            mov     r3, lr, pull #\pull
+               ldr1w   r1, lr, abort=21f
+               subs    ip, ip, #4
+               orr     r3, r3, lr, push #\push
+               str1w   r0, r3, abort=21f
+               bgt     15b
+       CALGN(  cmp     r2, #0                  )
+       CALGN(  bge     11b                     )
+
+16:            sub     r1, r1, #(\push / 8)
+               b       8b
+
+               .endm
+
+
+               forward_copy_shift      pull=8  push=24
+
+17:            forward_copy_shift      pull=16 push=16
+
+18:            forward_copy_shift      pull=24 push=8
+
diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S
new file mode 100644 (file)
index 0000000..0cdf895
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ *  linux/arch/arm/lib/memset.S
+ *
+ *  Copyright (C) 1995-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  ASM optimised string functions
+ */
+#include <asm/assembler.h>
+
+       .text
+       .align  5
+       .word   0
+
+1:     subs    r2, r2, #4              @ 1 do we have enough
+       blt     5f                      @ 1 bytes to align with?
+       cmp     r3, #2                  @ 1
+       strltb  r1, [r0], #1            @ 1
+       strleb  r1, [r0], #1            @ 1
+       strb    r1, [r0], #1            @ 1
+       add     r2, r2, r3              @ 1 (r2 = r2 - (4 - r3))
+/*
+ * The pointer is now aligned and the length is adjusted.  Try doing the
+ * memset again.
+ */
+
+.globl memset
+memset:
+       ands    r3, r0, #3              @ 1 unaligned?
+       bne     1b                      @ 1
+/*
+ * we know that the pointer in r0 is aligned to a word boundary.
+ */
+       orr     r1, r1, r1, lsl #8
+       orr     r1, r1, r1, lsl #16
+       mov     r3, r1
+       cmp     r2, #16
+       blt     4f
+
+#if ! CALGN(1)+0
+
+/*
+ * We need an extra register for this loop - save the return address and
+ * use the LR
+ */
+       str     lr, [sp, #-4]!
+       mov     ip, r1
+       mov     lr, r1
+
+2:     subs    r2, r2, #64
+       stmgeia r0!, {r1, r3, ip, lr}   @ 64 bytes at a time.
+       stmgeia r0!, {r1, r3, ip, lr}
+       stmgeia r0!, {r1, r3, ip, lr}
+       stmgeia r0!, {r1, r3, ip, lr}
+       bgt     2b
+       ldmeqfd sp!, {pc}               @ Now <64 bytes to go.
+/*
+ * No need to correct the count; we're only testing bits from now on
+ */
+       tst     r2, #32
+       stmneia r0!, {r1, r3, ip, lr}
+       stmneia r0!, {r1, r3, ip, lr}
+       tst     r2, #16
+       stmneia r0!, {r1, r3, ip, lr}
+       ldr     lr, [sp], #4
+
+#else
+
+/*
+ * This version aligns the destination pointer in order to write
+ * whole cache lines at once.
+ */
+
+       stmfd   sp!, {r4-r7, lr}
+       mov     r4, r1
+       mov     r5, r1
+       mov     r6, r1
+       mov     r7, r1
+       mov     ip, r1
+       mov     lr, r1
+
+       cmp     r2, #96
+       tstgt   r0, #31
+       ble     3f
+
+       and     ip, r0, #31
+       rsb     ip, ip, #32
+       sub     r2, r2, ip
+       movs    ip, ip, lsl #(32 - 4)
+       stmcsia r0!, {r4, r5, r6, r7}
+       stmmiia r0!, {r4, r5}
+       tst     ip, #(1 << 30)
+       mov     ip, r1
+       strne   r1, [r0], #4
+
+3:     subs    r2, r2, #64
+       stmgeia r0!, {r1, r3-r7, ip, lr}
+       stmgeia r0!, {r1, r3-r7, ip, lr}
+       bgt     3b
+       ldmeqfd sp!, {r4-r7, pc}
+
+       tst     r2, #32
+       stmneia r0!, {r1, r3-r7, ip, lr}
+       tst     r2, #16
+       stmneia r0!, {r4-r7}
+       ldmfd   sp!, {r4-r7, lr}
+
+#endif
+
+4:     tst     r2, #8
+       stmneia r0!, {r1, r3}
+       tst     r2, #4
+       strne   r1, [r0], #4
+/*
+ * When we get here, we've got less than 4 bytes to zero.  We
+ * may have an unaligned pointer as well.
+ */
+5:     tst     r2, #2
+       strneb  r1, [r0], #1
+       strneb  r1, [r0], #1
+       tst     r2, #1
+       strneb  r1, [r0], #1
+       mov     pc, lr
index 1121ca1cc253f0d05eeacab26a7a54a663db072c..9488c49132832e02a6d9d80f539012be5755193b 100644 (file)
@@ -23,7 +23,7 @@
 
 CROSS_COMPILE ?= avr32-linux-
 
-STANDALONE_LOAD_ADDR = 0x00000000
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000
 
 PLATFORM_RELFLAGS      += -ffixed-r5 -fPIC -mno-init-got -mrelax
 PLATFORM_LDFLAGS       += --relax
index f4503eacb99e45c6151a61205fea06bb1e62ab53..f0909e95d2e1e7230d24a18e739dfda0339f1e27 100644 (file)
 
 CROSS_COMPILE ?= bfin-uclinux-
 
-STANDALONE_LOAD_ADDR = 0x1000 -m elf32bfin
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin
 
+ifeq ($(CONFIG_BFIN_CPU),)
+CONFIG_BFIN_CPU := \
+       $(shell awk '$$2 == "CONFIG_BFIN_CPU" { print $$3 }' \
+               $(src)include/configs/$(BOARD).h)
+else
+CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU)))
+endif
 CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE)))
 
 PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic
@@ -34,7 +41,6 @@ LDFLAGS_FINAL += --gc-sections
 LDFLAGS += -m elf32bfin
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
 
-PLATFORM_CPPFLAGS += -DBFIN_CPU='"$(CONFIG_BFIN_CPU)"'
 PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU)
 
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
@@ -67,6 +73,13 @@ endif
 
 LDR_FLAGS += $(LDR_FLAGS-y)
 
+# Set some default LDR flags based on boot mode.
+LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
+
 ifeq ($(wildcard $(TOPDIR)/board/$(BOARD)/u-boot.lds*),)
 LDSCRIPT = $(obj)arch/$(ARCH)/lib/u-boot.lds.S
 endif
+
+ifneq ($(CONFIG_SYS_TEXT_BASE),)
+$(error do not set CONFIG_SYS_TEXT_BASE for Blackfin boards)
+endif
index 4a9e577a872ecb516fb77ce3aac9184a0f399b76..df10f1bc653295c64c132df90347e6b76160bc97 100644 (file)
@@ -18,7 +18,6 @@ CEXTRA   := initcode.o
 SEXTRA   := start.o
 SOBJS    := interrupt.o cache.o
 COBJS-$(CONFIG_BOOTCOUNT_LIMIT) += bootcount.o
-COBJS-$(CONFIG_CMD_GPIO) += cmd_gpio.o
 COBJS-y  += cpu.o
 COBJS-y  += gpio.o
 COBJS-y  += interrupts.o
diff --git a/arch/blackfin/cpu/cmd_gpio.c b/arch/blackfin/cpu/cmd_gpio.c
deleted file mode 100644 (file)
index e96413b..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Control GPIO pins on the fly
- *
- * Copyright (c) 2008-2010 Analog Devices Inc.
- *
- * Licensed under the GPL-2 or later.
- */
-
-#include <common.h>
-#include <command.h>
-#include <linux/ctype.h>
-
-#include <asm/blackfin.h>
-#include <asm/gpio.h>
-
-enum {
-       GPIO_INPUT,
-       GPIO_SET,
-       GPIO_CLEAR,
-       GPIO_TOGGLE,
-};
-
-int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       if (argc == 2 && !strcmp(argv[1], "status")) {
-               bfin_gpio_labels();
-               return 0;
-       }
-
-       if (argc != 3)
- show_usage:
-               return cmd_usage(cmdtp);
-
-       /* parse the behavior */
-       ulong sub_cmd;
-       switch (argv[1][0]) {
-               case 'i': sub_cmd = GPIO_INPUT;  break;
-               case 's': sub_cmd = GPIO_SET;    break;
-               case 'c': sub_cmd = GPIO_CLEAR;  break;
-               case 't': sub_cmd = GPIO_TOGGLE; break;
-               default:  goto show_usage;
-       }
-
-       /* parse the pin with format: [p][port]<#> */
-       const char *str_pin = argv[2];
-
-       /* grab the [p]<port> portion */
-       ulong port_base;
-       if (tolower(*str_pin) == 'p') ++str_pin;
-       switch (tolower(*str_pin)) {
-#ifdef GPIO_PA0
-               case 'a': port_base = GPIO_PA0; break;
-#endif
-#ifdef GPIO_PB0
-               case 'b': port_base = GPIO_PB0; break;
-#endif
-#ifdef GPIO_PC0
-               case 'c': port_base = GPIO_PC0; break;
-#endif
-#ifdef GPIO_PD0
-               case 'd': port_base = GPIO_PD0; break;
-#endif
-#ifdef GPIO_PE0
-               case 'e': port_base = GPIO_PE0; break;
-#endif
-#ifdef GPIO_PF0
-               case 'f': port_base = GPIO_PF0; break;
-#endif
-#ifdef GPIO_PG0
-               case 'g': port_base = GPIO_PG0; break;
-#endif
-#ifdef GPIO_PH0
-               case 'h': port_base = GPIO_PH0; break;
-#endif
-#ifdef GPIO_PI0
-               case 'i': port_base = GPIO_PI0; break;
-#endif
-#ifdef GPIO_PJ
-               case 'j': port_base = GPIO_PJ0; break;
-#endif
-               default:  goto show_usage;
-       }
-
-       /* grab the <#> portion */
-       ulong pin = simple_strtoul(str_pin + 1, NULL, 10);
-       if (pin > 15)
-               goto show_usage;
-
-       /* grab the pin before we tweak it */
-       ulong gpio = port_base + pin;
-       gpio_request(gpio, "cmd_gpio");
-
-       /* finally, let's do it: set direction and exec command */
-       ulong value;
-       if (sub_cmd == GPIO_INPUT) {
-               gpio_direction_input(gpio);
-               value = gpio_get_value(gpio);
-       } else {
-               switch (sub_cmd) {
-                       case GPIO_SET:    value = 1; break;
-                       case GPIO_CLEAR:  value = 0; break;
-                       case GPIO_TOGGLE: value = !gpio_get_value(gpio); break;
-                       default:          goto show_usage;
-               }
-               gpio_direction_output(gpio, value);
-       }
-       printf("gpio: pin %lu on port %c (gpio %lu) value is %lu\n",
-               pin, *str_pin, gpio, value);
-
-       gpio_free(gpio);
-
-       return value;
-}
-
-U_BOOT_CMD(gpio, 3, 0, do_gpio,
-       "input/set/clear/toggle gpio output pins",
-       "<input|set|clear|toggle> <port><pin>\n"
-       "    - input/set/clear/toggle the specified pin (e.g. PF10)");
index ba85e0b9a5cf07808a62048e456b65ca938493b6..e70560f4de19d185869f9d4abc3ae5dd300b1ad4 100644 (file)
@@ -28,7 +28,6 @@
 #include <command.h>
 
 void board_reset(void) __attribute__((__weak__));
-void bfin_reset_or_hang(void) __attribute__((__noreturn__));
 void bfin_dump(struct pt_regs *reg);
 void bfin_panic(struct pt_regs *reg);
 void dump(struct pt_regs *regs);
index 488ca11bb0657055e2ad53f037a5c1907f641b91..cb96721cf4a7b910e6b57eec984d2098c0dfdee2 100644 (file)
@@ -45,7 +45,7 @@ static struct gpio_port_t * const gpio_array[] = {
 #if defined(BF533_FAMILY)
        (struct gpio_port_t *) FIO_FLAG_D,
 #elif defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x) \
-       || defined(BF538_FAMILY)
+       || defined(BF538_FAMILY) || defined(CONFIG_BF50x)
        (struct gpio_port_t *) PORTFIO,
 # if !defined(BF538_FAMILY)
        (struct gpio_port_t *) PORTGIO,
@@ -71,7 +71,8 @@ static struct gpio_port_t * const gpio_array[] = {
 #endif
 };
 
-#if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
+#if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x) || \
+    defined(CONFIG_BF50x)
 static unsigned short * const port_fer[] = {
        (unsigned short *) PORTF_FER,
        (unsigned short *) PORTG_FER,
@@ -202,7 +203,8 @@ static void port_setup(unsigned gpio, unsigned short usage)
        if (check_gpio(gpio))
                return;
 
-#if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
+#if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x) || \
+    defined(CONFIG_BF50x)
        if (usage == GPIO_USAGE)
                *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
        else
index 433d477ddfa15c64b53a0ccec8fc5f191996de87..750add06bcefc9db0276c63b464e5fe5d0098aa1 100644 (file)
@@ -341,13 +341,13 @@ maybe_self_refresh(ADI_BOOT_DATA *bs)
                return false;
 
        /* If external memory is enabled, put it into self refresh first. */
-#ifdef EBIU_RSTCTL
+#if defined(EBIU_RSTCTL)
        if (bfin_read_EBIU_RSTCTL() & DDR_SRESET) {
                serial_putc('b');
                bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() | SRREQ);
                return true;
        }
-#else
+#elif defined(EBIU_SDGCTL)
        if (bfin_read_EBIU_SDBCTL() & EBE) {
                serial_putc('b');
                bfin_write_EBIU_SDGCTL(bfin_read_EBIU_SDGCTL() | SRFS);
@@ -373,12 +373,15 @@ program_clocks(ADI_BOOT_DATA *bs, bool put_into_srfs)
 
        /* If we're entering self refresh, make sure it has happened. */
        if (put_into_srfs)
-#ifdef EBIU_RSTCTL
+#if defined(EBIU_RSTCTL)
                while (!(bfin_read_EBIU_RSTCTL() & SRACK))
-#else
+                       continue;
+#elif defined(EBIU_SDGCTL)
                while (!(bfin_read_EBIU_SDSTAT() & SDSRA))
-#endif
                        continue;
+#else
+               ;
+#endif
 
        serial_putc('c');
 
@@ -536,7 +539,7 @@ program_memory_controller(ADI_BOOT_DATA *bs, bool put_into_srfs)
        /* Program the external memory controller before we come out of
         * self-refresh.  This only works with our SDRAM controller.
         */
-#ifndef EBIU_RSTCTL
+#ifdef EBIU_SDGCTL
 # ifdef CONFIG_EBIU_SDRRC_VAL
        bfin_write_EBIU_SDRRC(CONFIG_EBIU_SDRRC_VAL);
 # endif
@@ -552,9 +555,9 @@ program_memory_controller(ADI_BOOT_DATA *bs, bool put_into_srfs)
 
        /* Now that we've reprogrammed, take things out of self refresh. */
        if (put_into_srfs)
-#ifdef EBIU_RSTCTL
+#if defined(EBIU_RSTCTL)
                bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() & ~(SRREQ));
-#else
+#elif defined(EBIU_SDGCTL)
                bfin_write_EBIU_SDGCTL(bfin_read_EBIU_SDGCTL() & ~(SRFS));
 #endif
 
@@ -646,10 +649,10 @@ program_async_controller(ADI_BOOT_DATA *bs)
        serial_putc('b');
 
        /* Not all parts have these additional MMRs. */
-#ifdef EBIU_MODE
-# ifdef CONFIG_EBIU_MBSCTL_VAL
+#ifdef EBIU_MBSCTL
        bfin_write_EBIU_MBSCTL(CONFIG_EBIU_MBSCTL_VAL);
-# endif
+#endif
+#ifdef EBIU_MODE
 # ifdef CONFIG_EBIU_MODE_VAL
        bfin_write_EBIU_MODE(CONFIG_EBIU_MODE_VAL);
 # endif
index 164afde33138dd00fde5d22b99e0e2651a9f7b77..9307e9f9e2005670f28549820e82215e989cf240 100644 (file)
@@ -80,27 +80,11 @@ static void bfin_reset(void)
  * PC relative call with a 25 bit immediate.  This is not enough
  * to get us from the top of SDRAM into L1.
  */
-__attribute__ ((__noreturn__))
-static inline void bfin_reset_trampoline(void)
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        if (board_reset)
                board_reset();
        while (1)
                asm("jump (%0);" : : "a" (bfin_reset));
-}
-
-__attribute__ ((__noreturn__))
-void bfin_reset_or_hang(void)
-{
-#ifdef CONFIG_PANIC_HANG
-       hang();
-#else
-       bfin_reset_trampoline();
-#endif
-}
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       bfin_reset_trampoline();
        return 0;
 }
index f9e311f3eee819620f186274011a242c2f5b39b8..7999a19333a682837cf5b08e8f395107e24ec099 100644 (file)
 #define LOB(x) ((x) & 0xFF)
 #define HIB(x) (((x) >> 8) & 0xFF)
 
+#if defined(__ADSPBF50x__) || defined(__ADSPBF54x__)
+# define BFIN_UART_HW_VER 2
+#else
+# define BFIN_UART_HW_VER 1
+#endif
+
 /*
  * All Blackfin system MMRs are padded to 32bits even if the register
  * itself is only 16bits.  So use a helper macro to streamline this.
  */
 #define __BFP(m) u16 m; u16 __pad_##m
 struct bfin_mmr_serial {
-#ifdef __ADSPBF54x__
+#if BFIN_UART_HW_VER == 2
        __BFP(dll);
        __BFP(dlh);
        __BFP(gctl);
@@ -74,25 +80,21 @@ struct bfin_mmr_serial {
 };
 #undef __BFP
 
-#ifndef UART_LSR
-# if (CONFIG_UART_CONSOLE == 3)
-#  define UART_BASE UART3_DLL
-# elif (CONFIG_UART_CONSOLE == 2)
-#  define UART_BASE UART2_DLL
-# elif (CONFIG_UART_CONSOLE == 1)
-#  define UART_BASE UART1_DLL
-# elif (CONFIG_UART_CONSOLE == 0)
-#  define UART_BASE UART0_DLL
-# endif
+#define __PASTE_UART(num, pfx, sfx) pfx##num##_##sfx
+#define _PASTE_UART(num, pfx, sfx) __PASTE_UART(num, pfx, sfx)
+#define MMR_UART(mmr) _PASTE_UART(CONFIG_UART_CONSOLE, UART, DLL)
+#define P_UART(pin) _PASTE_UART(CONFIG_UART_CONSOLE, P_UART, pin)
+
+#ifndef UART_DLL
+# define UART_DLL MMR_UART(DLL)
 #else
 # if CONFIG_UART_CONSOLE != 0
 #  error CONFIG_UART_CONSOLE must be 0 on parts with only one UART
 # endif
-# define UART_BASE UART_DLL
 #endif
-#define pUART ((volatile struct bfin_mmr_serial *)UART_BASE)
+#define pUART ((volatile struct bfin_mmr_serial *)UART_DLL)
 
-#ifdef __ADSPBF54x__
+#if BFIN_UART_HW_VER == 2
 # define ACCESS_LATCH()
 # define ACCESS_PORT_IER()
 #else
@@ -106,23 +108,21 @@ __attribute__((always_inline))
 static inline void serial_do_portmux(void)
 {
        if (!BFIN_DEBUG_EARLY_SERIAL) {
-               const unsigned short pins[] = {
-#if CONFIG_UART_CONSOLE == 0
-                       P_UART0_TX, P_UART0_RX,
-#elif CONFIG_UART_CONSOLE == 1
-                       P_UART1_TX, P_UART1_RX,
-#elif CONFIG_UART_CONSOLE == 2
-                       P_UART2_TX, P_UART2_RX,
-#elif CONFIG_UART_CONSOLE == 3
-                       P_UART3_TX, P_UART3_RX,
-#endif
-                       0,
-               };
+               const unsigned short pins[] = { P_UART(RX), P_UART(TX), 0, };
                peripheral_request_list(pins, "bfin-uart");
                return;
        }
 
-#if defined(__ADSPBF51x__)
+#if defined(__ADSPBF50x__)
+# define DO_MUX(port, mux_tx, mux_rx, tx, rx) \
+       bfin_write_PORT##port##_MUX((bfin_read_PORT##port##_MUX() & ~(PORT_x_MUX_##mux_tx##_MASK | PORT_x_MUX_##mux_rx##_MASK)) | PORT_x_MUX_##mux_tx##_FUNC_1 | PORT_x_MUX_##mux_rx##_FUNC_1); \
+       bfin_write_PORT##port##_FER(bfin_read_PORT##port##_FER() | P##port##tx | P##port##rx);
+       switch (CONFIG_UART_CONSOLE) {
+       case 0: DO_MUX(G, 7, 7, 12, 13); break; /* Port G; mux 7; PG12 and PG13 */
+       case 1: DO_MUX(F, 3, 3, 6, 7);   break; /* Port F; mux 3; PF6 and PF7 */
+       }
+       SSYNC();
+#elif defined(__ADSPBF51x__)
 # define DO_MUX(port, mux_tx, mux_rx, tx, rx) \
        bfin_write_PORT##port##_MUX((bfin_read_PORT##port##_MUX() & ~(PORT_x_MUX_##mux_tx##_MASK | PORT_x_MUX_##mux_rx##_MASK)) | PORT_x_MUX_##mux_tx##_FUNC_2 | PORT_x_MUX_##mux_rx##_FUNC_2); \
        bfin_write_PORT##port##_FER(bfin_read_PORT##port##_FER() | P##port##tx | P##port##rx);
@@ -141,13 +141,11 @@ static inline void serial_do_portmux(void)
        }
        SSYNC();
 #elif defined(__ADSPBF537__) || defined(__ADSPBF536__) || defined(__ADSPBF534__)
-# define DO_MUX(func, tx, rx) \
-       bfin_write_PORT_MUX(bfin_read_PORT_MUX() & ~(func)); \
-       bfin_write_PORTF_FER(bfin_read_PORTF_FER() | PF##tx | PF##rx);
-       switch (CONFIG_UART_CONSOLE) {
-       case 0: DO_MUX(PFDE, 0, 1); break;
-       case 1: DO_MUX(PFTE, 2, 3); break;
-       }
+       const uint16_t func[] = { PFDE, PFTE, };
+       bfin_write_PORT_MUX(bfin_read_PORT_MUX() & ~func[CONFIG_UART_CONSOLE]);
+       bfin_write_PORTF_FER(bfin_read_PORTF_FER() |
+                            (1 << P_IDENT(P_UART(RX))) |
+                            (1 << P_IDENT(P_UART(TX))));
        SSYNC();
 #elif defined(__ADSPBF54x__)
 # define DO_MUX(port, tx, rx) \
@@ -160,6 +158,12 @@ static inline void serial_do_portmux(void)
        case 3: DO_MUX(B, 6, 7); break; /* Port B; PB6 and PB7 */
        }
        SSYNC();
+#elif defined(__ADSPBF561__)
+       /* UART pins could be GPIO, but they aren't pin muxed.  */
+#else
+# if (P_UART(RX) & P_DEFINED) || (P_UART(TX) & P_DEFINED)
+#  error "missing portmux logic for UART"
+# endif
 #endif
 }
 
index 7a3abba21c4bbf7ebf562e247a1bafbe68dd9186..15ecb1e8ebcd4fe7a017037f00ce96b7bbd8352a 100644 (file)
@@ -52,6 +52,19 @@ ENTRY(_start)
        sp.l = LO(L1_SRAM_SCRATCH_END - 20);
        sp.h = HI(L1_SRAM_SCRATCH_END - 20);
 
+       /* Optimization register tricks: keep a base value in the
+        * reserved P registers so we use the load/store with an
+        * offset syntax.  R0 = [P5 + <constant>];
+        *   P4 - system MMR base
+        *   P5 - core MMR base
+        */
+#ifdef CONFIG_HW_WATCHDOG
+       p4.l = 0;
+       p4.h = HI(SYSMMR_BASE);
+#endif
+       p5.l = 0;
+       p5.h = HI(COREMMR_BASE);
+
 #ifdef CONFIG_HW_WATCHDOG
 # ifndef CONFIG_HW_WATCHDOG_TIMEOUT_START
 #  define CONFIG_HW_WATCHDOG_TIMEOUT_START 5000
@@ -60,13 +73,11 @@ ENTRY(_start)
         * That should be long enough to bootstrap ourselves up and
         * then the common u-boot code can take over.
         */
-       P0.L = LO(WDOG_CNT);
-       P0.H = HI(WDOG_CNT);
-       R0.L = 0;
-       R0.H = HI(MSEC_TO_SCLK(CONFIG_HW_WATCHDOG_TIMEOUT_START));
-       [P0] = R0;
+       r0 = 0;
+       r0.h = HI(MSEC_TO_SCLK(CONFIG_HW_WATCHDOG_TIMEOUT_START));
+       [p4 + (WDOG_CNT - SYSMMR_BASE)] = r0;
        /* fire up the watchdog - R0.L above needs to be 0x0000 */
-       W[P0 + (WDOG_CTL - WDOG_CNT)] = R0;
+       W[p4 + (WDOG_CTL - SYSMMR_BASE)] = r0;
 #endif
 
        /* Turn on the serial for debugging the init process */
@@ -121,6 +132,18 @@ ENTRY(_start)
        if cc jump .Lnorelocate;
        r6 = 0 (x);
 
+       /* Turn off caches as they require CPLBs and a CPLB miss requires
+        * a software exception handler to process it.  But we're about to
+        * clobber any previous executing software (like U-Boot that just
+        * launched a new U-Boot via 'go'), so any handler state will be
+        * unreliable after the memcpy below.
+        */
+       serial_early_puts("Kill Caches");
+       r0 = 0;
+       [p5 + (IMEM_CONTROL - COREMMR_BASE)] = r0;
+       [p5 + (DMEM_CONTROL - COREMMR_BASE)] = r0;
+       ssync;
+
        /* In bypass mode, we don't have an LDR with an init block
         * so we need to explicitly call it ourselves.  This will
         * reprogram our clocks, memory, and setup our async banks.
@@ -204,17 +227,15 @@ ENTRY(_start)
        serial_early_puts("Lower to 15");
        r0 = r7;
        r1 = r6;
-       p0.l = LO(EVT15);
-       p0.h = HI(EVT15);
        p1.l = .Lenable_nested;
        p1.h = .Lenable_nested;
-       [p0] = p1;
+       [p5 + (EVT15 - COREMMR_BASE)] = p1;
        r7 = EVT_IVG15 (z);
        sti r7;
        raise 15;
-       p4.l = .LWAIT_HERE;
-       p4.h = .LWAIT_HERE;
-       reti = p4;
+       p3.l = .LWAIT_HERE;
+       p3.h = .LWAIT_HERE;
+       reti = p3;
        rti;
 
        /* Enable nested interrupts before continuing with cpu init */
index 09388aa3d53a15ed8b34d188732ee31eded5499f..0cb833a0e43f0db3fb4daaf0b8e17a5662ac510d 100644 (file)
@@ -426,5 +426,5 @@ void bfin_panic(struct pt_regs *regs)
        unsigned long tflags;
        trace_buffer_save(tflags);
        bfin_dump(regs);
-       bfin_reset_or_hang();
+       panic("PANIC: Blackfin internal error");
 }
index 952444ed090e9f85e619fe82fef01ce35de526d5..a19f0f74e6d767c0dc1f30ff4926b01c500773d2 100644 (file)
@@ -6,6 +6,12 @@
 #ifndef __MACH_CDEF_BLACKFIN__
 #define __MACH_CDEF_BLACKFIN__
 
+#ifdef __ADSPBF504__
+# include "mach-bf506/BF504_cdef.h"
+#endif
+#ifdef __ADSPBF506__
+# include "mach-bf506/BF506_cdef.h"
+#endif
 #ifdef __ADSPBF512__
 # include "mach-bf518/BF512_cdef.h"
 #endif
index 385966a00bbe62727d8dd9405535713c872cfc3c..f06d1f12cc6cf2951a069c9368204e830b8647b0 100644 (file)
@@ -6,6 +6,16 @@
 #ifndef __MACH_DEF_BLACKFIN__
 #define __MACH_DEF_BLACKFIN__
 
+#ifdef __ADSPBF504__
+# include "mach-bf506/BF504_def.h"
+# include "mach-bf506/anomaly.h"
+# include "mach-bf506/def_local.h"
+#endif
+#ifdef __ADSPBF506__
+# include "mach-bf506/BF506_def.h"
+# include "mach-bf506/anomaly.h"
+# include "mach-bf506/def_local.h"
+#endif
 #ifdef __ADSPBF512__
 # include "mach-bf518/BF512_def.h"
 # include "mach-bf518/anomaly.h"
index 04372525cc2470f8bb0141945e6675e7863a9d57..89814cd5853b11bc9f59519c827027359e9b11a5 100644 (file)
 /* Some of our defines use this (like CONFIG_SYS_GBL_DATA_ADDR) */
 #include <asm-offsets.h>
 
+/* Sanity check CONFIG_BFIN_CPU */
+#ifndef CONFIG_BFIN_CPU
+# error CONFIG_BFIN_CPU: your board config needs to define this
+#endif
+
 #ifndef CONFIG_BFIN_SCRATCH_REG
 # define CONFIG_BFIN_SCRATCH_REG retn
 #endif
 #ifndef CONFIG_SYS_GBL_DATA_ADDR
 # define CONFIG_SYS_GBL_DATA_ADDR (CONFIG_SYS_MALLOC_BASE - GENERATED_GBL_DATA_SIZE)
 #endif
+#ifndef CONFIG_SYS_BD_INFO_ADDR
+# define CONFIG_SYS_BD_INFO_ADDR (CONFIG_SYS_GBL_DATA_ADDR - GENERATED_BD_INFO_SIZE)
+#endif
 #ifndef CONFIG_STACKBASE
-# define CONFIG_STACKBASE (CONFIG_SYS_GBL_DATA_ADDR - 4)
+# define CONFIG_STACKBASE (CONFIG_SYS_BD_INFO_ADDR - 4)
 #endif
 #ifndef CONFIG_SYS_MEMTEST_START
 # define CONFIG_SYS_MEMTEST_START 0
index b650ef080000ffbcb169c47a6d37eedf379d4a81..9c0e5d1954d87c7d2961a3732e04ed276fbf6f0d 100644 (file)
@@ -196,6 +196,59 @@ static inline int gpio_is_valid(int number)
        return number >= 0 && number < MAX_BLACKFIN_GPIOS;
 }
 
+#include <linux/ctype.h>
+
+static inline int name_to_gpio(const char *name)
+{
+       int port_base;
+
+       if (tolower(*name) == 'p') {
+               ++name;
+
+               switch (tolower(*name)) {
+#ifdef GPIO_PA0
+               case 'a': port_base = GPIO_PA0; break;
+#endif
+#ifdef GPIO_PB0
+               case 'b': port_base = GPIO_PB0; break;
+#endif
+#ifdef GPIO_PC0
+               case 'c': port_base = GPIO_PC0; break;
+#endif
+#ifdef GPIO_PD0
+               case 'd': port_base = GPIO_PD0; break;
+#endif
+#ifdef GPIO_PE0
+               case 'e': port_base = GPIO_PE0; break;
+#endif
+#ifdef GPIO_PF0
+               case 'f': port_base = GPIO_PF0; break;
+#endif
+#ifdef GPIO_PG0
+               case 'g': port_base = GPIO_PG0; break;
+#endif
+#ifdef GPIO_PH0
+               case 'h': port_base = GPIO_PH0; break;
+#endif
+#ifdef GPIO_PI0
+               case 'i': port_base = GPIO_PI0; break;
+#endif
+#ifdef GPIO_PJ
+               case 'j': port_base = GPIO_PJ0; break;
+#endif
+               default:  return -1;
+               }
+
+               ++name;
+       } else
+               port_base = 0;
+
+       return port_base + simple_strtoul(name, NULL, 10);
+}
+#define name_to_gpio(n) name_to_gpio(n)
+
+#define gpio_status() bfin_gpio_labels()
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __ARCH_BLACKFIN_GPIO_H__ */
diff --git a/arch/blackfin/include/asm/mach-bf506/BF504_cdef.h b/arch/blackfin/include/asm/mach-bf506/BF504_cdef.h
new file mode 100644 (file)
index 0000000..27864e5
--- /dev/null
@@ -0,0 +1,1782 @@
+/* DO NOT EDIT THIS FILE
+ * Automatically generated by generate-cdef-headers.xsl
+ * DO NOT EDIT THIS FILE
+ */
+
+#ifndef __BFIN_CDEF_ADSP_BF504_proc__
+#define __BFIN_CDEF_ADSP_BF504_proc__
+
+#include "../mach-common/ADSP-EDN-core_cdef.h"
+
+#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
+#define bfin_write_PLL_CTL(val) bfin_write16(PLL_CTL, val)
+#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
+#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
+#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
+#define bfin_write_VR_CTL(val) bfin_write16(VR_CTL, val)
+#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
+#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
+#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
+#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT, val)
+#define bfin_read_CHIPID() bfin_read32(CHIPID)
+#define bfin_write_CHIPID(val) bfin_write32(CHIPID, val)
+#define bfin_read_SWRST() bfin_read16(SWRST)
+#define bfin_write_SWRST(val) bfin_write16(SWRST, val)
+#define bfin_read_SYSCR() bfin_read16(SYSCR)
+#define bfin_write_SYSCR(val) bfin_write16(SYSCR, val)
+#define bfin_read_SIC_RVECT() bfin_read16(SIC_RVECT)
+#define bfin_write_SIC_RVECT(val) bfin_write16(SIC_RVECT, val)
+#define bfin_read_SIC_IMASK0() bfin_read32(SIC_IMASK0)
+#define bfin_write_SIC_IMASK0(val) bfin_write32(SIC_IMASK0, val)
+#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
+#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0, val)
+#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
+#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1, val)
+#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
+#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2, val)
+#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
+#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3, val)
+#define bfin_read_SIC_ISR0() bfin_read32(SIC_ISR0)
+#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val)
+#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0)
+#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val)
+#define bfin_read_SIC_IMASK1() bfin_read32(SIC_IMASK1)
+#define bfin_write_SIC_IMASK1(val) bfin_write32(SIC_IMASK1, val)
+#define bfin_read_SIC_IAR4() bfin_read32(SIC_IAR4)
+#define bfin_write_SIC_IAR4(val) bfin_write32(SIC_IAR4, val)
+#define bfin_read_SIC_IAR5() bfin_read32(SIC_IAR5)
+#define bfin_write_SIC_IAR5(val) bfin_write32(SIC_IAR5, val)
+#define bfin_read_SIC_IAR6() bfin_read32(SIC_IAR6)
+#define bfin_write_SIC_IAR6(val) bfin_write32(SIC_IAR6, val)
+#define bfin_read_SIC_IAR7() bfin_read32(SIC_IAR7)
+#define bfin_write_SIC_IAR7(val) bfin_write32(SIC_IAR7, val)
+#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1)
+#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val)
+#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1)
+#define bfin_write_SIC_IWR1(val) bfin_write32(SIC_IWR1, val)
+#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
+#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL, val)
+#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
+#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT, val)
+#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
+#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT, val)
+#define bfin_read_UART0_DLL() bfin_read16(UART0_DLL)
+#define bfin_write_UART0_DLL(val) bfin_write16(UART0_DLL, val)
+#define bfin_read_UART0_DLH() bfin_read16(UART0_DLH)
+#define bfin_write_UART0_DLH(val) bfin_write16(UART0_DLH, val)
+#define bfin_read_UART0_GCTL() bfin_read16(UART0_GCTL)
+#define bfin_write_UART0_GCTL(val) bfin_write16(UART0_GCTL, val)
+#define bfin_read_UART0_LCR() bfin_read16(UART0_LCR)
+#define bfin_write_UART0_LCR(val) bfin_write16(UART0_LCR, val)
+#define bfin_read_UART0_MCR() bfin_read16(UART0_MCR)
+#define bfin_write_UART0_MCR(val) bfin_write16(UART0_MCR, val)
+#define bfin_read_UART0_LSR() bfin_read16(UART0_LSR)
+#define bfin_write_UART0_LSR(val) bfin_write16(UART0_LSR, val)
+#define bfin_read_UART0_MSR() bfin_read16(UART0_MSR)
+#define bfin_write_UART0_MSR(val) bfin_write16(UART0_MSR, val)
+#define bfin_read_UART0_SCR() bfin_read16(UART0_SCR)
+#define bfin_write_UART0_SCR(val) bfin_write16(UART0_SCR, val)
+#define bfin_read_UART0_IER_SET() bfin_read16(UART0_IER_SET)
+#define bfin_write_UART0_IER_SET(val) bfin_write16(UART0_IER_SET, val)
+#define bfin_read_UART0_IER_CLEAR() bfin_read16(UART0_IER_CLEAR)
+#define bfin_write_UART0_IER_CLEAR(val) bfin_write16(UART0_IER_CLEAR, val)
+#define bfin_read_UART0_THR() bfin_read16(UART0_THR)
+#define bfin_write_UART0_THR(val) bfin_write16(UART0_THR, val)
+#define bfin_read_UART0_RBR() bfin_read16(UART0_RBR)
+#define bfin_write_UART0_RBR(val) bfin_write16(UART0_RBR, val)
+#define bfin_read_SPI0_CTL() bfin_read16(SPI0_CTL)
+#define bfin_write_SPI0_CTL(val) bfin_write16(SPI0_CTL, val)
+#define bfin_read_SPI0_FLG() bfin_read16(SPI0_FLG)
+#define bfin_write_SPI0_FLG(val) bfin_write16(SPI0_FLG, val)
+#define bfin_read_SPI0_STAT() bfin_read16(SPI0_STAT)
+#define bfin_write_SPI0_STAT(val) bfin_write16(SPI0_STAT, val)
+#define bfin_read_SPI0_TDBR() bfin_read16(SPI0_TDBR)
+#define bfin_write_SPI0_TDBR(val) bfin_write16(SPI0_TDBR, val)
+#define bfin_read_SPI0_RDBR() bfin_read16(SPI0_RDBR)
+#define bfin_write_SPI0_RDBR(val) bfin_write16(SPI0_RDBR, val)
+#define bfin_read_SPI0_BAUD() bfin_read16(SPI0_BAUD)
+#define bfin_write_SPI0_BAUD(val) bfin_write16(SPI0_BAUD, val)
+#define bfin_read_SPI0_SHADOW() bfin_read16(SPI0_SHADOW)
+#define bfin_write_SPI0_SHADOW(val) bfin_write16(SPI0_SHADOW, val)
+#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
+#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG, val)
+#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
+#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
+#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
+#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD, val)
+#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
+#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH, val)
+#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
+#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG, val)
+#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
+#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
+#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
+#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD, val)
+#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
+#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH, val)
+#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
+#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG, val)
+#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
+#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
+#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
+#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD, val)
+#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
+#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH, val)
+#define bfin_read_TIMER3_CONFIG() bfin_read16(TIMER3_CONFIG)
+#define bfin_write_TIMER3_CONFIG(val) bfin_write16(TIMER3_CONFIG, val)
+#define bfin_read_TIMER3_COUNTER() bfin_read32(TIMER3_COUNTER)
+#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER, val)
+#define bfin_read_TIMER3_PERIOD() bfin_read32(TIMER3_PERIOD)
+#define bfin_write_TIMER3_PERIOD(val) bfin_write32(TIMER3_PERIOD, val)
+#define bfin_read_TIMER3_WIDTH() bfin_read32(TIMER3_WIDTH)
+#define bfin_write_TIMER3_WIDTH(val) bfin_write32(TIMER3_WIDTH, val)
+#define bfin_read_TIMER4_CONFIG() bfin_read16(TIMER4_CONFIG)
+#define bfin_write_TIMER4_CONFIG(val) bfin_write16(TIMER4_CONFIG, val)
+#define bfin_read_TIMER4_COUNTER() bfin_read32(TIMER4_COUNTER)
+#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER, val)
+#define bfin_read_TIMER4_PERIOD() bfin_read32(TIMER4_PERIOD)
+#define bfin_write_TIMER4_PERIOD(val) bfin_write32(TIMER4_PERIOD, val)
+#define bfin_read_TIMER4_WIDTH() bfin_read32(TIMER4_WIDTH)
+#define bfin_write_TIMER4_WIDTH(val) bfin_write32(TIMER4_WIDTH, val)
+#define bfin_read_TIMER5_CONFIG() bfin_read16(TIMER5_CONFIG)
+#define bfin_write_TIMER5_CONFIG(val) bfin_write16(TIMER5_CONFIG, val)
+#define bfin_read_TIMER5_COUNTER() bfin_read32(TIMER5_COUNTER)
+#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER, val)
+#define bfin_read_TIMER5_PERIOD() bfin_read32(TIMER5_PERIOD)
+#define bfin_write_TIMER5_PERIOD(val) bfin_write32(TIMER5_PERIOD, val)
+#define bfin_read_TIMER5_WIDTH() bfin_read32(TIMER5_WIDTH)
+#define bfin_write_TIMER5_WIDTH(val) bfin_write32(TIMER5_WIDTH, val)
+#define bfin_read_TIMER6_CONFIG() bfin_read16(TIMER6_CONFIG)
+#define bfin_write_TIMER6_CONFIG(val) bfin_write16(TIMER6_CONFIG, val)
+#define bfin_read_TIMER6_COUNTER() bfin_read32(TIMER6_COUNTER)
+#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER, val)
+#define bfin_read_TIMER6_PERIOD() bfin_read32(TIMER6_PERIOD)
+#define bfin_write_TIMER6_PERIOD(val) bfin_write32(TIMER6_PERIOD, val)
+#define bfin_read_TIMER6_WIDTH() bfin_read32(TIMER6_WIDTH)
+#define bfin_write_TIMER6_WIDTH(val) bfin_write32(TIMER6_WIDTH, val)
+#define bfin_read_TIMER7_CONFIG() bfin_read16(TIMER7_CONFIG)
+#define bfin_write_TIMER7_CONFIG(val) bfin_write16(TIMER7_CONFIG, val)
+#define bfin_read_TIMER7_COUNTER() bfin_read32(TIMER7_COUNTER)
+#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER, val)
+#define bfin_read_TIMER7_PERIOD() bfin_read32(TIMER7_PERIOD)
+#define bfin_write_TIMER7_PERIOD(val) bfin_write32(TIMER7_PERIOD, val)
+#define bfin_read_TIMER7_WIDTH() bfin_read32(TIMER7_WIDTH)
+#define bfin_write_TIMER7_WIDTH(val) bfin_write32(TIMER7_WIDTH, val)
+#define bfin_read_TIMER_ENABLE() bfin_read16(TIMER_ENABLE)
+#define bfin_write_TIMER_ENABLE(val) bfin_write16(TIMER_ENABLE, val)
+#define bfin_read_TIMER_DISABLE() bfin_read16(TIMER_DISABLE)
+#define bfin_write_TIMER_DISABLE(val) bfin_write16(TIMER_DISABLE, val)
+#define bfin_read_TIMER_STATUS() bfin_read32(TIMER_STATUS)
+#define bfin_write_TIMER_STATUS(val) bfin_write32(TIMER_STATUS, val)
+#define bfin_read_PORTFIO() bfin_read16(PORTFIO)
+#define bfin_write_PORTFIO(val) bfin_write16(PORTFIO, val)
+#define bfin_read_PORTFIO_CLEAR() bfin_read16(PORTFIO_CLEAR)
+#define bfin_write_PORTFIO_CLEAR(val) bfin_write16(PORTFIO_CLEAR, val)
+#define bfin_read_PORTFIO_SET() bfin_read16(PORTFIO_SET)
+#define bfin_write_PORTFIO_SET(val) bfin_write16(PORTFIO_SET, val)
+#define bfin_read_PORTFIO_TOGGLE() bfin_read16(PORTFIO_TOGGLE)
+#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE, val)
+#define bfin_read_PORTFIO_MASKA() bfin_read16(PORTFIO_MASKA)
+#define bfin_write_PORTFIO_MASKA(val) bfin_write16(PORTFIO_MASKA, val)
+#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
+#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR, val)
+#define bfin_read_PORTFIO_MASKA_SET() bfin_read16(PORTFIO_MASKA_SET)
+#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET, val)
+#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
+#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE, val)
+#define bfin_read_PORTFIO_MASKB() bfin_read16(PORTFIO_MASKB)
+#define bfin_write_PORTFIO_MASKB(val) bfin_write16(PORTFIO_MASKB, val)
+#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
+#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR, val)
+#define bfin_read_PORTFIO_MASKB_SET() bfin_read16(PORTFIO_MASKB_SET)
+#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET, val)
+#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
+#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE, val)
+#define bfin_read_PORTFIO_DIR() bfin_read16(PORTFIO_DIR)
+#define bfin_write_PORTFIO_DIR(val) bfin_write16(PORTFIO_DIR, val)
+#define bfin_read_PORTFIO_POLAR() bfin_read16(PORTFIO_POLAR)
+#define bfin_write_PORTFIO_POLAR(val) bfin_write16(PORTFIO_POLAR, val)
+#define bfin_read_PORTFIO_EDGE() bfin_read16(PORTFIO_EDGE)
+#define bfin_write_PORTFIO_EDGE(val) bfin_write16(PORTFIO_EDGE, val)
+#define bfin_read_PORTFIO_BOTH() bfin_read16(PORTFIO_BOTH)
+#define bfin_write_PORTFIO_BOTH(val) bfin_write16(PORTFIO_BOTH, val)
+#define bfin_read_PORTFIO_INEN() bfin_read16(PORTFIO_INEN)
+#define bfin_write_PORTFIO_INEN(val) bfin_write16(PORTFIO_INEN, val)
+#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
+#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1, val)
+#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
+#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2, val)
+#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
+#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
+#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
+#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV, val)
+#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX, val)
+#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
+#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX, val)
+#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
+#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1, val)
+#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
+#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2, val)
+#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
+#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
+#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
+#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV, val)
+#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
+#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT, val)
+#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
+#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL, val)
+#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
+#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1, val)
+#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
+#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2, val)
+#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
+#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0, val)
+#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
+#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1, val)
+#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
+#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2, val)
+#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
+#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3, val)
+#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
+#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0, val)
+#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
+#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1, val)
+#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
+#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2, val)
+#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
+#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3, val)
+#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
+#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1, val)
+#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
+#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2, val)
+#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
+#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
+#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
+#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV, val)
+#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX, val)
+#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
+#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX, val)
+#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
+#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1, val)
+#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
+#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2, val)
+#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
+#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
+#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
+#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV, val)
+#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
+#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT, val)
+#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
+#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL, val)
+#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
+#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1, val)
+#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
+#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2, val)
+#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
+#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0, val)
+#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
+#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1, val)
+#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
+#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2, val)
+#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
+#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3, val)
+#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
+#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0, val)
+#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
+#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1, val)
+#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
+#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2, val)
+#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
+#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3, val)
+#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
+#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL, val)
+#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
+#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0, val)
+#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
+#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1, val)
+#define bfin_read_EBIU_MODE() bfin_read16(EBIU_MODE)
+#define bfin_write_EBIU_MODE(val) bfin_write16(EBIU_MODE, val)
+#define bfin_read_EBIU_FCTL() bfin_read16(EBIU_FCTL)
+#define bfin_write_EBIU_FCTL(val) bfin_write16(EBIU_FCTL, val)
+#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_readPTR(DMA0_NEXT_DESC_PTR)
+#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_writePTR(DMA0_NEXT_DESC_PTR, val)
+#define bfin_read_DMA0_START_ADDR() bfin_readPTR(DMA0_START_ADDR)
+#define bfin_write_DMA0_START_ADDR(val) bfin_writePTR(DMA0_START_ADDR, val)
+#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
+#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG, val)
+#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
+#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT, val)
+#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
+#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY, val)
+#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
+#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT, val)
+#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
+#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY, val)
+#define bfin_read_DMA0_CURR_DESC_PTR() bfin_readPTR(DMA0_CURR_DESC_PTR)
+#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_writePTR(DMA0_CURR_DESC_PTR, val)
+#define bfin_read_DMA0_CURR_ADDR() bfin_readPTR(DMA0_CURR_ADDR)
+#define bfin_write_DMA0_CURR_ADDR(val) bfin_writePTR(DMA0_CURR_ADDR, val)
+#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
+#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
+#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
+#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
+#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
+#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
+#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
+#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
+#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_readPTR(DMA1_NEXT_DESC_PTR)
+#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_writePTR(DMA1_NEXT_DESC_PTR, val)
+#define bfin_read_DMA1_START_ADDR() bfin_readPTR(DMA1_START_ADDR)
+#define bfin_write_DMA1_START_ADDR(val) bfin_writePTR(DMA1_START_ADDR, val)
+#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
+#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG, val)
+#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
+#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT, val)
+#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
+#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY, val)
+#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
+#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT, val)
+#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
+#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY, val)
+#define bfin_read_DMA1_CURR_DESC_PTR() bfin_readPTR(DMA1_CURR_DESC_PTR)
+#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_writePTR(DMA1_CURR_DESC_PTR, val)
+#define bfin_read_DMA1_CURR_ADDR() bfin_readPTR(DMA1_CURR_ADDR)
+#define bfin_write_DMA1_CURR_ADDR(val) bfin_writePTR(DMA1_CURR_ADDR, val)
+#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
+#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
+#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
+#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
+#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
+#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
+#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
+#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
+#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_readPTR(DMA2_NEXT_DESC_PTR)
+#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_writePTR(DMA2_NEXT_DESC_PTR, val)
+#define bfin_read_DMA2_START_ADDR() bfin_readPTR(DMA2_START_ADDR)
+#define bfin_write_DMA2_START_ADDR(val) bfin_writePTR(DMA2_START_ADDR, val)
+#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
+#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG, val)
+#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
+#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT, val)
+#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
+#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY, val)
+#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
+#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT, val)
+#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
+#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY, val)
+#define bfin_read_DMA2_CURR_DESC_PTR() bfin_readPTR(DMA2_CURR_DESC_PTR)
+#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_writePTR(DMA2_CURR_DESC_PTR, val)
+#define bfin_read_DMA2_CURR_ADDR() bfin_readPTR(DMA2_CURR_ADDR)
+#define bfin_write_DMA2_CURR_ADDR(val) bfin_writePTR(DMA2_CURR_ADDR, val)
+#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
+#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
+#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
+#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
+#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
+#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
+#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
+#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
+#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_readPTR(DMA3_NEXT_DESC_PTR)
+#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_writePTR(DMA3_NEXT_DESC_PTR, val)
+#define bfin_read_DMA3_START_ADDR() bfin_readPTR(DMA3_START_ADDR)
+#define bfin_write_DMA3_START_ADDR(val) bfin_writePTR(DMA3_START_ADDR, val)
+#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
+#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG, val)
+#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
+#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT, val)
+#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
+#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY, val)
+#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
+#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT, val)
+#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
+#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY, val)
+#define bfin_read_DMA3_CURR_DESC_PTR() bfin_readPTR(DMA3_CURR_DESC_PTR)
+#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_writePTR(DMA3_CURR_DESC_PTR, val)
+#define bfin_read_DMA3_CURR_ADDR() bfin_readPTR(DMA3_CURR_ADDR)
+#define bfin_write_DMA3_CURR_ADDR(val) bfin_writePTR(DMA3_CURR_ADDR, val)
+#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
+#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
+#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
+#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
+#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
+#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
+#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
+#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
+#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_readPTR(DMA4_NEXT_DESC_PTR)
+#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_writePTR(DMA4_NEXT_DESC_PTR, val)
+#define bfin_read_DMA4_START_ADDR() bfin_readPTR(DMA4_START_ADDR)
+#define bfin_write_DMA4_START_ADDR(val) bfin_writePTR(DMA4_START_ADDR, val)
+#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
+#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG, val)
+#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
+#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT, val)
+#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
+#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY, val)
+#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
+#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT, val)
+#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
+#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY, val)
+#define bfin_read_DMA4_CURR_DESC_PTR() bfin_readPTR(DMA4_CURR_DESC_PTR)
+#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_writePTR(DMA4_CURR_DESC_PTR, val)
+#define bfin_read_DMA4_CURR_ADDR() bfin_readPTR(DMA4_CURR_ADDR)
+#define bfin_write_DMA4_CURR_ADDR(val) bfin_writePTR(DMA4_CURR_ADDR, val)
+#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
+#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
+#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
+#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
+#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
+#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
+#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
+#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
+#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_readPTR(DMA5_NEXT_DESC_PTR)
+#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_writePTR(DMA5_NEXT_DESC_PTR, val)
+#define bfin_read_DMA5_START_ADDR() bfin_readPTR(DMA5_START_ADDR)
+#define bfin_write_DMA5_START_ADDR(val) bfin_writePTR(DMA5_START_ADDR, val)
+#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
+#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG, val)
+#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
+#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT, val)
+#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
+#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY, val)
+#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
+#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT, val)
+#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
+#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY, val)
+#define bfin_read_DMA5_CURR_DESC_PTR() bfin_readPTR(DMA5_CURR_DESC_PTR)
+#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_writePTR(DMA5_CURR_DESC_PTR, val)
+#define bfin_read_DMA5_CURR_ADDR() bfin_readPTR(DMA5_CURR_ADDR)
+#define bfin_write_DMA5_CURR_ADDR(val) bfin_writePTR(DMA5_CURR_ADDR, val)
+#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
+#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
+#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
+#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
+#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
+#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
+#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
+#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
+#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
+#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR, val)
+#define bfin_read_DMA6_START_ADDR() bfin_readPTR(DMA6_START_ADDR)
+#define bfin_write_DMA6_START_ADDR(val) bfin_writePTR(DMA6_START_ADDR, val)
+#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
+#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG, val)
+#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
+#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT, val)
+#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
+#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY, val)
+#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
+#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT, val)
+#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
+#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY, val)
+#define bfin_read_DMA6_CURR_DESC_PTR() bfin_readPTR(DMA6_CURR_DESC_PTR)
+#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_writePTR(DMA6_CURR_DESC_PTR, val)
+#define bfin_read_DMA6_CURR_ADDR() bfin_readPTR(DMA6_CURR_ADDR)
+#define bfin_write_DMA6_CURR_ADDR(val) bfin_writePTR(DMA6_CURR_ADDR, val)
+#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
+#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
+#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
+#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
+#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
+#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
+#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
+#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
+#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_readPTR(DMA7_NEXT_DESC_PTR)
+#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_writePTR(DMA7_NEXT_DESC_PTR, val)
+#define bfin_read_DMA7_START_ADDR() bfin_readPTR(DMA7_START_ADDR)
+#define bfin_write_DMA7_START_ADDR(val) bfin_writePTR(DMA7_START_ADDR, val)
+#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
+#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG, val)
+#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
+#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT, val)
+#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
+#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY, val)
+#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
+#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT, val)
+#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
+#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY, val)
+#define bfin_read_DMA7_CURR_DESC_PTR() bfin_readPTR(DMA7_CURR_DESC_PTR)
+#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_writePTR(DMA7_CURR_DESC_PTR, val)
+#define bfin_read_DMA7_CURR_ADDR() bfin_readPTR(DMA7_CURR_ADDR)
+#define bfin_write_DMA7_CURR_ADDR(val) bfin_writePTR(DMA7_CURR_ADDR, val)
+#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
+#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
+#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
+#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
+#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
+#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
+#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
+#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
+#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_readPTR(DMA8_NEXT_DESC_PTR)
+#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_writePTR(DMA8_NEXT_DESC_PTR, val)
+#define bfin_read_DMA8_START_ADDR() bfin_readPTR(DMA8_START_ADDR)
+#define bfin_write_DMA8_START_ADDR(val) bfin_writePTR(DMA8_START_ADDR, val)
+#define bfin_read_DMA8_CONFIG() bfin_read16(DMA8_CONFIG)
+#define bfin_write_DMA8_CONFIG(val) bfin_write16(DMA8_CONFIG, val)
+#define bfin_read_DMA8_X_COUNT() bfin_read16(DMA8_X_COUNT)
+#define bfin_write_DMA8_X_COUNT(val) bfin_write16(DMA8_X_COUNT, val)
+#define bfin_read_DMA8_X_MODIFY() bfin_read16(DMA8_X_MODIFY)
+#define bfin_write_DMA8_X_MODIFY(val) bfin_write16(DMA8_X_MODIFY, val)
+#define bfin_read_DMA8_Y_COUNT() bfin_read16(DMA8_Y_COUNT)
+#define bfin_write_DMA8_Y_COUNT(val) bfin_write16(DMA8_Y_COUNT, val)
+#define bfin_read_DMA8_Y_MODIFY() bfin_read16(DMA8_Y_MODIFY)
+#define bfin_write_DMA8_Y_MODIFY(val) bfin_write16(DMA8_Y_MODIFY, val)
+#define bfin_read_DMA8_CURR_DESC_PTR() bfin_readPTR(DMA8_CURR_DESC_PTR)
+#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_writePTR(DMA8_CURR_DESC_PTR, val)
+#define bfin_read_DMA8_CURR_ADDR() bfin_readPTR(DMA8_CURR_ADDR)
+#define bfin_write_DMA8_CURR_ADDR(val) bfin_writePTR(DMA8_CURR_ADDR, val)
+#define bfin_read_DMA8_IRQ_STATUS() bfin_read16(DMA8_IRQ_STATUS)
+#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
+#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
+#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
+#define bfin_read_DMA8_CURR_X_COUNT() bfin_read16(DMA8_CURR_X_COUNT)
+#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
+#define bfin_read_DMA8_CURR_Y_COUNT() bfin_read16(DMA8_CURR_Y_COUNT)
+#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
+#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_readPTR(DMA9_NEXT_DESC_PTR)
+#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_writePTR(DMA9_NEXT_DESC_PTR, val)
+#define bfin_read_DMA9_START_ADDR() bfin_readPTR(DMA9_START_ADDR)
+#define bfin_write_DMA9_START_ADDR(val) bfin_writePTR(DMA9_START_ADDR, val)
+#define bfin_read_DMA9_CONFIG() bfin_read16(DMA9_CONFIG)
+#define bfin_write_DMA9_CONFIG(val) bfin_write16(DMA9_CONFIG, val)
+#define bfin_read_DMA9_X_COUNT() bfin_read16(DMA9_X_COUNT)
+#define bfin_write_DMA9_X_COUNT(val) bfin_write16(DMA9_X_COUNT, val)
+#define bfin_read_DMA9_X_MODIFY() bfin_read16(DMA9_X_MODIFY)
+#define bfin_write_DMA9_X_MODIFY(val) bfin_write16(DMA9_X_MODIFY, val)
+#define bfin_read_DMA9_Y_COUNT() bfin_read16(DMA9_Y_COUNT)
+#define bfin_write_DMA9_Y_COUNT(val) bfin_write16(DMA9_Y_COUNT, val)
+#define bfin_read_DMA9_Y_MODIFY() bfin_read16(DMA9_Y_MODIFY)
+#define bfin_write_DMA9_Y_MODIFY(val) bfin_write16(DMA9_Y_MODIFY, val)
+#define bfin_read_DMA9_CURR_DESC_PTR() bfin_readPTR(DMA9_CURR_DESC_PTR)
+#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_writePTR(DMA9_CURR_DESC_PTR, val)
+#define bfin_read_DMA9_CURR_ADDR() bfin_readPTR(DMA9_CURR_ADDR)
+#define bfin_write_DMA9_CURR_ADDR(val) bfin_writePTR(DMA9_CURR_ADDR, val)
+#define bfin_read_DMA9_IRQ_STATUS() bfin_read16(DMA9_IRQ_STATUS)
+#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
+#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
+#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
+#define bfin_read_DMA9_CURR_X_COUNT() bfin_read16(DMA9_CURR_X_COUNT)
+#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
+#define bfin_read_DMA9_CURR_Y_COUNT() bfin_read16(DMA9_CURR_Y_COUNT)
+#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
+#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_readPTR(DMA10_NEXT_DESC_PTR)
+#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_writePTR(DMA10_NEXT_DESC_PTR, val)
+#define bfin_read_DMA10_START_ADDR() bfin_readPTR(DMA10_START_ADDR)
+#define bfin_write_DMA10_START_ADDR(val) bfin_writePTR(DMA10_START_ADDR, val)
+#define bfin_read_DMA10_CONFIG() bfin_read16(DMA10_CONFIG)
+#define bfin_write_DMA10_CONFIG(val) bfin_write16(DMA10_CONFIG, val)
+#define bfin_read_DMA10_X_COUNT() bfin_read16(DMA10_X_COUNT)
+#define bfin_write_DMA10_X_COUNT(val) bfin_write16(DMA10_X_COUNT, val)
+#define bfin_read_DMA10_X_MODIFY() bfin_read16(DMA10_X_MODIFY)
+#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY, val)
+#define bfin_read_DMA10_Y_COUNT() bfin_read16(DMA10_Y_COUNT)
+#define bfin_write_DMA10_Y_COUNT(val) bfin_write16(DMA10_Y_COUNT, val)
+#define bfin_read_DMA10_Y_MODIFY() bfin_read16(DMA10_Y_MODIFY)
+#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY, val)
+#define bfin_read_DMA10_CURR_DESC_PTR() bfin_readPTR(DMA10_CURR_DESC_PTR)
+#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_writePTR(DMA10_CURR_DESC_PTR, val)
+#define bfin_read_DMA10_CURR_ADDR() bfin_readPTR(DMA10_CURR_ADDR)
+#define bfin_write_DMA10_CURR_ADDR(val) bfin_writePTR(DMA10_CURR_ADDR, val)
+#define bfin_read_DMA10_IRQ_STATUS() bfin_read16(DMA10_IRQ_STATUS)
+#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
+#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
+#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
+#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
+#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
+#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
+#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
+#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_readPTR(DMA11_NEXT_DESC_PTR)
+#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_writePTR(DMA11_NEXT_DESC_PTR, val)
+#define bfin_read_DMA11_START_ADDR() bfin_readPTR(DMA11_START_ADDR)
+#define bfin_write_DMA11_START_ADDR(val) bfin_writePTR(DMA11_START_ADDR, val)
+#define bfin_read_DMA11_CONFIG() bfin_read16(DMA11_CONFIG)
+#define bfin_write_DMA11_CONFIG(val) bfin_write16(DMA11_CONFIG, val)
+#define bfin_read_DMA11_X_COUNT() bfin_read16(DMA11_X_COUNT)
+#define bfin_write_DMA11_X_COUNT(val) bfin_write16(DMA11_X_COUNT, val)
+#define bfin_read_DMA11_X_MODIFY() bfin_read16(DMA11_X_MODIFY)
+#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY, val)
+#define bfin_read_DMA11_Y_COUNT() bfin_read16(DMA11_Y_COUNT)
+#define bfin_write_DMA11_Y_COUNT(val) bfin_write16(DMA11_Y_COUNT, val)
+#define bfin_read_DMA11_Y_MODIFY() bfin_read16(DMA11_Y_MODIFY)
+#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY, val)
+#define bfin_read_DMA11_CURR_DESC_PTR() bfin_readPTR(DMA11_CURR_DESC_PTR)
+#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_writePTR(DMA11_CURR_DESC_PTR, val)
+#define bfin_read_DMA11_CURR_ADDR() bfin_readPTR(DMA11_CURR_ADDR)
+#define bfin_write_DMA11_CURR_ADDR(val) bfin_writePTR(DMA11_CURR_ADDR, val)
+#define bfin_read_DMA11_IRQ_STATUS() bfin_read16(DMA11_IRQ_STATUS)
+#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
+#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
+#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
+#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
+#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
+#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
+#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_readPTR(MDMA_S0_NEXT_DESC_PTR)
+#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_S0_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_S0_START_ADDR() bfin_readPTR(MDMA_S0_START_ADDR)
+#define bfin_write_MDMA_S0_START_ADDR(val) bfin_writePTR(MDMA_S0_START_ADDR, val)
+#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
+#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
+#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
+#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
+#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
+#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY, val)
+#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
+#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
+#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
+#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY, val)
+#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_readPTR(MDMA_S0_CURR_DESC_PTR)
+#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_writePTR(MDMA_S0_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_S0_CURR_ADDR() bfin_readPTR(MDMA_S0_CURR_ADDR)
+#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_writePTR(MDMA_S0_CURR_ADDR, val)
+#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
+#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val)
+#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
+#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
+#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT, val)
+#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
+#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_readPTR(MDMA_D0_NEXT_DESC_PTR)
+#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_D0_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_D0_START_ADDR() bfin_readPTR(MDMA_D0_START_ADDR)
+#define bfin_write_MDMA_D0_START_ADDR(val) bfin_writePTR(MDMA_D0_START_ADDR, val)
+#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
+#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
+#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
+#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
+#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
+#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY, val)
+#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
+#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
+#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
+#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY, val)
+#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_readPTR(MDMA_D0_CURR_DESC_PTR)
+#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_writePTR(MDMA_D0_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_D0_CURR_ADDR() bfin_readPTR(MDMA_D0_CURR_ADDR)
+#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_writePTR(MDMA_D0_CURR_ADDR, val)
+#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
+#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
+#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
+#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
+#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT, val)
+#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
+#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_readPTR(MDMA_S1_NEXT_DESC_PTR)
+#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_S1_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_S1_START_ADDR() bfin_readPTR(MDMA_S1_START_ADDR)
+#define bfin_write_MDMA_S1_START_ADDR(val) bfin_writePTR(MDMA_S1_START_ADDR, val)
+#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
+#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
+#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
+#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT, val)
+#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
+#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY, val)
+#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
+#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT, val)
+#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
+#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY, val)
+#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_readPTR(MDMA_S1_CURR_DESC_PTR)
+#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_writePTR(MDMA_S1_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_S1_CURR_ADDR() bfin_readPTR(MDMA_S1_CURR_ADDR)
+#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_writePTR(MDMA_S1_CURR_ADDR, val)
+#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
+#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
+#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
+#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
+#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT, val)
+#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
+#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_readPTR(MDMA_D1_NEXT_DESC_PTR)
+#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_D1_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_D1_START_ADDR() bfin_readPTR(MDMA_D1_START_ADDR)
+#define bfin_write_MDMA_D1_START_ADDR(val) bfin_writePTR(MDMA_D1_START_ADDR, val)
+#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
+#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
+#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
+#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT, val)
+#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
+#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY, val)
+#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
+#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT, val)
+#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
+#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY, val)
+#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_readPTR(MDMA_D1_CURR_DESC_PTR)
+#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_writePTR(MDMA_D1_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_D1_CURR_ADDR() bfin_readPTR(MDMA_D1_CURR_ADDR)
+#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_writePTR(MDMA_D1_CURR_ADDR, val)
+#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
+#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
+#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
+#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
+#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT, val)
+#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
+#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
+#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
+#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL, val)
+#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
+#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS, val)
+#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
+#define bfin_write_PPI_COUNT(val) bfin_write16(PPI_COUNT, val)
+#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
+#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY, val)
+#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
+#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME, val)
+#define bfin_read_TWI_CLKDIV() bfin_read16(TWI_CLKDIV)
+#define bfin_write_TWI_CLKDIV(val) bfin_write16(TWI_CLKDIV, val)
+#define bfin_read_TWI_CONTROL() bfin_read16(TWI_CONTROL)
+#define bfin_write_TWI_CONTROL(val) bfin_write16(TWI_CONTROL, val)
+#define bfin_read_TWI_SLAVE_CTL() bfin_read16(TWI_SLAVE_CTL)
+#define bfin_write_TWI_SLAVE_CTL(val) bfin_write16(TWI_SLAVE_CTL, val)
+#define bfin_read_TWI_SLAVE_STAT() bfin_read16(TWI_SLAVE_STAT)
+#define bfin_write_TWI_SLAVE_STAT(val) bfin_write16(TWI_SLAVE_STAT, val)
+#define bfin_read_TWI_SLAVE_ADDR() bfin_read16(TWI_SLAVE_ADDR)
+#define bfin_write_TWI_SLAVE_ADDR(val) bfin_write16(TWI_SLAVE_ADDR, val)
+#define bfin_read_TWI_MASTER_CTL() bfin_read16(TWI_MASTER_CTL)
+#define bfin_write_TWI_MASTER_CTL(val) bfin_write16(TWI_MASTER_CTL, val)
+#define bfin_read_TWI_MASTER_STAT() bfin_read16(TWI_MASTER_STAT)
+#define bfin_write_TWI_MASTER_STAT(val) bfin_write16(TWI_MASTER_STAT, val)
+#define bfin_read_TWI_MASTER_ADDR() bfin_read16(TWI_MASTER_ADDR)
+#define bfin_write_TWI_MASTER_ADDR(val) bfin_write16(TWI_MASTER_ADDR, val)
+#define bfin_read_TWI_INT_STAT() bfin_read16(TWI_INT_STAT)
+#define bfin_write_TWI_INT_STAT(val) bfin_write16(TWI_INT_STAT, val)
+#define bfin_read_TWI_INT_MASK() bfin_read16(TWI_INT_MASK)
+#define bfin_write_TWI_INT_MASK(val) bfin_write16(TWI_INT_MASK, val)
+#define bfin_read_TWI_FIFO_CTL() bfin_read16(TWI_FIFO_CTL)
+#define bfin_write_TWI_FIFO_CTL(val) bfin_write16(TWI_FIFO_CTL, val)
+#define bfin_read_TWI_FIFO_STAT() bfin_read16(TWI_FIFO_STAT)
+#define bfin_write_TWI_FIFO_STAT(val) bfin_write16(TWI_FIFO_STAT, val)
+#define bfin_read_TWI_XMT_DATA8() bfin_read16(TWI_XMT_DATA8)
+#define bfin_write_TWI_XMT_DATA8(val) bfin_write16(TWI_XMT_DATA8, val)
+#define bfin_read_TWI_XMT_DATA16() bfin_read16(TWI_XMT_DATA16)
+#define bfin_write_TWI_XMT_DATA16(val) bfin_write16(TWI_XMT_DATA16, val)
+#define bfin_read_TWI_RCV_DATA8() bfin_read16(TWI_RCV_DATA8)
+#define bfin_write_TWI_RCV_DATA8(val) bfin_write16(TWI_RCV_DATA8, val)
+#define bfin_read_TWI_RCV_DATA16() bfin_read16(TWI_RCV_DATA16)
+#define bfin_write_TWI_RCV_DATA16(val) bfin_write16(TWI_RCV_DATA16, val)
+#define bfin_read_PORTGIO() bfin_read16(PORTGIO)
+#define bfin_write_PORTGIO(val) bfin_write16(PORTGIO, val)
+#define bfin_read_PORTGIO_CLEAR() bfin_read16(PORTGIO_CLEAR)
+#define bfin_write_PORTGIO_CLEAR(val) bfin_write16(PORTGIO_CLEAR, val)
+#define bfin_read_PORTGIO_SET() bfin_read16(PORTGIO_SET)
+#define bfin_write_PORTGIO_SET(val) bfin_write16(PORTGIO_SET, val)
+#define bfin_read_PORTGIO_TOGGLE() bfin_read16(PORTGIO_TOGGLE)
+#define bfin_write_PORTGIO_TOGGLE(val) bfin_write16(PORTGIO_TOGGLE, val)
+#define bfin_read_PORTGIO_MASKA() bfin_read16(PORTGIO_MASKA)
+#define bfin_write_PORTGIO_MASKA(val) bfin_write16(PORTGIO_MASKA, val)
+#define bfin_read_PORTGIO_MASKA_CLEAR() bfin_read16(PORTGIO_MASKA_CLEAR)
+#define bfin_write_PORTGIO_MASKA_CLEAR(val) bfin_write16(PORTGIO_MASKA_CLEAR, val)
+#define bfin_read_PORTGIO_MASKA_SET() bfin_read16(PORTGIO_MASKA_SET)
+#define bfin_write_PORTGIO_MASKA_SET(val) bfin_write16(PORTGIO_MASKA_SET, val)
+#define bfin_read_PORTGIO_MASKA_TOGGLE() bfin_read16(PORTGIO_MASKA_TOGGLE)
+#define bfin_write_PORTGIO_MASKA_TOGGLE(val) bfin_write16(PORTGIO_MASKA_TOGGLE, val)
+#define bfin_read_PORTGIO_MASKB() bfin_read16(PORTGIO_MASKB)
+#define bfin_write_PORTGIO_MASKB(val) bfin_write16(PORTGIO_MASKB, val)
+#define bfin_read_PORTGIO_MASKB_CLEAR() bfin_read16(PORTGIO_MASKB_CLEAR)
+#define bfin_write_PORTGIO_MASKB_CLEAR(val) bfin_write16(PORTGIO_MASKB_CLEAR, val)
+#define bfin_read_PORTGIO_MASKB_SET() bfin_read16(PORTGIO_MASKB_SET)
+#define bfin_write_PORTGIO_MASKB_SET(val) bfin_write16(PORTGIO_MASKB_SET, val)
+#define bfin_read_PORTGIO_MASKB_TOGGLE() bfin_read16(PORTGIO_MASKB_TOGGLE)
+#define bfin_write_PORTGIO_MASKB_TOGGLE(val) bfin_write16(PORTGIO_MASKB_TOGGLE, val)
+#define bfin_read_PORTGIO_DIR() bfin_read16(PORTGIO_DIR)
+#define bfin_write_PORTGIO_DIR(val) bfin_write16(PORTGIO_DIR, val)
+#define bfin_read_PORTGIO_POLAR() bfin_read16(PORTGIO_POLAR)
+#define bfin_write_PORTGIO_POLAR(val) bfin_write16(PORTGIO_POLAR, val)
+#define bfin_read_PORTGIO_EDGE() bfin_read16(PORTGIO_EDGE)
+#define bfin_write_PORTGIO_EDGE(val) bfin_write16(PORTGIO_EDGE, val)
+#define bfin_read_PORTGIO_BOTH() bfin_read16(PORTGIO_BOTH)
+#define bfin_write_PORTGIO_BOTH(val) bfin_write16(PORTGIO_BOTH, val)
+#define bfin_read_PORTGIO_INEN() bfin_read16(PORTGIO_INEN)
+#define bfin_write_PORTGIO_INEN(val) bfin_write16(PORTGIO_INEN, val)
+#define bfin_read_PORTHIO() bfin_read16(PORTHIO)
+#define bfin_write_PORTHIO(val) bfin_write16(PORTHIO, val)
+#define bfin_read_PORTHIO_CLEAR() bfin_read16(PORTHIO_CLEAR)
+#define bfin_write_PORTHIO_CLEAR(val) bfin_write16(PORTHIO_CLEAR, val)
+#define bfin_read_PORTHIO_SET() bfin_read16(PORTHIO_SET)
+#define bfin_write_PORTHIO_SET(val) bfin_write16(PORTHIO_SET, val)
+#define bfin_read_PORTHIO_TOGGLE() bfin_read16(PORTHIO_TOGGLE)
+#define bfin_write_PORTHIO_TOGGLE(val) bfin_write16(PORTHIO_TOGGLE, val)
+#define bfin_read_PORTHIO_MASKA() bfin_read16(PORTHIO_MASKA)
+#define bfin_write_PORTHIO_MASKA(val) bfin_write16(PORTHIO_MASKA, val)
+#define bfin_read_PORTHIO_MASKA_CLEAR() bfin_read16(PORTHIO_MASKA_CLEAR)
+#define bfin_write_PORTHIO_MASKA_CLEAR(val) bfin_write16(PORTHIO_MASKA_CLEAR, val)
+#define bfin_read_PORTHIO_MASKA_SET() bfin_read16(PORTHIO_MASKA_SET)
+#define bfin_write_PORTHIO_MASKA_SET(val) bfin_write16(PORTHIO_MASKA_SET, val)
+#define bfin_read_PORTHIO_MASKA_TOGGLE() bfin_read16(PORTHIO_MASKA_TOGGLE)
+#define bfin_write_PORTHIO_MASKA_TOGGLE(val) bfin_write16(PORTHIO_MASKA_TOGGLE, val)
+#define bfin_read_PORTHIO_MASKB() bfin_read16(PORTHIO_MASKB)
+#define bfin_write_PORTHIO_MASKB(val) bfin_write16(PORTHIO_MASKB, val)
+#define bfin_read_PORTHIO_MASKB_CLEAR() bfin_read16(PORTHIO_MASKB_CLEAR)
+#define bfin_write_PORTHIO_MASKB_CLEAR(val) bfin_write16(PORTHIO_MASKB_CLEAR, val)
+#define bfin_read_PORTHIO_MASKB_SET() bfin_read16(PORTHIO_MASKB_SET)
+#define bfin_write_PORTHIO_MASKB_SET(val) bfin_write16(PORTHIO_MASKB_SET, val)
+#define bfin_read_PORTHIO_MASKB_TOGGLE() bfin_read16(PORTHIO_MASKB_TOGGLE)
+#define bfin_write_PORTHIO_MASKB_TOGGLE(val) bfin_write16(PORTHIO_MASKB_TOGGLE, val)
+#define bfin_read_PORTHIO_DIR() bfin_read16(PORTHIO_DIR)
+#define bfin_write_PORTHIO_DIR(val) bfin_write16(PORTHIO_DIR, val)
+#define bfin_read_PORTHIO_POLAR() bfin_read16(PORTHIO_POLAR)
+#define bfin_write_PORTHIO_POLAR(val) bfin_write16(PORTHIO_POLAR, val)
+#define bfin_read_PORTHIO_EDGE() bfin_read16(PORTHIO_EDGE)
+#define bfin_write_PORTHIO_EDGE(val) bfin_write16(PORTHIO_EDGE, val)
+#define bfin_read_PORTHIO_BOTH() bfin_read16(PORTHIO_BOTH)
+#define bfin_write_PORTHIO_BOTH(val) bfin_write16(PORTHIO_BOTH, val)
+#define bfin_read_PORTHIO_INEN() bfin_read16(PORTHIO_INEN)
+#define bfin_write_PORTHIO_INEN(val) bfin_write16(PORTHIO_INEN, val)
+#define bfin_read_UART1_DLL() bfin_read16(UART1_DLL)
+#define bfin_write_UART1_DLL(val) bfin_write16(UART1_DLL, val)
+#define bfin_read_UART1_DLH() bfin_read16(UART1_DLH)
+#define bfin_write_UART1_DLH(val) bfin_write16(UART1_DLH, val)
+#define bfin_read_UART1_GCTL() bfin_read16(UART1_GCTL)
+#define bfin_write_UART1_GCTL(val) bfin_write16(UART1_GCTL, val)
+#define bfin_read_UART1_LCR() bfin_read16(UART1_LCR)
+#define bfin_write_UART1_LCR(val) bfin_write16(UART1_LCR, val)
+#define bfin_read_UART1_MCR() bfin_read16(UART1_MCR)
+#define bfin_write_UART1_MCR(val) bfin_write16(UART1_MCR, val)
+#define bfin_read_UART1_LSR() bfin_read16(UART1_LSR)
+#define bfin_write_UART1_LSR(val) bfin_write16(UART1_LSR, val)
+#define bfin_read_UART1_MSR() bfin_read16(UART1_MSR)
+#define bfin_write_UART1_MSR(val) bfin_write16(UART1_MSR, val)
+#define bfin_read_UART1_SCR() bfin_read16(UART1_SCR)
+#define bfin_write_UART1_SCR(val) bfin_write16(UART1_SCR, val)
+#define bfin_read_UART1_IER_SET() bfin_read16(UART1_IER_SET)
+#define bfin_write_UART1_IER_SET(val) bfin_write16(UART1_IER_SET, val)
+#define bfin_read_UART1_IER_CLEAR() bfin_read16(UART1_IER_CLEAR)
+#define bfin_write_UART1_IER_CLEAR(val) bfin_write16(UART1_IER_CLEAR, val)
+#define bfin_read_UART1_THR() bfin_read16(UART1_THR)
+#define bfin_write_UART1_THR(val) bfin_write16(UART1_THR, val)
+#define bfin_read_UART1_RBR() bfin_read16(UART1_RBR)
+#define bfin_write_UART1_RBR(val) bfin_write16(UART1_RBR, val)
+#define bfin_read_CAN_MC1() bfin_read16(CAN_MC1)
+#define bfin_write_CAN_MC1(val) bfin_write16(CAN_MC1, val)
+#define bfin_read_CAN_MD1() bfin_read16(CAN_MD1)
+#define bfin_write_CAN_MD1(val) bfin_write16(CAN_MD1, val)
+#define bfin_read_CAN_TRS1() bfin_read16(CAN_TRS1)
+#define bfin_write_CAN_TRS1(val) bfin_write16(CAN_TRS1, val)
+#define bfin_read_CAN_TRR1() bfin_read16(CAN_TRR1)
+#define bfin_write_CAN_TRR1(val) bfin_write16(CAN_TRR1, val)
+#define bfin_read_CAN_TA1() bfin_read16(CAN_TA1)
+#define bfin_write_CAN_TA1(val) bfin_write16(CAN_TA1, val)
+#define bfin_read_CAN_AA1() bfin_read16(CAN_AA1)
+#define bfin_write_CAN_AA1(val) bfin_write16(CAN_AA1, val)
+#define bfin_read_CAN_RMP1() bfin_read16(CAN_RMP1)
+#define bfin_write_CAN_RMP1(val) bfin_write16(CAN_RMP1, val)
+#define bfin_read_CAN_RML1() bfin_read16(CAN_RML1)
+#define bfin_write_CAN_RML1(val) bfin_write16(CAN_RML1, val)
+#define bfin_read_CAN_MBTIF1() bfin_read16(CAN_MBTIF1)
+#define bfin_write_CAN_MBTIF1(val) bfin_write16(CAN_MBTIF1, val)
+#define bfin_read_CAN_MBRIF1() bfin_read16(CAN_MBRIF1)
+#define bfin_write_CAN_MBRIF1(val) bfin_write16(CAN_MBRIF1, val)
+#define bfin_read_CAN_MBIM1() bfin_read16(CAN_MBIM1)
+#define bfin_write_CAN_MBIM1(val) bfin_write16(CAN_MBIM1, val)
+#define bfin_read_CAN_RFH1() bfin_read16(CAN_RFH1)
+#define bfin_write_CAN_RFH1(val) bfin_write16(CAN_RFH1, val)
+#define bfin_read_CAN_OPSS1() bfin_read16(CAN_OPSS1)
+#define bfin_write_CAN_OPSS1(val) bfin_write16(CAN_OPSS1, val)
+#define bfin_read_CAN_MC2() bfin_read16(CAN_MC2)
+#define bfin_write_CAN_MC2(val) bfin_write16(CAN_MC2, val)
+#define bfin_read_CAN_MD2() bfin_read16(CAN_MD2)
+#define bfin_write_CAN_MD2(val) bfin_write16(CAN_MD2, val)
+#define bfin_read_CAN_TRS2() bfin_read16(CAN_TRS2)
+#define bfin_write_CAN_TRS2(val) bfin_write16(CAN_TRS2, val)
+#define bfin_read_CAN_TRR2() bfin_read16(CAN_TRR2)
+#define bfin_write_CAN_TRR2(val) bfin_write16(CAN_TRR2, val)
+#define bfin_read_CAN_TA2() bfin_read16(CAN_TA2)
+#define bfin_write_CAN_TA2(val) bfin_write16(CAN_TA2, val)
+#define bfin_read_CAN_AA2() bfin_read16(CAN_AA2)
+#define bfin_write_CAN_AA2(val) bfin_write16(CAN_AA2, val)
+#define bfin_read_CAN_RMP2() bfin_read16(CAN_RMP2)
+#define bfin_write_CAN_RMP2(val) bfin_write16(CAN_RMP2, val)
+#define bfin_read_CAN_RML2() bfin_read16(CAN_RML2)
+#define bfin_write_CAN_RML2(val) bfin_write16(CAN_RML2, val)
+#define bfin_read_CAN_MBTIF2() bfin_read16(CAN_MBTIF2)
+#define bfin_write_CAN_MBTIF2(val) bfin_write16(CAN_MBTIF2, val)
+#define bfin_read_CAN_MBRIF2() bfin_read16(CAN_MBRIF2)
+#define bfin_write_CAN_MBRIF2(val) bfin_write16(CAN_MBRIF2, val)
+#define bfin_read_CAN_MBIM2() bfin_read16(CAN_MBIM2)
+#define bfin_write_CAN_MBIM2(val) bfin_write16(CAN_MBIM2, val)
+#define bfin_read_CAN_RFH2() bfin_read16(CAN_RFH2)
+#define bfin_write_CAN_RFH2(val) bfin_write16(CAN_RFH2, val)
+#define bfin_read_CAN_OPSS2() bfin_read16(CAN_OPSS2)
+#define bfin_write_CAN_OPSS2(val) bfin_write16(CAN_OPSS2, val)
+#define bfin_read_CAN_CLOCK() bfin_read16(CAN_CLOCK)
+#define bfin_write_CAN_CLOCK(val) bfin_write16(CAN_CLOCK, val)
+#define bfin_read_CAN_TIMING() bfin_read16(CAN_TIMING)
+#define bfin_write_CAN_TIMING(val) bfin_write16(CAN_TIMING, val)
+#define bfin_read_CAN_DEBUG() bfin_read16(CAN_DEBUG)
+#define bfin_write_CAN_DEBUG(val) bfin_write16(CAN_DEBUG, val)
+#define bfin_read_CAN_STATUS() bfin_read16(CAN_STATUS)
+#define bfin_write_CAN_STATUS(val) bfin_write16(CAN_STATUS, val)
+#define bfin_read_CAN_CEC() bfin_read16(CAN_CEC)
+#define bfin_write_CAN_CEC(val) bfin_write16(CAN_CEC, val)
+#define bfin_read_CAN_GIS() bfin_read16(CAN_GIS)
+#define bfin_write_CAN_GIS(val) bfin_write16(CAN_GIS, val)
+#define bfin_read_CAN_GIM() bfin_read16(CAN_GIM)
+#define bfin_write_CAN_GIM(val) bfin_write16(CAN_GIM, val)
+#define bfin_read_CAN_GIF() bfin_read16(CAN_GIF)
+#define bfin_write_CAN_GIF(val) bfin_write16(CAN_GIF, val)
+#define bfin_read_CAN_CONTROL() bfin_read16(CAN_CONTROL)
+#define bfin_write_CAN_CONTROL(val) bfin_write16(CAN_CONTROL, val)
+#define bfin_read_CAN_INTR() bfin_read16(CAN_INTR)
+#define bfin_write_CAN_INTR(val) bfin_write16(CAN_INTR, val)
+#define bfin_read_CAN_VERSION() bfin_read16(CAN_VERSION)
+#define bfin_write_CAN_VERSION(val) bfin_write16(CAN_VERSION, val)
+#define bfin_read_CAN_MBTD() bfin_read16(CAN_MBTD)
+#define bfin_write_CAN_MBTD(val) bfin_write16(CAN_MBTD, val)
+#define bfin_read_CAN_EWR() bfin_read16(CAN_EWR)
+#define bfin_write_CAN_EWR(val) bfin_write16(CAN_EWR, val)
+#define bfin_read_CAN_ESR() bfin_read16(CAN_ESR)
+#define bfin_write_CAN_ESR(val) bfin_write16(CAN_ESR, val)
+#define bfin_read_CAN_UCREG() bfin_read16(CAN_UCREG)
+#define bfin_write_CAN_UCREG(val) bfin_write16(CAN_UCREG, val)
+#define bfin_read_CAN_UCCNT() bfin_read16(CAN_UCCNT)
+#define bfin_write_CAN_UCCNT(val) bfin_write16(CAN_UCCNT, val)
+#define bfin_read_CAN_UCRC() bfin_read16(CAN_UCRC)
+#define bfin_write_CAN_UCRC(val) bfin_write16(CAN_UCRC, val)
+#define bfin_read_CAN_UCCNF() bfin_read16(CAN_UCCNF)
+#define bfin_write_CAN_UCCNF(val) bfin_write16(CAN_UCCNF, val)
+#define bfin_read_CAN_VERSION2() bfin_read16(CAN_VERSION2)
+#define bfin_write_CAN_VERSION2(val) bfin_write16(CAN_VERSION2, val)
+#define bfin_read_CAN_AM00L() bfin_read16(CAN_AM00L)
+#define bfin_write_CAN_AM00L(val) bfin_write16(CAN_AM00L, val)
+#define bfin_read_CAN_AM00H() bfin_read16(CAN_AM00H)
+#define bfin_write_CAN_AM00H(val) bfin_write16(CAN_AM00H, val)
+#define bfin_read_CAN_AM01L() bfin_read16(CAN_AM01L)
+#define bfin_write_CAN_AM01L(val) bfin_write16(CAN_AM01L, val)
+#define bfin_read_CAN_AM01H() bfin_read16(CAN_AM01H)
+#define bfin_write_CAN_AM01H(val) bfin_write16(CAN_AM01H, val)
+#define bfin_read_CAN_AM02L() bfin_read16(CAN_AM02L)
+#define bfin_write_CAN_AM02L(val) bfin_write16(CAN_AM02L, val)
+#define bfin_read_CAN_AM02H() bfin_read16(CAN_AM02H)
+#define bfin_write_CAN_AM02H(val) bfin_write16(CAN_AM02H, val)
+#define bfin_read_CAN_AM03L() bfin_read16(CAN_AM03L)
+#define bfin_write_CAN_AM03L(val) bfin_write16(CAN_AM03L, val)
+#define bfin_read_CAN_AM03H() bfin_read16(CAN_AM03H)
+#define bfin_write_CAN_AM03H(val) bfin_write16(CAN_AM03H, val)
+#define bfin_read_CAN_AM04L() bfin_read16(CAN_AM04L)
+#define bfin_write_CAN_AM04L(val) bfin_write16(CAN_AM04L, val)
+#define bfin_read_CAN_AM04H() bfin_read16(CAN_AM04H)
+#define bfin_write_CAN_AM04H(val) bfin_write16(CAN_AM04H, val)
+#define bfin_read_CAN_AM05L() bfin_read16(CAN_AM05L)
+#define bfin_write_CAN_AM05L(val) bfin_write16(CAN_AM05L, val)
+#define bfin_read_CAN_AM05H() bfin_read16(CAN_AM05H)
+#define bfin_write_CAN_AM05H(val) bfin_write16(CAN_AM05H, val)
+#define bfin_read_CAN_AM06L() bfin_read16(CAN_AM06L)
+#define bfin_write_CAN_AM06L(val) bfin_write16(CAN_AM06L, val)
+#define bfin_read_CAN_AM06H() bfin_read16(CAN_AM06H)
+#define bfin_write_CAN_AM06H(val) bfin_write16(CAN_AM06H, val)
+#define bfin_read_CAN_AM07L() bfin_read16(CAN_AM07L)
+#define bfin_write_CAN_AM07L(val) bfin_write16(CAN_AM07L, val)
+#define bfin_read_CAN_AM07H() bfin_read16(CAN_AM07H)
+#define bfin_write_CAN_AM07H(val) bfin_write16(CAN_AM07H, val)
+#define bfin_read_CAN_AM08L() bfin_read16(CAN_AM08L)
+#define bfin_write_CAN_AM08L(val) bfin_write16(CAN_AM08L, val)
+#define bfin_read_CAN_AM08H() bfin_read16(CAN_AM08H)
+#define bfin_write_CAN_AM08H(val) bfin_write16(CAN_AM08H, val)
+#define bfin_read_CAN_AM09L() bfin_read16(CAN_AM09L)
+#define bfin_write_CAN_AM09L(val) bfin_write16(CAN_AM09L, val)
+#define bfin_read_CAN_AM09H() bfin_read16(CAN_AM09H)
+#define bfin_write_CAN_AM09H(val) bfin_write16(CAN_AM09H, val)
+#define bfin_read_CAN_AM10L() bfin_read16(CAN_AM10L)
+#define bfin_write_CAN_AM10L(val) bfin_write16(CAN_AM10L, val)
+#define bfin_read_CAN_AM10H() bfin_read16(CAN_AM10H)
+#define bfin_write_CAN_AM10H(val) bfin_write16(CAN_AM10H, val)
+#define bfin_read_CAN_AM11L() bfin_read16(CAN_AM11L)
+#define bfin_write_CAN_AM11L(val) bfin_write16(CAN_AM11L, val)
+#define bfin_read_CAN_AM11H() bfin_read16(CAN_AM11H)
+#define bfin_write_CAN_AM11H(val) bfin_write16(CAN_AM11H, val)
+#define bfin_read_CAN_AM12L() bfin_read16(CAN_AM12L)
+#define bfin_write_CAN_AM12L(val) bfin_write16(CAN_AM12L, val)
+#define bfin_read_CAN_AM12H() bfin_read16(CAN_AM12H)
+#define bfin_write_CAN_AM12H(val) bfin_write16(CAN_AM12H, val)
+#define bfin_read_CAN_AM13L() bfin_read16(CAN_AM13L)
+#define bfin_write_CAN_AM13L(val) bfin_write16(CAN_AM13L, val)
+#define bfin_read_CAN_AM13H() bfin_read16(CAN_AM13H)
+#define bfin_write_CAN_AM13H(val) bfin_write16(CAN_AM13H, val)
+#define bfin_read_CAN_AM14L() bfin_read16(CAN_AM14L)
+#define bfin_write_CAN_AM14L(val) bfin_write16(CAN_AM14L, val)
+#define bfin_read_CAN_AM14H() bfin_read16(CAN_AM14H)
+#define bfin_write_CAN_AM14H(val) bfin_write16(CAN_AM14H, val)
+#define bfin_read_CAN_AM15L() bfin_read16(CAN_AM15L)
+#define bfin_write_CAN_AM15L(val) bfin_write16(CAN_AM15L, val)
+#define bfin_read_CAN_AM15H() bfin_read16(CAN_AM15H)
+#define bfin_write_CAN_AM15H(val) bfin_write16(CAN_AM15H, val)
+#define bfin_read_CAN_AM16L() bfin_read16(CAN_AM16L)
+#define bfin_write_CAN_AM16L(val) bfin_write16(CAN_AM16L, val)
+#define bfin_read_CAN_AM16H() bfin_read16(CAN_AM16H)
+#define bfin_write_CAN_AM16H(val) bfin_write16(CAN_AM16H, val)
+#define bfin_read_CAN_AM17L() bfin_read16(CAN_AM17L)
+#define bfin_write_CAN_AM17L(val) bfin_write16(CAN_AM17L, val)
+#define bfin_read_CAN_AM17H() bfin_read16(CAN_AM17H)
+#define bfin_write_CAN_AM17H(val) bfin_write16(CAN_AM17H, val)
+#define bfin_read_CAN_AM18L() bfin_read16(CAN_AM18L)
+#define bfin_write_CAN_AM18L(val) bfin_write16(CAN_AM18L, val)
+#define bfin_read_CAN_AM18H() bfin_read16(CAN_AM18H)
+#define bfin_write_CAN_AM18H(val) bfin_write16(CAN_AM18H, val)
+#define bfin_read_CAN_AM19L() bfin_read16(CAN_AM19L)
+#define bfin_write_CAN_AM19L(val) bfin_write16(CAN_AM19L, val)
+#define bfin_read_CAN_AM19H() bfin_read16(CAN_AM19H)
+#define bfin_write_CAN_AM19H(val) bfin_write16(CAN_AM19H, val)
+#define bfin_read_CAN_AM20L() bfin_read16(CAN_AM20L)
+#define bfin_write_CAN_AM20L(val) bfin_write16(CAN_AM20L, val)
+#define bfin_read_CAN_AM20H() bfin_read16(CAN_AM20H)
+#define bfin_write_CAN_AM20H(val) bfin_write16(CAN_AM20H, val)
+#define bfin_read_CAN_AM21L() bfin_read16(CAN_AM21L)
+#define bfin_write_CAN_AM21L(val) bfin_write16(CAN_AM21L, val)
+#define bfin_read_CAN_AM21H() bfin_read16(CAN_AM21H)
+#define bfin_write_CAN_AM21H(val) bfin_write16(CAN_AM21H, val)
+#define bfin_read_CAN_AM22L() bfin_read16(CAN_AM22L)
+#define bfin_write_CAN_AM22L(val) bfin_write16(CAN_AM22L, val)
+#define bfin_read_CAN_AM22H() bfin_read16(CAN_AM22H)
+#define bfin_write_CAN_AM22H(val) bfin_write16(CAN_AM22H, val)
+#define bfin_read_CAN_AM23L() bfin_read16(CAN_AM23L)
+#define bfin_write_CAN_AM23L(val) bfin_write16(CAN_AM23L, val)
+#define bfin_read_CAN_AM23H() bfin_read16(CAN_AM23H)
+#define bfin_write_CAN_AM23H(val) bfin_write16(CAN_AM23H, val)
+#define bfin_read_CAN_AM24L() bfin_read16(CAN_AM24L)
+#define bfin_write_CAN_AM24L(val) bfin_write16(CAN_AM24L, val)
+#define bfin_read_CAN_AM24H() bfin_read16(CAN_AM24H)
+#define bfin_write_CAN_AM24H(val) bfin_write16(CAN_AM24H, val)
+#define bfin_read_CAN_AM25L() bfin_read16(CAN_AM25L)
+#define bfin_write_CAN_AM25L(val) bfin_write16(CAN_AM25L, val)
+#define bfin_read_CAN_AM25H() bfin_read16(CAN_AM25H)
+#define bfin_write_CAN_AM25H(val) bfin_write16(CAN_AM25H, val)
+#define bfin_read_CAN_AM26L() bfin_read16(CAN_AM26L)
+#define bfin_write_CAN_AM26L(val) bfin_write16(CAN_AM26L, val)
+#define bfin_read_CAN_AM26H() bfin_read16(CAN_AM26H)
+#define bfin_write_CAN_AM26H(val) bfin_write16(CAN_AM26H, val)
+#define bfin_read_CAN_AM27L() bfin_read16(CAN_AM27L)
+#define bfin_write_CAN_AM27L(val) bfin_write16(CAN_AM27L, val)
+#define bfin_read_CAN_AM27H() bfin_read16(CAN_AM27H)
+#define bfin_write_CAN_AM27H(val) bfin_write16(CAN_AM27H, val)
+#define bfin_read_CAN_AM28L() bfin_read16(CAN_AM28L)
+#define bfin_write_CAN_AM28L(val) bfin_write16(CAN_AM28L, val)
+#define bfin_read_CAN_AM28H() bfin_read16(CAN_AM28H)
+#define bfin_write_CAN_AM28H(val) bfin_write16(CAN_AM28H, val)
+#define bfin_read_CAN_AM29L() bfin_read16(CAN_AM29L)
+#define bfin_write_CAN_AM29L(val) bfin_write16(CAN_AM29L, val)
+#define bfin_read_CAN_AM29H() bfin_read16(CAN_AM29H)
+#define bfin_write_CAN_AM29H(val) bfin_write16(CAN_AM29H, val)
+#define bfin_read_CAN_AM30L() bfin_read16(CAN_AM30L)
+#define bfin_write_CAN_AM30L(val) bfin_write16(CAN_AM30L, val)
+#define bfin_read_CAN_AM30H() bfin_read16(CAN_AM30H)
+#define bfin_write_CAN_AM30H(val) bfin_write16(CAN_AM30H, val)
+#define bfin_read_CAN_AM31L() bfin_read16(CAN_AM31L)
+#define bfin_write_CAN_AM31L(val) bfin_write16(CAN_AM31L, val)
+#define bfin_read_CAN_AM31H() bfin_read16(CAN_AM31H)
+#define bfin_write_CAN_AM31H(val) bfin_write16(CAN_AM31H, val)
+#define bfin_read_CAN_MB00_DATA0() bfin_read16(CAN_MB00_DATA0)
+#define bfin_write_CAN_MB00_DATA0(val) bfin_write16(CAN_MB00_DATA0, val)
+#define bfin_read_CAN_MB00_DATA1() bfin_read16(CAN_MB00_DATA1)
+#define bfin_write_CAN_MB00_DATA1(val) bfin_write16(CAN_MB00_DATA1, val)
+#define bfin_read_CAN_MB00_DATA2() bfin_read16(CAN_MB00_DATA2)
+#define bfin_write_CAN_MB00_DATA2(val) bfin_write16(CAN_MB00_DATA2, val)
+#define bfin_read_CAN_MB00_DATA3() bfin_read16(CAN_MB00_DATA3)
+#define bfin_write_CAN_MB00_DATA3(val) bfin_write16(CAN_MB00_DATA3, val)
+#define bfin_read_CAN_MB00_LENGTH() bfin_read16(CAN_MB00_LENGTH)
+#define bfin_write_CAN_MB00_LENGTH(val) bfin_write16(CAN_MB00_LENGTH, val)
+#define bfin_read_CAN_MB00_TIMESTAMP() bfin_read16(CAN_MB00_TIMESTAMP)
+#define bfin_write_CAN_MB00_TIMESTAMP(val) bfin_write16(CAN_MB00_TIMESTAMP, val)
+#define bfin_read_CAN_MB00_ID0() bfin_read16(CAN_MB00_ID0)
+#define bfin_write_CAN_MB00_ID0(val) bfin_write16(CAN_MB00_ID0, val)
+#define bfin_read_CAN_MB00_ID1() bfin_read16(CAN_MB00_ID1)
+#define bfin_write_CAN_MB00_ID1(val) bfin_write16(CAN_MB00_ID1, val)
+#define bfin_read_CAN_MB01_DATA0() bfin_read16(CAN_MB01_DATA0)
+#define bfin_write_CAN_MB01_DATA0(val) bfin_write16(CAN_MB01_DATA0, val)
+#define bfin_read_CAN_MB01_DATA1() bfin_read16(CAN_MB01_DATA1)
+#define bfin_write_CAN_MB01_DATA1(val) bfin_write16(CAN_MB01_DATA1, val)
+#define bfin_read_CAN_MB01_DATA2() bfin_read16(CAN_MB01_DATA2)
+#define bfin_write_CAN_MB01_DATA2(val) bfin_write16(CAN_MB01_DATA2, val)
+#define bfin_read_CAN_MB01_DATA3() bfin_read16(CAN_MB01_DATA3)
+#define bfin_write_CAN_MB01_DATA3(val) bfin_write16(CAN_MB01_DATA3, val)
+#define bfin_read_CAN_MB01_LENGTH() bfin_read16(CAN_MB01_LENGTH)
+#define bfin_write_CAN_MB01_LENGTH(val) bfin_write16(CAN_MB01_LENGTH, val)
+#define bfin_read_CAN_MB01_TIMESTAMP() bfin_read16(CAN_MB01_TIMESTAMP)
+#define bfin_write_CAN_MB01_TIMESTAMP(val) bfin_write16(CAN_MB01_TIMESTAMP, val)
+#define bfin_read_CAN_MB01_ID0() bfin_read16(CAN_MB01_ID0)
+#define bfin_write_CAN_MB01_ID0(val) bfin_write16(CAN_MB01_ID0, val)
+#define bfin_read_CAN_MB01_ID1() bfin_read16(CAN_MB01_ID1)
+#define bfin_write_CAN_MB01_ID1(val) bfin_write16(CAN_MB01_ID1, val)
+#define bfin_read_CAN_MB02_DATA0() bfin_read16(CAN_MB02_DATA0)
+#define bfin_write_CAN_MB02_DATA0(val) bfin_write16(CAN_MB02_DATA0, val)
+#define bfin_read_CAN_MB02_DATA1() bfin_read16(CAN_MB02_DATA1)
+#define bfin_write_CAN_MB02_DATA1(val) bfin_write16(CAN_MB02_DATA1, val)
+#define bfin_read_CAN_MB02_DATA2() bfin_read16(CAN_MB02_DATA2)
+#define bfin_write_CAN_MB02_DATA2(val) bfin_write16(CAN_MB02_DATA2, val)
+#define bfin_read_CAN_MB02_DATA3() bfin_read16(CAN_MB02_DATA3)
+#define bfin_write_CAN_MB02_DATA3(val) bfin_write16(CAN_MB02_DATA3, val)
+#define bfin_read_CAN_MB02_LENGTH() bfin_read16(CAN_MB02_LENGTH)
+#define bfin_write_CAN_MB02_LENGTH(val) bfin_write16(CAN_MB02_LENGTH, val)
+#define bfin_read_CAN_MB02_TIMESTAMP() bfin_read16(CAN_MB02_TIMESTAMP)
+#define bfin_write_CAN_MB02_TIMESTAMP(val) bfin_write16(CAN_MB02_TIMESTAMP, val)
+#define bfin_read_CAN_MB02_ID0() bfin_read16(CAN_MB02_ID0)
+#define bfin_write_CAN_MB02_ID0(val) bfin_write16(CAN_MB02_ID0, val)
+#define bfin_read_CAN_MB02_ID1() bfin_read16(CAN_MB02_ID1)
+#define bfin_write_CAN_MB02_ID1(val) bfin_write16(CAN_MB02_ID1, val)
+#define bfin_read_CAN_MB03_DATA0() bfin_read16(CAN_MB03_DATA0)
+#define bfin_write_CAN_MB03_DATA0(val) bfin_write16(CAN_MB03_DATA0, val)
+#define bfin_read_CAN_MB03_DATA1() bfin_read16(CAN_MB03_DATA1)
+#define bfin_write_CAN_MB03_DATA1(val) bfin_write16(CAN_MB03_DATA1, val)
+#define bfin_read_CAN_MB03_DATA2() bfin_read16(CAN_MB03_DATA2)
+#define bfin_write_CAN_MB03_DATA2(val) bfin_write16(CAN_MB03_DATA2, val)
+#define bfin_read_CAN_MB03_DATA3() bfin_read16(CAN_MB03_DATA3)
+#define bfin_write_CAN_MB03_DATA3(val) bfin_write16(CAN_MB03_DATA3, val)
+#define bfin_read_CAN_MB03_LENGTH() bfin_read16(CAN_MB03_LENGTH)
+#define bfin_write_CAN_MB03_LENGTH(val) bfin_write16(CAN_MB03_LENGTH, val)
+#define bfin_read_CAN_MB03_TIMESTAMP() bfin_read16(CAN_MB03_TIMESTAMP)
+#define bfin_write_CAN_MB03_TIMESTAMP(val) bfin_write16(CAN_MB03_TIMESTAMP, val)
+#define bfin_read_CAN_MB03_ID0() bfin_read16(CAN_MB03_ID0)
+#define bfin_write_CAN_MB03_ID0(val) bfin_write16(CAN_MB03_ID0, val)
+#define bfin_read_CAN_MB03_ID1() bfin_read16(CAN_MB03_ID1)
+#define bfin_write_CAN_MB03_ID1(val) bfin_write16(CAN_MB03_ID1, val)
+#define bfin_read_CAN_MB04_DATA0() bfin_read16(CAN_MB04_DATA0)
+#define bfin_write_CAN_MB04_DATA0(val) bfin_write16(CAN_MB04_DATA0, val)
+#define bfin_read_CAN_MB04_DATA1() bfin_read16(CAN_MB04_DATA1)
+#define bfin_write_CAN_MB04_DATA1(val) bfin_write16(CAN_MB04_DATA1, val)
+#define bfin_read_CAN_MB04_DATA2() bfin_read16(CAN_MB04_DATA2)
+#define bfin_write_CAN_MB04_DATA2(val) bfin_write16(CAN_MB04_DATA2, val)
+#define bfin_read_CAN_MB04_DATA3() bfin_read16(CAN_MB04_DATA3)
+#define bfin_write_CAN_MB04_DATA3(val) bfin_write16(CAN_MB04_DATA3, val)
+#define bfin_read_CAN_MB04_LENGTH() bfin_read16(CAN_MB04_LENGTH)
+#define bfin_write_CAN_MB04_LENGTH(val) bfin_write16(CAN_MB04_LENGTH, val)
+#define bfin_read_CAN_MB04_TIMESTAMP() bfin_read16(CAN_MB04_TIMESTAMP)
+#define bfin_write_CAN_MB04_TIMESTAMP(val) bfin_write16(CAN_MB04_TIMESTAMP, val)
+#define bfin_read_CAN_MB04_ID0() bfin_read16(CAN_MB04_ID0)
+#define bfin_write_CAN_MB04_ID0(val) bfin_write16(CAN_MB04_ID0, val)
+#define bfin_read_CAN_MB04_ID1() bfin_read16(CAN_MB04_ID1)
+#define bfin_write_CAN_MB04_ID1(val) bfin_write16(CAN_MB04_ID1, val)
+#define bfin_read_CAN_MB05_DATA0() bfin_read16(CAN_MB05_DATA0)
+#define bfin_write_CAN_MB05_DATA0(val) bfin_write16(CAN_MB05_DATA0, val)
+#define bfin_read_CAN_MB05_DATA1() bfin_read16(CAN_MB05_DATA1)
+#define bfin_write_CAN_MB05_DATA1(val) bfin_write16(CAN_MB05_DATA1, val)
+#define bfin_read_CAN_MB05_DATA2() bfin_read16(CAN_MB05_DATA2)
+#define bfin_write_CAN_MB05_DATA2(val) bfin_write16(CAN_MB05_DATA2, val)
+#define bfin_read_CAN_MB05_DATA3() bfin_read16(CAN_MB05_DATA3)
+#define bfin_write_CAN_MB05_DATA3(val) bfin_write16(CAN_MB05_DATA3, val)
+#define bfin_read_CAN_MB05_LENGTH() bfin_read16(CAN_MB05_LENGTH)
+#define bfin_write_CAN_MB05_LENGTH(val) bfin_write16(CAN_MB05_LENGTH, val)
+#define bfin_read_CAN_MB05_TIMESTAMP() bfin_read16(CAN_MB05_TIMESTAMP)
+#define bfin_write_CAN_MB05_TIMESTAMP(val) bfin_write16(CAN_MB05_TIMESTAMP, val)
+#define bfin_read_CAN_MB05_ID0() bfin_read16(CAN_MB05_ID0)
+#define bfin_write_CAN_MB05_ID0(val) bfin_write16(CAN_MB05_ID0, val)
+#define bfin_read_CAN_MB05_ID1() bfin_read16(CAN_MB05_ID1)
+#define bfin_write_CAN_MB05_ID1(val) bfin_write16(CAN_MB05_ID1, val)
+#define bfin_read_CAN_MB06_DATA0() bfin_read16(CAN_MB06_DATA0)
+#define bfin_write_CAN_MB06_DATA0(val) bfin_write16(CAN_MB06_DATA0, val)
+#define bfin_read_CAN_MB06_DATA1() bfin_read16(CAN_MB06_DATA1)
+#define bfin_write_CAN_MB06_DATA1(val) bfin_write16(CAN_MB06_DATA1, val)
+#define bfin_read_CAN_MB06_DATA2() bfin_read16(CAN_MB06_DATA2)
+#define bfin_write_CAN_MB06_DATA2(val) bfin_write16(CAN_MB06_DATA2, val)
+#define bfin_read_CAN_MB06_DATA3() bfin_read16(CAN_MB06_DATA3)
+#define bfin_write_CAN_MB06_DATA3(val) bfin_write16(CAN_MB06_DATA3, val)
+#define bfin_read_CAN_MB06_LENGTH() bfin_read16(CAN_MB06_LENGTH)
+#define bfin_write_CAN_MB06_LENGTH(val) bfin_write16(CAN_MB06_LENGTH, val)
+#define bfin_read_CAN_MB06_TIMESTAMP() bfin_read16(CAN_MB06_TIMESTAMP)
+#define bfin_write_CAN_MB06_TIMESTAMP(val) bfin_write16(CAN_MB06_TIMESTAMP, val)
+#define bfin_read_CAN_MB06_ID0() bfin_read16(CAN_MB06_ID0)
+#define bfin_write_CAN_MB06_ID0(val) bfin_write16(CAN_MB06_ID0, val)
+#define bfin_read_CAN_MB06_ID1() bfin_read16(CAN_MB06_ID1)
+#define bfin_write_CAN_MB06_ID1(val) bfin_write16(CAN_MB06_ID1, val)
+#define bfin_read_CAN_MB07_DATA0() bfin_read16(CAN_MB07_DATA0)
+#define bfin_write_CAN_MB07_DATA0(val) bfin_write16(CAN_MB07_DATA0, val)
+#define bfin_read_CAN_MB07_DATA1() bfin_read16(CAN_MB07_DATA1)
+#define bfin_write_CAN_MB07_DATA1(val) bfin_write16(CAN_MB07_DATA1, val)
+#define bfin_read_CAN_MB07_DATA2() bfin_read16(CAN_MB07_DATA2)
+#define bfin_write_CAN_MB07_DATA2(val) bfin_write16(CAN_MB07_DATA2, val)
+#define bfin_read_CAN_MB07_DATA3() bfin_read16(CAN_MB07_DATA3)
+#define bfin_write_CAN_MB07_DATA3(val) bfin_write16(CAN_MB07_DATA3, val)
+#define bfin_read_CAN_MB07_LENGTH() bfin_read16(CAN_MB07_LENGTH)
+#define bfin_write_CAN_MB07_LENGTH(val) bfin_write16(CAN_MB07_LENGTH, val)
+#define bfin_read_CAN_MB07_TIMESTAMP() bfin_read16(CAN_MB07_TIMESTAMP)
+#define bfin_write_CAN_MB07_TIMESTAMP(val) bfin_write16(CAN_MB07_TIMESTAMP, val)
+#define bfin_read_CAN_MB07_ID0() bfin_read16(CAN_MB07_ID0)
+#define bfin_write_CAN_MB07_ID0(val) bfin_write16(CAN_MB07_ID0, val)
+#define bfin_read_CAN_MB07_ID1() bfin_read16(CAN_MB07_ID1)
+#define bfin_write_CAN_MB07_ID1(val) bfin_write16(CAN_MB07_ID1, val)
+#define bfin_read_CAN_MB08_DATA0() bfin_read16(CAN_MB08_DATA0)
+#define bfin_write_CAN_MB08_DATA0(val) bfin_write16(CAN_MB08_DATA0, val)
+#define bfin_read_CAN_MB08_DATA1() bfin_read16(CAN_MB08_DATA1)
+#define bfin_write_CAN_MB08_DATA1(val) bfin_write16(CAN_MB08_DATA1, val)
+#define bfin_read_CAN_MB08_DATA2() bfin_read16(CAN_MB08_DATA2)
+#define bfin_write_CAN_MB08_DATA2(val) bfin_write16(CAN_MB08_DATA2, val)
+#define bfin_read_CAN_MB08_DATA3() bfin_read16(CAN_MB08_DATA3)
+#define bfin_write_CAN_MB08_DATA3(val) bfin_write16(CAN_MB08_DATA3, val)
+#define bfin_read_CAN_MB08_LENGTH() bfin_read16(CAN_MB08_LENGTH)
+#define bfin_write_CAN_MB08_LENGTH(val) bfin_write16(CAN_MB08_LENGTH, val)
+#define bfin_read_CAN_MB08_TIMESTAMP() bfin_read16(CAN_MB08_TIMESTAMP)
+#define bfin_write_CAN_MB08_TIMESTAMP(val) bfin_write16(CAN_MB08_TIMESTAMP, val)
+#define bfin_read_CAN_MB08_ID0() bfin_read16(CAN_MB08_ID0)
+#define bfin_write_CAN_MB08_ID0(val) bfin_write16(CAN_MB08_ID0, val)
+#define bfin_read_CAN_MB08_ID1() bfin_read16(CAN_MB08_ID1)
+#define bfin_write_CAN_MB08_ID1(val) bfin_write16(CAN_MB08_ID1, val)
+#define bfin_read_CAN_MB09_DATA0() bfin_read16(CAN_MB09_DATA0)
+#define bfin_write_CAN_MB09_DATA0(val) bfin_write16(CAN_MB09_DATA0, val)
+#define bfin_read_CAN_MB09_DATA1() bfin_read16(CAN_MB09_DATA1)
+#define bfin_write_CAN_MB09_DATA1(val) bfin_write16(CAN_MB09_DATA1, val)
+#define bfin_read_CAN_MB09_DATA2() bfin_read16(CAN_MB09_DATA2)
+#define bfin_write_CAN_MB09_DATA2(val) bfin_write16(CAN_MB09_DATA2, val)
+#define bfin_read_CAN_MB09_DATA3() bfin_read16(CAN_MB09_DATA3)
+#define bfin_write_CAN_MB09_DATA3(val) bfin_write16(CAN_MB09_DATA3, val)
+#define bfin_read_CAN_MB09_LENGTH() bfin_read16(CAN_MB09_LENGTH)
+#define bfin_write_CAN_MB09_LENGTH(val) bfin_write16(CAN_MB09_LENGTH, val)
+#define bfin_read_CAN_MB09_TIMESTAMP() bfin_read16(CAN_MB09_TIMESTAMP)
+#define bfin_write_CAN_MB09_TIMESTAMP(val) bfin_write16(CAN_MB09_TIMESTAMP, val)
+#define bfin_read_CAN_MB09_ID0() bfin_read16(CAN_MB09_ID0)
+#define bfin_write_CAN_MB09_ID0(val) bfin_write16(CAN_MB09_ID0, val)
+#define bfin_read_CAN_MB09_ID1() bfin_read16(CAN_MB09_ID1)
+#define bfin_write_CAN_MB09_ID1(val) bfin_write16(CAN_MB09_ID1, val)
+#define bfin_read_CAN_MB10_DATA0() bfin_read16(CAN_MB10_DATA0)
+#define bfin_write_CAN_MB10_DATA0(val) bfin_write16(CAN_MB10_DATA0, val)
+#define bfin_read_CAN_MB10_DATA1() bfin_read16(CAN_MB10_DATA1)
+#define bfin_write_CAN_MB10_DATA1(val) bfin_write16(CAN_MB10_DATA1, val)
+#define bfin_read_CAN_MB10_DATA2() bfin_read16(CAN_MB10_DATA2)
+#define bfin_write_CAN_MB10_DATA2(val) bfin_write16(CAN_MB10_DATA2, val)
+#define bfin_read_CAN_MB10_DATA3() bfin_read16(CAN_MB10_DATA3)
+#define bfin_write_CAN_MB10_DATA3(val) bfin_write16(CAN_MB10_DATA3, val)
+#define bfin_read_CAN_MB10_LENGTH() bfin_read16(CAN_MB10_LENGTH)
+#define bfin_write_CAN_MB10_LENGTH(val) bfin_write16(CAN_MB10_LENGTH, val)
+#define bfin_read_CAN_MB10_TIMESTAMP() bfin_read16(CAN_MB10_TIMESTAMP)
+#define bfin_write_CAN_MB10_TIMESTAMP(val) bfin_write16(CAN_MB10_TIMESTAMP, val)
+#define bfin_read_CAN_MB10_ID0() bfin_read16(CAN_MB10_ID0)
+#define bfin_write_CAN_MB10_ID0(val) bfin_write16(CAN_MB10_ID0, val)
+#define bfin_read_CAN_MB10_ID1() bfin_read16(CAN_MB10_ID1)
+#define bfin_write_CAN_MB10_ID1(val) bfin_write16(CAN_MB10_ID1, val)
+#define bfin_read_CAN_MB11_DATA0() bfin_read16(CAN_MB11_DATA0)
+#define bfin_write_CAN_MB11_DATA0(val) bfin_write16(CAN_MB11_DATA0, val)
+#define bfin_read_CAN_MB11_DATA1() bfin_read16(CAN_MB11_DATA1)
+#define bfin_write_CAN_MB11_DATA1(val) bfin_write16(CAN_MB11_DATA1, val)
+#define bfin_read_CAN_MB11_DATA2() bfin_read16(CAN_MB11_DATA2)
+#define bfin_write_CAN_MB11_DATA2(val) bfin_write16(CAN_MB11_DATA2, val)
+#define bfin_read_CAN_MB11_DATA3() bfin_read16(CAN_MB11_DATA3)
+#define bfin_write_CAN_MB11_DATA3(val) bfin_write16(CAN_MB11_DATA3, val)
+#define bfin_read_CAN_MB11_LENGTH() bfin_read16(CAN_MB11_LENGTH)
+#define bfin_write_CAN_MB11_LENGTH(val) bfin_write16(CAN_MB11_LENGTH, val)
+#define bfin_read_CAN_MB11_TIMESTAMP() bfin_read16(CAN_MB11_TIMESTAMP)
+#define bfin_write_CAN_MB11_TIMESTAMP(val) bfin_write16(CAN_MB11_TIMESTAMP, val)
+#define bfin_read_CAN_MB11_ID0() bfin_read16(CAN_MB11_ID0)
+#define bfin_write_CAN_MB11_ID0(val) bfin_write16(CAN_MB11_ID0, val)
+#define bfin_read_CAN_MB11_ID1() bfin_read16(CAN_MB11_ID1)
+#define bfin_write_CAN_MB11_ID1(val) bfin_write16(CAN_MB11_ID1, val)
+#define bfin_read_CAN_MB12_DATA0() bfin_read16(CAN_MB12_DATA0)
+#define bfin_write_CAN_MB12_DATA0(val) bfin_write16(CAN_MB12_DATA0, val)
+#define bfin_read_CAN_MB12_DATA1() bfin_read16(CAN_MB12_DATA1)
+#define bfin_write_CAN_MB12_DATA1(val) bfin_write16(CAN_MB12_DATA1, val)
+#define bfin_read_CAN_MB12_DATA2() bfin_read16(CAN_MB12_DATA2)
+#define bfin_write_CAN_MB12_DATA2(val) bfin_write16(CAN_MB12_DATA2, val)
+#define bfin_read_CAN_MB12_DATA3() bfin_read16(CAN_MB12_DATA3)
+#define bfin_write_CAN_MB12_DATA3(val) bfin_write16(CAN_MB12_DATA3, val)
+#define bfin_read_CAN_MB12_LENGTH() bfin_read16(CAN_MB12_LENGTH)
+#define bfin_write_CAN_MB12_LENGTH(val) bfin_write16(CAN_MB12_LENGTH, val)
+#define bfin_read_CAN_MB12_TIMESTAMP() bfin_read16(CAN_MB12_TIMESTAMP)
+#define bfin_write_CAN_MB12_TIMESTAMP(val) bfin_write16(CAN_MB12_TIMESTAMP, val)
+#define bfin_read_CAN_MB12_ID0() bfin_read16(CAN_MB12_ID0)
+#define bfin_write_CAN_MB12_ID0(val) bfin_write16(CAN_MB12_ID0, val)
+#define bfin_read_CAN_MB12_ID1() bfin_read16(CAN_MB12_ID1)
+#define bfin_write_CAN_MB12_ID1(val) bfin_write16(CAN_MB12_ID1, val)
+#define bfin_read_CAN_MB13_DATA0() bfin_read16(CAN_MB13_DATA0)
+#define bfin_write_CAN_MB13_DATA0(val) bfin_write16(CAN_MB13_DATA0, val)
+#define bfin_read_CAN_MB13_DATA1() bfin_read16(CAN_MB13_DATA1)
+#define bfin_write_CAN_MB13_DATA1(val) bfin_write16(CAN_MB13_DATA1, val)
+#define bfin_read_CAN_MB13_DATA2() bfin_read16(CAN_MB13_DATA2)
+#define bfin_write_CAN_MB13_DATA2(val) bfin_write16(CAN_MB13_DATA2, val)
+#define bfin_read_CAN_MB13_DATA3() bfin_read16(CAN_MB13_DATA3)
+#define bfin_write_CAN_MB13_DATA3(val) bfin_write16(CAN_MB13_DATA3, val)
+#define bfin_read_CAN_MB13_LENGTH() bfin_read16(CAN_MB13_LENGTH)
+#define bfin_write_CAN_MB13_LENGTH(val) bfin_write16(CAN_MB13_LENGTH, val)
+#define bfin_read_CAN_MB13_TIMESTAMP() bfin_read16(CAN_MB13_TIMESTAMP)
+#define bfin_write_CAN_MB13_TIMESTAMP(val) bfin_write16(CAN_MB13_TIMESTAMP, val)
+#define bfin_read_CAN_MB13_ID0() bfin_read16(CAN_MB13_ID0)
+#define bfin_write_CAN_MB13_ID0(val) bfin_write16(CAN_MB13_ID0, val)
+#define bfin_read_CAN_MB13_ID1() bfin_read16(CAN_MB13_ID1)
+#define bfin_write_CAN_MB13_ID1(val) bfin_write16(CAN_MB13_ID1, val)
+#define bfin_read_CAN_MB14_DATA0() bfin_read16(CAN_MB14_DATA0)
+#define bfin_write_CAN_MB14_DATA0(val) bfin_write16(CAN_MB14_DATA0, val)
+#define bfin_read_CAN_MB14_DATA1() bfin_read16(CAN_MB14_DATA1)
+#define bfin_write_CAN_MB14_DATA1(val) bfin_write16(CAN_MB14_DATA1, val)
+#define bfin_read_CAN_MB14_DATA2() bfin_read16(CAN_MB14_DATA2)
+#define bfin_write_CAN_MB14_DATA2(val) bfin_write16(CAN_MB14_DATA2, val)
+#define bfin_read_CAN_MB14_DATA3() bfin_read16(CAN_MB14_DATA3)
+#define bfin_write_CAN_MB14_DATA3(val) bfin_write16(CAN_MB14_DATA3, val)
+#define bfin_read_CAN_MB14_LENGTH() bfin_read16(CAN_MB14_LENGTH)
+#define bfin_write_CAN_MB14_LENGTH(val) bfin_write16(CAN_MB14_LENGTH, val)
+#define bfin_read_CAN_MB14_TIMESTAMP() bfin_read16(CAN_MB14_TIMESTAMP)
+#define bfin_write_CAN_MB14_TIMESTAMP(val) bfin_write16(CAN_MB14_TIMESTAMP, val)
+#define bfin_read_CAN_MB14_ID0() bfin_read16(CAN_MB14_ID0)
+#define bfin_write_CAN_MB14_ID0(val) bfin_write16(CAN_MB14_ID0, val)
+#define bfin_read_CAN_MB14_ID1() bfin_read16(CAN_MB14_ID1)
+#define bfin_write_CAN_MB14_ID1(val) bfin_write16(CAN_MB14_ID1, val)
+#define bfin_read_CAN_MB15_DATA0() bfin_read16(CAN_MB15_DATA0)
+#define bfin_write_CAN_MB15_DATA0(val) bfin_write16(CAN_MB15_DATA0, val)
+#define bfin_read_CAN_MB15_DATA1() bfin_read16(CAN_MB15_DATA1)
+#define bfin_write_CAN_MB15_DATA1(val) bfin_write16(CAN_MB15_DATA1, val)
+#define bfin_read_CAN_MB15_DATA2() bfin_read16(CAN_MB15_DATA2)
+#define bfin_write_CAN_MB15_DATA2(val) bfin_write16(CAN_MB15_DATA2, val)
+#define bfin_read_CAN_MB15_DATA3() bfin_read16(CAN_MB15_DATA3)
+#define bfin_write_CAN_MB15_DATA3(val) bfin_write16(CAN_MB15_DATA3, val)
+#define bfin_read_CAN_MB15_LENGTH() bfin_read16(CAN_MB15_LENGTH)
+#define bfin_write_CAN_MB15_LENGTH(val) bfin_write16(CAN_MB15_LENGTH, val)
+#define bfin_read_CAN_MB15_TIMESTAMP() bfin_read16(CAN_MB15_TIMESTAMP)
+#define bfin_write_CAN_MB15_TIMESTAMP(val) bfin_write16(CAN_MB15_TIMESTAMP, val)
+#define bfin_read_CAN_MB15_ID0() bfin_read16(CAN_MB15_ID0)
+#define bfin_write_CAN_MB15_ID0(val) bfin_write16(CAN_MB15_ID0, val)
+#define bfin_read_CAN_MB15_ID1() bfin_read16(CAN_MB15_ID1)
+#define bfin_write_CAN_MB15_ID1(val) bfin_write16(CAN_MB15_ID1, val)
+#define bfin_read_CAN_MB16_DATA0() bfin_read16(CAN_MB16_DATA0)
+#define bfin_write_CAN_MB16_DATA0(val) bfin_write16(CAN_MB16_DATA0, val)
+#define bfin_read_CAN_MB16_DATA1() bfin_read16(CAN_MB16_DATA1)
+#define bfin_write_CAN_MB16_DATA1(val) bfin_write16(CAN_MB16_DATA1, val)
+#define bfin_read_CAN_MB16_DATA2() bfin_read16(CAN_MB16_DATA2)
+#define bfin_write_CAN_MB16_DATA2(val) bfin_write16(CAN_MB16_DATA2, val)
+#define bfin_read_CAN_MB16_DATA3() bfin_read16(CAN_MB16_DATA3)
+#define bfin_write_CAN_MB16_DATA3(val) bfin_write16(CAN_MB16_DATA3, val)
+#define bfin_read_CAN_MB16_LENGTH() bfin_read16(CAN_MB16_LENGTH)
+#define bfin_write_CAN_MB16_LENGTH(val) bfin_write16(CAN_MB16_LENGTH, val)
+#define bfin_read_CAN_MB16_TIMESTAMP() bfin_read16(CAN_MB16_TIMESTAMP)
+#define bfin_write_CAN_MB16_TIMESTAMP(val) bfin_write16(CAN_MB16_TIMESTAMP, val)
+#define bfin_read_CAN_MB16_ID0() bfin_read16(CAN_MB16_ID0)
+#define bfin_write_CAN_MB16_ID0(val) bfin_write16(CAN_MB16_ID0, val)
+#define bfin_read_CAN_MB16_ID1() bfin_read16(CAN_MB16_ID1)
+#define bfin_write_CAN_MB16_ID1(val) bfin_write16(CAN_MB16_ID1, val)
+#define bfin_read_CAN_MB17_DATA0() bfin_read16(CAN_MB17_DATA0)
+#define bfin_write_CAN_MB17_DATA0(val) bfin_write16(CAN_MB17_DATA0, val)
+#define bfin_read_CAN_MB17_DATA1() bfin_read16(CAN_MB17_DATA1)
+#define bfin_write_CAN_MB17_DATA1(val) bfin_write16(CAN_MB17_DATA1, val)
+#define bfin_read_CAN_MB17_DATA2() bfin_read16(CAN_MB17_DATA2)
+#define bfin_write_CAN_MB17_DATA2(val) bfin_write16(CAN_MB17_DATA2, val)
+#define bfin_read_CAN_MB17_DATA3() bfin_read16(CAN_MB17_DATA3)
+#define bfin_write_CAN_MB17_DATA3(val) bfin_write16(CAN_MB17_DATA3, val)
+#define bfin_read_CAN_MB17_LENGTH() bfin_read16(CAN_MB17_LENGTH)
+#define bfin_write_CAN_MB17_LENGTH(val) bfin_write16(CAN_MB17_LENGTH, val)
+#define bfin_read_CAN_MB17_TIMESTAMP() bfin_read16(CAN_MB17_TIMESTAMP)
+#define bfin_write_CAN_MB17_TIMESTAMP(val) bfin_write16(CAN_MB17_TIMESTAMP, val)
+#define bfin_read_CAN_MB17_ID0() bfin_read16(CAN_MB17_ID0)
+#define bfin_write_CAN_MB17_ID0(val) bfin_write16(CAN_MB17_ID0, val)
+#define bfin_read_CAN_MB17_ID1() bfin_read16(CAN_MB17_ID1)
+#define bfin_write_CAN_MB17_ID1(val) bfin_write16(CAN_MB17_ID1, val)
+#define bfin_read_CAN_MB18_DATA0() bfin_read16(CAN_MB18_DATA0)
+#define bfin_write_CAN_MB18_DATA0(val) bfin_write16(CAN_MB18_DATA0, val)
+#define bfin_read_CAN_MB18_DATA1() bfin_read16(CAN_MB18_DATA1)
+#define bfin_write_CAN_MB18_DATA1(val) bfin_write16(CAN_MB18_DATA1, val)
+#define bfin_read_CAN_MB18_DATA2() bfin_read16(CAN_MB18_DATA2)
+#define bfin_write_CAN_MB18_DATA2(val) bfin_write16(CAN_MB18_DATA2, val)
+#define bfin_read_CAN_MB18_DATA3() bfin_read16(CAN_MB18_DATA3)
+#define bfin_write_CAN_MB18_DATA3(val) bfin_write16(CAN_MB18_DATA3, val)
+#define bfin_read_CAN_MB18_LENGTH() bfin_read16(CAN_MB18_LENGTH)
+#define bfin_write_CAN_MB18_LENGTH(val) bfin_write16(CAN_MB18_LENGTH, val)
+#define bfin_read_CAN_MB18_TIMESTAMP() bfin_read16(CAN_MB18_TIMESTAMP)
+#define bfin_write_CAN_MB18_TIMESTAMP(val) bfin_write16(CAN_MB18_TIMESTAMP, val)
+#define bfin_read_CAN_MB18_ID0() bfin_read16(CAN_MB18_ID0)
+#define bfin_write_CAN_MB18_ID0(val) bfin_write16(CAN_MB18_ID0, val)
+#define bfin_read_CAN_MB18_ID1() bfin_read16(CAN_MB18_ID1)
+#define bfin_write_CAN_MB18_ID1(val) bfin_write16(CAN_MB18_ID1, val)
+#define bfin_read_CAN_MB19_DATA0() bfin_read16(CAN_MB19_DATA0)
+#define bfin_write_CAN_MB19_DATA0(val) bfin_write16(CAN_MB19_DATA0, val)
+#define bfin_read_CAN_MB19_DATA1() bfin_read16(CAN_MB19_DATA1)
+#define bfin_write_CAN_MB19_DATA1(val) bfin_write16(CAN_MB19_DATA1, val)
+#define bfin_read_CAN_MB19_DATA2() bfin_read16(CAN_MB19_DATA2)
+#define bfin_write_CAN_MB19_DATA2(val) bfin_write16(CAN_MB19_DATA2, val)
+#define bfin_read_CAN_MB19_DATA3() bfin_read16(CAN_MB19_DATA3)
+#define bfin_write_CAN_MB19_DATA3(val) bfin_write16(CAN_MB19_DATA3, val)
+#define bfin_read_CAN_MB19_LENGTH() bfin_read16(CAN_MB19_LENGTH)
+#define bfin_write_CAN_MB19_LENGTH(val) bfin_write16(CAN_MB19_LENGTH, val)
+#define bfin_read_CAN_MB19_TIMESTAMP() bfin_read16(CAN_MB19_TIMESTAMP)
+#define bfin_write_CAN_MB19_TIMESTAMP(val) bfin_write16(CAN_MB19_TIMESTAMP, val)
+#define bfin_read_CAN_MB19_ID0() bfin_read16(CAN_MB19_ID0)
+#define bfin_write_CAN_MB19_ID0(val) bfin_write16(CAN_MB19_ID0, val)
+#define bfin_read_CAN_MB19_ID1() bfin_read16(CAN_MB19_ID1)
+#define bfin_write_CAN_MB19_ID1(val) bfin_write16(CAN_MB19_ID1, val)
+#define bfin_read_CAN_MB20_DATA0() bfin_read16(CAN_MB20_DATA0)
+#define bfin_write_CAN_MB20_DATA0(val) bfin_write16(CAN_MB20_DATA0, val)
+#define bfin_read_CAN_MB20_DATA1() bfin_read16(CAN_MB20_DATA1)
+#define bfin_write_CAN_MB20_DATA1(val) bfin_write16(CAN_MB20_DATA1, val)
+#define bfin_read_CAN_MB20_DATA2() bfin_read16(CAN_MB20_DATA2)
+#define bfin_write_CAN_MB20_DATA2(val) bfin_write16(CAN_MB20_DATA2, val)
+#define bfin_read_CAN_MB20_DATA3() bfin_read16(CAN_MB20_DATA3)
+#define bfin_write_CAN_MB20_DATA3(val) bfin_write16(CAN_MB20_DATA3, val)
+#define bfin_read_CAN_MB20_LENGTH() bfin_read16(CAN_MB20_LENGTH)
+#define bfin_write_CAN_MB20_LENGTH(val) bfin_write16(CAN_MB20_LENGTH, val)
+#define bfin_read_CAN_MB20_TIMESTAMP() bfin_read16(CAN_MB20_TIMESTAMP)
+#define bfin_write_CAN_MB20_TIMESTAMP(val) bfin_write16(CAN_MB20_TIMESTAMP, val)
+#define bfin_read_CAN_MB20_ID0() bfin_read16(CAN_MB20_ID0)
+#define bfin_write_CAN_MB20_ID0(val) bfin_write16(CAN_MB20_ID0, val)
+#define bfin_read_CAN_MB20_ID1() bfin_read16(CAN_MB20_ID1)
+#define bfin_write_CAN_MB20_ID1(val) bfin_write16(CAN_MB20_ID1, val)
+#define bfin_read_CAN_MB21_DATA0() bfin_read16(CAN_MB21_DATA0)
+#define bfin_write_CAN_MB21_DATA0(val) bfin_write16(CAN_MB21_DATA0, val)
+#define bfin_read_CAN_MB21_DATA1() bfin_read16(CAN_MB21_DATA1)
+#define bfin_write_CAN_MB21_DATA1(val) bfin_write16(CAN_MB21_DATA1, val)
+#define bfin_read_CAN_MB21_DATA2() bfin_read16(CAN_MB21_DATA2)
+#define bfin_write_CAN_MB21_DATA2(val) bfin_write16(CAN_MB21_DATA2, val)
+#define bfin_read_CAN_MB21_DATA3() bfin_read16(CAN_MB21_DATA3)
+#define bfin_write_CAN_MB21_DATA3(val) bfin_write16(CAN_MB21_DATA3, val)
+#define bfin_read_CAN_MB21_LENGTH() bfin_read16(CAN_MB21_LENGTH)
+#define bfin_write_CAN_MB21_LENGTH(val) bfin_write16(CAN_MB21_LENGTH, val)
+#define bfin_read_CAN_MB21_TIMESTAMP() bfin_read16(CAN_MB21_TIMESTAMP)
+#define bfin_write_CAN_MB21_TIMESTAMP(val) bfin_write16(CAN_MB21_TIMESTAMP, val)
+#define bfin_read_CAN_MB21_ID0() bfin_read16(CAN_MB21_ID0)
+#define bfin_write_CAN_MB21_ID0(val) bfin_write16(CAN_MB21_ID0, val)
+#define bfin_read_CAN_MB21_ID1() bfin_read16(CAN_MB21_ID1)
+#define bfin_write_CAN_MB21_ID1(val) bfin_write16(CAN_MB21_ID1, val)
+#define bfin_read_CAN_MB22_DATA0() bfin_read16(CAN_MB22_DATA0)
+#define bfin_write_CAN_MB22_DATA0(val) bfin_write16(CAN_MB22_DATA0, val)
+#define bfin_read_CAN_MB22_DATA1() bfin_read16(CAN_MB22_DATA1)
+#define bfin_write_CAN_MB22_DATA1(val) bfin_write16(CAN_MB22_DATA1, val)
+#define bfin_read_CAN_MB22_DATA2() bfin_read16(CAN_MB22_DATA2)
+#define bfin_write_CAN_MB22_DATA2(val) bfin_write16(CAN_MB22_DATA2, val)
+#define bfin_read_CAN_MB22_DATA3() bfin_read16(CAN_MB22_DATA3)
+#define bfin_write_CAN_MB22_DATA3(val) bfin_write16(CAN_MB22_DATA3, val)
+#define bfin_read_CAN_MB22_LENGTH() bfin_read16(CAN_MB22_LENGTH)
+#define bfin_write_CAN_MB22_LENGTH(val) bfin_write16(CAN_MB22_LENGTH, val)
+#define bfin_read_CAN_MB22_TIMESTAMP() bfin_read16(CAN_MB22_TIMESTAMP)
+#define bfin_write_CAN_MB22_TIMESTAMP(val) bfin_write16(CAN_MB22_TIMESTAMP, val)
+#define bfin_read_CAN_MB22_ID0() bfin_read16(CAN_MB22_ID0)
+#define bfin_write_CAN_MB22_ID0(val) bfin_write16(CAN_MB22_ID0, val)
+#define bfin_read_CAN_MB22_ID1() bfin_read16(CAN_MB22_ID1)
+#define bfin_write_CAN_MB22_ID1(val) bfin_write16(CAN_MB22_ID1, val)
+#define bfin_read_CAN_MB23_DATA0() bfin_read16(CAN_MB23_DATA0)
+#define bfin_write_CAN_MB23_DATA0(val) bfin_write16(CAN_MB23_DATA0, val)
+#define bfin_read_CAN_MB23_DATA1() bfin_read16(CAN_MB23_DATA1)
+#define bfin_write_CAN_MB23_DATA1(val) bfin_write16(CAN_MB23_DATA1, val)
+#define bfin_read_CAN_MB23_DATA2() bfin_read16(CAN_MB23_DATA2)
+#define bfin_write_CAN_MB23_DATA2(val) bfin_write16(CAN_MB23_DATA2, val)
+#define bfin_read_CAN_MB23_DATA3() bfin_read16(CAN_MB23_DATA3)
+#define bfin_write_CAN_MB23_DATA3(val) bfin_write16(CAN_MB23_DATA3, val)
+#define bfin_read_CAN_MB23_LENGTH() bfin_read16(CAN_MB23_LENGTH)
+#define bfin_write_CAN_MB23_LENGTH(val) bfin_write16(CAN_MB23_LENGTH, val)
+#define bfin_read_CAN_MB23_TIMESTAMP() bfin_read16(CAN_MB23_TIMESTAMP)
+#define bfin_write_CAN_MB23_TIMESTAMP(val) bfin_write16(CAN_MB23_TIMESTAMP, val)
+#define bfin_read_CAN_MB23_ID0() bfin_read16(CAN_MB23_ID0)
+#define bfin_write_CAN_MB23_ID0(val) bfin_write16(CAN_MB23_ID0, val)
+#define bfin_read_CAN_MB23_ID1() bfin_read16(CAN_MB23_ID1)
+#define bfin_write_CAN_MB23_ID1(val) bfin_write16(CAN_MB23_ID1, val)
+#define bfin_read_CAN_MB24_DATA0() bfin_read16(CAN_MB24_DATA0)
+#define bfin_write_CAN_MB24_DATA0(val) bfin_write16(CAN_MB24_DATA0, val)
+#define bfin_read_CAN_MB24_DATA1() bfin_read16(CAN_MB24_DATA1)
+#define bfin_write_CAN_MB24_DATA1(val) bfin_write16(CAN_MB24_DATA1, val)
+#define bfin_read_CAN_MB24_DATA2() bfin_read16(CAN_MB24_DATA2)
+#define bfin_write_CAN_MB24_DATA2(val) bfin_write16(CAN_MB24_DATA2, val)
+#define bfin_read_CAN_MB24_DATA3() bfin_read16(CAN_MB24_DATA3)
+#define bfin_write_CAN_MB24_DATA3(val) bfin_write16(CAN_MB24_DATA3, val)
+#define bfin_read_CAN_MB24_LENGTH() bfin_read16(CAN_MB24_LENGTH)
+#define bfin_write_CAN_MB24_LENGTH(val) bfin_write16(CAN_MB24_LENGTH, val)
+#define bfin_read_CAN_MB24_TIMESTAMP() bfin_read16(CAN_MB24_TIMESTAMP)
+#define bfin_write_CAN_MB24_TIMESTAMP(val) bfin_write16(CAN_MB24_TIMESTAMP, val)
+#define bfin_read_CAN_MB24_ID0() bfin_read16(CAN_MB24_ID0)
+#define bfin_write_CAN_MB24_ID0(val) bfin_write16(CAN_MB24_ID0, val)
+#define bfin_read_CAN_MB24_ID1() bfin_read16(CAN_MB24_ID1)
+#define bfin_write_CAN_MB24_ID1(val) bfin_write16(CAN_MB24_ID1, val)
+#define bfin_read_CAN_MB25_DATA0() bfin_read16(CAN_MB25_DATA0)
+#define bfin_write_CAN_MB25_DATA0(val) bfin_write16(CAN_MB25_DATA0, val)
+#define bfin_read_CAN_MB25_DATA1() bfin_read16(CAN_MB25_DATA1)
+#define bfin_write_CAN_MB25_DATA1(val) bfin_write16(CAN_MB25_DATA1, val)
+#define bfin_read_CAN_MB25_DATA2() bfin_read16(CAN_MB25_DATA2)
+#define bfin_write_CAN_MB25_DATA2(val) bfin_write16(CAN_MB25_DATA2, val)
+#define bfin_read_CAN_MB25_DATA3() bfin_read16(CAN_MB25_DATA3)
+#define bfin_write_CAN_MB25_DATA3(val) bfin_write16(CAN_MB25_DATA3, val)
+#define bfin_read_CAN_MB25_LENGTH() bfin_read16(CAN_MB25_LENGTH)
+#define bfin_write_CAN_MB25_LENGTH(val) bfin_write16(CAN_MB25_LENGTH, val)
+#define bfin_read_CAN_MB25_TIMESTAMP() bfin_read16(CAN_MB25_TIMESTAMP)
+#define bfin_write_CAN_MB25_TIMESTAMP(val) bfin_write16(CAN_MB25_TIMESTAMP, val)
+#define bfin_read_CAN_MB25_ID0() bfin_read16(CAN_MB25_ID0)
+#define bfin_write_CAN_MB25_ID0(val) bfin_write16(CAN_MB25_ID0, val)
+#define bfin_read_CAN_MB25_ID1() bfin_read16(CAN_MB25_ID1)
+#define bfin_write_CAN_MB25_ID1(val) bfin_write16(CAN_MB25_ID1, val)
+#define bfin_read_CAN_MB26_DATA0() bfin_read16(CAN_MB26_DATA0)
+#define bfin_write_CAN_MB26_DATA0(val) bfin_write16(CAN_MB26_DATA0, val)
+#define bfin_read_CAN_MB26_DATA1() bfin_read16(CAN_MB26_DATA1)
+#define bfin_write_CAN_MB26_DATA1(val) bfin_write16(CAN_MB26_DATA1, val)
+#define bfin_read_CAN_MB26_DATA2() bfin_read16(CAN_MB26_DATA2)
+#define bfin_write_CAN_MB26_DATA2(val) bfin_write16(CAN_MB26_DATA2, val)
+#define bfin_read_CAN_MB26_DATA3() bfin_read16(CAN_MB26_DATA3)
+#define bfin_write_CAN_MB26_DATA3(val) bfin_write16(CAN_MB26_DATA3, val)
+#define bfin_read_CAN_MB26_LENGTH() bfin_read16(CAN_MB26_LENGTH)
+#define bfin_write_CAN_MB26_LENGTH(val) bfin_write16(CAN_MB26_LENGTH, val)
+#define bfin_read_CAN_MB26_TIMESTAMP() bfin_read16(CAN_MB26_TIMESTAMP)
+#define bfin_write_CAN_MB26_TIMESTAMP(val) bfin_write16(CAN_MB26_TIMESTAMP, val)
+#define bfin_read_CAN_MB26_ID0() bfin_read16(CAN_MB26_ID0)
+#define bfin_write_CAN_MB26_ID0(val) bfin_write16(CAN_MB26_ID0, val)
+#define bfin_read_CAN_MB26_ID1() bfin_read16(CAN_MB26_ID1)
+#define bfin_write_CAN_MB26_ID1(val) bfin_write16(CAN_MB26_ID1, val)
+#define bfin_read_CAN_MB27_DATA0() bfin_read16(CAN_MB27_DATA0)
+#define bfin_write_CAN_MB27_DATA0(val) bfin_write16(CAN_MB27_DATA0, val)
+#define bfin_read_CAN_MB27_DATA1() bfin_read16(CAN_MB27_DATA1)
+#define bfin_write_CAN_MB27_DATA1(val) bfin_write16(CAN_MB27_DATA1, val)
+#define bfin_read_CAN_MB27_DATA2() bfin_read16(CAN_MB27_DATA2)
+#define bfin_write_CAN_MB27_DATA2(val) bfin_write16(CAN_MB27_DATA2, val)
+#define bfin_read_CAN_MB27_DATA3() bfin_read16(CAN_MB27_DATA3)
+#define bfin_write_CAN_MB27_DATA3(val) bfin_write16(CAN_MB27_DATA3, val)
+#define bfin_read_CAN_MB27_LENGTH() bfin_read16(CAN_MB27_LENGTH)
+#define bfin_write_CAN_MB27_LENGTH(val) bfin_write16(CAN_MB27_LENGTH, val)
+#define bfin_read_CAN_MB27_TIMESTAMP() bfin_read16(CAN_MB27_TIMESTAMP)
+#define bfin_write_CAN_MB27_TIMESTAMP(val) bfin_write16(CAN_MB27_TIMESTAMP, val)
+#define bfin_read_CAN_MB27_ID0() bfin_read16(CAN_MB27_ID0)
+#define bfin_write_CAN_MB27_ID0(val) bfin_write16(CAN_MB27_ID0, val)
+#define bfin_read_CAN_MB27_ID1() bfin_read16(CAN_MB27_ID1)
+#define bfin_write_CAN_MB27_ID1(val) bfin_write16(CAN_MB27_ID1, val)
+#define bfin_read_CAN_MB28_DATA0() bfin_read16(CAN_MB28_DATA0)
+#define bfin_write_CAN_MB28_DATA0(val) bfin_write16(CAN_MB28_DATA0, val)
+#define bfin_read_CAN_MB28_DATA1() bfin_read16(CAN_MB28_DATA1)
+#define bfin_write_CAN_MB28_DATA1(val) bfin_write16(CAN_MB28_DATA1, val)
+#define bfin_read_CAN_MB28_DATA2() bfin_read16(CAN_MB28_DATA2)
+#define bfin_write_CAN_MB28_DATA2(val) bfin_write16(CAN_MB28_DATA2, val)
+#define bfin_read_CAN_MB28_DATA3() bfin_read16(CAN_MB28_DATA3)
+#define bfin_write_CAN_MB28_DATA3(val) bfin_write16(CAN_MB28_DATA3, val)
+#define bfin_read_CAN_MB28_LENGTH() bfin_read16(CAN_MB28_LENGTH)
+#define bfin_write_CAN_MB28_LENGTH(val) bfin_write16(CAN_MB28_LENGTH, val)
+#define bfin_read_CAN_MB28_TIMESTAMP() bfin_read16(CAN_MB28_TIMESTAMP)
+#define bfin_write_CAN_MB28_TIMESTAMP(val) bfin_write16(CAN_MB28_TIMESTAMP, val)
+#define bfin_read_CAN_MB28_ID0() bfin_read16(CAN_MB28_ID0)
+#define bfin_write_CAN_MB28_ID0(val) bfin_write16(CAN_MB28_ID0, val)
+#define bfin_read_CAN_MB28_ID1() bfin_read16(CAN_MB28_ID1)
+#define bfin_write_CAN_MB28_ID1(val) bfin_write16(CAN_MB28_ID1, val)
+#define bfin_read_CAN_MB29_DATA0() bfin_read16(CAN_MB29_DATA0)
+#define bfin_write_CAN_MB29_DATA0(val) bfin_write16(CAN_MB29_DATA0, val)
+#define bfin_read_CAN_MB29_DATA1() bfin_read16(CAN_MB29_DATA1)
+#define bfin_write_CAN_MB29_DATA1(val) bfin_write16(CAN_MB29_DATA1, val)
+#define bfin_read_CAN_MB29_DATA2() bfin_read16(CAN_MB29_DATA2)
+#define bfin_write_CAN_MB29_DATA2(val) bfin_write16(CAN_MB29_DATA2, val)
+#define bfin_read_CAN_MB29_DATA3() bfin_read16(CAN_MB29_DATA3)
+#define bfin_write_CAN_MB29_DATA3(val) bfin_write16(CAN_MB29_DATA3, val)
+#define bfin_read_CAN_MB29_LENGTH() bfin_read16(CAN_MB29_LENGTH)
+#define bfin_write_CAN_MB29_LENGTH(val) bfin_write16(CAN_MB29_LENGTH, val)
+#define bfin_read_CAN_MB29_TIMESTAMP() bfin_read16(CAN_MB29_TIMESTAMP)
+#define bfin_write_CAN_MB29_TIMESTAMP(val) bfin_write16(CAN_MB29_TIMESTAMP, val)
+#define bfin_read_CAN_MB29_ID0() bfin_read16(CAN_MB29_ID0)
+#define bfin_write_CAN_MB29_ID0(val) bfin_write16(CAN_MB29_ID0, val)
+#define bfin_read_CAN_MB29_ID1() bfin_read16(CAN_MB29_ID1)
+#define bfin_write_CAN_MB29_ID1(val) bfin_write16(CAN_MB29_ID1, val)
+#define bfin_read_CAN_MB30_DATA0() bfin_read16(CAN_MB30_DATA0)
+#define bfin_write_CAN_MB30_DATA0(val) bfin_write16(CAN_MB30_DATA0, val)
+#define bfin_read_CAN_MB30_DATA1() bfin_read16(CAN_MB30_DATA1)
+#define bfin_write_CAN_MB30_DATA1(val) bfin_write16(CAN_MB30_DATA1, val)
+#define bfin_read_CAN_MB30_DATA2() bfin_read16(CAN_MB30_DATA2)
+#define bfin_write_CAN_MB30_DATA2(val) bfin_write16(CAN_MB30_DATA2, val)
+#define bfin_read_CAN_MB30_DATA3() bfin_read16(CAN_MB30_DATA3)
+#define bfin_write_CAN_MB30_DATA3(val) bfin_write16(CAN_MB30_DATA3, val)
+#define bfin_read_CAN_MB30_LENGTH() bfin_read16(CAN_MB30_LENGTH)
+#define bfin_write_CAN_MB30_LENGTH(val) bfin_write16(CAN_MB30_LENGTH, val)
+#define bfin_read_CAN_MB30_TIMESTAMP() bfin_read16(CAN_MB30_TIMESTAMP)
+#define bfin_write_CAN_MB30_TIMESTAMP(val) bfin_write16(CAN_MB30_TIMESTAMP, val)
+#define bfin_read_CAN_MB30_ID0() bfin_read16(CAN_MB30_ID0)
+#define bfin_write_CAN_MB30_ID0(val) bfin_write16(CAN_MB30_ID0, val)
+#define bfin_read_CAN_MB30_ID1() bfin_read16(CAN_MB30_ID1)
+#define bfin_write_CAN_MB30_ID1(val) bfin_write16(CAN_MB30_ID1, val)
+#define bfin_read_CAN_MB31_DATA0() bfin_read16(CAN_MB31_DATA0)
+#define bfin_write_CAN_MB31_DATA0(val) bfin_write16(CAN_MB31_DATA0, val)
+#define bfin_read_CAN_MB31_DATA1() bfin_read16(CAN_MB31_DATA1)
+#define bfin_write_CAN_MB31_DATA1(val) bfin_write16(CAN_MB31_DATA1, val)
+#define bfin_read_CAN_MB31_DATA2() bfin_read16(CAN_MB31_DATA2)
+#define bfin_write_CAN_MB31_DATA2(val) bfin_write16(CAN_MB31_DATA2, val)
+#define bfin_read_CAN_MB31_DATA3() bfin_read16(CAN_MB31_DATA3)
+#define bfin_write_CAN_MB31_DATA3(val) bfin_write16(CAN_MB31_DATA3, val)
+#define bfin_read_CAN_MB31_LENGTH() bfin_read16(CAN_MB31_LENGTH)
+#define bfin_write_CAN_MB31_LENGTH(val) bfin_write16(CAN_MB31_LENGTH, val)
+#define bfin_read_CAN_MB31_TIMESTAMP() bfin_read16(CAN_MB31_TIMESTAMP)
+#define bfin_write_CAN_MB31_TIMESTAMP(val) bfin_write16(CAN_MB31_TIMESTAMP, val)
+#define bfin_read_CAN_MB31_ID0() bfin_read16(CAN_MB31_ID0)
+#define bfin_write_CAN_MB31_ID0(val) bfin_write16(CAN_MB31_ID0, val)
+#define bfin_read_CAN_MB31_ID1() bfin_read16(CAN_MB31_ID1)
+#define bfin_write_CAN_MB31_ID1(val) bfin_write16(CAN_MB31_ID1, val)
+#define bfin_read_PWM1_CTRL() bfin_read16(PWM1_CTRL)
+#define bfin_write_PWM1_CTRL(val) bfin_write16(PWM1_CTRL, val)
+#define bfin_read_PWM1_STAT() bfin_read16(PWM1_STAT)
+#define bfin_write_PWM1_STAT(val) bfin_write16(PWM1_STAT, val)
+#define bfin_read_PWM1_TM() bfin_read16(PWM1_TM)
+#define bfin_write_PWM1_TM(val) bfin_write16(PWM1_TM, val)
+#define bfin_read_PWM1_DT() bfin_read16(PWM1_DT)
+#define bfin_write_PWM1_DT(val) bfin_write16(PWM1_DT, val)
+#define bfin_read_PWM1_GATE() bfin_read16(PWM1_GATE)
+#define bfin_write_PWM1_GATE(val) bfin_write16(PWM1_GATE, val)
+#define bfin_read_PWM1_CHA() bfin_read16(PWM1_CHA)
+#define bfin_write_PWM1_CHA(val) bfin_write16(PWM1_CHA, val)
+#define bfin_read_PWM1_CHB() bfin_read16(PWM1_CHB)
+#define bfin_write_PWM1_CHB(val) bfin_write16(PWM1_CHB, val)
+#define bfin_read_PWM1_CHC() bfin_read16(PWM1_CHC)
+#define bfin_write_PWM1_CHC(val) bfin_write16(PWM1_CHC, val)
+#define bfin_read_PWM1_SEG() bfin_read16(PWM1_SEG)
+#define bfin_write_PWM1_SEG(val) bfin_write16(PWM1_SEG, val)
+#define bfin_read_PWM1_SYNCWT() bfin_read16(PWM1_SYNCWT)
+#define bfin_write_PWM1_SYNCWT(val) bfin_write16(PWM1_SYNCWT, val)
+#define bfin_read_PWM1_CHAL() bfin_read16(PWM1_CHAL)
+#define bfin_write_PWM1_CHAL(val) bfin_write16(PWM1_CHAL, val)
+#define bfin_read_PWM1_CHBL() bfin_read16(PWM1_CHBL)
+#define bfin_write_PWM1_CHBL(val) bfin_write16(PWM1_CHBL, val)
+#define bfin_read_PWM1_CHCL() bfin_read16(PWM1_CHCL)
+#define bfin_write_PWM1_CHCL(val) bfin_write16(PWM1_CHCL, val)
+#define bfin_read_PWM1_LSI() bfin_read16(PWM1_LSI)
+#define bfin_write_PWM1_LSI(val) bfin_write16(PWM1_LSI, val)
+#define bfin_read_PWM1_STAT2() bfin_read16(PWM1_STAT2)
+#define bfin_write_PWM1_STAT2(val) bfin_write16(PWM1_STAT2, val)
+#define bfin_read_PORTF_FER() bfin_read16(PORTF_FER)
+#define bfin_write_PORTF_FER(val) bfin_write16(PORTF_FER, val)
+#define bfin_read_PORTG_FER() bfin_read16(PORTG_FER)
+#define bfin_write_PORTG_FER(val) bfin_write16(PORTG_FER, val)
+#define bfin_read_PORTH_FER() bfin_read16(PORTH_FER)
+#define bfin_write_PORTH_FER(val) bfin_write16(PORTH_FER, val)
+#define bfin_read_PORTF_MUX() bfin_read16(PORTF_MUX)
+#define bfin_write_PORTF_MUX(val) bfin_write16(PORTF_MUX, val)
+#define bfin_read_PORTG_MUX() bfin_read16(PORTG_MUX)
+#define bfin_write_PORTG_MUX(val) bfin_write16(PORTG_MUX, val)
+#define bfin_read_PORTH_MUX() bfin_read16(PORTH_MUX)
+#define bfin_write_PORTH_MUX(val) bfin_write16(PORTH_MUX, val)
+#define bfin_read_PORTF_DRIVE() bfin_read16(PORTF_DRIVE)
+#define bfin_write_PORTF_DRIVE(val) bfin_write16(PORTF_DRIVE, val)
+#define bfin_read_PORTG_DRIVE() bfin_read16(PORTG_DRIVE)
+#define bfin_write_PORTG_DRIVE(val) bfin_write16(PORTG_DRIVE, val)
+#define bfin_read_PORTH_DRIVE() bfin_read16(PORTH_DRIVE)
+#define bfin_write_PORTH_DRIVE(val) bfin_write16(PORTH_DRIVE, val)
+#define bfin_read_PORTF_HYSTERESIS() bfin_read16(PORTF_HYSTERESIS)
+#define bfin_write_PORTF_HYSTERESIS(val) bfin_write16(PORTF_HYSTERESIS, val)
+#define bfin_read_PORTG_HYSTERESIS() bfin_read16(PORTG_HYSTERESIS)
+#define bfin_write_PORTG_HYSTERESIS(val) bfin_write16(PORTG_HYSTERESIS, val)
+#define bfin_read_PORTH_HYSTERESIS() bfin_read16(PORTH_HYSTERESIS)
+#define bfin_write_PORTH_HYSTERESIS(val) bfin_write16(PORTH_HYSTERESIS, val)
+#define bfin_read_NONGPIO_DRIVE() bfin_read16(NONGPIO_DRIVE)
+#define bfin_write_NONGPIO_DRIVE(val) bfin_write16(NONGPIO_DRIVE, val)
+#define bfin_read_NONGPIO_HYSTERESIS() bfin_read16(NONGPIO_HYSTERESIS)
+#define bfin_write_NONGPIO_HYSTERESIS(val) bfin_write16(NONGPIO_HYSTERESIS, val)
+#define bfin_read_FLASH_CONTROL() bfin_read16(FLASH_CONTROL)
+#define bfin_write_FLASH_CONTROL(val) bfin_write16(FLASH_CONTROL, val)
+#define bfin_read_FLASH_CONTROL_SET() bfin_read16(FLASH_CONTROL_SET)
+#define bfin_write_FLASH_CONTROL_SET(val) bfin_write16(FLASH_CONTROL_SET, val)
+#define bfin_read_FLASH_CONTROL_CLEAR() bfin_read16(FLASH_CONTROL_CLEAR)
+#define bfin_write_FLASH_CONTROL_CLEAR(val) bfin_write16(FLASH_CONTROL_CLEAR, val)
+#define bfin_read_CNT1_CONFIG() bfin_read16(CNT1_CONFIG)
+#define bfin_write_CNT1_CONFIG(val) bfin_write16(CNT1_CONFIG, val)
+#define bfin_read_CNT1_IMASK() bfin_read16(CNT1_IMASK)
+#define bfin_write_CNT1_IMASK(val) bfin_write16(CNT1_IMASK, val)
+#define bfin_read_CNT1_STATUS() bfin_read16(CNT1_STATUS)
+#define bfin_write_CNT1_STATUS(val) bfin_write16(CNT1_STATUS, val)
+#define bfin_read_CNT1_COMMAND() bfin_read16(CNT1_COMMAND)
+#define bfin_write_CNT1_COMMAND(val) bfin_write16(CNT1_COMMAND, val)
+#define bfin_read_CNT1_DEBOUNCE() bfin_read16(CNT1_DEBOUNCE)
+#define bfin_write_CNT1_DEBOUNCE(val) bfin_write16(CNT1_DEBOUNCE, val)
+#define bfin_read_CNT1_COUNTER() bfin_read32(CNT1_COUNTER)
+#define bfin_write_CNT1_COUNTER(val) bfin_write32(CNT1_COUNTER, val)
+#define bfin_read_CNT1_MAX() bfin_read32(CNT1_MAX)
+#define bfin_write_CNT1_MAX(val) bfin_write32(CNT1_MAX, val)
+#define bfin_read_CNT1_MIN() bfin_read32(CNT1_MIN)
+#define bfin_write_CNT1_MIN(val) bfin_write32(CNT1_MIN, val)
+#define bfin_read_SPI1_CTL() bfin_read16(SPI1_CTL)
+#define bfin_write_SPI1_CTL(val) bfin_write16(SPI1_CTL, val)
+#define bfin_read_SPI1_FLG() bfin_read16(SPI1_FLG)
+#define bfin_write_SPI1_FLG(val) bfin_write16(SPI1_FLG, val)
+#define bfin_read_SPI1_STAT() bfin_read16(SPI1_STAT)
+#define bfin_write_SPI1_STAT(val) bfin_write16(SPI1_STAT, val)
+#define bfin_read_SPI1_TDBR() bfin_read16(SPI1_TDBR)
+#define bfin_write_SPI1_TDBR(val) bfin_write16(SPI1_TDBR, val)
+#define bfin_read_SPI1_RDBR() bfin_read16(SPI1_RDBR)
+#define bfin_write_SPI1_RDBR(val) bfin_write16(SPI1_RDBR, val)
+#define bfin_read_SPI1_BAUD() bfin_read16(SPI1_BAUD)
+#define bfin_write_SPI1_BAUD(val) bfin_write16(SPI1_BAUD, val)
+#define bfin_read_SPI1_SHADOW() bfin_read16(SPI1_SHADOW)
+#define bfin_write_SPI1_SHADOW(val) bfin_write16(SPI1_SHADOW, val)
+#define bfin_read_CNT0_CONFIG() bfin_read16(CNT0_CONFIG)
+#define bfin_write_CNT0_CONFIG(val) bfin_write16(CNT0_CONFIG, val)
+#define bfin_read_CNT0_IMASK() bfin_read16(CNT0_IMASK)
+#define bfin_write_CNT0_IMASK(val) bfin_write16(CNT0_IMASK, val)
+#define bfin_read_CNT0_STATUS() bfin_read16(CNT0_STATUS)
+#define bfin_write_CNT0_STATUS(val) bfin_write16(CNT0_STATUS, val)
+#define bfin_read_CNT0_COMMAND() bfin_read16(CNT0_COMMAND)
+#define bfin_write_CNT0_COMMAND(val) bfin_write16(CNT0_COMMAND, val)
+#define bfin_read_CNT0_DEBOUNCE() bfin_read16(CNT0_DEBOUNCE)
+#define bfin_write_CNT0_DEBOUNCE(val) bfin_write16(CNT0_DEBOUNCE, val)
+#define bfin_read_CNT0_COUNTER() bfin_read32(CNT0_COUNTER)
+#define bfin_write_CNT0_COUNTER(val) bfin_write32(CNT0_COUNTER, val)
+#define bfin_read_CNT0_MAX() bfin_read32(CNT0_MAX)
+#define bfin_write_CNT0_MAX(val) bfin_write32(CNT0_MAX, val)
+#define bfin_read_CNT0_MIN() bfin_read32(CNT0_MIN)
+#define bfin_write_CNT0_MIN(val) bfin_write32(CNT0_MIN, val)
+#define bfin_read_PWM0_CTRL() bfin_read16(PWM0_CTRL)
+#define bfin_write_PWM0_CTRL(val) bfin_write16(PWM0_CTRL, val)
+#define bfin_read_PWM0_STAT() bfin_read16(PWM0_STAT)
+#define bfin_write_PWM0_STAT(val) bfin_write16(PWM0_STAT, val)
+#define bfin_read_PWM0_TM() bfin_read16(PWM0_TM)
+#define bfin_write_PWM0_TM(val) bfin_write16(PWM0_TM, val)
+#define bfin_read_PWM0_DT() bfin_read16(PWM0_DT)
+#define bfin_write_PWM0_DT(val) bfin_write16(PWM0_DT, val)
+#define bfin_read_PWM0_GATE() bfin_read16(PWM0_GATE)
+#define bfin_write_PWM0_GATE(val) bfin_write16(PWM0_GATE, val)
+#define bfin_read_PWM0_CHA() bfin_read16(PWM0_CHA)
+#define bfin_write_PWM0_CHA(val) bfin_write16(PWM0_CHA, val)
+#define bfin_read_PWM0_CHB() bfin_read16(PWM0_CHB)
+#define bfin_write_PWM0_CHB(val) bfin_write16(PWM0_CHB, val)
+#define bfin_read_PWM0_CHC() bfin_read16(PWM0_CHC)
+#define bfin_write_PWM0_CHC(val) bfin_write16(PWM0_CHC, val)
+#define bfin_read_PWM0_SEG() bfin_read16(PWM0_SEG)
+#define bfin_write_PWM0_SEG(val) bfin_write16(PWM0_SEG, val)
+#define bfin_read_PWM0_SYNCWT() bfin_read16(PWM0_SYNCWT)
+#define bfin_write_PWM0_SYNCWT(val) bfin_write16(PWM0_SYNCWT, val)
+#define bfin_read_PWM0_CHAL() bfin_read16(PWM0_CHAL)
+#define bfin_write_PWM0_CHAL(val) bfin_write16(PWM0_CHAL, val)
+#define bfin_read_PWM0_CHBL() bfin_read16(PWM0_CHBL)
+#define bfin_write_PWM0_CHBL(val) bfin_write16(PWM0_CHBL, val)
+#define bfin_read_PWM0_CHCL() bfin_read16(PWM0_CHCL)
+#define bfin_write_PWM0_CHCL(val) bfin_write16(PWM0_CHCL, val)
+#define bfin_read_PWM0_LSI() bfin_read16(PWM0_LSI)
+#define bfin_write_PWM0_LSI(val) bfin_write16(PWM0_LSI, val)
+#define bfin_read_PWM0_STAT2() bfin_read16(PWM0_STAT2)
+#define bfin_write_PWM0_STAT2(val) bfin_write16(PWM0_STAT2, val)
+#define bfin_read_RSI_PWR_CONTROL() bfin_read16(RSI_PWR_CONTROL)
+#define bfin_write_RSI_PWR_CONTROL(val) bfin_write16(RSI_PWR_CONTROL, val)
+#define bfin_read_RSI_CLK_CONTROL() bfin_read16(RSI_CLK_CONTROL)
+#define bfin_write_RSI_CLK_CONTROL(val) bfin_write16(RSI_CLK_CONTROL, val)
+#define bfin_read_RSI_ARGUMENT() bfin_read32(RSI_ARGUMENT)
+#define bfin_write_RSI_ARGUMENT(val) bfin_write32(RSI_ARGUMENT, val)
+#define bfin_read_RSI_COMMAND() bfin_read16(RSI_COMMAND)
+#define bfin_write_RSI_COMMAND(val) bfin_write16(RSI_COMMAND, val)
+#define bfin_read_RSI_RESP_CMD() bfin_read16(RSI_RESP_CMD)
+#define bfin_write_RSI_RESP_CMD(val) bfin_write16(RSI_RESP_CMD, val)
+#define bfin_read_RSI_RESPONSE0() bfin_read32(RSI_RESPONSE0)
+#define bfin_write_RSI_RESPONSE0(val) bfin_write32(RSI_RESPONSE0, val)
+#define bfin_read_RSI_RESPONSE1() bfin_read32(RSI_RESPONSE1)
+#define bfin_write_RSI_RESPONSE1(val) bfin_write32(RSI_RESPONSE1, val)
+#define bfin_read_RSI_RESPONSE2() bfin_read32(RSI_RESPONSE2)
+#define bfin_write_RSI_RESPONSE2(val) bfin_write32(RSI_RESPONSE2, val)
+#define bfin_read_RSI_RESPONSE3() bfin_read32(RSI_RESPONSE3)
+#define bfin_write_RSI_RESPONSE3(val) bfin_write32(RSI_RESPONSE3, val)
+#define bfin_read_RSI_DATA_TIMER() bfin_read32(RSI_DATA_TIMER)
+#define bfin_write_RSI_DATA_TIMER(val) bfin_write32(RSI_DATA_TIMER, val)
+#define bfin_read_RSI_DATA_LGTH() bfin_read16(RSI_DATA_LGTH)
+#define bfin_write_RSI_DATA_LGTH(val) bfin_write16(RSI_DATA_LGTH, val)
+#define bfin_read_RSI_DATA_CONTROL() bfin_read16(RSI_DATA_CONTROL)
+#define bfin_write_RSI_DATA_CONTROL(val) bfin_write16(RSI_DATA_CONTROL, val)
+#define bfin_read_RSI_DATA_CNT() bfin_read16(RSI_DATA_CNT)
+#define bfin_write_RSI_DATA_CNT(val) bfin_write16(RSI_DATA_CNT, val)
+#define bfin_read_RSI_STATUS() bfin_read32(RSI_STATUS)
+#define bfin_write_RSI_STATUS(val) bfin_write32(RSI_STATUS, val)
+#define bfin_read_RSI_STATUSCL() bfin_read16(RSI_STATUSCL)
+#define bfin_write_RSI_STATUSCL(val) bfin_write16(RSI_STATUSCL, val)
+#define bfin_read_RSI_MASK0() bfin_read32(RSI_MASK0)
+#define bfin_write_RSI_MASK0(val) bfin_write32(RSI_MASK0, val)
+#define bfin_read_RSI_MASK1() bfin_read32(RSI_MASK1)
+#define bfin_write_RSI_MASK1(val) bfin_write32(RSI_MASK1, val)
+#define bfin_read_RSI_FIFO_CNT() bfin_read16(RSI_FIFO_CNT)
+#define bfin_write_RSI_FIFO_CNT(val) bfin_write16(RSI_FIFO_CNT, val)
+#define bfin_read_RSI_CEATA_CONTROL() bfin_read16(RSI_CEATA_CONTROL)
+#define bfin_write_RSI_CEATA_CONTROL(val) bfin_write16(RSI_CEATA_CONTROL, val)
+#define bfin_read_RSI_FIFO() bfin_read32(RSI_FIFO)
+#define bfin_write_RSI_FIFO(val) bfin_write32(RSI_FIFO, val)
+#define bfin_read_RSI_ESTAT() bfin_read16(RSI_ESTAT)
+#define bfin_write_RSI_ESTAT(val) bfin_write16(RSI_ESTAT, val)
+#define bfin_read_RSI_EMASK() bfin_read16(RSI_EMASK)
+#define bfin_write_RSI_EMASK(val) bfin_write16(RSI_EMASK, val)
+#define bfin_read_RSI_CONFIG() bfin_read16(RSI_CONFIG)
+#define bfin_write_RSI_CONFIG(val) bfin_write16(RSI_CONFIG, val)
+#define bfin_read_RSI_RD_WAIT_EN() bfin_read16(RSI_RD_WAIT_EN)
+#define bfin_write_RSI_RD_WAIT_EN(val) bfin_write16(RSI_RD_WAIT_EN, val)
+#define bfin_read_RSI_PID0() bfin_read16(RSI_PID0)
+#define bfin_write_RSI_PID0(val) bfin_write16(RSI_PID0, val)
+#define bfin_read_RSI_PID1() bfin_read16(RSI_PID1)
+#define bfin_write_RSI_PID1(val) bfin_write16(RSI_PID1, val)
+#define bfin_read_RSI_PID2() bfin_read16(RSI_PID2)
+#define bfin_write_RSI_PID2(val) bfin_write16(RSI_PID2, val)
+#define bfin_read_RSI_PID3() bfin_read16(RSI_PID3)
+#define bfin_write_RSI_PID3(val) bfin_write16(RSI_PID3, val)
+#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
+#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT, val)
+#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
+#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER, val)
+
+#endif /* __BFIN_CDEF_ADSP_BF504_proc__ */
diff --git a/arch/blackfin/include/asm/mach-bf506/BF504_def.h b/arch/blackfin/include/asm/mach-bf506/BF504_def.h
new file mode 100644 (file)
index 0000000..8b0345f
--- /dev/null
@@ -0,0 +1,944 @@
+/* DO NOT EDIT THIS FILE
+ * Automatically generated by generate-def-headers.xsl
+ * DO NOT EDIT THIS FILE
+ */
+
+#ifndef __BFIN_DEF_ADSP_BF504_proc__
+#define __BFIN_DEF_ADSP_BF504_proc__
+
+#include "../mach-common/ADSP-EDN-core_def.h"
+
+#define PLL_CTL                        0xFFC00000 /* PLL Control Register */
+#define PLL_DIV                        0xFFC00004 /* PLL Divide Register */
+#define VR_CTL                         0xFFC00008 /* Voltage Regulator Control Register */
+#define PLL_STAT                       0xFFC0000C /* PLL Status Register */
+#define PLL_LOCKCNT                    0xFFC00010 /* PLL Lock Count Register */
+#define CHIPID                         0xFFC00014
+#define SWRST                          0xFFC00100 /* Software Reset Register */
+#define SYSCR                          0xFFC00104 /* System Configuration register */
+#define SIC_RVECT                      0xFFC00108 /* Interrupt Reset Vector Address Register */
+#define SIC_IMASK0                     0xFFC0010C /* Interrupt Mask Register */
+#define SIC_IAR0                       0xFFC00110 /* Interrupt Assignment Register 0 */
+#define SIC_IAR1                       0xFFC00114 /* Interrupt Assignment Register 1 */
+#define SIC_IAR2                       0xFFC00118 /* Interrupt Assignment Register 2 */
+#define SIC_IAR3                       0xFFC0011C /* Interrupt Assignment Register 3 */
+#define SIC_ISR0                       0xFFC00120 /* Interrupt Status Register */
+#define SIC_IWR0                       0xFFC00124 /* Interrupt Wakeup Register */
+#define SIC_IMASK1                     0xFFC0014C /* Interrupt Mask register of SIC2 */
+#define SIC_IAR4                       0xFFC00150 /* Interrupt Assignment register4 */
+#define SIC_IAR5                       0xFFC00154 /* Interrupt Assignment register5 */
+#define SIC_IAR6                       0xFFC00158 /* Interrupt Assignment register6 */
+#define SIC_IAR7                       0xFFC0015C /* Interrupt Assignment register7 */
+#define SIC_ISR1                       0xFFC00160 /* Interrupt Status register */
+#define SIC_IWR1                       0xFFC00164 /* Interrupt Wakeup register */
+#define WDOG_CTL                       0xFFC00200 /* Watchdog Control Register */
+#define WDOG_CNT                       0xFFC00204 /* Watchdog Count Register */
+#define WDOG_STAT                      0xFFC00208 /* Watchdog Status Register */
+#define UART0_DLL                      0xFFC00400 /* Divisor Latch Low Byte */
+#define UART0_DLH                      0xFFC00404 /* Divisor Latch High Byte */
+#define UART0_GCTL                     0xFFC00408 /* Global Control Register */
+#define UART0_LCR                      0xFFC0040C /* Line Control Register */
+#define UART0_MCR                      0xFFC00410 /* Modem Control Register */
+#define UART0_LSR                      0xFFC00414 /* Line Status Register */
+#define UART0_MSR                      0xFFC00418 /* Modem Status Register */
+#define UART0_SCR                      0xFFC0041C /* Scratch Register */
+#define UART0_IER_SET                  0xFFC00420 /* Interrupt Enable Register Set */
+#define UART0_IER_CLEAR                0xFFC00424 /* Interrupt Enable Register Clear */
+#define UART0_THR                      0xFFC00428 /* Transmit Hold Register */
+#define UART0_RBR                      0xFFC0042C /* Receive Buffer Register */
+#define SPI0_CTL                       0xFFC00500 /* SPI0 Control Register */
+#define SPI0_FLG                       0xFFC00504 /* SPI0 Flag register */
+#define SPI0_STAT                      0xFFC00508 /* SPI0 Status register */
+#define SPI0_TDBR                      0xFFC0050C /* SPI0 Transmit Data Buffer Register */
+#define SPI0_RDBR                      0xFFC00510 /* SPI0 Receive Data Buffer Register */
+#define SPI0_BAUD                      0xFFC00514 /* SPI0 Baud rate Register */
+#define SPI0_SHADOW                    0xFFC00518 /* SPI0_RDBR Shadow Register */
+#define TIMER0_CONFIG                  0xFFC00600 /* Timer 0 Configuration Register */
+#define TIMER0_COUNTER                 0xFFC00604 /* Timer 0 Counter Register */
+#define TIMER0_PERIOD                  0xFFC00608 /* Timer 0 Period Register */
+#define TIMER0_WIDTH                   0xFFC0060C /* Timer 0 Width Register */
+#define TIMER1_CONFIG                  0xFFC00610 /* Timer 1 Configuration Register */
+#define TIMER1_COUNTER                 0xFFC00614 /* Timer 1 Counter Register */
+#define TIMER1_PERIOD                  0xFFC00618 /* Timer 1 Period Register */
+#define TIMER1_WIDTH                   0xFFC0061C /* Timer 1 Width Register */
+#define TIMER2_CONFIG                  0xFFC00620 /* Timer 2 Configuration Register */
+#define TIMER2_COUNTER                 0xFFC00624 /* Timer 2 Counter Register */
+#define TIMER2_PERIOD                  0xFFC00628 /* Timer 2 Period Register */
+#define TIMER2_WIDTH                   0xFFC0062C /* Timer 2 Width Register */
+#define TIMER3_CONFIG                  0xFFC00630 /* Timer 3 Configuration Register */
+#define TIMER3_COUNTER                 0xFFC00634 /* Timer 3 Counter Register */
+#define TIMER3_PERIOD                  0xFFC00638 /* Timer 3 Period Register */
+#define TIMER3_WIDTH                   0xFFC0063C /* Timer 3 Width Register */
+#define TIMER4_CONFIG                  0xFFC00640 /* Timer 4 Configuration Register */
+#define TIMER4_COUNTER                 0xFFC00644 /* Timer 4 Counter Register */
+#define TIMER4_PERIOD                  0xFFC00648 /* Timer 4 Period Register */
+#define TIMER4_WIDTH                   0xFFC0064C /* Timer 4 Width Register */
+#define TIMER5_CONFIG                  0xFFC00650 /* Timer 5 Configuration Register */
+#define TIMER5_COUNTER                 0xFFC00654 /* Timer 5 Counter Register */
+#define TIMER5_PERIOD                  0xFFC00658 /* Timer 5 Period Register */
+#define TIMER5_WIDTH                   0xFFC0065C /* Timer 5 Width Register */
+#define TIMER6_CONFIG                  0xFFC00660 /* Timer 6 Configuration Register */
+#define TIMER6_COUNTER                 0xFFC00664 /* Timer 6 Counter Register */
+#define TIMER6_PERIOD                  0xFFC00668 /* Timer 6 Period Register */
+#define TIMER6_WIDTH                   0xFFC0066C /* Timer 6 Width Register\n */
+#define TIMER7_CONFIG                  0xFFC00670 /* Timer 7 Configuration Register */
+#define TIMER7_COUNTER                 0xFFC00674 /* Timer 7 Counter Register */
+#define TIMER7_PERIOD                  0xFFC00678 /* Timer 7 Period Register */
+#define TIMER7_WIDTH                   0xFFC0067C /* Timer 7 Width Register */
+#define TIMER_ENABLE                   0xFFC00680 /* Timer Enable Register */
+#define TIMER_DISABLE                  0xFFC00684 /* Timer Disable Register */
+#define TIMER_STATUS                   0xFFC00688 /* Timer Status Register */
+#define PORTFIO                        0xFFC00700 /* Port F I/O Pin State Specify Register */
+#define PORTFIO_CLEAR                  0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register */
+#define PORTFIO_SET                    0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register */
+#define PORTFIO_TOGGLE                 0xFFC0070C /* Port F I/O Pin State Toggle Register */
+#define PORTFIO_MASKA                  0xFFC00710 /* Port F I/O Mask State Specify Interrupt A Register */
+#define PORTFIO_MASKA_CLEAR            0xFFC00714 /* Port F I/O Mask Disable Interrupt A Register */
+#define PORTFIO_MASKA_SET              0xFFC00718 /* Port F I/O Mask Enable Interrupt A Register */
+#define PORTFIO_MASKA_TOGGLE           0xFFC0071C /* Port F I/O Mask Toggle Enable Interrupt A Register */
+#define PORTFIO_MASKB                  0xFFC00720 /* Port F I/O Mask State Specify Interrupt B Register */
+#define PORTFIO_MASKB_CLEAR            0xFFC00724 /* Port F I/O Mask Disable Interrupt B Register */
+#define PORTFIO_MASKB_SET              0xFFC00728 /* Port F I/O Mask Enable Interrupt B Register */
+#define PORTFIO_MASKB_TOGGLE           0xFFC0072C /* Port F I/O Mask Toggle Enable Interrupt B Register */
+#define PORTFIO_DIR                    0xFFC00730 /* Port F I/O Direction Register */
+#define PORTFIO_POLAR                  0xFFC00734 /* Port F I/O Source Polarity Register */
+#define PORTFIO_EDGE                   0xFFC00738 /* Port F I/O Source Sensitivity Register */
+#define PORTFIO_BOTH                   0xFFC0073C /* Port F I/O Set on BOTH Edges Register */
+#define PORTFIO_INEN                   0xFFC00740 /* Port F I/O Input Enable Register  */
+#define SPORT0_TCR1                    0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
+#define SPORT0_TCR2                    0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
+#define SPORT0_TCLKDIV                 0xFFC00808 /* SPORT0 Transmit Clock Divider */
+#define SPORT0_TFSDIV                  0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
+#define SPORT0_TX                      0xFFC00810 /* SPORT0 TX Data Register */
+#define SPORT0_RX                      0xFFC00818 /* SPORT0 RX Data Register */
+#define SPORT0_RCR1                    0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
+#define SPORT0_RCR2                    0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
+#define SPORT0_RCLKDIV                 0xFFC00828 /* SPORT0 Receive Clock Divider */
+#define SPORT0_RFSDIV                  0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
+#define SPORT0_STAT                    0xFFC00830 /* SPORT0 Status Register */
+#define SPORT0_CHNL                    0xFFC00834 /* SPORT0 Current Channel Register */
+#define SPORT0_MCMC1                   0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
+#define SPORT0_MCMC2                   0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
+#define SPORT0_MTCS0                   0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
+#define SPORT0_MTCS1                   0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
+#define SPORT0_MTCS2                   0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
+#define SPORT0_MTCS3                   0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
+#define SPORT0_MRCS0                   0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
+#define SPORT0_MRCS1                   0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
+#define SPORT0_MRCS2                   0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
+#define SPORT0_MRCS3                   0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
+#define SPORT1_TCR1                    0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
+#define SPORT1_TCR2                    0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
+#define SPORT1_TCLKDIV                 0xFFC00908 /* SPORT1 Transmit Clock Divider */
+#define SPORT1_TFSDIV                  0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
+#define SPORT1_TX                      0xFFC00910 /* SPORT1 TX Data Register */
+#define SPORT1_RX                      0xFFC00918 /* SPORT1 RX Data Register */
+#define SPORT1_RCR1                    0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
+#define SPORT1_RCR2                    0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
+#define SPORT1_RCLKDIV                 0xFFC00928 /* SPORT1 Receive Clock Divider */
+#define SPORT1_RFSDIV                  0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
+#define SPORT1_STAT                    0xFFC00930 /* SPORT1 Status Register */
+#define SPORT1_CHNL                    0xFFC00934 /* SPORT1 Current Channel Register */
+#define SPORT1_MCMC1                   0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
+#define SPORT1_MCMC2                   0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
+#define SPORT1_MTCS0                   0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
+#define SPORT1_MTCS1                   0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
+#define SPORT1_MTCS2                   0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
+#define SPORT1_MTCS3                   0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
+#define SPORT1_MRCS0                   0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
+#define SPORT1_MRCS1                   0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
+#define SPORT1_MRCS2                   0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
+#define SPORT1_MRCS3                   0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
+#define EBIU_AMGCTL                    0xFFC00A00 /* Asynchronous Memory Global Control Register */
+#define EBIU_AMBCTL0                   0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
+#define EBIU_AMBCTL1                   0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
+#define EBIU_MODE                      0xFFC00A20 /* Asynchronous Memory Mode Control Register */
+#define EBIU_FCTL                      0xFFC00A24 /* Asynchronous Memory Parameter Control Register */
+#define DMA0_NEXT_DESC_PTR             0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
+#define DMA0_START_ADDR                0xFFC00C04 /* DMA Channel 0 Start Address Register */
+#define DMA0_CONFIG                    0xFFC00C08 /* DMA Channel 0 Configuration Register */
+#define DMA0_X_COUNT                   0xFFC00C10 /* DMA Channel 0 X Count Register */
+#define DMA0_X_MODIFY                  0xFFC00C14 /* DMA Channel 0 X Modify Register */
+#define DMA0_Y_COUNT                   0xFFC00C18 /* DMA Channel 0 Y Count Register */
+#define DMA0_Y_MODIFY                  0xFFC00C1C /* DMA Channel 0 Y Modify Register */
+#define DMA0_CURR_DESC_PTR             0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
+#define DMA0_CURR_ADDR                 0xFFC00C24 /* DMA Channel 0 Current Address Register */
+#define DMA0_IRQ_STATUS                0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
+#define DMA0_PERIPHERAL_MAP            0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
+#define DMA0_CURR_X_COUNT              0xFFC00C30 /* DMA Channel 0 Current X Count Register */
+#define DMA0_CURR_Y_COUNT              0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
+#define DMA1_NEXT_DESC_PTR             0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
+#define DMA1_START_ADDR                0xFFC00C44 /* DMA Channel 1 Start Address Register */
+#define DMA1_CONFIG                    0xFFC00C48 /* DMA Channel 1 Configuration Register */
+#define DMA1_X_COUNT                   0xFFC00C50 /* DMA Channel 1 X Count Register */
+#define DMA1_X_MODIFY                  0xFFC00C54 /* DMA Channel 1 X Modify Register */
+#define DMA1_Y_COUNT                   0xFFC00C58 /* DMA Channel 1 Y Count Register */
+#define DMA1_Y_MODIFY                  0xFFC00C5C /* DMA Channel 1 Y Modify Register */
+#define DMA1_CURR_DESC_PTR             0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
+#define DMA1_CURR_ADDR                 0xFFC00C64 /* DMA Channel 1 Current Address Register */
+#define DMA1_IRQ_STATUS                0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
+#define DMA1_PERIPHERAL_MAP            0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
+#define DMA1_CURR_X_COUNT              0xFFC00C70 /* DMA Channel 1 Current X Count Register */
+#define DMA1_CURR_Y_COUNT              0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
+#define DMA2_NEXT_DESC_PTR             0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
+#define DMA2_START_ADDR                0xFFC00C84 /* DMA Channel 2 Start Address Register */
+#define DMA2_CONFIG                    0xFFC00C88 /* DMA Channel 2 Configuration Register */
+#define DMA2_X_COUNT                   0xFFC00C90 /* DMA Channel 2 X Count Register */
+#define DMA2_X_MODIFY                  0xFFC00C94 /* DMA Channel 2 X Modify Register */
+#define DMA2_Y_COUNT                   0xFFC00C98 /* DMA Channel 2 Y Count Register */
+#define DMA2_Y_MODIFY                  0xFFC00C9C /* DMA Channel 2 Y Modify Register */
+#define DMA2_CURR_DESC_PTR             0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
+#define DMA2_CURR_ADDR                 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
+#define DMA2_IRQ_STATUS                0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
+#define DMA2_PERIPHERAL_MAP            0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
+#define DMA2_CURR_X_COUNT              0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
+#define DMA2_CURR_Y_COUNT              0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
+#define DMA3_NEXT_DESC_PTR             0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
+#define DMA3_START_ADDR                0xFFC00CC4 /* DMA Channel 3 Start Address Register */
+#define DMA3_CONFIG                    0xFFC00CC8 /* DMA Channel 3 Configuration Register */
+#define DMA3_X_COUNT                   0xFFC00CD0 /* DMA Channel 3 X Count Register */
+#define DMA3_X_MODIFY                  0xFFC00CD4 /* DMA Channel 3 X Modify Register */
+#define DMA3_Y_COUNT                   0xFFC00CD8 /* DMA Channel 3 Y Count Register */
+#define DMA3_Y_MODIFY                  0xFFC00CDC /* DMA Channel 3 Y Modify Register */
+#define DMA3_CURR_DESC_PTR             0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
+#define DMA3_CURR_ADDR                 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
+#define DMA3_IRQ_STATUS                0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
+#define DMA3_PERIPHERAL_MAP            0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
+#define DMA3_CURR_X_COUNT              0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
+#define DMA3_CURR_Y_COUNT              0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
+#define DMA4_NEXT_DESC_PTR             0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
+#define DMA4_START_ADDR                0xFFC00D04 /* DMA Channel 4 Start Address Register */
+#define DMA4_CONFIG                    0xFFC00D08 /* DMA Channel 4 Configuration Register */
+#define DMA4_X_COUNT                   0xFFC00D10 /* DMA Channel 4 X Count Register */
+#define DMA4_X_MODIFY                  0xFFC00D14 /* DMA Channel 4 X Modify Register */
+#define DMA4_Y_COUNT                   0xFFC00D18 /* DMA Channel 4 Y Count Register */
+#define DMA4_Y_MODIFY                  0xFFC00D1C /* DMA Channel 4 Y Modify Register */
+#define DMA4_CURR_DESC_PTR             0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
+#define DMA4_CURR_ADDR                 0xFFC00D24 /* DMA Channel 4 Current Address Register */
+#define DMA4_IRQ_STATUS                0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
+#define DMA4_PERIPHERAL_MAP            0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
+#define DMA4_CURR_X_COUNT              0xFFC00D30 /* DMA Channel 4 Current X Count Register */
+#define DMA4_CURR_Y_COUNT              0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
+#define DMA5_NEXT_DESC_PTR             0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
+#define DMA5_START_ADDR                0xFFC00D44 /* DMA Channel 5 Start Address Register */
+#define DMA5_CONFIG                    0xFFC00D48 /* DMA Channel 5 Configuration Register */
+#define DMA5_X_COUNT                   0xFFC00D50 /* DMA Channel 5 X Count Register */
+#define DMA5_X_MODIFY                  0xFFC00D54 /* DMA Channel 5 X Modify Register */
+#define DMA5_Y_COUNT                   0xFFC00D58 /* DMA Channel 5 Y Count Register */
+#define DMA5_Y_MODIFY                  0xFFC00D5C /* DMA Channel 5 Y Modify Register */
+#define DMA5_CURR_DESC_PTR             0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
+#define DMA5_CURR_ADDR                 0xFFC00D64 /* DMA Channel 5 Current Address Register */
+#define DMA5_IRQ_STATUS                0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
+#define DMA5_PERIPHERAL_MAP            0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
+#define DMA5_CURR_X_COUNT              0xFFC00D70 /* DMA Channel 5 Current X Count Register */
+#define DMA5_CURR_Y_COUNT              0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
+#define DMA6_NEXT_DESC_PTR             0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
+#define DMA6_START_ADDR                0xFFC00D84 /* DMA Channel 6 Start Address Register */
+#define DMA6_CONFIG                    0xFFC00D88 /* DMA Channel 6 Configuration Register */
+#define DMA6_X_COUNT                   0xFFC00D90 /* DMA Channel 6 X Count Register */
+#define DMA6_X_MODIFY                  0xFFC00D94 /* DMA Channel 6 X Modify Register */
+#define DMA6_Y_COUNT                   0xFFC00D98 /* DMA Channel 6 Y Count Register */
+#define DMA6_Y_MODIFY                  0xFFC00D9C /* DMA Channel 6 Y Modify Register */
+#define DMA6_CURR_DESC_PTR             0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
+#define DMA6_CURR_ADDR                 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
+#define DMA6_IRQ_STATUS                0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
+#define DMA6_PERIPHERAL_MAP            0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
+#define DMA6_CURR_X_COUNT              0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
+#define DMA6_CURR_Y_COUNT              0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
+#define DMA7_NEXT_DESC_PTR             0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
+#define DMA7_START_ADDR                0xFFC00DC4 /* DMA Channel 7 Start Address Register */
+#define DMA7_CONFIG                    0xFFC00DC8 /* DMA Channel 7 Configuration Register */
+#define DMA7_X_COUNT                   0xFFC00DD0 /* DMA Channel 7 X Count Register */
+#define DMA7_X_MODIFY                  0xFFC00DD4 /* DMA Channel 7 X Modify Register */
+#define DMA7_Y_COUNT                   0xFFC00DD8 /* DMA Channel 7 Y Count Register */
+#define DMA7_Y_MODIFY                  0xFFC00DDC /* DMA Channel 7 Y Modify Register */
+#define DMA7_CURR_DESC_PTR             0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
+#define DMA7_CURR_ADDR                 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
+#define DMA7_IRQ_STATUS                0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
+#define DMA7_PERIPHERAL_MAP            0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
+#define DMA7_CURR_X_COUNT              0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
+#define DMA7_CURR_Y_COUNT              0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
+#define DMA8_NEXT_DESC_PTR             0xFFC00E00 /* DMA Channel 8 Next Descriptor Pointer Register */
+#define DMA8_START_ADDR                0xFFC00E04 /* DMA Channel 8 Start Address Register */
+#define DMA8_CONFIG                    0xFFC00E08 /* DMA Channel 8 Configuration Register */
+#define DMA8_X_COUNT                   0xFFC00E10 /* DMA Channel 8 X Count Register */
+#define DMA8_X_MODIFY                  0xFFC00E14 /* DMA Channel 8 X Modify Register */
+#define DMA8_Y_COUNT                   0xFFC00E18 /* DMA Channel 8 Y Count Register */
+#define DMA8_Y_MODIFY                  0xFFC00E1C /* DMA Channel 8 Y Modify Register */
+#define DMA8_CURR_DESC_PTR             0xFFC00E20 /* DMA Channel 8 Current Descriptor Pointer Register */
+#define DMA8_CURR_ADDR                 0xFFC00E24 /* DMA Channel 8 Current Address Register */
+#define DMA8_IRQ_STATUS                0xFFC00E28 /* DMA Channel 8 Interrupt/Status Register */
+#define DMA8_PERIPHERAL_MAP            0xFFC00E2C /* DMA Channel 8 Peripheral Map Register */
+#define DMA8_CURR_X_COUNT              0xFFC00E30 /* DMA Channel 8 Current X Count Register */
+#define DMA8_CURR_Y_COUNT              0xFFC00E38 /* DMA Channel 8 Current Y Count Register */
+#define DMA9_NEXT_DESC_PTR             0xFFC00E40 /* DMA Channel 9 Next Descriptor Pointer Register */
+#define DMA9_START_ADDR                0xFFC00E44 /* DMA Channel 9 Start Address Register */
+#define DMA9_CONFIG                    0xFFC00E48 /* DMA Channel 9 Configuration Register */
+#define DMA9_X_COUNT                   0xFFC00E50 /* DMA Channel 9 X Count Register */
+#define DMA9_X_MODIFY                  0xFFC00E54 /* DMA Channel 9 X Modify Register */
+#define DMA9_Y_COUNT                   0xFFC00E58 /* DMA Channel 9 Y Count Register */
+#define DMA9_Y_MODIFY                  0xFFC00E5C /* DMA Channel 9 Y Modify Register */
+#define DMA9_CURR_DESC_PTR             0xFFC00E60 /* DMA Channel 9 Current Descriptor Pointer Register */
+#define DMA9_CURR_ADDR                 0xFFC00E64 /* DMA Channel 9 Current Address Register */
+#define DMA9_IRQ_STATUS                0xFFC00E68 /* DMA Channel 9 Interrupt/Status Register */
+#define DMA9_PERIPHERAL_MAP            0xFFC00E6C /* DMA Channel 9 Peripheral Map Register */
+#define DMA9_CURR_X_COUNT              0xFFC00E70 /* DMA Channel 9 Current X Count Register */
+#define DMA9_CURR_Y_COUNT              0xFFC00E78 /* DMA Channel 9 Current Y Count Register */
+#define DMA10_NEXT_DESC_PTR            0xFFC00E80 /* DMA Channel 10 Next Descriptor Pointer Register */
+#define DMA10_START_ADDR               0xFFC00E84 /* DMA Channel 10 Start Address Register */
+#define DMA10_CONFIG                   0xFFC00E88 /* DMA Channel 10 Configuration Register */
+#define DMA10_X_COUNT                  0xFFC00E90 /* DMA Channel 10 X Count Register */
+#define DMA10_X_MODIFY                 0xFFC00E94 /* DMA Channel 10 X Modify Register */
+#define DMA10_Y_COUNT                  0xFFC00E98 /* DMA Channel 10 Y Count Register */
+#define DMA10_Y_MODIFY                 0xFFC00E9C /* DMA Channel 10 Y Modify Register */
+#define DMA10_CURR_DESC_PTR            0xFFC00EA0 /* DMA Channel 10 Current Descriptor Pointer Register */
+#define DMA10_CURR_ADDR                0xFFC00EA4 /* DMA Channel 10 Current Address Register */
+#define DMA10_IRQ_STATUS               0xFFC00EA8 /* DMA Channel 10 Interrupt/Status Register */
+#define DMA10_PERIPHERAL_MAP           0xFFC00EAC /* DMA Channel 10 Peripheral Map Register */
+#define DMA10_CURR_X_COUNT             0xFFC00EB0 /* DMA Channel 10 Current X Count Register */
+#define DMA10_CURR_Y_COUNT             0xFFC00EB8 /* DMA Channel 10 Current Y Count Register */
+#define DMA11_NEXT_DESC_PTR            0xFFC00EC0 /* DMA Channel 11 Next Descriptor Pointer Register */
+#define DMA11_START_ADDR               0xFFC00EC4 /* DMA Channel 11 Start Address Register */
+#define DMA11_CONFIG                   0xFFC00EC8 /* DMA Channel 11 Configuration Register */
+#define DMA11_X_COUNT                  0xFFC00ED0 /* DMA Channel 11 X Count Register */
+#define DMA11_X_MODIFY                 0xFFC00ED4 /* DMA Channel 11 X Modify Register */
+#define DMA11_Y_COUNT                  0xFFC00ED8 /* DMA Channel 11 Y Count Register */
+#define DMA11_Y_MODIFY                 0xFFC00EDC /* DMA Channel 11 Y Modify Register */
+#define DMA11_CURR_DESC_PTR            0xFFC00EE0 /* DMA Channel 11 Current Descriptor Pointer Register */
+#define DMA11_CURR_ADDR                0xFFC00EE4 /* DMA Channel 11 Current Address Register */
+#define DMA11_IRQ_STATUS               0xFFC00EE8 /* DMA Channel 11 Interrupt/Status Register */
+#define DMA11_PERIPHERAL_MAP           0xFFC00EEC /* DMA Channel 11 Peripheral Map Register */
+#define DMA11_CURR_X_COUNT             0xFFC00EF0 /* DMA Channel 11 Current X Count Register */
+#define DMA11_CURR_Y_COUNT             0xFFC00EF8 /* DMA Channel 11 Current Y Count Register */
+#define MDMA_S0_NEXT_DESC_PTR          0xFFC00F40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
+#define MDMA_S0_START_ADDR             0xFFC00F44 /* MemDMA Stream 0 Source Start Address Register */
+#define MDMA_S0_CONFIG                 0xFFC00F48 /* MemDMA Stream 0 Source Configuration Register */
+#define MDMA_S0_X_COUNT                0xFFC00F50 /* MemDMA Stream 0 Source X Count Register */
+#define MDMA_S0_X_MODIFY               0xFFC00F54 /* MemDMA Stream 0 Source X Modify Register */
+#define MDMA_S0_Y_COUNT                0xFFC00F58 /* MemDMA Stream 0 Source Y Count Register */
+#define MDMA_S0_Y_MODIFY               0xFFC00F5C /* MemDMA Stream 0 Source Y Modify Register */
+#define MDMA_S0_CURR_DESC_PTR          0xFFC00F60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
+#define MDMA_S0_CURR_ADDR              0xFFC00F64 /* MemDMA Stream 0 Source Current Address Register */
+#define MDMA_S0_IRQ_STATUS             0xFFC00F68 /* MemDMA Stream 0 Source Interrupt/Status Register */
+#define MDMA_S0_PERIPHERAL_MAP         0xFFC00F6C /* MemDMA Stream 0 Source Peripheral Map Register */
+#define MDMA_S0_CURR_X_COUNT           0xFFC00F70 /* MemDMA Stream 0 Source Current X Count Register */
+#define MDMA_S0_CURR_Y_COUNT           0xFFC00F78 /* MemDMA Stream 0 Source Current Y Count Register */
+#define MDMA_D0_NEXT_DESC_PTR          0xFFC00F00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
+#define MDMA_D0_START_ADDR             0xFFC00F04 /* MemDMA Stream 0 Destination Start Address Register */
+#define MDMA_D0_CONFIG                 0xFFC00F08 /* MemDMA Stream 0 Destination Configuration Register */
+#define MDMA_D0_X_COUNT                0xFFC00F10 /* MemDMA Stream 0 Destination X Count Register */
+#define MDMA_D0_X_MODIFY               0xFFC00F14 /* MemDMA Stream 0 Destination X Modify Register */
+#define MDMA_D0_Y_COUNT                0xFFC00F18 /* MemDMA Stream 0 Destination Y Count Register */
+#define MDMA_D0_Y_MODIFY               0xFFC00F1C /* MemDMA Stream 0 Destination Y Modify Register */
+#define MDMA_D0_CURR_DESC_PTR          0xFFC00F20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
+#define MDMA_D0_CURR_ADDR              0xFFC00F24 /* MemDMA Stream 0 Destination Current Address Register */
+#define MDMA_D0_IRQ_STATUS             0xFFC00F28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
+#define MDMA_D0_PERIPHERAL_MAP         0xFFC00F2C /* MemDMA Stream 0 Destination Peripheral Map Register */
+#define MDMA_D0_CURR_X_COUNT           0xFFC00F30 /* MemDMA Stream 0 Destination Current X Count Register */
+#define MDMA_D0_CURR_Y_COUNT           0xFFC00F38 /* MemDMA Stream 0 Destination Current Y Count Register */
+#define MDMA_S1_NEXT_DESC_PTR          0xFFC00FC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
+#define MDMA_S1_START_ADDR             0xFFC00FC4 /* MemDMA Stream 1 Source Start Address Register */
+#define MDMA_S1_CONFIG                 0xFFC00FC8 /* MemDMA Stream 1 Source Configuration Register */
+#define MDMA_S1_X_COUNT                0xFFC00FD0 /* MemDMA Stream 1 Source X Count Register */
+#define MDMA_S1_X_MODIFY               0xFFC00FD4 /* MemDMA Stream 1 Source X Modify Register */
+#define MDMA_S1_Y_COUNT                0xFFC00FD8 /* MemDMA Stream 1 Source Y Count Register */
+#define MDMA_S1_Y_MODIFY               0xFFC00FDC /* MemDMA Stream 1 Source Y Modify Register */
+#define MDMA_S1_CURR_DESC_PTR          0xFFC00FE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
+#define MDMA_S1_CURR_ADDR              0xFFC00FE4 /* MemDMA Stream 1 Source Current Address Register */
+#define MDMA_S1_IRQ_STATUS             0xFFC00FE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
+#define MDMA_S1_PERIPHERAL_MAP         0xFFC00FEC /* MemDMA Stream 1 Source Peripheral Map Register */
+#define MDMA_S1_CURR_X_COUNT           0xFFC00FF0 /* MemDMA Stream 1 Source Current X Count Register */
+#define MDMA_S1_CURR_Y_COUNT           0xFFC00FF8 /* MemDMA Stream 1 Source Current Y Count Register */
+#define MDMA_D1_NEXT_DESC_PTR          0xFFC00F80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
+#define MDMA_D1_START_ADDR             0xFFC00F84 /* MemDMA Stream 1 Destination Start Address Register */
+#define MDMA_D1_CONFIG                 0xFFC00F88 /* MemDMA Stream 1 Destination Configuration Register */
+#define MDMA_D1_X_COUNT                0xFFC00F90 /* MemDMA Stream 1 Destination X Count Register */
+#define MDMA_D1_X_MODIFY               0xFFC00F94 /* MemDMA Stream 1 Destination X Modify Register */
+#define MDMA_D1_Y_COUNT                0xFFC00F98 /* MemDMA Stream 1 Destination Y Count Register */
+#define MDMA_D1_Y_MODIFY               0xFFC00F9C /* MemDMA Stream 1 Destination Y Modify Register */
+#define MDMA_D1_CURR_DESC_PTR          0xFFC00FA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
+#define MDMA_D1_CURR_ADDR              0xFFC00FA4 /* MemDMA Stream 1 Destination Current Address Register */
+#define MDMA_D1_IRQ_STATUS             0xFFC00FA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
+#define MDMA_D1_PERIPHERAL_MAP         0xFFC00FAC /* MemDMA Stream 1 Destination Peripheral Map Register */
+#define MDMA_D1_CURR_X_COUNT           0xFFC00FB0 /* MemDMA Stream 1 Destination Current X Count Register */
+#define MDMA_D1_CURR_Y_COUNT           0xFFC00FB8 /* MemDMA Stream 1 Destination Current Y Count Register */
+#define PPI_CONTROL                    0xFFC01000 /* PPI Control Register */
+#define PPI_STATUS                     0xFFC01004 /* PPI Status Register */
+#define PPI_COUNT                      0xFFC01008 /* PPI Transfer Count Register */
+#define PPI_DELAY                      0xFFC0100C /* PPI Delay Count Register */
+#define PPI_FRAME                      0xFFC01010 /* PPI Frame Length Register */
+#define TWI_CLKDIV                     0xFFC01400 /* Serial Clock Divider Register */
+#define TWI_CONTROL                    0xFFC01404 /* TWI Control Register */
+#define TWI_SLAVE_CTL                  0xFFC01408 /* Slave Mode Control Register */
+#define TWI_SLAVE_STAT                 0xFFC0140C /* Slave Mode Status Register */
+#define TWI_SLAVE_ADDR                 0xFFC01410 /* Slave Mode Address Register */
+#define TWI_MASTER_CTL                 0xFFC01414 /* Master Mode Control Register */
+#define TWI_MASTER_STAT                0xFFC01418 /* Master Mode Status Register */
+#define TWI_MASTER_ADDR                0xFFC0141C /* Master Mode Address Register */
+#define TWI_INT_STAT                   0xFFC01420 /* TWI Interrupt Status Register */
+#define TWI_INT_MASK                   0xFFC01424 /* TWI Master Interrupt Mask Register */
+#define TWI_FIFO_CTL                   0xFFC01428 /* FIFO Control Register */
+#define TWI_FIFO_STAT                  0xFFC0142C /* FIFO Status Register */
+#define TWI_XMT_DATA8                  0xFFC01480 /* FIFO Transmit Data Single Byte Register */
+#define TWI_XMT_DATA16                 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
+#define TWI_RCV_DATA8                  0xFFC01488 /* FIFO Receive Data Single Byte Register */
+#define TWI_RCV_DATA16                 0xFFC0148C /* FIFO Receive Data Double Byte Register */
+#define PORTGIO                        0xFFC01500 /* Port G I/O Pin State Specify Register */
+#define PORTGIO_CLEAR                  0xFFC01504 /* Port G I/O Peripheral Interrupt Clear Register */
+#define PORTGIO_SET                    0xFFC01508 /* Port G I/O Peripheral Interrupt Set Register */
+#define PORTGIO_TOGGLE                 0xFFC0150C /* Port G I/O Pin State Toggle Register */
+#define PORTGIO_MASKA                  0xFFC01510 /* Port G I/O Mask State Specify Interrupt A Register */
+#define PORTGIO_MASKA_CLEAR            0xFFC01514 /* Port G I/O Mask Disable Interrupt A Register */
+#define PORTGIO_MASKA_SET              0xFFC01518 /* Port G I/O Mask Enable Interrupt A Register */
+#define PORTGIO_MASKA_TOGGLE           0xFFC0151C /* Port G I/O Mask Toggle Enable Interrupt A Register */
+#define PORTGIO_MASKB                  0xFFC01520 /* Port G I/O Mask State Specify Interrupt B Register */
+#define PORTGIO_MASKB_CLEAR            0xFFC01524 /* Port G I/O Mask Disable Interrupt B Register */
+#define PORTGIO_MASKB_SET              0xFFC01528 /* Port G I/O Mask Enable Interrupt B Register */
+#define PORTGIO_MASKB_TOGGLE           0xFFC0152C /* Port G I/O Mask Toggle Enable Interrupt B Register */
+#define PORTGIO_DIR                    0xFFC01530 /* Port G I/O Direction Register */
+#define PORTGIO_POLAR                  0xFFC01534 /* Port G I/O Source Polarity Register */
+#define PORTGIO_EDGE                   0xFFC01538 /* Port G I/O Source Sensitivity Register */
+#define PORTGIO_BOTH                   0xFFC0153C /* Port G I/O Set on BOTH Edges Register */
+#define PORTGIO_INEN                   0xFFC01540 /* Port G I/O Input Enable Register */
+#define PORTHIO                        0xFFC01700 /* Port H I/O Pin State Specify Register */
+#define PORTHIO_CLEAR                  0xFFC01704 /* Port H I/O Peripheral Interrupt Clear Register */
+#define PORTHIO_SET                    0xFFC01708 /* Port H I/O Peripheral Interrupt Set Register */
+#define PORTHIO_TOGGLE                 0xFFC0170C /* Port H I/O Pin State Toggle Register */
+#define PORTHIO_MASKA                  0xFFC01710 /* Port H I/O Mask State Specify Interrupt A Register */
+#define PORTHIO_MASKA_CLEAR            0xFFC01714 /* Port H I/O Mask Disable Interrupt A Register */
+#define PORTHIO_MASKA_SET              0xFFC01718 /* Port H I/O Mask Enable Interrupt A Register */
+#define PORTHIO_MASKA_TOGGLE           0xFFC0171C /* Port H I/O Mask Toggle Enable Interrupt A Register */
+#define PORTHIO_MASKB                  0xFFC01720 /* Port H I/O Mask State Specify Interrupt B Register */
+#define PORTHIO_MASKB_CLEAR            0xFFC01724 /* Port H I/O Mask Disable Interrupt B Register */
+#define PORTHIO_MASKB_SET              0xFFC01728 /* Port H I/O Mask Enable Interrupt B Register */
+#define PORTHIO_MASKB_TOGGLE           0xFFC0172C /* Port H I/O Mask Toggle Enable Interrupt B Register */
+#define PORTHIO_DIR                    0xFFC01730 /* Port H I/O Direction Register */
+#define PORTHIO_POLAR                  0xFFC01734 /* Port H I/O Source Polarity Register */
+#define PORTHIO_EDGE                   0xFFC01738 /* Port H I/O Source Sensitivity Register */
+#define PORTHIO_BOTH                   0xFFC0173C /* Port H I/O Set on BOTH Edges Register */
+#define PORTHIO_INEN                   0xFFC01740 /* Port H I/O Input Enable Register */
+#define UART1_DLL                      0xFFC02000 /* Divisor Latch Low Byte */
+#define UART1_DLH                      0xFFC02004 /* Divisor Latch High Byte */
+#define UART1_GCTL                     0xFFC02008 /* Global Control Register */
+#define UART1_LCR                      0xFFC0200C /* Line Control Register */
+#define UART1_MCR                      0xFFC02010 /* Modem Control Register */
+#define UART1_LSR                      0xFFC02014 /* Line Status Register */
+#define UART1_MSR                      0xFFC02018 /* Modem Status Register */
+#define UART1_SCR                      0xFFC0201C /* Scratch Register */
+#define UART1_IER_SET                  0xFFC02020 /* Interrupt Enable Register Set */
+#define UART1_IER_CLEAR                0xFFC02024 /* Interrupt Enable Register Clear */
+#define UART1_THR                      0xFFC02028 /* Transmit Hold Register */
+#define UART1_RBR                      0xFFC0202C /* Receive Buffer Register */
+#define CAN_MC1                        0xFFC02A00 /* CAN Controller 0 Mailbox Configuration Register 1 */
+#define CAN_MD1                        0xFFC02A04 /* CAN Controller 0 Mailbox Direction Register 1 */
+#define CAN_TRS1                       0xFFC02A08 /* CAN Controller 0 Transmit Request Set Register 1 */
+#define CAN_TRR1                       0xFFC02A0C /* CAN Controller 0 Transmit Request Reset Register 1 */
+#define CAN_TA1                        0xFFC02A10 /* CAN Controller 0 Transmit Acknowledge Register 1 */
+#define CAN_AA1                        0xFFC02A14 /* CAN Controller 0 Abort Acknowledge Register 1 */
+#define CAN_RMP1                       0xFFC02A18 /* CAN Controller 0 Receive Message Pending Register 1 */
+#define CAN_RML1                       0xFFC02A1C /* CAN Controller 0 Receive Message Lost Register 1 */
+#define CAN_MBTIF1                     0xFFC02A20 /* CAN Controller 0 Mailbox Transmit Interrupt Flag Register 1 */
+#define CAN_MBRIF1                     0xFFC02A24 /* CAN Controller 0 Mailbox Receive Interrupt Flag Register 1 */
+#define CAN_MBIM1                      0xFFC02A28 /* CAN Controller 0 Mailbox Interrupt Mask Register 1 */
+#define CAN_RFH1                       0xFFC02A2C /* CAN Controller 0 Remote Frame Handling Enable Register 1 */
+#define CAN_OPSS1                      0xFFC02A30 /* CAN Controller 0 Overwrite Protection Single Shot Transmit Register 1 */
+#define CAN_MC2                        0xFFC02A40 /* CAN Controller 0 Mailbox Configuration Register 2 */
+#define CAN_MD2                        0xFFC02A44 /* CAN Controller 0 Mailbox Direction Register 2 */
+#define CAN_TRS2                       0xFFC02A48 /* CAN Controller 0 Transmit Request Set Register 2 */
+#define CAN_TRR2                       0xFFC02A4C /* CAN Controller 0 Transmit Request Reset Register 2 */
+#define CAN_TA2                        0xFFC02A50 /* CAN Controller 0 Transmit Acknowledge Register 2 */
+#define CAN_AA2                        0xFFC02A54 /* CAN Controller 0 Abort Acknowledge Register 2 */
+#define CAN_RMP2                       0xFFC02A58 /* CAN Controller 0 Receive Message Pending Register 2 */
+#define CAN_RML2                       0xFFC02A5C /* CAN Controller 0 Receive Message Lost Register 2 */
+#define CAN_MBTIF2                     0xFFC02A60 /* CAN Controller 0 Mailbox Transmit Interrupt Flag Register 2 */
+#define CAN_MBRIF2                     0xFFC02A64 /* CAN Controller 0 Mailbox Receive Interrupt Flag Register 2 */
+#define CAN_MBIM2                      0xFFC02A68 /* CAN Controller 0 Mailbox Interrupt Mask Register 2 */
+#define CAN_RFH2                       0xFFC02A6C /* CAN Controller 0 Remote Frame Handling Enable Register 2 */
+#define CAN_OPSS2                      0xFFC02A70 /* CAN Controller 0 Overwrite Protection Single Shot Transmit Register 2 */
+#define CAN_CLOCK                      0xFFC02A80 /* CAN Controller 0 Clock Register */
+#define CAN_TIMING                     0xFFC02A84 /* CAN Controller 0 Timing Register */
+#define CAN_DEBUG                      0xFFC02A88 /* CAN Controller 0 Debug Register */
+#define CAN_STATUS                     0xFFC02A8C /* CAN Controller 0 Global Status Register */
+#define CAN_CEC                        0xFFC02A90 /* CAN Controller 0 Error Counter Register */
+#define CAN_GIS                        0xFFC02A94 /* CAN Controller 0 Global Interrupt Status Register */
+#define CAN_GIM                        0xFFC02A98 /* CAN Controller 0 Global Interrupt Mask Register */
+#define CAN_GIF                        0xFFC02A9C /* CAN Controller 0 Global Interrupt Flag Register */
+#define CAN_CONTROL                    0xFFC02AA0 /* CAN Controller 0 Master Control Register */
+#define CAN_INTR                       0xFFC02AA4 /* CAN Controller 0 Interrupt Pending Register */
+#define CAN_MBTD                       0xFFC02AAC /* CAN Controller 0 Mailbox Temporary Disable Register */
+#define CAN_EWR                        0xFFC02AB0 /* CAN Controller 0 Programmable Warning Level Register */
+#define CAN_ESR                        0xFFC02AB4 /* CAN Controller 0 Error Status Register */
+#define CAN_UCCNT                      0xFFC02AC4 /* CAN Controller 0 Universal Counter Register */
+#define CAN_UCRC                       0xFFC02AC8 /* CAN Controller 0 Universal Counter Force Reload Register */
+#define CAN_UCCNF                      0xFFC02ACC /* CAN Controller 0 Universal Counter Configuration Register */
+#define CAN_AM00L                      0xFFC02B00 /* CAN Controller 0 Mailbox 0 Acceptance Mask High Register */
+#define CAN_AM00H                      0xFFC02B04 /* CAN Controller 0 Mailbox 0 Acceptance Mask Low Register */
+#define CAN_AM01L                      0xFFC02B08 /* CAN Controller 0 Mailbox 1 Acceptance Mask High Register */
+#define CAN_AM01H                      0xFFC02B0C /* CAN Controller 0 Mailbox 1 Acceptance Mask Low Register */
+#define CAN_AM02L                      0xFFC02B10 /* CAN Controller 0 Mailbox 2 Acceptance Mask High Register */
+#define CAN_AM02H                      0xFFC02B14 /* CAN Controller 0 Mailbox 2 Acceptance Mask Low Register */
+#define CAN_AM03L                      0xFFC02B18 /* CAN Controller 0 Mailbox 3 Acceptance Mask High Register */
+#define CAN_AM03H                      0xFFC02B1C /* CAN Controller 0 Mailbox 3 Acceptance Mask Low Register */
+#define CAN_AM04L                      0xFFC02B20 /* CAN Controller 0 Mailbox 4 Acceptance Mask High Register */
+#define CAN_AM04H                      0xFFC02B24 /* CAN Controller 0 Mailbox 4 Acceptance Mask Low Register */
+#define CAN_AM05L                      0xFFC02B28 /* CAN Controller 0 Mailbox 5 Acceptance Mask High Register */
+#define CAN_AM05H                      0xFFC02B2C /* CAN Controller 0 Mailbox 5 Acceptance Mask Low Register */
+#define CAN_AM06L                      0xFFC02B30 /* CAN Controller 0 Mailbox 6 Acceptance Mask High Register */
+#define CAN_AM06H                      0xFFC02B34 /* CAN Controller 0 Mailbox 6 Acceptance Mask Low Register */
+#define CAN_AM07L                      0xFFC02B38 /* CAN Controller 0 Mailbox 7 Acceptance Mask High Register */
+#define CAN_AM07H                      0xFFC02B3C /* CAN Controller 0 Mailbox 7 Acceptance Mask Low Register */
+#define CAN_AM08L                      0xFFC02B40 /* CAN Controller 0 Mailbox 8 Acceptance Mask High Register */
+#define CAN_AM08H                      0xFFC02B44 /* CAN Controller 0 Mailbox 8 Acceptance Mask Low Register */
+#define CAN_AM09L                      0xFFC02B48 /* CAN Controller 0 Mailbox 9 Acceptance Mask High Register */
+#define CAN_AM09H                      0xFFC02B4C /* CAN Controller 0 Mailbox 9 Acceptance Mask Low Register */
+#define CAN_AM10L                      0xFFC02B50 /* CAN Controller 0 Mailbox 10 Acceptance Mask High Register */
+#define CAN_AM10H                      0xFFC02B54 /* CAN Controller 0 Mailbox 10 Acceptance Mask Low Register */
+#define CAN_AM11L                      0xFFC02B58 /* CAN Controller 0 Mailbox 11 Acceptance Mask High Register */
+#define CAN_AM11H                      0xFFC02B5C /* CAN Controller 0 Mailbox 11 Acceptance Mask Low Register */
+#define CAN_AM12L                      0xFFC02B60 /* CAN Controller 0 Mailbox 12 Acceptance Mask High Register */
+#define CAN_AM12H                      0xFFC02B64 /* CAN Controller 0 Mailbox 12 Acceptance Mask Low Register */
+#define CAN_AM13L                      0xFFC02B68 /* CAN Controller 0 Mailbox 13 Acceptance Mask High Register */
+#define CAN_AM13H                      0xFFC02B6C /* CAN Controller 0 Mailbox 13 Acceptance Mask Low Register */
+#define CAN_AM14L                      0xFFC02B70 /* CAN Controller 0 Mailbox 14 Acceptance Mask High Register */
+#define CAN_AM14H                      0xFFC02B74 /* CAN Controller 0 Mailbox 14 Acceptance Mask Low Register */
+#define CAN_AM15L                      0xFFC02B78 /* CAN Controller 0 Mailbox 15 Acceptance Mask High Register */
+#define CAN_AM15H                      0xFFC02B7C /* CAN Controller 0 Mailbox 15 Acceptance Mask Low Register */
+#define CAN_AM16L                      0xFFC02B80 /* CAN Controller 0 Mailbox 16 Acceptance Mask High Register */
+#define CAN_AM16H                      0xFFC02B84 /* CAN Controller 0 Mailbox 16 Acceptance Mask Low Register */
+#define CAN_AM17L                      0xFFC02B88 /* CAN Controller 0 Mailbox 17 Acceptance Mask High Register */
+#define CAN_AM17H                      0xFFC02B8C /* CAN Controller 0 Mailbox 17 Acceptance Mask Low Register */
+#define CAN_AM18L                      0xFFC02B90 /* CAN Controller 0 Mailbox 18 Acceptance Mask High Register */
+#define CAN_AM18H                      0xFFC02B94 /* CAN Controller 0 Mailbox 18 Acceptance Mask Low Register */
+#define CAN_AM19L                      0xFFC02B98 /* CAN Controller 0 Mailbox 19 Acceptance Mask High Register */
+#define CAN_AM19H                      0xFFC02B9C /* CAN Controller 0 Mailbox 19 Acceptance Mask Low Register */
+#define CAN_AM20L                      0xFFC02BA0 /* CAN Controller 0 Mailbox 20 Acceptance Mask High Register */
+#define CAN_AM20H                      0xFFC02BA4 /* CAN Controller 0 Mailbox 20 Acceptance Mask Low Register */
+#define CAN_AM21L                      0xFFC02BA8 /* CAN Controller 0 Mailbox 21 Acceptance Mask High Register */
+#define CAN_AM21H                      0xFFC02BAC /* CAN Controller 0 Mailbox 21 Acceptance Mask Low Register */
+#define CAN_AM22L                      0xFFC02BB0 /* CAN Controller 0 Mailbox 22 Acceptance Mask High Register */
+#define CAN_AM22H                      0xFFC02BB4 /* CAN Controller 0 Mailbox 22 Acceptance Mask Low Register */
+#define CAN_AM23L                      0xFFC02BB8 /* CAN Controller 0 Mailbox 23 Acceptance Mask High Register */
+#define CAN_AM23H                      0xFFC02BBC /* CAN Controller 0 Mailbox 23 Acceptance Mask Low Register */
+#define CAN_AM24L                      0xFFC02BC0 /* CAN Controller 0 Mailbox 24 Acceptance Mask High Register */
+#define CAN_AM24H                      0xFFC02BC4 /* CAN Controller 0 Mailbox 24 Acceptance Mask Low Register */
+#define CAN_AM25L                      0xFFC02BC8 /* CAN Controller 0 Mailbox 25 Acceptance Mask High Register */
+#define CAN_AM25H                      0xFFC02BCC /* CAN Controller 0 Mailbox 25 Acceptance Mask Low Register */
+#define CAN_AM26L                      0xFFC02BD0 /* CAN Controller 0 Mailbox 26 Acceptance Mask High Register */
+#define CAN_AM26H                      0xFFC02BD4 /* CAN Controller 0 Mailbox 26 Acceptance Mask Low Register */
+#define CAN_AM27L                      0xFFC02BD8 /* CAN Controller 0 Mailbox 27 Acceptance Mask High Register */
+#define CAN_AM27H                      0xFFC02BDC /* CAN Controller 0 Mailbox 27 Acceptance Mask Low Register */
+#define CAN_AM28L                      0xFFC02BE0 /* CAN Controller 0 Mailbox 28 Acceptance Mask High Register */
+#define CAN_AM28H                      0xFFC02BE4 /* CAN Controller 0 Mailbox 28 Acceptance Mask Low Register */
+#define CAN_AM29L                      0xFFC02BE8 /* CAN Controller 0 Mailbox 29 Acceptance Mask High Register */
+#define CAN_AM29H                      0xFFC02BEC /* CAN Controller 0 Mailbox 29 Acceptance Mask Low Register */
+#define CAN_AM30L                      0xFFC02BF0 /* CAN Controller 0 Mailbox 30 Acceptance Mask High Register */
+#define CAN_AM30H                      0xFFC02BF4 /* CAN Controller 0 Mailbox 30 Acceptance Mask Low Register */
+#define CAN_AM31L                      0xFFC02BF8 /* CAN Controller 0 Mailbox 31 Acceptance Mask High Register */
+#define CAN_AM31H                      0xFFC02BFC /* CAN Controller 0 Mailbox 31 Acceptance Mask Low Register */
+#define CAN_MB00_DATA0                 0xFFC02C00 /* CAN Controller 0 Mailbox 0 Data 0 Register */
+#define CAN_MB00_DATA1                 0xFFC02C04 /* CAN Controller 0 Mailbox 0 Data 1 Register */
+#define CAN_MB00_DATA2                 0xFFC02C08 /* CAN Controller 0 Mailbox 0 Data 2 Register */
+#define CAN_MB00_DATA3                 0xFFC02C0C /* CAN Controller 0 Mailbox 0 Data 3 Register */
+#define CAN_MB00_LENGTH                0xFFC02C10 /* CAN Controller 0 Mailbox 0 Length Register */
+#define CAN_MB00_TIMESTAMP             0xFFC02C14 /* CAN Controller 0 Mailbox 0 Timestamp Register */
+#define CAN_MB00_ID0                   0xFFC02C18 /* CAN Controller 0 Mailbox 0 ID0 Register */
+#define CAN_MB00_ID1                   0xFFC02C1C /* CAN Controller 0 Mailbox 0 ID1 Register */
+#define CAN_MB01_DATA0                 0xFFC02C20 /* CAN Controller 0 Mailbox 1 Data 0 Register */
+#define CAN_MB01_DATA1                 0xFFC02C24 /* CAN Controller 0 Mailbox 1 Data 1 Register */
+#define CAN_MB01_DATA2                 0xFFC02C28 /* CAN Controller 0 Mailbox 1 Data 2 Register */
+#define CAN_MB01_DATA3                 0xFFC02C2C /* CAN Controller 0 Mailbox 1 Data 3 Register */
+#define CAN_MB01_LENGTH                0xFFC02C30 /* CAN Controller 0 Mailbox 1 Length Register */
+#define CAN_MB01_TIMESTAMP             0xFFC02C34 /* CAN Controller 0 Mailbox 1 Timestamp Register */
+#define CAN_MB01_ID0                   0xFFC02C38 /* CAN Controller 0 Mailbox 1 ID0 Register */
+#define CAN_MB01_ID1                   0xFFC02C3C /* CAN Controller 0 Mailbox 1 ID1 Register */
+#define CAN_MB02_DATA0                 0xFFC02C40 /* CAN Controller 0 Mailbox 2 Data 0 Register */
+#define CAN_MB02_DATA1                 0xFFC02C44 /* CAN Controller 0 Mailbox 2 Data 1 Register */
+#define CAN_MB02_DATA2                 0xFFC02C48 /* CAN Controller 0 Mailbox 2 Data 2 Register */
+#define CAN_MB02_DATA3                 0xFFC02C4C /* CAN Controller 0 Mailbox 2 Data 3 Register */
+#define CAN_MB02_LENGTH                0xFFC02C50 /* CAN Controller 0 Mailbox 2 Length Register */
+#define CAN_MB02_TIMESTAMP             0xFFC02C54 /* CAN Controller 0 Mailbox 2 Timestamp Register */
+#define CAN_MB02_ID0                   0xFFC02C58 /* CAN Controller 0 Mailbox 2 ID0 Register */
+#define CAN_MB02_ID1                   0xFFC02C5C /* CAN Controller 0 Mailbox 2 ID1 Register */
+#define CAN_MB03_DATA0                 0xFFC02C60 /* CAN Controller 0 Mailbox 3 Data 0 Register */
+#define CAN_MB03_DATA1                 0xFFC02C64 /* CAN Controller 0 Mailbox 3 Data 1 Register */
+#define CAN_MB03_DATA2                 0xFFC02C68 /* CAN Controller 0 Mailbox 3 Data 2 Register */
+#define CAN_MB03_DATA3                 0xFFC02C6C /* CAN Controller 0 Mailbox 3 Data 3 Register */
+#define CAN_MB03_LENGTH                0xFFC02C70 /* CAN Controller 0 Mailbox 3 Length Register */
+#define CAN_MB03_TIMESTAMP             0xFFC02C74 /* CAN Controller 0 Mailbox 3 Timestamp Register */
+#define CAN_MB03_ID0                   0xFFC02C78 /* CAN Controller 0 Mailbox 3 ID0 Register */
+#define CAN_MB03_ID1                   0xFFC02C7C /* CAN Controller 0 Mailbox 3 ID1 Register */
+#define CAN_MB04_DATA0                 0xFFC02C80 /* CAN Controller 0 Mailbox 4 Data 0 Register */
+#define CAN_MB04_DATA1                 0xFFC02C84 /* CAN Controller 0 Mailbox 4 Data 1 Register */
+#define CAN_MB04_DATA2                 0xFFC02C88 /* CAN Controller 0 Mailbox 4 Data 2 Register */
+#define CAN_MB04_DATA3                 0xFFC02C8C /* CAN Controller 0 Mailbox 4 Data 3 Register */
+#define CAN_MB04_LENGTH                0xFFC02C90 /* CAN Controller 0 Mailbox 4 Length Register */
+#define CAN_MB04_TIMESTAMP             0xFFC02C94 /* CAN Controller 0 Mailbox 4 Timestamp Register */
+#define CAN_MB04_ID0                   0xFFC02C98 /* CAN Controller 0 Mailbox 4 ID0 Register */
+#define CAN_MB04_ID1                   0xFFC02C9C /* CAN Controller 0 Mailbox 4 ID1 Register */
+#define CAN_MB05_DATA0                 0xFFC02CA0 /* CAN Controller 0 Mailbox 5 Data 0 Register */
+#define CAN_MB05_DATA1                 0xFFC02CA4 /* CAN Controller 0 Mailbox 5 Data 1 Register */
+#define CAN_MB05_DATA2                 0xFFC02CA8 /* CAN Controller 0 Mailbox 5 Data 2 Register */
+#define CAN_MB05_DATA3                 0xFFC02CAC /* CAN Controller 0 Mailbox 5 Data 3 Register */
+#define CAN_MB05_LENGTH                0xFFC02CB0 /* CAN Controller 0 Mailbox 5 Length Register */
+#define CAN_MB05_TIMESTAMP             0xFFC02CB4 /* CAN Controller 0 Mailbox 5 Timestamp Register */
+#define CAN_MB05_ID0                   0xFFC02CB8 /* CAN Controller 0 Mailbox 5 ID0 Register */
+#define CAN_MB05_ID1                   0xFFC02CBC /* CAN Controller 0 Mailbox 5 ID1 Register */
+#define CAN_MB06_DATA0                 0xFFC02CC0 /* CAN Controller 0 Mailbox 6 Data 0 Register */
+#define CAN_MB06_DATA1                 0xFFC02CC4 /* CAN Controller 0 Mailbox 6 Data 1 Register */
+#define CAN_MB06_DATA2                 0xFFC02CC8 /* CAN Controller 0 Mailbox 6 Data 2 Register */
+#define CAN_MB06_DATA3                 0xFFC02CCC /* CAN Controller 0 Mailbox 6 Data 3 Register */
+#define CAN_MB06_LENGTH                0xFFC02CD0 /* CAN Controller 0 Mailbox 6 Length Register */
+#define CAN_MB06_TIMESTAMP             0xFFC02CD4 /* CAN Controller 0 Mailbox 6 Timestamp Register */
+#define CAN_MB06_ID0                   0xFFC02CD8 /* CAN Controller 0 Mailbox 6 ID0 Register */
+#define CAN_MB06_ID1                   0xFFC02CDC /* CAN Controller 0 Mailbox 6 ID1 Register */
+#define CAN_MB07_DATA0                 0xFFC02CE0 /* CAN Controller 0 Mailbox 7 Data 0 Register */
+#define CAN_MB07_DATA1                 0xFFC02CE4 /* CAN Controller 0 Mailbox 7 Data 1 Register */
+#define CAN_MB07_DATA2                 0xFFC02CE8 /* CAN Controller 0 Mailbox 7 Data 2 Register */
+#define CAN_MB07_DATA3                 0xFFC02CEC /* CAN Controller 0 Mailbox 7 Data 3 Register */
+#define CAN_MB07_LENGTH                0xFFC02CF0 /* CAN Controller 0 Mailbox 7 Length Register */
+#define CAN_MB07_TIMESTAMP             0xFFC02CF4 /* CAN Controller 0 Mailbox 7 Timestamp Register */
+#define CAN_MB07_ID0                   0xFFC02CF8 /* CAN Controller 0 Mailbox 7 ID0 Register */
+#define CAN_MB07_ID1                   0xFFC02CFC /* CAN Controller 0 Mailbox 7 ID1 Register */
+#define CAN_MB08_DATA0                 0xFFC02D00 /* CAN Controller 0 Mailbox 8 Data 0 Register */
+#define CAN_MB08_DATA1                 0xFFC02D04 /* CAN Controller 0 Mailbox 8 Data 1 Register */
+#define CAN_MB08_DATA2                 0xFFC02D08 /* CAN Controller 0 Mailbox 8 Data 2 Register */
+#define CAN_MB08_DATA3                 0xFFC02D0C /* CAN Controller 0 Mailbox 8 Data 3 Register */
+#define CAN_MB08_LENGTH                0xFFC02D10 /* CAN Controller 0 Mailbox 8 Length Register */
+#define CAN_MB08_TIMESTAMP             0xFFC02D14 /* CAN Controller 0 Mailbox 8 Timestamp Register */
+#define CAN_MB08_ID0                   0xFFC02D18 /* CAN Controller 0 Mailbox 8 ID0 Register */
+#define CAN_MB08_ID1                   0xFFC02D1C /* CAN Controller 0 Mailbox 8 ID1 Register */
+#define CAN_MB09_DATA0                 0xFFC02D20 /* CAN Controller 0 Mailbox 9 Data 0 Register */
+#define CAN_MB09_DATA1                 0xFFC02D24 /* CAN Controller 0 Mailbox 9 Data 1 Register */
+#define CAN_MB09_DATA2                 0xFFC02D28 /* CAN Controller 0 Mailbox 9 Data 2 Register */
+#define CAN_MB09_DATA3                 0xFFC02D2C /* CAN Controller 0 Mailbox 9 Data 3 Register */
+#define CAN_MB09_LENGTH                0xFFC02D30 /* CAN Controller 0 Mailbox 9 Length Register */
+#define CAN_MB09_TIMESTAMP             0xFFC02D34 /* CAN Controller 0 Mailbox 9 Timestamp Register */
+#define CAN_MB09_ID0                   0xFFC02D38 /* CAN Controller 0 Mailbox 9 ID0 Register */
+#define CAN_MB09_ID1                   0xFFC02D3C /* CAN Controller 0 Mailbox 9 ID1 Register */
+#define CAN_MB10_DATA0                 0xFFC02D40 /* CAN Controller 0 Mailbox 10 Data 0 Register */
+#define CAN_MB10_DATA1                 0xFFC02D44 /* CAN Controller 0 Mailbox 10 Data 1 Register */
+#define CAN_MB10_DATA2                 0xFFC02D48 /* CAN Controller 0 Mailbox 10 Data 2 Register */
+#define CAN_MB10_DATA3                 0xFFC02D4C /* CAN Controller 0 Mailbox 10 Data 3 Register */
+#define CAN_MB10_LENGTH                0xFFC02D50 /* CAN Controller 0 Mailbox 10 Length Register */
+#define CAN_MB10_TIMESTAMP             0xFFC02D54 /* CAN Controller 0 Mailbox 10 Timestamp Register */
+#define CAN_MB10_ID0                   0xFFC02D58 /* CAN Controller 0 Mailbox 10 ID0 Register */
+#define CAN_MB10_ID1                   0xFFC02D5C /* CAN Controller 0 Mailbox 10 ID1 Register */
+#define CAN_MB11_DATA0                 0xFFC02D60 /* CAN Controller 0 Mailbox 11 Data 0 Register */
+#define CAN_MB11_DATA1                 0xFFC02D64 /* CAN Controller 0 Mailbox 11 Data 1 Register */
+#define CAN_MB11_DATA2                 0xFFC02D68 /* CAN Controller 0 Mailbox 11 Data 2 Register */
+#define CAN_MB11_DATA3                 0xFFC02D6C /* CAN Controller 0 Mailbox 11 Data 3 Register */
+#define CAN_MB11_LENGTH                0xFFC02D70 /* CAN Controller 0 Mailbox 11 Length Register */
+#define CAN_MB11_TIMESTAMP             0xFFC02D74 /* CAN Controller 0 Mailbox 11 Timestamp Register */
+#define CAN_MB11_ID0                   0xFFC02D78 /* CAN Controller 0 Mailbox 11 ID0 Register */
+#define CAN_MB11_ID1                   0xFFC02D7C /* CAN Controller 0 Mailbox 11 ID1 Register */
+#define CAN_MB12_DATA0                 0xFFC02D80 /* CAN Controller 0 Mailbox 12 Data 0 Register */
+#define CAN_MB12_DATA1                 0xFFC02D84 /* CAN Controller 0 Mailbox 12 Data 1 Register */
+#define CAN_MB12_DATA2                 0xFFC02D88 /* CAN Controller 0 Mailbox 12 Data 2 Register */
+#define CAN_MB12_DATA3                 0xFFC02D8C /* CAN Controller 0 Mailbox 12 Data 3 Register */
+#define CAN_MB12_LENGTH                0xFFC02D90 /* CAN Controller 0 Mailbox 12 Length Register */
+#define CAN_MB12_TIMESTAMP             0xFFC02D94 /* CAN Controller 0 Mailbox 12 Timestamp Register */
+#define CAN_MB12_ID0                   0xFFC02D98 /* CAN Controller 0 Mailbox 12 ID0 Register */
+#define CAN_MB12_ID1                   0xFFC02D9C /* CAN Controller 0 Mailbox 12 ID1 Register */
+#define CAN_MB13_DATA0                 0xFFC02DA0 /* CAN Controller 0 Mailbox 13 Data 0 Register */
+#define CAN_MB13_DATA1                 0xFFC02DA4 /* CAN Controller 0 Mailbox 13 Data 1 Register */
+#define CAN_MB13_DATA2                 0xFFC02DA8 /* CAN Controller 0 Mailbox 13 Data 2 Register */
+#define CAN_MB13_DATA3                 0xFFC02DAC /* CAN Controller 0 Mailbox 13 Data 3 Register */
+#define CAN_MB13_LENGTH                0xFFC02DB0 /* CAN Controller 0 Mailbox 13 Length Register */
+#define CAN_MB13_TIMESTAMP             0xFFC02DB4 /* CAN Controller 0 Mailbox 13 Timestamp Register */
+#define CAN_MB13_ID0                   0xFFC02DB8 /* CAN Controller 0 Mailbox 13 ID0 Register */
+#define CAN_MB13_ID1                   0xFFC02DBC /* CAN Controller 0 Mailbox 13 ID1 Register */
+#define CAN_MB14_DATA0                 0xFFC02DC0 /* CAN Controller 0 Mailbox 14 Data 0 Register */
+#define CAN_MB14_DATA1                 0xFFC02DC4 /* CAN Controller 0 Mailbox 14 Data 1 Register */
+#define CAN_MB14_DATA2                 0xFFC02DC8 /* CAN Controller 0 Mailbox 14 Data 2 Register */
+#define CAN_MB14_DATA3                 0xFFC02DCC /* CAN Controller 0 Mailbox 14 Data 3 Register */
+#define CAN_MB14_LENGTH                0xFFC02DD0 /* CAN Controller 0 Mailbox 14 Length Register */
+#define CAN_MB14_TIMESTAMP             0xFFC02DD4 /* CAN Controller 0 Mailbox 14 Timestamp Register */
+#define CAN_MB14_ID0                   0xFFC02DD8 /* CAN Controller 0 Mailbox 14 ID0 Register */
+#define CAN_MB14_ID1                   0xFFC02DDC /* CAN Controller 0 Mailbox 14 ID1 Register */
+#define CAN_MB15_DATA0                 0xFFC02DE0 /* CAN Controller 0 Mailbox 15 Data 0 Register */
+#define CAN_MB15_DATA1                 0xFFC02DE4 /* CAN Controller 0 Mailbox 15 Data 1 Register */
+#define CAN_MB15_DATA2                 0xFFC02DE8 /* CAN Controller 0 Mailbox 15 Data 2 Register */
+#define CAN_MB15_DATA3                 0xFFC02DEC /* CAN Controller 0 Mailbox 15 Data 3 Register */
+#define CAN_MB15_LENGTH                0xFFC02DF0 /* CAN Controller 0 Mailbox 15 Length Register */
+#define CAN_MB15_TIMESTAMP             0xFFC02DF4 /* CAN Controller 0 Mailbox 15 Timestamp Register */
+#define CAN_MB15_ID0                   0xFFC02DF8 /* CAN Controller 0 Mailbox 15 ID0 Register */
+#define CAN_MB15_ID1                   0xFFC02DFC /* CAN Controller 0 Mailbox 15 ID1 Register */
+#define CAN_MB16_DATA0                 0xFFC02E00 /* CAN Controller 0 Mailbox 16 Data 0 Register */
+#define CAN_MB16_DATA1                 0xFFC02E04 /* CAN Controller 0 Mailbox 16 Data 1 Register */
+#define CAN_MB16_DATA2                 0xFFC02E08 /* CAN Controller 0 Mailbox 16 Data 2 Register */
+#define CAN_MB16_DATA3                 0xFFC02E0C /* CAN Controller 0 Mailbox 16 Data 3 Register */
+#define CAN_MB16_LENGTH                0xFFC02E10 /* CAN Controller 0 Mailbox 16 Length Register */
+#define CAN_MB16_TIMESTAMP             0xFFC02E14 /* CAN Controller 0 Mailbox 16 Timestamp Register */
+#define CAN_MB16_ID0                   0xFFC02E18 /* CAN Controller 0 Mailbox 16 ID0 Register */
+#define CAN_MB16_ID1                   0xFFC02E1C /* CAN Controller 0 Mailbox 16 ID1 Register */
+#define CAN_MB17_DATA0                 0xFFC02E20 /* CAN Controller 0 Mailbox 17 Data 0 Register */
+#define CAN_MB17_DATA1                 0xFFC02E24 /* CAN Controller 0 Mailbox 17 Data 1 Register */
+#define CAN_MB17_DATA2                 0xFFC02E28 /* CAN Controller 0 Mailbox 17 Data 2 Register */
+#define CAN_MB17_DATA3                 0xFFC02E2C /* CAN Controller 0 Mailbox 17 Data 3 Register */
+#define CAN_MB17_LENGTH                0xFFC02E30 /* CAN Controller 0 Mailbox 17 Length Register */
+#define CAN_MB17_TIMESTAMP             0xFFC02E34 /* CAN Controller 0 Mailbox 17 Timestamp Register */
+#define CAN_MB17_ID0                   0xFFC02E38 /* CAN Controller 0 Mailbox 17 ID0 Register */
+#define CAN_MB17_ID1                   0xFFC02E3C /* CAN Controller 0 Mailbox 17 ID1 Register */
+#define CAN_MB18_DATA0                 0xFFC02E40 /* CAN Controller 0 Mailbox 18 Data 0 Register */
+#define CAN_MB18_DATA1                 0xFFC02E44 /* CAN Controller 0 Mailbox 18 Data 1 Register */
+#define CAN_MB18_DATA2                 0xFFC02E48 /* CAN Controller 0 Mailbox 18 Data 2 Register */
+#define CAN_MB18_DATA3                 0xFFC02E4C /* CAN Controller 0 Mailbox 18 Data 3 Register */
+#define CAN_MB18_LENGTH                0xFFC02E50 /* CAN Controller 0 Mailbox 18 Length Register */
+#define CAN_MB18_TIMESTAMP             0xFFC02E54 /* CAN Controller 0 Mailbox 18 Timestamp Register */
+#define CAN_MB18_ID0                   0xFFC02E58 /* CAN Controller 0 Mailbox 18 ID0 Register */
+#define CAN_MB18_ID1                   0xFFC02E5C /* CAN Controller 0 Mailbox 18 ID1 Register */
+#define CAN_MB19_DATA0                 0xFFC02E60 /* CAN Controller 0 Mailbox 19 Data 0 Register */
+#define CAN_MB19_DATA1                 0xFFC02E64 /* CAN Controller 0 Mailbox 19 Data 1 Register */
+#define CAN_MB19_DATA2                 0xFFC02E68 /* CAN Controller 0 Mailbox 19 Data 2 Register */
+#define CAN_MB19_DATA3                 0xFFC02E6C /* CAN Controller 0 Mailbox 19 Data 3 Register */
+#define CAN_MB19_LENGTH                0xFFC02E70 /* CAN Controller 0 Mailbox 19 Length Register */
+#define CAN_MB19_TIMESTAMP             0xFFC02E74 /* CAN Controller 0 Mailbox 19 Timestamp Register */
+#define CAN_MB19_ID0                   0xFFC02E78 /* CAN Controller 0 Mailbox 19 ID0 Register */
+#define CAN_MB19_ID1                   0xFFC02E7C /* CAN Controller 0 Mailbox 19 ID1 Register */
+#define CAN_MB20_DATA0                 0xFFC02E80 /* CAN Controller 0 Mailbox 20 Data 0 Register */
+#define CAN_MB20_DATA1                 0xFFC02E84 /* CAN Controller 0 Mailbox 20 Data 1 Register */
+#define CAN_MB20_DATA2                 0xFFC02E88 /* CAN Controller 0 Mailbox 20 Data 2 Register */
+#define CAN_MB20_DATA3                 0xFFC02E8C /* CAN Controller 0 Mailbox 20 Data 3 Register */
+#define CAN_MB20_LENGTH                0xFFC02E90 /* CAN Controller 0 Mailbox 20 Length Register */
+#define CAN_MB20_TIMESTAMP             0xFFC02E94 /* CAN Controller 0 Mailbox 20 Timestamp Register */
+#define CAN_MB20_ID0                   0xFFC02E98 /* CAN Controller 0 Mailbox 20 ID0 Register */
+#define CAN_MB20_ID1                   0xFFC02E9C /* CAN Controller 0 Mailbox 20 ID1 Register */
+#define CAN_MB21_DATA0                 0xFFC02EA0 /* CAN Controller 0 Mailbox 21 Data 0 Register */
+#define CAN_MB21_DATA1                 0xFFC02EA4 /* CAN Controller 0 Mailbox 21 Data 1 Register */
+#define CAN_MB21_DATA2                 0xFFC02EA8 /* CAN Controller 0 Mailbox 21 Data 2 Register */
+#define CAN_MB21_DATA3                 0xFFC02EAC /* CAN Controller 0 Mailbox 21 Data 3 Register */
+#define CAN_MB21_LENGTH                0xFFC02EB0 /* CAN Controller 0 Mailbox 21 Length Register */
+#define CAN_MB21_TIMESTAMP             0xFFC02EB4 /* CAN Controller 0 Mailbox 21 Timestamp Register */
+#define CAN_MB21_ID0                   0xFFC02EB8 /* CAN Controller 0 Mailbox 21 ID0 Register */
+#define CAN_MB21_ID1                   0xFFC02EBC /* CAN Controller 0 Mailbox 21 ID1 Register */
+#define CAN_MB22_DATA0                 0xFFC02EC0 /* CAN Controller 0 Mailbox 22 Data 0 Register */
+#define CAN_MB22_DATA1                 0xFFC02EC4 /* CAN Controller 0 Mailbox 22 Data 1 Register */
+#define CAN_MB22_DATA2                 0xFFC02EC8 /* CAN Controller 0 Mailbox 22 Data 2 Register */
+#define CAN_MB22_DATA3                 0xFFC02ECC /* CAN Controller 0 Mailbox 22 Data 3 Register */
+#define CAN_MB22_LENGTH                0xFFC02ED0 /* CAN Controller 0 Mailbox 22 Length Register */
+#define CAN_MB22_TIMESTAMP             0xFFC02ED4 /* CAN Controller 0 Mailbox 22 Timestamp Register */
+#define CAN_MB22_ID0                   0xFFC02ED8 /* CAN Controller 0 Mailbox 22 ID0 Register */
+#define CAN_MB22_ID1                   0xFFC02EDC /* CAN Controller 0 Mailbox 22 ID1 Register */
+#define CAN_MB23_DATA0                 0xFFC02EE0 /* CAN Controller 0 Mailbox 23 Data 0 Register */
+#define CAN_MB23_DATA1                 0xFFC02EE4 /* CAN Controller 0 Mailbox 23 Data 1 Register */
+#define CAN_MB23_DATA2                 0xFFC02EE8 /* CAN Controller 0 Mailbox 23 Data 2 Register */
+#define CAN_MB23_DATA3                 0xFFC02EEC /* CAN Controller 0 Mailbox 23 Data 3 Register */
+#define CAN_MB23_LENGTH                0xFFC02EF0 /* CAN Controller 0 Mailbox 23 Length Register */
+#define CAN_MB23_TIMESTAMP             0xFFC02EF4 /* CAN Controller 0 Mailbox 23 Timestamp Register */
+#define CAN_MB23_ID0                   0xFFC02EF8 /* CAN Controller 0 Mailbox 23 ID0 Register */
+#define CAN_MB23_ID1                   0xFFC02EFC /* CAN Controller 0 Mailbox 23 ID1 Register */
+#define CAN_MB24_DATA0                 0xFFC02F00 /* CAN Controller 0 Mailbox 24 Data 0 Register */
+#define CAN_MB24_DATA1                 0xFFC02F04 /* CAN Controller 0 Mailbox 24 Data 1 Register */
+#define CAN_MB24_DATA2                 0xFFC02F08 /* CAN Controller 0 Mailbox 24 Data 2 Register */
+#define CAN_MB24_DATA3                 0xFFC02F0C /* CAN Controller 0 Mailbox 24 Data 3 Register */
+#define CAN_MB24_LENGTH                0xFFC02F10 /* CAN Controller 0 Mailbox 24 Length Register */
+#define CAN_MB24_TIMESTAMP             0xFFC02F14 /* CAN Controller 0 Mailbox 24 Timestamp Register */
+#define CAN_MB24_ID0                   0xFFC02F18 /* CAN Controller 0 Mailbox 24 ID0 Register */
+#define CAN_MB24_ID1                   0xFFC02F1C /* CAN Controller 0 Mailbox 24 ID1 Register */
+#define CAN_MB25_DATA0                 0xFFC02F20 /* CAN Controller 0 Mailbox 25 Data 0 Register */
+#define CAN_MB25_DATA1                 0xFFC02F24 /* CAN Controller 0 Mailbox 25 Data 1 Register */
+#define CAN_MB25_DATA2                 0xFFC02F28 /* CAN Controller 0 Mailbox 25 Data 2 Register */
+#define CAN_MB25_DATA3                 0xFFC02F2C /* CAN Controller 0 Mailbox 25 Data 3 Register */
+#define CAN_MB25_LENGTH                0xFFC02F30 /* CAN Controller 0 Mailbox 25 Length Register */
+#define CAN_MB25_TIMESTAMP             0xFFC02F34 /* CAN Controller 0 Mailbox 25 Timestamp Register */
+#define CAN_MB25_ID0                   0xFFC02F38 /* CAN Controller 0 Mailbox 25 ID0 Register */
+#define CAN_MB25_ID1                   0xFFC02F3C /* CAN Controller 0 Mailbox 25 ID1 Register */
+#define CAN_MB26_DATA0                 0xFFC02F40 /* CAN Controller 0 Mailbox 26 Data 0 Register */
+#define CAN_MB26_DATA1                 0xFFC02F44 /* CAN Controller 0 Mailbox 26 Data 1 Register */
+#define CAN_MB26_DATA2                 0xFFC02F48 /* CAN Controller 0 Mailbox 26 Data 2 Register */
+#define CAN_MB26_DATA3                 0xFFC02F4C /* CAN Controller 0 Mailbox 26 Data 3 Register */
+#define CAN_MB26_LENGTH                0xFFC02F50 /* CAN Controller 0 Mailbox 26 Length Register */
+#define CAN_MB26_TIMESTAMP             0xFFC02F54 /* CAN Controller 0 Mailbox 26 Timestamp Register */
+#define CAN_MB26_ID0                   0xFFC02F58 /* CAN Controller 0 Mailbox 26 ID0 Register */
+#define CAN_MB26_ID1                   0xFFC02F5C /* CAN Controller 0 Mailbox 26 ID1 Register */
+#define CAN_MB27_DATA0                 0xFFC02F60 /* CAN Controller 0 Mailbox 27 Data 0 Register */
+#define CAN_MB27_DATA1                 0xFFC02F64 /* CAN Controller 0 Mailbox 27 Data 1 Register */
+#define CAN_MB27_DATA2                 0xFFC02F68 /* CAN Controller 0 Mailbox 27 Data 2 Register */
+#define CAN_MB27_DATA3                 0xFFC02F6C /* CAN Controller 0 Mailbox 27 Data 3 Register */
+#define CAN_MB27_LENGTH                0xFFC02F70 /* CAN Controller 0 Mailbox 27 Length Register */
+#define CAN_MB27_TIMESTAMP             0xFFC02F74 /* CAN Controller 0 Mailbox 27 Timestamp Register */
+#define CAN_MB27_ID0                   0xFFC02F78 /* CAN Controller 0 Mailbox 27 ID0 Register */
+#define CAN_MB27_ID1                   0xFFC02F7C /* CAN Controller 0 Mailbox 27 ID1 Register */
+#define CAN_MB28_DATA0                 0xFFC02F80 /* CAN Controller 0 Mailbox 28 Data 0 Register */
+#define CAN_MB28_DATA1                 0xFFC02F84 /* CAN Controller 0 Mailbox 28 Data 1 Register */
+#define CAN_MB28_DATA2                 0xFFC02F88 /* CAN Controller 0 Mailbox 28 Data 2 Register */
+#define CAN_MB28_DATA3                 0xFFC02F8C /* CAN Controller 0 Mailbox 28 Data 3 Register */
+#define CAN_MB28_LENGTH                0xFFC02F90 /* CAN Controller 0 Mailbox 28 Length Register */
+#define CAN_MB28_TIMESTAMP             0xFFC02F94 /* CAN Controller 0 Mailbox 28 Timestamp Register */
+#define CAN_MB28_ID0                   0xFFC02F98 /* CAN Controller 0 Mailbox 28 ID0 Register */
+#define CAN_MB28_ID1                   0xFFC02F9C /* CAN Controller 0 Mailbox 28 ID1 Register */
+#define CAN_MB29_DATA0                 0xFFC02FA0 /* CAN Controller 0 Mailbox 29 Data 0 Register */
+#define CAN_MB29_DATA1                 0xFFC02FA4 /* CAN Controller 0 Mailbox 29 Data 1 Register */
+#define CAN_MB29_DATA2                 0xFFC02FA8 /* CAN Controller 0 Mailbox 29 Data 2 Register */
+#define CAN_MB29_DATA3                 0xFFC02FAC /* CAN Controller 0 Mailbox 29 Data 3 Register */
+#define CAN_MB29_LENGTH                0xFFC02FB0 /* CAN Controller 0 Mailbox 29 Length Register */
+#define CAN_MB29_TIMESTAMP             0xFFC02FB4 /* CAN Controller 0 Mailbox 29 Timestamp Register */
+#define CAN_MB29_ID0                   0xFFC02FB8 /* CAN Controller 0 Mailbox 29 ID0 Register */
+#define CAN_MB29_ID1                   0xFFC02FBC /* CAN Controller 0 Mailbox 29 ID1 Register */
+#define CAN_MB30_DATA0                 0xFFC02FC0 /* CAN Controller 0 Mailbox 30 Data 0 Register */
+#define CAN_MB30_DATA1                 0xFFC02FC4 /* CAN Controller 0 Mailbox 30 Data 1 Register */
+#define CAN_MB30_DATA2                 0xFFC02FC8 /* CAN Controller 0 Mailbox 30 Data 2 Register */
+#define CAN_MB30_DATA3                 0xFFC02FCC /* CAN Controller 0 Mailbox 30 Data 3 Register */
+#define CAN_MB30_LENGTH                0xFFC02FD0 /* CAN Controller 0 Mailbox 30 Length Register */
+#define CAN_MB30_TIMESTAMP             0xFFC02FD4 /* CAN Controller 0 Mailbox 30 Timestamp Register */
+#define CAN_MB30_ID0                   0xFFC02FD8 /* CAN Controller 0 Mailbox 30 ID0 Register */
+#define CAN_MB30_ID1                   0xFFC02FDC /* CAN Controller 0 Mailbox 30 ID1 Register */
+#define CAN_MB31_DATA0                 0xFFC02FE0 /* CAN Controller 0 Mailbox 31 Data 0 Register */
+#define CAN_MB31_DATA1                 0xFFC02FE4 /* CAN Controller 0 Mailbox 31 Data 1 Register */
+#define CAN_MB31_DATA2                 0xFFC02FE8 /* CAN Controller 0 Mailbox 31 Data 2 Register */
+#define CAN_MB31_DATA3                 0xFFC02FEC /* CAN Controller 0 Mailbox 31 Data 3 Register */
+#define CAN_MB31_LENGTH                0xFFC02FF0 /* CAN Controller 0 Mailbox 31 Length Register */
+#define CAN_MB31_TIMESTAMP             0xFFC02FF4 /* CAN Controller 0 Mailbox 31 Timestamp Register */
+#define CAN_MB31_ID0                   0xFFC02FF8 /* CAN Controller 0 Mailbox 31 ID0 Register */
+#define CAN_MB31_ID1                   0xFFC02FFC /* CAN Controller 0 Mailbox 31 ID1 Register */
+#define PWM1_CTRL                      0xFFC03000 /* PWM1 Control Register */
+#define PWM1_STAT                      0xFFC03004 /* PWM1 Status Register */
+#define PWM1_TM                        0xFFC03008 /* PWM1 Period Register */
+#define PWM1_DT                        0xFFC0300C /* PWM1 Dead Time Register */
+#define PWM1_GATE                      0xFFC03010 /* PWM1 Chopping Control */
+#define PWM1_CHA                       0xFFC03014 /* PWM1 Channel A Duty Control */
+#define PWM1_CHB                       0xFFC03018 /* PWM1 Channel B Duty Control */
+#define PWM1_CHC                       0xFFC0301C /* PWM1 Channel C Duty Control */
+#define PWM1_SEG                       0xFFC03020 /* PWM1 Crossover and Output Enable */
+#define PWM1_SYNCWT                    0xFFC03024 /* PWM1 Sync pulse width control */
+#define PWM1_CHAL                      0xFFC03028 /* PWM1 Channel AL Duty Control (SR mode only) */
+#define PWM1_CHBL                      0xFFC0302C /* PWM1 Channel BL Duty Control (SR mode only) */
+#define PWM1_CHCL                      0xFFC03030 /* PWM1 Channel CL Duty Control (SR mode only) */
+#define PWM1_LSI                       0xFFC03034 /* Low Side Invert (SR mode only) */
+#define PWM1_STAT2                     0xFFC03038 /* PWM1 Status Register */
+#define ACM_CTL                        0xFFC03100 /* ACM Control Register */
+#define ACM_TC0                        0xFFC03104 /* ACM Timing Configuration 0 Register */
+#define ACM_TC1                        0xFFC03108 /* ACM Timing Configuration 1 Register */
+#define ACM_STAT                       0xFFC0310C /* ACM Status Register */
+#define ACM_ES                         0xFFC03110 /* ACM Event Status Register */
+#define ACM_IMSK                       0xFFC03114 /* ACM Interrupt Mask Register */
+#define ACM_MS                         0xFFC03118 /* ACM Missed Event Status Register */
+#define ACM_EMSK                       0xFFC0311C /* ACM Missed Event Interrupt Mask Register */
+#define ACM_ER0                        0xFFC03120 /* ACM Event 0 Control Register */
+#define ACM_ER1                        0xFFC03124 /* ACM Event 1 Control Register */
+#define ACM_ER2                        0xFFC03128 /* ACM Event 2 Control Register */
+#define ACM_ER3                        0xFFC0312C /* ACM Event 3 Control Register */
+#define ACM_ER4                        0xFFC03130 /* ACM Event 4 Control Register */
+#define ACM_ER5                        0xFFC03134 /* ACM Event 5 Control Register */
+#define ACM_ER6                        0xFFC03138 /* ACM Event 6 Control Register */
+#define ACM_ER7                        0xFFC0313C /* ACM Event 7 Control Register */
+#define ACM_ER8                        0xFFC03140 /* ACM Event 8 Control Register */
+#define ACM_ER9                        0xFFC03144 /* ACM Event 9 Control Register */
+#define ACM_ER10                       0xFFC03148 /* ACM Event 10 Control Register */
+#define ACM_ER11                       0xFFC0314C /* ACM Event 11 Control Register */
+#define ACM_ER12                       0xFFC03150 /* ACM Event 12 Control Register */
+#define ACM_ER13                       0xFFC03154 /* ACM Event 13 Control Register */
+#define ACM_ER14                       0xFFC03158 /* ACM Event 14 Control Register */
+#define ACM_ER15                       0xFFC0315C /* ACM Event 15 Control Register */
+#define ACM_ET0                        0xFFC03180 /* ACM Event 0 Time Register */
+#define ACM_ET1                        0xFFC03184 /* ACM Event 1 Time Register */
+#define ACM_ET2                        0xFFC03188 /* ACM Event 2 Time Register */
+#define ACM_ET3                        0xFFC0318C /* ACM Event 3 Time Register */
+#define ACM_ET4                        0xFFC03190 /* ACM Event 4 Time Register */
+#define ACM_ET5                        0xFFC03194 /* ACM Event 5 Time Register */
+#define ACM_ET6                        0xFFC03198 /* ACM Event 6 Time Register */
+#define ACM_ET7                        0xFFC0319C /* ACM Event 7 Time Register */
+#define ACM_ET8                        0xFFC031A0 /* ACM Event 8 Time Register */
+#define ACM_ET9                        0xFFC031A4 /* ACM Event 9 Time Register */
+#define ACM_ET10                       0xFFC031A8 /* ACM Event 10 Time Register */
+#define ACM_ET11                       0xFFC031AC /* ACM Event 11 Time Register */
+#define ACM_ET12                       0xFFC031B0 /* ACM Event 12 Time Register */
+#define ACM_ET13                       0xFFC031B4 /* ACM Event 13 Time Register */
+#define ACM_ET14                       0xFFC031B8 /* ACM Event 14 Time Register */
+#define ACM_ET15                       0xFFC031BC /* ACM Event 15 Time Register */
+#define ACM_TMR0                       0xFFC031C0 /* ACM Timer 0 Registers */
+#define ACM_TMR1                       0xFFC031C4 /* ACM Timer 1 Registers */
+#define PORTF_FER                      0xFFC03200 /* Port F Function Enable Register (Alternate/Flag*) */
+#define PORTG_FER                      0xFFC03204 /* Port G Function Enable Register (Alternate/Flag*) */
+#define PORTH_FER                      0xFFC03208 /* Port H Function Enable Register (Alternate/Flag*) */
+#define PORTF_MUX                      0xFFC03210 /* Port F mux control */
+#define PORTG_MUX                      0xFFC03214 /* Port G mux control */
+#define PORTH_MUX                      0xFFC03218 /* Port H mux control */
+#define PORTF_DRIVE                    0xFFC03220 /* Port F drive strength control */
+#define PORTG_DRIVE                    0xFFC03224 /* Port G drive strength control */
+#define PORTH_DRIVE                    0xFFC03228 /* Port H drive strength control */
+#define PORTF_HYSTERESIS               0xFFC03240 /* Port F Schmitt trigger control */
+#define PORTG_HYSTERESIS               0xFFC03244 /* Port G Schmitt trigger control */
+#define PORTH_HYSTERESIS               0xFFC03248 /* Port H Schmitt trigger control */
+#define NONGPIO_DRIVE                  0xFFC03280 /* Non-GPIO Port drive strength control */
+#define NONGPIO_HYSTERESIS             0xFFC03288 /* Non-GPIO Port Schmitt trigger control */
+#define FLASH_CONTROL                  0xFFC0328C /* Stacked flash control register */
+#define FLASH_CONTROL_SET              0xFFC03290 /* Stacked flash control set register */
+#define FLASH_CONTROL_CLEAR            0xFFC03294 /* Stacked flash control clear register */
+#define CNT1_CONFIG                    0xFFC03300 /* Counter 1 Configuration Register */
+#define CNT1_IMASK                     0xFFC03304 /* Counter 1 Interrupt Mask Register */
+#define CNT1_STATUS                    0xFFC03308 /* Counter 1 Status Register */
+#define CNT1_COMMAND                   0xFFC0330C /* Counter 1 Command Register */
+#define CNT1_DEBOUNCE                  0xFFC03310 /* Counter 1 Debounce Register */
+#define CNT1_COUNTER                   0xFFC03314 /* Counter 1 Counter Register */
+#define CNT1_MAX                       0xFFC03318 /* Counter 1 Boundry Value Register - max count */
+#define CNT1_MIN                       0xFFC0331C /* Counter 1 Boundry Value Register - min count */
+#define SPI1_CTL                       0xFFC03400 /* SPI1 Control */
+#define SPI1_FLG                       0xFFC03404 /* SPI1 Flag Register */
+#define SPI1_STAT                      0xFFC03408 /* SPI1 Status Register */
+#define SPI1_TDBR                      0xFFC0340C /* SPI1 Transmit Data Buffer */
+#define SPI1_RDBR                      0xFFC03410 /* SPI1 Receive Data Buffer */
+#define SPI1_BAUD                      0xFFC03414 /* SPI1 Baud Rate */
+#define SPI1_SHADOW                    0xFFC03418 /* SPI1_RDBR Shadow Register */
+#define CNT0_CONFIG                    0xFFC03500 /* Configuration/Control Register */
+#define CNT0_IMASK                     0xFFC03504 /* Interrupt Mask Register */
+#define CNT0_STATUS                    0xFFC03508 /* Status Register */
+#define CNT0_COMMAND                   0xFFC0350C /* Command Register */
+#define CNT0_DEBOUNCE                  0xFFC03510 /* Debounce Prescaler Register */
+#define CNT0_COUNTER                   0xFFC03514 /* Counter Register */
+#define CNT0_MAX                       0xFFC03518 /* Maximal Count Boundary Value Register */
+#define CNT0_MIN                       0xFFC0351C /* Minimal Count Boundary Value Register */
+#define PWM0_CTRL                      0xFFC03700 /* PWM Control Register */
+#define PWM0_STAT                      0xFFC03704 /* PWM Status Register */
+#define PWM0_TM                        0xFFC03708 /* PWM Period Register */
+#define PWM0_DT                        0xFFC0370C /* PWM Dead Time Register */
+#define PWM0_GATE                      0xFFC03710 /* PWM Chopping Control */
+#define PWM0_CHA                       0xFFC03714 /* PWM Channel A Duty Control */
+#define PWM0_CHB                       0xFFC03718 /* PWM Channel B Duty Control */
+#define PWM0_CHC                       0xFFC0371C /* PWM Channel C Duty Control */
+#define PWM0_SEG                       0xFFC03720 /* PWM Crossover and Output Enable */
+#define PWM0_SYNCWT                    0xFFC03724 /* PWM Sync pulse width control */
+#define PWM0_CHAL                      0xFFC03728 /* PWM Channel AL Duty Control (SR mode only) */
+#define PWM0_CHBL                      0xFFC0372C /* PWM Channel BL Duty Control (SR mode only) */
+#define PWM0_CHCL                      0xFFC03730 /* PWM Channel CL Duty Control (SR mode only) */
+#define PWM0_LSI                       0xFFC03734 /* Low Side Invert (SR mode only) */
+#define PWM0_STAT2                     0xFFC03738 /* PWM Status Register */
+#define RSI_PWR_CONTROL                0xFFC03800 /* RSI Power Control Register */
+#define RSI_CLK_CONTROL                0xFFC03804 /* RSI Clock Control Register */
+#define RSI_ARGUMENT                   0xFFC03808 /* RSI Argument Register */
+#define RSI_COMMAND                    0xFFC0380C /* RSI Command Register */
+#define RSI_RESP_CMD                   0xFFC03810 /* RSI Response Command Register */
+#define RSI_RESPONSE0                  0xFFC03814 /* RSI Response Register */
+#define RSI_RESPONSE1                  0xFFC03818 /* RSI Response Register */
+#define RSI_RESPONSE2                  0xFFC0381C /* RSI Response Register */
+#define RSI_RESPONSE3                  0xFFC03820 /* RSI Response Register */
+#define RSI_DATA_TIMER                 0xFFC03824 /* RSI Data Timer Register */
+#define RSI_DATA_LGTH                  0xFFC03828 /* RSI Data Length Register */
+#define RSI_DATA_CONTROL               0xFFC0382C /* RSI Data Control Register */
+#define RSI_DATA_CNT                   0xFFC03830 /* RSI Data Counter Register */
+#define RSI_STATUS                     0xFFC03834 /* RSI Status Register */
+#define RSI_STATUSCL                   0xFFC03838 /* RSI Status Clear Register */
+#define RSI_MASK0                      0xFFC0383C /* RSI Interrupt 0 Mask Register */
+#define RSI_MASK1                      0xFFC03840 /* RSI Interrupt 1 Mask Register */
+#define RSI_FIFO_CNT                   0xFFC03848 /* RSI FIFO Counter Register */
+#define RSI_CEATA_CONTROL              0xFFC0384C /* RSI CEATA Register */
+#define RSI_FIFO                       0xFFC03880 /* RSI Data FIFO Register */
+#define RSI_ESTAT                      0xFFC038C0 /* RSI Exception Status Register */
+#define RSI_EMASK                      0xFFC038C4 /* RSI Exception Mask Register */
+#define RSI_CONFIG                     0xFFC038C8 /* RSI Configuration Register */
+#define RSI_RD_WAIT_EN                 0xFFC038CC /* RSI Read Wait Enable Register */
+#define RSI_PID0                       0xFFC038D0 /* RSI Peripheral ID Register 0 */
+#define RSI_PID1                       0xFFC038D4 /* RSI Peripheral ID Register 1 */
+#define RSI_PID2                       0xFFC038D8 /* RSI Peripheral ID Register 2 */
+#define RSI_PID3                       0xFFC038DC /* RSI Peripheral ID Register 3 */
+#define DMA_TC_CNT                     0xFFC00B0C
+#define DMA_TC_PER                     0xFFC00B10
+
+#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
+#define L1_DATA_A_SRAM_SIZE 0x8000
+#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
+#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
+#define L1_INST_SRAM_SIZE 0x8000
+#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
+
+#endif /* __BFIN_DEF_ADSP_BF504_proc__ */
diff --git a/arch/blackfin/include/asm/mach-bf506/BF506_cdef.h b/arch/blackfin/include/asm/mach-bf506/BF506_cdef.h
new file mode 100644 (file)
index 0000000..4c5baac
--- /dev/null
@@ -0,0 +1,11 @@
+/* DO NOT EDIT THIS FILE
+ * Automatically generated by generate-cdef-headers.xsl
+ * DO NOT EDIT THIS FILE
+ */
+
+#ifndef __BFIN_CDEF_ADSP_BF506_proc__
+#define __BFIN_CDEF_ADSP_BF506_proc__
+
+#include "BF504_cdef.h"
+
+#endif /* __BFIN_CDEF_ADSP_BF506_proc__ */
diff --git a/arch/blackfin/include/asm/mach-bf506/BF506_def.h b/arch/blackfin/include/asm/mach-bf506/BF506_def.h
new file mode 100644 (file)
index 0000000..1f91397
--- /dev/null
@@ -0,0 +1,11 @@
+/* DO NOT EDIT THIS FILE
+ * Automatically generated by generate-def-headers.xsl
+ * DO NOT EDIT THIS FILE
+ */
+
+#ifndef __BFIN_DEF_ADSP_BF506_proc__
+#define __BFIN_DEF_ADSP_BF506_proc__
+
+#include "BF504_def.h"
+
+#endif /* __BFIN_DEF_ADSP_BF506_proc__ */
diff --git a/arch/blackfin/include/asm/mach-bf506/anomaly.h b/arch/blackfin/include/asm/mach-bf506/anomaly.h
new file mode 100644 (file)
index 0000000..e767233
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * DO NOT EDIT THIS FILE
+ * This file is under version control at
+ *   svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
+ * and can be replaced with that version at any time
+ * DO NOT EDIT THIS FILE
+ *
+ * Copyright 2004-2010 Analog Devices Inc.
+ * Licensed under the ADI BSD license.
+ *   https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
+ */
+
+/* This file should be up to date with:
+ */
+
+#if __SILICON_REVISION__ < 0
+# error will not work on BF506 silicon version
+#endif
+
+#ifndef _MACH_ANOMALY_H_
+#define _MACH_ANOMALY_H_
+
+/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */
+#define ANOMALY_05000074 (1)
+/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
+#define ANOMALY_05000119 (1)
+/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
+#define ANOMALY_05000122 (1)
+/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
+#define ANOMALY_05000245 (1)
+/* Incorrect Timer Pulse Width in Single-Shot PWM_OUT Mode with External Clock */
+#define ANOMALY_05000254 (1)
+/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
+#define ANOMALY_05000265 (1)
+/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
+#define ANOMALY_05000310 (1)
+/* PPI Underflow Error Goes Undetected in ITU-R 656 Mode */
+#define ANOMALY_05000366 (1)
+/* Speculative Fetches Can Cause Undesired External FIFO Operations */
+#define ANOMALY_05000416 (1)
+/* Speculative Fetches of Indirect-Pointer Instructions Can Cause False Hardware Errors */
+#define ANOMALY_05000426 (1)
+/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
+#define ANOMALY_05000443 (1)
+/* UART IrDA Receiver Fails on Extended Bit Pulses */
+#define ANOMALY_05000447 (1)
+/* False Hardware Error when RETI Points to Invalid Memory */
+#define ANOMALY_05000461 (1)
+/* PLL Latches Incorrect Settings During Reset */
+#define ANOMALY_05000469 (1)
+/* Incorrect Default MSEL Value in PLL_CTL */
+#define ANOMALY_05000472 (1)
+/* Interrupted SPORT Receive Data Register Read Results In Underflow when SLEN > 15 */
+#define ANOMALY_05000473 (1)
+/* TESTSET Instruction Cannot Be Interrupted */
+#define ANOMALY_05000477 (1)
+/* Reads of ITEST_COMMAND and ITEST_DATA Registers Cause Cache Corruption */
+#define ANOMALY_05000481 (1)
+/* IFLUSH sucks at life */
+#define ANOMALY_05000491 (1)
+
+/* Anomalies that don't exist on this proc */
+#define ANOMALY_05000099 (0)
+#define ANOMALY_05000120 (0)
+#define ANOMALY_05000125 (0)
+#define ANOMALY_05000149 (0)
+#define ANOMALY_05000158 (0)
+#define ANOMALY_05000171 (0)
+#define ANOMALY_05000179 (0)
+#define ANOMALY_05000182 (0)
+#define ANOMALY_05000183 (0)
+#define ANOMALY_05000189 (0)
+#define ANOMALY_05000198 (0)
+#define ANOMALY_05000202 (0)
+#define ANOMALY_05000215 (0)
+#define ANOMALY_05000219 (0)
+#define ANOMALY_05000220 (0)
+#define ANOMALY_05000227 (0)
+#define ANOMALY_05000230 (0)
+#define ANOMALY_05000231 (0)
+#define ANOMALY_05000233 (0)
+#define ANOMALY_05000234 (0)
+#define ANOMALY_05000242 (0)
+#define ANOMALY_05000244 (0)
+#define ANOMALY_05000248 (0)
+#define ANOMALY_05000250 (0)
+#define ANOMALY_05000257 (0)
+#define ANOMALY_05000261 (0)
+#define ANOMALY_05000263 (0)
+#define ANOMALY_05000266 (0)
+#define ANOMALY_05000273 (0)
+#define ANOMALY_05000274 (0)
+#define ANOMALY_05000278 (0)
+#define ANOMALY_05000281 (0)
+#define ANOMALY_05000283 (0)
+#define ANOMALY_05000285 (0)
+#define ANOMALY_05000287 (0)
+#define ANOMALY_05000301 (0)
+#define ANOMALY_05000305 (0)
+#define ANOMALY_05000307 (0)
+#define ANOMALY_05000311 (0)
+#define ANOMALY_05000312 (0)
+#define ANOMALY_05000315 (0)
+#define ANOMALY_05000323 (0)
+#define ANOMALY_05000353 (0)
+#define ANOMALY_05000357 (0)
+#define ANOMALY_05000362 (1)
+#define ANOMALY_05000363 (0)
+#define ANOMALY_05000364 (0)
+#define ANOMALY_05000371 (0)
+#define ANOMALY_05000380 (0)
+#define ANOMALY_05000386 (0)
+#define ANOMALY_05000389 (0)
+#define ANOMALY_05000400 (0)
+#define ANOMALY_05000402 (0)
+#define ANOMALY_05000412 (0)
+#define ANOMALY_05000432 (0)
+#define ANOMALY_05000440 (0)
+#define ANOMALY_05000448 (0)
+#define ANOMALY_05000456 (0)
+#define ANOMALY_05000450 (0)
+#define ANOMALY_05000465 (0)
+#define ANOMALY_05000467 (0)
+#define ANOMALY_05000474 (0)
+#define ANOMALY_05000475 (0)
+#define ANOMALY_05000485 (0)
+
+#endif
diff --git a/arch/blackfin/include/asm/mach-bf506/def_local.h b/arch/blackfin/include/asm/mach-bf506/def_local.h
new file mode 100644 (file)
index 0000000..e7a416d
--- /dev/null
@@ -0,0 +1,5 @@
+#include "gpio.h"
+#include "portmux.h"
+#include "ports.h"
+
+#define CONFIG_BF50x 1 /* Linux glue */
diff --git a/arch/blackfin/include/asm/mach-bf506/gpio.h b/arch/blackfin/include/asm/mach-bf506/gpio.h
new file mode 100644 (file)
index 0000000..08a82f4
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2008 Analog Devices Inc.
+ * Licensed under the GPL-2 or later.
+ */
+
+
+#ifndef _MACH_GPIO_H_
+#define _MACH_GPIO_H_
+
+#define MAX_BLACKFIN_GPIOS 35
+
+#define GPIO_PF0       0
+#define GPIO_PF1       1
+#define GPIO_PF2       2
+#define GPIO_PF3       3
+#define GPIO_PF4       4
+#define GPIO_PF5       5
+#define GPIO_PF6       6
+#define GPIO_PF7       7
+#define GPIO_PF8       8
+#define GPIO_PF9       9
+#define GPIO_PF10      10
+#define GPIO_PF11      11
+#define GPIO_PF12      12
+#define GPIO_PF13      13
+#define GPIO_PF14      14
+#define GPIO_PF15      15
+#define GPIO_PG0       16
+#define GPIO_PG1       17
+#define GPIO_PG2       18
+#define GPIO_PG3       19
+#define GPIO_PG4       20
+#define GPIO_PG5       21
+#define GPIO_PG6       22
+#define GPIO_PG7       23
+#define GPIO_PG8       24
+#define GPIO_PG9       25
+#define GPIO_PG10      26
+#define GPIO_PG11      27
+#define GPIO_PG12      28
+#define GPIO_PG13      29
+#define GPIO_PG14      30
+#define GPIO_PG15      31
+#define GPIO_PH0       32
+#define GPIO_PH1       33
+#define GPIO_PH2       34
+
+#define PORT_F GPIO_PF0
+#define PORT_G GPIO_PG0
+#define PORT_H GPIO_PH0
+
+#endif /* _MACH_GPIO_H_ */
diff --git a/arch/blackfin/include/asm/mach-bf506/portmux.h b/arch/blackfin/include/asm/mach-bf506/portmux.h
new file mode 100644 (file)
index 0000000..086186d
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2008-2010 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later
+ */
+
+#ifndef _MACH_PORTMUX_H_
+#define _MACH_PORTMUX_H_
+
+#define MAX_RESOURCES  MAX_BLACKFIN_GPIOS
+
+/* PPI Port Mux */
+#define P_PPI0_D0      (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(2))
+#define P_PPI0_D1      (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(2))
+#define P_PPI0_D2      (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(2))
+#define P_PPI0_D3      (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(2))
+#define P_PPI0_D4      (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(2))
+#define P_PPI0_D5      (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(2))
+#define P_PPI0_D6      (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(2))
+#define P_PPI0_D7      (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(2))
+#define P_PPI0_D8      (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(2))
+#define P_PPI0_D9      (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(2))
+#define P_PPI0_D10     (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(2))
+#define P_PPI0_D11     (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(2))
+#define P_PPI0_D12     (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(2))
+#define P_PPI0_D13     (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(2))
+#define P_PPI0_D14     (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(2))
+#define P_PPI0_D15     (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(2))
+
+#define P_PPI0_CLK     (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(1))
+#define P_PPI0_FS1     (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(2))
+#define P_PPI0_FS2     (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(2))
+#define P_PPI0_FS3     (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(1))
+
+/* SPI Port Mux */
+#define P_SPI0_SCK     (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(0))
+#define P_SPI0_MISO    (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(0))
+#define P_SPI0_MOSI    (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(0))
+
+#define P_SPI0_SSEL1   (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(0))
+#define P_SPI0_SSEL2   (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(0))
+#define P_SPI0_SSEL3   (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(0))
+
+#define P_SPI1_SCK     (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0))
+#define P_SPI1_MISO    (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(0))
+#define P_SPI1_MOSI    (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(0))
+
+#define P_SPI1_SSEL1   (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(0))
+#define P_SPI1_SSEL2   (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
+#define P_SPI1_SSEL3   (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0))
+
+#define GPIO_DEFAULT_BOOT_SPI_CS GPIO_PF13
+#define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL1
+
+/* SPORT Port Mux */
+#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(0))
+#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(0))
+#define P_SPORT0_RFS   (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(0))
+#define P_SPORT0_TFS   (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(0))
+#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(0))
+#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(0))
+#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(1))
+#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1))
+
+#define P_SPORT1_DRPRI (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(0))
+#define P_SPORT1_RFS   (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(0))
+#define P_SPORT1_RSCLK (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(0))
+#define P_SPORT1_DTPRI (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(1))
+#define P_SPORT1_TFS   (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(1))
+#define P_SPORT1_TSCLK (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(1))
+#define P_SPORT1_DTSEC (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(1))
+#define P_SPORT1_DRSEC (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(0))
+
+/* UART Port Mux */
+#ifdef CONFIG_BF506_UART0_PORTF
+#define P_UART0_TX     (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1))
+#define P_UART0_RX     (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1))
+#else
+#define P_UART0_TX     (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(0))
+#define P_UART0_RX     (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(0))
+#endif
+#define P_UART0_RTS    (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0))
+#define P_UART0_CTS    (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0))
+
+#ifdef CONFIG_BF506_UART1_PORTG
+#define P_UART1_TX     (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0))
+#define P_UART1_RX     (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0))
+#else
+#define P_UART1_TX     (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(0))
+#define P_UART1_RX     (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(0))
+#endif
+#define P_UART1_RTS    (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(0))
+#define P_UART1_CTS    (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(0))
+
+/* Timer */
+#define P_TMRCLK       (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(1))
+#define P_TMR0         (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(2))
+#define P_TMR1         (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(2))
+#define P_TMR2         (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(1))
+#define P_TMR3         (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(1))
+#define P_TMR4         (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(1))
+#define P_TMR5         (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(2))
+#define P_TMR6         (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(2))
+#define P_TMR7         (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(1))
+
+/* CAN */
+#define P_CAN_TX       (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(2))
+#define P_CAN_RX       (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(2))
+
+/* PWM */
+#define P_PWM0_AH      (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1))
+#define P_PWM0_AL      (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1))
+#define P_PWM0_BH      (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1))
+#define P_PWM0_BL      (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1))
+#define P_PWM0_CH      (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1))
+#define P_PWM0_CL      (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1))
+#define P_PWM0_SYNC    (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1))
+#define P_PWM0_TRIP    (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1))
+
+#define P_PWM1_AH      (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(2))
+#define P_PWM1_AL      (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(2))
+#define P_PWM1_BH      (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(2))
+#define P_PWM1_BL      (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(2))
+#define P_PWM1_CH      (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(2))
+#define P_PWM1_CL      (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(2))
+#define P_PWM1_SYNC    (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(2))
+#define P_PWM1_TRIP    (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(2))
+
+/* RSI */
+#define P_RSI_DATA0    (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(1))
+#define P_RSI_DATA1    (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(1))
+#define P_RSI_DATA2    (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(1))
+#define P_RSI_DATA3    (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(1))
+#define P_RSI_DATA4    (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(1))
+#define P_RSI_DATA5    (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(1))
+#define P_RSI_DATA6    (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(1))
+#define P_RSI_DATA7    (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(1))
+#define P_RSI_CMD      (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(1))
+#define P_RSI_CLK      (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(1))
+
+/* ACM */
+#define P_ACM_SE_DIFF  (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0))
+#define P_ACM_RANGE    (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(0))
+#define P_ACM_A0       (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(0))
+#define P_ACM_A1       (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(0))
+#define P_ACM_A2       (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(0))
+
+#endif                         /* _MACH_PORTMUX_H_ */
diff --git a/arch/blackfin/include/asm/mach-bf506/ports.h b/arch/blackfin/include/asm/mach-bf506/ports.h
new file mode 100644 (file)
index 0000000..f1e9cc0
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Port Masks
+ */
+
+#ifndef __BFIN_PERIPHERAL_PORT__
+#define __BFIN_PERIPHERAL_PORT__
+
+/* PORTx_MUX Masks */
+#define PORT_x_MUX_0_MASK      0x0003
+#define PORT_x_MUX_1_MASK      0x000C
+#define PORT_x_MUX_2_MASK      0x0030
+#define PORT_x_MUX_3_MASK      0x00C0
+#define PORT_x_MUX_4_MASK      0x0300
+#define PORT_x_MUX_5_MASK      0x0C00
+#define PORT_x_MUX_6_MASK      0x3000
+#define PORT_x_MUX_7_MASK      0xC000
+
+#define PORT_x_MUX_FUNC_1      (0x0)
+#define PORT_x_MUX_FUNC_2      (0x1)
+#define PORT_x_MUX_FUNC_3      (0x2)
+#define PORT_x_MUX_FUNC_4      (0x3)
+#define PORT_x_MUX_0_FUNC_1    (PORT_x_MUX_FUNC_1 << 0)
+#define PORT_x_MUX_0_FUNC_2    (PORT_x_MUX_FUNC_2 << 0)
+#define PORT_x_MUX_0_FUNC_3    (PORT_x_MUX_FUNC_3 << 0)
+#define PORT_x_MUX_0_FUNC_4    (PORT_x_MUX_FUNC_4 << 0)
+#define PORT_x_MUX_1_FUNC_1    (PORT_x_MUX_FUNC_1 << 2)
+#define PORT_x_MUX_1_FUNC_2    (PORT_x_MUX_FUNC_2 << 2)
+#define PORT_x_MUX_1_FUNC_3    (PORT_x_MUX_FUNC_3 << 2)
+#define PORT_x_MUX_1_FUNC_4    (PORT_x_MUX_FUNC_4 << 2)
+#define PORT_x_MUX_2_FUNC_1    (PORT_x_MUX_FUNC_1 << 4)
+#define PORT_x_MUX_2_FUNC_2    (PORT_x_MUX_FUNC_2 << 4)
+#define PORT_x_MUX_2_FUNC_3    (PORT_x_MUX_FUNC_3 << 4)
+#define PORT_x_MUX_2_FUNC_4    (PORT_x_MUX_FUNC_4 << 4)
+#define PORT_x_MUX_3_FUNC_1    (PORT_x_MUX_FUNC_1 << 6)
+#define PORT_x_MUX_3_FUNC_2    (PORT_x_MUX_FUNC_2 << 6)
+#define PORT_x_MUX_3_FUNC_3    (PORT_x_MUX_FUNC_3 << 6)
+#define PORT_x_MUX_3_FUNC_4    (PORT_x_MUX_FUNC_4 << 6)
+#define PORT_x_MUX_4_FUNC_1    (PORT_x_MUX_FUNC_1 << 8)
+#define PORT_x_MUX_4_FUNC_2    (PORT_x_MUX_FUNC_2 << 8)
+#define PORT_x_MUX_4_FUNC_3    (PORT_x_MUX_FUNC_3 << 8)
+#define PORT_x_MUX_4_FUNC_4    (PORT_x_MUX_FUNC_4 << 8)
+#define PORT_x_MUX_5_FUNC_1    (PORT_x_MUX_FUNC_1 << 10)
+#define PORT_x_MUX_5_FUNC_2    (PORT_x_MUX_FUNC_2 << 10)
+#define PORT_x_MUX_5_FUNC_3    (PORT_x_MUX_FUNC_3 << 10)
+#define PORT_x_MUX_5_FUNC_4    (PORT_x_MUX_FUNC_4 << 10)
+#define PORT_x_MUX_6_FUNC_1    (PORT_x_MUX_FUNC_1 << 12)
+#define PORT_x_MUX_6_FUNC_2    (PORT_x_MUX_FUNC_2 << 12)
+#define PORT_x_MUX_6_FUNC_3    (PORT_x_MUX_FUNC_3 << 12)
+#define PORT_x_MUX_6_FUNC_4    (PORT_x_MUX_FUNC_4 << 12)
+#define PORT_x_MUX_7_FUNC_1    (PORT_x_MUX_FUNC_1 << 14)
+#define PORT_x_MUX_7_FUNC_2    (PORT_x_MUX_FUNC_2 << 14)
+#define PORT_x_MUX_7_FUNC_3    (PORT_x_MUX_FUNC_3 << 14)
+#define PORT_x_MUX_7_FUNC_4    (PORT_x_MUX_FUNC_4 << 14)
+
+#include "../mach-common/bits/ports-f.h"
+#include "../mach-common/bits/ports-g.h"
+#include "../mach-common/bits/ports-h.h"
+
+#endif
index abc88ca6d3309bd40e8f51175d16a4e1f2724434..bbaf22fa95feafa456787b6d25b621f8c5f6a24b 100644 (file)
 #define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
 #define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
 #define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF512_proc__ */
diff --git a/arch/blackfin/include/asm/mach-bf527/ADSP-EDN-BF52x-extended_cdef.h b/arch/blackfin/include/asm/mach-bf527/ADSP-EDN-BF52x-extended_cdef.h
deleted file mode 100644 (file)
index 5381bf0..0000000
+++ /dev/null
@@ -1,994 +0,0 @@
-/* DO NOT EDIT THIS FILE
- * Automatically generated by generate-cdef-headers.xsl
- * DO NOT EDIT THIS FILE
- */
-
-#ifndef __BFIN_CDEF_ADSP_EDN_BF52x_extended__
-#define __BFIN_CDEF_ADSP_EDN_BF52x_extended__
-
-#define bfin_read_SIC_RVECT()          bfin_read16(SIC_RVECT)
-#define bfin_write_SIC_RVECT(val)      bfin_write16(SIC_RVECT, val)
-#define bfin_read_SIC_IMASK0()         bfin_read32(SIC_IMASK0)
-#define bfin_write_SIC_IMASK0(val)     bfin_write32(SIC_IMASK0, val)
-#define bfin_read_SIC_IAR0()           bfin_read32(SIC_IAR0)
-#define bfin_write_SIC_IAR0(val)       bfin_write32(SIC_IAR0, val)
-#define bfin_read_SIC_IAR1()           bfin_read32(SIC_IAR1)
-#define bfin_write_SIC_IAR1(val)       bfin_write32(SIC_IAR1, val)
-#define bfin_read_SIC_IAR2()           bfin_read32(SIC_IAR2)
-#define bfin_write_SIC_IAR2(val)       bfin_write32(SIC_IAR2, val)
-#define bfin_read_SIC_IAR3()           bfin_read32(SIC_IAR3)
-#define bfin_write_SIC_IAR3(val)       bfin_write32(SIC_IAR3, val)
-#define bfin_read_SIC_ISR0()           bfin_read32(SIC_ISR0)
-#define bfin_write_SIC_ISR0(val)       bfin_write32(SIC_ISR0, val)
-#define bfin_read_SIC_IWR0()           bfin_read32(SIC_IWR0)
-#define bfin_write_SIC_IWR0(val)       bfin_write32(SIC_IWR0, val)
-#define bfin_read_SIC_IMASK1()         bfin_read32(SIC_IMASK1)
-#define bfin_write_SIC_IMASK1(val)     bfin_write32(SIC_IMASK1, val)
-#define bfin_read_SIC_IAR4()           bfin_read32(SIC_IAR4)
-#define bfin_write_SIC_IAR4(val)       bfin_write32(SIC_IAR4, val)
-#define bfin_read_SIC_IAR5()           bfin_read32(SIC_IAR5)
-#define bfin_write_SIC_IAR5(val)       bfin_write32(SIC_IAR5, val)
-#define bfin_read_SIC_IAR6()           bfin_read32(SIC_IAR6)
-#define bfin_write_SIC_IAR6(val)       bfin_write32(SIC_IAR6, val)
-#define bfin_read_SIC_IAR7()           bfin_read32(SIC_IAR7)
-#define bfin_write_SIC_IAR7(val)       bfin_write32(SIC_IAR7, val)
-#define bfin_read_SIC_ISR1()           bfin_read32(SIC_ISR1)
-#define bfin_write_SIC_ISR1(val)       bfin_write32(SIC_ISR1, val)
-#define bfin_read_SIC_IWR1()           bfin_read32(SIC_IWR1)
-#define bfin_write_SIC_IWR1(val)       bfin_write32(SIC_IWR1, val)
-#define bfin_read_WDOG_CTL()           bfin_read16(WDOG_CTL)
-#define bfin_write_WDOG_CTL(val)       bfin_write16(WDOG_CTL, val)
-#define bfin_read_WDOG_CNT()           bfin_read32(WDOG_CNT)
-#define bfin_write_WDOG_CNT(val)       bfin_write32(WDOG_CNT, val)
-#define bfin_read_WDOG_STAT()          bfin_read32(WDOG_STAT)
-#define bfin_write_WDOG_STAT(val)      bfin_write32(WDOG_STAT, val)
-#define bfin_read_RTC_STAT()           bfin_read32(RTC_STAT)
-#define bfin_write_RTC_STAT(val)       bfin_write32(RTC_STAT, val)
-#define bfin_read_RTC_ICTL()           bfin_read16(RTC_ICTL)
-#define bfin_write_RTC_ICTL(val)       bfin_write16(RTC_ICTL, val)
-#define bfin_read_RTC_ISTAT()          bfin_read16(RTC_ISTAT)
-#define bfin_write_RTC_ISTAT(val)      bfin_write16(RTC_ISTAT, val)
-#define bfin_read_RTC_SWCNT()          bfin_read16(RTC_SWCNT)
-#define bfin_write_RTC_SWCNT(val)      bfin_write16(RTC_SWCNT, val)
-#define bfin_read_RTC_ALARM()          bfin_read32(RTC_ALARM)
-#define bfin_write_RTC_ALARM(val)      bfin_write32(RTC_ALARM, val)
-#define bfin_read_RTC_PREN()           bfin_read16(RTC_PREN)
-#define bfin_write_RTC_PREN(val)       bfin_write16(RTC_PREN, val)
-#define bfin_read_UART0_THR()          bfin_read16(UART0_THR)
-#define bfin_write_UART0_THR(val)      bfin_write16(UART0_THR, val)
-#define bfin_read_UART0_RBR()          bfin_read16(UART0_RBR)
-#define bfin_write_UART0_RBR(val)      bfin_write16(UART0_RBR, val)
-#define bfin_read_UART0_DLL()          bfin_read16(UART0_DLL)
-#define bfin_write_UART0_DLL(val)      bfin_write16(UART0_DLL, val)
-#define bfin_read_UART0_IER()          bfin_read16(UART0_IER)
-#define bfin_write_UART0_IER(val)      bfin_write16(UART0_IER, val)
-#define bfin_read_UART0_DLH()          bfin_read16(UART0_DLH)
-#define bfin_write_UART0_DLH(val)      bfin_write16(UART0_DLH, val)
-#define bfin_read_UART0_IIR()          bfin_read16(UART0_IIR)
-#define bfin_write_UART0_IIR(val)      bfin_write16(UART0_IIR, val)
-#define bfin_read_UART0_LCR()          bfin_read16(UART0_LCR)
-#define bfin_write_UART0_LCR(val)      bfin_write16(UART0_LCR, val)
-#define bfin_read_UART0_MCR()          bfin_read16(UART0_MCR)
-#define bfin_write_UART0_MCR(val)      bfin_write16(UART0_MCR, val)
-#define bfin_read_UART0_LSR()          bfin_read16(UART0_LSR)
-#define bfin_write_UART0_LSR(val)      bfin_write16(UART0_LSR, val)
-#define bfin_read_UART0_MSR()          bfin_read16(UART0_MSR)
-#define bfin_write_UART0_MSR(val)      bfin_write16(UART0_MSR, val)
-#define bfin_read_UART0_SCR()          bfin_read16(UART0_SCR)
-#define bfin_write_UART0_SCR(val)      bfin_write16(UART0_SCR, val)
-#define bfin_read_UART0_GCTL()         bfin_read16(UART0_GCTL)
-#define bfin_write_UART0_GCTL(val)     bfin_write16(UART0_GCTL, val)
-#define bfin_read_SPI_CTL()            bfin_read16(SPI_CTL)
-#define bfin_write_SPI_CTL(val)        bfin_write16(SPI_CTL, val)
-#define bfin_read_SPI_FLG()            bfin_read16(SPI_FLG)
-#define bfin_write_SPI_FLG(val)        bfin_write16(SPI_FLG, val)
-#define bfin_read_SPI_STAT()           bfin_read16(SPI_STAT)
-#define bfin_write_SPI_STAT(val)       bfin_write16(SPI_STAT, val)
-#define bfin_read_SPI_TDBR()           bfin_read16(SPI_TDBR)
-#define bfin_write_SPI_TDBR(val)       bfin_write16(SPI_TDBR, val)
-#define bfin_read_SPI_RDBR()           bfin_read16(SPI_RDBR)
-#define bfin_write_SPI_RDBR(val)       bfin_write16(SPI_RDBR, val)
-#define bfin_read_SPI_BAUD()           bfin_read16(SPI_BAUD)
-#define bfin_write_SPI_BAUD(val)       bfin_write16(SPI_BAUD, val)
-#define bfin_read_SPI_SHADOW()         bfin_read16(SPI_SHADOW)
-#define bfin_write_SPI_SHADOW(val)     bfin_write16(SPI_SHADOW, val)
-#define bfin_read_TIMER0_CONFIG()      bfin_read16(TIMER0_CONFIG)
-#define bfin_write_TIMER0_CONFIG(val)  bfin_write16(TIMER0_CONFIG, val)
-#define bfin_read_TIMER0_COUNTER()     bfin_read32(TIMER0_COUNTER)
-#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
-#define bfin_read_TIMER0_PERIOD()      bfin_read32(TIMER0_PERIOD)
-#define bfin_write_TIMER0_PERIOD(val)  bfin_write32(TIMER0_PERIOD, val)
-#define bfin_read_TIMER0_WIDTH()       bfin_read32(TIMER0_WIDTH)
-#define bfin_write_TIMER0_WIDTH(val)   bfin_write32(TIMER0_WIDTH, val)
-#define bfin_read_TIMER1_CONFIG()      bfin_read16(TIMER1_CONFIG)
-#define bfin_write_TIMER1_CONFIG(val)  bfin_write16(TIMER1_CONFIG, val)
-#define bfin_read_TIMER1_COUNTER()     bfin_read32(TIMER1_COUNTER)
-#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
-#define bfin_read_TIMER1_PERIOD()      bfin_read32(TIMER1_PERIOD)
-#define bfin_write_TIMER1_PERIOD(val)  bfin_write32(TIMER1_PERIOD, val)
-#define bfin_read_TIMER1_WIDTH()       bfin_read32(TIMER1_WIDTH)
-#define bfin_write_TIMER1_WIDTH(val)   bfin_write32(TIMER1_WIDTH, val)
-#define bfin_read_TIMER2_CONFIG()      bfin_read16(TIMER2_CONFIG)
-#define bfin_write_TIMER2_CONFIG(val)  bfin_write16(TIMER2_CONFIG, val)
-#define bfin_read_TIMER2_COUNTER()     bfin_read32(TIMER2_COUNTER)
-#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
-#define bfin_read_TIMER2_PERIOD()      bfin_read32(TIMER2_PERIOD)
-#define bfin_write_TIMER2_PERIOD(val)  bfin_write32(TIMER2_PERIOD, val)
-#define bfin_read_TIMER2_WIDTH()       bfin_read32(TIMER2_WIDTH)
-#define bfin_write_TIMER2_WIDTH(val)   bfin_write32(TIMER2_WIDTH, val)
-#define bfin_read_TIMER3_CONFIG()      bfin_read16(TIMER3_CONFIG)
-#define bfin_write_TIMER3_CONFIG(val)  bfin_write16(TIMER3_CONFIG, val)
-#define bfin_read_TIMER3_COUNTER()     bfin_read32(TIMER3_COUNTER)
-#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER, val)
-#define bfin_read_TIMER3_PERIOD()      bfin_read32(TIMER3_PERIOD)
-#define bfin_write_TIMER3_PERIOD(val)  bfin_write32(TIMER3_PERIOD, val)
-#define bfin_read_TIMER3_WIDTH()       bfin_read32(TIMER3_WIDTH)
-#define bfin_write_TIMER3_WIDTH(val)   bfin_write32(TIMER3_WIDTH, val)
-#define bfin_read_TIMER4_CONFIG()      bfin_read16(TIMER4_CONFIG)
-#define bfin_write_TIMER4_CONFIG(val)  bfin_write16(TIMER4_CONFIG, val)
-#define bfin_read_TIMER4_COUNTER()     bfin_read32(TIMER4_COUNTER)
-#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER, val)
-#define bfin_read_TIMER4_PERIOD()      bfin_read32(TIMER4_PERIOD)
-#define bfin_write_TIMER4_PERIOD(val)  bfin_write32(TIMER4_PERIOD, val)
-#define bfin_read_TIMER4_WIDTH()       bfin_read32(TIMER4_WIDTH)
-#define bfin_write_TIMER4_WIDTH(val)   bfin_write32(TIMER4_WIDTH, val)
-#define bfin_read_TIMER5_CONFIG()      bfin_read16(TIMER5_CONFIG)
-#define bfin_write_TIMER5_CONFIG(val)  bfin_write16(TIMER5_CONFIG, val)
-#define bfin_read_TIMER5_COUNTER()     bfin_read32(TIMER5_COUNTER)
-#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER, val)
-#define bfin_read_TIMER5_PERIOD()      bfin_read32(TIMER5_PERIOD)
-#define bfin_write_TIMER5_PERIOD(val)  bfin_write32(TIMER5_PERIOD, val)
-#define bfin_read_TIMER5_WIDTH()       bfin_read32(TIMER5_WIDTH)
-#define bfin_write_TIMER5_WIDTH(val)   bfin_write32(TIMER5_WIDTH, val)
-#define bfin_read_TIMER6_CONFIG()      bfin_read16(TIMER6_CONFIG)
-#define bfin_write_TIMER6_CONFIG(val)  bfin_write16(TIMER6_CONFIG, val)
-#define bfin_read_TIMER6_COUNTER()     bfin_read32(TIMER6_COUNTER)
-#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER, val)
-#define bfin_read_TIMER6_PERIOD()      bfin_read32(TIMER6_PERIOD)
-#define bfin_write_TIMER6_PERIOD(val)  bfin_write32(TIMER6_PERIOD, val)
-#define bfin_read_TIMER6_WIDTH()       bfin_read32(TIMER6_WIDTH)
-#define bfin_write_TIMER6_WIDTH(val)   bfin_write32(TIMER6_WIDTH, val)
-#define bfin_read_TIMER7_CONFIG()      bfin_read16(TIMER7_CONFIG)
-#define bfin_write_TIMER7_CONFIG(val)  bfin_write16(TIMER7_CONFIG, val)
-#define bfin_read_TIMER7_COUNTER()     bfin_read32(TIMER7_COUNTER)
-#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER, val)
-#define bfin_read_TIMER7_PERIOD()      bfin_read32(TIMER7_PERIOD)
-#define bfin_write_TIMER7_PERIOD(val)  bfin_write32(TIMER7_PERIOD, val)
-#define bfin_read_TIMER7_WIDTH()       bfin_read32(TIMER7_WIDTH)
-#define bfin_write_TIMER7_WIDTH(val)   bfin_write32(TIMER7_WIDTH, val)
-#define bfin_read_TIMER_ENABLE()       bfin_read16(TIMER_ENABLE)
-#define bfin_write_TIMER_ENABLE(val)   bfin_write16(TIMER_ENABLE, val)
-#define bfin_read_TIMER_DISABLE()      bfin_read16(TIMER_DISABLE)
-#define bfin_write_TIMER_DISABLE(val)  bfin_write16(TIMER_DISABLE, val)
-#define bfin_read_TIMER_STATUS()       bfin_read32(TIMER_STATUS)
-#define bfin_write_TIMER_STATUS(val)   bfin_write32(TIMER_STATUS, val)
-#define bfin_read_PORTFIO()            bfin_read16(PORTFIO)
-#define bfin_write_PORTFIO(val)        bfin_write16(PORTFIO, val)
-#define bfin_read_PORTFIO_CLEAR()      bfin_read16(PORTFIO_CLEAR)
-#define bfin_write_PORTFIO_CLEAR(val)  bfin_write16(PORTFIO_CLEAR, val)
-#define bfin_read_PORTFIO_SET()        bfin_read16(PORTFIO_SET)
-#define bfin_write_PORTFIO_SET(val)    bfin_write16(PORTFIO_SET, val)
-#define bfin_read_PORTFIO_TOGGLE()     bfin_read16(PORTFIO_TOGGLE)
-#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE, val)
-#define bfin_read_PORTFIO_MASKA()      bfin_read16(PORTFIO_MASKA)
-#define bfin_write_PORTFIO_MASKA(val)  bfin_write16(PORTFIO_MASKA, val)
-#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
-#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR, val)
-#define bfin_read_PORTFIO_MASKA_SET()  bfin_read16(PORTFIO_MASKA_SET)
-#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET, val)
-#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
-#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE, val)
-#define bfin_read_PORTFIO_MASKB()      bfin_read16(PORTFIO_MASKB)
-#define bfin_write_PORTFIO_MASKB(val)  bfin_write16(PORTFIO_MASKB, val)
-#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
-#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR, val)
-#define bfin_read_PORTFIO_MASKB_SET()  bfin_read16(PORTFIO_MASKB_SET)
-#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET, val)
-#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
-#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE, val)
-#define bfin_read_PORTFIO_DIR()        bfin_read16(PORTFIO_DIR)
-#define bfin_write_PORTFIO_DIR(val)    bfin_write16(PORTFIO_DIR, val)
-#define bfin_read_PORTFIO_POLAR()      bfin_read16(PORTFIO_POLAR)
-#define bfin_write_PORTFIO_POLAR(val)  bfin_write16(PORTFIO_POLAR, val)
-#define bfin_read_PORTFIO_EDGE()       bfin_read16(PORTFIO_EDGE)
-#define bfin_write_PORTFIO_EDGE(val)   bfin_write16(PORTFIO_EDGE, val)
-#define bfin_read_PORTFIO_BOTH()       bfin_read16(PORTFIO_BOTH)
-#define bfin_write_PORTFIO_BOTH(val)   bfin_write16(PORTFIO_BOTH, val)
-#define bfin_read_PORTFIO_INEN()       bfin_read16(PORTFIO_INEN)
-#define bfin_write_PORTFIO_INEN(val)   bfin_write16(PORTFIO_INEN, val)
-#define bfin_read_SPORT0_TCR1()        bfin_read16(SPORT0_TCR1)
-#define bfin_write_SPORT0_TCR1(val)    bfin_write16(SPORT0_TCR1, val)
-#define bfin_read_SPORT0_TCR2()        bfin_read16(SPORT0_TCR2)
-#define bfin_write_SPORT0_TCR2(val)    bfin_write16(SPORT0_TCR2, val)
-#define bfin_read_SPORT0_TCLKDIV()     bfin_read16(SPORT0_TCLKDIV)
-#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
-#define bfin_read_SPORT0_TFSDIV()      bfin_read16(SPORT0_TFSDIV)
-#define bfin_write_SPORT0_TFSDIV(val)  bfin_write16(SPORT0_TFSDIV, val)
-#define bfin_write_SPORT0_TX(val)      bfin_write32(SPORT0_TX, val)
-#define bfin_read_SPORT0_RX()          bfin_read32(SPORT0_RX)
-#define bfin_write_SPORT0_RX(val)      bfin_write32(SPORT0_RX, val)
-#define bfin_read_SPORT0_RCR1()        bfin_read16(SPORT0_RCR1)
-#define bfin_write_SPORT0_RCR1(val)    bfin_write16(SPORT0_RCR1, val)
-#define bfin_read_SPORT0_RCR2()        bfin_read16(SPORT0_RCR2)
-#define bfin_write_SPORT0_RCR2(val)    bfin_write16(SPORT0_RCR2, val)
-#define bfin_read_SPORT0_RCLKDIV()     bfin_read16(SPORT0_RCLKDIV)
-#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
-#define bfin_read_SPORT0_RFSDIV()      bfin_read16(SPORT0_RFSDIV)
-#define bfin_write_SPORT0_RFSDIV(val)  bfin_write16(SPORT0_RFSDIV, val)
-#define bfin_read_SPORT0_STAT()        bfin_read16(SPORT0_STAT)
-#define bfin_write_SPORT0_STAT(val)    bfin_write16(SPORT0_STAT, val)
-#define bfin_read_SPORT0_CHNL()        bfin_read16(SPORT0_CHNL)
-#define bfin_write_SPORT0_CHNL(val)    bfin_write16(SPORT0_CHNL, val)
-#define bfin_read_SPORT0_MCMC1()       bfin_read16(SPORT0_MCMC1)
-#define bfin_write_SPORT0_MCMC1(val)   bfin_write16(SPORT0_MCMC1, val)
-#define bfin_read_SPORT0_MCMC2()       bfin_read16(SPORT0_MCMC2)
-#define bfin_write_SPORT0_MCMC2(val)   bfin_write16(SPORT0_MCMC2, val)
-#define bfin_read_SPORT0_MTCS0()       bfin_read32(SPORT0_MTCS0)
-#define bfin_write_SPORT0_MTCS0(val)   bfin_write32(SPORT0_MTCS0, val)
-#define bfin_read_SPORT0_MTCS1()       bfin_read32(SPORT0_MTCS1)
-#define bfin_write_SPORT0_MTCS1(val)   bfin_write32(SPORT0_MTCS1, val)
-#define bfin_read_SPORT0_MTCS2()       bfin_read32(SPORT0_MTCS2)
-#define bfin_write_SPORT0_MTCS2(val)   bfin_write32(SPORT0_MTCS2, val)
-#define bfin_read_SPORT0_MTCS3()       bfin_read32(SPORT0_MTCS3)
-#define bfin_write_SPORT0_MTCS3(val)   bfin_write32(SPORT0_MTCS3, val)
-#define bfin_read_SPORT0_MRCS0()       bfin_read32(SPORT0_MRCS0)
-#define bfin_write_SPORT0_MRCS0(val)   bfin_write32(SPORT0_MRCS0, val)
-#define bfin_read_SPORT0_MRCS1()       bfin_read32(SPORT0_MRCS1)
-#define bfin_write_SPORT0_MRCS1(val)   bfin_write32(SPORT0_MRCS1, val)
-#define bfin_read_SPORT0_MRCS2()       bfin_read32(SPORT0_MRCS2)
-#define bfin_write_SPORT0_MRCS2(val)   bfin_write32(SPORT0_MRCS2, val)
-#define bfin_read_SPORT0_MRCS3()       bfin_read32(SPORT0_MRCS3)
-#define bfin_write_SPORT0_MRCS3(val)   bfin_write32(SPORT0_MRCS3, val)
-#define bfin_read_SPORT1_TCR1()        bfin_read16(SPORT1_TCR1)
-#define bfin_write_SPORT1_TCR1(val)    bfin_write16(SPORT1_TCR1, val)
-#define bfin_read_SPORT1_TCR2()        bfin_read16(SPORT1_TCR2)
-#define bfin_write_SPORT1_TCR2(val)    bfin_write16(SPORT1_TCR2, val)
-#define bfin_read_SPORT1_TCLKDIV()     bfin_read16(SPORT1_TCLKDIV)
-#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
-#define bfin_read_SPORT1_TFSDIV()      bfin_read16(SPORT1_TFSDIV)
-#define bfin_write_SPORT1_TFSDIV(val)  bfin_write16(SPORT1_TFSDIV, val)
-#define bfin_write_SPORT1_TX(val)      bfin_write32(SPORT1_TX, val)
-#define bfin_read_SPORT1_RX()          bfin_read32(SPORT1_RX)
-#define bfin_write_SPORT1_RX(val)      bfin_write32(SPORT1_RX, val)
-#define bfin_read_SPORT1_RCR1()        bfin_read16(SPORT1_RCR1)
-#define bfin_write_SPORT1_RCR1(val)    bfin_write16(SPORT1_RCR1, val)
-#define bfin_read_SPORT1_RCR2()        bfin_read16(SPORT1_RCR2)
-#define bfin_write_SPORT1_RCR2(val)    bfin_write16(SPORT1_RCR2, val)
-#define bfin_read_SPORT1_RCLKDIV()     bfin_read16(SPORT1_RCLKDIV)
-#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
-#define bfin_read_SPORT1_RFSDIV()      bfin_read16(SPORT1_RFSDIV)
-#define bfin_write_SPORT1_RFSDIV(val)  bfin_write16(SPORT1_RFSDIV, val)
-#define bfin_read_SPORT1_STAT()        bfin_read16(SPORT1_STAT)
-#define bfin_write_SPORT1_STAT(val)    bfin_write16(SPORT1_STAT, val)
-#define bfin_read_SPORT1_CHNL()        bfin_read16(SPORT1_CHNL)
-#define bfin_write_SPORT1_CHNL(val)    bfin_write16(SPORT1_CHNL, val)
-#define bfin_read_SPORT1_MCMC1()       bfin_read16(SPORT1_MCMC1)
-#define bfin_write_SPORT1_MCMC1(val)   bfin_write16(SPORT1_MCMC1, val)
-#define bfin_read_SPORT1_MCMC2()       bfin_read16(SPORT1_MCMC2)
-#define bfin_write_SPORT1_MCMC2(val)   bfin_write16(SPORT1_MCMC2, val)
-#define bfin_read_SPORT1_MTCS0()       bfin_read32(SPORT1_MTCS0)
-#define bfin_write_SPORT1_MTCS0(val)   bfin_write32(SPORT1_MTCS0, val)
-#define bfin_read_SPORT1_MTCS1()       bfin_read32(SPORT1_MTCS1)
-#define bfin_write_SPORT1_MTCS1(val)   bfin_write32(SPORT1_MTCS1, val)
-#define bfin_read_SPORT1_MTCS2()       bfin_read32(SPORT1_MTCS2)
-#define bfin_write_SPORT1_MTCS2(val)   bfin_write32(SPORT1_MTCS2, val)
-#define bfin_read_SPORT1_MTCS3()       bfin_read32(SPORT1_MTCS3)
-#define bfin_write_SPORT1_MTCS3(val)   bfin_write32(SPORT1_MTCS3, val)
-#define bfin_read_SPORT1_MRCS0()       bfin_read32(SPORT1_MRCS0)
-#define bfin_write_SPORT1_MRCS0(val)   bfin_write32(SPORT1_MRCS0, val)
-#define bfin_read_SPORT1_MRCS1()       bfin_read32(SPORT1_MRCS1)
-#define bfin_write_SPORT1_MRCS1(val)   bfin_write32(SPORT1_MRCS1, val)
-#define bfin_read_SPORT1_MRCS2()       bfin_read32(SPORT1_MRCS2)
-#define bfin_write_SPORT1_MRCS2(val)   bfin_write32(SPORT1_MRCS2, val)
-#define bfin_read_SPORT1_MRCS3()       bfin_read32(SPORT1_MRCS3)
-#define bfin_write_SPORT1_MRCS3(val)   bfin_write32(SPORT1_MRCS3, val)
-#define bfin_read_EBIU_AMGCTL()        bfin_read16(EBIU_AMGCTL)
-#define bfin_write_EBIU_AMGCTL(val)    bfin_write16(EBIU_AMGCTL, val)
-#define bfin_read_EBIU_AMBCTL0()       bfin_read32(EBIU_AMBCTL0)
-#define bfin_write_EBIU_AMBCTL0(val)   bfin_write32(EBIU_AMBCTL0, val)
-#define bfin_read_EBIU_AMBCTL1()       bfin_read32(EBIU_AMBCTL1)
-#define bfin_write_EBIU_AMBCTL1(val)   bfin_write32(EBIU_AMBCTL1, val)
-#define bfin_read_EBIU_SDGCTL()        bfin_read32(EBIU_SDGCTL)
-#define bfin_write_EBIU_SDGCTL(val)    bfin_write32(EBIU_SDGCTL, val)
-#define bfin_read_EBIU_SDBCTL()        bfin_read16(EBIU_SDBCTL)
-#define bfin_write_EBIU_SDBCTL(val)    bfin_write16(EBIU_SDBCTL, val)
-#define bfin_read_EBIU_SDRRC()         bfin_read16(EBIU_SDRRC)
-#define bfin_write_EBIU_SDRRC(val)     bfin_write16(EBIU_SDRRC, val)
-#define bfin_read_EBIU_SDSTAT()        bfin_read16(EBIU_SDSTAT)
-#define bfin_write_EBIU_SDSTAT(val)    bfin_write16(EBIU_SDSTAT, val)
-#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_readPTR(DMA0_NEXT_DESC_PTR)
-#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_writePTR(DMA0_NEXT_DESC_PTR, val)
-#define bfin_read_DMA0_START_ADDR()    bfin_readPTR(DMA0_START_ADDR)
-#define bfin_write_DMA0_START_ADDR(val) bfin_writePTR(DMA0_START_ADDR, val)
-#define bfin_read_DMA0_CONFIG()        bfin_read16(DMA0_CONFIG)
-#define bfin_write_DMA0_CONFIG(val)    bfin_write16(DMA0_CONFIG, val)
-#define bfin_read_DMA0_X_COUNT()       bfin_read16(DMA0_X_COUNT)
-#define bfin_write_DMA0_X_COUNT(val)   bfin_write16(DMA0_X_COUNT, val)
-#define bfin_read_DMA0_X_MODIFY()      bfin_read16(DMA0_X_MODIFY)
-#define bfin_write_DMA0_X_MODIFY(val)  bfin_write16(DMA0_X_MODIFY, val)
-#define bfin_read_DMA0_Y_COUNT()       bfin_read16(DMA0_Y_COUNT)
-#define bfin_write_DMA0_Y_COUNT(val)   bfin_write16(DMA0_Y_COUNT, val)
-#define bfin_read_DMA0_Y_MODIFY()      bfin_read16(DMA0_Y_MODIFY)
-#define bfin_write_DMA0_Y_MODIFY(val)  bfin_write16(DMA0_Y_MODIFY, val)
-#define bfin_read_DMA0_CURR_DESC_PTR() bfin_readPTR(DMA0_CURR_DESC_PTR)
-#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_writePTR(DMA0_CURR_DESC_PTR, val)
-#define bfin_read_DMA0_CURR_ADDR()     bfin_readPTR(DMA0_CURR_ADDR)
-#define bfin_write_DMA0_CURR_ADDR(val) bfin_writePTR(DMA0_CURR_ADDR, val)
-#define bfin_read_DMA0_IRQ_STATUS()    bfin_read16(DMA0_IRQ_STATUS)
-#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
-#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
-#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
-#define bfin_read_DMA0_CURR_X_COUNT()  bfin_read16(DMA0_CURR_X_COUNT)
-#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
-#define bfin_read_DMA0_CURR_Y_COUNT()  bfin_read16(DMA0_CURR_Y_COUNT)
-#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
-#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_readPTR(DMA1_NEXT_DESC_PTR)
-#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_writePTR(DMA1_NEXT_DESC_PTR, val)
-#define bfin_read_DMA1_START_ADDR()    bfin_readPTR(DMA1_START_ADDR)
-#define bfin_write_DMA1_START_ADDR(val) bfin_writePTR(DMA1_START_ADDR, val)
-#define bfin_read_DMA1_CONFIG()        bfin_read16(DMA1_CONFIG)
-#define bfin_write_DMA1_CONFIG(val)    bfin_write16(DMA1_CONFIG, val)
-#define bfin_read_DMA1_X_COUNT()       bfin_read16(DMA1_X_COUNT)
-#define bfin_write_DMA1_X_COUNT(val)   bfin_write16(DMA1_X_COUNT, val)
-#define bfin_read_DMA1_X_MODIFY()      bfin_read16(DMA1_X_MODIFY)
-#define bfin_write_DMA1_X_MODIFY(val)  bfin_write16(DMA1_X_MODIFY, val)
-#define bfin_read_DMA1_Y_COUNT()       bfin_read16(DMA1_Y_COUNT)
-#define bfin_write_DMA1_Y_COUNT(val)   bfin_write16(DMA1_Y_COUNT, val)
-#define bfin_read_DMA1_Y_MODIFY()      bfin_read16(DMA1_Y_MODIFY)
-#define bfin_write_DMA1_Y_MODIFY(val)  bfin_write16(DMA1_Y_MODIFY, val)
-#define bfin_read_DMA1_CURR_DESC_PTR() bfin_readPTR(DMA1_CURR_DESC_PTR)
-#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_writePTR(DMA1_CURR_DESC_PTR, val)
-#define bfin_read_DMA1_CURR_ADDR()     bfin_readPTR(DMA1_CURR_ADDR)
-#define bfin_write_DMA1_CURR_ADDR(val) bfin_writePTR(DMA1_CURR_ADDR, val)
-#define bfin_read_DMA1_IRQ_STATUS()    bfin_read16(DMA1_IRQ_STATUS)
-#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
-#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
-#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
-#define bfin_read_DMA1_CURR_X_COUNT()  bfin_read16(DMA1_CURR_X_COUNT)
-#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
-#define bfin_read_DMA1_CURR_Y_COUNT()  bfin_read16(DMA1_CURR_Y_COUNT)
-#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
-#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_readPTR(DMA2_NEXT_DESC_PTR)
-#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_writePTR(DMA2_NEXT_DESC_PTR, val)
-#define bfin_read_DMA2_START_ADDR()    bfin_readPTR(DMA2_START_ADDR)
-#define bfin_write_DMA2_START_ADDR(val) bfin_writePTR(DMA2_START_ADDR, val)
-#define bfin_read_DMA2_CONFIG()        bfin_read16(DMA2_CONFIG)
-#define bfin_write_DMA2_CONFIG(val)    bfin_write16(DMA2_CONFIG, val)
-#define bfin_read_DMA2_X_COUNT()       bfin_read16(DMA2_X_COUNT)
-#define bfin_write_DMA2_X_COUNT(val)   bfin_write16(DMA2_X_COUNT, val)
-#define bfin_read_DMA2_X_MODIFY()      bfin_read16(DMA2_X_MODIFY)
-#define bfin_write_DMA2_X_MODIFY(val)  bfin_write16(DMA2_X_MODIFY, val)
-#define bfin_read_DMA2_Y_COUNT()       bfin_read16(DMA2_Y_COUNT)
-#define bfin_write_DMA2_Y_COUNT(val)   bfin_write16(DMA2_Y_COUNT, val)
-#define bfin_read_DMA2_Y_MODIFY()      bfin_read16(DMA2_Y_MODIFY)
-#define bfin_write_DMA2_Y_MODIFY(val)  bfin_write16(DMA2_Y_MODIFY, val)
-#define bfin_read_DMA2_CURR_DESC_PTR() bfin_readPTR(DMA2_CURR_DESC_PTR)
-#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_writePTR(DMA2_CURR_DESC_PTR, val)
-#define bfin_read_DMA2_CURR_ADDR()     bfin_readPTR(DMA2_CURR_ADDR)
-#define bfin_write_DMA2_CURR_ADDR(val) bfin_writePTR(DMA2_CURR_ADDR, val)
-#define bfin_read_DMA2_IRQ_STATUS()    bfin_read16(DMA2_IRQ_STATUS)
-#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
-#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
-#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
-#define bfin_read_DMA2_CURR_X_COUNT()  bfin_read16(DMA2_CURR_X_COUNT)
-#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
-#define bfin_read_DMA2_CURR_Y_COUNT()  bfin_read16(DMA2_CURR_Y_COUNT)
-#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
-#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_readPTR(DMA3_NEXT_DESC_PTR)
-#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_writePTR(DMA3_NEXT_DESC_PTR, val)
-#define bfin_read_DMA3_START_ADDR()    bfin_readPTR(DMA3_START_ADDR)
-#define bfin_write_DMA3_START_ADDR(val) bfin_writePTR(DMA3_START_ADDR, val)
-#define bfin_read_DMA3_CONFIG()        bfin_read16(DMA3_CONFIG)
-#define bfin_write_DMA3_CONFIG(val)    bfin_write16(DMA3_CONFIG, val)
-#define bfin_read_DMA3_X_COUNT()       bfin_read16(DMA3_X_COUNT)
-#define bfin_write_DMA3_X_COUNT(val)   bfin_write16(DMA3_X_COUNT, val)
-#define bfin_read_DMA3_X_MODIFY()      bfin_read16(DMA3_X_MODIFY)
-#define bfin_write_DMA3_X_MODIFY(val)  bfin_write16(DMA3_X_MODIFY, val)
-#define bfin_read_DMA3_Y_COUNT()       bfin_read16(DMA3_Y_COUNT)
-#define bfin_write_DMA3_Y_COUNT(val)   bfin_write16(DMA3_Y_COUNT, val)
-#define bfin_read_DMA3_Y_MODIFY()      bfin_read16(DMA3_Y_MODIFY)
-#define bfin_write_DMA3_Y_MODIFY(val)  bfin_write16(DMA3_Y_MODIFY, val)
-#define bfin_read_DMA3_CURR_DESC_PTR() bfin_readPTR(DMA3_CURR_DESC_PTR)
-#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_writePTR(DMA3_CURR_DESC_PTR, val)
-#define bfin_read_DMA3_CURR_ADDR()     bfin_readPTR(DMA3_CURR_ADDR)
-#define bfin_write_DMA3_CURR_ADDR(val) bfin_writePTR(DMA3_CURR_ADDR, val)
-#define bfin_read_DMA3_IRQ_STATUS()    bfin_read16(DMA3_IRQ_STATUS)
-#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
-#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
-#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
-#define bfin_read_DMA3_CURR_X_COUNT()  bfin_read16(DMA3_CURR_X_COUNT)
-#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
-#define bfin_read_DMA3_CURR_Y_COUNT()  bfin_read16(DMA3_CURR_Y_COUNT)
-#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
-#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_readPTR(DMA4_NEXT_DESC_PTR)
-#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_writePTR(DMA4_NEXT_DESC_PTR, val)
-#define bfin_read_DMA4_START_ADDR()    bfin_readPTR(DMA4_START_ADDR)
-#define bfin_write_DMA4_START_ADDR(val) bfin_writePTR(DMA4_START_ADDR, val)
-#define bfin_read_DMA4_CONFIG()        bfin_read16(DMA4_CONFIG)
-#define bfin_write_DMA4_CONFIG(val)    bfin_write16(DMA4_CONFIG, val)
-#define bfin_read_DMA4_X_COUNT()       bfin_read16(DMA4_X_COUNT)
-#define bfin_write_DMA4_X_COUNT(val)   bfin_write16(DMA4_X_COUNT, val)
-#define bfin_read_DMA4_X_MODIFY()      bfin_read16(DMA4_X_MODIFY)
-#define bfin_write_DMA4_X_MODIFY(val)  bfin_write16(DMA4_X_MODIFY, val)
-#define bfin_read_DMA4_Y_COUNT()       bfin_read16(DMA4_Y_COUNT)
-#define bfin_write_DMA4_Y_COUNT(val)   bfin_write16(DMA4_Y_COUNT, val)
-#define bfin_read_DMA4_Y_MODIFY()      bfin_read16(DMA4_Y_MODIFY)
-#define bfin_write_DMA4_Y_MODIFY(val)  bfin_write16(DMA4_Y_MODIFY, val)
-#define bfin_read_DMA4_CURR_DESC_PTR() bfin_readPTR(DMA4_CURR_DESC_PTR)
-#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_writePTR(DMA4_CURR_DESC_PTR, val)
-#define bfin_read_DMA4_CURR_ADDR()     bfin_readPTR(DMA4_CURR_ADDR)
-#define bfin_write_DMA4_CURR_ADDR(val) bfin_writePTR(DMA4_CURR_ADDR, val)
-#define bfin_read_DMA4_IRQ_STATUS()    bfin_read16(DMA4_IRQ_STATUS)
-#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
-#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
-#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
-#define bfin_read_DMA4_CURR_X_COUNT()  bfin_read16(DMA4_CURR_X_COUNT)
-#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
-#define bfin_read_DMA4_CURR_Y_COUNT()  bfin_read16(DMA4_CURR_Y_COUNT)
-#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
-#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_readPTR(DMA5_NEXT_DESC_PTR)
-#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_writePTR(DMA5_NEXT_DESC_PTR, val)
-#define bfin_read_DMA5_START_ADDR()    bfin_readPTR(DMA5_START_ADDR)
-#define bfin_write_DMA5_START_ADDR(val) bfin_writePTR(DMA5_START_ADDR, val)
-#define bfin_read_DMA5_CONFIG()        bfin_read16(DMA5_CONFIG)
-#define bfin_write_DMA5_CONFIG(val)    bfin_write16(DMA5_CONFIG, val)
-#define bfin_read_DMA5_X_COUNT()       bfin_read16(DMA5_X_COUNT)
-#define bfin_write_DMA5_X_COUNT(val)   bfin_write16(DMA5_X_COUNT, val)
-#define bfin_read_DMA5_X_MODIFY()      bfin_read16(DMA5_X_MODIFY)
-#define bfin_write_DMA5_X_MODIFY(val)  bfin_write16(DMA5_X_MODIFY, val)
-#define bfin_read_DMA5_Y_COUNT()       bfin_read16(DMA5_Y_COUNT)
-#define bfin_write_DMA5_Y_COUNT(val)   bfin_write16(DMA5_Y_COUNT, val)
-#define bfin_read_DMA5_Y_MODIFY()      bfin_read16(DMA5_Y_MODIFY)
-#define bfin_write_DMA5_Y_MODIFY(val)  bfin_write16(DMA5_Y_MODIFY, val)
-#define bfin_read_DMA5_CURR_DESC_PTR() bfin_readPTR(DMA5_CURR_DESC_PTR)
-#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_writePTR(DMA5_CURR_DESC_PTR, val)
-#define bfin_read_DMA5_CURR_ADDR()     bfin_readPTR(DMA5_CURR_ADDR)
-#define bfin_write_DMA5_CURR_ADDR(val) bfin_writePTR(DMA5_CURR_ADDR, val)
-#define bfin_read_DMA5_IRQ_STATUS()    bfin_read16(DMA5_IRQ_STATUS)
-#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
-#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
-#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
-#define bfin_read_DMA5_CURR_X_COUNT()  bfin_read16(DMA5_CURR_X_COUNT)
-#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
-#define bfin_read_DMA5_CURR_Y_COUNT()  bfin_read16(DMA5_CURR_Y_COUNT)
-#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
-#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
-#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR, val)
-#define bfin_read_DMA6_START_ADDR()    bfin_readPTR(DMA6_START_ADDR)
-#define bfin_write_DMA6_START_ADDR(val) bfin_writePTR(DMA6_START_ADDR, val)
-#define bfin_read_DMA6_CONFIG()        bfin_read16(DMA6_CONFIG)
-#define bfin_write_DMA6_CONFIG(val)    bfin_write16(DMA6_CONFIG, val)
-#define bfin_read_DMA6_X_COUNT()       bfin_read16(DMA6_X_COUNT)
-#define bfin_write_DMA6_X_COUNT(val)   bfin_write16(DMA6_X_COUNT, val)
-#define bfin_read_DMA6_X_MODIFY()      bfin_read16(DMA6_X_MODIFY)
-#define bfin_write_DMA6_X_MODIFY(val)  bfin_write16(DMA6_X_MODIFY, val)
-#define bfin_read_DMA6_Y_COUNT()       bfin_read16(DMA6_Y_COUNT)
-#define bfin_write_DMA6_Y_COUNT(val)   bfin_write16(DMA6_Y_COUNT, val)
-#define bfin_read_DMA6_Y_MODIFY()      bfin_read16(DMA6_Y_MODIFY)
-#define bfin_write_DMA6_Y_MODIFY(val)  bfin_write16(DMA6_Y_MODIFY, val)
-#define bfin_read_DMA6_CURR_DESC_PTR() bfin_readPTR(DMA6_CURR_DESC_PTR)
-#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_writePTR(DMA6_CURR_DESC_PTR, val)
-#define bfin_read_DMA6_CURR_ADDR()     bfin_readPTR(DMA6_CURR_ADDR)
-#define bfin_write_DMA6_CURR_ADDR(val) bfin_writePTR(DMA6_CURR_ADDR, val)
-#define bfin_read_DMA6_IRQ_STATUS()    bfin_read16(DMA6_IRQ_STATUS)
-#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
-#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
-#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
-#define bfin_read_DMA6_CURR_X_COUNT()  bfin_read16(DMA6_CURR_X_COUNT)
-#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
-#define bfin_read_DMA6_CURR_Y_COUNT()  bfin_read16(DMA6_CURR_Y_COUNT)
-#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
-#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_readPTR(DMA7_NEXT_DESC_PTR)
-#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_writePTR(DMA7_NEXT_DESC_PTR, val)
-#define bfin_read_DMA7_START_ADDR()    bfin_readPTR(DMA7_START_ADDR)
-#define bfin_write_DMA7_START_ADDR(val) bfin_writePTR(DMA7_START_ADDR, val)
-#define bfin_read_DMA7_CONFIG()        bfin_read16(DMA7_CONFIG)
-#define bfin_write_DMA7_CONFIG(val)    bfin_write16(DMA7_CONFIG, val)
-#define bfin_read_DMA7_X_COUNT()       bfin_read16(DMA7_X_COUNT)
-#define bfin_write_DMA7_X_COUNT(val)   bfin_write16(DMA7_X_COUNT, val)
-#define bfin_read_DMA7_X_MODIFY()      bfin_read16(DMA7_X_MODIFY)
-#define bfin_write_DMA7_X_MODIFY(val)  bfin_write16(DMA7_X_MODIFY, val)
-#define bfin_read_DMA7_Y_COUNT()       bfin_read16(DMA7_Y_COUNT)
-#define bfin_write_DMA7_Y_COUNT(val)   bfin_write16(DMA7_Y_COUNT, val)
-#define bfin_read_DMA7_Y_MODIFY()      bfin_read16(DMA7_Y_MODIFY)
-#define bfin_write_DMA7_Y_MODIFY(val)  bfin_write16(DMA7_Y_MODIFY, val)
-#define bfin_read_DMA7_CURR_DESC_PTR() bfin_readPTR(DMA7_CURR_DESC_PTR)
-#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_writePTR(DMA7_CURR_DESC_PTR, val)
-#define bfin_read_DMA7_CURR_ADDR()     bfin_readPTR(DMA7_CURR_ADDR)
-#define bfin_write_DMA7_CURR_ADDR(val) bfin_writePTR(DMA7_CURR_ADDR, val)
-#define bfin_read_DMA7_IRQ_STATUS()    bfin_read16(DMA7_IRQ_STATUS)
-#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
-#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
-#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
-#define bfin_read_DMA7_CURR_X_COUNT()  bfin_read16(DMA7_CURR_X_COUNT)
-#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
-#define bfin_read_DMA7_CURR_Y_COUNT()  bfin_read16(DMA7_CURR_Y_COUNT)
-#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
-#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_readPTR(DMA8_NEXT_DESC_PTR)
-#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_writePTR(DMA8_NEXT_DESC_PTR, val)
-#define bfin_read_DMA8_START_ADDR()    bfin_readPTR(DMA8_START_ADDR)
-#define bfin_write_DMA8_START_ADDR(val) bfin_writePTR(DMA8_START_ADDR, val)
-#define bfin_read_DMA8_CONFIG()        bfin_read16(DMA8_CONFIG)
-#define bfin_write_DMA8_CONFIG(val)    bfin_write16(DMA8_CONFIG, val)
-#define bfin_read_DMA8_X_COUNT()       bfin_read16(DMA8_X_COUNT)
-#define bfin_write_DMA8_X_COUNT(val)   bfin_write16(DMA8_X_COUNT, val)
-#define bfin_read_DMA8_X_MODIFY()      bfin_read16(DMA8_X_MODIFY)
-#define bfin_write_DMA8_X_MODIFY(val)  bfin_write16(DMA8_X_MODIFY, val)
-#define bfin_read_DMA8_Y_COUNT()       bfin_read16(DMA8_Y_COUNT)
-#define bfin_write_DMA8_Y_COUNT(val)   bfin_write16(DMA8_Y_COUNT, val)
-#define bfin_read_DMA8_Y_MODIFY()      bfin_read16(DMA8_Y_MODIFY)
-#define bfin_write_DMA8_Y_MODIFY(val)  bfin_write16(DMA8_Y_MODIFY, val)
-#define bfin_read_DMA8_CURR_DESC_PTR() bfin_readPTR(DMA8_CURR_DESC_PTR)
-#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_writePTR(DMA8_CURR_DESC_PTR, val)
-#define bfin_read_DMA8_CURR_ADDR()     bfin_readPTR(DMA8_CURR_ADDR)
-#define bfin_write_DMA8_CURR_ADDR(val) bfin_writePTR(DMA8_CURR_ADDR, val)
-#define bfin_read_DMA8_IRQ_STATUS()    bfin_read16(DMA8_IRQ_STATUS)
-#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
-#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
-#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
-#define bfin_read_DMA8_CURR_X_COUNT()  bfin_read16(DMA8_CURR_X_COUNT)
-#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
-#define bfin_read_DMA8_CURR_Y_COUNT()  bfin_read16(DMA8_CURR_Y_COUNT)
-#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
-#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_readPTR(DMA9_NEXT_DESC_PTR)
-#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_writePTR(DMA9_NEXT_DESC_PTR, val)
-#define bfin_read_DMA9_START_ADDR()    bfin_readPTR(DMA9_START_ADDR)
-#define bfin_write_DMA9_START_ADDR(val) bfin_writePTR(DMA9_START_ADDR, val)
-#define bfin_read_DMA9_CONFIG()        bfin_read16(DMA9_CONFIG)
-#define bfin_write_DMA9_CONFIG(val)    bfin_write16(DMA9_CONFIG, val)
-#define bfin_read_DMA9_X_COUNT()       bfin_read16(DMA9_X_COUNT)
-#define bfin_write_DMA9_X_COUNT(val)   bfin_write16(DMA9_X_COUNT, val)
-#define bfin_read_DMA9_X_MODIFY()      bfin_read16(DMA9_X_MODIFY)
-#define bfin_write_DMA9_X_MODIFY(val)  bfin_write16(DMA9_X_MODIFY, val)
-#define bfin_read_DMA9_Y_COUNT()       bfin_read16(DMA9_Y_COUNT)
-#define bfin_write_DMA9_Y_COUNT(val)   bfin_write16(DMA9_Y_COUNT, val)
-#define bfin_read_DMA9_Y_MODIFY()      bfin_read16(DMA9_Y_MODIFY)
-#define bfin_write_DMA9_Y_MODIFY(val)  bfin_write16(DMA9_Y_MODIFY, val)
-#define bfin_read_DMA9_CURR_DESC_PTR() bfin_readPTR(DMA9_CURR_DESC_PTR)
-#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_writePTR(DMA9_CURR_DESC_PTR, val)
-#define bfin_read_DMA9_CURR_ADDR()     bfin_readPTR(DMA9_CURR_ADDR)
-#define bfin_write_DMA9_CURR_ADDR(val) bfin_writePTR(DMA9_CURR_ADDR, val)
-#define bfin_read_DMA9_IRQ_STATUS()    bfin_read16(DMA9_IRQ_STATUS)
-#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
-#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
-#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
-#define bfin_read_DMA9_CURR_X_COUNT()  bfin_read16(DMA9_CURR_X_COUNT)
-#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
-#define bfin_read_DMA9_CURR_Y_COUNT()  bfin_read16(DMA9_CURR_Y_COUNT)
-#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
-#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_readPTR(DMA10_NEXT_DESC_PTR)
-#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_writePTR(DMA10_NEXT_DESC_PTR, val)
-#define bfin_read_DMA10_START_ADDR()   bfin_readPTR(DMA10_START_ADDR)
-#define bfin_write_DMA10_START_ADDR(val) bfin_writePTR(DMA10_START_ADDR, val)
-#define bfin_read_DMA10_CONFIG()       bfin_read16(DMA10_CONFIG)
-#define bfin_write_DMA10_CONFIG(val)   bfin_write16(DMA10_CONFIG, val)
-#define bfin_read_DMA10_X_COUNT()      bfin_read16(DMA10_X_COUNT)
-#define bfin_write_DMA10_X_COUNT(val)  bfin_write16(DMA10_X_COUNT, val)
-#define bfin_read_DMA10_X_MODIFY()     bfin_read16(DMA10_X_MODIFY)
-#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY, val)
-#define bfin_read_DMA10_Y_COUNT()      bfin_read16(DMA10_Y_COUNT)
-#define bfin_write_DMA10_Y_COUNT(val)  bfin_write16(DMA10_Y_COUNT, val)
-#define bfin_read_DMA10_Y_MODIFY()     bfin_read16(DMA10_Y_MODIFY)
-#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY, val)
-#define bfin_read_DMA10_CURR_DESC_PTR() bfin_readPTR(DMA10_CURR_DESC_PTR)
-#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_writePTR(DMA10_CURR_DESC_PTR, val)
-#define bfin_read_DMA10_CURR_ADDR()    bfin_readPTR(DMA10_CURR_ADDR)
-#define bfin_write_DMA10_CURR_ADDR(val) bfin_writePTR(DMA10_CURR_ADDR, val)
-#define bfin_read_DMA10_IRQ_STATUS()   bfin_read16(DMA10_IRQ_STATUS)
-#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
-#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
-#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
-#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
-#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
-#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
-#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
-#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_readPTR(DMA11_NEXT_DESC_PTR)
-#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_writePTR(DMA11_NEXT_DESC_PTR, val)
-#define bfin_read_DMA11_START_ADDR()   bfin_readPTR(DMA11_START_ADDR)
-#define bfin_write_DMA11_START_ADDR(val) bfin_writePTR(DMA11_START_ADDR, val)
-#define bfin_read_DMA11_CONFIG()       bfin_read16(DMA11_CONFIG)
-#define bfin_write_DMA11_CONFIG(val)   bfin_write16(DMA11_CONFIG, val)
-#define bfin_read_DMA11_X_COUNT()      bfin_read16(DMA11_X_COUNT)
-#define bfin_write_DMA11_X_COUNT(val)  bfin_write16(DMA11_X_COUNT, val)
-#define bfin_read_DMA11_X_MODIFY()     bfin_read16(DMA11_X_MODIFY)
-#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY, val)
-#define bfin_read_DMA11_Y_COUNT()      bfin_read16(DMA11_Y_COUNT)
-#define bfin_write_DMA11_Y_COUNT(val)  bfin_write16(DMA11_Y_COUNT, val)
-#define bfin_read_DMA11_Y_MODIFY()     bfin_read16(DMA11_Y_MODIFY)
-#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY, val)
-#define bfin_read_DMA11_CURR_DESC_PTR() bfin_readPTR(DMA11_CURR_DESC_PTR)
-#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_writePTR(DMA11_CURR_DESC_PTR, val)
-#define bfin_read_DMA11_CURR_ADDR()    bfin_readPTR(DMA11_CURR_ADDR)
-#define bfin_write_DMA11_CURR_ADDR(val) bfin_writePTR(DMA11_CURR_ADDR, val)
-#define bfin_read_DMA11_IRQ_STATUS()   bfin_read16(DMA11_IRQ_STATUS)
-#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
-#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
-#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
-#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
-#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
-#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
-#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
-#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_readPTR(MDMA_S0_NEXT_DESC_PTR)
-#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_S0_NEXT_DESC_PTR, val)
-#define bfin_read_MDMA_S0_START_ADDR() bfin_readPTR(MDMA_S0_START_ADDR)
-#define bfin_write_MDMA_S0_START_ADDR(val) bfin_writePTR(MDMA_S0_START_ADDR, val)
-#define bfin_read_MDMA_S0_CONFIG()     bfin_read16(MDMA_S0_CONFIG)
-#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
-#define bfin_read_MDMA_S0_X_COUNT()    bfin_read16(MDMA_S0_X_COUNT)
-#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
-#define bfin_read_MDMA_S0_X_MODIFY()   bfin_read16(MDMA_S0_X_MODIFY)
-#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY, val)
-#define bfin_read_MDMA_S0_Y_COUNT()    bfin_read16(MDMA_S0_Y_COUNT)
-#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
-#define bfin_read_MDMA_S0_Y_MODIFY()   bfin_read16(MDMA_S0_Y_MODIFY)
-#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY, val)
-#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_readPTR(MDMA_S0_CURR_DESC_PTR)
-#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_writePTR(MDMA_S0_CURR_DESC_PTR, val)
-#define bfin_read_MDMA_S0_CURR_ADDR()  bfin_readPTR(MDMA_S0_CURR_ADDR)
-#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_writePTR(MDMA_S0_CURR_ADDR, val)
-#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
-#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val)
-#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
-#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP, val)
-#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
-#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT, val)
-#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
-#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT, val)
-#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_readPTR(MDMA_D0_NEXT_DESC_PTR)
-#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_D0_NEXT_DESC_PTR, val)
-#define bfin_read_MDMA_D0_START_ADDR() bfin_readPTR(MDMA_D0_START_ADDR)
-#define bfin_write_MDMA_D0_START_ADDR(val) bfin_writePTR(MDMA_D0_START_ADDR, val)
-#define bfin_read_MDMA_D0_CONFIG()     bfin_read16(MDMA_D0_CONFIG)
-#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
-#define bfin_read_MDMA_D0_X_COUNT()    bfin_read16(MDMA_D0_X_COUNT)
-#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
-#define bfin_read_MDMA_D0_X_MODIFY()   bfin_read16(MDMA_D0_X_MODIFY)
-#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY, val)
-#define bfin_read_MDMA_D0_Y_COUNT()    bfin_read16(MDMA_D0_Y_COUNT)
-#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
-#define bfin_read_MDMA_D0_Y_MODIFY()   bfin_read16(MDMA_D0_Y_MODIFY)
-#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY, val)
-#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_readPTR(MDMA_D0_CURR_DESC_PTR)
-#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_writePTR(MDMA_D0_CURR_DESC_PTR, val)
-#define bfin_read_MDMA_D0_CURR_ADDR()  bfin_readPTR(MDMA_D0_CURR_ADDR)
-#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_writePTR(MDMA_D0_CURR_ADDR, val)
-#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
-#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
-#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
-#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP, val)
-#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
-#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT, val)
-#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
-#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
-#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_readPTR(MDMA_S1_NEXT_DESC_PTR)
-#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_S1_NEXT_DESC_PTR, val)
-#define bfin_read_MDMA_S1_START_ADDR() bfin_readPTR(MDMA_S1_START_ADDR)
-#define bfin_write_MDMA_S1_START_ADDR(val) bfin_writePTR(MDMA_S1_START_ADDR, val)
-#define bfin_read_MDMA_S1_CONFIG()     bfin_read16(MDMA_S1_CONFIG)
-#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
-#define bfin_read_MDMA_S1_X_COUNT()    bfin_read16(MDMA_S1_X_COUNT)
-#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT, val)
-#define bfin_read_MDMA_S1_X_MODIFY()   bfin_read16(MDMA_S1_X_MODIFY)
-#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY, val)
-#define bfin_read_MDMA_S1_Y_COUNT()    bfin_read16(MDMA_S1_Y_COUNT)
-#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT, val)
-#define bfin_read_MDMA_S1_Y_MODIFY()   bfin_read16(MDMA_S1_Y_MODIFY)
-#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY, val)
-#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_readPTR(MDMA_S1_CURR_DESC_PTR)
-#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_writePTR(MDMA_S1_CURR_DESC_PTR, val)
-#define bfin_read_MDMA_S1_CURR_ADDR()  bfin_readPTR(MDMA_S1_CURR_ADDR)
-#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_writePTR(MDMA_S1_CURR_ADDR, val)
-#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
-#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
-#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
-#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP, val)
-#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
-#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT, val)
-#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
-#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT, val)
-#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_readPTR(MDMA_D1_NEXT_DESC_PTR)
-#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_D1_NEXT_DESC_PTR, val)
-#define bfin_read_MDMA_D1_START_ADDR() bfin_readPTR(MDMA_D1_START_ADDR)
-#define bfin_write_MDMA_D1_START_ADDR(val) bfin_writePTR(MDMA_D1_START_ADDR, val)
-#define bfin_read_MDMA_D1_CONFIG()     bfin_read16(MDMA_D1_CONFIG)
-#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
-#define bfin_read_MDMA_D1_X_COUNT()    bfin_read16(MDMA_D1_X_COUNT)
-#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT, val)
-#define bfin_read_MDMA_D1_X_MODIFY()   bfin_read16(MDMA_D1_X_MODIFY)
-#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY, val)
-#define bfin_read_MDMA_D1_Y_COUNT()    bfin_read16(MDMA_D1_Y_COUNT)
-#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT, val)
-#define bfin_read_MDMA_D1_Y_MODIFY()   bfin_read16(MDMA_D1_Y_MODIFY)
-#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY, val)
-#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_readPTR(MDMA_D1_CURR_DESC_PTR)
-#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_writePTR(MDMA_D1_CURR_DESC_PTR, val)
-#define bfin_read_MDMA_D1_CURR_ADDR()  bfin_readPTR(MDMA_D1_CURR_ADDR)
-#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_writePTR(MDMA_D1_CURR_ADDR, val)
-#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
-#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
-#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
-#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP, val)
-#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
-#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT, val)
-#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
-#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
-#define bfin_read_PPI_CONTROL()        bfin_read16(PPI_CONTROL)
-#define bfin_write_PPI_CONTROL(val)    bfin_write16(PPI_CONTROL, val)
-#define bfin_read_PPI_STATUS()         bfin_read16(PPI_STATUS)
-#define bfin_write_PPI_STATUS(val)     bfin_write16(PPI_STATUS, val)
-#define bfin_read_PPI_COUNT()          bfin_read16(PPI_COUNT)
-#define bfin_write_PPI_COUNT(val)      bfin_write16(PPI_COUNT, val)
-#define bfin_read_PPI_DELAY()          bfin_read16(PPI_DELAY)
-#define bfin_write_PPI_DELAY(val)      bfin_write16(PPI_DELAY, val)
-#define bfin_read_PPI_FRAME()          bfin_read16(PPI_FRAME)
-#define bfin_write_PPI_FRAME(val)      bfin_write16(PPI_FRAME, val)
-#define bfin_read_TWI_CLKDIV()         bfin_read16(TWI_CLKDIV)
-#define bfin_write_TWI_CLKDIV(val)     bfin_write16(TWI_CLKDIV, val)
-#define bfin_read_TWI_CONTROL()        bfin_read16(TWI_CONTROL)
-#define bfin_write_TWI_CONTROL(val)    bfin_write16(TWI_CONTROL, val)
-#define bfin_read_TWI_SLAVE_CTL()      bfin_read16(TWI_SLAVE_CTL)
-#define bfin_write_TWI_SLAVE_CTL(val)  bfin_write16(TWI_SLAVE_CTL, val)
-#define bfin_read_TWI_SLAVE_STAT()     bfin_read16(TWI_SLAVE_STAT)
-#define bfin_write_TWI_SLAVE_STAT(val) bfin_write16(TWI_SLAVE_STAT, val)
-#define bfin_read_TWI_SLAVE_ADDR()     bfin_read16(TWI_SLAVE_ADDR)
-#define bfin_write_TWI_SLAVE_ADDR(val) bfin_write16(TWI_SLAVE_ADDR, val)
-#define bfin_read_TWI_MASTER_CTL()     bfin_read16(TWI_MASTER_CTL)
-#define bfin_write_TWI_MASTER_CTL(val) bfin_write16(TWI_MASTER_CTL, val)
-#define bfin_read_TWI_MASTER_STAT()    bfin_read16(TWI_MASTER_STAT)
-#define bfin_write_TWI_MASTER_STAT(val) bfin_write16(TWI_MASTER_STAT, val)
-#define bfin_read_TWI_MASTER_ADDR()    bfin_read16(TWI_MASTER_ADDR)
-#define bfin_write_TWI_MASTER_ADDR(val) bfin_write16(TWI_MASTER_ADDR, val)
-#define bfin_read_TWI_INT_STAT()       bfin_read16(TWI_INT_STAT)
-#define bfin_write_TWI_INT_STAT(val)   bfin_write16(TWI_INT_STAT, val)
-#define bfin_read_TWI_INT_MASK()       bfin_read16(TWI_INT_MASK)
-#define bfin_write_TWI_INT_MASK(val)   bfin_write16(TWI_INT_MASK, val)
-#define bfin_read_TWI_FIFO_CTL()       bfin_read16(TWI_FIFO_CTL)
-#define bfin_write_TWI_FIFO_CTL(val)   bfin_write16(TWI_FIFO_CTL, val)
-#define bfin_read_TWI_FIFO_STAT()      bfin_read16(TWI_FIFO_STAT)
-#define bfin_write_TWI_FIFO_STAT(val)  bfin_write16(TWI_FIFO_STAT, val)
-#define bfin_read_TWI_XMT_DATA8()      bfin_read16(TWI_XMT_DATA8)
-#define bfin_write_TWI_XMT_DATA8(val)  bfin_write16(TWI_XMT_DATA8, val)
-#define bfin_read_TWI_XMT_DATA16()     bfin_read16(TWI_XMT_DATA16)
-#define bfin_write_TWI_XMT_DATA16(val) bfin_write16(TWI_XMT_DATA16, val)
-#define bfin_read_TWI_RCV_DATA8()      bfin_read16(TWI_RCV_DATA8)
-#define bfin_write_TWI_RCV_DATA8(val)  bfin_write16(TWI_RCV_DATA8, val)
-#define bfin_read_TWI_RCV_DATA16()     bfin_read16(TWI_RCV_DATA16)
-#define bfin_write_TWI_RCV_DATA16(val) bfin_write16(TWI_RCV_DATA16, val)
-#define bfin_read_PORTGIO()            bfin_read16(PORTGIO)
-#define bfin_write_PORTGIO(val)        bfin_write16(PORTGIO, val)
-#define bfin_read_PORTGIO_CLEAR()      bfin_read16(PORTGIO_CLEAR)
-#define bfin_write_PORTGIO_CLEAR(val)  bfin_write16(PORTGIO_CLEAR, val)
-#define bfin_read_PORTGIO_SET()        bfin_read16(PORTGIO_SET)
-#define bfin_write_PORTGIO_SET(val)    bfin_write16(PORTGIO_SET, val)
-#define bfin_read_PORTGIO_TOGGLE()     bfin_read16(PORTGIO_TOGGLE)
-#define bfin_write_PORTGIO_TOGGLE(val) bfin_write16(PORTGIO_TOGGLE, val)
-#define bfin_read_PORTGIO_MASKA()      bfin_read16(PORTGIO_MASKA)
-#define bfin_write_PORTGIO_MASKA(val)  bfin_write16(PORTGIO_MASKA, val)
-#define bfin_read_PORTGIO_MASKA_CLEAR() bfin_read16(PORTGIO_MASKA_CLEAR)
-#define bfin_write_PORTGIO_MASKA_CLEAR(val) bfin_write16(PORTGIO_MASKA_CLEAR, val)
-#define bfin_read_PORTGIO_MASKA_SET()  bfin_read16(PORTGIO_MASKA_SET)
-#define bfin_write_PORTGIO_MASKA_SET(val) bfin_write16(PORTGIO_MASKA_SET, val)
-#define bfin_read_PORTGIO_MASKA_TOGGLE() bfin_read16(PORTGIO_MASKA_TOGGLE)
-#define bfin_write_PORTGIO_MASKA_TOGGLE(val) bfin_write16(PORTGIO_MASKA_TOGGLE, val)
-#define bfin_read_PORTGIO_MASKB()      bfin_read16(PORTGIO_MASKB)
-#define bfin_write_PORTGIO_MASKB(val)  bfin_write16(PORTGIO_MASKB, val)
-#define bfin_read_PORTGIO_MASKB_CLEAR() bfin_read16(PORTGIO_MASKB_CLEAR)
-#define bfin_write_PORTGIO_MASKB_CLEAR(val) bfin_write16(PORTGIO_MASKB_CLEAR, val)
-#define bfin_read_PORTGIO_MASKB_SET()  bfin_read16(PORTGIO_MASKB_SET)
-#define bfin_write_PORTGIO_MASKB_SET(val) bfin_write16(PORTGIO_MASKB_SET, val)
-#define bfin_read_PORTGIO_MASKB_TOGGLE() bfin_read16(PORTGIO_MASKB_TOGGLE)
-#define bfin_write_PORTGIO_MASKB_TOGGLE(val) bfin_write16(PORTGIO_MASKB_TOGGLE, val)
-#define bfin_read_PORTGIO_DIR()        bfin_read16(PORTGIO_DIR)
-#define bfin_write_PORTGIO_DIR(val)    bfin_write16(PORTGIO_DIR, val)
-#define bfin_read_PORTGIO_POLAR()      bfin_read16(PORTGIO_POLAR)
-#define bfin_write_PORTGIO_POLAR(val)  bfin_write16(PORTGIO_POLAR, val)
-#define bfin_read_PORTGIO_EDGE()       bfin_read16(PORTGIO_EDGE)
-#define bfin_write_PORTGIO_EDGE(val)   bfin_write16(PORTGIO_EDGE, val)
-#define bfin_read_PORTGIO_BOTH()       bfin_read16(PORTGIO_BOTH)
-#define bfin_write_PORTGIO_BOTH(val)   bfin_write16(PORTGIO_BOTH, val)
-#define bfin_read_PORTGIO_INEN()       bfin_read16(PORTGIO_INEN)
-#define bfin_write_PORTGIO_INEN(val)   bfin_write16(PORTGIO_INEN, val)
-#define bfin_read_PORTHIO()            bfin_read16(PORTHIO)
-#define bfin_write_PORTHIO(val)        bfin_write16(PORTHIO, val)
-#define bfin_read_PORTHIO_CLEAR()      bfin_read16(PORTHIO_CLEAR)
-#define bfin_write_PORTHIO_CLEAR(val)  bfin_write16(PORTHIO_CLEAR, val)
-#define bfin_read_PORTHIO_SET()        bfin_read16(PORTHIO_SET)
-#define bfin_write_PORTHIO_SET(val)    bfin_write16(PORTHIO_SET, val)
-#define bfin_read_PORTHIO_TOGGLE()     bfin_read16(PORTHIO_TOGGLE)
-#define bfin_write_PORTHIO_TOGGLE(val) bfin_write16(PORTHIO_TOGGLE, val)
-#define bfin_read_PORTHIO_MASKA()      bfin_read16(PORTHIO_MASKA)
-#define bfin_write_PORTHIO_MASKA(val)  bfin_write16(PORTHIO_MASKA, val)
-#define bfin_read_PORTHIO_MASKA_CLEAR() bfin_read16(PORTHIO_MASKA_CLEAR)
-#define bfin_write_PORTHIO_MASKA_CLEAR(val) bfin_write16(PORTHIO_MASKA_CLEAR, val)
-#define bfin_read_PORTHIO_MASKA_SET()  bfin_read16(PORTHIO_MASKA_SET)
-#define bfin_write_PORTHIO_MASKA_SET(val) bfin_write16(PORTHIO_MASKA_SET, val)
-#define bfin_read_PORTHIO_MASKA_TOGGLE() bfin_read16(PORTHIO_MASKA_TOGGLE)
-#define bfin_write_PORTHIO_MASKA_TOGGLE(val) bfin_write16(PORTHIO_MASKA_TOGGLE, val)
-#define bfin_read_PORTHIO_MASKB()      bfin_read16(PORTHIO_MASKB)
-#define bfin_write_PORTHIO_MASKB(val)  bfin_write16(PORTHIO_MASKB, val)
-#define bfin_read_PORTHIO_MASKB_CLEAR() bfin_read16(PORTHIO_MASKB_CLEAR)
-#define bfin_write_PORTHIO_MASKB_CLEAR(val) bfin_write16(PORTHIO_MASKB_CLEAR, val)
-#define bfin_read_PORTHIO_MASKB_SET()  bfin_read16(PORTHIO_MASKB_SET)
-#define bfin_write_PORTHIO_MASKB_SET(val) bfin_write16(PORTHIO_MASKB_SET, val)
-#define bfin_read_PORTHIO_MASKB_TOGGLE() bfin_read16(PORTHIO_MASKB_TOGGLE)
-#define bfin_write_PORTHIO_MASKB_TOGGLE(val) bfin_write16(PORTHIO_MASKB_TOGGLE, val)
-#define bfin_read_PORTHIO_DIR()        bfin_read16(PORTHIO_DIR)
-#define bfin_write_PORTHIO_DIR(val)    bfin_write16(PORTHIO_DIR, val)
-#define bfin_read_PORTHIO_POLAR()      bfin_read16(PORTHIO_POLAR)
-#define bfin_write_PORTHIO_POLAR(val)  bfin_write16(PORTHIO_POLAR, val)
-#define bfin_read_PORTHIO_EDGE()       bfin_read16(PORTHIO_EDGE)
-#define bfin_write_PORTHIO_EDGE(val)   bfin_write16(PORTHIO_EDGE, val)
-#define bfin_read_PORTHIO_BOTH()       bfin_read16(PORTHIO_BOTH)
-#define bfin_write_PORTHIO_BOTH(val)   bfin_write16(PORTHIO_BOTH, val)
-#define bfin_read_PORTHIO_INEN()       bfin_read16(PORTHIO_INEN)
-#define bfin_write_PORTHIO_INEN(val)   bfin_write16(PORTHIO_INEN, val)
-#define bfin_read_UART1_THR()          bfin_read16(UART1_THR)
-#define bfin_write_UART1_THR(val)      bfin_write16(UART1_THR, val)
-#define bfin_read_UART1_RBR()          bfin_read16(UART1_RBR)
-#define bfin_write_UART1_RBR(val)      bfin_write16(UART1_RBR, val)
-#define bfin_read_UART1_DLL()          bfin_read16(UART1_DLL)
-#define bfin_write_UART1_DLL(val)      bfin_write16(UART1_DLL, val)
-#define bfin_read_UART1_IER()          bfin_read16(UART1_IER)
-#define bfin_write_UART1_IER(val)      bfin_write16(UART1_IER, val)
-#define bfin_read_UART1_DLH()          bfin_read16(UART1_DLH)
-#define bfin_write_UART1_DLH(val)      bfin_write16(UART1_DLH, val)
-#define bfin_read_UART1_IIR()          bfin_read16(UART1_IIR)
-#define bfin_write_UART1_IIR(val)      bfin_write16(UART1_IIR, val)
-#define bfin_read_UART1_LCR()          bfin_read16(UART1_LCR)
-#define bfin_write_UART1_LCR(val)      bfin_write16(UART1_LCR, val)
-#define bfin_read_UART1_MCR()          bfin_read16(UART1_MCR)
-#define bfin_write_UART1_MCR(val)      bfin_write16(UART1_MCR, val)
-#define bfin_read_UART1_LSR()          bfin_read16(UART1_LSR)
-#define bfin_write_UART1_LSR(val)      bfin_write16(UART1_LSR, val)
-#define bfin_read_UART1_MSR()          bfin_read16(UART1_MSR)
-#define bfin_write_UART1_MSR(val)      bfin_write16(UART1_MSR, val)
-#define bfin_read_UART1_SCR()          bfin_read16(UART1_SCR)
-#define bfin_write_UART1_SCR(val)      bfin_write16(UART1_SCR, val)
-#define bfin_read_UART1_GCTL()         bfin_read16(UART1_GCTL)
-#define bfin_write_UART1_GCTL(val)     bfin_write16(UART1_GCTL, val)
-#define bfin_read_PORTF_FER()          bfin_read16(PORTF_FER)
-#define bfin_write_PORTF_FER(val)      bfin_write16(PORTF_FER, val)
-#define bfin_read_PORTG_FER()          bfin_read16(PORTG_FER)
-#define bfin_write_PORTG_FER(val)      bfin_write16(PORTG_FER, val)
-#define bfin_read_PORTH_FER()          bfin_read16(PORTH_FER)
-#define bfin_write_PORTH_FER(val)      bfin_write16(PORTH_FER, val)
-#define bfin_read_HMDMA0_CONTROL()     bfin_read16(HMDMA0_CONTROL)
-#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
-#define bfin_read_HMDMA0_ECINIT()      bfin_read16(HMDMA0_ECINIT)
-#define bfin_write_HMDMA0_ECINIT(val)  bfin_write16(HMDMA0_ECINIT, val)
-#define bfin_read_HMDMA0_BCINIT()      bfin_read16(HMDMA0_BCINIT)
-#define bfin_write_HMDMA0_BCINIT(val)  bfin_write16(HMDMA0_BCINIT, val)
-#define bfin_read_HMDMA0_ECURGENT()    bfin_read16(HMDMA0_ECURGENT)
-#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
-#define bfin_read_HMDMA0_ECOVERFLOW()  bfin_read16(HMDMA0_ECOVERFLOW)
-#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
-#define bfin_read_HMDMA0_ECOUNT()      bfin_read16(HMDMA0_ECOUNT)
-#define bfin_write_HMDMA0_ECOUNT(val)  bfin_write16(HMDMA0_ECOUNT, val)
-#define bfin_read_HMDMA0_BCOUNT()      bfin_read16(HMDMA0_BCOUNT)
-#define bfin_write_HMDMA0_BCOUNT(val)  bfin_write16(HMDMA0_BCOUNT, val)
-#define bfin_read_HMDMA1_CONTROL()     bfin_read16(HMDMA1_CONTROL)
-#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
-#define bfin_read_HMDMA1_ECINIT()      bfin_read16(HMDMA1_ECINIT)
-#define bfin_write_HMDMA1_ECINIT(val)  bfin_write16(HMDMA1_ECINIT, val)
-#define bfin_read_HMDMA1_BCINIT()      bfin_read16(HMDMA1_BCINIT)
-#define bfin_write_HMDMA1_BCINIT(val)  bfin_write16(HMDMA1_BCINIT, val)
-#define bfin_read_HMDMA1_ECURGENT()    bfin_read16(HMDMA1_ECURGENT)
-#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
-#define bfin_read_HMDMA1_ECOVERFLOW()  bfin_read16(HMDMA1_ECOVERFLOW)
-#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
-#define bfin_read_HMDMA1_ECOUNT()      bfin_read16(HMDMA1_ECOUNT)
-#define bfin_write_HMDMA1_ECOUNT(val)  bfin_write16(HMDMA1_ECOUNT, val)
-#define bfin_read_HMDMA1_BCOUNT()      bfin_read16(HMDMA1_BCOUNT)
-#define bfin_write_HMDMA1_BCOUNT(val)  bfin_write16(HMDMA1_BCOUNT, val)
-#define bfin_read_PORTF_MUX()          bfin_read16(PORTF_MUX)
-#define bfin_write_PORTF_MUX(val)      bfin_write16(PORTF_MUX, val)
-#define bfin_read_PORTG_MUX()          bfin_read16(PORTG_MUX)
-#define bfin_write_PORTG_MUX(val)      bfin_write16(PORTG_MUX, val)
-#define bfin_read_PORTH_MUX()          bfin_read16(PORTH_MUX)
-#define bfin_write_PORTH_MUX(val)      bfin_write16(PORTH_MUX, val)
-#define bfin_read_PORTF_DRIVE()        bfin_read16(PORTF_DRIVE)
-#define bfin_write_PORTF_DRIVE(val)    bfin_write16(PORTF_DRIVE, val)
-#define bfin_read_PORTG_DRIVE()        bfin_read16(PORTG_DRIVE)
-#define bfin_write_PORTG_DRIVE(val)    bfin_write16(PORTG_DRIVE, val)
-#define bfin_read_PORTH_DRIVE()        bfin_read16(PORTH_DRIVE)
-#define bfin_write_PORTH_DRIVE(val)    bfin_write16(PORTH_DRIVE, val)
-#define bfin_read_PORTF_SLEW()         bfin_read16(PORTF_SLEW)
-#define bfin_write_PORTF_SLEW(val)     bfin_write16(PORTF_SLEW, val)
-#define bfin_read_PORTG_SLEW()         bfin_read16(PORTG_SLEW)
-#define bfin_write_PORTG_SLEW(val)     bfin_write16(PORTG_SLEW, val)
-#define bfin_read_PORTH_SLEW()         bfin_read16(PORTH_SLEW)
-#define bfin_write_PORTH_SLEW(val)     bfin_write16(PORTH_SLEW, val)
-#define bfin_read_PORTF_HYSTERESIS()   bfin_read16(PORTF_HYSTERESIS)
-#define bfin_write_PORTF_HYSTERESIS(val) bfin_write16(PORTF_HYSTERESIS, val)
-#define bfin_read_PORTG_HYSTERESIS()   bfin_read16(PORTG_HYSTERESIS)
-#define bfin_write_PORTG_HYSTERESIS(val) bfin_write16(PORTG_HYSTERESIS, val)
-#define bfin_read_PORTH_HYSTERESIS()   bfin_read16(PORTH_HYSTERESIS)
-#define bfin_write_PORTH_HYSTERESIS(val) bfin_write16(PORTH_HYSTERESIS, val)
-#define bfin_read_NONGPIO_DRIVE()      bfin_read16(NONGPIO_DRIVE)
-#define bfin_write_NONGPIO_DRIVE(val)  bfin_write16(NONGPIO_DRIVE, val)
-#define bfin_read_NONGPIO_SLEW()       bfin_read16(NONGPIO_SLEW)
-#define bfin_write_NONGPIO_SLEW(val)   bfin_write16(NONGPIO_SLEW, val)
-#define bfin_read_NONGPIO_HYSTERESIS() bfin_read16(NONGPIO_HYSTERESIS)
-#define bfin_write_NONGPIO_HYSTERESIS(val) bfin_write16(NONGPIO_HYSTERESIS, val)
-#define bfin_read_HOST_CONTROL()       bfin_read16(HOST_CONTROL)
-#define bfin_write_HOST_CONTROL(val)   bfin_write16(HOST_CONTROL, val)
-#define bfin_read_HOST_STATUS()        bfin_read16(HOST_STATUS)
-#define bfin_write_HOST_STATUS(val)    bfin_write16(HOST_STATUS, val)
-#define bfin_read_HOST_TIMEOUT()       bfin_read16(HOST_TIMEOUT)
-#define bfin_write_HOST_TIMEOUT(val)   bfin_write16(HOST_TIMEOUT, val)
-#define bfin_read_CNT_CONFIG()         bfin_read16(CNT_CONFIG)
-#define bfin_write_CNT_CONFIG(val)     bfin_write16(CNT_CONFIG, val)
-#define bfin_read_CNT_IMASK()          bfin_read16(CNT_IMASK)
-#define bfin_write_CNT_IMASK(val)      bfin_write16(CNT_IMASK, val)
-#define bfin_read_CNT_STATUS()         bfin_read16(CNT_STATUS)
-#define bfin_write_CNT_STATUS(val)     bfin_write16(CNT_STATUS, val)
-#define bfin_read_CNT_COMMAND()        bfin_read16(CNT_COMMAND)
-#define bfin_write_CNT_COMMAND(val)    bfin_write16(CNT_COMMAND, val)
-#define bfin_read_CNT_DEBOUNCE()       bfin_read16(CNT_DEBOUNCE)
-#define bfin_write_CNT_DEBOUNCE(val)   bfin_write16(CNT_DEBOUNCE, val)
-#define bfin_read_CNT_COUNTER()        bfin_read32(CNT_COUNTER)
-#define bfin_write_CNT_COUNTER(val)    bfin_write32(CNT_COUNTER, val)
-#define bfin_read_CNT_MAX()            bfin_read32(CNT_MAX)
-#define bfin_write_CNT_MAX(val)        bfin_write32(CNT_MAX, val)
-#define bfin_read_CNT_MIN()            bfin_read32(CNT_MIN)
-#define bfin_write_CNT_MIN(val)        bfin_write32(CNT_MIN, val)
-#define bfin_read_OTP_CONTROL()        bfin_read16(OTP_CONTROL)
-#define bfin_write_OTP_CONTROL(val)    bfin_write16(OTP_CONTROL, val)
-#define bfin_read_OTP_BEN()            bfin_read16(OTP_BEN)
-#define bfin_write_OTP_BEN(val)        bfin_write16(OTP_BEN, val)
-#define bfin_read_OTP_STATUS()         bfin_read16(OTP_STATUS)
-#define bfin_write_OTP_STATUS(val)     bfin_write16(OTP_STATUS, val)
-#define bfin_read_OTP_TIMING()         bfin_read32(OTP_TIMING)
-#define bfin_write_OTP_TIMING(val)     bfin_write32(OTP_TIMING, val)
-#define bfin_read_SECURE_SYSSWT()      bfin_read32(SECURE_SYSSWT)
-#define bfin_write_SECURE_SYSSWT(val)  bfin_write32(SECURE_SYSSWT, val)
-#define bfin_read_SECURE_CONTROL()     bfin_read16(SECURE_CONTROL)
-#define bfin_write_SECURE_CONTROL(val) bfin_write16(SECURE_CONTROL, val)
-#define bfin_read_SECURE_STATUS()      bfin_read16(SECURE_STATUS)
-#define bfin_write_SECURE_STATUS(val)  bfin_write16(SECURE_STATUS, val)
-#define bfin_read_OTP_DATA0()          bfin_read32(OTP_DATA0)
-#define bfin_write_OTP_DATA0(val)      bfin_write32(OTP_DATA0, val)
-#define bfin_read_OTP_DATA1()          bfin_read32(OTP_DATA1)
-#define bfin_write_OTP_DATA1(val)      bfin_write32(OTP_DATA1, val)
-#define bfin_read_OTP_DATA2()          bfin_read32(OTP_DATA2)
-#define bfin_write_OTP_DATA2(val)      bfin_write32(OTP_DATA2, val)
-#define bfin_read_OTP_DATA3()          bfin_read32(OTP_DATA3)
-#define bfin_write_OTP_DATA3(val)      bfin_write32(OTP_DATA3, val)
-#define bfin_read_NFC_CTL()            bfin_read16(NFC_CTL)
-#define bfin_write_NFC_CTL(val)        bfin_write16(NFC_CTL, val)
-#define bfin_read_NFC_STAT()           bfin_read16(NFC_STAT)
-#define bfin_write_NFC_STAT(val)       bfin_write16(NFC_STAT, val)
-#define bfin_read_NFC_IRQSTAT()        bfin_read16(NFC_IRQSTAT)
-#define bfin_write_NFC_IRQSTAT(val)    bfin_write16(NFC_IRQSTAT, val)
-#define bfin_read_NFC_IRQMASK()        bfin_read16(NFC_IRQMASK)
-#define bfin_write_NFC_IRQMASK(val)    bfin_write16(NFC_IRQMASK, val)
-#define bfin_read_NFC_ECC0()           bfin_read16(NFC_ECC0)
-#define bfin_write_NFC_ECC0(val)       bfin_write16(NFC_ECC0, val)
-#define bfin_read_NFC_ECC1()           bfin_read16(NFC_ECC1)
-#define bfin_write_NFC_ECC1(val)       bfin_write16(NFC_ECC1, val)
-#define bfin_read_NFC_ECC2()           bfin_read16(NFC_ECC2)
-#define bfin_write_NFC_ECC2(val)       bfin_write16(NFC_ECC2, val)
-#define bfin_read_NFC_ECC3()           bfin_read16(NFC_ECC3)
-#define bfin_write_NFC_ECC3(val)       bfin_write16(NFC_ECC3, val)
-#define bfin_read_NFC_COUNT()          bfin_read16(NFC_COUNT)
-#define bfin_write_NFC_COUNT(val)      bfin_write16(NFC_COUNT, val)
-#define bfin_read_NFC_RST()            bfin_read16(NFC_RST)
-#define bfin_write_NFC_RST(val)        bfin_write16(NFC_RST, val)
-#define bfin_read_NFC_PGCTL()          bfin_read16(NFC_PGCTL)
-#define bfin_write_NFC_PGCTL(val)      bfin_write16(NFC_PGCTL, val)
-#define bfin_read_NFC_READ()           bfin_read16(NFC_READ)
-#define bfin_write_NFC_READ(val)       bfin_write16(NFC_READ, val)
-#define bfin_read_NFC_ADDR()           bfin_read16(NFC_ADDR)
-#define bfin_write_NFC_ADDR(val)       bfin_write16(NFC_ADDR, val)
-#define bfin_read_NFC_CMD()            bfin_read16(NFC_CMD)
-#define bfin_write_NFC_CMD(val)        bfin_write16(NFC_CMD, val)
-#define bfin_read_NFC_DATA_WR()        bfin_read16(NFC_DATA_WR)
-#define bfin_write_NFC_DATA_WR(val)    bfin_write16(NFC_DATA_WR, val)
-#define bfin_read_NFC_DATA_RD()        bfin_read16(NFC_DATA_RD)
-#define bfin_write_NFC_DATA_RD(val)    bfin_write16(NFC_DATA_RD, val)
-#define bfin_read_DMA_TC_CNT()         bfin_read16(DMA_TC_CNT)
-#define bfin_write_DMA_TC_CNT(val)     bfin_write16(DMA_TC_CNT, val)
-#define bfin_read_DMA_TC_PER()         bfin_read16(DMA_TC_PER)
-#define bfin_write_DMA_TC_PER(val)     bfin_write16(DMA_TC_PER, val)
-
-#endif /* __BFIN_CDEF_ADSP_EDN_BF52x_extended__ */
diff --git a/arch/blackfin/include/asm/mach-bf527/ADSP-EDN-BF52x-extended_def.h b/arch/blackfin/include/asm/mach-bf527/ADSP-EDN-BF52x-extended_def.h
deleted file mode 100644 (file)
index 7b97aee..0000000
+++ /dev/null
@@ -1,503 +0,0 @@
-/* DO NOT EDIT THIS FILE
- * Automatically generated by generate-def-headers.xsl
- * DO NOT EDIT THIS FILE
- */
-
-#ifndef __BFIN_DEF_ADSP_EDN_BF52x_extended__
-#define __BFIN_DEF_ADSP_EDN_BF52x_extended__
-
-#define SIC_RVECT                      0xFFC00108 /* Interrupt Reset Vector Address Register */
-#define SIC_IMASK0                     0xFFC0010C /* Interrupt Mask Register */
-#define SIC_IAR0                       0xFFC00110 /* Interrupt Assignment Register 0 */
-#define SIC_IAR1                       0xFFC00114 /* Interrupt Assignment Register 1 */
-#define SIC_IAR2                       0xFFC00118 /* Interrupt Assignment Register 2 */
-#define SIC_IAR3                       0xFFC0011C /* Interrupt Assignment Register 3 */
-#define SIC_ISR0                       0xFFC00120 /* Interrupt Status Register */
-#define SIC_IWR0                       0xFFC00124 /* Interrupt Wakeup Register */
-#define SIC_IMASK1                     0xFFC0014C /* Interrupt Mask register of SIC2 */
-#define SIC_IAR4                       0xFFC00150 /* Interrupt Assignment register4 */
-#define SIC_IAR5                       0xFFC00154 /* Interrupt Assignment register5 */
-#define SIC_IAR6                       0xFFC00158 /* Interrupt Assignment register6 */
-#define SIC_IAR7                       0xFFC0015C /* Interrupt Assignment register7 */
-#define SIC_ISR1                       0xFFC00160 /* Interrupt Status register */
-#define SIC_IWR1                       0xFFC00164 /* Interrupt Wakeup register */
-#define WDOG_CTL                       0xFFC00200 /* Watchdog Control Register */
-#define WDOG_CNT                       0xFFC00204 /* Watchdog Count Register */
-#define WDOG_STAT                      0xFFC00208 /* Watchdog Status Register */
-#define RTC_STAT                       0xFFC00300 /* RTC Status Register */
-#define RTC_ICTL                       0xFFC00304 /* RTC Interrupt Control Register */
-#define RTC_ISTAT                      0xFFC00308 /* RTC Interrupt Status Register */
-#define RTC_SWCNT                      0xFFC0030C /* RTC Stopwatch Count Register */
-#define RTC_ALARM                      0xFFC00310 /* RTC Alarm Time Register */
-#define RTC_PREN                       0xFFC00314 /* RTC Prescaler Enable Register */
-#define UART0_THR                      0xFFC00400 /* Transmit Holding register */
-#define UART0_RBR                      0xFFC00400 /* Receive Buffer register */
-#define UART0_DLL                      0xFFC00400 /* Divisor Latch (Low-Byte) */
-#define UART0_IER                      0xFFC00404 /* Interrupt Enable Register */
-#define UART0_DLH                      0xFFC00404 /* Divisor Latch (High-Byte) */
-#define UART0_IIR                      0xFFC00408 /* Interrupt Identification Register */
-#define UART0_LCR                      0xFFC0040C /* Line Control Register */
-#define UART0_MCR                      0xFFC00410 /* Modem Control Register */
-#define UART0_LSR                      0xFFC00414 /* Line Status Register */
-#define UART0_MSR                      0xFFC00418 /* Modem Status Register */
-#define UART0_SCR                      0xFFC0041C /* SCR Scratch Register */
-#define UART0_GCTL                     0xFFC00424 /* Global Control Register */
-#define SPI_CTL                        0xFFC00500 /* SPI Control Register */
-#define SPI_FLG                        0xFFC00504 /* SPI Flag register */
-#define SPI_STAT                       0xFFC00508 /* SPI Status register */
-#define SPI_TDBR                       0xFFC0050C /* SPI Transmit Data Buffer Register */
-#define SPI_RDBR                       0xFFC00510 /* SPI Receive Data Buffer Register */
-#define SPI_BAUD                       0xFFC00514 /* SPI Baud rate Register */
-#define SPI_SHADOW                     0xFFC00518 /* SPI_RDBR Shadow Register */
-#define TIMER0_CONFIG                  0xFFC00600 /* Timer 0 Configuration Register */
-#define TIMER0_COUNTER                 0xFFC00604 /* Timer 0 Counter Register */
-#define TIMER0_PERIOD                  0xFFC00608 /* Timer 0 Period Register */
-#define TIMER0_WIDTH                   0xFFC0060C /* Timer 0 Width Register */
-#define TIMER1_CONFIG                  0xFFC00610 /* Timer 1 Configuration Register */
-#define TIMER1_COUNTER                 0xFFC00614 /* Timer 1 Counter Register */
-#define TIMER1_PERIOD                  0xFFC00618 /* Timer 1 Period Register */
-#define TIMER1_WIDTH                   0xFFC0061C /* Timer 1 Width Register */
-#define TIMER2_CONFIG                  0xFFC00620 /* Timer 2 Configuration Register */
-#define TIMER2_COUNTER                 0xFFC00624 /* Timer 2 Counter Register */
-#define TIMER2_PERIOD                  0xFFC00628 /* Timer 2 Period Register */
-#define TIMER2_WIDTH                   0xFFC0062C /* Timer 2 Width Register */
-#define TIMER3_CONFIG                  0xFFC00630 /* Timer 3 Configuration Register */
-#define TIMER3_COUNTER                 0xFFC00634 /* Timer 3 Counter Register */
-#define TIMER3_PERIOD                  0xFFC00638 /* Timer 3 Period Register */
-#define TIMER3_WIDTH                   0xFFC0063C /* Timer 3 Width Register */
-#define TIMER4_CONFIG                  0xFFC00640 /* Timer 4 Configuration Register */
-#define TIMER4_COUNTER                 0xFFC00644 /* Timer 4 Counter Register */
-#define TIMER4_PERIOD                  0xFFC00648 /* Timer 4 Period Register */
-#define TIMER4_WIDTH                   0xFFC0064C /* Timer 4 Width Register */
-#define TIMER5_CONFIG                  0xFFC00650 /* Timer 5 Configuration Register */
-#define TIMER5_COUNTER                 0xFFC00654 /* Timer 5 Counter Register */
-#define TIMER5_PERIOD                  0xFFC00658 /* Timer 5 Period Register */
-#define TIMER5_WIDTH                   0xFFC0065C /* Timer 5 Width Register */
-#define TIMER6_CONFIG                  0xFFC00660 /* Timer 6 Configuration Register */
-#define TIMER6_COUNTER                 0xFFC00664 /* Timer 6 Counter Register */
-#define TIMER6_PERIOD                  0xFFC00668 /* Timer 6 Period Register */
-#define TIMER6_WIDTH                   0xFFC0066C /* Timer 6 Width Register\n */
-#define TIMER7_CONFIG                  0xFFC00670 /* Timer 7 Configuration Register */
-#define TIMER7_COUNTER                 0xFFC00674 /* Timer 7 Counter Register */
-#define TIMER7_PERIOD                  0xFFC00678 /* Timer 7 Period Register */
-#define TIMER7_WIDTH                   0xFFC0067C /* Timer 7 Width Register */
-#define TIMER_ENABLE                   0xFFC00680 /* Timer Enable Register */
-#define TIMER_DISABLE                  0xFFC00684 /* Timer Disable Register */
-#define TIMER_STATUS                   0xFFC00688 /* Timer Status Register */
-#define PORTFIO                        0xFFC00700 /* Port F I/O Pin State Specify Register */
-#define PORTFIO_CLEAR                  0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register */
-#define PORTFIO_SET                    0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register */
-#define PORTFIO_TOGGLE                 0xFFC0070C /* Port F I/O Pin State Toggle Register */
-#define PORTFIO_MASKA                  0xFFC00710 /* Port F I/O Mask State Specify Interrupt A Register */
-#define PORTFIO_MASKA_CLEAR            0xFFC00714 /* Port F I/O Mask Disable Interrupt A Register */
-#define PORTFIO_MASKA_SET              0xFFC00718 /* Port F I/O Mask Enable Interrupt A Register */
-#define PORTFIO_MASKA_TOGGLE           0xFFC0071C /* Port F I/O Mask Toggle Enable Interrupt A Register */
-#define PORTFIO_MASKB                  0xFFC00720 /* Port F I/O Mask State Specify Interrupt B Register */
-#define PORTFIO_MASKB_CLEAR            0xFFC00724 /* Port F I/O Mask Disable Interrupt B Register */
-#define PORTFIO_MASKB_SET              0xFFC00728 /* Port F I/O Mask Enable Interrupt B Register */
-#define PORTFIO_MASKB_TOGGLE           0xFFC0072C /* Port F I/O Mask Toggle Enable Interrupt B Register */
-#define PORTFIO_DIR                    0xFFC00730 /* Port F I/O Direction Register */
-#define PORTFIO_POLAR                  0xFFC00734 /* Port F I/O Source Polarity Register */
-#define PORTFIO_EDGE                   0xFFC00738 /* Port F I/O Source Sensitivity Register */
-#define PORTFIO_BOTH                   0xFFC0073C /* Port F I/O Set on BOTH Edges Register */
-#define PORTFIO_INEN                   0xFFC00740 /* Port F I/O Input Enable Register  */
-#define SPORT0_TCR1                    0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
-#define SPORT0_TCR2                    0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
-#define SPORT0_TCLKDIV                 0xFFC00808 /* SPORT0 Transmit Clock Divider */
-#define SPORT0_TFSDIV                  0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
-#define SPORT0_TX                      0xFFC00810 /* SPORT0 TX Data Register */
-#define SPORT0_RX                      0xFFC00818 /* SPORT0 RX Data Register */
-#define SPORT0_RCR1                    0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
-#define SPORT0_RCR2                    0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
-#define SPORT0_RCLKDIV                 0xFFC00828 /* SPORT0 Receive Clock Divider */
-#define SPORT0_RFSDIV                  0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
-#define SPORT0_STAT                    0xFFC00830 /* SPORT0 Status Register */
-#define SPORT0_CHNL                    0xFFC00834 /* SPORT0 Current Channel Register */
-#define SPORT0_MCMC1                   0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
-#define SPORT0_MCMC2                   0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
-#define SPORT0_MTCS0                   0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
-#define SPORT0_MTCS1                   0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
-#define SPORT0_MTCS2                   0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
-#define SPORT0_MTCS3                   0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
-#define SPORT0_MRCS0                   0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
-#define SPORT0_MRCS1                   0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
-#define SPORT0_MRCS2                   0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
-#define SPORT0_MRCS3                   0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
-#define SPORT1_TCR1                    0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
-#define SPORT1_TCR2                    0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
-#define SPORT1_TCLKDIV                 0xFFC00908 /* SPORT1 Transmit Clock Divider */
-#define SPORT1_TFSDIV                  0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
-#define SPORT1_TX                      0xFFC00910 /* SPORT1 TX Data Register */
-#define SPORT1_RX                      0xFFC00918 /* SPORT1 RX Data Register */
-#define SPORT1_RCR1                    0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
-#define SPORT1_RCR2                    0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
-#define SPORT1_RCLKDIV                 0xFFC00928 /* SPORT1 Receive Clock Divider */
-#define SPORT1_RFSDIV                  0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
-#define SPORT1_STAT                    0xFFC00930 /* SPORT1 Status Register */
-#define SPORT1_CHNL                    0xFFC00934 /* SPORT1 Current Channel Register */
-#define SPORT1_MCMC1                   0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
-#define SPORT1_MCMC2                   0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
-#define SPORT1_MTCS0                   0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
-#define SPORT1_MTCS1                   0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
-#define SPORT1_MTCS2                   0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
-#define SPORT1_MTCS3                   0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
-#define SPORT1_MRCS0                   0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
-#define SPORT1_MRCS1                   0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
-#define SPORT1_MRCS2                   0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
-#define SPORT1_MRCS3                   0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
-#define EBIU_AMGCTL                    0xFFC00A00 /* Asynchronous Memory Global Control Register */
-#define EBIU_AMBCTL0                   0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
-#define EBIU_AMBCTL1                   0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
-#define EBIU_SDGCTL                    0xFFC00A10 /* SDRAM Global Control Register */
-#define EBIU_SDBCTL                    0xFFC00A14 /* SDRAM Bank Control Register */
-#define EBIU_SDRRC                     0xFFC00A18 /* SDRAM Refresh Rate Control Register */
-#define EBIU_SDSTAT                    0xFFC00A1C /* SDRAM Status Register */
-#define DMA0_NEXT_DESC_PTR             0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
-#define DMA0_START_ADDR                0xFFC00C04 /* DMA Channel 0 Start Address Register */
-#define DMA0_CONFIG                    0xFFC00C08 /* DMA Channel 0 Configuration Register */
-#define DMA0_X_COUNT                   0xFFC00C10 /* DMA Channel 0 X Count Register */
-#define DMA0_X_MODIFY                  0xFFC00C14 /* DMA Channel 0 X Modify Register */
-#define DMA0_Y_COUNT                   0xFFC00C18 /* DMA Channel 0 Y Count Register */
-#define DMA0_Y_MODIFY                  0xFFC00C1C /* DMA Channel 0 Y Modify Register */
-#define DMA0_CURR_DESC_PTR             0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
-#define DMA0_CURR_ADDR                 0xFFC00C24 /* DMA Channel 0 Current Address Register */
-#define DMA0_IRQ_STATUS                0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
-#define DMA0_PERIPHERAL_MAP            0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
-#define DMA0_CURR_X_COUNT              0xFFC00C30 /* DMA Channel 0 Current X Count Register */
-#define DMA0_CURR_Y_COUNT              0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
-#define DMA1_NEXT_DESC_PTR             0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
-#define DMA1_START_ADDR                0xFFC00C44 /* DMA Channel 1 Start Address Register */
-#define DMA1_CONFIG                    0xFFC00C48 /* DMA Channel 1 Configuration Register */
-#define DMA1_X_COUNT                   0xFFC00C50 /* DMA Channel 1 X Count Register */
-#define DMA1_X_MODIFY                  0xFFC00C54 /* DMA Channel 1 X Modify Register */
-#define DMA1_Y_COUNT                   0xFFC00C58 /* DMA Channel 1 Y Count Register */
-#define DMA1_Y_MODIFY                  0xFFC00C5C /* DMA Channel 1 Y Modify Register */
-#define DMA1_CURR_DESC_PTR             0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
-#define DMA1_CURR_ADDR                 0xFFC00C64 /* DMA Channel 1 Current Address Register */
-#define DMA1_IRQ_STATUS                0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
-#define DMA1_PERIPHERAL_MAP            0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
-#define DMA1_CURR_X_COUNT              0xFFC00C70 /* DMA Channel 1 Current X Count Register */
-#define DMA1_CURR_Y_COUNT              0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
-#define DMA2_NEXT_DESC_PTR             0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
-#define DMA2_START_ADDR                0xFFC00C84 /* DMA Channel 2 Start Address Register */
-#define DMA2_CONFIG                    0xFFC00C88 /* DMA Channel 2 Configuration Register */
-#define DMA2_X_COUNT                   0xFFC00C90 /* DMA Channel 2 X Count Register */
-#define DMA2_X_MODIFY                  0xFFC00C94 /* DMA Channel 2 X Modify Register */
-#define DMA2_Y_COUNT                   0xFFC00C98 /* DMA Channel 2 Y Count Register */
-#define DMA2_Y_MODIFY                  0xFFC00C9C /* DMA Channel 2 Y Modify Register */
-#define DMA2_CURR_DESC_PTR             0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
-#define DMA2_CURR_ADDR                 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
-#define DMA2_IRQ_STATUS                0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
-#define DMA2_PERIPHERAL_MAP            0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
-#define DMA2_CURR_X_COUNT              0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
-#define DMA2_CURR_Y_COUNT              0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
-#define DMA3_NEXT_DESC_PTR             0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
-#define DMA3_START_ADDR                0xFFC00CC4 /* DMA Channel 3 Start Address Register */
-#define DMA3_CONFIG                    0xFFC00CC8 /* DMA Channel 3 Configuration Register */
-#define DMA3_X_COUNT                   0xFFC00CD0 /* DMA Channel 3 X Count Register */
-#define DMA3_X_MODIFY                  0xFFC00CD4 /* DMA Channel 3 X Modify Register */
-#define DMA3_Y_COUNT                   0xFFC00CD8 /* DMA Channel 3 Y Count Register */
-#define DMA3_Y_MODIFY                  0xFFC00CDC /* DMA Channel 3 Y Modify Register */
-#define DMA3_CURR_DESC_PTR             0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
-#define DMA3_CURR_ADDR                 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
-#define DMA3_IRQ_STATUS                0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
-#define DMA3_PERIPHERAL_MAP            0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
-#define DMA3_CURR_X_COUNT              0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
-#define DMA3_CURR_Y_COUNT              0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
-#define DMA4_NEXT_DESC_PTR             0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
-#define DMA4_START_ADDR                0xFFC00D04 /* DMA Channel 4 Start Address Register */
-#define DMA4_CONFIG                    0xFFC00D08 /* DMA Channel 4 Configuration Register */
-#define DMA4_X_COUNT                   0xFFC00D10 /* DMA Channel 4 X Count Register */
-#define DMA4_X_MODIFY                  0xFFC00D14 /* DMA Channel 4 X Modify Register */
-#define DMA4_Y_COUNT                   0xFFC00D18 /* DMA Channel 4 Y Count Register */
-#define DMA4_Y_MODIFY                  0xFFC00D1C /* DMA Channel 4 Y Modify Register */
-#define DMA4_CURR_DESC_PTR             0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
-#define DMA4_CURR_ADDR                 0xFFC00D24 /* DMA Channel 4 Current Address Register */
-#define DMA4_IRQ_STATUS                0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
-#define DMA4_PERIPHERAL_MAP            0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
-#define DMA4_CURR_X_COUNT              0xFFC00D30 /* DMA Channel 4 Current X Count Register */
-#define DMA4_CURR_Y_COUNT              0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
-#define DMA5_NEXT_DESC_PTR             0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
-#define DMA5_START_ADDR                0xFFC00D44 /* DMA Channel 5 Start Address Register */
-#define DMA5_CONFIG                    0xFFC00D48 /* DMA Channel 5 Configuration Register */
-#define DMA5_X_COUNT                   0xFFC00D50 /* DMA Channel 5 X Count Register */
-#define DMA5_X_MODIFY                  0xFFC00D54 /* DMA Channel 5 X Modify Register */
-#define DMA5_Y_COUNT                   0xFFC00D58 /* DMA Channel 5 Y Count Register */
-#define DMA5_Y_MODIFY                  0xFFC00D5C /* DMA Channel 5 Y Modify Register */
-#define DMA5_CURR_DESC_PTR             0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
-#define DMA5_CURR_ADDR                 0xFFC00D64 /* DMA Channel 5 Current Address Register */
-#define DMA5_IRQ_STATUS                0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
-#define DMA5_PERIPHERAL_MAP            0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
-#define DMA5_CURR_X_COUNT              0xFFC00D70 /* DMA Channel 5 Current X Count Register */
-#define DMA5_CURR_Y_COUNT              0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
-#define DMA6_NEXT_DESC_PTR             0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
-#define DMA6_START_ADDR                0xFFC00D84 /* DMA Channel 6 Start Address Register */
-#define DMA6_CONFIG                    0xFFC00D88 /* DMA Channel 6 Configuration Register */
-#define DMA6_X_COUNT                   0xFFC00D90 /* DMA Channel 6 X Count Register */
-#define DMA6_X_MODIFY                  0xFFC00D94 /* DMA Channel 6 X Modify Register */
-#define DMA6_Y_COUNT                   0xFFC00D98 /* DMA Channel 6 Y Count Register */
-#define DMA6_Y_MODIFY                  0xFFC00D9C /* DMA Channel 6 Y Modify Register */
-#define DMA6_CURR_DESC_PTR             0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
-#define DMA6_CURR_ADDR                 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
-#define DMA6_IRQ_STATUS                0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
-#define DMA6_PERIPHERAL_MAP            0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
-#define DMA6_CURR_X_COUNT              0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
-#define DMA6_CURR_Y_COUNT              0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
-#define DMA7_NEXT_DESC_PTR             0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
-#define DMA7_START_ADDR                0xFFC00DC4 /* DMA Channel 7 Start Address Register */
-#define DMA7_CONFIG                    0xFFC00DC8 /* DMA Channel 7 Configuration Register */
-#define DMA7_X_COUNT                   0xFFC00DD0 /* DMA Channel 7 X Count Register */
-#define DMA7_X_MODIFY                  0xFFC00DD4 /* DMA Channel 7 X Modify Register */
-#define DMA7_Y_COUNT                   0xFFC00DD8 /* DMA Channel 7 Y Count Register */
-#define DMA7_Y_MODIFY                  0xFFC00DDC /* DMA Channel 7 Y Modify Register */
-#define DMA7_CURR_DESC_PTR             0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
-#define DMA7_CURR_ADDR                 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
-#define DMA7_IRQ_STATUS                0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
-#define DMA7_PERIPHERAL_MAP            0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
-#define DMA7_CURR_X_COUNT              0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
-#define DMA7_CURR_Y_COUNT              0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
-#define DMA8_NEXT_DESC_PTR             0xFFC00E00 /* DMA Channel 8 Next Descriptor Pointer Register */
-#define DMA8_START_ADDR                0xFFC00E04 /* DMA Channel 8 Start Address Register */
-#define DMA8_CONFIG                    0xFFC00E08 /* DMA Channel 8 Configuration Register */
-#define DMA8_X_COUNT                   0xFFC00E10 /* DMA Channel 8 X Count Register */
-#define DMA8_X_MODIFY                  0xFFC00E14 /* DMA Channel 8 X Modify Register */
-#define DMA8_Y_COUNT                   0xFFC00E18 /* DMA Channel 8 Y Count Register */
-#define DMA8_Y_MODIFY                  0xFFC00E1C /* DMA Channel 8 Y Modify Register */
-#define DMA8_CURR_DESC_PTR             0xFFC00E20 /* DMA Channel 8 Current Descriptor Pointer Register */
-#define DMA8_CURR_ADDR                 0xFFC00E24 /* DMA Channel 8 Current Address Register */
-#define DMA8_IRQ_STATUS                0xFFC00E28 /* DMA Channel 8 Interrupt/Status Register */
-#define DMA8_PERIPHERAL_MAP            0xFFC00E2C /* DMA Channel 8 Peripheral Map Register */
-#define DMA8_CURR_X_COUNT              0xFFC00E30 /* DMA Channel 8 Current X Count Register */
-#define DMA8_CURR_Y_COUNT              0xFFC00E38 /* DMA Channel 8 Current Y Count Register */
-#define DMA9_NEXT_DESC_PTR             0xFFC00E40 /* DMA Channel 9 Next Descriptor Pointer Register */
-#define DMA9_START_ADDR                0xFFC00E44 /* DMA Channel 9 Start Address Register */
-#define DMA9_CONFIG                    0xFFC00E48 /* DMA Channel 9 Configuration Register */
-#define DMA9_X_COUNT                   0xFFC00E50 /* DMA Channel 9 X Count Register */
-#define DMA9_X_MODIFY                  0xFFC00E54 /* DMA Channel 9 X Modify Register */
-#define DMA9_Y_COUNT                   0xFFC00E58 /* DMA Channel 9 Y Count Register */
-#define DMA9_Y_MODIFY                  0xFFC00E5C /* DMA Channel 9 Y Modify Register */
-#define DMA9_CURR_DESC_PTR             0xFFC00E60 /* DMA Channel 9 Current Descriptor Pointer Register */
-#define DMA9_CURR_ADDR                 0xFFC00E64 /* DMA Channel 9 Current Address Register */
-#define DMA9_IRQ_STATUS                0xFFC00E68 /* DMA Channel 9 Interrupt/Status Register */
-#define DMA9_PERIPHERAL_MAP            0xFFC00E6C /* DMA Channel 9 Peripheral Map Register */
-#define DMA9_CURR_X_COUNT              0xFFC00E70 /* DMA Channel 9 Current X Count Register */
-#define DMA9_CURR_Y_COUNT              0xFFC00E78 /* DMA Channel 9 Current Y Count Register */
-#define DMA10_NEXT_DESC_PTR            0xFFC00E80 /* DMA Channel 10 Next Descriptor Pointer Register */
-#define DMA10_START_ADDR               0xFFC00E84 /* DMA Channel 10 Start Address Register */
-#define DMA10_CONFIG                   0xFFC00E88 /* DMA Channel 10 Configuration Register */
-#define DMA10_X_COUNT                  0xFFC00E90 /* DMA Channel 10 X Count Register */
-#define DMA10_X_MODIFY                 0xFFC00E94 /* DMA Channel 10 X Modify Register */
-#define DMA10_Y_COUNT                  0xFFC00E98 /* DMA Channel 10 Y Count Register */
-#define DMA10_Y_MODIFY                 0xFFC00E9C /* DMA Channel 10 Y Modify Register */
-#define DMA10_CURR_DESC_PTR            0xFFC00EA0 /* DMA Channel 10 Current Descriptor Pointer Register */
-#define DMA10_CURR_ADDR                0xFFC00EA4 /* DMA Channel 10 Current Address Register */
-#define DMA10_IRQ_STATUS               0xFFC00EA8 /* DMA Channel 10 Interrupt/Status Register */
-#define DMA10_PERIPHERAL_MAP           0xFFC00EAC /* DMA Channel 10 Peripheral Map Register */
-#define DMA10_CURR_X_COUNT             0xFFC00EB0 /* DMA Channel 10 Current X Count Register */
-#define DMA10_CURR_Y_COUNT             0xFFC00EB8 /* DMA Channel 10 Current Y Count Register */
-#define DMA11_NEXT_DESC_PTR            0xFFC00EC0 /* DMA Channel 11 Next Descriptor Pointer Register */
-#define DMA11_START_ADDR               0xFFC00EC4 /* DMA Channel 11 Start Address Register */
-#define DMA11_CONFIG                   0xFFC00EC8 /* DMA Channel 11 Configuration Register */
-#define DMA11_X_COUNT                  0xFFC00ED0 /* DMA Channel 11 X Count Register */
-#define DMA11_X_MODIFY                 0xFFC00ED4 /* DMA Channel 11 X Modify Register */
-#define DMA11_Y_COUNT                  0xFFC00ED8 /* DMA Channel 11 Y Count Register */
-#define DMA11_Y_MODIFY                 0xFFC00EDC /* DMA Channel 11 Y Modify Register */
-#define DMA11_CURR_DESC_PTR            0xFFC00EE0 /* DMA Channel 11 Current Descriptor Pointer Register */
-#define DMA11_CURR_ADDR                0xFFC00EE4 /* DMA Channel 11 Current Address Register */
-#define DMA11_IRQ_STATUS               0xFFC00EE8 /* DMA Channel 11 Interrupt/Status Register */
-#define DMA11_PERIPHERAL_MAP           0xFFC00EEC /* DMA Channel 11 Peripheral Map Register */
-#define DMA11_CURR_X_COUNT             0xFFC00EF0 /* DMA Channel 11 Current X Count Register */
-#define DMA11_CURR_Y_COUNT             0xFFC00EF8 /* DMA Channel 11 Current Y Count Register */
-#define MDMA_S0_NEXT_DESC_PTR          0xFFC00F40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
-#define MDMA_S0_START_ADDR             0xFFC00F44 /* MemDMA Stream 0 Source Start Address Register */
-#define MDMA_S0_CONFIG                 0xFFC00F48 /* MemDMA Stream 0 Source Configuration Register */
-#define MDMA_S0_X_COUNT                0xFFC00F50 /* MemDMA Stream 0 Source X Count Register */
-#define MDMA_S0_X_MODIFY               0xFFC00F54 /* MemDMA Stream 0 Source X Modify Register */
-#define MDMA_S0_Y_COUNT                0xFFC00F58 /* MemDMA Stream 0 Source Y Count Register */
-#define MDMA_S0_Y_MODIFY               0xFFC00F5C /* MemDMA Stream 0 Source Y Modify Register */
-#define MDMA_S0_CURR_DESC_PTR          0xFFC00F60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
-#define MDMA_S0_CURR_ADDR              0xFFC00F64 /* MemDMA Stream 0 Source Current Address Register */
-#define MDMA_S0_IRQ_STATUS             0xFFC00F68 /* MemDMA Stream 0 Source Interrupt/Status Register */
-#define MDMA_S0_PERIPHERAL_MAP         0xFFC00F6C /* MemDMA Stream 0 Source Peripheral Map Register */
-#define MDMA_S0_CURR_X_COUNT           0xFFC00F70 /* MemDMA Stream 0 Source Current X Count Register */
-#define MDMA_S0_CURR_Y_COUNT           0xFFC00F78 /* MemDMA Stream 0 Source Current Y Count Register */
-#define MDMA_D0_NEXT_DESC_PTR          0xFFC00F00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
-#define MDMA_D0_START_ADDR             0xFFC00F04 /* MemDMA Stream 0 Destination Start Address Register */
-#define MDMA_D0_CONFIG                 0xFFC00F08 /* MemDMA Stream 0 Destination Configuration Register */
-#define MDMA_D0_X_COUNT                0xFFC00F10 /* MemDMA Stream 0 Destination X Count Register */
-#define MDMA_D0_X_MODIFY               0xFFC00F14 /* MemDMA Stream 0 Destination X Modify Register */
-#define MDMA_D0_Y_COUNT                0xFFC00F18 /* MemDMA Stream 0 Destination Y Count Register */
-#define MDMA_D0_Y_MODIFY               0xFFC00F1C /* MemDMA Stream 0 Destination Y Modify Register */
-#define MDMA_D0_CURR_DESC_PTR          0xFFC00F20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
-#define MDMA_D0_CURR_ADDR              0xFFC00F24 /* MemDMA Stream 0 Destination Current Address Register */
-#define MDMA_D0_IRQ_STATUS             0xFFC00F28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
-#define MDMA_D0_PERIPHERAL_MAP         0xFFC00F2C /* MemDMA Stream 0 Destination Peripheral Map Register */
-#define MDMA_D0_CURR_X_COUNT           0xFFC00F30 /* MemDMA Stream 0 Destination Current X Count Register */
-#define MDMA_D0_CURR_Y_COUNT           0xFFC00F38 /* MemDMA Stream 0 Destination Current Y Count Register */
-#define MDMA_S1_NEXT_DESC_PTR          0xFFC00FC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
-#define MDMA_S1_START_ADDR             0xFFC00FC4 /* MemDMA Stream 1 Source Start Address Register */
-#define MDMA_S1_CONFIG                 0xFFC00FC8 /* MemDMA Stream 1 Source Configuration Register */
-#define MDMA_S1_X_COUNT                0xFFC00FD0 /* MemDMA Stream 1 Source X Count Register */
-#define MDMA_S1_X_MODIFY               0xFFC00FD4 /* MemDMA Stream 1 Source X Modify Register */
-#define MDMA_S1_Y_COUNT                0xFFC00FD8 /* MemDMA Stream 1 Source Y Count Register */
-#define MDMA_S1_Y_MODIFY               0xFFC00FDC /* MemDMA Stream 1 Source Y Modify Register */
-#define MDMA_S1_CURR_DESC_PTR          0xFFC00FE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
-#define MDMA_S1_CURR_ADDR              0xFFC00FE4 /* MemDMA Stream 1 Source Current Address Register */
-#define MDMA_S1_IRQ_STATUS             0xFFC00FE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
-#define MDMA_S1_PERIPHERAL_MAP         0xFFC00FEC /* MemDMA Stream 1 Source Peripheral Map Register */
-#define MDMA_S1_CURR_X_COUNT           0xFFC00FF0 /* MemDMA Stream 1 Source Current X Count Register */
-#define MDMA_S1_CURR_Y_COUNT           0xFFC00FF8 /* MemDMA Stream 1 Source Current Y Count Register */
-#define MDMA_D1_NEXT_DESC_PTR          0xFFC00F80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
-#define MDMA_D1_START_ADDR             0xFFC00F84 /* MemDMA Stream 1 Destination Start Address Register */
-#define MDMA_D1_CONFIG                 0xFFC00F88 /* MemDMA Stream 1 Destination Configuration Register */
-#define MDMA_D1_X_COUNT                0xFFC00F90 /* MemDMA Stream 1 Destination X Count Register */
-#define MDMA_D1_X_MODIFY               0xFFC00F94 /* MemDMA Stream 1 Destination X Modify Register */
-#define MDMA_D1_Y_COUNT                0xFFC00F98 /* MemDMA Stream 1 Destination Y Count Register */
-#define MDMA_D1_Y_MODIFY               0xFFC00F9C /* MemDMA Stream 1 Destination Y Modify Register */
-#define MDMA_D1_CURR_DESC_PTR          0xFFC00FA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
-#define MDMA_D1_CURR_ADDR              0xFFC00FA4 /* MemDMA Stream 1 Destination Current Address Register */
-#define MDMA_D1_IRQ_STATUS             0xFFC00FA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
-#define MDMA_D1_PERIPHERAL_MAP         0xFFC00FAC /* MemDMA Stream 1 Destination Peripheral Map Register */
-#define MDMA_D1_CURR_X_COUNT           0xFFC00FB0 /* MemDMA Stream 1 Destination Current X Count Register */
-#define MDMA_D1_CURR_Y_COUNT           0xFFC00FB8 /* MemDMA Stream 1 Destination Current Y Count Register */
-#define PPI_CONTROL                    0xFFC01000 /* PPI Control Register */
-#define PPI_STATUS                     0xFFC01004 /* PPI Status Register */
-#define PPI_COUNT                      0xFFC01008 /* PPI Transfer Count Register */
-#define PPI_DELAY                      0xFFC0100C /* PPI Delay Count Register */
-#define PPI_FRAME                      0xFFC01010 /* PPI Frame Length Register */
-#define TWI_CLKDIV                     0xFFC01400 /* Serial Clock Divider Register */
-#define TWI_CONTROL                    0xFFC01404 /* TWI Control Register */
-#define TWI_SLAVE_CTL                  0xFFC01408 /* Slave Mode Control Register */
-#define TWI_SLAVE_STAT                 0xFFC0140C /* Slave Mode Status Register */
-#define TWI_SLAVE_ADDR                 0xFFC01410 /* Slave Mode Address Register */
-#define TWI_MASTER_CTL                 0xFFC01414 /* Master Mode Control Register */
-#define TWI_MASTER_STAT                0xFFC01418 /* Master Mode Status Register */
-#define TWI_MASTER_ADDR                0xFFC0141C /* Master Mode Address Register */
-#define TWI_INT_STAT                   0xFFC01420 /* TWI Interrupt Status Register */
-#define TWI_INT_MASK                   0xFFC01424 /* TWI Master Interrupt Mask Register */
-#define TWI_FIFO_CTL                   0xFFC01428 /* FIFO Control Register */
-#define TWI_FIFO_STAT                  0xFFC0142C /* FIFO Status Register */
-#define TWI_XMT_DATA8                  0xFFC01480 /* FIFO Transmit Data Single Byte Register */
-#define TWI_XMT_DATA16                 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
-#define TWI_RCV_DATA8                  0xFFC01488 /* FIFO Receive Data Single Byte Register */
-#define TWI_RCV_DATA16                 0xFFC0148C /* FIFO Receive Data Double Byte Register */
-#define PORTGIO                        0xFFC01500 /* Port G I/O Pin State Specify Register */
-#define PORTGIO_CLEAR                  0xFFC01504 /* Port G I/O Peripheral Interrupt Clear Register */
-#define PORTGIO_SET                    0xFFC01508 /* Port G I/O Peripheral Interrupt Set Register */
-#define PORTGIO_TOGGLE                 0xFFC0150C /* Port G I/O Pin State Toggle Register */
-#define PORTGIO_MASKA                  0xFFC01510 /* Port G I/O Mask State Specify Interrupt A Register */
-#define PORTGIO_MASKA_CLEAR            0xFFC01514 /* Port G I/O Mask Disable Interrupt A Register */
-#define PORTGIO_MASKA_SET              0xFFC01518 /* Port G I/O Mask Enable Interrupt A Register */
-#define PORTGIO_MASKA_TOGGLE           0xFFC0151C /* Port G I/O Mask Toggle Enable Interrupt A Register */
-#define PORTGIO_MASKB                  0xFFC01520 /* Port G I/O Mask State Specify Interrupt B Register */
-#define PORTGIO_MASKB_CLEAR            0xFFC01524 /* Port G I/O Mask Disable Interrupt B Register */
-#define PORTGIO_MASKB_SET              0xFFC01528 /* Port G I/O Mask Enable Interrupt B Register */
-#define PORTGIO_MASKB_TOGGLE           0xFFC0152C /* Port G I/O Mask Toggle Enable Interrupt B Register */
-#define PORTGIO_DIR                    0xFFC01530 /* Port G I/O Direction Register */
-#define PORTGIO_POLAR                  0xFFC01534 /* Port G I/O Source Polarity Register */
-#define PORTGIO_EDGE                   0xFFC01538 /* Port G I/O Source Sensitivity Register */
-#define PORTGIO_BOTH                   0xFFC0153C /* Port G I/O Set on BOTH Edges Register */
-#define PORTGIO_INEN                   0xFFC01540 /* Port G I/O Input Enable Register */
-#define PORTHIO                        0xFFC01700 /* Port H I/O Pin State Specify Register */
-#define PORTHIO_CLEAR                  0xFFC01704 /* Port H I/O Peripheral Interrupt Clear Register */
-#define PORTHIO_SET                    0xFFC01708 /* Port H I/O Peripheral Interrupt Set Register */
-#define PORTHIO_TOGGLE                 0xFFC0170C /* Port H I/O Pin State Toggle Register */
-#define PORTHIO_MASKA                  0xFFC01710 /* Port H I/O Mask State Specify Interrupt A Register */
-#define PORTHIO_MASKA_CLEAR            0xFFC01714 /* Port H I/O Mask Disable Interrupt A Register */
-#define PORTHIO_MASKA_SET              0xFFC01718 /* Port H I/O Mask Enable Interrupt A Register */
-#define PORTHIO_MASKA_TOGGLE           0xFFC0171C /* Port H I/O Mask Toggle Enable Interrupt A Register */
-#define PORTHIO_MASKB                  0xFFC01720 /* Port H I/O Mask State Specify Interrupt B Register */
-#define PORTHIO_MASKB_CLEAR            0xFFC01724 /* Port H I/O Mask Disable Interrupt B Register */
-#define PORTHIO_MASKB_SET              0xFFC01728 /* Port H I/O Mask Enable Interrupt B Register */
-#define PORTHIO_MASKB_TOGGLE           0xFFC0172C /* Port H I/O Mask Toggle Enable Interrupt B Register */
-#define PORTHIO_DIR                    0xFFC01730 /* Port H I/O Direction Register */
-#define PORTHIO_POLAR                  0xFFC01734 /* Port H I/O Source Polarity Register */
-#define PORTHIO_EDGE                   0xFFC01738 /* Port H I/O Source Sensitivity Register */
-#define PORTHIO_BOTH                   0xFFC0173C /* Port H I/O Set on BOTH Edges Register */
-#define PORTHIO_INEN                   0xFFC01740 /* Port H I/O Input Enable Register */
-#define UART1_THR                      0xFFC02000 /* Transmit Holding register */
-#define UART1_RBR                      0xFFC02000 /* Receive Buffer register */
-#define UART1_DLL                      0xFFC02000 /* Divisor Latch (Low-Byte) */
-#define UART1_IER                      0xFFC02004 /* Interrupt Enable Register */
-#define UART1_DLH                      0xFFC02004 /* Divisor Latch (High-Byte) */
-#define UART1_IIR                      0xFFC02008 /* Interrupt Identification Register */
-#define UART1_LCR                      0xFFC0200C /* Line Control Register */
-#define UART1_MCR                      0xFFC02010 /* Modem Control Register */
-#define UART1_LSR                      0xFFC02014 /* Line Status Register */
-#define UART1_MSR                      0xFFC02018 /* Modem Status Register */
-#define UART1_SCR                      0xFFC0201C /* SCR Scratch Register */
-#define UART1_GCTL                     0xFFC02024 /* Global Control Register */
-#define PORTF_FER                      0xFFC03200 /* Port F Function Enable Register (Alternate/Flag*) */
-#define PORTG_FER                      0xFFC03204 /* Port G Function Enable Register (Alternate/Flag*) */
-#define PORTH_FER                      0xFFC03208 /* Port H Function Enable Register (Alternate/Flag*) */
-#define HMDMA0_CONTROL                 0xFFC03300 /* Handshake MDMA0 Control Register */
-#define HMDMA0_ECINIT                  0xFFC03304 /* HMDMA0 Initial Edge Count Register */
-#define HMDMA0_BCINIT                  0xFFC03308 /* HMDMA0 Initial Block Count Register */
-#define HMDMA0_ECURGENT                0xFFC0330C /* HMDMA0 Urgent Edge Count Threshhold Register */
-#define HMDMA0_ECOVERFLOW              0xFFC03310 /* HMDMA0 Edge Count Overflow Interrupt Register */
-#define HMDMA0_ECOUNT                  0xFFC03314 /* HMDMA0 Current Edge Count Register */
-#define HMDMA0_BCOUNT                  0xFFC03318 /* HMDMA0 Current Block Count Register */
-#define HMDMA1_CONTROL                 0xFFC03340 /* Handshake MDMA1 Control Register */
-#define HMDMA1_ECINIT                  0xFFC03344 /* HMDMA1 Initial Edge Count Register */
-#define HMDMA1_BCINIT                  0xFFC03348 /* HMDMA1 Initial Block Count Register */
-#define HMDMA1_ECURGENT                0xFFC0334C /* HMDMA1 Urgent Edge Count Threshhold Register */
-#define HMDMA1_ECOVERFLOW              0xFFC03350 /* HMDMA1 Edge Count Overflow Interrupt Register */
-#define HMDMA1_ECOUNT                  0xFFC03354 /* HMDMA1 Current Edge Count Register */
-#define HMDMA1_BCOUNT                  0xFFC03358 /* HMDMA1 Current Block Count Register */
-#define PORTF_MUX                      0xFFC03210 /* Port F mux control */
-#define PORTG_MUX                      0xFFC03214 /* Port G mux control */
-#define PORTH_MUX                      0xFFC03218 /* Port H mux control */
-#define PORTF_DRIVE                    0xFFC03220 /* Port F drive strength control */
-#define PORTG_DRIVE                    0xFFC03224 /* Port G drive strength control */
-#define PORTH_DRIVE                    0xFFC03228 /* Port H drive strength control */
-#define PORTF_SLEW                     0xFFC03230 /* Port F slew control */
-#define PORTG_SLEW                     0xFFC03234 /* Port G slew control */
-#define PORTH_SLEW                     0xFFC03238 /* Port H slew control */
-#define PORTF_HYSTERESIS               0xFFC03240 /* Port F Schmitt trigger control */
-#define PORTG_HYSTERESIS               0xFFC03244 /* Port G Schmitt trigger control */
-#define PORTH_HYSTERESIS               0xFFC03248 /* Port H Schmitt trigger control */
-#define NONGPIO_DRIVE                  0xFFC03280 /* Non-GPIO Port drive strength control */
-#define NONGPIO_SLEW                   0xFFC03284 /* Non-GPIO Port slew control */
-#define NONGPIO_HYSTERESIS             0xFFC03288 /* Non-GPIO Port Schmitt trigger control */
-#define HOST_CONTROL                   0xFFC03400 /* HOST Control Register */
-#define HOST_STATUS                    0xFFC03404 /* HOST Status Register */
-#define HOST_TIMEOUT                   0xFFC03408 /* HOST Acknowledge Mode Timeout Register */
-#define CNT_CONFIG                     0xFFC03500 /* Configuration/Control Register */
-#define CNT_IMASK                      0xFFC03504 /* Interrupt Mask Register */
-#define CNT_STATUS                     0xFFC03508 /* Status Register */
-#define CNT_COMMAND                    0xFFC0350C /* Command Register */
-#define CNT_DEBOUNCE                   0xFFC03510 /* Debounce Prescaler Register */
-#define CNT_COUNTER                    0xFFC03514 /* Counter Register */
-#define CNT_MAX                        0xFFC03518 /* Maximal Count Boundary Value Register */
-#define CNT_MIN                        0xFFC0351C /* Minimal Count Boundary Value Register */
-#define OTP_CONTROL                    0xFFC03600 /* OTP/Fuse Control Register */
-#define OTP_BEN                        0xFFC03604 /* OTP/Fuse Byte Enable */
-#define OTP_STATUS                     0xFFC03608 /* OTP/Fuse Status */
-#define OTP_TIMING                     0xFFC0360C /* OTP/Fuse Access Timing */
-#define SECURE_SYSSWT                  0xFFC03620 /* Secure System Switches */
-#define SECURE_CONTROL                 0xFFC03624 /* Secure Control */
-#define SECURE_STATUS                  0xFFC03628 /* Secure Status */
-#define OTP_DATA0                      0xFFC03680 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
-#define OTP_DATA1                      0xFFC03684 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
-#define OTP_DATA2                      0xFFC03688 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
-#define OTP_DATA3                      0xFFC0368C /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
-#define NFC_CTL                        0xFFC03700 /* NAND Control Register */
-#define NFC_STAT                       0xFFC03704 /* NAND Status Register */
-#define NFC_IRQSTAT                    0xFFC03708 /* NAND Interrupt Status Register */
-#define NFC_IRQMASK                    0xFFC0370C /* NAND Interrupt Mask Register */
-#define NFC_ECC0                       0xFFC03710 /* NAND ECC Register 0 */
-#define NFC_ECC1                       0xFFC03714 /* NAND ECC Register 1 */
-#define NFC_ECC2                       0xFFC03718 /* NAND ECC Register 2 */
-#define NFC_ECC3                       0xFFC0371C /* NAND ECC Register 3 */
-#define NFC_COUNT                      0xFFC03720 /* NAND ECC Count Register */
-#define NFC_RST                        0xFFC03724 /* NAND ECC Reset Register */
-#define NFC_PGCTL                      0xFFC03728 /* NAND Page Control Register */
-#define NFC_READ                       0xFFC0372C /* NAND Read Data Register */
-#define NFC_ADDR                       0xFFC03740 /* NAND Address Register */
-#define NFC_CMD                        0xFFC03744 /* NAND Command Register */
-#define NFC_DATA_WR                    0xFFC03748 /* NAND Data Write Register */
-#define NFC_DATA_RD                    0xFFC0374C /* NAND Data Read Register */
-#define DMA_TC_CNT                     0xFFC00B0C
-#define DMA_TC_PER                     0xFFC00B10
-
-#endif /* __BFIN_DEF_ADSP_EDN_BF52x_extended__ */
index 9ce41b16dfba6293ed0334093bd61d96e259a48f..49a60afac6d36eb338d1828c9aa45926a9f327e4 100644 (file)
@@ -8,8 +8,6 @@
 
 #include "../mach-common/ADSP-EDN-core_cdef.h"
 
-#include "ADSP-EDN-BF52x-extended_cdef.h"
-
 #define bfin_read_PLL_CTL()            bfin_read16(PLL_CTL)
 #define bfin_write_PLL_CTL(val)        bfin_write16(PLL_CTL, val)
 #define bfin_read_PLL_DIV()            bfin_read16(PLL_DIV)
 #define bfin_write_SWRST(val)          bfin_write16(SWRST, val)
 #define bfin_read_SYSCR()              bfin_read16(SYSCR)
 #define bfin_write_SYSCR(val)          bfin_write16(SYSCR, val)
+#define bfin_read_SIC_RVECT()          bfin_read16(SIC_RVECT)
+#define bfin_write_SIC_RVECT(val)      bfin_write16(SIC_RVECT, val)
+#define bfin_read_SIC_IMASK0()         bfin_read32(SIC_IMASK0)
+#define bfin_write_SIC_IMASK0(val)     bfin_write32(SIC_IMASK0, val)
+#define bfin_read_SIC_IAR0()           bfin_read32(SIC_IAR0)
+#define bfin_write_SIC_IAR0(val)       bfin_write32(SIC_IAR0, val)
+#define bfin_read_SIC_IAR1()           bfin_read32(SIC_IAR1)
+#define bfin_write_SIC_IAR1(val)       bfin_write32(SIC_IAR1, val)
+#define bfin_read_SIC_IAR2()           bfin_read32(SIC_IAR2)
+#define bfin_write_SIC_IAR2(val)       bfin_write32(SIC_IAR2, val)
+#define bfin_read_SIC_IAR3()           bfin_read32(SIC_IAR3)
+#define bfin_write_SIC_IAR3(val)       bfin_write32(SIC_IAR3, val)
+#define bfin_read_SIC_ISR0()           bfin_read32(SIC_ISR0)
+#define bfin_write_SIC_ISR0(val)       bfin_write32(SIC_ISR0, val)
+#define bfin_read_SIC_IWR0()           bfin_read32(SIC_IWR0)
+#define bfin_write_SIC_IWR0(val)       bfin_write32(SIC_IWR0, val)
+#define bfin_read_SIC_IMASK1()         bfin_read32(SIC_IMASK1)
+#define bfin_write_SIC_IMASK1(val)     bfin_write32(SIC_IMASK1, val)
+#define bfin_read_SIC_IAR4()           bfin_read32(SIC_IAR4)
+#define bfin_write_SIC_IAR4(val)       bfin_write32(SIC_IAR4, val)
+#define bfin_read_SIC_IAR5()           bfin_read32(SIC_IAR5)
+#define bfin_write_SIC_IAR5(val)       bfin_write32(SIC_IAR5, val)
+#define bfin_read_SIC_IAR6()           bfin_read32(SIC_IAR6)
+#define bfin_write_SIC_IAR6(val)       bfin_write32(SIC_IAR6, val)
+#define bfin_read_SIC_IAR7()           bfin_read32(SIC_IAR7)
+#define bfin_write_SIC_IAR7(val)       bfin_write32(SIC_IAR7, val)
+#define bfin_read_SIC_ISR1()           bfin_read32(SIC_ISR1)
+#define bfin_write_SIC_ISR1(val)       bfin_write32(SIC_ISR1, val)
+#define bfin_read_SIC_IWR1()           bfin_read32(SIC_IWR1)
+#define bfin_write_SIC_IWR1(val)       bfin_write32(SIC_IWR1, val)
+#define bfin_read_WDOG_CTL()           bfin_read16(WDOG_CTL)
+#define bfin_write_WDOG_CTL(val)       bfin_write16(WDOG_CTL, val)
+#define bfin_read_WDOG_CNT()           bfin_read32(WDOG_CNT)
+#define bfin_write_WDOG_CNT(val)       bfin_write32(WDOG_CNT, val)
+#define bfin_read_WDOG_STAT()          bfin_read32(WDOG_STAT)
+#define bfin_write_WDOG_STAT(val)      bfin_write32(WDOG_STAT, val)
+#define bfin_read_RTC_STAT()           bfin_read32(RTC_STAT)
+#define bfin_write_RTC_STAT(val)       bfin_write32(RTC_STAT, val)
+#define bfin_read_RTC_ICTL()           bfin_read16(RTC_ICTL)
+#define bfin_write_RTC_ICTL(val)       bfin_write16(RTC_ICTL, val)
+#define bfin_read_RTC_ISTAT()          bfin_read16(RTC_ISTAT)
+#define bfin_write_RTC_ISTAT(val)      bfin_write16(RTC_ISTAT, val)
+#define bfin_read_RTC_SWCNT()          bfin_read16(RTC_SWCNT)
+#define bfin_write_RTC_SWCNT(val)      bfin_write16(RTC_SWCNT, val)
+#define bfin_read_RTC_ALARM()          bfin_read32(RTC_ALARM)
+#define bfin_write_RTC_ALARM(val)      bfin_write32(RTC_ALARM, val)
+#define bfin_read_RTC_PREN()           bfin_read16(RTC_PREN)
+#define bfin_write_RTC_PREN(val)       bfin_write16(RTC_PREN, val)
+#define bfin_read_UART0_THR()          bfin_read16(UART0_THR)
+#define bfin_write_UART0_THR(val)      bfin_write16(UART0_THR, val)
+#define bfin_read_UART0_RBR()          bfin_read16(UART0_RBR)
+#define bfin_write_UART0_RBR(val)      bfin_write16(UART0_RBR, val)
+#define bfin_read_UART0_DLL()          bfin_read16(UART0_DLL)
+#define bfin_write_UART0_DLL(val)      bfin_write16(UART0_DLL, val)
+#define bfin_read_UART0_IER()          bfin_read16(UART0_IER)
+#define bfin_write_UART0_IER(val)      bfin_write16(UART0_IER, val)
+#define bfin_read_UART0_DLH()          bfin_read16(UART0_DLH)
+#define bfin_write_UART0_DLH(val)      bfin_write16(UART0_DLH, val)
+#define bfin_read_UART0_IIR()          bfin_read16(UART0_IIR)
+#define bfin_write_UART0_IIR(val)      bfin_write16(UART0_IIR, val)
+#define bfin_read_UART0_LCR()          bfin_read16(UART0_LCR)
+#define bfin_write_UART0_LCR(val)      bfin_write16(UART0_LCR, val)
+#define bfin_read_UART0_MCR()          bfin_read16(UART0_MCR)
+#define bfin_write_UART0_MCR(val)      bfin_write16(UART0_MCR, val)
+#define bfin_read_UART0_LSR()          bfin_read16(UART0_LSR)
+#define bfin_write_UART0_LSR(val)      bfin_write16(UART0_LSR, val)
+#define bfin_read_UART0_MSR()          bfin_read16(UART0_MSR)
+#define bfin_write_UART0_MSR(val)      bfin_write16(UART0_MSR, val)
+#define bfin_read_UART0_SCR()          bfin_read16(UART0_SCR)
+#define bfin_write_UART0_SCR(val)      bfin_write16(UART0_SCR, val)
+#define bfin_read_UART0_GCTL()         bfin_read16(UART0_GCTL)
+#define bfin_write_UART0_GCTL(val)     bfin_write16(UART0_GCTL, val)
+#define bfin_read_SPI_CTL()            bfin_read16(SPI_CTL)
+#define bfin_write_SPI_CTL(val)        bfin_write16(SPI_CTL, val)
+#define bfin_read_SPI_FLG()            bfin_read16(SPI_FLG)
+#define bfin_write_SPI_FLG(val)        bfin_write16(SPI_FLG, val)
+#define bfin_read_SPI_STAT()           bfin_read16(SPI_STAT)
+#define bfin_write_SPI_STAT(val)       bfin_write16(SPI_STAT, val)
+#define bfin_read_SPI_TDBR()           bfin_read16(SPI_TDBR)
+#define bfin_write_SPI_TDBR(val)       bfin_write16(SPI_TDBR, val)
+#define bfin_read_SPI_RDBR()           bfin_read16(SPI_RDBR)
+#define bfin_write_SPI_RDBR(val)       bfin_write16(SPI_RDBR, val)
+#define bfin_read_SPI_BAUD()           bfin_read16(SPI_BAUD)
+#define bfin_write_SPI_BAUD(val)       bfin_write16(SPI_BAUD, val)
+#define bfin_read_SPI_SHADOW()         bfin_read16(SPI_SHADOW)
+#define bfin_write_SPI_SHADOW(val)     bfin_write16(SPI_SHADOW, val)
+#define bfin_read_TIMER0_CONFIG()      bfin_read16(TIMER0_CONFIG)
+#define bfin_write_TIMER0_CONFIG(val)  bfin_write16(TIMER0_CONFIG, val)
+#define bfin_read_TIMER0_COUNTER()     bfin_read32(TIMER0_COUNTER)
+#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
+#define bfin_read_TIMER0_PERIOD()      bfin_read32(TIMER0_PERIOD)
+#define bfin_write_TIMER0_PERIOD(val)  bfin_write32(TIMER0_PERIOD, val)
+#define bfin_read_TIMER0_WIDTH()       bfin_read32(TIMER0_WIDTH)
+#define bfin_write_TIMER0_WIDTH(val)   bfin_write32(TIMER0_WIDTH, val)
+#define bfin_read_TIMER1_CONFIG()      bfin_read16(TIMER1_CONFIG)
+#define bfin_write_TIMER1_CONFIG(val)  bfin_write16(TIMER1_CONFIG, val)
+#define bfin_read_TIMER1_COUNTER()     bfin_read32(TIMER1_COUNTER)
+#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
+#define bfin_read_TIMER1_PERIOD()      bfin_read32(TIMER1_PERIOD)
+#define bfin_write_TIMER1_PERIOD(val)  bfin_write32(TIMER1_PERIOD, val)
+#define bfin_read_TIMER1_WIDTH()       bfin_read32(TIMER1_WIDTH)
+#define bfin_write_TIMER1_WIDTH(val)   bfin_write32(TIMER1_WIDTH, val)
+#define bfin_read_TIMER2_CONFIG()      bfin_read16(TIMER2_CONFIG)
+#define bfin_write_TIMER2_CONFIG(val)  bfin_write16(TIMER2_CONFIG, val)
+#define bfin_read_TIMER2_COUNTER()     bfin_read32(TIMER2_COUNTER)
+#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
+#define bfin_read_TIMER2_PERIOD()      bfin_read32(TIMER2_PERIOD)
+#define bfin_write_TIMER2_PERIOD(val)  bfin_write32(TIMER2_PERIOD, val)
+#define bfin_read_TIMER2_WIDTH()       bfin_read32(TIMER2_WIDTH)
+#define bfin_write_TIMER2_WIDTH(val)   bfin_write32(TIMER2_WIDTH, val)
+#define bfin_read_TIMER3_CONFIG()      bfin_read16(TIMER3_CONFIG)
+#define bfin_write_TIMER3_CONFIG(val)  bfin_write16(TIMER3_CONFIG, val)
+#define bfin_read_TIMER3_COUNTER()     bfin_read32(TIMER3_COUNTER)
+#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER, val)
+#define bfin_read_TIMER3_PERIOD()      bfin_read32(TIMER3_PERIOD)
+#define bfin_write_TIMER3_PERIOD(val)  bfin_write32(TIMER3_PERIOD, val)
+#define bfin_read_TIMER3_WIDTH()       bfin_read32(TIMER3_WIDTH)
+#define bfin_write_TIMER3_WIDTH(val)   bfin_write32(TIMER3_WIDTH, val)
+#define bfin_read_TIMER4_CONFIG()      bfin_read16(TIMER4_CONFIG)
+#define bfin_write_TIMER4_CONFIG(val)  bfin_write16(TIMER4_CONFIG, val)
+#define bfin_read_TIMER4_COUNTER()     bfin_read32(TIMER4_COUNTER)
+#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER, val)
+#define bfin_read_TIMER4_PERIOD()      bfin_read32(TIMER4_PERIOD)
+#define bfin_write_TIMER4_PERIOD(val)  bfin_write32(TIMER4_PERIOD, val)
+#define bfin_read_TIMER4_WIDTH()       bfin_read32(TIMER4_WIDTH)
+#define bfin_write_TIMER4_WIDTH(val)   bfin_write32(TIMER4_WIDTH, val)
+#define bfin_read_TIMER5_CONFIG()      bfin_read16(TIMER5_CONFIG)
+#define bfin_write_TIMER5_CONFIG(val)  bfin_write16(TIMER5_CONFIG, val)
+#define bfin_read_TIMER5_COUNTER()     bfin_read32(TIMER5_COUNTER)
+#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER, val)
+#define bfin_read_TIMER5_PERIOD()      bfin_read32(TIMER5_PERIOD)
+#define bfin_write_TIMER5_PERIOD(val)  bfin_write32(TIMER5_PERIOD, val)
+#define bfin_read_TIMER5_WIDTH()       bfin_read32(TIMER5_WIDTH)
+#define bfin_write_TIMER5_WIDTH(val)   bfin_write32(TIMER5_WIDTH, val)
+#define bfin_read_TIMER6_CONFIG()      bfin_read16(TIMER6_CONFIG)
+#define bfin_write_TIMER6_CONFIG(val)  bfin_write16(TIMER6_CONFIG, val)
+#define bfin_read_TIMER6_COUNTER()     bfin_read32(TIMER6_COUNTER)
+#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER, val)
+#define bfin_read_TIMER6_PERIOD()      bfin_read32(TIMER6_PERIOD)
+#define bfin_write_TIMER6_PERIOD(val)  bfin_write32(TIMER6_PERIOD, val)
+#define bfin_read_TIMER6_WIDTH()       bfin_read32(TIMER6_WIDTH)
+#define bfin_write_TIMER6_WIDTH(val)   bfin_write32(TIMER6_WIDTH, val)
+#define bfin_read_TIMER7_CONFIG()      bfin_read16(TIMER7_CONFIG)
+#define bfin_write_TIMER7_CONFIG(val)  bfin_write16(TIMER7_CONFIG, val)
+#define bfin_read_TIMER7_COUNTER()     bfin_read32(TIMER7_COUNTER)
+#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER, val)
+#define bfin_read_TIMER7_PERIOD()      bfin_read32(TIMER7_PERIOD)
+#define bfin_write_TIMER7_PERIOD(val)  bfin_write32(TIMER7_PERIOD, val)
+#define bfin_read_TIMER7_WIDTH()       bfin_read32(TIMER7_WIDTH)
+#define bfin_write_TIMER7_WIDTH(val)   bfin_write32(TIMER7_WIDTH, val)
+#define bfin_read_TIMER_ENABLE()       bfin_read16(TIMER_ENABLE)
+#define bfin_write_TIMER_ENABLE(val)   bfin_write16(TIMER_ENABLE, val)
+#define bfin_read_TIMER_DISABLE()      bfin_read16(TIMER_DISABLE)
+#define bfin_write_TIMER_DISABLE(val)  bfin_write16(TIMER_DISABLE, val)
+#define bfin_read_TIMER_STATUS()       bfin_read32(TIMER_STATUS)
+#define bfin_write_TIMER_STATUS(val)   bfin_write32(TIMER_STATUS, val)
+#define bfin_read_PORTFIO()            bfin_read16(PORTFIO)
+#define bfin_write_PORTFIO(val)        bfin_write16(PORTFIO, val)
+#define bfin_read_PORTFIO_CLEAR()      bfin_read16(PORTFIO_CLEAR)
+#define bfin_write_PORTFIO_CLEAR(val)  bfin_write16(PORTFIO_CLEAR, val)
+#define bfin_read_PORTFIO_SET()        bfin_read16(PORTFIO_SET)
+#define bfin_write_PORTFIO_SET(val)    bfin_write16(PORTFIO_SET, val)
+#define bfin_read_PORTFIO_TOGGLE()     bfin_read16(PORTFIO_TOGGLE)
+#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE, val)
+#define bfin_read_PORTFIO_MASKA()      bfin_read16(PORTFIO_MASKA)
+#define bfin_write_PORTFIO_MASKA(val)  bfin_write16(PORTFIO_MASKA, val)
+#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
+#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR, val)
+#define bfin_read_PORTFIO_MASKA_SET()  bfin_read16(PORTFIO_MASKA_SET)
+#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET, val)
+#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
+#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE, val)
+#define bfin_read_PORTFIO_MASKB()      bfin_read16(PORTFIO_MASKB)
+#define bfin_write_PORTFIO_MASKB(val)  bfin_write16(PORTFIO_MASKB, val)
+#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
+#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR, val)
+#define bfin_read_PORTFIO_MASKB_SET()  bfin_read16(PORTFIO_MASKB_SET)
+#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET, val)
+#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
+#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE, val)
+#define bfin_read_PORTFIO_DIR()        bfin_read16(PORTFIO_DIR)
+#define bfin_write_PORTFIO_DIR(val)    bfin_write16(PORTFIO_DIR, val)
+#define bfin_read_PORTFIO_POLAR()      bfin_read16(PORTFIO_POLAR)
+#define bfin_write_PORTFIO_POLAR(val)  bfin_write16(PORTFIO_POLAR, val)
+#define bfin_read_PORTFIO_EDGE()       bfin_read16(PORTFIO_EDGE)
+#define bfin_write_PORTFIO_EDGE(val)   bfin_write16(PORTFIO_EDGE, val)
+#define bfin_read_PORTFIO_BOTH()       bfin_read16(PORTFIO_BOTH)
+#define bfin_write_PORTFIO_BOTH(val)   bfin_write16(PORTFIO_BOTH, val)
+#define bfin_read_PORTFIO_INEN()       bfin_read16(PORTFIO_INEN)
+#define bfin_write_PORTFIO_INEN(val)   bfin_write16(PORTFIO_INEN, val)
+#define bfin_read_SPORT0_TCR1()        bfin_read16(SPORT0_TCR1)
+#define bfin_write_SPORT0_TCR1(val)    bfin_write16(SPORT0_TCR1, val)
+#define bfin_read_SPORT0_TCR2()        bfin_read16(SPORT0_TCR2)
+#define bfin_write_SPORT0_TCR2(val)    bfin_write16(SPORT0_TCR2, val)
+#define bfin_read_SPORT0_TCLKDIV()     bfin_read16(SPORT0_TCLKDIV)
+#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
+#define bfin_read_SPORT0_TFSDIV()      bfin_read16(SPORT0_TFSDIV)
+#define bfin_write_SPORT0_TFSDIV(val)  bfin_write16(SPORT0_TFSDIV, val)
+#define bfin_write_SPORT0_TX(val)      bfin_write32(SPORT0_TX, val)
+#define bfin_read_SPORT0_RX()          bfin_read32(SPORT0_RX)
+#define bfin_write_SPORT0_RX(val)      bfin_write32(SPORT0_RX, val)
+#define bfin_read_SPORT0_RCR1()        bfin_read16(SPORT0_RCR1)
+#define bfin_write_SPORT0_RCR1(val)    bfin_write16(SPORT0_RCR1, val)
+#define bfin_read_SPORT0_RCR2()        bfin_read16(SPORT0_RCR2)
+#define bfin_write_SPORT0_RCR2(val)    bfin_write16(SPORT0_RCR2, val)
+#define bfin_read_SPORT0_RCLKDIV()     bfin_read16(SPORT0_RCLKDIV)
+#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
+#define bfin_read_SPORT0_RFSDIV()      bfin_read16(SPORT0_RFSDIV)
+#define bfin_write_SPORT0_RFSDIV(val)  bfin_write16(SPORT0_RFSDIV, val)
+#define bfin_read_SPORT0_STAT()        bfin_read16(SPORT0_STAT)
+#define bfin_write_SPORT0_STAT(val)    bfin_write16(SPORT0_STAT, val)
+#define bfin_read_SPORT0_CHNL()        bfin_read16(SPORT0_CHNL)
+#define bfin_write_SPORT0_CHNL(val)    bfin_write16(SPORT0_CHNL, val)
+#define bfin_read_SPORT0_MCMC1()       bfin_read16(SPORT0_MCMC1)
+#define bfin_write_SPORT0_MCMC1(val)   bfin_write16(SPORT0_MCMC1, val)
+#define bfin_read_SPORT0_MCMC2()       bfin_read16(SPORT0_MCMC2)
+#define bfin_write_SPORT0_MCMC2(val)   bfin_write16(SPORT0_MCMC2, val)
+#define bfin_read_SPORT0_MTCS0()       bfin_read32(SPORT0_MTCS0)
+#define bfin_write_SPORT0_MTCS0(val)   bfin_write32(SPORT0_MTCS0, val)
+#define bfin_read_SPORT0_MTCS1()       bfin_read32(SPORT0_MTCS1)
+#define bfin_write_SPORT0_MTCS1(val)   bfin_write32(SPORT0_MTCS1, val)
+#define bfin_read_SPORT0_MTCS2()       bfin_read32(SPORT0_MTCS2)
+#define bfin_write_SPORT0_MTCS2(val)   bfin_write32(SPORT0_MTCS2, val)
+#define bfin_read_SPORT0_MTCS3()       bfin_read32(SPORT0_MTCS3)
+#define bfin_write_SPORT0_MTCS3(val)   bfin_write32(SPORT0_MTCS3, val)
+#define bfin_read_SPORT0_MRCS0()       bfin_read32(SPORT0_MRCS0)
+#define bfin_write_SPORT0_MRCS0(val)   bfin_write32(SPORT0_MRCS0, val)
+#define bfin_read_SPORT0_MRCS1()       bfin_read32(SPORT0_MRCS1)
+#define bfin_write_SPORT0_MRCS1(val)   bfin_write32(SPORT0_MRCS1, val)
+#define bfin_read_SPORT0_MRCS2()       bfin_read32(SPORT0_MRCS2)
+#define bfin_write_SPORT0_MRCS2(val)   bfin_write32(SPORT0_MRCS2, val)
+#define bfin_read_SPORT0_MRCS3()       bfin_read32(SPORT0_MRCS3)
+#define bfin_write_SPORT0_MRCS3(val)   bfin_write32(SPORT0_MRCS3, val)
+#define bfin_read_SPORT1_TCR1()        bfin_read16(SPORT1_TCR1)
+#define bfin_write_SPORT1_TCR1(val)    bfin_write16(SPORT1_TCR1, val)
+#define bfin_read_SPORT1_TCR2()        bfin_read16(SPORT1_TCR2)
+#define bfin_write_SPORT1_TCR2(val)    bfin_write16(SPORT1_TCR2, val)
+#define bfin_read_SPORT1_TCLKDIV()     bfin_read16(SPORT1_TCLKDIV)
+#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
+#define bfin_read_SPORT1_TFSDIV()      bfin_read16(SPORT1_TFSDIV)
+#define bfin_write_SPORT1_TFSDIV(val)  bfin_write16(SPORT1_TFSDIV, val)
+#define bfin_write_SPORT1_TX(val)      bfin_write32(SPORT1_TX, val)
+#define bfin_read_SPORT1_RX()          bfin_read32(SPORT1_RX)
+#define bfin_write_SPORT1_RX(val)      bfin_write32(SPORT1_RX, val)
+#define bfin_read_SPORT1_RCR1()        bfin_read16(SPORT1_RCR1)
+#define bfin_write_SPORT1_RCR1(val)    bfin_write16(SPORT1_RCR1, val)
+#define bfin_read_SPORT1_RCR2()        bfin_read16(SPORT1_RCR2)
+#define bfin_write_SPORT1_RCR2(val)    bfin_write16(SPORT1_RCR2, val)
+#define bfin_read_SPORT1_RCLKDIV()     bfin_read16(SPORT1_RCLKDIV)
+#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
+#define bfin_read_SPORT1_RFSDIV()      bfin_read16(SPORT1_RFSDIV)
+#define bfin_write_SPORT1_RFSDIV(val)  bfin_write16(SPORT1_RFSDIV, val)
+#define bfin_read_SPORT1_STAT()        bfin_read16(SPORT1_STAT)
+#define bfin_write_SPORT1_STAT(val)    bfin_write16(SPORT1_STAT, val)
+#define bfin_read_SPORT1_CHNL()        bfin_read16(SPORT1_CHNL)
+#define bfin_write_SPORT1_CHNL(val)    bfin_write16(SPORT1_CHNL, val)
+#define bfin_read_SPORT1_MCMC1()       bfin_read16(SPORT1_MCMC1)
+#define bfin_write_SPORT1_MCMC1(val)   bfin_write16(SPORT1_MCMC1, val)
+#define bfin_read_SPORT1_MCMC2()       bfin_read16(SPORT1_MCMC2)
+#define bfin_write_SPORT1_MCMC2(val)   bfin_write16(SPORT1_MCMC2, val)
+#define bfin_read_SPORT1_MTCS0()       bfin_read32(SPORT1_MTCS0)
+#define bfin_write_SPORT1_MTCS0(val)   bfin_write32(SPORT1_MTCS0, val)
+#define bfin_read_SPORT1_MTCS1()       bfin_read32(SPORT1_MTCS1)
+#define bfin_write_SPORT1_MTCS1(val)   bfin_write32(SPORT1_MTCS1, val)
+#define bfin_read_SPORT1_MTCS2()       bfin_read32(SPORT1_MTCS2)
+#define bfin_write_SPORT1_MTCS2(val)   bfin_write32(SPORT1_MTCS2, val)
+#define bfin_read_SPORT1_MTCS3()       bfin_read32(SPORT1_MTCS3)
+#define bfin_write_SPORT1_MTCS3(val)   bfin_write32(SPORT1_MTCS3, val)
+#define bfin_read_SPORT1_MRCS0()       bfin_read32(SPORT1_MRCS0)
+#define bfin_write_SPORT1_MRCS0(val)   bfin_write32(SPORT1_MRCS0, val)
+#define bfin_read_SPORT1_MRCS1()       bfin_read32(SPORT1_MRCS1)
+#define bfin_write_SPORT1_MRCS1(val)   bfin_write32(SPORT1_MRCS1, val)
+#define bfin_read_SPORT1_MRCS2()       bfin_read32(SPORT1_MRCS2)
+#define bfin_write_SPORT1_MRCS2(val)   bfin_write32(SPORT1_MRCS2, val)
+#define bfin_read_SPORT1_MRCS3()       bfin_read32(SPORT1_MRCS3)
+#define bfin_write_SPORT1_MRCS3(val)   bfin_write32(SPORT1_MRCS3, val)
+#define bfin_read_EBIU_AMGCTL()        bfin_read16(EBIU_AMGCTL)
+#define bfin_write_EBIU_AMGCTL(val)    bfin_write16(EBIU_AMGCTL, val)
+#define bfin_read_EBIU_AMBCTL0()       bfin_read32(EBIU_AMBCTL0)
+#define bfin_write_EBIU_AMBCTL0(val)   bfin_write32(EBIU_AMBCTL0, val)
+#define bfin_read_EBIU_AMBCTL1()       bfin_read32(EBIU_AMBCTL1)
+#define bfin_write_EBIU_AMBCTL1(val)   bfin_write32(EBIU_AMBCTL1, val)
+#define bfin_read_EBIU_SDGCTL()        bfin_read32(EBIU_SDGCTL)
+#define bfin_write_EBIU_SDGCTL(val)    bfin_write32(EBIU_SDGCTL, val)
+#define bfin_read_EBIU_SDBCTL()        bfin_read16(EBIU_SDBCTL)
+#define bfin_write_EBIU_SDBCTL(val)    bfin_write16(EBIU_SDBCTL, val)
+#define bfin_read_EBIU_SDRRC()         bfin_read16(EBIU_SDRRC)
+#define bfin_write_EBIU_SDRRC(val)     bfin_write16(EBIU_SDRRC, val)
+#define bfin_read_EBIU_SDSTAT()        bfin_read16(EBIU_SDSTAT)
+#define bfin_write_EBIU_SDSTAT(val)    bfin_write16(EBIU_SDSTAT, val)
+#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_readPTR(DMA0_NEXT_DESC_PTR)
+#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_writePTR(DMA0_NEXT_DESC_PTR, val)
+#define bfin_read_DMA0_START_ADDR()    bfin_readPTR(DMA0_START_ADDR)
+#define bfin_write_DMA0_START_ADDR(val) bfin_writePTR(DMA0_START_ADDR, val)
+#define bfin_read_DMA0_CONFIG()        bfin_read16(DMA0_CONFIG)
+#define bfin_write_DMA0_CONFIG(val)    bfin_write16(DMA0_CONFIG, val)
+#define bfin_read_DMA0_X_COUNT()       bfin_read16(DMA0_X_COUNT)
+#define bfin_write_DMA0_X_COUNT(val)   bfin_write16(DMA0_X_COUNT, val)
+#define bfin_read_DMA0_X_MODIFY()      bfin_read16(DMA0_X_MODIFY)
+#define bfin_write_DMA0_X_MODIFY(val)  bfin_write16(DMA0_X_MODIFY, val)
+#define bfin_read_DMA0_Y_COUNT()       bfin_read16(DMA0_Y_COUNT)
+#define bfin_write_DMA0_Y_COUNT(val)   bfin_write16(DMA0_Y_COUNT, val)
+#define bfin_read_DMA0_Y_MODIFY()      bfin_read16(DMA0_Y_MODIFY)
+#define bfin_write_DMA0_Y_MODIFY(val)  bfin_write16(DMA0_Y_MODIFY, val)
+#define bfin_read_DMA0_CURR_DESC_PTR() bfin_readPTR(DMA0_CURR_DESC_PTR)
+#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_writePTR(DMA0_CURR_DESC_PTR, val)
+#define bfin_read_DMA0_CURR_ADDR()     bfin_readPTR(DMA0_CURR_ADDR)
+#define bfin_write_DMA0_CURR_ADDR(val) bfin_writePTR(DMA0_CURR_ADDR, val)
+#define bfin_read_DMA0_IRQ_STATUS()    bfin_read16(DMA0_IRQ_STATUS)
+#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
+#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
+#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
+#define bfin_read_DMA0_CURR_X_COUNT()  bfin_read16(DMA0_CURR_X_COUNT)
+#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
+#define bfin_read_DMA0_CURR_Y_COUNT()  bfin_read16(DMA0_CURR_Y_COUNT)
+#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
+#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_readPTR(DMA1_NEXT_DESC_PTR)
+#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_writePTR(DMA1_NEXT_DESC_PTR, val)
+#define bfin_read_DMA1_START_ADDR()    bfin_readPTR(DMA1_START_ADDR)
+#define bfin_write_DMA1_START_ADDR(val) bfin_writePTR(DMA1_START_ADDR, val)
+#define bfin_read_DMA1_CONFIG()        bfin_read16(DMA1_CONFIG)
+#define bfin_write_DMA1_CONFIG(val)    bfin_write16(DMA1_CONFIG, val)
+#define bfin_read_DMA1_X_COUNT()       bfin_read16(DMA1_X_COUNT)
+#define bfin_write_DMA1_X_COUNT(val)   bfin_write16(DMA1_X_COUNT, val)
+#define bfin_read_DMA1_X_MODIFY()      bfin_read16(DMA1_X_MODIFY)
+#define bfin_write_DMA1_X_MODIFY(val)  bfin_write16(DMA1_X_MODIFY, val)
+#define bfin_read_DMA1_Y_COUNT()       bfin_read16(DMA1_Y_COUNT)
+#define bfin_write_DMA1_Y_COUNT(val)   bfin_write16(DMA1_Y_COUNT, val)
+#define bfin_read_DMA1_Y_MODIFY()      bfin_read16(DMA1_Y_MODIFY)
+#define bfin_write_DMA1_Y_MODIFY(val)  bfin_write16(DMA1_Y_MODIFY, val)
+#define bfin_read_DMA1_CURR_DESC_PTR() bfin_readPTR(DMA1_CURR_DESC_PTR)
+#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_writePTR(DMA1_CURR_DESC_PTR, val)
+#define bfin_read_DMA1_CURR_ADDR()     bfin_readPTR(DMA1_CURR_ADDR)
+#define bfin_write_DMA1_CURR_ADDR(val) bfin_writePTR(DMA1_CURR_ADDR, val)
+#define bfin_read_DMA1_IRQ_STATUS()    bfin_read16(DMA1_IRQ_STATUS)
+#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
+#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
+#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
+#define bfin_read_DMA1_CURR_X_COUNT()  bfin_read16(DMA1_CURR_X_COUNT)
+#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
+#define bfin_read_DMA1_CURR_Y_COUNT()  bfin_read16(DMA1_CURR_Y_COUNT)
+#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
+#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_readPTR(DMA2_NEXT_DESC_PTR)
+#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_writePTR(DMA2_NEXT_DESC_PTR, val)
+#define bfin_read_DMA2_START_ADDR()    bfin_readPTR(DMA2_START_ADDR)
+#define bfin_write_DMA2_START_ADDR(val) bfin_writePTR(DMA2_START_ADDR, val)
+#define bfin_read_DMA2_CONFIG()        bfin_read16(DMA2_CONFIG)
+#define bfin_write_DMA2_CONFIG(val)    bfin_write16(DMA2_CONFIG, val)
+#define bfin_read_DMA2_X_COUNT()       bfin_read16(DMA2_X_COUNT)
+#define bfin_write_DMA2_X_COUNT(val)   bfin_write16(DMA2_X_COUNT, val)
+#define bfin_read_DMA2_X_MODIFY()      bfin_read16(DMA2_X_MODIFY)
+#define bfin_write_DMA2_X_MODIFY(val)  bfin_write16(DMA2_X_MODIFY, val)
+#define bfin_read_DMA2_Y_COUNT()       bfin_read16(DMA2_Y_COUNT)
+#define bfin_write_DMA2_Y_COUNT(val)   bfin_write16(DMA2_Y_COUNT, val)
+#define bfin_read_DMA2_Y_MODIFY()      bfin_read16(DMA2_Y_MODIFY)
+#define bfin_write_DMA2_Y_MODIFY(val)  bfin_write16(DMA2_Y_MODIFY, val)
+#define bfin_read_DMA2_CURR_DESC_PTR() bfin_readPTR(DMA2_CURR_DESC_PTR)
+#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_writePTR(DMA2_CURR_DESC_PTR, val)
+#define bfin_read_DMA2_CURR_ADDR()     bfin_readPTR(DMA2_CURR_ADDR)
+#define bfin_write_DMA2_CURR_ADDR(val) bfin_writePTR(DMA2_CURR_ADDR, val)
+#define bfin_read_DMA2_IRQ_STATUS()    bfin_read16(DMA2_IRQ_STATUS)
+#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
+#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
+#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
+#define bfin_read_DMA2_CURR_X_COUNT()  bfin_read16(DMA2_CURR_X_COUNT)
+#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
+#define bfin_read_DMA2_CURR_Y_COUNT()  bfin_read16(DMA2_CURR_Y_COUNT)
+#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
+#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_readPTR(DMA3_NEXT_DESC_PTR)
+#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_writePTR(DMA3_NEXT_DESC_PTR, val)
+#define bfin_read_DMA3_START_ADDR()    bfin_readPTR(DMA3_START_ADDR)
+#define bfin_write_DMA3_START_ADDR(val) bfin_writePTR(DMA3_START_ADDR, val)
+#define bfin_read_DMA3_CONFIG()        bfin_read16(DMA3_CONFIG)
+#define bfin_write_DMA3_CONFIG(val)    bfin_write16(DMA3_CONFIG, val)
+#define bfin_read_DMA3_X_COUNT()       bfin_read16(DMA3_X_COUNT)
+#define bfin_write_DMA3_X_COUNT(val)   bfin_write16(DMA3_X_COUNT, val)
+#define bfin_read_DMA3_X_MODIFY()      bfin_read16(DMA3_X_MODIFY)
+#define bfin_write_DMA3_X_MODIFY(val)  bfin_write16(DMA3_X_MODIFY, val)
+#define bfin_read_DMA3_Y_COUNT()       bfin_read16(DMA3_Y_COUNT)
+#define bfin_write_DMA3_Y_COUNT(val)   bfin_write16(DMA3_Y_COUNT, val)
+#define bfin_read_DMA3_Y_MODIFY()      bfin_read16(DMA3_Y_MODIFY)
+#define bfin_write_DMA3_Y_MODIFY(val)  bfin_write16(DMA3_Y_MODIFY, val)
+#define bfin_read_DMA3_CURR_DESC_PTR() bfin_readPTR(DMA3_CURR_DESC_PTR)
+#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_writePTR(DMA3_CURR_DESC_PTR, val)
+#define bfin_read_DMA3_CURR_ADDR()     bfin_readPTR(DMA3_CURR_ADDR)
+#define bfin_write_DMA3_CURR_ADDR(val) bfin_writePTR(DMA3_CURR_ADDR, val)
+#define bfin_read_DMA3_IRQ_STATUS()    bfin_read16(DMA3_IRQ_STATUS)
+#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
+#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
+#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
+#define bfin_read_DMA3_CURR_X_COUNT()  bfin_read16(DMA3_CURR_X_COUNT)
+#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
+#define bfin_read_DMA3_CURR_Y_COUNT()  bfin_read16(DMA3_CURR_Y_COUNT)
+#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
+#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_readPTR(DMA4_NEXT_DESC_PTR)
+#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_writePTR(DMA4_NEXT_DESC_PTR, val)
+#define bfin_read_DMA4_START_ADDR()    bfin_readPTR(DMA4_START_ADDR)
+#define bfin_write_DMA4_START_ADDR(val) bfin_writePTR(DMA4_START_ADDR, val)
+#define bfin_read_DMA4_CONFIG()        bfin_read16(DMA4_CONFIG)
+#define bfin_write_DMA4_CONFIG(val)    bfin_write16(DMA4_CONFIG, val)
+#define bfin_read_DMA4_X_COUNT()       bfin_read16(DMA4_X_COUNT)
+#define bfin_write_DMA4_X_COUNT(val)   bfin_write16(DMA4_X_COUNT, val)
+#define bfin_read_DMA4_X_MODIFY()      bfin_read16(DMA4_X_MODIFY)
+#define bfin_write_DMA4_X_MODIFY(val)  bfin_write16(DMA4_X_MODIFY, val)
+#define bfin_read_DMA4_Y_COUNT()       bfin_read16(DMA4_Y_COUNT)
+#define bfin_write_DMA4_Y_COUNT(val)   bfin_write16(DMA4_Y_COUNT, val)
+#define bfin_read_DMA4_Y_MODIFY()      bfin_read16(DMA4_Y_MODIFY)
+#define bfin_write_DMA4_Y_MODIFY(val)  bfin_write16(DMA4_Y_MODIFY, val)
+#define bfin_read_DMA4_CURR_DESC_PTR() bfin_readPTR(DMA4_CURR_DESC_PTR)
+#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_writePTR(DMA4_CURR_DESC_PTR, val)
+#define bfin_read_DMA4_CURR_ADDR()     bfin_readPTR(DMA4_CURR_ADDR)
+#define bfin_write_DMA4_CURR_ADDR(val) bfin_writePTR(DMA4_CURR_ADDR, val)
+#define bfin_read_DMA4_IRQ_STATUS()    bfin_read16(DMA4_IRQ_STATUS)
+#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
+#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
+#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
+#define bfin_read_DMA4_CURR_X_COUNT()  bfin_read16(DMA4_CURR_X_COUNT)
+#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
+#define bfin_read_DMA4_CURR_Y_COUNT()  bfin_read16(DMA4_CURR_Y_COUNT)
+#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
+#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_readPTR(DMA5_NEXT_DESC_PTR)
+#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_writePTR(DMA5_NEXT_DESC_PTR, val)
+#define bfin_read_DMA5_START_ADDR()    bfin_readPTR(DMA5_START_ADDR)
+#define bfin_write_DMA5_START_ADDR(val) bfin_writePTR(DMA5_START_ADDR, val)
+#define bfin_read_DMA5_CONFIG()        bfin_read16(DMA5_CONFIG)
+#define bfin_write_DMA5_CONFIG(val)    bfin_write16(DMA5_CONFIG, val)
+#define bfin_read_DMA5_X_COUNT()       bfin_read16(DMA5_X_COUNT)
+#define bfin_write_DMA5_X_COUNT(val)   bfin_write16(DMA5_X_COUNT, val)
+#define bfin_read_DMA5_X_MODIFY()      bfin_read16(DMA5_X_MODIFY)
+#define bfin_write_DMA5_X_MODIFY(val)  bfin_write16(DMA5_X_MODIFY, val)
+#define bfin_read_DMA5_Y_COUNT()       bfin_read16(DMA5_Y_COUNT)
+#define bfin_write_DMA5_Y_COUNT(val)   bfin_write16(DMA5_Y_COUNT, val)
+#define bfin_read_DMA5_Y_MODIFY()      bfin_read16(DMA5_Y_MODIFY)
+#define bfin_write_DMA5_Y_MODIFY(val)  bfin_write16(DMA5_Y_MODIFY, val)
+#define bfin_read_DMA5_CURR_DESC_PTR() bfin_readPTR(DMA5_CURR_DESC_PTR)
+#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_writePTR(DMA5_CURR_DESC_PTR, val)
+#define bfin_read_DMA5_CURR_ADDR()     bfin_readPTR(DMA5_CURR_ADDR)
+#define bfin_write_DMA5_CURR_ADDR(val) bfin_writePTR(DMA5_CURR_ADDR, val)
+#define bfin_read_DMA5_IRQ_STATUS()    bfin_read16(DMA5_IRQ_STATUS)
+#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
+#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
+#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
+#define bfin_read_DMA5_CURR_X_COUNT()  bfin_read16(DMA5_CURR_X_COUNT)
+#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
+#define bfin_read_DMA5_CURR_Y_COUNT()  bfin_read16(DMA5_CURR_Y_COUNT)
+#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
+#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
+#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR, val)
+#define bfin_read_DMA6_START_ADDR()    bfin_readPTR(DMA6_START_ADDR)
+#define bfin_write_DMA6_START_ADDR(val) bfin_writePTR(DMA6_START_ADDR, val)
+#define bfin_read_DMA6_CONFIG()        bfin_read16(DMA6_CONFIG)
+#define bfin_write_DMA6_CONFIG(val)    bfin_write16(DMA6_CONFIG, val)
+#define bfin_read_DMA6_X_COUNT()       bfin_read16(DMA6_X_COUNT)
+#define bfin_write_DMA6_X_COUNT(val)   bfin_write16(DMA6_X_COUNT, val)
+#define bfin_read_DMA6_X_MODIFY()      bfin_read16(DMA6_X_MODIFY)
+#define bfin_write_DMA6_X_MODIFY(val)  bfin_write16(DMA6_X_MODIFY, val)
+#define bfin_read_DMA6_Y_COUNT()       bfin_read16(DMA6_Y_COUNT)
+#define bfin_write_DMA6_Y_COUNT(val)   bfin_write16(DMA6_Y_COUNT, val)
+#define bfin_read_DMA6_Y_MODIFY()      bfin_read16(DMA6_Y_MODIFY)
+#define bfin_write_DMA6_Y_MODIFY(val)  bfin_write16(DMA6_Y_MODIFY, val)
+#define bfin_read_DMA6_CURR_DESC_PTR() bfin_readPTR(DMA6_CURR_DESC_PTR)
+#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_writePTR(DMA6_CURR_DESC_PTR, val)
+#define bfin_read_DMA6_CURR_ADDR()     bfin_readPTR(DMA6_CURR_ADDR)
+#define bfin_write_DMA6_CURR_ADDR(val) bfin_writePTR(DMA6_CURR_ADDR, val)
+#define bfin_read_DMA6_IRQ_STATUS()    bfin_read16(DMA6_IRQ_STATUS)
+#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
+#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
+#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
+#define bfin_read_DMA6_CURR_X_COUNT()  bfin_read16(DMA6_CURR_X_COUNT)
+#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
+#define bfin_read_DMA6_CURR_Y_COUNT()  bfin_read16(DMA6_CURR_Y_COUNT)
+#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
+#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_readPTR(DMA7_NEXT_DESC_PTR)
+#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_writePTR(DMA7_NEXT_DESC_PTR, val)
+#define bfin_read_DMA7_START_ADDR()    bfin_readPTR(DMA7_START_ADDR)
+#define bfin_write_DMA7_START_ADDR(val) bfin_writePTR(DMA7_START_ADDR, val)
+#define bfin_read_DMA7_CONFIG()        bfin_read16(DMA7_CONFIG)
+#define bfin_write_DMA7_CONFIG(val)    bfin_write16(DMA7_CONFIG, val)
+#define bfin_read_DMA7_X_COUNT()       bfin_read16(DMA7_X_COUNT)
+#define bfin_write_DMA7_X_COUNT(val)   bfin_write16(DMA7_X_COUNT, val)
+#define bfin_read_DMA7_X_MODIFY()      bfin_read16(DMA7_X_MODIFY)
+#define bfin_write_DMA7_X_MODIFY(val)  bfin_write16(DMA7_X_MODIFY, val)
+#define bfin_read_DMA7_Y_COUNT()       bfin_read16(DMA7_Y_COUNT)
+#define bfin_write_DMA7_Y_COUNT(val)   bfin_write16(DMA7_Y_COUNT, val)
+#define bfin_read_DMA7_Y_MODIFY()      bfin_read16(DMA7_Y_MODIFY)
+#define bfin_write_DMA7_Y_MODIFY(val)  bfin_write16(DMA7_Y_MODIFY, val)
+#define bfin_read_DMA7_CURR_DESC_PTR() bfin_readPTR(DMA7_CURR_DESC_PTR)
+#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_writePTR(DMA7_CURR_DESC_PTR, val)
+#define bfin_read_DMA7_CURR_ADDR()     bfin_readPTR(DMA7_CURR_ADDR)
+#define bfin_write_DMA7_CURR_ADDR(val) bfin_writePTR(DMA7_CURR_ADDR, val)
+#define bfin_read_DMA7_IRQ_STATUS()    bfin_read16(DMA7_IRQ_STATUS)
+#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
+#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
+#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
+#define bfin_read_DMA7_CURR_X_COUNT()  bfin_read16(DMA7_CURR_X_COUNT)
+#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
+#define bfin_read_DMA7_CURR_Y_COUNT()  bfin_read16(DMA7_CURR_Y_COUNT)
+#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
+#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_readPTR(DMA8_NEXT_DESC_PTR)
+#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_writePTR(DMA8_NEXT_DESC_PTR, val)
+#define bfin_read_DMA8_START_ADDR()    bfin_readPTR(DMA8_START_ADDR)
+#define bfin_write_DMA8_START_ADDR(val) bfin_writePTR(DMA8_START_ADDR, val)
+#define bfin_read_DMA8_CONFIG()        bfin_read16(DMA8_CONFIG)
+#define bfin_write_DMA8_CONFIG(val)    bfin_write16(DMA8_CONFIG, val)
+#define bfin_read_DMA8_X_COUNT()       bfin_read16(DMA8_X_COUNT)
+#define bfin_write_DMA8_X_COUNT(val)   bfin_write16(DMA8_X_COUNT, val)
+#define bfin_read_DMA8_X_MODIFY()      bfin_read16(DMA8_X_MODIFY)
+#define bfin_write_DMA8_X_MODIFY(val)  bfin_write16(DMA8_X_MODIFY, val)
+#define bfin_read_DMA8_Y_COUNT()       bfin_read16(DMA8_Y_COUNT)
+#define bfin_write_DMA8_Y_COUNT(val)   bfin_write16(DMA8_Y_COUNT, val)
+#define bfin_read_DMA8_Y_MODIFY()      bfin_read16(DMA8_Y_MODIFY)
+#define bfin_write_DMA8_Y_MODIFY(val)  bfin_write16(DMA8_Y_MODIFY, val)
+#define bfin_read_DMA8_CURR_DESC_PTR() bfin_readPTR(DMA8_CURR_DESC_PTR)
+#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_writePTR(DMA8_CURR_DESC_PTR, val)
+#define bfin_read_DMA8_CURR_ADDR()     bfin_readPTR(DMA8_CURR_ADDR)
+#define bfin_write_DMA8_CURR_ADDR(val) bfin_writePTR(DMA8_CURR_ADDR, val)
+#define bfin_read_DMA8_IRQ_STATUS()    bfin_read16(DMA8_IRQ_STATUS)
+#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
+#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
+#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
+#define bfin_read_DMA8_CURR_X_COUNT()  bfin_read16(DMA8_CURR_X_COUNT)
+#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
+#define bfin_read_DMA8_CURR_Y_COUNT()  bfin_read16(DMA8_CURR_Y_COUNT)
+#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
+#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_readPTR(DMA9_NEXT_DESC_PTR)
+#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_writePTR(DMA9_NEXT_DESC_PTR, val)
+#define bfin_read_DMA9_START_ADDR()    bfin_readPTR(DMA9_START_ADDR)
+#define bfin_write_DMA9_START_ADDR(val) bfin_writePTR(DMA9_START_ADDR, val)
+#define bfin_read_DMA9_CONFIG()        bfin_read16(DMA9_CONFIG)
+#define bfin_write_DMA9_CONFIG(val)    bfin_write16(DMA9_CONFIG, val)
+#define bfin_read_DMA9_X_COUNT()       bfin_read16(DMA9_X_COUNT)
+#define bfin_write_DMA9_X_COUNT(val)   bfin_write16(DMA9_X_COUNT, val)
+#define bfin_read_DMA9_X_MODIFY()      bfin_read16(DMA9_X_MODIFY)
+#define bfin_write_DMA9_X_MODIFY(val)  bfin_write16(DMA9_X_MODIFY, val)
+#define bfin_read_DMA9_Y_COUNT()       bfin_read16(DMA9_Y_COUNT)
+#define bfin_write_DMA9_Y_COUNT(val)   bfin_write16(DMA9_Y_COUNT, val)
+#define bfin_read_DMA9_Y_MODIFY()      bfin_read16(DMA9_Y_MODIFY)
+#define bfin_write_DMA9_Y_MODIFY(val)  bfin_write16(DMA9_Y_MODIFY, val)
+#define bfin_read_DMA9_CURR_DESC_PTR() bfin_readPTR(DMA9_CURR_DESC_PTR)
+#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_writePTR(DMA9_CURR_DESC_PTR, val)
+#define bfin_read_DMA9_CURR_ADDR()     bfin_readPTR(DMA9_CURR_ADDR)
+#define bfin_write_DMA9_CURR_ADDR(val) bfin_writePTR(DMA9_CURR_ADDR, val)
+#define bfin_read_DMA9_IRQ_STATUS()    bfin_read16(DMA9_IRQ_STATUS)
+#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
+#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
+#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
+#define bfin_read_DMA9_CURR_X_COUNT()  bfin_read16(DMA9_CURR_X_COUNT)
+#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
+#define bfin_read_DMA9_CURR_Y_COUNT()  bfin_read16(DMA9_CURR_Y_COUNT)
+#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
+#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_readPTR(DMA10_NEXT_DESC_PTR)
+#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_writePTR(DMA10_NEXT_DESC_PTR, val)
+#define bfin_read_DMA10_START_ADDR()   bfin_readPTR(DMA10_START_ADDR)
+#define bfin_write_DMA10_START_ADDR(val) bfin_writePTR(DMA10_START_ADDR, val)
+#define bfin_read_DMA10_CONFIG()       bfin_read16(DMA10_CONFIG)
+#define bfin_write_DMA10_CONFIG(val)   bfin_write16(DMA10_CONFIG, val)
+#define bfin_read_DMA10_X_COUNT()      bfin_read16(DMA10_X_COUNT)
+#define bfin_write_DMA10_X_COUNT(val)  bfin_write16(DMA10_X_COUNT, val)
+#define bfin_read_DMA10_X_MODIFY()     bfin_read16(DMA10_X_MODIFY)
+#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY, val)
+#define bfin_read_DMA10_Y_COUNT()      bfin_read16(DMA10_Y_COUNT)
+#define bfin_write_DMA10_Y_COUNT(val)  bfin_write16(DMA10_Y_COUNT, val)
+#define bfin_read_DMA10_Y_MODIFY()     bfin_read16(DMA10_Y_MODIFY)
+#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY, val)
+#define bfin_read_DMA10_CURR_DESC_PTR() bfin_readPTR(DMA10_CURR_DESC_PTR)
+#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_writePTR(DMA10_CURR_DESC_PTR, val)
+#define bfin_read_DMA10_CURR_ADDR()    bfin_readPTR(DMA10_CURR_ADDR)
+#define bfin_write_DMA10_CURR_ADDR(val) bfin_writePTR(DMA10_CURR_ADDR, val)
+#define bfin_read_DMA10_IRQ_STATUS()   bfin_read16(DMA10_IRQ_STATUS)
+#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
+#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
+#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
+#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
+#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
+#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
+#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
+#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_readPTR(DMA11_NEXT_DESC_PTR)
+#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_writePTR(DMA11_NEXT_DESC_PTR, val)
+#define bfin_read_DMA11_START_ADDR()   bfin_readPTR(DMA11_START_ADDR)
+#define bfin_write_DMA11_START_ADDR(val) bfin_writePTR(DMA11_START_ADDR, val)
+#define bfin_read_DMA11_CONFIG()       bfin_read16(DMA11_CONFIG)
+#define bfin_write_DMA11_CONFIG(val)   bfin_write16(DMA11_CONFIG, val)
+#define bfin_read_DMA11_X_COUNT()      bfin_read16(DMA11_X_COUNT)
+#define bfin_write_DMA11_X_COUNT(val)  bfin_write16(DMA11_X_COUNT, val)
+#define bfin_read_DMA11_X_MODIFY()     bfin_read16(DMA11_X_MODIFY)
+#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY, val)
+#define bfin_read_DMA11_Y_COUNT()      bfin_read16(DMA11_Y_COUNT)
+#define bfin_write_DMA11_Y_COUNT(val)  bfin_write16(DMA11_Y_COUNT, val)
+#define bfin_read_DMA11_Y_MODIFY()     bfin_read16(DMA11_Y_MODIFY)
+#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY, val)
+#define bfin_read_DMA11_CURR_DESC_PTR() bfin_readPTR(DMA11_CURR_DESC_PTR)
+#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_writePTR(DMA11_CURR_DESC_PTR, val)
+#define bfin_read_DMA11_CURR_ADDR()    bfin_readPTR(DMA11_CURR_ADDR)
+#define bfin_write_DMA11_CURR_ADDR(val) bfin_writePTR(DMA11_CURR_ADDR, val)
+#define bfin_read_DMA11_IRQ_STATUS()   bfin_read16(DMA11_IRQ_STATUS)
+#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
+#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
+#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
+#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
+#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
+#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
+#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_readPTR(MDMA_S0_NEXT_DESC_PTR)
+#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_S0_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_S0_START_ADDR() bfin_readPTR(MDMA_S0_START_ADDR)
+#define bfin_write_MDMA_S0_START_ADDR(val) bfin_writePTR(MDMA_S0_START_ADDR, val)
+#define bfin_read_MDMA_S0_CONFIG()     bfin_read16(MDMA_S0_CONFIG)
+#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
+#define bfin_read_MDMA_S0_X_COUNT()    bfin_read16(MDMA_S0_X_COUNT)
+#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
+#define bfin_read_MDMA_S0_X_MODIFY()   bfin_read16(MDMA_S0_X_MODIFY)
+#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY, val)
+#define bfin_read_MDMA_S0_Y_COUNT()    bfin_read16(MDMA_S0_Y_COUNT)
+#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
+#define bfin_read_MDMA_S0_Y_MODIFY()   bfin_read16(MDMA_S0_Y_MODIFY)
+#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY, val)
+#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_readPTR(MDMA_S0_CURR_DESC_PTR)
+#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_writePTR(MDMA_S0_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_S0_CURR_ADDR()  bfin_readPTR(MDMA_S0_CURR_ADDR)
+#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_writePTR(MDMA_S0_CURR_ADDR, val)
+#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
+#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val)
+#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
+#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
+#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT, val)
+#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
+#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_readPTR(MDMA_D0_NEXT_DESC_PTR)
+#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_D0_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_D0_START_ADDR() bfin_readPTR(MDMA_D0_START_ADDR)
+#define bfin_write_MDMA_D0_START_ADDR(val) bfin_writePTR(MDMA_D0_START_ADDR, val)
+#define bfin_read_MDMA_D0_CONFIG()     bfin_read16(MDMA_D0_CONFIG)
+#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
+#define bfin_read_MDMA_D0_X_COUNT()    bfin_read16(MDMA_D0_X_COUNT)
+#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
+#define bfin_read_MDMA_D0_X_MODIFY()   bfin_read16(MDMA_D0_X_MODIFY)
+#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY, val)
+#define bfin_read_MDMA_D0_Y_COUNT()    bfin_read16(MDMA_D0_Y_COUNT)
+#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
+#define bfin_read_MDMA_D0_Y_MODIFY()   bfin_read16(MDMA_D0_Y_MODIFY)
+#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY, val)
+#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_readPTR(MDMA_D0_CURR_DESC_PTR)
+#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_writePTR(MDMA_D0_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_D0_CURR_ADDR()  bfin_readPTR(MDMA_D0_CURR_ADDR)
+#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_writePTR(MDMA_D0_CURR_ADDR, val)
+#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
+#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
+#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
+#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
+#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT, val)
+#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
+#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_readPTR(MDMA_S1_NEXT_DESC_PTR)
+#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_S1_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_S1_START_ADDR() bfin_readPTR(MDMA_S1_START_ADDR)
+#define bfin_write_MDMA_S1_START_ADDR(val) bfin_writePTR(MDMA_S1_START_ADDR, val)
+#define bfin_read_MDMA_S1_CONFIG()     bfin_read16(MDMA_S1_CONFIG)
+#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
+#define bfin_read_MDMA_S1_X_COUNT()    bfin_read16(MDMA_S1_X_COUNT)
+#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT, val)
+#define bfin_read_MDMA_S1_X_MODIFY()   bfin_read16(MDMA_S1_X_MODIFY)
+#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY, val)
+#define bfin_read_MDMA_S1_Y_COUNT()    bfin_read16(MDMA_S1_Y_COUNT)
+#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT, val)
+#define bfin_read_MDMA_S1_Y_MODIFY()   bfin_read16(MDMA_S1_Y_MODIFY)
+#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY, val)
+#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_readPTR(MDMA_S1_CURR_DESC_PTR)
+#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_writePTR(MDMA_S1_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_S1_CURR_ADDR()  bfin_readPTR(MDMA_S1_CURR_ADDR)
+#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_writePTR(MDMA_S1_CURR_ADDR, val)
+#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
+#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
+#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
+#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
+#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT, val)
+#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
+#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_readPTR(MDMA_D1_NEXT_DESC_PTR)
+#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_D1_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_D1_START_ADDR() bfin_readPTR(MDMA_D1_START_ADDR)
+#define bfin_write_MDMA_D1_START_ADDR(val) bfin_writePTR(MDMA_D1_START_ADDR, val)
+#define bfin_read_MDMA_D1_CONFIG()     bfin_read16(MDMA_D1_CONFIG)
+#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
+#define bfin_read_MDMA_D1_X_COUNT()    bfin_read16(MDMA_D1_X_COUNT)
+#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT, val)
+#define bfin_read_MDMA_D1_X_MODIFY()   bfin_read16(MDMA_D1_X_MODIFY)
+#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY, val)
+#define bfin_read_MDMA_D1_Y_COUNT()    bfin_read16(MDMA_D1_Y_COUNT)
+#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT, val)
+#define bfin_read_MDMA_D1_Y_MODIFY()   bfin_read16(MDMA_D1_Y_MODIFY)
+#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY, val)
+#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_readPTR(MDMA_D1_CURR_DESC_PTR)
+#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_writePTR(MDMA_D1_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_D1_CURR_ADDR()  bfin_readPTR(MDMA_D1_CURR_ADDR)
+#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_writePTR(MDMA_D1_CURR_ADDR, val)
+#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
+#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
+#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
+#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
+#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT, val)
+#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
+#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
+#define bfin_read_PPI_CONTROL()        bfin_read16(PPI_CONTROL)
+#define bfin_write_PPI_CONTROL(val)    bfin_write16(PPI_CONTROL, val)
+#define bfin_read_PPI_STATUS()         bfin_read16(PPI_STATUS)
+#define bfin_write_PPI_STATUS(val)     bfin_write16(PPI_STATUS, val)
+#define bfin_read_PPI_COUNT()          bfin_read16(PPI_COUNT)
+#define bfin_write_PPI_COUNT(val)      bfin_write16(PPI_COUNT, val)
+#define bfin_read_PPI_DELAY()          bfin_read16(PPI_DELAY)
+#define bfin_write_PPI_DELAY(val)      bfin_write16(PPI_DELAY, val)
+#define bfin_read_PPI_FRAME()          bfin_read16(PPI_FRAME)
+#define bfin_write_PPI_FRAME(val)      bfin_write16(PPI_FRAME, val)
+#define bfin_read_TWI_CLKDIV()         bfin_read16(TWI_CLKDIV)
+#define bfin_write_TWI_CLKDIV(val)     bfin_write16(TWI_CLKDIV, val)
+#define bfin_read_TWI_CONTROL()        bfin_read16(TWI_CONTROL)
+#define bfin_write_TWI_CONTROL(val)    bfin_write16(TWI_CONTROL, val)
+#define bfin_read_TWI_SLAVE_CTL()      bfin_read16(TWI_SLAVE_CTL)
+#define bfin_write_TWI_SLAVE_CTL(val)  bfin_write16(TWI_SLAVE_CTL, val)
+#define bfin_read_TWI_SLAVE_STAT()     bfin_read16(TWI_SLAVE_STAT)
+#define bfin_write_TWI_SLAVE_STAT(val) bfin_write16(TWI_SLAVE_STAT, val)
+#define bfin_read_TWI_SLAVE_ADDR()     bfin_read16(TWI_SLAVE_ADDR)
+#define bfin_write_TWI_SLAVE_ADDR(val) bfin_write16(TWI_SLAVE_ADDR, val)
+#define bfin_read_TWI_MASTER_CTL()     bfin_read16(TWI_MASTER_CTL)
+#define bfin_write_TWI_MASTER_CTL(val) bfin_write16(TWI_MASTER_CTL, val)
+#define bfin_read_TWI_MASTER_STAT()    bfin_read16(TWI_MASTER_STAT)
+#define bfin_write_TWI_MASTER_STAT(val) bfin_write16(TWI_MASTER_STAT, val)
+#define bfin_read_TWI_MASTER_ADDR()    bfin_read16(TWI_MASTER_ADDR)
+#define bfin_write_TWI_MASTER_ADDR(val) bfin_write16(TWI_MASTER_ADDR, val)
+#define bfin_read_TWI_INT_STAT()       bfin_read16(TWI_INT_STAT)
+#define bfin_write_TWI_INT_STAT(val)   bfin_write16(TWI_INT_STAT, val)
+#define bfin_read_TWI_INT_MASK()       bfin_read16(TWI_INT_MASK)
+#define bfin_write_TWI_INT_MASK(val)   bfin_write16(TWI_INT_MASK, val)
+#define bfin_read_TWI_FIFO_CTL()       bfin_read16(TWI_FIFO_CTL)
+#define bfin_write_TWI_FIFO_CTL(val)   bfin_write16(TWI_FIFO_CTL, val)
+#define bfin_read_TWI_FIFO_STAT()      bfin_read16(TWI_FIFO_STAT)
+#define bfin_write_TWI_FIFO_STAT(val)  bfin_write16(TWI_FIFO_STAT, val)
+#define bfin_read_TWI_XMT_DATA8()      bfin_read16(TWI_XMT_DATA8)
+#define bfin_write_TWI_XMT_DATA8(val)  bfin_write16(TWI_XMT_DATA8, val)
+#define bfin_read_TWI_XMT_DATA16()     bfin_read16(TWI_XMT_DATA16)
+#define bfin_write_TWI_XMT_DATA16(val) bfin_write16(TWI_XMT_DATA16, val)
+#define bfin_read_TWI_RCV_DATA8()      bfin_read16(TWI_RCV_DATA8)
+#define bfin_write_TWI_RCV_DATA8(val)  bfin_write16(TWI_RCV_DATA8, val)
+#define bfin_read_TWI_RCV_DATA16()     bfin_read16(TWI_RCV_DATA16)
+#define bfin_write_TWI_RCV_DATA16(val) bfin_write16(TWI_RCV_DATA16, val)
+#define bfin_read_PORTGIO()            bfin_read16(PORTGIO)
+#define bfin_write_PORTGIO(val)        bfin_write16(PORTGIO, val)
+#define bfin_read_PORTGIO_CLEAR()      bfin_read16(PORTGIO_CLEAR)
+#define bfin_write_PORTGIO_CLEAR(val)  bfin_write16(PORTGIO_CLEAR, val)
+#define bfin_read_PORTGIO_SET()        bfin_read16(PORTGIO_SET)
+#define bfin_write_PORTGIO_SET(val)    bfin_write16(PORTGIO_SET, val)
+#define bfin_read_PORTGIO_TOGGLE()     bfin_read16(PORTGIO_TOGGLE)
+#define bfin_write_PORTGIO_TOGGLE(val) bfin_write16(PORTGIO_TOGGLE, val)
+#define bfin_read_PORTGIO_MASKA()      bfin_read16(PORTGIO_MASKA)
+#define bfin_write_PORTGIO_MASKA(val)  bfin_write16(PORTGIO_MASKA, val)
+#define bfin_read_PORTGIO_MASKA_CLEAR() bfin_read16(PORTGIO_MASKA_CLEAR)
+#define bfin_write_PORTGIO_MASKA_CLEAR(val) bfin_write16(PORTGIO_MASKA_CLEAR, val)
+#define bfin_read_PORTGIO_MASKA_SET()  bfin_read16(PORTGIO_MASKA_SET)
+#define bfin_write_PORTGIO_MASKA_SET(val) bfin_write16(PORTGIO_MASKA_SET, val)
+#define bfin_read_PORTGIO_MASKA_TOGGLE() bfin_read16(PORTGIO_MASKA_TOGGLE)
+#define bfin_write_PORTGIO_MASKA_TOGGLE(val) bfin_write16(PORTGIO_MASKA_TOGGLE, val)
+#define bfin_read_PORTGIO_MASKB()      bfin_read16(PORTGIO_MASKB)
+#define bfin_write_PORTGIO_MASKB(val)  bfin_write16(PORTGIO_MASKB, val)
+#define bfin_read_PORTGIO_MASKB_CLEAR() bfin_read16(PORTGIO_MASKB_CLEAR)
+#define bfin_write_PORTGIO_MASKB_CLEAR(val) bfin_write16(PORTGIO_MASKB_CLEAR, val)
+#define bfin_read_PORTGIO_MASKB_SET()  bfin_read16(PORTGIO_MASKB_SET)
+#define bfin_write_PORTGIO_MASKB_SET(val) bfin_write16(PORTGIO_MASKB_SET, val)
+#define bfin_read_PORTGIO_MASKB_TOGGLE() bfin_read16(PORTGIO_MASKB_TOGGLE)
+#define bfin_write_PORTGIO_MASKB_TOGGLE(val) bfin_write16(PORTGIO_MASKB_TOGGLE, val)
+#define bfin_read_PORTGIO_DIR()        bfin_read16(PORTGIO_DIR)
+#define bfin_write_PORTGIO_DIR(val)    bfin_write16(PORTGIO_DIR, val)
+#define bfin_read_PORTGIO_POLAR()      bfin_read16(PORTGIO_POLAR)
+#define bfin_write_PORTGIO_POLAR(val)  bfin_write16(PORTGIO_POLAR, val)
+#define bfin_read_PORTGIO_EDGE()       bfin_read16(PORTGIO_EDGE)
+#define bfin_write_PORTGIO_EDGE(val)   bfin_write16(PORTGIO_EDGE, val)
+#define bfin_read_PORTGIO_BOTH()       bfin_read16(PORTGIO_BOTH)
+#define bfin_write_PORTGIO_BOTH(val)   bfin_write16(PORTGIO_BOTH, val)
+#define bfin_read_PORTGIO_INEN()       bfin_read16(PORTGIO_INEN)
+#define bfin_write_PORTGIO_INEN(val)   bfin_write16(PORTGIO_INEN, val)
+#define bfin_read_PORTHIO()            bfin_read16(PORTHIO)
+#define bfin_write_PORTHIO(val)        bfin_write16(PORTHIO, val)
+#define bfin_read_PORTHIO_CLEAR()      bfin_read16(PORTHIO_CLEAR)
+#define bfin_write_PORTHIO_CLEAR(val)  bfin_write16(PORTHIO_CLEAR, val)
+#define bfin_read_PORTHIO_SET()        bfin_read16(PORTHIO_SET)
+#define bfin_write_PORTHIO_SET(val)    bfin_write16(PORTHIO_SET, val)
+#define bfin_read_PORTHIO_TOGGLE()     bfin_read16(PORTHIO_TOGGLE)
+#define bfin_write_PORTHIO_TOGGLE(val) bfin_write16(PORTHIO_TOGGLE, val)
+#define bfin_read_PORTHIO_MASKA()      bfin_read16(PORTHIO_MASKA)
+#define bfin_write_PORTHIO_MASKA(val)  bfin_write16(PORTHIO_MASKA, val)
+#define bfin_read_PORTHIO_MASKA_CLEAR() bfin_read16(PORTHIO_MASKA_CLEAR)
+#define bfin_write_PORTHIO_MASKA_CLEAR(val) bfin_write16(PORTHIO_MASKA_CLEAR, val)
+#define bfin_read_PORTHIO_MASKA_SET()  bfin_read16(PORTHIO_MASKA_SET)
+#define bfin_write_PORTHIO_MASKA_SET(val) bfin_write16(PORTHIO_MASKA_SET, val)
+#define bfin_read_PORTHIO_MASKA_TOGGLE() bfin_read16(PORTHIO_MASKA_TOGGLE)
+#define bfin_write_PORTHIO_MASKA_TOGGLE(val) bfin_write16(PORTHIO_MASKA_TOGGLE, val)
+#define bfin_read_PORTHIO_MASKB()      bfin_read16(PORTHIO_MASKB)
+#define bfin_write_PORTHIO_MASKB(val)  bfin_write16(PORTHIO_MASKB, val)
+#define bfin_read_PORTHIO_MASKB_CLEAR() bfin_read16(PORTHIO_MASKB_CLEAR)
+#define bfin_write_PORTHIO_MASKB_CLEAR(val) bfin_write16(PORTHIO_MASKB_CLEAR, val)
+#define bfin_read_PORTHIO_MASKB_SET()  bfin_read16(PORTHIO_MASKB_SET)
+#define bfin_write_PORTHIO_MASKB_SET(val) bfin_write16(PORTHIO_MASKB_SET, val)
+#define bfin_read_PORTHIO_MASKB_TOGGLE() bfin_read16(PORTHIO_MASKB_TOGGLE)
+#define bfin_write_PORTHIO_MASKB_TOGGLE(val) bfin_write16(PORTHIO_MASKB_TOGGLE, val)
+#define bfin_read_PORTHIO_DIR()        bfin_read16(PORTHIO_DIR)
+#define bfin_write_PORTHIO_DIR(val)    bfin_write16(PORTHIO_DIR, val)
+#define bfin_read_PORTHIO_POLAR()      bfin_read16(PORTHIO_POLAR)
+#define bfin_write_PORTHIO_POLAR(val)  bfin_write16(PORTHIO_POLAR, val)
+#define bfin_read_PORTHIO_EDGE()       bfin_read16(PORTHIO_EDGE)
+#define bfin_write_PORTHIO_EDGE(val)   bfin_write16(PORTHIO_EDGE, val)
+#define bfin_read_PORTHIO_BOTH()       bfin_read16(PORTHIO_BOTH)
+#define bfin_write_PORTHIO_BOTH(val)   bfin_write16(PORTHIO_BOTH, val)
+#define bfin_read_PORTHIO_INEN()       bfin_read16(PORTHIO_INEN)
+#define bfin_write_PORTHIO_INEN(val)   bfin_write16(PORTHIO_INEN, val)
+#define bfin_read_UART1_THR()          bfin_read16(UART1_THR)
+#define bfin_write_UART1_THR(val)      bfin_write16(UART1_THR, val)
+#define bfin_read_UART1_RBR()          bfin_read16(UART1_RBR)
+#define bfin_write_UART1_RBR(val)      bfin_write16(UART1_RBR, val)
+#define bfin_read_UART1_DLL()          bfin_read16(UART1_DLL)
+#define bfin_write_UART1_DLL(val)      bfin_write16(UART1_DLL, val)
+#define bfin_read_UART1_IER()          bfin_read16(UART1_IER)
+#define bfin_write_UART1_IER(val)      bfin_write16(UART1_IER, val)
+#define bfin_read_UART1_DLH()          bfin_read16(UART1_DLH)
+#define bfin_write_UART1_DLH(val)      bfin_write16(UART1_DLH, val)
+#define bfin_read_UART1_IIR()          bfin_read16(UART1_IIR)
+#define bfin_write_UART1_IIR(val)      bfin_write16(UART1_IIR, val)
+#define bfin_read_UART1_LCR()          bfin_read16(UART1_LCR)
+#define bfin_write_UART1_LCR(val)      bfin_write16(UART1_LCR, val)
+#define bfin_read_UART1_MCR()          bfin_read16(UART1_MCR)
+#define bfin_write_UART1_MCR(val)      bfin_write16(UART1_MCR, val)
+#define bfin_read_UART1_LSR()          bfin_read16(UART1_LSR)
+#define bfin_write_UART1_LSR(val)      bfin_write16(UART1_LSR, val)
+#define bfin_read_UART1_MSR()          bfin_read16(UART1_MSR)
+#define bfin_write_UART1_MSR(val)      bfin_write16(UART1_MSR, val)
+#define bfin_read_UART1_SCR()          bfin_read16(UART1_SCR)
+#define bfin_write_UART1_SCR(val)      bfin_write16(UART1_SCR, val)
+#define bfin_read_UART1_GCTL()         bfin_read16(UART1_GCTL)
+#define bfin_write_UART1_GCTL(val)     bfin_write16(UART1_GCTL, val)
+#define bfin_read_PORTF_FER()          bfin_read16(PORTF_FER)
+#define bfin_write_PORTF_FER(val)      bfin_write16(PORTF_FER, val)
+#define bfin_read_PORTG_FER()          bfin_read16(PORTG_FER)
+#define bfin_write_PORTG_FER(val)      bfin_write16(PORTG_FER, val)
+#define bfin_read_PORTH_FER()          bfin_read16(PORTH_FER)
+#define bfin_write_PORTH_FER(val)      bfin_write16(PORTH_FER, val)
+#define bfin_read_HMDMA0_CONTROL()     bfin_read16(HMDMA0_CONTROL)
+#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
+#define bfin_read_HMDMA0_ECINIT()      bfin_read16(HMDMA0_ECINIT)
+#define bfin_write_HMDMA0_ECINIT(val)  bfin_write16(HMDMA0_ECINIT, val)
+#define bfin_read_HMDMA0_BCINIT()      bfin_read16(HMDMA0_BCINIT)
+#define bfin_write_HMDMA0_BCINIT(val)  bfin_write16(HMDMA0_BCINIT, val)
+#define bfin_read_HMDMA0_ECURGENT()    bfin_read16(HMDMA0_ECURGENT)
+#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
+#define bfin_read_HMDMA0_ECOVERFLOW()  bfin_read16(HMDMA0_ECOVERFLOW)
+#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
+#define bfin_read_HMDMA0_ECOUNT()      bfin_read16(HMDMA0_ECOUNT)
+#define bfin_write_HMDMA0_ECOUNT(val)  bfin_write16(HMDMA0_ECOUNT, val)
+#define bfin_read_HMDMA0_BCOUNT()      bfin_read16(HMDMA0_BCOUNT)
+#define bfin_write_HMDMA0_BCOUNT(val)  bfin_write16(HMDMA0_BCOUNT, val)
+#define bfin_read_HMDMA1_CONTROL()     bfin_read16(HMDMA1_CONTROL)
+#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
+#define bfin_read_HMDMA1_ECINIT()      bfin_read16(HMDMA1_ECINIT)
+#define bfin_write_HMDMA1_ECINIT(val)  bfin_write16(HMDMA1_ECINIT, val)
+#define bfin_read_HMDMA1_BCINIT()      bfin_read16(HMDMA1_BCINIT)
+#define bfin_write_HMDMA1_BCINIT(val)  bfin_write16(HMDMA1_BCINIT, val)
+#define bfin_read_HMDMA1_ECURGENT()    bfin_read16(HMDMA1_ECURGENT)
+#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
+#define bfin_read_HMDMA1_ECOVERFLOW()  bfin_read16(HMDMA1_ECOVERFLOW)
+#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
+#define bfin_read_HMDMA1_ECOUNT()      bfin_read16(HMDMA1_ECOUNT)
+#define bfin_write_HMDMA1_ECOUNT(val)  bfin_write16(HMDMA1_ECOUNT, val)
+#define bfin_read_HMDMA1_BCOUNT()      bfin_read16(HMDMA1_BCOUNT)
+#define bfin_write_HMDMA1_BCOUNT(val)  bfin_write16(HMDMA1_BCOUNT, val)
+#define bfin_read_PORTF_MUX()          bfin_read16(PORTF_MUX)
+#define bfin_write_PORTF_MUX(val)      bfin_write16(PORTF_MUX, val)
+#define bfin_read_PORTG_MUX()          bfin_read16(PORTG_MUX)
+#define bfin_write_PORTG_MUX(val)      bfin_write16(PORTG_MUX, val)
+#define bfin_read_PORTH_MUX()          bfin_read16(PORTH_MUX)
+#define bfin_write_PORTH_MUX(val)      bfin_write16(PORTH_MUX, val)
+#define bfin_read_PORTF_DRIVE()        bfin_read16(PORTF_DRIVE)
+#define bfin_write_PORTF_DRIVE(val)    bfin_write16(PORTF_DRIVE, val)
+#define bfin_read_PORTG_DRIVE()        bfin_read16(PORTG_DRIVE)
+#define bfin_write_PORTG_DRIVE(val)    bfin_write16(PORTG_DRIVE, val)
+#define bfin_read_PORTH_DRIVE()        bfin_read16(PORTH_DRIVE)
+#define bfin_write_PORTH_DRIVE(val)    bfin_write16(PORTH_DRIVE, val)
+#define bfin_read_PORTF_SLEW()         bfin_read16(PORTF_SLEW)
+#define bfin_write_PORTF_SLEW(val)     bfin_write16(PORTF_SLEW, val)
+#define bfin_read_PORTG_SLEW()         bfin_read16(PORTG_SLEW)
+#define bfin_write_PORTG_SLEW(val)     bfin_write16(PORTG_SLEW, val)
+#define bfin_read_PORTH_SLEW()         bfin_read16(PORTH_SLEW)
+#define bfin_write_PORTH_SLEW(val)     bfin_write16(PORTH_SLEW, val)
+#define bfin_read_PORTF_HYSTERESIS()   bfin_read16(PORTF_HYSTERESIS)
+#define bfin_write_PORTF_HYSTERESIS(val) bfin_write16(PORTF_HYSTERESIS, val)
+#define bfin_read_PORTG_HYSTERESIS()   bfin_read16(PORTG_HYSTERESIS)
+#define bfin_write_PORTG_HYSTERESIS(val) bfin_write16(PORTG_HYSTERESIS, val)
+#define bfin_read_PORTH_HYSTERESIS()   bfin_read16(PORTH_HYSTERESIS)
+#define bfin_write_PORTH_HYSTERESIS(val) bfin_write16(PORTH_HYSTERESIS, val)
+#define bfin_read_NONGPIO_DRIVE()      bfin_read16(NONGPIO_DRIVE)
+#define bfin_write_NONGPIO_DRIVE(val)  bfin_write16(NONGPIO_DRIVE, val)
+#define bfin_read_NONGPIO_SLEW()       bfin_read16(NONGPIO_SLEW)
+#define bfin_write_NONGPIO_SLEW(val)   bfin_write16(NONGPIO_SLEW, val)
+#define bfin_read_NONGPIO_HYSTERESIS() bfin_read16(NONGPIO_HYSTERESIS)
+#define bfin_write_NONGPIO_HYSTERESIS(val) bfin_write16(NONGPIO_HYSTERESIS, val)
+#define bfin_read_HOST_CONTROL()       bfin_read16(HOST_CONTROL)
+#define bfin_write_HOST_CONTROL(val)   bfin_write16(HOST_CONTROL, val)
+#define bfin_read_HOST_STATUS()        bfin_read16(HOST_STATUS)
+#define bfin_write_HOST_STATUS(val)    bfin_write16(HOST_STATUS, val)
+#define bfin_read_HOST_TIMEOUT()       bfin_read16(HOST_TIMEOUT)
+#define bfin_write_HOST_TIMEOUT(val)   bfin_write16(HOST_TIMEOUT, val)
+#define bfin_read_CNT_CONFIG()         bfin_read16(CNT_CONFIG)
+#define bfin_write_CNT_CONFIG(val)     bfin_write16(CNT_CONFIG, val)
+#define bfin_read_CNT_IMASK()          bfin_read16(CNT_IMASK)
+#define bfin_write_CNT_IMASK(val)      bfin_write16(CNT_IMASK, val)
+#define bfin_read_CNT_STATUS()         bfin_read16(CNT_STATUS)
+#define bfin_write_CNT_STATUS(val)     bfin_write16(CNT_STATUS, val)
+#define bfin_read_CNT_COMMAND()        bfin_read16(CNT_COMMAND)
+#define bfin_write_CNT_COMMAND(val)    bfin_write16(CNT_COMMAND, val)
+#define bfin_read_CNT_DEBOUNCE()       bfin_read16(CNT_DEBOUNCE)
+#define bfin_write_CNT_DEBOUNCE(val)   bfin_write16(CNT_DEBOUNCE, val)
+#define bfin_read_CNT_COUNTER()        bfin_read32(CNT_COUNTER)
+#define bfin_write_CNT_COUNTER(val)    bfin_write32(CNT_COUNTER, val)
+#define bfin_read_CNT_MAX()            bfin_read32(CNT_MAX)
+#define bfin_write_CNT_MAX(val)        bfin_write32(CNT_MAX, val)
+#define bfin_read_CNT_MIN()            bfin_read32(CNT_MIN)
+#define bfin_write_CNT_MIN(val)        bfin_write32(CNT_MIN, val)
+#define bfin_read_OTP_CONTROL()        bfin_read16(OTP_CONTROL)
+#define bfin_write_OTP_CONTROL(val)    bfin_write16(OTP_CONTROL, val)
+#define bfin_read_OTP_BEN()            bfin_read16(OTP_BEN)
+#define bfin_write_OTP_BEN(val)        bfin_write16(OTP_BEN, val)
+#define bfin_read_OTP_STATUS()         bfin_read16(OTP_STATUS)
+#define bfin_write_OTP_STATUS(val)     bfin_write16(OTP_STATUS, val)
+#define bfin_read_OTP_TIMING()         bfin_read32(OTP_TIMING)
+#define bfin_write_OTP_TIMING(val)     bfin_write32(OTP_TIMING, val)
+#define bfin_read_SECURE_SYSSWT()      bfin_read32(SECURE_SYSSWT)
+#define bfin_write_SECURE_SYSSWT(val)  bfin_write32(SECURE_SYSSWT, val)
+#define bfin_read_SECURE_CONTROL()     bfin_read16(SECURE_CONTROL)
+#define bfin_write_SECURE_CONTROL(val) bfin_write16(SECURE_CONTROL, val)
+#define bfin_read_SECURE_STATUS()      bfin_read16(SECURE_STATUS)
+#define bfin_write_SECURE_STATUS(val)  bfin_write16(SECURE_STATUS, val)
+#define bfin_read_OTP_DATA0()          bfin_read32(OTP_DATA0)
+#define bfin_write_OTP_DATA0(val)      bfin_write32(OTP_DATA0, val)
+#define bfin_read_OTP_DATA1()          bfin_read32(OTP_DATA1)
+#define bfin_write_OTP_DATA1(val)      bfin_write32(OTP_DATA1, val)
+#define bfin_read_OTP_DATA2()          bfin_read32(OTP_DATA2)
+#define bfin_write_OTP_DATA2(val)      bfin_write32(OTP_DATA2, val)
+#define bfin_read_OTP_DATA3()          bfin_read32(OTP_DATA3)
+#define bfin_write_OTP_DATA3(val)      bfin_write32(OTP_DATA3, val)
+#define bfin_read_NFC_CTL()            bfin_read16(NFC_CTL)
+#define bfin_write_NFC_CTL(val)        bfin_write16(NFC_CTL, val)
+#define bfin_read_NFC_STAT()           bfin_read16(NFC_STAT)
+#define bfin_write_NFC_STAT(val)       bfin_write16(NFC_STAT, val)
+#define bfin_read_NFC_IRQSTAT()        bfin_read16(NFC_IRQSTAT)
+#define bfin_write_NFC_IRQSTAT(val)    bfin_write16(NFC_IRQSTAT, val)
+#define bfin_read_NFC_IRQMASK()        bfin_read16(NFC_IRQMASK)
+#define bfin_write_NFC_IRQMASK(val)    bfin_write16(NFC_IRQMASK, val)
+#define bfin_read_NFC_ECC0()           bfin_read16(NFC_ECC0)
+#define bfin_write_NFC_ECC0(val)       bfin_write16(NFC_ECC0, val)
+#define bfin_read_NFC_ECC1()           bfin_read16(NFC_ECC1)
+#define bfin_write_NFC_ECC1(val)       bfin_write16(NFC_ECC1, val)
+#define bfin_read_NFC_ECC2()           bfin_read16(NFC_ECC2)
+#define bfin_write_NFC_ECC2(val)       bfin_write16(NFC_ECC2, val)
+#define bfin_read_NFC_ECC3()           bfin_read16(NFC_ECC3)
+#define bfin_write_NFC_ECC3(val)       bfin_write16(NFC_ECC3, val)
+#define bfin_read_NFC_COUNT()          bfin_read16(NFC_COUNT)
+#define bfin_write_NFC_COUNT(val)      bfin_write16(NFC_COUNT, val)
+#define bfin_read_NFC_RST()            bfin_read16(NFC_RST)
+#define bfin_write_NFC_RST(val)        bfin_write16(NFC_RST, val)
+#define bfin_read_NFC_PGCTL()          bfin_read16(NFC_PGCTL)
+#define bfin_write_NFC_PGCTL(val)      bfin_write16(NFC_PGCTL, val)
+#define bfin_read_NFC_READ()           bfin_read16(NFC_READ)
+#define bfin_write_NFC_READ(val)       bfin_write16(NFC_READ, val)
+#define bfin_read_NFC_ADDR()           bfin_read16(NFC_ADDR)
+#define bfin_write_NFC_ADDR(val)       bfin_write16(NFC_ADDR, val)
+#define bfin_read_NFC_CMD()            bfin_read16(NFC_CMD)
+#define bfin_write_NFC_CMD(val)        bfin_write16(NFC_CMD, val)
+#define bfin_read_NFC_DATA_WR()        bfin_read16(NFC_DATA_WR)
+#define bfin_write_NFC_DATA_WR(val)    bfin_write16(NFC_DATA_WR, val)
+#define bfin_read_NFC_DATA_RD()        bfin_read16(NFC_DATA_RD)
+#define bfin_write_NFC_DATA_RD(val)    bfin_write16(NFC_DATA_RD, val)
+#define bfin_read_DMA_TC_CNT()         bfin_read16(DMA_TC_CNT)
+#define bfin_write_DMA_TC_CNT(val)     bfin_write16(DMA_TC_CNT, val)
+#define bfin_read_DMA_TC_PER()         bfin_read16(DMA_TC_PER)
+#define bfin_write_DMA_TC_PER(val)     bfin_write16(DMA_TC_PER, val)
 
 #endif /* __BFIN_CDEF_ADSP_BF522_proc__ */
index a6b0787807d1cba3047fd4dce0f98a3902f1a7da..075c6970b51eaa6c21b392ff27bf05f43ba93da6 100644 (file)
@@ -8,8 +8,6 @@
 
 #include "../mach-common/ADSP-EDN-core_def.h"
 
-#include "ADSP-EDN-BF52x-extended_def.h"
-
 #define PLL_CTL                        0xFFC00000 /* PLL Control Register */
 #define PLL_DIV                        0xFFC00004 /* PLL Divide Register */
 #define VR_CTL                         0xFFC00008 /* Voltage Regulator Control Register */
 #define CHIPID                         0xFFC00014
 #define SWRST                          0xFFC00100 /* Software Reset Register */
 #define SYSCR                          0xFFC00104 /* System Configuration register */
+#define SIC_RVECT                      0xFFC00108 /* Interrupt Reset Vector Address Register */
+#define SIC_IMASK0                     0xFFC0010C /* Interrupt Mask Register */
+#define SIC_IAR0                       0xFFC00110 /* Interrupt Assignment Register 0 */
+#define SIC_IAR1                       0xFFC00114 /* Interrupt Assignment Register 1 */
+#define SIC_IAR2                       0xFFC00118 /* Interrupt Assignment Register 2 */
+#define SIC_IAR3                       0xFFC0011C /* Interrupt Assignment Register 3 */
+#define SIC_ISR0                       0xFFC00120 /* Interrupt Status Register */
+#define SIC_IWR0                       0xFFC00124 /* Interrupt Wakeup Register */
+#define SIC_IMASK1                     0xFFC0014C /* Interrupt Mask register of SIC2 */
+#define SIC_IAR4                       0xFFC00150 /* Interrupt Assignment register4 */
+#define SIC_IAR5                       0xFFC00154 /* Interrupt Assignment register5 */
+#define SIC_IAR6                       0xFFC00158 /* Interrupt Assignment register6 */
+#define SIC_IAR7                       0xFFC0015C /* Interrupt Assignment register7 */
+#define SIC_ISR1                       0xFFC00160 /* Interrupt Status register */
+#define SIC_IWR1                       0xFFC00164 /* Interrupt Wakeup register */
+#define WDOG_CTL                       0xFFC00200 /* Watchdog Control Register */
+#define WDOG_CNT                       0xFFC00204 /* Watchdog Count Register */
+#define WDOG_STAT                      0xFFC00208 /* Watchdog Status Register */
+#define RTC_STAT                       0xFFC00300 /* RTC Status Register */
+#define RTC_ICTL                       0xFFC00304 /* RTC Interrupt Control Register */
+#define RTC_ISTAT                      0xFFC00308 /* RTC Interrupt Status Register */
+#define RTC_SWCNT                      0xFFC0030C /* RTC Stopwatch Count Register */
+#define RTC_ALARM                      0xFFC00310 /* RTC Alarm Time Register */
+#define RTC_PREN                       0xFFC00314 /* RTC Prescaler Enable Register */
+#define UART0_THR                      0xFFC00400 /* Transmit Holding register */
+#define UART0_RBR                      0xFFC00400 /* Receive Buffer register */
+#define UART0_DLL                      0xFFC00400 /* Divisor Latch (Low-Byte) */
+#define UART0_IER                      0xFFC00404 /* Interrupt Enable Register */
+#define UART0_DLH                      0xFFC00404 /* Divisor Latch (High-Byte) */
+#define UART0_IIR                      0xFFC00408 /* Interrupt Identification Register */
+#define UART0_LCR                      0xFFC0040C /* Line Control Register */
+#define UART0_MCR                      0xFFC00410 /* Modem Control Register */
+#define UART0_LSR                      0xFFC00414 /* Line Status Register */
+#define UART0_MSR                      0xFFC00418 /* Modem Status Register */
+#define UART0_SCR                      0xFFC0041C /* SCR Scratch Register */
+#define UART0_GCTL                     0xFFC00424 /* Global Control Register */
+#define SPI_CTL                        0xFFC00500 /* SPI Control Register */
+#define SPI_FLG                        0xFFC00504 /* SPI Flag register */
+#define SPI_STAT                       0xFFC00508 /* SPI Status register */
+#define SPI_TDBR                       0xFFC0050C /* SPI Transmit Data Buffer Register */
+#define SPI_RDBR                       0xFFC00510 /* SPI Receive Data Buffer Register */
+#define SPI_BAUD                       0xFFC00514 /* SPI Baud rate Register */
+#define SPI_SHADOW                     0xFFC00518 /* SPI_RDBR Shadow Register */
+#define TIMER0_CONFIG                  0xFFC00600 /* Timer 0 Configuration Register */
+#define TIMER0_COUNTER                 0xFFC00604 /* Timer 0 Counter Register */
+#define TIMER0_PERIOD                  0xFFC00608 /* Timer 0 Period Register */
+#define TIMER0_WIDTH                   0xFFC0060C /* Timer 0 Width Register */
+#define TIMER1_CONFIG                  0xFFC00610 /* Timer 1 Configuration Register */
+#define TIMER1_COUNTER                 0xFFC00614 /* Timer 1 Counter Register */
+#define TIMER1_PERIOD                  0xFFC00618 /* Timer 1 Period Register */
+#define TIMER1_WIDTH                   0xFFC0061C /* Timer 1 Width Register */
+#define TIMER2_CONFIG                  0xFFC00620 /* Timer 2 Configuration Register */
+#define TIMER2_COUNTER                 0xFFC00624 /* Timer 2 Counter Register */
+#define TIMER2_PERIOD                  0xFFC00628 /* Timer 2 Period Register */
+#define TIMER2_WIDTH                   0xFFC0062C /* Timer 2 Width Register */
+#define TIMER3_CONFIG                  0xFFC00630 /* Timer 3 Configuration Register */
+#define TIMER3_COUNTER                 0xFFC00634 /* Timer 3 Counter Register */
+#define TIMER3_PERIOD                  0xFFC00638 /* Timer 3 Period Register */
+#define TIMER3_WIDTH                   0xFFC0063C /* Timer 3 Width Register */
+#define TIMER4_CONFIG                  0xFFC00640 /* Timer 4 Configuration Register */
+#define TIMER4_COUNTER                 0xFFC00644 /* Timer 4 Counter Register */
+#define TIMER4_PERIOD                  0xFFC00648 /* Timer 4 Period Register */
+#define TIMER4_WIDTH                   0xFFC0064C /* Timer 4 Width Register */
+#define TIMER5_CONFIG                  0xFFC00650 /* Timer 5 Configuration Register */
+#define TIMER5_COUNTER                 0xFFC00654 /* Timer 5 Counter Register */
+#define TIMER5_PERIOD                  0xFFC00658 /* Timer 5 Period Register */
+#define TIMER5_WIDTH                   0xFFC0065C /* Timer 5 Width Register */
+#define TIMER6_CONFIG                  0xFFC00660 /* Timer 6 Configuration Register */
+#define TIMER6_COUNTER                 0xFFC00664 /* Timer 6 Counter Register */
+#define TIMER6_PERIOD                  0xFFC00668 /* Timer 6 Period Register */
+#define TIMER6_WIDTH                   0xFFC0066C /* Timer 6 Width Register\n */
+#define TIMER7_CONFIG                  0xFFC00670 /* Timer 7 Configuration Register */
+#define TIMER7_COUNTER                 0xFFC00674 /* Timer 7 Counter Register */
+#define TIMER7_PERIOD                  0xFFC00678 /* Timer 7 Period Register */
+#define TIMER7_WIDTH                   0xFFC0067C /* Timer 7 Width Register */
+#define TIMER_ENABLE                   0xFFC00680 /* Timer Enable Register */
+#define TIMER_DISABLE                  0xFFC00684 /* Timer Disable Register */
+#define TIMER_STATUS                   0xFFC00688 /* Timer Status Register */
+#define PORTFIO                        0xFFC00700 /* Port F I/O Pin State Specify Register */
+#define PORTFIO_CLEAR                  0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register */
+#define PORTFIO_SET                    0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register */
+#define PORTFIO_TOGGLE                 0xFFC0070C /* Port F I/O Pin State Toggle Register */
+#define PORTFIO_MASKA                  0xFFC00710 /* Port F I/O Mask State Specify Interrupt A Register */
+#define PORTFIO_MASKA_CLEAR            0xFFC00714 /* Port F I/O Mask Disable Interrupt A Register */
+#define PORTFIO_MASKA_SET              0xFFC00718 /* Port F I/O Mask Enable Interrupt A Register */
+#define PORTFIO_MASKA_TOGGLE           0xFFC0071C /* Port F I/O Mask Toggle Enable Interrupt A Register */
+#define PORTFIO_MASKB                  0xFFC00720 /* Port F I/O Mask State Specify Interrupt B Register */
+#define PORTFIO_MASKB_CLEAR            0xFFC00724 /* Port F I/O Mask Disable Interrupt B Register */
+#define PORTFIO_MASKB_SET              0xFFC00728 /* Port F I/O Mask Enable Interrupt B Register */
+#define PORTFIO_MASKB_TOGGLE           0xFFC0072C /* Port F I/O Mask Toggle Enable Interrupt B Register */
+#define PORTFIO_DIR                    0xFFC00730 /* Port F I/O Direction Register */
+#define PORTFIO_POLAR                  0xFFC00734 /* Port F I/O Source Polarity Register */
+#define PORTFIO_EDGE                   0xFFC00738 /* Port F I/O Source Sensitivity Register */
+#define PORTFIO_BOTH                   0xFFC0073C /* Port F I/O Set on BOTH Edges Register */
+#define PORTFIO_INEN                   0xFFC00740 /* Port F I/O Input Enable Register  */
+#define SPORT0_TCR1                    0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
+#define SPORT0_TCR2                    0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
+#define SPORT0_TCLKDIV                 0xFFC00808 /* SPORT0 Transmit Clock Divider */
+#define SPORT0_TFSDIV                  0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
+#define SPORT0_TX                      0xFFC00810 /* SPORT0 TX Data Register */
+#define SPORT0_RX                      0xFFC00818 /* SPORT0 RX Data Register */
+#define SPORT0_RCR1                    0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
+#define SPORT0_RCR2                    0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
+#define SPORT0_RCLKDIV                 0xFFC00828 /* SPORT0 Receive Clock Divider */
+#define SPORT0_RFSDIV                  0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
+#define SPORT0_STAT                    0xFFC00830 /* SPORT0 Status Register */
+#define SPORT0_CHNL                    0xFFC00834 /* SPORT0 Current Channel Register */
+#define SPORT0_MCMC1                   0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
+#define SPORT0_MCMC2                   0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
+#define SPORT0_MTCS0                   0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
+#define SPORT0_MTCS1                   0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
+#define SPORT0_MTCS2                   0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
+#define SPORT0_MTCS3                   0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
+#define SPORT0_MRCS0                   0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
+#define SPORT0_MRCS1                   0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
+#define SPORT0_MRCS2                   0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
+#define SPORT0_MRCS3                   0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
+#define SPORT1_TCR1                    0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
+#define SPORT1_TCR2                    0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
+#define SPORT1_TCLKDIV                 0xFFC00908 /* SPORT1 Transmit Clock Divider */
+#define SPORT1_TFSDIV                  0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
+#define SPORT1_TX                      0xFFC00910 /* SPORT1 TX Data Register */
+#define SPORT1_RX                      0xFFC00918 /* SPORT1 RX Data Register */
+#define SPORT1_RCR1                    0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
+#define SPORT1_RCR2                    0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
+#define SPORT1_RCLKDIV                 0xFFC00928 /* SPORT1 Receive Clock Divider */
+#define SPORT1_RFSDIV                  0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
+#define SPORT1_STAT                    0xFFC00930 /* SPORT1 Status Register */
+#define SPORT1_CHNL                    0xFFC00934 /* SPORT1 Current Channel Register */
+#define SPORT1_MCMC1                   0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
+#define SPORT1_MCMC2                   0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
+#define SPORT1_MTCS0                   0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
+#define SPORT1_MTCS1                   0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
+#define SPORT1_MTCS2                   0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
+#define SPORT1_MTCS3                   0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
+#define SPORT1_MRCS0                   0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
+#define SPORT1_MRCS1                   0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
+#define SPORT1_MRCS2                   0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
+#define SPORT1_MRCS3                   0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
+#define EBIU_AMGCTL                    0xFFC00A00 /* Asynchronous Memory Global Control Register */
+#define EBIU_AMBCTL0                   0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
+#define EBIU_AMBCTL1                   0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
+#define EBIU_SDGCTL                    0xFFC00A10 /* SDRAM Global Control Register */
+#define EBIU_SDBCTL                    0xFFC00A14 /* SDRAM Bank Control Register */
+#define EBIU_SDRRC                     0xFFC00A18 /* SDRAM Refresh Rate Control Register */
+#define EBIU_SDSTAT                    0xFFC00A1C /* SDRAM Status Register */
+#define DMA0_NEXT_DESC_PTR             0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
+#define DMA0_START_ADDR                0xFFC00C04 /* DMA Channel 0 Start Address Register */
+#define DMA0_CONFIG                    0xFFC00C08 /* DMA Channel 0 Configuration Register */
+#define DMA0_X_COUNT                   0xFFC00C10 /* DMA Channel 0 X Count Register */
+#define DMA0_X_MODIFY                  0xFFC00C14 /* DMA Channel 0 X Modify Register */
+#define DMA0_Y_COUNT                   0xFFC00C18 /* DMA Channel 0 Y Count Register */
+#define DMA0_Y_MODIFY                  0xFFC00C1C /* DMA Channel 0 Y Modify Register */
+#define DMA0_CURR_DESC_PTR             0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
+#define DMA0_CURR_ADDR                 0xFFC00C24 /* DMA Channel 0 Current Address Register */
+#define DMA0_IRQ_STATUS                0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
+#define DMA0_PERIPHERAL_MAP            0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
+#define DMA0_CURR_X_COUNT              0xFFC00C30 /* DMA Channel 0 Current X Count Register */
+#define DMA0_CURR_Y_COUNT              0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
+#define DMA1_NEXT_DESC_PTR             0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
+#define DMA1_START_ADDR                0xFFC00C44 /* DMA Channel 1 Start Address Register */
+#define DMA1_CONFIG                    0xFFC00C48 /* DMA Channel 1 Configuration Register */
+#define DMA1_X_COUNT                   0xFFC00C50 /* DMA Channel 1 X Count Register */
+#define DMA1_X_MODIFY                  0xFFC00C54 /* DMA Channel 1 X Modify Register */
+#define DMA1_Y_COUNT                   0xFFC00C58 /* DMA Channel 1 Y Count Register */
+#define DMA1_Y_MODIFY                  0xFFC00C5C /* DMA Channel 1 Y Modify Register */
+#define DMA1_CURR_DESC_PTR             0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
+#define DMA1_CURR_ADDR                 0xFFC00C64 /* DMA Channel 1 Current Address Register */
+#define DMA1_IRQ_STATUS                0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
+#define DMA1_PERIPHERAL_MAP            0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
+#define DMA1_CURR_X_COUNT              0xFFC00C70 /* DMA Channel 1 Current X Count Register */
+#define DMA1_CURR_Y_COUNT              0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
+#define DMA2_NEXT_DESC_PTR             0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
+#define DMA2_START_ADDR                0xFFC00C84 /* DMA Channel 2 Start Address Register */
+#define DMA2_CONFIG                    0xFFC00C88 /* DMA Channel 2 Configuration Register */
+#define DMA2_X_COUNT                   0xFFC00C90 /* DMA Channel 2 X Count Register */
+#define DMA2_X_MODIFY                  0xFFC00C94 /* DMA Channel 2 X Modify Register */
+#define DMA2_Y_COUNT                   0xFFC00C98 /* DMA Channel 2 Y Count Register */
+#define DMA2_Y_MODIFY                  0xFFC00C9C /* DMA Channel 2 Y Modify Register */
+#define DMA2_CURR_DESC_PTR             0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
+#define DMA2_CURR_ADDR                 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
+#define DMA2_IRQ_STATUS                0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
+#define DMA2_PERIPHERAL_MAP            0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
+#define DMA2_CURR_X_COUNT              0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
+#define DMA2_CURR_Y_COUNT              0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
+#define DMA3_NEXT_DESC_PTR             0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
+#define DMA3_START_ADDR                0xFFC00CC4 /* DMA Channel 3 Start Address Register */
+#define DMA3_CONFIG                    0xFFC00CC8 /* DMA Channel 3 Configuration Register */
+#define DMA3_X_COUNT                   0xFFC00CD0 /* DMA Channel 3 X Count Register */
+#define DMA3_X_MODIFY                  0xFFC00CD4 /* DMA Channel 3 X Modify Register */
+#define DMA3_Y_COUNT                   0xFFC00CD8 /* DMA Channel 3 Y Count Register */
+#define DMA3_Y_MODIFY                  0xFFC00CDC /* DMA Channel 3 Y Modify Register */
+#define DMA3_CURR_DESC_PTR             0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
+#define DMA3_CURR_ADDR                 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
+#define DMA3_IRQ_STATUS                0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
+#define DMA3_PERIPHERAL_MAP            0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
+#define DMA3_CURR_X_COUNT              0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
+#define DMA3_CURR_Y_COUNT              0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
+#define DMA4_NEXT_DESC_PTR             0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
+#define DMA4_START_ADDR                0xFFC00D04 /* DMA Channel 4 Start Address Register */
+#define DMA4_CONFIG                    0xFFC00D08 /* DMA Channel 4 Configuration Register */
+#define DMA4_X_COUNT                   0xFFC00D10 /* DMA Channel 4 X Count Register */
+#define DMA4_X_MODIFY                  0xFFC00D14 /* DMA Channel 4 X Modify Register */
+#define DMA4_Y_COUNT                   0xFFC00D18 /* DMA Channel 4 Y Count Register */
+#define DMA4_Y_MODIFY                  0xFFC00D1C /* DMA Channel 4 Y Modify Register */
+#define DMA4_CURR_DESC_PTR             0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
+#define DMA4_CURR_ADDR                 0xFFC00D24 /* DMA Channel 4 Current Address Register */
+#define DMA4_IRQ_STATUS                0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
+#define DMA4_PERIPHERAL_MAP            0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
+#define DMA4_CURR_X_COUNT              0xFFC00D30 /* DMA Channel 4 Current X Count Register */
+#define DMA4_CURR_Y_COUNT              0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
+#define DMA5_NEXT_DESC_PTR             0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
+#define DMA5_START_ADDR                0xFFC00D44 /* DMA Channel 5 Start Address Register */
+#define DMA5_CONFIG                    0xFFC00D48 /* DMA Channel 5 Configuration Register */
+#define DMA5_X_COUNT                   0xFFC00D50 /* DMA Channel 5 X Count Register */
+#define DMA5_X_MODIFY                  0xFFC00D54 /* DMA Channel 5 X Modify Register */
+#define DMA5_Y_COUNT                   0xFFC00D58 /* DMA Channel 5 Y Count Register */
+#define DMA5_Y_MODIFY                  0xFFC00D5C /* DMA Channel 5 Y Modify Register */
+#define DMA5_CURR_DESC_PTR             0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
+#define DMA5_CURR_ADDR                 0xFFC00D64 /* DMA Channel 5 Current Address Register */
+#define DMA5_IRQ_STATUS                0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
+#define DMA5_PERIPHERAL_MAP            0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
+#define DMA5_CURR_X_COUNT              0xFFC00D70 /* DMA Channel 5 Current X Count Register */
+#define DMA5_CURR_Y_COUNT              0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
+#define DMA6_NEXT_DESC_PTR             0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
+#define DMA6_START_ADDR                0xFFC00D84 /* DMA Channel 6 Start Address Register */
+#define DMA6_CONFIG                    0xFFC00D88 /* DMA Channel 6 Configuration Register */
+#define DMA6_X_COUNT                   0xFFC00D90 /* DMA Channel 6 X Count Register */
+#define DMA6_X_MODIFY                  0xFFC00D94 /* DMA Channel 6 X Modify Register */
+#define DMA6_Y_COUNT                   0xFFC00D98 /* DMA Channel 6 Y Count Register */
+#define DMA6_Y_MODIFY                  0xFFC00D9C /* DMA Channel 6 Y Modify Register */
+#define DMA6_CURR_DESC_PTR             0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
+#define DMA6_CURR_ADDR                 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
+#define DMA6_IRQ_STATUS                0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
+#define DMA6_PERIPHERAL_MAP            0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
+#define DMA6_CURR_X_COUNT              0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
+#define DMA6_CURR_Y_COUNT              0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
+#define DMA7_NEXT_DESC_PTR             0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
+#define DMA7_START_ADDR                0xFFC00DC4 /* DMA Channel 7 Start Address Register */
+#define DMA7_CONFIG                    0xFFC00DC8 /* DMA Channel 7 Configuration Register */
+#define DMA7_X_COUNT                   0xFFC00DD0 /* DMA Channel 7 X Count Register */
+#define DMA7_X_MODIFY                  0xFFC00DD4 /* DMA Channel 7 X Modify Register */
+#define DMA7_Y_COUNT                   0xFFC00DD8 /* DMA Channel 7 Y Count Register */
+#define DMA7_Y_MODIFY                  0xFFC00DDC /* DMA Channel 7 Y Modify Register */
+#define DMA7_CURR_DESC_PTR             0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
+#define DMA7_CURR_ADDR                 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
+#define DMA7_IRQ_STATUS                0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
+#define DMA7_PERIPHERAL_MAP            0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
+#define DMA7_CURR_X_COUNT              0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
+#define DMA7_CURR_Y_COUNT              0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
+#define DMA8_NEXT_DESC_PTR             0xFFC00E00 /* DMA Channel 8 Next Descriptor Pointer Register */
+#define DMA8_START_ADDR                0xFFC00E04 /* DMA Channel 8 Start Address Register */
+#define DMA8_CONFIG                    0xFFC00E08 /* DMA Channel 8 Configuration Register */
+#define DMA8_X_COUNT                   0xFFC00E10 /* DMA Channel 8 X Count Register */
+#define DMA8_X_MODIFY                  0xFFC00E14 /* DMA Channel 8 X Modify Register */
+#define DMA8_Y_COUNT                   0xFFC00E18 /* DMA Channel 8 Y Count Register */
+#define DMA8_Y_MODIFY                  0xFFC00E1C /* DMA Channel 8 Y Modify Register */
+#define DMA8_CURR_DESC_PTR             0xFFC00E20 /* DMA Channel 8 Current Descriptor Pointer Register */
+#define DMA8_CURR_ADDR                 0xFFC00E24 /* DMA Channel 8 Current Address Register */
+#define DMA8_IRQ_STATUS                0xFFC00E28 /* DMA Channel 8 Interrupt/Status Register */
+#define DMA8_PERIPHERAL_MAP            0xFFC00E2C /* DMA Channel 8 Peripheral Map Register */
+#define DMA8_CURR_X_COUNT              0xFFC00E30 /* DMA Channel 8 Current X Count Register */
+#define DMA8_CURR_Y_COUNT              0xFFC00E38 /* DMA Channel 8 Current Y Count Register */
+#define DMA9_NEXT_DESC_PTR             0xFFC00E40 /* DMA Channel 9 Next Descriptor Pointer Register */
+#define DMA9_START_ADDR                0xFFC00E44 /* DMA Channel 9 Start Address Register */
+#define DMA9_CONFIG                    0xFFC00E48 /* DMA Channel 9 Configuration Register */
+#define DMA9_X_COUNT                   0xFFC00E50 /* DMA Channel 9 X Count Register */
+#define DMA9_X_MODIFY                  0xFFC00E54 /* DMA Channel 9 X Modify Register */
+#define DMA9_Y_COUNT                   0xFFC00E58 /* DMA Channel 9 Y Count Register */
+#define DMA9_Y_MODIFY                  0xFFC00E5C /* DMA Channel 9 Y Modify Register */
+#define DMA9_CURR_DESC_PTR             0xFFC00E60 /* DMA Channel 9 Current Descriptor Pointer Register */
+#define DMA9_CURR_ADDR                 0xFFC00E64 /* DMA Channel 9 Current Address Register */
+#define DMA9_IRQ_STATUS                0xFFC00E68 /* DMA Channel 9 Interrupt/Status Register */
+#define DMA9_PERIPHERAL_MAP            0xFFC00E6C /* DMA Channel 9 Peripheral Map Register */
+#define DMA9_CURR_X_COUNT              0xFFC00E70 /* DMA Channel 9 Current X Count Register */
+#define DMA9_CURR_Y_COUNT              0xFFC00E78 /* DMA Channel 9 Current Y Count Register */
+#define DMA10_NEXT_DESC_PTR            0xFFC00E80 /* DMA Channel 10 Next Descriptor Pointer Register */
+#define DMA10_START_ADDR               0xFFC00E84 /* DMA Channel 10 Start Address Register */
+#define DMA10_CONFIG                   0xFFC00E88 /* DMA Channel 10 Configuration Register */
+#define DMA10_X_COUNT                  0xFFC00E90 /* DMA Channel 10 X Count Register */
+#define DMA10_X_MODIFY                 0xFFC00E94 /* DMA Channel 10 X Modify Register */
+#define DMA10_Y_COUNT                  0xFFC00E98 /* DMA Channel 10 Y Count Register */
+#define DMA10_Y_MODIFY                 0xFFC00E9C /* DMA Channel 10 Y Modify Register */
+#define DMA10_CURR_DESC_PTR            0xFFC00EA0 /* DMA Channel 10 Current Descriptor Pointer Register */
+#define DMA10_CURR_ADDR                0xFFC00EA4 /* DMA Channel 10 Current Address Register */
+#define DMA10_IRQ_STATUS               0xFFC00EA8 /* DMA Channel 10 Interrupt/Status Register */
+#define DMA10_PERIPHERAL_MAP           0xFFC00EAC /* DMA Channel 10 Peripheral Map Register */
+#define DMA10_CURR_X_COUNT             0xFFC00EB0 /* DMA Channel 10 Current X Count Register */
+#define DMA10_CURR_Y_COUNT             0xFFC00EB8 /* DMA Channel 10 Current Y Count Register */
+#define DMA11_NEXT_DESC_PTR            0xFFC00EC0 /* DMA Channel 11 Next Descriptor Pointer Register */
+#define DMA11_START_ADDR               0xFFC00EC4 /* DMA Channel 11 Start Address Register */
+#define DMA11_CONFIG                   0xFFC00EC8 /* DMA Channel 11 Configuration Register */
+#define DMA11_X_COUNT                  0xFFC00ED0 /* DMA Channel 11 X Count Register */
+#define DMA11_X_MODIFY                 0xFFC00ED4 /* DMA Channel 11 X Modify Register */
+#define DMA11_Y_COUNT                  0xFFC00ED8 /* DMA Channel 11 Y Count Register */
+#define DMA11_Y_MODIFY                 0xFFC00EDC /* DMA Channel 11 Y Modify Register */
+#define DMA11_CURR_DESC_PTR            0xFFC00EE0 /* DMA Channel 11 Current Descriptor Pointer Register */
+#define DMA11_CURR_ADDR                0xFFC00EE4 /* DMA Channel 11 Current Address Register */
+#define DMA11_IRQ_STATUS               0xFFC00EE8 /* DMA Channel 11 Interrupt/Status Register */
+#define DMA11_PERIPHERAL_MAP           0xFFC00EEC /* DMA Channel 11 Peripheral Map Register */
+#define DMA11_CURR_X_COUNT             0xFFC00EF0 /* DMA Channel 11 Current X Count Register */
+#define DMA11_CURR_Y_COUNT             0xFFC00EF8 /* DMA Channel 11 Current Y Count Register */
+#define MDMA_S0_NEXT_DESC_PTR          0xFFC00F40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
+#define MDMA_S0_START_ADDR             0xFFC00F44 /* MemDMA Stream 0 Source Start Address Register */
+#define MDMA_S0_CONFIG                 0xFFC00F48 /* MemDMA Stream 0 Source Configuration Register */
+#define MDMA_S0_X_COUNT                0xFFC00F50 /* MemDMA Stream 0 Source X Count Register */
+#define MDMA_S0_X_MODIFY               0xFFC00F54 /* MemDMA Stream 0 Source X Modify Register */
+#define MDMA_S0_Y_COUNT                0xFFC00F58 /* MemDMA Stream 0 Source Y Count Register */
+#define MDMA_S0_Y_MODIFY               0xFFC00F5C /* MemDMA Stream 0 Source Y Modify Register */
+#define MDMA_S0_CURR_DESC_PTR          0xFFC00F60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
+#define MDMA_S0_CURR_ADDR              0xFFC00F64 /* MemDMA Stream 0 Source Current Address Register */
+#define MDMA_S0_IRQ_STATUS             0xFFC00F68 /* MemDMA Stream 0 Source Interrupt/Status Register */
+#define MDMA_S0_PERIPHERAL_MAP         0xFFC00F6C /* MemDMA Stream 0 Source Peripheral Map Register */
+#define MDMA_S0_CURR_X_COUNT           0xFFC00F70 /* MemDMA Stream 0 Source Current X Count Register */
+#define MDMA_S0_CURR_Y_COUNT           0xFFC00F78 /* MemDMA Stream 0 Source Current Y Count Register */
+#define MDMA_D0_NEXT_DESC_PTR          0xFFC00F00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
+#define MDMA_D0_START_ADDR             0xFFC00F04 /* MemDMA Stream 0 Destination Start Address Register */
+#define MDMA_D0_CONFIG                 0xFFC00F08 /* MemDMA Stream 0 Destination Configuration Register */
+#define MDMA_D0_X_COUNT                0xFFC00F10 /* MemDMA Stream 0 Destination X Count Register */
+#define MDMA_D0_X_MODIFY               0xFFC00F14 /* MemDMA Stream 0 Destination X Modify Register */
+#define MDMA_D0_Y_COUNT                0xFFC00F18 /* MemDMA Stream 0 Destination Y Count Register */
+#define MDMA_D0_Y_MODIFY               0xFFC00F1C /* MemDMA Stream 0 Destination Y Modify Register */
+#define MDMA_D0_CURR_DESC_PTR          0xFFC00F20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
+#define MDMA_D0_CURR_ADDR              0xFFC00F24 /* MemDMA Stream 0 Destination Current Address Register */
+#define MDMA_D0_IRQ_STATUS             0xFFC00F28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
+#define MDMA_D0_PERIPHERAL_MAP         0xFFC00F2C /* MemDMA Stream 0 Destination Peripheral Map Register */
+#define MDMA_D0_CURR_X_COUNT           0xFFC00F30 /* MemDMA Stream 0 Destination Current X Count Register */
+#define MDMA_D0_CURR_Y_COUNT           0xFFC00F38 /* MemDMA Stream 0 Destination Current Y Count Register */
+#define MDMA_S1_NEXT_DESC_PTR          0xFFC00FC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
+#define MDMA_S1_START_ADDR             0xFFC00FC4 /* MemDMA Stream 1 Source Start Address Register */
+#define MDMA_S1_CONFIG                 0xFFC00FC8 /* MemDMA Stream 1 Source Configuration Register */
+#define MDMA_S1_X_COUNT                0xFFC00FD0 /* MemDMA Stream 1 Source X Count Register */
+#define MDMA_S1_X_MODIFY               0xFFC00FD4 /* MemDMA Stream 1 Source X Modify Register */
+#define MDMA_S1_Y_COUNT                0xFFC00FD8 /* MemDMA Stream 1 Source Y Count Register */
+#define MDMA_S1_Y_MODIFY               0xFFC00FDC /* MemDMA Stream 1 Source Y Modify Register */
+#define MDMA_S1_CURR_DESC_PTR          0xFFC00FE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
+#define MDMA_S1_CURR_ADDR              0xFFC00FE4 /* MemDMA Stream 1 Source Current Address Register */
+#define MDMA_S1_IRQ_STATUS             0xFFC00FE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
+#define MDMA_S1_PERIPHERAL_MAP         0xFFC00FEC /* MemDMA Stream 1 Source Peripheral Map Register */
+#define MDMA_S1_CURR_X_COUNT           0xFFC00FF0 /* MemDMA Stream 1 Source Current X Count Register */
+#define MDMA_S1_CURR_Y_COUNT           0xFFC00FF8 /* MemDMA Stream 1 Source Current Y Count Register */
+#define MDMA_D1_NEXT_DESC_PTR          0xFFC00F80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
+#define MDMA_D1_START_ADDR             0xFFC00F84 /* MemDMA Stream 1 Destination Start Address Register */
+#define MDMA_D1_CONFIG                 0xFFC00F88 /* MemDMA Stream 1 Destination Configuration Register */
+#define MDMA_D1_X_COUNT                0xFFC00F90 /* MemDMA Stream 1 Destination X Count Register */
+#define MDMA_D1_X_MODIFY               0xFFC00F94 /* MemDMA Stream 1 Destination X Modify Register */
+#define MDMA_D1_Y_COUNT                0xFFC00F98 /* MemDMA Stream 1 Destination Y Count Register */
+#define MDMA_D1_Y_MODIFY               0xFFC00F9C /* MemDMA Stream 1 Destination Y Modify Register */
+#define MDMA_D1_CURR_DESC_PTR          0xFFC00FA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
+#define MDMA_D1_CURR_ADDR              0xFFC00FA4 /* MemDMA Stream 1 Destination Current Address Register */
+#define MDMA_D1_IRQ_STATUS             0xFFC00FA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
+#define MDMA_D1_PERIPHERAL_MAP         0xFFC00FAC /* MemDMA Stream 1 Destination Peripheral Map Register */
+#define MDMA_D1_CURR_X_COUNT           0xFFC00FB0 /* MemDMA Stream 1 Destination Current X Count Register */
+#define MDMA_D1_CURR_Y_COUNT           0xFFC00FB8 /* MemDMA Stream 1 Destination Current Y Count Register */
+#define PPI_CONTROL                    0xFFC01000 /* PPI Control Register */
+#define PPI_STATUS                     0xFFC01004 /* PPI Status Register */
+#define PPI_COUNT                      0xFFC01008 /* PPI Transfer Count Register */
+#define PPI_DELAY                      0xFFC0100C /* PPI Delay Count Register */
+#define PPI_FRAME                      0xFFC01010 /* PPI Frame Length Register */
+#define TWI_CLKDIV                     0xFFC01400 /* Serial Clock Divider Register */
+#define TWI_CONTROL                    0xFFC01404 /* TWI Control Register */
+#define TWI_SLAVE_CTL                  0xFFC01408 /* Slave Mode Control Register */
+#define TWI_SLAVE_STAT                 0xFFC0140C /* Slave Mode Status Register */
+#define TWI_SLAVE_ADDR                 0xFFC01410 /* Slave Mode Address Register */
+#define TWI_MASTER_CTL                 0xFFC01414 /* Master Mode Control Register */
+#define TWI_MASTER_STAT                0xFFC01418 /* Master Mode Status Register */
+#define TWI_MASTER_ADDR                0xFFC0141C /* Master Mode Address Register */
+#define TWI_INT_STAT                   0xFFC01420 /* TWI Interrupt Status Register */
+#define TWI_INT_MASK                   0xFFC01424 /* TWI Master Interrupt Mask Register */
+#define TWI_FIFO_CTL                   0xFFC01428 /* FIFO Control Register */
+#define TWI_FIFO_STAT                  0xFFC0142C /* FIFO Status Register */
+#define TWI_XMT_DATA8                  0xFFC01480 /* FIFO Transmit Data Single Byte Register */
+#define TWI_XMT_DATA16                 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
+#define TWI_RCV_DATA8                  0xFFC01488 /* FIFO Receive Data Single Byte Register */
+#define TWI_RCV_DATA16                 0xFFC0148C /* FIFO Receive Data Double Byte Register */
+#define PORTGIO                        0xFFC01500 /* Port G I/O Pin State Specify Register */
+#define PORTGIO_CLEAR                  0xFFC01504 /* Port G I/O Peripheral Interrupt Clear Register */
+#define PORTGIO_SET                    0xFFC01508 /* Port G I/O Peripheral Interrupt Set Register */
+#define PORTGIO_TOGGLE                 0xFFC0150C /* Port G I/O Pin State Toggle Register */
+#define PORTGIO_MASKA                  0xFFC01510 /* Port G I/O Mask State Specify Interrupt A Register */
+#define PORTGIO_MASKA_CLEAR            0xFFC01514 /* Port G I/O Mask Disable Interrupt A Register */
+#define PORTGIO_MASKA_SET              0xFFC01518 /* Port G I/O Mask Enable Interrupt A Register */
+#define PORTGIO_MASKA_TOGGLE           0xFFC0151C /* Port G I/O Mask Toggle Enable Interrupt A Register */
+#define PORTGIO_MASKB                  0xFFC01520 /* Port G I/O Mask State Specify Interrupt B Register */
+#define PORTGIO_MASKB_CLEAR            0xFFC01524 /* Port G I/O Mask Disable Interrupt B Register */
+#define PORTGIO_MASKB_SET              0xFFC01528 /* Port G I/O Mask Enable Interrupt B Register */
+#define PORTGIO_MASKB_TOGGLE           0xFFC0152C /* Port G I/O Mask Toggle Enable Interrupt B Register */
+#define PORTGIO_DIR                    0xFFC01530 /* Port G I/O Direction Register */
+#define PORTGIO_POLAR                  0xFFC01534 /* Port G I/O Source Polarity Register */
+#define PORTGIO_EDGE                   0xFFC01538 /* Port G I/O Source Sensitivity Register */
+#define PORTGIO_BOTH                   0xFFC0153C /* Port G I/O Set on BOTH Edges Register */
+#define PORTGIO_INEN                   0xFFC01540 /* Port G I/O Input Enable Register */
+#define PORTHIO                        0xFFC01700 /* Port H I/O Pin State Specify Register */
+#define PORTHIO_CLEAR                  0xFFC01704 /* Port H I/O Peripheral Interrupt Clear Register */
+#define PORTHIO_SET                    0xFFC01708 /* Port H I/O Peripheral Interrupt Set Register */
+#define PORTHIO_TOGGLE                 0xFFC0170C /* Port H I/O Pin State Toggle Register */
+#define PORTHIO_MASKA                  0xFFC01710 /* Port H I/O Mask State Specify Interrupt A Register */
+#define PORTHIO_MASKA_CLEAR            0xFFC01714 /* Port H I/O Mask Disable Interrupt A Register */
+#define PORTHIO_MASKA_SET              0xFFC01718 /* Port H I/O Mask Enable Interrupt A Register */
+#define PORTHIO_MASKA_TOGGLE           0xFFC0171C /* Port H I/O Mask Toggle Enable Interrupt A Register */
+#define PORTHIO_MASKB                  0xFFC01720 /* Port H I/O Mask State Specify Interrupt B Register */
+#define PORTHIO_MASKB_CLEAR            0xFFC01724 /* Port H I/O Mask Disable Interrupt B Register */
+#define PORTHIO_MASKB_SET              0xFFC01728 /* Port H I/O Mask Enable Interrupt B Register */
+#define PORTHIO_MASKB_TOGGLE           0xFFC0172C /* Port H I/O Mask Toggle Enable Interrupt B Register */
+#define PORTHIO_DIR                    0xFFC01730 /* Port H I/O Direction Register */
+#define PORTHIO_POLAR                  0xFFC01734 /* Port H I/O Source Polarity Register */
+#define PORTHIO_EDGE                   0xFFC01738 /* Port H I/O Source Sensitivity Register */
+#define PORTHIO_BOTH                   0xFFC0173C /* Port H I/O Set on BOTH Edges Register */
+#define PORTHIO_INEN                   0xFFC01740 /* Port H I/O Input Enable Register */
+#define UART1_THR                      0xFFC02000 /* Transmit Holding register */
+#define UART1_RBR                      0xFFC02000 /* Receive Buffer register */
+#define UART1_DLL                      0xFFC02000 /* Divisor Latch (Low-Byte) */
+#define UART1_IER                      0xFFC02004 /* Interrupt Enable Register */
+#define UART1_DLH                      0xFFC02004 /* Divisor Latch (High-Byte) */
+#define UART1_IIR                      0xFFC02008 /* Interrupt Identification Register */
+#define UART1_LCR                      0xFFC0200C /* Line Control Register */
+#define UART1_MCR                      0xFFC02010 /* Modem Control Register */
+#define UART1_LSR                      0xFFC02014 /* Line Status Register */
+#define UART1_MSR                      0xFFC02018 /* Modem Status Register */
+#define UART1_SCR                      0xFFC0201C /* SCR Scratch Register */
+#define UART1_GCTL                     0xFFC02024 /* Global Control Register */
+#define PORTF_FER                      0xFFC03200 /* Port F Function Enable Register (Alternate/Flag*) */
+#define PORTG_FER                      0xFFC03204 /* Port G Function Enable Register (Alternate/Flag*) */
+#define PORTH_FER                      0xFFC03208 /* Port H Function Enable Register (Alternate/Flag*) */
+#define HMDMA0_CONTROL                 0xFFC03300 /* Handshake MDMA0 Control Register */
+#define HMDMA0_ECINIT                  0xFFC03304 /* HMDMA0 Initial Edge Count Register */
+#define HMDMA0_BCINIT                  0xFFC03308 /* HMDMA0 Initial Block Count Register */
+#define HMDMA0_ECURGENT                0xFFC0330C /* HMDMA0 Urgent Edge Count Threshhold Register */
+#define HMDMA0_ECOVERFLOW              0xFFC03310 /* HMDMA0 Edge Count Overflow Interrupt Register */
+#define HMDMA0_ECOUNT                  0xFFC03314 /* HMDMA0 Current Edge Count Register */
+#define HMDMA0_BCOUNT                  0xFFC03318 /* HMDMA0 Current Block Count Register */
+#define HMDMA1_CONTROL                 0xFFC03340 /* Handshake MDMA1 Control Register */
+#define HMDMA1_ECINIT                  0xFFC03344 /* HMDMA1 Initial Edge Count Register */
+#define HMDMA1_BCINIT                  0xFFC03348 /* HMDMA1 Initial Block Count Register */
+#define HMDMA1_ECURGENT                0xFFC0334C /* HMDMA1 Urgent Edge Count Threshhold Register */
+#define HMDMA1_ECOVERFLOW              0xFFC03350 /* HMDMA1 Edge Count Overflow Interrupt Register */
+#define HMDMA1_ECOUNT                  0xFFC03354 /* HMDMA1 Current Edge Count Register */
+#define HMDMA1_BCOUNT                  0xFFC03358 /* HMDMA1 Current Block Count Register */
+#define PORTF_MUX                      0xFFC03210 /* Port F mux control */
+#define PORTG_MUX                      0xFFC03214 /* Port G mux control */
+#define PORTH_MUX                      0xFFC03218 /* Port H mux control */
+#define PORTF_DRIVE                    0xFFC03220 /* Port F drive strength control */
+#define PORTG_DRIVE                    0xFFC03224 /* Port G drive strength control */
+#define PORTH_DRIVE                    0xFFC03228 /* Port H drive strength control */
+#define PORTF_SLEW                     0xFFC03230 /* Port F slew control */
+#define PORTG_SLEW                     0xFFC03234 /* Port G slew control */
+#define PORTH_SLEW                     0xFFC03238 /* Port H slew control */
+#define PORTF_HYSTERESIS               0xFFC03240 /* Port F Schmitt trigger control */
+#define PORTG_HYSTERESIS               0xFFC03244 /* Port G Schmitt trigger control */
+#define PORTH_HYSTERESIS               0xFFC03248 /* Port H Schmitt trigger control */
+#define NONGPIO_DRIVE                  0xFFC03280 /* Non-GPIO Port drive strength control */
+#define NONGPIO_SLEW                   0xFFC03284 /* Non-GPIO Port slew control */
+#define NONGPIO_HYSTERESIS             0xFFC03288 /* Non-GPIO Port Schmitt trigger control */
+#define HOST_CONTROL                   0xFFC03400 /* HOST Control Register */
+#define HOST_STATUS                    0xFFC03404 /* HOST Status Register */
+#define HOST_TIMEOUT                   0xFFC03408 /* HOST Acknowledge Mode Timeout Register */
+#define CNT_CONFIG                     0xFFC03500 /* Configuration/Control Register */
+#define CNT_IMASK                      0xFFC03504 /* Interrupt Mask Register */
+#define CNT_STATUS                     0xFFC03508 /* Status Register */
+#define CNT_COMMAND                    0xFFC0350C /* Command Register */
+#define CNT_DEBOUNCE                   0xFFC03510 /* Debounce Prescaler Register */
+#define CNT_COUNTER                    0xFFC03514 /* Counter Register */
+#define CNT_MAX                        0xFFC03518 /* Maximal Count Boundary Value Register */
+#define CNT_MIN                        0xFFC0351C /* Minimal Count Boundary Value Register */
+#define OTP_CONTROL                    0xFFC03600 /* OTP/Fuse Control Register */
+#define OTP_BEN                        0xFFC03604 /* OTP/Fuse Byte Enable */
+#define OTP_STATUS                     0xFFC03608 /* OTP/Fuse Status */
+#define OTP_TIMING                     0xFFC0360C /* OTP/Fuse Access Timing */
+#define SECURE_SYSSWT                  0xFFC03620 /* Secure System Switches */
+#define SECURE_CONTROL                 0xFFC03624 /* Secure Control */
+#define SECURE_STATUS                  0xFFC03628 /* Secure Status */
+#define OTP_DATA0                      0xFFC03680 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
+#define OTP_DATA1                      0xFFC03684 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
+#define OTP_DATA2                      0xFFC03688 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
+#define OTP_DATA3                      0xFFC0368C /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
+#define NFC_CTL                        0xFFC03700 /* NAND Control Register */
+#define NFC_STAT                       0xFFC03704 /* NAND Status Register */
+#define NFC_IRQSTAT                    0xFFC03708 /* NAND Interrupt Status Register */
+#define NFC_IRQMASK                    0xFFC0370C /* NAND Interrupt Mask Register */
+#define NFC_ECC0                       0xFFC03710 /* NAND ECC Register 0 */
+#define NFC_ECC1                       0xFFC03714 /* NAND ECC Register 1 */
+#define NFC_ECC2                       0xFFC03718 /* NAND ECC Register 2 */
+#define NFC_ECC3                       0xFFC0371C /* NAND ECC Register 3 */
+#define NFC_COUNT                      0xFFC03720 /* NAND ECC Count Register */
+#define NFC_RST                        0xFFC03724 /* NAND ECC Reset Register */
+#define NFC_PGCTL                      0xFFC03728 /* NAND Page Control Register */
+#define NFC_READ                       0xFFC0372C /* NAND Read Data Register */
+#define NFC_ADDR                       0xFFC03740 /* NAND Address Register */
+#define NFC_CMD                        0xFFC03744 /* NAND Command Register */
+#define NFC_DATA_WR                    0xFFC03748 /* NAND Data Write Register */
+#define NFC_DATA_RD                    0xFFC0374C /* NAND Data Read Register */
+#define DMA_TC_CNT                     0xFFC00B0C
+#define DMA_TC_PER                     0xFFC00B10
 
 #endif /* __BFIN_DEF_ADSP_BF522_proc__ */
index 25612bfdda4ae7cee8941849d89bde34cba4923b..060dce31a2b2353a9c23af96c09eefea5db57147 100644 (file)
@@ -6,26 +6,8 @@
 #ifndef __BFIN_CDEF_ADSP_BF524_proc__
 #define __BFIN_CDEF_ADSP_BF524_proc__
 
-#include "../mach-common/ADSP-EDN-core_cdef.h"
+#include "BF522_cdef.h"
 
-#include "ADSP-EDN-BF52x-extended_cdef.h"
-
-#define bfin_read_PLL_CTL()            bfin_read16(PLL_CTL)
-#define bfin_write_PLL_CTL(val)        bfin_write16(PLL_CTL, val)
-#define bfin_read_PLL_DIV()            bfin_read16(PLL_DIV)
-#define bfin_write_PLL_DIV(val)        bfin_write16(PLL_DIV, val)
-#define bfin_read_VR_CTL()             bfin_read16(VR_CTL)
-#define bfin_write_VR_CTL(val)         bfin_write16(VR_CTL, val)
-#define bfin_read_PLL_STAT()           bfin_read16(PLL_STAT)
-#define bfin_write_PLL_STAT(val)       bfin_write16(PLL_STAT, val)
-#define bfin_read_PLL_LOCKCNT()        bfin_read16(PLL_LOCKCNT)
-#define bfin_write_PLL_LOCKCNT(val)    bfin_write16(PLL_LOCKCNT, val)
-#define bfin_read_CHIPID()             bfin_read32(CHIPID)
-#define bfin_write_CHIPID(val)         bfin_write32(CHIPID, val)
-#define bfin_read_SWRST()              bfin_read16(SWRST)
-#define bfin_write_SWRST(val)          bfin_write16(SWRST, val)
-#define bfin_read_SYSCR()              bfin_read16(SYSCR)
-#define bfin_write_SYSCR(val)          bfin_write16(SYSCR, val)
 #define bfin_read_USB_FADDR()          bfin_read16(USB_FADDR)
 #define bfin_write_USB_FADDR(val)      bfin_write16(USB_FADDR, val)
 #define bfin_read_USB_POWER()          bfin_read16(USB_POWER)
index 0a0056adb06c4479ecb2b4c5ac6b2c4a565163f2..f0e77166a7c44fa2c47c0a93adb1cd9555f7f7f7 100644 (file)
@@ -6,18 +6,8 @@
 #ifndef __BFIN_DEF_ADSP_BF524_proc__
 #define __BFIN_DEF_ADSP_BF524_proc__
 
-#include "../mach-common/ADSP-EDN-core_def.h"
+#include "BF522_def.h"
 
-#include "ADSP-EDN-BF52x-extended_def.h"
-
-#define PLL_CTL                        0xFFC00000 /* PLL Control Register */
-#define PLL_DIV                        0xFFC00004 /* PLL Divide Register */
-#define VR_CTL                         0xFFC00008 /* Voltage Regulator Control Register */
-#define PLL_STAT                       0xFFC0000C /* PLL Status Register */
-#define PLL_LOCKCNT                    0xFFC00010 /* PLL Lock Count Register */
-#define CHIPID                         0xFFC00014
-#define SWRST                          0xFFC00100 /* Software Reset Register */
-#define SYSCR                          0xFFC00104 /* System Configuration register */
 #define USB_FADDR                      0xFFC03800 /* Function address register */
 #define USB_POWER                      0xFFC03804 /* Power management register */
 #define USB_INTRTX                     0xFFC03808 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
index aa320ac8c42924432e2cafb5aa30635d3f509ccc..515acd3285e71c403c8b2c2bfc9a3bae8fb3a2ac 100644 (file)
@@ -6,26 +6,8 @@
 #ifndef __BFIN_CDEF_ADSP_BF526_proc__
 #define __BFIN_CDEF_ADSP_BF526_proc__
 
-#include "../mach-common/ADSP-EDN-core_cdef.h"
+#include "BF524_cdef.h"
 
-#include "ADSP-EDN-BF52x-extended_cdef.h"
-
-#define bfin_read_PLL_CTL()            bfin_read16(PLL_CTL)
-#define bfin_write_PLL_CTL(val)        bfin_write16(PLL_CTL, val)
-#define bfin_read_PLL_DIV()            bfin_read16(PLL_DIV)
-#define bfin_write_PLL_DIV(val)        bfin_write16(PLL_DIV, val)
-#define bfin_read_VR_CTL()             bfin_read16(VR_CTL)
-#define bfin_write_VR_CTL(val)         bfin_write16(VR_CTL, val)
-#define bfin_read_PLL_STAT()           bfin_read16(PLL_STAT)
-#define bfin_write_PLL_STAT(val)       bfin_write16(PLL_STAT, val)
-#define bfin_read_PLL_LOCKCNT()        bfin_read16(PLL_LOCKCNT)
-#define bfin_write_PLL_LOCKCNT(val)    bfin_write16(PLL_LOCKCNT, val)
-#define bfin_read_CHIPID()             bfin_read32(CHIPID)
-#define bfin_write_CHIPID(val)         bfin_write32(CHIPID, val)
-#define bfin_read_SWRST()              bfin_read16(SWRST)
-#define bfin_write_SWRST(val)          bfin_write16(SWRST, val)
-#define bfin_read_SYSCR()              bfin_read16(SYSCR)
-#define bfin_write_SYSCR(val)          bfin_write16(SYSCR, val)
 #define bfin_read_EMAC_OPMODE()        bfin_read32(EMAC_OPMODE)
 #define bfin_write_EMAC_OPMODE(val)    bfin_write32(EMAC_OPMODE, val)
 #define bfin_read_EMAC_ADDRLO()        bfin_read32(EMAC_ADDRLO)
 #define bfin_write_EMAC_TXC_GE1024(val) bfin_write32(EMAC_TXC_GE1024, val)
 #define bfin_read_EMAC_TXC_ABORT()     bfin_read32(EMAC_TXC_ABORT)
 #define bfin_write_EMAC_TXC_ABORT(val) bfin_write32(EMAC_TXC_ABORT, val)
-#define bfin_read_USB_FADDR()          bfin_read16(USB_FADDR)
-#define bfin_write_USB_FADDR(val)      bfin_write16(USB_FADDR, val)
-#define bfin_read_USB_POWER()          bfin_read16(USB_POWER)
-#define bfin_write_USB_POWER(val)      bfin_write16(USB_POWER, val)
-#define bfin_read_USB_INTRTX()         bfin_read16(USB_INTRTX)
-#define bfin_write_USB_INTRTX(val)     bfin_write16(USB_INTRTX, val)
-#define bfin_read_USB_INTRRX()         bfin_read16(USB_INTRRX)
-#define bfin_write_USB_INTRRX(val)     bfin_write16(USB_INTRRX, val)
-#define bfin_read_USB_INTRTXE()        bfin_read16(USB_INTRTXE)
-#define bfin_write_USB_INTRTXE(val)    bfin_write16(USB_INTRTXE, val)
-#define bfin_read_USB_INTRRXE()        bfin_read16(USB_INTRRXE)
-#define bfin_write_USB_INTRRXE(val)    bfin_write16(USB_INTRRXE, val)
-#define bfin_read_USB_INTRUSB()        bfin_read16(USB_INTRUSB)
-#define bfin_write_USB_INTRUSB(val)    bfin_write16(USB_INTRUSB, val)
-#define bfin_read_USB_INTRUSBE()       bfin_read16(USB_INTRUSBE)
-#define bfin_write_USB_INTRUSBE(val)   bfin_write16(USB_INTRUSBE, val)
-#define bfin_read_USB_FRAME()          bfin_read16(USB_FRAME)
-#define bfin_write_USB_FRAME(val)      bfin_write16(USB_FRAME, val)
-#define bfin_read_USB_INDEX()          bfin_read16(USB_INDEX)
-#define bfin_write_USB_INDEX(val)      bfin_write16(USB_INDEX, val)
-#define bfin_read_USB_TESTMODE()       bfin_read16(USB_TESTMODE)
-#define bfin_write_USB_TESTMODE(val)   bfin_write16(USB_TESTMODE, val)
-#define bfin_read_USB_GLOBINTR()       bfin_read16(USB_GLOBINTR)
-#define bfin_write_USB_GLOBINTR(val)   bfin_write16(USB_GLOBINTR, val)
-#define bfin_read_USB_GLOBAL_CTL()     bfin_read16(USB_GLOBAL_CTL)
-#define bfin_write_USB_GLOBAL_CTL(val) bfin_write16(USB_GLOBAL_CTL, val)
-#define bfin_read_USB_TX_MAX_PACKET()  bfin_read16(USB_TX_MAX_PACKET)
-#define bfin_write_USB_TX_MAX_PACKET(val) bfin_write16(USB_TX_MAX_PACKET, val)
-#define bfin_read_USB_CSR0()           bfin_read16(USB_CSR0)
-#define bfin_write_USB_CSR0(val)       bfin_write16(USB_CSR0, val)
-#define bfin_read_USB_TXCSR()          bfin_read16(USB_TXCSR)
-#define bfin_write_USB_TXCSR(val)      bfin_write16(USB_TXCSR, val)
-#define bfin_read_USB_RX_MAX_PACKET()  bfin_read16(USB_RX_MAX_PACKET)
-#define bfin_write_USB_RX_MAX_PACKET(val) bfin_write16(USB_RX_MAX_PACKET, val)
-#define bfin_read_USB_RXCSR()          bfin_read16(USB_RXCSR)
-#define bfin_write_USB_RXCSR(val)      bfin_write16(USB_RXCSR, val)
-#define bfin_read_USB_COUNT0()         bfin_read16(USB_COUNT0)
-#define bfin_write_USB_COUNT0(val)     bfin_write16(USB_COUNT0, val)
-#define bfin_read_USB_RXCOUNT()        bfin_read16(USB_RXCOUNT)
-#define bfin_write_USB_RXCOUNT(val)    bfin_write16(USB_RXCOUNT, val)
-#define bfin_read_USB_TXTYPE()         bfin_read16(USB_TXTYPE)
-#define bfin_write_USB_TXTYPE(val)     bfin_write16(USB_TXTYPE, val)
-#define bfin_read_USB_NAKLIMIT0()      bfin_read16(USB_NAKLIMIT0)
-#define bfin_write_USB_NAKLIMIT0(val)  bfin_write16(USB_NAKLIMIT0, val)
-#define bfin_read_USB_TXINTERVAL()     bfin_read16(USB_TXINTERVAL)
-#define bfin_write_USB_TXINTERVAL(val) bfin_write16(USB_TXINTERVAL, val)
-#define bfin_read_USB_RXTYPE()         bfin_read16(USB_RXTYPE)
-#define bfin_write_USB_RXTYPE(val)     bfin_write16(USB_RXTYPE, val)
-#define bfin_read_USB_RXINTERVAL()     bfin_read16(USB_RXINTERVAL)
-#define bfin_write_USB_RXINTERVAL(val) bfin_write16(USB_RXINTERVAL, val)
-#define bfin_read_USB_TXCOUNT()        bfin_read16(USB_TXCOUNT)
-#define bfin_write_USB_TXCOUNT(val)    bfin_write16(USB_TXCOUNT, val)
-#define bfin_read_USB_EP0_FIFO()       bfin_read16(USB_EP0_FIFO)
-#define bfin_write_USB_EP0_FIFO(val)   bfin_write16(USB_EP0_FIFO, val)
-#define bfin_read_USB_EP1_FIFO()       bfin_read16(USB_EP1_FIFO)
-#define bfin_write_USB_EP1_FIFO(val)   bfin_write16(USB_EP1_FIFO, val)
-#define bfin_read_USB_EP2_FIFO()       bfin_read16(USB_EP2_FIFO)
-#define bfin_write_USB_EP2_FIFO(val)   bfin_write16(USB_EP2_FIFO, val)
-#define bfin_read_USB_EP3_FIFO()       bfin_read16(USB_EP3_FIFO)
-#define bfin_write_USB_EP3_FIFO(val)   bfin_write16(USB_EP3_FIFO, val)
-#define bfin_read_USB_EP4_FIFO()       bfin_read16(USB_EP4_FIFO)
-#define bfin_write_USB_EP4_FIFO(val)   bfin_write16(USB_EP4_FIFO, val)
-#define bfin_read_USB_EP5_FIFO()       bfin_read16(USB_EP5_FIFO)
-#define bfin_write_USB_EP5_FIFO(val)   bfin_write16(USB_EP5_FIFO, val)
-#define bfin_read_USB_EP6_FIFO()       bfin_read16(USB_EP6_FIFO)
-#define bfin_write_USB_EP6_FIFO(val)   bfin_write16(USB_EP6_FIFO, val)
-#define bfin_read_USB_EP7_FIFO()       bfin_read16(USB_EP7_FIFO)
-#define bfin_write_USB_EP7_FIFO(val)   bfin_write16(USB_EP7_FIFO, val)
-#define bfin_read_USB_OTG_DEV_CTL()    bfin_read16(USB_OTG_DEV_CTL)
-#define bfin_write_USB_OTG_DEV_CTL(val) bfin_write16(USB_OTG_DEV_CTL, val)
-#define bfin_read_USB_OTG_VBUS_IRQ()   bfin_read16(USB_OTG_VBUS_IRQ)
-#define bfin_write_USB_OTG_VBUS_IRQ(val) bfin_write16(USB_OTG_VBUS_IRQ, val)
-#define bfin_read_USB_OTG_VBUS_MASK()  bfin_read16(USB_OTG_VBUS_MASK)
-#define bfin_write_USB_OTG_VBUS_MASK(val) bfin_write16(USB_OTG_VBUS_MASK, val)
-#define bfin_read_USB_LINKINFO()       bfin_read16(USB_LINKINFO)
-#define bfin_write_USB_LINKINFO(val)   bfin_write16(USB_LINKINFO, val)
-#define bfin_read_USB_VPLEN()          bfin_read16(USB_VPLEN)
-#define bfin_write_USB_VPLEN(val)      bfin_write16(USB_VPLEN, val)
-#define bfin_read_USB_HS_EOF1()        bfin_read16(USB_HS_EOF1)
-#define bfin_write_USB_HS_EOF1(val)    bfin_write16(USB_HS_EOF1, val)
-#define bfin_read_USB_FS_EOF1()        bfin_read16(USB_FS_EOF1)
-#define bfin_write_USB_FS_EOF1(val)    bfin_write16(USB_FS_EOF1, val)
-#define bfin_read_USB_LS_EOF1()        bfin_read16(USB_LS_EOF1)
-#define bfin_write_USB_LS_EOF1(val)    bfin_write16(USB_LS_EOF1, val)
-#define bfin_read_USB_APHY_CNTRL()     bfin_read16(USB_APHY_CNTRL)
-#define bfin_write_USB_APHY_CNTRL(val) bfin_write16(USB_APHY_CNTRL, val)
-#define bfin_read_USB_APHY_CALIB()     bfin_read16(USB_APHY_CALIB)
-#define bfin_write_USB_APHY_CALIB(val) bfin_write16(USB_APHY_CALIB, val)
-#define bfin_read_USB_APHY_CNTRL2()    bfin_read16(USB_APHY_CNTRL2)
-#define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val)
-#define bfin_read_USB_PHY_TEST()       bfin_read16(USB_PHY_TEST)
-#define bfin_write_USB_PHY_TEST(val)   bfin_write16(USB_PHY_TEST, val)
-#define bfin_read_USB_PLLOSC_CTRL()    bfin_read16(USB_PLLOSC_CTRL)
-#define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val)
-#define bfin_read_USB_SRP_CLKDIV()     bfin_read16(USB_SRP_CLKDIV)
-#define bfin_write_USB_SRP_CLKDIV(val) bfin_write16(USB_SRP_CLKDIV, val)
-#define bfin_read_USB_EP_NI0_TXMAXP()  bfin_read16(USB_EP_NI0_TXMAXP)
-#define bfin_write_USB_EP_NI0_TXMAXP(val) bfin_write16(USB_EP_NI0_TXMAXP, val)
-#define bfin_read_USB_EP_NI0_TXCSR()   bfin_read16(USB_EP_NI0_TXCSR)
-#define bfin_write_USB_EP_NI0_TXCSR(val) bfin_write16(USB_EP_NI0_TXCSR, val)
-#define bfin_read_USB_EP_NI0_RXMAXP()  bfin_read16(USB_EP_NI0_RXMAXP)
-#define bfin_write_USB_EP_NI0_RXMAXP(val) bfin_write16(USB_EP_NI0_RXMAXP, val)
-#define bfin_read_USB_EP_NI0_RXCSR()   bfin_read16(USB_EP_NI0_RXCSR)
-#define bfin_write_USB_EP_NI0_RXCSR(val) bfin_write16(USB_EP_NI0_RXCSR, val)
-#define bfin_read_USB_EP_NI0_RXCOUNT() bfin_read16(USB_EP_NI0_RXCOUNT)
-#define bfin_write_USB_EP_NI0_RXCOUNT(val) bfin_write16(USB_EP_NI0_RXCOUNT, val)
-#define bfin_read_USB_EP_NI0_TXTYPE()  bfin_read16(USB_EP_NI0_TXTYPE)
-#define bfin_write_USB_EP_NI0_TXTYPE(val) bfin_write16(USB_EP_NI0_TXTYPE, val)
-#define bfin_read_USB_EP_NI0_TXINTERVAL() bfin_read16(USB_EP_NI0_TXINTERVAL)
-#define bfin_write_USB_EP_NI0_TXINTERVAL(val) bfin_write16(USB_EP_NI0_TXINTERVAL, val)
-#define bfin_read_USB_EP_NI0_RXTYPE()  bfin_read16(USB_EP_NI0_RXTYPE)
-#define bfin_write_USB_EP_NI0_RXTYPE(val) bfin_write16(USB_EP_NI0_RXTYPE, val)
-#define bfin_read_USB_EP_NI0_RXINTERVAL() bfin_read16(USB_EP_NI0_RXINTERVAL)
-#define bfin_write_USB_EP_NI0_RXINTERVAL(val) bfin_write16(USB_EP_NI0_RXINTERVAL, val)
-#define bfin_read_USB_EP_NI0_TXCOUNT() bfin_read16(USB_EP_NI0_TXCOUNT)
-#define bfin_write_USB_EP_NI0_TXCOUNT(val) bfin_write16(USB_EP_NI0_TXCOUNT, val)
-#define bfin_read_USB_EP_NI1_TXMAXP()  bfin_read16(USB_EP_NI1_TXMAXP)
-#define bfin_write_USB_EP_NI1_TXMAXP(val) bfin_write16(USB_EP_NI1_TXMAXP, val)
-#define bfin_read_USB_EP_NI1_TXCSR()   bfin_read16(USB_EP_NI1_TXCSR)
-#define bfin_write_USB_EP_NI1_TXCSR(val) bfin_write16(USB_EP_NI1_TXCSR, val)
-#define bfin_read_USB_EP_NI1_RXMAXP()  bfin_read16(USB_EP_NI1_RXMAXP)
-#define bfin_write_USB_EP_NI1_RXMAXP(val) bfin_write16(USB_EP_NI1_RXMAXP, val)
-#define bfin_read_USB_EP_NI1_RXCSR()   bfin_read16(USB_EP_NI1_RXCSR)
-#define bfin_write_USB_EP_NI1_RXCSR(val) bfin_write16(USB_EP_NI1_RXCSR, val)
-#define bfin_read_USB_EP_NI1_RXCOUNT() bfin_read16(USB_EP_NI1_RXCOUNT)
-#define bfin_write_USB_EP_NI1_RXCOUNT(val) bfin_write16(USB_EP_NI1_RXCOUNT, val)
-#define bfin_read_USB_EP_NI1_TXTYPE()  bfin_read16(USB_EP_NI1_TXTYPE)
-#define bfin_write_USB_EP_NI1_TXTYPE(val) bfin_write16(USB_EP_NI1_TXTYPE, val)
-#define bfin_read_USB_EP_NI1_TXINTERVAL() bfin_read16(USB_EP_NI1_TXINTERVAL)
-#define bfin_write_USB_EP_NI1_TXINTERVAL(val) bfin_write16(USB_EP_NI1_TXINTERVAL, val)
-#define bfin_read_USB_EP_NI1_RXTYPE()  bfin_read16(USB_EP_NI1_RXTYPE)
-#define bfin_write_USB_EP_NI1_RXTYPE(val) bfin_write16(USB_EP_NI1_RXTYPE, val)
-#define bfin_read_USB_EP_NI1_RXINTERVAL() bfin_read16(USB_EP_NI1_RXINTERVAL)
-#define bfin_write_USB_EP_NI1_RXINTERVAL(val) bfin_write16(USB_EP_NI1_RXINTERVAL, val)
-#define bfin_read_USB_EP_NI1_TXCOUNT() bfin_read16(USB_EP_NI1_TXCOUNT)
-#define bfin_write_USB_EP_NI1_TXCOUNT(val) bfin_write16(USB_EP_NI1_TXCOUNT, val)
-#define bfin_read_USB_EP_NI2_TXMAXP()  bfin_read16(USB_EP_NI2_TXMAXP)
-#define bfin_write_USB_EP_NI2_TXMAXP(val) bfin_write16(USB_EP_NI2_TXMAXP, val)
-#define bfin_read_USB_EP_NI2_TXCSR()   bfin_read16(USB_EP_NI2_TXCSR)
-#define bfin_write_USB_EP_NI2_TXCSR(val) bfin_write16(USB_EP_NI2_TXCSR, val)
-#define bfin_read_USB_EP_NI2_RXMAXP()  bfin_read16(USB_EP_NI2_RXMAXP)
-#define bfin_write_USB_EP_NI2_RXMAXP(val) bfin_write16(USB_EP_NI2_RXMAXP, val)
-#define bfin_read_USB_EP_NI2_RXCSR()   bfin_read16(USB_EP_NI2_RXCSR)
-#define bfin_write_USB_EP_NI2_RXCSR(val) bfin_write16(USB_EP_NI2_RXCSR, val)
-#define bfin_read_USB_EP_NI2_RXCOUNT() bfin_read16(USB_EP_NI2_RXCOUNT)
-#define bfin_write_USB_EP_NI2_RXCOUNT(val) bfin_write16(USB_EP_NI2_RXCOUNT, val)
-#define bfin_read_USB_EP_NI2_TXTYPE()  bfin_read16(USB_EP_NI2_TXTYPE)
-#define bfin_write_USB_EP_NI2_TXTYPE(val) bfin_write16(USB_EP_NI2_TXTYPE, val)
-#define bfin_read_USB_EP_NI2_TXINTERVAL() bfin_read16(USB_EP_NI2_TXINTERVAL)
-#define bfin_write_USB_EP_NI2_TXINTERVAL(val) bfin_write16(USB_EP_NI2_TXINTERVAL, val)
-#define bfin_read_USB_EP_NI2_RXTYPE()  bfin_read16(USB_EP_NI2_RXTYPE)
-#define bfin_write_USB_EP_NI2_RXTYPE(val) bfin_write16(USB_EP_NI2_RXTYPE, val)
-#define bfin_read_USB_EP_NI2_RXINTERVAL() bfin_read16(USB_EP_NI2_RXINTERVAL)
-#define bfin_write_USB_EP_NI2_RXINTERVAL(val) bfin_write16(USB_EP_NI2_RXINTERVAL, val)
-#define bfin_read_USB_EP_NI2_TXCOUNT() bfin_read16(USB_EP_NI2_TXCOUNT)
-#define bfin_write_USB_EP_NI2_TXCOUNT(val) bfin_write16(USB_EP_NI2_TXCOUNT, val)
-#define bfin_read_USB_EP_NI3_TXMAXP()  bfin_read16(USB_EP_NI3_TXMAXP)
-#define bfin_write_USB_EP_NI3_TXMAXP(val) bfin_write16(USB_EP_NI3_TXMAXP, val)
-#define bfin_read_USB_EP_NI3_TXCSR()   bfin_read16(USB_EP_NI3_TXCSR)
-#define bfin_write_USB_EP_NI3_TXCSR(val) bfin_write16(USB_EP_NI3_TXCSR, val)
-#define bfin_read_USB_EP_NI3_RXMAXP()  bfin_read16(USB_EP_NI3_RXMAXP)
-#define bfin_write_USB_EP_NI3_RXMAXP(val) bfin_write16(USB_EP_NI3_RXMAXP, val)
-#define bfin_read_USB_EP_NI3_RXCSR()   bfin_read16(USB_EP_NI3_RXCSR)
-#define bfin_write_USB_EP_NI3_RXCSR(val) bfin_write16(USB_EP_NI3_RXCSR, val)
-#define bfin_read_USB_EP_NI3_RXCOUNT() bfin_read16(USB_EP_NI3_RXCOUNT)
-#define bfin_write_USB_EP_NI3_RXCOUNT(val) bfin_write16(USB_EP_NI3_RXCOUNT, val)
-#define bfin_read_USB_EP_NI3_TXTYPE()  bfin_read16(USB_EP_NI3_TXTYPE)
-#define bfin_write_USB_EP_NI3_TXTYPE(val) bfin_write16(USB_EP_NI3_TXTYPE, val)
-#define bfin_read_USB_EP_NI3_TXINTERVAL() bfin_read16(USB_EP_NI3_TXINTERVAL)
-#define bfin_write_USB_EP_NI3_TXINTERVAL(val) bfin_write16(USB_EP_NI3_TXINTERVAL, val)
-#define bfin_read_USB_EP_NI3_RXTYPE()  bfin_read16(USB_EP_NI3_RXTYPE)
-#define bfin_write_USB_EP_NI3_RXTYPE(val) bfin_write16(USB_EP_NI3_RXTYPE, val)
-#define bfin_read_USB_EP_NI3_RXINTERVAL() bfin_read16(USB_EP_NI3_RXINTERVAL)
-#define bfin_write_USB_EP_NI3_RXINTERVAL(val) bfin_write16(USB_EP_NI3_RXINTERVAL, val)
-#define bfin_read_USB_EP_NI3_TXCOUNT() bfin_read16(USB_EP_NI3_TXCOUNT)
-#define bfin_write_USB_EP_NI3_TXCOUNT(val) bfin_write16(USB_EP_NI3_TXCOUNT, val)
-#define bfin_read_USB_EP_NI4_TXMAXP()  bfin_read16(USB_EP_NI4_TXMAXP)
-#define bfin_write_USB_EP_NI4_TXMAXP(val) bfin_write16(USB_EP_NI4_TXMAXP, val)
-#define bfin_read_USB_EP_NI4_TXCSR()   bfin_read16(USB_EP_NI4_TXCSR)
-#define bfin_write_USB_EP_NI4_TXCSR(val) bfin_write16(USB_EP_NI4_TXCSR, val)
-#define bfin_read_USB_EP_NI4_RXMAXP()  bfin_read16(USB_EP_NI4_RXMAXP)
-#define bfin_write_USB_EP_NI4_RXMAXP(val) bfin_write16(USB_EP_NI4_RXMAXP, val)
-#define bfin_read_USB_EP_NI4_RXCSR()   bfin_read16(USB_EP_NI4_RXCSR)
-#define bfin_write_USB_EP_NI4_RXCSR(val) bfin_write16(USB_EP_NI4_RXCSR, val)
-#define bfin_read_USB_EP_NI4_RXCOUNT() bfin_read16(USB_EP_NI4_RXCOUNT)
-#define bfin_write_USB_EP_NI4_RXCOUNT(val) bfin_write16(USB_EP_NI4_RXCOUNT, val)
-#define bfin_read_USB_EP_NI4_TXTYPE()  bfin_read16(USB_EP_NI4_TXTYPE)
-#define bfin_write_USB_EP_NI4_TXTYPE(val) bfin_write16(USB_EP_NI4_TXTYPE, val)
-#define bfin_read_USB_EP_NI4_TXINTERVAL() bfin_read16(USB_EP_NI4_TXINTERVAL)
-#define bfin_write_USB_EP_NI4_TXINTERVAL(val) bfin_write16(USB_EP_NI4_TXINTERVAL, val)
-#define bfin_read_USB_EP_NI4_RXTYPE()  bfin_read16(USB_EP_NI4_RXTYPE)
-#define bfin_write_USB_EP_NI4_RXTYPE(val) bfin_write16(USB_EP_NI4_RXTYPE, val)
-#define bfin_read_USB_EP_NI4_RXINTERVAL() bfin_read16(USB_EP_NI4_RXINTERVAL)
-#define bfin_write_USB_EP_NI4_RXINTERVAL(val) bfin_write16(USB_EP_NI4_RXINTERVAL, val)
-#define bfin_read_USB_EP_NI4_TXCOUNT() bfin_read16(USB_EP_NI4_TXCOUNT)
-#define bfin_write_USB_EP_NI4_TXCOUNT(val) bfin_write16(USB_EP_NI4_TXCOUNT, val)
-#define bfin_read_USB_EP_NI5_TXMAXP()  bfin_read16(USB_EP_NI5_TXMAXP)
-#define bfin_write_USB_EP_NI5_TXMAXP(val) bfin_write16(USB_EP_NI5_TXMAXP, val)
-#define bfin_read_USB_EP_NI5_TXCSR()   bfin_read16(USB_EP_NI5_TXCSR)
-#define bfin_write_USB_EP_NI5_TXCSR(val) bfin_write16(USB_EP_NI5_TXCSR, val)
-#define bfin_read_USB_EP_NI5_RXMAXP()  bfin_read16(USB_EP_NI5_RXMAXP)
-#define bfin_write_USB_EP_NI5_RXMAXP(val) bfin_write16(USB_EP_NI5_RXMAXP, val)
-#define bfin_read_USB_EP_NI5_RXCSR()   bfin_read16(USB_EP_NI5_RXCSR)
-#define bfin_write_USB_EP_NI5_RXCSR(val) bfin_write16(USB_EP_NI5_RXCSR, val)
-#define bfin_read_USB_EP_NI5_RXCOUNT() bfin_read16(USB_EP_NI5_RXCOUNT)
-#define bfin_write_USB_EP_NI5_RXCOUNT(val) bfin_write16(USB_EP_NI5_RXCOUNT, val)
-#define bfin_read_USB_EP_NI5_TXTYPE()  bfin_read16(USB_EP_NI5_TXTYPE)
-#define bfin_write_USB_EP_NI5_TXTYPE(val) bfin_write16(USB_EP_NI5_TXTYPE, val)
-#define bfin_read_USB_EP_NI5_TXINTERVAL() bfin_read16(USB_EP_NI5_TXINTERVAL)
-#define bfin_write_USB_EP_NI5_TXINTERVAL(val) bfin_write16(USB_EP_NI5_TXINTERVAL, val)
-#define bfin_read_USB_EP_NI5_RXTYPE()  bfin_read16(USB_EP_NI5_RXTYPE)
-#define bfin_write_USB_EP_NI5_RXTYPE(val) bfin_write16(USB_EP_NI5_RXTYPE, val)
-#define bfin_read_USB_EP_NI5_RXINTERVAL() bfin_read16(USB_EP_NI5_RXINTERVAL)
-#define bfin_write_USB_EP_NI5_RXINTERVAL(val) bfin_write16(USB_EP_NI5_RXINTERVAL, val)
-#define bfin_read_USB_EP_NI5_TXCOUNT() bfin_read16(USB_EP_NI5_TXCOUNT)
-#define bfin_write_USB_EP_NI5_TXCOUNT(val) bfin_write16(USB_EP_NI5_TXCOUNT, val)
-#define bfin_read_USB_EP_NI6_TXMAXP()  bfin_read16(USB_EP_NI6_TXMAXP)
-#define bfin_write_USB_EP_NI6_TXMAXP(val) bfin_write16(USB_EP_NI6_TXMAXP, val)
-#define bfin_read_USB_EP_NI6_TXCSR()   bfin_read16(USB_EP_NI6_TXCSR)
-#define bfin_write_USB_EP_NI6_TXCSR(val) bfin_write16(USB_EP_NI6_TXCSR, val)
-#define bfin_read_USB_EP_NI6_RXMAXP()  bfin_read16(USB_EP_NI6_RXMAXP)
-#define bfin_write_USB_EP_NI6_RXMAXP(val) bfin_write16(USB_EP_NI6_RXMAXP, val)
-#define bfin_read_USB_EP_NI6_RXCSR()   bfin_read16(USB_EP_NI6_RXCSR)
-#define bfin_write_USB_EP_NI6_RXCSR(val) bfin_write16(USB_EP_NI6_RXCSR, val)
-#define bfin_read_USB_EP_NI6_RXCOUNT() bfin_read16(USB_EP_NI6_RXCOUNT)
-#define bfin_write_USB_EP_NI6_RXCOUNT(val) bfin_write16(USB_EP_NI6_RXCOUNT, val)
-#define bfin_read_USB_EP_NI6_TXTYPE()  bfin_read16(USB_EP_NI6_TXTYPE)
-#define bfin_write_USB_EP_NI6_TXTYPE(val) bfin_write16(USB_EP_NI6_TXTYPE, val)
-#define bfin_read_USB_EP_NI6_TXINTERVAL() bfin_read16(USB_EP_NI6_TXINTERVAL)
-#define bfin_write_USB_EP_NI6_TXINTERVAL(val) bfin_write16(USB_EP_NI6_TXINTERVAL, val)
-#define bfin_read_USB_EP_NI6_RXTYPE()  bfin_read16(USB_EP_NI6_RXTYPE)
-#define bfin_write_USB_EP_NI6_RXTYPE(val) bfin_write16(USB_EP_NI6_RXTYPE, val)
-#define bfin_read_USB_EP_NI6_RXINTERVAL() bfin_read16(USB_EP_NI6_RXINTERVAL)
-#define bfin_write_USB_EP_NI6_RXINTERVAL(val) bfin_write16(USB_EP_NI6_RXINTERVAL, val)
-#define bfin_read_USB_EP_NI6_TXCOUNT() bfin_read16(USB_EP_NI6_TXCOUNT)
-#define bfin_write_USB_EP_NI6_TXCOUNT(val) bfin_write16(USB_EP_NI6_TXCOUNT, val)
-#define bfin_read_USB_EP_NI7_TXMAXP()  bfin_read16(USB_EP_NI7_TXMAXP)
-#define bfin_write_USB_EP_NI7_TXMAXP(val) bfin_write16(USB_EP_NI7_TXMAXP, val)
-#define bfin_read_USB_EP_NI7_TXCSR()   bfin_read16(USB_EP_NI7_TXCSR)
-#define bfin_write_USB_EP_NI7_TXCSR(val) bfin_write16(USB_EP_NI7_TXCSR, val)
-#define bfin_read_USB_EP_NI7_RXMAXP()  bfin_read16(USB_EP_NI7_RXMAXP)
-#define bfin_write_USB_EP_NI7_RXMAXP(val) bfin_write16(USB_EP_NI7_RXMAXP, val)
-#define bfin_read_USB_EP_NI7_RXCSR()   bfin_read16(USB_EP_NI7_RXCSR)
-#define bfin_write_USB_EP_NI7_RXCSR(val) bfin_write16(USB_EP_NI7_RXCSR, val)
-#define bfin_read_USB_EP_NI7_RXCOUNT() bfin_read16(USB_EP_NI7_RXCOUNT)
-#define bfin_write_USB_EP_NI7_RXCOUNT(val) bfin_write16(USB_EP_NI7_RXCOUNT, val)
-#define bfin_read_USB_EP_NI7_TXTYPE()  bfin_read16(USB_EP_NI7_TXTYPE)
-#define bfin_write_USB_EP_NI7_TXTYPE(val) bfin_write16(USB_EP_NI7_TXTYPE, val)
-#define bfin_read_USB_EP_NI7_TXINTERVAL() bfin_read16(USB_EP_NI7_TXINTERVAL)
-#define bfin_write_USB_EP_NI7_TXINTERVAL(val) bfin_write16(USB_EP_NI7_TXINTERVAL, val)
-#define bfin_read_USB_EP_NI7_RXTYPE()  bfin_read16(USB_EP_NI7_RXTYPE)
-#define bfin_write_USB_EP_NI7_RXTYPE(val) bfin_write16(USB_EP_NI7_RXTYPE, val)
-#define bfin_read_USB_EP_NI7_RXINTERVAL() bfin_read16(USB_EP_NI7_RXINTERVAL)
-#define bfin_write_USB_EP_NI7_RXINTERVAL(val) bfin_write16(USB_EP_NI7_RXINTERVAL, val)
-#define bfin_read_USB_EP_NI7_TXCOUNT() bfin_read16(USB_EP_NI7_TXCOUNT)
-#define bfin_write_USB_EP_NI7_TXCOUNT(val) bfin_write16(USB_EP_NI7_TXCOUNT, val)
-#define bfin_read_USB_DMA_INTERRUPT()  bfin_read16(USB_DMA_INTERRUPT)
-#define bfin_write_USB_DMA_INTERRUPT(val) bfin_write16(USB_DMA_INTERRUPT, val)
-#define bfin_read_USB_DMA0_CONTROL()   bfin_read16(USB_DMA0_CONTROL)
-#define bfin_write_USB_DMA0_CONTROL(val) bfin_write16(USB_DMA0_CONTROL, val)
-#define bfin_read_USB_DMA0_ADDRLOW()   bfin_read16(USB_DMA0_ADDRLOW)
-#define bfin_write_USB_DMA0_ADDRLOW(val) bfin_write16(USB_DMA0_ADDRLOW, val)
-#define bfin_read_USB_DMA0_ADDRHIGH()  bfin_read16(USB_DMA0_ADDRHIGH)
-#define bfin_write_USB_DMA0_ADDRHIGH(val) bfin_write16(USB_DMA0_ADDRHIGH, val)
-#define bfin_read_USB_DMA0_COUNTLOW()  bfin_read16(USB_DMA0_COUNTLOW)
-#define bfin_write_USB_DMA0_COUNTLOW(val) bfin_write16(USB_DMA0_COUNTLOW, val)
-#define bfin_read_USB_DMA0_COUNTHIGH() bfin_read16(USB_DMA0_COUNTHIGH)
-#define bfin_write_USB_DMA0_COUNTHIGH(val) bfin_write16(USB_DMA0_COUNTHIGH, val)
-#define bfin_read_USB_DMA1_CONTROL()   bfin_read16(USB_DMA1_CONTROL)
-#define bfin_write_USB_DMA1_CONTROL(val) bfin_write16(USB_DMA1_CONTROL, val)
-#define bfin_read_USB_DMA1_ADDRLOW()   bfin_read16(USB_DMA1_ADDRLOW)
-#define bfin_write_USB_DMA1_ADDRLOW(val) bfin_write16(USB_DMA1_ADDRLOW, val)
-#define bfin_read_USB_DMA1_ADDRHIGH()  bfin_read16(USB_DMA1_ADDRHIGH)
-#define bfin_write_USB_DMA1_ADDRHIGH(val) bfin_write16(USB_DMA1_ADDRHIGH, val)
-#define bfin_read_USB_DMA1_COUNTLOW()  bfin_read16(USB_DMA1_COUNTLOW)
-#define bfin_write_USB_DMA1_COUNTLOW(val) bfin_write16(USB_DMA1_COUNTLOW, val)
-#define bfin_read_USB_DMA1_COUNTHIGH() bfin_read16(USB_DMA1_COUNTHIGH)
-#define bfin_write_USB_DMA1_COUNTHIGH(val) bfin_write16(USB_DMA1_COUNTHIGH, val)
-#define bfin_read_USB_DMA2_CONTROL()   bfin_read16(USB_DMA2_CONTROL)
-#define bfin_write_USB_DMA2_CONTROL(val) bfin_write16(USB_DMA2_CONTROL, val)
-#define bfin_read_USB_DMA2_ADDRLOW()   bfin_read16(USB_DMA2_ADDRLOW)
-#define bfin_write_USB_DMA2_ADDRLOW(val) bfin_write16(USB_DMA2_ADDRLOW, val)
-#define bfin_read_USB_DMA2_ADDRHIGH()  bfin_read16(USB_DMA2_ADDRHIGH)
-#define bfin_write_USB_DMA2_ADDRHIGH(val) bfin_write16(USB_DMA2_ADDRHIGH, val)
-#define bfin_read_USB_DMA2_COUNTLOW()  bfin_read16(USB_DMA2_COUNTLOW)
-#define bfin_write_USB_DMA2_COUNTLOW(val) bfin_write16(USB_DMA2_COUNTLOW, val)
-#define bfin_read_USB_DMA2_COUNTHIGH() bfin_read16(USB_DMA2_COUNTHIGH)
-#define bfin_write_USB_DMA2_COUNTHIGH(val) bfin_write16(USB_DMA2_COUNTHIGH, val)
-#define bfin_read_USB_DMA3_CONTROL()   bfin_read16(USB_DMA3_CONTROL)
-#define bfin_write_USB_DMA3_CONTROL(val) bfin_write16(USB_DMA3_CONTROL, val)
-#define bfin_read_USB_DMA3_ADDRLOW()   bfin_read16(USB_DMA3_ADDRLOW)
-#define bfin_write_USB_DMA3_ADDRLOW(val) bfin_write16(USB_DMA3_ADDRLOW, val)
-#define bfin_read_USB_DMA3_ADDRHIGH()  bfin_read16(USB_DMA3_ADDRHIGH)
-#define bfin_write_USB_DMA3_ADDRHIGH(val) bfin_write16(USB_DMA3_ADDRHIGH, val)
-#define bfin_read_USB_DMA3_COUNTLOW()  bfin_read16(USB_DMA3_COUNTLOW)
-#define bfin_write_USB_DMA3_COUNTLOW(val) bfin_write16(USB_DMA3_COUNTLOW, val)
-#define bfin_read_USB_DMA3_COUNTHIGH() bfin_read16(USB_DMA3_COUNTHIGH)
-#define bfin_write_USB_DMA3_COUNTHIGH(val) bfin_write16(USB_DMA3_COUNTHIGH, val)
-#define bfin_read_USB_DMA4_CONTROL()   bfin_read16(USB_DMA4_CONTROL)
-#define bfin_write_USB_DMA4_CONTROL(val) bfin_write16(USB_DMA4_CONTROL, val)
-#define bfin_read_USB_DMA4_ADDRLOW()   bfin_read16(USB_DMA4_ADDRLOW)
-#define bfin_write_USB_DMA4_ADDRLOW(val) bfin_write16(USB_DMA4_ADDRLOW, val)
-#define bfin_read_USB_DMA4_ADDRHIGH()  bfin_read16(USB_DMA4_ADDRHIGH)
-#define bfin_write_USB_DMA4_ADDRHIGH(val) bfin_write16(USB_DMA4_ADDRHIGH, val)
-#define bfin_read_USB_DMA4_COUNTLOW()  bfin_read16(USB_DMA4_COUNTLOW)
-#define bfin_write_USB_DMA4_COUNTLOW(val) bfin_write16(USB_DMA4_COUNTLOW, val)
-#define bfin_read_USB_DMA4_COUNTHIGH() bfin_read16(USB_DMA4_COUNTHIGH)
-#define bfin_write_USB_DMA4_COUNTHIGH(val) bfin_write16(USB_DMA4_COUNTHIGH, val)
-#define bfin_read_USB_DMA5_CONTROL()   bfin_read16(USB_DMA5_CONTROL)
-#define bfin_write_USB_DMA5_CONTROL(val) bfin_write16(USB_DMA5_CONTROL, val)
-#define bfin_read_USB_DMA5_ADDRLOW()   bfin_read16(USB_DMA5_ADDRLOW)
-#define bfin_write_USB_DMA5_ADDRLOW(val) bfin_write16(USB_DMA5_ADDRLOW, val)
-#define bfin_read_USB_DMA5_ADDRHIGH()  bfin_read16(USB_DMA5_ADDRHIGH)
-#define bfin_write_USB_DMA5_ADDRHIGH(val) bfin_write16(USB_DMA5_ADDRHIGH, val)
-#define bfin_read_USB_DMA5_COUNTLOW()  bfin_read16(USB_DMA5_COUNTLOW)
-#define bfin_write_USB_DMA5_COUNTLOW(val) bfin_write16(USB_DMA5_COUNTLOW, val)
-#define bfin_read_USB_DMA5_COUNTHIGH() bfin_read16(USB_DMA5_COUNTHIGH)
-#define bfin_write_USB_DMA5_COUNTHIGH(val) bfin_write16(USB_DMA5_COUNTHIGH, val)
-#define bfin_read_USB_DMA6_CONTROL()   bfin_read16(USB_DMA6_CONTROL)
-#define bfin_write_USB_DMA6_CONTROL(val) bfin_write16(USB_DMA6_CONTROL, val)
-#define bfin_read_USB_DMA6_ADDRLOW()   bfin_read16(USB_DMA6_ADDRLOW)
-#define bfin_write_USB_DMA6_ADDRLOW(val) bfin_write16(USB_DMA6_ADDRLOW, val)
-#define bfin_read_USB_DMA6_ADDRHIGH()  bfin_read16(USB_DMA6_ADDRHIGH)
-#define bfin_write_USB_DMA6_ADDRHIGH(val) bfin_write16(USB_DMA6_ADDRHIGH, val)
-#define bfin_read_USB_DMA6_COUNTLOW()  bfin_read16(USB_DMA6_COUNTLOW)
-#define bfin_write_USB_DMA6_COUNTLOW(val) bfin_write16(USB_DMA6_COUNTLOW, val)
-#define bfin_read_USB_DMA6_COUNTHIGH() bfin_read16(USB_DMA6_COUNTHIGH)
-#define bfin_write_USB_DMA6_COUNTHIGH(val) bfin_write16(USB_DMA6_COUNTHIGH, val)
-#define bfin_read_USB_DMA7_CONTROL()   bfin_read16(USB_DMA7_CONTROL)
-#define bfin_write_USB_DMA7_CONTROL(val) bfin_write16(USB_DMA7_CONTROL, val)
-#define bfin_read_USB_DMA7_ADDRLOW()   bfin_read16(USB_DMA7_ADDRLOW)
-#define bfin_write_USB_DMA7_ADDRLOW(val) bfin_write16(USB_DMA7_ADDRLOW, val)
-#define bfin_read_USB_DMA7_ADDRHIGH()  bfin_read16(USB_DMA7_ADDRHIGH)
-#define bfin_write_USB_DMA7_ADDRHIGH(val) bfin_write16(USB_DMA7_ADDRHIGH, val)
-#define bfin_read_USB_DMA7_COUNTLOW()  bfin_read16(USB_DMA7_COUNTLOW)
-#define bfin_write_USB_DMA7_COUNTLOW(val) bfin_write16(USB_DMA7_COUNTLOW, val)
-#define bfin_read_USB_DMA7_COUNTHIGH() bfin_read16(USB_DMA7_COUNTHIGH)
-#define bfin_write_USB_DMA7_COUNTHIGH(val) bfin_write16(USB_DMA7_COUNTHIGH, val)
 
 #endif /* __BFIN_CDEF_ADSP_BF526_proc__ */
index 935d11ee659ab1e9e202ef83c909682efb764fad..40b5b01f11cffa26e445442bb33ddb8eb6034ae8 100644 (file)
@@ -6,18 +6,8 @@
 #ifndef __BFIN_DEF_ADSP_BF526_proc__
 #define __BFIN_DEF_ADSP_BF526_proc__
 
-#include "../mach-common/ADSP-EDN-core_def.h"
+#include "BF524_def.h"
 
-#include "ADSP-EDN-BF52x-extended_def.h"
-
-#define PLL_CTL                        0xFFC00000 /* PLL Control Register */
-#define PLL_DIV                        0xFFC00004 /* PLL Divide Register */
-#define VR_CTL                         0xFFC00008 /* Voltage Regulator Control Register */
-#define PLL_STAT                       0xFFC0000C /* PLL Status Register */
-#define PLL_LOCKCNT                    0xFFC00010 /* PLL Lock Count Register */
-#define CHIPID                         0xFFC00014
-#define SWRST                          0xFFC00100 /* Software Reset Register */
-#define SYSCR                          0xFFC00104 /* System Configuration register */
 #define EMAC_OPMODE                    0xFFC03000 /* Operating Mode Register */
 #define EMAC_ADDRLO                    0xFFC03004 /* Address Low (32 LSBs) Register */
 #define EMAC_ADDRHI                    0xFFC03008 /* Address High (16 MSBs) Register */
 #define EMAC_TXC_LT1024                0xFFC031D0 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
 #define EMAC_TXC_GE1024                0xFFC031D4 /* Good TX Frame Count - Byte Count x >= 1024 */
 #define EMAC_TXC_ABORT                 0xFFC031D8 /* Total TX Frames Aborted Count */
-#define USB_FADDR                      0xFFC03800 /* Function address register */
-#define USB_POWER                      0xFFC03804 /* Power management register */
-#define USB_INTRTX                     0xFFC03808 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
-#define USB_INTRRX                     0xFFC0380C /* Interrupt register for Rx endpoints 1 to 7 */
-#define USB_INTRTXE                    0xFFC03810 /* Interrupt enable register for IntrTx */
-#define USB_INTRRXE                    0xFFC03814 /* Interrupt enable register for IntrRx */
-#define USB_INTRUSB                    0xFFC03818 /* Interrupt register for common USB interrupts */
-#define USB_INTRUSBE                   0xFFC0381C /* Interrupt enable register for IntrUSB */
-#define USB_FRAME                      0xFFC03820 /* USB frame number */
-#define USB_INDEX                      0xFFC03824 /* Index register for selecting the indexed endpoint registers */
-#define USB_TESTMODE                   0xFFC03828 /* Enabled USB 20 test modes */
-#define USB_GLOBINTR                   0xFFC0382C /* Global Interrupt Mask register and Wakeup Exception Interrupt */
-#define USB_GLOBAL_CTL                 0xFFC03830 /* Global Clock Control for the core */
-#define USB_TX_MAX_PACKET              0xFFC03840 /* Maximum packet size for Host Tx endpoint */
-#define USB_CSR0                       0xFFC03844 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
-#define USB_TXCSR                      0xFFC03844 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
-#define USB_RX_MAX_PACKET              0xFFC03848 /* Maximum packet size for Host Rx endpoint */
-#define USB_RXCSR                      0xFFC0384C /* Control Status register for Host Rx endpoint */
-#define USB_COUNT0                     0xFFC03850 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
-#define USB_RXCOUNT                    0xFFC03850 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
-#define USB_TXTYPE                     0xFFC03854 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint */
-#define USB_NAKLIMIT0                  0xFFC03858 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
-#define USB_TXINTERVAL                 0xFFC03858 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
-#define USB_RXTYPE                     0xFFC0385C /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint */
-#define USB_RXINTERVAL                 0xFFC03860 /* Sets the polling interval for Interrupt and Isochronous transfers or the NAK response timeout on Bulk transfers */
-#define USB_TXCOUNT                    0xFFC03868 /* Number of bytes to be written to the selected endpoint Tx FIFO */
-#define USB_EP0_FIFO                   0xFFC03880 /* Endpoint 0 FIFO */
-#define USB_EP1_FIFO                   0xFFC03888 /* Endpoint 1 FIFO */
-#define USB_EP2_FIFO                   0xFFC03890 /* Endpoint 2 FIFO */
-#define USB_EP3_FIFO                   0xFFC03898 /* Endpoint 3 FIFO */
-#define USB_EP4_FIFO                   0xFFC038A0 /* Endpoint 4 FIFO */
-#define USB_EP5_FIFO                   0xFFC038A8 /* Endpoint 5 FIFO */
-#define USB_EP6_FIFO                   0xFFC038B0 /* Endpoint 6 FIFO */
-#define USB_EP7_FIFO                   0xFFC038B8 /* Endpoint 7 FIFO */
-#define USB_OTG_DEV_CTL                0xFFC03900 /* OTG Device Control Register */
-#define USB_OTG_VBUS_IRQ               0xFFC03904 /* OTG VBUS Control Interrupts */
-#define USB_OTG_VBUS_MASK              0xFFC03908 /* VBUS Control Interrupt Enable */
-#define USB_LINKINFO                   0xFFC03948 /* Enables programming of some PHY-side delays */
-#define USB_VPLEN                      0xFFC0394C /* Determines duration of VBUS pulse for VBUS charging */
-#define USB_HS_EOF1                    0xFFC03950 /* Time buffer for High-Speed transactions */
-#define USB_FS_EOF1                    0xFFC03954 /* Time buffer for Full-Speed transactions */
-#define USB_LS_EOF1                    0xFFC03958 /* Time buffer for Low-Speed transactions */
-#define USB_APHY_CNTRL                 0xFFC039E0 /* Register that increases visibility of Analog PHY */
-#define USB_APHY_CALIB                 0xFFC039E4 /* Register used to set some calibration values */
-#define USB_APHY_CNTRL2                0xFFC039E8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */
-#define USB_PHY_TEST                   0xFFC039EC /* Used for reducing simulation time and simplifies FIFO testability */
-#define USB_PLLOSC_CTRL                0xFFC039F0 /* Used to program different parameters for USB PLL and Oscillator */
-#define USB_SRP_CLKDIV                 0xFFC039F4 /* Used to program clock divide value for the clock fed to the SRP detection logic */
-#define USB_EP_NI0_TXMAXP              0xFFC03A00 /* Maximum packet size for Host Tx endpoint0 */
-#define USB_EP_NI0_TXCSR               0xFFC03A04 /* Control Status register for endpoint 0 */
-#define USB_EP_NI0_RXMAXP              0xFFC03A08 /* Maximum packet size for Host Rx endpoint0 */
-#define USB_EP_NI0_RXCSR               0xFFC03A0C /* Control Status register for Host Rx endpoint0 */
-#define USB_EP_NI0_RXCOUNT             0xFFC03A10 /* Number of bytes received in endpoint 0 FIFO */
-#define USB_EP_NI0_TXTYPE              0xFFC03A14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint0 */
-#define USB_EP_NI0_TXINTERVAL          0xFFC03A18 /* Sets the NAK response timeout on Endpoint 0 */
-#define USB_EP_NI0_RXTYPE              0xFFC03A1C /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint0 */
-#define USB_EP_NI0_RXINTERVAL          0xFFC03A20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint0 */
-#define USB_EP_NI0_TXCOUNT             0xFFC03A28 /* Number of bytes to be written to the endpoint0 Tx FIFO */
-#define USB_EP_NI1_TXMAXP              0xFFC03A40 /* Maximum packet size for Host Tx endpoint1 */
-#define USB_EP_NI1_TXCSR               0xFFC03A44 /* Control Status register for endpoint1 */
-#define USB_EP_NI1_RXMAXP              0xFFC03A48 /* Maximum packet size for Host Rx endpoint1 */
-#define USB_EP_NI1_RXCSR               0xFFC03A4C /* Control Status register for Host Rx endpoint1 */
-#define USB_EP_NI1_RXCOUNT             0xFFC03A50 /* Number of bytes received in endpoint1 FIFO */
-#define USB_EP_NI1_TXTYPE              0xFFC03A54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint1 */
-#define USB_EP_NI1_TXINTERVAL          0xFFC03A58 /* Sets the NAK response timeout on Endpoint1 */
-#define USB_EP_NI1_RXTYPE              0xFFC03A5C /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint1 */
-#define USB_EP_NI1_RXINTERVAL          0xFFC03A60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint1 */
-#define USB_EP_NI1_TXCOUNT             0xFFC03A68 /* Number of bytes to be written to the+H102 endpoint1 Tx FIFO */
-#define USB_EP_NI2_TXMAXP              0xFFC03A80 /* Maximum packet size for Host Tx endpoint2 */
-#define USB_EP_NI2_TXCSR               0xFFC03A84 /* Control Status register for endpoint2 */
-#define USB_EP_NI2_RXMAXP              0xFFC03A88 /* Maximum packet size for Host Rx endpoint2 */
-#define USB_EP_NI2_RXCSR               0xFFC03A8C /* Control Status register for Host Rx endpoint2 */
-#define USB_EP_NI2_RXCOUNT             0xFFC03A90 /* Number of bytes received in endpoint2 FIFO */
-#define USB_EP_NI2_TXTYPE              0xFFC03A94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint2 */
-#define USB_EP_NI2_TXINTERVAL          0xFFC03A98 /* Sets the NAK response timeout on Endpoint2 */
-#define USB_EP_NI2_RXTYPE              0xFFC03A9C /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint2 */
-#define USB_EP_NI2_RXINTERVAL          0xFFC03AA0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint2 */
-#define USB_EP_NI2_TXCOUNT             0xFFC03AA8 /* Number of bytes to be written to the endpoint2 Tx FIFO */
-#define USB_EP_NI3_TXMAXP              0xFFC03AC0 /* Maximum packet size for Host Tx endpoint3 */
-#define USB_EP_NI3_TXCSR               0xFFC03AC4 /* Control Status register for endpoint3 */
-#define USB_EP_NI3_RXMAXP              0xFFC03AC8 /* Maximum packet size for Host Rx endpoint3 */
-#define USB_EP_NI3_RXCSR               0xFFC03ACC /* Control Status register for Host Rx endpoint3 */
-#define USB_EP_NI3_RXCOUNT             0xFFC03AD0 /* Number of bytes received in endpoint3 FIFO */
-#define USB_EP_NI3_TXTYPE              0xFFC03AD4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint3 */
-#define USB_EP_NI3_TXINTERVAL          0xFFC03AD8 /* Sets the NAK response timeout on Endpoint3 */
-#define USB_EP_NI3_RXTYPE              0xFFC03ADC /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint3 */
-#define USB_EP_NI3_RXINTERVAL          0xFFC03AE0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint3 */
-#define USB_EP_NI3_TXCOUNT             0xFFC03AE8 /* Number of bytes to be written to the H124endpoint3 Tx FIFO */
-#define USB_EP_NI4_TXMAXP              0xFFC03B00 /* Maximum packet size for Host Tx endpoint4 */
-#define USB_EP_NI4_TXCSR               0xFFC03B04 /* Control Status register for endpoint4 */
-#define USB_EP_NI4_RXMAXP              0xFFC03B08 /* Maximum packet size for Host Rx endpoint4 */
-#define USB_EP_NI4_RXCSR               0xFFC03B0C /* Control Status register for Host Rx endpoint4 */
-#define USB_EP_NI4_RXCOUNT             0xFFC03B10 /* Number of bytes received in endpoint4 FIFO */
-#define USB_EP_NI4_TXTYPE              0xFFC03B14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint4 */
-#define USB_EP_NI4_TXINTERVAL          0xFFC03B18 /* Sets the NAK response timeout on Endpoint4 */
-#define USB_EP_NI4_RXTYPE              0xFFC03B1C /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint4 */
-#define USB_EP_NI4_RXINTERVAL          0xFFC03B20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint4 */
-#define USB_EP_NI4_TXCOUNT             0xFFC03B28 /* Number of bytes to be written to the endpoint4 Tx FIFO */
-#define USB_EP_NI5_TXMAXP              0xFFC03B40 /* Maximum packet size for Host Tx endpoint5 */
-#define USB_EP_NI5_TXCSR               0xFFC03B44 /* Control Status register for endpoint5 */
-#define USB_EP_NI5_RXMAXP              0xFFC03B48 /* Maximum packet size for Host Rx endpoint5 */
-#define USB_EP_NI5_RXCSR               0xFFC03B4C /* Control Status register for Host Rx endpoint5 */
-#define USB_EP_NI5_RXCOUNT             0xFFC03B50 /* Number of bytes received in endpoint5 FIFO */
-#define USB_EP_NI5_TXTYPE              0xFFC03B54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint5 */
-#define USB_EP_NI5_TXINTERVAL          0xFFC03B58 /* Sets the NAK response timeout on Endpoint5 */
-#define USB_EP_NI5_RXTYPE              0xFFC03B5C /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint5 */
-#define USB_EP_NI5_RXINTERVAL          0xFFC03B60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint5 */
-#define USB_EP_NI5_TXCOUNT             0xFFC03B68 /* Number of bytes to be written to the endpoint5 Tx FIFO */
-#define USB_EP_NI6_TXMAXP              0xFFC03B80 /* Maximum packet size for Host Tx endpoint6 */
-#define USB_EP_NI6_TXCSR               0xFFC03B84 /* Control Status register for endpoint6 */
-#define USB_EP_NI6_RXMAXP              0xFFC03B88 /* Maximum packet size for Host Rx endpoint6 */
-#define USB_EP_NI6_RXCSR               0xFFC03B8C /* Control Status register for Host Rx endpoint6 */
-#define USB_EP_NI6_RXCOUNT             0xFFC03B90 /* Number of bytes received in endpoint6 FIFO */
-#define USB_EP_NI6_TXTYPE              0xFFC03B94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint6 */
-#define USB_EP_NI6_TXINTERVAL          0xFFC03B98 /* Sets the NAK response timeout on Endpoint6 */
-#define USB_EP_NI6_RXTYPE              0xFFC03B9C /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint6 */
-#define USB_EP_NI6_RXINTERVAL          0xFFC03BA0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint6 */
-#define USB_EP_NI6_TXCOUNT             0xFFC03BA8 /* Number of bytes to be written to the endpoint6 Tx FIFO */
-#define USB_EP_NI7_TXMAXP              0xFFC03BC0 /* Maximum packet size for Host Tx endpoint7 */
-#define USB_EP_NI7_TXCSR               0xFFC03BC4 /* Control Status register for endpoint7 */
-#define USB_EP_NI7_RXMAXP              0xFFC03BC8 /* Maximum packet size for Host Rx endpoint7 */
-#define USB_EP_NI7_RXCSR               0xFFC03BCC /* Control Status register for Host Rx endpoint7 */
-#define USB_EP_NI7_RXCOUNT             0xFFC03BD0 /* Number of bytes received in endpoint7 FIFO */
-#define USB_EP_NI7_TXTYPE              0xFFC03BD4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint7 */
-#define USB_EP_NI7_TXINTERVAL          0xFFC03BD8 /* Sets the NAK response timeout on Endpoint7 */
-#define USB_EP_NI7_RXTYPE              0xFFC03BDC /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint7 */
-#define USB_EP_NI7_RXINTERVAL          0xFFC03BF0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint7 */
-#define USB_EP_NI7_TXCOUNT             0xFFC03BF8 /* Number of bytes to be written to the endpoint7 Tx FIFO */
-#define USB_DMA_INTERRUPT              0xFFC03C00 /* Indicates pending interrupts for the DMA channels */
-#define USB_DMA0_CONTROL               0xFFC03C04 /* DMA master channel 0 configuration */
-#define USB_DMA0_ADDRLOW               0xFFC03C08 /* Lower 16-bits of memory source/destination address for DMA master channel 0 */
-#define USB_DMA0_ADDRHIGH              0xFFC03C0C /* Upper 16-bits of memory source/destination address for DMA master channel 0 */
-#define USB_DMA0_COUNTLOW              0xFFC03C10 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 0 */
-#define USB_DMA0_COUNTHIGH             0xFFC03C14 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 0 */
-#define USB_DMA1_CONTROL               0xFFC03C24 /* DMA master channel 1 configuration */
-#define USB_DMA1_ADDRLOW               0xFFC03C28 /* Lower 16-bits of memory source/destination address for DMA master channel 1 */
-#define USB_DMA1_ADDRHIGH              0xFFC03C2C /* Upper 16-bits of memory source/destination address for DMA master channel 1 */
-#define USB_DMA1_COUNTLOW              0xFFC03C30 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 1 */
-#define USB_DMA1_COUNTHIGH             0xFFC03C34 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 1 */
-#define USB_DMA2_CONTROL               0xFFC03C44 /* DMA master channel 2 configuration */
-#define USB_DMA2_ADDRLOW               0xFFC03C48 /* Lower 16-bits of memory source/destination address for DMA master channel 2 */
-#define USB_DMA2_ADDRHIGH              0xFFC03C4C /* Upper 16-bits of memory source/destination address for DMA master channel 2 */
-#define USB_DMA2_COUNTLOW              0xFFC03C50 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 2 */
-#define USB_DMA2_COUNTHIGH             0xFFC03C54 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 2 */
-#define USB_DMA3_CONTROL               0xFFC03C64 /* DMA master channel 3 configuration */
-#define USB_DMA3_ADDRLOW               0xFFC03C68 /* Lower 16-bits of memory source/destination address for DMA master channel 3 */
-#define USB_DMA3_ADDRHIGH              0xFFC03C6C /* Upper 16-bits of memory source/destination address for DMA master channel 3 */
-#define USB_DMA3_COUNTLOW              0xFFC03C70 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 3 */
-#define USB_DMA3_COUNTHIGH             0xFFC03C74 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 3 */
-#define USB_DMA4_CONTROL               0xFFC03C84 /* DMA master channel 4 configuration */
-#define USB_DMA4_ADDRLOW               0xFFC03C88 /* Lower 16-bits of memory source/destination address for DMA master channel 4 */
-#define USB_DMA4_ADDRHIGH              0xFFC03C8C /* Upper 16-bits of memory source/destination address for DMA master channel 4 */
-#define USB_DMA4_COUNTLOW              0xFFC03C90 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 4 */
-#define USB_DMA4_COUNTHIGH             0xFFC03C94 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 4 */
-#define USB_DMA5_CONTROL               0xFFC03CA4 /* DMA master channel 5 configuration */
-#define USB_DMA5_ADDRLOW               0xFFC03CA8 /* Lower 16-bits of memory source/destination address for DMA master channel 5 */
-#define USB_DMA5_ADDRHIGH              0xFFC03CAC /* Upper 16-bits of memory source/destination address for DMA master channel 5 */
-#define USB_DMA5_COUNTLOW              0xFFC03CB0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 5 */
-#define USB_DMA5_COUNTHIGH             0xFFC03CB4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 5 */
-#define USB_DMA6_CONTROL               0xFFC03CC4 /* DMA master channel 6 configuration */
-#define USB_DMA6_ADDRLOW               0xFFC03CC8 /* Lower 16-bits of memory source/destination address for DMA master channel 6 */
-#define USB_DMA6_ADDRHIGH              0xFFC03CCC /* Upper 16-bits of memory source/destination address for DMA master channel 6 */
-#define USB_DMA6_COUNTLOW              0xFFC03CD0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 6 */
-#define USB_DMA6_COUNTHIGH             0xFFC03CD4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 6 */
-#define USB_DMA7_CONTROL               0xFFC03CE4 /* DMA master channel 7 configuration */
-#define USB_DMA7_ADDRLOW               0xFFC03CE8 /* Lower 16-bits of memory source/destination address for DMA master channel 7 */
-#define USB_DMA7_ADDRHIGH              0xFFC03CEC /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
-#define USB_DMA7_COUNTLOW              0xFFC03CF0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
-#define USB_DMA7_COUNTHIGH             0xFFC03CF4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
 
 #endif /* __BFIN_DEF_ADSP_BF526_proc__ */
index 5d61972176f55b4294283a8af22101540a6e475d..3b61aafcc9ddf033d377947ce9fb996eca294ac0 100644 (file)
 #define L1_INST_SRAM 0xFFA08000 /* 0xFFA08000 -> 0xFFA0BFFF Instruction Bank A SRAM */
 #define L1_INST_SRAM_SIZE (0xFFA0BFFF - 0xFFA08000 + 1)
 #define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 #endif
 
 #endif /* __BFIN_DEF_ADSP_BF531_proc__ */
index f7378b70a786ffee65fc61009ee193cbf0dee1b5..64f55f50c78d2adc766cabd78cef806962058c93 100644 (file)
 #define L1_INST_SRAM 0xFFA08000 /* 0xFFA08000 -> 0xFFA0BFFF Instruction Bank A SRAM */
 #define L1_INST_SRAM_SIZE (0xFFA0BFFF - 0xFFA08000 + 1)
 #define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 #endif
 
 #endif /* __BFIN_DEF_ADSP_BF532_proc__ */
index b77efe0a2cf8b58d20b37210a642f55666f69503..3c0595f50b10599e43d1cd6706153c9040c21ed8 100644 (file)
 #define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
 #define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
 #define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF533_proc__ */
diff --git a/arch/blackfin/include/asm/mach-bf537/ADSP-EDN-BF534-extended_cdef.h b/arch/blackfin/include/asm/mach-bf537/ADSP-EDN-BF534-extended_cdef.h
deleted file mode 100644 (file)
index bfe6d9f..0000000
+++ /dev/null
@@ -1,1624 +0,0 @@
-/* DO NOT EDIT THIS FILE
- * Automatically generated by generate-cdef-headers.xsl
- * DO NOT EDIT THIS FILE
- */
-
-#ifndef __BFIN_CDEF_ADSP_EDN_BF534_extended__
-#define __BFIN_CDEF_ADSP_EDN_BF534_extended__
-
-#include "../mach-common/ADSP-EDN-core_cdef.h"
-
-#define bfin_read_PLL_CTL()            bfin_read16(PLL_CTL)
-#define bfin_write_PLL_CTL(val)        bfin_write16(PLL_CTL, val)
-#define bfin_read_PLL_DIV()            bfin_read16(PLL_DIV)
-#define bfin_write_PLL_DIV(val)        bfin_write16(PLL_DIV, val)
-#define bfin_read_VR_CTL()             bfin_read16(VR_CTL)
-#define bfin_write_VR_CTL(val)         bfin_write16(VR_CTL, val)
-#define bfin_read_PLL_STAT()           bfin_read16(PLL_STAT)
-#define bfin_write_PLL_STAT(val)       bfin_write16(PLL_STAT, val)
-#define bfin_read_PLL_LOCKCNT()        bfin_read16(PLL_LOCKCNT)
-#define bfin_write_PLL_LOCKCNT(val)    bfin_write16(PLL_LOCKCNT, val)
-#define bfin_read_SWRST()              bfin_read16(SWRST)
-#define bfin_write_SWRST(val)          bfin_write16(SWRST, val)
-#define bfin_read_SYSCR()              bfin_read16(SYSCR)
-#define bfin_write_SYSCR(val)          bfin_write16(SYSCR, val)
-#define bfin_read_SIC_RVECT()          bfin_read16(SIC_RVECT)
-#define bfin_write_SIC_RVECT(val)      bfin_write16(SIC_RVECT, val)
-#define bfin_read_SIC_IMASK()          bfin_read32(SIC_IMASK)
-#define bfin_write_SIC_IMASK(val)      bfin_write32(SIC_IMASK, val)
-#define bfin_read_SIC_IAR0()           bfin_read32(SIC_IAR0)
-#define bfin_write_SIC_IAR0(val)       bfin_write32(SIC_IAR0, val)
-#define bfin_read_SIC_IAR1()           bfin_read32(SIC_IAR1)
-#define bfin_write_SIC_IAR1(val)       bfin_write32(SIC_IAR1, val)
-#define bfin_read_SIC_IAR2()           bfin_read32(SIC_IAR2)
-#define bfin_write_SIC_IAR2(val)       bfin_write32(SIC_IAR2, val)
-#define bfin_read_SIC_IAR3()           bfin_read32(SIC_IAR3)
-#define bfin_write_SIC_IAR3(val)       bfin_write32(SIC_IAR3, val)
-#define bfin_read_SIC_ISR()            bfin_read32(SIC_ISR)
-#define bfin_write_SIC_ISR(val)        bfin_write32(SIC_ISR, val)
-#define bfin_read_SIC_IWR()            bfin_read32(SIC_IWR)
-#define bfin_write_SIC_IWR(val)        bfin_write32(SIC_IWR, val)
-#define bfin_read_WDOG_CTL()           bfin_read16(WDOG_CTL)
-#define bfin_write_WDOG_CTL(val)       bfin_write16(WDOG_CTL, val)
-#define bfin_read_WDOG_CNT()           bfin_read32(WDOG_CNT)
-#define bfin_write_WDOG_CNT(val)       bfin_write32(WDOG_CNT, val)
-#define bfin_read_WDOG_STAT()          bfin_read32(WDOG_STAT)
-#define bfin_write_WDOG_STAT(val)      bfin_write32(WDOG_STAT, val)
-#define bfin_read_RTC_STAT()           bfin_read32(RTC_STAT)
-#define bfin_write_RTC_STAT(val)       bfin_write32(RTC_STAT, val)
-#define bfin_read_RTC_ICTL()           bfin_read16(RTC_ICTL)
-#define bfin_write_RTC_ICTL(val)       bfin_write16(RTC_ICTL, val)
-#define bfin_read_RTC_ISTAT()          bfin_read16(RTC_ISTAT)
-#define bfin_write_RTC_ISTAT(val)      bfin_write16(RTC_ISTAT, val)
-#define bfin_read_RTC_SWCNT()          bfin_read16(RTC_SWCNT)
-#define bfin_write_RTC_SWCNT(val)      bfin_write16(RTC_SWCNT, val)
-#define bfin_read_RTC_ALARM()          bfin_read32(RTC_ALARM)
-#define bfin_write_RTC_ALARM(val)      bfin_write32(RTC_ALARM, val)
-#define bfin_read_RTC_PREN()           bfin_read16(RTC_PREN)
-#define bfin_write_RTC_PREN(val)       bfin_write16(RTC_PREN, val)
-#define bfin_read_UART0_THR()          bfin_read16(UART0_THR)
-#define bfin_write_UART0_THR(val)      bfin_write16(UART0_THR, val)
-#define bfin_read_UART0_RBR()          bfin_read16(UART0_RBR)
-#define bfin_write_UART0_RBR(val)      bfin_write16(UART0_RBR, val)
-#define bfin_read_UART0_DLL()          bfin_read16(UART0_DLL)
-#define bfin_write_UART0_DLL(val)      bfin_write16(UART0_DLL, val)
-#define bfin_read_UART0_IER()          bfin_read16(UART0_IER)
-#define bfin_write_UART0_IER(val)      bfin_write16(UART0_IER, val)
-#define bfin_read_UART0_DLH()          bfin_read16(UART0_DLH)
-#define bfin_write_UART0_DLH(val)      bfin_write16(UART0_DLH, val)
-#define bfin_read_UART0_IIR()          bfin_read16(UART0_IIR)
-#define bfin_write_UART0_IIR(val)      bfin_write16(UART0_IIR, val)
-#define bfin_read_UART0_LCR()          bfin_read16(UART0_LCR)
-#define bfin_write_UART0_LCR(val)      bfin_write16(UART0_LCR, val)
-#define bfin_read_UART0_MCR()          bfin_read16(UART0_MCR)
-#define bfin_write_UART0_MCR(val)      bfin_write16(UART0_MCR, val)
-#define bfin_read_UART0_LSR()          bfin_read16(UART0_LSR)
-#define bfin_write_UART0_LSR(val)      bfin_write16(UART0_LSR, val)
-#define bfin_read_UART0_MSR()          bfin_read16(UART0_MSR)
-#define bfin_write_UART0_MSR(val)      bfin_write16(UART0_MSR, val)
-#define bfin_read_UART0_SCR()          bfin_read16(UART0_SCR)
-#define bfin_write_UART0_SCR(val)      bfin_write16(UART0_SCR, val)
-#define bfin_read_UART0_GCTL()         bfin_read16(UART0_GCTL)
-#define bfin_write_UART0_GCTL(val)     bfin_write16(UART0_GCTL, val)
-#define bfin_read_SPI_CTL()            bfin_read16(SPI_CTL)
-#define bfin_write_SPI_CTL(val)        bfin_write16(SPI_CTL, val)
-#define bfin_read_SPI_FLG()            bfin_read16(SPI_FLG)
-#define bfin_write_SPI_FLG(val)        bfin_write16(SPI_FLG, val)
-#define bfin_read_SPI_STAT()           bfin_read16(SPI_STAT)
-#define bfin_write_SPI_STAT(val)       bfin_write16(SPI_STAT, val)
-#define bfin_read_SPI_TDBR()           bfin_read16(SPI_TDBR)
-#define bfin_write_SPI_TDBR(val)       bfin_write16(SPI_TDBR, val)
-#define bfin_read_SPI_RDBR()           bfin_read16(SPI_RDBR)
-#define bfin_write_SPI_RDBR(val)       bfin_write16(SPI_RDBR, val)
-#define bfin_read_SPI_BAUD()           bfin_read16(SPI_BAUD)
-#define bfin_write_SPI_BAUD(val)       bfin_write16(SPI_BAUD, val)
-#define bfin_read_SPI_SHADOW()         bfin_read16(SPI_SHADOW)
-#define bfin_write_SPI_SHADOW(val)     bfin_write16(SPI_SHADOW, val)
-#define bfin_read_TIMER0_CONFIG()      bfin_read16(TIMER0_CONFIG)
-#define bfin_write_TIMER0_CONFIG(val)  bfin_write16(TIMER0_CONFIG, val)
-#define bfin_read_TIMER0_COUNTER()     bfin_read32(TIMER0_COUNTER)
-#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
-#define bfin_read_TIMER0_PERIOD()      bfin_read32(TIMER0_PERIOD)
-#define bfin_write_TIMER0_PERIOD(val)  bfin_write32(TIMER0_PERIOD, val)
-#define bfin_read_TIMER0_WIDTH()       bfin_read32(TIMER0_WIDTH)
-#define bfin_write_TIMER0_WIDTH(val)   bfin_write32(TIMER0_WIDTH, val)
-#define bfin_read_TIMER1_CONFIG()      bfin_read16(TIMER1_CONFIG)
-#define bfin_write_TIMER1_CONFIG(val)  bfin_write16(TIMER1_CONFIG, val)
-#define bfin_read_TIMER1_COUNTER()     bfin_read32(TIMER1_COUNTER)
-#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
-#define bfin_read_TIMER1_PERIOD()      bfin_read32(TIMER1_PERIOD)
-#define bfin_write_TIMER1_PERIOD(val)  bfin_write32(TIMER1_PERIOD, val)
-#define bfin_read_TIMER1_WIDTH()       bfin_read32(TIMER1_WIDTH)
-#define bfin_write_TIMER1_WIDTH(val)   bfin_write32(TIMER1_WIDTH, val)
-#define bfin_read_TIMER2_CONFIG()      bfin_read16(TIMER2_CONFIG)
-#define bfin_write_TIMER2_CONFIG(val)  bfin_write16(TIMER2_CONFIG, val)
-#define bfin_read_TIMER2_COUNTER()     bfin_read32(TIMER2_COUNTER)
-#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
-#define bfin_read_TIMER2_PERIOD()      bfin_read32(TIMER2_PERIOD)
-#define bfin_write_TIMER2_PERIOD(val)  bfin_write32(TIMER2_PERIOD, val)
-#define bfin_read_TIMER2_WIDTH()       bfin_read32(TIMER2_WIDTH)
-#define bfin_write_TIMER2_WIDTH(val)   bfin_write32(TIMER2_WIDTH, val)
-#define bfin_read_TIMER3_CONFIG()      bfin_read16(TIMER3_CONFIG)
-#define bfin_write_TIMER3_CONFIG(val)  bfin_write16(TIMER3_CONFIG, val)
-#define bfin_read_TIMER3_COUNTER()     bfin_read32(TIMER3_COUNTER)
-#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER, val)
-#define bfin_read_TIMER3_PERIOD()      bfin_read32(TIMER3_PERIOD)
-#define bfin_write_TIMER3_PERIOD(val)  bfin_write32(TIMER3_PERIOD, val)
-#define bfin_read_TIMER3_WIDTH()       bfin_read32(TIMER3_WIDTH)
-#define bfin_write_TIMER3_WIDTH(val)   bfin_write32(TIMER3_WIDTH, val)
-#define bfin_read_TIMER4_CONFIG()      bfin_read16(TIMER4_CONFIG)
-#define bfin_write_TIMER4_CONFIG(val)  bfin_write16(TIMER4_CONFIG, val)
-#define bfin_read_TIMER4_COUNTER()     bfin_read32(TIMER4_COUNTER)
-#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER, val)
-#define bfin_read_TIMER4_PERIOD()      bfin_read32(TIMER4_PERIOD)
-#define bfin_write_TIMER4_PERIOD(val)  bfin_write32(TIMER4_PERIOD, val)
-#define bfin_read_TIMER4_WIDTH()       bfin_read32(TIMER4_WIDTH)
-#define bfin_write_TIMER4_WIDTH(val)   bfin_write32(TIMER4_WIDTH, val)
-#define bfin_read_TIMER5_CONFIG()      bfin_read16(TIMER5_CONFIG)
-#define bfin_write_TIMER5_CONFIG(val)  bfin_write16(TIMER5_CONFIG, val)
-#define bfin_read_TIMER5_COUNTER()     bfin_read32(TIMER5_COUNTER)
-#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER, val)
-#define bfin_read_TIMER5_PERIOD()      bfin_read32(TIMER5_PERIOD)
-#define bfin_write_TIMER5_PERIOD(val)  bfin_write32(TIMER5_PERIOD, val)
-#define bfin_read_TIMER5_WIDTH()       bfin_read32(TIMER5_WIDTH)
-#define bfin_write_TIMER5_WIDTH(val)   bfin_write32(TIMER5_WIDTH, val)
-#define bfin_read_TIMER6_CONFIG()      bfin_read16(TIMER6_CONFIG)
-#define bfin_write_TIMER6_CONFIG(val)  bfin_write16(TIMER6_CONFIG, val)
-#define bfin_read_TIMER6_COUNTER()     bfin_read32(TIMER6_COUNTER)
-#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER, val)
-#define bfin_read_TIMER6_PERIOD()      bfin_read32(TIMER6_PERIOD)
-#define bfin_write_TIMER6_PERIOD(val)  bfin_write32(TIMER6_PERIOD, val)
-#define bfin_read_TIMER6_WIDTH()       bfin_read32(TIMER6_WIDTH)
-#define bfin_write_TIMER6_WIDTH(val)   bfin_write32(TIMER6_WIDTH, val)
-#define bfin_read_TIMER7_CONFIG()      bfin_read16(TIMER7_CONFIG)
-#define bfin_write_TIMER7_CONFIG(val)  bfin_write16(TIMER7_CONFIG, val)
-#define bfin_read_TIMER7_COUNTER()     bfin_read32(TIMER7_COUNTER)
-#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER, val)
-#define bfin_read_TIMER7_PERIOD()      bfin_read32(TIMER7_PERIOD)
-#define bfin_write_TIMER7_PERIOD(val)  bfin_write32(TIMER7_PERIOD, val)
-#define bfin_read_TIMER7_WIDTH()       bfin_read32(TIMER7_WIDTH)
-#define bfin_write_TIMER7_WIDTH(val)   bfin_write32(TIMER7_WIDTH, val)
-#define bfin_read_TIMER_ENABLE()       bfin_read16(TIMER_ENABLE)
-#define bfin_write_TIMER_ENABLE(val)   bfin_write16(TIMER_ENABLE, val)
-#define bfin_read_TIMER_DISABLE()      bfin_read16(TIMER_DISABLE)
-#define bfin_write_TIMER_DISABLE(val)  bfin_write16(TIMER_DISABLE, val)
-#define bfin_read_TIMER_STATUS()       bfin_read32(TIMER_STATUS)
-#define bfin_write_TIMER_STATUS(val)   bfin_write32(TIMER_STATUS, val)
-#define bfin_read_PORTFIO()            bfin_read16(PORTFIO)
-#define bfin_write_PORTFIO(val)        bfin_write16(PORTFIO, val)
-#define bfin_read_PORTFIO_CLEAR()      bfin_read16(PORTFIO_CLEAR)
-#define bfin_write_PORTFIO_CLEAR(val)  bfin_write16(PORTFIO_CLEAR, val)
-#define bfin_read_PORTFIO_SET()        bfin_read16(PORTFIO_SET)
-#define bfin_write_PORTFIO_SET(val)    bfin_write16(PORTFIO_SET, val)
-#define bfin_read_PORTFIO_TOGGLE()     bfin_read16(PORTFIO_TOGGLE)
-#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE, val)
-#define bfin_read_PORTFIO_MASKA()      bfin_read16(PORTFIO_MASKA)
-#define bfin_write_PORTFIO_MASKA(val)  bfin_write16(PORTFIO_MASKA, val)
-#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
-#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR, val)
-#define bfin_read_PORTFIO_MASKA_SET()  bfin_read16(PORTFIO_MASKA_SET)
-#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET, val)
-#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
-#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE, val)
-#define bfin_read_PORTFIO_MASKB()      bfin_read16(PORTFIO_MASKB)
-#define bfin_write_PORTFIO_MASKB(val)  bfin_write16(PORTFIO_MASKB, val)
-#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
-#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR, val)
-#define bfin_read_PORTFIO_MASKB_SET()  bfin_read16(PORTFIO_MASKB_SET)
-#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET, val)
-#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
-#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE, val)
-#define bfin_read_PORTFIO_DIR()        bfin_read16(PORTFIO_DIR)
-#define bfin_write_PORTFIO_DIR(val)    bfin_write16(PORTFIO_DIR, val)
-#define bfin_read_PORTFIO_POLAR()      bfin_read16(PORTFIO_POLAR)
-#define bfin_write_PORTFIO_POLAR(val)  bfin_write16(PORTFIO_POLAR, val)
-#define bfin_read_PORTFIO_EDGE()       bfin_read16(PORTFIO_EDGE)
-#define bfin_write_PORTFIO_EDGE(val)   bfin_write16(PORTFIO_EDGE, val)
-#define bfin_read_PORTFIO_BOTH()       bfin_read16(PORTFIO_BOTH)
-#define bfin_write_PORTFIO_BOTH(val)   bfin_write16(PORTFIO_BOTH, val)
-#define bfin_read_PORTFIO_INEN()       bfin_read16(PORTFIO_INEN)
-#define bfin_write_PORTFIO_INEN(val)   bfin_write16(PORTFIO_INEN, val)
-#define bfin_read_SPORT0_TCR1()        bfin_read16(SPORT0_TCR1)
-#define bfin_write_SPORT0_TCR1(val)    bfin_write16(SPORT0_TCR1, val)
-#define bfin_read_SPORT0_TCR2()        bfin_read16(SPORT0_TCR2)
-#define bfin_write_SPORT0_TCR2(val)    bfin_write16(SPORT0_TCR2, val)
-#define bfin_read_SPORT0_TCLKDIV()     bfin_read16(SPORT0_TCLKDIV)
-#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
-#define bfin_read_SPORT0_TFSDIV()      bfin_read16(SPORT0_TFSDIV)
-#define bfin_write_SPORT0_TFSDIV(val)  bfin_write16(SPORT0_TFSDIV, val)
-#define bfin_write_SPORT0_TX(val)      bfin_write32(SPORT0_TX, val)
-#define bfin_read_SPORT0_RX()          bfin_read32(SPORT0_RX)
-#define bfin_write_SPORT0_RX(val)      bfin_write32(SPORT0_RX, val)
-#define bfin_read_SPORT0_RCR1()        bfin_read16(SPORT0_RCR1)
-#define bfin_write_SPORT0_RCR1(val)    bfin_write16(SPORT0_RCR1, val)
-#define bfin_read_SPORT0_RCR2()        bfin_read16(SPORT0_RCR2)
-#define bfin_write_SPORT0_RCR2(val)    bfin_write16(SPORT0_RCR2, val)
-#define bfin_read_SPORT0_RCLKDIV()     bfin_read16(SPORT0_RCLKDIV)
-#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
-#define bfin_read_SPORT0_RFSDIV()      bfin_read16(SPORT0_RFSDIV)
-#define bfin_write_SPORT0_RFSDIV(val)  bfin_write16(SPORT0_RFSDIV, val)
-#define bfin_read_SPORT0_STAT()        bfin_read16(SPORT0_STAT)
-#define bfin_write_SPORT0_STAT(val)    bfin_write16(SPORT0_STAT, val)
-#define bfin_read_SPORT0_CHNL()        bfin_read16(SPORT0_CHNL)
-#define bfin_write_SPORT0_CHNL(val)    bfin_write16(SPORT0_CHNL, val)
-#define bfin_read_SPORT0_MCMC1()       bfin_read16(SPORT0_MCMC1)
-#define bfin_write_SPORT0_MCMC1(val)   bfin_write16(SPORT0_MCMC1, val)
-#define bfin_read_SPORT0_MCMC2()       bfin_read16(SPORT0_MCMC2)
-#define bfin_write_SPORT0_MCMC2(val)   bfin_write16(SPORT0_MCMC2, val)
-#define bfin_read_SPORT0_MTCS0()       bfin_read32(SPORT0_MTCS0)
-#define bfin_write_SPORT0_MTCS0(val)   bfin_write32(SPORT0_MTCS0, val)
-#define bfin_read_SPORT0_MTCS1()       bfin_read32(SPORT0_MTCS1)
-#define bfin_write_SPORT0_MTCS1(val)   bfin_write32(SPORT0_MTCS1, val)
-#define bfin_read_SPORT0_MTCS2()       bfin_read32(SPORT0_MTCS2)
-#define bfin_write_SPORT0_MTCS2(val)   bfin_write32(SPORT0_MTCS2, val)
-#define bfin_read_SPORT0_MTCS3()       bfin_read32(SPORT0_MTCS3)
-#define bfin_write_SPORT0_MTCS3(val)   bfin_write32(SPORT0_MTCS3, val)
-#define bfin_read_SPORT0_MRCS0()       bfin_read32(SPORT0_MRCS0)
-#define bfin_write_SPORT0_MRCS0(val)   bfin_write32(SPORT0_MRCS0, val)
-#define bfin_read_SPORT0_MRCS1()       bfin_read32(SPORT0_MRCS1)
-#define bfin_write_SPORT0_MRCS1(val)   bfin_write32(SPORT0_MRCS1, val)
-#define bfin_read_SPORT0_MRCS2()       bfin_read32(SPORT0_MRCS2)
-#define bfin_write_SPORT0_MRCS2(val)   bfin_write32(SPORT0_MRCS2, val)
-#define bfin_read_SPORT0_MRCS3()       bfin_read32(SPORT0_MRCS3)
-#define bfin_write_SPORT0_MRCS3(val)   bfin_write32(SPORT0_MRCS3, val)
-#define bfin_read_SPORT1_TCR1()        bfin_read16(SPORT1_TCR1)
-#define bfin_write_SPORT1_TCR1(val)    bfin_write16(SPORT1_TCR1, val)
-#define bfin_read_SPORT1_TCR2()        bfin_read16(SPORT1_TCR2)
-#define bfin_write_SPORT1_TCR2(val)    bfin_write16(SPORT1_TCR2, val)
-#define bfin_read_SPORT1_TCLKDIV()     bfin_read16(SPORT1_TCLKDIV)
-#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
-#define bfin_read_SPORT1_TFSDIV()      bfin_read16(SPORT1_TFSDIV)
-#define bfin_write_SPORT1_TFSDIV(val)  bfin_write16(SPORT1_TFSDIV, val)
-#define bfin_write_SPORT1_TX(val)      bfin_write32(SPORT1_TX, val)
-#define bfin_read_SPORT1_RX()          bfin_read32(SPORT1_RX)
-#define bfin_write_SPORT1_RX(val)      bfin_write32(SPORT1_RX, val)
-#define bfin_read_SPORT1_RCR1()        bfin_read16(SPORT1_RCR1)
-#define bfin_write_SPORT1_RCR1(val)    bfin_write16(SPORT1_RCR1, val)
-#define bfin_read_SPORT1_RCR2()        bfin_read16(SPORT1_RCR2)
-#define bfin_write_SPORT1_RCR2(val)    bfin_write16(SPORT1_RCR2, val)
-#define bfin_read_SPORT1_RCLKDIV()     bfin_read16(SPORT1_RCLKDIV)
-#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
-#define bfin_read_SPORT1_RFSDIV()      bfin_read16(SPORT1_RFSDIV)
-#define bfin_write_SPORT1_RFSDIV(val)  bfin_write16(SPORT1_RFSDIV, val)
-#define bfin_read_SPORT1_STAT()        bfin_read16(SPORT1_STAT)
-#define bfin_write_SPORT1_STAT(val)    bfin_write16(SPORT1_STAT, val)
-#define bfin_read_SPORT1_CHNL()        bfin_read16(SPORT1_CHNL)
-#define bfin_write_SPORT1_CHNL(val)    bfin_write16(SPORT1_CHNL, val)
-#define bfin_read_SPORT1_MCMC1()       bfin_read16(SPORT1_MCMC1)
-#define bfin_write_SPORT1_MCMC1(val)   bfin_write16(SPORT1_MCMC1, val)
-#define bfin_read_SPORT1_MCMC2()       bfin_read16(SPORT1_MCMC2)
-#define bfin_write_SPORT1_MCMC2(val)   bfin_write16(SPORT1_MCMC2, val)
-#define bfin_read_SPORT1_MTCS0()       bfin_read32(SPORT1_MTCS0)
-#define bfin_write_SPORT1_MTCS0(val)   bfin_write32(SPORT1_MTCS0, val)
-#define bfin_read_SPORT1_MTCS1()       bfin_read32(SPORT1_MTCS1)
-#define bfin_write_SPORT1_MTCS1(val)   bfin_write32(SPORT1_MTCS1, val)
-#define bfin_read_SPORT1_MTCS2()       bfin_read32(SPORT1_MTCS2)
-#define bfin_write_SPORT1_MTCS2(val)   bfin_write32(SPORT1_MTCS2, val)
-#define bfin_read_SPORT1_MTCS3()       bfin_read32(SPORT1_MTCS3)
-#define bfin_write_SPORT1_MTCS3(val)   bfin_write32(SPORT1_MTCS3, val)
-#define bfin_read_SPORT1_MRCS0()       bfin_read32(SPORT1_MRCS0)
-#define bfin_write_SPORT1_MRCS0(val)   bfin_write32(SPORT1_MRCS0, val)
-#define bfin_read_SPORT1_MRCS1()       bfin_read32(SPORT1_MRCS1)
-#define bfin_write_SPORT1_MRCS1(val)   bfin_write32(SPORT1_MRCS1, val)
-#define bfin_read_SPORT1_MRCS2()       bfin_read32(SPORT1_MRCS2)
-#define bfin_write_SPORT1_MRCS2(val)   bfin_write32(SPORT1_MRCS2, val)
-#define bfin_read_SPORT1_MRCS3()       bfin_read32(SPORT1_MRCS3)
-#define bfin_write_SPORT1_MRCS3(val)   bfin_write32(SPORT1_MRCS3, val)
-#define bfin_read_EBIU_AMGCTL()        bfin_read16(EBIU_AMGCTL)
-#define bfin_write_EBIU_AMGCTL(val)    bfin_write16(EBIU_AMGCTL, val)
-#define bfin_read_EBIU_AMBCTL0()       bfin_read32(EBIU_AMBCTL0)
-#define bfin_write_EBIU_AMBCTL0(val)   bfin_write32(EBIU_AMBCTL0, val)
-#define bfin_read_EBIU_AMBCTL1()       bfin_read32(EBIU_AMBCTL1)
-#define bfin_write_EBIU_AMBCTL1(val)   bfin_write32(EBIU_AMBCTL1, val)
-#define bfin_read_EBIU_SDGCTL()        bfin_read32(EBIU_SDGCTL)
-#define bfin_write_EBIU_SDGCTL(val)    bfin_write32(EBIU_SDGCTL, val)
-#define bfin_read_EBIU_SDBCTL()        bfin_read16(EBIU_SDBCTL)
-#define bfin_write_EBIU_SDBCTL(val)    bfin_write16(EBIU_SDBCTL, val)
-#define bfin_read_EBIU_SDRRC()         bfin_read16(EBIU_SDRRC)
-#define bfin_write_EBIU_SDRRC(val)     bfin_write16(EBIU_SDRRC, val)
-#define bfin_read_EBIU_SDSTAT()        bfin_read16(EBIU_SDSTAT)
-#define bfin_write_EBIU_SDSTAT(val)    bfin_write16(EBIU_SDSTAT, val)
-#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_readPTR(DMA0_NEXT_DESC_PTR)
-#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_writePTR(DMA0_NEXT_DESC_PTR, val)
-#define bfin_read_DMA0_START_ADDR()    bfin_readPTR(DMA0_START_ADDR)
-#define bfin_write_DMA0_START_ADDR(val) bfin_writePTR(DMA0_START_ADDR, val)
-#define bfin_read_DMA0_CONFIG()        bfin_read16(DMA0_CONFIG)
-#define bfin_write_DMA0_CONFIG(val)    bfin_write16(DMA0_CONFIG, val)
-#define bfin_read_DMA0_X_COUNT()       bfin_read16(DMA0_X_COUNT)
-#define bfin_write_DMA0_X_COUNT(val)   bfin_write16(DMA0_X_COUNT, val)
-#define bfin_read_DMA0_X_MODIFY()      bfin_read16(DMA0_X_MODIFY)
-#define bfin_write_DMA0_X_MODIFY(val)  bfin_write16(DMA0_X_MODIFY, val)
-#define bfin_read_DMA0_Y_COUNT()       bfin_read16(DMA0_Y_COUNT)
-#define bfin_write_DMA0_Y_COUNT(val)   bfin_write16(DMA0_Y_COUNT, val)
-#define bfin_read_DMA0_Y_MODIFY()      bfin_read16(DMA0_Y_MODIFY)
-#define bfin_write_DMA0_Y_MODIFY(val)  bfin_write16(DMA0_Y_MODIFY, val)
-#define bfin_read_DMA0_CURR_DESC_PTR() bfin_readPTR(DMA0_CURR_DESC_PTR)
-#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_writePTR(DMA0_CURR_DESC_PTR, val)
-#define bfin_read_DMA0_CURR_ADDR()     bfin_readPTR(DMA0_CURR_ADDR)
-#define bfin_write_DMA0_CURR_ADDR(val) bfin_writePTR(DMA0_CURR_ADDR, val)
-#define bfin_read_DMA0_IRQ_STATUS()    bfin_read16(DMA0_IRQ_STATUS)
-#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
-#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
-#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
-#define bfin_read_DMA0_CURR_X_COUNT()  bfin_read16(DMA0_CURR_X_COUNT)
-#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
-#define bfin_read_DMA0_CURR_Y_COUNT()  bfin_read16(DMA0_CURR_Y_COUNT)
-#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
-#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_readPTR(DMA1_NEXT_DESC_PTR)
-#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_writePTR(DMA1_NEXT_DESC_PTR, val)
-#define bfin_read_DMA1_START_ADDR()    bfin_readPTR(DMA1_START_ADDR)
-#define bfin_write_DMA1_START_ADDR(val) bfin_writePTR(DMA1_START_ADDR, val)
-#define bfin_read_DMA1_CONFIG()        bfin_read16(DMA1_CONFIG)
-#define bfin_write_DMA1_CONFIG(val)    bfin_write16(DMA1_CONFIG, val)
-#define bfin_read_DMA1_X_COUNT()       bfin_read16(DMA1_X_COUNT)
-#define bfin_write_DMA1_X_COUNT(val)   bfin_write16(DMA1_X_COUNT, val)
-#define bfin_read_DMA1_X_MODIFY()      bfin_read16(DMA1_X_MODIFY)
-#define bfin_write_DMA1_X_MODIFY(val)  bfin_write16(DMA1_X_MODIFY, val)
-#define bfin_read_DMA1_Y_COUNT()       bfin_read16(DMA1_Y_COUNT)
-#define bfin_write_DMA1_Y_COUNT(val)   bfin_write16(DMA1_Y_COUNT, val)
-#define bfin_read_DMA1_Y_MODIFY()      bfin_read16(DMA1_Y_MODIFY)
-#define bfin_write_DMA1_Y_MODIFY(val)  bfin_write16(DMA1_Y_MODIFY, val)
-#define bfin_read_DMA1_CURR_DESC_PTR() bfin_readPTR(DMA1_CURR_DESC_PTR)
-#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_writePTR(DMA1_CURR_DESC_PTR, val)
-#define bfin_read_DMA1_CURR_ADDR()     bfin_readPTR(DMA1_CURR_ADDR)
-#define bfin_write_DMA1_CURR_ADDR(val) bfin_writePTR(DMA1_CURR_ADDR, val)
-#define bfin_read_DMA1_IRQ_STATUS()    bfin_read16(DMA1_IRQ_STATUS)
-#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
-#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
-#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
-#define bfin_read_DMA1_CURR_X_COUNT()  bfin_read16(DMA1_CURR_X_COUNT)
-#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
-#define bfin_read_DMA1_CURR_Y_COUNT()  bfin_read16(DMA1_CURR_Y_COUNT)
-#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
-#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_readPTR(DMA2_NEXT_DESC_PTR)
-#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_writePTR(DMA2_NEXT_DESC_PTR, val)
-#define bfin_read_DMA2_START_ADDR()    bfin_readPTR(DMA2_START_ADDR)
-#define bfin_write_DMA2_START_ADDR(val) bfin_writePTR(DMA2_START_ADDR, val)
-#define bfin_read_DMA2_CONFIG()        bfin_read16(DMA2_CONFIG)
-#define bfin_write_DMA2_CONFIG(val)    bfin_write16(DMA2_CONFIG, val)
-#define bfin_read_DMA2_X_COUNT()       bfin_read16(DMA2_X_COUNT)
-#define bfin_write_DMA2_X_COUNT(val)   bfin_write16(DMA2_X_COUNT, val)
-#define bfin_read_DMA2_X_MODIFY()      bfin_read16(DMA2_X_MODIFY)
-#define bfin_write_DMA2_X_MODIFY(val)  bfin_write16(DMA2_X_MODIFY, val)
-#define bfin_read_DMA2_Y_COUNT()       bfin_read16(DMA2_Y_COUNT)
-#define bfin_write_DMA2_Y_COUNT(val)   bfin_write16(DMA2_Y_COUNT, val)
-#define bfin_read_DMA2_Y_MODIFY()      bfin_read16(DMA2_Y_MODIFY)
-#define bfin_write_DMA2_Y_MODIFY(val)  bfin_write16(DMA2_Y_MODIFY, val)
-#define bfin_read_DMA2_CURR_DESC_PTR() bfin_readPTR(DMA2_CURR_DESC_PTR)
-#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_writePTR(DMA2_CURR_DESC_PTR, val)
-#define bfin_read_DMA2_CURR_ADDR()     bfin_readPTR(DMA2_CURR_ADDR)
-#define bfin_write_DMA2_CURR_ADDR(val) bfin_writePTR(DMA2_CURR_ADDR, val)
-#define bfin_read_DMA2_IRQ_STATUS()    bfin_read16(DMA2_IRQ_STATUS)
-#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
-#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
-#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
-#define bfin_read_DMA2_CURR_X_COUNT()  bfin_read16(DMA2_CURR_X_COUNT)
-#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
-#define bfin_read_DMA2_CURR_Y_COUNT()  bfin_read16(DMA2_CURR_Y_COUNT)
-#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
-#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_readPTR(DMA3_NEXT_DESC_PTR)
-#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_writePTR(DMA3_NEXT_DESC_PTR, val)
-#define bfin_read_DMA3_START_ADDR()    bfin_readPTR(DMA3_START_ADDR)
-#define bfin_write_DMA3_START_ADDR(val) bfin_writePTR(DMA3_START_ADDR, val)
-#define bfin_read_DMA3_CONFIG()        bfin_read16(DMA3_CONFIG)
-#define bfin_write_DMA3_CONFIG(val)    bfin_write16(DMA3_CONFIG, val)
-#define bfin_read_DMA3_X_COUNT()       bfin_read16(DMA3_X_COUNT)
-#define bfin_write_DMA3_X_COUNT(val)   bfin_write16(DMA3_X_COUNT, val)
-#define bfin_read_DMA3_X_MODIFY()      bfin_read16(DMA3_X_MODIFY)
-#define bfin_write_DMA3_X_MODIFY(val)  bfin_write16(DMA3_X_MODIFY, val)
-#define bfin_read_DMA3_Y_COUNT()       bfin_read16(DMA3_Y_COUNT)
-#define bfin_write_DMA3_Y_COUNT(val)   bfin_write16(DMA3_Y_COUNT, val)
-#define bfin_read_DMA3_Y_MODIFY()      bfin_read16(DMA3_Y_MODIFY)
-#define bfin_write_DMA3_Y_MODIFY(val)  bfin_write16(DMA3_Y_MODIFY, val)
-#define bfin_read_DMA3_CURR_DESC_PTR() bfin_readPTR(DMA3_CURR_DESC_PTR)
-#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_writePTR(DMA3_CURR_DESC_PTR, val)
-#define bfin_read_DMA3_CURR_ADDR()     bfin_readPTR(DMA3_CURR_ADDR)
-#define bfin_write_DMA3_CURR_ADDR(val) bfin_writePTR(DMA3_CURR_ADDR, val)
-#define bfin_read_DMA3_IRQ_STATUS()    bfin_read16(DMA3_IRQ_STATUS)
-#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
-#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
-#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
-#define bfin_read_DMA3_CURR_X_COUNT()  bfin_read16(DMA3_CURR_X_COUNT)
-#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
-#define bfin_read_DMA3_CURR_Y_COUNT()  bfin_read16(DMA3_CURR_Y_COUNT)
-#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
-#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_readPTR(DMA4_NEXT_DESC_PTR)
-#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_writePTR(DMA4_NEXT_DESC_PTR, val)
-#define bfin_read_DMA4_START_ADDR()    bfin_readPTR(DMA4_START_ADDR)
-#define bfin_write_DMA4_START_ADDR(val) bfin_writePTR(DMA4_START_ADDR, val)
-#define bfin_read_DMA4_CONFIG()        bfin_read16(DMA4_CONFIG)
-#define bfin_write_DMA4_CONFIG(val)    bfin_write16(DMA4_CONFIG, val)
-#define bfin_read_DMA4_X_COUNT()       bfin_read16(DMA4_X_COUNT)
-#define bfin_write_DMA4_X_COUNT(val)   bfin_write16(DMA4_X_COUNT, val)
-#define bfin_read_DMA4_X_MODIFY()      bfin_read16(DMA4_X_MODIFY)
-#define bfin_write_DMA4_X_MODIFY(val)  bfin_write16(DMA4_X_MODIFY, val)
-#define bfin_read_DMA4_Y_COUNT()       bfin_read16(DMA4_Y_COUNT)
-#define bfin_write_DMA4_Y_COUNT(val)   bfin_write16(DMA4_Y_COUNT, val)
-#define bfin_read_DMA4_Y_MODIFY()      bfin_read16(DMA4_Y_MODIFY)
-#define bfin_write_DMA4_Y_MODIFY(val)  bfin_write16(DMA4_Y_MODIFY, val)
-#define bfin_read_DMA4_CURR_DESC_PTR() bfin_readPTR(DMA4_CURR_DESC_PTR)
-#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_writePTR(DMA4_CURR_DESC_PTR, val)
-#define bfin_read_DMA4_CURR_ADDR()     bfin_readPTR(DMA4_CURR_ADDR)
-#define bfin_write_DMA4_CURR_ADDR(val) bfin_writePTR(DMA4_CURR_ADDR, val)
-#define bfin_read_DMA4_IRQ_STATUS()    bfin_read16(DMA4_IRQ_STATUS)
-#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
-#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
-#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
-#define bfin_read_DMA4_CURR_X_COUNT()  bfin_read16(DMA4_CURR_X_COUNT)
-#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
-#define bfin_read_DMA4_CURR_Y_COUNT()  bfin_read16(DMA4_CURR_Y_COUNT)
-#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
-#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_readPTR(DMA5_NEXT_DESC_PTR)
-#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_writePTR(DMA5_NEXT_DESC_PTR, val)
-#define bfin_read_DMA5_START_ADDR()    bfin_readPTR(DMA5_START_ADDR)
-#define bfin_write_DMA5_START_ADDR(val) bfin_writePTR(DMA5_START_ADDR, val)
-#define bfin_read_DMA5_CONFIG()        bfin_read16(DMA5_CONFIG)
-#define bfin_write_DMA5_CONFIG(val)    bfin_write16(DMA5_CONFIG, val)
-#define bfin_read_DMA5_X_COUNT()       bfin_read16(DMA5_X_COUNT)
-#define bfin_write_DMA5_X_COUNT(val)   bfin_write16(DMA5_X_COUNT, val)
-#define bfin_read_DMA5_X_MODIFY()      bfin_read16(DMA5_X_MODIFY)
-#define bfin_write_DMA5_X_MODIFY(val)  bfin_write16(DMA5_X_MODIFY, val)
-#define bfin_read_DMA5_Y_COUNT()       bfin_read16(DMA5_Y_COUNT)
-#define bfin_write_DMA5_Y_COUNT(val)   bfin_write16(DMA5_Y_COUNT, val)
-#define bfin_read_DMA5_Y_MODIFY()      bfin_read16(DMA5_Y_MODIFY)
-#define bfin_write_DMA5_Y_MODIFY(val)  bfin_write16(DMA5_Y_MODIFY, val)
-#define bfin_read_DMA5_CURR_DESC_PTR() bfin_readPTR(DMA5_CURR_DESC_PTR)
-#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_writePTR(DMA5_CURR_DESC_PTR, val)
-#define bfin_read_DMA5_CURR_ADDR()     bfin_readPTR(DMA5_CURR_ADDR)
-#define bfin_write_DMA5_CURR_ADDR(val) bfin_writePTR(DMA5_CURR_ADDR, val)
-#define bfin_read_DMA5_IRQ_STATUS()    bfin_read16(DMA5_IRQ_STATUS)
-#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
-#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
-#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
-#define bfin_read_DMA5_CURR_X_COUNT()  bfin_read16(DMA5_CURR_X_COUNT)
-#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
-#define bfin_read_DMA5_CURR_Y_COUNT()  bfin_read16(DMA5_CURR_Y_COUNT)
-#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
-#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
-#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR, val)
-#define bfin_read_DMA6_START_ADDR()    bfin_readPTR(DMA6_START_ADDR)
-#define bfin_write_DMA6_START_ADDR(val) bfin_writePTR(DMA6_START_ADDR, val)
-#define bfin_read_DMA6_CONFIG()        bfin_read16(DMA6_CONFIG)
-#define bfin_write_DMA6_CONFIG(val)    bfin_write16(DMA6_CONFIG, val)
-#define bfin_read_DMA6_X_COUNT()       bfin_read16(DMA6_X_COUNT)
-#define bfin_write_DMA6_X_COUNT(val)   bfin_write16(DMA6_X_COUNT, val)
-#define bfin_read_DMA6_X_MODIFY()      bfin_read16(DMA6_X_MODIFY)
-#define bfin_write_DMA6_X_MODIFY(val)  bfin_write16(DMA6_X_MODIFY, val)
-#define bfin_read_DMA6_Y_COUNT()       bfin_read16(DMA6_Y_COUNT)
-#define bfin_write_DMA6_Y_COUNT(val)   bfin_write16(DMA6_Y_COUNT, val)
-#define bfin_read_DMA6_Y_MODIFY()      bfin_read16(DMA6_Y_MODIFY)
-#define bfin_write_DMA6_Y_MODIFY(val)  bfin_write16(DMA6_Y_MODIFY, val)
-#define bfin_read_DMA6_CURR_DESC_PTR() bfin_readPTR(DMA6_CURR_DESC_PTR)
-#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_writePTR(DMA6_CURR_DESC_PTR, val)
-#define bfin_read_DMA6_CURR_ADDR()     bfin_readPTR(DMA6_CURR_ADDR)
-#define bfin_write_DMA6_CURR_ADDR(val) bfin_writePTR(DMA6_CURR_ADDR, val)
-#define bfin_read_DMA6_IRQ_STATUS()    bfin_read16(DMA6_IRQ_STATUS)
-#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
-#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
-#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
-#define bfin_read_DMA6_CURR_X_COUNT()  bfin_read16(DMA6_CURR_X_COUNT)
-#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
-#define bfin_read_DMA6_CURR_Y_COUNT()  bfin_read16(DMA6_CURR_Y_COUNT)
-#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
-#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_readPTR(DMA7_NEXT_DESC_PTR)
-#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_writePTR(DMA7_NEXT_DESC_PTR, val)
-#define bfin_read_DMA7_START_ADDR()    bfin_readPTR(DMA7_START_ADDR)
-#define bfin_write_DMA7_START_ADDR(val) bfin_writePTR(DMA7_START_ADDR, val)
-#define bfin_read_DMA7_CONFIG()        bfin_read16(DMA7_CONFIG)
-#define bfin_write_DMA7_CONFIG(val)    bfin_write16(DMA7_CONFIG, val)
-#define bfin_read_DMA7_X_COUNT()       bfin_read16(DMA7_X_COUNT)
-#define bfin_write_DMA7_X_COUNT(val)   bfin_write16(DMA7_X_COUNT, val)
-#define bfin_read_DMA7_X_MODIFY()      bfin_read16(DMA7_X_MODIFY)
-#define bfin_write_DMA7_X_MODIFY(val)  bfin_write16(DMA7_X_MODIFY, val)
-#define bfin_read_DMA7_Y_COUNT()       bfin_read16(DMA7_Y_COUNT)
-#define bfin_write_DMA7_Y_COUNT(val)   bfin_write16(DMA7_Y_COUNT, val)
-#define bfin_read_DMA7_Y_MODIFY()      bfin_read16(DMA7_Y_MODIFY)
-#define bfin_write_DMA7_Y_MODIFY(val)  bfin_write16(DMA7_Y_MODIFY, val)
-#define bfin_read_DMA7_CURR_DESC_PTR() bfin_readPTR(DMA7_CURR_DESC_PTR)
-#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_writePTR(DMA7_CURR_DESC_PTR, val)
-#define bfin_read_DMA7_CURR_ADDR()     bfin_readPTR(DMA7_CURR_ADDR)
-#define bfin_write_DMA7_CURR_ADDR(val) bfin_writePTR(DMA7_CURR_ADDR, val)
-#define bfin_read_DMA7_IRQ_STATUS()    bfin_read16(DMA7_IRQ_STATUS)
-#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
-#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
-#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
-#define bfin_read_DMA7_CURR_X_COUNT()  bfin_read16(DMA7_CURR_X_COUNT)
-#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
-#define bfin_read_DMA7_CURR_Y_COUNT()  bfin_read16(DMA7_CURR_Y_COUNT)
-#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
-#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_readPTR(DMA8_NEXT_DESC_PTR)
-#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_writePTR(DMA8_NEXT_DESC_PTR, val)
-#define bfin_read_DMA8_START_ADDR()    bfin_readPTR(DMA8_START_ADDR)
-#define bfin_write_DMA8_START_ADDR(val) bfin_writePTR(DMA8_START_ADDR, val)
-#define bfin_read_DMA8_CONFIG()        bfin_read16(DMA8_CONFIG)
-#define bfin_write_DMA8_CONFIG(val)    bfin_write16(DMA8_CONFIG, val)
-#define bfin_read_DMA8_X_COUNT()       bfin_read16(DMA8_X_COUNT)
-#define bfin_write_DMA8_X_COUNT(val)   bfin_write16(DMA8_X_COUNT, val)
-#define bfin_read_DMA8_X_MODIFY()      bfin_read16(DMA8_X_MODIFY)
-#define bfin_write_DMA8_X_MODIFY(val)  bfin_write16(DMA8_X_MODIFY, val)
-#define bfin_read_DMA8_Y_COUNT()       bfin_read16(DMA8_Y_COUNT)
-#define bfin_write_DMA8_Y_COUNT(val)   bfin_write16(DMA8_Y_COUNT, val)
-#define bfin_read_DMA8_Y_MODIFY()      bfin_read16(DMA8_Y_MODIFY)
-#define bfin_write_DMA8_Y_MODIFY(val)  bfin_write16(DMA8_Y_MODIFY, val)
-#define bfin_read_DMA8_CURR_DESC_PTR() bfin_readPTR(DMA8_CURR_DESC_PTR)
-#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_writePTR(DMA8_CURR_DESC_PTR, val)
-#define bfin_read_DMA8_CURR_ADDR()     bfin_readPTR(DMA8_CURR_ADDR)
-#define bfin_write_DMA8_CURR_ADDR(val) bfin_writePTR(DMA8_CURR_ADDR, val)
-#define bfin_read_DMA8_IRQ_STATUS()    bfin_read16(DMA8_IRQ_STATUS)
-#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
-#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
-#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
-#define bfin_read_DMA8_CURR_X_COUNT()  bfin_read16(DMA8_CURR_X_COUNT)
-#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
-#define bfin_read_DMA8_CURR_Y_COUNT()  bfin_read16(DMA8_CURR_Y_COUNT)
-#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
-#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_readPTR(DMA9_NEXT_DESC_PTR)
-#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_writePTR(DMA9_NEXT_DESC_PTR, val)
-#define bfin_read_DMA9_START_ADDR()    bfin_readPTR(DMA9_START_ADDR)
-#define bfin_write_DMA9_START_ADDR(val) bfin_writePTR(DMA9_START_ADDR, val)
-#define bfin_read_DMA9_CONFIG()        bfin_read16(DMA9_CONFIG)
-#define bfin_write_DMA9_CONFIG(val)    bfin_write16(DMA9_CONFIG, val)
-#define bfin_read_DMA9_X_COUNT()       bfin_read16(DMA9_X_COUNT)
-#define bfin_write_DMA9_X_COUNT(val)   bfin_write16(DMA9_X_COUNT, val)
-#define bfin_read_DMA9_X_MODIFY()      bfin_read16(DMA9_X_MODIFY)
-#define bfin_write_DMA9_X_MODIFY(val)  bfin_write16(DMA9_X_MODIFY, val)
-#define bfin_read_DMA9_Y_COUNT()       bfin_read16(DMA9_Y_COUNT)
-#define bfin_write_DMA9_Y_COUNT(val)   bfin_write16(DMA9_Y_COUNT, val)
-#define bfin_read_DMA9_Y_MODIFY()      bfin_read16(DMA9_Y_MODIFY)
-#define bfin_write_DMA9_Y_MODIFY(val)  bfin_write16(DMA9_Y_MODIFY, val)
-#define bfin_read_DMA9_CURR_DESC_PTR() bfin_readPTR(DMA9_CURR_DESC_PTR)
-#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_writePTR(DMA9_CURR_DESC_PTR, val)
-#define bfin_read_DMA9_CURR_ADDR()     bfin_readPTR(DMA9_CURR_ADDR)
-#define bfin_write_DMA9_CURR_ADDR(val) bfin_writePTR(DMA9_CURR_ADDR, val)
-#define bfin_read_DMA9_IRQ_STATUS()    bfin_read16(DMA9_IRQ_STATUS)
-#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
-#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
-#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
-#define bfin_read_DMA9_CURR_X_COUNT()  bfin_read16(DMA9_CURR_X_COUNT)
-#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
-#define bfin_read_DMA9_CURR_Y_COUNT()  bfin_read16(DMA9_CURR_Y_COUNT)
-#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
-#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_readPTR(DMA10_NEXT_DESC_PTR)
-#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_writePTR(DMA10_NEXT_DESC_PTR, val)
-#define bfin_read_DMA10_START_ADDR()   bfin_readPTR(DMA10_START_ADDR)
-#define bfin_write_DMA10_START_ADDR(val) bfin_writePTR(DMA10_START_ADDR, val)
-#define bfin_read_DMA10_CONFIG()       bfin_read16(DMA10_CONFIG)
-#define bfin_write_DMA10_CONFIG(val)   bfin_write16(DMA10_CONFIG, val)
-#define bfin_read_DMA10_X_COUNT()      bfin_read16(DMA10_X_COUNT)
-#define bfin_write_DMA10_X_COUNT(val)  bfin_write16(DMA10_X_COUNT, val)
-#define bfin_read_DMA10_X_MODIFY()     bfin_read16(DMA10_X_MODIFY)
-#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY, val)
-#define bfin_read_DMA10_Y_COUNT()      bfin_read16(DMA10_Y_COUNT)
-#define bfin_write_DMA10_Y_COUNT(val)  bfin_write16(DMA10_Y_COUNT, val)
-#define bfin_read_DMA10_Y_MODIFY()     bfin_read16(DMA10_Y_MODIFY)
-#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY, val)
-#define bfin_read_DMA10_CURR_DESC_PTR() bfin_readPTR(DMA10_CURR_DESC_PTR)
-#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_writePTR(DMA10_CURR_DESC_PTR, val)
-#define bfin_read_DMA10_CURR_ADDR()    bfin_readPTR(DMA10_CURR_ADDR)
-#define bfin_write_DMA10_CURR_ADDR(val) bfin_writePTR(DMA10_CURR_ADDR, val)
-#define bfin_read_DMA10_IRQ_STATUS()   bfin_read16(DMA10_IRQ_STATUS)
-#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
-#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
-#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
-#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
-#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
-#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
-#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
-#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_readPTR(DMA11_NEXT_DESC_PTR)
-#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_writePTR(DMA11_NEXT_DESC_PTR, val)
-#define bfin_read_DMA11_START_ADDR()   bfin_readPTR(DMA11_START_ADDR)
-#define bfin_write_DMA11_START_ADDR(val) bfin_writePTR(DMA11_START_ADDR, val)
-#define bfin_read_DMA11_CONFIG()       bfin_read16(DMA11_CONFIG)
-#define bfin_write_DMA11_CONFIG(val)   bfin_write16(DMA11_CONFIG, val)
-#define bfin_read_DMA11_X_COUNT()      bfin_read16(DMA11_X_COUNT)
-#define bfin_write_DMA11_X_COUNT(val)  bfin_write16(DMA11_X_COUNT, val)
-#define bfin_read_DMA11_X_MODIFY()     bfin_read16(DMA11_X_MODIFY)
-#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY, val)
-#define bfin_read_DMA11_Y_COUNT()      bfin_read16(DMA11_Y_COUNT)
-#define bfin_write_DMA11_Y_COUNT(val)  bfin_write16(DMA11_Y_COUNT, val)
-#define bfin_read_DMA11_Y_MODIFY()     bfin_read16(DMA11_Y_MODIFY)
-#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY, val)
-#define bfin_read_DMA11_CURR_DESC_PTR() bfin_readPTR(DMA11_CURR_DESC_PTR)
-#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_writePTR(DMA11_CURR_DESC_PTR, val)
-#define bfin_read_DMA11_CURR_ADDR()    bfin_readPTR(DMA11_CURR_ADDR)
-#define bfin_write_DMA11_CURR_ADDR(val) bfin_writePTR(DMA11_CURR_ADDR, val)
-#define bfin_read_DMA11_IRQ_STATUS()   bfin_read16(DMA11_IRQ_STATUS)
-#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
-#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
-#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
-#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
-#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
-#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
-#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
-#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_readPTR(MDMA_S0_NEXT_DESC_PTR)
-#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_S0_NEXT_DESC_PTR, val)
-#define bfin_read_MDMA_S0_START_ADDR() bfin_readPTR(MDMA_S0_START_ADDR)
-#define bfin_write_MDMA_S0_START_ADDR(val) bfin_writePTR(MDMA_S0_START_ADDR, val)
-#define bfin_read_MDMA_S0_CONFIG()     bfin_read16(MDMA_S0_CONFIG)
-#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
-#define bfin_read_MDMA_S0_X_COUNT()    bfin_read16(MDMA_S0_X_COUNT)
-#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
-#define bfin_read_MDMA_S0_X_MODIFY()   bfin_read16(MDMA_S0_X_MODIFY)
-#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY, val)
-#define bfin_read_MDMA_S0_Y_COUNT()    bfin_read16(MDMA_S0_Y_COUNT)
-#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
-#define bfin_read_MDMA_S0_Y_MODIFY()   bfin_read16(MDMA_S0_Y_MODIFY)
-#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY, val)
-#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_readPTR(MDMA_S0_CURR_DESC_PTR)
-#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_writePTR(MDMA_S0_CURR_DESC_PTR, val)
-#define bfin_read_MDMA_S0_CURR_ADDR()  bfin_readPTR(MDMA_S0_CURR_ADDR)
-#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_writePTR(MDMA_S0_CURR_ADDR, val)
-#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
-#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val)
-#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
-#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP, val)
-#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
-#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT, val)
-#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
-#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT, val)
-#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_readPTR(MDMA_D0_NEXT_DESC_PTR)
-#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_D0_NEXT_DESC_PTR, val)
-#define bfin_read_MDMA_D0_START_ADDR() bfin_readPTR(MDMA_D0_START_ADDR)
-#define bfin_write_MDMA_D0_START_ADDR(val) bfin_writePTR(MDMA_D0_START_ADDR, val)
-#define bfin_read_MDMA_D0_CONFIG()     bfin_read16(MDMA_D0_CONFIG)
-#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
-#define bfin_read_MDMA_D0_X_COUNT()    bfin_read16(MDMA_D0_X_COUNT)
-#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
-#define bfin_read_MDMA_D0_X_MODIFY()   bfin_read16(MDMA_D0_X_MODIFY)
-#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY, val)
-#define bfin_read_MDMA_D0_Y_COUNT()    bfin_read16(MDMA_D0_Y_COUNT)
-#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
-#define bfin_read_MDMA_D0_Y_MODIFY()   bfin_read16(MDMA_D0_Y_MODIFY)
-#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY, val)
-#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_readPTR(MDMA_D0_CURR_DESC_PTR)
-#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_writePTR(MDMA_D0_CURR_DESC_PTR, val)
-#define bfin_read_MDMA_D0_CURR_ADDR()  bfin_readPTR(MDMA_D0_CURR_ADDR)
-#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_writePTR(MDMA_D0_CURR_ADDR, val)
-#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
-#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
-#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
-#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP, val)
-#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
-#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT, val)
-#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
-#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
-#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_readPTR(MDMA_S1_NEXT_DESC_PTR)
-#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_S1_NEXT_DESC_PTR, val)
-#define bfin_read_MDMA_S1_START_ADDR() bfin_readPTR(MDMA_S1_START_ADDR)
-#define bfin_write_MDMA_S1_START_ADDR(val) bfin_writePTR(MDMA_S1_START_ADDR, val)
-#define bfin_read_MDMA_S1_CONFIG()     bfin_read16(MDMA_S1_CONFIG)
-#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
-#define bfin_read_MDMA_S1_X_COUNT()    bfin_read16(MDMA_S1_X_COUNT)
-#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT, val)
-#define bfin_read_MDMA_S1_X_MODIFY()   bfin_read16(MDMA_S1_X_MODIFY)
-#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY, val)
-#define bfin_read_MDMA_S1_Y_COUNT()    bfin_read16(MDMA_S1_Y_COUNT)
-#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT, val)
-#define bfin_read_MDMA_S1_Y_MODIFY()   bfin_read16(MDMA_S1_Y_MODIFY)
-#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY, val)
-#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_readPTR(MDMA_S1_CURR_DESC_PTR)
-#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_writePTR(MDMA_S1_CURR_DESC_PTR, val)
-#define bfin_read_MDMA_S1_CURR_ADDR()  bfin_readPTR(MDMA_S1_CURR_ADDR)
-#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_writePTR(MDMA_S1_CURR_ADDR, val)
-#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
-#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
-#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
-#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP, val)
-#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
-#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT, val)
-#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
-#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT, val)
-#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_readPTR(MDMA_D1_NEXT_DESC_PTR)
-#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_D1_NEXT_DESC_PTR, val)
-#define bfin_read_MDMA_D1_START_ADDR() bfin_readPTR(MDMA_D1_START_ADDR)
-#define bfin_write_MDMA_D1_START_ADDR(val) bfin_writePTR(MDMA_D1_START_ADDR, val)
-#define bfin_read_MDMA_D1_CONFIG()     bfin_read16(MDMA_D1_CONFIG)
-#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
-#define bfin_read_MDMA_D1_X_COUNT()    bfin_read16(MDMA_D1_X_COUNT)
-#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT, val)
-#define bfin_read_MDMA_D1_X_MODIFY()   bfin_read16(MDMA_D1_X_MODIFY)
-#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY, val)
-#define bfin_read_MDMA_D1_Y_COUNT()    bfin_read16(MDMA_D1_Y_COUNT)
-#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT, val)
-#define bfin_read_MDMA_D1_Y_MODIFY()   bfin_read16(MDMA_D1_Y_MODIFY)
-#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY, val)
-#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_readPTR(MDMA_D1_CURR_DESC_PTR)
-#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_writePTR(MDMA_D1_CURR_DESC_PTR, val)
-#define bfin_read_MDMA_D1_CURR_ADDR()  bfin_readPTR(MDMA_D1_CURR_ADDR)
-#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_writePTR(MDMA_D1_CURR_ADDR, val)
-#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
-#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
-#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
-#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP, val)
-#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
-#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT, val)
-#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
-#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
-#define bfin_read_PPI_CONTROL()        bfin_read16(PPI_CONTROL)
-#define bfin_write_PPI_CONTROL(val)    bfin_write16(PPI_CONTROL, val)
-#define bfin_read_PPI_STATUS()         bfin_read16(PPI_STATUS)
-#define bfin_write_PPI_STATUS(val)     bfin_write16(PPI_STATUS, val)
-#define bfin_read_PPI_COUNT()          bfin_read16(PPI_COUNT)
-#define bfin_write_PPI_COUNT(val)      bfin_write16(PPI_COUNT, val)
-#define bfin_read_PPI_DELAY()          bfin_read16(PPI_DELAY)
-#define bfin_write_PPI_DELAY(val)      bfin_write16(PPI_DELAY, val)
-#define bfin_read_PPI_FRAME()          bfin_read16(PPI_FRAME)
-#define bfin_write_PPI_FRAME(val)      bfin_write16(PPI_FRAME, val)
-#define bfin_read_TWI_CLKDIV()         bfin_read16(TWI_CLKDIV)
-#define bfin_write_TWI_CLKDIV(val)     bfin_write16(TWI_CLKDIV, val)
-#define bfin_read_TWI_CONTROL()        bfin_read16(TWI_CONTROL)
-#define bfin_write_TWI_CONTROL(val)    bfin_write16(TWI_CONTROL, val)
-#define bfin_read_TWI_SLAVE_CTL()      bfin_read16(TWI_SLAVE_CTL)
-#define bfin_write_TWI_SLAVE_CTL(val)  bfin_write16(TWI_SLAVE_CTL, val)
-#define bfin_read_TWI_SLAVE_STAT()     bfin_read16(TWI_SLAVE_STAT)
-#define bfin_write_TWI_SLAVE_STAT(val) bfin_write16(TWI_SLAVE_STAT, val)
-#define bfin_read_TWI_SLAVE_ADDR()     bfin_read16(TWI_SLAVE_ADDR)
-#define bfin_write_TWI_SLAVE_ADDR(val) bfin_write16(TWI_SLAVE_ADDR, val)
-#define bfin_read_TWI_MASTER_CTL()     bfin_read16(TWI_MASTER_CTL)
-#define bfin_write_TWI_MASTER_CTL(val) bfin_write16(TWI_MASTER_CTL, val)
-#define bfin_read_TWI_MASTER_STAT()    bfin_read16(TWI_MASTER_STAT)
-#define bfin_write_TWI_MASTER_STAT(val) bfin_write16(TWI_MASTER_STAT, val)
-#define bfin_read_TWI_MASTER_ADDR()    bfin_read16(TWI_MASTER_ADDR)
-#define bfin_write_TWI_MASTER_ADDR(val) bfin_write16(TWI_MASTER_ADDR, val)
-#define bfin_read_TWI_INT_STAT()       bfin_read16(TWI_INT_STAT)
-#define bfin_write_TWI_INT_STAT(val)   bfin_write16(TWI_INT_STAT, val)
-#define bfin_read_TWI_INT_MASK()       bfin_read16(TWI_INT_MASK)
-#define bfin_write_TWI_INT_MASK(val)   bfin_write16(TWI_INT_MASK, val)
-#define bfin_read_TWI_FIFO_CTL()       bfin_read16(TWI_FIFO_CTL)
-#define bfin_write_TWI_FIFO_CTL(val)   bfin_write16(TWI_FIFO_CTL, val)
-#define bfin_read_TWI_FIFO_STAT()      bfin_read16(TWI_FIFO_STAT)
-#define bfin_write_TWI_FIFO_STAT(val)  bfin_write16(TWI_FIFO_STAT, val)
-#define bfin_read_TWI_XMT_DATA8()      bfin_read16(TWI_XMT_DATA8)
-#define bfin_write_TWI_XMT_DATA8(val)  bfin_write16(TWI_XMT_DATA8, val)
-#define bfin_read_TWI_XMT_DATA16()     bfin_read16(TWI_XMT_DATA16)
-#define bfin_write_TWI_XMT_DATA16(val) bfin_write16(TWI_XMT_DATA16, val)
-#define bfin_read_TWI_RCV_DATA8()      bfin_read16(TWI_RCV_DATA8)
-#define bfin_write_TWI_RCV_DATA8(val)  bfin_write16(TWI_RCV_DATA8, val)
-#define bfin_read_TWI_RCV_DATA16()     bfin_read16(TWI_RCV_DATA16)
-#define bfin_write_TWI_RCV_DATA16(val) bfin_write16(TWI_RCV_DATA16, val)
-#define bfin_read_PORTGIO()            bfin_read16(PORTGIO)
-#define bfin_write_PORTGIO(val)        bfin_write16(PORTGIO, val)
-#define bfin_read_PORTGIO_CLEAR()      bfin_read16(PORTGIO_CLEAR)
-#define bfin_write_PORTGIO_CLEAR(val)  bfin_write16(PORTGIO_CLEAR, val)
-#define bfin_read_PORTGIO_SET()        bfin_read16(PORTGIO_SET)
-#define bfin_write_PORTGIO_SET(val)    bfin_write16(PORTGIO_SET, val)
-#define bfin_read_PORTGIO_TOGGLE()     bfin_read16(PORTGIO_TOGGLE)
-#define bfin_write_PORTGIO_TOGGLE(val) bfin_write16(PORTGIO_TOGGLE, val)
-#define bfin_read_PORTGIO_MASKA()      bfin_read16(PORTGIO_MASKA)
-#define bfin_write_PORTGIO_MASKA(val)  bfin_write16(PORTGIO_MASKA, val)
-#define bfin_read_PORTGIO_MASKA_CLEAR() bfin_read16(PORTGIO_MASKA_CLEAR)
-#define bfin_write_PORTGIO_MASKA_CLEAR(val) bfin_write16(PORTGIO_MASKA_CLEAR, val)
-#define bfin_read_PORTGIO_MASKA_SET()  bfin_read16(PORTGIO_MASKA_SET)
-#define bfin_write_PORTGIO_MASKA_SET(val) bfin_write16(PORTGIO_MASKA_SET, val)
-#define bfin_read_PORTGIO_MASKA_TOGGLE() bfin_read16(PORTGIO_MASKA_TOGGLE)
-#define bfin_write_PORTGIO_MASKA_TOGGLE(val) bfin_write16(PORTGIO_MASKA_TOGGLE, val)
-#define bfin_read_PORTGIO_MASKB()      bfin_read16(PORTGIO_MASKB)
-#define bfin_write_PORTGIO_MASKB(val)  bfin_write16(PORTGIO_MASKB, val)
-#define bfin_read_PORTGIO_MASKB_CLEAR() bfin_read16(PORTGIO_MASKB_CLEAR)
-#define bfin_write_PORTGIO_MASKB_CLEAR(val) bfin_write16(PORTGIO_MASKB_CLEAR, val)
-#define bfin_read_PORTGIO_MASKB_SET()  bfin_read16(PORTGIO_MASKB_SET)
-#define bfin_write_PORTGIO_MASKB_SET(val) bfin_write16(PORTGIO_MASKB_SET, val)
-#define bfin_read_PORTGIO_MASKB_TOGGLE() bfin_read16(PORTGIO_MASKB_TOGGLE)
-#define bfin_write_PORTGIO_MASKB_TOGGLE(val) bfin_write16(PORTGIO_MASKB_TOGGLE, val)
-#define bfin_read_PORTGIO_DIR()        bfin_read16(PORTGIO_DIR)
-#define bfin_write_PORTGIO_DIR(val)    bfin_write16(PORTGIO_DIR, val)
-#define bfin_read_PORTGIO_POLAR()      bfin_read16(PORTGIO_POLAR)
-#define bfin_write_PORTGIO_POLAR(val)  bfin_write16(PORTGIO_POLAR, val)
-#define bfin_read_PORTGIO_EDGE()       bfin_read16(PORTGIO_EDGE)
-#define bfin_write_PORTGIO_EDGE(val)   bfin_write16(PORTGIO_EDGE, val)
-#define bfin_read_PORTGIO_BOTH()       bfin_read16(PORTGIO_BOTH)
-#define bfin_write_PORTGIO_BOTH(val)   bfin_write16(PORTGIO_BOTH, val)
-#define bfin_read_PORTGIO_INEN()       bfin_read16(PORTGIO_INEN)
-#define bfin_write_PORTGIO_INEN(val)   bfin_write16(PORTGIO_INEN, val)
-#define bfin_read_PORTHIO()            bfin_read16(PORTHIO)
-#define bfin_write_PORTHIO(val)        bfin_write16(PORTHIO, val)
-#define bfin_read_PORTHIO_CLEAR()      bfin_read16(PORTHIO_CLEAR)
-#define bfin_write_PORTHIO_CLEAR(val)  bfin_write16(PORTHIO_CLEAR, val)
-#define bfin_read_PORTHIO_SET()        bfin_read16(PORTHIO_SET)
-#define bfin_write_PORTHIO_SET(val)    bfin_write16(PORTHIO_SET, val)
-#define bfin_read_PORTHIO_TOGGLE()     bfin_read16(PORTHIO_TOGGLE)
-#define bfin_write_PORTHIO_TOGGLE(val) bfin_write16(PORTHIO_TOGGLE, val)
-#define bfin_read_PORTHIO_MASKA()      bfin_read16(PORTHIO_MASKA)
-#define bfin_write_PORTHIO_MASKA(val)  bfin_write16(PORTHIO_MASKA, val)
-#define bfin_read_PORTHIO_MASKA_CLEAR() bfin_read16(PORTHIO_MASKA_CLEAR)
-#define bfin_write_PORTHIO_MASKA_CLEAR(val) bfin_write16(PORTHIO_MASKA_CLEAR, val)
-#define bfin_read_PORTHIO_MASKA_SET()  bfin_read16(PORTHIO_MASKA_SET)
-#define bfin_write_PORTHIO_MASKA_SET(val) bfin_write16(PORTHIO_MASKA_SET, val)
-#define bfin_read_PORTHIO_MASKA_TOGGLE() bfin_read16(PORTHIO_MASKA_TOGGLE)
-#define bfin_write_PORTHIO_MASKA_TOGGLE(val) bfin_write16(PORTHIO_MASKA_TOGGLE, val)
-#define bfin_read_PORTHIO_MASKB()      bfin_read16(PORTHIO_MASKB)
-#define bfin_write_PORTHIO_MASKB(val)  bfin_write16(PORTHIO_MASKB, val)
-#define bfin_read_PORTHIO_MASKB_CLEAR() bfin_read16(PORTHIO_MASKB_CLEAR)
-#define bfin_write_PORTHIO_MASKB_CLEAR(val) bfin_write16(PORTHIO_MASKB_CLEAR, val)
-#define bfin_read_PORTHIO_MASKB_SET()  bfin_read16(PORTHIO_MASKB_SET)
-#define bfin_write_PORTHIO_MASKB_SET(val) bfin_write16(PORTHIO_MASKB_SET, val)
-#define bfin_read_PORTHIO_MASKB_TOGGLE() bfin_read16(PORTHIO_MASKB_TOGGLE)
-#define bfin_write_PORTHIO_MASKB_TOGGLE(val) bfin_write16(PORTHIO_MASKB_TOGGLE, val)
-#define bfin_read_PORTHIO_DIR()        bfin_read16(PORTHIO_DIR)
-#define bfin_write_PORTHIO_DIR(val)    bfin_write16(PORTHIO_DIR, val)
-#define bfin_read_PORTHIO_POLAR()      bfin_read16(PORTHIO_POLAR)
-#define bfin_write_PORTHIO_POLAR(val)  bfin_write16(PORTHIO_POLAR, val)
-#define bfin_read_PORTHIO_EDGE()       bfin_read16(PORTHIO_EDGE)
-#define bfin_write_PORTHIO_EDGE(val)   bfin_write16(PORTHIO_EDGE, val)
-#define bfin_read_PORTHIO_BOTH()       bfin_read16(PORTHIO_BOTH)
-#define bfin_write_PORTHIO_BOTH(val)   bfin_write16(PORTHIO_BOTH, val)
-#define bfin_read_PORTHIO_INEN()       bfin_read16(PORTHIO_INEN)
-#define bfin_write_PORTHIO_INEN(val)   bfin_write16(PORTHIO_INEN, val)
-#define bfin_read_UART1_THR()          bfin_read16(UART1_THR)
-#define bfin_write_UART1_THR(val)      bfin_write16(UART1_THR, val)
-#define bfin_read_UART1_RBR()          bfin_read16(UART1_RBR)
-#define bfin_write_UART1_RBR(val)      bfin_write16(UART1_RBR, val)
-#define bfin_read_UART1_DLL()          bfin_read16(UART1_DLL)
-#define bfin_write_UART1_DLL(val)      bfin_write16(UART1_DLL, val)
-#define bfin_read_UART1_IER()          bfin_read16(UART1_IER)
-#define bfin_write_UART1_IER(val)      bfin_write16(UART1_IER, val)
-#define bfin_read_UART1_DLH()          bfin_read16(UART1_DLH)
-#define bfin_write_UART1_DLH(val)      bfin_write16(UART1_DLH, val)
-#define bfin_read_UART1_IIR()          bfin_read16(UART1_IIR)
-#define bfin_write_UART1_IIR(val)      bfin_write16(UART1_IIR, val)
-#define bfin_read_UART1_LCR()          bfin_read16(UART1_LCR)
-#define bfin_write_UART1_LCR(val)      bfin_write16(UART1_LCR, val)
-#define bfin_read_UART1_MCR()          bfin_read16(UART1_MCR)
-#define bfin_write_UART1_MCR(val)      bfin_write16(UART1_MCR, val)
-#define bfin_read_UART1_LSR()          bfin_read16(UART1_LSR)
-#define bfin_write_UART1_LSR(val)      bfin_write16(UART1_LSR, val)
-#define bfin_read_UART1_MSR()          bfin_read16(UART1_MSR)
-#define bfin_write_UART1_MSR(val)      bfin_write16(UART1_MSR, val)
-#define bfin_read_UART1_SCR()          bfin_read16(UART1_SCR)
-#define bfin_write_UART1_SCR(val)      bfin_write16(UART1_SCR, val)
-#define bfin_read_UART1_GCTL()         bfin_read16(UART1_GCTL)
-#define bfin_write_UART1_GCTL(val)     bfin_write16(UART1_GCTL, val)
-#define bfin_read_CAN_MC1()            bfin_read16(CAN_MC1)
-#define bfin_write_CAN_MC1(val)        bfin_write16(CAN_MC1, val)
-#define bfin_read_CAN_MD1()            bfin_read16(CAN_MD1)
-#define bfin_write_CAN_MD1(val)        bfin_write16(CAN_MD1, val)
-#define bfin_read_CAN_TRS1()           bfin_read16(CAN_TRS1)
-#define bfin_write_CAN_TRS1(val)       bfin_write16(CAN_TRS1, val)
-#define bfin_read_CAN_TRR1()           bfin_read16(CAN_TRR1)
-#define bfin_write_CAN_TRR1(val)       bfin_write16(CAN_TRR1, val)
-#define bfin_read_CAN_TA1()            bfin_read16(CAN_TA1)
-#define bfin_write_CAN_TA1(val)        bfin_write16(CAN_TA1, val)
-#define bfin_read_CAN_AA1()            bfin_read16(CAN_AA1)
-#define bfin_write_CAN_AA1(val)        bfin_write16(CAN_AA1, val)
-#define bfin_read_CAN_RMP1()           bfin_read16(CAN_RMP1)
-#define bfin_write_CAN_RMP1(val)       bfin_write16(CAN_RMP1, val)
-#define bfin_read_CAN_RML1()           bfin_read16(CAN_RML1)
-#define bfin_write_CAN_RML1(val)       bfin_write16(CAN_RML1, val)
-#define bfin_read_CAN_MBTIF1()         bfin_read16(CAN_MBTIF1)
-#define bfin_write_CAN_MBTIF1(val)     bfin_write16(CAN_MBTIF1, val)
-#define bfin_read_CAN_MBRIF1()         bfin_read16(CAN_MBRIF1)
-#define bfin_write_CAN_MBRIF1(val)     bfin_write16(CAN_MBRIF1, val)
-#define bfin_read_CAN_MBIM1()          bfin_read16(CAN_MBIM1)
-#define bfin_write_CAN_MBIM1(val)      bfin_write16(CAN_MBIM1, val)
-#define bfin_read_CAN_RFH1()           bfin_read16(CAN_RFH1)
-#define bfin_write_CAN_RFH1(val)       bfin_write16(CAN_RFH1, val)
-#define bfin_read_CAN_OPSS1()          bfin_read16(CAN_OPSS1)
-#define bfin_write_CAN_OPSS1(val)      bfin_write16(CAN_OPSS1, val)
-#define bfin_read_CAN_MC2()            bfin_read16(CAN_MC2)
-#define bfin_write_CAN_MC2(val)        bfin_write16(CAN_MC2, val)
-#define bfin_read_CAN_MD2()            bfin_read16(CAN_MD2)
-#define bfin_write_CAN_MD2(val)        bfin_write16(CAN_MD2, val)
-#define bfin_read_CAN_TRS2()           bfin_read16(CAN_TRS2)
-#define bfin_write_CAN_TRS2(val)       bfin_write16(CAN_TRS2, val)
-#define bfin_read_CAN_TRR2()           bfin_read16(CAN_TRR2)
-#define bfin_write_CAN_TRR2(val)       bfin_write16(CAN_TRR2, val)
-#define bfin_read_CAN_TA2()            bfin_read16(CAN_TA2)
-#define bfin_write_CAN_TA2(val)        bfin_write16(CAN_TA2, val)
-#define bfin_read_CAN_AA2()            bfin_read16(CAN_AA2)
-#define bfin_write_CAN_AA2(val)        bfin_write16(CAN_AA2, val)
-#define bfin_read_CAN_RMP2()           bfin_read16(CAN_RMP2)
-#define bfin_write_CAN_RMP2(val)       bfin_write16(CAN_RMP2, val)
-#define bfin_read_CAN_RML2()           bfin_read16(CAN_RML2)
-#define bfin_write_CAN_RML2(val)       bfin_write16(CAN_RML2, val)
-#define bfin_read_CAN_MBTIF2()         bfin_read16(CAN_MBTIF2)
-#define bfin_write_CAN_MBTIF2(val)     bfin_write16(CAN_MBTIF2, val)
-#define bfin_read_CAN_MBRIF2()         bfin_read16(CAN_MBRIF2)
-#define bfin_write_CAN_MBRIF2(val)     bfin_write16(CAN_MBRIF2, val)
-#define bfin_read_CAN_MBIM2()          bfin_read16(CAN_MBIM2)
-#define bfin_write_CAN_MBIM2(val)      bfin_write16(CAN_MBIM2, val)
-#define bfin_read_CAN_RFH2()           bfin_read16(CAN_RFH2)
-#define bfin_write_CAN_RFH2(val)       bfin_write16(CAN_RFH2, val)
-#define bfin_read_CAN_OPSS2()          bfin_read16(CAN_OPSS2)
-#define bfin_write_CAN_OPSS2(val)      bfin_write16(CAN_OPSS2, val)
-#define bfin_read_CAN_CLOCK()          bfin_read16(CAN_CLOCK)
-#define bfin_write_CAN_CLOCK(val)      bfin_write16(CAN_CLOCK, val)
-#define bfin_read_CAN_TIMING()         bfin_read16(CAN_TIMING)
-#define bfin_write_CAN_TIMING(val)     bfin_write16(CAN_TIMING, val)
-#define bfin_read_CAN_DEBUG()          bfin_read16(CAN_DEBUG)
-#define bfin_write_CAN_DEBUG(val)      bfin_write16(CAN_DEBUG, val)
-#define bfin_read_CAN_STATUS()         bfin_read16(CAN_STATUS)
-#define bfin_write_CAN_STATUS(val)     bfin_write16(CAN_STATUS, val)
-#define bfin_read_CAN_CEC()            bfin_read16(CAN_CEC)
-#define bfin_write_CAN_CEC(val)        bfin_write16(CAN_CEC, val)
-#define bfin_read_CAN_GIS()            bfin_read16(CAN_GIS)
-#define bfin_write_CAN_GIS(val)        bfin_write16(CAN_GIS, val)
-#define bfin_read_CAN_GIM()            bfin_read16(CAN_GIM)
-#define bfin_write_CAN_GIM(val)        bfin_write16(CAN_GIM, val)
-#define bfin_read_CAN_GIF()            bfin_read16(CAN_GIF)
-#define bfin_write_CAN_GIF(val)        bfin_write16(CAN_GIF, val)
-#define bfin_read_CAN_CONTROL()        bfin_read16(CAN_CONTROL)
-#define bfin_write_CAN_CONTROL(val)    bfin_write16(CAN_CONTROL, val)
-#define bfin_read_CAN_INTR()           bfin_read16(CAN_INTR)
-#define bfin_write_CAN_INTR(val)       bfin_write16(CAN_INTR, val)
-#define bfin_read_CAN_VERSION()        bfin_read16(CAN_VERSION)
-#define bfin_write_CAN_VERSION(val)    bfin_write16(CAN_VERSION, val)
-#define bfin_read_CAN_MBTD()           bfin_read16(CAN_MBTD)
-#define bfin_write_CAN_MBTD(val)       bfin_write16(CAN_MBTD, val)
-#define bfin_read_CAN_EWR()            bfin_read16(CAN_EWR)
-#define bfin_write_CAN_EWR(val)        bfin_write16(CAN_EWR, val)
-#define bfin_read_CAN_ESR()            bfin_read16(CAN_ESR)
-#define bfin_write_CAN_ESR(val)        bfin_write16(CAN_ESR, val)
-#define bfin_read_CAN_UCREG()          bfin_read16(CAN_UCREG)
-#define bfin_write_CAN_UCREG(val)      bfin_write16(CAN_UCREG, val)
-#define bfin_read_CAN_UCCNT()          bfin_read16(CAN_UCCNT)
-#define bfin_write_CAN_UCCNT(val)      bfin_write16(CAN_UCCNT, val)
-#define bfin_read_CAN_UCRC()           bfin_read16(CAN_UCRC)
-#define bfin_write_CAN_UCRC(val)       bfin_write16(CAN_UCRC, val)
-#define bfin_read_CAN_UCCNF()          bfin_read16(CAN_UCCNF)
-#define bfin_write_CAN_UCCNF(val)      bfin_write16(CAN_UCCNF, val)
-#define bfin_read_CAN_VERSION2()       bfin_read16(CAN_VERSION2)
-#define bfin_write_CAN_VERSION2(val)   bfin_write16(CAN_VERSION2, val)
-#define bfin_read_CAN_AM00L()          bfin_read16(CAN_AM00L)
-#define bfin_write_CAN_AM00L(val)      bfin_write16(CAN_AM00L, val)
-#define bfin_read_CAN_AM00H()          bfin_read16(CAN_AM00H)
-#define bfin_write_CAN_AM00H(val)      bfin_write16(CAN_AM00H, val)
-#define bfin_read_CAN_AM01L()          bfin_read16(CAN_AM01L)
-#define bfin_write_CAN_AM01L(val)      bfin_write16(CAN_AM01L, val)
-#define bfin_read_CAN_AM01H()          bfin_read16(CAN_AM01H)
-#define bfin_write_CAN_AM01H(val)      bfin_write16(CAN_AM01H, val)
-#define bfin_read_CAN_AM02L()          bfin_read16(CAN_AM02L)
-#define bfin_write_CAN_AM02L(val)      bfin_write16(CAN_AM02L, val)
-#define bfin_read_CAN_AM02H()          bfin_read16(CAN_AM02H)
-#define bfin_write_CAN_AM02H(val)      bfin_write16(CAN_AM02H, val)
-#define bfin_read_CAN_AM03L()          bfin_read16(CAN_AM03L)
-#define bfin_write_CAN_AM03L(val)      bfin_write16(CAN_AM03L, val)
-#define bfin_read_CAN_AM03H()          bfin_read16(CAN_AM03H)
-#define bfin_write_CAN_AM03H(val)      bfin_write16(CAN_AM03H, val)
-#define bfin_read_CAN_AM04L()          bfin_read16(CAN_AM04L)
-#define bfin_write_CAN_AM04L(val)      bfin_write16(CAN_AM04L, val)
-#define bfin_read_CAN_AM04H()          bfin_read16(CAN_AM04H)
-#define bfin_write_CAN_AM04H(val)      bfin_write16(CAN_AM04H, val)
-#define bfin_read_CAN_AM05L()          bfin_read16(CAN_AM05L)
-#define bfin_write_CAN_AM05L(val)      bfin_write16(CAN_AM05L, val)
-#define bfin_read_CAN_AM05H()          bfin_read16(CAN_AM05H)
-#define bfin_write_CAN_AM05H(val)      bfin_write16(CAN_AM05H, val)
-#define bfin_read_CAN_AM06L()          bfin_read16(CAN_AM06L)
-#define bfin_write_CAN_AM06L(val)      bfin_write16(CAN_AM06L, val)
-#define bfin_read_CAN_AM06H()          bfin_read16(CAN_AM06H)
-#define bfin_write_CAN_AM06H(val)      bfin_write16(CAN_AM06H, val)
-#define bfin_read_CAN_AM07L()          bfin_read16(CAN_AM07L)
-#define bfin_write_CAN_AM07L(val)      bfin_write16(CAN_AM07L, val)
-#define bfin_read_CAN_AM07H()          bfin_read16(CAN_AM07H)
-#define bfin_write_CAN_AM07H(val)      bfin_write16(CAN_AM07H, val)
-#define bfin_read_CAN_AM08L()          bfin_read16(CAN_AM08L)
-#define bfin_write_CAN_AM08L(val)      bfin_write16(CAN_AM08L, val)
-#define bfin_read_CAN_AM08H()          bfin_read16(CAN_AM08H)
-#define bfin_write_CAN_AM08H(val)      bfin_write16(CAN_AM08H, val)
-#define bfin_read_CAN_AM09L()          bfin_read16(CAN_AM09L)
-#define bfin_write_CAN_AM09L(val)      bfin_write16(CAN_AM09L, val)
-#define bfin_read_CAN_AM09H()          bfin_read16(CAN_AM09H)
-#define bfin_write_CAN_AM09H(val)      bfin_write16(CAN_AM09H, val)
-#define bfin_read_CAN_AM10L()          bfin_read16(CAN_AM10L)
-#define bfin_write_CAN_AM10L(val)      bfin_write16(CAN_AM10L, val)
-#define bfin_read_CAN_AM10H()          bfin_read16(CAN_AM10H)
-#define bfin_write_CAN_AM10H(val)      bfin_write16(CAN_AM10H, val)
-#define bfin_read_CAN_AM11L()          bfin_read16(CAN_AM11L)
-#define bfin_write_CAN_AM11L(val)      bfin_write16(CAN_AM11L, val)
-#define bfin_read_CAN_AM11H()          bfin_read16(CAN_AM11H)
-#define bfin_write_CAN_AM11H(val)      bfin_write16(CAN_AM11H, val)
-#define bfin_read_CAN_AM12L()          bfin_read16(CAN_AM12L)
-#define bfin_write_CAN_AM12L(val)      bfin_write16(CAN_AM12L, val)
-#define bfin_read_CAN_AM12H()          bfin_read16(CAN_AM12H)
-#define bfin_write_CAN_AM12H(val)      bfin_write16(CAN_AM12H, val)
-#define bfin_read_CAN_AM13L()          bfin_read16(CAN_AM13L)
-#define bfin_write_CAN_AM13L(val)      bfin_write16(CAN_AM13L, val)
-#define bfin_read_CAN_AM13H()          bfin_read16(CAN_AM13H)
-#define bfin_write_CAN_AM13H(val)      bfin_write16(CAN_AM13H, val)
-#define bfin_read_CAN_AM14L()          bfin_read16(CAN_AM14L)
-#define bfin_write_CAN_AM14L(val)      bfin_write16(CAN_AM14L, val)
-#define bfin_read_CAN_AM14H()          bfin_read16(CAN_AM14H)
-#define bfin_write_CAN_AM14H(val)      bfin_write16(CAN_AM14H, val)
-#define bfin_read_CAN_AM15L()          bfin_read16(CAN_AM15L)
-#define bfin_write_CAN_AM15L(val)      bfin_write16(CAN_AM15L, val)
-#define bfin_read_CAN_AM15H()          bfin_read16(CAN_AM15H)
-#define bfin_write_CAN_AM15H(val)      bfin_write16(CAN_AM15H, val)
-#define bfin_read_CAN_AM16L()          bfin_read16(CAN_AM16L)
-#define bfin_write_CAN_AM16L(val)      bfin_write16(CAN_AM16L, val)
-#define bfin_read_CAN_AM16H()          bfin_read16(CAN_AM16H)
-#define bfin_write_CAN_AM16H(val)      bfin_write16(CAN_AM16H, val)
-#define bfin_read_CAN_AM17L()          bfin_read16(CAN_AM17L)
-#define bfin_write_CAN_AM17L(val)      bfin_write16(CAN_AM17L, val)
-#define bfin_read_CAN_AM17H()          bfin_read16(CAN_AM17H)
-#define bfin_write_CAN_AM17H(val)      bfin_write16(CAN_AM17H, val)
-#define bfin_read_CAN_AM18L()          bfin_read16(CAN_AM18L)
-#define bfin_write_CAN_AM18L(val)      bfin_write16(CAN_AM18L, val)
-#define bfin_read_CAN_AM18H()          bfin_read16(CAN_AM18H)
-#define bfin_write_CAN_AM18H(val)      bfin_write16(CAN_AM18H, val)
-#define bfin_read_CAN_AM19L()          bfin_read16(CAN_AM19L)
-#define bfin_write_CAN_AM19L(val)      bfin_write16(CAN_AM19L, val)
-#define bfin_read_CAN_AM19H()          bfin_read16(CAN_AM19H)
-#define bfin_write_CAN_AM19H(val)      bfin_write16(CAN_AM19H, val)
-#define bfin_read_CAN_AM20L()          bfin_read16(CAN_AM20L)
-#define bfin_write_CAN_AM20L(val)      bfin_write16(CAN_AM20L, val)
-#define bfin_read_CAN_AM20H()          bfin_read16(CAN_AM20H)
-#define bfin_write_CAN_AM20H(val)      bfin_write16(CAN_AM20H, val)
-#define bfin_read_CAN_AM21L()          bfin_read16(CAN_AM21L)
-#define bfin_write_CAN_AM21L(val)      bfin_write16(CAN_AM21L, val)
-#define bfin_read_CAN_AM21H()          bfin_read16(CAN_AM21H)
-#define bfin_write_CAN_AM21H(val)      bfin_write16(CAN_AM21H, val)
-#define bfin_read_CAN_AM22L()          bfin_read16(CAN_AM22L)
-#define bfin_write_CAN_AM22L(val)      bfin_write16(CAN_AM22L, val)
-#define bfin_read_CAN_AM22H()          bfin_read16(CAN_AM22H)
-#define bfin_write_CAN_AM22H(val)      bfin_write16(CAN_AM22H, val)
-#define bfin_read_CAN_AM23L()          bfin_read16(CAN_AM23L)
-#define bfin_write_CAN_AM23L(val)      bfin_write16(CAN_AM23L, val)
-#define bfin_read_CAN_AM23H()          bfin_read16(CAN_AM23H)
-#define bfin_write_CAN_AM23H(val)      bfin_write16(CAN_AM23H, val)
-#define bfin_read_CAN_AM24L()          bfin_read16(CAN_AM24L)
-#define bfin_write_CAN_AM24L(val)      bfin_write16(CAN_AM24L, val)
-#define bfin_read_CAN_AM24H()          bfin_read16(CAN_AM24H)
-#define bfin_write_CAN_AM24H(val)      bfin_write16(CAN_AM24H, val)
-#define bfin_read_CAN_AM25L()          bfin_read16(CAN_AM25L)
-#define bfin_write_CAN_AM25L(val)      bfin_write16(CAN_AM25L, val)
-#define bfin_read_CAN_AM25H()          bfin_read16(CAN_AM25H)
-#define bfin_write_CAN_AM25H(val)      bfin_write16(CAN_AM25H, val)
-#define bfin_read_CAN_AM26L()          bfin_read16(CAN_AM26L)
-#define bfin_write_CAN_AM26L(val)      bfin_write16(CAN_AM26L, val)
-#define bfin_read_CAN_AM26H()          bfin_read16(CAN_AM26H)
-#define bfin_write_CAN_AM26H(val)      bfin_write16(CAN_AM26H, val)
-#define bfin_read_CAN_AM27L()          bfin_read16(CAN_AM27L)
-#define bfin_write_CAN_AM27L(val)      bfin_write16(CAN_AM27L, val)
-#define bfin_read_CAN_AM27H()          bfin_read16(CAN_AM27H)
-#define bfin_write_CAN_AM27H(val)      bfin_write16(CAN_AM27H, val)
-#define bfin_read_CAN_AM28L()          bfin_read16(CAN_AM28L)
-#define bfin_write_CAN_AM28L(val)      bfin_write16(CAN_AM28L, val)
-#define bfin_read_CAN_AM28H()          bfin_read16(CAN_AM28H)
-#define bfin_write_CAN_AM28H(val)      bfin_write16(CAN_AM28H, val)
-#define bfin_read_CAN_AM29L()          bfin_read16(CAN_AM29L)
-#define bfin_write_CAN_AM29L(val)      bfin_write16(CAN_AM29L, val)
-#define bfin_read_CAN_AM29H()          bfin_read16(CAN_AM29H)
-#define bfin_write_CAN_AM29H(val)      bfin_write16(CAN_AM29H, val)
-#define bfin_read_CAN_AM30L()          bfin_read16(CAN_AM30L)
-#define bfin_write_CAN_AM30L(val)      bfin_write16(CAN_AM30L, val)
-#define bfin_read_CAN_AM30H()          bfin_read16(CAN_AM30H)
-#define bfin_write_CAN_AM30H(val)      bfin_write16(CAN_AM30H, val)
-#define bfin_read_CAN_AM31L()          bfin_read16(CAN_AM31L)
-#define bfin_write_CAN_AM31L(val)      bfin_write16(CAN_AM31L, val)
-#define bfin_read_CAN_AM31H()          bfin_read16(CAN_AM31H)
-#define bfin_write_CAN_AM31H(val)      bfin_write16(CAN_AM31H, val)
-#define bfin_read_CAN_MB00_DATA0()     bfin_read16(CAN_MB00_DATA0)
-#define bfin_write_CAN_MB00_DATA0(val) bfin_write16(CAN_MB00_DATA0, val)
-#define bfin_read_CAN_MB00_DATA1()     bfin_read16(CAN_MB00_DATA1)
-#define bfin_write_CAN_MB00_DATA1(val) bfin_write16(CAN_MB00_DATA1, val)
-#define bfin_read_CAN_MB00_DATA2()     bfin_read16(CAN_MB00_DATA2)
-#define bfin_write_CAN_MB00_DATA2(val) bfin_write16(CAN_MB00_DATA2, val)
-#define bfin_read_CAN_MB00_DATA3()     bfin_read16(CAN_MB00_DATA3)
-#define bfin_write_CAN_MB00_DATA3(val) bfin_write16(CAN_MB00_DATA3, val)
-#define bfin_read_CAN_MB00_LENGTH()    bfin_read16(CAN_MB00_LENGTH)
-#define bfin_write_CAN_MB00_LENGTH(val) bfin_write16(CAN_MB00_LENGTH, val)
-#define bfin_read_CAN_MB00_TIMESTAMP() bfin_read16(CAN_MB00_TIMESTAMP)
-#define bfin_write_CAN_MB00_TIMESTAMP(val) bfin_write16(CAN_MB00_TIMESTAMP, val)
-#define bfin_read_CAN_MB00_ID0()       bfin_read16(CAN_MB00_ID0)
-#define bfin_write_CAN_MB00_ID0(val)   bfin_write16(CAN_MB00_ID0, val)
-#define bfin_read_CAN_MB00_ID1()       bfin_read16(CAN_MB00_ID1)
-#define bfin_write_CAN_MB00_ID1(val)   bfin_write16(CAN_MB00_ID1, val)
-#define bfin_read_CAN_MB01_DATA0()     bfin_read16(CAN_MB01_DATA0)
-#define bfin_write_CAN_MB01_DATA0(val) bfin_write16(CAN_MB01_DATA0, val)
-#define bfin_read_CAN_MB01_DATA1()     bfin_read16(CAN_MB01_DATA1)
-#define bfin_write_CAN_MB01_DATA1(val) bfin_write16(CAN_MB01_DATA1, val)
-#define bfin_read_CAN_MB01_DATA2()     bfin_read16(CAN_MB01_DATA2)
-#define bfin_write_CAN_MB01_DATA2(val) bfin_write16(CAN_MB01_DATA2, val)
-#define bfin_read_CAN_MB01_DATA3()     bfin_read16(CAN_MB01_DATA3)
-#define bfin_write_CAN_MB01_DATA3(val) bfin_write16(CAN_MB01_DATA3, val)
-#define bfin_read_CAN_MB01_LENGTH()    bfin_read16(CAN_MB01_LENGTH)
-#define bfin_write_CAN_MB01_LENGTH(val) bfin_write16(CAN_MB01_LENGTH, val)
-#define bfin_read_CAN_MB01_TIMESTAMP() bfin_read16(CAN_MB01_TIMESTAMP)
-#define bfin_write_CAN_MB01_TIMESTAMP(val) bfin_write16(CAN_MB01_TIMESTAMP, val)
-#define bfin_read_CAN_MB01_ID0()       bfin_read16(CAN_MB01_ID0)
-#define bfin_write_CAN_MB01_ID0(val)   bfin_write16(CAN_MB01_ID0, val)
-#define bfin_read_CAN_MB01_ID1()       bfin_read16(CAN_MB01_ID1)
-#define bfin_write_CAN_MB01_ID1(val)   bfin_write16(CAN_MB01_ID1, val)
-#define bfin_read_CAN_MB02_DATA0()     bfin_read16(CAN_MB02_DATA0)
-#define bfin_write_CAN_MB02_DATA0(val) bfin_write16(CAN_MB02_DATA0, val)
-#define bfin_read_CAN_MB02_DATA1()     bfin_read16(CAN_MB02_DATA1)
-#define bfin_write_CAN_MB02_DATA1(val) bfin_write16(CAN_MB02_DATA1, val)
-#define bfin_read_CAN_MB02_DATA2()     bfin_read16(CAN_MB02_DATA2)
-#define bfin_write_CAN_MB02_DATA2(val) bfin_write16(CAN_MB02_DATA2, val)
-#define bfin_read_CAN_MB02_DATA3()     bfin_read16(CAN_MB02_DATA3)
-#define bfin_write_CAN_MB02_DATA3(val) bfin_write16(CAN_MB02_DATA3, val)
-#define bfin_read_CAN_MB02_LENGTH()    bfin_read16(CAN_MB02_LENGTH)
-#define bfin_write_CAN_MB02_LENGTH(val) bfin_write16(CAN_MB02_LENGTH, val)
-#define bfin_read_CAN_MB02_TIMESTAMP() bfin_read16(CAN_MB02_TIMESTAMP)
-#define bfin_write_CAN_MB02_TIMESTAMP(val) bfin_write16(CAN_MB02_TIMESTAMP, val)
-#define bfin_read_CAN_MB02_ID0()       bfin_read16(CAN_MB02_ID0)
-#define bfin_write_CAN_MB02_ID0(val)   bfin_write16(CAN_MB02_ID0, val)
-#define bfin_read_CAN_MB02_ID1()       bfin_read16(CAN_MB02_ID1)
-#define bfin_write_CAN_MB02_ID1(val)   bfin_write16(CAN_MB02_ID1, val)
-#define bfin_read_CAN_MB03_DATA0()     bfin_read16(CAN_MB03_DATA0)
-#define bfin_write_CAN_MB03_DATA0(val) bfin_write16(CAN_MB03_DATA0, val)
-#define bfin_read_CAN_MB03_DATA1()     bfin_read16(CAN_MB03_DATA1)
-#define bfin_write_CAN_MB03_DATA1(val) bfin_write16(CAN_MB03_DATA1, val)
-#define bfin_read_CAN_MB03_DATA2()     bfin_read16(CAN_MB03_DATA2)
-#define bfin_write_CAN_MB03_DATA2(val) bfin_write16(CAN_MB03_DATA2, val)
-#define bfin_read_CAN_MB03_DATA3()     bfin_read16(CAN_MB03_DATA3)
-#define bfin_write_CAN_MB03_DATA3(val) bfin_write16(CAN_MB03_DATA3, val)
-#define bfin_read_CAN_MB03_LENGTH()    bfin_read16(CAN_MB03_LENGTH)
-#define bfin_write_CAN_MB03_LENGTH(val) bfin_write16(CAN_MB03_LENGTH, val)
-#define bfin_read_CAN_MB03_TIMESTAMP() bfin_read16(CAN_MB03_TIMESTAMP)
-#define bfin_write_CAN_MB03_TIMESTAMP(val) bfin_write16(CAN_MB03_TIMESTAMP, val)
-#define bfin_read_CAN_MB03_ID0()       bfin_read16(CAN_MB03_ID0)
-#define bfin_write_CAN_MB03_ID0(val)   bfin_write16(CAN_MB03_ID0, val)
-#define bfin_read_CAN_MB03_ID1()       bfin_read16(CAN_MB03_ID1)
-#define bfin_write_CAN_MB03_ID1(val)   bfin_write16(CAN_MB03_ID1, val)
-#define bfin_read_CAN_MB04_DATA0()     bfin_read16(CAN_MB04_DATA0)
-#define bfin_write_CAN_MB04_DATA0(val) bfin_write16(CAN_MB04_DATA0, val)
-#define bfin_read_CAN_MB04_DATA1()     bfin_read16(CAN_MB04_DATA1)
-#define bfin_write_CAN_MB04_DATA1(val) bfin_write16(CAN_MB04_DATA1, val)
-#define bfin_read_CAN_MB04_DATA2()     bfin_read16(CAN_MB04_DATA2)
-#define bfin_write_CAN_MB04_DATA2(val) bfin_write16(CAN_MB04_DATA2, val)
-#define bfin_read_CAN_MB04_DATA3()     bfin_read16(CAN_MB04_DATA3)
-#define bfin_write_CAN_MB04_DATA3(val) bfin_write16(CAN_MB04_DATA3, val)
-#define bfin_read_CAN_MB04_LENGTH()    bfin_read16(CAN_MB04_LENGTH)
-#define bfin_write_CAN_MB04_LENGTH(val) bfin_write16(CAN_MB04_LENGTH, val)
-#define bfin_read_CAN_MB04_TIMESTAMP() bfin_read16(CAN_MB04_TIMESTAMP)
-#define bfin_write_CAN_MB04_TIMESTAMP(val) bfin_write16(CAN_MB04_TIMESTAMP, val)
-#define bfin_read_CAN_MB04_ID0()       bfin_read16(CAN_MB04_ID0)
-#define bfin_write_CAN_MB04_ID0(val)   bfin_write16(CAN_MB04_ID0, val)
-#define bfin_read_CAN_MB04_ID1()       bfin_read16(CAN_MB04_ID1)
-#define bfin_write_CAN_MB04_ID1(val)   bfin_write16(CAN_MB04_ID1, val)
-#define bfin_read_CAN_MB05_DATA0()     bfin_read16(CAN_MB05_DATA0)
-#define bfin_write_CAN_MB05_DATA0(val) bfin_write16(CAN_MB05_DATA0, val)
-#define bfin_read_CAN_MB05_DATA1()     bfin_read16(CAN_MB05_DATA1)
-#define bfin_write_CAN_MB05_DATA1(val) bfin_write16(CAN_MB05_DATA1, val)
-#define bfin_read_CAN_MB05_DATA2()     bfin_read16(CAN_MB05_DATA2)
-#define bfin_write_CAN_MB05_DATA2(val) bfin_write16(CAN_MB05_DATA2, val)
-#define bfin_read_CAN_MB05_DATA3()     bfin_read16(CAN_MB05_DATA3)
-#define bfin_write_CAN_MB05_DATA3(val) bfin_write16(CAN_MB05_DATA3, val)
-#define bfin_read_CAN_MB05_LENGTH()    bfin_read16(CAN_MB05_LENGTH)
-#define bfin_write_CAN_MB05_LENGTH(val) bfin_write16(CAN_MB05_LENGTH, val)
-#define bfin_read_CAN_MB05_TIMESTAMP() bfin_read16(CAN_MB05_TIMESTAMP)
-#define bfin_write_CAN_MB05_TIMESTAMP(val) bfin_write16(CAN_MB05_TIMESTAMP, val)
-#define bfin_read_CAN_MB05_ID0()       bfin_read16(CAN_MB05_ID0)
-#define bfin_write_CAN_MB05_ID0(val)   bfin_write16(CAN_MB05_ID0, val)
-#define bfin_read_CAN_MB05_ID1()       bfin_read16(CAN_MB05_ID1)
-#define bfin_write_CAN_MB05_ID1(val)   bfin_write16(CAN_MB05_ID1, val)
-#define bfin_read_CAN_MB06_DATA0()     bfin_read16(CAN_MB06_DATA0)
-#define bfin_write_CAN_MB06_DATA0(val) bfin_write16(CAN_MB06_DATA0, val)
-#define bfin_read_CAN_MB06_DATA1()     bfin_read16(CAN_MB06_DATA1)
-#define bfin_write_CAN_MB06_DATA1(val) bfin_write16(CAN_MB06_DATA1, val)
-#define bfin_read_CAN_MB06_DATA2()     bfin_read16(CAN_MB06_DATA2)
-#define bfin_write_CAN_MB06_DATA2(val) bfin_write16(CAN_MB06_DATA2, val)
-#define bfin_read_CAN_MB06_DATA3()     bfin_read16(CAN_MB06_DATA3)
-#define bfin_write_CAN_MB06_DATA3(val) bfin_write16(CAN_MB06_DATA3, val)
-#define bfin_read_CAN_MB06_LENGTH()    bfin_read16(CAN_MB06_LENGTH)
-#define bfin_write_CAN_MB06_LENGTH(val) bfin_write16(CAN_MB06_LENGTH, val)
-#define bfin_read_CAN_MB06_TIMESTAMP() bfin_read16(CAN_MB06_TIMESTAMP)
-#define bfin_write_CAN_MB06_TIMESTAMP(val) bfin_write16(CAN_MB06_TIMESTAMP, val)
-#define bfin_read_CAN_MB06_ID0()       bfin_read16(CAN_MB06_ID0)
-#define bfin_write_CAN_MB06_ID0(val)   bfin_write16(CAN_MB06_ID0, val)
-#define bfin_read_CAN_MB06_ID1()       bfin_read16(CAN_MB06_ID1)
-#define bfin_write_CAN_MB06_ID1(val)   bfin_write16(CAN_MB06_ID1, val)
-#define bfin_read_CAN_MB07_DATA0()     bfin_read16(CAN_MB07_DATA0)
-#define bfin_write_CAN_MB07_DATA0(val) bfin_write16(CAN_MB07_DATA0, val)
-#define bfin_read_CAN_MB07_DATA1()     bfin_read16(CAN_MB07_DATA1)
-#define bfin_write_CAN_MB07_DATA1(val) bfin_write16(CAN_MB07_DATA1, val)
-#define bfin_read_CAN_MB07_DATA2()     bfin_read16(CAN_MB07_DATA2)
-#define bfin_write_CAN_MB07_DATA2(val) bfin_write16(CAN_MB07_DATA2, val)
-#define bfin_read_CAN_MB07_DATA3()     bfin_read16(CAN_MB07_DATA3)
-#define bfin_write_CAN_MB07_DATA3(val) bfin_write16(CAN_MB07_DATA3, val)
-#define bfin_read_CAN_MB07_LENGTH()    bfin_read16(CAN_MB07_LENGTH)
-#define bfin_write_CAN_MB07_LENGTH(val) bfin_write16(CAN_MB07_LENGTH, val)
-#define bfin_read_CAN_MB07_TIMESTAMP() bfin_read16(CAN_MB07_TIMESTAMP)
-#define bfin_write_CAN_MB07_TIMESTAMP(val) bfin_write16(CAN_MB07_TIMESTAMP, val)
-#define bfin_read_CAN_MB07_ID0()       bfin_read16(CAN_MB07_ID0)
-#define bfin_write_CAN_MB07_ID0(val)   bfin_write16(CAN_MB07_ID0, val)
-#define bfin_read_CAN_MB07_ID1()       bfin_read16(CAN_MB07_ID1)
-#define bfin_write_CAN_MB07_ID1(val)   bfin_write16(CAN_MB07_ID1, val)
-#define bfin_read_CAN_MB08_DATA0()     bfin_read16(CAN_MB08_DATA0)
-#define bfin_write_CAN_MB08_DATA0(val) bfin_write16(CAN_MB08_DATA0, val)
-#define bfin_read_CAN_MB08_DATA1()     bfin_read16(CAN_MB08_DATA1)
-#define bfin_write_CAN_MB08_DATA1(val) bfin_write16(CAN_MB08_DATA1, val)
-#define bfin_read_CAN_MB08_DATA2()     bfin_read16(CAN_MB08_DATA2)
-#define bfin_write_CAN_MB08_DATA2(val) bfin_write16(CAN_MB08_DATA2, val)
-#define bfin_read_CAN_MB08_DATA3()     bfin_read16(CAN_MB08_DATA3)
-#define bfin_write_CAN_MB08_DATA3(val) bfin_write16(CAN_MB08_DATA3, val)
-#define bfin_read_CAN_MB08_LENGTH()    bfin_read16(CAN_MB08_LENGTH)
-#define bfin_write_CAN_MB08_LENGTH(val) bfin_write16(CAN_MB08_LENGTH, val)
-#define bfin_read_CAN_MB08_TIMESTAMP() bfin_read16(CAN_MB08_TIMESTAMP)
-#define bfin_write_CAN_MB08_TIMESTAMP(val) bfin_write16(CAN_MB08_TIMESTAMP, val)
-#define bfin_read_CAN_MB08_ID0()       bfin_read16(CAN_MB08_ID0)
-#define bfin_write_CAN_MB08_ID0(val)   bfin_write16(CAN_MB08_ID0, val)
-#define bfin_read_CAN_MB08_ID1()       bfin_read16(CAN_MB08_ID1)
-#define bfin_write_CAN_MB08_ID1(val)   bfin_write16(CAN_MB08_ID1, val)
-#define bfin_read_CAN_MB09_DATA0()     bfin_read16(CAN_MB09_DATA0)
-#define bfin_write_CAN_MB09_DATA0(val) bfin_write16(CAN_MB09_DATA0, val)
-#define bfin_read_CAN_MB09_DATA1()     bfin_read16(CAN_MB09_DATA1)
-#define bfin_write_CAN_MB09_DATA1(val) bfin_write16(CAN_MB09_DATA1, val)
-#define bfin_read_CAN_MB09_DATA2()     bfin_read16(CAN_MB09_DATA2)
-#define bfin_write_CAN_MB09_DATA2(val) bfin_write16(CAN_MB09_DATA2, val)
-#define bfin_read_CAN_MB09_DATA3()     bfin_read16(CAN_MB09_DATA3)
-#define bfin_write_CAN_MB09_DATA3(val) bfin_write16(CAN_MB09_DATA3, val)
-#define bfin_read_CAN_MB09_LENGTH()    bfin_read16(CAN_MB09_LENGTH)
-#define bfin_write_CAN_MB09_LENGTH(val) bfin_write16(CAN_MB09_LENGTH, val)
-#define bfin_read_CAN_MB09_TIMESTAMP() bfin_read16(CAN_MB09_TIMESTAMP)
-#define bfin_write_CAN_MB09_TIMESTAMP(val) bfin_write16(CAN_MB09_TIMESTAMP, val)
-#define bfin_read_CAN_MB09_ID0()       bfin_read16(CAN_MB09_ID0)
-#define bfin_write_CAN_MB09_ID0(val)   bfin_write16(CAN_MB09_ID0, val)
-#define bfin_read_CAN_MB09_ID1()       bfin_read16(CAN_MB09_ID1)
-#define bfin_write_CAN_MB09_ID1(val)   bfin_write16(CAN_MB09_ID1, val)
-#define bfin_read_CAN_MB10_DATA0()     bfin_read16(CAN_MB10_DATA0)
-#define bfin_write_CAN_MB10_DATA0(val) bfin_write16(CAN_MB10_DATA0, val)
-#define bfin_read_CAN_MB10_DATA1()     bfin_read16(CAN_MB10_DATA1)
-#define bfin_write_CAN_MB10_DATA1(val) bfin_write16(CAN_MB10_DATA1, val)
-#define bfin_read_CAN_MB10_DATA2()     bfin_read16(CAN_MB10_DATA2)
-#define bfin_write_CAN_MB10_DATA2(val) bfin_write16(CAN_MB10_DATA2, val)
-#define bfin_read_CAN_MB10_DATA3()     bfin_read16(CAN_MB10_DATA3)
-#define bfin_write_CAN_MB10_DATA3(val) bfin_write16(CAN_MB10_DATA3, val)
-#define bfin_read_CAN_MB10_LENGTH()    bfin_read16(CAN_MB10_LENGTH)
-#define bfin_write_CAN_MB10_LENGTH(val) bfin_write16(CAN_MB10_LENGTH, val)
-#define bfin_read_CAN_MB10_TIMESTAMP() bfin_read16(CAN_MB10_TIMESTAMP)
-#define bfin_write_CAN_MB10_TIMESTAMP(val) bfin_write16(CAN_MB10_TIMESTAMP, val)
-#define bfin_read_CAN_MB10_ID0()       bfin_read16(CAN_MB10_ID0)
-#define bfin_write_CAN_MB10_ID0(val)   bfin_write16(CAN_MB10_ID0, val)
-#define bfin_read_CAN_MB10_ID1()       bfin_read16(CAN_MB10_ID1)
-#define bfin_write_CAN_MB10_ID1(val)   bfin_write16(CAN_MB10_ID1, val)
-#define bfin_read_CAN_MB11_DATA0()     bfin_read16(CAN_MB11_DATA0)
-#define bfin_write_CAN_MB11_DATA0(val) bfin_write16(CAN_MB11_DATA0, val)
-#define bfin_read_CAN_MB11_DATA1()     bfin_read16(CAN_MB11_DATA1)
-#define bfin_write_CAN_MB11_DATA1(val) bfin_write16(CAN_MB11_DATA1, val)
-#define bfin_read_CAN_MB11_DATA2()     bfin_read16(CAN_MB11_DATA2)
-#define bfin_write_CAN_MB11_DATA2(val) bfin_write16(CAN_MB11_DATA2, val)
-#define bfin_read_CAN_MB11_DATA3()     bfin_read16(CAN_MB11_DATA3)
-#define bfin_write_CAN_MB11_DATA3(val) bfin_write16(CAN_MB11_DATA3, val)
-#define bfin_read_CAN_MB11_LENGTH()    bfin_read16(CAN_MB11_LENGTH)
-#define bfin_write_CAN_MB11_LENGTH(val) bfin_write16(CAN_MB11_LENGTH, val)
-#define bfin_read_CAN_MB11_TIMESTAMP() bfin_read16(CAN_MB11_TIMESTAMP)
-#define bfin_write_CAN_MB11_TIMESTAMP(val) bfin_write16(CAN_MB11_TIMESTAMP, val)
-#define bfin_read_CAN_MB11_ID0()       bfin_read16(CAN_MB11_ID0)
-#define bfin_write_CAN_MB11_ID0(val)   bfin_write16(CAN_MB11_ID0, val)
-#define bfin_read_CAN_MB11_ID1()       bfin_read16(CAN_MB11_ID1)
-#define bfin_write_CAN_MB11_ID1(val)   bfin_write16(CAN_MB11_ID1, val)
-#define bfin_read_CAN_MB12_DATA0()     bfin_read16(CAN_MB12_DATA0)
-#define bfin_write_CAN_MB12_DATA0(val) bfin_write16(CAN_MB12_DATA0, val)
-#define bfin_read_CAN_MB12_DATA1()     bfin_read16(CAN_MB12_DATA1)
-#define bfin_write_CAN_MB12_DATA1(val) bfin_write16(CAN_MB12_DATA1, val)
-#define bfin_read_CAN_MB12_DATA2()     bfin_read16(CAN_MB12_DATA2)
-#define bfin_write_CAN_MB12_DATA2(val) bfin_write16(CAN_MB12_DATA2, val)
-#define bfin_read_CAN_MB12_DATA3()     bfin_read16(CAN_MB12_DATA3)
-#define bfin_write_CAN_MB12_DATA3(val) bfin_write16(CAN_MB12_DATA3, val)
-#define bfin_read_CAN_MB12_LENGTH()    bfin_read16(CAN_MB12_LENGTH)
-#define bfin_write_CAN_MB12_LENGTH(val) bfin_write16(CAN_MB12_LENGTH, val)
-#define bfin_read_CAN_MB12_TIMESTAMP() bfin_read16(CAN_MB12_TIMESTAMP)
-#define bfin_write_CAN_MB12_TIMESTAMP(val) bfin_write16(CAN_MB12_TIMESTAMP, val)
-#define bfin_read_CAN_MB12_ID0()       bfin_read16(CAN_MB12_ID0)
-#define bfin_write_CAN_MB12_ID0(val)   bfin_write16(CAN_MB12_ID0, val)
-#define bfin_read_CAN_MB12_ID1()       bfin_read16(CAN_MB12_ID1)
-#define bfin_write_CAN_MB12_ID1(val)   bfin_write16(CAN_MB12_ID1, val)
-#define bfin_read_CAN_MB13_DATA0()     bfin_read16(CAN_MB13_DATA0)
-#define bfin_write_CAN_MB13_DATA0(val) bfin_write16(CAN_MB13_DATA0, val)
-#define bfin_read_CAN_MB13_DATA1()     bfin_read16(CAN_MB13_DATA1)
-#define bfin_write_CAN_MB13_DATA1(val) bfin_write16(CAN_MB13_DATA1, val)
-#define bfin_read_CAN_MB13_DATA2()     bfin_read16(CAN_MB13_DATA2)
-#define bfin_write_CAN_MB13_DATA2(val) bfin_write16(CAN_MB13_DATA2, val)
-#define bfin_read_CAN_MB13_DATA3()     bfin_read16(CAN_MB13_DATA3)
-#define bfin_write_CAN_MB13_DATA3(val) bfin_write16(CAN_MB13_DATA3, val)
-#define bfin_read_CAN_MB13_LENGTH()    bfin_read16(CAN_MB13_LENGTH)
-#define bfin_write_CAN_MB13_LENGTH(val) bfin_write16(CAN_MB13_LENGTH, val)
-#define bfin_read_CAN_MB13_TIMESTAMP() bfin_read16(CAN_MB13_TIMESTAMP)
-#define bfin_write_CAN_MB13_TIMESTAMP(val) bfin_write16(CAN_MB13_TIMESTAMP, val)
-#define bfin_read_CAN_MB13_ID0()       bfin_read16(CAN_MB13_ID0)
-#define bfin_write_CAN_MB13_ID0(val)   bfin_write16(CAN_MB13_ID0, val)
-#define bfin_read_CAN_MB13_ID1()       bfin_read16(CAN_MB13_ID1)
-#define bfin_write_CAN_MB13_ID1(val)   bfin_write16(CAN_MB13_ID1, val)
-#define bfin_read_CAN_MB14_DATA0()     bfin_read16(CAN_MB14_DATA0)
-#define bfin_write_CAN_MB14_DATA0(val) bfin_write16(CAN_MB14_DATA0, val)
-#define bfin_read_CAN_MB14_DATA1()     bfin_read16(CAN_MB14_DATA1)
-#define bfin_write_CAN_MB14_DATA1(val) bfin_write16(CAN_MB14_DATA1, val)
-#define bfin_read_CAN_MB14_DATA2()     bfin_read16(CAN_MB14_DATA2)
-#define bfin_write_CAN_MB14_DATA2(val) bfin_write16(CAN_MB14_DATA2, val)
-#define bfin_read_CAN_MB14_DATA3()     bfin_read16(CAN_MB14_DATA3)
-#define bfin_write_CAN_MB14_DATA3(val) bfin_write16(CAN_MB14_DATA3, val)
-#define bfin_read_CAN_MB14_LENGTH()    bfin_read16(CAN_MB14_LENGTH)
-#define bfin_write_CAN_MB14_LENGTH(val) bfin_write16(CAN_MB14_LENGTH, val)
-#define bfin_read_CAN_MB14_TIMESTAMP() bfin_read16(CAN_MB14_TIMESTAMP)
-#define bfin_write_CAN_MB14_TIMESTAMP(val) bfin_write16(CAN_MB14_TIMESTAMP, val)
-#define bfin_read_CAN_MB14_ID0()       bfin_read16(CAN_MB14_ID0)
-#define bfin_write_CAN_MB14_ID0(val)   bfin_write16(CAN_MB14_ID0, val)
-#define bfin_read_CAN_MB14_ID1()       bfin_read16(CAN_MB14_ID1)
-#define bfin_write_CAN_MB14_ID1(val)   bfin_write16(CAN_MB14_ID1, val)
-#define bfin_read_CAN_MB15_DATA0()     bfin_read16(CAN_MB15_DATA0)
-#define bfin_write_CAN_MB15_DATA0(val) bfin_write16(CAN_MB15_DATA0, val)
-#define bfin_read_CAN_MB15_DATA1()     bfin_read16(CAN_MB15_DATA1)
-#define bfin_write_CAN_MB15_DATA1(val) bfin_write16(CAN_MB15_DATA1, val)
-#define bfin_read_CAN_MB15_DATA2()     bfin_read16(CAN_MB15_DATA2)
-#define bfin_write_CAN_MB15_DATA2(val) bfin_write16(CAN_MB15_DATA2, val)
-#define bfin_read_CAN_MB15_DATA3()     bfin_read16(CAN_MB15_DATA3)
-#define bfin_write_CAN_MB15_DATA3(val) bfin_write16(CAN_MB15_DATA3, val)
-#define bfin_read_CAN_MB15_LENGTH()    bfin_read16(CAN_MB15_LENGTH)
-#define bfin_write_CAN_MB15_LENGTH(val) bfin_write16(CAN_MB15_LENGTH, val)
-#define bfin_read_CAN_MB15_TIMESTAMP() bfin_read16(CAN_MB15_TIMESTAMP)
-#define bfin_write_CAN_MB15_TIMESTAMP(val) bfin_write16(CAN_MB15_TIMESTAMP, val)
-#define bfin_read_CAN_MB15_ID0()       bfin_read16(CAN_MB15_ID0)
-#define bfin_write_CAN_MB15_ID0(val)   bfin_write16(CAN_MB15_ID0, val)
-#define bfin_read_CAN_MB15_ID1()       bfin_read16(CAN_MB15_ID1)
-#define bfin_write_CAN_MB15_ID1(val)   bfin_write16(CAN_MB15_ID1, val)
-#define bfin_read_CAN_MB16_DATA0()     bfin_read16(CAN_MB16_DATA0)
-#define bfin_write_CAN_MB16_DATA0(val) bfin_write16(CAN_MB16_DATA0, val)
-#define bfin_read_CAN_MB16_DATA1()     bfin_read16(CAN_MB16_DATA1)
-#define bfin_write_CAN_MB16_DATA1(val) bfin_write16(CAN_MB16_DATA1, val)
-#define bfin_read_CAN_MB16_DATA2()     bfin_read16(CAN_MB16_DATA2)
-#define bfin_write_CAN_MB16_DATA2(val) bfin_write16(CAN_MB16_DATA2, val)
-#define bfin_read_CAN_MB16_DATA3()     bfin_read16(CAN_MB16_DATA3)
-#define bfin_write_CAN_MB16_DATA3(val) bfin_write16(CAN_MB16_DATA3, val)
-#define bfin_read_CAN_MB16_LENGTH()    bfin_read16(CAN_MB16_LENGTH)
-#define bfin_write_CAN_MB16_LENGTH(val) bfin_write16(CAN_MB16_LENGTH, val)
-#define bfin_read_CAN_MB16_TIMESTAMP() bfin_read16(CAN_MB16_TIMESTAMP)
-#define bfin_write_CAN_MB16_TIMESTAMP(val) bfin_write16(CAN_MB16_TIMESTAMP, val)
-#define bfin_read_CAN_MB16_ID0()       bfin_read16(CAN_MB16_ID0)
-#define bfin_write_CAN_MB16_ID0(val)   bfin_write16(CAN_MB16_ID0, val)
-#define bfin_read_CAN_MB16_ID1()       bfin_read16(CAN_MB16_ID1)
-#define bfin_write_CAN_MB16_ID1(val)   bfin_write16(CAN_MB16_ID1, val)
-#define bfin_read_CAN_MB17_DATA0()     bfin_read16(CAN_MB17_DATA0)
-#define bfin_write_CAN_MB17_DATA0(val) bfin_write16(CAN_MB17_DATA0, val)
-#define bfin_read_CAN_MB17_DATA1()     bfin_read16(CAN_MB17_DATA1)
-#define bfin_write_CAN_MB17_DATA1(val) bfin_write16(CAN_MB17_DATA1, val)
-#define bfin_read_CAN_MB17_DATA2()     bfin_read16(CAN_MB17_DATA2)
-#define bfin_write_CAN_MB17_DATA2(val) bfin_write16(CAN_MB17_DATA2, val)
-#define bfin_read_CAN_MB17_DATA3()     bfin_read16(CAN_MB17_DATA3)
-#define bfin_write_CAN_MB17_DATA3(val) bfin_write16(CAN_MB17_DATA3, val)
-#define bfin_read_CAN_MB17_LENGTH()    bfin_read16(CAN_MB17_LENGTH)
-#define bfin_write_CAN_MB17_LENGTH(val) bfin_write16(CAN_MB17_LENGTH, val)
-#define bfin_read_CAN_MB17_TIMESTAMP() bfin_read16(CAN_MB17_TIMESTAMP)
-#define bfin_write_CAN_MB17_TIMESTAMP(val) bfin_write16(CAN_MB17_TIMESTAMP, val)
-#define bfin_read_CAN_MB17_ID0()       bfin_read16(CAN_MB17_ID0)
-#define bfin_write_CAN_MB17_ID0(val)   bfin_write16(CAN_MB17_ID0, val)
-#define bfin_read_CAN_MB17_ID1()       bfin_read16(CAN_MB17_ID1)
-#define bfin_write_CAN_MB17_ID1(val)   bfin_write16(CAN_MB17_ID1, val)
-#define bfin_read_CAN_MB18_DATA0()     bfin_read16(CAN_MB18_DATA0)
-#define bfin_write_CAN_MB18_DATA0(val) bfin_write16(CAN_MB18_DATA0, val)
-#define bfin_read_CAN_MB18_DATA1()     bfin_read16(CAN_MB18_DATA1)
-#define bfin_write_CAN_MB18_DATA1(val) bfin_write16(CAN_MB18_DATA1, val)
-#define bfin_read_CAN_MB18_DATA2()     bfin_read16(CAN_MB18_DATA2)
-#define bfin_write_CAN_MB18_DATA2(val) bfin_write16(CAN_MB18_DATA2, val)
-#define bfin_read_CAN_MB18_DATA3()     bfin_read16(CAN_MB18_DATA3)
-#define bfin_write_CAN_MB18_DATA3(val) bfin_write16(CAN_MB18_DATA3, val)
-#define bfin_read_CAN_MB18_LENGTH()    bfin_read16(CAN_MB18_LENGTH)
-#define bfin_write_CAN_MB18_LENGTH(val) bfin_write16(CAN_MB18_LENGTH, val)
-#define bfin_read_CAN_MB18_TIMESTAMP() bfin_read16(CAN_MB18_TIMESTAMP)
-#define bfin_write_CAN_MB18_TIMESTAMP(val) bfin_write16(CAN_MB18_TIMESTAMP, val)
-#define bfin_read_CAN_MB18_ID0()       bfin_read16(CAN_MB18_ID0)
-#define bfin_write_CAN_MB18_ID0(val)   bfin_write16(CAN_MB18_ID0, val)
-#define bfin_read_CAN_MB18_ID1()       bfin_read16(CAN_MB18_ID1)
-#define bfin_write_CAN_MB18_ID1(val)   bfin_write16(CAN_MB18_ID1, val)
-#define bfin_read_CAN_MB19_DATA0()     bfin_read16(CAN_MB19_DATA0)
-#define bfin_write_CAN_MB19_DATA0(val) bfin_write16(CAN_MB19_DATA0, val)
-#define bfin_read_CAN_MB19_DATA1()     bfin_read16(CAN_MB19_DATA1)
-#define bfin_write_CAN_MB19_DATA1(val) bfin_write16(CAN_MB19_DATA1, val)
-#define bfin_read_CAN_MB19_DATA2()     bfin_read16(CAN_MB19_DATA2)
-#define bfin_write_CAN_MB19_DATA2(val) bfin_write16(CAN_MB19_DATA2, val)
-#define bfin_read_CAN_MB19_DATA3()     bfin_read16(CAN_MB19_DATA3)
-#define bfin_write_CAN_MB19_DATA3(val) bfin_write16(CAN_MB19_DATA3, val)
-#define bfin_read_CAN_MB19_LENGTH()    bfin_read16(CAN_MB19_LENGTH)
-#define bfin_write_CAN_MB19_LENGTH(val) bfin_write16(CAN_MB19_LENGTH, val)
-#define bfin_read_CAN_MB19_TIMESTAMP() bfin_read16(CAN_MB19_TIMESTAMP)
-#define bfin_write_CAN_MB19_TIMESTAMP(val) bfin_write16(CAN_MB19_TIMESTAMP, val)
-#define bfin_read_CAN_MB19_ID0()       bfin_read16(CAN_MB19_ID0)
-#define bfin_write_CAN_MB19_ID0(val)   bfin_write16(CAN_MB19_ID0, val)
-#define bfin_read_CAN_MB19_ID1()       bfin_read16(CAN_MB19_ID1)
-#define bfin_write_CAN_MB19_ID1(val)   bfin_write16(CAN_MB19_ID1, val)
-#define bfin_read_CAN_MB20_DATA0()     bfin_read16(CAN_MB20_DATA0)
-#define bfin_write_CAN_MB20_DATA0(val) bfin_write16(CAN_MB20_DATA0, val)
-#define bfin_read_CAN_MB20_DATA1()     bfin_read16(CAN_MB20_DATA1)
-#define bfin_write_CAN_MB20_DATA1(val) bfin_write16(CAN_MB20_DATA1, val)
-#define bfin_read_CAN_MB20_DATA2()     bfin_read16(CAN_MB20_DATA2)
-#define bfin_write_CAN_MB20_DATA2(val) bfin_write16(CAN_MB20_DATA2, val)
-#define bfin_read_CAN_MB20_DATA3()     bfin_read16(CAN_MB20_DATA3)
-#define bfin_write_CAN_MB20_DATA3(val) bfin_write16(CAN_MB20_DATA3, val)
-#define bfin_read_CAN_MB20_LENGTH()    bfin_read16(CAN_MB20_LENGTH)
-#define bfin_write_CAN_MB20_LENGTH(val) bfin_write16(CAN_MB20_LENGTH, val)
-#define bfin_read_CAN_MB20_TIMESTAMP() bfin_read16(CAN_MB20_TIMESTAMP)
-#define bfin_write_CAN_MB20_TIMESTAMP(val) bfin_write16(CAN_MB20_TIMESTAMP, val)
-#define bfin_read_CAN_MB20_ID0()       bfin_read16(CAN_MB20_ID0)
-#define bfin_write_CAN_MB20_ID0(val)   bfin_write16(CAN_MB20_ID0, val)
-#define bfin_read_CAN_MB20_ID1()       bfin_read16(CAN_MB20_ID1)
-#define bfin_write_CAN_MB20_ID1(val)   bfin_write16(CAN_MB20_ID1, val)
-#define bfin_read_CAN_MB21_DATA0()     bfin_read16(CAN_MB21_DATA0)
-#define bfin_write_CAN_MB21_DATA0(val) bfin_write16(CAN_MB21_DATA0, val)
-#define bfin_read_CAN_MB21_DATA1()     bfin_read16(CAN_MB21_DATA1)
-#define bfin_write_CAN_MB21_DATA1(val) bfin_write16(CAN_MB21_DATA1, val)
-#define bfin_read_CAN_MB21_DATA2()     bfin_read16(CAN_MB21_DATA2)
-#define bfin_write_CAN_MB21_DATA2(val) bfin_write16(CAN_MB21_DATA2, val)
-#define bfin_read_CAN_MB21_DATA3()     bfin_read16(CAN_MB21_DATA3)
-#define bfin_write_CAN_MB21_DATA3(val) bfin_write16(CAN_MB21_DATA3, val)
-#define bfin_read_CAN_MB21_LENGTH()    bfin_read16(CAN_MB21_LENGTH)
-#define bfin_write_CAN_MB21_LENGTH(val) bfin_write16(CAN_MB21_LENGTH, val)
-#define bfin_read_CAN_MB21_TIMESTAMP() bfin_read16(CAN_MB21_TIMESTAMP)
-#define bfin_write_CAN_MB21_TIMESTAMP(val) bfin_write16(CAN_MB21_TIMESTAMP, val)
-#define bfin_read_CAN_MB21_ID0()       bfin_read16(CAN_MB21_ID0)
-#define bfin_write_CAN_MB21_ID0(val)   bfin_write16(CAN_MB21_ID0, val)
-#define bfin_read_CAN_MB21_ID1()       bfin_read16(CAN_MB21_ID1)
-#define bfin_write_CAN_MB21_ID1(val)   bfin_write16(CAN_MB21_ID1, val)
-#define bfin_read_CAN_MB22_DATA0()     bfin_read16(CAN_MB22_DATA0)
-#define bfin_write_CAN_MB22_DATA0(val) bfin_write16(CAN_MB22_DATA0, val)
-#define bfin_read_CAN_MB22_DATA1()     bfin_read16(CAN_MB22_DATA1)
-#define bfin_write_CAN_MB22_DATA1(val) bfin_write16(CAN_MB22_DATA1, val)
-#define bfin_read_CAN_MB22_DATA2()     bfin_read16(CAN_MB22_DATA2)
-#define bfin_write_CAN_MB22_DATA2(val) bfin_write16(CAN_MB22_DATA2, val)
-#define bfin_read_CAN_MB22_DATA3()     bfin_read16(CAN_MB22_DATA3)
-#define bfin_write_CAN_MB22_DATA3(val) bfin_write16(CAN_MB22_DATA3, val)
-#define bfin_read_CAN_MB22_LENGTH()    bfin_read16(CAN_MB22_LENGTH)
-#define bfin_write_CAN_MB22_LENGTH(val) bfin_write16(CAN_MB22_LENGTH, val)
-#define bfin_read_CAN_MB22_TIMESTAMP() bfin_read16(CAN_MB22_TIMESTAMP)
-#define bfin_write_CAN_MB22_TIMESTAMP(val) bfin_write16(CAN_MB22_TIMESTAMP, val)
-#define bfin_read_CAN_MB22_ID0()       bfin_read16(CAN_MB22_ID0)
-#define bfin_write_CAN_MB22_ID0(val)   bfin_write16(CAN_MB22_ID0, val)
-#define bfin_read_CAN_MB22_ID1()       bfin_read16(CAN_MB22_ID1)
-#define bfin_write_CAN_MB22_ID1(val)   bfin_write16(CAN_MB22_ID1, val)
-#define bfin_read_CAN_MB23_DATA0()     bfin_read16(CAN_MB23_DATA0)
-#define bfin_write_CAN_MB23_DATA0(val) bfin_write16(CAN_MB23_DATA0, val)
-#define bfin_read_CAN_MB23_DATA1()     bfin_read16(CAN_MB23_DATA1)
-#define bfin_write_CAN_MB23_DATA1(val) bfin_write16(CAN_MB23_DATA1, val)
-#define bfin_read_CAN_MB23_DATA2()     bfin_read16(CAN_MB23_DATA2)
-#define bfin_write_CAN_MB23_DATA2(val) bfin_write16(CAN_MB23_DATA2, val)
-#define bfin_read_CAN_MB23_DATA3()     bfin_read16(CAN_MB23_DATA3)
-#define bfin_write_CAN_MB23_DATA3(val) bfin_write16(CAN_MB23_DATA3, val)
-#define bfin_read_CAN_MB23_LENGTH()    bfin_read16(CAN_MB23_LENGTH)
-#define bfin_write_CAN_MB23_LENGTH(val) bfin_write16(CAN_MB23_LENGTH, val)
-#define bfin_read_CAN_MB23_TIMESTAMP() bfin_read16(CAN_MB23_TIMESTAMP)
-#define bfin_write_CAN_MB23_TIMESTAMP(val) bfin_write16(CAN_MB23_TIMESTAMP, val)
-#define bfin_read_CAN_MB23_ID0()       bfin_read16(CAN_MB23_ID0)
-#define bfin_write_CAN_MB23_ID0(val)   bfin_write16(CAN_MB23_ID0, val)
-#define bfin_read_CAN_MB23_ID1()       bfin_read16(CAN_MB23_ID1)
-#define bfin_write_CAN_MB23_ID1(val)   bfin_write16(CAN_MB23_ID1, val)
-#define bfin_read_CAN_MB24_DATA0()     bfin_read16(CAN_MB24_DATA0)
-#define bfin_write_CAN_MB24_DATA0(val) bfin_write16(CAN_MB24_DATA0, val)
-#define bfin_read_CAN_MB24_DATA1()     bfin_read16(CAN_MB24_DATA1)
-#define bfin_write_CAN_MB24_DATA1(val) bfin_write16(CAN_MB24_DATA1, val)
-#define bfin_read_CAN_MB24_DATA2()     bfin_read16(CAN_MB24_DATA2)
-#define bfin_write_CAN_MB24_DATA2(val) bfin_write16(CAN_MB24_DATA2, val)
-#define bfin_read_CAN_MB24_DATA3()     bfin_read16(CAN_MB24_DATA3)
-#define bfin_write_CAN_MB24_DATA3(val) bfin_write16(CAN_MB24_DATA3, val)
-#define bfin_read_CAN_MB24_LENGTH()    bfin_read16(CAN_MB24_LENGTH)
-#define bfin_write_CAN_MB24_LENGTH(val) bfin_write16(CAN_MB24_LENGTH, val)
-#define bfin_read_CAN_MB24_TIMESTAMP() bfin_read16(CAN_MB24_TIMESTAMP)
-#define bfin_write_CAN_MB24_TIMESTAMP(val) bfin_write16(CAN_MB24_TIMESTAMP, val)
-#define bfin_read_CAN_MB24_ID0()       bfin_read16(CAN_MB24_ID0)
-#define bfin_write_CAN_MB24_ID0(val)   bfin_write16(CAN_MB24_ID0, val)
-#define bfin_read_CAN_MB24_ID1()       bfin_read16(CAN_MB24_ID1)
-#define bfin_write_CAN_MB24_ID1(val)   bfin_write16(CAN_MB24_ID1, val)
-#define bfin_read_CAN_MB25_DATA0()     bfin_read16(CAN_MB25_DATA0)
-#define bfin_write_CAN_MB25_DATA0(val) bfin_write16(CAN_MB25_DATA0, val)
-#define bfin_read_CAN_MB25_DATA1()     bfin_read16(CAN_MB25_DATA1)
-#define bfin_write_CAN_MB25_DATA1(val) bfin_write16(CAN_MB25_DATA1, val)
-#define bfin_read_CAN_MB25_DATA2()     bfin_read16(CAN_MB25_DATA2)
-#define bfin_write_CAN_MB25_DATA2(val) bfin_write16(CAN_MB25_DATA2, val)
-#define bfin_read_CAN_MB25_DATA3()     bfin_read16(CAN_MB25_DATA3)
-#define bfin_write_CAN_MB25_DATA3(val) bfin_write16(CAN_MB25_DATA3, val)
-#define bfin_read_CAN_MB25_LENGTH()    bfin_read16(CAN_MB25_LENGTH)
-#define bfin_write_CAN_MB25_LENGTH(val) bfin_write16(CAN_MB25_LENGTH, val)
-#define bfin_read_CAN_MB25_TIMESTAMP() bfin_read16(CAN_MB25_TIMESTAMP)
-#define bfin_write_CAN_MB25_TIMESTAMP(val) bfin_write16(CAN_MB25_TIMESTAMP, val)
-#define bfin_read_CAN_MB25_ID0()       bfin_read16(CAN_MB25_ID0)
-#define bfin_write_CAN_MB25_ID0(val)   bfin_write16(CAN_MB25_ID0, val)
-#define bfin_read_CAN_MB25_ID1()       bfin_read16(CAN_MB25_ID1)
-#define bfin_write_CAN_MB25_ID1(val)   bfin_write16(CAN_MB25_ID1, val)
-#define bfin_read_CAN_MB26_DATA0()     bfin_read16(CAN_MB26_DATA0)
-#define bfin_write_CAN_MB26_DATA0(val) bfin_write16(CAN_MB26_DATA0, val)
-#define bfin_read_CAN_MB26_DATA1()     bfin_read16(CAN_MB26_DATA1)
-#define bfin_write_CAN_MB26_DATA1(val) bfin_write16(CAN_MB26_DATA1, val)
-#define bfin_read_CAN_MB26_DATA2()     bfin_read16(CAN_MB26_DATA2)
-#define bfin_write_CAN_MB26_DATA2(val) bfin_write16(CAN_MB26_DATA2, val)
-#define bfin_read_CAN_MB26_DATA3()     bfin_read16(CAN_MB26_DATA3)
-#define bfin_write_CAN_MB26_DATA3(val) bfin_write16(CAN_MB26_DATA3, val)
-#define bfin_read_CAN_MB26_LENGTH()    bfin_read16(CAN_MB26_LENGTH)
-#define bfin_write_CAN_MB26_LENGTH(val) bfin_write16(CAN_MB26_LENGTH, val)
-#define bfin_read_CAN_MB26_TIMESTAMP() bfin_read16(CAN_MB26_TIMESTAMP)
-#define bfin_write_CAN_MB26_TIMESTAMP(val) bfin_write16(CAN_MB26_TIMESTAMP, val)
-#define bfin_read_CAN_MB26_ID0()       bfin_read16(CAN_MB26_ID0)
-#define bfin_write_CAN_MB26_ID0(val)   bfin_write16(CAN_MB26_ID0, val)
-#define bfin_read_CAN_MB26_ID1()       bfin_read16(CAN_MB26_ID1)
-#define bfin_write_CAN_MB26_ID1(val)   bfin_write16(CAN_MB26_ID1, val)
-#define bfin_read_CAN_MB27_DATA0()     bfin_read16(CAN_MB27_DATA0)
-#define bfin_write_CAN_MB27_DATA0(val) bfin_write16(CAN_MB27_DATA0, val)
-#define bfin_read_CAN_MB27_DATA1()     bfin_read16(CAN_MB27_DATA1)
-#define bfin_write_CAN_MB27_DATA1(val) bfin_write16(CAN_MB27_DATA1, val)
-#define bfin_read_CAN_MB27_DATA2()     bfin_read16(CAN_MB27_DATA2)
-#define bfin_write_CAN_MB27_DATA2(val) bfin_write16(CAN_MB27_DATA2, val)
-#define bfin_read_CAN_MB27_DATA3()     bfin_read16(CAN_MB27_DATA3)
-#define bfin_write_CAN_MB27_DATA3(val) bfin_write16(CAN_MB27_DATA3, val)
-#define bfin_read_CAN_MB27_LENGTH()    bfin_read16(CAN_MB27_LENGTH)
-#define bfin_write_CAN_MB27_LENGTH(val) bfin_write16(CAN_MB27_LENGTH, val)
-#define bfin_read_CAN_MB27_TIMESTAMP() bfin_read16(CAN_MB27_TIMESTAMP)
-#define bfin_write_CAN_MB27_TIMESTAMP(val) bfin_write16(CAN_MB27_TIMESTAMP, val)
-#define bfin_read_CAN_MB27_ID0()       bfin_read16(CAN_MB27_ID0)
-#define bfin_write_CAN_MB27_ID0(val)   bfin_write16(CAN_MB27_ID0, val)
-#define bfin_read_CAN_MB27_ID1()       bfin_read16(CAN_MB27_ID1)
-#define bfin_write_CAN_MB27_ID1(val)   bfin_write16(CAN_MB27_ID1, val)
-#define bfin_read_CAN_MB28_DATA0()     bfin_read16(CAN_MB28_DATA0)
-#define bfin_write_CAN_MB28_DATA0(val) bfin_write16(CAN_MB28_DATA0, val)
-#define bfin_read_CAN_MB28_DATA1()     bfin_read16(CAN_MB28_DATA1)
-#define bfin_write_CAN_MB28_DATA1(val) bfin_write16(CAN_MB28_DATA1, val)
-#define bfin_read_CAN_MB28_DATA2()     bfin_read16(CAN_MB28_DATA2)
-#define bfin_write_CAN_MB28_DATA2(val) bfin_write16(CAN_MB28_DATA2, val)
-#define bfin_read_CAN_MB28_DATA3()     bfin_read16(CAN_MB28_DATA3)
-#define bfin_write_CAN_MB28_DATA3(val) bfin_write16(CAN_MB28_DATA3, val)
-#define bfin_read_CAN_MB28_LENGTH()    bfin_read16(CAN_MB28_LENGTH)
-#define bfin_write_CAN_MB28_LENGTH(val) bfin_write16(CAN_MB28_LENGTH, val)
-#define bfin_read_CAN_MB28_TIMESTAMP() bfin_read16(CAN_MB28_TIMESTAMP)
-#define bfin_write_CAN_MB28_TIMESTAMP(val) bfin_write16(CAN_MB28_TIMESTAMP, val)
-#define bfin_read_CAN_MB28_ID0()       bfin_read16(CAN_MB28_ID0)
-#define bfin_write_CAN_MB28_ID0(val)   bfin_write16(CAN_MB28_ID0, val)
-#define bfin_read_CAN_MB28_ID1()       bfin_read16(CAN_MB28_ID1)
-#define bfin_write_CAN_MB28_ID1(val)   bfin_write16(CAN_MB28_ID1, val)
-#define bfin_read_CAN_MB29_DATA0()     bfin_read16(CAN_MB29_DATA0)
-#define bfin_write_CAN_MB29_DATA0(val) bfin_write16(CAN_MB29_DATA0, val)
-#define bfin_read_CAN_MB29_DATA1()     bfin_read16(CAN_MB29_DATA1)
-#define bfin_write_CAN_MB29_DATA1(val) bfin_write16(CAN_MB29_DATA1, val)
-#define bfin_read_CAN_MB29_DATA2()     bfin_read16(CAN_MB29_DATA2)
-#define bfin_write_CAN_MB29_DATA2(val) bfin_write16(CAN_MB29_DATA2, val)
-#define bfin_read_CAN_MB29_DATA3()     bfin_read16(CAN_MB29_DATA3)
-#define bfin_write_CAN_MB29_DATA3(val) bfin_write16(CAN_MB29_DATA3, val)
-#define bfin_read_CAN_MB29_LENGTH()    bfin_read16(CAN_MB29_LENGTH)
-#define bfin_write_CAN_MB29_LENGTH(val) bfin_write16(CAN_MB29_LENGTH, val)
-#define bfin_read_CAN_MB29_TIMESTAMP() bfin_read16(CAN_MB29_TIMESTAMP)
-#define bfin_write_CAN_MB29_TIMESTAMP(val) bfin_write16(CAN_MB29_TIMESTAMP, val)
-#define bfin_read_CAN_MB29_ID0()       bfin_read16(CAN_MB29_ID0)
-#define bfin_write_CAN_MB29_ID0(val)   bfin_write16(CAN_MB29_ID0, val)
-#define bfin_read_CAN_MB29_ID1()       bfin_read16(CAN_MB29_ID1)
-#define bfin_write_CAN_MB29_ID1(val)   bfin_write16(CAN_MB29_ID1, val)
-#define bfin_read_CAN_MB30_DATA0()     bfin_read16(CAN_MB30_DATA0)
-#define bfin_write_CAN_MB30_DATA0(val) bfin_write16(CAN_MB30_DATA0, val)
-#define bfin_read_CAN_MB30_DATA1()     bfin_read16(CAN_MB30_DATA1)
-#define bfin_write_CAN_MB30_DATA1(val) bfin_write16(CAN_MB30_DATA1, val)
-#define bfin_read_CAN_MB30_DATA2()     bfin_read16(CAN_MB30_DATA2)
-#define bfin_write_CAN_MB30_DATA2(val) bfin_write16(CAN_MB30_DATA2, val)
-#define bfin_read_CAN_MB30_DATA3()     bfin_read16(CAN_MB30_DATA3)
-#define bfin_write_CAN_MB30_DATA3(val) bfin_write16(CAN_MB30_DATA3, val)
-#define bfin_read_CAN_MB30_LENGTH()    bfin_read16(CAN_MB30_LENGTH)
-#define bfin_write_CAN_MB30_LENGTH(val) bfin_write16(CAN_MB30_LENGTH, val)
-#define bfin_read_CAN_MB30_TIMESTAMP() bfin_read16(CAN_MB30_TIMESTAMP)
-#define bfin_write_CAN_MB30_TIMESTAMP(val) bfin_write16(CAN_MB30_TIMESTAMP, val)
-#define bfin_read_CAN_MB30_ID0()       bfin_read16(CAN_MB30_ID0)
-#define bfin_write_CAN_MB30_ID0(val)   bfin_write16(CAN_MB30_ID0, val)
-#define bfin_read_CAN_MB30_ID1()       bfin_read16(CAN_MB30_ID1)
-#define bfin_write_CAN_MB30_ID1(val)   bfin_write16(CAN_MB30_ID1, val)
-#define bfin_read_CAN_MB31_DATA0()     bfin_read16(CAN_MB31_DATA0)
-#define bfin_write_CAN_MB31_DATA0(val) bfin_write16(CAN_MB31_DATA0, val)
-#define bfin_read_CAN_MB31_DATA1()     bfin_read16(CAN_MB31_DATA1)
-#define bfin_write_CAN_MB31_DATA1(val) bfin_write16(CAN_MB31_DATA1, val)
-#define bfin_read_CAN_MB31_DATA2()     bfin_read16(CAN_MB31_DATA2)
-#define bfin_write_CAN_MB31_DATA2(val) bfin_write16(CAN_MB31_DATA2, val)
-#define bfin_read_CAN_MB31_DATA3()     bfin_read16(CAN_MB31_DATA3)
-#define bfin_write_CAN_MB31_DATA3(val) bfin_write16(CAN_MB31_DATA3, val)
-#define bfin_read_CAN_MB31_LENGTH()    bfin_read16(CAN_MB31_LENGTH)
-#define bfin_write_CAN_MB31_LENGTH(val) bfin_write16(CAN_MB31_LENGTH, val)
-#define bfin_read_CAN_MB31_TIMESTAMP() bfin_read16(CAN_MB31_TIMESTAMP)
-#define bfin_write_CAN_MB31_TIMESTAMP(val) bfin_write16(CAN_MB31_TIMESTAMP, val)
-#define bfin_read_CAN_MB31_ID0()       bfin_read16(CAN_MB31_ID0)
-#define bfin_write_CAN_MB31_ID0(val)   bfin_write16(CAN_MB31_ID0, val)
-#define bfin_read_CAN_MB31_ID1()       bfin_read16(CAN_MB31_ID1)
-#define bfin_write_CAN_MB31_ID1(val)   bfin_write16(CAN_MB31_ID1, val)
-#define bfin_read_PORTF_FER()          bfin_read16(PORTF_FER)
-#define bfin_write_PORTF_FER(val)      bfin_write16(PORTF_FER, val)
-#define bfin_read_PORTG_FER()          bfin_read16(PORTG_FER)
-#define bfin_write_PORTG_FER(val)      bfin_write16(PORTG_FER, val)
-#define bfin_read_PORTH_FER()          bfin_read16(PORTH_FER)
-#define bfin_write_PORTH_FER(val)      bfin_write16(PORTH_FER, val)
-#define bfin_read_PORT_MUX()           bfin_read16(PORT_MUX)
-#define bfin_write_PORT_MUX(val)       bfin_write16(PORT_MUX, val)
-#define bfin_read_HMDMA0_CONTROL()     bfin_read16(HMDMA0_CONTROL)
-#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
-#define bfin_read_HMDMA0_ECINIT()      bfin_read16(HMDMA0_ECINIT)
-#define bfin_write_HMDMA0_ECINIT(val)  bfin_write16(HMDMA0_ECINIT, val)
-#define bfin_read_HMDMA0_BCINIT()      bfin_read16(HMDMA0_BCINIT)
-#define bfin_write_HMDMA0_BCINIT(val)  bfin_write16(HMDMA0_BCINIT, val)
-#define bfin_read_HMDMA0_ECURGENT()    bfin_read16(HMDMA0_ECURGENT)
-#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
-#define bfin_read_HMDMA0_ECOVERFLOW()  bfin_read16(HMDMA0_ECOVERFLOW)
-#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
-#define bfin_read_HMDMA0_ECOUNT()      bfin_read16(HMDMA0_ECOUNT)
-#define bfin_write_HMDMA0_ECOUNT(val)  bfin_write16(HMDMA0_ECOUNT, val)
-#define bfin_read_HMDMA0_BCOUNT()      bfin_read16(HMDMA0_BCOUNT)
-#define bfin_write_HMDMA0_BCOUNT(val)  bfin_write16(HMDMA0_BCOUNT, val)
-#define bfin_read_HMDMA1_CONTROL()     bfin_read16(HMDMA1_CONTROL)
-#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
-#define bfin_read_HMDMA1_ECINIT()      bfin_read16(HMDMA1_ECINIT)
-#define bfin_write_HMDMA1_ECINIT(val)  bfin_write16(HMDMA1_ECINIT, val)
-#define bfin_read_HMDMA1_BCINIT()      bfin_read16(HMDMA1_BCINIT)
-#define bfin_write_HMDMA1_BCINIT(val)  bfin_write16(HMDMA1_BCINIT, val)
-#define bfin_read_HMDMA1_ECURGENT()    bfin_read16(HMDMA1_ECURGENT)
-#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
-#define bfin_read_HMDMA1_ECOVERFLOW()  bfin_read16(HMDMA1_ECOVERFLOW)
-#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
-#define bfin_read_HMDMA1_ECOUNT()      bfin_read16(HMDMA1_ECOUNT)
-#define bfin_write_HMDMA1_ECOUNT(val)  bfin_write16(HMDMA1_ECOUNT, val)
-#define bfin_read_HMDMA1_BCOUNT()      bfin_read16(HMDMA1_BCOUNT)
-#define bfin_write_HMDMA1_BCOUNT(val)  bfin_write16(HMDMA1_BCOUNT, val)
-#define bfin_read_CHIPID()             bfin_read32(CHIPID)
-#define bfin_write_CHIPID(val)         bfin_write32(CHIPID, val)
-#define bfin_read_DMA_TC_CNT()         bfin_read16(DMA_TC_CNT)
-#define bfin_write_DMA_TC_CNT(val)     bfin_write16(DMA_TC_CNT, val)
-#define bfin_read_DMA_TC_PER()         bfin_read16(DMA_TC_PER)
-#define bfin_write_DMA_TC_PER(val)     bfin_write16(DMA_TC_PER, val)
-
-#endif /* __BFIN_CDEF_ADSP_EDN_BF534_extended__ */
diff --git a/arch/blackfin/include/asm/mach-bf537/ADSP-EDN-BF534-extended_def.h b/arch/blackfin/include/asm/mach-bf537/ADSP-EDN-BF534-extended_def.h
deleted file mode 100644 (file)
index 81b158e..0000000
+++ /dev/null
@@ -1,819 +0,0 @@
-/* DO NOT EDIT THIS FILE
- * Automatically generated by generate-def-headers.xsl
- * DO NOT EDIT THIS FILE
- */
-
-#ifndef __BFIN_DEF_ADSP_EDN_BF534_extended__
-#define __BFIN_DEF_ADSP_EDN_BF534_extended__
-
-#include "../mach-common/ADSP-EDN-core_def.h"
-
-#define PLL_CTL                        0xFFC00000 /* PLL Control Register */
-#define PLL_DIV                        0xFFC00004 /* PLL Divide Register */
-#define VR_CTL                         0xFFC00008 /* Voltage Regulator Control Register */
-#define PLL_STAT                       0xFFC0000C /* PLL Status Register */
-#define PLL_LOCKCNT                    0xFFC00010 /* PLL Lock Count Register */
-#define SWRST                          0xFFC00100 /* Software Reset Register */
-#define SYSCR                          0xFFC00104 /* System Configuration Register */
-#define SIC_RVECT                      0xFFC00108 /* Interrupt Reset Vector Address Register */
-#define SIC_IMASK                      0xFFC0010C /* Interrupt Mask Register */
-#define SIC_IAR0                       0xFFC00110 /* Interrupt Assignment Register 0 */
-#define SIC_IAR1                       0xFFC00114 /* Interrupt Assignment Register 1 */
-#define SIC_IAR2                       0xFFC00118 /* Interrupt Assignment Register 2 */
-#define SIC_IAR3                       0xFFC0011C /* Interrupt Assignment Register 3 */
-#define SIC_ISR                        0xFFC00120 /* Interrupt Status Register */
-#define SIC_IWR                        0xFFC00124 /* Interrupt Wakeup Register */
-#define WDOG_CTL                       0xFFC00200 /* Watchdog Control Register */
-#define WDOG_CNT                       0xFFC00204 /* Watchdog Count Register */
-#define WDOG_STAT                      0xFFC00208 /* Watchdog Status Register */
-#define RTC_STAT                       0xFFC00300 /* RTC Status Register */
-#define RTC_ICTL                       0xFFC00304 /* RTC Interrupt Control Register */
-#define RTC_ISTAT                      0xFFC00308 /* RTC Interrupt Status Register */
-#define RTC_SWCNT                      0xFFC0030C /* RTC Stopwatch Count Register */
-#define RTC_ALARM                      0xFFC00310 /* RTC Alarm Time Register */
-#define RTC_PREN                       0xFFC00314 /* RTC Prescaler Enable Register */
-#define UART0_THR                      0xFFC00400 /* Transmit Holding register */
-#define UART0_RBR                      0xFFC00400 /* Receive Buffer register */
-#define UART0_DLL                      0xFFC00400 /* Divisor Latch (Low-Byte) */
-#define UART0_IER                      0xFFC00404 /* Interrupt Enable Register */
-#define UART0_DLH                      0xFFC00404 /* Divisor Latch (High-Byte) */
-#define UART0_IIR                      0xFFC00408 /* Interrupt Identification Register */
-#define UART0_LCR                      0xFFC0040C /* Line Control Register */
-#define UART0_MCR                      0xFFC00410 /* Modem Control Register */
-#define UART0_LSR                      0xFFC00414 /* Line Status Register */
-#define UART0_MSR                      0xFFC00418 /* Modem Status Register */
-#define UART0_SCR                      0xFFC0041C /* SCR Scratch Register */
-#define UART0_GCTL                     0xFFC00424 /* Global Control Register */
-#define SPI_CTL                        0xFFC00500 /* SPI Control Register */
-#define SPI_FLG                        0xFFC00504 /* SPI Flag register */
-#define SPI_STAT                       0xFFC00508 /* SPI Status register */
-#define SPI_TDBR                       0xFFC0050C /* SPI Transmit Data Buffer Register */
-#define SPI_RDBR                       0xFFC00510 /* SPI Receive Data Buffer Register */
-#define SPI_BAUD                       0xFFC00514 /* SPI Baud rate Register */
-#define SPI_SHADOW                     0xFFC00518 /* SPI_RDBR Shadow Register */
-#define TIMER0_CONFIG                  0xFFC00600 /* Timer 0 Configuration Register */
-#define TIMER0_COUNTER                 0xFFC00604 /* Timer 0 Counter Register */
-#define TIMER0_PERIOD                  0xFFC00608 /* Timer 0 Period Register */
-#define TIMER0_WIDTH                   0xFFC0060C /* Timer 0 Width Register */
-#define TIMER1_CONFIG                  0xFFC00610 /* Timer 1 Configuration Register */
-#define TIMER1_COUNTER                 0xFFC00614 /* Timer 1 Counter Register */
-#define TIMER1_PERIOD                  0xFFC00618 /* Timer 1 Period Register */
-#define TIMER1_WIDTH                   0xFFC0061C /* Timer 1 Width Register */
-#define TIMER2_CONFIG                  0xFFC00620 /* Timer 2 Configuration Register */
-#define TIMER2_COUNTER                 0xFFC00624 /* Timer 2 Counter Register */
-#define TIMER2_PERIOD                  0xFFC00628 /* Timer 2 Period Register */
-#define TIMER2_WIDTH                   0xFFC0062C /* Timer 2 Width Register */
-#define TIMER3_CONFIG                  0xFFC00630 /* Timer 3 Configuration Register */
-#define TIMER3_COUNTER                 0xFFC00634 /* Timer 3 Counter Register */
-#define TIMER3_PERIOD                  0xFFC00638 /* Timer 3 Period Register */
-#define TIMER3_WIDTH                   0xFFC0063C /* Timer 3 Width Register */
-#define TIMER4_CONFIG                  0xFFC00640 /* Timer 4 Configuration Register */
-#define TIMER4_COUNTER                 0xFFC00644 /* Timer 4 Counter Register */
-#define TIMER4_PERIOD                  0xFFC00648 /* Timer 4 Period Register */
-#define TIMER4_WIDTH                   0xFFC0064C /* Timer 4 Width Register */
-#define TIMER5_CONFIG                  0xFFC00650 /* Timer 5 Configuration Register */
-#define TIMER5_COUNTER                 0xFFC00654 /* Timer 5 Counter Register */
-#define TIMER5_PERIOD                  0xFFC00658 /* Timer 5 Period Register */
-#define TIMER5_WIDTH                   0xFFC0065C /* Timer 5 Width Register */
-#define TIMER6_CONFIG                  0xFFC00660 /* Timer 6 Configuration Register */
-#define TIMER6_COUNTER                 0xFFC00664 /* Timer 6 Counter Register */
-#define TIMER6_PERIOD                  0xFFC00668 /* Timer 6 Period Register */
-#define TIMER6_WIDTH                   0xFFC0066C /* Timer 6 Width Register\n */
-#define TIMER7_CONFIG                  0xFFC00670 /* Timer 7 Configuration Register */
-#define TIMER7_COUNTER                 0xFFC00674 /* Timer 7 Counter Register */
-#define TIMER7_PERIOD                  0xFFC00678 /* Timer 7 Period Register */
-#define TIMER7_WIDTH                   0xFFC0067C /* Timer 7 Width Register */
-#define TIMER_ENABLE                   0xFFC00680 /* Timer Enable Register */
-#define TIMER_DISABLE                  0xFFC00684 /* Timer Disable Register */
-#define TIMER_STATUS                   0xFFC00688 /* Timer Status Register */
-#define PORTFIO                        0xFFC00700 /* Port F I/O Pin State Specify Register */
-#define PORTFIO_CLEAR                  0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register */
-#define PORTFIO_SET                    0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register */
-#define PORTFIO_TOGGLE                 0xFFC0070C /* Port F I/O Pin State Toggle Register */
-#define PORTFIO_MASKA                  0xFFC00710 /* Port F I/O Mask State Specify Interrupt A Register */
-#define PORTFIO_MASKA_CLEAR            0xFFC00714 /* Port F I/O Mask Disable Interrupt A Register */
-#define PORTFIO_MASKA_SET              0xFFC00718 /* Port F I/O Mask Enable Interrupt A Register */
-#define PORTFIO_MASKA_TOGGLE           0xFFC0071C /* Port F I/O Mask Toggle Enable Interrupt A Register */
-#define PORTFIO_MASKB                  0xFFC00720 /* Port F I/O Mask State Specify Interrupt B Register */
-#define PORTFIO_MASKB_CLEAR            0xFFC00724 /* Port F I/O Mask Disable Interrupt B Register */
-#define PORTFIO_MASKB_SET              0xFFC00728 /* Port F I/O Mask Enable Interrupt B Register */
-#define PORTFIO_MASKB_TOGGLE           0xFFC0072C /* Port F I/O Mask Toggle Enable Interrupt B Register */
-#define PORTFIO_DIR                    0xFFC00730 /* Port F I/O Direction Register */
-#define PORTFIO_POLAR                  0xFFC00734 /* Port F I/O Source Polarity Register */
-#define PORTFIO_EDGE                   0xFFC00738 /* Port F I/O Source Sensitivity Register */
-#define PORTFIO_BOTH                   0xFFC0073C /* Port F I/O Set on BOTH Edges Register */
-#define PORTFIO_INEN                   0xFFC00740 /* Port F I/O Input Enable Register  */
-#define SPORT0_TCR1                    0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
-#define SPORT0_TCR2                    0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
-#define SPORT0_TCLKDIV                 0xFFC00808 /* SPORT0 Transmit Clock Divider */
-#define SPORT0_TFSDIV                  0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
-#define SPORT0_TX                      0xFFC00810 /* SPORT0 TX Data Register */
-#define SPORT0_RX                      0xFFC00818 /* SPORT0 RX Data Register */
-#define SPORT0_RCR1                    0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
-#define SPORT0_RCR2                    0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
-#define SPORT0_RCLKDIV                 0xFFC00828 /* SPORT0 Receive Clock Divider */
-#define SPORT0_RFSDIV                  0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
-#define SPORT0_STAT                    0xFFC00830 /* SPORT0 Status Register */
-#define SPORT0_CHNL                    0xFFC00834 /* SPORT0 Current Channel Register */
-#define SPORT0_MCMC1                   0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
-#define SPORT0_MCMC2                   0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
-#define SPORT0_MTCS0                   0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
-#define SPORT0_MTCS1                   0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
-#define SPORT0_MTCS2                   0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
-#define SPORT0_MTCS3                   0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
-#define SPORT0_MRCS0                   0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
-#define SPORT0_MRCS1                   0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
-#define SPORT0_MRCS2                   0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
-#define SPORT0_MRCS3                   0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
-#define SPORT1_TCR1                    0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
-#define SPORT1_TCR2                    0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
-#define SPORT1_TCLKDIV                 0xFFC00908 /* SPORT1 Transmit Clock Divider */
-#define SPORT1_TFSDIV                  0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
-#define SPORT1_TX                      0xFFC00910 /* SPORT1 TX Data Register */
-#define SPORT1_RX                      0xFFC00918 /* SPORT1 RX Data Register */
-#define SPORT1_RCR1                    0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
-#define SPORT1_RCR2                    0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
-#define SPORT1_RCLKDIV                 0xFFC00928 /* SPORT1 Receive Clock Divider */
-#define SPORT1_RFSDIV                  0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
-#define SPORT1_STAT                    0xFFC00930 /* SPORT1 Status Register */
-#define SPORT1_CHNL                    0xFFC00934 /* SPORT1 Current Channel Register */
-#define SPORT1_MCMC1                   0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
-#define SPORT1_MCMC2                   0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
-#define SPORT1_MTCS0                   0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
-#define SPORT1_MTCS1                   0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
-#define SPORT1_MTCS2                   0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
-#define SPORT1_MTCS3                   0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
-#define SPORT1_MRCS0                   0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
-#define SPORT1_MRCS1                   0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
-#define SPORT1_MRCS2                   0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
-#define SPORT1_MRCS3                   0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
-#define EBIU_AMGCTL                    0xFFC00A00 /* Asynchronous Memory Global Control Register */
-#define EBIU_AMBCTL0                   0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
-#define EBIU_AMBCTL1                   0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
-#define EBIU_SDGCTL                    0xFFC00A10 /* SDRAM Global Control Register */
-#define EBIU_SDBCTL                    0xFFC00A14 /* SDRAM Bank Control Register */
-#define EBIU_SDRRC                     0xFFC00A18 /* SDRAM Refresh Rate Control Register */
-#define EBIU_SDSTAT                    0xFFC00A1C /* SDRAM Status Register */
-#define DMA0_NEXT_DESC_PTR             0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
-#define DMA0_START_ADDR                0xFFC00C04 /* DMA Channel 0 Start Address Register */
-#define DMA0_CONFIG                    0xFFC00C08 /* DMA Channel 0 Configuration Register */
-#define DMA0_X_COUNT                   0xFFC00C10 /* DMA Channel 0 X Count Register */
-#define DMA0_X_MODIFY                  0xFFC00C14 /* DMA Channel 0 X Modify Register */
-#define DMA0_Y_COUNT                   0xFFC00C18 /* DMA Channel 0 Y Count Register */
-#define DMA0_Y_MODIFY                  0xFFC00C1C /* DMA Channel 0 Y Modify Register */
-#define DMA0_CURR_DESC_PTR             0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
-#define DMA0_CURR_ADDR                 0xFFC00C24 /* DMA Channel 0 Current Address Register */
-#define DMA0_IRQ_STATUS                0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
-#define DMA0_PERIPHERAL_MAP            0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
-#define DMA0_CURR_X_COUNT              0xFFC00C30 /* DMA Channel 0 Current X Count Register */
-#define DMA0_CURR_Y_COUNT              0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
-#define DMA1_NEXT_DESC_PTR             0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
-#define DMA1_START_ADDR                0xFFC00C44 /* DMA Channel 1 Start Address Register */
-#define DMA1_CONFIG                    0xFFC00C48 /* DMA Channel 1 Configuration Register */
-#define DMA1_X_COUNT                   0xFFC00C50 /* DMA Channel 1 X Count Register */
-#define DMA1_X_MODIFY                  0xFFC00C54 /* DMA Channel 1 X Modify Register */
-#define DMA1_Y_COUNT                   0xFFC00C58 /* DMA Channel 1 Y Count Register */
-#define DMA1_Y_MODIFY                  0xFFC00C5C /* DMA Channel 1 Y Modify Register */
-#define DMA1_CURR_DESC_PTR             0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
-#define DMA1_CURR_ADDR                 0xFFC00C64 /* DMA Channel 1 Current Address Register */
-#define DMA1_IRQ_STATUS                0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
-#define DMA1_PERIPHERAL_MAP            0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
-#define DMA1_CURR_X_COUNT              0xFFC00C70 /* DMA Channel 1 Current X Count Register */
-#define DMA1_CURR_Y_COUNT              0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
-#define DMA2_NEXT_DESC_PTR             0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
-#define DMA2_START_ADDR                0xFFC00C84 /* DMA Channel 2 Start Address Register */
-#define DMA2_CONFIG                    0xFFC00C88 /* DMA Channel 2 Configuration Register */
-#define DMA2_X_COUNT                   0xFFC00C90 /* DMA Channel 2 X Count Register */
-#define DMA2_X_MODIFY                  0xFFC00C94 /* DMA Channel 2 X Modify Register */
-#define DMA2_Y_COUNT                   0xFFC00C98 /* DMA Channel 2 Y Count Register */
-#define DMA2_Y_MODIFY                  0xFFC00C9C /* DMA Channel 2 Y Modify Register */
-#define DMA2_CURR_DESC_PTR             0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
-#define DMA2_CURR_ADDR                 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
-#define DMA2_IRQ_STATUS                0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
-#define DMA2_PERIPHERAL_MAP            0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
-#define DMA2_CURR_X_COUNT              0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
-#define DMA2_CURR_Y_COUNT              0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
-#define DMA3_NEXT_DESC_PTR             0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
-#define DMA3_START_ADDR                0xFFC00CC4 /* DMA Channel 3 Start Address Register */
-#define DMA3_CONFIG                    0xFFC00CC8 /* DMA Channel 3 Configuration Register */
-#define DMA3_X_COUNT                   0xFFC00CD0 /* DMA Channel 3 X Count Register */
-#define DMA3_X_MODIFY                  0xFFC00CD4 /* DMA Channel 3 X Modify Register */
-#define DMA3_Y_COUNT                   0xFFC00CD8 /* DMA Channel 3 Y Count Register */
-#define DMA3_Y_MODIFY                  0xFFC00CDC /* DMA Channel 3 Y Modify Register */
-#define DMA3_CURR_DESC_PTR             0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
-#define DMA3_CURR_ADDR                 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
-#define DMA3_IRQ_STATUS                0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
-#define DMA3_PERIPHERAL_MAP            0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
-#define DMA3_CURR_X_COUNT              0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
-#define DMA3_CURR_Y_COUNT              0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
-#define DMA4_NEXT_DESC_PTR             0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
-#define DMA4_START_ADDR                0xFFC00D04 /* DMA Channel 4 Start Address Register */
-#define DMA4_CONFIG                    0xFFC00D08 /* DMA Channel 4 Configuration Register */
-#define DMA4_X_COUNT                   0xFFC00D10 /* DMA Channel 4 X Count Register */
-#define DMA4_X_MODIFY                  0xFFC00D14 /* DMA Channel 4 X Modify Register */
-#define DMA4_Y_COUNT                   0xFFC00D18 /* DMA Channel 4 Y Count Register */
-#define DMA4_Y_MODIFY                  0xFFC00D1C /* DMA Channel 4 Y Modify Register */
-#define DMA4_CURR_DESC_PTR             0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
-#define DMA4_CURR_ADDR                 0xFFC00D24 /* DMA Channel 4 Current Address Register */
-#define DMA4_IRQ_STATUS                0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
-#define DMA4_PERIPHERAL_MAP            0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
-#define DMA4_CURR_X_COUNT              0xFFC00D30 /* DMA Channel 4 Current X Count Register */
-#define DMA4_CURR_Y_COUNT              0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
-#define DMA5_NEXT_DESC_PTR             0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
-#define DMA5_START_ADDR                0xFFC00D44 /* DMA Channel 5 Start Address Register */
-#define DMA5_CONFIG                    0xFFC00D48 /* DMA Channel 5 Configuration Register */
-#define DMA5_X_COUNT                   0xFFC00D50 /* DMA Channel 5 X Count Register */
-#define DMA5_X_MODIFY                  0xFFC00D54 /* DMA Channel 5 X Modify Register */
-#define DMA5_Y_COUNT                   0xFFC00D58 /* DMA Channel 5 Y Count Register */
-#define DMA5_Y_MODIFY                  0xFFC00D5C /* DMA Channel 5 Y Modify Register */
-#define DMA5_CURR_DESC_PTR             0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
-#define DMA5_CURR_ADDR                 0xFFC00D64 /* DMA Channel 5 Current Address Register */
-#define DMA5_IRQ_STATUS                0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
-#define DMA5_PERIPHERAL_MAP            0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
-#define DMA5_CURR_X_COUNT              0xFFC00D70 /* DMA Channel 5 Current X Count Register */
-#define DMA5_CURR_Y_COUNT              0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
-#define DMA6_NEXT_DESC_PTR             0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
-#define DMA6_START_ADDR                0xFFC00D84 /* DMA Channel 6 Start Address Register */
-#define DMA6_CONFIG                    0xFFC00D88 /* DMA Channel 6 Configuration Register */
-#define DMA6_X_COUNT                   0xFFC00D90 /* DMA Channel 6 X Count Register */
-#define DMA6_X_MODIFY                  0xFFC00D94 /* DMA Channel 6 X Modify Register */
-#define DMA6_Y_COUNT                   0xFFC00D98 /* DMA Channel 6 Y Count Register */
-#define DMA6_Y_MODIFY                  0xFFC00D9C /* DMA Channel 6 Y Modify Register */
-#define DMA6_CURR_DESC_PTR             0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
-#define DMA6_CURR_ADDR                 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
-#define DMA6_IRQ_STATUS                0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
-#define DMA6_PERIPHERAL_MAP            0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
-#define DMA6_CURR_X_COUNT              0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
-#define DMA6_CURR_Y_COUNT              0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
-#define DMA7_NEXT_DESC_PTR             0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
-#define DMA7_START_ADDR                0xFFC00DC4 /* DMA Channel 7 Start Address Register */
-#define DMA7_CONFIG                    0xFFC00DC8 /* DMA Channel 7 Configuration Register */
-#define DMA7_X_COUNT                   0xFFC00DD0 /* DMA Channel 7 X Count Register */
-#define DMA7_X_MODIFY                  0xFFC00DD4 /* DMA Channel 7 X Modify Register */
-#define DMA7_Y_COUNT                   0xFFC00DD8 /* DMA Channel 7 Y Count Register */
-#define DMA7_Y_MODIFY                  0xFFC00DDC /* DMA Channel 7 Y Modify Register */
-#define DMA7_CURR_DESC_PTR             0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
-#define DMA7_CURR_ADDR                 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
-#define DMA7_IRQ_STATUS                0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
-#define DMA7_PERIPHERAL_MAP            0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
-#define DMA7_CURR_X_COUNT              0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
-#define DMA7_CURR_Y_COUNT              0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
-#define DMA8_NEXT_DESC_PTR             0xFFC00E00 /* DMA Channel 8 Next Descriptor Pointer Register */
-#define DMA8_START_ADDR                0xFFC00E04 /* DMA Channel 8 Start Address Register */
-#define DMA8_CONFIG                    0xFFC00E08 /* DMA Channel 8 Configuration Register */
-#define DMA8_X_COUNT                   0xFFC00E10 /* DMA Channel 8 X Count Register */
-#define DMA8_X_MODIFY                  0xFFC00E14 /* DMA Channel 8 X Modify Register */
-#define DMA8_Y_COUNT                   0xFFC00E18 /* DMA Channel 8 Y Count Register */
-#define DMA8_Y_MODIFY                  0xFFC00E1C /* DMA Channel 8 Y Modify Register */
-#define DMA8_CURR_DESC_PTR             0xFFC00E20 /* DMA Channel 8 Current Descriptor Pointer Register */
-#define DMA8_CURR_ADDR                 0xFFC00E24 /* DMA Channel 8 Current Address Register */
-#define DMA8_IRQ_STATUS                0xFFC00E28 /* DMA Channel 8 Interrupt/Status Register */
-#define DMA8_PERIPHERAL_MAP            0xFFC00E2C /* DMA Channel 8 Peripheral Map Register */
-#define DMA8_CURR_X_COUNT              0xFFC00E30 /* DMA Channel 8 Current X Count Register */
-#define DMA8_CURR_Y_COUNT              0xFFC00E38 /* DMA Channel 8 Current Y Count Register */
-#define DMA9_NEXT_DESC_PTR             0xFFC00E40 /* DMA Channel 9 Next Descriptor Pointer Register */
-#define DMA9_START_ADDR                0xFFC00E44 /* DMA Channel 9 Start Address Register */
-#define DMA9_CONFIG                    0xFFC00E48 /* DMA Channel 9 Configuration Register */
-#define DMA9_X_COUNT                   0xFFC00E50 /* DMA Channel 9 X Count Register */
-#define DMA9_X_MODIFY                  0xFFC00E54 /* DMA Channel 9 X Modify Register */
-#define DMA9_Y_COUNT                   0xFFC00E58 /* DMA Channel 9 Y Count Register */
-#define DMA9_Y_MODIFY                  0xFFC00E5C /* DMA Channel 9 Y Modify Register */
-#define DMA9_CURR_DESC_PTR             0xFFC00E60 /* DMA Channel 9 Current Descriptor Pointer Register */
-#define DMA9_CURR_ADDR                 0xFFC00E64 /* DMA Channel 9 Current Address Register */
-#define DMA9_IRQ_STATUS                0xFFC00E68 /* DMA Channel 9 Interrupt/Status Register */
-#define DMA9_PERIPHERAL_MAP            0xFFC00E6C /* DMA Channel 9 Peripheral Map Register */
-#define DMA9_CURR_X_COUNT              0xFFC00E70 /* DMA Channel 9 Current X Count Register */
-#define DMA9_CURR_Y_COUNT              0xFFC00E78 /* DMA Channel 9 Current Y Count Register */
-#define DMA10_NEXT_DESC_PTR            0xFFC00E80 /* DMA Channel 10 Next Descriptor Pointer Register */
-#define DMA10_START_ADDR               0xFFC00E84 /* DMA Channel 10 Start Address Register */
-#define DMA10_CONFIG                   0xFFC00E88 /* DMA Channel 10 Configuration Register */
-#define DMA10_X_COUNT                  0xFFC00E90 /* DMA Channel 10 X Count Register */
-#define DMA10_X_MODIFY                 0xFFC00E94 /* DMA Channel 10 X Modify Register */
-#define DMA10_Y_COUNT                  0xFFC00E98 /* DMA Channel 10 Y Count Register */
-#define DMA10_Y_MODIFY                 0xFFC00E9C /* DMA Channel 10 Y Modify Register */
-#define DMA10_CURR_DESC_PTR            0xFFC00EA0 /* DMA Channel 10 Current Descriptor Pointer Register */
-#define DMA10_CURR_ADDR                0xFFC00EA4 /* DMA Channel 10 Current Address Register */
-#define DMA10_IRQ_STATUS               0xFFC00EA8 /* DMA Channel 10 Interrupt/Status Register */
-#define DMA10_PERIPHERAL_MAP           0xFFC00EAC /* DMA Channel 10 Peripheral Map Register */
-#define DMA10_CURR_X_COUNT             0xFFC00EB0 /* DMA Channel 10 Current X Count Register */
-#define DMA10_CURR_Y_COUNT             0xFFC00EB8 /* DMA Channel 10 Current Y Count Register */
-#define DMA11_NEXT_DESC_PTR            0xFFC00EC0 /* DMA Channel 11 Next Descriptor Pointer Register */
-#define DMA11_START_ADDR               0xFFC00EC4 /* DMA Channel 11 Start Address Register */
-#define DMA11_CONFIG                   0xFFC00EC8 /* DMA Channel 11 Configuration Register */
-#define DMA11_X_COUNT                  0xFFC00ED0 /* DMA Channel 11 X Count Register */
-#define DMA11_X_MODIFY                 0xFFC00ED4 /* DMA Channel 11 X Modify Register */
-#define DMA11_Y_COUNT                  0xFFC00ED8 /* DMA Channel 11 Y Count Register */
-#define DMA11_Y_MODIFY                 0xFFC00EDC /* DMA Channel 11 Y Modify Register */
-#define DMA11_CURR_DESC_PTR            0xFFC00EE0 /* DMA Channel 11 Current Descriptor Pointer Register */
-#define DMA11_CURR_ADDR                0xFFC00EE4 /* DMA Channel 11 Current Address Register */
-#define DMA11_IRQ_STATUS               0xFFC00EE8 /* DMA Channel 11 Interrupt/Status Register */
-#define DMA11_PERIPHERAL_MAP           0xFFC00EEC /* DMA Channel 11 Peripheral Map Register */
-#define DMA11_CURR_X_COUNT             0xFFC00EF0 /* DMA Channel 11 Current X Count Register */
-#define DMA11_CURR_Y_COUNT             0xFFC00EF8 /* DMA Channel 11 Current Y Count Register */
-#define MDMA_S0_NEXT_DESC_PTR          0xFFC00F40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
-#define MDMA_S0_START_ADDR             0xFFC00F44 /* MemDMA Stream 0 Source Start Address Register */
-#define MDMA_S0_CONFIG                 0xFFC00F48 /* MemDMA Stream 0 Source Configuration Register */
-#define MDMA_S0_X_COUNT                0xFFC00F50 /* MemDMA Stream 0 Source X Count Register */
-#define MDMA_S0_X_MODIFY               0xFFC00F54 /* MemDMA Stream 0 Source X Modify Register */
-#define MDMA_S0_Y_COUNT                0xFFC00F58 /* MemDMA Stream 0 Source Y Count Register */
-#define MDMA_S0_Y_MODIFY               0xFFC00F5C /* MemDMA Stream 0 Source Y Modify Register */
-#define MDMA_S0_CURR_DESC_PTR          0xFFC00F60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
-#define MDMA_S0_CURR_ADDR              0xFFC00F64 /* MemDMA Stream 0 Source Current Address Register */
-#define MDMA_S0_IRQ_STATUS             0xFFC00F68 /* MemDMA Stream 0 Source Interrupt/Status Register */
-#define MDMA_S0_PERIPHERAL_MAP         0xFFC00F6C /* MemDMA Stream 0 Source Peripheral Map Register */
-#define MDMA_S0_CURR_X_COUNT           0xFFC00F70 /* MemDMA Stream 0 Source Current X Count Register */
-#define MDMA_S0_CURR_Y_COUNT           0xFFC00F78 /* MemDMA Stream 0 Source Current Y Count Register */
-#define MDMA_D0_NEXT_DESC_PTR          0xFFC00F00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
-#define MDMA_D0_START_ADDR             0xFFC00F04 /* MemDMA Stream 0 Destination Start Address Register */
-#define MDMA_D0_CONFIG                 0xFFC00F08 /* MemDMA Stream 0 Destination Configuration Register */
-#define MDMA_D0_X_COUNT                0xFFC00F10 /* MemDMA Stream 0 Destination X Count Register */
-#define MDMA_D0_X_MODIFY               0xFFC00F14 /* MemDMA Stream 0 Destination X Modify Register */
-#define MDMA_D0_Y_COUNT                0xFFC00F18 /* MemDMA Stream 0 Destination Y Count Register */
-#define MDMA_D0_Y_MODIFY               0xFFC00F1C /* MemDMA Stream 0 Destination Y Modify Register */
-#define MDMA_D0_CURR_DESC_PTR          0xFFC00F20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
-#define MDMA_D0_CURR_ADDR              0xFFC00F24 /* MemDMA Stream 0 Destination Current Address Register */
-#define MDMA_D0_IRQ_STATUS             0xFFC00F28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
-#define MDMA_D0_PERIPHERAL_MAP         0xFFC00F2C /* MemDMA Stream 0 Destination Peripheral Map Register */
-#define MDMA_D0_CURR_X_COUNT           0xFFC00F30 /* MemDMA Stream 0 Destination Current X Count Register */
-#define MDMA_D0_CURR_Y_COUNT           0xFFC00F38 /* MemDMA Stream 0 Destination Current Y Count Register */
-#define MDMA_S1_NEXT_DESC_PTR          0xFFC00FC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
-#define MDMA_S1_START_ADDR             0xFFC00FC4 /* MemDMA Stream 1 Source Start Address Register */
-#define MDMA_S1_CONFIG                 0xFFC00FC8 /* MemDMA Stream 1 Source Configuration Register */
-#define MDMA_S1_X_COUNT                0xFFC00FD0 /* MemDMA Stream 1 Source X Count Register */
-#define MDMA_S1_X_MODIFY               0xFFC00FD4 /* MemDMA Stream 1 Source X Modify Register */
-#define MDMA_S1_Y_COUNT                0xFFC00FD8 /* MemDMA Stream 1 Source Y Count Register */
-#define MDMA_S1_Y_MODIFY               0xFFC00FDC /* MemDMA Stream 1 Source Y Modify Register */
-#define MDMA_S1_CURR_DESC_PTR          0xFFC00FE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
-#define MDMA_S1_CURR_ADDR              0xFFC00FE4 /* MemDMA Stream 1 Source Current Address Register */
-#define MDMA_S1_IRQ_STATUS             0xFFC00FE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
-#define MDMA_S1_PERIPHERAL_MAP         0xFFC00FEC /* MemDMA Stream 1 Source Peripheral Map Register */
-#define MDMA_S1_CURR_X_COUNT           0xFFC00FF0 /* MemDMA Stream 1 Source Current X Count Register */
-#define MDMA_S1_CURR_Y_COUNT           0xFFC00FF8 /* MemDMA Stream 1 Source Current Y Count Register */
-#define MDMA_D1_NEXT_DESC_PTR          0xFFC00F80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
-#define MDMA_D1_START_ADDR             0xFFC00F84 /* MemDMA Stream 1 Destination Start Address Register */
-#define MDMA_D1_CONFIG                 0xFFC00F88 /* MemDMA Stream 1 Destination Configuration Register */
-#define MDMA_D1_X_COUNT                0xFFC00F90 /* MemDMA Stream 1 Destination X Count Register */
-#define MDMA_D1_X_MODIFY               0xFFC00F94 /* MemDMA Stream 1 Destination X Modify Register */
-#define MDMA_D1_Y_COUNT                0xFFC00F98 /* MemDMA Stream 1 Destination Y Count Register */
-#define MDMA_D1_Y_MODIFY               0xFFC00F9C /* MemDMA Stream 1 Destination Y Modify Register */
-#define MDMA_D1_CURR_DESC_PTR          0xFFC00FA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
-#define MDMA_D1_CURR_ADDR              0xFFC00FA4 /* MemDMA Stream 1 Destination Current Address Register */
-#define MDMA_D1_IRQ_STATUS             0xFFC00FA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
-#define MDMA_D1_PERIPHERAL_MAP         0xFFC00FAC /* MemDMA Stream 1 Destination Peripheral Map Register */
-#define MDMA_D1_CURR_X_COUNT           0xFFC00FB0 /* MemDMA Stream 1 Destination Current X Count Register */
-#define MDMA_D1_CURR_Y_COUNT           0xFFC00FB8 /* MemDMA Stream 1 Destination Current Y Count Register */
-#define PPI_CONTROL                    0xFFC01000 /* PPI Control Register */
-#define PPI_STATUS                     0xFFC01004 /* PPI Status Register */
-#define PPI_COUNT                      0xFFC01008 /* PPI Transfer Count Register */
-#define PPI_DELAY                      0xFFC0100C /* PPI Delay Count Register */
-#define PPI_FRAME                      0xFFC01010 /* PPI Frame Length Register */
-#define TWI_CLKDIV                     0xFFC01400 /* Serial Clock Divider Register */
-#define TWI_CONTROL                    0xFFC01404 /* TWI Control Register */
-#define TWI_SLAVE_CTL                  0xFFC01408 /* Slave Mode Control Register */
-#define TWI_SLAVE_STAT                 0xFFC0140C /* Slave Mode Status Register */
-#define TWI_SLAVE_ADDR                 0xFFC01410 /* Slave Mode Address Register */
-#define TWI_MASTER_CTL                 0xFFC01414 /* Master Mode Control Register */
-#define TWI_MASTER_STAT                0xFFC01418 /* Master Mode Status Register */
-#define TWI_MASTER_ADDR                0xFFC0141C /* Master Mode Address Register */
-#define TWI_INT_STAT                   0xFFC01420 /* TWI Interrupt Status Register */
-#define TWI_INT_MASK                   0xFFC01424 /* TWI Master Interrupt Mask Register */
-#define TWI_FIFO_CTL                   0xFFC01428 /* FIFO Control Register */
-#define TWI_FIFO_STAT                  0xFFC0142C /* FIFO Status Register */
-#define TWI_XMT_DATA8                  0xFFC01480 /* FIFO Transmit Data Single Byte Register */
-#define TWI_XMT_DATA16                 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
-#define TWI_RCV_DATA8                  0xFFC01488 /* FIFO Receive Data Single Byte Register */
-#define TWI_RCV_DATA16                 0xFFC0148C /* FIFO Receive Data Double Byte Register */
-#define PORTGIO                        0xFFC01500 /* Port G I/O Pin State Specify Register */
-#define PORTGIO_CLEAR                  0xFFC01504 /* Port G I/O Peripheral Interrupt Clear Register */
-#define PORTGIO_SET                    0xFFC01508 /* Port G I/O Peripheral Interrupt Set Register */
-#define PORTGIO_TOGGLE                 0xFFC0150C /* Port G I/O Pin State Toggle Register */
-#define PORTGIO_MASKA                  0xFFC01510 /* Port G I/O Mask State Specify Interrupt A Register */
-#define PORTGIO_MASKA_CLEAR            0xFFC01514 /* Port G I/O Mask Disable Interrupt A Register */
-#define PORTGIO_MASKA_SET              0xFFC01518 /* Port G I/O Mask Enable Interrupt A Register */
-#define PORTGIO_MASKA_TOGGLE           0xFFC0151C /* Port G I/O Mask Toggle Enable Interrupt A Register */
-#define PORTGIO_MASKB                  0xFFC01520 /* Port G I/O Mask State Specify Interrupt B Register */
-#define PORTGIO_MASKB_CLEAR            0xFFC01524 /* Port G I/O Mask Disable Interrupt B Register */
-#define PORTGIO_MASKB_SET              0xFFC01528 /* Port G I/O Mask Enable Interrupt B Register */
-#define PORTGIO_MASKB_TOGGLE           0xFFC0152C /* Port G I/O Mask Toggle Enable Interrupt B Register */
-#define PORTGIO_DIR                    0xFFC01530 /* Port G I/O Direction Register */
-#define PORTGIO_POLAR                  0xFFC01534 /* Port G I/O Source Polarity Register */
-#define PORTGIO_EDGE                   0xFFC01538 /* Port G I/O Source Sensitivity Register */
-#define PORTGIO_BOTH                   0xFFC0153C /* Port G I/O Set on BOTH Edges Register */
-#define PORTGIO_INEN                   0xFFC01540 /* Port G I/O Input Enable Register */
-#define PORTHIO                        0xFFC01700 /* Port H I/O Pin State Specify Register */
-#define PORTHIO_CLEAR                  0xFFC01704 /* Port H I/O Peripheral Interrupt Clear Register */
-#define PORTHIO_SET                    0xFFC01708 /* Port H I/O Peripheral Interrupt Set Register */
-#define PORTHIO_TOGGLE                 0xFFC0170C /* Port H I/O Pin State Toggle Register */
-#define PORTHIO_MASKA                  0xFFC01710 /* Port H I/O Mask State Specify Interrupt A Register */
-#define PORTHIO_MASKA_CLEAR            0xFFC01714 /* Port H I/O Mask Disable Interrupt A Register */
-#define PORTHIO_MASKA_SET              0xFFC01718 /* Port H I/O Mask Enable Interrupt A Register */
-#define PORTHIO_MASKA_TOGGLE           0xFFC0171C /* Port H I/O Mask Toggle Enable Interrupt A Register */
-#define PORTHIO_MASKB                  0xFFC01720 /* Port H I/O Mask State Specify Interrupt B Register */
-#define PORTHIO_MASKB_CLEAR            0xFFC01724 /* Port H I/O Mask Disable Interrupt B Register */
-#define PORTHIO_MASKB_SET              0xFFC01728 /* Port H I/O Mask Enable Interrupt B Register */
-#define PORTHIO_MASKB_TOGGLE           0xFFC0172C /* Port H I/O Mask Toggle Enable Interrupt B Register */
-#define PORTHIO_DIR                    0xFFC01730 /* Port H I/O Direction Register */
-#define PORTHIO_POLAR                  0xFFC01734 /* Port H I/O Source Polarity Register */
-#define PORTHIO_EDGE                   0xFFC01738 /* Port H I/O Source Sensitivity Register */
-#define PORTHIO_BOTH                   0xFFC0173C /* Port H I/O Set on BOTH Edges Register */
-#define PORTHIO_INEN                   0xFFC01740 /* Port H I/O Input Enable Register */
-#define UART1_THR                      0xFFC02000 /* Transmit Holding register */
-#define UART1_RBR                      0xFFC02000 /* Receive Buffer register */
-#define UART1_DLL                      0xFFC02000 /* Divisor Latch (Low-Byte) */
-#define UART1_IER                      0xFFC02004 /* Interrupt Enable Register */
-#define UART1_DLH                      0xFFC02004 /* Divisor Latch (High-Byte) */
-#define UART1_IIR                      0xFFC02008 /* Interrupt Identification Register */
-#define UART1_LCR                      0xFFC0200C /* Line Control Register */
-#define UART1_MCR                      0xFFC02010 /* Modem Control Register */
-#define UART1_LSR                      0xFFC02014 /* Line Status Register */
-#define UART1_MSR                      0xFFC02018 /* Modem Status Register */
-#define UART1_SCR                      0xFFC0201C /* SCR Scratch Register */
-#define UART1_GCTL                     0xFFC02024 /* Global Control Register */
-#define CAN_MC1                        0xFFC02A00 /* Mailbox config reg 1 */
-#define CAN_MD1                        0xFFC02A04 /* Mailbox direction reg 1 */
-#define CAN_TRS1                       0xFFC02A08 /* Transmit Request Set reg 1 */
-#define CAN_TRR1                       0xFFC02A0C /* Transmit Request Reset reg 1 */
-#define CAN_TA1                        0xFFC02A10 /* Transmit Acknowledge reg 1 */
-#define CAN_AA1                        0xFFC02A14 /* Transmit Abort Acknowledge reg 1 */
-#define CAN_RMP1                       0xFFC02A18 /* Receive Message Pending reg 1 */
-#define CAN_RML1                       0xFFC02A1C /* Receive Message Lost reg 1 */
-#define CAN_MBTIF1                     0xFFC02A20 /* Mailbox Transmit Interrupt Flag reg 1 */
-#define CAN_MBRIF1                     0xFFC02A24 /* Mailbox Receive  Interrupt Flag reg 1 */
-#define CAN_MBIM1                      0xFFC02A28 /* Mailbox Interrupt Mask reg 1 */
-#define CAN_RFH1                       0xFFC02A2C /* Remote Frame Handling reg 1 */
-#define CAN_OPSS1                      0xFFC02A30 /* Overwrite Protection Single Shot Xmission reg 1 */
-#define CAN_MC2                        0xFFC02A40 /* Mailbox config reg 2 */
-#define CAN_MD2                        0xFFC02A44 /* Mailbox direction reg 2 */
-#define CAN_TRS2                       0xFFC02A48 /* Transmit Request Set reg 2 */
-#define CAN_TRR2                       0xFFC02A4C /* Transmit Request Reset reg 2 */
-#define CAN_TA2                        0xFFC02A50 /* Transmit Acknowledge reg 2 */
-#define CAN_AA2                        0xFFC02A54 /* Transmit Abort Acknowledge reg 2 */
-#define CAN_RMP2                       0xFFC02A58 /* Receive Message Pending reg 2 */
-#define CAN_RML2                       0xFFC02A5C /* Receive Message Lost reg 2 */
-#define CAN_MBTIF2                     0xFFC02A60 /* Mailbox Transmit Interrupt Flag reg 2 */
-#define CAN_MBRIF2                     0xFFC02A64 /* Mailbox Receive  Interrupt Flag reg 2 */
-#define CAN_MBIM2                      0xFFC02A68 /* Mailbox Interrupt Mask reg 2 */
-#define CAN_RFH2                       0xFFC02A6C /* Remote Frame Handling reg 2 */
-#define CAN_OPSS2                      0xFFC02A70 /* Overwrite Protection Single Shot Xmission reg 2 */
-#define CAN_CLOCK                      0xFFC02A80 /* Bit Timing Configuration register 0 */
-#define CAN_TIMING                     0xFFC02A84 /* Bit Timing Configuration register 1 */
-#define CAN_DEBUG                      0xFFC02A88 /* Config register */
-#define CAN_STATUS                     0xFFC02A8C /* Global Status Register */
-#define CAN_CEC                        0xFFC02A90 /* Error Counter Register */
-#define CAN_GIS                        0xFFC02A94 /* Global Interrupt Status Register */
-#define CAN_GIM                        0xFFC02A98 /* Global Interrupt Mask Register */
-#define CAN_GIF                        0xFFC02A9C /* Global Interrupt Flag Register */
-#define CAN_CONTROL                    0xFFC02AA0 /* Master Control Register */
-#define CAN_INTR                       0xFFC02AA4 /* Interrupt Pending Register */
-#define CAN_VERSION                    0xFFC02AA8 /* Version Code Register */
-#define CAN_MBTD                       0xFFC02AAC /* Mailbox Temporary Disable Feature */
-#define CAN_EWR                        0xFFC02AB0 /* Programmable Warning Level */
-#define CAN_ESR                        0xFFC02AB4 /* Error Status Register */
-#define CAN_UCREG                      0xFFC02AC0 /* Universal Counter Register/Capture Register */
-#define CAN_UCCNT                      0xFFC02AC4 /* Universal Counter */
-#define CAN_UCRC                       0xFFC02AC8 /* Universal Counter Force Reload Register */
-#define CAN_UCCNF                      0xFFC02ACC /* Universal Counter Configuration Register */
-#define CAN_VERSION2                   0xFFC02AD4 /* Version Code Register 2 */
-#define CAN_AM00L                      0xFFC02B00 /* Mailbox 0 Low Acceptance Mask */
-#define CAN_AM00H                      0xFFC02B04 /* Mailbox 0 High Acceptance Mask */
-#define CAN_AM01L                      0xFFC02B08 /* Mailbox 1 Low Acceptance Mask  */
-#define CAN_AM01H                      0xFFC02B0C /* Mailbox 1 High Acceptance Mask */
-#define CAN_AM02L                      0xFFC02B10 /* Mailbox 2 Low Acceptance Mask  */
-#define CAN_AM02H                      0xFFC02B14 /* Mailbox 2 High Acceptance Mask */
-#define CAN_AM03L                      0xFFC02B18 /* Mailbox 3 Low Acceptance Mask  */
-#define CAN_AM03H                      0xFFC02B1C /* Mailbox 3 High Acceptance Mask */
-#define CAN_AM04L                      0xFFC02B20 /* Mailbox 4 Low Acceptance Mask  */
-#define CAN_AM04H                      0xFFC02B24 /* Mailbox 4 High Acceptance Mask */
-#define CAN_AM05L                      0xFFC02B28 /* Mailbox 5 Low Acceptance Mask  */
-#define CAN_AM05H                      0xFFC02B2C /* Mailbox 5 High Acceptance Mask */
-#define CAN_AM06L                      0xFFC02B30 /* Mailbox 6 Low Acceptance Mask  */
-#define CAN_AM06H                      0xFFC02B34 /* Mailbox 6 High Acceptance Mask */
-#define CAN_AM07L                      0xFFC02B38 /* Mailbox 7 Low Acceptance Mask  */
-#define CAN_AM07H                      0xFFC02B3C /* Mailbox 7 High Acceptance Mask */
-#define CAN_AM08L                      0xFFC02B40 /* Mailbox 8 Low Acceptance Mask  */
-#define CAN_AM08H                      0xFFC02B44 /* Mailbox 8 High Acceptance Mask */
-#define CAN_AM09L                      0xFFC02B48 /* Mailbox 9 Low Acceptance Mask  */
-#define CAN_AM09H                      0xFFC02B4C /* Mailbox 9 High Acceptance Mask */
-#define CAN_AM10L                      0xFFC02B50 /* Mailbox 10 Low Acceptance Mask  */
-#define CAN_AM10H                      0xFFC02B54 /* Mailbox 10 High Acceptance Mask */
-#define CAN_AM11L                      0xFFC02B58 /* Mailbox 11 Low Acceptance Mask  */
-#define CAN_AM11H                      0xFFC02B5C /* Mailbox 11 High Acceptance Mask */
-#define CAN_AM12L                      0xFFC02B60 /* Mailbox 12 Low Acceptance Mask  */
-#define CAN_AM12H                      0xFFC02B64 /* Mailbox 12 High Acceptance Mask */
-#define CAN_AM13L                      0xFFC02B68 /* Mailbox 13 Low Acceptance Mask  */
-#define CAN_AM13H                      0xFFC02B6C /* Mailbox 13 High Acceptance Mask */
-#define CAN_AM14L                      0xFFC02B70 /* Mailbox 14 Low Acceptance Mask  */
-#define CAN_AM14H                      0xFFC02B74 /* Mailbox 14 High Acceptance Mask */
-#define CAN_AM15L                      0xFFC02B78 /* Mailbox 15 Low Acceptance Mask  */
-#define CAN_AM15H                      0xFFC02B7C /* Mailbox 15 High Acceptance Mask */
-#define CAN_AM16L                      0xFFC02B80 /* Mailbox 16 Low Acceptance Mask  */
-#define CAN_AM16H                      0xFFC02B84 /* Mailbox 16 High Acceptance Mask */
-#define CAN_AM17L                      0xFFC02B88 /* Mailbox 17 Low Acceptance Mask  */
-#define CAN_AM17H                      0xFFC02B8C /* Mailbox 17 High Acceptance Mask */
-#define CAN_AM18L                      0xFFC02B90 /* Mailbox 18 Low Acceptance Mask  */
-#define CAN_AM18H                      0xFFC02B94 /* Mailbox 18 High Acceptance Mask */
-#define CAN_AM19L                      0xFFC02B98 /* Mailbox 19 Low Acceptance Mask  */
-#define CAN_AM19H                      0xFFC02B9C /* Mailbox 19 High Acceptance Mask */
-#define CAN_AM20L                      0xFFC02BA0 /* Mailbox 20 Low Acceptance Mask  */
-#define CAN_AM20H                      0xFFC02BA4 /* Mailbox 20 High Acceptance Mask */
-#define CAN_AM21L                      0xFFC02BA8 /* Mailbox 21 Low Acceptance Mask  */
-#define CAN_AM21H                      0xFFC02BAC /* Mailbox 21 High Acceptance Mask */
-#define CAN_AM22L                      0xFFC02BB0 /* Mailbox 22 Low Acceptance Mask  */
-#define CAN_AM22H                      0xFFC02BB4 /* Mailbox 22 High Acceptance Mask */
-#define CAN_AM23L                      0xFFC02BB8 /* Mailbox 23 Low Acceptance Mask  */
-#define CAN_AM23H                      0xFFC02BBC /* Mailbox 23 High Acceptance Mask */
-#define CAN_AM24L                      0xFFC02BC0 /* Mailbox 24 Low Acceptance Mask  */
-#define CAN_AM24H                      0xFFC02BC4 /* Mailbox 24 High Acceptance Mask */
-#define CAN_AM25L                      0xFFC02BC8 /* Mailbox 25 Low Acceptance Mask  */
-#define CAN_AM25H                      0xFFC02BCC /* Mailbox 25 High Acceptance Mask */
-#define CAN_AM26L                      0xFFC02BD0 /* Mailbox 26 Low Acceptance Mask  */
-#define CAN_AM26H                      0xFFC02BD4 /* Mailbox 26 High Acceptance Mask */
-#define CAN_AM27L                      0xFFC02BD8 /* Mailbox 27 Low Acceptance Mask  */
-#define CAN_AM27H                      0xFFC02BDC /* Mailbox 27 High Acceptance Mask */
-#define CAN_AM28L                      0xFFC02BE0 /* Mailbox 28 Low Acceptance Mask  */
-#define CAN_AM28H                      0xFFC02BE4 /* Mailbox 28 High Acceptance Mask */
-#define CAN_AM29L                      0xFFC02BE8 /* Mailbox 29 Low Acceptance Mask  */
-#define CAN_AM29H                      0xFFC02BEC /* Mailbox 29 High Acceptance Mask */
-#define CAN_AM30L                      0xFFC02BF0 /* Mailbox 30 Low Acceptance Mask  */
-#define CAN_AM30H                      0xFFC02BF4 /* Mailbox 30 High Acceptance Mask */
-#define CAN_AM31L                      0xFFC02BF8 /* Mailbox 31 Low Acceptance Mask  */
-#define CAN_AM31H                      0xFFC02BFC /* Mailbox 31 High Acceptance Mask */
-#define CAN_MB00_DATA0                 0xFFC02C00 /* Mailbox 0 Data Word 0 [15:0] Register */
-#define CAN_MB00_DATA1                 0xFFC02C04 /* Mailbox 0 Data Word 1 [31:16] Register */
-#define CAN_MB00_DATA2                 0xFFC02C08 /* Mailbox 0 Data Word 2 [47:32] Register */
-#define CAN_MB00_DATA3                 0xFFC02C0C /* Mailbox 0 Data Word 3 [63:48] Register */
-#define CAN_MB00_LENGTH                0xFFC02C10 /* Mailbox 0 Data Length Code Register */
-#define CAN_MB00_TIMESTAMP             0xFFC02C14 /* Mailbox 0 Time Stamp Value Register */
-#define CAN_MB00_ID0                   0xFFC02C18 /* Mailbox 0 Identifier Low Register */
-#define CAN_MB00_ID1                   0xFFC02C1C /* Mailbox 0 Identifier High Register */
-#define CAN_MB01_DATA0                 0xFFC02C20 /* Mailbox 1 Data Word 0 [15:0] Register  */
-#define CAN_MB01_DATA1                 0xFFC02C24 /* Mailbox 1 Data Word 1 [31:16] Register */
-#define CAN_MB01_DATA2                 0xFFC02C28 /* Mailbox 1 Data Word 2 [47:32] Register */
-#define CAN_MB01_DATA3                 0xFFC02C2C /* Mailbox 1 Data Word 3 [63:48] Register */
-#define CAN_MB01_LENGTH                0xFFC02C30 /* Mailbox 1 Data Length Code Register */
-#define CAN_MB01_TIMESTAMP             0xFFC02C34 /* Mailbox 1 Time Stamp Value Register */
-#define CAN_MB01_ID0                   0xFFC02C38 /* Mailbox 1 Identifier Low Register */
-#define CAN_MB01_ID1                   0xFFC02C3C /* Mailbox 1 Identifier High Register */
-#define CAN_MB02_DATA0                 0xFFC02C40 /* Mailbox 2 Data Word 0 [15:0] Register  */
-#define CAN_MB02_DATA1                 0xFFC02C44 /* Mailbox 2 Data Word 1 [31:16] Register */
-#define CAN_MB02_DATA2                 0xFFC02C48 /* Mailbox 2 Data Word 2 [47:32] Register */
-#define CAN_MB02_DATA3                 0xFFC02C4C /* Mailbox 2 Data Word 3 [63:48] Register */
-#define CAN_MB02_LENGTH                0xFFC02C50 /* Mailbox 2 Data Length Code Register    */
-#define CAN_MB02_TIMESTAMP             0xFFC02C54 /* Mailbox 2 Time Stamp Value Register */
-#define CAN_MB02_ID0                   0xFFC02C58 /* Mailbox 2 Identifier Low Register */
-#define CAN_MB02_ID1                   0xFFC02C5C /* Mailbox 2 Identifier High Register */
-#define CAN_MB03_DATA0                 0xFFC02C60 /* Mailbox 3 Data Word 0 [15:0] Register  */
-#define CAN_MB03_DATA1                 0xFFC02C64 /* Mailbox 3 Data Word 1 [31:16] Register */
-#define CAN_MB03_DATA2                 0xFFC02C68 /* Mailbox 3 Data Word 2 [47:32] Register */
-#define CAN_MB03_DATA3                 0xFFC02C6C /* Mailbox 3 Data Word 3 [63:48] Register */
-#define CAN_MB03_LENGTH                0xFFC02C70 /* Mailbox 3 Data Length Code Register */
-#define CAN_MB03_TIMESTAMP             0xFFC02C74 /* Mailbox 3 Time Stamp Value Register */
-#define CAN_MB03_ID0                   0xFFC02C78 /* Mailbox 3 Identifier Low Register */
-#define CAN_MB03_ID1                   0xFFC02C7C /* Mailbox 3 Identifier High Register */
-#define CAN_MB04_DATA0                 0xFFC02C80 /* Mailbox 4 Data Word 0 [15:0] Register */
-#define CAN_MB04_DATA1                 0xFFC02C84 /* Mailbox 4 Data Word 1 [31:16] Register */
-#define CAN_MB04_DATA2                 0xFFC02C88 /* Mailbox 4 Data Word 2 [47:32] Register */
-#define CAN_MB04_DATA3                 0xFFC02C8C /* Mailbox 4 Data Word 3 [63:48] Register */
-#define CAN_MB04_LENGTH                0xFFC02C90 /* Mailbox 4 Data Length Code Register */
-#define CAN_MB04_TIMESTAMP             0xFFC02C94 /* Mailbox 4 Time Stamp Value Register */
-#define CAN_MB04_ID0                   0xFFC02C98 /* Mailbox 4 Identifier Low Register */
-#define CAN_MB04_ID1                   0xFFC02C9C /* Mailbox 4 Identifier High Register */
-#define CAN_MB05_DATA0                 0xFFC02CA0 /* Mailbox 5 Data Word 0 [15:0] Register  */
-#define CAN_MB05_DATA1                 0xFFC02CA4 /* Mailbox 5 Data Word 1 [31:16] Register */
-#define CAN_MB05_DATA2                 0xFFC02CA8 /* Mailbox 5 Data Word 2 [47:32] Register */
-#define CAN_MB05_DATA3                 0xFFC02CAC /* Mailbox 5 Data Word 3 [63:48] Register */
-#define CAN_MB05_LENGTH                0xFFC02CB0 /* Mailbox 5 Data Length Code Register */
-#define CAN_MB05_TIMESTAMP             0xFFC02CB4 /* Mailbox 5 Time Stamp Value Register */
-#define CAN_MB05_ID0                   0xFFC02CB8 /* Mailbox 5 Identifier Low Register */
-#define CAN_MB05_ID1                   0xFFC02CBC /* Mailbox 5 Identifier High Register */
-#define CAN_MB06_DATA0                 0xFFC02CC0 /* Mailbox 6 Data Word 0 [15:0] Register  */
-#define CAN_MB06_DATA1                 0xFFC02CC4 /* Mailbox 6 Data Word 1 [31:16] Register */
-#define CAN_MB06_DATA2                 0xFFC02CC8 /* Mailbox 6 Data Word 2 [47:32] Register */
-#define CAN_MB06_DATA3                 0xFFC02CCC /* Mailbox 6 Data Word 3 [63:48] Register */
-#define CAN_MB06_LENGTH                0xFFC02CD0 /* Mailbox 6 Data Length Code Register */
-#define CAN_MB06_TIMESTAMP             0xFFC02CD4 /* Mailbox 6 Time Stamp Value Register */
-#define CAN_MB06_ID0                   0xFFC02CD8 /* Mailbox 6 Identifier Low Register */
-#define CAN_MB06_ID1                   0xFFC02CDC /* Mailbox 6 Identifier High Register */
-#define CAN_MB07_DATA0                 0xFFC02CE0 /* Mailbox 7 Data Word 0 [15:0] Register */
-#define CAN_MB07_DATA1                 0xFFC02CE4 /* Mailbox 7 Data Word 1 [31:16] Register */
-#define CAN_MB07_DATA2                 0xFFC02CE8 /* Mailbox 7 Data Word 2 [47:32] Register */
-#define CAN_MB07_DATA3                 0xFFC02CEC /* Mailbox 7 Data Word 3 [63:48] Register */
-#define CAN_MB07_LENGTH                0xFFC02CF0 /* Mailbox 7 Data Length Code Register */
-#define CAN_MB07_TIMESTAMP             0xFFC02CF4 /* Mailbox 7 Time Stamp Value Register */
-#define CAN_MB07_ID0                   0xFFC02CF8 /* Mailbox 7 Identifier Low Register */
-#define CAN_MB07_ID1                   0xFFC02CFC /* Mailbox 7 Identifier High Register */
-#define CAN_MB08_DATA0                 0xFFC02D00 /* Mailbox 8 Data Word 0 [15:0] Register */
-#define CAN_MB08_DATA1                 0xFFC02D04 /* Mailbox 8 Data Word 1 [31:16] Register */
-#define CAN_MB08_DATA2                 0xFFC02D08 /* Mailbox 8 Data Word 2 [47:32] Register */
-#define CAN_MB08_DATA3                 0xFFC02D0C /* Mailbox 8 Data Word 3 [63:48] Register */
-#define CAN_MB08_LENGTH                0xFFC02D10 /* Mailbox 8 Data Length Code Register */
-#define CAN_MB08_TIMESTAMP             0xFFC02D14 /* Mailbox 8 Time Stamp Value Register */
-#define CAN_MB08_ID0                   0xFFC02D18 /* Mailbox 8 Identifier Low Register */
-#define CAN_MB08_ID1                   0xFFC02D1C /* Mailbox 8 Identifier High Register */
-#define CAN_MB09_DATA0                 0xFFC02D20 /* Mailbox 9 Data Word 0 [15:0] Register */
-#define CAN_MB09_DATA1                 0xFFC02D24 /* Mailbox 9 Data Word 1 [31:16] Register */
-#define CAN_MB09_DATA2                 0xFFC02D28 /* Mailbox 9 Data Word 2 [47:32] Register */
-#define CAN_MB09_DATA3                 0xFFC02D2C /* Mailbox 9 Data Word 3 [63:48] Register */
-#define CAN_MB09_LENGTH                0xFFC02D30 /* Mailbox 9 Data Length Code Register */
-#define CAN_MB09_TIMESTAMP             0xFFC02D34 /* Mailbox 9 Time Stamp Value Register */
-#define CAN_MB09_ID0                   0xFFC02D38 /* Mailbox 9 Identifier Low Register */
-#define CAN_MB09_ID1                   0xFFC02D3C /* Mailbox 9 Identifier High Register */
-#define CAN_MB10_DATA0                 0xFFC02D40 /* Mailbox 10 Data Word 0 [15:0] Register */
-#define CAN_MB10_DATA1                 0xFFC02D44 /* Mailbox 10 Data Word 1 [31:16] Register */
-#define CAN_MB10_DATA2                 0xFFC02D48 /* Mailbox 10 Data Word 2 [47:32] Register */
-#define CAN_MB10_DATA3                 0xFFC02D4C /* Mailbox 10 Data Word 3 [63:48] Register */
-#define CAN_MB10_LENGTH                0xFFC02D50 /* Mailbox 10 Data Length Code Register */
-#define CAN_MB10_TIMESTAMP             0xFFC02D54 /* Mailbox 10 Time Stamp Value Register */
-#define CAN_MB10_ID0                   0xFFC02D58 /* Mailbox 10 Identifier Low Register */
-#define CAN_MB10_ID1                   0xFFC02D5C /* Mailbox 10 Identifier High Register */
-#define CAN_MB11_DATA0                 0xFFC02D60 /* Mailbox 11 Data Word 0 [15:0] Register */
-#define CAN_MB11_DATA1                 0xFFC02D64 /* Mailbox 11 Data Word 1 [31:16] Register */
-#define CAN_MB11_DATA2                 0xFFC02D68 /* Mailbox 11 Data Word 2 [47:32] Register */
-#define CAN_MB11_DATA3                 0xFFC02D6C /* Mailbox 11 Data Word 3 [63:48] Register */
-#define CAN_MB11_LENGTH                0xFFC02D70 /* Mailbox 11 Data Length Code Register */
-#define CAN_MB11_TIMESTAMP             0xFFC02D74 /* Mailbox 11 Time Stamp Value Register */
-#define CAN_MB11_ID0                   0xFFC02D78 /* Mailbox 11 Identifier Low Register */
-#define CAN_MB11_ID1                   0xFFC02D7C /* Mailbox 11 Identifier High Register */
-#define CAN_MB12_DATA0                 0xFFC02D80 /* Mailbox 12 Data Word 0 [15:0] Register */
-#define CAN_MB12_DATA1                 0xFFC02D84 /* Mailbox 12 Data Word 1 [31:16] Register */
-#define CAN_MB12_DATA2                 0xFFC02D88 /* Mailbox 12 Data Word 2 [47:32] Register */
-#define CAN_MB12_DATA3                 0xFFC02D8C /* Mailbox 12 Data Word 3 [63:48] Register */
-#define CAN_MB12_LENGTH                0xFFC02D90 /* Mailbox 12 Data Length Code Register */
-#define CAN_MB12_TIMESTAMP             0xFFC02D94 /* Mailbox 12 Time Stamp Value Register */
-#define CAN_MB12_ID0                   0xFFC02D98 /* Mailbox 12 Identifier Low Register */
-#define CAN_MB12_ID1                   0xFFC02D9C /* Mailbox 12 Identifier High Register */
-#define CAN_MB13_DATA0                 0xFFC02DA0 /* Mailbox 13 Data Word 0 [15:0] Register */
-#define CAN_MB13_DATA1                 0xFFC02DA4 /* Mailbox 13 Data Word 1 [31:16] Register */
-#define CAN_MB13_DATA2                 0xFFC02DA8 /* Mailbox 13 Data Word 2 [47:32] Register */
-#define CAN_MB13_DATA3                 0xFFC02DAC /* Mailbox 13 Data Word 3 [63:48] Register */
-#define CAN_MB13_LENGTH                0xFFC02DB0 /* Mailbox 13 Data Length Code Register */
-#define CAN_MB13_TIMESTAMP             0xFFC02DB4 /* Mailbox 13 Time Stamp Value Register */
-#define CAN_MB13_ID0                   0xFFC02DB8 /* Mailbox 13 Identifier Low Register */
-#define CAN_MB13_ID1                   0xFFC02DBC /* Mailbox 13 Identifier High Register */
-#define CAN_MB14_DATA0                 0xFFC02DC0 /* Mailbox 14 Data Word 0 [15:0] Register */
-#define CAN_MB14_DATA1                 0xFFC02DC4 /* Mailbox 14 Data Word 1 [31:16] Register */
-#define CAN_MB14_DATA2                 0xFFC02DC8 /* Mailbox 14 Data Word 2 [47:32] Register */
-#define CAN_MB14_DATA3                 0xFFC02DCC /* Mailbox 14 Data Word 3 [63:48] Register */
-#define CAN_MB14_LENGTH                0xFFC02DD0 /* Mailbox 14 Data Length Code Register */
-#define CAN_MB14_TIMESTAMP             0xFFC02DD4 /* Mailbox 14 Time Stamp Value Register */
-#define CAN_MB14_ID0                   0xFFC02DD8 /* Mailbox 14 Identifier Low Register */
-#define CAN_MB14_ID1                   0xFFC02DDC /* Mailbox 14 Identifier High Register */
-#define CAN_MB15_DATA0                 0xFFC02DE0 /* Mailbox 15 Data Word 0 [15:0] Register */
-#define CAN_MB15_DATA1                 0xFFC02DE4 /* Mailbox 15 Data Word 1 [31:16] Register */
-#define CAN_MB15_DATA2                 0xFFC02DE8 /* Mailbox 15 Data Word 2 [47:32] Register */
-#define CAN_MB15_DATA3                 0xFFC02DEC /* Mailbox 15 Data Word 3 [63:48] Register */
-#define CAN_MB15_LENGTH                0xFFC02DF0 /* Mailbox 15 Data Length Code Register */
-#define CAN_MB15_TIMESTAMP             0xFFC02DF4 /* Mailbox 15 Time Stamp Value Register */
-#define CAN_MB15_ID0                   0xFFC02DF8 /* Mailbox 15 Identifier Low Register */
-#define CAN_MB15_ID1                   0xFFC02DFC /* Mailbox 15 Identifier High Register */
-#define CAN_MB16_DATA0                 0xFFC02E00 /* Mailbox 16 Data Word 0 [15:0] Register */
-#define CAN_MB16_DATA1                 0xFFC02E04 /* Mailbox 16 Data Word 1 [31:16] Register */
-#define CAN_MB16_DATA2                 0xFFC02E08 /* Mailbox 16 Data Word 2 [47:32] Register */
-#define CAN_MB16_DATA3                 0xFFC02E0C /* Mailbox 16 Data Word 3 [63:48] Register */
-#define CAN_MB16_LENGTH                0xFFC02E10 /* Mailbox 16 Data Length Code Register */
-#define CAN_MB16_TIMESTAMP             0xFFC02E14 /* Mailbox 16 Time Stamp Value Register */
-#define CAN_MB16_ID0                   0xFFC02E18 /* Mailbox 16 Identifier Low Register */
-#define CAN_MB16_ID1                   0xFFC02E1C /* Mailbox 16 Identifier High Register */
-#define CAN_MB17_DATA0                 0xFFC02E20 /* Mailbox 17 Data Word 0 [15:0] Register */
-#define CAN_MB17_DATA1                 0xFFC02E24 /* Mailbox 17 Data Word 1 [31:16] Register */
-#define CAN_MB17_DATA2                 0xFFC02E28 /* Mailbox 17 Data Word 2 [47:32] Register */
-#define CAN_MB17_DATA3                 0xFFC02E2C /* Mailbox 17 Data Word 3 [63:48] Register */
-#define CAN_MB17_LENGTH                0xFFC02E30 /* Mailbox 17 Data Length Code Register */
-#define CAN_MB17_TIMESTAMP             0xFFC02E34 /* Mailbox 17 Time Stamp Value Register */
-#define CAN_MB17_ID0                   0xFFC02E38 /* Mailbox 17 Identifier Low Register */
-#define CAN_MB17_ID1                   0xFFC02E3C /* Mailbox 17 Identifier High Register */
-#define CAN_MB18_DATA0                 0xFFC02E40 /* Mailbox 18 Data Word 0 [15:0] Register */
-#define CAN_MB18_DATA1                 0xFFC02E44 /* Mailbox 18 Data Word 1 [31:16] Register */
-#define CAN_MB18_DATA2                 0xFFC02E48 /* Mailbox 18 Data Word 2 [47:32] Register */
-#define CAN_MB18_DATA3                 0xFFC02E4C /* Mailbox 18 Data Word 3 [63:48] Register */
-#define CAN_MB18_LENGTH                0xFFC02E50 /* Mailbox 18 Data Length Code Register */
-#define CAN_MB18_TIMESTAMP             0xFFC02E54 /* Mailbox 18 Time Stamp Value Register */
-#define CAN_MB18_ID0                   0xFFC02E58 /* Mailbox 18 Identifier Low Register */
-#define CAN_MB18_ID1                   0xFFC02E5C /* Mailbox 18 Identifier High Register */
-#define CAN_MB19_DATA0                 0xFFC02E60 /* Mailbox 19 Data Word 0 [15:0] Register */
-#define CAN_MB19_DATA1                 0xFFC02E64 /* Mailbox 19 Data Word 1 [31:16] Register */
-#define CAN_MB19_DATA2                 0xFFC02E68 /* Mailbox 19 Data Word 2 [47:32] Register */
-#define CAN_MB19_DATA3                 0xFFC02E6C /* Mailbox 19 Data Word 3 [63:48] Register */
-#define CAN_MB19_LENGTH                0xFFC02E70 /* Mailbox 19 Data Length Code Register */
-#define CAN_MB19_TIMESTAMP             0xFFC02E74 /* Mailbox 19 Time Stamp Value Register */
-#define CAN_MB19_ID0                   0xFFC02E78 /* Mailbox 19 Identifier Low Register */
-#define CAN_MB19_ID1                   0xFFC02E7C /* Mailbox 19 Identifier High Register */
-#define CAN_MB20_DATA0                 0xFFC02E80 /* Mailbox 20 Data Word 0 [15:0] Register */
-#define CAN_MB20_DATA1                 0xFFC02E84 /* Mailbox 20 Data Word 1 [31:16] Register */
-#define CAN_MB20_DATA2                 0xFFC02E88 /* Mailbox 20 Data Word 2 [47:32] Register */
-#define CAN_MB20_DATA3                 0xFFC02E8C /* Mailbox 20 Data Word 3 [63:48] Register */
-#define CAN_MB20_LENGTH                0xFFC02E90 /* Mailbox 20 Data Length Code Register */
-#define CAN_MB20_TIMESTAMP             0xFFC02E94 /* Mailbox 20 Time Stamp Value Register */
-#define CAN_MB20_ID0                   0xFFC02E98 /* Mailbox 20 Identifier Low Register */
-#define CAN_MB20_ID1                   0xFFC02E9C /* Mailbox 20 Identifier High Register */
-#define CAN_MB21_DATA0                 0xFFC02EA0 /* Mailbox 21 Data Word 0 [15:0] Register */
-#define CAN_MB21_DATA1                 0xFFC02EA4 /* Mailbox 21 Data Word 1 [31:16] Register */
-#define CAN_MB21_DATA2                 0xFFC02EA8 /* Mailbox 21 Data Word 2 [47:32] Register */
-#define CAN_MB21_DATA3                 0xFFC02EAC /* Mailbox 21 Data Word 3 [63:48] Register */
-#define CAN_MB21_LENGTH                0xFFC02EB0 /* Mailbox 21 Data Length Code Register */
-#define CAN_MB21_TIMESTAMP             0xFFC02EB4 /* Mailbox 21 Time Stamp Value Register */
-#define CAN_MB21_ID0                   0xFFC02EB8 /* Mailbox 21 Identifier Low Register */
-#define CAN_MB21_ID1                   0xFFC02EBC /* Mailbox 21 Identifier High Register */
-#define CAN_MB22_DATA0                 0xFFC02EC0 /* Mailbox 22 Data Word 0 [15:0] Register */
-#define CAN_MB22_DATA1                 0xFFC02EC4 /* Mailbox 22 Data Word 1 [31:16] Register */
-#define CAN_MB22_DATA2                 0xFFC02EC8 /* Mailbox 22 Data Word 2 [47:32] Register */
-#define CAN_MB22_DATA3                 0xFFC02ECC /* Mailbox 22 Data Word 3 [63:48] Register */
-#define CAN_MB22_LENGTH                0xFFC02ED0 /* Mailbox 22 Data Length Code Register */
-#define CAN_MB22_TIMESTAMP             0xFFC02ED4 /* Mailbox 22 Time Stamp Value Register */
-#define CAN_MB22_ID0                   0xFFC02ED8 /* Mailbox 22 Identifier Low Register */
-#define CAN_MB22_ID1                   0xFFC02EDC /* Mailbox 22 Identifier High Register */
-#define CAN_MB23_DATA0                 0xFFC02EE0 /* Mailbox 23 Data Word 0 [15:0] Register */
-#define CAN_MB23_DATA1                 0xFFC02EE4 /* Mailbox 23 Data Word 1 [31:16] Register */
-#define CAN_MB23_DATA2                 0xFFC02EE8 /* Mailbox 23 Data Word 2 [47:32] Register */
-#define CAN_MB23_DATA3                 0xFFC02EEC /* Mailbox 23 Data Word 3 [63:48] Register */
-#define CAN_MB23_LENGTH                0xFFC02EF0 /* Mailbox 23 Data Length Code Register */
-#define CAN_MB23_TIMESTAMP             0xFFC02EF4 /* Mailbox 23 Time Stamp Value Register */
-#define CAN_MB23_ID0                   0xFFC02EF8 /* Mailbox 23 Identifier Low Register */
-#define CAN_MB23_ID1                   0xFFC02EFC /* Mailbox 23 Identifier High Register */
-#define CAN_MB24_DATA0                 0xFFC02F00 /* Mailbox 24 Data Word 0 [15:0] Register */
-#define CAN_MB24_DATA1                 0xFFC02F04 /* Mailbox 24 Data Word 1 [31:16] Register */
-#define CAN_MB24_DATA2                 0xFFC02F08 /* Mailbox 24 Data Word 2 [47:32] Register */
-#define CAN_MB24_DATA3                 0xFFC02F0C /* Mailbox 24 Data Word 3 [63:48] Register */
-#define CAN_MB24_LENGTH                0xFFC02F10 /* Mailbox 24 Data Length Code Register */
-#define CAN_MB24_TIMESTAMP             0xFFC02F14 /* Mailbox 24 Time Stamp Value Register */
-#define CAN_MB24_ID0                   0xFFC02F18 /* Mailbox 24 Identifier Low Register */
-#define CAN_MB24_ID1                   0xFFC02F1C /* Mailbox 24 Identifier High Register */
-#define CAN_MB25_DATA0                 0xFFC02F20 /* Mailbox 25 Data Word 0 [15:0] Register */
-#define CAN_MB25_DATA1                 0xFFC02F24 /* Mailbox 25 Data Word 1 [31:16] Register */
-#define CAN_MB25_DATA2                 0xFFC02F28 /* Mailbox 25 Data Word 2 [47:32] Register */
-#define CAN_MB25_DATA3                 0xFFC02F2C /* Mailbox 25 Data Word 3 [63:48] Register */
-#define CAN_MB25_LENGTH                0xFFC02F30 /* Mailbox 25 Data Length Code Register */
-#define CAN_MB25_TIMESTAMP             0xFFC02F34 /* Mailbox 25 Time Stamp Value Register */
-#define CAN_MB25_ID0                   0xFFC02F38 /* Mailbox 25 Identifier Low Register */
-#define CAN_MB25_ID1                   0xFFC02F3C /* Mailbox 25 Identifier High Register */
-#define CAN_MB26_DATA0                 0xFFC02F40 /* Mailbox 26 Data Word 0 [15:0] Register */
-#define CAN_MB26_DATA1                 0xFFC02F44 /* Mailbox 26 Data Word 1 [31:16] Register */
-#define CAN_MB26_DATA2                 0xFFC02F48 /* Mailbox 26 Data Word 2 [47:32] Register */
-#define CAN_MB26_DATA3                 0xFFC02F4C /* Mailbox 26 Data Word 3 [63:48] Register */
-#define CAN_MB26_LENGTH                0xFFC02F50 /* Mailbox 26 Data Length Code Register */
-#define CAN_MB26_TIMESTAMP             0xFFC02F54 /* Mailbox 26 Time Stamp Value Register */
-#define CAN_MB26_ID0                   0xFFC02F58 /* Mailbox 26 Identifier Low Register */
-#define CAN_MB26_ID1                   0xFFC02F5C /* Mailbox 26 Identifier High Register */
-#define CAN_MB27_DATA0                 0xFFC02F60 /* Mailbox 27 Data Word 0 [15:0] Register */
-#define CAN_MB27_DATA1                 0xFFC02F64 /* Mailbox 27 Data Word 1 [31:16] Register */
-#define CAN_MB27_DATA2                 0xFFC02F68 /* Mailbox 27 Data Word 2 [47:32] Register */
-#define CAN_MB27_DATA3                 0xFFC02F6C /* Mailbox 27 Data Word 3 [63:48] Register */
-#define CAN_MB27_LENGTH                0xFFC02F70 /* Mailbox 27 Data Length Code Register */
-#define CAN_MB27_TIMESTAMP             0xFFC02F74 /* Mailbox 27 Time Stamp Value Register */
-#define CAN_MB27_ID0                   0xFFC02F78 /* Mailbox 27 Identifier Low Register */
-#define CAN_MB27_ID1                   0xFFC02F7C /* Mailbox 27 Identifier High Register */
-#define CAN_MB28_DATA0                 0xFFC02F80 /* Mailbox 28 Data Word 0 [15:0] Register */
-#define CAN_MB28_DATA1                 0xFFC02F84 /* Mailbox 28 Data Word 1 [31:16] Register */
-#define CAN_MB28_DATA2                 0xFFC02F88 /* Mailbox 28 Data Word 2 [47:32] Register */
-#define CAN_MB28_DATA3                 0xFFC02F8C /* Mailbox 28 Data Word 3 [63:48] Register */
-#define CAN_MB28_LENGTH                0xFFC02F90 /* Mailbox 28 Data Length Code Register */
-#define CAN_MB28_TIMESTAMP             0xFFC02F94 /* Mailbox 28 Time Stamp Value Register */
-#define CAN_MB28_ID0                   0xFFC02F98 /* Mailbox 28 Identifier Low Register */
-#define CAN_MB28_ID1                   0xFFC02F9C /* Mailbox 28 Identifier High Register */
-#define CAN_MB29_DATA0                 0xFFC02FA0 /* Mailbox 29 Data Word 0 [15:0] Register */
-#define CAN_MB29_DATA1                 0xFFC02FA4 /* Mailbox 29 Data Word 1 [31:16] Register */
-#define CAN_MB29_DATA2                 0xFFC02FA8 /* Mailbox 29 Data Word 2 [47:32] Register */
-#define CAN_MB29_DATA3                 0xFFC02FAC /* Mailbox 29 Data Word 3 [63:48] Register */
-#define CAN_MB29_LENGTH                0xFFC02FB0 /* Mailbox 29 Data Length Code Register */
-#define CAN_MB29_TIMESTAMP             0xFFC02FB4 /* Mailbox 29 Time Stamp Value Register */
-#define CAN_MB29_ID0                   0xFFC02FB8 /* Mailbox 29 Identifier Low Register */
-#define CAN_MB29_ID1                   0xFFC02FBC /* Mailbox 29 Identifier High Register */
-#define CAN_MB30_DATA0                 0xFFC02FC0 /* Mailbox 30 Data Word 0 [15:0] Register */
-#define CAN_MB30_DATA1                 0xFFC02FC4 /* Mailbox 30 Data Word 1 [31:16] Register */
-#define CAN_MB30_DATA2                 0xFFC02FC8 /* Mailbox 30 Data Word 2 [47:32] Register */
-#define CAN_MB30_DATA3                 0xFFC02FCC /* Mailbox 30 Data Word 3 [63:48] Register */
-#define CAN_MB30_LENGTH                0xFFC02FD0 /* Mailbox 30 Data Length Code Register */
-#define CAN_MB30_TIMESTAMP             0xFFC02FD4 /* Mailbox 30 Time Stamp Value Register */
-#define CAN_MB30_ID0                   0xFFC02FD8 /* Mailbox 30 Identifier Low Register */
-#define CAN_MB30_ID1                   0xFFC02FDC /* Mailbox 30 Identifier High Register */
-#define CAN_MB31_DATA0                 0xFFC02FE0 /* Mailbox 31 Data Word 0 [15:0] Register */
-#define CAN_MB31_DATA1                 0xFFC02FE4 /* Mailbox 31 Data Word 1 [31:16] Register */
-#define CAN_MB31_DATA2                 0xFFC02FE8 /* Mailbox 31 Data Word 2 [47:32] Register */
-#define CAN_MB31_DATA3                 0xFFC02FEC /* Mailbox 31 Data Word 3 [63:48] Register */
-#define CAN_MB31_LENGTH                0xFFC02FF0 /* Mailbox 31 Data Length Code Register */
-#define CAN_MB31_TIMESTAMP             0xFFC02FF4 /* Mailbox 31 Time Stamp Value Register */
-#define CAN_MB31_ID0                   0xFFC02FF8 /* Mailbox 31 Identifier Low Register */
-#define CAN_MB31_ID1                   0xFFC02FFC /* Mailbox 31 Identifier High Register */
-#define PORTF_FER                      0xFFC03200 /* Port F Function Enable Register (Alternate/Flag*) */
-#define PORTG_FER                      0xFFC03204 /* Port G Function Enable Register (Alternate/Flag*) */
-#define PORTH_FER                      0xFFC03208 /* Port H Function Enable Register (Alternate/Flag*) */
-#define PORT_MUX                       0xFFC0320C /* Port Multiplexer Control Register */
-#define HMDMA0_CONTROL                 0xFFC03300 /* Handshake MDMA0 Control Register */
-#define HMDMA0_ECINIT                  0xFFC03304 /* HMDMA0 Initial Edge Count Register */
-#define HMDMA0_BCINIT                  0xFFC03308 /* HMDMA0 Initial Block Count Register */
-#define HMDMA0_ECURGENT                0xFFC0330C /* HMDMA0 Urgent Edge Count Threshhold Register */
-#define HMDMA0_ECOVERFLOW              0xFFC03310 /* HMDMA0 Edge Count Overflow Interrupt Register */
-#define HMDMA0_ECOUNT                  0xFFC03314 /* HMDMA0 Current Edge Count Register */
-#define HMDMA0_BCOUNT                  0xFFC03318 /* HMDMA0 Current Block Count Register */
-#define HMDMA1_CONTROL                 0xFFC03340 /* Handshake MDMA1 Control Register */
-#define HMDMA1_ECINIT                  0xFFC03344 /* HMDMA1 Initial Edge Count Register */
-#define HMDMA1_BCINIT                  0xFFC03348 /* HMDMA1 Initial Block Count Register */
-#define HMDMA1_ECURGENT                0xFFC0334C /* HMDMA1 Urgent Edge Count Threshhold Register */
-#define HMDMA1_ECOVERFLOW              0xFFC03350 /* HMDMA1 Edge Count Overflow Interrupt Register */
-#define HMDMA1_ECOUNT                  0xFFC03354 /* HMDMA1 Current Edge Count Register */
-#define HMDMA1_BCOUNT                  0xFFC03358 /* HMDMA1 Current Block Count Register */
-#define CHIPID                         0xFFC00014
-#define DMA_TC_CNT                     0xFFC00B0C
-#define DMA_TC_PER                     0xFFC00B10
-
-#endif /* __BFIN_DEF_ADSP_EDN_BF534_extended__ */
index 27842cc9541e3012b13e13ab113e34d438b04ff4..3d9412d181e69ae0645e7a0da318db7db001a290 100644 (file)
 
 #include "../mach-common/ADSP-EDN-core_cdef.h"
 
-#include "ADSP-EDN-BF534-extended_cdef.h"
-
+#define bfin_read_PLL_CTL()            bfin_read16(PLL_CTL)
+#define bfin_write_PLL_CTL(val)        bfin_write16(PLL_CTL, val)
+#define bfin_read_PLL_DIV()            bfin_read16(PLL_DIV)
+#define bfin_write_PLL_DIV(val)        bfin_write16(PLL_DIV, val)
+#define bfin_read_VR_CTL()             bfin_read16(VR_CTL)
+#define bfin_write_VR_CTL(val)         bfin_write16(VR_CTL, val)
+#define bfin_read_PLL_STAT()           bfin_read16(PLL_STAT)
+#define bfin_write_PLL_STAT(val)       bfin_write16(PLL_STAT, val)
+#define bfin_read_PLL_LOCKCNT()        bfin_read16(PLL_LOCKCNT)
+#define bfin_write_PLL_LOCKCNT(val)    bfin_write16(PLL_LOCKCNT, val)
+#define bfin_read_SWRST()              bfin_read16(SWRST)
+#define bfin_write_SWRST(val)          bfin_write16(SWRST, val)
+#define bfin_read_SYSCR()              bfin_read16(SYSCR)
+#define bfin_write_SYSCR(val)          bfin_write16(SYSCR, val)
+#define bfin_read_SIC_RVECT()          bfin_read16(SIC_RVECT)
+#define bfin_write_SIC_RVECT(val)      bfin_write16(SIC_RVECT, val)
+#define bfin_read_SIC_IMASK()          bfin_read32(SIC_IMASK)
+#define bfin_write_SIC_IMASK(val)      bfin_write32(SIC_IMASK, val)
+#define bfin_read_SIC_IAR0()           bfin_read32(SIC_IAR0)
+#define bfin_write_SIC_IAR0(val)       bfin_write32(SIC_IAR0, val)
+#define bfin_read_SIC_IAR1()           bfin_read32(SIC_IAR1)
+#define bfin_write_SIC_IAR1(val)       bfin_write32(SIC_IAR1, val)
+#define bfin_read_SIC_IAR2()           bfin_read32(SIC_IAR2)
+#define bfin_write_SIC_IAR2(val)       bfin_write32(SIC_IAR2, val)
+#define bfin_read_SIC_IAR3()           bfin_read32(SIC_IAR3)
+#define bfin_write_SIC_IAR3(val)       bfin_write32(SIC_IAR3, val)
+#define bfin_read_SIC_ISR()            bfin_read32(SIC_ISR)
+#define bfin_write_SIC_ISR(val)        bfin_write32(SIC_ISR, val)
+#define bfin_read_SIC_IWR()            bfin_read32(SIC_IWR)
+#define bfin_write_SIC_IWR(val)        bfin_write32(SIC_IWR, val)
+#define bfin_read_WDOG_CTL()           bfin_read16(WDOG_CTL)
+#define bfin_write_WDOG_CTL(val)       bfin_write16(WDOG_CTL, val)
+#define bfin_read_WDOG_CNT()           bfin_read32(WDOG_CNT)
+#define bfin_write_WDOG_CNT(val)       bfin_write32(WDOG_CNT, val)
+#define bfin_read_WDOG_STAT()          bfin_read32(WDOG_STAT)
+#define bfin_write_WDOG_STAT(val)      bfin_write32(WDOG_STAT, val)
+#define bfin_read_RTC_STAT()           bfin_read32(RTC_STAT)
+#define bfin_write_RTC_STAT(val)       bfin_write32(RTC_STAT, val)
+#define bfin_read_RTC_ICTL()           bfin_read16(RTC_ICTL)
+#define bfin_write_RTC_ICTL(val)       bfin_write16(RTC_ICTL, val)
+#define bfin_read_RTC_ISTAT()          bfin_read16(RTC_ISTAT)
+#define bfin_write_RTC_ISTAT(val)      bfin_write16(RTC_ISTAT, val)
+#define bfin_read_RTC_SWCNT()          bfin_read16(RTC_SWCNT)
+#define bfin_write_RTC_SWCNT(val)      bfin_write16(RTC_SWCNT, val)
+#define bfin_read_RTC_ALARM()          bfin_read32(RTC_ALARM)
+#define bfin_write_RTC_ALARM(val)      bfin_write32(RTC_ALARM, val)
+#define bfin_read_RTC_PREN()           bfin_read16(RTC_PREN)
+#define bfin_write_RTC_PREN(val)       bfin_write16(RTC_PREN, val)
+#define bfin_read_UART0_THR()          bfin_read16(UART0_THR)
+#define bfin_write_UART0_THR(val)      bfin_write16(UART0_THR, val)
+#define bfin_read_UART0_RBR()          bfin_read16(UART0_RBR)
+#define bfin_write_UART0_RBR(val)      bfin_write16(UART0_RBR, val)
+#define bfin_read_UART0_DLL()          bfin_read16(UART0_DLL)
+#define bfin_write_UART0_DLL(val)      bfin_write16(UART0_DLL, val)
+#define bfin_read_UART0_IER()          bfin_read16(UART0_IER)
+#define bfin_write_UART0_IER(val)      bfin_write16(UART0_IER, val)
+#define bfin_read_UART0_DLH()          bfin_read16(UART0_DLH)
+#define bfin_write_UART0_DLH(val)      bfin_write16(UART0_DLH, val)
+#define bfin_read_UART0_IIR()          bfin_read16(UART0_IIR)
+#define bfin_write_UART0_IIR(val)      bfin_write16(UART0_IIR, val)
+#define bfin_read_UART0_LCR()          bfin_read16(UART0_LCR)
+#define bfin_write_UART0_LCR(val)      bfin_write16(UART0_LCR, val)
+#define bfin_read_UART0_MCR()          bfin_read16(UART0_MCR)
+#define bfin_write_UART0_MCR(val)      bfin_write16(UART0_MCR, val)
+#define bfin_read_UART0_LSR()          bfin_read16(UART0_LSR)
+#define bfin_write_UART0_LSR(val)      bfin_write16(UART0_LSR, val)
+#define bfin_read_UART0_MSR()          bfin_read16(UART0_MSR)
+#define bfin_write_UART0_MSR(val)      bfin_write16(UART0_MSR, val)
+#define bfin_read_UART0_SCR()          bfin_read16(UART0_SCR)
+#define bfin_write_UART0_SCR(val)      bfin_write16(UART0_SCR, val)
+#define bfin_read_UART0_GCTL()         bfin_read16(UART0_GCTL)
+#define bfin_write_UART0_GCTL(val)     bfin_write16(UART0_GCTL, val)
+#define bfin_read_SPI_CTL()            bfin_read16(SPI_CTL)
+#define bfin_write_SPI_CTL(val)        bfin_write16(SPI_CTL, val)
+#define bfin_read_SPI_FLG()            bfin_read16(SPI_FLG)
+#define bfin_write_SPI_FLG(val)        bfin_write16(SPI_FLG, val)
+#define bfin_read_SPI_STAT()           bfin_read16(SPI_STAT)
+#define bfin_write_SPI_STAT(val)       bfin_write16(SPI_STAT, val)
+#define bfin_read_SPI_TDBR()           bfin_read16(SPI_TDBR)
+#define bfin_write_SPI_TDBR(val)       bfin_write16(SPI_TDBR, val)
+#define bfin_read_SPI_RDBR()           bfin_read16(SPI_RDBR)
+#define bfin_write_SPI_RDBR(val)       bfin_write16(SPI_RDBR, val)
+#define bfin_read_SPI_BAUD()           bfin_read16(SPI_BAUD)
+#define bfin_write_SPI_BAUD(val)       bfin_write16(SPI_BAUD, val)
+#define bfin_read_SPI_SHADOW()         bfin_read16(SPI_SHADOW)
+#define bfin_write_SPI_SHADOW(val)     bfin_write16(SPI_SHADOW, val)
+#define bfin_read_TIMER0_CONFIG()      bfin_read16(TIMER0_CONFIG)
+#define bfin_write_TIMER0_CONFIG(val)  bfin_write16(TIMER0_CONFIG, val)
+#define bfin_read_TIMER0_COUNTER()     bfin_read32(TIMER0_COUNTER)
+#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
+#define bfin_read_TIMER0_PERIOD()      bfin_read32(TIMER0_PERIOD)
+#define bfin_write_TIMER0_PERIOD(val)  bfin_write32(TIMER0_PERIOD, val)
+#define bfin_read_TIMER0_WIDTH()       bfin_read32(TIMER0_WIDTH)
+#define bfin_write_TIMER0_WIDTH(val)   bfin_write32(TIMER0_WIDTH, val)
+#define bfin_read_TIMER1_CONFIG()      bfin_read16(TIMER1_CONFIG)
+#define bfin_write_TIMER1_CONFIG(val)  bfin_write16(TIMER1_CONFIG, val)
+#define bfin_read_TIMER1_COUNTER()     bfin_read32(TIMER1_COUNTER)
+#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
+#define bfin_read_TIMER1_PERIOD()      bfin_read32(TIMER1_PERIOD)
+#define bfin_write_TIMER1_PERIOD(val)  bfin_write32(TIMER1_PERIOD, val)
+#define bfin_read_TIMER1_WIDTH()       bfin_read32(TIMER1_WIDTH)
+#define bfin_write_TIMER1_WIDTH(val)   bfin_write32(TIMER1_WIDTH, val)
+#define bfin_read_TIMER2_CONFIG()      bfin_read16(TIMER2_CONFIG)
+#define bfin_write_TIMER2_CONFIG(val)  bfin_write16(TIMER2_CONFIG, val)
+#define bfin_read_TIMER2_COUNTER()     bfin_read32(TIMER2_COUNTER)
+#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
+#define bfin_read_TIMER2_PERIOD()      bfin_read32(TIMER2_PERIOD)
+#define bfin_write_TIMER2_PERIOD(val)  bfin_write32(TIMER2_PERIOD, val)
+#define bfin_read_TIMER2_WIDTH()       bfin_read32(TIMER2_WIDTH)
+#define bfin_write_TIMER2_WIDTH(val)   bfin_write32(TIMER2_WIDTH, val)
+#define bfin_read_TIMER3_CONFIG()      bfin_read16(TIMER3_CONFIG)
+#define bfin_write_TIMER3_CONFIG(val)  bfin_write16(TIMER3_CONFIG, val)
+#define bfin_read_TIMER3_COUNTER()     bfin_read32(TIMER3_COUNTER)
+#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER, val)
+#define bfin_read_TIMER3_PERIOD()      bfin_read32(TIMER3_PERIOD)
+#define bfin_write_TIMER3_PERIOD(val)  bfin_write32(TIMER3_PERIOD, val)
+#define bfin_read_TIMER3_WIDTH()       bfin_read32(TIMER3_WIDTH)
+#define bfin_write_TIMER3_WIDTH(val)   bfin_write32(TIMER3_WIDTH, val)
+#define bfin_read_TIMER4_CONFIG()      bfin_read16(TIMER4_CONFIG)
+#define bfin_write_TIMER4_CONFIG(val)  bfin_write16(TIMER4_CONFIG, val)
+#define bfin_read_TIMER4_COUNTER()     bfin_read32(TIMER4_COUNTER)
+#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER, val)
+#define bfin_read_TIMER4_PERIOD()      bfin_read32(TIMER4_PERIOD)
+#define bfin_write_TIMER4_PERIOD(val)  bfin_write32(TIMER4_PERIOD, val)
+#define bfin_read_TIMER4_WIDTH()       bfin_read32(TIMER4_WIDTH)
+#define bfin_write_TIMER4_WIDTH(val)   bfin_write32(TIMER4_WIDTH, val)
+#define bfin_read_TIMER5_CONFIG()      bfin_read16(TIMER5_CONFIG)
+#define bfin_write_TIMER5_CONFIG(val)  bfin_write16(TIMER5_CONFIG, val)
+#define bfin_read_TIMER5_COUNTER()     bfin_read32(TIMER5_COUNTER)
+#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER, val)
+#define bfin_read_TIMER5_PERIOD()      bfin_read32(TIMER5_PERIOD)
+#define bfin_write_TIMER5_PERIOD(val)  bfin_write32(TIMER5_PERIOD, val)
+#define bfin_read_TIMER5_WIDTH()       bfin_read32(TIMER5_WIDTH)
+#define bfin_write_TIMER5_WIDTH(val)   bfin_write32(TIMER5_WIDTH, val)
+#define bfin_read_TIMER6_CONFIG()      bfin_read16(TIMER6_CONFIG)
+#define bfin_write_TIMER6_CONFIG(val)  bfin_write16(TIMER6_CONFIG, val)
+#define bfin_read_TIMER6_COUNTER()     bfin_read32(TIMER6_COUNTER)
+#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER, val)
+#define bfin_read_TIMER6_PERIOD()      bfin_read32(TIMER6_PERIOD)
+#define bfin_write_TIMER6_PERIOD(val)  bfin_write32(TIMER6_PERIOD, val)
+#define bfin_read_TIMER6_WIDTH()       bfin_read32(TIMER6_WIDTH)
+#define bfin_write_TIMER6_WIDTH(val)   bfin_write32(TIMER6_WIDTH, val)
+#define bfin_read_TIMER7_CONFIG()      bfin_read16(TIMER7_CONFIG)
+#define bfin_write_TIMER7_CONFIG(val)  bfin_write16(TIMER7_CONFIG, val)
+#define bfin_read_TIMER7_COUNTER()     bfin_read32(TIMER7_COUNTER)
+#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER, val)
+#define bfin_read_TIMER7_PERIOD()      bfin_read32(TIMER7_PERIOD)
+#define bfin_write_TIMER7_PERIOD(val)  bfin_write32(TIMER7_PERIOD, val)
+#define bfin_read_TIMER7_WIDTH()       bfin_read32(TIMER7_WIDTH)
+#define bfin_write_TIMER7_WIDTH(val)   bfin_write32(TIMER7_WIDTH, val)
+#define bfin_read_TIMER_ENABLE()       bfin_read16(TIMER_ENABLE)
+#define bfin_write_TIMER_ENABLE(val)   bfin_write16(TIMER_ENABLE, val)
+#define bfin_read_TIMER_DISABLE()      bfin_read16(TIMER_DISABLE)
+#define bfin_write_TIMER_DISABLE(val)  bfin_write16(TIMER_DISABLE, val)
+#define bfin_read_TIMER_STATUS()       bfin_read32(TIMER_STATUS)
+#define bfin_write_TIMER_STATUS(val)   bfin_write32(TIMER_STATUS, val)
+#define bfin_read_PORTFIO()            bfin_read16(PORTFIO)
+#define bfin_write_PORTFIO(val)        bfin_write16(PORTFIO, val)
+#define bfin_read_PORTFIO_CLEAR()      bfin_read16(PORTFIO_CLEAR)
+#define bfin_write_PORTFIO_CLEAR(val)  bfin_write16(PORTFIO_CLEAR, val)
+#define bfin_read_PORTFIO_SET()        bfin_read16(PORTFIO_SET)
+#define bfin_write_PORTFIO_SET(val)    bfin_write16(PORTFIO_SET, val)
+#define bfin_read_PORTFIO_TOGGLE()     bfin_read16(PORTFIO_TOGGLE)
+#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE, val)
+#define bfin_read_PORTFIO_MASKA()      bfin_read16(PORTFIO_MASKA)
+#define bfin_write_PORTFIO_MASKA(val)  bfin_write16(PORTFIO_MASKA, val)
+#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
+#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR, val)
+#define bfin_read_PORTFIO_MASKA_SET()  bfin_read16(PORTFIO_MASKA_SET)
+#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET, val)
+#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
+#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE, val)
+#define bfin_read_PORTFIO_MASKB()      bfin_read16(PORTFIO_MASKB)
+#define bfin_write_PORTFIO_MASKB(val)  bfin_write16(PORTFIO_MASKB, val)
+#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
+#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR, val)
+#define bfin_read_PORTFIO_MASKB_SET()  bfin_read16(PORTFIO_MASKB_SET)
+#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET, val)
+#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
+#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE, val)
+#define bfin_read_PORTFIO_DIR()        bfin_read16(PORTFIO_DIR)
+#define bfin_write_PORTFIO_DIR(val)    bfin_write16(PORTFIO_DIR, val)
+#define bfin_read_PORTFIO_POLAR()      bfin_read16(PORTFIO_POLAR)
+#define bfin_write_PORTFIO_POLAR(val)  bfin_write16(PORTFIO_POLAR, val)
+#define bfin_read_PORTFIO_EDGE()       bfin_read16(PORTFIO_EDGE)
+#define bfin_write_PORTFIO_EDGE(val)   bfin_write16(PORTFIO_EDGE, val)
+#define bfin_read_PORTFIO_BOTH()       bfin_read16(PORTFIO_BOTH)
+#define bfin_write_PORTFIO_BOTH(val)   bfin_write16(PORTFIO_BOTH, val)
+#define bfin_read_PORTFIO_INEN()       bfin_read16(PORTFIO_INEN)
+#define bfin_write_PORTFIO_INEN(val)   bfin_write16(PORTFIO_INEN, val)
+#define bfin_read_SPORT0_TCR1()        bfin_read16(SPORT0_TCR1)
+#define bfin_write_SPORT0_TCR1(val)    bfin_write16(SPORT0_TCR1, val)
+#define bfin_read_SPORT0_TCR2()        bfin_read16(SPORT0_TCR2)
+#define bfin_write_SPORT0_TCR2(val)    bfin_write16(SPORT0_TCR2, val)
+#define bfin_read_SPORT0_TCLKDIV()     bfin_read16(SPORT0_TCLKDIV)
+#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
+#define bfin_read_SPORT0_TFSDIV()      bfin_read16(SPORT0_TFSDIV)
+#define bfin_write_SPORT0_TFSDIV(val)  bfin_write16(SPORT0_TFSDIV, val)
+#define bfin_write_SPORT0_TX(val)      bfin_write32(SPORT0_TX, val)
+#define bfin_read_SPORT0_RX()          bfin_read32(SPORT0_RX)
+#define bfin_write_SPORT0_RX(val)      bfin_write32(SPORT0_RX, val)
+#define bfin_read_SPORT0_RCR1()        bfin_read16(SPORT0_RCR1)
+#define bfin_write_SPORT0_RCR1(val)    bfin_write16(SPORT0_RCR1, val)
+#define bfin_read_SPORT0_RCR2()        bfin_read16(SPORT0_RCR2)
+#define bfin_write_SPORT0_RCR2(val)    bfin_write16(SPORT0_RCR2, val)
+#define bfin_read_SPORT0_RCLKDIV()     bfin_read16(SPORT0_RCLKDIV)
+#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
+#define bfin_read_SPORT0_RFSDIV()      bfin_read16(SPORT0_RFSDIV)
+#define bfin_write_SPORT0_RFSDIV(val)  bfin_write16(SPORT0_RFSDIV, val)
+#define bfin_read_SPORT0_STAT()        bfin_read16(SPORT0_STAT)
+#define bfin_write_SPORT0_STAT(val)    bfin_write16(SPORT0_STAT, val)
+#define bfin_read_SPORT0_CHNL()        bfin_read16(SPORT0_CHNL)
+#define bfin_write_SPORT0_CHNL(val)    bfin_write16(SPORT0_CHNL, val)
+#define bfin_read_SPORT0_MCMC1()       bfin_read16(SPORT0_MCMC1)
+#define bfin_write_SPORT0_MCMC1(val)   bfin_write16(SPORT0_MCMC1, val)
+#define bfin_read_SPORT0_MCMC2()       bfin_read16(SPORT0_MCMC2)
+#define bfin_write_SPORT0_MCMC2(val)   bfin_write16(SPORT0_MCMC2, val)
+#define bfin_read_SPORT0_MTCS0()       bfin_read32(SPORT0_MTCS0)
+#define bfin_write_SPORT0_MTCS0(val)   bfin_write32(SPORT0_MTCS0, val)
+#define bfin_read_SPORT0_MTCS1()       bfin_read32(SPORT0_MTCS1)
+#define bfin_write_SPORT0_MTCS1(val)   bfin_write32(SPORT0_MTCS1, val)
+#define bfin_read_SPORT0_MTCS2()       bfin_read32(SPORT0_MTCS2)
+#define bfin_write_SPORT0_MTCS2(val)   bfin_write32(SPORT0_MTCS2, val)
+#define bfin_read_SPORT0_MTCS3()       bfin_read32(SPORT0_MTCS3)
+#define bfin_write_SPORT0_MTCS3(val)   bfin_write32(SPORT0_MTCS3, val)
+#define bfin_read_SPORT0_MRCS0()       bfin_read32(SPORT0_MRCS0)
+#define bfin_write_SPORT0_MRCS0(val)   bfin_write32(SPORT0_MRCS0, val)
+#define bfin_read_SPORT0_MRCS1()       bfin_read32(SPORT0_MRCS1)
+#define bfin_write_SPORT0_MRCS1(val)   bfin_write32(SPORT0_MRCS1, val)
+#define bfin_read_SPORT0_MRCS2()       bfin_read32(SPORT0_MRCS2)
+#define bfin_write_SPORT0_MRCS2(val)   bfin_write32(SPORT0_MRCS2, val)
+#define bfin_read_SPORT0_MRCS3()       bfin_read32(SPORT0_MRCS3)
+#define bfin_write_SPORT0_MRCS3(val)   bfin_write32(SPORT0_MRCS3, val)
+#define bfin_read_SPORT1_TCR1()        bfin_read16(SPORT1_TCR1)
+#define bfin_write_SPORT1_TCR1(val)    bfin_write16(SPORT1_TCR1, val)
+#define bfin_read_SPORT1_TCR2()        bfin_read16(SPORT1_TCR2)
+#define bfin_write_SPORT1_TCR2(val)    bfin_write16(SPORT1_TCR2, val)
+#define bfin_read_SPORT1_TCLKDIV()     bfin_read16(SPORT1_TCLKDIV)
+#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
+#define bfin_read_SPORT1_TFSDIV()      bfin_read16(SPORT1_TFSDIV)
+#define bfin_write_SPORT1_TFSDIV(val)  bfin_write16(SPORT1_TFSDIV, val)
+#define bfin_write_SPORT1_TX(val)      bfin_write32(SPORT1_TX, val)
+#define bfin_read_SPORT1_RX()          bfin_read32(SPORT1_RX)
+#define bfin_write_SPORT1_RX(val)      bfin_write32(SPORT1_RX, val)
+#define bfin_read_SPORT1_RCR1()        bfin_read16(SPORT1_RCR1)
+#define bfin_write_SPORT1_RCR1(val)    bfin_write16(SPORT1_RCR1, val)
+#define bfin_read_SPORT1_RCR2()        bfin_read16(SPORT1_RCR2)
+#define bfin_write_SPORT1_RCR2(val)    bfin_write16(SPORT1_RCR2, val)
+#define bfin_read_SPORT1_RCLKDIV()     bfin_read16(SPORT1_RCLKDIV)
+#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
+#define bfin_read_SPORT1_RFSDIV()      bfin_read16(SPORT1_RFSDIV)
+#define bfin_write_SPORT1_RFSDIV(val)  bfin_write16(SPORT1_RFSDIV, val)
+#define bfin_read_SPORT1_STAT()        bfin_read16(SPORT1_STAT)
+#define bfin_write_SPORT1_STAT(val)    bfin_write16(SPORT1_STAT, val)
+#define bfin_read_SPORT1_CHNL()        bfin_read16(SPORT1_CHNL)
+#define bfin_write_SPORT1_CHNL(val)    bfin_write16(SPORT1_CHNL, val)
+#define bfin_read_SPORT1_MCMC1()       bfin_read16(SPORT1_MCMC1)
+#define bfin_write_SPORT1_MCMC1(val)   bfin_write16(SPORT1_MCMC1, val)
+#define bfin_read_SPORT1_MCMC2()       bfin_read16(SPORT1_MCMC2)
+#define bfin_write_SPORT1_MCMC2(val)   bfin_write16(SPORT1_MCMC2, val)
+#define bfin_read_SPORT1_MTCS0()       bfin_read32(SPORT1_MTCS0)
+#define bfin_write_SPORT1_MTCS0(val)   bfin_write32(SPORT1_MTCS0, val)
+#define bfin_read_SPORT1_MTCS1()       bfin_read32(SPORT1_MTCS1)
+#define bfin_write_SPORT1_MTCS1(val)   bfin_write32(SPORT1_MTCS1, val)
+#define bfin_read_SPORT1_MTCS2()       bfin_read32(SPORT1_MTCS2)
+#define bfin_write_SPORT1_MTCS2(val)   bfin_write32(SPORT1_MTCS2, val)
+#define bfin_read_SPORT1_MTCS3()       bfin_read32(SPORT1_MTCS3)
+#define bfin_write_SPORT1_MTCS3(val)   bfin_write32(SPORT1_MTCS3, val)
+#define bfin_read_SPORT1_MRCS0()       bfin_read32(SPORT1_MRCS0)
+#define bfin_write_SPORT1_MRCS0(val)   bfin_write32(SPORT1_MRCS0, val)
+#define bfin_read_SPORT1_MRCS1()       bfin_read32(SPORT1_MRCS1)
+#define bfin_write_SPORT1_MRCS1(val)   bfin_write32(SPORT1_MRCS1, val)
+#define bfin_read_SPORT1_MRCS2()       bfin_read32(SPORT1_MRCS2)
+#define bfin_write_SPORT1_MRCS2(val)   bfin_write32(SPORT1_MRCS2, val)
+#define bfin_read_SPORT1_MRCS3()       bfin_read32(SPORT1_MRCS3)
+#define bfin_write_SPORT1_MRCS3(val)   bfin_write32(SPORT1_MRCS3, val)
+#define bfin_read_EBIU_AMGCTL()        bfin_read16(EBIU_AMGCTL)
+#define bfin_write_EBIU_AMGCTL(val)    bfin_write16(EBIU_AMGCTL, val)
+#define bfin_read_EBIU_AMBCTL0()       bfin_read32(EBIU_AMBCTL0)
+#define bfin_write_EBIU_AMBCTL0(val)   bfin_write32(EBIU_AMBCTL0, val)
+#define bfin_read_EBIU_AMBCTL1()       bfin_read32(EBIU_AMBCTL1)
+#define bfin_write_EBIU_AMBCTL1(val)   bfin_write32(EBIU_AMBCTL1, val)
+#define bfin_read_EBIU_SDGCTL()        bfin_read32(EBIU_SDGCTL)
+#define bfin_write_EBIU_SDGCTL(val)    bfin_write32(EBIU_SDGCTL, val)
+#define bfin_read_EBIU_SDBCTL()        bfin_read16(EBIU_SDBCTL)
+#define bfin_write_EBIU_SDBCTL(val)    bfin_write16(EBIU_SDBCTL, val)
+#define bfin_read_EBIU_SDRRC()         bfin_read16(EBIU_SDRRC)
+#define bfin_write_EBIU_SDRRC(val)     bfin_write16(EBIU_SDRRC, val)
+#define bfin_read_EBIU_SDSTAT()        bfin_read16(EBIU_SDSTAT)
+#define bfin_write_EBIU_SDSTAT(val)    bfin_write16(EBIU_SDSTAT, val)
+#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_readPTR(DMA0_NEXT_DESC_PTR)
+#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_writePTR(DMA0_NEXT_DESC_PTR, val)
+#define bfin_read_DMA0_START_ADDR()    bfin_readPTR(DMA0_START_ADDR)
+#define bfin_write_DMA0_START_ADDR(val) bfin_writePTR(DMA0_START_ADDR, val)
+#define bfin_read_DMA0_CONFIG()        bfin_read16(DMA0_CONFIG)
+#define bfin_write_DMA0_CONFIG(val)    bfin_write16(DMA0_CONFIG, val)
+#define bfin_read_DMA0_X_COUNT()       bfin_read16(DMA0_X_COUNT)
+#define bfin_write_DMA0_X_COUNT(val)   bfin_write16(DMA0_X_COUNT, val)
+#define bfin_read_DMA0_X_MODIFY()      bfin_read16(DMA0_X_MODIFY)
+#define bfin_write_DMA0_X_MODIFY(val)  bfin_write16(DMA0_X_MODIFY, val)
+#define bfin_read_DMA0_Y_COUNT()       bfin_read16(DMA0_Y_COUNT)
+#define bfin_write_DMA0_Y_COUNT(val)   bfin_write16(DMA0_Y_COUNT, val)
+#define bfin_read_DMA0_Y_MODIFY()      bfin_read16(DMA0_Y_MODIFY)
+#define bfin_write_DMA0_Y_MODIFY(val)  bfin_write16(DMA0_Y_MODIFY, val)
+#define bfin_read_DMA0_CURR_DESC_PTR() bfin_readPTR(DMA0_CURR_DESC_PTR)
+#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_writePTR(DMA0_CURR_DESC_PTR, val)
+#define bfin_read_DMA0_CURR_ADDR()     bfin_readPTR(DMA0_CURR_ADDR)
+#define bfin_write_DMA0_CURR_ADDR(val) bfin_writePTR(DMA0_CURR_ADDR, val)
+#define bfin_read_DMA0_IRQ_STATUS()    bfin_read16(DMA0_IRQ_STATUS)
+#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
+#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
+#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
+#define bfin_read_DMA0_CURR_X_COUNT()  bfin_read16(DMA0_CURR_X_COUNT)
+#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
+#define bfin_read_DMA0_CURR_Y_COUNT()  bfin_read16(DMA0_CURR_Y_COUNT)
+#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
+#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_readPTR(DMA1_NEXT_DESC_PTR)
+#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_writePTR(DMA1_NEXT_DESC_PTR, val)
+#define bfin_read_DMA1_START_ADDR()    bfin_readPTR(DMA1_START_ADDR)
+#define bfin_write_DMA1_START_ADDR(val) bfin_writePTR(DMA1_START_ADDR, val)
+#define bfin_read_DMA1_CONFIG()        bfin_read16(DMA1_CONFIG)
+#define bfin_write_DMA1_CONFIG(val)    bfin_write16(DMA1_CONFIG, val)
+#define bfin_read_DMA1_X_COUNT()       bfin_read16(DMA1_X_COUNT)
+#define bfin_write_DMA1_X_COUNT(val)   bfin_write16(DMA1_X_COUNT, val)
+#define bfin_read_DMA1_X_MODIFY()      bfin_read16(DMA1_X_MODIFY)
+#define bfin_write_DMA1_X_MODIFY(val)  bfin_write16(DMA1_X_MODIFY, val)
+#define bfin_read_DMA1_Y_COUNT()       bfin_read16(DMA1_Y_COUNT)
+#define bfin_write_DMA1_Y_COUNT(val)   bfin_write16(DMA1_Y_COUNT, val)
+#define bfin_read_DMA1_Y_MODIFY()      bfin_read16(DMA1_Y_MODIFY)
+#define bfin_write_DMA1_Y_MODIFY(val)  bfin_write16(DMA1_Y_MODIFY, val)
+#define bfin_read_DMA1_CURR_DESC_PTR() bfin_readPTR(DMA1_CURR_DESC_PTR)
+#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_writePTR(DMA1_CURR_DESC_PTR, val)
+#define bfin_read_DMA1_CURR_ADDR()     bfin_readPTR(DMA1_CURR_ADDR)
+#define bfin_write_DMA1_CURR_ADDR(val) bfin_writePTR(DMA1_CURR_ADDR, val)
+#define bfin_read_DMA1_IRQ_STATUS()    bfin_read16(DMA1_IRQ_STATUS)
+#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
+#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
+#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
+#define bfin_read_DMA1_CURR_X_COUNT()  bfin_read16(DMA1_CURR_X_COUNT)
+#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
+#define bfin_read_DMA1_CURR_Y_COUNT()  bfin_read16(DMA1_CURR_Y_COUNT)
+#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
+#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_readPTR(DMA2_NEXT_DESC_PTR)
+#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_writePTR(DMA2_NEXT_DESC_PTR, val)
+#define bfin_read_DMA2_START_ADDR()    bfin_readPTR(DMA2_START_ADDR)
+#define bfin_write_DMA2_START_ADDR(val) bfin_writePTR(DMA2_START_ADDR, val)
+#define bfin_read_DMA2_CONFIG()        bfin_read16(DMA2_CONFIG)
+#define bfin_write_DMA2_CONFIG(val)    bfin_write16(DMA2_CONFIG, val)
+#define bfin_read_DMA2_X_COUNT()       bfin_read16(DMA2_X_COUNT)
+#define bfin_write_DMA2_X_COUNT(val)   bfin_write16(DMA2_X_COUNT, val)
+#define bfin_read_DMA2_X_MODIFY()      bfin_read16(DMA2_X_MODIFY)
+#define bfin_write_DMA2_X_MODIFY(val)  bfin_write16(DMA2_X_MODIFY, val)
+#define bfin_read_DMA2_Y_COUNT()       bfin_read16(DMA2_Y_COUNT)
+#define bfin_write_DMA2_Y_COUNT(val)   bfin_write16(DMA2_Y_COUNT, val)
+#define bfin_read_DMA2_Y_MODIFY()      bfin_read16(DMA2_Y_MODIFY)
+#define bfin_write_DMA2_Y_MODIFY(val)  bfin_write16(DMA2_Y_MODIFY, val)
+#define bfin_read_DMA2_CURR_DESC_PTR() bfin_readPTR(DMA2_CURR_DESC_PTR)
+#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_writePTR(DMA2_CURR_DESC_PTR, val)
+#define bfin_read_DMA2_CURR_ADDR()     bfin_readPTR(DMA2_CURR_ADDR)
+#define bfin_write_DMA2_CURR_ADDR(val) bfin_writePTR(DMA2_CURR_ADDR, val)
+#define bfin_read_DMA2_IRQ_STATUS()    bfin_read16(DMA2_IRQ_STATUS)
+#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
+#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
+#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
+#define bfin_read_DMA2_CURR_X_COUNT()  bfin_read16(DMA2_CURR_X_COUNT)
+#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
+#define bfin_read_DMA2_CURR_Y_COUNT()  bfin_read16(DMA2_CURR_Y_COUNT)
+#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
+#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_readPTR(DMA3_NEXT_DESC_PTR)
+#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_writePTR(DMA3_NEXT_DESC_PTR, val)
+#define bfin_read_DMA3_START_ADDR()    bfin_readPTR(DMA3_START_ADDR)
+#define bfin_write_DMA3_START_ADDR(val) bfin_writePTR(DMA3_START_ADDR, val)
+#define bfin_read_DMA3_CONFIG()        bfin_read16(DMA3_CONFIG)
+#define bfin_write_DMA3_CONFIG(val)    bfin_write16(DMA3_CONFIG, val)
+#define bfin_read_DMA3_X_COUNT()       bfin_read16(DMA3_X_COUNT)
+#define bfin_write_DMA3_X_COUNT(val)   bfin_write16(DMA3_X_COUNT, val)
+#define bfin_read_DMA3_X_MODIFY()      bfin_read16(DMA3_X_MODIFY)
+#define bfin_write_DMA3_X_MODIFY(val)  bfin_write16(DMA3_X_MODIFY, val)
+#define bfin_read_DMA3_Y_COUNT()       bfin_read16(DMA3_Y_COUNT)
+#define bfin_write_DMA3_Y_COUNT(val)   bfin_write16(DMA3_Y_COUNT, val)
+#define bfin_read_DMA3_Y_MODIFY()      bfin_read16(DMA3_Y_MODIFY)
+#define bfin_write_DMA3_Y_MODIFY(val)  bfin_write16(DMA3_Y_MODIFY, val)
+#define bfin_read_DMA3_CURR_DESC_PTR() bfin_readPTR(DMA3_CURR_DESC_PTR)
+#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_writePTR(DMA3_CURR_DESC_PTR, val)
+#define bfin_read_DMA3_CURR_ADDR()     bfin_readPTR(DMA3_CURR_ADDR)
+#define bfin_write_DMA3_CURR_ADDR(val) bfin_writePTR(DMA3_CURR_ADDR, val)
+#define bfin_read_DMA3_IRQ_STATUS()    bfin_read16(DMA3_IRQ_STATUS)
+#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
+#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
+#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
+#define bfin_read_DMA3_CURR_X_COUNT()  bfin_read16(DMA3_CURR_X_COUNT)
+#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
+#define bfin_read_DMA3_CURR_Y_COUNT()  bfin_read16(DMA3_CURR_Y_COUNT)
+#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
+#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_readPTR(DMA4_NEXT_DESC_PTR)
+#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_writePTR(DMA4_NEXT_DESC_PTR, val)
+#define bfin_read_DMA4_START_ADDR()    bfin_readPTR(DMA4_START_ADDR)
+#define bfin_write_DMA4_START_ADDR(val) bfin_writePTR(DMA4_START_ADDR, val)
+#define bfin_read_DMA4_CONFIG()        bfin_read16(DMA4_CONFIG)
+#define bfin_write_DMA4_CONFIG(val)    bfin_write16(DMA4_CONFIG, val)
+#define bfin_read_DMA4_X_COUNT()       bfin_read16(DMA4_X_COUNT)
+#define bfin_write_DMA4_X_COUNT(val)   bfin_write16(DMA4_X_COUNT, val)
+#define bfin_read_DMA4_X_MODIFY()      bfin_read16(DMA4_X_MODIFY)
+#define bfin_write_DMA4_X_MODIFY(val)  bfin_write16(DMA4_X_MODIFY, val)
+#define bfin_read_DMA4_Y_COUNT()       bfin_read16(DMA4_Y_COUNT)
+#define bfin_write_DMA4_Y_COUNT(val)   bfin_write16(DMA4_Y_COUNT, val)
+#define bfin_read_DMA4_Y_MODIFY()      bfin_read16(DMA4_Y_MODIFY)
+#define bfin_write_DMA4_Y_MODIFY(val)  bfin_write16(DMA4_Y_MODIFY, val)
+#define bfin_read_DMA4_CURR_DESC_PTR() bfin_readPTR(DMA4_CURR_DESC_PTR)
+#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_writePTR(DMA4_CURR_DESC_PTR, val)
+#define bfin_read_DMA4_CURR_ADDR()     bfin_readPTR(DMA4_CURR_ADDR)
+#define bfin_write_DMA4_CURR_ADDR(val) bfin_writePTR(DMA4_CURR_ADDR, val)
+#define bfin_read_DMA4_IRQ_STATUS()    bfin_read16(DMA4_IRQ_STATUS)
+#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
+#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
+#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
+#define bfin_read_DMA4_CURR_X_COUNT()  bfin_read16(DMA4_CURR_X_COUNT)
+#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
+#define bfin_read_DMA4_CURR_Y_COUNT()  bfin_read16(DMA4_CURR_Y_COUNT)
+#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
+#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_readPTR(DMA5_NEXT_DESC_PTR)
+#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_writePTR(DMA5_NEXT_DESC_PTR, val)
+#define bfin_read_DMA5_START_ADDR()    bfin_readPTR(DMA5_START_ADDR)
+#define bfin_write_DMA5_START_ADDR(val) bfin_writePTR(DMA5_START_ADDR, val)
+#define bfin_read_DMA5_CONFIG()        bfin_read16(DMA5_CONFIG)
+#define bfin_write_DMA5_CONFIG(val)    bfin_write16(DMA5_CONFIG, val)
+#define bfin_read_DMA5_X_COUNT()       bfin_read16(DMA5_X_COUNT)
+#define bfin_write_DMA5_X_COUNT(val)   bfin_write16(DMA5_X_COUNT, val)
+#define bfin_read_DMA5_X_MODIFY()      bfin_read16(DMA5_X_MODIFY)
+#define bfin_write_DMA5_X_MODIFY(val)  bfin_write16(DMA5_X_MODIFY, val)
+#define bfin_read_DMA5_Y_COUNT()       bfin_read16(DMA5_Y_COUNT)
+#define bfin_write_DMA5_Y_COUNT(val)   bfin_write16(DMA5_Y_COUNT, val)
+#define bfin_read_DMA5_Y_MODIFY()      bfin_read16(DMA5_Y_MODIFY)
+#define bfin_write_DMA5_Y_MODIFY(val)  bfin_write16(DMA5_Y_MODIFY, val)
+#define bfin_read_DMA5_CURR_DESC_PTR() bfin_readPTR(DMA5_CURR_DESC_PTR)
+#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_writePTR(DMA5_CURR_DESC_PTR, val)
+#define bfin_read_DMA5_CURR_ADDR()     bfin_readPTR(DMA5_CURR_ADDR)
+#define bfin_write_DMA5_CURR_ADDR(val) bfin_writePTR(DMA5_CURR_ADDR, val)
+#define bfin_read_DMA5_IRQ_STATUS()    bfin_read16(DMA5_IRQ_STATUS)
+#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
+#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
+#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
+#define bfin_read_DMA5_CURR_X_COUNT()  bfin_read16(DMA5_CURR_X_COUNT)
+#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
+#define bfin_read_DMA5_CURR_Y_COUNT()  bfin_read16(DMA5_CURR_Y_COUNT)
+#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
+#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
+#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR, val)
+#define bfin_read_DMA6_START_ADDR()    bfin_readPTR(DMA6_START_ADDR)
+#define bfin_write_DMA6_START_ADDR(val) bfin_writePTR(DMA6_START_ADDR, val)
+#define bfin_read_DMA6_CONFIG()        bfin_read16(DMA6_CONFIG)
+#define bfin_write_DMA6_CONFIG(val)    bfin_write16(DMA6_CONFIG, val)
+#define bfin_read_DMA6_X_COUNT()       bfin_read16(DMA6_X_COUNT)
+#define bfin_write_DMA6_X_COUNT(val)   bfin_write16(DMA6_X_COUNT, val)
+#define bfin_read_DMA6_X_MODIFY()      bfin_read16(DMA6_X_MODIFY)
+#define bfin_write_DMA6_X_MODIFY(val)  bfin_write16(DMA6_X_MODIFY, val)
+#define bfin_read_DMA6_Y_COUNT()       bfin_read16(DMA6_Y_COUNT)
+#define bfin_write_DMA6_Y_COUNT(val)   bfin_write16(DMA6_Y_COUNT, val)
+#define bfin_read_DMA6_Y_MODIFY()      bfin_read16(DMA6_Y_MODIFY)
+#define bfin_write_DMA6_Y_MODIFY(val)  bfin_write16(DMA6_Y_MODIFY, val)
+#define bfin_read_DMA6_CURR_DESC_PTR() bfin_readPTR(DMA6_CURR_DESC_PTR)
+#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_writePTR(DMA6_CURR_DESC_PTR, val)
+#define bfin_read_DMA6_CURR_ADDR()     bfin_readPTR(DMA6_CURR_ADDR)
+#define bfin_write_DMA6_CURR_ADDR(val) bfin_writePTR(DMA6_CURR_ADDR, val)
+#define bfin_read_DMA6_IRQ_STATUS()    bfin_read16(DMA6_IRQ_STATUS)
+#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
+#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
+#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
+#define bfin_read_DMA6_CURR_X_COUNT()  bfin_read16(DMA6_CURR_X_COUNT)
+#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
+#define bfin_read_DMA6_CURR_Y_COUNT()  bfin_read16(DMA6_CURR_Y_COUNT)
+#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
+#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_readPTR(DMA7_NEXT_DESC_PTR)
+#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_writePTR(DMA7_NEXT_DESC_PTR, val)
+#define bfin_read_DMA7_START_ADDR()    bfin_readPTR(DMA7_START_ADDR)
+#define bfin_write_DMA7_START_ADDR(val) bfin_writePTR(DMA7_START_ADDR, val)
+#define bfin_read_DMA7_CONFIG()        bfin_read16(DMA7_CONFIG)
+#define bfin_write_DMA7_CONFIG(val)    bfin_write16(DMA7_CONFIG, val)
+#define bfin_read_DMA7_X_COUNT()       bfin_read16(DMA7_X_COUNT)
+#define bfin_write_DMA7_X_COUNT(val)   bfin_write16(DMA7_X_COUNT, val)
+#define bfin_read_DMA7_X_MODIFY()      bfin_read16(DMA7_X_MODIFY)
+#define bfin_write_DMA7_X_MODIFY(val)  bfin_write16(DMA7_X_MODIFY, val)
+#define bfin_read_DMA7_Y_COUNT()       bfin_read16(DMA7_Y_COUNT)
+#define bfin_write_DMA7_Y_COUNT(val)   bfin_write16(DMA7_Y_COUNT, val)
+#define bfin_read_DMA7_Y_MODIFY()      bfin_read16(DMA7_Y_MODIFY)
+#define bfin_write_DMA7_Y_MODIFY(val)  bfin_write16(DMA7_Y_MODIFY, val)
+#define bfin_read_DMA7_CURR_DESC_PTR() bfin_readPTR(DMA7_CURR_DESC_PTR)
+#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_writePTR(DMA7_CURR_DESC_PTR, val)
+#define bfin_read_DMA7_CURR_ADDR()     bfin_readPTR(DMA7_CURR_ADDR)
+#define bfin_write_DMA7_CURR_ADDR(val) bfin_writePTR(DMA7_CURR_ADDR, val)
+#define bfin_read_DMA7_IRQ_STATUS()    bfin_read16(DMA7_IRQ_STATUS)
+#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
+#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
+#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
+#define bfin_read_DMA7_CURR_X_COUNT()  bfin_read16(DMA7_CURR_X_COUNT)
+#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
+#define bfin_read_DMA7_CURR_Y_COUNT()  bfin_read16(DMA7_CURR_Y_COUNT)
+#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
+#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_readPTR(DMA8_NEXT_DESC_PTR)
+#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_writePTR(DMA8_NEXT_DESC_PTR, val)
+#define bfin_read_DMA8_START_ADDR()    bfin_readPTR(DMA8_START_ADDR)
+#define bfin_write_DMA8_START_ADDR(val) bfin_writePTR(DMA8_START_ADDR, val)
+#define bfin_read_DMA8_CONFIG()        bfin_read16(DMA8_CONFIG)
+#define bfin_write_DMA8_CONFIG(val)    bfin_write16(DMA8_CONFIG, val)
+#define bfin_read_DMA8_X_COUNT()       bfin_read16(DMA8_X_COUNT)
+#define bfin_write_DMA8_X_COUNT(val)   bfin_write16(DMA8_X_COUNT, val)
+#define bfin_read_DMA8_X_MODIFY()      bfin_read16(DMA8_X_MODIFY)
+#define bfin_write_DMA8_X_MODIFY(val)  bfin_write16(DMA8_X_MODIFY, val)
+#define bfin_read_DMA8_Y_COUNT()       bfin_read16(DMA8_Y_COUNT)
+#define bfin_write_DMA8_Y_COUNT(val)   bfin_write16(DMA8_Y_COUNT, val)
+#define bfin_read_DMA8_Y_MODIFY()      bfin_read16(DMA8_Y_MODIFY)
+#define bfin_write_DMA8_Y_MODIFY(val)  bfin_write16(DMA8_Y_MODIFY, val)
+#define bfin_read_DMA8_CURR_DESC_PTR() bfin_readPTR(DMA8_CURR_DESC_PTR)
+#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_writePTR(DMA8_CURR_DESC_PTR, val)
+#define bfin_read_DMA8_CURR_ADDR()     bfin_readPTR(DMA8_CURR_ADDR)
+#define bfin_write_DMA8_CURR_ADDR(val) bfin_writePTR(DMA8_CURR_ADDR, val)
+#define bfin_read_DMA8_IRQ_STATUS()    bfin_read16(DMA8_IRQ_STATUS)
+#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
+#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
+#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
+#define bfin_read_DMA8_CURR_X_COUNT()  bfin_read16(DMA8_CURR_X_COUNT)
+#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
+#define bfin_read_DMA8_CURR_Y_COUNT()  bfin_read16(DMA8_CURR_Y_COUNT)
+#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
+#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_readPTR(DMA9_NEXT_DESC_PTR)
+#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_writePTR(DMA9_NEXT_DESC_PTR, val)
+#define bfin_read_DMA9_START_ADDR()    bfin_readPTR(DMA9_START_ADDR)
+#define bfin_write_DMA9_START_ADDR(val) bfin_writePTR(DMA9_START_ADDR, val)
+#define bfin_read_DMA9_CONFIG()        bfin_read16(DMA9_CONFIG)
+#define bfin_write_DMA9_CONFIG(val)    bfin_write16(DMA9_CONFIG, val)
+#define bfin_read_DMA9_X_COUNT()       bfin_read16(DMA9_X_COUNT)
+#define bfin_write_DMA9_X_COUNT(val)   bfin_write16(DMA9_X_COUNT, val)
+#define bfin_read_DMA9_X_MODIFY()      bfin_read16(DMA9_X_MODIFY)
+#define bfin_write_DMA9_X_MODIFY(val)  bfin_write16(DMA9_X_MODIFY, val)
+#define bfin_read_DMA9_Y_COUNT()       bfin_read16(DMA9_Y_COUNT)
+#define bfin_write_DMA9_Y_COUNT(val)   bfin_write16(DMA9_Y_COUNT, val)
+#define bfin_read_DMA9_Y_MODIFY()      bfin_read16(DMA9_Y_MODIFY)
+#define bfin_write_DMA9_Y_MODIFY(val)  bfin_write16(DMA9_Y_MODIFY, val)
+#define bfin_read_DMA9_CURR_DESC_PTR() bfin_readPTR(DMA9_CURR_DESC_PTR)
+#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_writePTR(DMA9_CURR_DESC_PTR, val)
+#define bfin_read_DMA9_CURR_ADDR()     bfin_readPTR(DMA9_CURR_ADDR)
+#define bfin_write_DMA9_CURR_ADDR(val) bfin_writePTR(DMA9_CURR_ADDR, val)
+#define bfin_read_DMA9_IRQ_STATUS()    bfin_read16(DMA9_IRQ_STATUS)
+#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
+#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
+#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
+#define bfin_read_DMA9_CURR_X_COUNT()  bfin_read16(DMA9_CURR_X_COUNT)
+#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
+#define bfin_read_DMA9_CURR_Y_COUNT()  bfin_read16(DMA9_CURR_Y_COUNT)
+#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
+#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_readPTR(DMA10_NEXT_DESC_PTR)
+#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_writePTR(DMA10_NEXT_DESC_PTR, val)
+#define bfin_read_DMA10_START_ADDR()   bfin_readPTR(DMA10_START_ADDR)
+#define bfin_write_DMA10_START_ADDR(val) bfin_writePTR(DMA10_START_ADDR, val)
+#define bfin_read_DMA10_CONFIG()       bfin_read16(DMA10_CONFIG)
+#define bfin_write_DMA10_CONFIG(val)   bfin_write16(DMA10_CONFIG, val)
+#define bfin_read_DMA10_X_COUNT()      bfin_read16(DMA10_X_COUNT)
+#define bfin_write_DMA10_X_COUNT(val)  bfin_write16(DMA10_X_COUNT, val)
+#define bfin_read_DMA10_X_MODIFY()     bfin_read16(DMA10_X_MODIFY)
+#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY, val)
+#define bfin_read_DMA10_Y_COUNT()      bfin_read16(DMA10_Y_COUNT)
+#define bfin_write_DMA10_Y_COUNT(val)  bfin_write16(DMA10_Y_COUNT, val)
+#define bfin_read_DMA10_Y_MODIFY()     bfin_read16(DMA10_Y_MODIFY)
+#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY, val)
+#define bfin_read_DMA10_CURR_DESC_PTR() bfin_readPTR(DMA10_CURR_DESC_PTR)
+#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_writePTR(DMA10_CURR_DESC_PTR, val)
+#define bfin_read_DMA10_CURR_ADDR()    bfin_readPTR(DMA10_CURR_ADDR)
+#define bfin_write_DMA10_CURR_ADDR(val) bfin_writePTR(DMA10_CURR_ADDR, val)
+#define bfin_read_DMA10_IRQ_STATUS()   bfin_read16(DMA10_IRQ_STATUS)
+#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
+#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
+#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
+#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
+#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
+#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
+#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
+#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_readPTR(DMA11_NEXT_DESC_PTR)
+#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_writePTR(DMA11_NEXT_DESC_PTR, val)
+#define bfin_read_DMA11_START_ADDR()   bfin_readPTR(DMA11_START_ADDR)
+#define bfin_write_DMA11_START_ADDR(val) bfin_writePTR(DMA11_START_ADDR, val)
+#define bfin_read_DMA11_CONFIG()       bfin_read16(DMA11_CONFIG)
+#define bfin_write_DMA11_CONFIG(val)   bfin_write16(DMA11_CONFIG, val)
+#define bfin_read_DMA11_X_COUNT()      bfin_read16(DMA11_X_COUNT)
+#define bfin_write_DMA11_X_COUNT(val)  bfin_write16(DMA11_X_COUNT, val)
+#define bfin_read_DMA11_X_MODIFY()     bfin_read16(DMA11_X_MODIFY)
+#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY, val)
+#define bfin_read_DMA11_Y_COUNT()      bfin_read16(DMA11_Y_COUNT)
+#define bfin_write_DMA11_Y_COUNT(val)  bfin_write16(DMA11_Y_COUNT, val)
+#define bfin_read_DMA11_Y_MODIFY()     bfin_read16(DMA11_Y_MODIFY)
+#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY, val)
+#define bfin_read_DMA11_CURR_DESC_PTR() bfin_readPTR(DMA11_CURR_DESC_PTR)
+#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_writePTR(DMA11_CURR_DESC_PTR, val)
+#define bfin_read_DMA11_CURR_ADDR()    bfin_readPTR(DMA11_CURR_ADDR)
+#define bfin_write_DMA11_CURR_ADDR(val) bfin_writePTR(DMA11_CURR_ADDR, val)
+#define bfin_read_DMA11_IRQ_STATUS()   bfin_read16(DMA11_IRQ_STATUS)
+#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
+#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
+#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
+#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
+#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
+#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
+#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_readPTR(MDMA_S0_NEXT_DESC_PTR)
+#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_S0_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_S0_START_ADDR() bfin_readPTR(MDMA_S0_START_ADDR)
+#define bfin_write_MDMA_S0_START_ADDR(val) bfin_writePTR(MDMA_S0_START_ADDR, val)
+#define bfin_read_MDMA_S0_CONFIG()     bfin_read16(MDMA_S0_CONFIG)
+#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
+#define bfin_read_MDMA_S0_X_COUNT()    bfin_read16(MDMA_S0_X_COUNT)
+#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
+#define bfin_read_MDMA_S0_X_MODIFY()   bfin_read16(MDMA_S0_X_MODIFY)
+#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY, val)
+#define bfin_read_MDMA_S0_Y_COUNT()    bfin_read16(MDMA_S0_Y_COUNT)
+#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
+#define bfin_read_MDMA_S0_Y_MODIFY()   bfin_read16(MDMA_S0_Y_MODIFY)
+#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY, val)
+#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_readPTR(MDMA_S0_CURR_DESC_PTR)
+#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_writePTR(MDMA_S0_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_S0_CURR_ADDR()  bfin_readPTR(MDMA_S0_CURR_ADDR)
+#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_writePTR(MDMA_S0_CURR_ADDR, val)
+#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
+#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val)
+#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
+#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
+#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT, val)
+#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
+#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_readPTR(MDMA_D0_NEXT_DESC_PTR)
+#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_D0_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_D0_START_ADDR() bfin_readPTR(MDMA_D0_START_ADDR)
+#define bfin_write_MDMA_D0_START_ADDR(val) bfin_writePTR(MDMA_D0_START_ADDR, val)
+#define bfin_read_MDMA_D0_CONFIG()     bfin_read16(MDMA_D0_CONFIG)
+#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
+#define bfin_read_MDMA_D0_X_COUNT()    bfin_read16(MDMA_D0_X_COUNT)
+#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
+#define bfin_read_MDMA_D0_X_MODIFY()   bfin_read16(MDMA_D0_X_MODIFY)
+#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY, val)
+#define bfin_read_MDMA_D0_Y_COUNT()    bfin_read16(MDMA_D0_Y_COUNT)
+#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
+#define bfin_read_MDMA_D0_Y_MODIFY()   bfin_read16(MDMA_D0_Y_MODIFY)
+#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY, val)
+#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_readPTR(MDMA_D0_CURR_DESC_PTR)
+#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_writePTR(MDMA_D0_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_D0_CURR_ADDR()  bfin_readPTR(MDMA_D0_CURR_ADDR)
+#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_writePTR(MDMA_D0_CURR_ADDR, val)
+#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
+#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
+#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
+#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
+#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT, val)
+#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
+#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_readPTR(MDMA_S1_NEXT_DESC_PTR)
+#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_S1_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_S1_START_ADDR() bfin_readPTR(MDMA_S1_START_ADDR)
+#define bfin_write_MDMA_S1_START_ADDR(val) bfin_writePTR(MDMA_S1_START_ADDR, val)
+#define bfin_read_MDMA_S1_CONFIG()     bfin_read16(MDMA_S1_CONFIG)
+#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
+#define bfin_read_MDMA_S1_X_COUNT()    bfin_read16(MDMA_S1_X_COUNT)
+#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT, val)
+#define bfin_read_MDMA_S1_X_MODIFY()   bfin_read16(MDMA_S1_X_MODIFY)
+#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY, val)
+#define bfin_read_MDMA_S1_Y_COUNT()    bfin_read16(MDMA_S1_Y_COUNT)
+#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT, val)
+#define bfin_read_MDMA_S1_Y_MODIFY()   bfin_read16(MDMA_S1_Y_MODIFY)
+#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY, val)
+#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_readPTR(MDMA_S1_CURR_DESC_PTR)
+#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_writePTR(MDMA_S1_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_S1_CURR_ADDR()  bfin_readPTR(MDMA_S1_CURR_ADDR)
+#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_writePTR(MDMA_S1_CURR_ADDR, val)
+#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
+#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
+#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
+#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
+#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT, val)
+#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
+#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT, val)
+#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_readPTR(MDMA_D1_NEXT_DESC_PTR)
+#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA_D1_NEXT_DESC_PTR, val)
+#define bfin_read_MDMA_D1_START_ADDR() bfin_readPTR(MDMA_D1_START_ADDR)
+#define bfin_write_MDMA_D1_START_ADDR(val) bfin_writePTR(MDMA_D1_START_ADDR, val)
+#define bfin_read_MDMA_D1_CONFIG()     bfin_read16(MDMA_D1_CONFIG)
+#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
+#define bfin_read_MDMA_D1_X_COUNT()    bfin_read16(MDMA_D1_X_COUNT)
+#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT, val)
+#define bfin_read_MDMA_D1_X_MODIFY()   bfin_read16(MDMA_D1_X_MODIFY)
+#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY, val)
+#define bfin_read_MDMA_D1_Y_COUNT()    bfin_read16(MDMA_D1_Y_COUNT)
+#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT, val)
+#define bfin_read_MDMA_D1_Y_MODIFY()   bfin_read16(MDMA_D1_Y_MODIFY)
+#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY, val)
+#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_readPTR(MDMA_D1_CURR_DESC_PTR)
+#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_writePTR(MDMA_D1_CURR_DESC_PTR, val)
+#define bfin_read_MDMA_D1_CURR_ADDR()  bfin_readPTR(MDMA_D1_CURR_ADDR)
+#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_writePTR(MDMA_D1_CURR_ADDR, val)
+#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
+#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
+#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
+#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP, val)
+#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
+#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT, val)
+#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
+#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
+#define bfin_read_PPI_CONTROL()        bfin_read16(PPI_CONTROL)
+#define bfin_write_PPI_CONTROL(val)    bfin_write16(PPI_CONTROL, val)
+#define bfin_read_PPI_STATUS()         bfin_read16(PPI_STATUS)
+#define bfin_write_PPI_STATUS(val)     bfin_write16(PPI_STATUS, val)
+#define bfin_read_PPI_COUNT()          bfin_read16(PPI_COUNT)
+#define bfin_write_PPI_COUNT(val)      bfin_write16(PPI_COUNT, val)
+#define bfin_read_PPI_DELAY()          bfin_read16(PPI_DELAY)
+#define bfin_write_PPI_DELAY(val)      bfin_write16(PPI_DELAY, val)
+#define bfin_read_PPI_FRAME()          bfin_read16(PPI_FRAME)
+#define bfin_write_PPI_FRAME(val)      bfin_write16(PPI_FRAME, val)
+#define bfin_read_TWI_CLKDIV()         bfin_read16(TWI_CLKDIV)
+#define bfin_write_TWI_CLKDIV(val)     bfin_write16(TWI_CLKDIV, val)
+#define bfin_read_TWI_CONTROL()        bfin_read16(TWI_CONTROL)
+#define bfin_write_TWI_CONTROL(val)    bfin_write16(TWI_CONTROL, val)
+#define bfin_read_TWI_SLAVE_CTL()      bfin_read16(TWI_SLAVE_CTL)
+#define bfin_write_TWI_SLAVE_CTL(val)  bfin_write16(TWI_SLAVE_CTL, val)
+#define bfin_read_TWI_SLAVE_STAT()     bfin_read16(TWI_SLAVE_STAT)
+#define bfin_write_TWI_SLAVE_STAT(val) bfin_write16(TWI_SLAVE_STAT, val)
+#define bfin_read_TWI_SLAVE_ADDR()     bfin_read16(TWI_SLAVE_ADDR)
+#define bfin_write_TWI_SLAVE_ADDR(val) bfin_write16(TWI_SLAVE_ADDR, val)
+#define bfin_read_TWI_MASTER_CTL()     bfin_read16(TWI_MASTER_CTL)
+#define bfin_write_TWI_MASTER_CTL(val) bfin_write16(TWI_MASTER_CTL, val)
+#define bfin_read_TWI_MASTER_STAT()    bfin_read16(TWI_MASTER_STAT)
+#define bfin_write_TWI_MASTER_STAT(val) bfin_write16(TWI_MASTER_STAT, val)
+#define bfin_read_TWI_MASTER_ADDR()    bfin_read16(TWI_MASTER_ADDR)
+#define bfin_write_TWI_MASTER_ADDR(val) bfin_write16(TWI_MASTER_ADDR, val)
+#define bfin_read_TWI_INT_STAT()       bfin_read16(TWI_INT_STAT)
+#define bfin_write_TWI_INT_STAT(val)   bfin_write16(TWI_INT_STAT, val)
+#define bfin_read_TWI_INT_MASK()       bfin_read16(TWI_INT_MASK)
+#define bfin_write_TWI_INT_MASK(val)   bfin_write16(TWI_INT_MASK, val)
+#define bfin_read_TWI_FIFO_CTL()       bfin_read16(TWI_FIFO_CTL)
+#define bfin_write_TWI_FIFO_CTL(val)   bfin_write16(TWI_FIFO_CTL, val)
+#define bfin_read_TWI_FIFO_STAT()      bfin_read16(TWI_FIFO_STAT)
+#define bfin_write_TWI_FIFO_STAT(val)  bfin_write16(TWI_FIFO_STAT, val)
+#define bfin_read_TWI_XMT_DATA8()      bfin_read16(TWI_XMT_DATA8)
+#define bfin_write_TWI_XMT_DATA8(val)  bfin_write16(TWI_XMT_DATA8, val)
+#define bfin_read_TWI_XMT_DATA16()     bfin_read16(TWI_XMT_DATA16)
+#define bfin_write_TWI_XMT_DATA16(val) bfin_write16(TWI_XMT_DATA16, val)
+#define bfin_read_TWI_RCV_DATA8()      bfin_read16(TWI_RCV_DATA8)
+#define bfin_write_TWI_RCV_DATA8(val)  bfin_write16(TWI_RCV_DATA8, val)
+#define bfin_read_TWI_RCV_DATA16()     bfin_read16(TWI_RCV_DATA16)
+#define bfin_write_TWI_RCV_DATA16(val) bfin_write16(TWI_RCV_DATA16, val)
+#define bfin_read_PORTGIO()            bfin_read16(PORTGIO)
+#define bfin_write_PORTGIO(val)        bfin_write16(PORTGIO, val)
+#define bfin_read_PORTGIO_CLEAR()      bfin_read16(PORTGIO_CLEAR)
+#define bfin_write_PORTGIO_CLEAR(val)  bfin_write16(PORTGIO_CLEAR, val)
+#define bfin_read_PORTGIO_SET()        bfin_read16(PORTGIO_SET)
+#define bfin_write_PORTGIO_SET(val)    bfin_write16(PORTGIO_SET, val)
+#define bfin_read_PORTGIO_TOGGLE()     bfin_read16(PORTGIO_TOGGLE)
+#define bfin_write_PORTGIO_TOGGLE(val) bfin_write16(PORTGIO_TOGGLE, val)
+#define bfin_read_PORTGIO_MASKA()      bfin_read16(PORTGIO_MASKA)
+#define bfin_write_PORTGIO_MASKA(val)  bfin_write16(PORTGIO_MASKA, val)
+#define bfin_read_PORTGIO_MASKA_CLEAR() bfin_read16(PORTGIO_MASKA_CLEAR)
+#define bfin_write_PORTGIO_MASKA_CLEAR(val) bfin_write16(PORTGIO_MASKA_CLEAR, val)
+#define bfin_read_PORTGIO_MASKA_SET()  bfin_read16(PORTGIO_MASKA_SET)
+#define bfin_write_PORTGIO_MASKA_SET(val) bfin_write16(PORTGIO_MASKA_SET, val)
+#define bfin_read_PORTGIO_MASKA_TOGGLE() bfin_read16(PORTGIO_MASKA_TOGGLE)
+#define bfin_write_PORTGIO_MASKA_TOGGLE(val) bfin_write16(PORTGIO_MASKA_TOGGLE, val)
+#define bfin_read_PORTGIO_MASKB()      bfin_read16(PORTGIO_MASKB)
+#define bfin_write_PORTGIO_MASKB(val)  bfin_write16(PORTGIO_MASKB, val)
+#define bfin_read_PORTGIO_MASKB_CLEAR() bfin_read16(PORTGIO_MASKB_CLEAR)
+#define bfin_write_PORTGIO_MASKB_CLEAR(val) bfin_write16(PORTGIO_MASKB_CLEAR, val)
+#define bfin_read_PORTGIO_MASKB_SET()  bfin_read16(PORTGIO_MASKB_SET)
+#define bfin_write_PORTGIO_MASKB_SET(val) bfin_write16(PORTGIO_MASKB_SET, val)
+#define bfin_read_PORTGIO_MASKB_TOGGLE() bfin_read16(PORTGIO_MASKB_TOGGLE)
+#define bfin_write_PORTGIO_MASKB_TOGGLE(val) bfin_write16(PORTGIO_MASKB_TOGGLE, val)
+#define bfin_read_PORTGIO_DIR()        bfin_read16(PORTGIO_DIR)
+#define bfin_write_PORTGIO_DIR(val)    bfin_write16(PORTGIO_DIR, val)
+#define bfin_read_PORTGIO_POLAR()      bfin_read16(PORTGIO_POLAR)
+#define bfin_write_PORTGIO_POLAR(val)  bfin_write16(PORTGIO_POLAR, val)
+#define bfin_read_PORTGIO_EDGE()       bfin_read16(PORTGIO_EDGE)
+#define bfin_write_PORTGIO_EDGE(val)   bfin_write16(PORTGIO_EDGE, val)
+#define bfin_read_PORTGIO_BOTH()       bfin_read16(PORTGIO_BOTH)
+#define bfin_write_PORTGIO_BOTH(val)   bfin_write16(PORTGIO_BOTH, val)
+#define bfin_read_PORTGIO_INEN()       bfin_read16(PORTGIO_INEN)
+#define bfin_write_PORTGIO_INEN(val)   bfin_write16(PORTGIO_INEN, val)
+#define bfin_read_PORTHIO()            bfin_read16(PORTHIO)
+#define bfin_write_PORTHIO(val)        bfin_write16(PORTHIO, val)
+#define bfin_read_PORTHIO_CLEAR()      bfin_read16(PORTHIO_CLEAR)
+#define bfin_write_PORTHIO_CLEAR(val)  bfin_write16(PORTHIO_CLEAR, val)
+#define bfin_read_PORTHIO_SET()        bfin_read16(PORTHIO_SET)
+#define bfin_write_PORTHIO_SET(val)    bfin_write16(PORTHIO_SET, val)
+#define bfin_read_PORTHIO_TOGGLE()     bfin_read16(PORTHIO_TOGGLE)
+#define bfin_write_PORTHIO_TOGGLE(val) bfin_write16(PORTHIO_TOGGLE, val)
+#define bfin_read_PORTHIO_MASKA()      bfin_read16(PORTHIO_MASKA)
+#define bfin_write_PORTHIO_MASKA(val)  bfin_write16(PORTHIO_MASKA, val)
+#define bfin_read_PORTHIO_MASKA_CLEAR() bfin_read16(PORTHIO_MASKA_CLEAR)
+#define bfin_write_PORTHIO_MASKA_CLEAR(val) bfin_write16(PORTHIO_MASKA_CLEAR, val)
+#define bfin_read_PORTHIO_MASKA_SET()  bfin_read16(PORTHIO_MASKA_SET)
+#define bfin_write_PORTHIO_MASKA_SET(val) bfin_write16(PORTHIO_MASKA_SET, val)
+#define bfin_read_PORTHIO_MASKA_TOGGLE() bfin_read16(PORTHIO_MASKA_TOGGLE)
+#define bfin_write_PORTHIO_MASKA_TOGGLE(val) bfin_write16(PORTHIO_MASKA_TOGGLE, val)
+#define bfin_read_PORTHIO_MASKB()      bfin_read16(PORTHIO_MASKB)
+#define bfin_write_PORTHIO_MASKB(val)  bfin_write16(PORTHIO_MASKB, val)
+#define bfin_read_PORTHIO_MASKB_CLEAR() bfin_read16(PORTHIO_MASKB_CLEAR)
+#define bfin_write_PORTHIO_MASKB_CLEAR(val) bfin_write16(PORTHIO_MASKB_CLEAR, val)
+#define bfin_read_PORTHIO_MASKB_SET()  bfin_read16(PORTHIO_MASKB_SET)
+#define bfin_write_PORTHIO_MASKB_SET(val) bfin_write16(PORTHIO_MASKB_SET, val)
+#define bfin_read_PORTHIO_MASKB_TOGGLE() bfin_read16(PORTHIO_MASKB_TOGGLE)
+#define bfin_write_PORTHIO_MASKB_TOGGLE(val) bfin_write16(PORTHIO_MASKB_TOGGLE, val)
+#define bfin_read_PORTHIO_DIR()        bfin_read16(PORTHIO_DIR)
+#define bfin_write_PORTHIO_DIR(val)    bfin_write16(PORTHIO_DIR, val)
+#define bfin_read_PORTHIO_POLAR()      bfin_read16(PORTHIO_POLAR)
+#define bfin_write_PORTHIO_POLAR(val)  bfin_write16(PORTHIO_POLAR, val)
+#define bfin_read_PORTHIO_EDGE()       bfin_read16(PORTHIO_EDGE)
+#define bfin_write_PORTHIO_EDGE(val)   bfin_write16(PORTHIO_EDGE, val)
+#define bfin_read_PORTHIO_BOTH()       bfin_read16(PORTHIO_BOTH)
+#define bfin_write_PORTHIO_BOTH(val)   bfin_write16(PORTHIO_BOTH, val)
+#define bfin_read_PORTHIO_INEN()       bfin_read16(PORTHIO_INEN)
+#define bfin_write_PORTHIO_INEN(val)   bfin_write16(PORTHIO_INEN, val)
+#define bfin_read_UART1_THR()          bfin_read16(UART1_THR)
+#define bfin_write_UART1_THR(val)      bfin_write16(UART1_THR, val)
+#define bfin_read_UART1_RBR()          bfin_read16(UART1_RBR)
+#define bfin_write_UART1_RBR(val)      bfin_write16(UART1_RBR, val)
+#define bfin_read_UART1_DLL()          bfin_read16(UART1_DLL)
+#define bfin_write_UART1_DLL(val)      bfin_write16(UART1_DLL, val)
+#define bfin_read_UART1_IER()          bfin_read16(UART1_IER)
+#define bfin_write_UART1_IER(val)      bfin_write16(UART1_IER, val)
+#define bfin_read_UART1_DLH()          bfin_read16(UART1_DLH)
+#define bfin_write_UART1_DLH(val)      bfin_write16(UART1_DLH, val)
+#define bfin_read_UART1_IIR()          bfin_read16(UART1_IIR)
+#define bfin_write_UART1_IIR(val)      bfin_write16(UART1_IIR, val)
+#define bfin_read_UART1_LCR()          bfin_read16(UART1_LCR)
+#define bfin_write_UART1_LCR(val)      bfin_write16(UART1_LCR, val)
+#define bfin_read_UART1_MCR()          bfin_read16(UART1_MCR)
+#define bfin_write_UART1_MCR(val)      bfin_write16(UART1_MCR, val)
+#define bfin_read_UART1_LSR()          bfin_read16(UART1_LSR)
+#define bfin_write_UART1_LSR(val)      bfin_write16(UART1_LSR, val)
+#define bfin_read_UART1_MSR()          bfin_read16(UART1_MSR)
+#define bfin_write_UART1_MSR(val)      bfin_write16(UART1_MSR, val)
+#define bfin_read_UART1_SCR()          bfin_read16(UART1_SCR)
+#define bfin_write_UART1_SCR(val)      bfin_write16(UART1_SCR, val)
+#define bfin_read_UART1_GCTL()         bfin_read16(UART1_GCTL)
+#define bfin_write_UART1_GCTL(val)     bfin_write16(UART1_GCTL, val)
+#define bfin_read_CAN_MC1()            bfin_read16(CAN_MC1)
+#define bfin_write_CAN_MC1(val)        bfin_write16(CAN_MC1, val)
+#define bfin_read_CAN_MD1()            bfin_read16(CAN_MD1)
+#define bfin_write_CAN_MD1(val)        bfin_write16(CAN_MD1, val)
+#define bfin_read_CAN_TRS1()           bfin_read16(CAN_TRS1)
+#define bfin_write_CAN_TRS1(val)       bfin_write16(CAN_TRS1, val)
+#define bfin_read_CAN_TRR1()           bfin_read16(CAN_TRR1)
+#define bfin_write_CAN_TRR1(val)       bfin_write16(CAN_TRR1, val)
+#define bfin_read_CAN_TA1()            bfin_read16(CAN_TA1)
+#define bfin_write_CAN_TA1(val)        bfin_write16(CAN_TA1, val)
+#define bfin_read_CAN_AA1()            bfin_read16(CAN_AA1)
+#define bfin_write_CAN_AA1(val)        bfin_write16(CAN_AA1, val)
+#define bfin_read_CAN_RMP1()           bfin_read16(CAN_RMP1)
+#define bfin_write_CAN_RMP1(val)       bfin_write16(CAN_RMP1, val)
+#define bfin_read_CAN_RML1()           bfin_read16(CAN_RML1)
+#define bfin_write_CAN_RML1(val)       bfin_write16(CAN_RML1, val)
+#define bfin_read_CAN_MBTIF1()         bfin_read16(CAN_MBTIF1)
+#define bfin_write_CAN_MBTIF1(val)     bfin_write16(CAN_MBTIF1, val)
+#define bfin_read_CAN_MBRIF1()         bfin_read16(CAN_MBRIF1)
+#define bfin_write_CAN_MBRIF1(val)     bfin_write16(CAN_MBRIF1, val)
+#define bfin_read_CAN_MBIM1()          bfin_read16(CAN_MBIM1)
+#define bfin_write_CAN_MBIM1(val)      bfin_write16(CAN_MBIM1, val)
+#define bfin_read_CAN_RFH1()           bfin_read16(CAN_RFH1)
+#define bfin_write_CAN_RFH1(val)       bfin_write16(CAN_RFH1, val)
+#define bfin_read_CAN_OPSS1()          bfin_read16(CAN_OPSS1)
+#define bfin_write_CAN_OPSS1(val)      bfin_write16(CAN_OPSS1, val)
+#define bfin_read_CAN_MC2()            bfin_read16(CAN_MC2)
+#define bfin_write_CAN_MC2(val)        bfin_write16(CAN_MC2, val)
+#define bfin_read_CAN_MD2()            bfin_read16(CAN_MD2)
+#define bfin_write_CAN_MD2(val)        bfin_write16(CAN_MD2, val)
+#define bfin_read_CAN_TRS2()           bfin_read16(CAN_TRS2)
+#define bfin_write_CAN_TRS2(val)       bfin_write16(CAN_TRS2, val)
+#define bfin_read_CAN_TRR2()           bfin_read16(CAN_TRR2)
+#define bfin_write_CAN_TRR2(val)       bfin_write16(CAN_TRR2, val)
+#define bfin_read_CAN_TA2()            bfin_read16(CAN_TA2)
+#define bfin_write_CAN_TA2(val)        bfin_write16(CAN_TA2, val)
+#define bfin_read_CAN_AA2()            bfin_read16(CAN_AA2)
+#define bfin_write_CAN_AA2(val)        bfin_write16(CAN_AA2, val)
+#define bfin_read_CAN_RMP2()           bfin_read16(CAN_RMP2)
+#define bfin_write_CAN_RMP2(val)       bfin_write16(CAN_RMP2, val)
+#define bfin_read_CAN_RML2()           bfin_read16(CAN_RML2)
+#define bfin_write_CAN_RML2(val)       bfin_write16(CAN_RML2, val)
+#define bfin_read_CAN_MBTIF2()         bfin_read16(CAN_MBTIF2)
+#define bfin_write_CAN_MBTIF2(val)     bfin_write16(CAN_MBTIF2, val)
+#define bfin_read_CAN_MBRIF2()         bfin_read16(CAN_MBRIF2)
+#define bfin_write_CAN_MBRIF2(val)     bfin_write16(CAN_MBRIF2, val)
+#define bfin_read_CAN_MBIM2()          bfin_read16(CAN_MBIM2)
+#define bfin_write_CAN_MBIM2(val)      bfin_write16(CAN_MBIM2, val)
+#define bfin_read_CAN_RFH2()           bfin_read16(CAN_RFH2)
+#define bfin_write_CAN_RFH2(val)       bfin_write16(CAN_RFH2, val)
+#define bfin_read_CAN_OPSS2()          bfin_read16(CAN_OPSS2)
+#define bfin_write_CAN_OPSS2(val)      bfin_write16(CAN_OPSS2, val)
+#define bfin_read_CAN_CLOCK()          bfin_read16(CAN_CLOCK)
+#define bfin_write_CAN_CLOCK(val)      bfin_write16(CAN_CLOCK, val)
+#define bfin_read_CAN_TIMING()         bfin_read16(CAN_TIMING)
+#define bfin_write_CAN_TIMING(val)     bfin_write16(CAN_TIMING, val)
+#define bfin_read_CAN_DEBUG()          bfin_read16(CAN_DEBUG)
+#define bfin_write_CAN_DEBUG(val)      bfin_write16(CAN_DEBUG, val)
+#define bfin_read_CAN_STATUS()         bfin_read16(CAN_STATUS)
+#define bfin_write_CAN_STATUS(val)     bfin_write16(CAN_STATUS, val)
+#define bfin_read_CAN_CEC()            bfin_read16(CAN_CEC)
+#define bfin_write_CAN_CEC(val)        bfin_write16(CAN_CEC, val)
+#define bfin_read_CAN_GIS()            bfin_read16(CAN_GIS)
+#define bfin_write_CAN_GIS(val)        bfin_write16(CAN_GIS, val)
+#define bfin_read_CAN_GIM()            bfin_read16(CAN_GIM)
+#define bfin_write_CAN_GIM(val)        bfin_write16(CAN_GIM, val)
+#define bfin_read_CAN_GIF()            bfin_read16(CAN_GIF)
+#define bfin_write_CAN_GIF(val)        bfin_write16(CAN_GIF, val)
+#define bfin_read_CAN_CONTROL()        bfin_read16(CAN_CONTROL)
+#define bfin_write_CAN_CONTROL(val)    bfin_write16(CAN_CONTROL, val)
+#define bfin_read_CAN_INTR()           bfin_read16(CAN_INTR)
+#define bfin_write_CAN_INTR(val)       bfin_write16(CAN_INTR, val)
+#define bfin_read_CAN_VERSION()        bfin_read16(CAN_VERSION)
+#define bfin_write_CAN_VERSION(val)    bfin_write16(CAN_VERSION, val)
+#define bfin_read_CAN_MBTD()           bfin_read16(CAN_MBTD)
+#define bfin_write_CAN_MBTD(val)       bfin_write16(CAN_MBTD, val)
+#define bfin_read_CAN_EWR()            bfin_read16(CAN_EWR)
+#define bfin_write_CAN_EWR(val)        bfin_write16(CAN_EWR, val)
+#define bfin_read_CAN_ESR()            bfin_read16(CAN_ESR)
+#define bfin_write_CAN_ESR(val)        bfin_write16(CAN_ESR, val)
+#define bfin_read_CAN_UCREG()          bfin_read16(CAN_UCREG)
+#define bfin_write_CAN_UCREG(val)      bfin_write16(CAN_UCREG, val)
+#define bfin_read_CAN_UCCNT()          bfin_read16(CAN_UCCNT)
+#define bfin_write_CAN_UCCNT(val)      bfin_write16(CAN_UCCNT, val)
+#define bfin_read_CAN_UCRC()           bfin_read16(CAN_UCRC)
+#define bfin_write_CAN_UCRC(val)       bfin_write16(CAN_UCRC, val)
+#define bfin_read_CAN_UCCNF()          bfin_read16(CAN_UCCNF)
+#define bfin_write_CAN_UCCNF(val)      bfin_write16(CAN_UCCNF, val)
+#define bfin_read_CAN_VERSION2()       bfin_read16(CAN_VERSION2)
+#define bfin_write_CAN_VERSION2(val)   bfin_write16(CAN_VERSION2, val)
+#define bfin_read_CAN_AM00L()          bfin_read16(CAN_AM00L)
+#define bfin_write_CAN_AM00L(val)      bfin_write16(CAN_AM00L, val)
+#define bfin_read_CAN_AM00H()          bfin_read16(CAN_AM00H)
+#define bfin_write_CAN_AM00H(val)      bfin_write16(CAN_AM00H, val)
+#define bfin_read_CAN_AM01L()          bfin_read16(CAN_AM01L)
+#define bfin_write_CAN_AM01L(val)      bfin_write16(CAN_AM01L, val)
+#define bfin_read_CAN_AM01H()          bfin_read16(CAN_AM01H)
+#define bfin_write_CAN_AM01H(val)      bfin_write16(CAN_AM01H, val)
+#define bfin_read_CAN_AM02L()          bfin_read16(CAN_AM02L)
+#define bfin_write_CAN_AM02L(val)      bfin_write16(CAN_AM02L, val)
+#define bfin_read_CAN_AM02H()          bfin_read16(CAN_AM02H)
+#define bfin_write_CAN_AM02H(val)      bfin_write16(CAN_AM02H, val)
+#define bfin_read_CAN_AM03L()          bfin_read16(CAN_AM03L)
+#define bfin_write_CAN_AM03L(val)      bfin_write16(CAN_AM03L, val)
+#define bfin_read_CAN_AM03H()          bfin_read16(CAN_AM03H)
+#define bfin_write_CAN_AM03H(val)      bfin_write16(CAN_AM03H, val)
+#define bfin_read_CAN_AM04L()          bfin_read16(CAN_AM04L)
+#define bfin_write_CAN_AM04L(val)      bfin_write16(CAN_AM04L, val)
+#define bfin_read_CAN_AM04H()          bfin_read16(CAN_AM04H)
+#define bfin_write_CAN_AM04H(val)      bfin_write16(CAN_AM04H, val)
+#define bfin_read_CAN_AM05L()          bfin_read16(CAN_AM05L)
+#define bfin_write_CAN_AM05L(val)      bfin_write16(CAN_AM05L, val)
+#define bfin_read_CAN_AM05H()          bfin_read16(CAN_AM05H)
+#define bfin_write_CAN_AM05H(val)      bfin_write16(CAN_AM05H, val)
+#define bfin_read_CAN_AM06L()          bfin_read16(CAN_AM06L)
+#define bfin_write_CAN_AM06L(val)      bfin_write16(CAN_AM06L, val)
+#define bfin_read_CAN_AM06H()          bfin_read16(CAN_AM06H)
+#define bfin_write_CAN_AM06H(val)      bfin_write16(CAN_AM06H, val)
+#define bfin_read_CAN_AM07L()          bfin_read16(CAN_AM07L)
+#define bfin_write_CAN_AM07L(val)      bfin_write16(CAN_AM07L, val)
+#define bfin_read_CAN_AM07H()          bfin_read16(CAN_AM07H)
+#define bfin_write_CAN_AM07H(val)      bfin_write16(CAN_AM07H, val)
+#define bfin_read_CAN_AM08L()          bfin_read16(CAN_AM08L)
+#define bfin_write_CAN_AM08L(val)      bfin_write16(CAN_AM08L, val)
+#define bfin_read_CAN_AM08H()          bfin_read16(CAN_AM08H)
+#define bfin_write_CAN_AM08H(val)      bfin_write16(CAN_AM08H, val)
+#define bfin_read_CAN_AM09L()          bfin_read16(CAN_AM09L)
+#define bfin_write_CAN_AM09L(val)      bfin_write16(CAN_AM09L, val)
+#define bfin_read_CAN_AM09H()          bfin_read16(CAN_AM09H)
+#define bfin_write_CAN_AM09H(val)      bfin_write16(CAN_AM09H, val)
+#define bfin_read_CAN_AM10L()          bfin_read16(CAN_AM10L)
+#define bfin_write_CAN_AM10L(val)      bfin_write16(CAN_AM10L, val)
+#define bfin_read_CAN_AM10H()          bfin_read16(CAN_AM10H)
+#define bfin_write_CAN_AM10H(val)      bfin_write16(CAN_AM10H, val)
+#define bfin_read_CAN_AM11L()          bfin_read16(CAN_AM11L)
+#define bfin_write_CAN_AM11L(val)      bfin_write16(CAN_AM11L, val)
+#define bfin_read_CAN_AM11H()          bfin_read16(CAN_AM11H)
+#define bfin_write_CAN_AM11H(val)      bfin_write16(CAN_AM11H, val)
+#define bfin_read_CAN_AM12L()          bfin_read16(CAN_AM12L)
+#define bfin_write_CAN_AM12L(val)      bfin_write16(CAN_AM12L, val)
+#define bfin_read_CAN_AM12H()          bfin_read16(CAN_AM12H)
+#define bfin_write_CAN_AM12H(val)      bfin_write16(CAN_AM12H, val)
+#define bfin_read_CAN_AM13L()          bfin_read16(CAN_AM13L)
+#define bfin_write_CAN_AM13L(val)      bfin_write16(CAN_AM13L, val)
+#define bfin_read_CAN_AM13H()          bfin_read16(CAN_AM13H)
+#define bfin_write_CAN_AM13H(val)      bfin_write16(CAN_AM13H, val)
+#define bfin_read_CAN_AM14L()          bfin_read16(CAN_AM14L)
+#define bfin_write_CAN_AM14L(val)      bfin_write16(CAN_AM14L, val)
+#define bfin_read_CAN_AM14H()          bfin_read16(CAN_AM14H)
+#define bfin_write_CAN_AM14H(val)      bfin_write16(CAN_AM14H, val)
+#define bfin_read_CAN_AM15L()          bfin_read16(CAN_AM15L)
+#define bfin_write_CAN_AM15L(val)      bfin_write16(CAN_AM15L, val)
+#define bfin_read_CAN_AM15H()          bfin_read16(CAN_AM15H)
+#define bfin_write_CAN_AM15H(val)      bfin_write16(CAN_AM15H, val)
+#define bfin_read_CAN_AM16L()          bfin_read16(CAN_AM16L)
+#define bfin_write_CAN_AM16L(val)      bfin_write16(CAN_AM16L, val)
+#define bfin_read_CAN_AM16H()          bfin_read16(CAN_AM16H)
+#define bfin_write_CAN_AM16H(val)      bfin_write16(CAN_AM16H, val)
+#define bfin_read_CAN_AM17L()          bfin_read16(CAN_AM17L)
+#define bfin_write_CAN_AM17L(val)      bfin_write16(CAN_AM17L, val)
+#define bfin_read_CAN_AM17H()          bfin_read16(CAN_AM17H)
+#define bfin_write_CAN_AM17H(val)      bfin_write16(CAN_AM17H, val)
+#define bfin_read_CAN_AM18L()          bfin_read16(CAN_AM18L)
+#define bfin_write_CAN_AM18L(val)      bfin_write16(CAN_AM18L, val)
+#define bfin_read_CAN_AM18H()          bfin_read16(CAN_AM18H)
+#define bfin_write_CAN_AM18H(val)      bfin_write16(CAN_AM18H, val)
+#define bfin_read_CAN_AM19L()          bfin_read16(CAN_AM19L)
+#define bfin_write_CAN_AM19L(val)      bfin_write16(CAN_AM19L, val)
+#define bfin_read_CAN_AM19H()          bfin_read16(CAN_AM19H)
+#define bfin_write_CAN_AM19H(val)      bfin_write16(CAN_AM19H, val)
+#define bfin_read_CAN_AM20L()          bfin_read16(CAN_AM20L)
+#define bfin_write_CAN_AM20L(val)      bfin_write16(CAN_AM20L, val)
+#define bfin_read_CAN_AM20H()          bfin_read16(CAN_AM20H)
+#define bfin_write_CAN_AM20H(val)      bfin_write16(CAN_AM20H, val)
+#define bfin_read_CAN_AM21L()          bfin_read16(CAN_AM21L)
+#define bfin_write_CAN_AM21L(val)      bfin_write16(CAN_AM21L, val)
+#define bfin_read_CAN_AM21H()          bfin_read16(CAN_AM21H)
+#define bfin_write_CAN_AM21H(val)      bfin_write16(CAN_AM21H, val)
+#define bfin_read_CAN_AM22L()          bfin_read16(CAN_AM22L)
+#define bfin_write_CAN_AM22L(val)      bfin_write16(CAN_AM22L, val)
+#define bfin_read_CAN_AM22H()          bfin_read16(CAN_AM22H)
+#define bfin_write_CAN_AM22H(val)      bfin_write16(CAN_AM22H, val)
+#define bfin_read_CAN_AM23L()          bfin_read16(CAN_AM23L)
+#define bfin_write_CAN_AM23L(val)      bfin_write16(CAN_AM23L, val)
+#define bfin_read_CAN_AM23H()          bfin_read16(CAN_AM23H)
+#define bfin_write_CAN_AM23H(val)      bfin_write16(CAN_AM23H, val)
+#define bfin_read_CAN_AM24L()          bfin_read16(CAN_AM24L)
+#define bfin_write_CAN_AM24L(val)      bfin_write16(CAN_AM24L, val)
+#define bfin_read_CAN_AM24H()          bfin_read16(CAN_AM24H)
+#define bfin_write_CAN_AM24H(val)      bfin_write16(CAN_AM24H, val)
+#define bfin_read_CAN_AM25L()          bfin_read16(CAN_AM25L)
+#define bfin_write_CAN_AM25L(val)      bfin_write16(CAN_AM25L, val)
+#define bfin_read_CAN_AM25H()          bfin_read16(CAN_AM25H)
+#define bfin_write_CAN_AM25H(val)      bfin_write16(CAN_AM25H, val)
+#define bfin_read_CAN_AM26L()          bfin_read16(CAN_AM26L)
+#define bfin_write_CAN_AM26L(val)      bfin_write16(CAN_AM26L, val)
+#define bfin_read_CAN_AM26H()          bfin_read16(CAN_AM26H)
+#define bfin_write_CAN_AM26H(val)      bfin_write16(CAN_AM26H, val)
+#define bfin_read_CAN_AM27L()          bfin_read16(CAN_AM27L)
+#define bfin_write_CAN_AM27L(val)      bfin_write16(CAN_AM27L, val)
+#define bfin_read_CAN_AM27H()          bfin_read16(CAN_AM27H)
+#define bfin_write_CAN_AM27H(val)      bfin_write16(CAN_AM27H, val)
+#define bfin_read_CAN_AM28L()          bfin_read16(CAN_AM28L)
+#define bfin_write_CAN_AM28L(val)      bfin_write16(CAN_AM28L, val)
+#define bfin_read_CAN_AM28H()          bfin_read16(CAN_AM28H)
+#define bfin_write_CAN_AM28H(val)      bfin_write16(CAN_AM28H, val)
+#define bfin_read_CAN_AM29L()          bfin_read16(CAN_AM29L)
+#define bfin_write_CAN_AM29L(val)      bfin_write16(CAN_AM29L, val)
+#define bfin_read_CAN_AM29H()          bfin_read16(CAN_AM29H)
+#define bfin_write_CAN_AM29H(val)      bfin_write16(CAN_AM29H, val)
+#define bfin_read_CAN_AM30L()          bfin_read16(CAN_AM30L)
+#define bfin_write_CAN_AM30L(val)      bfin_write16(CAN_AM30L, val)
+#define bfin_read_CAN_AM30H()          bfin_read16(CAN_AM30H)
+#define bfin_write_CAN_AM30H(val)      bfin_write16(CAN_AM30H, val)
+#define bfin_read_CAN_AM31L()          bfin_read16(CAN_AM31L)
+#define bfin_write_CAN_AM31L(val)      bfin_write16(CAN_AM31L, val)
+#define bfin_read_CAN_AM31H()          bfin_read16(CAN_AM31H)
+#define bfin_write_CAN_AM31H(val)      bfin_write16(CAN_AM31H, val)
+#define bfin_read_CAN_MB00_DATA0()     bfin_read16(CAN_MB00_DATA0)
+#define bfin_write_CAN_MB00_DATA0(val) bfin_write16(CAN_MB00_DATA0, val)
+#define bfin_read_CAN_MB00_DATA1()     bfin_read16(CAN_MB00_DATA1)
+#define bfin_write_CAN_MB00_DATA1(val) bfin_write16(CAN_MB00_DATA1, val)
+#define bfin_read_CAN_MB00_DATA2()     bfin_read16(CAN_MB00_DATA2)
+#define bfin_write_CAN_MB00_DATA2(val) bfin_write16(CAN_MB00_DATA2, val)
+#define bfin_read_CAN_MB00_DATA3()     bfin_read16(CAN_MB00_DATA3)
+#define bfin_write_CAN_MB00_DATA3(val) bfin_write16(CAN_MB00_DATA3, val)
+#define bfin_read_CAN_MB00_LENGTH()    bfin_read16(CAN_MB00_LENGTH)
+#define bfin_write_CAN_MB00_LENGTH(val) bfin_write16(CAN_MB00_LENGTH, val)
+#define bfin_read_CAN_MB00_TIMESTAMP() bfin_read16(CAN_MB00_TIMESTAMP)
+#define bfin_write_CAN_MB00_TIMESTAMP(val) bfin_write16(CAN_MB00_TIMESTAMP, val)
+#define bfin_read_CAN_MB00_ID0()       bfin_read16(CAN_MB00_ID0)
+#define bfin_write_CAN_MB00_ID0(val)   bfin_write16(CAN_MB00_ID0, val)
+#define bfin_read_CAN_MB00_ID1()       bfin_read16(CAN_MB00_ID1)
+#define bfin_write_CAN_MB00_ID1(val)   bfin_write16(CAN_MB00_ID1, val)
+#define bfin_read_CAN_MB01_DATA0()     bfin_read16(CAN_MB01_DATA0)
+#define bfin_write_CAN_MB01_DATA0(val) bfin_write16(CAN_MB01_DATA0, val)
+#define bfin_read_CAN_MB01_DATA1()     bfin_read16(CAN_MB01_DATA1)
+#define bfin_write_CAN_MB01_DATA1(val) bfin_write16(CAN_MB01_DATA1, val)
+#define bfin_read_CAN_MB01_DATA2()     bfin_read16(CAN_MB01_DATA2)
+#define bfin_write_CAN_MB01_DATA2(val) bfin_write16(CAN_MB01_DATA2, val)
+#define bfin_read_CAN_MB01_DATA3()     bfin_read16(CAN_MB01_DATA3)
+#define bfin_write_CAN_MB01_DATA3(val) bfin_write16(CAN_MB01_DATA3, val)
+#define bfin_read_CAN_MB01_LENGTH()    bfin_read16(CAN_MB01_LENGTH)
+#define bfin_write_CAN_MB01_LENGTH(val) bfin_write16(CAN_MB01_LENGTH, val)
+#define bfin_read_CAN_MB01_TIMESTAMP() bfin_read16(CAN_MB01_TIMESTAMP)
+#define bfin_write_CAN_MB01_TIMESTAMP(val) bfin_write16(CAN_MB01_TIMESTAMP, val)
+#define bfin_read_CAN_MB01_ID0()       bfin_read16(CAN_MB01_ID0)
+#define bfin_write_CAN_MB01_ID0(val)   bfin_write16(CAN_MB01_ID0, val)
+#define bfin_read_CAN_MB01_ID1()       bfin_read16(CAN_MB01_ID1)
+#define bfin_write_CAN_MB01_ID1(val)   bfin_write16(CAN_MB01_ID1, val)
+#define bfin_read_CAN_MB02_DATA0()     bfin_read16(CAN_MB02_DATA0)
+#define bfin_write_CAN_MB02_DATA0(val) bfin_write16(CAN_MB02_DATA0, val)
+#define bfin_read_CAN_MB02_DATA1()     bfin_read16(CAN_MB02_DATA1)
+#define bfin_write_CAN_MB02_DATA1(val) bfin_write16(CAN_MB02_DATA1, val)
+#define bfin_read_CAN_MB02_DATA2()     bfin_read16(CAN_MB02_DATA2)
+#define bfin_write_CAN_MB02_DATA2(val) bfin_write16(CAN_MB02_DATA2, val)
+#define bfin_read_CAN_MB02_DATA3()     bfin_read16(CAN_MB02_DATA3)
+#define bfin_write_CAN_MB02_DATA3(val) bfin_write16(CAN_MB02_DATA3, val)
+#define bfin_read_CAN_MB02_LENGTH()    bfin_read16(CAN_MB02_LENGTH)
+#define bfin_write_CAN_MB02_LENGTH(val) bfin_write16(CAN_MB02_LENGTH, val)
+#define bfin_read_CAN_MB02_TIMESTAMP() bfin_read16(CAN_MB02_TIMESTAMP)
+#define bfin_write_CAN_MB02_TIMESTAMP(val) bfin_write16(CAN_MB02_TIMESTAMP, val)
+#define bfin_read_CAN_MB02_ID0()       bfin_read16(CAN_MB02_ID0)
+#define bfin_write_CAN_MB02_ID0(val)   bfin_write16(CAN_MB02_ID0, val)
+#define bfin_read_CAN_MB02_ID1()       bfin_read16(CAN_MB02_ID1)
+#define bfin_write_CAN_MB02_ID1(val)   bfin_write16(CAN_MB02_ID1, val)
+#define bfin_read_CAN_MB03_DATA0()     bfin_read16(CAN_MB03_DATA0)
+#define bfin_write_CAN_MB03_DATA0(val) bfin_write16(CAN_MB03_DATA0, val)
+#define bfin_read_CAN_MB03_DATA1()     bfin_read16(CAN_MB03_DATA1)
+#define bfin_write_CAN_MB03_DATA1(val) bfin_write16(CAN_MB03_DATA1, val)
+#define bfin_read_CAN_MB03_DATA2()     bfin_read16(CAN_MB03_DATA2)
+#define bfin_write_CAN_MB03_DATA2(val) bfin_write16(CAN_MB03_DATA2, val)
+#define bfin_read_CAN_MB03_DATA3()     bfin_read16(CAN_MB03_DATA3)
+#define bfin_write_CAN_MB03_DATA3(val) bfin_write16(CAN_MB03_DATA3, val)
+#define bfin_read_CAN_MB03_LENGTH()    bfin_read16(CAN_MB03_LENGTH)
+#define bfin_write_CAN_MB03_LENGTH(val) bfin_write16(CAN_MB03_LENGTH, val)
+#define bfin_read_CAN_MB03_TIMESTAMP() bfin_read16(CAN_MB03_TIMESTAMP)
+#define bfin_write_CAN_MB03_TIMESTAMP(val) bfin_write16(CAN_MB03_TIMESTAMP, val)
+#define bfin_read_CAN_MB03_ID0()       bfin_read16(CAN_MB03_ID0)
+#define bfin_write_CAN_MB03_ID0(val)   bfin_write16(CAN_MB03_ID0, val)
+#define bfin_read_CAN_MB03_ID1()       bfin_read16(CAN_MB03_ID1)
+#define bfin_write_CAN_MB03_ID1(val)   bfin_write16(CAN_MB03_ID1, val)
+#define bfin_read_CAN_MB04_DATA0()     bfin_read16(CAN_MB04_DATA0)
+#define bfin_write_CAN_MB04_DATA0(val) bfin_write16(CAN_MB04_DATA0, val)
+#define bfin_read_CAN_MB04_DATA1()     bfin_read16(CAN_MB04_DATA1)
+#define bfin_write_CAN_MB04_DATA1(val) bfin_write16(CAN_MB04_DATA1, val)
+#define bfin_read_CAN_MB04_DATA2()     bfin_read16(CAN_MB04_DATA2)
+#define bfin_write_CAN_MB04_DATA2(val) bfin_write16(CAN_MB04_DATA2, val)
+#define bfin_read_CAN_MB04_DATA3()     bfin_read16(CAN_MB04_DATA3)
+#define bfin_write_CAN_MB04_DATA3(val) bfin_write16(CAN_MB04_DATA3, val)
+#define bfin_read_CAN_MB04_LENGTH()    bfin_read16(CAN_MB04_LENGTH)
+#define bfin_write_CAN_MB04_LENGTH(val) bfin_write16(CAN_MB04_LENGTH, val)
+#define bfin_read_CAN_MB04_TIMESTAMP() bfin_read16(CAN_MB04_TIMESTAMP)
+#define bfin_write_CAN_MB04_TIMESTAMP(val) bfin_write16(CAN_MB04_TIMESTAMP, val)
+#define bfin_read_CAN_MB04_ID0()       bfin_read16(CAN_MB04_ID0)
+#define bfin_write_CAN_MB04_ID0(val)   bfin_write16(CAN_MB04_ID0, val)
+#define bfin_read_CAN_MB04_ID1()       bfin_read16(CAN_MB04_ID1)
+#define bfin_write_CAN_MB04_ID1(val)   bfin_write16(CAN_MB04_ID1, val)
+#define bfin_read_CAN_MB05_DATA0()     bfin_read16(CAN_MB05_DATA0)
+#define bfin_write_CAN_MB05_DATA0(val) bfin_write16(CAN_MB05_DATA0, val)
+#define bfin_read_CAN_MB05_DATA1()     bfin_read16(CAN_MB05_DATA1)
+#define bfin_write_CAN_MB05_DATA1(val) bfin_write16(CAN_MB05_DATA1, val)
+#define bfin_read_CAN_MB05_DATA2()     bfin_read16(CAN_MB05_DATA2)
+#define bfin_write_CAN_MB05_DATA2(val) bfin_write16(CAN_MB05_DATA2, val)
+#define bfin_read_CAN_MB05_DATA3()     bfin_read16(CAN_MB05_DATA3)
+#define bfin_write_CAN_MB05_DATA3(val) bfin_write16(CAN_MB05_DATA3, val)
+#define bfin_read_CAN_MB05_LENGTH()    bfin_read16(CAN_MB05_LENGTH)
+#define bfin_write_CAN_MB05_LENGTH(val) bfin_write16(CAN_MB05_LENGTH, val)
+#define bfin_read_CAN_MB05_TIMESTAMP() bfin_read16(CAN_MB05_TIMESTAMP)
+#define bfin_write_CAN_MB05_TIMESTAMP(val) bfin_write16(CAN_MB05_TIMESTAMP, val)
+#define bfin_read_CAN_MB05_ID0()       bfin_read16(CAN_MB05_ID0)
+#define bfin_write_CAN_MB05_ID0(val)   bfin_write16(CAN_MB05_ID0, val)
+#define bfin_read_CAN_MB05_ID1()       bfin_read16(CAN_MB05_ID1)
+#define bfin_write_CAN_MB05_ID1(val)   bfin_write16(CAN_MB05_ID1, val)
+#define bfin_read_CAN_MB06_DATA0()     bfin_read16(CAN_MB06_DATA0)
+#define bfin_write_CAN_MB06_DATA0(val) bfin_write16(CAN_MB06_DATA0, val)
+#define bfin_read_CAN_MB06_DATA1()     bfin_read16(CAN_MB06_DATA1)
+#define bfin_write_CAN_MB06_DATA1(val) bfin_write16(CAN_MB06_DATA1, val)
+#define bfin_read_CAN_MB06_DATA2()     bfin_read16(CAN_MB06_DATA2)
+#define bfin_write_CAN_MB06_DATA2(val) bfin_write16(CAN_MB06_DATA2, val)
+#define bfin_read_CAN_MB06_DATA3()     bfin_read16(CAN_MB06_DATA3)
+#define bfin_write_CAN_MB06_DATA3(val) bfin_write16(CAN_MB06_DATA3, val)
+#define bfin_read_CAN_MB06_LENGTH()    bfin_read16(CAN_MB06_LENGTH)
+#define bfin_write_CAN_MB06_LENGTH(val) bfin_write16(CAN_MB06_LENGTH, val)
+#define bfin_read_CAN_MB06_TIMESTAMP() bfin_read16(CAN_MB06_TIMESTAMP)
+#define bfin_write_CAN_MB06_TIMESTAMP(val) bfin_write16(CAN_MB06_TIMESTAMP, val)
+#define bfin_read_CAN_MB06_ID0()       bfin_read16(CAN_MB06_ID0)
+#define bfin_write_CAN_MB06_ID0(val)   bfin_write16(CAN_MB06_ID0, val)
+#define bfin_read_CAN_MB06_ID1()       bfin_read16(CAN_MB06_ID1)
+#define bfin_write_CAN_MB06_ID1(val)   bfin_write16(CAN_MB06_ID1, val)
+#define bfin_read_CAN_MB07_DATA0()     bfin_read16(CAN_MB07_DATA0)
+#define bfin_write_CAN_MB07_DATA0(val) bfin_write16(CAN_MB07_DATA0, val)
+#define bfin_read_CAN_MB07_DATA1()     bfin_read16(CAN_MB07_DATA1)
+#define bfin_write_CAN_MB07_DATA1(val) bfin_write16(CAN_MB07_DATA1, val)
+#define bfin_read_CAN_MB07_DATA2()     bfin_read16(CAN_MB07_DATA2)
+#define bfin_write_CAN_MB07_DATA2(val) bfin_write16(CAN_MB07_DATA2, val)
+#define bfin_read_CAN_MB07_DATA3()     bfin_read16(CAN_MB07_DATA3)
+#define bfin_write_CAN_MB07_DATA3(val) bfin_write16(CAN_MB07_DATA3, val)
+#define bfin_read_CAN_MB07_LENGTH()    bfin_read16(CAN_MB07_LENGTH)
+#define bfin_write_CAN_MB07_LENGTH(val) bfin_write16(CAN_MB07_LENGTH, val)
+#define bfin_read_CAN_MB07_TIMESTAMP() bfin_read16(CAN_MB07_TIMESTAMP)
+#define bfin_write_CAN_MB07_TIMESTAMP(val) bfin_write16(CAN_MB07_TIMESTAMP, val)
+#define bfin_read_CAN_MB07_ID0()       bfin_read16(CAN_MB07_ID0)
+#define bfin_write_CAN_MB07_ID0(val)   bfin_write16(CAN_MB07_ID0, val)
+#define bfin_read_CAN_MB07_ID1()       bfin_read16(CAN_MB07_ID1)
+#define bfin_write_CAN_MB07_ID1(val)   bfin_write16(CAN_MB07_ID1, val)
+#define bfin_read_CAN_MB08_DATA0()     bfin_read16(CAN_MB08_DATA0)
+#define bfin_write_CAN_MB08_DATA0(val) bfin_write16(CAN_MB08_DATA0, val)
+#define bfin_read_CAN_MB08_DATA1()     bfin_read16(CAN_MB08_DATA1)
+#define bfin_write_CAN_MB08_DATA1(val) bfin_write16(CAN_MB08_DATA1, val)
+#define bfin_read_CAN_MB08_DATA2()     bfin_read16(CAN_MB08_DATA2)
+#define bfin_write_CAN_MB08_DATA2(val) bfin_write16(CAN_MB08_DATA2, val)
+#define bfin_read_CAN_MB08_DATA3()     bfin_read16(CAN_MB08_DATA3)
+#define bfin_write_CAN_MB08_DATA3(val) bfin_write16(CAN_MB08_DATA3, val)
+#define bfin_read_CAN_MB08_LENGTH()    bfin_read16(CAN_MB08_LENGTH)
+#define bfin_write_CAN_MB08_LENGTH(val) bfin_write16(CAN_MB08_LENGTH, val)
+#define bfin_read_CAN_MB08_TIMESTAMP() bfin_read16(CAN_MB08_TIMESTAMP)
+#define bfin_write_CAN_MB08_TIMESTAMP(val) bfin_write16(CAN_MB08_TIMESTAMP, val)
+#define bfin_read_CAN_MB08_ID0()       bfin_read16(CAN_MB08_ID0)
+#define bfin_write_CAN_MB08_ID0(val)   bfin_write16(CAN_MB08_ID0, val)
+#define bfin_read_CAN_MB08_ID1()       bfin_read16(CAN_MB08_ID1)
+#define bfin_write_CAN_MB08_ID1(val)   bfin_write16(CAN_MB08_ID1, val)
+#define bfin_read_CAN_MB09_DATA0()     bfin_read16(CAN_MB09_DATA0)
+#define bfin_write_CAN_MB09_DATA0(val) bfin_write16(CAN_MB09_DATA0, val)
+#define bfin_read_CAN_MB09_DATA1()     bfin_read16(CAN_MB09_DATA1)
+#define bfin_write_CAN_MB09_DATA1(val) bfin_write16(CAN_MB09_DATA1, val)
+#define bfin_read_CAN_MB09_DATA2()     bfin_read16(CAN_MB09_DATA2)
+#define bfin_write_CAN_MB09_DATA2(val) bfin_write16(CAN_MB09_DATA2, val)
+#define bfin_read_CAN_MB09_DATA3()     bfin_read16(CAN_MB09_DATA3)
+#define bfin_write_CAN_MB09_DATA3(val) bfin_write16(CAN_MB09_DATA3, val)
+#define bfin_read_CAN_MB09_LENGTH()    bfin_read16(CAN_MB09_LENGTH)
+#define bfin_write_CAN_MB09_LENGTH(val) bfin_write16(CAN_MB09_LENGTH, val)
+#define bfin_read_CAN_MB09_TIMESTAMP() bfin_read16(CAN_MB09_TIMESTAMP)
+#define bfin_write_CAN_MB09_TIMESTAMP(val) bfin_write16(CAN_MB09_TIMESTAMP, val)
+#define bfin_read_CAN_MB09_ID0()       bfin_read16(CAN_MB09_ID0)
+#define bfin_write_CAN_MB09_ID0(val)   bfin_write16(CAN_MB09_ID0, val)
+#define bfin_read_CAN_MB09_ID1()       bfin_read16(CAN_MB09_ID1)
+#define bfin_write_CAN_MB09_ID1(val)   bfin_write16(CAN_MB09_ID1, val)
+#define bfin_read_CAN_MB10_DATA0()     bfin_read16(CAN_MB10_DATA0)
+#define bfin_write_CAN_MB10_DATA0(val) bfin_write16(CAN_MB10_DATA0, val)
+#define bfin_read_CAN_MB10_DATA1()     bfin_read16(CAN_MB10_DATA1)
+#define bfin_write_CAN_MB10_DATA1(val) bfin_write16(CAN_MB10_DATA1, val)
+#define bfin_read_CAN_MB10_DATA2()     bfin_read16(CAN_MB10_DATA2)
+#define bfin_write_CAN_MB10_DATA2(val) bfin_write16(CAN_MB10_DATA2, val)
+#define bfin_read_CAN_MB10_DATA3()     bfin_read16(CAN_MB10_DATA3)
+#define bfin_write_CAN_MB10_DATA3(val) bfin_write16(CAN_MB10_DATA3, val)
+#define bfin_read_CAN_MB10_LENGTH()    bfin_read16(CAN_MB10_LENGTH)
+#define bfin_write_CAN_MB10_LENGTH(val) bfin_write16(CAN_MB10_LENGTH, val)
+#define bfin_read_CAN_MB10_TIMESTAMP() bfin_read16(CAN_MB10_TIMESTAMP)
+#define bfin_write_CAN_MB10_TIMESTAMP(val) bfin_write16(CAN_MB10_TIMESTAMP, val)
+#define bfin_read_CAN_MB10_ID0()       bfin_read16(CAN_MB10_ID0)
+#define bfin_write_CAN_MB10_ID0(val)   bfin_write16(CAN_MB10_ID0, val)
+#define bfin_read_CAN_MB10_ID1()       bfin_read16(CAN_MB10_ID1)
+#define bfin_write_CAN_MB10_ID1(val)   bfin_write16(CAN_MB10_ID1, val)
+#define bfin_read_CAN_MB11_DATA0()     bfin_read16(CAN_MB11_DATA0)
+#define bfin_write_CAN_MB11_DATA0(val) bfin_write16(CAN_MB11_DATA0, val)
+#define bfin_read_CAN_MB11_DATA1()     bfin_read16(CAN_MB11_DATA1)
+#define bfin_write_CAN_MB11_DATA1(val) bfin_write16(CAN_MB11_DATA1, val)
+#define bfin_read_CAN_MB11_DATA2()     bfin_read16(CAN_MB11_DATA2)
+#define bfin_write_CAN_MB11_DATA2(val) bfin_write16(CAN_MB11_DATA2, val)
+#define bfin_read_CAN_MB11_DATA3()     bfin_read16(CAN_MB11_DATA3)
+#define bfin_write_CAN_MB11_DATA3(val) bfin_write16(CAN_MB11_DATA3, val)
+#define bfin_read_CAN_MB11_LENGTH()    bfin_read16(CAN_MB11_LENGTH)
+#define bfin_write_CAN_MB11_LENGTH(val) bfin_write16(CAN_MB11_LENGTH, val)
+#define bfin_read_CAN_MB11_TIMESTAMP() bfin_read16(CAN_MB11_TIMESTAMP)
+#define bfin_write_CAN_MB11_TIMESTAMP(val) bfin_write16(CAN_MB11_TIMESTAMP, val)
+#define bfin_read_CAN_MB11_ID0()       bfin_read16(CAN_MB11_ID0)
+#define bfin_write_CAN_MB11_ID0(val)   bfin_write16(CAN_MB11_ID0, val)
+#define bfin_read_CAN_MB11_ID1()       bfin_read16(CAN_MB11_ID1)
+#define bfin_write_CAN_MB11_ID1(val)   bfin_write16(CAN_MB11_ID1, val)
+#define bfin_read_CAN_MB12_DATA0()     bfin_read16(CAN_MB12_DATA0)
+#define bfin_write_CAN_MB12_DATA0(val) bfin_write16(CAN_MB12_DATA0, val)
+#define bfin_read_CAN_MB12_DATA1()     bfin_read16(CAN_MB12_DATA1)
+#define bfin_write_CAN_MB12_DATA1(val) bfin_write16(CAN_MB12_DATA1, val)
+#define bfin_read_CAN_MB12_DATA2()     bfin_read16(CAN_MB12_DATA2)
+#define bfin_write_CAN_MB12_DATA2(val) bfin_write16(CAN_MB12_DATA2, val)
+#define bfin_read_CAN_MB12_DATA3()     bfin_read16(CAN_MB12_DATA3)
+#define bfin_write_CAN_MB12_DATA3(val) bfin_write16(CAN_MB12_DATA3, val)
+#define bfin_read_CAN_MB12_LENGTH()    bfin_read16(CAN_MB12_LENGTH)
+#define bfin_write_CAN_MB12_LENGTH(val) bfin_write16(CAN_MB12_LENGTH, val)
+#define bfin_read_CAN_MB12_TIMESTAMP() bfin_read16(CAN_MB12_TIMESTAMP)
+#define bfin_write_CAN_MB12_TIMESTAMP(val) bfin_write16(CAN_MB12_TIMESTAMP, val)
+#define bfin_read_CAN_MB12_ID0()       bfin_read16(CAN_MB12_ID0)
+#define bfin_write_CAN_MB12_ID0(val)   bfin_write16(CAN_MB12_ID0, val)
+#define bfin_read_CAN_MB12_ID1()       bfin_read16(CAN_MB12_ID1)
+#define bfin_write_CAN_MB12_ID1(val)   bfin_write16(CAN_MB12_ID1, val)
+#define bfin_read_CAN_MB13_DATA0()     bfin_read16(CAN_MB13_DATA0)
+#define bfin_write_CAN_MB13_DATA0(val) bfin_write16(CAN_MB13_DATA0, val)
+#define bfin_read_CAN_MB13_DATA1()     bfin_read16(CAN_MB13_DATA1)
+#define bfin_write_CAN_MB13_DATA1(val) bfin_write16(CAN_MB13_DATA1, val)
+#define bfin_read_CAN_MB13_DATA2()     bfin_read16(CAN_MB13_DATA2)
+#define bfin_write_CAN_MB13_DATA2(val) bfin_write16(CAN_MB13_DATA2, val)
+#define bfin_read_CAN_MB13_DATA3()     bfin_read16(CAN_MB13_DATA3)
+#define bfin_write_CAN_MB13_DATA3(val) bfin_write16(CAN_MB13_DATA3, val)
+#define bfin_read_CAN_MB13_LENGTH()    bfin_read16(CAN_MB13_LENGTH)
+#define bfin_write_CAN_MB13_LENGTH(val) bfin_write16(CAN_MB13_LENGTH, val)
+#define bfin_read_CAN_MB13_TIMESTAMP() bfin_read16(CAN_MB13_TIMESTAMP)
+#define bfin_write_CAN_MB13_TIMESTAMP(val) bfin_write16(CAN_MB13_TIMESTAMP, val)
+#define bfin_read_CAN_MB13_ID0()       bfin_read16(CAN_MB13_ID0)
+#define bfin_write_CAN_MB13_ID0(val)   bfin_write16(CAN_MB13_ID0, val)
+#define bfin_read_CAN_MB13_ID1()       bfin_read16(CAN_MB13_ID1)
+#define bfin_write_CAN_MB13_ID1(val)   bfin_write16(CAN_MB13_ID1, val)
+#define bfin_read_CAN_MB14_DATA0()     bfin_read16(CAN_MB14_DATA0)
+#define bfin_write_CAN_MB14_DATA0(val) bfin_write16(CAN_MB14_DATA0, val)
+#define bfin_read_CAN_MB14_DATA1()     bfin_read16(CAN_MB14_DATA1)
+#define bfin_write_CAN_MB14_DATA1(val) bfin_write16(CAN_MB14_DATA1, val)
+#define bfin_read_CAN_MB14_DATA2()     bfin_read16(CAN_MB14_DATA2)
+#define bfin_write_CAN_MB14_DATA2(val) bfin_write16(CAN_MB14_DATA2, val)
+#define bfin_read_CAN_MB14_DATA3()     bfin_read16(CAN_MB14_DATA3)
+#define bfin_write_CAN_MB14_DATA3(val) bfin_write16(CAN_MB14_DATA3, val)
+#define bfin_read_CAN_MB14_LENGTH()    bfin_read16(CAN_MB14_LENGTH)
+#define bfin_write_CAN_MB14_LENGTH(val) bfin_write16(CAN_MB14_LENGTH, val)
+#define bfin_read_CAN_MB14_TIMESTAMP() bfin_read16(CAN_MB14_TIMESTAMP)
+#define bfin_write_CAN_MB14_TIMESTAMP(val) bfin_write16(CAN_MB14_TIMESTAMP, val)
+#define bfin_read_CAN_MB14_ID0()       bfin_read16(CAN_MB14_ID0)
+#define bfin_write_CAN_MB14_ID0(val)   bfin_write16(CAN_MB14_ID0, val)
+#define bfin_read_CAN_MB14_ID1()       bfin_read16(CAN_MB14_ID1)
+#define bfin_write_CAN_MB14_ID1(val)   bfin_write16(CAN_MB14_ID1, val)
+#define bfin_read_CAN_MB15_DATA0()     bfin_read16(CAN_MB15_DATA0)
+#define bfin_write_CAN_MB15_DATA0(val) bfin_write16(CAN_MB15_DATA0, val)
+#define bfin_read_CAN_MB15_DATA1()     bfin_read16(CAN_MB15_DATA1)
+#define bfin_write_CAN_MB15_DATA1(val) bfin_write16(CAN_MB15_DATA1, val)
+#define bfin_read_CAN_MB15_DATA2()     bfin_read16(CAN_MB15_DATA2)
+#define bfin_write_CAN_MB15_DATA2(val) bfin_write16(CAN_MB15_DATA2, val)
+#define bfin_read_CAN_MB15_DATA3()     bfin_read16(CAN_MB15_DATA3)
+#define bfin_write_CAN_MB15_DATA3(val) bfin_write16(CAN_MB15_DATA3, val)
+#define bfin_read_CAN_MB15_LENGTH()    bfin_read16(CAN_MB15_LENGTH)
+#define bfin_write_CAN_MB15_LENGTH(val) bfin_write16(CAN_MB15_LENGTH, val)
+#define bfin_read_CAN_MB15_TIMESTAMP() bfin_read16(CAN_MB15_TIMESTAMP)
+#define bfin_write_CAN_MB15_TIMESTAMP(val) bfin_write16(CAN_MB15_TIMESTAMP, val)
+#define bfin_read_CAN_MB15_ID0()       bfin_read16(CAN_MB15_ID0)
+#define bfin_write_CAN_MB15_ID0(val)   bfin_write16(CAN_MB15_ID0, val)
+#define bfin_read_CAN_MB15_ID1()       bfin_read16(CAN_MB15_ID1)
+#define bfin_write_CAN_MB15_ID1(val)   bfin_write16(CAN_MB15_ID1, val)
+#define bfin_read_CAN_MB16_DATA0()     bfin_read16(CAN_MB16_DATA0)
+#define bfin_write_CAN_MB16_DATA0(val) bfin_write16(CAN_MB16_DATA0, val)
+#define bfin_read_CAN_MB16_DATA1()     bfin_read16(CAN_MB16_DATA1)
+#define bfin_write_CAN_MB16_DATA1(val) bfin_write16(CAN_MB16_DATA1, val)
+#define bfin_read_CAN_MB16_DATA2()     bfin_read16(CAN_MB16_DATA2)
+#define bfin_write_CAN_MB16_DATA2(val) bfin_write16(CAN_MB16_DATA2, val)
+#define bfin_read_CAN_MB16_DATA3()     bfin_read16(CAN_MB16_DATA3)
+#define bfin_write_CAN_MB16_DATA3(val) bfin_write16(CAN_MB16_DATA3, val)
+#define bfin_read_CAN_MB16_LENGTH()    bfin_read16(CAN_MB16_LENGTH)
+#define bfin_write_CAN_MB16_LENGTH(val) bfin_write16(CAN_MB16_LENGTH, val)
+#define bfin_read_CAN_MB16_TIMESTAMP() bfin_read16(CAN_MB16_TIMESTAMP)
+#define bfin_write_CAN_MB16_TIMESTAMP(val) bfin_write16(CAN_MB16_TIMESTAMP, val)
+#define bfin_read_CAN_MB16_ID0()       bfin_read16(CAN_MB16_ID0)
+#define bfin_write_CAN_MB16_ID0(val)   bfin_write16(CAN_MB16_ID0, val)
+#define bfin_read_CAN_MB16_ID1()       bfin_read16(CAN_MB16_ID1)
+#define bfin_write_CAN_MB16_ID1(val)   bfin_write16(CAN_MB16_ID1, val)
+#define bfin_read_CAN_MB17_DATA0()     bfin_read16(CAN_MB17_DATA0)
+#define bfin_write_CAN_MB17_DATA0(val) bfin_write16(CAN_MB17_DATA0, val)
+#define bfin_read_CAN_MB17_DATA1()     bfin_read16(CAN_MB17_DATA1)
+#define bfin_write_CAN_MB17_DATA1(val) bfin_write16(CAN_MB17_DATA1, val)
+#define bfin_read_CAN_MB17_DATA2()     bfin_read16(CAN_MB17_DATA2)
+#define bfin_write_CAN_MB17_DATA2(val) bfin_write16(CAN_MB17_DATA2, val)
+#define bfin_read_CAN_MB17_DATA3()     bfin_read16(CAN_MB17_DATA3)
+#define bfin_write_CAN_MB17_DATA3(val) bfin_write16(CAN_MB17_DATA3, val)
+#define bfin_read_CAN_MB17_LENGTH()    bfin_read16(CAN_MB17_LENGTH)
+#define bfin_write_CAN_MB17_LENGTH(val) bfin_write16(CAN_MB17_LENGTH, val)
+#define bfin_read_CAN_MB17_TIMESTAMP() bfin_read16(CAN_MB17_TIMESTAMP)
+#define bfin_write_CAN_MB17_TIMESTAMP(val) bfin_write16(CAN_MB17_TIMESTAMP, val)
+#define bfin_read_CAN_MB17_ID0()       bfin_read16(CAN_MB17_ID0)
+#define bfin_write_CAN_MB17_ID0(val)   bfin_write16(CAN_MB17_ID0, val)
+#define bfin_read_CAN_MB17_ID1()       bfin_read16(CAN_MB17_ID1)
+#define bfin_write_CAN_MB17_ID1(val)   bfin_write16(CAN_MB17_ID1, val)
+#define bfin_read_CAN_MB18_DATA0()     bfin_read16(CAN_MB18_DATA0)
+#define bfin_write_CAN_MB18_DATA0(val) bfin_write16(CAN_MB18_DATA0, val)
+#define bfin_read_CAN_MB18_DATA1()     bfin_read16(CAN_MB18_DATA1)
+#define bfin_write_CAN_MB18_DATA1(val) bfin_write16(CAN_MB18_DATA1, val)
+#define bfin_read_CAN_MB18_DATA2()     bfin_read16(CAN_MB18_DATA2)
+#define bfin_write_CAN_MB18_DATA2(val) bfin_write16(CAN_MB18_DATA2, val)
+#define bfin_read_CAN_MB18_DATA3()     bfin_read16(CAN_MB18_DATA3)
+#define bfin_write_CAN_MB18_DATA3(val) bfin_write16(CAN_MB18_DATA3, val)
+#define bfin_read_CAN_MB18_LENGTH()    bfin_read16(CAN_MB18_LENGTH)
+#define bfin_write_CAN_MB18_LENGTH(val) bfin_write16(CAN_MB18_LENGTH, val)
+#define bfin_read_CAN_MB18_TIMESTAMP() bfin_read16(CAN_MB18_TIMESTAMP)
+#define bfin_write_CAN_MB18_TIMESTAMP(val) bfin_write16(CAN_MB18_TIMESTAMP, val)
+#define bfin_read_CAN_MB18_ID0()       bfin_read16(CAN_MB18_ID0)
+#define bfin_write_CAN_MB18_ID0(val)   bfin_write16(CAN_MB18_ID0, val)
+#define bfin_read_CAN_MB18_ID1()       bfin_read16(CAN_MB18_ID1)
+#define bfin_write_CAN_MB18_ID1(val)   bfin_write16(CAN_MB18_ID1, val)
+#define bfin_read_CAN_MB19_DATA0()     bfin_read16(CAN_MB19_DATA0)
+#define bfin_write_CAN_MB19_DATA0(val) bfin_write16(CAN_MB19_DATA0, val)
+#define bfin_read_CAN_MB19_DATA1()     bfin_read16(CAN_MB19_DATA1)
+#define bfin_write_CAN_MB19_DATA1(val) bfin_write16(CAN_MB19_DATA1, val)
+#define bfin_read_CAN_MB19_DATA2()     bfin_read16(CAN_MB19_DATA2)
+#define bfin_write_CAN_MB19_DATA2(val) bfin_write16(CAN_MB19_DATA2, val)
+#define bfin_read_CAN_MB19_DATA3()     bfin_read16(CAN_MB19_DATA3)
+#define bfin_write_CAN_MB19_DATA3(val) bfin_write16(CAN_MB19_DATA3, val)
+#define bfin_read_CAN_MB19_LENGTH()    bfin_read16(CAN_MB19_LENGTH)
+#define bfin_write_CAN_MB19_LENGTH(val) bfin_write16(CAN_MB19_LENGTH, val)
+#define bfin_read_CAN_MB19_TIMESTAMP() bfin_read16(CAN_MB19_TIMESTAMP)
+#define bfin_write_CAN_MB19_TIMESTAMP(val) bfin_write16(CAN_MB19_TIMESTAMP, val)
+#define bfin_read_CAN_MB19_ID0()       bfin_read16(CAN_MB19_ID0)
+#define bfin_write_CAN_MB19_ID0(val)   bfin_write16(CAN_MB19_ID0, val)
+#define bfin_read_CAN_MB19_ID1()       bfin_read16(CAN_MB19_ID1)
+#define bfin_write_CAN_MB19_ID1(val)   bfin_write16(CAN_MB19_ID1, val)
+#define bfin_read_CAN_MB20_DATA0()     bfin_read16(CAN_MB20_DATA0)
+#define bfin_write_CAN_MB20_DATA0(val) bfin_write16(CAN_MB20_DATA0, val)
+#define bfin_read_CAN_MB20_DATA1()     bfin_read16(CAN_MB20_DATA1)
+#define bfin_write_CAN_MB20_DATA1(val) bfin_write16(CAN_MB20_DATA1, val)
+#define bfin_read_CAN_MB20_DATA2()     bfin_read16(CAN_MB20_DATA2)
+#define bfin_write_CAN_MB20_DATA2(val) bfin_write16(CAN_MB20_DATA2, val)
+#define bfin_read_CAN_MB20_DATA3()     bfin_read16(CAN_MB20_DATA3)
+#define bfin_write_CAN_MB20_DATA3(val) bfin_write16(CAN_MB20_DATA3, val)
+#define bfin_read_CAN_MB20_LENGTH()    bfin_read16(CAN_MB20_LENGTH)
+#define bfin_write_CAN_MB20_LENGTH(val) bfin_write16(CAN_MB20_LENGTH, val)
+#define bfin_read_CAN_MB20_TIMESTAMP() bfin_read16(CAN_MB20_TIMESTAMP)
+#define bfin_write_CAN_MB20_TIMESTAMP(val) bfin_write16(CAN_MB20_TIMESTAMP, val)
+#define bfin_read_CAN_MB20_ID0()       bfin_read16(CAN_MB20_ID0)
+#define bfin_write_CAN_MB20_ID0(val)   bfin_write16(CAN_MB20_ID0, val)
+#define bfin_read_CAN_MB20_ID1()       bfin_read16(CAN_MB20_ID1)
+#define bfin_write_CAN_MB20_ID1(val)   bfin_write16(CAN_MB20_ID1, val)
+#define bfin_read_CAN_MB21_DATA0()     bfin_read16(CAN_MB21_DATA0)
+#define bfin_write_CAN_MB21_DATA0(val) bfin_write16(CAN_MB21_DATA0, val)
+#define bfin_read_CAN_MB21_DATA1()     bfin_read16(CAN_MB21_DATA1)
+#define bfin_write_CAN_MB21_DATA1(val) bfin_write16(CAN_MB21_DATA1, val)
+#define bfin_read_CAN_MB21_DATA2()     bfin_read16(CAN_MB21_DATA2)
+#define bfin_write_CAN_MB21_DATA2(val) bfin_write16(CAN_MB21_DATA2, val)
+#define bfin_read_CAN_MB21_DATA3()     bfin_read16(CAN_MB21_DATA3)
+#define bfin_write_CAN_MB21_DATA3(val) bfin_write16(CAN_MB21_DATA3, val)
+#define bfin_read_CAN_MB21_LENGTH()    bfin_read16(CAN_MB21_LENGTH)
+#define bfin_write_CAN_MB21_LENGTH(val) bfin_write16(CAN_MB21_LENGTH, val)
+#define bfin_read_CAN_MB21_TIMESTAMP() bfin_read16(CAN_MB21_TIMESTAMP)
+#define bfin_write_CAN_MB21_TIMESTAMP(val) bfin_write16(CAN_MB21_TIMESTAMP, val)
+#define bfin_read_CAN_MB21_ID0()       bfin_read16(CAN_MB21_ID0)
+#define bfin_write_CAN_MB21_ID0(val)   bfin_write16(CAN_MB21_ID0, val)
+#define bfin_read_CAN_MB21_ID1()       bfin_read16(CAN_MB21_ID1)
+#define bfin_write_CAN_MB21_ID1(val)   bfin_write16(CAN_MB21_ID1, val)
+#define bfin_read_CAN_MB22_DATA0()     bfin_read16(CAN_MB22_DATA0)
+#define bfin_write_CAN_MB22_DATA0(val) bfin_write16(CAN_MB22_DATA0, val)
+#define bfin_read_CAN_MB22_DATA1()     bfin_read16(CAN_MB22_DATA1)
+#define bfin_write_CAN_MB22_DATA1(val) bfin_write16(CAN_MB22_DATA1, val)
+#define bfin_read_CAN_MB22_DATA2()     bfin_read16(CAN_MB22_DATA2)
+#define bfin_write_CAN_MB22_DATA2(val) bfin_write16(CAN_MB22_DATA2, val)
+#define bfin_read_CAN_MB22_DATA3()     bfin_read16(CAN_MB22_DATA3)
+#define bfin_write_CAN_MB22_DATA3(val) bfin_write16(CAN_MB22_DATA3, val)
+#define bfin_read_CAN_MB22_LENGTH()    bfin_read16(CAN_MB22_LENGTH)
+#define bfin_write_CAN_MB22_LENGTH(val) bfin_write16(CAN_MB22_LENGTH, val)
+#define bfin_read_CAN_MB22_TIMESTAMP() bfin_read16(CAN_MB22_TIMESTAMP)
+#define bfin_write_CAN_MB22_TIMESTAMP(val) bfin_write16(CAN_MB22_TIMESTAMP, val)
+#define bfin_read_CAN_MB22_ID0()       bfin_read16(CAN_MB22_ID0)
+#define bfin_write_CAN_MB22_ID0(val)   bfin_write16(CAN_MB22_ID0, val)
+#define bfin_read_CAN_MB22_ID1()       bfin_read16(CAN_MB22_ID1)
+#define bfin_write_CAN_MB22_ID1(val)   bfin_write16(CAN_MB22_ID1, val)
+#define bfin_read_CAN_MB23_DATA0()     bfin_read16(CAN_MB23_DATA0)
+#define bfin_write_CAN_MB23_DATA0(val) bfin_write16(CAN_MB23_DATA0, val)
+#define bfin_read_CAN_MB23_DATA1()     bfin_read16(CAN_MB23_DATA1)
+#define bfin_write_CAN_MB23_DATA1(val) bfin_write16(CAN_MB23_DATA1, val)
+#define bfin_read_CAN_MB23_DATA2()     bfin_read16(CAN_MB23_DATA2)
+#define bfin_write_CAN_MB23_DATA2(val) bfin_write16(CAN_MB23_DATA2, val)
+#define bfin_read_CAN_MB23_DATA3()     bfin_read16(CAN_MB23_DATA3)
+#define bfin_write_CAN_MB23_DATA3(val) bfin_write16(CAN_MB23_DATA3, val)
+#define bfin_read_CAN_MB23_LENGTH()    bfin_read16(CAN_MB23_LENGTH)
+#define bfin_write_CAN_MB23_LENGTH(val) bfin_write16(CAN_MB23_LENGTH, val)
+#define bfin_read_CAN_MB23_TIMESTAMP() bfin_read16(CAN_MB23_TIMESTAMP)
+#define bfin_write_CAN_MB23_TIMESTAMP(val) bfin_write16(CAN_MB23_TIMESTAMP, val)
+#define bfin_read_CAN_MB23_ID0()       bfin_read16(CAN_MB23_ID0)
+#define bfin_write_CAN_MB23_ID0(val)   bfin_write16(CAN_MB23_ID0, val)
+#define bfin_read_CAN_MB23_ID1()       bfin_read16(CAN_MB23_ID1)
+#define bfin_write_CAN_MB23_ID1(val)   bfin_write16(CAN_MB23_ID1, val)
+#define bfin_read_CAN_MB24_DATA0()     bfin_read16(CAN_MB24_DATA0)
+#define bfin_write_CAN_MB24_DATA0(val) bfin_write16(CAN_MB24_DATA0, val)
+#define bfin_read_CAN_MB24_DATA1()     bfin_read16(CAN_MB24_DATA1)
+#define bfin_write_CAN_MB24_DATA1(val) bfin_write16(CAN_MB24_DATA1, val)
+#define bfin_read_CAN_MB24_DATA2()     bfin_read16(CAN_MB24_DATA2)
+#define bfin_write_CAN_MB24_DATA2(val) bfin_write16(CAN_MB24_DATA2, val)
+#define bfin_read_CAN_MB24_DATA3()     bfin_read16(CAN_MB24_DATA3)
+#define bfin_write_CAN_MB24_DATA3(val) bfin_write16(CAN_MB24_DATA3, val)
+#define bfin_read_CAN_MB24_LENGTH()    bfin_read16(CAN_MB24_LENGTH)
+#define bfin_write_CAN_MB24_LENGTH(val) bfin_write16(CAN_MB24_LENGTH, val)
+#define bfin_read_CAN_MB24_TIMESTAMP() bfin_read16(CAN_MB24_TIMESTAMP)
+#define bfin_write_CAN_MB24_TIMESTAMP(val) bfin_write16(CAN_MB24_TIMESTAMP, val)
+#define bfin_read_CAN_MB24_ID0()       bfin_read16(CAN_MB24_ID0)
+#define bfin_write_CAN_MB24_ID0(val)   bfin_write16(CAN_MB24_ID0, val)
+#define bfin_read_CAN_MB24_ID1()       bfin_read16(CAN_MB24_ID1)
+#define bfin_write_CAN_MB24_ID1(val)   bfin_write16(CAN_MB24_ID1, val)
+#define bfin_read_CAN_MB25_DATA0()     bfin_read16(CAN_MB25_DATA0)
+#define bfin_write_CAN_MB25_DATA0(val) bfin_write16(CAN_MB25_DATA0, val)
+#define bfin_read_CAN_MB25_DATA1()     bfin_read16(CAN_MB25_DATA1)
+#define bfin_write_CAN_MB25_DATA1(val) bfin_write16(CAN_MB25_DATA1, val)
+#define bfin_read_CAN_MB25_DATA2()     bfin_read16(CAN_MB25_DATA2)
+#define bfin_write_CAN_MB25_DATA2(val) bfin_write16(CAN_MB25_DATA2, val)
+#define bfin_read_CAN_MB25_DATA3()     bfin_read16(CAN_MB25_DATA3)
+#define bfin_write_CAN_MB25_DATA3(val) bfin_write16(CAN_MB25_DATA3, val)
+#define bfin_read_CAN_MB25_LENGTH()    bfin_read16(CAN_MB25_LENGTH)
+#define bfin_write_CAN_MB25_LENGTH(val) bfin_write16(CAN_MB25_LENGTH, val)
+#define bfin_read_CAN_MB25_TIMESTAMP() bfin_read16(CAN_MB25_TIMESTAMP)
+#define bfin_write_CAN_MB25_TIMESTAMP(val) bfin_write16(CAN_MB25_TIMESTAMP, val)
+#define bfin_read_CAN_MB25_ID0()       bfin_read16(CAN_MB25_ID0)
+#define bfin_write_CAN_MB25_ID0(val)   bfin_write16(CAN_MB25_ID0, val)
+#define bfin_read_CAN_MB25_ID1()       bfin_read16(CAN_MB25_ID1)
+#define bfin_write_CAN_MB25_ID1(val)   bfin_write16(CAN_MB25_ID1, val)
+#define bfin_read_CAN_MB26_DATA0()     bfin_read16(CAN_MB26_DATA0)
+#define bfin_write_CAN_MB26_DATA0(val) bfin_write16(CAN_MB26_DATA0, val)
+#define bfin_read_CAN_MB26_DATA1()     bfin_read16(CAN_MB26_DATA1)
+#define bfin_write_CAN_MB26_DATA1(val) bfin_write16(CAN_MB26_DATA1, val)
+#define bfin_read_CAN_MB26_DATA2()     bfin_read16(CAN_MB26_DATA2)
+#define bfin_write_CAN_MB26_DATA2(val) bfin_write16(CAN_MB26_DATA2, val)
+#define bfin_read_CAN_MB26_DATA3()     bfin_read16(CAN_MB26_DATA3)
+#define bfin_write_CAN_MB26_DATA3(val) bfin_write16(CAN_MB26_DATA3, val)
+#define bfin_read_CAN_MB26_LENGTH()    bfin_read16(CAN_MB26_LENGTH)
+#define bfin_write_CAN_MB26_LENGTH(val) bfin_write16(CAN_MB26_LENGTH, val)
+#define bfin_read_CAN_MB26_TIMESTAMP() bfin_read16(CAN_MB26_TIMESTAMP)
+#define bfin_write_CAN_MB26_TIMESTAMP(val) bfin_write16(CAN_MB26_TIMESTAMP, val)
+#define bfin_read_CAN_MB26_ID0()       bfin_read16(CAN_MB26_ID0)
+#define bfin_write_CAN_MB26_ID0(val)   bfin_write16(CAN_MB26_ID0, val)
+#define bfin_read_CAN_MB26_ID1()       bfin_read16(CAN_MB26_ID1)
+#define bfin_write_CAN_MB26_ID1(val)   bfin_write16(CAN_MB26_ID1, val)
+#define bfin_read_CAN_MB27_DATA0()     bfin_read16(CAN_MB27_DATA0)
+#define bfin_write_CAN_MB27_DATA0(val) bfin_write16(CAN_MB27_DATA0, val)
+#define bfin_read_CAN_MB27_DATA1()     bfin_read16(CAN_MB27_DATA1)
+#define bfin_write_CAN_MB27_DATA1(val) bfin_write16(CAN_MB27_DATA1, val)
+#define bfin_read_CAN_MB27_DATA2()     bfin_read16(CAN_MB27_DATA2)
+#define bfin_write_CAN_MB27_DATA2(val) bfin_write16(CAN_MB27_DATA2, val)
+#define bfin_read_CAN_MB27_DATA3()     bfin_read16(CAN_MB27_DATA3)
+#define bfin_write_CAN_MB27_DATA3(val) bfin_write16(CAN_MB27_DATA3, val)
+#define bfin_read_CAN_MB27_LENGTH()    bfin_read16(CAN_MB27_LENGTH)
+#define bfin_write_CAN_MB27_LENGTH(val) bfin_write16(CAN_MB27_LENGTH, val)
+#define bfin_read_CAN_MB27_TIMESTAMP() bfin_read16(CAN_MB27_TIMESTAMP)
+#define bfin_write_CAN_MB27_TIMESTAMP(val) bfin_write16(CAN_MB27_TIMESTAMP, val)
+#define bfin_read_CAN_MB27_ID0()       bfin_read16(CAN_MB27_ID0)
+#define bfin_write_CAN_MB27_ID0(val)   bfin_write16(CAN_MB27_ID0, val)
+#define bfin_read_CAN_MB27_ID1()       bfin_read16(CAN_MB27_ID1)
+#define bfin_write_CAN_MB27_ID1(val)   bfin_write16(CAN_MB27_ID1, val)
+#define bfin_read_CAN_MB28_DATA0()     bfin_read16(CAN_MB28_DATA0)
+#define bfin_write_CAN_MB28_DATA0(val) bfin_write16(CAN_MB28_DATA0, val)
+#define bfin_read_CAN_MB28_DATA1()     bfin_read16(CAN_MB28_DATA1)
+#define bfin_write_CAN_MB28_DATA1(val) bfin_write16(CAN_MB28_DATA1, val)
+#define bfin_read_CAN_MB28_DATA2()     bfin_read16(CAN_MB28_DATA2)
+#define bfin_write_CAN_MB28_DATA2(val) bfin_write16(CAN_MB28_DATA2, val)
+#define bfin_read_CAN_MB28_DATA3()     bfin_read16(CAN_MB28_DATA3)
+#define bfin_write_CAN_MB28_DATA3(val) bfin_write16(CAN_MB28_DATA3, val)
+#define bfin_read_CAN_MB28_LENGTH()    bfin_read16(CAN_MB28_LENGTH)
+#define bfin_write_CAN_MB28_LENGTH(val) bfin_write16(CAN_MB28_LENGTH, val)
+#define bfin_read_CAN_MB28_TIMESTAMP() bfin_read16(CAN_MB28_TIMESTAMP)
+#define bfin_write_CAN_MB28_TIMESTAMP(val) bfin_write16(CAN_MB28_TIMESTAMP, val)
+#define bfin_read_CAN_MB28_ID0()       bfin_read16(CAN_MB28_ID0)
+#define bfin_write_CAN_MB28_ID0(val)   bfin_write16(CAN_MB28_ID0, val)
+#define bfin_read_CAN_MB28_ID1()       bfin_read16(CAN_MB28_ID1)
+#define bfin_write_CAN_MB28_ID1(val)   bfin_write16(CAN_MB28_ID1, val)
+#define bfin_read_CAN_MB29_DATA0()     bfin_read16(CAN_MB29_DATA0)
+#define bfin_write_CAN_MB29_DATA0(val) bfin_write16(CAN_MB29_DATA0, val)
+#define bfin_read_CAN_MB29_DATA1()     bfin_read16(CAN_MB29_DATA1)
+#define bfin_write_CAN_MB29_DATA1(val) bfin_write16(CAN_MB29_DATA1, val)
+#define bfin_read_CAN_MB29_DATA2()     bfin_read16(CAN_MB29_DATA2)
+#define bfin_write_CAN_MB29_DATA2(val) bfin_write16(CAN_MB29_DATA2, val)
+#define bfin_read_CAN_MB29_DATA3()     bfin_read16(CAN_MB29_DATA3)
+#define bfin_write_CAN_MB29_DATA3(val) bfin_write16(CAN_MB29_DATA3, val)
+#define bfin_read_CAN_MB29_LENGTH()    bfin_read16(CAN_MB29_LENGTH)
+#define bfin_write_CAN_MB29_LENGTH(val) bfin_write16(CAN_MB29_LENGTH, val)
+#define bfin_read_CAN_MB29_TIMESTAMP() bfin_read16(CAN_MB29_TIMESTAMP)
+#define bfin_write_CAN_MB29_TIMESTAMP(val) bfin_write16(CAN_MB29_TIMESTAMP, val)
+#define bfin_read_CAN_MB29_ID0()       bfin_read16(CAN_MB29_ID0)
+#define bfin_write_CAN_MB29_ID0(val)   bfin_write16(CAN_MB29_ID0, val)
+#define bfin_read_CAN_MB29_ID1()       bfin_read16(CAN_MB29_ID1)
+#define bfin_write_CAN_MB29_ID1(val)   bfin_write16(CAN_MB29_ID1, val)
+#define bfin_read_CAN_MB30_DATA0()     bfin_read16(CAN_MB30_DATA0)
+#define bfin_write_CAN_MB30_DATA0(val) bfin_write16(CAN_MB30_DATA0, val)
+#define bfin_read_CAN_MB30_DATA1()     bfin_read16(CAN_MB30_DATA1)
+#define bfin_write_CAN_MB30_DATA1(val) bfin_write16(CAN_MB30_DATA1, val)
+#define bfin_read_CAN_MB30_DATA2()     bfin_read16(CAN_MB30_DATA2)
+#define bfin_write_CAN_MB30_DATA2(val) bfin_write16(CAN_MB30_DATA2, val)
+#define bfin_read_CAN_MB30_DATA3()     bfin_read16(CAN_MB30_DATA3)
+#define bfin_write_CAN_MB30_DATA3(val) bfin_write16(CAN_MB30_DATA3, val)
+#define bfin_read_CAN_MB30_LENGTH()    bfin_read16(CAN_MB30_LENGTH)
+#define bfin_write_CAN_MB30_LENGTH(val) bfin_write16(CAN_MB30_LENGTH, val)
+#define bfin_read_CAN_MB30_TIMESTAMP() bfin_read16(CAN_MB30_TIMESTAMP)
+#define bfin_write_CAN_MB30_TIMESTAMP(val) bfin_write16(CAN_MB30_TIMESTAMP, val)
+#define bfin_read_CAN_MB30_ID0()       bfin_read16(CAN_MB30_ID0)
+#define bfin_write_CAN_MB30_ID0(val)   bfin_write16(CAN_MB30_ID0, val)
+#define bfin_read_CAN_MB30_ID1()       bfin_read16(CAN_MB30_ID1)
+#define bfin_write_CAN_MB30_ID1(val)   bfin_write16(CAN_MB30_ID1, val)
+#define bfin_read_CAN_MB31_DATA0()     bfin_read16(CAN_MB31_DATA0)
+#define bfin_write_CAN_MB31_DATA0(val) bfin_write16(CAN_MB31_DATA0, val)
+#define bfin_read_CAN_MB31_DATA1()     bfin_read16(CAN_MB31_DATA1)
+#define bfin_write_CAN_MB31_DATA1(val) bfin_write16(CAN_MB31_DATA1, val)
+#define bfin_read_CAN_MB31_DATA2()     bfin_read16(CAN_MB31_DATA2)
+#define bfin_write_CAN_MB31_DATA2(val) bfin_write16(CAN_MB31_DATA2, val)
+#define bfin_read_CAN_MB31_DATA3()     bfin_read16(CAN_MB31_DATA3)
+#define bfin_write_CAN_MB31_DATA3(val) bfin_write16(CAN_MB31_DATA3, val)
+#define bfin_read_CAN_MB31_LENGTH()    bfin_read16(CAN_MB31_LENGTH)
+#define bfin_write_CAN_MB31_LENGTH(val) bfin_write16(CAN_MB31_LENGTH, val)
+#define bfin_read_CAN_MB31_TIMESTAMP() bfin_read16(CAN_MB31_TIMESTAMP)
+#define bfin_write_CAN_MB31_TIMESTAMP(val) bfin_write16(CAN_MB31_TIMESTAMP, val)
+#define bfin_read_CAN_MB31_ID0()       bfin_read16(CAN_MB31_ID0)
+#define bfin_write_CAN_MB31_ID0(val)   bfin_write16(CAN_MB31_ID0, val)
+#define bfin_read_CAN_MB31_ID1()       bfin_read16(CAN_MB31_ID1)
+#define bfin_write_CAN_MB31_ID1(val)   bfin_write16(CAN_MB31_ID1, val)
+#define bfin_read_PORTF_FER()          bfin_read16(PORTF_FER)
+#define bfin_write_PORTF_FER(val)      bfin_write16(PORTF_FER, val)
+#define bfin_read_PORTG_FER()          bfin_read16(PORTG_FER)
+#define bfin_write_PORTG_FER(val)      bfin_write16(PORTG_FER, val)
+#define bfin_read_PORTH_FER()          bfin_read16(PORTH_FER)
+#define bfin_write_PORTH_FER(val)      bfin_write16(PORTH_FER, val)
+#define bfin_read_PORT_MUX()           bfin_read16(PORT_MUX)
+#define bfin_write_PORT_MUX(val)       bfin_write16(PORT_MUX, val)
+#define bfin_read_HMDMA0_CONTROL()     bfin_read16(HMDMA0_CONTROL)
+#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
+#define bfin_read_HMDMA0_ECINIT()      bfin_read16(HMDMA0_ECINIT)
+#define bfin_write_HMDMA0_ECINIT(val)  bfin_write16(HMDMA0_ECINIT, val)
+#define bfin_read_HMDMA0_BCINIT()      bfin_read16(HMDMA0_BCINIT)
+#define bfin_write_HMDMA0_BCINIT(val)  bfin_write16(HMDMA0_BCINIT, val)
+#define bfin_read_HMDMA0_ECURGENT()    bfin_read16(HMDMA0_ECURGENT)
+#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
+#define bfin_read_HMDMA0_ECOVERFLOW()  bfin_read16(HMDMA0_ECOVERFLOW)
+#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
+#define bfin_read_HMDMA0_ECOUNT()      bfin_read16(HMDMA0_ECOUNT)
+#define bfin_write_HMDMA0_ECOUNT(val)  bfin_write16(HMDMA0_ECOUNT, val)
+#define bfin_read_HMDMA0_BCOUNT()      bfin_read16(HMDMA0_BCOUNT)
+#define bfin_write_HMDMA0_BCOUNT(val)  bfin_write16(HMDMA0_BCOUNT, val)
+#define bfin_read_HMDMA1_CONTROL()     bfin_read16(HMDMA1_CONTROL)
+#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
+#define bfin_read_HMDMA1_ECINIT()      bfin_read16(HMDMA1_ECINIT)
+#define bfin_write_HMDMA1_ECINIT(val)  bfin_write16(HMDMA1_ECINIT, val)
+#define bfin_read_HMDMA1_BCINIT()      bfin_read16(HMDMA1_BCINIT)
+#define bfin_write_HMDMA1_BCINIT(val)  bfin_write16(HMDMA1_BCINIT, val)
+#define bfin_read_HMDMA1_ECURGENT()    bfin_read16(HMDMA1_ECURGENT)
+#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
+#define bfin_read_HMDMA1_ECOVERFLOW()  bfin_read16(HMDMA1_ECOVERFLOW)
+#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
+#define bfin_read_HMDMA1_ECOUNT()      bfin_read16(HMDMA1_ECOUNT)
+#define bfin_write_HMDMA1_ECOUNT(val)  bfin_write16(HMDMA1_ECOUNT, val)
+#define bfin_read_HMDMA1_BCOUNT()      bfin_read16(HMDMA1_BCOUNT)
+#define bfin_write_HMDMA1_BCOUNT(val)  bfin_write16(HMDMA1_BCOUNT, val)
+#define bfin_read_CHIPID()             bfin_read32(CHIPID)
+#define bfin_write_CHIPID(val)         bfin_write32(CHIPID, val)
+#define bfin_read_DMA_TC_CNT()         bfin_read16(DMA_TC_CNT)
+#define bfin_write_DMA_TC_CNT(val)     bfin_write16(DMA_TC_CNT, val)
+#define bfin_read_DMA_TC_PER()         bfin_read16(DMA_TC_PER)
+#define bfin_write_DMA_TC_PER(val)     bfin_write16(DMA_TC_PER, val)
 
 #endif /* __BFIN_CDEF_ADSP_BF534_proc__ */
index e04676c14a1c76060f38e3ae053936476ca26aff..cb6a543d56fd2aa51ffb53b1590c53767757a3f3 100644 (file)
@@ -8,9 +8,815 @@
 
 #include "../mach-common/ADSP-EDN-core_def.h"
 
-#include "ADSP-EDN-BF534-extended_def.h"
+#define PLL_CTL                        0xFFC00000 /* PLL Control Register */
+#define PLL_DIV                        0xFFC00004 /* PLL Divide Register */
+#define VR_CTL                         0xFFC00008 /* Voltage Regulator Control Register */
+#define PLL_STAT                       0xFFC0000C /* PLL Status Register */
+#define PLL_LOCKCNT                    0xFFC00010 /* PLL Lock Count Register */
+#define SWRST                          0xFFC00100 /* Software Reset Register */
+#define SYSCR                          0xFFC00104 /* System Configuration Register */
+#define SIC_RVECT                      0xFFC00108 /* Interrupt Reset Vector Address Register */
+#define SIC_IMASK                      0xFFC0010C /* Interrupt Mask Register */
+#define SIC_IAR0                       0xFFC00110 /* Interrupt Assignment Register 0 */
+#define SIC_IAR1                       0xFFC00114 /* Interrupt Assignment Register 1 */
+#define SIC_IAR2                       0xFFC00118 /* Interrupt Assignment Register 2 */
+#define SIC_IAR3                       0xFFC0011C /* Interrupt Assignment Register 3 */
+#define SIC_ISR                        0xFFC00120 /* Interrupt Status Register */
+#define SIC_IWR                        0xFFC00124 /* Interrupt Wakeup Register */
+#define WDOG_CTL                       0xFFC00200 /* Watchdog Control Register */
+#define WDOG_CNT                       0xFFC00204 /* Watchdog Count Register */
+#define WDOG_STAT                      0xFFC00208 /* Watchdog Status Register */
+#define RTC_STAT                       0xFFC00300 /* RTC Status Register */
+#define RTC_ICTL                       0xFFC00304 /* RTC Interrupt Control Register */
+#define RTC_ISTAT                      0xFFC00308 /* RTC Interrupt Status Register */
+#define RTC_SWCNT                      0xFFC0030C /* RTC Stopwatch Count Register */
+#define RTC_ALARM                      0xFFC00310 /* RTC Alarm Time Register */
+#define RTC_PREN                       0xFFC00314 /* RTC Prescaler Enable Register */
+#define UART0_THR                      0xFFC00400 /* Transmit Holding register */
+#define UART0_RBR                      0xFFC00400 /* Receive Buffer register */
+#define UART0_DLL                      0xFFC00400 /* Divisor Latch (Low-Byte) */
+#define UART0_IER                      0xFFC00404 /* Interrupt Enable Register */
+#define UART0_DLH                      0xFFC00404 /* Divisor Latch (High-Byte) */
+#define UART0_IIR                      0xFFC00408 /* Interrupt Identification Register */
+#define UART0_LCR                      0xFFC0040C /* Line Control Register */
+#define UART0_MCR                      0xFFC00410 /* Modem Control Register */
+#define UART0_LSR                      0xFFC00414 /* Line Status Register */
+#define UART0_MSR                      0xFFC00418 /* Modem Status Register */
+#define UART0_SCR                      0xFFC0041C /* SCR Scratch Register */
+#define UART0_GCTL                     0xFFC00424 /* Global Control Register */
+#define SPI_CTL                        0xFFC00500 /* SPI Control Register */
+#define SPI_FLG                        0xFFC00504 /* SPI Flag register */
+#define SPI_STAT                       0xFFC00508 /* SPI Status register */
+#define SPI_TDBR                       0xFFC0050C /* SPI Transmit Data Buffer Register */
+#define SPI_RDBR                       0xFFC00510 /* SPI Receive Data Buffer Register */
+#define SPI_BAUD                       0xFFC00514 /* SPI Baud rate Register */
+#define SPI_SHADOW                     0xFFC00518 /* SPI_RDBR Shadow Register */
+#define TIMER0_CONFIG                  0xFFC00600 /* Timer 0 Configuration Register */
+#define TIMER0_COUNTER                 0xFFC00604 /* Timer 0 Counter Register */
+#define TIMER0_PERIOD                  0xFFC00608 /* Timer 0 Period Register */
+#define TIMER0_WIDTH                   0xFFC0060C /* Timer 0 Width Register */
+#define TIMER1_CONFIG                  0xFFC00610 /* Timer 1 Configuration Register */
+#define TIMER1_COUNTER                 0xFFC00614 /* Timer 1 Counter Register */
+#define TIMER1_PERIOD                  0xFFC00618 /* Timer 1 Period Register */
+#define TIMER1_WIDTH                   0xFFC0061C /* Timer 1 Width Register */
+#define TIMER2_CONFIG                  0xFFC00620 /* Timer 2 Configuration Register */
+#define TIMER2_COUNTER                 0xFFC00624 /* Timer 2 Counter Register */
+#define TIMER2_PERIOD                  0xFFC00628 /* Timer 2 Period Register */
+#define TIMER2_WIDTH                   0xFFC0062C /* Timer 2 Width Register */
+#define TIMER3_CONFIG                  0xFFC00630 /* Timer 3 Configuration Register */
+#define TIMER3_COUNTER                 0xFFC00634 /* Timer 3 Counter Register */
+#define TIMER3_PERIOD                  0xFFC00638 /* Timer 3 Period Register */
+#define TIMER3_WIDTH                   0xFFC0063C /* Timer 3 Width Register */
+#define TIMER4_CONFIG                  0xFFC00640 /* Timer 4 Configuration Register */
+#define TIMER4_COUNTER                 0xFFC00644 /* Timer 4 Counter Register */
+#define TIMER4_PERIOD                  0xFFC00648 /* Timer 4 Period Register */
+#define TIMER4_WIDTH                   0xFFC0064C /* Timer 4 Width Register */
+#define TIMER5_CONFIG                  0xFFC00650 /* Timer 5 Configuration Register */
+#define TIMER5_COUNTER                 0xFFC00654 /* Timer 5 Counter Register */
+#define TIMER5_PERIOD                  0xFFC00658 /* Timer 5 Period Register */
+#define TIMER5_WIDTH                   0xFFC0065C /* Timer 5 Width Register */
+#define TIMER6_CONFIG                  0xFFC00660 /* Timer 6 Configuration Register */
+#define TIMER6_COUNTER                 0xFFC00664 /* Timer 6 Counter Register */
+#define TIMER6_PERIOD                  0xFFC00668 /* Timer 6 Period Register */
+#define TIMER6_WIDTH                   0xFFC0066C /* Timer 6 Width Register\n */
+#define TIMER7_CONFIG                  0xFFC00670 /* Timer 7 Configuration Register */
+#define TIMER7_COUNTER                 0xFFC00674 /* Timer 7 Counter Register */
+#define TIMER7_PERIOD                  0xFFC00678 /* Timer 7 Period Register */
+#define TIMER7_WIDTH                   0xFFC0067C /* Timer 7 Width Register */
+#define TIMER_ENABLE                   0xFFC00680 /* Timer Enable Register */
+#define TIMER_DISABLE                  0xFFC00684 /* Timer Disable Register */
+#define TIMER_STATUS                   0xFFC00688 /* Timer Status Register */
+#define PORTFIO                        0xFFC00700 /* Port F I/O Pin State Specify Register */
+#define PORTFIO_CLEAR                  0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register */
+#define PORTFIO_SET                    0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register */
+#define PORTFIO_TOGGLE                 0xFFC0070C /* Port F I/O Pin State Toggle Register */
+#define PORTFIO_MASKA                  0xFFC00710 /* Port F I/O Mask State Specify Interrupt A Register */
+#define PORTFIO_MASKA_CLEAR            0xFFC00714 /* Port F I/O Mask Disable Interrupt A Register */
+#define PORTFIO_MASKA_SET              0xFFC00718 /* Port F I/O Mask Enable Interrupt A Register */
+#define PORTFIO_MASKA_TOGGLE           0xFFC0071C /* Port F I/O Mask Toggle Enable Interrupt A Register */
+#define PORTFIO_MASKB                  0xFFC00720 /* Port F I/O Mask State Specify Interrupt B Register */
+#define PORTFIO_MASKB_CLEAR            0xFFC00724 /* Port F I/O Mask Disable Interrupt B Register */
+#define PORTFIO_MASKB_SET              0xFFC00728 /* Port F I/O Mask Enable Interrupt B Register */
+#define PORTFIO_MASKB_TOGGLE           0xFFC0072C /* Port F I/O Mask Toggle Enable Interrupt B Register */
+#define PORTFIO_DIR                    0xFFC00730 /* Port F I/O Direction Register */
+#define PORTFIO_POLAR                  0xFFC00734 /* Port F I/O Source Polarity Register */
+#define PORTFIO_EDGE                   0xFFC00738 /* Port F I/O Source Sensitivity Register */
+#define PORTFIO_BOTH                   0xFFC0073C /* Port F I/O Set on BOTH Edges Register */
+#define PORTFIO_INEN                   0xFFC00740 /* Port F I/O Input Enable Register  */
+#define SPORT0_TCR1                    0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
+#define SPORT0_TCR2                    0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
+#define SPORT0_TCLKDIV                 0xFFC00808 /* SPORT0 Transmit Clock Divider */
+#define SPORT0_TFSDIV                  0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
+#define SPORT0_TX                      0xFFC00810 /* SPORT0 TX Data Register */
+#define SPORT0_RX                      0xFFC00818 /* SPORT0 RX Data Register */
+#define SPORT0_RCR1                    0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
+#define SPORT0_RCR2                    0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
+#define SPORT0_RCLKDIV                 0xFFC00828 /* SPORT0 Receive Clock Divider */
+#define SPORT0_RFSDIV                  0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
+#define SPORT0_STAT                    0xFFC00830 /* SPORT0 Status Register */
+#define SPORT0_CHNL                    0xFFC00834 /* SPORT0 Current Channel Register */
+#define SPORT0_MCMC1                   0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
+#define SPORT0_MCMC2                   0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
+#define SPORT0_MTCS0                   0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
+#define SPORT0_MTCS1                   0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
+#define SPORT0_MTCS2                   0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
+#define SPORT0_MTCS3                   0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
+#define SPORT0_MRCS0                   0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
+#define SPORT0_MRCS1                   0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
+#define SPORT0_MRCS2                   0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
+#define SPORT0_MRCS3                   0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
+#define SPORT1_TCR1                    0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
+#define SPORT1_TCR2                    0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
+#define SPORT1_TCLKDIV                 0xFFC00908 /* SPORT1 Transmit Clock Divider */
+#define SPORT1_TFSDIV                  0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
+#define SPORT1_TX                      0xFFC00910 /* SPORT1 TX Data Register */
+#define SPORT1_RX                      0xFFC00918 /* SPORT1 RX Data Register */
+#define SPORT1_RCR1                    0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
+#define SPORT1_RCR2                    0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
+#define SPORT1_RCLKDIV                 0xFFC00928 /* SPORT1 Receive Clock Divider */
+#define SPORT1_RFSDIV                  0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
+#define SPORT1_STAT                    0xFFC00930 /* SPORT1 Status Register */
+#define SPORT1_CHNL                    0xFFC00934 /* SPORT1 Current Channel Register */
+#define SPORT1_MCMC1                   0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
+#define SPORT1_MCMC2                   0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
+#define SPORT1_MTCS0                   0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
+#define SPORT1_MTCS1                   0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
+#define SPORT1_MTCS2                   0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
+#define SPORT1_MTCS3                   0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
+#define SPORT1_MRCS0                   0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
+#define SPORT1_MRCS1                   0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
+#define SPORT1_MRCS2                   0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
+#define SPORT1_MRCS3                   0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
+#define EBIU_AMGCTL                    0xFFC00A00 /* Asynchronous Memory Global Control Register */
+#define EBIU_AMBCTL0                   0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
+#define EBIU_AMBCTL1                   0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
+#define EBIU_SDGCTL                    0xFFC00A10 /* SDRAM Global Control Register */
+#define EBIU_SDBCTL                    0xFFC00A14 /* SDRAM Bank Control Register */
+#define EBIU_SDRRC                     0xFFC00A18 /* SDRAM Refresh Rate Control Register */
+#define EBIU_SDSTAT                    0xFFC00A1C /* SDRAM Status Register */
+#define DMA0_NEXT_DESC_PTR             0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
+#define DMA0_START_ADDR                0xFFC00C04 /* DMA Channel 0 Start Address Register */
+#define DMA0_CONFIG                    0xFFC00C08 /* DMA Channel 0 Configuration Register */
+#define DMA0_X_COUNT                   0xFFC00C10 /* DMA Channel 0 X Count Register */
+#define DMA0_X_MODIFY                  0xFFC00C14 /* DMA Channel 0 X Modify Register */
+#define DMA0_Y_COUNT                   0xFFC00C18 /* DMA Channel 0 Y Count Register */
+#define DMA0_Y_MODIFY                  0xFFC00C1C /* DMA Channel 0 Y Modify Register */
+#define DMA0_CURR_DESC_PTR             0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
+#define DMA0_CURR_ADDR                 0xFFC00C24 /* DMA Channel 0 Current Address Register */
+#define DMA0_IRQ_STATUS                0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
+#define DMA0_PERIPHERAL_MAP            0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
+#define DMA0_CURR_X_COUNT              0xFFC00C30 /* DMA Channel 0 Current X Count Register */
+#define DMA0_CURR_Y_COUNT              0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
+#define DMA1_NEXT_DESC_PTR             0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
+#define DMA1_START_ADDR                0xFFC00C44 /* DMA Channel 1 Start Address Register */
+#define DMA1_CONFIG                    0xFFC00C48 /* DMA Channel 1 Configuration Register */
+#define DMA1_X_COUNT                   0xFFC00C50 /* DMA Channel 1 X Count Register */
+#define DMA1_X_MODIFY                  0xFFC00C54 /* DMA Channel 1 X Modify Register */
+#define DMA1_Y_COUNT                   0xFFC00C58 /* DMA Channel 1 Y Count Register */
+#define DMA1_Y_MODIFY                  0xFFC00C5C /* DMA Channel 1 Y Modify Register */
+#define DMA1_CURR_DESC_PTR             0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
+#define DMA1_CURR_ADDR                 0xFFC00C64 /* DMA Channel 1 Current Address Register */
+#define DMA1_IRQ_STATUS                0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
+#define DMA1_PERIPHERAL_MAP            0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
+#define DMA1_CURR_X_COUNT              0xFFC00C70 /* DMA Channel 1 Current X Count Register */
+#define DMA1_CURR_Y_COUNT              0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
+#define DMA2_NEXT_DESC_PTR             0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
+#define DMA2_START_ADDR                0xFFC00C84 /* DMA Channel 2 Start Address Register */
+#define DMA2_CONFIG                    0xFFC00C88 /* DMA Channel 2 Configuration Register */
+#define DMA2_X_COUNT                   0xFFC00C90 /* DMA Channel 2 X Count Register */
+#define DMA2_X_MODIFY                  0xFFC00C94 /* DMA Channel 2 X Modify Register */
+#define DMA2_Y_COUNT                   0xFFC00C98 /* DMA Channel 2 Y Count Register */
+#define DMA2_Y_MODIFY                  0xFFC00C9C /* DMA Channel 2 Y Modify Register */
+#define DMA2_CURR_DESC_PTR             0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
+#define DMA2_CURR_ADDR                 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
+#define DMA2_IRQ_STATUS                0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
+#define DMA2_PERIPHERAL_MAP            0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
+#define DMA2_CURR_X_COUNT              0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
+#define DMA2_CURR_Y_COUNT              0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
+#define DMA3_NEXT_DESC_PTR             0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
+#define DMA3_START_ADDR                0xFFC00CC4 /* DMA Channel 3 Start Address Register */
+#define DMA3_CONFIG                    0xFFC00CC8 /* DMA Channel 3 Configuration Register */
+#define DMA3_X_COUNT                   0xFFC00CD0 /* DMA Channel 3 X Count Register */
+#define DMA3_X_MODIFY                  0xFFC00CD4 /* DMA Channel 3 X Modify Register */
+#define DMA3_Y_COUNT                   0xFFC00CD8 /* DMA Channel 3 Y Count Register */
+#define DMA3_Y_MODIFY                  0xFFC00CDC /* DMA Channel 3 Y Modify Register */
+#define DMA3_CURR_DESC_PTR             0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
+#define DMA3_CURR_ADDR                 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
+#define DMA3_IRQ_STATUS                0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
+#define DMA3_PERIPHERAL_MAP            0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
+#define DMA3_CURR_X_COUNT              0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
+#define DMA3_CURR_Y_COUNT              0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
+#define DMA4_NEXT_DESC_PTR             0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
+#define DMA4_START_ADDR                0xFFC00D04 /* DMA Channel 4 Start Address Register */
+#define DMA4_CONFIG                    0xFFC00D08 /* DMA Channel 4 Configuration Register */
+#define DMA4_X_COUNT                   0xFFC00D10 /* DMA Channel 4 X Count Register */
+#define DMA4_X_MODIFY                  0xFFC00D14 /* DMA Channel 4 X Modify Register */
+#define DMA4_Y_COUNT                   0xFFC00D18 /* DMA Channel 4 Y Count Register */
+#define DMA4_Y_MODIFY                  0xFFC00D1C /* DMA Channel 4 Y Modify Register */
+#define DMA4_CURR_DESC_PTR             0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
+#define DMA4_CURR_ADDR                 0xFFC00D24 /* DMA Channel 4 Current Address Register */
+#define DMA4_IRQ_STATUS                0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
+#define DMA4_PERIPHERAL_MAP            0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
+#define DMA4_CURR_X_COUNT              0xFFC00D30 /* DMA Channel 4 Current X Count Register */
+#define DMA4_CURR_Y_COUNT              0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
+#define DMA5_NEXT_DESC_PTR             0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
+#define DMA5_START_ADDR                0xFFC00D44 /* DMA Channel 5 Start Address Register */
+#define DMA5_CONFIG                    0xFFC00D48 /* DMA Channel 5 Configuration Register */
+#define DMA5_X_COUNT                   0xFFC00D50 /* DMA Channel 5 X Count Register */
+#define DMA5_X_MODIFY                  0xFFC00D54 /* DMA Channel 5 X Modify Register */
+#define DMA5_Y_COUNT                   0xFFC00D58 /* DMA Channel 5 Y Count Register */
+#define DMA5_Y_MODIFY                  0xFFC00D5C /* DMA Channel 5 Y Modify Register */
+#define DMA5_CURR_DESC_PTR             0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
+#define DMA5_CURR_ADDR                 0xFFC00D64 /* DMA Channel 5 Current Address Register */
+#define DMA5_IRQ_STATUS                0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
+#define DMA5_PERIPHERAL_MAP            0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
+#define DMA5_CURR_X_COUNT              0xFFC00D70 /* DMA Channel 5 Current X Count Register */
+#define DMA5_CURR_Y_COUNT              0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
+#define DMA6_NEXT_DESC_PTR             0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
+#define DMA6_START_ADDR                0xFFC00D84 /* DMA Channel 6 Start Address Register */
+#define DMA6_CONFIG                    0xFFC00D88 /* DMA Channel 6 Configuration Register */
+#define DMA6_X_COUNT                   0xFFC00D90 /* DMA Channel 6 X Count Register */
+#define DMA6_X_MODIFY                  0xFFC00D94 /* DMA Channel 6 X Modify Register */
+#define DMA6_Y_COUNT                   0xFFC00D98 /* DMA Channel 6 Y Count Register */
+#define DMA6_Y_MODIFY                  0xFFC00D9C /* DMA Channel 6 Y Modify Register */
+#define DMA6_CURR_DESC_PTR             0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
+#define DMA6_CURR_ADDR                 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
+#define DMA6_IRQ_STATUS                0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
+#define DMA6_PERIPHERAL_MAP            0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
+#define DMA6_CURR_X_COUNT              0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
+#define DMA6_CURR_Y_COUNT              0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
+#define DMA7_NEXT_DESC_PTR             0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
+#define DMA7_START_ADDR                0xFFC00DC4 /* DMA Channel 7 Start Address Register */
+#define DMA7_CONFIG                    0xFFC00DC8 /* DMA Channel 7 Configuration Register */
+#define DMA7_X_COUNT                   0xFFC00DD0 /* DMA Channel 7 X Count Register */
+#define DMA7_X_MODIFY                  0xFFC00DD4 /* DMA Channel 7 X Modify Register */
+#define DMA7_Y_COUNT                   0xFFC00DD8 /* DMA Channel 7 Y Count Register */
+#define DMA7_Y_MODIFY                  0xFFC00DDC /* DMA Channel 7 Y Modify Register */
+#define DMA7_CURR_DESC_PTR             0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
+#define DMA7_CURR_ADDR                 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
+#define DMA7_IRQ_STATUS                0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
+#define DMA7_PERIPHERAL_MAP            0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
+#define DMA7_CURR_X_COUNT              0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
+#define DMA7_CURR_Y_COUNT              0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
+#define DMA8_NEXT_DESC_PTR             0xFFC00E00 /* DMA Channel 8 Next Descriptor Pointer Register */
+#define DMA8_START_ADDR                0xFFC00E04 /* DMA Channel 8 Start Address Register */
+#define DMA8_CONFIG                    0xFFC00E08 /* DMA Channel 8 Configuration Register */
+#define DMA8_X_COUNT                   0xFFC00E10 /* DMA Channel 8 X Count Register */
+#define DMA8_X_MODIFY                  0xFFC00E14 /* DMA Channel 8 X Modify Register */
+#define DMA8_Y_COUNT                   0xFFC00E18 /* DMA Channel 8 Y Count Register */
+#define DMA8_Y_MODIFY                  0xFFC00E1C /* DMA Channel 8 Y Modify Register */
+#define DMA8_CURR_DESC_PTR             0xFFC00E20 /* DMA Channel 8 Current Descriptor Pointer Register */
+#define DMA8_CURR_ADDR                 0xFFC00E24 /* DMA Channel 8 Current Address Register */
+#define DMA8_IRQ_STATUS                0xFFC00E28 /* DMA Channel 8 Interrupt/Status Register */
+#define DMA8_PERIPHERAL_MAP            0xFFC00E2C /* DMA Channel 8 Peripheral Map Register */
+#define DMA8_CURR_X_COUNT              0xFFC00E30 /* DMA Channel 8 Current X Count Register */
+#define DMA8_CURR_Y_COUNT              0xFFC00E38 /* DMA Channel 8 Current Y Count Register */
+#define DMA9_NEXT_DESC_PTR             0xFFC00E40 /* DMA Channel 9 Next Descriptor Pointer Register */
+#define DMA9_START_ADDR                0xFFC00E44 /* DMA Channel 9 Start Address Register */
+#define DMA9_CONFIG                    0xFFC00E48 /* DMA Channel 9 Configuration Register */
+#define DMA9_X_COUNT                   0xFFC00E50 /* DMA Channel 9 X Count Register */
+#define DMA9_X_MODIFY                  0xFFC00E54 /* DMA Channel 9 X Modify Register */
+#define DMA9_Y_COUNT                   0xFFC00E58 /* DMA Channel 9 Y Count Register */
+#define DMA9_Y_MODIFY                  0xFFC00E5C /* DMA Channel 9 Y Modify Register */
+#define DMA9_CURR_DESC_PTR             0xFFC00E60 /* DMA Channel 9 Current Descriptor Pointer Register */
+#define DMA9_CURR_ADDR                 0xFFC00E64 /* DMA Channel 9 Current Address Register */
+#define DMA9_IRQ_STATUS                0xFFC00E68 /* DMA Channel 9 Interrupt/Status Register */
+#define DMA9_PERIPHERAL_MAP            0xFFC00E6C /* DMA Channel 9 Peripheral Map Register */
+#define DMA9_CURR_X_COUNT              0xFFC00E70 /* DMA Channel 9 Current X Count Register */
+#define DMA9_CURR_Y_COUNT              0xFFC00E78 /* DMA Channel 9 Current Y Count Register */
+#define DMA10_NEXT_DESC_PTR            0xFFC00E80 /* DMA Channel 10 Next Descriptor Pointer Register */
+#define DMA10_START_ADDR               0xFFC00E84 /* DMA Channel 10 Start Address Register */
+#define DMA10_CONFIG                   0xFFC00E88 /* DMA Channel 10 Configuration Register */
+#define DMA10_X_COUNT                  0xFFC00E90 /* DMA Channel 10 X Count Register */
+#define DMA10_X_MODIFY                 0xFFC00E94 /* DMA Channel 10 X Modify Register */
+#define DMA10_Y_COUNT                  0xFFC00E98 /* DMA Channel 10 Y Count Register */
+#define DMA10_Y_MODIFY                 0xFFC00E9C /* DMA Channel 10 Y Modify Register */
+#define DMA10_CURR_DESC_PTR            0xFFC00EA0 /* DMA Channel 10 Current Descriptor Pointer Register */
+#define DMA10_CURR_ADDR                0xFFC00EA4 /* DMA Channel 10 Current Address Register */
+#define DMA10_IRQ_STATUS               0xFFC00EA8 /* DMA Channel 10 Interrupt/Status Register */
+#define DMA10_PERIPHERAL_MAP           0xFFC00EAC /* DMA Channel 10 Peripheral Map Register */
+#define DMA10_CURR_X_COUNT             0xFFC00EB0 /* DMA Channel 10 Current X Count Register */
+#define DMA10_CURR_Y_COUNT             0xFFC00EB8 /* DMA Channel 10 Current Y Count Register */
+#define DMA11_NEXT_DESC_PTR            0xFFC00EC0 /* DMA Channel 11 Next Descriptor Pointer Register */
+#define DMA11_START_ADDR               0xFFC00EC4 /* DMA Channel 11 Start Address Register */
+#define DMA11_CONFIG                   0xFFC00EC8 /* DMA Channel 11 Configuration Register */
+#define DMA11_X_COUNT                  0xFFC00ED0 /* DMA Channel 11 X Count Register */
+#define DMA11_X_MODIFY                 0xFFC00ED4 /* DMA Channel 11 X Modify Register */
+#define DMA11_Y_COUNT                  0xFFC00ED8 /* DMA Channel 11 Y Count Register */
+#define DMA11_Y_MODIFY                 0xFFC00EDC /* DMA Channel 11 Y Modify Register */
+#define DMA11_CURR_DESC_PTR            0xFFC00EE0 /* DMA Channel 11 Current Descriptor Pointer Register */
+#define DMA11_CURR_ADDR                0xFFC00EE4 /* DMA Channel 11 Current Address Register */
+#define DMA11_IRQ_STATUS               0xFFC00EE8 /* DMA Channel 11 Interrupt/Status Register */
+#define DMA11_PERIPHERAL_MAP           0xFFC00EEC /* DMA Channel 11 Peripheral Map Register */
+#define DMA11_CURR_X_COUNT             0xFFC00EF0 /* DMA Channel 11 Current X Count Register */
+#define DMA11_CURR_Y_COUNT             0xFFC00EF8 /* DMA Channel 11 Current Y Count Register */
+#define MDMA_S0_NEXT_DESC_PTR          0xFFC00F40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
+#define MDMA_S0_START_ADDR             0xFFC00F44 /* MemDMA Stream 0 Source Start Address Register */
+#define MDMA_S0_CONFIG                 0xFFC00F48 /* MemDMA Stream 0 Source Configuration Register */
+#define MDMA_S0_X_COUNT                0xFFC00F50 /* MemDMA Stream 0 Source X Count Register */
+#define MDMA_S0_X_MODIFY               0xFFC00F54 /* MemDMA Stream 0 Source X Modify Register */
+#define MDMA_S0_Y_COUNT                0xFFC00F58 /* MemDMA Stream 0 Source Y Count Register */
+#define MDMA_S0_Y_MODIFY               0xFFC00F5C /* MemDMA Stream 0 Source Y Modify Register */
+#define MDMA_S0_CURR_DESC_PTR          0xFFC00F60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
+#define MDMA_S0_CURR_ADDR              0xFFC00F64 /* MemDMA Stream 0 Source Current Address Register */
+#define MDMA_S0_IRQ_STATUS             0xFFC00F68 /* MemDMA Stream 0 Source Interrupt/Status Register */
+#define MDMA_S0_PERIPHERAL_MAP         0xFFC00F6C /* MemDMA Stream 0 Source Peripheral Map Register */
+#define MDMA_S0_CURR_X_COUNT           0xFFC00F70 /* MemDMA Stream 0 Source Current X Count Register */
+#define MDMA_S0_CURR_Y_COUNT           0xFFC00F78 /* MemDMA Stream 0 Source Current Y Count Register */
+#define MDMA_D0_NEXT_DESC_PTR          0xFFC00F00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
+#define MDMA_D0_START_ADDR             0xFFC00F04 /* MemDMA Stream 0 Destination Start Address Register */
+#define MDMA_D0_CONFIG                 0xFFC00F08 /* MemDMA Stream 0 Destination Configuration Register */
+#define MDMA_D0_X_COUNT                0xFFC00F10 /* MemDMA Stream 0 Destination X Count Register */
+#define MDMA_D0_X_MODIFY               0xFFC00F14 /* MemDMA Stream 0 Destination X Modify Register */
+#define MDMA_D0_Y_COUNT                0xFFC00F18 /* MemDMA Stream 0 Destination Y Count Register */
+#define MDMA_D0_Y_MODIFY               0xFFC00F1C /* MemDMA Stream 0 Destination Y Modify Register */
+#define MDMA_D0_CURR_DESC_PTR          0xFFC00F20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
+#define MDMA_D0_CURR_ADDR              0xFFC00F24 /* MemDMA Stream 0 Destination Current Address Register */
+#define MDMA_D0_IRQ_STATUS             0xFFC00F28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
+#define MDMA_D0_PERIPHERAL_MAP         0xFFC00F2C /* MemDMA Stream 0 Destination Peripheral Map Register */
+#define MDMA_D0_CURR_X_COUNT           0xFFC00F30 /* MemDMA Stream 0 Destination Current X Count Register */
+#define MDMA_D0_CURR_Y_COUNT           0xFFC00F38 /* MemDMA Stream 0 Destination Current Y Count Register */
+#define MDMA_S1_NEXT_DESC_PTR          0xFFC00FC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
+#define MDMA_S1_START_ADDR             0xFFC00FC4 /* MemDMA Stream 1 Source Start Address Register */
+#define MDMA_S1_CONFIG                 0xFFC00FC8 /* MemDMA Stream 1 Source Configuration Register */
+#define MDMA_S1_X_COUNT                0xFFC00FD0 /* MemDMA Stream 1 Source X Count Register */
+#define MDMA_S1_X_MODIFY               0xFFC00FD4 /* MemDMA Stream 1 Source X Modify Register */
+#define MDMA_S1_Y_COUNT                0xFFC00FD8 /* MemDMA Stream 1 Source Y Count Register */
+#define MDMA_S1_Y_MODIFY               0xFFC00FDC /* MemDMA Stream 1 Source Y Modify Register */
+#define MDMA_S1_CURR_DESC_PTR          0xFFC00FE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
+#define MDMA_S1_CURR_ADDR              0xFFC00FE4 /* MemDMA Stream 1 Source Current Address Register */
+#define MDMA_S1_IRQ_STATUS             0xFFC00FE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
+#define MDMA_S1_PERIPHERAL_MAP         0xFFC00FEC /* MemDMA Stream 1 Source Peripheral Map Register */
+#define MDMA_S1_CURR_X_COUNT           0xFFC00FF0 /* MemDMA Stream 1 Source Current X Count Register */
+#define MDMA_S1_CURR_Y_COUNT           0xFFC00FF8 /* MemDMA Stream 1 Source Current Y Count Register */
+#define MDMA_D1_NEXT_DESC_PTR          0xFFC00F80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
+#define MDMA_D1_START_ADDR             0xFFC00F84 /* MemDMA Stream 1 Destination Start Address Register */
+#define MDMA_D1_CONFIG                 0xFFC00F88 /* MemDMA Stream 1 Destination Configuration Register */
+#define MDMA_D1_X_COUNT                0xFFC00F90 /* MemDMA Stream 1 Destination X Count Register */
+#define MDMA_D1_X_MODIFY               0xFFC00F94 /* MemDMA Stream 1 Destination X Modify Register */
+#define MDMA_D1_Y_COUNT                0xFFC00F98 /* MemDMA Stream 1 Destination Y Count Register */
+#define MDMA_D1_Y_MODIFY               0xFFC00F9C /* MemDMA Stream 1 Destination Y Modify Register */
+#define MDMA_D1_CURR_DESC_PTR          0xFFC00FA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
+#define MDMA_D1_CURR_ADDR              0xFFC00FA4 /* MemDMA Stream 1 Destination Current Address Register */
+#define MDMA_D1_IRQ_STATUS             0xFFC00FA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
+#define MDMA_D1_PERIPHERAL_MAP         0xFFC00FAC /* MemDMA Stream 1 Destination Peripheral Map Register */
+#define MDMA_D1_CURR_X_COUNT           0xFFC00FB0 /* MemDMA Stream 1 Destination Current X Count Register */
+#define MDMA_D1_CURR_Y_COUNT           0xFFC00FB8 /* MemDMA Stream 1 Destination Current Y Count Register */
+#define PPI_CONTROL                    0xFFC01000 /* PPI Control Register */
+#define PPI_STATUS                     0xFFC01004 /* PPI Status Register */
+#define PPI_COUNT                      0xFFC01008 /* PPI Transfer Count Register */
+#define PPI_DELAY                      0xFFC0100C /* PPI Delay Count Register */
+#define PPI_FRAME                      0xFFC01010 /* PPI Frame Length Register */
+#define TWI_CLKDIV                     0xFFC01400 /* Serial Clock Divider Register */
+#define TWI_CONTROL                    0xFFC01404 /* TWI Control Register */
+#define TWI_SLAVE_CTL                  0xFFC01408 /* Slave Mode Control Register */
+#define TWI_SLAVE_STAT                 0xFFC0140C /* Slave Mode Status Register */
+#define TWI_SLAVE_ADDR                 0xFFC01410 /* Slave Mode Address Register */
+#define TWI_MASTER_CTL                 0xFFC01414 /* Master Mode Control Register */
+#define TWI_MASTER_STAT                0xFFC01418 /* Master Mode Status Register */
+#define TWI_MASTER_ADDR                0xFFC0141C /* Master Mode Address Register */
+#define TWI_INT_STAT                   0xFFC01420 /* TWI Interrupt Status Register */
+#define TWI_INT_MASK                   0xFFC01424 /* TWI Master Interrupt Mask Register */
+#define TWI_FIFO_CTL                   0xFFC01428 /* FIFO Control Register */
+#define TWI_FIFO_STAT                  0xFFC0142C /* FIFO Status Register */
+#define TWI_XMT_DATA8                  0xFFC01480 /* FIFO Transmit Data Single Byte Register */
+#define TWI_XMT_DATA16                 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
+#define TWI_RCV_DATA8                  0xFFC01488 /* FIFO Receive Data Single Byte Register */
+#define TWI_RCV_DATA16                 0xFFC0148C /* FIFO Receive Data Double Byte Register */
+#define PORTGIO                        0xFFC01500 /* Port G I/O Pin State Specify Register */
+#define PORTGIO_CLEAR                  0xFFC01504 /* Port G I/O Peripheral Interrupt Clear Register */
+#define PORTGIO_SET                    0xFFC01508 /* Port G I/O Peripheral Interrupt Set Register */
+#define PORTGIO_TOGGLE                 0xFFC0150C /* Port G I/O Pin State Toggle Register */
+#define PORTGIO_MASKA                  0xFFC01510 /* Port G I/O Mask State Specify Interrupt A Register */
+#define PORTGIO_MASKA_CLEAR            0xFFC01514 /* Port G I/O Mask Disable Interrupt A Register */
+#define PORTGIO_MASKA_SET              0xFFC01518 /* Port G I/O Mask Enable Interrupt A Register */
+#define PORTGIO_MASKA_TOGGLE           0xFFC0151C /* Port G I/O Mask Toggle Enable Interrupt A Register */
+#define PORTGIO_MASKB                  0xFFC01520 /* Port G I/O Mask State Specify Interrupt B Register */
+#define PORTGIO_MASKB_CLEAR            0xFFC01524 /* Port G I/O Mask Disable Interrupt B Register */
+#define PORTGIO_MASKB_SET              0xFFC01528 /* Port G I/O Mask Enable Interrupt B Register */
+#define PORTGIO_MASKB_TOGGLE           0xFFC0152C /* Port G I/O Mask Toggle Enable Interrupt B Register */
+#define PORTGIO_DIR                    0xFFC01530 /* Port G I/O Direction Register */
+#define PORTGIO_POLAR                  0xFFC01534 /* Port G I/O Source Polarity Register */
+#define PORTGIO_EDGE                   0xFFC01538 /* Port G I/O Source Sensitivity Register */
+#define PORTGIO_BOTH                   0xFFC0153C /* Port G I/O Set on BOTH Edges Register */
+#define PORTGIO_INEN                   0xFFC01540 /* Port G I/O Input Enable Register */
+#define PORTHIO                        0xFFC01700 /* Port H I/O Pin State Specify Register */
+#define PORTHIO_CLEAR                  0xFFC01704 /* Port H I/O Peripheral Interrupt Clear Register */
+#define PORTHIO_SET                    0xFFC01708 /* Port H I/O Peripheral Interrupt Set Register */
+#define PORTHIO_TOGGLE                 0xFFC0170C /* Port H I/O Pin State Toggle Register */
+#define PORTHIO_MASKA                  0xFFC01710 /* Port H I/O Mask State Specify Interrupt A Register */
+#define PORTHIO_MASKA_CLEAR            0xFFC01714 /* Port H I/O Mask Disable Interrupt A Register */
+#define PORTHIO_MASKA_SET              0xFFC01718 /* Port H I/O Mask Enable Interrupt A Register */
+#define PORTHIO_MASKA_TOGGLE           0xFFC0171C /* Port H I/O Mask Toggle Enable Interrupt A Register */
+#define PORTHIO_MASKB                  0xFFC01720 /* Port H I/O Mask State Specify Interrupt B Register */
+#define PORTHIO_MASKB_CLEAR            0xFFC01724 /* Port H I/O Mask Disable Interrupt B Register */
+#define PORTHIO_MASKB_SET              0xFFC01728 /* Port H I/O Mask Enable Interrupt B Register */
+#define PORTHIO_MASKB_TOGGLE           0xFFC0172C /* Port H I/O Mask Toggle Enable Interrupt B Register */
+#define PORTHIO_DIR                    0xFFC01730 /* Port H I/O Direction Register */
+#define PORTHIO_POLAR                  0xFFC01734 /* Port H I/O Source Polarity Register */
+#define PORTHIO_EDGE                   0xFFC01738 /* Port H I/O Source Sensitivity Register */
+#define PORTHIO_BOTH                   0xFFC0173C /* Port H I/O Set on BOTH Edges Register */
+#define PORTHIO_INEN                   0xFFC01740 /* Port H I/O Input Enable Register */
+#define UART1_THR                      0xFFC02000 /* Transmit Holding register */
+#define UART1_RBR                      0xFFC02000 /* Receive Buffer register */
+#define UART1_DLL                      0xFFC02000 /* Divisor Latch (Low-Byte) */
+#define UART1_IER                      0xFFC02004 /* Interrupt Enable Register */
+#define UART1_DLH                      0xFFC02004 /* Divisor Latch (High-Byte) */
+#define UART1_IIR                      0xFFC02008 /* Interrupt Identification Register */
+#define UART1_LCR                      0xFFC0200C /* Line Control Register */
+#define UART1_MCR                      0xFFC02010 /* Modem Control Register */
+#define UART1_LSR                      0xFFC02014 /* Line Status Register */
+#define UART1_MSR                      0xFFC02018 /* Modem Status Register */
+#define UART1_SCR                      0xFFC0201C /* SCR Scratch Register */
+#define UART1_GCTL                     0xFFC02024 /* Global Control Register */
+#define CAN_MC1                        0xFFC02A00 /* Mailbox config reg 1 */
+#define CAN_MD1                        0xFFC02A04 /* Mailbox direction reg 1 */
+#define CAN_TRS1                       0xFFC02A08 /* Transmit Request Set reg 1 */
+#define CAN_TRR1                       0xFFC02A0C /* Transmit Request Reset reg 1 */
+#define CAN_TA1                        0xFFC02A10 /* Transmit Acknowledge reg 1 */
+#define CAN_AA1                        0xFFC02A14 /* Transmit Abort Acknowledge reg 1 */
+#define CAN_RMP1                       0xFFC02A18 /* Receive Message Pending reg 1 */
+#define CAN_RML1                       0xFFC02A1C /* Receive Message Lost reg 1 */
+#define CAN_MBTIF1                     0xFFC02A20 /* Mailbox Transmit Interrupt Flag reg 1 */
+#define CAN_MBRIF1                     0xFFC02A24 /* Mailbox Receive  Interrupt Flag reg 1 */
+#define CAN_MBIM1                      0xFFC02A28 /* Mailbox Interrupt Mask reg 1 */
+#define CAN_RFH1                       0xFFC02A2C /* Remote Frame Handling reg 1 */
+#define CAN_OPSS1                      0xFFC02A30 /* Overwrite Protection Single Shot Xmission reg 1 */
+#define CAN_MC2                        0xFFC02A40 /* Mailbox config reg 2 */
+#define CAN_MD2                        0xFFC02A44 /* Mailbox direction reg 2 */
+#define CAN_TRS2                       0xFFC02A48 /* Transmit Request Set reg 2 */
+#define CAN_TRR2                       0xFFC02A4C /* Transmit Request Reset reg 2 */
+#define CAN_TA2                        0xFFC02A50 /* Transmit Acknowledge reg 2 */
+#define CAN_AA2                        0xFFC02A54 /* Transmit Abort Acknowledge reg 2 */
+#define CAN_RMP2                       0xFFC02A58 /* Receive Message Pending reg 2 */
+#define CAN_RML2                       0xFFC02A5C /* Receive Message Lost reg 2 */
+#define CAN_MBTIF2                     0xFFC02A60 /* Mailbox Transmit Interrupt Flag reg 2 */
+#define CAN_MBRIF2                     0xFFC02A64 /* Mailbox Receive  Interrupt Flag reg 2 */
+#define CAN_MBIM2                      0xFFC02A68 /* Mailbox Interrupt Mask reg 2 */
+#define CAN_RFH2                       0xFFC02A6C /* Remote Frame Handling reg 2 */
+#define CAN_OPSS2                      0xFFC02A70 /* Overwrite Protection Single Shot Xmission reg 2 */
+#define CAN_CLOCK                      0xFFC02A80 /* Bit Timing Configuration register 0 */
+#define CAN_TIMING                     0xFFC02A84 /* Bit Timing Configuration register 1 */
+#define CAN_DEBUG                      0xFFC02A88 /* Config register */
+#define CAN_STATUS                     0xFFC02A8C /* Global Status Register */
+#define CAN_CEC                        0xFFC02A90 /* Error Counter Register */
+#define CAN_GIS                        0xFFC02A94 /* Global Interrupt Status Register */
+#define CAN_GIM                        0xFFC02A98 /* Global Interrupt Mask Register */
+#define CAN_GIF                        0xFFC02A9C /* Global Interrupt Flag Register */
+#define CAN_CONTROL                    0xFFC02AA0 /* Master Control Register */
+#define CAN_INTR                       0xFFC02AA4 /* Interrupt Pending Register */
+#define CAN_VERSION                    0xFFC02AA8 /* Version Code Register */
+#define CAN_MBTD                       0xFFC02AAC /* Mailbox Temporary Disable Feature */
+#define CAN_EWR                        0xFFC02AB0 /* Programmable Warning Level */
+#define CAN_ESR                        0xFFC02AB4 /* Error Status Register */
+#define CAN_UCREG                      0xFFC02AC0 /* Universal Counter Register/Capture Register */
+#define CAN_UCCNT                      0xFFC02AC4 /* Universal Counter */
+#define CAN_UCRC                       0xFFC02AC8 /* Universal Counter Force Reload Register */
+#define CAN_UCCNF                      0xFFC02ACC /* Universal Counter Configuration Register */
+#define CAN_VERSION2                   0xFFC02AD4 /* Version Code Register 2 */
+#define CAN_AM00L                      0xFFC02B00 /* Mailbox 0 Low Acceptance Mask */
+#define CAN_AM00H                      0xFFC02B04 /* Mailbox 0 High Acceptance Mask */
+#define CAN_AM01L                      0xFFC02B08 /* Mailbox 1 Low Acceptance Mask  */
+#define CAN_AM01H                      0xFFC02B0C /* Mailbox 1 High Acceptance Mask */
+#define CAN_AM02L                      0xFFC02B10 /* Mailbox 2 Low Acceptance Mask  */
+#define CAN_AM02H                      0xFFC02B14 /* Mailbox 2 High Acceptance Mask */
+#define CAN_AM03L                      0xFFC02B18 /* Mailbox 3 Low Acceptance Mask  */
+#define CAN_AM03H                      0xFFC02B1C /* Mailbox 3 High Acceptance Mask */
+#define CAN_AM04L                      0xFFC02B20 /* Mailbox 4 Low Acceptance Mask  */
+#define CAN_AM04H                      0xFFC02B24 /* Mailbox 4 High Acceptance Mask */
+#define CAN_AM05L                      0xFFC02B28 /* Mailbox 5 Low Acceptance Mask  */
+#define CAN_AM05H                      0xFFC02B2C /* Mailbox 5 High Acceptance Mask */
+#define CAN_AM06L                      0xFFC02B30 /* Mailbox 6 Low Acceptance Mask  */
+#define CAN_AM06H                      0xFFC02B34 /* Mailbox 6 High Acceptance Mask */
+#define CAN_AM07L                      0xFFC02B38 /* Mailbox 7 Low Acceptance Mask  */
+#define CAN_AM07H                      0xFFC02B3C /* Mailbox 7 High Acceptance Mask */
+#define CAN_AM08L                      0xFFC02B40 /* Mailbox 8 Low Acceptance Mask  */
+#define CAN_AM08H                      0xFFC02B44 /* Mailbox 8 High Acceptance Mask */
+#define CAN_AM09L                      0xFFC02B48 /* Mailbox 9 Low Acceptance Mask  */
+#define CAN_AM09H                      0xFFC02B4C /* Mailbox 9 High Acceptance Mask */
+#define CAN_AM10L                      0xFFC02B50 /* Mailbox 10 Low Acceptance Mask  */
+#define CAN_AM10H                      0xFFC02B54 /* Mailbox 10 High Acceptance Mask */
+#define CAN_AM11L                      0xFFC02B58 /* Mailbox 11 Low Acceptance Mask  */
+#define CAN_AM11H                      0xFFC02B5C /* Mailbox 11 High Acceptance Mask */
+#define CAN_AM12L                      0xFFC02B60 /* Mailbox 12 Low Acceptance Mask  */
+#define CAN_AM12H                      0xFFC02B64 /* Mailbox 12 High Acceptance Mask */
+#define CAN_AM13L                      0xFFC02B68 /* Mailbox 13 Low Acceptance Mask  */
+#define CAN_AM13H                      0xFFC02B6C /* Mailbox 13 High Acceptance Mask */
+#define CAN_AM14L                      0xFFC02B70 /* Mailbox 14 Low Acceptance Mask  */
+#define CAN_AM14H                      0xFFC02B74 /* Mailbox 14 High Acceptance Mask */
+#define CAN_AM15L                      0xFFC02B78 /* Mailbox 15 Low Acceptance Mask  */
+#define CAN_AM15H                      0xFFC02B7C /* Mailbox 15 High Acceptance Mask */
+#define CAN_AM16L                      0xFFC02B80 /* Mailbox 16 Low Acceptance Mask  */
+#define CAN_AM16H                      0xFFC02B84 /* Mailbox 16 High Acceptance Mask */
+#define CAN_AM17L                      0xFFC02B88 /* Mailbox 17 Low Acceptance Mask  */
+#define CAN_AM17H                      0xFFC02B8C /* Mailbox 17 High Acceptance Mask */
+#define CAN_AM18L                      0xFFC02B90 /* Mailbox 18 Low Acceptance Mask  */
+#define CAN_AM18H                      0xFFC02B94 /* Mailbox 18 High Acceptance Mask */
+#define CAN_AM19L                      0xFFC02B98 /* Mailbox 19 Low Acceptance Mask  */
+#define CAN_AM19H                      0xFFC02B9C /* Mailbox 19 High Acceptance Mask */
+#define CAN_AM20L                      0xFFC02BA0 /* Mailbox 20 Low Acceptance Mask  */
+#define CAN_AM20H                      0xFFC02BA4 /* Mailbox 20 High Acceptance Mask */
+#define CAN_AM21L                      0xFFC02BA8 /* Mailbox 21 Low Acceptance Mask  */
+#define CAN_AM21H                      0xFFC02BAC /* Mailbox 21 High Acceptance Mask */
+#define CAN_AM22L                      0xFFC02BB0 /* Mailbox 22 Low Acceptance Mask  */
+#define CAN_AM22H                      0xFFC02BB4 /* Mailbox 22 High Acceptance Mask */
+#define CAN_AM23L                      0xFFC02BB8 /* Mailbox 23 Low Acceptance Mask  */
+#define CAN_AM23H                      0xFFC02BBC /* Mailbox 23 High Acceptance Mask */
+#define CAN_AM24L                      0xFFC02BC0 /* Mailbox 24 Low Acceptance Mask  */
+#define CAN_AM24H                      0xFFC02BC4 /* Mailbox 24 High Acceptance Mask */
+#define CAN_AM25L                      0xFFC02BC8 /* Mailbox 25 Low Acceptance Mask  */
+#define CAN_AM25H                      0xFFC02BCC /* Mailbox 25 High Acceptance Mask */
+#define CAN_AM26L                      0xFFC02BD0 /* Mailbox 26 Low Acceptance Mask  */
+#define CAN_AM26H                      0xFFC02BD4 /* Mailbox 26 High Acceptance Mask */
+#define CAN_AM27L                      0xFFC02BD8 /* Mailbox 27 Low Acceptance Mask  */
+#define CAN_AM27H                      0xFFC02BDC /* Mailbox 27 High Acceptance Mask */
+#define CAN_AM28L                      0xFFC02BE0 /* Mailbox 28 Low Acceptance Mask  */
+#define CAN_AM28H                      0xFFC02BE4 /* Mailbox 28 High Acceptance Mask */
+#define CAN_AM29L                      0xFFC02BE8 /* Mailbox 29 Low Acceptance Mask  */
+#define CAN_AM29H                      0xFFC02BEC /* Mailbox 29 High Acceptance Mask */
+#define CAN_AM30L                      0xFFC02BF0 /* Mailbox 30 Low Acceptance Mask  */
+#define CAN_AM30H                      0xFFC02BF4 /* Mailbox 30 High Acceptance Mask */
+#define CAN_AM31L                      0xFFC02BF8 /* Mailbox 31 Low Acceptance Mask  */
+#define CAN_AM31H                      0xFFC02BFC /* Mailbox 31 High Acceptance Mask */
+#define CAN_MB00_DATA0                 0xFFC02C00 /* Mailbox 0 Data Word 0 [15:0] Register */
+#define CAN_MB00_DATA1                 0xFFC02C04 /* Mailbox 0 Data Word 1 [31:16] Register */
+#define CAN_MB00_DATA2                 0xFFC02C08 /* Mailbox 0 Data Word 2 [47:32] Register */
+#define CAN_MB00_DATA3                 0xFFC02C0C /* Mailbox 0 Data Word 3 [63:48] Register */
+#define CAN_MB00_LENGTH                0xFFC02C10 /* Mailbox 0 Data Length Code Register */
+#define CAN_MB00_TIMESTAMP             0xFFC02C14 /* Mailbox 0 Time Stamp Value Register */
+#define CAN_MB00_ID0                   0xFFC02C18 /* Mailbox 0 Identifier Low Register */
+#define CAN_MB00_ID1                   0xFFC02C1C /* Mailbox 0 Identifier High Register */
+#define CAN_MB01_DATA0                 0xFFC02C20 /* Mailbox 1 Data Word 0 [15:0] Register  */
+#define CAN_MB01_DATA1                 0xFFC02C24 /* Mailbox 1 Data Word 1 [31:16] Register */
+#define CAN_MB01_DATA2                 0xFFC02C28 /* Mailbox 1 Data Word 2 [47:32] Register */
+#define CAN_MB01_DATA3                 0xFFC02C2C /* Mailbox 1 Data Word 3 [63:48] Register */
+#define CAN_MB01_LENGTH                0xFFC02C30 /* Mailbox 1 Data Length Code Register */
+#define CAN_MB01_TIMESTAMP             0xFFC02C34 /* Mailbox 1 Time Stamp Value Register */
+#define CAN_MB01_ID0                   0xFFC02C38 /* Mailbox 1 Identifier Low Register */
+#define CAN_MB01_ID1                   0xFFC02C3C /* Mailbox 1 Identifier High Register */
+#define CAN_MB02_DATA0                 0xFFC02C40 /* Mailbox 2 Data Word 0 [15:0] Register  */
+#define CAN_MB02_DATA1                 0xFFC02C44 /* Mailbox 2 Data Word 1 [31:16] Register */
+#define CAN_MB02_DATA2                 0xFFC02C48 /* Mailbox 2 Data Word 2 [47:32] Register */
+#define CAN_MB02_DATA3                 0xFFC02C4C /* Mailbox 2 Data Word 3 [63:48] Register */
+#define CAN_MB02_LENGTH                0xFFC02C50 /* Mailbox 2 Data Length Code Register    */
+#define CAN_MB02_TIMESTAMP             0xFFC02C54 /* Mailbox 2 Time Stamp Value Register */
+#define CAN_MB02_ID0                   0xFFC02C58 /* Mailbox 2 Identifier Low Register */
+#define CAN_MB02_ID1                   0xFFC02C5C /* Mailbox 2 Identifier High Register */
+#define CAN_MB03_DATA0                 0xFFC02C60 /* Mailbox 3 Data Word 0 [15:0] Register  */
+#define CAN_MB03_DATA1                 0xFFC02C64 /* Mailbox 3 Data Word 1 [31:16] Register */
+#define CAN_MB03_DATA2                 0xFFC02C68 /* Mailbox 3 Data Word 2 [47:32] Register */
+#define CAN_MB03_DATA3                 0xFFC02C6C /* Mailbox 3 Data Word 3 [63:48] Register */
+#define CAN_MB03_LENGTH                0xFFC02C70 /* Mailbox 3 Data Length Code Register */
+#define CAN_MB03_TIMESTAMP             0xFFC02C74 /* Mailbox 3 Time Stamp Value Register */
+#define CAN_MB03_ID0                   0xFFC02C78 /* Mailbox 3 Identifier Low Register */
+#define CAN_MB03_ID1                   0xFFC02C7C /* Mailbox 3 Identifier High Register */
+#define CAN_MB04_DATA0                 0xFFC02C80 /* Mailbox 4 Data Word 0 [15:0] Register */
+#define CAN_MB04_DATA1                 0xFFC02C84 /* Mailbox 4 Data Word 1 [31:16] Register */
+#define CAN_MB04_DATA2                 0xFFC02C88 /* Mailbox 4 Data Word 2 [47:32] Register */
+#define CAN_MB04_DATA3                 0xFFC02C8C /* Mailbox 4 Data Word 3 [63:48] Register */
+#define CAN_MB04_LENGTH                0xFFC02C90 /* Mailbox 4 Data Length Code Register */
+#define CAN_MB04_TIMESTAMP             0xFFC02C94 /* Mailbox 4 Time Stamp Value Register */
+#define CAN_MB04_ID0                   0xFFC02C98 /* Mailbox 4 Identifier Low Register */
+#define CAN_MB04_ID1                   0xFFC02C9C /* Mailbox 4 Identifier High Register */
+#define CAN_MB05_DATA0                 0xFFC02CA0 /* Mailbox 5 Data Word 0 [15:0] Register  */
+#define CAN_MB05_DATA1                 0xFFC02CA4 /* Mailbox 5 Data Word 1 [31:16] Register */
+#define CAN_MB05_DATA2                 0xFFC02CA8 /* Mailbox 5 Data Word 2 [47:32] Register */
+#define CAN_MB05_DATA3                 0xFFC02CAC /* Mailbox 5 Data Word 3 [63:48] Register */
+#define CAN_MB05_LENGTH                0xFFC02CB0 /* Mailbox 5 Data Length Code Register */
+#define CAN_MB05_TIMESTAMP             0xFFC02CB4 /* Mailbox 5 Time Stamp Value Register */
+#define CAN_MB05_ID0                   0xFFC02CB8 /* Mailbox 5 Identifier Low Register */
+#define CAN_MB05_ID1                   0xFFC02CBC /* Mailbox 5 Identifier High Register */
+#define CAN_MB06_DATA0                 0xFFC02CC0 /* Mailbox 6 Data Word 0 [15:0] Register  */
+#define CAN_MB06_DATA1                 0xFFC02CC4 /* Mailbox 6 Data Word 1 [31:16] Register */
+#define CAN_MB06_DATA2                 0xFFC02CC8 /* Mailbox 6 Data Word 2 [47:32] Register */
+#define CAN_MB06_DATA3                 0xFFC02CCC /* Mailbox 6 Data Word 3 [63:48] Register */
+#define CAN_MB06_LENGTH                0xFFC02CD0 /* Mailbox 6 Data Length Code Register */
+#define CAN_MB06_TIMESTAMP             0xFFC02CD4 /* Mailbox 6 Time Stamp Value Register */
+#define CAN_MB06_ID0                   0xFFC02CD8 /* Mailbox 6 Identifier Low Register */
+#define CAN_MB06_ID1                   0xFFC02CDC /* Mailbox 6 Identifier High Register */
+#define CAN_MB07_DATA0                 0xFFC02CE0 /* Mailbox 7 Data Word 0 [15:0] Register */
+#define CAN_MB07_DATA1                 0xFFC02CE4 /* Mailbox 7 Data Word 1 [31:16] Register */
+#define CAN_MB07_DATA2                 0xFFC02CE8 /* Mailbox 7 Data Word 2 [47:32] Register */
+#define CAN_MB07_DATA3                 0xFFC02CEC /* Mailbox 7 Data Word 3 [63:48] Register */
+#define CAN_MB07_LENGTH                0xFFC02CF0 /* Mailbox 7 Data Length Code Register */
+#define CAN_MB07_TIMESTAMP             0xFFC02CF4 /* Mailbox 7 Time Stamp Value Register */
+#define CAN_MB07_ID0                   0xFFC02CF8 /* Mailbox 7 Identifier Low Register */
+#define CAN_MB07_ID1                   0xFFC02CFC /* Mailbox 7 Identifier High Register */
+#define CAN_MB08_DATA0                 0xFFC02D00 /* Mailbox 8 Data Word 0 [15:0] Register */
+#define CAN_MB08_DATA1                 0xFFC02D04 /* Mailbox 8 Data Word 1 [31:16] Register */
+#define CAN_MB08_DATA2                 0xFFC02D08 /* Mailbox 8 Data Word 2 [47:32] Register */
+#define CAN_MB08_DATA3                 0xFFC02D0C /* Mailbox 8 Data Word 3 [63:48] Register */
+#define CAN_MB08_LENGTH                0xFFC02D10 /* Mailbox 8 Data Length Code Register */
+#define CAN_MB08_TIMESTAMP             0xFFC02D14 /* Mailbox 8 Time Stamp Value Register */
+#define CAN_MB08_ID0                   0xFFC02D18 /* Mailbox 8 Identifier Low Register */
+#define CAN_MB08_ID1                   0xFFC02D1C /* Mailbox 8 Identifier High Register */
+#define CAN_MB09_DATA0                 0xFFC02D20 /* Mailbox 9 Data Word 0 [15:0] Register */
+#define CAN_MB09_DATA1                 0xFFC02D24 /* Mailbox 9 Data Word 1 [31:16] Register */
+#define CAN_MB09_DATA2                 0xFFC02D28 /* Mailbox 9 Data Word 2 [47:32] Register */
+#define CAN_MB09_DATA3                 0xFFC02D2C /* Mailbox 9 Data Word 3 [63:48] Register */
+#define CAN_MB09_LENGTH                0xFFC02D30 /* Mailbox 9 Data Length Code Register */
+#define CAN_MB09_TIMESTAMP             0xFFC02D34 /* Mailbox 9 Time Stamp Value Register */
+#define CAN_MB09_ID0                   0xFFC02D38 /* Mailbox 9 Identifier Low Register */
+#define CAN_MB09_ID1                   0xFFC02D3C /* Mailbox 9 Identifier High Register */
+#define CAN_MB10_DATA0                 0xFFC02D40 /* Mailbox 10 Data Word 0 [15:0] Register */
+#define CAN_MB10_DATA1                 0xFFC02D44 /* Mailbox 10 Data Word 1 [31:16] Register */
+#define CAN_MB10_DATA2                 0xFFC02D48 /* Mailbox 10 Data Word 2 [47:32] Register */
+#define CAN_MB10_DATA3                 0xFFC02D4C /* Mailbox 10 Data Word 3 [63:48] Register */
+#define CAN_MB10_LENGTH                0xFFC02D50 /* Mailbox 10 Data Length Code Register */
+#define CAN_MB10_TIMESTAMP             0xFFC02D54 /* Mailbox 10 Time Stamp Value Register */
+#define CAN_MB10_ID0                   0xFFC02D58 /* Mailbox 10 Identifier Low Register */
+#define CAN_MB10_ID1                   0xFFC02D5C /* Mailbox 10 Identifier High Register */
+#define CAN_MB11_DATA0                 0xFFC02D60 /* Mailbox 11 Data Word 0 [15:0] Register */
+#define CAN_MB11_DATA1                 0xFFC02D64 /* Mailbox 11 Data Word 1 [31:16] Register */
+#define CAN_MB11_DATA2                 0xFFC02D68 /* Mailbox 11 Data Word 2 [47:32] Register */
+#define CAN_MB11_DATA3                 0xFFC02D6C /* Mailbox 11 Data Word 3 [63:48] Register */
+#define CAN_MB11_LENGTH                0xFFC02D70 /* Mailbox 11 Data Length Code Register */
+#define CAN_MB11_TIMESTAMP             0xFFC02D74 /* Mailbox 11 Time Stamp Value Register */
+#define CAN_MB11_ID0                   0xFFC02D78 /* Mailbox 11 Identifier Low Register */
+#define CAN_MB11_ID1                   0xFFC02D7C /* Mailbox 11 Identifier High Register */
+#define CAN_MB12_DATA0                 0xFFC02D80 /* Mailbox 12 Data Word 0 [15:0] Register */
+#define CAN_MB12_DATA1                 0xFFC02D84 /* Mailbox 12 Data Word 1 [31:16] Register */
+#define CAN_MB12_DATA2                 0xFFC02D88 /* Mailbox 12 Data Word 2 [47:32] Register */
+#define CAN_MB12_DATA3                 0xFFC02D8C /* Mailbox 12 Data Word 3 [63:48] Register */
+#define CAN_MB12_LENGTH                0xFFC02D90 /* Mailbox 12 Data Length Code Register */
+#define CAN_MB12_TIMESTAMP             0xFFC02D94 /* Mailbox 12 Time Stamp Value Register */
+#define CAN_MB12_ID0                   0xFFC02D98 /* Mailbox 12 Identifier Low Register */
+#define CAN_MB12_ID1                   0xFFC02D9C /* Mailbox 12 Identifier High Register */
+#define CAN_MB13_DATA0                 0xFFC02DA0 /* Mailbox 13 Data Word 0 [15:0] Register */
+#define CAN_MB13_DATA1                 0xFFC02DA4 /* Mailbox 13 Data Word 1 [31:16] Register */
+#define CAN_MB13_DATA2                 0xFFC02DA8 /* Mailbox 13 Data Word 2 [47:32] Register */
+#define CAN_MB13_DATA3                 0xFFC02DAC /* Mailbox 13 Data Word 3 [63:48] Register */
+#define CAN_MB13_LENGTH                0xFFC02DB0 /* Mailbox 13 Data Length Code Register */
+#define CAN_MB13_TIMESTAMP             0xFFC02DB4 /* Mailbox 13 Time Stamp Value Register */
+#define CAN_MB13_ID0                   0xFFC02DB8 /* Mailbox 13 Identifier Low Register */
+#define CAN_MB13_ID1                   0xFFC02DBC /* Mailbox 13 Identifier High Register */
+#define CAN_MB14_DATA0                 0xFFC02DC0 /* Mailbox 14 Data Word 0 [15:0] Register */
+#define CAN_MB14_DATA1                 0xFFC02DC4 /* Mailbox 14 Data Word 1 [31:16] Register */
+#define CAN_MB14_DATA2                 0xFFC02DC8 /* Mailbox 14 Data Word 2 [47:32] Register */
+#define CAN_MB14_DATA3                 0xFFC02DCC /* Mailbox 14 Data Word 3 [63:48] Register */
+#define CAN_MB14_LENGTH                0xFFC02DD0 /* Mailbox 14 Data Length Code Register */
+#define CAN_MB14_TIMESTAMP             0xFFC02DD4 /* Mailbox 14 Time Stamp Value Register */
+#define CAN_MB14_ID0                   0xFFC02DD8 /* Mailbox 14 Identifier Low Register */
+#define CAN_MB14_ID1                   0xFFC02DDC /* Mailbox 14 Identifier High Register */
+#define CAN_MB15_DATA0                 0xFFC02DE0 /* Mailbox 15 Data Word 0 [15:0] Register */
+#define CAN_MB15_DATA1                 0xFFC02DE4 /* Mailbox 15 Data Word 1 [31:16] Register */
+#define CAN_MB15_DATA2                 0xFFC02DE8 /* Mailbox 15 Data Word 2 [47:32] Register */
+#define CAN_MB15_DATA3                 0xFFC02DEC /* Mailbox 15 Data Word 3 [63:48] Register */
+#define CAN_MB15_LENGTH                0xFFC02DF0 /* Mailbox 15 Data Length Code Register */
+#define CAN_MB15_TIMESTAMP             0xFFC02DF4 /* Mailbox 15 Time Stamp Value Register */
+#define CAN_MB15_ID0                   0xFFC02DF8 /* Mailbox 15 Identifier Low Register */
+#define CAN_MB15_ID1                   0xFFC02DFC /* Mailbox 15 Identifier High Register */
+#define CAN_MB16_DATA0                 0xFFC02E00 /* Mailbox 16 Data Word 0 [15:0] Register */
+#define CAN_MB16_DATA1                 0xFFC02E04 /* Mailbox 16 Data Word 1 [31:16] Register */
+#define CAN_MB16_DATA2                 0xFFC02E08 /* Mailbox 16 Data Word 2 [47:32] Register */
+#define CAN_MB16_DATA3                 0xFFC02E0C /* Mailbox 16 Data Word 3 [63:48] Register */
+#define CAN_MB16_LENGTH                0xFFC02E10 /* Mailbox 16 Data Length Code Register */
+#define CAN_MB16_TIMESTAMP             0xFFC02E14 /* Mailbox 16 Time Stamp Value Register */
+#define CAN_MB16_ID0                   0xFFC02E18 /* Mailbox 16 Identifier Low Register */
+#define CAN_MB16_ID1                   0xFFC02E1C /* Mailbox 16 Identifier High Register */
+#define CAN_MB17_DATA0                 0xFFC02E20 /* Mailbox 17 Data Word 0 [15:0] Register */
+#define CAN_MB17_DATA1                 0xFFC02E24 /* Mailbox 17 Data Word 1 [31:16] Register */
+#define CAN_MB17_DATA2                 0xFFC02E28 /* Mailbox 17 Data Word 2 [47:32] Register */
+#define CAN_MB17_DATA3                 0xFFC02E2C /* Mailbox 17 Data Word 3 [63:48] Register */
+#define CAN_MB17_LENGTH                0xFFC02E30 /* Mailbox 17 Data Length Code Register */
+#define CAN_MB17_TIMESTAMP             0xFFC02E34 /* Mailbox 17 Time Stamp Value Register */
+#define CAN_MB17_ID0                   0xFFC02E38 /* Mailbox 17 Identifier Low Register */
+#define CAN_MB17_ID1                   0xFFC02E3C /* Mailbox 17 Identifier High Register */
+#define CAN_MB18_DATA0                 0xFFC02E40 /* Mailbox 18 Data Word 0 [15:0] Register */
+#define CAN_MB18_DATA1                 0xFFC02E44 /* Mailbox 18 Data Word 1 [31:16] Register */
+#define CAN_MB18_DATA2                 0xFFC02E48 /* Mailbox 18 Data Word 2 [47:32] Register */
+#define CAN_MB18_DATA3                 0xFFC02E4C /* Mailbox 18 Data Word 3 [63:48] Register */
+#define CAN_MB18_LENGTH                0xFFC02E50 /* Mailbox 18 Data Length Code Register */
+#define CAN_MB18_TIMESTAMP             0xFFC02E54 /* Mailbox 18 Time Stamp Value Register */
+#define CAN_MB18_ID0                   0xFFC02E58 /* Mailbox 18 Identifier Low Register */
+#define CAN_MB18_ID1                   0xFFC02E5C /* Mailbox 18 Identifier High Register */
+#define CAN_MB19_DATA0                 0xFFC02E60 /* Mailbox 19 Data Word 0 [15:0] Register */
+#define CAN_MB19_DATA1                 0xFFC02E64 /* Mailbox 19 Data Word 1 [31:16] Register */
+#define CAN_MB19_DATA2                 0xFFC02E68 /* Mailbox 19 Data Word 2 [47:32] Register */
+#define CAN_MB19_DATA3                 0xFFC02E6C /* Mailbox 19 Data Word 3 [63:48] Register */
+#define CAN_MB19_LENGTH                0xFFC02E70 /* Mailbox 19 Data Length Code Register */
+#define CAN_MB19_TIMESTAMP             0xFFC02E74 /* Mailbox 19 Time Stamp Value Register */
+#define CAN_MB19_ID0                   0xFFC02E78 /* Mailbox 19 Identifier Low Register */
+#define CAN_MB19_ID1                   0xFFC02E7C /* Mailbox 19 Identifier High Register */
+#define CAN_MB20_DATA0                 0xFFC02E80 /* Mailbox 20 Data Word 0 [15:0] Register */
+#define CAN_MB20_DATA1                 0xFFC02E84 /* Mailbox 20 Data Word 1 [31:16] Register */
+#define CAN_MB20_DATA2                 0xFFC02E88 /* Mailbox 20 Data Word 2 [47:32] Register */
+#define CAN_MB20_DATA3                 0xFFC02E8C /* Mailbox 20 Data Word 3 [63:48] Register */
+#define CAN_MB20_LENGTH                0xFFC02E90 /* Mailbox 20 Data Length Code Register */
+#define CAN_MB20_TIMESTAMP             0xFFC02E94 /* Mailbox 20 Time Stamp Value Register */
+#define CAN_MB20_ID0                   0xFFC02E98 /* Mailbox 20 Identifier Low Register */
+#define CAN_MB20_ID1                   0xFFC02E9C /* Mailbox 20 Identifier High Register */
+#define CAN_MB21_DATA0                 0xFFC02EA0 /* Mailbox 21 Data Word 0 [15:0] Register */
+#define CAN_MB21_DATA1                 0xFFC02EA4 /* Mailbox 21 Data Word 1 [31:16] Register */
+#define CAN_MB21_DATA2                 0xFFC02EA8 /* Mailbox 21 Data Word 2 [47:32] Register */
+#define CAN_MB21_DATA3                 0xFFC02EAC /* Mailbox 21 Data Word 3 [63:48] Register */
+#define CAN_MB21_LENGTH                0xFFC02EB0 /* Mailbox 21 Data Length Code Register */
+#define CAN_MB21_TIMESTAMP             0xFFC02EB4 /* Mailbox 21 Time Stamp Value Register */
+#define CAN_MB21_ID0                   0xFFC02EB8 /* Mailbox 21 Identifier Low Register */
+#define CAN_MB21_ID1                   0xFFC02EBC /* Mailbox 21 Identifier High Register */
+#define CAN_MB22_DATA0                 0xFFC02EC0 /* Mailbox 22 Data Word 0 [15:0] Register */
+#define CAN_MB22_DATA1                 0xFFC02EC4 /* Mailbox 22 Data Word 1 [31:16] Register */
+#define CAN_MB22_DATA2                 0xFFC02EC8 /* Mailbox 22 Data Word 2 [47:32] Register */
+#define CAN_MB22_DATA3                 0xFFC02ECC /* Mailbox 22 Data Word 3 [63:48] Register */
+#define CAN_MB22_LENGTH                0xFFC02ED0 /* Mailbox 22 Data Length Code Register */
+#define CAN_MB22_TIMESTAMP             0xFFC02ED4 /* Mailbox 22 Time Stamp Value Register */
+#define CAN_MB22_ID0                   0xFFC02ED8 /* Mailbox 22 Identifier Low Register */
+#define CAN_MB22_ID1                   0xFFC02EDC /* Mailbox 22 Identifier High Register */
+#define CAN_MB23_DATA0                 0xFFC02EE0 /* Mailbox 23 Data Word 0 [15:0] Register */
+#define CAN_MB23_DATA1                 0xFFC02EE4 /* Mailbox 23 Data Word 1 [31:16] Register */
+#define CAN_MB23_DATA2                 0xFFC02EE8 /* Mailbox 23 Data Word 2 [47:32] Register */
+#define CAN_MB23_DATA3                 0xFFC02EEC /* Mailbox 23 Data Word 3 [63:48] Register */
+#define CAN_MB23_LENGTH                0xFFC02EF0 /* Mailbox 23 Data Length Code Register */
+#define CAN_MB23_TIMESTAMP             0xFFC02EF4 /* Mailbox 23 Time Stamp Value Register */
+#define CAN_MB23_ID0                   0xFFC02EF8 /* Mailbox 23 Identifier Low Register */
+#define CAN_MB23_ID1                   0xFFC02EFC /* Mailbox 23 Identifier High Register */
+#define CAN_MB24_DATA0                 0xFFC02F00 /* Mailbox 24 Data Word 0 [15:0] Register */
+#define CAN_MB24_DATA1                 0xFFC02F04 /* Mailbox 24 Data Word 1 [31:16] Register */
+#define CAN_MB24_DATA2                 0xFFC02F08 /* Mailbox 24 Data Word 2 [47:32] Register */
+#define CAN_MB24_DATA3                 0xFFC02F0C /* Mailbox 24 Data Word 3 [63:48] Register */
+#define CAN_MB24_LENGTH                0xFFC02F10 /* Mailbox 24 Data Length Code Register */
+#define CAN_MB24_TIMESTAMP             0xFFC02F14 /* Mailbox 24 Time Stamp Value Register */
+#define CAN_MB24_ID0                   0xFFC02F18 /* Mailbox 24 Identifier Low Register */
+#define CAN_MB24_ID1                   0xFFC02F1C /* Mailbox 24 Identifier High Register */
+#define CAN_MB25_DATA0                 0xFFC02F20 /* Mailbox 25 Data Word 0 [15:0] Register */
+#define CAN_MB25_DATA1                 0xFFC02F24 /* Mailbox 25 Data Word 1 [31:16] Register */
+#define CAN_MB25_DATA2                 0xFFC02F28 /* Mailbox 25 Data Word 2 [47:32] Register */
+#define CAN_MB25_DATA3                 0xFFC02F2C /* Mailbox 25 Data Word 3 [63:48] Register */
+#define CAN_MB25_LENGTH                0xFFC02F30 /* Mailbox 25 Data Length Code Register */
+#define CAN_MB25_TIMESTAMP             0xFFC02F34 /* Mailbox 25 Time Stamp Value Register */
+#define CAN_MB25_ID0                   0xFFC02F38 /* Mailbox 25 Identifier Low Register */
+#define CAN_MB25_ID1                   0xFFC02F3C /* Mailbox 25 Identifier High Register */
+#define CAN_MB26_DATA0                 0xFFC02F40 /* Mailbox 26 Data Word 0 [15:0] Register */
+#define CAN_MB26_DATA1                 0xFFC02F44 /* Mailbox 26 Data Word 1 [31:16] Register */
+#define CAN_MB26_DATA2                 0xFFC02F48 /* Mailbox 26 Data Word 2 [47:32] Register */
+#define CAN_MB26_DATA3                 0xFFC02F4C /* Mailbox 26 Data Word 3 [63:48] Register */
+#define CAN_MB26_LENGTH                0xFFC02F50 /* Mailbox 26 Data Length Code Register */
+#define CAN_MB26_TIMESTAMP             0xFFC02F54 /* Mailbox 26 Time Stamp Value Register */
+#define CAN_MB26_ID0                   0xFFC02F58 /* Mailbox 26 Identifier Low Register */
+#define CAN_MB26_ID1                   0xFFC02F5C /* Mailbox 26 Identifier High Register */
+#define CAN_MB27_DATA0                 0xFFC02F60 /* Mailbox 27 Data Word 0 [15:0] Register */
+#define CAN_MB27_DATA1                 0xFFC02F64 /* Mailbox 27 Data Word 1 [31:16] Register */
+#define CAN_MB27_DATA2                 0xFFC02F68 /* Mailbox 27 Data Word 2 [47:32] Register */
+#define CAN_MB27_DATA3                 0xFFC02F6C /* Mailbox 27 Data Word 3 [63:48] Register */
+#define CAN_MB27_LENGTH                0xFFC02F70 /* Mailbox 27 Data Length Code Register */
+#define CAN_MB27_TIMESTAMP             0xFFC02F74 /* Mailbox 27 Time Stamp Value Register */
+#define CAN_MB27_ID0                   0xFFC02F78 /* Mailbox 27 Identifier Low Register */
+#define CAN_MB27_ID1                   0xFFC02F7C /* Mailbox 27 Identifier High Register */
+#define CAN_MB28_DATA0                 0xFFC02F80 /* Mailbox 28 Data Word 0 [15:0] Register */
+#define CAN_MB28_DATA1                 0xFFC02F84 /* Mailbox 28 Data Word 1 [31:16] Register */
+#define CAN_MB28_DATA2                 0xFFC02F88 /* Mailbox 28 Data Word 2 [47:32] Register */
+#define CAN_MB28_DATA3                 0xFFC02F8C /* Mailbox 28 Data Word 3 [63:48] Register */
+#define CAN_MB28_LENGTH                0xFFC02F90 /* Mailbox 28 Data Length Code Register */
+#define CAN_MB28_TIMESTAMP             0xFFC02F94 /* Mailbox 28 Time Stamp Value Register */
+#define CAN_MB28_ID0                   0xFFC02F98 /* Mailbox 28 Identifier Low Register */
+#define CAN_MB28_ID1                   0xFFC02F9C /* Mailbox 28 Identifier High Register */
+#define CAN_MB29_DATA0                 0xFFC02FA0 /* Mailbox 29 Data Word 0 [15:0] Register */
+#define CAN_MB29_DATA1                 0xFFC02FA4 /* Mailbox 29 Data Word 1 [31:16] Register */
+#define CAN_MB29_DATA2                 0xFFC02FA8 /* Mailbox 29 Data Word 2 [47:32] Register */
+#define CAN_MB29_DATA3                 0xFFC02FAC /* Mailbox 29 Data Word 3 [63:48] Register */
+#define CAN_MB29_LENGTH                0xFFC02FB0 /* Mailbox 29 Data Length Code Register */
+#define CAN_MB29_TIMESTAMP             0xFFC02FB4 /* Mailbox 29 Time Stamp Value Register */
+#define CAN_MB29_ID0                   0xFFC02FB8 /* Mailbox 29 Identifier Low Register */
+#define CAN_MB29_ID1                   0xFFC02FBC /* Mailbox 29 Identifier High Register */
+#define CAN_MB30_DATA0                 0xFFC02FC0 /* Mailbox 30 Data Word 0 [15:0] Register */
+#define CAN_MB30_DATA1                 0xFFC02FC4 /* Mailbox 30 Data Word 1 [31:16] Register */
+#define CAN_MB30_DATA2                 0xFFC02FC8 /* Mailbox 30 Data Word 2 [47:32] Register */
+#define CAN_MB30_DATA3                 0xFFC02FCC /* Mailbox 30 Data Word 3 [63:48] Register */
+#define CAN_MB30_LENGTH                0xFFC02FD0 /* Mailbox 30 Data Length Code Register */
+#define CAN_MB30_TIMESTAMP             0xFFC02FD4 /* Mailbox 30 Time Stamp Value Register */
+#define CAN_MB30_ID0                   0xFFC02FD8 /* Mailbox 30 Identifier Low Register */
+#define CAN_MB30_ID1                   0xFFC02FDC /* Mailbox 30 Identifier High Register */
+#define CAN_MB31_DATA0                 0xFFC02FE0 /* Mailbox 31 Data Word 0 [15:0] Register */
+#define CAN_MB31_DATA1                 0xFFC02FE4 /* Mailbox 31 Data Word 1 [31:16] Register */
+#define CAN_MB31_DATA2                 0xFFC02FE8 /* Mailbox 31 Data Word 2 [47:32] Register */
+#define CAN_MB31_DATA3                 0xFFC02FEC /* Mailbox 31 Data Word 3 [63:48] Register */
+#define CAN_MB31_LENGTH                0xFFC02FF0 /* Mailbox 31 Data Length Code Register */
+#define CAN_MB31_TIMESTAMP             0xFFC02FF4 /* Mailbox 31 Time Stamp Value Register */
+#define CAN_MB31_ID0                   0xFFC02FF8 /* Mailbox 31 Identifier Low Register */
+#define CAN_MB31_ID1                   0xFFC02FFC /* Mailbox 31 Identifier High Register */
+#define PORTF_FER                      0xFFC03200 /* Port F Function Enable Register (Alternate/Flag*) */
+#define PORTG_FER                      0xFFC03204 /* Port G Function Enable Register (Alternate/Flag*) */
+#define PORTH_FER                      0xFFC03208 /* Port H Function Enable Register (Alternate/Flag*) */
+#define PORT_MUX                       0xFFC0320C /* Port Multiplexer Control Register */
+#define HMDMA0_CONTROL                 0xFFC03300 /* Handshake MDMA0 Control Register */
+#define HMDMA0_ECINIT                  0xFFC03304 /* HMDMA0 Initial Edge Count Register */
+#define HMDMA0_BCINIT                  0xFFC03308 /* HMDMA0 Initial Block Count Register */
+#define HMDMA0_ECURGENT                0xFFC0330C /* HMDMA0 Urgent Edge Count Threshhold Register */
+#define HMDMA0_ECOVERFLOW              0xFFC03310 /* HMDMA0 Edge Count Overflow Interrupt Register */
+#define HMDMA0_ECOUNT                  0xFFC03314 /* HMDMA0 Current Edge Count Register */
+#define HMDMA0_BCOUNT                  0xFFC03318 /* HMDMA0 Current Block Count Register */
+#define HMDMA1_CONTROL                 0xFFC03340 /* Handshake MDMA1 Control Register */
+#define HMDMA1_ECINIT                  0xFFC03344 /* HMDMA1 Initial Edge Count Register */
+#define HMDMA1_BCINIT                  0xFFC03348 /* HMDMA1 Initial Block Count Register */
+#define HMDMA1_ECURGENT                0xFFC0334C /* HMDMA1 Urgent Edge Count Threshhold Register */
+#define HMDMA1_ECOVERFLOW              0xFFC03350 /* HMDMA1 Edge Count Overflow Interrupt Register */
+#define HMDMA1_ECOUNT                  0xFFC03354 /* HMDMA1 Current Edge Count Register */
+#define HMDMA1_BCOUNT                  0xFFC03358 /* HMDMA1 Current Block Count Register */
+#define CHIPID                         0xFFC00014
+#define DMA_TC_CNT                     0xFFC00B0C
+#define DMA_TC_PER                     0xFFC00B10
 
-#if defined(__BFIN_DEF_ADSP_BF537_proc__) || !defined(__BFIN_DEF_ADSP_BF536_proc__)
+#if !defined(__ADSPBF536__)
 #define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
 #define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
 #define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
 #define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
 #define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
 #define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF534_proc__ */
index eae8e8178e9957fb6e134a2c7b32b8bafc07a5ed..1736dabf09cb59f6d019fc05143c5659cd295d77 100644 (file)
 #define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
 #define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
 #define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF538_proc__ */
index 1aae565fe7fac90cade2c3febacb3024b025ca4c..46925f8c070dc74be5e81ed86a9551882037623a 100644 (file)
 #define EBIU_SDBCTL                    0xFFC00A14
 #define EBIU_SDRRC                     0xFFC00A18
 #define EBIU_SDSTAT                    0xFFC00A1C
+
 #define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA03FFF Instruction Bank A SRAM */
 #define L1_INST_SRAM_SIZE (0xFFA03FFF - 0xFFA00000 + 1)
 #define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF561_proc__ */
index f537e93f701a751a1f5d9bdce96126d93d3b9f5d..0e2cacb3937a4ee9dbaf9a5b84c1436bf32e9065 100644 (file)
@@ -229,33 +229,65 @@ static uint32_t (* const bfrom_NandBoot)(int32_t dNandAddress, int32_t dFlags, i
 
 #endif /* __ASSEMBLY__ */
 
+/* Bit defines for BF53x block flags */
+#define BFLAG_53X_ZEROFILL     0x0001
+#define BFLAG_53X_RESVECT      0x0002
+#define BFLAG_53X_INIT         0x0008
+#define BFLAG_53X_IGNORE       0x0010
+#define BFLAG_53X_PFLAG_MASK   0x01E0
+#define BFLAG_53X_PFLAG_SHIFT  5
+#define BFLAG_53X_PPORT_MASK   0x0600
+#define BFLAG_53X_PPORT_SHIFT  9
+#define BFLAG_53X_COMPRESSED   0x2000
+#define BFLAG_53X_FINAL        0x8000
+
+/* Bit defines for BF56x global header */
+#define GFLAG_56X_16BIT_FLASH  0x00000001
+#define GFLAG_56X_WAIT_MASK    0x0000001E
+#define GFLAG_56X_WAIT_SHIFT   1
+#define GFLAG_56X_HOLD_MASK    0x000000C0
+#define GFLAG_56X_HOLD_SHIFT   6
+#define GFLAG_56X_SPI_MASK     0x00000700
+#define GFLAG_56X_SPI_SHIFT    8
+#define GFLAG_56X_SPI_500K     0x0
+#define GFLAG_56X_SPI_1M       0x1
+#define GFLAG_56X_SPI_2M       0x2
+#define GFLAG_56X_SIGN_MASK    0xFF000000
+#define GFLAG_56X_SIGN_SHIFT   28
+#define GFLAG_56X_SIGN_MAGIC   0xA
+
 /* Bit defines for ADI_BOOT_DATA->dFlags */
-#define BFLAG_DMACODE_MASK 0x0000000F
-#define BFLAG_SAFE         0x00000010
-#define BFLAG_AUX          0x00000020
-#define BFLAG_FILL         0x00000100
-#define BFLAG_QUICKBOOT    0x00000200
-#define BFLAG_CALLBACK     0x00000400
-#define BFLAG_INIT         0x00000800
-#define BFLAG_IGNORE       0x00001000
-#define BFLAG_INDIRECT     0x00002000
-#define BFLAG_FIRST        0x00004000
-#define BFLAG_FINAL        0x00008000
-#define BFLAG_HOOK         0x00400000
-#define BFLAG_HDRINDIRECT  0x00800000
-#define BFLAG_TYPE_MASK    0x00300000
-#define BFLAG_TYPE_1       0x00000000
-#define BFLAG_TYPE_2       0x00100000
-#define BFLAG_TYPE_3       0x00200000
-#define BFLAG_TYPE_4       0x00300000
-#define BFLAG_FASTREAD     0x00400000
-#define BFLAG_NOAUTO       0x01000000
-#define BFLAG_PERIPHERAL   0x02000000
-#define BFLAG_SLAVE        0x04000000
-#define BFLAG_WAKEUP       0x08000000
-#define BFLAG_NEXTDXE      0x10000000
-#define BFLAG_RETURN       0x20000000
-#define BFLAG_RESET        0x40000000
-#define BFLAG_NONRESTORE   0x80000000
+#define BFLAG_DMACODE_MASK     0x0000000F
+#define BFLAG_SAFE             0x00000010
+#define BFLAG_AUX              0x00000020
+#define BFLAG_FILL             0x00000100
+#define BFLAG_QUICKBOOT        0x00000200
+#define BFLAG_CALLBACK         0x00000400
+#define BFLAG_INIT             0x00000800
+#define BFLAG_IGNORE           0x00001000
+#define BFLAG_INDIRECT         0x00002000
+#define BFLAG_FIRST            0x00004000
+#define BFLAG_FINAL            0x00008000
+#define BFLAG_HDRSIGN_MASK     0xFF000000
+#define BFLAG_HDRSIGN_SHIFT    24
+#define BFLAG_HDRSIGN_MAGIC    0xAD
+#define BFLAG_HDRCHK_MASK      0x00FF0000
+#define BFLAG_HDRCHK_SHIFT     16
+#define BFLAG_HOOK             0x00400000
+#define BFLAG_HDRINDIRECT      0x00800000
+#define BFLAG_TYPE_MASK        0x00300000
+#define BFLAG_TYPE_1           0x00000000
+#define BFLAG_TYPE_2           0x00100000
+#define BFLAG_TYPE_3           0x00200000
+#define BFLAG_TYPE_4           0x00300000
+#define BFLAG_FASTREAD         0x00400000
+#define BFLAG_NOAUTO           0x01000000
+#define BFLAG_PERIPHERAL       0x02000000
+#define BFLAG_SLAVE            0x04000000
+#define BFLAG_WAKEUP           0x08000000
+#define BFLAG_NEXTDXE          0x10000000
+#define BFLAG_RETURN           0x20000000
+#define BFLAG_RESET            0x40000000
+#define BFLAG_NONRESTORE       0x80000000
 
 #endif
index 8eca7d6fb64d4cd1490c3c1063e16e774ca6c82d..362b8c47eaa9143fe73fcf04bd80ef1c12d396dd 100644 (file)
@@ -207,7 +207,6 @@ extern int timer_init(void);
 
 void board_init_f(ulong bootflag)
 {
-       ulong addr;
        bd_t *bd;
        char buf[32];
 
@@ -244,17 +243,12 @@ void board_init_f(ulong bootflag)
        gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR);
        memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
 
-       /* Board data initialization */
-       addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t));
-
-       /* Align to 4 byte boundary */
-       addr &= ~(4 - 1);
-       bd = (bd_t *) addr;
+       bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR);
        gd->bd = bd;
-       memset((void *)bd, 0, sizeof(bd_t));
+       memset((void *)bd, 0, GENERATED_BD_INFO_SIZE);
 
        bd->bi_r_version = version_string;
-       bd->bi_cpu = BFIN_CPU;
+       bd->bi_cpu = MK_STR(CONFIG_BFIN_CPU);
        bd->bi_board_name = BFIN_BOARD_NAME;
        bd->bi_vco = get_vco();
        bd->bi_cclk = get_cclk();
@@ -283,8 +277,11 @@ void board_init_f(ulong bootflag)
        printf("Core: %s MHz, ", strmhz(buf, get_cclk()));
        printf("System: %s MHz\n", strmhz(buf, get_sclk()));
 
-       printf("RAM:   ");
-       print_size(bd->bi_memsize, "\n");
+       if (CONFIG_MEM_SIZE) {
+               printf("RAM:   ");
+               print_size(bd->bi_memsize, "\n");
+       }
+
 #if defined(CONFIG_POST)
        post_init_f();
        post_bootmode_init();
@@ -393,7 +390,7 @@ void board_init_r(gd_t * id, ulong dest_addr)
                post_run(NULL, POST_RAM | post_bootmode_get(0));
 #endif
 
-       if (bfin_os_log_check()) {
+       if (CONFIG_MEM_SIZE && bfin_os_log_check()) {
                puts("\nLog buffer from operating system:\n");
                bfin_os_log_dump();
                puts("\n");
index f15c97ed0cbbc4ba677be673a3467cf56b107210..2b8d285e1f420a52be8d99c1e1dbbb3e0ff2a7e1 100644 (file)
  * This is here in the first place so we can quickly test building
  * for different CPU's which may lack non-cache L1 data.
  */
+#ifndef L1_DATA_A_SRAM
+# define L1_DATA_A_SRAM      0
+# define L1_DATA_A_SRAM_SIZE 0
+#endif
 #ifndef L1_DATA_B_SRAM
-# define L1_DATA_B_SRAM      CONFIG_SYS_MONITOR_BASE
-# define L1_DATA_B_SRAM_SIZE 0
+# define L1_DATA_B_SRAM      L1_DATA_A_SRAM
+# define L1_DATA_B_SRAM_SIZE L1_DATA_A_SRAM_SIZE
 #endif
 
 /* The 0xC offset is so we don't clobber the tiny LDR jump block. */
@@ -138,7 +142,7 @@ SECTIONS
        } >l1_data AT>ram_data
        __data_l1_lma = LOADADDR(.data_l1);
        __data_l1_len = SIZEOF(.data_l1);
-       ASSERT (__data_l1_len <= L1_DATA_B_SRAM_SIZE, "L1 data overflow!")
+       ASSERT (__data_l1_len <= L1_DATA_B_SRAM_SIZE, "L1 data overflow!")
 
        .bss :
        {
index 749c38968ab1823cb403d2a063e7c73fad0a77a0..863f3ddbc6a641566632706e367b223c6a1ab606 100644 (file)
@@ -24,7 +24,7 @@
 CROSS_COMPILE ?= m68k-elf-
 
 clibdir = $(shell dirname `$(CC) $(CFLAGS) -print-file-name=libc.a`)
-STANDALONE_LOAD_ADDR = 0x20000 -L $(clibdir)
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x20000 -L $(clibdir)
 
 PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__
 PLATFORM_LDFLAGS  += -n
index f824b34252d47a8b380d187a2518c010c4f44373..6a892db649cdaf6e03a881960a9f2139b4803480 100644 (file)
@@ -277,9 +277,13 @@ board_init_f (ulong bootflag)
        debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);
 
 #ifdef CONFIG_LCD
+#ifdef CONFIG_FB_ADDR
+       gd->fb_base = CONFIG_FB_ADDR;
+#else
        /* reserve memory for LCD display (always full pages) */
        addr = lcd_setmem (addr);
        gd->fb_base = addr;
+#endif /* CONFIG_FB_ADDR */
 #endif /* CONFIG_LCD */
 
        /*
index 76a2fb27c1b720c526d40ed665e829e93aac345b..1229ac7f255ba2b6067811368fcc47582ebe85de 100644 (file)
@@ -71,7 +71,6 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
        int ret;
 
        ulong cmd_start, cmd_end;
-       ulong bootmap_base;
        bd_t  *kbd;
        void  (*kernel) (bd_t *, ulong, ulong, ulong, ulong);
        struct lmb *lmb = &images->lmb;
@@ -79,17 +78,15 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
        if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
                return 1;
 
-       bootmap_base = getenv_bootm_low();
-
        /* allocate space and init command line */
-       ret = boot_get_cmdline (lmb, &cmd_start, &cmd_end, bootmap_base);
+       ret = boot_get_cmdline (lmb, &cmd_start, &cmd_end);
        if (ret) {
                puts("ERROR with allocation of cmdline\n");
                goto error;
        }
 
        /* allocate space for kernel copy of board info */
-       ret = boot_get_kbd (lmb, &kbd, bootmap_base);
+       ret = boot_get_kbd (lmb, &kbd);
        if (ret) {
                puts("ERROR with allocation of kernel bd\n");
                goto error;
index c3c9f958c0b1dac5b6d9170bb09507870d8e491c..abea70bb0d79ebf455d803aa407c10b212217a7b 100644 (file)
@@ -26,6 +26,6 @@
 
 CROSS_COMPILE ?= mb-
 
-STANDALONE_LOAD_ADDR = 0x80F00000
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F00000
 
 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
index aa06761ae35f9ac994487265e9cc13271cd7b77b..318d34b1e6887198bea8d15ff9df09b28a2ded8a 100644 (file)
@@ -23,7 +23,7 @@
 
 CROSS_COMPILE ?= mips_4KC-
 
-STANDALONE_LOAD_ADDR = 0x80200000 -T mips.lds
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -T mips.lds
 
 PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 
similarity index 87%
rename from arch/mips/cpu/Makefile
rename to arch/mips/cpu/mips32/Makefile
index 06df8d17a8cac07fcf43af606633a03808311b77..e315c1bb8cf7a876a8281aa1596273283a4a221c 100644 (file)
@@ -29,11 +29,6 @@ START        = start.o
 SOBJS-y        = cache.o
 COBJS-y        = cpu.o interrupts.o
 
-SOBJS-$(CONFIG_INCA_IP)        += incaip_wdt.o
-COBJS-$(CONFIG_INCA_IP)        += asc_serial.o incaip_clock.o
-COBJS-$(CONFIG_PURPLE) += asc_serial.o
-COBJS-$(CONFIG_SOC_AU1X00) += au1x00_eth.o au1x00_serial.o au1x00_usb_ohci.o
-
 SRCS   := $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 START  := $(addprefix $(obj),$(START))
diff --git a/arch/mips/cpu/mips32/au1x00/Makefile b/arch/mips/cpu/mips32/au1x00/Makefile
new file mode 100644 (file)
index 0000000..dc58475
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# (C) Copyright 2011
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(SOC).o
+
+COBJS  = au1x00_eth.o au1x00_serial.o au1x00_usb_ohci.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(obj).depend $(LIB)
+
+$(LIB):        $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 87%
rename from board/eNET/config.mk
rename to arch/mips/cpu/mips32/au1x00/config.mk
index 9d2dfa535b2ecedd9b9ce8e11ecff4c73daabead..568f33356bbef33036ab3199bab7ff57c220fd57 100644 (file)
@@ -1,6 +1,6 @@
 #
-# (C) Copyright 2002
-# Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
+# (C) Copyright 2011
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -21,4 +21,4 @@
 # MA 02111-1307 USA
 #
 
-LDPPFLAGS += -DFLASH_SIZE=0x40000
+PLATFORM_CPPFLAGS += -mtune=4kc
similarity index 98%
rename from arch/mips/cpu/cache.S
rename to arch/mips/cpu/mips32/cache.S
index 4b30c89b1481bc1b009cb35d2b5b567c6281916e..296593805a7334a333321a73d1cb051c909d88d7 100644 (file)
@@ -311,11 +311,7 @@ LEAF(dcache_enable)
 * RETURNS: N/A
 *
 */
-#if defined(CONFIG_PURPLE)
-# define       CACHE_LOCK_SIZE (CONFIG_SYS_DCACHE_SIZE/2)
-#else
 # define       CACHE_LOCK_SIZE (CONFIG_SYS_DCACHE_SIZE)
-#endif
        .globl  mips_cache_lock
        .ent    mips_cache_lock
 mips_cache_lock:
similarity index 83%
rename from arch/mips/cpu/config.mk
rename to arch/mips/cpu/mips32/config.mk
index a173c5480c0131e2c89808fee7f6398737061b52..4d1b27379d8973e05352ab472d0ece07e20a5582 100644 (file)
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-v=$(shell $(AS) --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | cut -d. -f2)
-MIPSFLAGS:=$(shell \
-if [ "$v" -lt "14" ]; then \
-       echo "-mcpu=4kc"; \
-else \
-       echo "-march=4kc -mtune=4kc"; \
-fi)
+
+#
+# Default optimization level for MIPS32
+#
+# Note: Toolchains with binutils prior to v2.16
+# are no longer supported by U-Boot MIPS tree!
+#
+MIPSFLAGS = -march=mips32r2
 
 ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
 ENDIANNESS = -EL
similarity index 83%
rename from board/purple/Makefile
rename to arch/mips/cpu/mips32/incaip/Makefile
index 10e566da5c2c6cc82a6a47f6a4c4915e203caae2..9c2b1aa86ca7a19c69e2eed7bddb34b6952f5759 100644 (file)
@@ -1,6 +1,5 @@
-
 #
-# (C) Copyright 2003-2006
+# (C) Copyright 2011
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = $(obj)lib$(BOARD).o
+LIB    = $(obj)lib$(SOC).o
 
-COBJS  = $(BOARD).o flash.o sconsole.o
-SOBJS  = lowlevel_init.o
+SOBJS  = incaip_wdt.o
+COBJS  = incaip_clock.o asc_serial.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+all:   $(obj).depend $(LIB)
 
-$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+$(LIB):        $(OBJS)
        $(call cmd_link_o_target, $(OBJS))
 
 #########################################################################
similarity index 77%
rename from arch/mips/cpu/asc_serial.c
rename to arch/mips/cpu/mips32/incaip/asc_serial.c
index be686c2ae8ddbb5e0fc0594f0998cf3b19289da1..7239804b9d4bc34afb8599d2b516b8a4347c60cf 100644 (file)
@@ -3,47 +3,10 @@
  */
 
 #include <config.h>
-
-#ifdef CONFIG_PURPLE
-#define        serial_init     asc_serial_init
-#define        serial_putc     asc_serial_putc
-#define        serial_puts     asc_serial_puts
-#define        serial_getc     asc_serial_getc
-#define        serial_tstc     asc_serial_tstc
-#define        serial_setbrg   asc_serial_setbrg
-#endif
-
 #include <common.h>
 #include <asm/inca-ip.h>
 #include "asc_serial.h"
 
-#ifdef CONFIG_PURPLE
-
-#undef ASC_FIFO_PRESENT
-#define TOUT_LOOP      100000
-
-/* Set base address for second FPI interrupt control register bank */
-#define SFPI_INTCON_BASEADDR   0xBF0F0000
-
-/* Register offset from base address */
-#define FBS_ISR                0x00000000      /* Interrupt status register */
-#define FBS_IMR                0x00000008      /* Interrupt mask register */
-#define FBS_IDIS       0x00000010      /* Interrupt disable register */
-
-/* Interrupt status register bits */
-#define FBS_ISR_AT     0x00000040      /* ASC transmit interrupt */
-#define FBS_ISR_AR     0x00000020      /* ASC receive interrupt */
-#define FBS_ISR_AE     0x00000010      /* ASC error interrupt */
-#define FBS_ISR_AB     0x00000008      /* ASC transmit buffer interrupt */
-#define FBS_ISR_AS      0x00000004     /* ASC start of autobaud detection interrupt */
-#define FBS_ISR_AF     0x00000002      /* ASC end of autobaud detection interrupt */
-
-#else
-
-#define ASC_FIFO_PRESENT
-
-#endif
-
 
 #define SET_BIT(reg, mask)                  reg |= (mask)
 #define CLEAR_BIT(reg, mask)                reg &= (~mask)
@@ -71,10 +34,8 @@ static volatile incaAsc_t *pAsc = (incaAsc_t *)INCA_IP_ASC;
 
 int serial_init (void)
 {
-#ifdef CONFIG_INCA_IP
     /* we have to set PMU.EN13 bit to enable an ASC device*/
     INCAASC_PMU_ENABLE(13);
-#endif
 
     /* and we have to set CLC register*/
     CLEAR_BIT(pAsc->asc_clc, ASCCLC_DISS);
@@ -86,7 +47,6 @@ int serial_init (void)
     /* select input port */
     pAsc->asc_pisel = (CONSOLE_TTY & 0x1);
 
-#ifdef ASC_FIFO_PRESENT
     /* TXFIFO's filling level */
     SET_BITFIELD(pAsc->asc_txfcon, ASCTXFCON_TXFITLMASK,
                    ASCTXFCON_TXFITLOFF, INCAASC_TXFIFO_FL);
@@ -98,25 +58,20 @@ int serial_init (void)
                    ASCRXFCON_RXFITLOFF, INCAASC_RXFIFO_FL);
     /* enable RXFIFO */
     SET_BIT(pAsc->asc_rxfcon, ASCRXFCON_RXFEN);
-#endif
 
     /* enable error signals */
     SET_BIT(pAsc->asc_con, ASCCON_FEN);
     SET_BIT(pAsc->asc_con, ASCCON_OEN);
 
-#ifdef CONFIG_INCA_IP
     /* acknowledge ASC interrupts */
     ASC_INTERRUPTS_CLEAR(INCAASC_IRQ_LINE_ALL);
 
     /* disable ASC interrupts */
     ASC_INTERRUPTS_DISABLE(INCAASC_IRQ_LINE_ALL);
-#endif
 
-#ifdef ASC_FIFO_PRESENT
     /* set FIFOs into the transparent mode */
     SET_BIT(pAsc->asc_txfcon, ASCTXFCON_TXTMEN);
     SET_BIT(pAsc->asc_rxfcon, ASCRXFCON_RXTMEN);
-#endif
 
     /* set baud rate */
     serial_setbrg();
@@ -132,11 +87,7 @@ void serial_setbrg (void)
     ulong      uiReloadValue, fdv;
     ulong      f_ASC;
 
-#ifdef CONFIG_INCA_IP
     f_ASC = incaip_get_fpiclk();
-#else
-    f_ASC = ASC_CLOCK_RATE;
-#endif
 
 #ifndef INCAASC_USE_FDV
     fdv = 2;
@@ -261,15 +212,10 @@ static int serial_setopt (void)
 
 void serial_putc (const char c)
 {
-#ifdef ASC_FIFO_PRESENT
     uint txFl = 0;
-#else
-    uint timeout = 0;
-#endif
 
     if (c == '\n') serial_putc ('\r');
 
-#ifdef ASC_FIFO_PRESENT
     /* check do we have a free space in the TX FIFO */
     /* get current filling level */
     do
@@ -277,25 +223,9 @@ void serial_putc (const char c)
        txFl = ( pAsc->asc_fstat & ASCFSTAT_TXFFLMASK ) >> ASCFSTAT_TXFFLOFF;
     }
     while ( txFl == INCAASC_TXFIFO_FULL );
-#else
-
-    while(!(*(volatile unsigned long*)(SFPI_INTCON_BASEADDR + FBS_ISR) &
-                          FBS_ISR_AB))
-    {
-           if (timeout++ > TOUT_LOOP)
-           {
-                   break;
-           }
-    }
-#endif
 
     pAsc->asc_tbuf = c; /* write char to Transmit Buffer Register */
 
-#ifndef ASC_FIFO_PRESENT
-    *(volatile unsigned long*)(SFPI_INTCON_BASEADDR + FBS_ISR) = FBS_ISR_AB |
-                                                                FBS_ISR_AT;
-#endif
-
     /* check for errors */
     if ( pAsc->asc_con & ASCCON_OE )
     {
@@ -324,10 +254,6 @@ int serial_getc (void)
 
     c = (char)(pAsc->asc_rbuf & symbol_mask);
 
-#ifndef ASC_FIFO_PRESENT
-    *(volatile unsigned long*)(SFPI_INTCON_BASEADDR + FBS_ISR) = FBS_ISR_AR;
-#endif
-
     return c;
 }
 
@@ -335,19 +261,10 @@ int serial_tstc (void)
 {
     int res = 1;
 
-#ifdef ASC_FIFO_PRESENT
     if ( (pAsc->asc_fstat & ASCFSTAT_RXFFLMASK) == 0 )
     {
        res = 0;
     }
-#else
-    if (!(*(volatile unsigned long*)(SFPI_INTCON_BASEADDR + FBS_ISR) &
-                                                               FBS_ISR_AR))
-
-    {
-       res = 0;
-    }
-#endif
     else if ( pAsc->asc_con & ASCCON_FE )
     {
        SET_BIT(pAsc->asc_whbcon, ASCWHBCON_CLRFE);
similarity index 85%
rename from board/st/nhk8815/config.mk
rename to arch/mips/cpu/mips32/incaip/config.mk
index 1789717fcf4dda248bb1d85393a2a26bb7088992..568f33356bbef33036ab3199bab7ff57c220fd57 100644 (file)
@@ -1,5 +1,6 @@
-# (C) Copyright 2007
-# STMicroelectronics, <www.st.com>
+#
+# (C) Copyright 2011
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -19,8 +20,5 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-#
-# image should be loaded at 0x01000000
-#
 
-CONFIG_SYS_TEXT_BASE = 0x03F80000
+PLATFORM_CPPFLAGS += -mtune=4kc
similarity index 92%
rename from arch/mips/cpu/start.S
rename to arch/mips/cpu/mips32/start.S
index d6bcef6b5624dee914c97bdd39a36021b4967d64..e661d4625fc5f0167c24159fe8028f4a5a2685f5 100644 (file)
@@ -67,9 +67,6 @@ _start:
 #if defined(CONFIG_INCA_IP)
        .word INFINEON_EBU_BOOTCFG /* EBU init code, fetched during booting */
        .word 0x00000000           /* phase of the flash                    */
-#elif defined(CONFIG_PURPLE)
-       .word INFINEON_EBU_BOOTCFG /* EBU init code, fetched during booting */
-       .word INFINEON_EBU_BOOTCFG /* EBU init code, fetched during booting */
 #else
        RVECENT(romReserved,2)
 #endif
@@ -203,30 +200,6 @@ _start:
         * 128 * 8 == 1024 == 0x400
         * so this is address R_VEC+0x400 == 0xbfc00400
         */
-#ifdef CONFIG_PURPLE
-/* 0xbfc00400 */
-       .word   0xdc870000
-       .word   0xfca70000
-       .word   0x20840008
-       .word   0x20a50008
-       .word   0x20c6ffff
-       .word   0x14c0fffa
-       .word   0x00000000
-       .word   0x03e00008
-       .word   0x00000000
-       .word   0x00000000
-/* 0xbfc00428 */
-       .word   0xdc870000
-       .word   0xfca70000
-       .word   0x20840008
-       .word   0x20a50008
-       .word   0x20c6ffff
-       .word   0x14c0fffa
-       .word   0x00000000
-       .word   0x03e00008
-       .word   0x00000000
-       .word   0x00000000
-#endif /* CONFIG_PURPLE */
        .align 4
 reset:
 
@@ -337,17 +310,12 @@ relocate_code:
        move    a0, t1          /* a0 <-- destination addr      */
        sub     a1, t2, t0      /* a1 <-- size                  */
 
-       /* On the purple board we copy the code earlier in a special way
-        * in order to solve flash problems
-        */
-#ifndef CONFIG_PURPLE
 1:
        lw      t3, 0(t0)
        sw      t3, 0(t1)
        addu    t0, 4
        ble     t0, t2, 1b
        addu    t1, 4           /* delay slot                   */
-#endif
 
        /* If caches were enabled, we would have to flush them here.
         */
index e787a1dee656906fc29712fd7bd1ba74aa06e9c4..26f100290c0f483c5df4235cfb6c9cd6a3f3ee35 100644 (file)
 /*  Module      :  EBU register address and bits                       */
 /***********************************************************************/
 
-#if defined(CONFIG_INCA_IP)
 #define INCA_IP_EBU                          (0xB8000200)
-#elif defined(CONFIG_PURPLE)
-#define INCA_IP_EBU                          (0xB800D800)
-#endif
-
 /***********************************************************************/
 
 
@@ -1495,12 +1490,7 @@ If set and clear bit are written concurrently with 1, the associated bit is not
 /*  Module      :  ASC register address and bits                       */
 /***********************************************************************/
 
-#if defined(CONFIG_INCA_IP)
 #define INCA_IP_ASC                          (0xB8000400)
-#elif defined(CONFIG_PURPLE)
-#define INCA_IP_ASC                          (0xBE500000)
-#endif
-
 /***********************************************************************/
 
 
index f3171241556a9e3ae59eb3b4058d1379cfa00146..623c4d7f0d58a2ee0018c3dbecfdf2ed07c51e04 100644 (file)
@@ -162,9 +162,6 @@ void board_init_f(ulong bootflag)
        init_fnc_t **init_fnc_ptr;
        ulong addr, addr_sp, len = (ulong)&uboot_end - CONFIG_SYS_MONITOR_BASE;
        ulong *s;
-#ifdef CONFIG_PURPLE
-       void copy_code (ulong);
-#endif
 
        /* Pointer is writable since we allocated a register for it.
         */
@@ -253,13 +250,6 @@ void board_init_f(ulong bootflag)
 
        memcpy (id, (void *)gd, sizeof (gd_t));
 
-       /* On the purple board we copy the code in a special way
-        * in order to solve flash problems
-        */
-#ifdef CONFIG_PURPLE
-       copy_code(addr);
-#endif
-
        relocate_code (addr_sp, id, addr);
 
        /* NOTREACHED - relocate_code() does not return */
index d241a96e8e81024f9e8641af5c3a97c26c8016d5..e58ea24d2cb1b5aef061c1fa6a293a6609763794 100644 (file)
@@ -29,7 +29,5 @@ STANDALONE_LOAD_ADDR ?= 0x02000000
 PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__
 PLATFORM_CPPFLAGS += -G0
 
-LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
-
 LDFLAGS_FINAL += --gc-sections
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
index 31e44160f61e63e31cc80bc3d171ce1409dff86b..a30715459de952a543cd85d6fe21eac74260ac0c 100644 (file)
 
 CROSS_COMPILE ?= ppc_8xx-
 
-STANDALONE_LOAD_ADDR = 0x40000
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
 LDFLAGS_FINAL += --gc-sections
-PLATFORM_RELFLAGS += -mrelocatable -ffunction-sections -fdata-sections
+PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections
 PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
 PLATFORM_LDFLAGS  += -n
 
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_SPL
-LDSCRIPT := $(SRCTREE)/$(CONFIG_BOARDDIR)/u-boot-nand.lds
-else
-ifneq ($(wildcard $(SRCTREE)/arch/powerpc/cpu/$(CPU)/u-boot.lds),)
-LDSCRIPT := $(SRCTREE)/arch/powerpc/cpu/$(CPU)/u-boot.lds
-endif
-endif
-
 #
 # When cross-compiling on NetBSD, we have to define __PPC__ or else we
 # will pick up a va_list declaration that is incompatible with the
index df1f6acedf14a7f33a06e2f50f633654764190b7..fb0c7158caed4115a28810533506edabe5f0a6c5 100644 (file)
@@ -21,6 +21,6 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 
 PLATFORM_CPPFLAGS += -DCONFIG_74xx_7xx -ffixed-r2 -mstring
index baf55ccaaf1b182c89b38963d856f1a22d5cacff..8fcededf26aab6932c95f14cf000bb57ade69ca8 100644 (file)
@@ -20,7 +20,7 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 
 PLATFORM_CPPFLAGS += -DCONFIG_MPC512X -DCONFIG_E300 \
                        -ffixed-r2 -msoft-float -mcpu=603e
index c4108af33673689f16c73143cb1ad66a2a3b87a5..9dc1e48256a6330046ca7418a8a11183f8516aca 100644 (file)
@@ -51,20 +51,10 @@ void diu_set_pixel_clock(unsigned int pixclock)
        debug("DIU: Modified value of CLKDVDR = 0x%08x\n", in_be32(clkdvdr));
 }
 
-int platform_diu_init(unsigned int *xres, unsigned int *yres)
+int platform_diu_init(unsigned int xres, unsigned int yres, const char *port)
 {
-       unsigned int pixel_format;
-
-#if defined(CONFIG_VIDEO_XRES) & defined(CONFIG_VIDEO_YRES)
-       *xres = CONFIG_VIDEO_XRES;
-       *yres = CONFIG_VIDEO_YRES;
-#else
-       *xres = 1024;
-       *yres = 768;
-#endif
-       pixel_format = 0x88883316;
+       unsigned int pixel_format = 0x88883316;
 
        debug("mpc5121_diu_init\n");
-
-       return fsl_diu_init(*xres, pixel_format, 0);
+       return fsl_diu_init(xres, pixel_format, 0);
 }
index 1c7df0005c0db22a81a69fffd5cd107b46ed8484..ab55040e5a409ce7f5167bf4b770231bd1bc89d1 100644 (file)
@@ -21,6 +21,6 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS +=   -fPIC -meabi
+PLATFORM_RELFLAGS +=   -meabi
 
 PLATFORM_CPPFLAGS +=   -DCONFIG_5xx -ffixed-r2 -mpowerpc -msoft-float
index 832909fbb3bd54118f33762965fe8e1d618e7aa1..fb879809c8ac82cab13bfed7fa8eca999c75f8c4 100644 (file)
@@ -21,7 +21,7 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 
 PLATFORM_CPPFLAGS += -DCONFIG_MPC5xxx -ffixed-r2 \
                     -mstring -mcpu=603e -mmultiple
index 9142b91a5da8b90e75567beedc7717a4e676c36c..2c638b5c531d21c54c36a02264e62ae27d93ddae 100644 (file)
@@ -21,7 +21,7 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 
 PLATFORM_CPPFLAGS += -DCONFIG_MPC8220 -ffixed-r2 \
                     -mstring -mcpu=603e -mmultiple
index 65a177133a995e2b7c3385acd29325e3ef62e045..82b8cc657d141f5c87fa1bb8ee18b6f718bf8288 100644 (file)
@@ -21,6 +21,6 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 
 PLATFORM_CPPFLAGS += -DCONFIG_MPC824X -ffixed-r2 -mstring -mcpu=603e -msoft-float
index 5e4645a0257ea1a637b2acc8ecae8282d10a7ea1..f091fa971bdb6c61214fe378216446e981b8553d 100644 (file)
@@ -21,7 +21,7 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 
 PLATFORM_CPPFLAGS += -DCONFIG_8260 -DCONFIG_CPM2 -ffixed-r2 \
                     -mstring -mcpu=603e -mmultiple
index 0dced88add78995b7fdeb014a7c4ce2414a9d522..a79729e01989d539f1f987c646d67a1d7502a777 100644 (file)
@@ -20,7 +20,7 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 
 PLATFORM_CPPFLAGS += -DCONFIG_MPC83xx -DCONFIG_E300 \
                        -ffixed-r2 -msoft-float
index daf73a6e5ab164fba02beb5ea046be87b1a7c56d..028c8f0d584fd3861f3205ef9462dc5f31e87887 100644 (file)
@@ -32,7 +32,8 @@ extern void ft_qe_setup(void *blob);
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_BOOTCOUNT_LIMIT) && defined(CONFIG_MPC8360)
+#if defined(CONFIG_BOOTCOUNT_LIMIT) && \
+       (defined(CONFIG_QE))
 #include <asm/immap_qe.h>
 
 void fdt_fixup_muram (void *blob)
index cbb0fc6bbd932ccbb2961b81e48f592482e57c87..d61d34c905b386a5c91fbe6a5612129f202b4b1e 100644 (file)
@@ -55,9 +55,13 @@ COBJS-$(CONFIG_P1011)        += ddr-gen3.o
 COBJS-$(CONFIG_P1012)  += ddr-gen3.o
 COBJS-$(CONFIG_P1013)  += ddr-gen3.o
 COBJS-$(CONFIG_P1014)  += ddr-gen3.o
+COBJS-$(CONFIG_P1015)  += ddr-gen3.o
+COBJS-$(CONFIG_P1016)  += ddr-gen3.o
 COBJS-$(CONFIG_P1020)  += ddr-gen3.o
 COBJS-$(CONFIG_P1021)  += ddr-gen3.o
 COBJS-$(CONFIG_P1022)  += ddr-gen3.o
+COBJS-$(CONFIG_P1024)  += ddr-gen3.o
+COBJS-$(CONFIG_P1025)  += ddr-gen3.o
 COBJS-$(CONFIG_P2010)  += ddr-gen3.o
 COBJS-$(CONFIG_P2020)  += ddr-gen3.o
 COBJS-$(CONFIG_PPC_P3041)      += ddr-gen3.o
@@ -69,7 +73,7 @@ COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
 COBJS-$(CONFIG_FSL_CORENET) += liodn.o
 COBJS-$(CONFIG_MP)     += mp.o
 COBJS-$(CONFIG_PCI)    += pci.o
-COBJS-$(CONFIG_FSL_CORENET) += portals.o
+COBJS-$(CONFIG_SYS_DPAA_QBMAN) += portals.o
 
 # various SoC specific assignments
 COBJS-$(CONFIG_PPC_P3041) += p3041_ids.o
@@ -87,12 +91,20 @@ COBJS-$(CONFIG_MPC8548) += mpc8548_serdes.o
 COBJS-$(CONFIG_MPC8568) += mpc8568_serdes.o
 COBJS-$(CONFIG_MPC8569) += mpc8569_serdes.o
 COBJS-$(CONFIG_MPC8572) += mpc8572_serdes.o
+COBJS-$(CONFIG_P1010)  += p1010_serdes.o
 COBJS-$(CONFIG_P1011)  += p1021_serdes.o
 COBJS-$(CONFIG_P1012)  += p1021_serdes.o
 COBJS-$(CONFIG_P1013)  += p1022_serdes.o
+COBJS-$(CONFIG_P1014)  += p1010_serdes.o
+COBJS-$(CONFIG_P1015)  += p1021_serdes.o
+COBJS-$(CONFIG_P1016)  += p1021_serdes.o
+COBJS-$(CONFIG_P1017)  += p1023_serdes.o
 COBJS-$(CONFIG_P1020)  += p1021_serdes.o
 COBJS-$(CONFIG_P1021)  += p1021_serdes.o
 COBJS-$(CONFIG_P1022)  += p1022_serdes.o
+COBJS-$(CONFIG_P1023)  += p1023_serdes.o
+COBJS-$(CONFIG_P1024)  += p1021_serdes.o
+COBJS-$(CONFIG_P1025)  += p1021_serdes.o
 COBJS-$(CONFIG_P2010)  += p2020_serdes.o
 COBJS-$(CONFIG_P2020)  += p2020_serdes.o
 COBJS-$(CONFIG_PPC_P3041) += p3041_serdes.o
index e94975a1c6857c27b111dc4792f0d622e86b7a1c..7b9f77362c4af7f7e2f6ad3f69a30c7d39ff92c5 100644 (file)
@@ -44,6 +44,12 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES8)
        puts("Work-around for Erratum SERDES8 enabled\n");
 #endif
+#if defined(CONFIG_SYS_P4080_ERRATUM_SERDES9)
+       puts("Work-around for Erratum SERDES9 enabled\n");
+#endif
+#if defined(CONFIG_SYS_P4080_ERRATUM_SERDES_A005)
+       puts("Work-around for Erratum SERDES-A005 enabled\n");
+#endif
 #if defined(CONFIG_SYS_P4080_ERRATUM_CPU22)
        puts("Work-around for Erratum CPU22 enabled\n");
 #endif
index 66d1741cc17aad1b38aa6b9ec06c4356eec695e1..68ac57dd0de6df2f893f9375681c57054e76a3cc 100644 (file)
@@ -21,7 +21,7 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 
 PLATFORM_CPPFLAGS += -ffixed-r2 -Wa,-me500 -msoft-float -mno-string
 
index 1aad2ba92557dbe4e32106390ad1d083cf44fbfd..f863f4aad02958f4c35c18c1d14c4e36272156f5 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/cache.h>
 #include <asm/io.h>
 #include <asm/mmu.h>
+#include <asm/fsl_ifc.h>
 #include <asm/fsl_law.h>
 #include <asm/fsl_lbc.h>
 #include <post.h>
@@ -233,13 +234,14 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 /*
  * Get timebase clock frequency
  */
+#ifndef CONFIG_SYS_FSL_TBCLK_DIV
+#define CONFIG_SYS_FSL_TBCLK_DIV 8
+#endif
 unsigned long get_tbclk (void)
 {
-#ifdef CONFIG_FSL_CORENET
-       return (gd->bus_clk + 8) / 16;
-#else
-       return (gd->bus_clk + 4UL)/8UL;
-#endif
+       unsigned long tbclk_div = CONFIG_SYS_FSL_TBCLK_DIV;
+
+       return (gd->bus_clk + (tbclk_div >> 1)) / tbclk_div;
 }
 
 
@@ -280,7 +282,8 @@ int cpu_mmc_init(bd_t *bis)
 
 /*
  * Print out the state of various machine registers.
- * Currently prints out LAWs, BR0/OR0, and TLBs
+ * Currently prints out LAWs, BR0/OR0 for LBC, CSPR/CSOR/Timing
+ * parameters for IFC and TLBs
  */
 void mpc85xx_reginfo(void)
 {
@@ -289,11 +292,24 @@ void mpc85xx_reginfo(void)
 #if defined(CONFIG_FSL_LBC)
        print_lbc_regs();
 #endif
+#ifdef CONFIG_FSL_IFC
+       print_ifc_regs();
+#endif
 
 }
 
 /* Common ddr init for non-corenet fsl 85xx platforms */
 #ifndef CONFIG_FSL_CORENET
+#if defined(CONFIG_SYS_RAMBOOT) && !defined(CONFIG_SYS_INIT_L2_ADDR)
+phys_size_t initdram(int board_type)
+{
+#if defined(CONFIG_SPD_EEPROM) || defined(CONFIG_DDR_SPD)
+       return fsl_ddr_sdram_size();
+#else
+       return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
+#endif
+}
+#else /* CONFIG_SYS_RAMBOOT */
 phys_size_t initdram(int board_type)
 {
        phys_size_t dram_size = 0;
@@ -343,6 +359,7 @@ phys_size_t initdram(int board_type)
        puts("DDR: ");
        return dram_size;
 }
+#endif /* CONFIG_SYS_RAMBOOT */
 #endif
 
 #if CONFIG_POST & CONFIG_SYS_POST_MEMORY
index 8ece970097246c2fe1b102935ad78b439fe7ce3a..b3da970d4201bb34ed29d20f49080266cb56e20c 100644 (file)
 #include <asm/fsl_law.h>
 #include <asm/fsl_serdes.h>
 #include "mp.h"
+#ifdef CONFIG_SYS_QE_FW_IN_NAND
+#include <nand.h>
+#include <errno.h>
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -141,6 +145,22 @@ static void enable_cpc(void)
        for (i = 0; i < CONFIG_SYS_NUM_CPC; i++, cpc++) {
                u32 cpccfg0 = in_be32(&cpc->cpccfg0);
                size += CPC_CFG0_SZ_K(cpccfg0);
+#ifdef CONFIG_RAMBOOT_PBL
+               if (in_be32(&cpc->cpcsrcr0) & CPC_SRCR0_SRAMEN) {
+                       /* find and disable LAW of SRAM */
+                       struct law_entry law = find_law(CONFIG_SYS_INIT_L3_ADDR);
+
+                       if (law.index == -1) {
+                               printf("\nFatal error happened\n");
+                               return;
+                       }
+                       disable_law(law.index);
+
+                       clrbits_be32(&cpc->cpchdbcr0, CPC_HDBCR0_CDQ_SPEC_DIS);
+                       out_be32(&cpc->cpccsr0, 0);
+                       out_be32(&cpc->cpcsrcr0, 0);
+               }
+#endif
 
 #ifdef CONFIG_SYS_FSL_ERRATUM_CPC_A002
                setbits_be32(&cpc->cpchdbcr0, CPC_HDBCR0_TAG_ECC_SCRUB_DIS);
@@ -164,6 +184,9 @@ void invalidate_cpc(void)
        cpc_corenet_t *cpc = (cpc_corenet_t *)CONFIG_SYS_FSL_CPC_ADDR;
 
        for (i = 0; i < CONFIG_SYS_NUM_CPC; i++, cpc++) {
+               /* skip CPC when it used as all SRAM */
+               if (in_be32(&cpc->cpcsrcr0) & CPC_SRCR0_SRAMEN)
+                       continue;
                /* Flash invalidate the CPC and clear all the locks */
                out_be32(&cpc->cpccsr0, CPC_CSR0_FI | CPC_CSR0_LFC);
                while (in_be32(&cpc->cpccsr0) & (CPC_CSR0_FI | CPC_CSR0_LFC))
@@ -384,12 +407,6 @@ int cpu_init_r(void)
 
        enable_cpc();
 
-#ifdef CONFIG_QE
-       uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */
-       qe_init(qe_base);
-       qe_reset();
-#endif
-
        /* needs to be in ram since code uses global static vars */
        fsl_serdes_init();
 
@@ -419,6 +436,23 @@ int cpu_init_r(void)
        isync();
 #endif
 
+#ifdef CONFIG_SYS_FSL_USB1_PHY_ENABLE
+       {
+               ccsr_usb_phy_t *usb_phy1 =
+                       (void *)CONFIG_SYS_MPC85xx_USB1_PHY_ADDR;
+               out_be32(&usb_phy1->usb_enable_override,
+                               CONFIG_SYS_FSL_USB_ENABLE_OVERRIDE);
+       }
+#endif
+#ifdef CONFIG_SYS_FSL_USB2_PHY_ENABLE
+       {
+               ccsr_usb_phy_t *usb_phy2 =
+                       (void *)CONFIG_SYS_MPC85xx_USB2_PHY_ADDR;
+               out_be32(&usb_phy2->usb_enable_override,
+                               CONFIG_SYS_FSL_USB_ENABLE_OVERRIDE);
+       }
+#endif
+
        return 0;
 }
 
@@ -449,3 +483,25 @@ int sata_initialize(void)
        return 1;
 }
 #endif
+
+void cpu_secondary_init_r(void)
+{
+#ifdef CONFIG_QE
+       uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */
+#ifdef CONFIG_SYS_QE_FW_IN_NAND
+       int ret;
+       size_t fw_length = CONFIG_SYS_QE_FW_LENGTH;
+
+       /* load QE firmware from NAND flash to DDR first */
+       ret = nand_read(&nand_info[0], (loff_t)CONFIG_SYS_QE_FW_IN_NAND,
+                       &fw_length, (u_char *)CONFIG_SYS_QE_FW_ADDR);
+
+       if (ret && ret == -EUCLEAN) {
+               printf ("NAND read for QE firmware at offset %x failed %d\n",
+                               CONFIG_SYS_QE_FW_IN_NAND, ret);
+       }
+#endif
+       qe_init(qe_base);
+       qe_reset();
+#endif
+}
index 8fb27abc55bfa2145497968cd6fc01151381a41c..796d3984261e889ef456bf1188897fd7668f08bc 100644 (file)
@@ -33,17 +33,15 @@ void cpu_init_f(void)
         */
        out_be32(&lbc->lcrr, LCRR_DBYP | LCRR_CLKDIV_8);
 
-#if defined(CONFIG_NAND_BR_PRELIM) && defined(CONFIG_NAND_OR_PRELIM)
-       set_lbc_br(0, CONFIG_NAND_BR_PRELIM);
-       set_lbc_or(0, CONFIG_NAND_OR_PRELIM);
+#if defined(CONFIG_SYS_NAND_BR_PRELIM) && defined(CONFIG_SYS_NAND_OR_PRELIM)
+       set_lbc_br(0, CONFIG_SYS_NAND_BR_PRELIM);
+       set_lbc_or(0, CONFIG_SYS_NAND_OR_PRELIM);
 #else
-#error  CONFIG_NAND_BR_PRELIM, CONFIG_NAND_OR_PRELIM must be defined
+#error  CONFIG_SYS_NAND_BR_PRELIM, CONFIG_SYS_NAND_OR_PRELIM must be defined
 #endif
 
 #if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
        ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR;
-       char *l2srbar;
-       int i;
 
        out_be32(&l2cache->l2srbar0, CONFIG_SYS_INIT_L2_ADDR);
 
@@ -54,10 +52,5 @@ void cpu_init_f(void)
        /* set L2E=1 & L2SRAM=001 */
        out_be32(&l2cache->l2ctl,
                (MPC85xx_L2CTL_L2E | MPC85xx_L2CTL_L2SRAM_ENTIRE));
-
-       /* Initialize L2 SRAM to zero */
-       l2srbar = (char *)CONFIG_SYS_INIT_L2_ADDR;
-       for (i = 0; i < CONFIG_SYS_L2_SIZE; i++)
-               l2srbar[i] = 0;
 #endif
 }
index 00fa752996593353216e183a7f6547737817bc97..6e909b52d0ea775725e31025a10ede74e401f6e7 100644 (file)
@@ -338,6 +338,9 @@ void fdt_add_enet_stashing(void *fdt)
        do_fixup_by_compat_u32(fdt, "gianfar", "rx-stash-len", 96, 1);
 
        do_fixup_by_compat_u32(fdt, "gianfar", "rx-stash-idx", 0, 1);
+       do_fixup_by_compat(fdt, "fsl,etsec2", "bd-stash", NULL, 0, 1);
+       do_fixup_by_compat_u32(fdt, "fsl,etsec2", "rx-stash-len", 96, 1);
+       do_fixup_by_compat_u32(fdt, "fsl,etsec2", "rx-stash-idx", 0, 1);
 }
 
 #if defined(CONFIG_SYS_DPAA_FMAN) || defined(CONFIG_SYS_DPAA_PME)
@@ -470,6 +473,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        fdt_portal(blob, "fsl,bman-portal", "bman-portals",
                        (u64)CONFIG_SYS_BMAN_MEM_PHYS,
                        CONFIG_SYS_BMAN_MEM_SIZE);
+       fdt_fixup_bportals(blob);
 #endif
 
 #if defined(CONFIG_SYS_QMAN_MEM_PHYS)
@@ -483,4 +487,13 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_SYS_SRIO
        ft_srio_setup(blob);
 #endif
+
+       /*
+        * system-clock = CCB clock/2
+        * Here gd->bus_clk = CCB clock
+        * We are using the system clock as 1588 Timer reference
+        * clock source select
+        */
+       do_fixup_by_compat_u32(blob, "fsl,gianfar-ptp-timer",
+                       "timer-frequency", gd->bus_clk/2, 1);
 }
index 7fc00d8c6ff40bcc45bfd59376422dedd8f5bc08..741a0f84aace038b425bc8ca0c5d179ac51edd42 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/fsl_law.h>
+#include <asm/errno.h>
 #include "fsl_corenet_serdes.h"
 
 static u32 serdes_prtcl_map;
@@ -91,7 +92,7 @@ int serdes_get_lane_idx(int lane)
        return lanes[lane].idx;
 }
 
-int serdes_get_bank(int lane)
+int serdes_get_bank_by_lane(int lane)
 {
        return lanes[lane].bank;
 }
@@ -109,10 +110,13 @@ int serdes_lane_enabled(int lane)
                return 0;
 
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
-       if (!IS_SVR_REV(get_svr(), 1, 0))
-               if (bank > 0)
-                       return !(srds_lpd_b[bank] &
-                                       (8 >> (lane - (6 + 4 * bank))));
+       /*
+        * For banks two and three, use the srds_lpd_b[] array instead of the
+        * RCW, because this array contains the real values of SRDS_LPD_B2 and
+        * SRDS_LPD_B3.
+        */
+       if (bank > 0)
+               return !(srds_lpd_b[bank] & (8 >> (lane - (6 + 4 * bank))));
 #endif
 
        return !(in_be32(&gur->rcwsr[word]) & (0x80000000 >> bit));
@@ -129,6 +133,125 @@ int is_serdes_configured(enum srds_prtcl device)
        return (1 << device) & serdes_prtcl_map;
 }
 
+static int __serdes_get_first_lane(uint32_t prtcl, enum srds_prtcl device)
+{
+       int i;
+
+       for (i = 0; i < SRDS_MAX_LANES; i++) {
+               if (serdes_get_prtcl(prtcl, i) == device)
+                       return i;
+       }
+
+       return -ENODEV;
+}
+
+/*
+ * Returns the SERDES lane (0..SRDS_MAX_LANES-1) that routes to the given
+ * device. This depends on the current SERDES protocol, as defined in the RCW.
+ *
+ * Returns a negative error code if SERDES is disabled or the given device is
+ * not supported in the current SERDES protocol.
+ */
+int serdes_get_first_lane(enum srds_prtcl device)
+{
+       u32 prtcl;
+       const ccsr_gur_t *gur;
+
+       gur = (typeof(gur))CONFIG_SYS_MPC85xx_GUTS_ADDR;
+
+       /* Is serdes enabled at all? */
+       if (unlikely((in_be32(&gur->rcwsr[5]) & 0x2000) == 0))
+               return -ENODEV;
+
+       prtcl = (in_be32(&gur->rcwsr[4]) & FSL_CORENET_RCWSR4_SRDS_PRTCL) >> 26;
+
+       return __serdes_get_first_lane(prtcl, device);
+}
+
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
+/*
+ * Returns the SERDES bank (1, 2, or 3) that a given device is on for a given
+ * SERDES protocol.
+ *
+ * Returns a negative error code if the given device is not supported for the
+ * given SERDES protocol.
+ */
+static int serdes_get_bank_by_device(uint32_t prtcl, enum srds_prtcl device)
+{
+       int lane;
+
+       lane = __serdes_get_first_lane(prtcl, device);
+       if (unlikely(lane < 0))
+               return lane;
+
+       return serdes_get_bank_by_lane(lane);
+}
+
+static uint32_t __serdes_get_lane_count(uint32_t prtcl, enum srds_prtcl device,
+                                       int first)
+{
+       int lane;
+
+       for (lane = first; lane < SRDS_MAX_LANES; lane++) {
+               if (serdes_get_prtcl(prtcl, lane) != device)
+                       break;
+       }
+
+       return lane - first;
+}
+
+static void __serdes_reset_rx(serdes_corenet_t *regs,
+                             uint32_t prtcl,
+                             enum srds_prtcl device)
+{
+       int lane, idx, first, last;
+
+       lane = __serdes_get_first_lane(prtcl, device);
+       if (unlikely(lane < 0))
+               return;
+       first = serdes_get_lane_idx(lane);
+       last = first + __serdes_get_lane_count(prtcl, device, lane);
+
+       /*
+        * Set BnGCRy0[RRST] = 0 for each lane in the each bank that is
+        * selected as XAUI to place the lane into reset.
+       */
+       for (idx = first; idx < last; idx++)
+               clrbits_be32(&regs->lane[idx].gcr0, SRDS_GCR0_RRST);
+
+       /* Wait at least 250 ns */
+       udelay(1);
+
+       /*
+        * Set BnGCRy0[RRST] = 1 for each lane in the each bank that is
+        * selected as XAUI to bring the lane out of reset.
+        */
+       for (idx = first; idx < last; idx++)
+               setbits_be32(&regs->lane[idx].gcr0, SRDS_GCR0_RRST);
+}
+
+void serdes_reset_rx(enum srds_prtcl device)
+{
+       u32 prtcl;
+       const ccsr_gur_t *gur;
+       serdes_corenet_t *regs;
+
+       if (unlikely(device == NONE))
+               return;
+
+       gur = (typeof(gur))CONFIG_SYS_MPC85xx_GUTS_ADDR;
+
+       /* Is serdes enabled at all? */
+       if (unlikely((in_be32(&gur->rcwsr[5]) & 0x2000) == 0))
+               return;
+
+       regs = (typeof(regs))CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
+       prtcl = (in_be32(&gur->rcwsr[4]) & FSL_CORENET_RCWSR4_SRDS_PRTCL) >> 26;
+
+       __serdes_reset_rx(regs, prtcl, device);
+}
+#endif
+
 #ifndef CONFIG_SYS_DCSRBAR_PHYS
 #define CONFIG_SYS_DCSRBAR_PHYS        0x80000000 /* Must be 1GB-aligned for rev1.0 */
 #define CONFIG_SYS_DCSRBAR     0x80000000
@@ -263,6 +386,74 @@ static void p4080_erratum_serdes8(serdes_corenet_t *regs, ccsr_gur_t *gur,
 }
 #endif
 
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A005
+/*
+ * If PCIe is not selected as a protocol for any lanes driven by a given PLL,
+ * that PLL should have SRDSBnPLLCR1[PLLBW_SEL] = 0.
+ */
+static void p4080_erratum_serdes_a005(serdes_corenet_t *regs, unsigned int cfg)
+{
+       enum srds_prtcl device;
+
+       switch (cfg) {
+       case 0x13:
+       case 0x16:
+               /*
+                * If SRDS_PRTCL = 0x13 or 0x16, set SRDSB1PLLCR1[PLLBW_SEL]
+                * to 0.
+                */
+               clrbits_be32(&regs->bank[FSL_SRDS_BANK_1].pllcr1,
+                            SRDS_PLLCR1_PLL_BWSEL);
+               break;
+       case 0x19:
+               /*
+                * If SRDS_PRTCL = 0x19, set SRDSB1PLLCR1[PLLBW_SEL] to 0 and
+                * SRDSB3PLLCR1[PLLBW_SEL] to 1.
+                */
+               clrbits_be32(&regs->bank[FSL_SRDS_BANK_1].pllcr1,
+                            SRDS_PLLCR1_PLL_BWSEL);
+               setbits_be32(&regs->bank[FSL_SRDS_BANK_3].pllcr1,
+                            SRDS_PLLCR1_PLL_BWSEL);
+               break;
+       }
+
+       /*
+        * Set SRDSBnPLLCR1[PLLBW_SEL] to 0 for each bank that selects XAUI
+        * before XAUI is initialized.
+        */
+       for (device = XAUI_FM1; device <= XAUI_FM2; device++) {
+               if (is_serdes_configured(device)) {
+                       int bank = serdes_get_bank_by_device(cfg, device);
+
+                       clrbits_be32(&regs->bank[bank].pllcr1,
+                                    SRDS_PLLCR1_PLL_BWSEL);
+               }
+       }
+}
+#endif
+
+/*
+ * Wait for the RSTDONE bit to get set, or a one-second timeout.
+ */
+static void wait_for_rstdone(unsigned int bank)
+{
+       serdes_corenet_t *srds_regs =
+               (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
+       unsigned long long end_tick;
+       u32 rstctl;
+
+       /* wait for reset complete or 1-second timeout */
+       end_tick = usec2ticks(1000000) + get_ticks();
+       do {
+               rstctl = in_be32(&srds_regs->bank[bank].rstctl);
+               if (rstctl & SRDS_RSTCTL_RSTDONE)
+                       break;
+       } while (end_tick > get_ticks());
+
+       if (!(rstctl & SRDS_RSTCTL_RSTDONE))
+               printf("SERDES: timeout resetting bank %u\n", bank);
+}
+
 void fsl_serdes_init(void)
 {
        ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
@@ -270,7 +461,6 @@ void fsl_serdes_init(void)
        serdes_corenet_t *srds_regs;
        int lane, bank, idx;
        enum srds_prtcl lane_prtcl;
-       long long end_tick;
        int have_bank[SRDS_MAX_BANK] = {};
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
        u32 serdes8_devdisr = 0;
@@ -278,6 +468,12 @@ void fsl_serdes_init(void)
        char srds_lpd_opt[16];
        const char *srds_lpd_arg;
        size_t arglen;
+#endif
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
+       enum srds_prtcl device;
+#endif
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
+       int need_serdes_a001;   /* TRUE == need work-around for SERDES A001 */
 #endif
        char buffer[HWCONFIG_BUFFER_SIZE];
        char *buf = NULL;
@@ -303,60 +499,76 @@ void fsl_serdes_init(void)
        }
 
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
-       if (!IS_SVR_REV(get_svr(), 1, 0))
-               for (bank = 1; bank < ARRAY_SIZE(srds_lpd_b); bank++) {
-                       sprintf(srds_lpd_opt, "fsl_srds_lpd_b%u", bank + 1);
-                       srds_lpd_arg = hwconfig_subarg_f("serdes", srds_lpd_opt,
-                                                      &arglen, buf);
-                       if (srds_lpd_arg)
-                               srds_lpd_b[bank] = simple_strtoul(srds_lpd_arg,
-                                                                 NULL, 0);
-               }
+       /*
+        * Display a warning if banks two and three are not disabled in the RCW,
+        * since our work-around for SERDES8 depends on these banks being
+        * disabled at power-on.
+        */
+#define B2_B3 (FSL_CORENET_RCWSRn_SRDS_LPD_B2 | FSL_CORENET_RCWSRn_SRDS_LPD_B3)
+       if ((in_be32(&gur->rcwsr[5]) & B2_B3) != B2_B3) {
+               printf("Warning: SERDES8 requires banks two and "
+                      "three to be disabled in the RCW\n");
+       }
+
+       /*
+        * Store the values of the fsl_srds_lpd_b2 and fsl_srds_lpd_b3
+        * hwconfig options into the srds_lpd_b[] array.  See README.p4080ds
+        * for a description of these options.
+        */
+       for (bank = 1; bank < ARRAY_SIZE(srds_lpd_b); bank++) {
+               sprintf(srds_lpd_opt, "fsl_srds_lpd_b%u", bank + 1);
+               srds_lpd_arg =
+                       hwconfig_subarg_f("serdes", srds_lpd_opt, &arglen, buf);
+               if (srds_lpd_arg)
+                       srds_lpd_b[bank] =
+                               simple_strtoul(srds_lpd_arg, NULL, 0) & 0xf;
+       }
 #endif
 
        /* Look for banks with all lanes disabled, and power down the bank. */
        for (lane = 0; lane < SRDS_MAX_LANES; lane++) {
                enum srds_prtcl lane_prtcl = serdes_get_prtcl(cfg, lane);
                if (serdes_lane_enabled(lane)) {
-                       have_bank[serdes_get_bank(lane)] = 1;
+                       have_bank[serdes_get_bank_by_lane(lane)] = 1;
                        serdes_prtcl_map |= (1 << lane_prtcl);
                }
        }
 
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
-       if (IS_SVR_REV(get_svr(), 1, 0)) {
-               /* At least one bank must be disabled due to SERDES8.  If
-                * no bank is found to be disabled based on lane
-                * disables, disable bank 3 because we can't turn off its
-                * lanes in the RCW without disabling MDIO due to erratum
-                * GEN8.
-                *
-                * This means that if you are relying on bank 3 being
-                * disabled to avoid SERDES8, in some cases you cannot
-                * also disable all lanes of another bank, or else bank
-                * 3 won't be disabled, leaving you with a configuration
-                * that isn't valid according to SERDES8 (e.g. if banks
-                * 2 and 3 have the same clock, and bank 1 is disabled
-                * instead of 3).
-                */
-               for (bank = 0; bank < SRDS_MAX_BANK; bank++) {
-                       if (!have_bank[bank])
-                               break;
-               }
+       /*
+        * Bank two uses the clock from bank three, so if bank two is enabled,
+        * then bank three must also be enabled.
+        */
+       if (have_bank[FSL_SRDS_BANK_2])
+               have_bank[FSL_SRDS_BANK_3] = 1;
+#endif
 
-               if (bank == SRDS_MAX_BANK)
-                       have_bank[FSL_SRDS_BANK_3] = 0;
-       } else {
-               if (have_bank[FSL_SRDS_BANK_2])
-                       have_bank[FSL_SRDS_BANK_3] = 1;
-       }
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
+       /*
+        * The work-aroud for erratum SERDES-A001 is needed only if bank two
+        * is disabled and bank three is enabled.
+        */
+       need_serdes_a001 =
+               !have_bank[FSL_SRDS_BANK_2] && have_bank[FSL_SRDS_BANK_3];
 #endif
 
+       /* Power down the banks we're not interested in */
        for (bank = 0; bank < SRDS_MAX_BANK; bank++) {
                if (!have_bank[bank]) {
                        printf("SERDES: bank %d disabled\n", bank + 1);
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
+                       /*
+                        * Erratum SERDES-A001 says bank two needs to be powered
+                        * down after bank three is powered up, so don't power
+                        * down bank two here.
+                        */
+                       if (!need_serdes_a001 || (bank != FSL_SRDS_BANK_2))
+                               setbits_be32(&srds_regs->bank[bank].rstctl,
+                                            SRDS_RSTCTL_SDPD);
+#else
                        setbits_be32(&srds_regs->bank[bank].rstctl,
                                     SRDS_RSTCTL_SDPD);
+#endif
                }
        }
 
@@ -382,6 +594,35 @@ void fsl_serdes_init(void)
                printf("%s ", serdes_prtcl_str[lane_prtcl]);
 #endif
 
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
+               /*
+                * Set BnTTLCRy0[FLT_SEL] = 000011 and set BnTTLCRy0[17] = 1 for
+                * each of the SerDes lanes selected as SGMII, XAUI, SRIO, or
+                * AURORA before the device is initialized.
+                */
+               switch (lane_prtcl) {
+               case SGMII_FM1_DTSEC1:
+               case SGMII_FM1_DTSEC2:
+               case SGMII_FM1_DTSEC3:
+               case SGMII_FM1_DTSEC4:
+               case SGMII_FM2_DTSEC1:
+               case SGMII_FM2_DTSEC2:
+               case SGMII_FM2_DTSEC3:
+               case SGMII_FM2_DTSEC4:
+               case XAUI_FM1:
+               case XAUI_FM2:
+               case SRIO1:
+               case SRIO2:
+               case AURORA:
+                       clrsetbits_be32(&srds_regs->lane[idx].ttlcr0,
+                                       SRDS_TTLCR0_FLT_SEL_MASK,
+                                       SRDS_TTLCR0_FLT_SEL_750PPM |
+                                       SRDS_TTLCR0_PM_DIS);
+               default:
+                       break;
+               }
+#endif
+
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
                switch (lane_prtcl) {
                case PCIE1:
@@ -428,13 +669,12 @@ void fsl_serdes_init(void)
                                            FSL_CORENET_DEVDISR2_DTSEC2_4;
                        break;
                case XAUI_FM1:
+                       serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM1    |
+                                           FSL_CORENET_DEVDISR2_10GEC1;
+                       break;
                case XAUI_FM2:
-                       if (lane_prtcl == XAUI_FM1)
-                               serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM1    |
-                                                   FSL_CORENET_DEVDISR2_10GEC1;
-                       else
-                               serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM2    |
-                                                   FSL_CORENET_DEVDISR2_10GEC2;
+                       serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM2    |
+                                           FSL_CORENET_DEVDISR2_10GEC2;
                        break;
                case AURORA:
                        break;
@@ -449,25 +689,24 @@ void fsl_serdes_init(void)
        puts("\n");
 #endif
 
-       for (idx = 0; idx < SRDS_MAX_BANK; idx++) {
-               u32 rstctl;
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A005
+       p4080_erratum_serdes_a005(srds_regs, cfg);
+#endif
 
+       for (idx = 0; idx < SRDS_MAX_BANK; idx++) {
                bank = idx;
 
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
-               if (!IS_SVR_REV(get_svr(), 1, 0)) {
-                       /*
-                        * Change bank init order to 0, 2, 1, so that the
-                        * third bank's PLL is established before we
-                        * start the second bank which shares the third
-                        * bank's PLL.
-                        */
+               /*
+                * Change bank init order to 0, 2, 1, so that the third bank's
+                * PLL is established before we start the second bank.  The
+                * second bank uses the third bank's PLL.
+                */
 
-                       if (idx == 1)
-                               bank = FSL_SRDS_BANK_3;
-                       else if (idx == 2)
-                               bank = FSL_SRDS_BANK_2;
-               }
+               if (idx == 1)
+                       bank = FSL_SRDS_BANK_3;
+               else if (idx == 2)
+                       bank = FSL_SRDS_BANK_2;
 #endif
 
                /* Skip disabled banks */
@@ -475,32 +714,48 @@ void fsl_serdes_init(void)
                        continue;
 
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
-               if (!IS_SVR_REV(get_svr(), 1, 0)) {
-                       if (idx == 1) {
-                               p4080_erratum_serdes8(srds_regs, gur,
-                                                     serdes8_devdisr,
-                                                     serdes8_devdisr2, cfg);
-                       } else if (idx == 2) {
-                               enable_bank(gur, FSL_SRDS_BANK_2);
-                       }
+               if (idx == 1) {
+                       /*
+                        * Re-enable devices on banks two and three that were
+                        * disabled by the RCW, and then enable bank three. The
+                        * devices need to be enabled before either bank is
+                        * powered up.
+                        */
+                       p4080_erratum_serdes8(srds_regs, gur, serdes8_devdisr,
+                                             serdes8_devdisr2, cfg);
+               } else if (idx == 2) {
+                       /* Eable bank two now that bank three is enabled. */
+                       enable_bank(gur, FSL_SRDS_BANK_2);
                }
 #endif
 
                /* reset banks for errata */
                setbits_be32(&srds_regs->bank[bank].rstctl, SRDS_RSTCTL_RST);
 
-               /* wait for reset complete or 1-second timeout */
-               end_tick = usec2ticks(1000000) + get_ticks();
-               do {
-                       rstctl = in_be32(&srds_regs->bank[bank].rstctl);
-                       if (rstctl & SRDS_RSTCTL_RSTDONE)
-                               break;
-               } while (end_tick > get_ticks());
-
-               if (!(rstctl & SRDS_RSTCTL_RSTDONE)) {
-                       printf("SERDES: timeout resetting bank %d\n",
-                              bank + 1);
-                       continue;
-               }
+               wait_for_rstdone(bank);
        }
+
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
+       if (need_serdes_a001) {
+               /*
+                * Bank three has been enabled, so enable bank two and then
+                * disable it.
+                */
+               srds_lpd_b[FSL_SRDS_BANK_2] = 0;
+               enable_bank(gur, FSL_SRDS_BANK_2);
+
+               wait_for_rstdone(FSL_SRDS_BANK_2);
+
+               /* Disable bank 2 */
+               setbits_be32(&srds_regs->bank[FSL_SRDS_BANK_2].rstctl,
+                            SRDS_RSTCTL_SDPD);
+       }
+#endif
+
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
+       for (device = XAUI_FM1; device <= XAUI_FM2; device++) {
+               if (is_serdes_configured(device))
+                       __serdes_reset_rx(srds_regs, cfg, device);
+       }
+#endif
 }
index 42d771e0965637ee7e73689a601423b7dd0bc303..f261351c8a91e732af4127a377003f7a6b031d7c 100644 (file)
@@ -33,7 +33,7 @@ enum srds_bank {
 
 int is_serdes_prtcl_valid(u32 prtcl);
 int serdes_get_lane_idx(int lane);
-int serdes_get_bank(int lane);
+int serdes_get_bank_by_lane(int lane);
 int serdes_lane_enabled(int lane);
 enum srds_prtcl serdes_get_prtcl(int cfg, int lane);
 
diff --git a/arch/powerpc/cpu/mpc85xx/p1010_serdes.c b/arch/powerpc/cpu/mpc85xx/p1010_serdes.c
new file mode 100644 (file)
index 0000000..e8a0387
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Author: Prabhakar Kushwaha <prabhakar@freescale.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include <config.h>
+#include <common.h>
+#include <asm/io.h>
+#include <asm/immap_85xx.h>
+#include <asm/fsl_serdes.h>
+
+#define SRDS1_MAX_LANES                4
+#define SRDS2_MAX_LANES                2
+
+static u32 serdes1_prtcl_map, serdes2_prtcl_map;
+
+static const u8 serdes1_cfg_tbl[][SRDS1_MAX_LANES] = {
+       [0x00] = {NONE, NONE, NONE, NONE},
+       [0x01] = {PCIE1, PCIE2, SGMII_TSEC2, SGMII_TSEC3},
+       [0x02] = {PCIE1, SGMII_TSEC1, SGMII_TSEC2, SGMII_TSEC3},
+       [0x03] = {NONE, SGMII_TSEC1, SGMII_TSEC2, SGMII_TSEC3},
+};
+
+static const u8 serdes2_cfg_tbl[][SRDS2_MAX_LANES] = {
+       [0x00] = {NONE, NONE},
+       [0x01] = {SATA1, SATA2},
+       [0x02] = {SATA1, SATA2},
+       [0x03] = {PCIE1, PCIE2},
+};
+
+
+int is_serdes_configured(enum srds_prtcl device)
+{
+       int ret = (1 << device) & serdes1_prtcl_map;
+
+       if (ret)
+               return ret;
+
+       return (1 << device) & serdes2_prtcl_map;
+}
+
+void fsl_serdes_init(void)
+{
+       ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+       u32 pordevsr = in_be32(&gur->pordevsr);
+       u32 srds_cfg = (pordevsr & MPC85xx_PORDEVSR_IO_SEL) >>
+                               MPC85xx_PORDEVSR_IO_SEL_SHIFT;
+       int lane;
+
+       debug("PORDEVSR[IO_SEL_SRDS] = %x\n", srds_cfg);
+
+       if (srds_cfg > ARRAY_SIZE(serdes1_cfg_tbl)) {
+               printf("Invalid PORDEVSR[IO_SEL_SRDS] = %d\n", srds_cfg);
+               return;
+       }
+       for (lane = 0; lane < SRDS1_MAX_LANES; lane++) {
+               enum srds_prtcl lane_prtcl = serdes1_cfg_tbl[srds_cfg][lane];
+               serdes1_prtcl_map |= (1 << lane_prtcl);
+       }
+
+       if (srds_cfg > ARRAY_SIZE(serdes2_cfg_tbl)) {
+               printf("Invalid PORDEVSR[IO_SEL_SRDS] = %d\n", srds_cfg);
+               return;
+       }
+
+       for (lane = 0; lane < SRDS2_MAX_LANES; lane++) {
+               enum srds_prtcl lane_prtcl = serdes2_cfg_tbl[srds_cfg][lane];
+               serdes2_prtcl_map |= (1 << lane_prtcl);
+       }
+}
diff --git a/arch/powerpc/cpu/mpc85xx/p1023_serdes.c b/arch/powerpc/cpu/mpc85xx/p1023_serdes.c
new file mode 100644 (file)
index 0000000..c8ab5d6
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * Author: Roy Zang <tie-fei.zang@freescale.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include <config.h>
+#include <common.h>
+#include <asm/io.h>
+#include <asm/immap_85xx.h>
+#include <asm/fsl_serdes.h>
+
+#define SRDS1_MAX_LANES                4
+
+static u32 serdes1_prtcl_map;
+
+static const u8 serdes1_cfg_tbl[][SRDS1_MAX_LANES] = {
+       [0x00] = {PCIE1, PCIE2, NONE, NONE},
+       [0x01] = {PCIE1, PCIE2, PCIE3, NONE},
+       [0x02] = {PCIE1, PCIE2, PCIE3, SGMII_FM1_DTSEC2},
+       [0x03] = {PCIE1, PCIE2, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2},
+};
+
+int is_serdes_configured(enum srds_prtcl device)
+{
+       int ret = (1 << device) & serdes1_prtcl_map;
+       return ret;
+}
+
+void fsl_serdes_init(void)
+{
+       ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+       u32 pordevsr = in_be32(&gur->pordevsr);
+       u32 srds_cfg = (pordevsr & MPC85xx_PORDEVSR_IO_SEL) >>
+                               MPC85xx_PORDEVSR_IO_SEL_SHIFT;
+       int lane;
+
+       debug("PORDEVSR[IO_SEL_SRDS] = %x\n", srds_cfg);
+
+       if (srds_cfg > ARRAY_SIZE(serdes1_cfg_tbl)) {
+               printf("Invalid PORDEVSR[IO_SEL_SRDS] = %d\n", srds_cfg);
+               return;
+       }
+       for (lane = 0; lane < SRDS1_MAX_LANES; lane++) {
+               enum srds_prtcl lane_prtcl = serdes1_cfg_tbl[srds_cfg][lane];
+               serdes1_prtcl_map |= (1 << lane_prtcl);
+       }
+
+}
index febbee95bab98ecddbd037a4c1c3ece695194608..1255898483b7c1a15253f92b77d28e18234a6f16 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -52,10 +52,10 @@ struct liodn_id_table liodn_tbl[] = {
        SET_SATA_LIODN(1, 127),
        SET_SATA_LIODN(2, 128),
 
-       SET_PCI_LIODN(1, 193),
-       SET_PCI_LIODN(2, 194),
-       SET_PCI_LIODN(3, 195),
-       SET_PCI_LIODN(4, 196),
+       SET_PCI_LIODN("fsl,qoriq-pcie-v2.2", 1, 193),
+       SET_PCI_LIODN("fsl,qoriq-pcie-v2.2", 2, 194),
+       SET_PCI_LIODN("fsl,qoriq-pcie-v2.2", 3, 195),
+       SET_PCI_LIODN("fsl,qoriq-pcie-v2.2", 4, 196),
 
        SET_DMA_LIODN(1, 197),
        SET_DMA_LIODN(2, 198),
index df2504802a0136cb89305f35fd60c01cbbaa6e21..fd155c89e0b94bc2f8898ae298e1adf8b32f535b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -44,9 +44,9 @@ struct liodn_id_table liodn_tbl[] = {
 
        SET_SDHC_LIODN(1, 156),
 
-       SET_PCI_LIODN(1, 193),
-       SET_PCI_LIODN(2, 194),
-       SET_PCI_LIODN(3, 195),
+       SET_PCI_LIODN("fsl,p4080-pcie", 1, 193),
+       SET_PCI_LIODN("fsl,p4080-pcie", 2, 194),
+       SET_PCI_LIODN("fsl,p4080-pcie", 3, 195),
 
        SET_DMA_LIODN(1, 196),
        SET_DMA_LIODN(2, 197),
index febbee95bab98ecddbd037a4c1c3ece695194608..1255898483b7c1a15253f92b77d28e18234a6f16 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -52,10 +52,10 @@ struct liodn_id_table liodn_tbl[] = {
        SET_SATA_LIODN(1, 127),
        SET_SATA_LIODN(2, 128),
 
-       SET_PCI_LIODN(1, 193),
-       SET_PCI_LIODN(2, 194),
-       SET_PCI_LIODN(3, 195),
-       SET_PCI_LIODN(4, 196),
+       SET_PCI_LIODN("fsl,qoriq-pcie-v2.2", 1, 193),
+       SET_PCI_LIODN("fsl,qoriq-pcie-v2.2", 2, 194),
+       SET_PCI_LIODN("fsl,qoriq-pcie-v2.2", 3, 195),
+       SET_PCI_LIODN("fsl,qoriq-pcie-v2.2", 4, 196),
 
        SET_DMA_LIODN(1, 197),
        SET_DMA_LIODN(2, 198),
index 01aec6e794efc15a0e65d345b89c4f4e92c35d08..c014163e3ceaec6fe53a3182faca1f4b7867224a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2010 Freescale Semiconductor, Inc.
+ * Copyright 2008-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
 #include <asm/fsl_portals.h>
 #include <asm/fsl_liodn.h>
 
-static ccsr_qman_t *qman = (void *)CONFIG_SYS_FSL_CORENET_QMAN_ADDR;
+static ccsr_qman_t *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR;
+static ccsr_bman_t *bman = (void *)CONFIG_SYS_FSL_BMAN_ADDR;
 
 void setup_portals(void)
 {
+#ifdef CONFIG_FSL_CORENET
        int i;
 
-       /* Set the Qman initiator BAR to match the LAW (for DQRR stashing) */
-#ifdef CONFIG_PHYS_64BIT
-       out_be32(&qman->qcsp_bare, (u32)(CONFIG_SYS_QMAN_MEM_PHYS >> 32));
-#endif
-       out_be32(&qman->qcsp_bar, (u32)CONFIG_SYS_QMAN_MEM_PHYS);
-
        for (i = 0; i < CONFIG_SYS_QMAN_NUM_PORTALS; i++) {
                u8 sdest = qp_info[i].sdest;
                u16 fliodn = qp_info[i].fliodn;
@@ -53,6 +49,13 @@ void setup_portals(void)
                /* set frame liodn */
                out_be32(&qman->qcsp[i].qcsp_io_cfg, (sdest << 16) | fliodn);
        }
+#endif
+
+       /* Set the Qman initiator BAR to match the LAW (for DQRR stashing) */
+#ifdef CONFIG_PHYS_64BIT
+       out_be32(&qman->qcsp_bare, (u32)(CONFIG_SYS_QMAN_MEM_PHYS >> 32));
+#endif
+       out_be32(&qman->qcsp_bar, (u32)CONFIG_SYS_QMAN_MEM_PHYS);
 }
 
 /* Update portal containter to match LAW setup of portal in phy map */
@@ -118,9 +121,12 @@ void fdt_portal(void *blob, const char *compat, const char *container,
 static int fdt_qportal(void *blob, int off, int id, char *name,
                       enum fsl_dpaa_dev dev, int create)
 {
-       int childoff, dev_off, num, ret = 0;
+       int childoff, dev_off, ret = 0;
        uint32_t dev_handle;
+#ifdef CONFIG_FSL_CORENET
+       int num;
        u32 liodns[2];
+#endif
 
        childoff = fdt_subnode_offset(blob, off, name);
        if (create) {
@@ -154,9 +160,11 @@ static int fdt_qportal(void *blob, int off, int id, char *name,
                        if (ret < 0)
                                return ret;
 
+#ifdef CONFIG_FSL_CORENET
                        num = get_dpaa_liodn(dev, &liodns[0], id);
                        ret = fdt_setprop(blob, childoff, "fsl,liodn",
                                          &liodns[0], sizeof(u32) * num);
+#endif
                } else {
                        return childoff;
                }
@@ -184,7 +192,9 @@ void fdt_fixup_qportals(void *blob)
 
        off = fdt_node_offset_by_compatible(blob, -1, "fsl,qman-portal");
        while (off != -FDT_ERR_NOTFOUND) {
+#ifdef CONFIG_FSL_CORENET
                u32 liodns[2];
+#endif
                const int *ci = fdt_getprop(blob, off, "cell-index", NULL);
                int j, i = *ci;
 
@@ -192,6 +202,7 @@ void fdt_fixup_qportals(void *blob)
                if (err < 0)
                        goto err;
 
+#ifdef CONFIG_FSL_CORENET
                liodns[0] = qp_info[i].dliodn;
                liodns[1] = qp_info[i].fliodn;
 
@@ -199,6 +210,7 @@ void fdt_fixup_qportals(void *blob)
                                  &liodns, sizeof(u32) * 2);
                if (err < 0)
                        goto err;
+#endif
 
                i++;
 
@@ -207,6 +219,7 @@ void fdt_fixup_qportals(void *blob)
                if (err < 0)
                        goto err;
 
+#ifdef CONFIG_FSL_CORENET
 #ifdef CONFIG_SYS_DPAA_PME
                err = fdt_qportal(blob, off, i, "pme@0", FSL_HW_PORTAL_PME, 1);
                if (err < 0)
@@ -214,6 +227,8 @@ void fdt_fixup_qportals(void *blob)
 #else
                fdt_qportal(blob, off, i, "pme@0", FSL_HW_PORTAL_PME, 0);
 #endif
+#endif
+
 #ifdef CONFIG_SYS_DPAA_FMAN
                for (j = 0; j < CONFIG_SYS_NUM_FMAN; j++) {
                        char name[] = "fman@0";
@@ -236,3 +251,32 @@ err:
                off = fdt_node_offset_by_compatible(blob, off, "fsl,qman-portal");
        }
 }
+
+void fdt_fixup_bportals(void *blob)
+{
+       int off, err;
+       unsigned int maj, min;
+       u32 rev_1 = in_be32(&bman->ip_rev_1);
+       char compat[64];
+       int compat_len;
+
+       maj = (rev_1 >> 8) & 0xff;
+       min = rev_1 & 0xff;
+
+       compat_len = sprintf(compat, "fsl,bman-portal-%u.%u", maj, min) + 1;
+       compat_len += sprintf(compat + compat_len, "fsl,bman-portal") + 1;
+
+       off = fdt_node_offset_by_compatible(blob, -1, "fsl,bman-portal");
+       while (off != -FDT_ERR_NOTFOUND) {
+               err = fdt_setprop(blob, off, "compatible", compat, compat_len);
+               if (err < 0) {
+                       printf("ERROR: unable to create props for %s: %s\n",
+                               fdt_get_name(blob, off, NULL),
+                                                fdt_strerror(err));
+                       return;
+               }
+
+               off = fdt_node_offset_by_compatible(blob, off, "fsl,bman-portal");
+       }
+
+}
index f2aa8d039d69053bb0d2517f2a6860575f927ce2..c4c156d73720c07012429bbd211e4fc06efd6e47 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <common.h>
 #include <ppc_asm.tmpl>
+#include <linux/compiler.h>
 #include <asm/processor.h>
 #include <asm/io.h>
 
@@ -107,25 +108,45 @@ void get_sys_info (sys_info_t * sysInfo)
 #define PME_CLK_SEL    0x80000000
 #define FM1_CLK_SEL    0x40000000
 #define FM2_CLK_SEL    0x20000000
+#define HWA_ASYNC_DIV  0x04000000
+#if (CONFIG_SYS_FSL_NUM_CC_PLLS == 2)
+#define HWA_CC_PLL     1
+#elif (CONFIG_SYS_FSL_NUM_CC_PLLS == 4)
+#define HWA_CC_PLL     2       
+#else
+#error CONFIG_SYS_FSL_NUM_CC_PLLS not set or unknown case
+#endif
        rcw_tmp = in_be32(&gur->rcwsr[7]);
 
 #ifdef CONFIG_SYS_DPAA_PME
-       if (rcw_tmp & PME_CLK_SEL)
-               sysInfo->freqPME = freqCC_PLL[2] / 2;
-       else
+       if (rcw_tmp & PME_CLK_SEL) {
+               if (rcw_tmp & HWA_ASYNC_DIV)
+                       sysInfo->freqPME = freqCC_PLL[HWA_CC_PLL] / 4;
+               else
+                       sysInfo->freqPME = freqCC_PLL[HWA_CC_PLL] / 2;
+       } else {
                sysInfo->freqPME = sysInfo->freqSystemBus / 2;
+       }
 #endif
 
 #ifdef CONFIG_SYS_DPAA_FMAN
-       if (rcw_tmp & FM1_CLK_SEL)
-               sysInfo->freqFMan[0] = freqCC_PLL[2] / 2;
-       else
+       if (rcw_tmp & FM1_CLK_SEL) {
+               if (rcw_tmp & HWA_ASYNC_DIV)
+                       sysInfo->freqFMan[0] = freqCC_PLL[HWA_CC_PLL] / 4;
+               else
+                       sysInfo->freqFMan[0] = freqCC_PLL[HWA_CC_PLL] / 2;
+       } else {
                sysInfo->freqFMan[0] = sysInfo->freqSystemBus / 2;
+       }
 #if (CONFIG_SYS_NUM_FMAN) == 2
-       if (rcw_tmp & FM2_CLK_SEL)
-               sysInfo->freqFMan[1] = freqCC_PLL[2] / 2;
-       else
+       if (rcw_tmp & FM2_CLK_SEL) {
+               if (rcw_tmp & HWA_ASYNC_DIV)
+                       sysInfo->freqFMan[1] = freqCC_PLL[HWA_CC_PLL] / 4;
+               else
+                       sysInfo->freqFMan[1] = freqCC_PLL[HWA_CC_PLL] / 2;
+       } else {
                sysInfo->freqFMan[1] = sysInfo->freqSystemBus / 2;
+       }
 #endif
 #endif
 
@@ -136,7 +157,7 @@ void get_sys_info (sys_info_t * sysInfo)
 #endif
        int i;
 #ifdef CONFIG_QE
-       u32 qe_ratio;
+       __maybe_unused u32 qe_ratio;
 #endif
 
        plat_ratio = (gur->porpllsr) & 0x0000003e;
@@ -162,13 +183,23 @@ void get_sys_info (sys_info_t * sysInfo)
                        sysInfo->freqDDRBus = ddr_ratio * CONFIG_DDR_CLK_FREQ;
        }
 #endif
-#endif
 
 #ifdef CONFIG_QE
+#if defined(CONFIG_P1012) || defined(CONFIG_P1016) || \
+    defined(CONFIG_P1021) || defined(CONFIG_P1025)
+       sysInfo->freqQE =  sysInfo->freqSystemBus;
+#else
        qe_ratio = ((gur->porpllsr) & MPC85xx_PORPLLSR_QE_RATIO)
                        >> MPC85xx_PORPLLSR_QE_RATIO_SHIFT;
        sysInfo->freqQE = qe_ratio * CONFIG_SYS_CLK_FREQ;
 #endif
+#endif
+
+#ifdef CONFIG_SYS_DPAA_FMAN
+               sysInfo->freqFMan[0] = sysInfo->freqSystemBus;
+#endif
+
+#endif /* CONFIG_FSL_CORENET */
 
 #if defined(CONFIG_FSL_LBC)
 #if defined(CONFIG_SYS_LBC_LCRR)
@@ -254,7 +285,8 @@ int get_clocks (void)
        gd->i2c2_clk = gd->i2c1_clk;
 
 #if defined(CONFIG_FSL_ESDHC)
-#ifdef CONFIG_MPC8569
+#if defined(CONFIG_MPC8569) || defined(CONFIG_P1010) ||\
+       defined(CONFIG_P1014)
        gd->sdhc_clk = gd->bus_clk;
 #else
        gd->sdhc_clk = gd->bus_clk / 2;
index 31143ba5300fade223cfb0c4d4998064f5e18046..295f175bba63868b619d049d39709acb61360233 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2009 Freescale Semiconductor, Inc.
+ * Copyright 2008-2011 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -55,6 +55,7 @@ void init_tlbs(void)
        return ;
 }
 
+#ifndef CONFIG_NAND_SPL
 void read_tlbcam_entry(int idx, u32 *valid, u32 *tsize, unsigned long *epn,
                       phys_addr_t *rpn)
 {
@@ -73,7 +74,6 @@ void read_tlbcam_entry(int idx, u32 *valid, u32 *tsize, unsigned long *epn,
 #endif
 }
 
-#ifndef CONFIG_NAND_SPL
 void print_tlbcam(void)
 {
        int i;
index ca2f8376edd9dd167ae986e6726055cdf6d0e2ac..92ff7bf3e911c7ccb1537fa6147d62e9636a2505 100644 (file)
@@ -21,7 +21,7 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 
 PLATFORM_CPPFLAGS += -ffixed-r2 -mstring
 PLATFORM_CPPFLAGS += -maltivec -mabi=altivec -msoft-float
index f5e08a5138a298e11edf471a34e5352dccc7063c..aa61980bcd7fc65942fecc50b45f05108137e09a 100644 (file)
@@ -21,6 +21,6 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 
 PLATFORM_CPPFLAGS += -DCONFIG_8xx -ffixed-r2 -mstring -mcpu=860 -msoft-float
index 5dfd65b88244fb8e83eb50d9871da6062cafe1c2..4ae26e42104b896208f2e9f584f109b72f76af7d 100644 (file)
@@ -15,6 +15,7 @@ COBJS-y       += cpu.o
 endif
 
 COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
+COBJS-$(CONFIG_FSL_IFC) += fsl_ifc.o
 COBJS-$(CONFIG_FSL_LBC) += fsl_lbc.o
 COBJS-$(CONFIG_SYS_SRIO) += srio.o
 
index 4335fb4f31ff1c879f1f380a5e90377bb6bf6592..39b304ae99bf8d7b56a1e7819accee4f162ff650 100644 (file)
@@ -71,15 +71,27 @@ struct cpu_type cpu_type_list [] = {
        CPU_TYPE_ENTRY(P1012, P1012, 1),
        CPU_TYPE_ENTRY(P1012, P1012_E, 1),
        CPU_TYPE_ENTRY(P1013, P1013, 1),
+       CPU_TYPE_ENTRY(P1013, P1013_E, 1),
        CPU_TYPE_ENTRY(P1014, P1014_E, 1),
        CPU_TYPE_ENTRY(P1014, P1014, 1),
-       CPU_TYPE_ENTRY(P1013, P1013_E, 1),
+       CPU_TYPE_ENTRY(P1015, P1015_E, 1),
+       CPU_TYPE_ENTRY(P1015, P1015, 1),
+       CPU_TYPE_ENTRY(P1016, P1016_E, 1),
+       CPU_TYPE_ENTRY(P1016, P1016, 1),
+       CPU_TYPE_ENTRY(P1017, P1017, 1),
+       CPU_TYPE_ENTRY(P1017, P1017, 1),
        CPU_TYPE_ENTRY(P1020, P1020, 2),
        CPU_TYPE_ENTRY(P1020, P1020_E, 2),
        CPU_TYPE_ENTRY(P1021, P1021, 2),
        CPU_TYPE_ENTRY(P1021, P1021_E, 2),
        CPU_TYPE_ENTRY(P1022, P1022, 2),
        CPU_TYPE_ENTRY(P1022, P1022_E, 2),
+       CPU_TYPE_ENTRY(P1023, P1023, 2),
+       CPU_TYPE_ENTRY(P1023, P1023_E, 2),
+       CPU_TYPE_ENTRY(P1024, P1024, 2),
+       CPU_TYPE_ENTRY(P1024, P1024_E, 2),
+       CPU_TYPE_ENTRY(P1025, P1025, 2),
+       CPU_TYPE_ENTRY(P1025, P1025_E, 2),
        CPU_TYPE_ENTRY(P2010, P2010, 1),
        CPU_TYPE_ENTRY(P2010, P2010_E, 1),
        CPU_TYPE_ENTRY(P2020, P2020, 2),
index cefabe769fb3b51afc2bcdea591159f44b32452b..02d069c9ec605359e09273073de01cd00497e6a4 100644 (file)
@@ -236,7 +236,7 @@ static void set_timing_cfg_0(fsl_ddr_cfg_regs_t *ddr,
         * tAXPD=1, need design to confirm.
         */
        int tXP = max((get_memory_clk_period_ps() * 3), 7500); /* unit=ps */
-       unsigned int data_rate = fsl_ddr_get_mem_data_rate();
+       unsigned int data_rate = get_ddr_freq(0);
        tmrd_mclk = 4;
        /* set the turnaround time */
        trwt_mclk = 1;
@@ -1305,7 +1305,7 @@ static void set_ddr_eor(fsl_ddr_cfg_regs_t *ddr, const memctl_options_t *popts)
 {
        if (popts->addr_hash) {
                ddr->ddr_eor = 0x40000000;      /* address hash enable */
-               puts("Addess hashing enabled.\n");
+               puts("Address hashing enabled.\n");
        }
 }
 
index c7c12c1c2f63c8d04e3732151cb144e9f7f180e6..1e866fe03530268a8998d570e60905698576df4a 100644 (file)
@@ -80,5 +80,4 @@ extern void check_interleaving_options(fsl_ddr_info_t *pinfo);
 extern unsigned int mclk_to_picos(unsigned int mclk);
 extern unsigned int get_memory_clk_period_ps(void);
 extern unsigned int picos_to_mclk(unsigned int picos);
-extern unsigned int fsl_ddr_get_mem_data_rate(void);
 #endif
index dcb37cea1f99e4aff566f59e83c9e5d0444d6147..b565e338ad3923f2904694cc5d5d4be4fd9ad7c6 100644 (file)
@@ -250,24 +250,27 @@ ddr_compute_dimm_parameters(const ddr2_spd_eeprom_t *spd,
        pdimm->primary_sdram_width = spd->primw;
        pdimm->ec_sdram_width = spd->ecw;
 
-       /* FIXME: what about registered SO-DIMM? */
+       /* These are all the types defined by the JEDEC DDR2 SPD 1.3 spec */
        switch (spd->dimm_type) {
-       case 0x01:      /* RDIMM */
-       case 0x10:      /* Mini-RDIMM */
-               pdimm->registered_dimm = 1; /* register buffered */
+       case DDR2_SPD_DIMMTYPE_RDIMM:
+       case DDR2_SPD_DIMMTYPE_72B_SO_RDIMM:
+       case DDR2_SPD_DIMMTYPE_MINI_RDIMM:
+               /* Registered/buffered DIMMs */
+               pdimm->registered_dimm = 1;
                break;
 
-       case 0x02:      /* UDIMM */
-       case 0x04:      /* SO-DIMM */
-       case 0x08:      /* Micro-DIMM */
-       case 0x20:      /* Mini-UDIMM */
-               pdimm->registered_dimm = 0;     /* unbuffered */
+       case DDR2_SPD_DIMMTYPE_UDIMM:
+       case DDR2_SPD_DIMMTYPE_SO_DIMM:
+       case DDR2_SPD_DIMMTYPE_MICRO_DIMM:
+       case DDR2_SPD_DIMMTYPE_MINI_UDIMM:
+               /* Unbuffered DIMMs */
+               pdimm->registered_dimm = 0;
                break;
 
+       case DDR2_SPD_DIMMTYPE_72B_SO_CDIMM:
        default:
                printf("unknown dimm_type 0x%02X\n", spd->dimm_type);
                return 1;
-               break;
        }
 
        /* SDRAM device parameters */
index 29cea53266b87e5a25439b26e65c08aeb9d27812..756b15f7ab0b088262373cebbf037b1419feefbd 100644 (file)
@@ -128,24 +128,32 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,
        pdimm->data_width = pdimm->primary_sdram_width
                          + pdimm->ec_sdram_width;
 
-       switch (spd->module_type & 0xf) {
-       case 0x01:      /* RDIMM */
-       case 0x05:      /* Mini-RDIMM */
-               pdimm->registered_dimm = 1; /* register buffered */
+       /* These are the types defined by the JEDEC DDR3 SPD spec */
+       pdimm->mirrored_dimm = 0;
+       pdimm->registered_dimm = 0;
+       switch (spd->module_type & DDR3_SPD_MODULETYPE_MASK) {
+       case DDR3_SPD_MODULETYPE_RDIMM:
+       case DDR3_SPD_MODULETYPE_MINI_RDIMM:
+               /* Registered/buffered DIMMs */
+               pdimm->registered_dimm = 1;
                for (i = 0; i < 16; i += 2) {
-                       pdimm->rcw[i] = spd->mod_section.registered.rcw[i/2] & 0x0F;
-                       pdimm->rcw[i+1] = (spd->mod_section.registered.rcw[i/2] >> 4) & 0x0F;
+                       u8 rcw = spd->mod_section.registered.rcw[i/2];
+                       pdimm->rcw[i]   = (rcw >> 0) & 0x0F;
+                       pdimm->rcw[i+1] = (rcw >> 4) & 0x0F;
                }
                break;
-       case 0x02:      /* UDIMM */
-       case 0x03:      /* SO-DIMM */
-       case 0x04:      /* Micro-DIMM */
-       case 0x06:      /* Mini-UDIMM */
-               pdimm->registered_dimm = 0;     /* unbuffered */
+
+       case DDR3_SPD_MODULETYPE_UDIMM:
+       case DDR3_SPD_MODULETYPE_SO_DIMM:
+       case DDR3_SPD_MODULETYPE_MICRO_DIMM:
+       case DDR3_SPD_MODULETYPE_MINI_UDIMM:
+               /* Unbuffered DIMMs */
+               if (spd->mod_section.unbuffered.addr_mapping & 0x1)
+                       pdimm->mirrored_dimm = 1;
                break;
 
        default:
-               printf("unknown dimm_type 0x%02X\n", spd->module_type);
+               printf("unknown module_type 0x%02X\n", spd->module_type);
                return 1;
        }
 
@@ -303,16 +311,5 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,
        pdimm->tFAW_ps = (((spd->tFAW_msb & 0xf) << 8) | spd->tFAW_min)
                        * mtb_ps;
 
-       /*
-        * We need check the address mirror for unbuffered DIMM
-        * If SPD indicate the address map mirror, The DDR controller
-        * need care it.
-        */
-       if ((spd->module_type == SPD_MODULETYPE_UDIMM) ||
-           (spd->module_type == SPD_MODULETYPE_SODIMM) ||
-           (spd->module_type == SPD_MODULETYPE_MICRODIMM) ||
-           (spd->module_type == SPD_MODULETYPE_MINIUDIMM))
-               pdimm->mirrored_dimm = spd->mod_section.unbuffered.addr_mapping & 0x1;
-
        return 0;
 }
index 8b31ec0cfaeb97f5d078eedde6d40d1f40e70e1d..00f3d6c600a322206372a33908ccc67d5ed30ce4 100644 (file)
@@ -207,10 +207,15 @@ compute_lowest_common_dimm_parameters(const dimm_params_t *dimm_params,
        temp1 = temp2 = 0;
        for (i = 0; i < number_of_dimms; i++) {
                if (dimm_params[i].n_ranks) {
-                       if (dimm_params[i].registered_dimm)
+                       if (dimm_params[i].registered_dimm) {
                                temp1 = 1;
-                       if (!dimm_params[i].registered_dimm)
+                               printf("Detected RDIMM %s\n",
+                                       dimm_params[i].mpart);
+                       } else {
                                temp2 = 1;
+                               printf("Detected UDIMM %s\n",
+                                       dimm_params[i].mpart);
+                       }
                }
        }
 
@@ -218,10 +223,8 @@ compute_lowest_common_dimm_parameters(const dimm_params_t *dimm_params,
        outpdimm->all_DIMMs_unbuffered = 0;
        if (temp1 && !temp2) {
                outpdimm->all_DIMMs_registered = 1;
-               printf("Detected RDIMM(s)\n");
        } else if (!temp1 && temp2) {
                outpdimm->all_DIMMs_unbuffered = 1;
-               printf("Detected UDIMM(s)\n");
        } else {
                printf("ERROR:  Mix of registered buffered and unbuffered "
                                "DIMMs detected!\n");
index bb96d66a9df5774e6a2cbeb6ed011266b40fe8c4..c8fa123539d7dffe50eb09959a2cde00cf23d6a7 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <i2c.h>
 #include <asm/fsl_ddr_sdram.h>
 
 #include "ddr.h"
@@ -26,9 +27,65 @@ extern void fsl_ddr_set_lawbar(
 extern void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
                                   unsigned int ctrl_num);
 
-/* Board-specific functions defined in each board's ddr.c */
-extern void fsl_ddr_get_spd(generic_spd_eeprom_t *ctrl_dimms_spd,
-                          unsigned int ctrl_num);
+#if defined(SPD_EEPROM_ADDRESS) || \
+    defined(SPD_EEPROM_ADDRESS1) || defined(SPD_EEPROM_ADDRESS2) || \
+    defined(SPD_EEPROM_ADDRESS3) || defined(SPD_EEPROM_ADDRESS4)
+#if (CONFIG_NUM_DDR_CONTROLLERS == 1) && (CONFIG_DIMM_SLOTS_PER_CTLR == 1)
+u8 spd_i2c_addr[CONFIG_NUM_DDR_CONTROLLERS][CONFIG_DIMM_SLOTS_PER_CTLR] = {
+       [0][0] = SPD_EEPROM_ADDRESS,
+};
+#endif
+#if (CONFIG_NUM_DDR_CONTROLLERS == 2) && (CONFIG_DIMM_SLOTS_PER_CTLR == 1)
+u8 spd_i2c_addr[CONFIG_NUM_DDR_CONTROLLERS][CONFIG_DIMM_SLOTS_PER_CTLR] = {
+       [0][0] = SPD_EEPROM_ADDRESS1,   /* controller 1 */
+       [1][0] = SPD_EEPROM_ADDRESS2,   /* controller 2 */
+};
+#endif
+#if (CONFIG_NUM_DDR_CONTROLLERS == 2) && (CONFIG_DIMM_SLOTS_PER_CTLR == 2)
+u8 spd_i2c_addr[CONFIG_NUM_DDR_CONTROLLERS][CONFIG_DIMM_SLOTS_PER_CTLR] = {
+       [0][0] = SPD_EEPROM_ADDRESS1,   /* controller 1 */
+       [0][1] = SPD_EEPROM_ADDRESS2,   /* controller 1 */
+       [1][0] = SPD_EEPROM_ADDRESS3,   /* controller 2 */
+       [1][1] = SPD_EEPROM_ADDRESS4,   /* controller 2 */
+};
+#endif
+
+static void __get_spd(generic_spd_eeprom_t *spd, u8 i2c_address)
+{
+       int ret = i2c_read(i2c_address, 0, 1, (uchar *)spd,
+                               sizeof(generic_spd_eeprom_t));
+
+       if (ret) {
+               printf("DDR: failed to read SPD from address %u\n", i2c_address);
+               memset(spd, 0, sizeof(generic_spd_eeprom_t));
+       }
+}
+
+__attribute__((weak, alias("__get_spd")))
+void get_spd(generic_spd_eeprom_t *spd, u8 i2c_address);
+
+void fsl_ddr_get_spd(generic_spd_eeprom_t *ctrl_dimms_spd,
+                     unsigned int ctrl_num)
+{
+       unsigned int i;
+       unsigned int i2c_address = 0;
+
+       if (ctrl_num >= CONFIG_NUM_DDR_CONTROLLERS) {
+               printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
+               return;
+       }
+
+       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
+               i2c_address = spd_i2c_addr[ctrl_num][i];
+               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
+       }
+}
+#else
+void fsl_ddr_get_spd(generic_spd_eeprom_t *ctrl_dimms_spd,
+                     unsigned int ctrl_num)
+{
+}
+#endif /* SPD_EEPROM_ADDRESSx */
 
 /*
  * ASSUMPTIONS:
index 1e2d921286e98050b90add2dca8bff8b3f288c0a..104d360a5f1d31708ef5ffb871a49b1173702203 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008 Freescale Semiconductor, Inc.
+ * Copyright 2008-2011 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
@@ -8,10 +8,16 @@
 
 #include <common.h>
 #include <asm/fsl_law.h>
+#include <div64.h>
 
 #include "ddr.h"
 
-unsigned int fsl_ddr_get_mem_data_rate(void);
+/* To avoid 64-bit full-divides, we factor this here */
+#define ULL_2E12 2000000000000ULL
+#define UL_5POW12 244140625UL
+#define UL_2POW13 (1UL << 13)
+
+#define ULL_8FS 0xFFFFFFFFULL
 
 /*
  * Round mclk_ps to nearest 10 ps in memory controller code.
@@ -22,35 +28,51 @@ unsigned int fsl_ddr_get_mem_data_rate(void);
  */
 unsigned int get_memory_clk_period_ps(void)
 {
-       unsigned int mclk_ps;
+       unsigned int data_rate = get_ddr_freq(0);
+       unsigned int result;
+
+       /* Round to nearest 10ps, being careful about 64-bit multiply/divide */
+       unsigned long long mclk_ps = ULL_2E12;
+
+       /* Add 5*data_rate, for rounding */
+       mclk_ps += 5*(unsigned long long)data_rate;
 
-       mclk_ps = 2000000000000ULL / fsl_ddr_get_mem_data_rate();
-       /* round to nearest 10 ps */
-       return 10 * ((mclk_ps + 5) / 10);
+       /* Now perform the big divide, the result fits in 32-bits */
+       do_div(mclk_ps, data_rate);
+       result = mclk_ps;
+
+       /* We still need to round to 10ps */
+       return 10 * (result/10);
 }
 
 /* Convert picoseconds into DRAM clock cycles (rounding up if needed). */
 unsigned int picos_to_mclk(unsigned int picos)
 {
-       const unsigned long long ULL_2e12 = 2000000000000ULL;
-       const unsigned long long ULL_8Fs = 0xFFFFFFFFULL;
-       unsigned long long clks;
-       unsigned long long clks_temp;
+       unsigned long long clks, clks_rem;
 
+       /* Short circuit for zero picos */
        if (!picos)
                return 0;
 
-       clks = fsl_ddr_get_mem_data_rate() * (unsigned long long) picos;
-       clks_temp = clks;
-       clks = clks / ULL_2e12;
-       if (clks_temp % ULL_2e12) {
-               clks++;
-       }
+       /* First multiply the time by the data rate (32x32 => 64) */
+       clks = picos * (unsigned long long)get_ddr_freq(0);
 
-       if (clks > ULL_8Fs) {
-               clks = ULL_8Fs;
-       }
+       /*
+        * Now divide by 5^12 and track the 32-bit remainder, then divide
+        * by 2*(2^12) using shifts (and updating the remainder).
+        */
+       clks_rem = do_div(clks, UL_5POW12);
+       clks_rem <<= 13;
+       clks_rem |= clks & (UL_2POW13-1);
+       clks >>= 13;
+
+       /* If we had a remainder, then round up */
+       if (clks_rem)
+               clks++;
 
+       /* Clamp to the maximum representable value */
+       if (clks > ULL_8FS)
+               clks = ULL_8FS;
        return (unsigned int) clks;
 }
 
@@ -141,6 +163,8 @@ void board_add_ram_info(int use_default)
 
        if (sdram_cfg & SDRAM_CFG_32_BE)
                puts(", 32-bit");
+       else if (sdram_cfg & SDRAM_CFG_16_BE)
+               puts(", 16-bit");
        else
                puts(", 64-bit");
 
index 0c166fd6c9c53432d641179d9ad4e4f1e9e12a3c..520cb90280967f5fa349c8f356aba3080f70ca61 100644 (file)
@@ -27,8 +27,8 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <asm/mp.h>
-#include <asm/fsl_enet.h>
 #include <asm/fsl_serdes.h>
+#include <phy.h>
 
 #if defined(CONFIG_MP) && (defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx))
 static int ft_del_cpuhandle(void *blob, int cpuhandle)
@@ -218,27 +218,10 @@ void fdt_fixup_crypto_node(void *blob, int sec_rev)
 }
 #endif
 
-int fdt_fixup_phy_connection(void *blob, int offset, enum fsl_phy_enet_if phyc)
+int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)
 {
-       static const char *fsl_phy_enet_if_str[] = {
-               [MII]           = "mii",
-               [RMII]          = "rmii",
-               [GMII]          = "gmii",
-               [RGMII]         = "rgmii",
-               [RGMII_ID]      = "rgmii-id",
-               [RGMII_RXID]    = "rgmii-rxid",
-               [SGMII]         = "sgmii",
-               [TBI]           = "tbi",
-               [RTBI]          = "rtbi",
-               [XAUI]          = "xgmii",
-               [FSL_ETH_IF_NONE] = "",
-       };
-
-       if (phyc > ARRAY_SIZE(fsl_phy_enet_if_str))
-               return fdt_setprop_string(blob, offset, "phy-connection-type", "");
-
        return fdt_setprop_string(blob, offset, "phy-connection-type",
-                                        fsl_phy_enet_if_str[phyc]);
+                                        phy_string_for_interface(phyc));
 }
 
 #ifdef CONFIG_SYS_SRIO
diff --git a/arch/powerpc/cpu/mpc8xxx/fsl_ifc.c b/arch/powerpc/cpu/mpc8xxx/fsl_ifc.c
new file mode 100644 (file)
index 0000000..e794821
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * Author: Dipen Dudhat <dipen.dudhat@freescale.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 <common.h>
+#include <asm/fsl_ifc.h>
+
+void print_ifc_regs(void)
+{
+       int i, j;
+
+       printf("IFC Controller Registers\n");
+       for (i = 0; i < FSL_IFC_BANK_COUNT; i++) {
+               printf("CSPR%d:0x%08X\tAMASK%d:0x%08X\tCSOR%d:0x%08X\n",
+                       i, get_ifc_cspr(i), i, get_ifc_amask(i),
+                       i, get_ifc_csor(i));
+               for (j = 0; j < 4; j++)
+                       printf("IFC_FTIM%d:0x%08X\n", j, get_ifc_ftim(i, j));
+       }
+}
+
+void init_early_memctl_regs(void)
+{
+#if defined(CONFIG_SYS_CSPR0) && defined(CONFIG_SYS_CSOR0)
+       set_ifc_ftim(IFC_CS0, IFC_FTIM0, CONFIG_SYS_CS0_FTIM0);
+       set_ifc_ftim(IFC_CS0, IFC_FTIM1, CONFIG_SYS_CS0_FTIM1);
+       set_ifc_ftim(IFC_CS0, IFC_FTIM2, CONFIG_SYS_CS0_FTIM2);
+       set_ifc_ftim(IFC_CS0, IFC_FTIM3, CONFIG_SYS_CS0_FTIM3);
+
+       set_ifc_cspr(IFC_CS0, CONFIG_SYS_CSPR0);
+       set_ifc_amask(IFC_CS0, CONFIG_SYS_AMASK0);
+       set_ifc_csor(IFC_CS0, CONFIG_SYS_CSOR0);
+#endif
+
+#if defined(CONFIG_SYS_CSPR1) && defined(CONFIG_SYS_CSOR1)
+       set_ifc_ftim(IFC_CS1, IFC_FTIM0, CONFIG_SYS_CS1_FTIM0);
+       set_ifc_ftim(IFC_CS1, IFC_FTIM1, CONFIG_SYS_CS1_FTIM1);
+       set_ifc_ftim(IFC_CS1, IFC_FTIM2, CONFIG_SYS_CS1_FTIM2);
+       set_ifc_ftim(IFC_CS1, IFC_FTIM3, CONFIG_SYS_CS1_FTIM3);
+
+       set_ifc_csor(IFC_CS1, CONFIG_SYS_CSOR1);
+       set_ifc_amask(IFC_CS1, CONFIG_SYS_AMASK1);
+       set_ifc_cspr(IFC_CS1, CONFIG_SYS_CSPR1);
+#endif
+
+#if defined(CONFIG_SYS_CSPR2) && defined(CONFIG_SYS_CSOR2)
+       set_ifc_ftim(IFC_CS2, IFC_FTIM0, CONFIG_SYS_CS2_FTIM0);
+       set_ifc_ftim(IFC_CS2, IFC_FTIM1, CONFIG_SYS_CS2_FTIM1);
+       set_ifc_ftim(IFC_CS2, IFC_FTIM2, CONFIG_SYS_CS2_FTIM2);
+       set_ifc_ftim(IFC_CS2, IFC_FTIM3, CONFIG_SYS_CS2_FTIM3);
+
+       set_ifc_csor(IFC_CS2, CONFIG_SYS_CSOR2);
+       set_ifc_amask(IFC_CS2, CONFIG_SYS_AMASK2);
+       set_ifc_cspr(IFC_CS2, CONFIG_SYS_CSPR2);
+#endif
+
+#if defined(CONFIG_SYS_CSPR3) && defined(CONFIG_SYS_CSOR3)
+       set_ifc_ftim(IFC_CS3, IFC_FTIM0, CONFIG_SYS_CS3_FTIM0);
+       set_ifc_ftim(IFC_CS3, IFC_FTIM1, CONFIG_SYS_CS3_FTIM1);
+       set_ifc_ftim(IFC_CS3, IFC_FTIM2, CONFIG_SYS_CS3_FTIM2);
+       set_ifc_ftim(IFC_CS3, IFC_FTIM3, CONFIG_SYS_CS3_FTIM3);
+
+       set_ifc_cspr(IFC_CS3, CONFIG_SYS_CSPR3);
+       set_ifc_amask(IFC_CS3, CONFIG_SYS_AMASK3);
+       set_ifc_csor(IFC_CS3, CONFIG_SYS_CSOR3);
+#endif
+}
index d862bb4fb83ad3dc0de0851038b8ba19649cb8c4..f5cbbbd665a0318dd02425255b9526c4583adeff 100644 (file)
@@ -21,7 +21,7 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -meabi
+PLATFORM_RELFLAGS += -meabi
 PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float
 
 cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
index 2b6b233ba680afd14c7314f633e5013a10b2133e..9aad9be1b0eb8e4b3d8f6bfcb93f5f248ae368fb 100644 (file)
 #include <asm/config_mpc86xx.h>
 #endif
 
+/* CONFIG_HARD_SPI triggers SPI bus initialization in PowerPC */
+#if defined(CONFIG_MPC8XXX_SPI) || defined(CONFIG_FSL_ESPI)
+# ifndef CONFIG_HARD_SPI
+#  define CONFIG_HARD_SPI
+# endif
+#endif
+
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 #define CONFIG_SYS_BOOT_GET_CMDLINE
 /* Since so many PPC SOCs have a semi-common LBC, define this here */
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) || \
        defined(CONFIG_MPC83xx)
+#if !defined(CONFIG_FSL_IFC)
 #define CONFIG_FSL_LBC
 #endif
+#endif
+
+/* The TSEC driver uses the PHYLIB infrastructure */
+#ifndef CONFIG_PHYLIB
+#if defined(CONFIG_TSEC_ENET)
+#define CONFIG_PHYLIB
+
+#include <config_phylib_all_drivers.h>
+#endif /* TSEC_ENET */
+#endif /* !CONFIG_PHYLIB */
 
 /* All PPC boards must swap IDE bytes */
 #define CONFIG_IDE_SWAP_IO
index 6c16681b7f320a9c1179d0b8cf694ff53bb54878..41c2d20df5deab4fbfa3d56185fef760bbb69b09 100644 (file)
 #define CONFIG_MAX_CPUS                        1
 #define CONFIG_SYS_FSL_NUM_LAWS                10
 #define CONFIG_SYS_FSL_SEC_COMPAT      2
+#define QE_MURAM_SIZE                  0x10000UL
+#define MAX_QE_RISC                    2
+#define QE_NUM_OF_SNUM                 28
 
 #elif defined(CONFIG_MPC8569)
 #define CONFIG_MAX_CPUS                        1
 #define CONFIG_SYS_FSL_NUM_LAWS                10
 #define CONFIG_SYS_FSL_SEC_COMPAT      2
+#define QE_MURAM_SIZE                  0x20000UL
+#define MAX_QE_RISC                    4
+#define QE_NUM_OF_SNUM                 46
 
 #elif defined(CONFIG_MPC8572)
 #define CONFIG_MAX_CPUS                        2
 
 #elif defined(CONFIG_P1010)
 #define CONFIG_MAX_CPUS                        1
+#define CONFIG_FSL_SDHC_V2_3
 #define CONFIG_SYS_FSL_NUM_LAWS                12
 #define CONFIG_TSECV2
 #define CONFIG_SYS_FSL_SEC_COMPAT      4
+#define CONFIG_FSL_SATA_V2
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+#define CONFIG_NUM_DDR_CONTROLLERS     1
+#define CONFIG_SYS_CCSRBAR_DEFAULT     0xff700000
 
+/* P1011 is single core version of P1020 */
 #elif defined(CONFIG_P1011)
 #define CONFIG_MAX_CPUS                        1
 #define CONFIG_SYS_FSL_NUM_LAWS                12
 #define CONFIG_TSECV2
 #define CONFIG_FSL_PCIE_DISABLE_ASPM
 #define CONFIG_SYS_FSL_SEC_COMPAT      2
+#define CONFIG_SYS_FSL_ERRATUM_ELBC_A001
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
 
+/* P1012 is single core version of P1021 */
 #elif defined(CONFIG_P1012)
 #define CONFIG_MAX_CPUS                        1
 #define CONFIG_SYS_FSL_NUM_LAWS                12
 #define CONFIG_TSECV2
 #define CONFIG_FSL_PCIE_DISABLE_ASPM
 #define CONFIG_SYS_FSL_SEC_COMPAT      2
+#define CONFIG_SYS_FSL_ERRATUM_ELBC_A001
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+#define QE_MURAM_SIZE                  0x6000UL
+#define MAX_QE_RISC                    1
+#define QE_NUM_OF_SNUM                 28
 
+/* P1013 is single core version of P1022 */
 #elif defined(CONFIG_P1013)
 #define CONFIG_MAX_CPUS                        1
 #define CONFIG_SYS_FSL_NUM_LAWS                12
 
 #elif defined(CONFIG_P1014)
 #define CONFIG_MAX_CPUS                        1
+#define CONFIG_FSL_SDHC_V2_3
 #define CONFIG_SYS_FSL_NUM_LAWS                12
 #define CONFIG_TSECV2
 #define CONFIG_SYS_FSL_SEC_COMPAT      4
+#define CONFIG_FSL_SATA_V2
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+#define CONFIG_NUM_DDR_CONTROLLERS     1
+#define CONFIG_SYS_CCSRBAR_DEFAULT     0xff700000
+
+/* P1015 is single core version of P1024 */
+#elif defined(CONFIG_P1015)
+#define CONFIG_MAX_CPUS                        1
+#define CONFIG_SYS_FSL_NUM_LAWS                12
+#define CONFIG_TSECV2
+#define CONFIG_FSL_PCIE_DISABLE_ASPM
+#define CONFIG_SYS_FSL_SEC_COMPAT      2
+#define CONFIG_SYS_FSL_ERRATUM_ELBC_A001
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+
+/* P1016 is single core version of P1025 */
+#elif defined(CONFIG_P1016)
+#define CONFIG_MAX_CPUS                        1
+#define CONFIG_SYS_FSL_NUM_LAWS                12
+#define CONFIG_TSECV2
+#define CONFIG_FSL_PCIE_DISABLE_ASPM
+#define CONFIG_SYS_FSL_SEC_COMPAT      2
+#define CONFIG_SYS_FSL_ERRATUM_ELBC_A001
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+#define QE_MURAM_SIZE                  0x6000UL
+#define MAX_QE_RISC                    1
+#define QE_NUM_OF_SNUM                 28
+
+/* P1017 is single core version of P1023 */
+#elif defined(CONFIG_P1017)
+#define CONFIG_MAX_CPUS                        1
+#define CONFIG_SYS_FSL_NUM_LAWS                12
+#define CONFIG_SYS_FSL_SEC_COMPAT      4
+#define CONFIG_SYS_NUM_FMAN            1
+#define CONFIG_SYS_NUM_FM1_DTSEC       2
+#define CONFIG_NUM_DDR_CONTROLLERS     1
+#define CONFIG_SYS_QMAN_NUM_PORTALS    3
+#define CONFIG_SYS_BMAN_NUM_PORTALS    3
+#define CONFIG_SYS_FM_MURAM_SIZE       0x10000
 
 #elif defined(CONFIG_P1020)
 #define CONFIG_MAX_CPUS                        2
 #define CONFIG_TSECV2
 #define CONFIG_FSL_PCIE_DISABLE_ASPM
 #define CONFIG_SYS_FSL_SEC_COMPAT      2
+#define CONFIG_SYS_FSL_ERRATUM_ELBC_A001
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
 
 #elif defined(CONFIG_P1021)
 #define CONFIG_MAX_CPUS                        2
 #define CONFIG_TSECV2
 #define CONFIG_FSL_PCIE_DISABLE_ASPM
 #define CONFIG_SYS_FSL_SEC_COMPAT      2
+#define CONFIG_SYS_FSL_ERRATUM_ELBC_A001
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+#define QE_MURAM_SIZE                  0x6000UL
+#define MAX_QE_RISC                    1
+#define QE_NUM_OF_SNUM                 28
 
 #elif defined(CONFIG_P1022)
 #define CONFIG_MAX_CPUS                        2
 #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
 #define CONFIG_FSL_SATA_ERRATUM_A001
 
+#elif defined(CONFIG_P1023)
+#define CONFIG_MAX_CPUS                        2
+#define CONFIG_SYS_FSL_NUM_LAWS                12
+#define CONFIG_SYS_FSL_SEC_COMPAT      4
+#define CONFIG_SYS_NUM_FMAN            1
+#define CONFIG_SYS_NUM_FM1_DTSEC       2
+#define CONFIG_NUM_DDR_CONTROLLERS     1
+#define CONFIG_SYS_QMAN_NUM_PORTALS    3
+#define CONFIG_SYS_BMAN_NUM_PORTALS    3
+#define CONFIG_SYS_FM_MURAM_SIZE       0x10000
+
+/* P1024 is lower end variant of P1020 */
+#elif defined(CONFIG_P1024)
+#define CONFIG_MAX_CPUS                        2
+#define CONFIG_SYS_FSL_NUM_LAWS                12
+#define CONFIG_TSECV2
+#define CONFIG_FSL_PCIE_DISABLE_ASPM
+#define CONFIG_SYS_FSL_SEC_COMPAT      2
+#define CONFIG_SYS_FSL_ERRATUM_ELBC_A001
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+
+/* P1025 is lower end variant of P1021 */
+#elif defined(CONFIG_P1025)
+#define CONFIG_MAX_CPUS                        2
+#define CONFIG_SYS_FSL_NUM_LAWS                12
+#define CONFIG_TSECV2
+#define CONFIG_FSL_PCIE_DISABLE_ASPM
+#define CONFIG_SYS_FSL_SEC_COMPAT      2
+#define CONFIG_SYS_FSL_ERRATUM_ELBC_A001
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+#define QE_MURAM_SIZE                  0x6000UL
+#define MAX_QE_RISC                    1
+#define QE_NUM_OF_SNUM                 28
+
+/* P2010 is single core version of P2020 */
 #elif defined(CONFIG_P2010)
 #define CONFIG_MAX_CPUS                        1
 #define CONFIG_SYS_FSL_NUM_LAWS                12
 
 #elif defined(CONFIG_PPC_P2040)
 #define CONFIG_MAX_CPUS                        4
+#define CONFIG_SYS_FSL_NUM_CC_PLLS     2
 #define CONFIG_SYS_FSL_NUM_LAWS                32
 #define CONFIG_SYS_FSL_SEC_COMPAT      4
+#define CONFIG_SYS_NUM_FMAN            1
+#define CONFIG_SYS_NUM_FM1_DTSEC       5
+#define CONFIG_NUM_DDR_CONTROLLERS     1
+#define CONFIG_SYS_FM_MURAM_SIZE       0x28000
+#define CONFIG_SYS_FSL_TBCLK_DIV       32
+#define CONFIG_SYS_FSL_USB1_PHY_ENABLE
+#define CONFIG_SYS_FSL_USB2_PHY_ENABLE
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
 
 #elif defined(CONFIG_PPC_P3041)
 #define CONFIG_MAX_CPUS                        4
+#define CONFIG_SYS_FSL_NUM_CC_PLLS     2
 #define CONFIG_SYS_FSL_NUM_LAWS                32
 #define CONFIG_SYS_FSL_SEC_COMPAT      4
+#define CONFIG_SYS_NUM_FMAN            1
+#define CONFIG_SYS_NUM_FM1_DTSEC       5
+#define CONFIG_SYS_NUM_FM1_10GEC       1
+#define CONFIG_NUM_DDR_CONTROLLERS     1
+#define CONFIG_SYS_FM_MURAM_SIZE       0x28000
+#define CONFIG_SYS_FSL_TBCLK_DIV       32
+#define CONFIG_SYS_FSL_USB1_PHY_ENABLE
+#define CONFIG_SYS_FSL_USB2_PHY_ENABLE
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
 
 #elif defined(CONFIG_PPC_P4040)
 #define CONFIG_MAX_CPUS                        4
+#define CONFIG_SYS_FSL_NUM_CC_PLLS     4
 #define CONFIG_SYS_FSL_NUM_LAWS                32
 #define CONFIG_SYS_FSL_SEC_COMPAT      4
+#define CONFIG_SYS_FM_MURAM_SIZE       0x28000
+#define CONFIG_SYS_FSL_TBCLK_DIV       16
 
 #elif defined(CONFIG_PPC_P4080)
 #define CONFIG_MAX_CPUS                        8
+#define CONFIG_SYS_FSL_NUM_CC_PLLS     4
 #define CONFIG_SYS_FSL_NUM_LAWS                32
 #define CONFIG_SYS_FSL_SEC_COMPAT      4
 #define CONFIG_SYS_NUM_FMAN            2
 #define CONFIG_SYS_NUM_FM1_10GEC       1
 #define CONFIG_SYS_NUM_FM2_10GEC       1
 #define CONFIG_NUM_DDR_CONTROLLERS     2
+#define CONFIG_SYS_FM_MURAM_SIZE       0x28000
+#define CONFIG_SYS_FSL_TBCLK_DIV       16
 #define CONFIG_SYS_FSL_ERRATUM_CPC_A002
 #define CONFIG_SYS_FSL_ERRATUM_CPC_A003
 #define CONFIG_SYS_FSL_ERRATUM_DDR_A003
 #define CONFIG_SYS_FSL_ERRATUM_ESDHC136
 #define CONFIG_SYS_P4080_ERRATUM_CPU22
 #define CONFIG_SYS_P4080_ERRATUM_SERDES8
+#define CONFIG_SYS_P4080_ERRATUM_SERDES9
+#define CONFIG_SYS_P4080_ERRATUM_SERDES_A001
+#define CONFIG_SYS_P4080_ERRATUM_SERDES_A005
 
+/* P5010 is single core version of P5020 */
 #elif defined(CONFIG_PPC_P5010)
 #define CONFIG_MAX_CPUS                        1
+#define CONFIG_SYS_FSL_NUM_CC_PLLS     2
 #define CONFIG_SYS_FSL_NUM_LAWS                32
 #define CONFIG_SYS_FSL_SEC_COMPAT      4
+#define CONFIG_SYS_NUM_FMAN            1
+#define CONFIG_SYS_NUM_FM1_DTSEC       5
+#define CONFIG_SYS_NUM_FM1_10GEC       1
+#define CONFIG_NUM_DDR_CONTROLLERS     1
+#define CONFIG_SYS_FM_MURAM_SIZE       0x28000
+#define CONFIG_SYS_FSL_TBCLK_DIV       32
+#define CONFIG_SYS_FSL_USB1_PHY_ENABLE
+#define CONFIG_SYS_FSL_USB2_PHY_ENABLE
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
 
 #elif defined(CONFIG_PPC_P5020)
 #define CONFIG_MAX_CPUS                        2
+#define CONFIG_SYS_FSL_NUM_CC_PLLS     2
 #define CONFIG_SYS_FSL_NUM_LAWS                32
 #define CONFIG_SYS_FSL_SEC_COMPAT      4
+#define CONFIG_SYS_NUM_FMAN            1
+#define CONFIG_SYS_NUM_FM1_DTSEC       5
+#define CONFIG_SYS_NUM_FM1_10GEC       1
+#define CONFIG_NUM_DDR_CONTROLLERS     2
+#define CONFIG_SYS_FM_MURAM_SIZE       0x28000
+#define CONFIG_SYS_FSL_TBCLK_DIV       32
+#define CONFIG_SYS_FSL_USB1_PHY_ENABLE
+#define CONFIG_SYS_FSL_USB2_PHY_ENABLE
+#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
 
 #else
 #error Processor type not defined for this platform
index 02a1f5d32339f15058f8b5027f271e3c3b409e88..127a84039c337556c90cff6d55defa8b4eef89ab 100644 (file)
@@ -84,6 +84,7 @@ typedef ddr3_spd_eeprom_t generic_spd_eeprom_t;
 #define SDRAM_CFG_SDRAM_TYPE_SHIFT     24
 #define SDRAM_CFG_DYN_PWR              0x00200000
 #define SDRAM_CFG_32_BE                        0x00080000
+#define SDRAM_CFG_16_BE                        0x00100000
 #define SDRAM_CFG_8_BE                 0x00040000
 #define SDRAM_CFG_NCAP                 0x00020000
 #define SDRAM_CFG_2T_EN                        0x00008000
@@ -270,7 +271,10 @@ typedef struct memctl_options_s {
 } memctl_options_t;
 
 extern phys_size_t fsl_ddr_sdram(void);
+extern phys_size_t fsl_ddr_sdram_size(void);
 extern int fsl_use_spd(void);
+extern void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
+                                       unsigned int ctrl_num);
 
 /*
  * The 85xx boards have a common prototype for fixed_sdram so put the
index 4fb2857f3e56fc8a6fc9c595f103639903718519..8227b667cb3561b345ff722c39194ad88aafef9b 100644 (file)
 #ifndef __ASM_PPC_FSL_ENET_H
 #define __ASM_PPC_FSL_ENET_H
 
-enum fsl_phy_enet_if {
-       MII,
-       RMII,
-       GMII,
-       RGMII,
-       RGMII_ID,
-       RGMII_RXID,
-       RGMII_TXID,
-       SGMII,
-       TBI,
-       RTBI,
-       XAUI,
-       FSL_ETH_IF_NONE,
-};
+#include <phy.h>
 
-int fdt_fixup_phy_connection(void *blob, int offset, enum fsl_phy_enet_if phyc);
+struct tsec_mii_mng {
+       u32 miimcfg;            /* MII management configuration reg */
+       u32 miimcom;            /* MII management command reg */
+       u32 miimadd;            /* MII management address reg */
+       u32 miimcon;            /* MII management control reg */
+       u32 miimstat;           /* MII management status reg  */
+       u32 miimind;            /* MII management indication reg */
+       u32 ifstat;             /* Interface Status Register */
+} __attribute__ ((packed));
+
+int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc);
 
 #endif /* __ASM_PPC_FSL_ENET_H */
diff --git a/arch/powerpc/include/asm/fsl_ifc.h b/arch/powerpc/include/asm/fsl_ifc.h
new file mode 100644 (file)
index 0000000..d4d9809
--- /dev/null
@@ -0,0 +1,957 @@
+/*
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * Author: Dipen Dudhat <dipen.dudhat@freescale.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_PPC_FSL_IFC_H
+#define __ASM_PPC_FSL_IFC_H
+
+#include <config.h>
+#include <common.h>
+
+/*
+ * CSPR - Chip Select Property Register
+ */
+#define CSPR_BA                                0xFFFF0000
+#define CSPR_BA_SHIFT                  16
+#define CSPR_PORT_SIZE                 0x00000180
+#define CSPR_PORT_SIZE_SHIFT           7
+/* Port Size 8 bit */
+#define CSPR_PORT_SIZE_8               0x00000080
+/* Port Size 16 bit */
+#define CSPR_PORT_SIZE_16              0x00000100
+/* Port Size 32 bit */
+#define CSPR_PORT_SIZE_32              0x00000180
+/* Write Protect */
+#define CSPR_WP                                0x00000040
+#define CSPR_WP_SHIFT                  6
+/* Machine Select */
+#define CSPR_MSEL                      0x00000006
+#define CSPR_MSEL_SHIFT                        1
+/* NOR */
+#define CSPR_MSEL_NOR                  0x00000000
+/* NAND */
+#define CSPR_MSEL_NAND                 0x00000002
+/* GPCM */
+#define CSPR_MSEL_GPCM                 0x00000004
+/* Bank Valid */
+#define CSPR_V                         0x00000001
+#define CSPR_V_SHIFT                   0
+
+/* Convert an address into the right format for the CSPR Registers */
+#define CSPR_PHYS_ADDR(x)              (((uint64_t)x) & 0xffff0000)
+
+/*
+ * Address Mask Register
+ */
+#define IFC_AMASK_MASK                 0xFFFF0000
+#define IFC_AMASK_SHIFT                        16
+#define IFC_AMASK(n)                   (IFC_AMASK_MASK << \
+                                       (__ilog2(n) - IFC_AMASK_SHIFT))
+
+/*
+ * Chip Select Option Register IFC_NAND Machine
+ */
+/* Enable ECC Encoder */
+#define CSOR_NAND_ECC_ENC_EN           0x80000000
+/* 4 bit correction per 520 Byte sector */
+#define CSOR_NAND_ECC_MODE_4           0x00000000
+/* 8 bit correction per 528 Byte sector */
+#define CSOR_NAND_ECC_MODE_8           0x10000000
+/* Enable ECC Decoder */
+#define CSOR_NAND_ECC_DEC_EN           0x04000000
+/* Row Address Length */
+#define CSOR_NAND_RAL_MASK             0x01800000
+#define CSOR_NAND_RAL_SHIFT            20
+#define CSOR_NAND_RAL_1                        0x00000000
+#define CSOR_NAND_RAL_2                        0x00800000
+#define CSOR_NAND_RAL_3                        0x01000000
+#define CSOR_NAND_RAL_4                        0x01800000
+/* Page Size 512b, 2k, 4k */
+#define CSOR_NAND_PGS_MASK             0x00180000
+#define CSOR_NAND_PGS_SHIFT            16
+#define CSOR_NAND_PGS_512              0x00000000
+#define CSOR_NAND_PGS_2K               0x00080000
+#define CSOR_NAND_PGS_4K               0x00100000
+/* Spare region Size */
+#define CSOR_NAND_SPRZ_MASK            0x0000E000
+#define CSOR_NAND_SPRZ_SHIFT           13
+#define CSOR_NAND_SPRZ_16              0x00000000
+#define CSOR_NAND_SPRZ_64              0x00002000
+#define CSOR_NAND_SPRZ_128             0x00004000
+#define CSOR_NAND_SPRZ_210             0x00006000
+#define CSOR_NAND_SPRZ_218             0x00008000
+#define CSOR_NAND_SPRZ_224             0x0000A000
+/* Pages Per Block */
+#define CSOR_NAND_PB_MASK              0x00000700
+#define CSOR_NAND_PB_SHIFT             8
+#define CSOR_NAND_PB(n)                ((__ilog2(n) - 5) << CSOR_NAND_PB_SHIFT)
+/* Time for Read Enable High to Output High Impedance */
+#define CSOR_NAND_TRHZ_MASK            0x0000001C
+#define CSOR_NAND_TRHZ_SHIFT           2
+#define CSOR_NAND_TRHZ_20              0x00000000
+#define CSOR_NAND_TRHZ_40              0x00000004
+#define CSOR_NAND_TRHZ_60              0x00000008
+#define CSOR_NAND_TRHZ_80              0x0000000C
+#define CSOR_NAND_TRHZ_100             0x00000010
+/* Buffer control disable */
+#define CSOR_NAND_BCTLD                        0x00000001
+
+/*
+ * Chip Select Option Register - NOR Flash Mode
+ */
+/* Enable Address shift Mode */
+#define CSOR_NOR_ADM_SHFT_MODE_EN      0x80000000
+/* Page Read Enable from NOR device */
+#define CSOR_NOR_PGRD_EN               0x10000000
+/* AVD Toggle Enable during Burst Program */
+#define CSOR_NOR_AVD_TGL_PGM_EN                0x01000000
+/* Address Data Multiplexing Shift */
+#define CSOR_NOR_ADM_MASK              0x0003E000
+#define CSOR_NOR_ADM_SHIFT_SHIFT       13
+#define CSOR_NOR_ADM_SHIFT(n)  ((n) << CSOR_NOR_ADM_SHIFT_SHIFT)
+/* Type of the NOR device hooked */
+#define CSOR_NOR_NOR_MODE_AYSNC_NOR    0x00000000
+#define CSOR_NOR_NOR_MODE_AVD_NOR      0x00000020
+/* Time for Read Enable High to Output High Impedance */
+#define CSOR_NOR_TRHZ_MASK             0x0000001C
+#define CSOR_NOR_TRHZ_SHIFT            2
+#define CSOR_NOR_TRHZ_20               0x00000000
+#define CSOR_NOR_TRHZ_40               0x00000004
+#define CSOR_NOR_TRHZ_60               0x00000008
+#define CSOR_NOR_TRHZ_80               0x0000000C
+#define CSOR_NOR_TRHZ_100              0x00000010
+/* Buffer control disable */
+#define CSOR_NOR_BCTLD                 0x00000001
+
+/*
+ * Chip Select Option Register - GPCM Mode
+ */
+/* GPCM Mode - Normal */
+#define CSOR_GPCM_GPMODE_NORMAL                0x00000000
+/* GPCM Mode - GenericASIC */
+#define CSOR_GPCM_GPMODE_ASIC          0x80000000
+/* Parity Mode odd/even */
+#define CSOR_GPCM_PARITY_EVEN          0x40000000
+/* Parity Checking enable/disable */
+#define CSOR_GPCM_PAR_EN               0x20000000
+/* GPCM Timeout Count */
+#define CSOR_GPCM_GPTO_MASK            0x0F000000
+#define CSOR_GPCM_GPTO_SHIFT           24
+#define CSOR_GPCM_GPTO(n)      ((__ilog2(n) - 8) << CSOR_GPCM_GPTO_SHIFT)
+/* GPCM External Access Termination mode for read access */
+#define CSOR_GPCM_RGETA_EXT            0x00080000
+/* GPCM External Access Termination mode for write access */
+#define CSOR_GPCM_WGETA_EXT            0x00040000
+/* Address Data Multiplexing Shift */
+#define CSOR_GPCM_ADM_MASK             0x0003E000
+#define CSOR_GPCM_ADM_SHIFT_SHIFT      13
+#define CSOR_GPCM_ADM_SHIFT(n) ((n) << CSOR_GPCM_ADM_SHIFT_SHIFT)
+/* Generic ASIC Parity error indication delay */
+#define CSOR_GPCM_GAPERRD_MASK         0x00000180
+#define CSOR_GPCM_GAPERRD_SHIFT                7
+#define CSOR_GPCM_GAPERRD(n)   (((n) - 1) << CSOR_GPCM_GAPERRD_SHIFT)
+/* Time for Read Enable High to Output High Impedance */
+#define CSOR_GPCM_TRHZ_MASK            0x0000001C
+#define CSOR_GPCM_TRHZ_20              0x00000000
+#define CSOR_GPCM_TRHZ_40              0x00000004
+#define CSOR_GPCM_TRHZ_60              0x00000008
+#define CSOR_GPCM_TRHZ_80              0x0000000C
+#define CSOR_GPCM_TRHZ_100             0x00000010
+/* Buffer control disable */
+#define CSOR_GPCM_BCTLD                        0x00000001
+
+/*
+ * Flash Timing Registers (FTIM0 - FTIM2_CSn)
+ */
+/*
+ * FTIM0 - NAND Flash Mode
+ */
+#define FTIM0_NAND                     0x7EFF3F3F
+#define FTIM0_NAND_TCCST_SHIFT 25
+#define FTIM0_NAND_TCCST(n)    ((n) << FTIM0_NAND_TCCST_SHIFT)
+#define FTIM0_NAND_TWP_SHIFT   16
+#define FTIM0_NAND_TWP(n)      ((n) << FTIM0_NAND_TWP_SHIFT)
+#define FTIM0_NAND_TWCHT_SHIFT 8
+#define FTIM0_NAND_TWCHT(n)    ((n) << FTIM0_NAND_TWCHT_SHIFT)
+#define FTIM0_NAND_TWH_SHIFT   0
+#define FTIM0_NAND_TWH(n)      ((n) << FTIM0_NAND_TWH_SHIFT)
+/*
+ * FTIM1 - NAND Flash Mode
+ */
+#define FTIM1_NAND                     0xFFFF3FFF
+#define FTIM1_NAND_TADLE_SHIFT 24
+#define FTIM1_NAND_TADLE(n)    ((n) << FTIM1_NAND_TADLE_SHIFT)
+#define FTIM1_NAND_TWBE_SHIFT  16
+#define FTIM1_NAND_TWBE(n)     ((n) << FTIM1_NAND_TWBE_SHIFT)
+#define FTIM1_NAND_TRR_SHIFT   8
+#define FTIM1_NAND_TRR(n)      ((n) << FTIM1_NAND_TRR_SHIFT)
+#define FTIM1_NAND_TRP_SHIFT   0
+#define FTIM1_NAND_TRP(n)      ((n) << FTIM1_NAND_TRP_SHIFT)
+/*
+ * FTIM2 - NAND Flash Mode
+ */
+#define FTIM2_NAND                     0x1FE1F8FF
+#define FTIM2_NAND_TRAD_SHIFT  21
+#define FTIM2_NAND_TRAD(n)     ((n) << FTIM2_NAND_TRAD_SHIFT)
+#define FTIM2_NAND_TREH_SHIFT  11
+#define FTIM2_NAND_TREH(n)     ((n) << FTIM2_NAND_TREH_SHIFT)
+#define FTIM2_NAND_TWHRE_SHIFT 0
+#define FTIM2_NAND_TWHRE(n)    ((n) << FTIM2_NAND_TWHRE_SHIFT)
+/*
+ * FTIM3 - NAND Flash Mode
+ */
+#define FTIM3_NAND                     0xFF000000
+#define FTIM3_NAND_TWW_SHIFT   24
+#define FTIM3_NAND_TWW(n)      ((n) << FTIM3_NAND_TWW_SHIFT)
+
+/*
+ * FTIM0 - NOR Flash Mode
+ */
+#define FTIM0_NOR                      0xF03F3F3F
+#define FTIM0_NOR_TACSE_SHIFT  28
+#define FTIM0_NOR_TACSE(n)     ((n) << FTIM0_NOR_TACSE_SHIFT)
+#define FTIM0_NOR_TEADC_SHIFT  16
+#define FTIM0_NOR_TEADC(n)     ((n) << FTIM0_NOR_TEADC_SHIFT)
+#define FTIM0_NOR_TAVDS_SHIFT  8
+#define FTIM0_NOR_TAVDS(n)     ((n) << FTIM0_NOR_TAVDS_SHIFT)
+#define FTIM0_NOR_TEAHC_SHIFT  0
+#define FTIM0_NOR_TEAHC(n)     ((n) << FTIM0_NOR_TEAHC_SHIFT)
+/*
+ * FTIM1 - NOR Flash Mode
+ */
+#define FTIM1_NOR                      0xFF003F3F
+#define FTIM1_NOR_TACO_SHIFT   24
+#define FTIM1_NOR_TACO(n)      ((n) << FTIM1_NOR_TACO_SHIFT)
+#define FTIM1_NOR_TRAD_NOR_SHIFT       8
+#define FTIM1_NOR_TRAD_NOR(n)  ((n) << FTIM1_NOR_TRAD_NOR_SHIFT)
+#define FTIM1_NOR_TSEQRAD_NOR_SHIFT    0
+#define FTIM1_NOR_TSEQRAD_NOR(n)       ((n) << FTIM1_NOR_TSEQRAD_NOR_SHIFT)
+/*
+ * FTIM2 - NOR Flash Mode
+ */
+#define FTIM2_NOR                      0x0F3CFCFF
+#define FTIM2_NOR_TCS_SHIFT            24
+#define FTIM2_NOR_TCS(n)       ((n) << FTIM2_NOR_TCS_SHIFT)
+#define FTIM2_NOR_TCH_SHIFT            18
+#define FTIM2_NOR_TCH(n)       ((n) << FTIM2_NOR_TCH_SHIFT)
+#define FTIM2_NOR_TWPH_SHIFT   10
+#define FTIM2_NOR_TWPH(n)      ((n) << FTIM2_NOR_TWPH_SHIFT)
+#define FTIM2_NOR_TWP_SHIFT            0
+#define FTIM2_NOR_TWP(n)       ((n) << FTIM2_NOR_TWP_SHIFT)
+
+/*
+ * FTIM0 - Normal GPCM Mode
+ */
+#define FTIM0_GPCM                     0xF03F3F3F
+#define FTIM0_GPCM_TACSE_SHIFT 28
+#define FTIM0_GPCM_TACSE(n)    ((n) << FTIM0_GPCM_TACSE_SHIFT)
+#define FTIM0_GPCM_TEADC_SHIFT 16
+#define FTIM0_GPCM_TEADC(n)    ((n) << FTIM0_GPCM_TEADC_SHIFT)
+#define FTIM0_GPCM_TAVDS_SHIFT 8
+#define FTIM0_GPCM_TAVDS(n)    ((n) << FTIM0_GPCM_TAVDS_SHIFT)
+#define FTIM0_GPCM_TEAHC_SHIFT 0
+#define FTIM0_GPCM_TEAHC(n)    ((n) << FTIM0_GPCM_TEAHC_SHIFT)
+/*
+ * FTIM1 - Normal GPCM Mode
+ */
+#define FTIM1_GPCM                     0xFF003F00
+#define FTIM1_GPCM_TACO_SHIFT  24
+#define FTIM1_GPCM_TACO(n)     ((n) << FTIM1_GPCM_TACO_SHIFT)
+#define FTIM1_GPCM_TRAD_SHIFT  8
+#define FTIM1_GPCM_TRAD(n)     ((n) << FTIM1_GPCM_TRAD_SHIFT)
+/*
+ * FTIM2 - Normal GPCM Mode
+ */
+#define FTIM2_GPCM                     0x0F3C00FF
+#define FTIM2_GPCM_TCS_SHIFT   24
+#define FTIM2_GPCM_TCS(n)      ((n) << FTIM2_GPCM_TCS_SHIFT)
+#define FTIM2_GPCM_TCH_SHIFT   18
+#define FTIM2_GPCM_TCH(n)      ((n) << FTIM2_GPCM_TCH_SHIFT)
+#define FTIM2_GPCM_TWP_SHIFT   0
+#define FTIM2_GPCM_TWP(n)      ((n) << FTIM2_GPCM_TWP_SHIFT)
+
+/*
+ * Ready Busy Status Register (RB_STAT)
+ */
+/* CSn is READY */
+#define IFC_RB_STAT_READY_CS0          0x80000000
+#define IFC_RB_STAT_READY_CS1          0x40000000
+#define IFC_RB_STAT_READY_CS2          0x20000000
+#define IFC_RB_STAT_READY_CS3          0x10000000
+
+/*
+ * General Control Register (GCR)
+ */
+#define IFC_GCR_MASK                   0x8000F800
+/* reset all IFC hardware */
+#define IFC_GCR_SOFT_RST_ALL           0x80000000
+/* Turnaroud Time of external buffer */
+#define IFC_GCR_TBCTL_TRN_TIME         0x0000F800
+#define IFC_GCR_TBCTL_TRN_TIME_SHIFT   11
+
+/*
+ * Common Event and Error Status Register (CM_EVTER_STAT)
+ */
+/* Chip select error */
+#define IFC_CM_EVTER_STAT_CSER         0x80000000
+
+/*
+ * Common Event and Error Enable Register (CM_EVTER_EN)
+ */
+/* Chip select error checking enable */
+#define IFC_CM_EVTER_EN_CSEREN         0x80000000
+
+/*
+ * Common Event and Error Interrupt Enable Register (CM_EVTER_INTR_EN)
+ */
+/* Chip select error interrupt enable */
+#define IFC_CM_EVTER_INTR_EN_CSERIREN  0x80000000
+
+/*
+ * Common Transfer Error Attribute Register-0 (CM_ERATTR0)
+ */
+/* transaction type of error Read/Write */
+#define IFC_CM_ERATTR0_ERTYP_READ      0x80000000
+#define IFC_CM_ERATTR0_ERAID           0x0FF00000
+#define IFC_CM_ERATTR0_ESRCID          0x0000FF00
+
+/*
+ * Clock Control Register (CCR)
+ */
+#define IFC_CCR_MASK                   0x0F0F8800
+/* Clock division ratio */
+#define IFC_CCR_CLK_DIV_MASK           0x0F000000
+#define IFC_CCR_CLK_DIV_SHIFT          24
+#define IFC_CCR_CLK_DIV(n)             ((n-1) << IFC_CCR_CLK_DIV_SHIFT)
+/* IFC Clock Delay */
+#define IFC_CCR_CLK_DLY_MASK           0x000F0000
+#define IFC_CCR_CLK_DLY_SHIFT          16
+#define IFC_CCR_CLK_DLY(n)             ((n) << IFC_CCR_CLK_DLY_SHIFT)
+/* Invert IFC clock before sending out */
+#define IFC_CCR_INV_CLK_EN             0x00008000
+/* Fedback IFC Clock */
+#define IFC_CCR_FB_IFC_CLK_SEL         0x00000800
+
+/*
+ * Clock Status Register (CSR)
+ */
+/* Clk is stable */
+#define IFC_CSR_CLK_STAT_STABLE                0x80000000
+
+/*
+ * IFC_NAND Machine Specific Registers
+ */
+/*
+ * NAND Configuration Register (NCFGR)
+ */
+/* Auto Boot Mode */
+#define IFC_NAND_NCFGR_BOOT            0x80000000
+/* Addressing Mode-ROW0+n/COL0 */
+#define IFC_NAND_NCFGR_ADDR_MODE_RC0   0x00000000
+/* Addressing Mode-ROW0+n/COL0+n */
+#define IFC_NAND_NCFGR_ADDR_MODE_RC1   0x00400000
+/* Number of loop iterations of FIR sequences for multi page operations */
+#define IFC_NAND_NCFGR_NUM_LOOP_MASK   0x0000F000
+#define IFC_NAND_NCFGR_NUM_LOOP_SHIFT  12
+#define IFC_NAND_NCFGR_NUM_LOOP(n)     ((n) << IFC_NAND_NCFGR_NUM_LOOP_SHIFT)
+/* Number of wait cycles */
+#define IFC_NAND_NCFGR_NUM_WAIT_MASK   0x000000FF
+#define IFC_NAND_NCFGR_NUM_WAIT_SHIFT  0
+
+/*
+ * NAND Flash Command Registers (NAND_FCR0/NAND_FCR1)
+ */
+/* General purpose FCM flash command bytes CMD0-CMD7 */
+#define IFC_NAND_FCR0_CMD0             0xFF000000
+#define IFC_NAND_FCR0_CMD0_SHIFT       24
+#define IFC_NAND_FCR0_CMD1             0x00FF0000
+#define IFC_NAND_FCR0_CMD1_SHIFT       16
+#define IFC_NAND_FCR0_CMD2             0x0000FF00
+#define IFC_NAND_FCR0_CMD2_SHIFT       8
+#define IFC_NAND_FCR0_CMD3             0x000000FF
+#define IFC_NAND_FCR0_CMD3_SHIFT       0
+#define IFC_NAND_FCR1_CMD4             0xFF000000
+#define IFC_NAND_FCR1_CMD4_SHIFT       24
+#define IFC_NAND_FCR1_CMD5             0x00FF0000
+#define IFC_NAND_FCR1_CMD5_SHIFT       16
+#define IFC_NAND_FCR1_CMD6             0x0000FF00
+#define IFC_NAND_FCR1_CMD6_SHIFT       8
+#define IFC_NAND_FCR1_CMD7             0x000000FF
+#define IFC_NAND_FCR1_CMD7_SHIFT       0
+
+/*
+ * Flash ROW and COL Address Register (ROWn, COLn)
+ */
+/* Main/spare region locator */
+#define IFC_NAND_COL_MS                        0x80000000
+/* Column Address */
+#define IFC_NAND_COL_CA_MASK           0x00000FFF
+
+/*
+ * NAND Flash Byte Count Register (NAND_BC)
+ */
+/* Byte Count for read/Write */
+#define IFC_NAND_BC                    0x000001FF
+
+/*
+ * NAND Flash Instruction Registers (NAND_FIR0/NAND_FIR1/NAND_FIR2)
+ */
+/* NAND Machine specific opcodes OP0-OP14*/
+#define IFC_NAND_FIR0_OP0              0xFC000000
+#define IFC_NAND_FIR0_OP0_SHIFT                26
+#define IFC_NAND_FIR0_OP1              0x03F00000
+#define IFC_NAND_FIR0_OP1_SHIFT                20
+#define IFC_NAND_FIR0_OP2              0x000FC000
+#define IFC_NAND_FIR0_OP2_SHIFT                14
+#define IFC_NAND_FIR0_OP3              0x00003F00
+#define IFC_NAND_FIR0_OP3_SHIFT                8
+#define IFC_NAND_FIR0_OP4              0x000000FC
+#define IFC_NAND_FIR0_OP4_SHIFT                2
+#define IFC_NAND_FIR1_OP5              0xFC000000
+#define IFC_NAND_FIR1_OP5_SHIFT                26
+#define IFC_NAND_FIR1_OP6              0x03F00000
+#define IFC_NAND_FIR1_OP6_SHIFT                20
+#define IFC_NAND_FIR1_OP7              0x000FC000
+#define IFC_NAND_FIR1_OP7_SHIFT                14
+#define IFC_NAND_FIR1_OP8              0x00003F00
+#define IFC_NAND_FIR1_OP8_SHIFT                8
+#define IFC_NAND_FIR1_OP9              0x000000FC
+#define IFC_NAND_FIR1_OP9_SHIFT                2
+#define IFC_NAND_FIR2_OP10             0xFC000000
+#define IFC_NAND_FIR2_OP10_SHIFT       26
+#define IFC_NAND_FIR2_OP11             0x03F00000
+#define IFC_NAND_FIR2_OP11_SHIFT       20
+#define IFC_NAND_FIR2_OP12             0x000FC000
+#define IFC_NAND_FIR2_OP12_SHIFT       14
+#define IFC_NAND_FIR2_OP13             0x00003F00
+#define IFC_NAND_FIR2_OP13_SHIFT       8
+#define IFC_NAND_FIR2_OP14             0x000000FC
+#define IFC_NAND_FIR2_OP14_SHIFT       2
+
+/*
+ * Instruction opcodes to be programmed
+ * in FIR registers- 6bits
+ */
+enum ifc_nand_fir_opcodes {
+       IFC_FIR_OP_NOP,
+       IFC_FIR_OP_CA0,
+       IFC_FIR_OP_CA1,
+       IFC_FIR_OP_CA2,
+       IFC_FIR_OP_CA3,
+       IFC_FIR_OP_RA0,
+       IFC_FIR_OP_RA1,
+       IFC_FIR_OP_RA2,
+       IFC_FIR_OP_RA3,
+       IFC_FIR_OP_CMD0,
+       IFC_FIR_OP_CMD1,
+       IFC_FIR_OP_CMD2,
+       IFC_FIR_OP_CMD3,
+       IFC_FIR_OP_CMD4,
+       IFC_FIR_OP_CMD5,
+       IFC_FIR_OP_CMD6,
+       IFC_FIR_OP_CMD7,
+       IFC_FIR_OP_CW0,
+       IFC_FIR_OP_CW1,
+       IFC_FIR_OP_CW2,
+       IFC_FIR_OP_CW3,
+       IFC_FIR_OP_CW4,
+       IFC_FIR_OP_CW5,
+       IFC_FIR_OP_CW6,
+       IFC_FIR_OP_CW7,
+       IFC_FIR_OP_WBCD,
+       IFC_FIR_OP_RBCD,
+       IFC_FIR_OP_BTRD,
+       IFC_FIR_OP_RDSTAT,
+       IFC_FIR_OP_NWAIT,
+       IFC_FIR_OP_WFR,
+       IFC_FIR_OP_SBRD,
+       IFC_FIR_OP_UA,
+       IFC_FIR_OP_RB,
+};
+
+/*
+ * NAND Chip Select Register (NAND_CSEL)
+ */
+#define IFC_NAND_CSEL                  0x0C000000
+#define IFC_NAND_CSEL_SHIFT            26
+#define IFC_NAND_CSEL_CS0              0x00000000
+#define IFC_NAND_CSEL_CS1              0x04000000
+#define IFC_NAND_CSEL_CS2              0x08000000
+#define IFC_NAND_CSEL_CS3              0x0C000000
+
+/*
+ * NAND Operation Sequence Start (NANDSEQ_STRT)
+ */
+/* NAND Flash Operation Start */
+#define IFC_NAND_SEQ_STRT_FIR_STRT     0x80000000
+/* Automatic Erase */
+#define IFC_NAND_SEQ_STRT_AUTO_ERS     0x00800000
+/* Automatic Program */
+#define IFC_NAND_SEQ_STRT_AUTO_PGM     0x00100000
+/* Automatic Copyback */
+#define IFC_NAND_SEQ_STRT_AUTO_CPB     0x00020000
+/* Automatic Read Operation */
+#define IFC_NAND_SEQ_STRT_AUTO_RD      0x00004000
+/* Automatic Status Read */
+#define IFC_NAND_SEQ_STRT_AUTO_STAT_RD 0x00000800
+
+/*
+ * NAND Event and Error Status Register (NAND_EVTER_STAT)
+ */
+/* Operation Complete */
+#define IFC_NAND_EVTER_STAT_OPC                0x80000000
+/* Flash Timeout Error */
+#define IFC_NAND_EVTER_STAT_FTOER      0x08000000
+/* Write Protect Error */
+#define IFC_NAND_EVTER_STAT_WPER       0x04000000
+/* ECC Error */
+#define IFC_NAND_EVTER_STAT_ECCER      0x02000000
+/* RCW Load Done */
+#define IFC_NAND_EVTER_STAT_RCW_DN     0x00008000
+/* Boot Loadr Done */
+#define IFC_NAND_EVTER_STAT_BOOT_DN    0x00004000
+/* Bad Block Indicator search select */
+#define IFC_NAND_EVTER_STAT_BBI_SRCH_SE        0x00000800
+
+/*
+ * NAND Flash Page Read Completion Event Status Register
+ * (PGRDCMPL_EVT_STAT)
+ */
+#define PGRDCMPL_EVT_STAT_MASK         0xFFFF0000
+/* Small Page 0-15 Done */
+#define PGRDCMPL_EVT_STAT_SECTION_SP(n)        (1 << (31 - (n)))
+/* Large Page(2K) 0-3 Done */
+#define PGRDCMPL_EVT_STAT_LP_2K(n)     (0xF << (28 - (n)*4))
+/* Large Page(4K) 0-1 Done */
+#define PGRDCMPL_EVT_STAT_LP_4K(n)     (0xFF << (24 - (n)*8))
+
+/*
+ * NAND Event and Error Enable Register (NAND_EVTER_EN)
+ */
+/* Operation complete event enable */
+#define IFC_NAND_EVTER_EN_OPC_EN       0x80000000
+/* Page read complete event enable */
+#define IFC_NAND_EVTER_EN_PGRDCMPL_EN  0x20000000
+/* Flash Timeout error enable */
+#define IFC_NAND_EVTER_EN_FTOER_EN     0x08000000
+/* Write Protect error enable */
+#define IFC_NAND_EVTER_EN_WPER_EN      0x04000000
+/* ECC error logging enable */
+#define IFC_NAND_EVTER_EN_ECCER_EN     0x02000000
+
+/*
+ * NAND Event and Error Interrupt Enable Register (NAND_EVTER_INTR_EN)
+ */
+/* Enable interrupt for operation complete */
+#define IFC_NAND_EVTER_INTR_OPCIR_EN           0x80000000
+/* Enable interrupt for Page read complete */
+#define IFC_NAND_EVTER_INTR_PGRDCMPLIR_EN      0x20000000
+/* Enable interrupt for Flash timeout error */
+#define IFC_NAND_EVTER_INTR_FTOERIR_EN         0x08000000
+/* Enable interrupt for Write protect error */
+#define IFC_NAND_EVTER_INTR_WPERIR_EN          0x04000000
+/* Enable interrupt for ECC error*/
+#define IFC_NAND_EVTER_INTR_ECCERIR_EN         0x02000000
+
+/*
+ * NAND Transfer Error Attribute Register-0 (NAND_ERATTR0)
+ */
+#define IFC_NAND_ERATTR0_MASK          0x0C080000
+/* Error on CS0-3 for NAND */
+#define IFC_NAND_ERATTR0_ERCS_CS0      0x00000000
+#define IFC_NAND_ERATTR0_ERCS_CS1      0x04000000
+#define IFC_NAND_ERATTR0_ERCS_CS2      0x08000000
+#define IFC_NAND_ERATTR0_ERCS_CS3      0x0C000000
+/* Transaction type of error Read/Write */
+#define IFC_NAND_ERATTR0_ERTTYPE_READ  0x00080000
+
+/*
+ * NAND Flash Status Register (NAND_FSR)
+ */
+/* First byte of data read from read status op */
+#define IFC_NAND_NFSR_RS0              0xFF000000
+/* Second byte of data read from read status op */
+#define IFC_NAND_NFSR_RS1              0x00FF0000
+
+/*
+ * ECC Error Status Registers (ECCSTAT0-ECCSTAT3)
+ */
+/* Number of ECC errors on sector n (n = 0-15) */
+#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR0_MASK  0x0F000000
+#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR0_SHIFT 24
+#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR1_MASK  0x000F0000
+#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR1_SHIFT 16
+#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR2_MASK  0x00000F00
+#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR2_SHIFT 8
+#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR3_MASK  0x0000000F
+#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR3_SHIFT 0
+#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR4_MASK  0x0F000000
+#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR4_SHIFT 24
+#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR5_MASK  0x000F0000
+#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR5_SHIFT 16
+#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR6_MASK  0x00000F00
+#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR6_SHIFT 8
+#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR7_MASK  0x0000000F
+#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR7_SHIFT 0
+#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR8_MASK  0x0F000000
+#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR8_SHIFT 24
+#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR9_MASK  0x000F0000
+#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR9_SHIFT 16
+#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR10_MASK 0x00000F00
+#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR10_SHIFT        8
+#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR11_MASK 0x0000000F
+#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR11_SHIFT        0
+#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR12_MASK 0x0F000000
+#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR12_SHIFT        24
+#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR13_MASK 0x000F0000
+#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR13_SHIFT        16
+#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR14_MASK 0x00000F00
+#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR14_SHIFT        8
+#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR15_MASK 0x0000000F
+#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR15_SHIFT        0
+
+/*
+ * NAND Control Register (NANDCR)
+ */
+#define IFC_NAND_NCR_FTOCNT_MASK       0x1E000000
+#define IFC_NAND_NCR_FTOCNT_SHIFT      25
+#define IFC_NAND_NCR_FTOCNT(n) ((_ilog2(n) - 8)  << IFC_NAND_NCR_FTOCNT_SHIFT)
+
+/*
+ * NAND_AUTOBOOT_TRGR
+ */
+/* Trigger RCW load */
+#define IFC_NAND_AUTOBOOT_TRGR_RCW_LD  0x80000000
+/* Trigget Auto Boot */
+#define IFC_NAND_AUTOBOOT_TRGR_BOOT_LD 0x20000000
+
+/*
+ * NAND_MDR
+ */
+/* 1st read data byte when opcode SBRD */
+#define IFC_NAND_MDR_RDATA0            0xFF000000
+/* 2nd read data byte when opcode SBRD */
+#define IFC_NAND_MDR_RDATA1            0x00FF0000
+
+/*
+ * NOR Machine Specific Registers
+ */
+/*
+ * NOR Event and Error Status Register (NOR_EVTER_STAT)
+ */
+/* NOR Command Sequence Operation Complete */
+#define IFC_NOR_EVTER_STAT_OPC_NOR     0x80000000
+/* Write Protect Error */
+#define IFC_NOR_EVTER_STAT_WPER                0x04000000
+/* Command Sequence Timeout Error */
+#define IFC_NOR_EVTER_STAT_STOER       0x01000000
+
+/*
+ * NOR Event and Error Enable Register (NOR_EVTER_EN)
+ */
+/* NOR Command Seq complete event enable */
+#define IFC_NOR_EVTER_EN_OPCEN_NOR     0x80000000
+/* Write Protect Error Checking Enable */
+#define IFC_NOR_EVTER_EN_WPEREN                0x04000000
+/* Timeout Error Enable */
+#define IFC_NOR_EVTER_EN_STOEREN       0x01000000
+
+/*
+ * NOR Event and Error Interrupt Enable Register (NOR_EVTER_INTR_EN)
+ */
+/* Enable interrupt for OPC complete */
+#define IFC_NOR_EVTER_INTR_OPCEN_NOR   0x80000000
+/* Enable interrupt for write protect error */
+#define IFC_NOR_EVTER_INTR_WPEREN      0x04000000
+/* Enable interrupt for timeout error */
+#define IFC_NOR_EVTER_INTR_STOEREN     0x01000000
+
+/*
+ * NOR Transfer Error Attribute Register-0 (NOR_ERATTR0)
+ */
+/* Source ID for error transaction */
+#define IFC_NOR_ERATTR0_ERSRCID                0xFF000000
+/* AXI ID for error transation */
+#define IFC_NOR_ERATTR0_ERAID          0x000FF000
+/* Chip select corresponds to NOR error */
+#define IFC_NOR_ERATTR0_ERCS_CS0       0x00000000
+#define IFC_NOR_ERATTR0_ERCS_CS1       0x00000010
+#define IFC_NOR_ERATTR0_ERCS_CS2       0x00000020
+#define IFC_NOR_ERATTR0_ERCS_CS3       0x00000030
+/* Type of transaction read/write */
+#define IFC_NOR_ERATTR0_ERTYPE_READ    0x00000001
+
+/*
+ * NOR Transfer Error Attribute Register-2 (NOR_ERATTR2)
+ */
+#define IFC_NOR_ERATTR2_ER_NUM_PHASE_EXP       0x000F0000
+#define IFC_NOR_ERATTR2_ER_NUM_PHASE_PER       0x00000F00
+
+/*
+ * NOR Control Register (NORCR)
+ */
+#define IFC_NORCR_MASK                 0x0F0F0000
+/* No. of Address/Data Phase */
+#define IFC_NORCR_NUM_PHASE_MASK       0x0F000000
+#define IFC_NORCR_NUM_PHASE_SHIFT      24
+#define IFC_NORCR_NUM_PHASE(n) ((n-1) << IFC_NORCR_NUM_PHASE_SHIFT)
+/* Sequence Timeout Count */
+#define IFC_NORCR_STOCNT_MASK          0x000F0000
+#define IFC_NORCR_STOCNT_SHIFT         16
+#define IFC_NORCR_STOCNT(n)    ((__ilog2(n) - 8) << IFC_NORCR_STOCNT_SHIFT)
+
+/*
+ * GPCM Machine specific registers
+ */
+/*
+ * GPCM Event and Error Status Register (GPCM_EVTER_STAT)
+ */
+/* Timeout error */
+#define IFC_GPCM_EVTER_STAT_TOER       0x04000000
+/* Parity error */
+#define IFC_GPCM_EVTER_STAT_PER                0x01000000
+
+/*
+ * GPCM Event and Error Enable Register (GPCM_EVTER_EN)
+ */
+/* Timeout error enable */
+#define IFC_GPCM_EVTER_EN_TOER_EN      0x04000000
+/* Parity error enable */
+#define IFC_GPCM_EVTER_EN_PER_EN       0x01000000
+
+/*
+ * GPCM Event and Error Interrupt Enable Register (GPCM_EVTER_INTR_EN)
+ */
+/* Enable Interrupt for timeout error */
+#define IFC_GPCM_EEIER_TOERIR_EN       0x04000000
+/* Enable Interrupt for Parity error */
+#define IFC_GPCM_EEIER_PERIR_EN                0x01000000
+
+/*
+ * GPCM Transfer Error Attribute Register-0 (GPCM_ERATTR0)
+ */
+/* Source ID for error transaction */
+#define IFC_GPCM_ERATTR0_ERSRCID       0xFF000000
+/* AXI ID for error transaction */
+#define IFC_GPCM_ERATTR0_ERAID         0x000FF000
+/* Chip select corresponds to GPCM error */
+#define IFC_GPCM_ERATTR0_ERCS_CS0      0x00000000
+#define IFC_GPCM_ERATTR0_ERCS_CS1      0x00000040
+#define IFC_GPCM_ERATTR0_ERCS_CS2      0x00000080
+#define IFC_GPCM_ERATTR0_ERCS_CS3      0x000000C0
+/* Type of transaction read/Write */
+#define IFC_GPCM_ERATTR0_ERTYPE_READ   0x00000001
+
+/*
+ * GPCM Transfer Error Attribute Register-2 (GPCM_ERATTR2)
+ */
+/* On which beat of address/data parity error is observed */
+#define IFC_GPCM_ERATTR2_PERR_BEAT             0x00000C00
+/* Parity Error on byte */
+#define IFC_GPCM_ERATTR2_PERR_BYTE             0x000000F0
+/* Parity Error reported in addr or data phase */
+#define IFC_GPCM_ERATTR2_PERR_DATA_PHASE       0x00000001
+
+/*
+ * GPCM Status Register (GPCM_STAT)
+ */
+#define IFC_GPCM_STAT_BSY              0x80000000  /* GPCM is busy */
+
+
+#ifndef __ASSEMBLY__
+#include <asm/io.h>
+
+extern void print_ifc_regs(void);
+extern void init_early_memctl_regs(void);
+
+#define IFC_BASE_ADDR ((struct fsl_ifc *)CONFIG_SYS_IFC_ADDR)
+
+#define get_ifc_cspr(i) (in_be32(&(IFC_BASE_ADDR)->cspr_cs[i].cspr))
+#define get_ifc_csor(i) (in_be32(&(IFC_BASE_ADDR)->csor_cs[i].csor))
+#define get_ifc_amask(i) (in_be32(&(IFC_BASE_ADDR)->amask_cs[i].amask))
+#define get_ifc_ftim(i, j) (in_be32(&(IFC_BASE_ADDR)->ftim_cs[i].ftim[j]))
+
+#define set_ifc_cspr(i, v) (out_be32(&(IFC_BASE_ADDR)->cspr_cs[i].cspr, v))
+#define set_ifc_csor(i, v) (out_be32(&(IFC_BASE_ADDR)->csor_cs[i].csor, v))
+#define set_ifc_amask(i, v) (out_be32(&(IFC_BASE_ADDR)->amask_cs[i].amask, v))
+#define set_ifc_ftim(i, j, v) \
+                       (out_be32(&(IFC_BASE_ADDR)->ftim_cs[i].ftim[j], v))
+
+#define FSL_IFC_BANK_COUNT     4
+
+enum ifc_chip_sel {
+       IFC_CS0,
+       IFC_CS1,
+       IFC_CS2,
+       IFC_CS3,
+};
+
+enum ifc_ftims {
+       IFC_FTIM0,
+       IFC_FTIM1,
+       IFC_FTIM2,
+       IFC_FTIM3,
+};
+
+/*
+ * IFC Controller NAND Machine registers
+ */
+struct fsl_ifc_nand {
+       u32 ncfgr;
+       u32 res1[0x4];
+       u32 nand_fcr0;
+       u32 nand_fcr1;
+       u32 res2[0x8];
+       u32 row0;
+       u32 res3;
+       u32 col0;
+       u32 res4;
+       u32 row1;
+       u32 res5;
+       u32 col1;
+       u32 res6;
+       u32 row2;
+       u32 res7;
+       u32 col2;
+       u32 res8;
+       u32 row3;
+       u32 res9;
+       u32 col3;
+       u32 res10[0x24];
+       u32 nand_fbcr;
+       u32 res11;
+       u32 nand_fir0;
+       u32 nand_fir1;
+       u32 nand_fir2;
+       u32 res12[0x10];
+       u32 nand_csel;
+       u32 res13;
+       u32 nandseq_strt;
+       u32 res14;
+       u32 nand_evter_stat;
+       u32 res15;
+       u32 pgrdcmpl_evt_stat;
+       u32 res16[0x2];
+       u32 nand_evter_en;
+       u32 res17[0x2];
+       u32 nand_evter_intr_en;
+       u32 res18[0x2];
+       u32 nand_erattr0;
+       u32 nand_erattr1;
+       u32 res19[0x10];
+       u32 nand_fsr;
+       u32 res20;
+       u32 nand_eccstat0;
+       u32 nand_eccstat1;
+       u32 nand_eccstat2;
+       u32 nand_eccstat3;
+       u32 res21[0x20];
+       u32 nanndcr;
+       u32 res22[0x2];
+       u32 nand_autoboot_trgr;
+       u32 res23;
+       u32 nand_mdr;
+       u32 res24[0x5C];
+};
+
+/*
+ * IFC controller NOR Machine registers
+ */
+struct fsl_ifc_nor {
+       u32 nor_evter_stat;
+       u32 res1[0x2];
+       u32 nor_evter_en;
+       u32 res2[0x2];
+       u32 nor_evter_intr_en;
+       u32 res3[0x2];
+       u32 nor_erattr0;
+       u32 nor_erattr1;
+       u32 nor_erattr2;
+       u32 res4[0x4];
+       u32 norcr;
+       u32 res5[0xEF];
+};
+
+/*
+ * IFC controller GPCM Machine registers
+ */
+struct fsl_ifc_gpcm {
+       u32 gpcm_evter_stat;
+       u32 res1[0x2];
+       u32 gpcm_evter_en;
+       u32 res2[0x2];
+       u32 gpcm_evter_intr_en;
+       u32 res3[0x2];
+       u32 gpcm_erattr0;
+       u32 gpcm_erattr1;
+       u32 gpcm_erattr2;
+       u32 gpcm_stat;
+       u32 res4[0x1F3];
+};
+
+
+/*
+ * IFC Controller Registers
+ */
+struct fsl_ifc {
+       u32 ifc_rev;
+       u32 res1[0x3];
+       struct {
+               u32 cspr;
+               u32 res2[0x2];
+       } cspr_cs[FSL_IFC_BANK_COUNT];
+       u32 res3[0x18];
+       struct {
+               u32 amask;
+               u32 res4[0x2];
+       } amask_cs[FSL_IFC_BANK_COUNT];
+       u32 res5[0x18];
+       struct {
+               u32 csor;
+               u32 res6[0x2];
+       } csor_cs[FSL_IFC_BANK_COUNT];
+       u32 res7[0x18];
+       struct {
+               u32 ftim[4];
+               u32 res8[0x8];
+       } ftim_cs[FSL_IFC_BANK_COUNT];
+       u32 res9[0x60];
+       u32 rb_stat;
+       u32 res10[0x2];
+       u32 ifc_gcr;
+       u32 res11[0x2];
+       u32 cm_evter_stat;
+       u32 res12[0x2];
+       u32 cm_evter_en;
+       u32 res13[0x2];
+       u32 cm_evter_intr_en;
+       u32 res14[0x2];
+       u32 cm_erattr0;
+       u32 cm_erattr1;
+       u32 res15[0x2];
+       u32 ifc_ccr;
+       u32 ifc_csr;
+       u32 res16[0x2EB];
+       struct fsl_ifc_nand ifc_nand;
+       struct fsl_ifc_nor ifc_nor;
+       struct fsl_ifc_gpcm ifc_gpcm;
+};
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_PPC_FSL_IFC_H */
index 6a4279ce987f39c783d0851aaa0958ec92c0133f..13caffd96e27eee4a595af054f4dde576ca4f4d5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2010 Freescale Semiconductor, Inc.
+ * Copyright 2008-2011 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
@@ -83,6 +83,7 @@ enum law_trgt_if {
        LAW_TRGT_IF_DDR_INTRLV = 0x0b,
        LAW_TRGT_IF_RIO = 0x0c,
        LAW_TRGT_IF_RIO_2 = 0x0d,
+       LAW_TRGT_IF_DPAA_SWP_SRAM = 0x0e,
        LAW_TRGT_IF_DDR = 0x0f,
        LAW_TRGT_IF_DDR_2 = 0x16,       /* 2nd controller */
 };
@@ -91,6 +92,7 @@ enum law_trgt_if {
 #define LAW_TRGT_IF_PCIX       LAW_TRGT_IF_PCI
 #define LAW_TRGT_IF_PCIE_2     LAW_TRGT_IF_PCI_2
 #define LAW_TRGT_IF_RIO_1      LAW_TRGT_IF_RIO
+#define LAW_TRGT_IF_IFC                LAW_TRGT_IF_LBC
 
 #ifdef CONFIG_MPC8641
 #define LAW_TRGT_IF_PCIE_1     LAW_TRGT_IF_PCI
index 4c17fe232e63496413833cce1117f60bc81912a7..801571f9eb56314aa8ff36a3bb7c2241e44f743b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009-2010 Freescale Semiconductor, Inc.
+ * Copyright 2009-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -70,8 +70,8 @@ extern void fdt_fixup_liodn(void *blob);
        SET_GUTS_LIODN("fsl,pq-sata-v2", liodn, sata##sataNum##liodnr,\
                CONFIG_SYS_MPC85xx_SATA##sataNum##_OFFSET)
 
-#define SET_PCI_LIODN(pciNum, liodn) \
-       SET_GUTS_LIODN("fsl,p4080-pcie", liodn, pex##pciNum##liodnr,\
+#define SET_PCI_LIODN(compat, pciNum, liodn) \
+       SET_GUTS_LIODN(compat, liodn, pex##pciNum##liodnr,\
                CONFIG_SYS_MPC85xx_PCIE##pciNum##_OFFSET)
 
 /* reg nodes for DMA start @ 0x300 */
@@ -85,13 +85,13 @@ extern void fdt_fixup_liodn(void *blob);
 
 #define SET_QMAN_LIODN(liodn) \
        SET_LIODN_ENTRY_1("fsl,qman", liodn, offsetof(ccsr_qman_t, liodnr) + \
-               CONFIG_SYS_FSL_CORENET_QMAN_OFFSET, \
-               CONFIG_SYS_FSL_CORENET_QMAN_OFFSET)
+               CONFIG_SYS_FSL_QMAN_OFFSET, \
+               CONFIG_SYS_FSL_QMAN_OFFSET)
 
 #define SET_BMAN_LIODN(liodn) \
        SET_LIODN_ENTRY_1("fsl,bman", liodn, offsetof(ccsr_bman_t, liodnr) + \
-               CONFIG_SYS_FSL_CORENET_BMAN_OFFSET, \
-               CONFIG_SYS_FSL_CORENET_BMAN_OFFSET)
+               CONFIG_SYS_FSL_BMAN_OFFSET, \
+               CONFIG_SYS_FSL_BMAN_OFFSET)
 
 #define SET_PME_LIODN(liodn) \
        SET_LIODN_ENTRY_1("fsl,pme", liodn, offsetof(ccsr_pme_t, liodnr) + \
@@ -115,8 +115,16 @@ extern void fdt_fixup_liodn(void *blob);
                FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 16), \
                CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_10G_OFFSET) \
 
+/*
+ * handle both old and new versioned SEC properties:
+ * "fsl,secX.Y" became "fsl,sec-vX.Y" during development
+ */
 #define SET_SEC_JR_LIODN_ENTRY(jrNum, liodnA, liodnB) \
        SET_LIODN_ENTRY_2("fsl,sec4.0-job-ring", liodnA, liodnB,\
+               offsetof(ccsr_sec_t, jrliodnr[jrNum].ls) + \
+               CONFIG_SYS_FSL_SEC_OFFSET, \
+               CONFIG_SYS_FSL_SEC_OFFSET + 0x1000 + 0x1000 * jrNum), \
+       SET_LIODN_ENTRY_2("fsl,sec-v4.0-job-ring", liodnA, liodnB,\
                offsetof(ccsr_sec_t, jrliodnr[jrNum].ls) + \
                CONFIG_SYS_FSL_SEC_OFFSET, \
                CONFIG_SYS_FSL_SEC_OFFSET + 0x1000 + 0x1000 * jrNum)
@@ -124,6 +132,11 @@ extern void fdt_fixup_liodn(void *blob);
 /* This is a bit evil since we treat rtic param as both a string & hex value */
 #define SET_SEC_RTIC_LIODN_ENTRY(rtic, liodnA) \
        SET_LIODN_ENTRY_1("fsl,sec4.0-rtic-memory", \
+               liodnA, \
+               offsetof(ccsr_sec_t, rticliodnr[0x##rtic-0xa].ls) + \
+               CONFIG_SYS_FSL_SEC_OFFSET, \
+               CONFIG_SYS_FSL_SEC_OFFSET + 0x6100 + 0x20 * (0x##rtic-0xa)), \
+       SET_LIODN_ENTRY_1("fsl,sec-v4.0-rtic-memory", \
                liodnA, \
                offsetof(ccsr_sec_t, rticliodnr[0x##rtic-0xa].ls) + \
                CONFIG_SYS_FSL_SEC_OFFSET, \
index 0a98bdee361e96f6b039895cc052ed9c526dee23..fc47a9f7ec8d2ed8d4d0a93a9357a96bd23629d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007,2009-2010 Freescale Semiconductor, Inc.
+ * Copyright 2007,2009-2011 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
@@ -25,6 +25,9 @@
 #include <asm/fsl_serdes.h>
 #include <pci.h>
 
+#define PEX_IP_BLK_REV_2_2     0x02080202
+#define PEX_IP_BLK_REV_2_3     0x02080203
+
 int fsl_setup_hose(struct pci_controller *hose, unsigned long addr);
 int fsl_is_pci_agent(struct pci_controller *hose);
 void fsl_pci_config_unlock(struct pci_controller *hose);
@@ -73,7 +76,8 @@ typedef struct ccsr_pci {
        u32     out_comp_to;    /* 0x00C - PCI Outbound Completion Timeout Register */
        u32     out_conf_to;    /* 0x010 - PCI Configuration Timeout Register */
        u32     config;         /* 0x014 - PCIE CONFIG Register */
-       char    res2[8];
+       u32     int_status;     /* 0x018 - PCIE interrupt status register */
+       char    res2[4];
        u32     pme_msg_det;    /* 0x020 - PCIE PME & message detect register */
        u32     pme_msg_dis;    /* 0x024 - PCIE PME & message disable register */
        u32     pme_msg_int_en; /* 0x028 - PCIE PME & message interrupt enable register */
@@ -83,8 +87,11 @@ typedef struct ccsr_pci {
        u32     block_rev2;     /* 0xbfc - PCIE Block Revision register 2 */
 
        pot_t   pot[5];         /* 0xc00 - 0xc9f Outbound ATMU's 0, 1, 2, 3, and 4 */
-       u32     res5[64];
-       pit_t   pit[3];         /* 0xda0 - 0xdff Inbound ATMU's 3, 2, and 1 */
+       u32     res5[24];
+       pit_t   pmit;           /* 0xd00 - 0xd9c Inbound ATMU's MSI */
+       u32     res6[24];
+       pit_t   pit[4];         /* 0xd80 - 0xdff Inbound ATMU's 3, 2, 1 and 0 */
+
 #define PIT3 0
 #define PIT2 1
 #define PIT1 2
@@ -158,6 +165,11 @@ typedef struct ccsr_pci {
        u32     pdb_stat;       /* 0xf00 - PCIE Debug Status */
        char    res24[252];
 } ccsr_fsl_pci_t;
+#define PCIE_CONFIG_PC 0x00020000
+#define PCIE_CONFIG_OB_CK      0x00002000
+#define PCIE_CONFIG_SAC        0x00000010
+#define PCIE_CONFIG_SP 0x80000002
+#define PCIE_CONFIG_SCC        0x80000001
 
 struct fsl_pci_info {
        unsigned long regs;
@@ -218,7 +230,9 @@ int fsl_pcie_init_board(int busno);
 #define FT_FSL_PCIE3_SETUP __FT_FSL_PCIE_SETUP(blob, FSL_PCIE_COMPAT, 3)
 #define FT_FSL_PCIE4_SETUP __FT_FSL_PCIE_SETUP(blob, FSL_PCIE_COMPAT, 4)
 
-#if defined(CONFIG_FSL_CORENET)
+#if !defined(CONFIG_PCI)
+#define FT_FSL_PCI_SETUP
+#elif defined(CONFIG_FSL_CORENET)
 #define FSL_PCIE_COMPAT        "fsl,p4080-pcie"
 #define FT_FSL_PCI_SETUP \
        FT_FSL_PCIE1_SETUP; \
index cb32927a83ebff78c93d25e2630b19eb51457d2c..e1c1212c388b758c1b9f2f08ae7aaf3f151a4af4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009-2010 Freescale Semiconductor, Inc.
+ * Copyright 2009-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -51,6 +51,7 @@ extern int get_dpaa_liodn(enum fsl_dpaa_dev dpaa_dev,
                          u32 *liodns, int liodn_offset);
 extern void setup_portals(void);
 extern void fdt_fixup_qportals(void *blob);
+extern void fdt_fixup_bportals(void *blob);
 
 extern struct qportal_info qp_info[];
 extern void fdt_portal(void *blob, const char *compat, const char *container,
index 85518eb6e71292d9303d023db20367f48cee5a5c..0f31af1db320e8d9272eaefd8dbf9446a8b546a2 100644 (file)
@@ -53,4 +53,11 @@ enum srds_prtcl {
 int is_serdes_configured(enum srds_prtcl device);
 void fsl_serdes_init(void);
 
+#ifdef CONFIG_FSL_CORENET
+int serdes_get_first_lane(enum srds_prtcl device);
+#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
+void serdes_reset_rx(enum srds_prtcl device);
+#endif
+#endif
+
 #endif /* __FSL_SERDES_H */
index 6bd83ba166137f385fa6de3528750b44bbfdac0f..f85cee270fcaecdbde743f02973dc5277d1e09da 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/types.h>
 #include <asm/fsl_dma.h>
 #include <asm/fsl_i2c.h>
+#include <asm/fsl_ifc.h>
 #include <asm/fsl_lbc.h>
 #include <asm/fsl_fman.h>
 
@@ -1864,8 +1865,13 @@ typedef struct ccsr_gur {
 #define MPC85xx_PORBMSR_HA_SHIFT       16
        u32     porimpscr;      /* POR I/O impedance status & control */
        u32     pordevsr;       /* POR I/O device status regsiter */
+#if defined(CONFIG_P1017) || defined(CONFIG_P1023)
+#define MPC85xx_PORDEVSR_SGMII1_DIS    0x10000000
+#define MPC85xx_PORDEVSR_SGMII2_DIS    0x08000000
+#else
 #define MPC85xx_PORDEVSR_SGMII1_DIS    0x20000000
 #define MPC85xx_PORDEVSR_SGMII2_DIS    0x10000000
+#endif
 #define MPC85xx_PORDEVSR_SGMII3_DIS    0x08000000
 #define MPC85xx_PORDEVSR_SGMII4_DIS    0x04000000
 #define MPC85xx_PORDEVSR_SRDS2_IO_SEL  0x38000000
@@ -1873,9 +1879,17 @@ typedef struct ccsr_gur {
 #if defined(CONFIG_P1013) || defined(CONFIG_P1022)
 #define MPC85xx_PORDEVSR_IO_SEL                0x007c0000
 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT  18
+#elif defined(CONFIG_P1017) || defined(CONFIG_P1023)
+#define MPC85xx_PORDEVSR_IO_SEL                0x00600000
+#define MPC85xx_PORDEVSR_IO_SEL_SHIFT  21
+#else
+#if defined(CONFIG_P1010)
+#define MPC85xx_PORDEVSR_IO_SEL                0x00600000
+#define MPC85xx_PORDEVSR_IO_SEL_SHIFT  21
 #else
 #define MPC85xx_PORDEVSR_IO_SEL                0x00780000
 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT  19
+#endif /* if defined(CONFIG_P1010) */
 #endif
 #define MPC85xx_PORDEVSR_PCI2_ARB      0x00040000
 #define MPC85xx_PORDEVSR_PCI1_ARB      0x00020000
@@ -1906,10 +1920,106 @@ typedef struct ccsr_gur {
        u32     gpindr;         /* General-purpose input data */
        u8      res5[12];
        u32     pmuxcr;         /* Alt. function signal multiplex control */
+#if defined(CONFIG_P1010) || defined(CONFIG_P1014)
+#define MPC85xx_PMUXCR_TSEC1_0_1588            0x40000000
+#define MPC85xx_PMUXCR_TSEC1_0_RES             0xC0000000
+#define MPC85xx_PMUXCR_TSEC1_1_1588_TRIG       0x10000000
+#define MPC85xx_PMUXCR_TSEC1_1_GPIO_12         0x20000000
+#define MPC85xx_PMUXCR_TSEC1_1_RES             0x30000000
+#define MPC85xx_PMUXCR_TSEC1_2_DMA             0x04000000
+#define MPC85xx_PMUXCR_TSEC1_2_GPIO            0x08000000
+#define MPC85xx_PMUXCR_TSEC1_2_RES             0x0C000000
+#define MPC85xx_PMUXCR_TSEC1_3_RES             0x01000000
+#define MPC85xx_PMUXCR_TSEC1_3_GPIO_15         0x02000000
+#define MPC85xx_PMUXCR_IFC_ADDR16_SDHC         0x00400000
+#define MPC85xx_PMUXCR_IFC_ADDR16_USB          0x00800000
+#define MPC85xx_PMUXCR_IFC_ADDR16_IFC_CS2      0x00C00000
+#define MPC85xx_PMUXCR_IFC_ADDR17_18_SDHC      0x00100000
+#define MPC85xx_PMUXCR_IFC_ADDR17_18_USB       0x00200000
+#define MPC85xx_PMUXCR_IFC_ADDR17_18_DMA       0x00300000
+#define MPC85xx_PMUXCR_IFC_ADDR19_SDHC_DATA    0x00040000
+#define MPC85xx_PMUXCR_IFC_ADDR19_USB          0x00080000
+#define MPC85xx_PMUXCR_IFC_ADDR19_DMA          0x000C0000
+#define MPC85xx_PMUXCR_IFC_ADDR20_21_SDHC_DATA 0x00010000
+#define MPC85xx_PMUXCR_IFC_ADDR20_21_USB       0x00020000
+#define MPC85xx_PMUXCR_IFC_ADDR20_21_RES       0x00030000
+#define MPC85xx_PMUXCR_IFC_ADDR22_SDHC         0x00004000
+#define MPC85xx_PMUXCR_IFC_ADDR22_USB          0x00008000
+#define MPC85xx_PMUXCR_IFC_ADDR22_RES          0x0000C000
+#define MPC85xx_PMUXCR_IFC_ADDR23_SDHC         0x00001000
+#define MPC85xx_PMUXCR_IFC_ADDR23_USB          0x00002000
+#define MPC85xx_PMUXCR_IFC_ADDR23_RES          0x00003000
+#define MPC85xx_PMUXCR_IFC_ADDR24_SDHC         0x00000400
+#define MPC85xx_PMUXCR_IFC_ADDR24_USB          0x00000800
+#define MPC85xx_PMUXCR_IFC_ADDR24_RES          0x00000C00
+#define MPC85xx_PMUXCR_IFC_PAR_PERR_RES                0x00000300
+#define MPC85xx_PMUXCR_IFC_PAR_PERR_USB                0x00000200
+#define MPC85xx_PMUXCR_LCLK_RES                        0x00000040
+#define MPC85xx_PMUXCR_LCLK_USB                        0x00000080
+#define MPC85xx_PMUXCR_LCLK_IFC_CS3            0x000000C0
+#define MPC85xx_PMUXCR_SPI_RES                 0x00000030
+#define MPC85xx_PMUXCR_SPI_GPIO                        0x00000020
+#define MPC85xx_PMUXCR_CAN1_UART               0x00000004
+#define MPC85xx_PMUXCR_CAN1_TDM                        0x00000008
+#define MPC85xx_PMUXCR_CAN1_RES                        0x0000000C
+#define MPC85xx_PMUXCR_CAN2_UART               0x00000001
+#define MPC85xx_PMUXCR_CAN2_TDM                        0x00000002
+#define MPC85xx_PMUXCR_CAN2_RES                        0x00000003
+#endif
 #define MPC85xx_PMUXCR_SD_DATA         0x80000000
 #define MPC85xx_PMUXCR_SDHC_CD         0x40000000
 #define MPC85xx_PMUXCR_SDHC_WP         0x20000000
+#define MPC85xx_PMUXCR_ELBC_OFF_USB2_ON        0x01000000
+#define MPC85xx_PMUXCR_TDM_ENA         0x00800000
+#define MPC85xx_PMUXCR_QE0             0x00008000
+#define MPC85xx_PMUXCR_QE1             0x00004000
+#define MPC85xx_PMUXCR_QE2             0x00002000
+#define MPC85xx_PMUXCR_QE3             0x00001000
+#define MPC85xx_PMUXCR_QE4             0x00000800
+#define MPC85xx_PMUXCR_QE5             0x00000400
+#define MPC85xx_PMUXCR_QE6             0x00000200
+#define MPC85xx_PMUXCR_QE7             0x00000100
+#define MPC85xx_PMUXCR_QE8             0x00000080
+#define MPC85xx_PMUXCR_QE9             0x00000040
+#define MPC85xx_PMUXCR_QE10            0x00000020
+#define MPC85xx_PMUXCR_QE11            0x00000010
+#define MPC85xx_PMUXCR_QE12            0x00000008
+#if defined(CONFIG_P1013) || defined(CONFIG_P1022)
+#define MPC85xx_PMUXCR_TDM_MASK                0x0001cc00
+#define MPC85xx_PMUXCR_TDM             0x00014800
+#define MPC85xx_PMUXCR_SPI_MASK                0x00600000
+#define MPC85xx_PMUXCR_SPI             0x00000000
+#endif
        u32     pmuxcr2;        /* Alt. function signal multiplex control 2 */
+#if defined(CONFIG_P1010) || defined(CONFIG_P1014)
+#define MPC85xx_PMUXCR2_UART_GPIO              0x40000000
+#define MPC85xx_PMUXCR2_UART_TDM               0x80000000
+#define MPC85xx_PMUXCR2_UART_RES               0xC0000000
+#define MPC85xx_PMUXCR2_IRQ2_TRIG_IN           0x10000000
+#define MPC85xx_PMUXCR2_IRQ2_RES               0x30000000
+#define MPC85xx_PMUXCR2_IRQ3_SRESET            0x04000000
+#define MPC85xx_PMUXCR2_IRQ3_RES               0x0C000000
+#define MPC85xx_PMUXCR2_GPIO01_DRVVBUS         0x01000000
+#define MPC85xx_PMUXCR2_GPIO01_RES             0x03000000
+#define MPC85xx_PMUXCR2_GPIO23_CKSTP           0x00400000
+#define MPC85xx_PMUXCR2_GPIO23_RES             0x00800000
+#define MPC85xx_PMUXCR2_GPIO23_USB             0x00C00000
+#define MPC85xx_PMUXCR2_GPIO4_MCP              0x00100000
+#define MPC85xx_PMUXCR2_GPIO4_RES              0x00200000
+#define MPC85xx_PMUXCR2_GPIO4_CLK_OUT          0x00300000
+#define MPC85xx_PMUXCR2_GPIO5_UDE              0x00040000
+#define MPC85xx_PMUXCR2_GPIO5_RES              0x00080000
+#define MPC85xx_PMUXCR2_READY_ASLEEP           0x00020000
+#define MPC85xx_PMUXCR2_DDR_ECC_MUX            0x00010000
+#define MPC85xx_PMUXCR2_DEBUG_PORT_EXPOSE      0x00008000
+#define MPC85xx_PMUXCR2_POST_EXPOSE            0x00004000
+#define MPC85xx_PMUXCR2_DEBUG_MUX_SEL_USBPHY   0x00002000
+#define MPC85xx_PMUXCR2_PLL_LKDT_EXPOSE                0x00001000
+#endif
+#if defined(CONFIG_P1013) || defined(CONFIG_P1022)
+#define MPC85xx_PMUXCR2_ETSECUSB_MASK  0x001f1000
+#define MPC85xx_PMUXCR2_USB            0x00150000
+#endif
        u8      res6[8];
        u32     devdisr;        /* Device disable control */
 #define MPC85xx_DEVDISR_PCI1           0x80000000
@@ -1942,32 +2052,43 @@ typedef struct ccsr_gur {
        u8      res9[12];
        u32     pvr;            /* Processor version */
        u32     svr;            /* System version */
-       u8      res10a[8];
+       u8      res10[8];
        u32     rstcr;          /* Reset control */
 #if defined(CONFIG_MPC8568)||defined(CONFIG_MPC8569)
-       u8      res10b[76];
+       u8      res11a[76];
        par_io_t qe_par_io[7];
-       u8      res10c[1600];
+       u8      res11b[1600];
+#elif defined(CONFIG_P1012) || defined(CONFIG_P1016) || \
+      defined(CONFIG_P1021) || defined(CONFIG_P1025)
+       u8      res11a[12];
+       u32     iovselsr;
+       u8      res11b[60];
+       par_io_t qe_par_io[3];
+       u8      res11c[1496];
 #else
-       u8      res10b[1868];
+       u8      res11a[1868];
 #endif
        u32     clkdvdr;        /* Clock Divide register */
-       u8      res10d[1532];
+       u8      res12[1532];
        u32     clkocr;         /* Clock out select */
-       u8      res11[12];
+       u8      res13[12];
        u32     ddrdllcr;       /* DDR DLL control */
-       u8      res12[12];
+       u8      res14[12];
        u32     lbcdllcr;       /* LBC DLL control */
-       u8      res13[248];
+       u8      res15[248];
        u32     lbiuiplldcr0;   /* LBIU PLL Debug Reg 0 */
        u32     lbiuiplldcr1;   /* LBIU PLL Debug Reg 1 */
        u32     ddrioovcr;      /* DDR IO Override Control */
        u32     tsec12ioovcr;   /* eTSEC 1/2 IO override control */
        u32     tsec34ioovcr;   /* eTSEC 3/4 IO override control */
-       u8      res15[61648];
+       u8      res16[52];
+       u32     sdhcdcr;        /* SDHC debug control register */
+       u8      res17[61592];
 } ccsr_gur_t;
 #endif
 
+#define SDHCDCR_CD_INV         0x80000000 /* invert SDHC card detect */
+
 typedef struct serdes_corenet {
        struct {
                u32     rstctl; /* Reset Control Register */
@@ -1980,6 +2101,7 @@ typedef struct serdes_corenet {
 #define SRDS_PLLCR0_RFCK_SEL_100       0x00000000
 #define SRDS_PLLCR0_RFCK_SEL_125       0x10000000
 #define SRDS_PLLCR0_RFCK_SEL_156_25    0x20000000
+#define SRDS_PLLCR0_RFCK_SEL_150       0x30000000
 #define SRDS_PLLCR0_FRATE_SEL_MASK     0x00030000
 #define SRDS_PLLCR0_FRATE_SEL_5                0x00000000
 #define SRDS_PLLCR0_FRATE_SEL_6_25     0x00010000
@@ -2016,6 +2138,9 @@ typedef struct serdes_corenet {
 #define SRDS_TECR0_TEQ_TYPE_2LVL       0x10000000
                u32     res3;
                u32     ttlcr0; /* Transition Tracking Loop Ctrl 0 */
+#define SRDS_TTLCR0_FLT_SEL_MASK       0x3f000000
+#define SRDS_TTLCR0_FLT_SEL_750PPM     0x03000000
+#define SRDS_TTLCR0_PM_DIS             0x00004000
                u32     res4[7];
        } lane[24];
        u32 res6[384];
@@ -2164,6 +2289,13 @@ typedef struct ccsr_pme {
        u8      res4[0x400];
 } ccsr_pme_t;
 
+typedef struct ccsr_usb_phy {
+       u8      res0[0x18];
+       u32     usb_enable_override;
+       u8      res[0xe4];
+} ccsr_usb_phy_t;
+#define CONFIG_SYS_FSL_USB_ENABLE_OVERRIDE 1
+
 #ifdef CONFIG_FSL_CORENET
 #define CONFIG_SYS_FSL_CORENET_CCM_OFFSET      0x0000
 #define CONFIG_SYS_MPC85xx_DDR_OFFSET          0x8000
@@ -2186,12 +2318,14 @@ typedef struct ccsr_pme {
 #define CONFIG_SYS_MPC85xx_USB1_OFFSET         0x210000
 #define CONFIG_SYS_MPC85xx_USB2_OFFSET         0x211000
 #define CONFIG_SYS_MPC85xx_USB_OFFSET          CONFIG_SYS_MPC85xx_USB1_OFFSET
+#define CONFIG_SYS_MPC85xx_USB1_PHY_OFFSET 0x214000
+#define CONFIG_SYS_MPC85xx_USB2_PHY_OFFSET 0x214100
 #define CONFIG_SYS_MPC85xx_SATA1_OFFSET                0x220000
 #define CONFIG_SYS_MPC85xx_SATA2_OFFSET                0x221000
 #define CONFIG_SYS_FSL_SEC_OFFSET              0x300000
 #define CONFIG_SYS_FSL_CORENET_PME_OFFSET      0x316000
-#define CONFIG_SYS_FSL_CORENET_QMAN_OFFSET     0x318000
-#define CONFIG_SYS_FSL_CORENET_BMAN_OFFSET     0x31a000
+#define CONFIG_SYS_FSL_QMAN_OFFSET             0x318000
+#define CONFIG_SYS_FSL_BMAN_OFFSET             0x31a000
 #define CONFIG_SYS_FSL_FM1_OFFSET              0x400000
 #define CONFIG_SYS_FSL_FM1_RX0_1G_OFFSET       0x488000
 #define CONFIG_SYS_FSL_FM1_RX1_1G_OFFSET       0x489000
@@ -2227,6 +2361,7 @@ typedef struct ccsr_pme {
 #define CONFIG_SYS_MPC85xx_GPIO_OFFSET         0xF000
 #define CONFIG_SYS_MPC85xx_SATA1_OFFSET                0x18000
 #define CONFIG_SYS_MPC85xx_SATA2_OFFSET                0x19000
+#define CONFIG_SYS_MPC85xx_IFC_OFFSET          0x1e000
 #define CONFIG_SYS_MPC85xx_L2_OFFSET           0x20000
 #define CONFIG_SYS_MPC85xx_DMA_OFFSET          0x21000
 #define CONFIG_SYS_MPC85xx_USB_OFFSET          0x22000
@@ -2240,6 +2375,12 @@ typedef struct ccsr_pme {
 #define CONFIG_SYS_MPC85xx_SERDES2_OFFSET      0xE3100
 #define CONFIG_SYS_MPC85xx_SERDES1_OFFSET      0xE3000
 #define CONFIG_SYS_MPC85xx_CPM_OFFSET          0x80000
+#define CONFIG_SYS_FSL_QMAN_OFFSET             0x88000
+#define CONFIG_SYS_FSL_BMAN_OFFSET             0x8a000
+#define CONFIG_SYS_FSL_FM1_OFFSET              0x100000
+#define CONFIG_SYS_FSL_FM1_RX0_1G_OFFSET       0x188000
+#define CONFIG_SYS_FSL_FM1_RX1_1G_OFFSET       0x189000
+#define CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET       0x1e0000
 #endif
 
 #define CONFIG_SYS_MPC85xx_PIC_OFFSET          0x40000
@@ -2247,10 +2388,10 @@ typedef struct ccsr_pme {
 
 #define CONFIG_SYS_FSL_CPC_ADDR        \
        (CONFIG_SYS_CCSRBAR + CONFIG_SYS_FSL_CPC_OFFSET)
-#define CONFIG_SYS_FSL_CORENET_QMAN_ADDR \
-       (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_QMAN_OFFSET)
-#define CONFIG_SYS_FSL_CORENET_BMAN_ADDR \
-       (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_BMAN_OFFSET)
+#define CONFIG_SYS_FSL_QMAN_ADDR \
+       (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_QMAN_OFFSET)
+#define CONFIG_SYS_FSL_BMAN_ADDR \
+       (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_BMAN_OFFSET)
 #define CONFIG_SYS_FSL_CORENET_PME_ADDR \
        (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_PME_OFFSET)
 #define CONFIG_SYS_MPC85xx_GUTS_ADDR \
@@ -2269,6 +2410,8 @@ typedef struct ccsr_pme {
        (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_DDR2_OFFSET)
 #define CONFIG_SYS_LBC_ADDR \
        (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_LBC_OFFSET)
+#define CONFIG_SYS_IFC_ADDR \
+       (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_IFC_OFFSET)
 #define CONFIG_SYS_MPC85xx_ESPI_ADDR \
        (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_ESPI_OFFSET)
 #define CONFIG_SYS_MPC85xx_PCIX_ADDR \
@@ -2299,6 +2442,10 @@ typedef struct ccsr_pme {
        (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES_OFFSET)
 #define CONFIG_SYS_MPC85xx_USB_ADDR \
        (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB_OFFSET)
+#define CONFIG_SYS_MPC85xx_USB1_PHY_ADDR \
+       (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB1_PHY_OFFSET)
+#define CONFIG_SYS_MPC85xx_USB2_PHY_ADDR \
+       (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB2_PHY_OFFSET)
 #define CONFIG_SYS_FSL_SEC_ADDR \
        (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_SEC_OFFSET)
 #define CONFIG_SYS_FSL_FM1_ADDR \
index 531cfc891d74e13e8b147c7e69ff3f41681b3b89..9be9dca1f7349b0596a04f55961f81038041ed0f 100644 (file)
@@ -3,7 +3,7 @@
  * The Internal Memory Map for devices with QE on them. This
  * is the superset of all QE devices (8360, etc.).
  *
- * Copyright (c) 2006-2009 Freescale Semiconductor, Inc.
+ * Copyright (c) 2006-2009, 2011 Freescale Semiconductor, Inc.
  * Author: Shlomi Gridih <gridish@freescale.com>
  *
  * This program is free software; you can redistribute  it and/or modify it
 #ifndef __IMMAP_QE_H__
 #define __IMMAP_QE_H__
 
-/* QE I-RAM
-*/
+#ifdef CONFIG_MPC83xx
+#if defined(CONFIG_MPC8360)
+#define QE_MURAM_SIZE          0xc000UL
+#define MAX_QE_RISC            2
+#define QE_NUM_OF_SNUM         28
+#elif defined(CONFIG_MPC832x)
+#define QE_MURAM_SIZE          0x4000UL
+#define MAX_QE_RISC            1
+#define QE_NUM_OF_SNUM         28
+#endif
+#endif
+
+/* QE I-RAM */
 typedef struct qe_iram {
        u32 iadd;               /* I-RAM Address Register */
        u32 idata;              /* I-RAM Data Register    */
@@ -25,8 +36,7 @@ typedef struct qe_iram {
        u8 res1[0x70];
 } __attribute__ ((packed)) qe_iram_t;
 
-/* QE Interrupt Controller
-*/
+/* QE Interrupt Controller */
 typedef struct qe_ic {
        u32 qicr;
        u32 qivec;
@@ -49,8 +59,7 @@ typedef struct qe_ic {
        u8 res3[0x1C];
 } __attribute__ ((packed)) qe_ic_t;
 
-/* Communications Processor
-*/
+/* Communications Processor */
 typedef struct cp_qe {
        u32 cecr;               /* QE command register */
        u32 ceccr;              /* QE controller configuration register */
@@ -87,8 +96,7 @@ typedef struct cp_qe {
        u8 res13[0x280];
 } __attribute__ ((packed)) cp_qe_t;
 
-/* QE Multiplexer
-*/
+/* QE Multiplexer */
 typedef struct qe_mux {
        u32 cmxgcr;             /* CMX general clock route register    */
        u32 cmxsi1cr_l;         /* CMX SI1 clock route low register    */
@@ -102,8 +110,7 @@ typedef struct qe_mux {
        u8 res0[0x1C];
 } __attribute__ ((packed)) qe_mux_t;
 
-/* QE Timers
-*/
+/* QE Timers */
 typedef struct qe_timers {
        u8 gtcfr1;              /* Timer 1 2 global configuration register */
        u8 res0[0x3];
@@ -133,8 +140,7 @@ typedef struct qe_timers {
        u8 res2[0x46];
 } __attribute__ ((packed)) qe_timers_t;
 
-/* BRG
-*/
+/* BRG */
 typedef struct qe_brg {
        u32 brgc1;              /* BRG1 configuration register  */
        u32 brgc2;              /* BRG2 configuration register  */
@@ -155,8 +161,7 @@ typedef struct qe_brg {
        u8 res0[0x40];
 } __attribute__ ((packed)) qe_brg_t;
 
-/* SPI
-*/
+/* SPI */
 typedef struct spi {
        u8 res0[0x20];
        u32 spmode;             /* SPI mode register */
@@ -174,8 +179,7 @@ typedef struct spi {
        u8 res7[0x8];
 } __attribute__ ((packed)) spi_t;
 
-/* SI
-*/
+/* SI */
 typedef struct si1 {
        u16 siamr1;             /* SI1 TDMA mode register */
        u16 sibmr1;             /* SI1 TDMB mode register */
@@ -222,16 +226,14 @@ typedef struct si1 {
        u8 res9[0xBB];
 } __attribute__ ((packed)) si1_t;
 
-/* SI Routing Tables
-*/
+/* SI Routing Tables */
 typedef struct sir {
        u8 tx[0x400];
        u8 rx[0x400];
        u8 res0[0x800];
 } __attribute__ ((packed)) sir_t;
 
-/* USB Controller.
-*/
+/* USB Controller.  */
 typedef struct usb_ctlr {
        u8 usb_usmod;
        u8 usb_usadr;
@@ -253,8 +255,7 @@ typedef struct usb_ctlr {
        u8 res6[0x22];
 } __attribute__ ((packed)) usb_t;
 
-/* MCC
-*/
+/* MCC */
 typedef struct mcc {
        u32 mcce;               /* MCC event register */
        u32 mccm;               /* MCC mask register */
@@ -263,8 +264,7 @@ typedef struct mcc {
        u8 res0[0xF0];
 } __attribute__ ((packed)) mcc_t;
 
-/* QE UCC Slow
-*/
+/* QE UCC Slow */
 typedef struct ucc_slow {
        u32 gumr_l;             /* UCCx general mode register (low) */
        u32 gumr_h;             /* UCCx general mode register (high) */
@@ -368,8 +368,7 @@ typedef struct ucc_ethernet {
        u8 res5[0x200 - 0x1c4];
 } __attribute__ ((packed)) uec_t;
 
-/* QE UCC Fast
-*/
+/* QE UCC Fast */
 typedef struct ucc_fast {
        u32 gumr;               /* UCCx general mode register */
        u32 upsmr;              /* UCCx protocol-specific mode register  */
@@ -403,8 +402,7 @@ typedef struct ucc_fast {
        uec_t ucc_eth;
 } __attribute__ ((packed)) ucc_fast_t;
 
-/* QE UCC
-*/
+/* QE UCC */
 typedef struct ucc_common {
        u8 res1[0x90];
        u8 guemr;
@@ -419,8 +417,7 @@ typedef struct ucc {
        };
 } __attribute__ ((packed)) ucc_t;
 
-/* MultiPHY UTOPIA POS Controllers (UPC)
-*/
+/* MultiPHY UTOPIA POS Controllers (UPC) */
 typedef struct upc {
        u32 upgcr;              /* UTOPIA/POS general configuration register */
        u32 uplpa;              /* UTOPIA/POS last PHY address */
@@ -476,8 +473,7 @@ typedef struct upc {
        u8 res2[0x150];
 } __attribute__ ((packed)) upc_t;
 
-/* SDMA
-*/
+/* SDMA */
 typedef struct sdma {
        u32 sdsr;               /* Serial DMA status register */
        u32 sdmr;               /* Serial DMA mode register */
@@ -497,8 +493,7 @@ typedef struct sdma {
        u8 res2[0x38];
 } __attribute__ ((packed)) sdma_t;
 
-/* Debug Space
-*/
+/* Debug Space */
 typedef struct dbg {
        u32 bpdcr;              /* Breakpoint debug command register */
        u32 bpdsr;              /* Breakpoint debug status register */
@@ -582,40 +577,9 @@ typedef struct qe_immap {
        u8 res14[0x300];
        u8 res15[0x3A00];
        u8 res16[0x8000];       /* 0x108000 -  0x110000 */
-#if defined(CONFIG_MPC8568)
-       u8 muram[0x10000];      /* 0x1_0000 -  0x2_0000 Multi-user RAM */
-       u8 res17[0x20000];      /* 0x2_0000 -  0x4_0000 */
-#elif defined(CONFIG_MPC8569)
-       u8 muram[0x20000];      /* 0x1_0000 -  0x3_0000 Multi-user RAM */
-       u8 res17[0x10000];      /* 0x3_0000 -  0x4_0000 */
-#else
-       u8 muram[0xC000];       /* 0x110000 -  0x11C000 Multi-user RAM */
-       u8 res17[0x24000];      /* 0x11C000 -  0x140000 */
-       u8 res18[0xC0000];      /* 0x140000 -  0x200000 */
-#endif
+       u8 muram[QE_MURAM_SIZE];
 } __attribute__ ((packed)) qe_map_t;
 
 extern qe_map_t *qe_immr;
 
-#if defined(CONFIG_MPC8568)
-#define QE_MURAM_SIZE          0x10000UL
-#elif defined(CONFIG_MPC8569)
-#define QE_MURAM_SIZE          0x20000UL
-#elif defined(CONFIG_MPC8360)
-#define QE_MURAM_SIZE          0xc000UL
-#elif defined(CONFIG_MPC832x)
-#define QE_MURAM_SIZE          0x4000UL
-#endif
-
-#if defined(CONFIG_MPC8323)
-#define MAX_QE_RISC     1
-#define QE_NUM_OF_SNUM 28
-#elif defined(CONFIG_MPC8569)
-#define MAX_QE_RISC     4
-#define QE_NUM_OF_SNUM 46
-#else
-#define MAX_QE_RISC    2
-#define QE_NUM_OF_SNUM 28
-#endif
-
 #endif                         /* __IMMAP_QE_H__ */
index 4ddad26e8180aba7f9052a13c08699588b902d32..56ac9fe6c534b2f08d69ac0b3610252bd8b60a7b 100644 (file)
@@ -175,7 +175,10 @@ extern inline int in_8(const volatile unsigned char __iomem *addr)
 
 extern inline void out_8(volatile unsigned char __iomem *addr, int val)
 {
-       __asm__ __volatile__("stb%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
+       __asm__ __volatile__("sync;\n"
+                            "stb%U0%X0 %1,%0;\n"
+                            : "=m" (*addr)
+                            : "r" (val));
 }
 
 extern inline int in_le16(const volatile unsigned short __iomem *addr)
index fcee1a2428510045e7933a410da4717ea06b309a..f5bf4dd4fd40af7884ce79e50c10e96ddec5fba4 100644 (file)
 #define SVR_P1013_E    0x80EF00
 #define SVR_P1014      0x80F101
 #define SVR_P1014_E    0x80F901
+#define SVR_P1015      0x80E502
+#define SVR_P1015_E    0x80ED02
+#define SVR_P1016      0x80E503
+#define SVR_P1016_E    0x80ED03
+#define SVR_P1017      0x80F700
+#define SVR_P1017_E    0x80FF00
 #define SVR_P1020      0x80E400
 #define SVR_P1020_E    0x80EC00
 #define SVR_P1021      0x80E401
 #define SVR_P1021_E    0x80EC01
 #define SVR_P1022      0x80E600
 #define SVR_P1022_E    0x80EE00
+#define SVR_P1023      0x80F600
+#define SVR_P1023_E    0x80FE00
+#define SVR_P1024      0x80E402
+#define SVR_P1024_E    0x80EC02
+#define SVR_P1025      0x80E403
+#define SVR_P1025_E    0x80EC03
 #define SVR_P2010      0x80E300
 #define SVR_P2010_E    0x80EB00
 #define SVR_P2020      0x80E200
index 4719f8c6967a4761dd28cae35b9df9f040e70db4..aaa5add1fa5bc4bda439ee5430f655747640fbb9 100644 (file)
@@ -186,6 +186,12 @@ int __board_flash_wp_on(void)
 }
 int board_flash_wp_on(void) __attribute__((weak, alias("__board_flash_wp_on")));
 
+void __cpu_secondary_init_r(void)
+{
+}
+void cpu_secondary_init_r(void)
+__attribute__((weak, alias("__cpu_secondary_init_r")));
+
 static int init_func_ram (void)
 {
 #ifdef CONFIG_BOARD_TYPES
@@ -453,9 +459,13 @@ void board_init_f (ulong bootflag)
        debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);
 
 #ifdef CONFIG_LCD
+#ifdef CONFIG_FB_ADDR
+       gd->fb_base = CONFIG_FB_ADDR;
+#else
        /* reserve memory for LCD display (always full pages) */
        addr = lcd_setmem (addr);
        gd->fb_base = addr;
+#endif /* CONFIG_FB_ADDR */
 #endif /* CONFIG_LCD */
 
 #if defined(CONFIG_VIDEO) && defined(CONFIG_8xx)
@@ -797,6 +807,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
        /* relocate environment function pointers etc. */
        env_relocate ();
 
+       /*
+        * after non-volatile devices & environment is setup and cpu code have
+        * another round to deal with any initialization that might require
+        * full access to the environment or loading of some image (firmware)
+        * from a non-volatile device
+        */
+       cpu_secondary_init_r();
+
        /*
         * Fill in missing fields of bd_info.
         * We do this here, where we have "normal" access to the
index 07ef28d1b4d906e4ee91a4921ce6fdd88ca58d01..f9ce539ecb45f5734621a971784a7e553ac8e0f8 100644 (file)
@@ -51,7 +51,7 @@
 #define CONFIG_SYS_BOOTCOUNT_ADDR      (CONFIG_SYS_IMMR + CPM_BOOTCOUNT_ADDR)
 #endif /* defined(CONFIG_MPC8260) */
 
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_QE)
 #include <asm/immap_qe.h>
 
 #define CONFIG_SYS_BOOTCOUNT_ADDR      (CONFIG_SYS_IMMR + 0x110000 + \
index 116d81bec6bf03baf0d53fb796f0960c840710e4..e01787dcb77f6eac861295ac59aa34645020d830 100644 (file)
@@ -33,6 +33,7 @@
 #include <bzlib.h>
 #include <environment.h>
 #include <asm/byteorder.h>
+#include <asm/mp.h>
 
 #if defined(CONFIG_OF_LIBFDT)
 #include <fdt.h>
@@ -95,7 +96,7 @@ static void boot_jump_linux(bootm_headers_t *images)
                debug ("   Booting using OF flat tree...\n");
                WATCHDOG_RESET ();
                (*kernel) ((bd_t *)of_flat_tree, 0, 0, EPAPR_MAGIC,
-                          CONFIG_SYS_BOOTMAPSZ, 0, 0);
+                          getenv_bootm_mapsize(), 0, 0);
                /* does not return */
        } else
 #endif
@@ -166,6 +167,10 @@ void arch_lmb_reserve(struct lmb *lmb)
        sp -= 4096;
        lmb_reserve(lmb, sp, (CONFIG_SYS_SDRAM_BASE + get_effective_memsize() - sp));
 
+#ifdef CONFIG_MP
+       cpu_mp_lmb_reserve(lmb);
+#endif
+
        return ;
 }
 
@@ -181,7 +186,6 @@ static void boot_prep_linux(void)
 
 static int boot_cmdline_linux(bootm_headers_t *images)
 {
-       ulong bootmap_base = getenv_bootm_low();
        ulong of_size = images->ft_len;
        struct lmb *lmb = &images->lmb;
        ulong *cmd_start = &images->cmdline_start;
@@ -191,7 +195,7 @@ static int boot_cmdline_linux(bootm_headers_t *images)
 
        if (!of_size) {
                /* allocate space and init command line */
-               ret = boot_get_cmdline (lmb, cmd_start, cmd_end, bootmap_base);
+               ret = boot_get_cmdline (lmb, cmd_start, cmd_end);
                if (ret) {
                        puts("ERROR with allocation of cmdline\n");
                        return ret;
@@ -203,7 +207,6 @@ static int boot_cmdline_linux(bootm_headers_t *images)
 
 static int boot_bd_t_linux(bootm_headers_t *images)
 {
-       ulong bootmap_base = getenv_bootm_low();
        ulong of_size = images->ft_len;
        struct lmb *lmb = &images->lmb;
        bd_t **kbd = &images->kbd;
@@ -212,7 +215,7 @@ static int boot_bd_t_linux(bootm_headers_t *images)
 
        if (!of_size) {
                /* allocate space for kernel copy of board info */
-               ret = boot_get_kbd (lmb, kbd, bootmap_base);
+               ret = boot_get_kbd (lmb, kbd);
                if (ret) {
                        puts("ERROR with allocation of kernel bd\n");
                        return ret;
@@ -230,13 +233,16 @@ static int boot_body_linux(bootm_headers_t *images)
        ulong *initrd_start = &images->initrd_start;
        ulong *initrd_end = &images->initrd_end;
 #if defined(CONFIG_OF_LIBFDT)
-       ulong bootmap_base = getenv_bootm_low();
        ulong of_size = images->ft_len;
        char **of_flat_tree = &images->ft_addr;
 #endif
 
        int ret;
 
+#if defined(CONFIG_OF_LIBFDT)
+       boot_fdt_add_mem_rsv_regions(lmb, *of_flat_tree);
+#endif
+
        /* allocate space and init command line */
        ret = boot_cmdline_linux(images);
        if (ret)
@@ -252,8 +258,8 @@ static int boot_body_linux(bootm_headers_t *images)
        if (ret)
                return ret;
 
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_SYS_BOOTMAPSZ)
-       ret = boot_relocate_fdt(lmb, bootmap_base, of_flat_tree, &of_size);
+#if defined(CONFIG_OF_LIBFDT)
+       ret = boot_relocate_fdt(lmb, of_flat_tree, &of_size);
        if (ret)
                return ret;
 
@@ -291,7 +297,7 @@ static int boot_body_linux(bootm_headers_t *images)
                if (*initrd_start && *initrd_end)
                        fdt_initrd(*of_flat_tree, *initrd_start, *initrd_end, 1);
        }
-#endif /* CONFIG_OF_LIBFDT && CONFIG_SYS_BOOTMAPSZ */
+#endif /* CONFIG_OF_LIBFDT */
        return 0;
 }
 
index cd851f59c49eaaa06e349c0970b33cb4e360f549..07ff8b9348e5beece2d86d4f74dc9a96b868684b 100644 (file)
 
 CROSS_COMPILE ?= sh4-linux-
 
-STANDALONE_LOAD_ADDR = 0x8C000000
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000
 ifeq ($(CPU),sh2)
-STANDALONE_LOAD_ADDR += -EB
+CONFIG_STANDALONE_LOAD_ADDR += -EB
 endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
 PLATFORM_LDFLAGS += -e $(CONFIG_SYS_TEXT_BASE) --defsym reloc_dst=$(CONFIG_SYS_TEXT_BASE)
 LDFLAGS_FINAL = --gc-sections
-
-ifdef CONFIG_SYS_LDSCRIPT
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else
-LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
-endif
index 4de6515ef49d187038188573cc152eddabd40a69..cae7478e28055eaab7a76b428a683e281d8028be 100644 (file)
@@ -23,6 +23,6 @@
 
 CROSS_COMPILE ?= sparc-elf-
 
-STANDALONE_LOAD_ADDR = 0x00000000 -L $(gcclibdir) -T sparc.lds
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) -T sparc.lds
 
 PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__
index a24f778c6d7857502eded1bb2ebda969f31cfb1f..795c7d7a79c8ab63ef3e770ff3ac7543fcd616d8 100644 (file)
@@ -47,9 +47,9 @@ struct {
  * initialize a bunch of registers.
  *
  * Run from FLASH/PROM:
- *  - until memory controller is set up, only registers avaiable
+ *  - until memory controller is set up, only registers available
  *  - no global variables available for writing
- *  - constants avaiable
+ *  - constants available
  */
 
 void cpu_init_f(void)
index be22ec26aafb5112e3aa09e8543e9eca80ca3ef1..cba9d0eb40b5ccc00252575e2b930788fce69f8d 100644 (file)
@@ -57,9 +57,9 @@ struct {
  * initialize a bunch of registers.
  *
  * Run from FLASH/PROM:
- *  - until memory controller is set up, only registers avaiable
+ *  - until memory controller is set up, only registers available
  *  - no global variables available for writing
- *  - constants avaiable
+ *  - constants available
  */
 
 void cpu_init_f(void)
similarity index 95%
rename from arch/i386/config.mk
rename to arch/x86/config.mk
index 47e0fb4c789bfdeacf9dedb2375328866979d53d..ee23c9f87d29fd20e6b6c12ac06a9da12d02790d 100644 (file)
@@ -21,7 +21,7 @@
 # MA 02111-1307 USA
 #
 
-STANDALONE_LOAD_ADDR = 0x40000
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
 
 PLATFORM_CPPFLAGS += -fno-strict-aliasing
 PLATFORM_CPPFLAGS += -Wstrict-prototypes
@@ -39,4 +39,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
 PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions
 
 LDFLAGS_FINAL += --gc-sections -pie
-LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
similarity index 100%
rename from arch/i386/cpu/Makefile
rename to arch/x86/cpu/Makefile
similarity index 94%
rename from arch/i386/cpu/config.mk
rename to arch/x86/cpu/config.mk
index 9b2e2c9fe1191153045208b5dcb3ce7b024a1e60..d1b528a43797122908c730ef5a0a0309241158f9 100644 (file)
@@ -23,7 +23,7 @@
 
 CROSS_COMPILE ?= i386-linux-
 
-PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__ -march=i386 -Werror
+PLATFORM_CPPFLAGS += -DCONFIG_X86 -D__I386__ -march=i386 -Werror
 
 # DO NOT MODIFY THE FOLLOWING UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!
 LDPPFLAGS += -DRESET_SEG_START=0xffff0000
similarity index 89%
rename from arch/i386/cpu/cpu.c
rename to arch/x86/cpu/cpu.c
index 2339cd41bbe71d037bc7900dd1222b83b8194528..0c5d7c3d53a437a3a8f7ead925fe9862ff52658b 100644 (file)
@@ -1,6 +1,9 @@
 /*
+ * (C) Copyright 2008-2011
+ * Graeme Russ, <graeme.russ@gmail.com>
+ *
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * (C) Copyright 2002
  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  * MA 02111-1307 USA
  */
 
-/*
- * CPU specific code
- */
-
 #include <common.h>
 #include <command.h>
 #include <asm/processor.h>
 #include <asm/processor-flags.h>
 #include <asm/interrupt.h>
 
-/* Constructor for a conventional segment GDT (or LDT) entry */
-/* This is a macro so it can be used in initializers */
+/*
+ * Constructor for a conventional segment GDT (or LDT) entry
+ * This is a macro so it can be used in initialisers
+ */
 #define GDT_ENTRY(flags, base, limit)                  \
        ((((base)  & 0xff000000ULL) << (56-24)) |       \
         (((flags) & 0x0000f0ffULL) << 40) |            \
         (((base)  & 0x00ffffffULL) << 16) |            \
         (((limit) & 0x0000ffffULL)))
 
-/*
- * Set up the GDT
- */
-
 struct gdt_ptr {
        u16 len;
        u32 ptr;
@@ -59,8 +56,10 @@ struct gdt_ptr {
 
 static void reload_gdt(void)
 {
-       /* There are machines which are known to not boot with the GDT
-          being 8-byte unaligned.  Intel recommends 16 byte alignment. */
+       /*
+        * There are machines which are known to not boot with the GDT
+        * being 8-byte unaligned.  Intel recommends 16 byte alignment
+        */
        static const u64 boot_gdt[] __attribute__((aligned(16))) = {
                /* CS: code, read/execute, 4 GB, base 0 */
                [GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xfffff),
@@ -86,7 +85,6 @@ static void reload_gdt(void)
                     : : "m" (gdt) : "ecx");
 }
 
-
 int x86_cpu_init_f(void)
 {
        const u32 em_rst = ~X86_CR0_EM;
@@ -125,7 +123,9 @@ int cpu_init_r(void) __attribute__((weak, alias("x86_cpu_init_r")));
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        printf ("resetting ...\n");
-       udelay(50000);                          /* wait 50 ms */
+
+       /* wait 50 ms */
+       udelay(50000);
        disable_interrupts();
        reset_cpu(0);
 
@@ -136,7 +136,6 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 void  flush_cache (unsigned long dummy1, unsigned long dummy2)
 {
        asm("wbinvd\n");
-       return;
 }
 
 void __attribute__ ((regparm(0))) generate_gpf(void);
@@ -150,7 +149,7 @@ asm(".globl generate_gpf\n"
 
 void __reset_cpu(ulong addr)
 {
-       printf("Resetting using i386 Triple Fault\n");
+       printf("Resetting using x86 Triple Fault\n");
        set_vector(13, generate_gpf);  /* general protection fault handler */
        set_vector(8, generate_gpf);   /* double fault handler */
        generate_gpf();                /* start the show */
similarity index 99%
rename from arch/i386/cpu/interrupts.c
rename to arch/x86/cpu/interrupts.c
index 1cefe02c86546baab4d8847ae7dfc2472123ac0d..62bcadc486a5671edc1fc99d41c4cea476de8c2f 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * (C) Copyright 2008
- * Graeme Russ, graeme.russ@gmail.com.
+ * (C) Copyright 2008-2011
+ * Graeme Russ, <graeme.russ@gmail.com>
  *
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * Portions of this file are derived from the Linux kernel source
  *  Copyright (C) 1991, 1992  Linus Torvalds
@@ -45,7 +45,7 @@
  * read/write functions for the control registers and messing everything up.
  * A memory clobber would solve the problem, but would prevent reordering of
  * all loads stores around it, which can hurt performance. Solution is to
- * use a variable and mimic reads and writes to it to enforce serialization
+ * use a variable and mimic reads and writes to it to enforce serialisation
  */
 static unsigned long __force_order;
 
similarity index 89%
rename from arch/i386/cpu/resetvec.S
rename to arch/x86/cpu/resetvec.S
index d9222dd2fc63934b1a1e52ced447c0d986560b54..c690d2516e7b1a2857643898577b06a29e149017 100644 (file)
@@ -1,7 +1,8 @@
 /*
- *  U-boot - i386 Startup Code
+ *  U-boot - x86 Startup Code
  *
- *  Copyright (c) 2002 Omicron Ceti AB, Daniel Engström <denaiel@omicron.se>
+ * (C) Copyright 2002
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
similarity index 96%
rename from arch/i386/cpu/sc520/Makefile
rename to arch/x86/cpu/sc520/Makefile
index 54260b610763c4223ca5de4413c8804217b5fbf2..694b61ee423e3f18c188f0d7c6e52174fa61f9a6 100644 (file)
@@ -33,6 +33,7 @@ LIB   := $(obj)lib$(SOC).o
 
 COBJS-$(CONFIG_SYS_SC520) += sc520.o
 COBJS-$(CONFIG_PCI) += sc520_pci.o
+COBJS-$(CONFIG_SYS_SC520_RESET) += sc520_reset.o
 COBJS-$(CONFIG_SYS_SC520) += sc520_sdram.o
 COBJS-$(CONFIG_SYS_SC520_SSI) += sc520_ssi.o
 COBJS-$(CONFIG_SYS_SC520_TIMER) += sc520_timer.o
similarity index 82%
rename from arch/i386/cpu/sc520/sc520.c
rename to arch/x86/cpu/sc520/sc520.c
index d0c313b91a9aa7ce64aef0d8c759bfb61637a0e2..8c410a2337d46b720421fc2926be473e3f62c8de 100644 (file)
@@ -1,6 +1,9 @@
 /*
+ * (C) Copyright 2008-2011
+ * Graeme Russ, <graeme.russ@gmail.com>
+ *
  * (C) Copyright 2002
- * Daniel Engstr�m, Omicron Ceti AB <daniel@omicron.se>.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -21,9 +24,6 @@
  * MA 02111-1307 USA
  */
 
-/* stuff specific for the sc520,
- * but idependent of implementation */
-
 #include <common.h>
 #include <asm/io.h>
 #include <asm/processor-flags.h>
@@ -65,13 +65,3 @@ int cpu_init_r(void)
        return x86_cpu_init_r();
 }
 
-#ifdef CONFIG_SYS_SC520_RESET
-void reset_cpu(ulong addr)
-{
-       printf("Resetting using SC520 MMCR\n");
-       /* Write a '1' to the SYS_RST of the RESCFG MMCR */
-       writeb(0x01, &sc520_mmcr->rescfg);
-
-       /* NOTREACHED */
-}
-#endif
similarity index 97%
rename from arch/i386/cpu/sc520/sc520_car.S
rename to arch/x86/cpu/sc520/sc520_car.S
index 22f5225311c6afb2c2cb65f1e83208bd749eb720..a33f94f4919a5d5cc448cd91747eb72f04120702 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * (C) Copyright 2010
- * Graeme Russ <graeme.russ@gmail.com>.
+ * (C) Copyright 2010-2011
+ * Graeme Russ, <graeme.russ@gmail.com>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -21,7 +21,6 @@
  * MA 02111-1307 USA
  */
 
-
 #include <config.h>
 #include <asm/processor-flags.h>
 #include <asm/ic/sc520.h>
similarity index 94%
rename from arch/i386/cpu/sc520/sc520_pci.c
rename to arch/x86/cpu/sc520/sc520_pci.c
index b91773435e9a8b23ee7e2d6ccc2af4e861e0a7a3..8cd7ffecdb692634bf923e6595a6342ff493e982 100644 (file)
@@ -1,6 +1,9 @@
 /*
+ * (C) Copyright 2008-2011
+ * Graeme Russ, <graeme.russ@gmail.com>
+ *
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB <daniel@omicron.se>.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -21,8 +24,6 @@
  * MA 02111-1307 USA
  */
 
-/* stuff specific for the sc520, but independent of implementation */
-
 #include <common.h>
 #include <pci.h>
 #include <asm/io.h>
@@ -54,7 +55,6 @@ static struct {
        { SC520_IRQ15, 1, 0x80 }
 };
 
-
 /* The interrupt used for PCI INTA-INTD  */
 int sc520_pci_ints[15] = {
        -1, -1, -1, -1, -1, -1, -1, -1,
@@ -68,9 +68,8 @@ int pci_sc520_set_irq(int pci_pin, int irq)
        u8 tmpb;
        u16 tmpw;
 
-# if 1
-       printf("set_irq(): map INT%c to IRQ%d\n", pci_pin + 'A', irq);
-#endif
+       debug("set_irq(): map INT%c to IRQ%d\n", pci_pin + 'A', irq);
+
        if (irq < 0 || irq > 15) {
                return -1; /* illegal irq */
        }
@@ -138,5 +137,4 @@ void pci_sc520_init(struct pci_controller *hose)
        /* enable target memory acceses on host brige */
        pci_write_config_word(0, PCI_COMMAND,
                              PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
-
 }
similarity index 54%
rename from board/purple/sconsole.h
rename to arch/x86/cpu/sc520/sc520_reset.c
index baed5fbb87c01d30df7a3e85583a221edcd30921..79ef976838c067da3c364899519ca1e8b4e0cade 100644 (file)
@@ -1,6 +1,9 @@
 /*
+ * (C) Copyright 2011
+ * Graeme Russ, <graeme.russ@gmail.com>
+ *
  * (C) Copyright 2002
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -12,7 +15,7 @@
  *
  * 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
+ * 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
  * MA 02111-1307 USA
  */
 
-#ifndef _SCONSOLE_H_
-#define _SCONSOLE_H_
-
-#include <config.h>
-
-typedef struct sconsole_buffer_s {
-       unsigned long size;
-       unsigned long max_size;
-       unsigned long pos;
-       char data[1];
-} sconsole_buffer_t;
-
-#define SCONSOLE_BUFFER                ((sconsole_buffer_t *) CONFIG_SYS_SCONSOLE_ADDR)
+#include <common.h>
+#include <asm/io.h>
+#include <asm/ic/sc520.h>
 
-extern void    (* sconsole_putc)       (char);
-extern void    (* sconsole_puts)       (const char *);
-extern int     (* sconsole_getc)       (void);
-extern int     (* sconsole_tstc)       (void);
-extern void    (* sconsole_setbrg)     (void);
+DECLARE_GLOBAL_DATA_PTR;
 
-extern void    sconsole_flush          (void);
+void reset_cpu(ulong addr)
+{
+       printf("Resetting using SC520 MMCR\n");
+       /* Write a '1' to the SYS_RST of the RESCFG MMCR */
+       writeb(0x01, &sc520_mmcr->rescfg);
 
-#endif
+       /* NOTREACHED */
+}
similarity index 99%
rename from arch/i386/cpu/sc520/sc520_sdram.c
rename to arch/x86/cpu/sc520/sc520_sdram.c
index d5ab55df069d931b3c61f9bfac6eb180d429f25c..f3623f53f2580ec5efcf1feb9d6550bade277137 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * (C) Copyright 2010
- * Graeme Russ <graeme.russ@gmail.com>.
+ * (C) Copyright 2010,2011
+ * Graeme Russ, <graeme.russ@gmail.com>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
similarity index 94%
rename from arch/i386/cpu/sc520/sc520_ssi.c
rename to arch/x86/cpu/sc520/sc520_ssi.c
index 6e5e346303304ef930d676f3635fa28d190d31b8..ac58d259705e24e96983376fd32b593397754422 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB <daniel@omicron.se>.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -21,8 +21,6 @@
  * MA 02111-1307 USA
  */
 
-/* stuff specific for the sc520, but independent of implementation */
-
 #include <common.h>
 #include <asm/io.h>
 #include <asm/ic/ssi.h>
@@ -77,7 +75,6 @@ u8 ssi_txrx_byte(u8 data)
        return readb(&sc520_mmcr->ssircv);
 }
 
-
 void ssi_tx_byte(u8 data)
 {
        writeb(data, &sc520_mmcr->ssixmit);
similarity index 94%
rename from arch/i386/cpu/sc520/sc520_timer.c
rename to arch/x86/cpu/sc520/sc520_timer.c
index d5617e91f6e154a1360f2a6a850e022a8df0aa66..1bcfe67c947e28c70d5188e5ab251f4b2365689f 100644 (file)
@@ -1,6 +1,9 @@
 /*
+ * (C) Copyright 2008-2011
+ * Graeme Russ, <graeme.russ@gmail.com>
+ *
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB <daniel@omicron.se>.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -21,8 +24,6 @@
  * MA 02111-1307 USA
  */
 
-/* stuff specific for the sc520, but independent of implementation */
-
 #include <common.h>
 #include <asm/io.h>
 #include <asm/interrupt.h>
similarity index 84%
rename from arch/i386/cpu/start.S
rename to arch/x86/cpu/start.S
index 00313897ce8517da4288e2870a4c97593ed48adb..7ccc076fec04b9f9cda074a11412ec645e1ed62a 100644 (file)
@@ -1,7 +1,11 @@
 /*
- *  U-boot - i386 Startup Code
+ *  U-boot - x86 Startup Code
  *
- *  Copyright (c) 2002 Omicron Ceti AB, Daniel Engström <denaiel@omicron.se>
+ * (C) Copyright 2008-2011
+ * Graeme Russ, <graeme.russ@gmail.com>
+ *
+ * (C) Copyright 2002
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
  * MA 02111-1307 USA
  */
 
-
 #include <config.h>
 #include <version.h>
 #include <asm/global_data.h>
 #include <asm/processor-flags.h>
 
-
 .section .text
 .code32
 .globl _start
 .type _start, @function
-.globl _i386boot_start
-_i386boot_start:
+.globl _x86boot_start
+_x86boot_start:
        /*
         * This is the fail safe 32-bit bootstrap entry point. The
         * following code is not executed from a cold-reset (actually, a
@@ -56,8 +58,8 @@ _i386boot_start:
 _start:
        /* This is the 32-bit cold-reset entry point */
 
-       movl    $0x18, %eax     /* Load our segement registes, the
-                                * gdt have already been loaded by start16.S */
+       /* Load the segement registes to match the gdt loaded in start16.S */
+       movl    $0x18, %eax
        movw    %ax, %fs
        movw    %ax, %ds
        movw    %ax, %gs
@@ -82,21 +84,13 @@ car_init_ret:
         * starting at CONFIG_SYS_CAR_ADDR to be used as a temporary stack
         */
        movl    $CONFIG_SYS_INIT_SP_ADDR, %esp
-       movl    $CONFIG_SYS_INIT_GD_ADDR, %ebp
-
-       /* Set Boot Flags in Global Data */
-       movl    %ebx, (GD_FLAGS * 4)(%ebp)
-
-       /* Determine our load offset (and put in Global Data) */
-       call    1f
-1:     popl    %ecx
-       subl    $1b, %ecx
-       movl    %ecx, (GD_LOAD_OFF * 4)(%ebp)
 
        /* Set parameter to board_init_f() to boot flags */
-       movl    (GD_FLAGS * 4)(%ebp), %eax
+       xorl    %eax, %eax
+       movw    %bx, %ax
 
-       call    board_init_f    /* Enter, U-boot! */
+       /* Enter, U-boot! */
+       call    board_init_f
 
        /* indicate (lack of) progress */
        movw    $0x85, %ax
similarity index 93%
rename from arch/i386/cpu/start16.S
rename to arch/x86/cpu/start16.S
index 7dc53583662509b5a63704e7089f488709e3638d..f1b9d0a0c9719f0c9946bc4243c43802a529323d 100644 (file)
@@ -1,7 +1,11 @@
 /*
- *  U-boot - i386 Startup Code
+ *  U-boot - x86 Startup Code
  *
- *  Copyright (c) 2002, 2003 Omicron Ceti AB, Daniel Engström <denaiel@omicron.se>
+ * (C) Copyright 2008-2011
+ * Graeme Russ, <graeme.russ@gmail.com>
+ *
+ * (C) Copyright 2002,2003
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
similarity index 90%
rename from arch/i386/cpu/u-boot.lds
rename to arch/x86/cpu/u-boot.lds
index 98a548d62eb630e179e9598fee1cbf0f0ce2201a..55974228b50b257817ef4863fc5d75f8abad2c22 100644 (file)
@@ -21,6 +21,7 @@
  * MA 02111-1307 USA
  */
 
+#include <config.h>
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
 OUTPUT_ARCH(i386)
 ENTRY(_start)
@@ -89,8 +90,8 @@ SECTIONS
         * Reset Vector at the end of the Flash ROM
         */
        . = START_16;
-       .start16 : AT (CONFIG_SYS_TEXT_BASE + (FLASH_SIZE - RESET_SEG_SIZE + START_16)) { KEEP(*(.start16)); }
+       .start16 : AT (CONFIG_SYS_TEXT_BASE + (CONFIG_SYS_MONITOR_LEN - RESET_SEG_SIZE + START_16)) { KEEP(*(.start16)); }
 
        . = RESET_VEC_LOC;
-       .resetvec : AT (CONFIG_SYS_TEXT_BASE + (FLASH_SIZE - RESET_SEG_SIZE + RESET_VEC_LOC)) { KEEP(*(.resetvec)); }
+       .resetvec : AT (CONFIG_SYS_TEXT_BASE + (CONFIG_SYS_MONITOR_LEN - RESET_SEG_SIZE + RESET_VEC_LOC)) { KEEP(*(.resetvec)); }
 }
similarity index 95%
rename from arch/i386/include/asm/interrupt.h
rename to arch/x86/include/asm/interrupt.h
index d32ef8b190ef22c606e7fa951ef3cd21393dc780..be52fe40d0716f841b25892903124edeae466e19 100644 (file)
 
 #include <asm/types.h>
 
-/* arch/i386/cpu/interrupts.c */
+/* arch/x86/cpu/interrupts.c */
 void set_vector(u8 intnum, void *routine);
 
-/* arch/i386/lib/interupts.c */
+/* arch/x86/lib/interupts.c */
 void disable_irq(int irq);
 void enable_irq(int irq);
 
similarity index 93%
rename from arch/i386/include/asm/u-boot-i386.h
rename to arch/x86/include/asm/u-boot-x86.h
index 7b39bd2ae01acd679a1ec11702819f1df4810606..944e1a20057a7b80c9e7757670e90aff5ea2691c 100644 (file)
@@ -35,7 +35,7 @@ void timer_isr(void *);
 typedef void (timer_fnc_t) (void);
 int register_timer_isr (timer_fnc_t *isr_func);
 
-/* Architecture specific - can be in arch/i386/cpu/, arch/i386/lib/, or $(BOARD)/ */
+/* Architecture specific - can be in arch/x86/cpu/, arch/x86/lib/, or $(BOARD)/ */
 int timer_init(void);
 int dram_init_f(void);
 
@@ -51,7 +51,7 @@ void setup_pcat_compatibility(void);
 void isa_unmap_rom(u32 addr);
 u32 isa_map_rom(u32 bus_addr, int size);
 
-/* arch/i386/lib/... */
+/* arch/x86/lib/... */
 int video_bios_init(void);
 int video_init(void);
 
similarity index 100%
rename from arch/i386/lib/Makefile
rename to arch/x86/lib/Makefile
similarity index 99%
rename from arch/i386/lib/bios.S
rename to arch/x86/lib/bios.S
index 48f1b81122272a5c92208629c49100b059e3db41..660a24439474463e08a2ac47c6e2ae6800cfadfe 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -42,7 +42,6 @@
  * a general purpose replacement for a real BIOS !!
  */
 
-
 .section .bios, "ax"
 .code16
 .org 0
similarity index 81%
rename from arch/i386/lib/bios.h
rename to arch/x86/lib/bios.h
index 4901f8917a231c0af8a0ab5e1b059294b0e2a30f..3c8d61a6f4511cbad0eba6645b7262b2499ee7bf 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -57,7 +57,7 @@
 #define OFFS_FLAGS   44    /* 16bit */
 
 #define SEGMENT      0x40
-#define STACK       0x800                      /* stack at 0x40:0x800 -> 0x800 */
+#define STACK       0x800      /* stack at 0x40:0x800 -> 0x800 */
 
 /* save general registers */
 /* save some segments     */
        /* setup BIOS stackpointer */
 
 #define MAKE_BIOS_STACK \
-       pushal          ; \
-       pushw   %ds     ; \
-       pushw   %gs     ; \
-       pushw   %es     ; \
-       pushw   %ss     ; \
-       popw    %gs     ; \
-       movw    $SEGMENT,%ax ; \
-       movw    %ax,%ds ; \
-       movw    %ax,%es ; \
-       movw    %ax,%ss ; \
-       movw    %sp,%bp ; \
-       movw    $STACK,%sp
+       pushal; \
+       pushw   %ds; \
+       pushw   %gs; \
+       pushw   %es; \
+       pushw   %ss; \
+       popw    %gs; \
+       movw    $SEGMENT, %ax; \
+       movw    %ax, %ds; \
+       movw    %ax, %es; \
+       movw    %ax, %ss; \
+       movw    %sp, %bp; \
+       movw    $STACK, %sp
 
 #define RESTORE_CALLERS_STACK \
-       pushw   %gs     ;                       /* restore callers stack segment */ \
-       popw    %ss     ; \
-       movw    %bp,%sp ;                       /* restore stackpointer */ \
-               \
-       popw    %es     ;                       /* restore segment selectors */ \
-       popw    %gs     ; \
-       popw    %ds     ; \
-               \
-       popal                                   /* restore GP registers */
+       pushw   %gs;            /* restore callers stack segment */ \
+       popw    %ss; \
+       movw    %bp, %sp;       /* restore stackpointer */ \
+       popw    %es;            /* restore segment selectors */ \
+       popw    %gs; \
+       popw    %ds; \
+       popal                   /* restore GP registers */
 
 #endif
similarity index 99%
rename from arch/i386/lib/bios_setup.c
rename to arch/x86/lib/bios_setup.c
index 75407c173cf162cb8c42c443c5e6a4d29c23b8d0..6949b35069b9c8b2b5677903bff1d83473ede4e7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -21,7 +21,6 @@
  * MA 02111-1307 USA
  */
 
-
 /*
  * Partly based on msbios.c from rolo 1.6:
  *----------------------------------------------------------------------
similarity index 95%
rename from arch/i386/lib/board.c
rename to arch/x86/lib/board.c
index e0f9803e5e8d9badec62c6ce355f8111307b9ab8..df54222211ad1ad098e36a27a9a2ced78006c1ad 100644 (file)
@@ -1,9 +1,12 @@
 /*
+ * (C) Copyright 2008-2011
+ * Graeme Russ, <graeme.russ@gmail.com>
+ *
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * (C) Copyright 2002
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
  *
  * (C) Copyright 2002
  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
@@ -38,7 +41,7 @@
 #include <net.h>
 #include <ide.h>
 #include <serial.h>
-#include <asm/u-boot-i386.h>
+#include <asm/u-boot-x86.h>
 #include <elf.h>
 
 #ifdef CONFIG_BITBANGMII
@@ -103,13 +106,6 @@ static int display_banner (void)
        return (0);
 }
 
-/*
- * WARNING: this code looks "cleaner" than the PowerPC version, but
- * has the disadvantage that you either get nothing, or everything.
- * On PowerPC, you might see "DRAM: " before the system hangs - which
- * gives a simple yet clear indication which part of the
- * initialization if failing.
- */
 static int display_dram_config (void)
 {
        int i;
@@ -141,7 +137,6 @@ static void display_flash_config (ulong size)
  * can relocate the monitor code to RAM.
  */
 
-
 /*
  * All attempts to come up with a "common" initialization sequence
  * that works for all boards and architectures failed: some of the
@@ -251,13 +246,13 @@ static int do_elf_reloc_fixups(void)
        return 0;
 }
 
-/*
- * Load U-Boot into RAM, initialize BSS, perform relocation adjustments
- */
+/* Load U-Boot into RAM, initialize BSS, perform relocation adjustments */
 void board_init_f(ulong boot_flags)
 {
        init_fnc_t **init_fnc_ptr;
 
+       gd->flags = boot_flags;
+
        for (init_fnc_ptr = init_sequence_f; *init_fnc_ptr; ++init_fnc_ptr) {
                if ((*init_fnc_ptr)() != 0)
                        hang();
similarity index 86%
rename from arch/i386/lib/bootm.c
rename to arch/x86/lib/bootm.c
index b36e58d9ec679f6e30df50af3f6b9579678317d5..a21a21f1f7f9fb0c1106884e17d42121211090d0 100644 (file)
@@ -5,10 +5,13 @@
  *
  * Copyright (C) 2001  Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
  *
- * 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.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
@@ -17,8 +20,8 @@
  *
  * 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
- *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
  */
 
 #include <common.h>
similarity index 88%
rename from arch/i386/lib/interrupts.c
rename to arch/x86/lib/interrupts.c
index 5a282782809e4e53480747166a4ff226d38cd31b..a2c598f9a4f7d129257874abdf7973f546c833df 100644 (file)
@@ -1,21 +1,21 @@
 /*
  * (C) Copyright 2009
- * Graeme Russ, graeme.russ@gmail.com
+ * Graeme Russ, <graeme.russ@gmail.com>
  *
  * (C) Copyright 2007
- * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
+ * Daniel Hellstrom, Gaisler Research, <daniel@gaisler.com>
  *
  * (C) Copyright 2006
- * Detlev Zundel, DENX Software Engineering, dzu@denx.de
+ * Detlev Zundel, DENX Software Engineering, <dzu@denx.de>
  *
  * (C) Copyright -2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
  *
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
+ * Josh Huber, Mission Critical Linux, Inc, <huber@mclx.com>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
 
 /*
  * This file contains the high-level API for the interrupt sub-system
- * of the i386 port of U-Boot. Most of the functionality has been
+ * of the x86 port of U-Boot. Most of the functionality has been
  * shamelessly stolen from the leon2 / leon3 ports of U-Boot.
  * Daniel Hellstrom, Detlev Zundel, Wolfgang Denk and Josh Huber are
  * credited for the corresponding work on those ports. The original
- * interrupt handling routines for the i386 port were written by
+ * interrupt handling routines for the x86 port were written by
  * Daniel Engström
  */
 
similarity index 96%
rename from arch/i386/lib/pcat_interrupts.c
rename to arch/x86/lib/pcat_interrupts.c
index 67e6e97e35eb77587df6817425daa7e5f4f97ab8..364c4358378cc3153777f4b2910f3a033f32bdad 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * (C) Copyright 2009
- * Graeme Russ, graeme.russ@gmail.com
+ * Graeme Russ, <graeme.russ@gmail.com>
  *
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
similarity index 97%
rename from arch/i386/lib/pcat_timer.c
rename to arch/x86/lib/pcat_timer.c
index 1373fd125c81d1f792788ebf8ba837cf4dc9fee1..1911c6c19d24365393420b271d3a51e0b71adef3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
similarity index 94%
rename from arch/i386/lib/pci.c
rename to arch/x86/lib/pci.c
index 9020e7ce7646df66ab777244cffb59f57ef9efb1..e791e88bd421107adbbd28112a5bb09c96f3d5f8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -54,10 +54,9 @@ int pci_shadow_rom(pci_dev_t dev, unsigned char *dest)
        class_code &= 0xffffff00;
        class_code >>= 8;
 
-#if 0
-       printf("PCI Header Vendor %04x device %04x class %06x\n",
+       debug("PCI Header Vendor %04x device %04x class %06x\n",
               vendor, device, class_code);
-#endif
+
        /* Enable the rom addess decoder */
        pci_write_config_dword(dev, PCI_ROM_ADDRESS, (u32)PCI_ROM_ADDRESS_MASK);
        pci_read_config_dword(dev, PCI_ROM_ADDRESS, &addr_reg);
@@ -70,13 +69,12 @@ int pci_shadow_rom(pci_dev_t dev, unsigned char *dest)
 
        size = (~(addr_reg&PCI_ROM_ADDRESS_MASK))+1;
 
-#if 0
-       printf("ROM is %d bytes\n", size);
-#endif
+       debug("ROM is %d bytes\n", size);
+
        rom_addr = pci_get_rom_window(hose, size);
-#if 0
-       printf("ROM mapped at %x \n", rom_addr);
-#endif
+
+       debug("ROM mapped at %x\n", rom_addr);
+
        pci_write_config_dword(dev, PCI_ROM_ADDRESS,
                               pci_phys_to_mem(dev, rom_addr)
                               |PCI_ROM_ADDRESS_ENABLE);
similarity index 61%
rename from arch/i386/lib/pci_type1.c
rename to arch/x86/lib/pci_type1.c
index 225ae4a990923b3dfa127ac34e34e41b0f70cf81..8ce5b33e3d235c115291634ea014a979445b8140 100644 (file)
@@ -1,15 +1,30 @@
 /*
- * Support for type PCI configuration cycles.
- * based on pci_indirect.c
+ * (C) Copyright 2002
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
- * Copyright (C) 2002 Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
+ * See file CREDITS for list of people who contributed to this
+ * project.
  *
  * 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.
+ * 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
  */
 
+/*
+ * Support for type PCI configuration cycles.
+ * based on pci_indirect.c
+ */
 #include <common.h>
 #include <asm/io.h>
 #include <pci.h>
similarity index 95%
rename from arch/i386/lib/realmode.c
rename to arch/x86/lib/realmode.c
index 2dda95b064d38d693fd6233f684bd7b4e2805784..5be827c66b124d1d0520a747599a9b19b89d32c9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
 #include <asm/ptrace.h>
 #include <asm/realmode.h>
 
-
 #define REALMODE_MAILBOX ((char*)0xe00)
 
-
 extern ulong __realmode_start;
 extern ulong __realmode_size;
 extern char realmode_enter;
@@ -57,13 +55,11 @@ int enter_realmode(u16 seg, u16 off, struct pt_regs *in, struct pt_regs *out)
 {
 
        /* setup out thin bios emulation */
-       if (bios_setup()) {
+       if (bios_setup())
                return -1;
-       }
 
-       if (realmode_setup()) {
+       if (realmode_setup())
                return -1;
-       }
 
        in->eip = off;
        in->xcs = seg;
similarity index 99%
rename from arch/i386/lib/realmode_switch.S
rename to arch/x86/lib/realmode_switch.S
index d6c74ecd79b4cea61a5e5b391441b6a11cf512f2..fce4eccab01e71671efc980a07f4b594fab1cf4d 100644 (file)
@@ -21,7 +21,6 @@
  * MA 02111-1307 USA
  */
 
-
 /* 32bit -> 16bit -> 32bit mode switch code */
 
 /*
similarity index 94%
rename from arch/i386/lib/timer.c
rename to arch/x86/lib/timer.c
index 5cb1f54fb5628616622a93f659992b5afeb6ae74..8fc68cdcb899a72b87e8b8aec4f26c1f92860a32 100644 (file)
@@ -1,6 +1,9 @@
 /*
+ * (C) Copyright 2008,2009
+ * Graeme Russ, <graeme.russ@gmail.com>
+ *
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
similarity index 86%
rename from arch/i386/lib/video.c
rename to arch/x86/lib/video.c
index c58ed104cc8a3129a083312b06c9528f96c9d09b..b29075c490a48ce14e3c3c485fdb21bbcc198172 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -30,7 +30,6 @@
 #include <asm/io.h>
 #include <asm/pci.h>
 
-
 /* basic textmode I/O from linux kernel */
 static char *vidmem = (char *)0xb8000;
 static int vidport;
@@ -42,9 +41,9 @@ static void beep(int dur)
        int i;
 
        outb_p(3, 0x61);
-       for (i=0;i<10*dur;i++) {
+       for (i = 0; i < 10*dur; i++)
                udelay(1000);
-       }
+
        outb_p(0, 0x61);
 }
 
@@ -52,8 +51,8 @@ static void scroll(void)
 {
        int i;
 
-       memcpy ( vidmem, vidmem + cols * 2, ( lines - 1 ) * cols * 2 );
-       for ( i = ( lines - 1 ) * cols * 2; i < lines * cols * 2; i += 2 )
+       memcpy(vidmem, vidmem + cols * 2, (lines - 1) * cols * 2);
+       for (i = (lines - 1) * cols * 2; i < lines * cols * 2; i += 2)
                vidmem[i] = ' ';
 }
 
@@ -61,14 +60,14 @@ static void __video_putc(const char c, int *x, int *y)
 {
        if (c == '\n') {
                (*x) = 0;
-               if ( ++(*y) >= lines ) {
+               if (++(*y) >= lines) {
                        scroll();
                        (*y)--;
                }
        } else if (c == '\b') {
                if ((*x) != 0) {
                        --(*x);
-                       vidmem [ ( (*x) + cols * (*y) ) * 2 ] = ' ';
+                       vidmem[((*x) + cols * (*y)) * 2] = ' ';
                }
        } else if (c == '\r') {
                (*x) = 0;
@@ -106,16 +105,15 @@ static void __video_putc(const char c, int *x, int *y)
                }
        } else if (c == '\f') {
                int i;
-               for (i=0;i<lines*cols*2;i+=2) {
+               for (i = 0; i < lines * cols * 2; i += 2)
                        vidmem[i] = 0;
-               }
                (*x) = 0;
                (*y) = 0;
        } else {
-               vidmem [ ( (*x) + cols * (*y) ) * 2 ] = c;
-               if ( ++(*x) >= cols ) {
+               vidmem[((*x) + cols * (*y)) * 2] = c;
+               if (++(*x) >= cols) {
                        (*x) = 0;
-                       if ( ++(*y) >= lines ) {
+                       if (++(*y) >= lines) {
                                scroll();
                                (*y)--;
                        }
@@ -150,9 +148,8 @@ static void video_puts(const char *s)
        x = orig_x;
        y = orig_y;
 
-       while ( ( c = *s++ ) != '\0' ) {
+       while ((c = *s++) != '\0')
                __video_putc(c, &x, &y);
-       }
 
        orig_x = x;
        orig_y = y;
@@ -189,10 +186,8 @@ int video_init(void)
 #if 0
        printf("pos %x %d %d\n", pos, orig_x, orig_y);
 #endif
-       if (orig_y > lines) {
+       if (orig_y > lines)
                orig_x = orig_y =0;
-       }
-
 
        memset(&vga_dev, 0, sizeof(vga_dev));
        strcpy(vga_dev.name, "vga");
@@ -203,13 +198,11 @@ int video_init(void)
        vga_dev.tstc  = NULL;              /* 'tstc' function */
        vga_dev.getc  = NULL;              /* 'getc' function */
 
-       if (stdio_register(&vga_dev) == 0) {
-           return 1;
-       }
+       if (stdio_register(&vga_dev) == 0)
+               return 1;
 
-       if (i8042_kbd_init()) {
+       if (i8042_kbd_init())
                return 1;
-       }
 
        memset(&kbd_dev, 0, sizeof(kbd_dev));
        strcpy(kbd_dev.name, "kbd");
@@ -220,18 +213,17 @@ int video_init(void)
        kbd_dev.tstc  = i8042_tstc;  /* 'tstc' function */
        kbd_dev.getc  = i8042_getc;  /* 'getc' function */
 
-       if (stdio_register(&kbd_dev) == 0) {
-           return 1;
-       }
+       if (stdio_register(&kbd_dev) == 0)
+               return 1;
+
        return 0;
 }
 
 
 int drv_video_init(void)
 {
-       if (video_bios_init()) {
+       if (video_bios_init())
                return 1;
-       }
 
        return video_init();
 }
similarity index 99%
rename from arch/i386/lib/video_bios.c
rename to arch/x86/lib/video_bios.c
index c8060e60a7766e50b272d206afea7bbd7b418174..6bc4335743572f0bb11a1a5abb6fdcab59a2cd6a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
similarity index 98%
rename from arch/i386/lib/zimage.c
rename to arch/x86/lib/zimage.c
index 0c420726912c120b5a263b7e3b3c165d5af601e6..cc4b40e64c9d2f836e8208336ec9a7fdd6a1ec9e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -22,7 +22,7 @@
  */
 
 /*
- * Linux i386 zImage and bzImage loading
+ * Linux x86 zImage and bzImage loading
  *
  * based on the procdure described in
  * linux/Documentation/i386/boot.txt
index 45206ca3bd1de0f9acf20fc99592ebc92ff00700..5aaf6b309d8eda7be637e2b352af588d727418fa 100644 (file)
@@ -67,13 +67,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index f73338906436d4c1a30e30fb3634d881041cf18f..31b89e46b608f7eb0ef6110692b968a0a2fd5d64 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+# Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
 #
 # Based on original Kirkwood support which is
 # (C) Copyright 2009
index 2ffd1250af5b7244ff9ddbf21c9f83ad22968017..b2ee416132d28c0a8d582fd04943734bcb8a9709 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+# Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
 #
 # (C) Copyright 2009
 # Marvell Semiconductor <www.marvell.com>
index bb388edd13a97e7e2d7b18293170bcddb7eb49ce..ee26893328197b045163fbb2a5bb3e84b9308f87 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+ * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
  * (C) Copyright 2009
  * Marvell Semiconductor <www.marvell.com>
index 046ffd62cb37a8873b315fee128133f9f6d5537e..34ac7aa55339395dafda9b320717af52d74bbabd 100644 (file)
@@ -33,9 +33,14 @@ DECLARE_GLOBAL_DATA_PTR;
 int board_early_init_f(void)
 {
        u32 mfp_cfg[] = {
+               /* I2C */
+               MFP105_CI2C_SDA,
+               MFP106_CI2C_SCL,
+
                /* Enable Console on UART1 */
                MFP107_UART1_RXD,
                MFP108_UART1_TXD,
+
                MFP_EOC         /*End of configureation*/
        };
        /* configure MFP's */
index 72a2d2a985039d0fb34dd9fdd30870272c9a0eaf..00f73e79f79e3b17f7e6ed356bbde6ae43abc86c 100644 (file)
@@ -36,6 +36,10 @@ int board_early_init_f(void)
                MFP47_UART2_RXD,
                MFP48_UART2_TXD,
 
+               /* I2C */
+               MFP53_CI2C_SCL,
+               MFP54_CI2C_SDA,
+
                MFP_EOC         /*End of configureation*/
        };
        /* configure MFP's */
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 3e7853a2a07a3a3f10536514826b8fe705381e27..838537375b3fefd55c8cb2359787b2553282d3fb 100644 (file)
@@ -52,13 +52,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 88634f7fe2b278a763231008fa18e0edfe0827a7..9cb838b7380ce75e86c3934bef50cd965ddc8be2 100644 (file)
@@ -2,5 +2,3 @@ CONFIG_SYS_TEXT_BASE = 0x00e00000
 
 # include NPE ethernet driver
 BOARDLIBS = arch/arm/cpu/ixp/npe/libnpe.o
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
index 88634f7fe2b278a763231008fa18e0edfe0827a7..9cb838b7380ce75e86c3934bef50cd965ddc8be2 100644 (file)
@@ -2,5 +2,3 @@ CONFIG_SYS_TEXT_BASE = 0x00e00000
 
 # include NPE ethernet driver
 BOARDLIBS = arch/arm/cpu/ixp/npe/libnpe.o
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
index 88634f7fe2b278a763231008fa18e0edfe0827a7..9cb838b7380ce75e86c3934bef50cd965ddc8be2 100644 (file)
@@ -2,5 +2,3 @@ CONFIG_SYS_TEXT_BASE = 0x00e00000
 
 # include NPE ethernet driver
 BOARDLIBS = arch/arm/cpu/ixp/npe/libnpe.o
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
index 661a94ab153f951664682317e0305014399d3f18..a7627699e76f04cd15cf086b55b28b2aec0465e5 100644 (file)
@@ -43,13 +43,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
index 95e75af034d4f726a2ac735e239e416d804563ce..00c16fc4c5a7b5eee8c8675574d94768c28c0812 100644 (file)
@@ -30,5 +30,3 @@ PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(VENDOR)/include
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
 endif
-
-LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
index 89848cf041f4e43f4b8da87bc3da92bcdc2c7cf8..220a4c44a4d191c713b6970e9f48448f1a115b0d 100644 (file)
 
 #include <common.h>
 #include <netdev.h>
+#include <mtd/cfi_flash.h>
+#include <asm/io.h>
 
 void text_base_hook(void); /* nop hook for text_base.S */
 
+#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR)
+static void __early_flash_cmd_reset(void)
+{
+       /* reset flash before we read env */
+       writeb(AMD_CMD_RESET, CONFIG_ENV_ADDR);
+       writeb(FLASH_CMD_RESET, CONFIG_ENV_ADDR);
+}
+void early_flash_cmd_reset(void)
+       __attribute__((weak,alias("__early_flash_cmd_reset")));
+#endif
+
 int board_early_init_f(void)
 {
        text_base_hook();
+#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR)
+       early_flash_cmd_reset();
+#endif
        return 0;
 }
 
index 2f2787f1128901ff220ae290d52b2c5ba1bbbf8c..bfc0945704042c3df2c2cc749f3bd20f44140d73 100644 (file)
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
 endif
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_U_BOOT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-endif
index 7ca16a06639bac7ff883831738959e59ae5677cd..24f74e121330cfdd3f5ba4ff559a3a4a6bfff792 100644 (file)
@@ -30,10 +30,3 @@ endif
 ifeq ($(dbcr),1)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff0000
 endif
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_U_BOOT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-endif
index abf2a268083c07b90571abdc79de506f785f72ad..d693a26b8112c235d28b93e05f4dbdbe2049088a 100644 (file)
@@ -33,10 +33,3 @@ endif
 ifeq ($(dbcr),1)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff0000
 endif
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_U_BOOT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-endif
index 4ae3ea92657df0bb12a37b6e1d04b0c380e4a2f2..003b8c3b81988dee0b0ae7d78031102c61541ee5 100644 (file)
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
 endif
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_U_BOOT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-endif
index 73efe727d2c794f79aed867029771a597ba790d2..e0bf07115ffe819f6bd539e7a5be19b7ac9854af 100644 (file)
@@ -33,10 +33,3 @@ endif
 ifeq ($(dbcr),1)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff0000
 endif
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_U_BOOT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-endif
index 57fe1d9ce0861397db3d28672c0d1a8322316877..cd8f5cebab5a6b88a82ede61525587f24d9cadf3 100644 (file)
@@ -49,13 +49,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index ce1be1e7665c39b5ca6d9bbf607bc78ee820697a..3566b958e7db6f504aa11caf367ead897ea7b3d0 100644 (file)
@@ -86,6 +86,15 @@ int board_eth_init(bd_t *bis)
        return rc;
 }
 
+int cpu_mmc_init(bd_t *bis)
+{
+       int rc = 0;
+#ifdef CONFIG_ARM_PL180_MMCI
+       rc = arm_pl180_mmci_init();
+#endif
+       return rc;
+}
+
 static void flash__init(void)
 {
        /* Setup the sytem control register to allow writing to flash */
diff --git a/board/armltd/vexpress/config.mk b/board/armltd/vexpress/config.mk
deleted file mode 100644 (file)
index 36395f2..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-# Linux-Kernel is expected to be at 0x60008000
-#
-CONFIG_SYS_TEXT_BASE = 0x60800000
index 8c03b77f7b55ffea430be6651d2f712a148c87c2..284f7ff32e6f86a933c8a34e8e37b833cbac5e74 100644 (file)
@@ -1,4 +1,3 @@
 PLATFORM_RELFLAGS      += -ffunction-sections -fdata-sections
 PLATFORM_LDFLAGS       += --gc-sections
 CONFIG_SYS_TEXT_BASE           = 0x00000000
-LDSCRIPT               = $(src)board/atmel/atstk1000/u-boot.lds
diff --git a/board/avnet/fx12mm/config.mk b/board/avnet/fx12mm/config.mk
deleted file mode 100644 (file)
index 78dde62..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# (C) Copyright 2008
-# Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@uam.es
-# Work supported by Qtechnology http://www.qtec.com
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-#
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-endif
diff --git a/board/avnet/v5fx30teval/config.mk b/board/avnet/v5fx30teval/config.mk
deleted file mode 100644 (file)
index 78dde62..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# (C) Copyright 2008
-# Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@uam.es
-# Work supported by Qtechnology http://www.qtec.com
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-#
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-endif
index 0c02d440d7c4b9bf9a30713e80ba0e26e77e79ce..799a6828ac015f700d70e7b8c72426e936ead30e 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf536-0.3
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
-
-# Set some default LDR flags based on boot mode.
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
diff --git a/board/bf506f-ezkit/Makefile b/board/bf506f-ezkit/Makefile
new file mode 100644 (file)
index 0000000..cde8168
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# U-boot - Makefile
+#
+# Copyright (c) 2005-2008 Analog Device Inc.
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS-y        := $(BOARD).o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/bf506f-ezkit/bf506f-ezkit.c b/board/bf506f-ezkit/bf506f-ezkit.c
new file mode 100644 (file)
index 0000000..638500d
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * U-boot - main board file
+ *
+ * Copyright (c) 2008-2010 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <asm/blackfin.h>
+
+int checkboard(void)
+{
+       printf("Board: ADI BF506F EZ-Kit board\n");
+       printf("       Support: http://blackfin.uclinux.org/\n");
+       return 0;
+}
+
+int board_early_init_f(void)
+{
+       bfin_write_EBIU_MODE(1);
+       SSYNC();
+       bfin_write_FLASH_CONTROL_CLEAR(1);
+       udelay(1);
+       bfin_write_FLASH_CONTROL_SET(1);
+       return 0;
+}
index ff1ac4cda80a5e172eb229a42c78063e49baf506..09a2353e7d93f26f730e5691507941ca62c22f93 100644 (file)
@@ -30,24 +30,21 @@ int checkboard(void)
 #if defined(CONFIG_BFIN_MAC)
 static void board_init_enetaddr(uchar *mac_addr)
 {
+#ifdef CONFIG_SYS_NO_FLASH
+# define USE_MAC_IN_FLASH 0
+#else
+# define USE_MAC_IN_FLASH 1
+#endif
        bool valid_mac = false;
 
-#if 0
-       /* the MAC is stored in OTP memory page 0xDF */
-       uint32_t ret;
-       uint64_t otp_mac;
-
-       ret = bfrom_OtpRead(0xDF, OTP_LOWER_HALF, &otp_mac);
-       if (!(ret & OTP_MASTER_ERROR)) {
-               uchar *otp_mac_p = (uchar *)&otp_mac;
-
-               for (ret = 0; ret < 6; ++ret)
-                       mac_addr[ret] = otp_mac_p[5 - ret];
-
-               if (is_valid_ether_addr(mac_addr))
+       if (USE_MAC_IN_FLASH) {
+               /* we cram the MAC in the last flash sector */
+               uchar *board_mac_addr = (uchar *)0x203F0096;
+               if (is_valid_ether_addr(board_mac_addr)) {
+                       memcpy(mac_addr, board_mac_addr, 6);
                        valid_mac = true;
+               }
        }
-#endif
 
        if (!valid_mac) {
                puts("Warning: Generating 'random' MAC address\n");
@@ -57,6 +54,13 @@ static void board_init_enetaddr(uchar *mac_addr)
        eth_setenv_enetaddr("ethaddr", mac_addr);
 }
 
+/* Only the first run of boards had a KSZ switch */
+#if defined(CONFIG_BFIN_SPI) && __SILICON_REVISION__ == 0
+# define KSZ_POSSIBLE 1
+#else
+# define KSZ_POSSIBLE 0
+#endif
+
 #define KSZ_MAX_HZ    5000000
 
 #define KSZ_WRITE     0x02
@@ -109,17 +113,16 @@ static int ksz8893m_reset(struct spi_slave *slave)
        return ret;
 }
 
-int board_eth_init(bd_t *bis)
+static bool board_ksz_init(void)
 {
-       static bool switch_is_alive = false, phy_is_ksz = true;
-       int ret;
+       static bool switch_is_alive = false;
 
        if (!switch_is_alive) {
                struct spi_slave *slave = spi_setup_slave(0, 1, KSZ_MAX_HZ, SPI_MODE_3);
                if (slave) {
                        if (!spi_claim_bus(slave)) {
-                               phy_is_ksz = (ksz8893m_reg_read(slave, KSZ_REG_CHID) == 0x88);
-                               ret = phy_is_ksz ? ksz8893m_reset(slave) : 0;
+                               bool phy_is_ksz = (ksz8893m_reg_read(slave, KSZ_REG_CHID) == 0x88);
+                               int ret = phy_is_ksz ? ksz8893m_reset(slave) : 0;
                                switch_is_alive = (ret == 0);
                                spi_release_bus(slave);
                        }
@@ -127,10 +130,16 @@ int board_eth_init(bd_t *bis)
                }
        }
 
-       if (switch_is_alive)
-               return bfin_EMAC_initialize(bis);
-       else
-               return -1;
+       return switch_is_alive;
+}
+
+int board_eth_init(bd_t *bis)
+{
+       if (KSZ_POSSIBLE) {
+               if (!board_ksz_init())
+                       return 0;
+       }
+       return bfin_EMAC_initialize(bis);
 }
 #endif
 
@@ -142,6 +151,12 @@ int misc_init_r(void)
                board_init_enetaddr(enetaddr);
 #endif
 
+#ifndef CONFIG_SYS_NO_FLASH
+       /* we use the last sector for the MAC address / POST LDR */
+       extern flash_info_t flash_info[];
+       flash_protect(FLAG_PROTECT_SET, 0x203F0000, 0x203FFFFF, &flash_info[0]);
+#endif
+
        return 0;
 }
 
index 9a54dbfb86fce39e840723329dfb219b4fa7a7c1..799a6828ac015f700d70e7b8c72426e936ead30e 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf518-0.0
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
-
-# Set some default LDR flags based on boot mode.
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
diff --git a/board/bf525-ucr2/Makefile b/board/bf525-ucr2/Makefile
new file mode 100644 (file)
index 0000000..cde8168
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# U-boot - Makefile
+#
+# Copyright (c) 2005-2008 Analog Device Inc.
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS-y        := $(BOARD).o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/bf525-ucr2/bf525-ucr2.c b/board/bf525-ucr2/bf525-ucr2.c
new file mode 100644 (file)
index 0000000..3e6df1f
--- /dev/null
@@ -0,0 +1,16 @@
+/* U-boot - bf525-ucr2.c  board specific routines
+ *
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+
+int checkboard(void)
+{
+       printf("Board: bf525-ucr2\n");
+       printf("Support: http://www.ucrobotics.com/\n");
+       return 0;
+}
index 52d82cd87e4b6832bcbbf398228257a84975d107..4695b1161a0d2624c9e660be5ff017731590f853 100644 (file)
@@ -27,21 +27,20 @@ int checkboard(void)
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
+#ifdef CONFIG_SYS_NO_FLASH
+# define USE_MAC_IN_FLASH 0
+#else
+# define USE_MAC_IN_FLASH 1
+#endif
        bool valid_mac = false;
 
-       /* the MAC is stored in OTP memory page 0xDF */
-       uint32_t ret;
-       uint64_t otp_mac;
-
-       ret = bfrom_OtpRead(0xDF, OTP_LOWER_HALF, &otp_mac);
-       if (!(ret & OTP_MASTER_ERROR)) {
-               uchar *otp_mac_p = (uchar *)&otp_mac;
-
-               for (ret = 0; ret < 6; ++ret)
-                       mac_addr[ret] = otp_mac_p[5 - ret];
-
-               if (is_valid_ether_addr(mac_addr))
+       if (USE_MAC_IN_FLASH) {
+               /* we cram the MAC in the last flash sector */
+               uchar *board_mac_addr = (uchar *)0x203F0096;
+               if (is_valid_ether_addr(board_mac_addr)) {
+                       memcpy(mac_addr, board_mac_addr, 6);
                        valid_mac = true;
+               }
        }
 
        if (!valid_mac) {
@@ -66,5 +65,11 @@ int misc_init_r(void)
                board_init_enetaddr(enetaddr);
 #endif
 
+#ifndef CONFIG_SYS_NO_FLASH
+       /* we use the last sector for the MAC address / POST LDR */
+       extern flash_info_t flash_info[];
+       flash_protect(FLAG_PROTECT_SET, 0x203F0000, 0x203FFFFF, &flash_info[0]);
+#endif
+
        return 0;
 }
index 46c09ea8f4dcc53ef845b3559d545d9d48486cea..799a6828ac015f700d70e7b8c72426e936ead30e 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf526-0.0
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
-
-# Set some default LDR flags based on boot mode.
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index a6c272aea77f43b3996e6e07c9bf48d543622844..799a6828ac015f700d70e7b8c72426e936ead30e 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf527-0.2
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
-
-# Set some default LDR flags based on boot mode.
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index 790fe99b045d99adf34fa9cfe86eab194d2ab3ea..799a6828ac015f700d70e7b8c72426e936ead30e 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf527-0.0
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
-
-# Set some default LDR flags based on boot mode.
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index 7cb935a2afe48365f6f80bb3eb1d6c138e352b3a..727177402f57b193af9d9d8794ca28a7b01efd54 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf527-0.2
-
-CFLAGS_lib_generic += -O2
-CFLAGS_lzma += -O2
+CFLAGS_lib += -O2
+CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 6
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index a0d174924add03ff688854012ea6b70de680d864..c0cb9ffc41e1dab3ab1d37e59cd7a625b2c3cd18 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf533-0.3
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index a0d174924add03ff688854012ea6b70de680d864..c0cb9ffc41e1dab3ab1d37e59cd7a625b2c3cd18 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf533-0.3
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index de026356df8499f7555ee90878531ffca9ecb6b4..4bb6506d84c1db4ca8868557b86c82a61d232191 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf537-0.2
-
 # Set some default LDR flags based on boot mode.
-LDR_FLAGS-BFIN_BOOT_UART       := --port g --gpio 6
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
+LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6
diff --git a/board/bf537-pnav/config.mk b/board/bf537-pnav/config.mk
deleted file mode 100644 (file)
index e29d87f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf537-0.2
-
-# Set some default LDR flags based on boot mode.
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index de026356df8499f7555ee90878531ffca9ecb6b4..4bb6506d84c1db4ca8868557b86c82a61d232191 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf537-0.2
-
 # Set some default LDR flags based on boot mode.
-LDR_FLAGS-BFIN_BOOT_UART       := --port g --gpio 6
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
+LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6
index 6694f06617686bb7f2abb9b751bcb3f7f314e430..7c023d1fea895366d6fe2f562d6d3b22b5201ae5 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf537-0.2
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
 LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index 4ab139731344e3925d2f8039da119af6c00f3f6a..c0cb9ffc41e1dab3ab1d37e59cd7a625b2c3cd18 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf538-0.4
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index 9aa176151250ef1e2085cc36f1eb6bc3c92771b7..7f38b1469d40724c0c6915c3c329c28e39e1da3b 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf548-0.0
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
@@ -37,4 +32,3 @@ LDR_FLAGS-BFIN_BOOT_FIFO       := --dma 1
 LDR_FLAGS-BFIN_BOOT_SPI_MASTER := --dma 1
 LDR_FLAGS-BFIN_BOOT_UART       := --dma 1
 LDR_FLAGS-BFIN_BOOT_NAND       := --dma 6
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index 5c88114ac4589015f52843f2141e072e15d55bf2..4c811ba35907794f771e42a8e3af00124d7b0468 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf561-0.5
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index 19cdefc147a3635673fbd8358a3fc741117e88c3..4c811ba35907794f771e42a8e3af00124d7b0468 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf561-0.3
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
diff --git a/board/blackstamp/config.mk b/board/blackstamp/config.mk
deleted file mode 100644 (file)
index 0ca3c90..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf532-0.5
-
-# Set some default LDR flags based on boot mode.
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
diff --git a/board/blackvme/config.mk b/board/blackvme/config.mk
deleted file mode 100644 (file)
index 4d6e0ba..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Copyright (c) 2005-2008 Analog Device Inc.
-#
-# (C) Copyright 2001
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf561-0.5
-
-# Set some default LDR flags based on boot mode.
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index 524c36eb4b490d8f8d82e3d07a1284d7af384c3f..b9b8e3c727420129f506cac912430025c8f78756 100644 (file)
@@ -55,13 +55,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 790fe99b045d99adf34fa9cfe86eab194d2ab3ea..799a6828ac015f700d70e7b8c72426e936ead30e 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf527-0.0
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
-
-# Set some default LDR flags based on boot mode.
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index a0d174924add03ff688854012ea6b70de680d864..c0cb9ffc41e1dab3ab1d37e59cd7a625b2c3cd18 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf533-0.3
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index c5d45c7db7f96787a1fa11501c0316cd83669644..c0cb9ffc41e1dab3ab1d37e59cd7a625b2c3cd18 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf537-0.2
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index c5d45c7db7f96787a1fa11501c0316cd83669644..c0cb9ffc41e1dab3ab1d37e59cd7a625b2c3cd18 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf537-0.2
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index da6aa52dfeee4a8a2b0f0d2b268109afbd8ed9b7..5adb6fc163d088cced21fcacfed08feca4dda2e3 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf548-0.0
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
@@ -36,4 +31,3 @@ LDR_FLAGS-BFIN_BOOT_PARA       := --dma 6
 LDR_FLAGS-BFIN_BOOT_FIFO       := --dma 1
 LDR_FLAGS-BFIN_BOOT_SPI_MASTER := --dma 1
 LDR_FLAGS-BFIN_BOOT_UART       := --dma 1
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index 19cdefc147a3635673fbd8358a3fc741117e88c3..4c811ba35907794f771e42a8e3af00124d7b0468 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf561-0.3
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
diff --git a/board/cm5200/u-boot.lds b/board/cm5200/u-boot.lds
deleted file mode 100644 (file)
index cf73b11..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * (C) Copyright 2003-2007
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    arch/powerpc/cpu/mpc5xxx/start.o   (.text)
-    *(.text)
-    *(.got1)
-    . = ALIGN(16);
-    *(.eh_frame)
-    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss (NOLOAD)       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-   . = ALIGN(4);
-  }
-  __bss_end__ = . ;
-  PROVIDE (end = .);
-}
index 862b8dc1b2506c83e088971a5629b9bf546b7984..83d7a568f8365b3606737de8115aa42fd25df113 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).o
 
-COBJS  := cm_t35.o
+COBJS  := cm_t35.o leds.o
 
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
index 459df0b490994a5fea2e9f4db234f709bd41112e..f82111bac2f76467574dde335bc5519998167a89 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * (C) Copyright 2010
+ * (C) Copyright 2011
  * CompuLab, Ltd. <www.compulab.co.il>
  *
- * Author: Mike Rapoport <mike@compulab.co.il>
+ * Authors: Mike Rapoport <mike@compulab.co.il>
+ *         Igor Grinberg <grinberg@compulab.co.il>
  *
  * Derived from omap3evm and Beagle Board by
  *     Manikandan Pillai <mani.pillai@ti.com>
  *
  * 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
+ * Foundation, Inc.
  */
 
 #include <common.h>
+#include <status_led.h>
 #include <netdev.h>
 #include <net.h>
 #include <i2c.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 const omap3_sysinfo sysinfo = {
        DDR_DISCRETE,
-       "CM-T35 board",
+       "CM-T3x board",
        "NAND",
 };
 
@@ -73,31 +76,33 @@ static u32 gpmc_nand_config[GPMC_MAX_REG] = {
  */
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
 
        enable_gpmc_cs_config(gpmc_nand_config, &gpmc_cfg->cs[0],
                              CONFIG_SYS_NAND_BASE, GPMC_SIZE_16M);
 
        /* board id for Linux */
-       gd->bd->bi_arch_number = MACH_TYPE_CM_T35;
+       if (get_cpu_family() == CPU_OMAP34XX)
+               gd->bd->bi_arch_number = MACH_TYPE_CM_T35;
+       else
+               gd->bd->bi_arch_number = MACH_TYPE_CM_T3730;
+
        /* boot param addr */
        gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
 
+#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
+       status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
+#endif
+
        return 0;
 }
 
 /*
  * Routine: misc_init_r
- * Description: Init I2C and display die ID
+ * Description: display die ID
  */
 int misc_init_r(void)
 {
-#ifdef CONFIG_DRIVER_OMAP34XX_I2C
-       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-#endif
-
        dieid_num_r();
 
        return 0;
@@ -109,7 +114,7 @@ int misc_init_r(void)
  *             hardware. Many pins need to be moved from protect to primary
  *             mode.
  */
-void set_muxconf_regs(void)
+static void cm_t3x_set_common_muxconf(void)
 {
        /* SDRC */
        MUX_VAL(CP(SDRC_D0),            (IEN  | PTD | DIS | M0)); /*SDRC_D0*/
@@ -184,7 +189,7 @@ void set_muxconf_regs(void)
        /* SB-T35 Ethernet */
        MUX_VAL(CP(GPMC_NCS4),          (IEN  | PTU | EN  | M0)); /*GPMC_nCS4*/
 
-       /* CM-T35 Ethernet */
+       /* CM-T3x Ethernet */
        MUX_VAL(CP(GPMC_NCS5),          (IDIS | PTU | DIS | M0)); /*GPMC_nCS5*/
        MUX_VAL(CP(GPMC_CLK),           (IEN  | PTD | DIS | M4)); /*GPIO_59*/
        MUX_VAL(CP(GPMC_NADV_ALE),      (IDIS | PTD | DIS | M0)); /*nADV_ALE*/
@@ -200,12 +205,6 @@ void set_muxconf_regs(void)
        MUX_VAL(CP(DSS_HSYNC),          (IDIS | PTD | DIS | M0)); /*DSS_HSYNC*/
        MUX_VAL(CP(DSS_VSYNC),          (IDIS | PTD | DIS | M0)); /*DSS_VSYNC*/
        MUX_VAL(CP(DSS_ACBIAS),         (IDIS | PTD | DIS | M0)); /*DSS_ACBIAS*/
-       MUX_VAL(CP(DSS_DATA0),          (IDIS | PTD | DIS | M0)); /*DSS_DATA0*/
-       MUX_VAL(CP(DSS_DATA1),          (IDIS | PTD | DIS | M0)); /*DSS_DATA1*/
-       MUX_VAL(CP(DSS_DATA2),          (IDIS | PTD | DIS | M0)); /*DSS_DATA2*/
-       MUX_VAL(CP(DSS_DATA3),          (IDIS | PTD | DIS | M0)); /*DSS_DATA3*/
-       MUX_VAL(CP(DSS_DATA4),          (IDIS | PTD | DIS | M0)); /*DSS_DATA4*/
-       MUX_VAL(CP(DSS_DATA5),          (IDIS | PTD | DIS | M0)); /*DSS_DATA5*/
        MUX_VAL(CP(DSS_DATA6),          (IDIS | PTD | DIS | M0)); /*DSS_DATA6*/
        MUX_VAL(CP(DSS_DATA7),          (IDIS | PTD | DIS | M0)); /*DSS_DATA7*/
        MUX_VAL(CP(DSS_DATA8),          (IDIS | PTD | DIS | M0)); /*DSS_DATA8*/
@@ -218,12 +217,6 @@ void set_muxconf_regs(void)
        MUX_VAL(CP(DSS_DATA15),         (IDIS | PTD | DIS | M0)); /*DSS_DATA15*/
        MUX_VAL(CP(DSS_DATA16),         (IDIS | PTD | DIS | M0)); /*DSS_DATA16*/
        MUX_VAL(CP(DSS_DATA17),         (IDIS | PTD | DIS | M0)); /*DSS_DATA17*/
-       MUX_VAL(CP(DSS_DATA18),         (IDIS | PTD | DIS | M0)); /*DSS_DATA18*/
-       MUX_VAL(CP(DSS_DATA19),         (IDIS | PTD | DIS | M0)); /*DSS_DATA19*/
-       MUX_VAL(CP(DSS_DATA20),         (IDIS | PTD | DIS | M0)); /*DSS_DATA20*/
-       MUX_VAL(CP(DSS_DATA21),         (IDIS | PTD | DIS | M0)); /*DSS_DATA21*/
-       MUX_VAL(CP(DSS_DATA22),         (IDIS | PTD | DIS | M0)); /*DSS_DATA22*/
-       MUX_VAL(CP(DSS_DATA23),         (IDIS | PTD | DIS | M0)); /*DSS_DATA23*/
 
        /* serial interface */
        MUX_VAL(CP(UART3_RX_IRRX),      (IEN  | PTD | DIS | M0)); /*UART3_RX*/
@@ -253,19 +246,72 @@ void set_muxconf_regs(void)
        MUX_VAL(CP(SYS_NIRQ),           (IEN  | PTU | EN  | M0)); /*SYS_nIRQ*/
        MUX_VAL(CP(SYS_OFF_MODE),       (IEN  | PTD | DIS | M0)); /*OFF_MODE*/
        MUX_VAL(CP(SYS_CLKOUT1),        (IEN  | PTD | DIS | M0)); /*CLKOUT1*/
-       MUX_VAL(CP(SYS_CLKOUT2),        (IDIS | PTD | DIS | M4)); /*green LED*/
+       MUX_VAL(CP(SYS_CLKOUT2),        (IDIS | PTU | DIS | M4)); /*green LED*/
        MUX_VAL(CP(JTAG_nTRST),         (IEN  | PTD | DIS | M0)); /*JTAG_nTRST*/
        MUX_VAL(CP(JTAG_TCK),           (IEN  | PTD | DIS | M0)); /*JTAG_TCK*/
        MUX_VAL(CP(JTAG_TMS),           (IEN  | PTD | DIS | M0)); /*JTAG_TMS*/
        MUX_VAL(CP(JTAG_TDI),           (IEN  | PTD | DIS | M0)); /*JTAG_TDI*/
+
+       /* MMC1 */
+       MUX_VAL(CP(MMC1_CLK),           (IDIS | PTU | EN  | M0)); /*MMC1_CLK*/
+       MUX_VAL(CP(MMC1_CMD),           (IEN  | PTU | EN  | M0)); /*MMC1_CMD*/
+       MUX_VAL(CP(MMC1_DAT0),          (IEN  | PTU | EN  | M0)); /*MMC1_DAT0*/
+       MUX_VAL(CP(MMC1_DAT1),          (IEN  | PTU | EN  | M0)); /*MMC1_DAT1*/
+       MUX_VAL(CP(MMC1_DAT2),          (IEN  | PTU | EN  | M0)); /*MMC1_DAT2*/
+       MUX_VAL(CP(MMC1_DAT3),          (IEN  | PTU | EN  | M0)); /*MMC1_DAT3*/
+}
+
+static void cm_t35_set_muxconf(void)
+{
+       /* DSS */
+       MUX_VAL(CP(DSS_DATA0),          (IDIS | PTD | DIS | M0)); /*DSS_DATA0*/
+       MUX_VAL(CP(DSS_DATA1),          (IDIS | PTD | DIS | M0)); /*DSS_DATA1*/
+       MUX_VAL(CP(DSS_DATA2),          (IDIS | PTD | DIS | M0)); /*DSS_DATA2*/
+       MUX_VAL(CP(DSS_DATA3),          (IDIS | PTD | DIS | M0)); /*DSS_DATA3*/
+       MUX_VAL(CP(DSS_DATA4),          (IDIS | PTD | DIS | M0)); /*DSS_DATA4*/
+       MUX_VAL(CP(DSS_DATA5),          (IDIS | PTD | DIS | M0)); /*DSS_DATA5*/
+
+       MUX_VAL(CP(DSS_DATA18),         (IDIS | PTD | DIS | M0)); /*DSS_DATA18*/
+       MUX_VAL(CP(DSS_DATA19),         (IDIS | PTD | DIS | M0)); /*DSS_DATA19*/
+       MUX_VAL(CP(DSS_DATA20),         (IDIS | PTD | DIS | M0)); /*DSS_DATA20*/
+       MUX_VAL(CP(DSS_DATA21),         (IDIS | PTD | DIS | M0)); /*DSS_DATA21*/
+       MUX_VAL(CP(DSS_DATA22),         (IDIS | PTD | DIS | M0)); /*DSS_DATA22*/
+       MUX_VAL(CP(DSS_DATA23),         (IDIS | PTD | DIS | M0)); /*DSS_DATA23*/
+
+       /* MMC1 */
+       MUX_VAL(CP(MMC1_DAT4),          (IEN  | PTU | EN  | M0)); /*MMC1_DAT4*/
+       MUX_VAL(CP(MMC1_DAT5),          (IEN  | PTU | EN  | M0)); /*MMC1_DAT5*/
+       MUX_VAL(CP(MMC1_DAT6),          (IEN  | PTU | EN  | M0)); /*MMC1_DAT6*/
+       MUX_VAL(CP(MMC1_DAT7),          (IEN  | PTU | EN  | M0)); /*MMC1_DAT7*/
 }
 
-#ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
+static void cm_t3730_set_muxconf(void)
 {
-       return omap_mmc_init(0);
+       /* DSS */
+       MUX_VAL(CP(DSS_DATA18),         (IDIS | PTD | DIS | M3)); /*DSS_DATA0*/
+       MUX_VAL(CP(DSS_DATA19),         (IDIS | PTD | DIS | M3)); /*DSS_DATA1*/
+       MUX_VAL(CP(DSS_DATA20),         (IDIS | PTD | DIS | M3)); /*DSS_DATA2*/
+       MUX_VAL(CP(DSS_DATA21),         (IDIS | PTD | DIS | M3)); /*DSS_DATA3*/
+       MUX_VAL(CP(DSS_DATA22),         (IDIS | PTD | DIS | M3)); /*DSS_DATA4*/
+       MUX_VAL(CP(DSS_DATA23),         (IDIS | PTD | DIS | M3)); /*DSS_DATA5*/
+
+       MUX_VAL(CP(SYS_BOOT0),          (IDIS | PTD | DIS | M3)); /*DSS_DATA18*/
+       MUX_VAL(CP(SYS_BOOT1),          (IDIS | PTD | DIS | M3)); /*DSS_DATA19*/
+       MUX_VAL(CP(SYS_BOOT3),          (IDIS | PTD | DIS | M3)); /*DSS_DATA20*/
+       MUX_VAL(CP(SYS_BOOT4),          (IDIS | PTD | DIS | M3)); /*DSS_DATA21*/
+       MUX_VAL(CP(SYS_BOOT5),          (IDIS | PTD | DIS | M3)); /*DSS_DATA22*/
+       MUX_VAL(CP(SYS_BOOT6),          (IDIS | PTD | DIS | M3)); /*DSS_DATA23*/
+}
+
+void set_muxconf_regs(void)
+{
+       cm_t3x_set_common_muxconf();
+
+       if (get_cpu_family() == CPU_OMAP34XX)
+               cm_t35_set_muxconf();
+       else
+               cm_t3730_set_muxconf();
 }
-#endif
 
 /*
  * Routine: setup_net_chip_gmpc
@@ -277,7 +323,7 @@ static void setup_net_chip_gmpc(void)
        struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
 
        enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[5],
-                             CM_T35_SMC911X_BASE, GPMC_SIZE_16M);
+                             CM_T3X_SMC911X_BASE, GPMC_SIZE_16M);
        enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[4],
                              SB_T35_SMC911X_BASE, GPMC_SIZE_16M);
 
@@ -356,9 +402,9 @@ int board_eth_init(bd_t *bis)
 
        rc1 = handle_mac_address();
        if (rc1)
-               printf("CM-T35: No MAC address found\n");
+               printf("CM-T3x: No MAC address found\n");
 
-       rc1 = smc911x_initialize(0, CM_T35_SMC911X_BASE);
+       rc1 = smc911x_initialize(0, CM_T3X_SMC911X_BASE);
        if (rc1 > 0)
                rc++;
 
diff --git a/board/cm_t35/leds.c b/board/cm_t35/leds.c
new file mode 100644 (file)
index 0000000..71c5b0d
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * (C) Copyright 2011
+ * CompuLab, Ltd. <www.compulab.co.il>
+ *
+ * Author: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * 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.
+ */
+#include <common.h>
+#include <status_led.h>
+#include <asm/arch/gpio.h>
+
+static unsigned int leds[] = { GREEN_LED_GPIO };
+
+void __led_init(led_id_t mask, int state)
+{
+       if (omap_request_gpio(leds[mask]) != 0) {
+               printf("%s: failed requesting GPIO%u\n", __func__, leds[mask]);
+               return;
+       }
+
+       omap_set_gpio_direction(leds[mask], 0);
+}
+
+void __led_set(led_id_t mask, int state)
+{
+       omap_set_gpio_dataout(leds[mask], state == STATUS_LED_ON);
+}
+
+void __led_toggle(led_id_t mask)
+{
+       omap_set_gpio_dataout(leds[mask], !omap_get_gpio_datain(leds[mask]));
+}
index 78730db490fbb609436425b7a4a71f9b7fbe04e7..12e2e7c2a725e8e0086c60b2942a143ddab1715c 100644 (file)
@@ -26,5 +26,3 @@
 #
 
 PLATFORM_CPPFLAGS += -I$(TOPDIR)
-
-LDSCRIPT := $(SRCTREE)/board/cogent/u-boot.lds
index e324f5c1e66ce12208383de78af0ce3157054140..2393d8d8af67d02e351d843cd2f31483048561d0 100644 (file)
@@ -51,13 +51,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
similarity index 89%
rename from board/mp2usb/Makefile
rename to board/comelit/dig297/Makefile
index 335734a7ab7a71a9baaad76998490673b5d56e7e..8dffedd34ea6398d34e045bcd394f585f8f4783b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003-2006
+# (C) Copyright 2000, 2001, 2002
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -25,17 +25,16 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).o
 
-COBJS  := mp2usb.o flash.o
+COBJS  := dig297.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(call cmd_link_o_target, $(OBJS))
 
 clean:
-       rm -f $(SOBJS) $(OBJS)
+       rm -f $(OBJS)
 
 distclean:     clean
        rm -f $(LIB) core *.bak $(obj).depend
diff --git a/board/comelit/dig297/dig297.c b/board/comelit/dig297/dig297.c
new file mode 100644 (file)
index 0000000..0062f12
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * (C) Copyright 2011 Comelit Group SpA
+ * Luca Ceresoli <luca.ceresoli@comelit.it>
+ *
+ * Based on board/ti/beagle/beagle.c:
+ * (C) Copyright 2004-2008
+ * Texas Instruments, <www.ti.com>
+ *
+ * Author :
+ *     Sunil Kumar <sunilsaini05@gmail.com>
+ *     Shashi Ranjan <shashiranjanmca05@gmail.com>
+ *
+ * Derived from Beagle Board and 3430 SDP code by
+ *     Richard Woodruff <r-woodruff2@ti.com>
+ *     Syed Mohammed Khasim <khasim@ti.com>
+ *
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 <common.h>
+#include <netdev.h>
+#include <twl4030.h>
+#include <asm/io.h>
+#include <asm/arch/omap3-regs.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/gpio.h>
+#include <asm/mach-types.h>
+#include "dig297.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_CMD_NET
+static void setup_net_chip(void);
+
+#define NET_LAN9221_RESET_GPIO 12
+
+/* GPMC CS 5 connected to an SMSC LAN9220 ethernet controller */
+#define NET_LAN9220_GPMC_CONFIG1       (DEVICESIZE_16BIT)
+#define NET_LAN9220_GPMC_CONFIG2       (CSWROFFTIME(8) | \
+                                        CSRDOFFTIME(7) | \
+                                        ADVONTIME(1))
+#define NET_LAN9220_GPMC_CONFIG3       (ADVWROFFTIME(2) | \
+                                        ADVRDOFFTIME(2) | \
+                                        ADVONTIME(1))
+#define NET_LAN9220_GPMC_CONFIG4       (WEOFFTIME(8) | \
+                                        WEONTIME(1) |  \
+                                        OEOFFTIME(7)|  \
+                                        OEONTIME(1))
+#define NET_LAN9220_GPMC_CONFIG5       (PAGEBURSTACCESSTIME(0) | \
+                                        RDACCESSTIME(6)        | \
+                                        WRCYCLETIME(0x1D)      | \
+                                        RDCYCLETIME(0x1D))
+#define NET_LAN9220_GPMC_CONFIG6       ((1 << 31)          | \
+                                        WRACCESSTIME(0x1D) | \
+                                        WRDATAONADMUXBUS(3))
+
+static const u32 gpmc_lan_config[] = {
+       NET_LAN9220_GPMC_CONFIG1,
+       NET_LAN9220_GPMC_CONFIG2,
+       NET_LAN9220_GPMC_CONFIG3,
+       NET_LAN9220_GPMC_CONFIG4,
+       NET_LAN9220_GPMC_CONFIG5,
+       NET_LAN9220_GPMC_CONFIG6,
+       /* CONFIG7: computed by enable_gpmc_cs_config() */
+};
+#endif /* CONFIG_CMD_NET */
+
+/*
+ * Routine: board_init
+ * Description: Early hardware init.
+ */
+int board_init(void)
+{
+       gpmc_init();            /* in SRAM or SDRAM, finish GPMC */
+       /* board id for Linux */
+       gd->bd->bi_arch_number = MACH_TYPE_OMAP3_CPS;
+       /* boot param addr */
+       gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
+
+       return 0;
+}
+
+/*
+ * Routine: misc_init_r
+ * Description: Configure board specific parts
+ */
+int misc_init_r(void)
+{
+       struct gpio *gpio1_base = (struct gpio *)OMAP34XX_GPIO1_BASE;
+       struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
+
+       twl4030_power_init();
+       twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
+
+       /*
+        * GPIO list
+        * - 159 OUT (GPIO5+31): reset for remote camera interface connector.
+        * - 19  OUT (GPIO1+19): integrated speaker amplifier (1=on, 0=shdn).
+        * - 20  OUT (GPIO1+20): handset amplifier (1=on, 0=shdn).
+        */
+
+       /* Configure GPIOs to output */
+       writel(~(GPIO19 | GPIO20), &gpio1_base->oe);
+       writel(~(GPIO31), &gpio5_base->oe);
+
+       /* Set GPIO values */
+       writel((GPIO19 | GPIO20), &gpio1_base->setdataout);
+       writel(0, &gpio5_base->setdataout);
+
+#if defined(CONFIG_CMD_NET)
+       setup_net_chip();
+#endif
+
+       dieid_num_r();
+
+       return 0;
+}
+
+/*
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ *             hardware. Many pins need to be moved from protect to primary
+ *             mode.
+ */
+void set_muxconf_regs(void)
+{
+       MUX_DIG297();
+}
+
+#ifdef CONFIG_CMD_NET
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *           Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+       struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+       /* Configure GPMC registers */
+       enable_gpmc_cs_config(gpmc_lan_config, &gpmc_cfg->cs[5],
+                             CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
+
+       /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+       writew(readw(&ctrl_base->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+       /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+       writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+       /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+       writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+              &ctrl_base->gpmc_nadv_ale);
+
+       /* Make GPIO 12 as output pin and send a magic pulse through it */
+       if (!omap_request_gpio(NET_LAN9221_RESET_GPIO)) {
+               omap_set_gpio_direction(NET_LAN9221_RESET_GPIO, 0);
+               omap_set_gpio_dataout(NET_LAN9221_RESET_GPIO, 1);
+               udelay(1);
+               omap_set_gpio_dataout(NET_LAN9221_RESET_GPIO, 0);
+               udelay(31000);  /* Should be >= 30ms according to datasheet */
+               omap_set_gpio_dataout(NET_LAN9221_RESET_GPIO, 1);
+       }
+}
+#endif /* CONFIG_CMD_NET */
+
+int board_eth_init(bd_t *bis)
+{
+       int rc = 0;
+       rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+       return rc;
+}
diff --git a/board/comelit/dig297/dig297.h b/board/comelit/dig297/dig297.h
new file mode 100644 (file)
index 0000000..68ba7c5
--- /dev/null
@@ -0,0 +1,383 @@
+/*
+ * (C) Copyright 2011 Comelit Group SpA
+ * Luca Ceresoli <luca.ceresoli@comelit.it>
+ *
+ * Based on board/ti/beagle/beagle.h:
+ * (C) Copyright 2008
+ * Dirk Behme <dirk.behme@gmail.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 _DIG297_H_
+#define _DIG297_H_
+
+const omap3_sysinfo sysinfo = {
+       DDR_STACKED,
+       "OMAP3 DIG297 board",
+       "NAND",
+};
+
+/*
+ * IEN  - Input Enable
+ * IDIS - Input Disable
+ * PTD  - Pull type Down
+ * PTU  - Pull type Up
+ * DIS  - Pull type selection is inactive
+ * EN   - Pull type selection is active
+ * M0   - Mode 0
+ * The commented string gives the final mux configuration for that pin
+ */
+#define MUX_DIG297() \
+/*SDRC*/\
+       MUX_VAL(CP(SDRC_D0),        (IEN  | PTD | DIS | M0)) /*SDRC_D0*/\
+       MUX_VAL(CP(SDRC_D1),        (IEN  | PTD | DIS | M0)) /*SDRC_D1*/\
+       MUX_VAL(CP(SDRC_D2),        (IEN  | PTD | DIS | M0)) /*SDRC_D2*/\
+       MUX_VAL(CP(SDRC_D3),        (IEN  | PTD | DIS | M0)) /*SDRC_D3*/\
+       MUX_VAL(CP(SDRC_D4),        (IEN  | PTD | DIS | M0)) /*SDRC_D4*/\
+       MUX_VAL(CP(SDRC_D5),        (IEN  | PTD | DIS | M0)) /*SDRC_D5*/\
+       MUX_VAL(CP(SDRC_D6),        (IEN  | PTD | DIS | M0)) /*SDRC_D6*/\
+       MUX_VAL(CP(SDRC_D7),        (IEN  | PTD | DIS | M0)) /*SDRC_D7*/\
+       MUX_VAL(CP(SDRC_D8),        (IEN  | PTD | DIS | M0)) /*SDRC_D8*/\
+       MUX_VAL(CP(SDRC_D9),        (IEN  | PTD | DIS | M0)) /*SDRC_D9*/\
+       MUX_VAL(CP(SDRC_D10),       (IEN  | PTD | DIS | M0)) /*SDRC_D10*/\
+       MUX_VAL(CP(SDRC_D11),       (IEN  | PTD | DIS | M0)) /*SDRC_D11*/\
+       MUX_VAL(CP(SDRC_D12),       (IEN  | PTD | DIS | M0)) /*SDRC_D12*/\
+       MUX_VAL(CP(SDRC_D13),       (IEN  | PTD | DIS | M0)) /*SDRC_D13*/\
+       MUX_VAL(CP(SDRC_D14),       (IEN  | PTD | DIS | M0)) /*SDRC_D14*/\
+       MUX_VAL(CP(SDRC_D15),       (IEN  | PTD | DIS | M0)) /*SDRC_D15*/\
+       MUX_VAL(CP(SDRC_D16),       (IEN  | PTD | DIS | M0)) /*SDRC_D16*/\
+       MUX_VAL(CP(SDRC_D17),       (IEN  | PTD | DIS | M0)) /*SDRC_D17*/\
+       MUX_VAL(CP(SDRC_D18),       (IEN  | PTD | DIS | M0)) /*SDRC_D18*/\
+       MUX_VAL(CP(SDRC_D19),       (IEN  | PTD | DIS | M0)) /*SDRC_D19*/\
+       MUX_VAL(CP(SDRC_D20),       (IEN  | PTD | DIS | M0)) /*SDRC_D20*/\
+       MUX_VAL(CP(SDRC_D21),       (IEN  | PTD | DIS | M0)) /*SDRC_D21*/\
+       MUX_VAL(CP(SDRC_D22),       (IEN  | PTD | DIS | M0)) /*SDRC_D22*/\
+       MUX_VAL(CP(SDRC_D23),       (IEN  | PTD | DIS | M0)) /*SDRC_D23*/\
+       MUX_VAL(CP(SDRC_D24),       (IEN  | PTD | DIS | M0)) /*SDRC_D24*/\
+       MUX_VAL(CP(SDRC_D25),       (IEN  | PTD | DIS | M0)) /*SDRC_D25*/\
+       MUX_VAL(CP(SDRC_D26),       (IEN  | PTD | DIS | M0)) /*SDRC_D26*/\
+       MUX_VAL(CP(SDRC_D27),       (IEN  | PTD | DIS | M0)) /*SDRC_D27*/\
+       MUX_VAL(CP(SDRC_D28),       (IEN  | PTD | DIS | M0)) /*SDRC_D28*/\
+       MUX_VAL(CP(SDRC_D29),       (IEN  | PTD | DIS | M0)) /*SDRC_D29*/\
+       MUX_VAL(CP(SDRC_D30),       (IEN  | PTD | DIS | M0)) /*SDRC_D30*/\
+       MUX_VAL(CP(SDRC_D31),       (IEN  | PTD | DIS | M0)) /*SDRC_D31*/\
+       MUX_VAL(CP(SDRC_CLK),       (IEN  | PTD | DIS | M0)) /*SDRC_CLK*/\
+       MUX_VAL(CP(SDRC_DQS0),      (IEN  | PTD | DIS | M0)) /*SDRC_DQS0*/\
+       MUX_VAL(CP(SDRC_DQS1),      (IEN  | PTD | DIS | M0)) /*SDRC_DQS1*/\
+       MUX_VAL(CP(SDRC_DQS2),      (IEN  | PTD | DIS | M0)) /*SDRC_DQS2*/\
+       MUX_VAL(CP(SDRC_DQS3),      (IEN  | PTD | DIS | M0)) /*SDRC_DQS3*/\
+       MUX_VAL(CP(SDRC_CKE0),      (IDIS | PTU | EN  | M0)) /*sdrc_cke0*/\
+       MUX_VAL(CP(SDRC_CKE1),      (IDIS | PTU | DIS | M0)) /*sdrc_cke1: NC*/\
+/*GPMC*/\
+       MUX_VAL(CP(GPMC_A1),        (IDIS | PTU | EN  | M0)) /*GPMC_A1*/\
+       MUX_VAL(CP(GPMC_A2),        (IDIS | PTU | EN  | M0)) /*GPMC_A2*/\
+       MUX_VAL(CP(GPMC_A3),        (IDIS | PTU | EN  | M0)) /*GPMC_A3*/\
+       MUX_VAL(CP(GPMC_A4),        (IDIS | PTU | EN  | M0)) /*GPMC_A4*/\
+       MUX_VAL(CP(GPMC_A5),        (IDIS | PTU | EN  | M0)) /*GPMC_A5*/\
+       MUX_VAL(CP(GPMC_A6),        (IDIS | PTU | EN  | M0)) /*GPMC_A6*/\
+       MUX_VAL(CP(GPMC_A7),        (IDIS | PTU | EN  | M0)) /*GPMC_A7*/\
+       MUX_VAL(CP(GPMC_A8),        (IDIS | PTU | EN  | M0)) /*GPMC_A8*/\
+       MUX_VAL(CP(GPMC_A9),        (IDIS | PTU | EN  | M0)) /*GPMC_A9*/\
+       MUX_VAL(CP(GPMC_A10),       (IDIS | PTU | EN  | M0)) /*GPMC_A10*/\
+       MUX_VAL(CP(GPMC_D0),        (IEN  | PTU | EN  | M0)) /*GPMC_D0*/\
+       MUX_VAL(CP(GPMC_D1),        (IEN  | PTU | EN  | M0)) /*GPMC_D1*/\
+       MUX_VAL(CP(GPMC_D2),        (IEN  | PTU | EN  | M0)) /*GPMC_D2*/\
+       MUX_VAL(CP(GPMC_D3),        (IEN  | PTU | EN  | M0)) /*GPMC_D3*/\
+       MUX_VAL(CP(GPMC_D4),        (IEN  | PTU | EN  | M0)) /*GPMC_D4*/\
+       MUX_VAL(CP(GPMC_D5),        (IEN  | PTU | EN  | M0)) /*GPMC_D5*/\
+       MUX_VAL(CP(GPMC_D6),        (IEN  | PTU | EN  | M0)) /*GPMC_D6*/\
+       MUX_VAL(CP(GPMC_D7),        (IEN  | PTU | EN  | M0)) /*GPMC_D7*/\
+       MUX_VAL(CP(GPMC_D8),        (IEN  | PTU | EN  | M0)) /*GPMC_D8*/\
+       MUX_VAL(CP(GPMC_D9),        (IEN  | PTU | EN  | M0)) /*GPMC_D9*/\
+       MUX_VAL(CP(GPMC_D10),       (IEN  | PTU | EN  | M0)) /*GPMC_D10*/\
+       MUX_VAL(CP(GPMC_D11),       (IEN  | PTU | EN  | M0)) /*GPMC_D11*/\
+       MUX_VAL(CP(GPMC_D12),       (IEN  | PTU | EN  | M0)) /*GPMC_D12*/\
+       MUX_VAL(CP(GPMC_D13),       (IEN  | PTU | EN  | M0)) /*GPMC_D13*/\
+       MUX_VAL(CP(GPMC_D14),       (IEN  | PTU | EN  | M0)) /*GPMC_D14*/\
+       MUX_VAL(CP(GPMC_D15),       (IEN  | PTU | EN  | M0)) /*GPMC_D15*/\
+       MUX_VAL(CP(GPMC_NCS0),      (IDIS | PTU | EN  | M0)) /*NAND*/\
+       /* GPMC_nCS1/2: not available on CUS package*/\
+       MUX_VAL(CP(GPMC_NCS3),      (IDIS | PTU | DIS | M0)) /*GPMC_nCS3*/\
+       MUX_VAL(CP(GPMC_NCS4),      (IDIS | PTU | DIS | M0)) /*GPMC_nCS4*/\
+       MUX_VAL(CP(GPMC_NCS5),      (IDIS | PTU | EN  | M0)) /*GPMC_nCS5*/\
+       MUX_VAL(CP(GPMC_NCS6),      (IEN  | PTD | DIS | M1)) /*SYS_nDMA_REQ2*/\
+       MUX_VAL(CP(GPMC_NCS7),      (IEN  | PTU | EN  | M1)) /*SYS_nDMA_REQ3*/\
+       MUX_VAL(CP(GPMC_NBE1),      (IDIS | PTD | DIS | M0)) /*GPMC_nBE1: NC*/\
+       /* GPMC_WAIT2: not available on CUS package*/\
+       MUX_VAL(CP(GPMC_WAIT3),     (IDIS | PTU | DIS | M0)) /*GPMC_WAIT3: NC*/\
+       /* GPMC_CLK: NC (only asyncronous peripherals are connected) */\
+       MUX_VAL(CP(GPMC_CLK),       (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(GPMC_NADV_ALE),  (IDIS | PTD | DIS | M0)) /*GPMC_nADV_ALE*/\
+       MUX_VAL(CP(GPMC_NOE),       (IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\
+       MUX_VAL(CP(GPMC_NWE),       (IDIS | PTD | DIS | M0)) /*GPMC_nWE*/\
+       MUX_VAL(CP(GPMC_NBE0_CLE),  (IDIS | PTD | DIS | M0)) /*GPMC_nBE0_CLE*/\
+       MUX_VAL(CP(GPMC_NWP),       (IEN  | PTD | DIS | M0)) /*GPMC_nWP*/\
+       MUX_VAL(CP(GPMC_WAIT0),     (IEN  | PTU | EN  | M0)) /*GPMC_WAIT0*/\
+       /* GPMC_WAIT1: not available on CUS package*/\
+/*DSS*/\
+       MUX_VAL(CP(DSS_PCLK),       (IDIS | PTD | DIS | M0)) /*DSS_PCLK*/\
+       MUX_VAL(CP(DSS_HSYNC),      (IDIS | PTD | DIS | M0)) /*DSS_HSYNC*/\
+       MUX_VAL(CP(DSS_VSYNC),      (IDIS | PTD | DIS | M0)) /*DSS_VSYNC*/\
+       /* DSS_ACBIAS: AC BIAS: connected to TFT, not to be driven */\
+       MUX_VAL(CP(DSS_ACBIAS),     (IDIS | PTU | EN  | M7))\
+       MUX_VAL(CP(DSS_DATA0),      (IDIS | PTD | DIS | M0)) /*DSS_DATA0*/\
+       MUX_VAL(CP(DSS_DATA1),      (IDIS | PTD | DIS | M0)) /*DSS_DATA1*/\
+       MUX_VAL(CP(DSS_DATA2),      (IDIS | PTD | DIS | M0)) /*DSS_DATA2*/\
+       MUX_VAL(CP(DSS_DATA3),      (IDIS | PTD | DIS | M0)) /*DSS_DATA3*/\
+       MUX_VAL(CP(DSS_DATA4),      (IDIS | PTD | DIS | M0)) /*DSS_DATA4*/\
+       MUX_VAL(CP(DSS_DATA5),      (IDIS | PTD | DIS | M0)) /*DSS_DATA5*/\
+       MUX_VAL(CP(DSS_DATA6),      (IDIS | PTD | DIS | M0)) /*DSS_DATA6*/\
+       MUX_VAL(CP(DSS_DATA7),      (IDIS | PTD | DIS | M0)) /*DSS_DATA7*/\
+       MUX_VAL(CP(DSS_DATA8),      (IDIS | PTD | DIS | M0)) /*DSS_DATA8*/\
+       MUX_VAL(CP(DSS_DATA9),      (IDIS | PTD | DIS | M0)) /*DSS_DATA9*/\
+       MUX_VAL(CP(DSS_DATA10),     (IDIS | PTD | DIS | M0)) /*DSS_DATA10*/\
+       MUX_VAL(CP(DSS_DATA11),     (IDIS | PTD | DIS | M0)) /*DSS_DATA11*/\
+       MUX_VAL(CP(DSS_DATA12),     (IDIS | PTD | DIS | M0)) /*DSS_DATA12*/\
+       MUX_VAL(CP(DSS_DATA13),     (IDIS | PTD | DIS | M0)) /*DSS_DATA13*/\
+       MUX_VAL(CP(DSS_DATA14),     (IDIS | PTD | DIS | M0)) /*DSS_DATA14*/\
+       MUX_VAL(CP(DSS_DATA15),     (IDIS | PTD | DIS | M0)) /*DSS_DATA15*/\
+       MUX_VAL(CP(DSS_DATA16),     (IDIS | PTD | DIS | M0)) /*DSS_DATA16*/\
+       MUX_VAL(CP(DSS_DATA17),     (IDIS | PTD | DIS | M0)) /*DSS_DATA17*/\
+       MUX_VAL(CP(DSS_DATA18),     (IDIS | PTD | DIS | M0)) /*DSS_DATA18*/\
+       MUX_VAL(CP(DSS_DATA19),     (IDIS | PTD | DIS | M0)) /*DSS_DATA19*/\
+       MUX_VAL(CP(DSS_DATA20),     (IDIS | PTD | DIS | M0)) /*DSS_DATA20*/\
+       MUX_VAL(CP(DSS_DATA21),     (IDIS | PTD | DIS | M0)) /*DSS_DATA21*/\
+       MUX_VAL(CP(DSS_DATA22),     (IDIS | PTD | DIS | M0)) /*DSS_DATA22*/\
+       MUX_VAL(CP(DSS_DATA23),     (IDIS | PTD | DIS | M0)) /*DSS_DATA23*/\
+/*CAMERA*/\
+       MUX_VAL(CP(CAM_HS),         (IEN  | PTU | EN  | M0)) /*CAM_HS */\
+       MUX_VAL(CP(CAM_VS),         (IEN  | PTU | EN  | M0)) /*CAM_VS */\
+       MUX_VAL(CP(CAM_XCLKA),      (IDIS | PTD | DIS | M0)) /*CAM_XCLKA*/\
+       MUX_VAL(CP(CAM_PCLK),       (IEN  | PTU | EN  | M0)) /*CAM_PCLK*/\
+       MUX_VAL(CP(CAM_FLD),        (IDIS | PTD | DIS | M4)) /*GPIO_98*/\
+       MUX_VAL(CP(CAM_D0),         (IEN  | PTD | DIS | M0)) /*CAM_D0*/\
+       MUX_VAL(CP(CAM_D1),         (IEN  | PTD | DIS | M0)) /*CAM_D1*/\
+       MUX_VAL(CP(CAM_D2),         (IEN  | PTD | DIS | M0)) /*CAM_D2*/\
+       MUX_VAL(CP(CAM_D3),         (IEN  | PTD | DIS | M0)) /*CAM_D3*/\
+       MUX_VAL(CP(CAM_D4),         (IEN  | PTD | DIS | M0)) /*CAM_D4*/\
+       MUX_VAL(CP(CAM_D5),         (IEN  | PTD | DIS | M0)) /*CAM_D5*/\
+       MUX_VAL(CP(CAM_D6),         (IEN  | PTD | DIS | M0)) /*CAM_D6*/\
+       MUX_VAL(CP(CAM_D7),         (IEN  | PTD | DIS | M0)) /*CAM_D7*/\
+       MUX_VAL(CP(CAM_D8),         (IEN  | PTD | DIS | M0)) /*CAM_D8*/\
+       MUX_VAL(CP(CAM_D9),         (IEN  | PTD | DIS | M0)) /*CAM_D9*/\
+       MUX_VAL(CP(CAM_D10),        (IEN  | PTD | DIS | M0)) /*CAM_D10*/\
+       MUX_VAL(CP(CAM_D11),        (IEN  | PTD | DIS | M0)) /*CAM_D11*/\
+       MUX_VAL(CP(CAM_XCLKB),      (IDIS | PTD | DIS | M0)) /*CAM_XCLKB*/\
+       MUX_VAL(CP(CAM_WEN),        (IEN  | PTD | DIS | M4)) /*GPIO_167*/\
+       MUX_VAL(CP(CAM_STROBE),     (IDIS | PTD | DIS | M0)) /*CAM_STROBE*/\
+       MUX_VAL(CP(CSI2_DX0),       (IEN  | PTD | DIS | M0)) /*CSI2_DX0*/\
+       MUX_VAL(CP(CSI2_DY0),       (IEN  | PTD | DIS | M0)) /*CSI2_DY0*/\
+       MUX_VAL(CP(CSI2_DX1),       (IEN  | PTD | DIS | M0)) /*CSI2_DX1*/\
+       MUX_VAL(CP(CSI2_DY1),       (IEN  | PTD | DIS | M0)) /*CSI2_DY1*/\
+/*Audio Interface */\
+       MUX_VAL(CP(MCBSP2_FSX),     (IEN  | PTD | DIS | M0)) /*McBSP2_FSX*/\
+       MUX_VAL(CP(MCBSP2_CLKX),    (IEN  | PTD | DIS | M0)) /*McBSP2_CLKX*/\
+       MUX_VAL(CP(MCBSP2_DR),      (IEN  | PTD | DIS | M0)) /*McBSP2_DR*/\
+       MUX_VAL(CP(MCBSP2_DX),      (IDIS | PTD | DIS | M0)) /*McBSP2_DX*/\
+/*Expansion card */\
+       MUX_VAL(CP(MMC1_CLK),       (IDIS | PTU | EN  | M0)) /*MMC1_CLK*/\
+       MUX_VAL(CP(MMC1_CMD),       (IEN  | PTU | EN  | M0)) /*MMC1_CMD*/\
+       MUX_VAL(CP(MMC1_DAT0),      (IEN  | PTU | EN  | M0)) /*MMC1_DAT0*/\
+       MUX_VAL(CP(MMC1_DAT1),      (IEN  | PTU | EN  | M0)) /*MMC1_DAT1*/\
+       MUX_VAL(CP(MMC1_DAT2),      (IEN  | PTU | EN  | M0)) /*MMC1_DAT2*/\
+       MUX_VAL(CP(MMC1_DAT3),      (IEN  | PTU | EN  | M0)) /*MMC1_DAT3*/\
+       MUX_VAL(CP(MMC1_DAT4),      (IEN  | PTU | EN  | M0)) /*MMC1_DAT4*/\
+       MUX_VAL(CP(MMC1_DAT5),      (IEN  | PTU | EN  | M0)) /*MMC1_DAT5*/\
+       MUX_VAL(CP(MMC1_DAT6),      (IEN  | PTU | EN  | M0)) /*MMC1_DAT6*/\
+       MUX_VAL(CP(MMC1_DAT7),      (IEN  | PTU | EN  | M0)) /*MMC1_DAT7*/\
+/*Wireless LAN */\
+       MUX_VAL(CP(MMC2_CLK),       (IEN  | PTU | EN  | M4)) /*GPIO_130*/\
+       MUX_VAL(CP(MMC2_CMD),       (IEN  | PTU | EN  | M4)) /*GPIO_131*/\
+       MUX_VAL(CP(MMC2_DAT0),      (IEN  | PTU | EN  | M4)) /*GPIO_132*/\
+       MUX_VAL(CP(MMC2_DAT1),      (IEN  | PTU | EN  | M4)) /*GPIO_133*/\
+       MUX_VAL(CP(MMC2_DAT2),      (IEN  | PTU | EN  | M4)) /*GPIO_134*/\
+       MUX_VAL(CP(MMC2_DAT3),      (IEN  | PTU | EN  | M4)) /*GPIO_135*/\
+       MUX_VAL(CP(MMC2_DAT4),      (IEN  | PTU | EN  | M4)) /*GPIO_136*/\
+       MUX_VAL(CP(MMC2_DAT5),      (IEN  | PTU | EN  | M4)) /*GPIO_137*/\
+       MUX_VAL(CP(MMC2_DAT6),      (IEN  | PTU | EN  | M4)) /*GPIO_138*/\
+       MUX_VAL(CP(MMC2_DAT7),      (IEN  | PTU | EN  | M4)) /*GPIO_139*/\
+/*Bluetooth*/\
+       MUX_VAL(CP(MCBSP3_DX),      (IEN  | PTD | DIS | M1)) /*UART2_CTS*/\
+       MUX_VAL(CP(MCBSP3_DR),      (IDIS | PTD | DIS | M1)) /*UART2_RTS*/\
+       MUX_VAL(CP(MCBSP3_CLKX),    (IDIS | PTD | DIS | M1)) /*UART2_TX*/\
+       MUX_VAL(CP(MCBSP3_FSX),     (IEN  | PTD | DIS | M1)) /*UART2_RX*/\
+       MUX_VAL(CP(UART2_CTS),      (IEN  | PTD | DIS | M4)) /*GPIO_144*/\
+       MUX_VAL(CP(UART2_RTS),      (IEN  | PTD | DIS | M4)) /*GPIO_145*/\
+       MUX_VAL(CP(UART2_TX),       (IEN  | PTD | DIS | M4)) /*GPIO_146*/\
+       MUX_VAL(CP(UART2_RX),       (IEN  | PTD | DIS | M4)) /*GPIO_147*/\
+/*Modem Interface */\
+       MUX_VAL(CP(UART1_TX),       (IDIS | PTD | DIS | M0)) /*UART1_TX*/\
+       MUX_VAL(CP(UART1_RTS),      (IDIS | PTD | DIS | M4)) /*GPIO_149*/ \
+       MUX_VAL(CP(UART1_CTS),      (IDIS | PTD | DIS | M4)) /*GPIO_150*/ \
+       MUX_VAL(CP(UART1_RX),       (IEN  | PTD | DIS | M0)) /*UART1_RX*/\
+       MUX_VAL(CP(MCBSP4_CLKX),    (IEN  | PTD | DIS | M1)) /*SSI1_DAT_RX*/\
+       MUX_VAL(CP(MCBSP4_DR),      (IEN  | PTD | DIS | M1)) /*SSI1_FLAG_RX*/\
+       MUX_VAL(CP(MCBSP4_DX),      (IEN  | PTD | DIS | M1)) /*SSI1_RDY_RX*/\
+       MUX_VAL(CP(MCBSP4_FSX),     (IEN  | PTD | DIS | M1)) /*SSI1_WAKE*/\
+       MUX_VAL(CP(MCBSP_CLKS),     (IEN  | PTU | DIS | M0)) /*McBSP_CLKS*/\
+/*Serial Interface*/\
+       MUX_VAL(CP(UART3_CTS_RCTX), (IEN  | PTD | EN  | M0)) /*UART3_CTS_RCTX*/\
+       MUX_VAL(CP(UART3_RX_IRRX),  (IEN  | PTD | DIS | M0)) /*UART3_RX_IRRX*/\
+       MUX_VAL(CP(UART3_TX_IRTX),  (IDIS | PTD | DIS | M0)) /*UART3_TX_IRTX*/\
+       MUX_VAL(CP(HSUSB0_CLK),     (IEN  | PTD | DIS | M0)) /*HSUSB0_CLK*/\
+       MUX_VAL(CP(HSUSB0_STP),     (IDIS | PTU | EN  | M0)) /*HSUSB0_STP*/\
+       MUX_VAL(CP(HSUSB0_DIR),     (IEN  | PTD | DIS | M0)) /*HSUSB0_DIR*/\
+       MUX_VAL(CP(HSUSB0_NXT),     (IEN  | PTD | DIS | M0)) /*HSUSB0_NXT*/\
+       MUX_VAL(CP(HSUSB0_DATA0),   (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA0*/\
+       MUX_VAL(CP(HSUSB0_DATA1),   (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA1*/\
+       MUX_VAL(CP(HSUSB0_DATA2),   (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA2*/\
+       MUX_VAL(CP(HSUSB0_DATA3),   (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA3*/\
+       MUX_VAL(CP(HSUSB0_DATA4),   (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA4*/\
+       MUX_VAL(CP(HSUSB0_DATA5),   (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA5*/\
+       MUX_VAL(CP(HSUSB0_DATA6),   (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA6*/\
+       MUX_VAL(CP(HSUSB0_DATA7),   (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA7*/\
+       MUX_VAL(CP(I2C1_SCL),       (IEN  | PTU | EN  | M0)) /*I2C1_SCL*/\
+       MUX_VAL(CP(I2C1_SDA),       (IEN  | PTU | EN  | M0)) /*I2C1_SDA*/\
+       MUX_VAL(CP(I2C2_SCL),       (IEN  | PTU | EN  | M4)) /*GPIO_168*/\
+       MUX_VAL(CP(I2C2_SDA),       (IEN  | PTU | EN  | M4)) /*GPIO_183*/\
+       MUX_VAL(CP(I2C3_SCL),       (IEN  | PTU | EN  | M0)) /*I2C3_SCL*/\
+       MUX_VAL(CP(I2C3_SDA),       (IEN  | PTU | EN  | M0)) /*I2C3_SDA*/\
+       MUX_VAL(CP(I2C4_SCL),       (IEN  | PTU | EN  | M0)) /*I2C4_SCL*/\
+       MUX_VAL(CP(I2C4_SDA),       (IEN  | PTU | EN  | M0)) /*I2C4_SDA*/\
+/* USB EHCI (port 2) */\
+       MUX_VAL(CP(ETK_D14_ES2),    (IEN  | PTU | DIS | M3)) /*HSUSB2_DATA0*/\
+       MUX_VAL(CP(ETK_D15_ES2),    (IEN  | PTU | DIS | M3)) /*HSUSB2_DATA1*/\
+/* MCSPI1: to TOUCH controller TSC2046 (ADS7846 compatible).*/\
+       /*
+        * McSPI1_CLK.
+        * IEN needed fot the McSPI to "receive" the clock and be able to
+        * sample SOMI. See http://e2e.ti.com/support/arm174_microprocessors/
+        * omap_applications_processors/f/42/p/29444/102394.aspx#102394
+        */\
+       MUX_VAL(CP(MCSPI1_CLK),     (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(MCSPI1_SIMO),    (IDIS | PTD | EN  | M0)) /*McSPI1_SIMO*/\
+       MUX_VAL(CP(MCSPI1_SOMI),    (IEN  | PTD | EN  | M0)) /*McSPI1_SOMI*/\
+       MUX_VAL(CP(MCSPI1_CS0),     (IDIS | PTU | EN  | M0)) /*McSPI1_CS0*/\
+/* MCSPI2: to HIMAX TFT controller.*/\
+       MUX_VAL(CP(MCSPI2_CLK),     (IDIS | PTD | EN  | M0)) /*MCSPI2_CLK*/\
+       MUX_VAL(CP(MCSPI2_SIMO),    (IDIS | PTD | EN  | M0)) /*MCSPI3_SIMO*/\
+       /* MCSPI3_SOMI: NC because HIMAX in monodirectional (no SOMI line) */\
+       MUX_VAL(CP(MCSPI2_SOMI),    (IDIS | PTU | DIS | M7))\
+       MUX_VAL(CP(MCSPI2_CS0),     (IDIS | PTU | EN  | M0)) /*MCSPI3_CS0*/\
+       MUX_VAL(CP(MCSPI2_CS1),     (IDIS | PTU | DIS | M7)) /*Safe mode: NC*/\
+/* GPIO */\
+       MUX_VAL(CP(SYS_BOOT5),      (IEN  | PTD | DIS | M4)) /*GPIO_7*/\
+       MUX_VAL(CP(ETK_CLK_ES2),    (IDIS | PTU | EN  | M4)) /*GPIO_12*/\
+       MUX_VAL(CP(ETK_CTL_ES2),    (IEN  | PTU | EN  | M4)) /*GPIO_13*/\
+       MUX_VAL(CP(ETK_D0_ES2),     (IEN  | PTU | DIS | M4)) /*GPIO_14*/\
+       MUX_VAL(CP(ETK_D1_ES2),     (IDIS | PTD | EN  | M4)) /*GPIO_15*/\
+       MUX_VAL(CP(ETK_D2_ES2),     (IDIS | PTD | EN  | M4)) /*GPIO_16*/\
+       MUX_VAL(CP(ETK_D3_ES2),     (IEN  | PTU | DIS | M4)) /*GPIO_17*/\
+       MUX_VAL(CP(ETK_D4_ES2),     (IDIS | PTD | EN  | M4)) /*GPIO_18*/\
+       MUX_VAL(CP(ETK_D5_ES2),     (IDIS | PTD | EN  | M4)) /*GPIO_19*/\
+       MUX_VAL(CP(ETK_D6_ES2),     (IDIS | PTD | EN  | M4)) /*GPIO_20*/\
+       MUX_VAL(CP(ETK_D7_ES2),     (IDIS | PTD | EN  | M4)) /*GPIO_21*/\
+       MUX_VAL(CP(ETK_D9_ES2),     (IEN  | PTU | DIS | M4)) /*GPIO_23*/\
+       MUX_VAL(CP(ETK_D10_ES2),    (IDIS | PTD | EN  | M4)) /*GPIO_24*/\
+       MUX_VAL(CP(ETK_D11_ES2),    (IDIS | PTD | EN  | M4)) /*GPIO_25*/\
+       MUX_VAL(CP(ETK_D12_ES2),    (IDIS | PTD | EN  | M4)) /*GPIO_26*/\
+       MUX_VAL(CP(ETK_D13_ES2),    (IDIS | PTD | EN  | M4)) /*GPIO_27*/\
+       MUX_VAL(CP(MCBSP1_CLKR),    (IEN  | PTD | DIS | M4)) /*GPIO_156*/\
+       MUX_VAL(CP(MCBSP1_FSR),     (IEN  | PTU | EN  | M4)) /*GPIO_157*/\
+       MUX_VAL(CP(MCBSP1_DX),      (IEN  | PTD | DIS | M4)) /*GPIO_158*/\
+       MUX_VAL(CP(MCBSP1_DR),      (IDIS | PTD | DIS | M4)) /*GPIO_159*/\
+       MUX_VAL(CP(MCBSP1_FSX),     (IEN  | PTD | DIS | M4)) /*GPIO_161*/\
+       MUX_VAL(CP(MCBSP1_CLKX),    (IEN  | PTD | DIS | M4)) /*GPIO_162*/\
+       MUX_VAL(CP(UART3_RTS_SD),   (IDIS | PTD | EN  | M4)) /*GPIO_164*/\
+       MUX_VAL(CP(HDQ_SIO),        (IDIS | PTU | DIS | M4)) /*GPIO_170*/\
+       MUX_VAL(CP(MCSPI1_CS3),     (IEN  | PTU | EN  | M4)) /*GPIO_177*/\
+/*Control and debug */\
+       MUX_VAL(CP(SYS_32K),        (IEN  | PTD | DIS | M0)) /*SYS_32K*/\
+       MUX_VAL(CP(SYS_CLKREQ),     (IEN  | PTD | DIS | M0)) /*SYS_CLKREQ*/\
+       MUX_VAL(CP(SYS_NIRQ),       (IEN  | PTU | EN  | M0)) /*SYS_nIRQ*/\
+       MUX_VAL(CP(SYS_BOOT0),      (IEN  | PTD | DIS | M4)) /*GPIO_2*/\
+       MUX_VAL(CP(SYS_BOOT1),      (IEN  | PTD | DIS | M4)) /*GPIO_3*/\
+       MUX_VAL(CP(SYS_BOOT2),      (IEN  | PTD | DIS | M4)) /*GPIO_4*/\
+       MUX_VAL(CP(SYS_BOOT3),      (IEN  | PTD | DIS | M4)) /*GPIO_5*/\
+       MUX_VAL(CP(SYS_BOOT4),      (IEN  | PTD | DIS | M4)) /*GPIO_6*/\
+       MUX_VAL(CP(SYS_BOOT6),      (IDIS | PTD | DIS | M4)) /*GPIO_8*/ \
+       MUX_VAL(CP(SYS_OFF_MODE),   (IEN  | PTD | DIS | M0)) /*SYS_OFF_MODE*/\
+       MUX_VAL(CP(SYS_CLKOUT1),    (IEN  | PTD | DIS | M0)) /*SYS_CLKOUT1*/\
+       MUX_VAL(CP(SYS_CLKOUT2),    (IEN  | PTU | EN  | M4)) /*GPIO_186*/\
+       MUX_VAL(CP(ETK_D8_ES2),     (IEN  | PTU | DIS | M3)) /*HSUSB1_DIR*/\
+       MUX_VAL(CP(D2D_MCAD1),      (IEN  | PTD | EN  | M0)) /*d2d_mcad1*/\
+       MUX_VAL(CP(D2D_MCAD2),      (IEN  | PTD | EN  | M0)) /*d2d_mcad2*/\
+       MUX_VAL(CP(D2D_MCAD3),      (IEN  | PTD | EN  | M0)) /*d2d_mcad3*/\
+       MUX_VAL(CP(D2D_MCAD4),      (IEN  | PTD | EN  | M0)) /*d2d_mcad4*/\
+       MUX_VAL(CP(D2D_MCAD5),      (IEN  | PTD | EN  | M0)) /*d2d_mcad5*/\
+       MUX_VAL(CP(D2D_MCAD6),      (IEN  | PTD | EN  | M0)) /*d2d_mcad6*/\
+       MUX_VAL(CP(D2D_MCAD7),      (IEN  | PTD | EN  | M0)) /*d2d_mcad7*/\
+       MUX_VAL(CP(D2D_MCAD8),      (IEN  | PTD | EN  | M0)) /*d2d_mcad8*/\
+       MUX_VAL(CP(D2D_MCAD9),      (IEN  | PTD | EN  | M0)) /*d2d_mcad9*/\
+       MUX_VAL(CP(D2D_MCAD10),     (IEN  | PTD | EN  | M0)) /*d2d_mcad10*/\
+       MUX_VAL(CP(D2D_MCAD11),     (IEN  | PTD | EN  | M0)) /*d2d_mcad11*/\
+       MUX_VAL(CP(D2D_MCAD12),     (IEN  | PTD | EN  | M0)) /*d2d_mcad12*/\
+       MUX_VAL(CP(D2D_MCAD13),     (IEN  | PTD | EN  | M0)) /*d2d_mcad13*/\
+       MUX_VAL(CP(D2D_MCAD14),     (IEN  | PTD | EN  | M0)) /*d2d_mcad14*/\
+       MUX_VAL(CP(D2D_MCAD15),     (IEN  | PTD | EN  | M0)) /*d2d_mcad15*/\
+       MUX_VAL(CP(D2D_MCAD16),     (IEN  | PTD | EN  | M0)) /*d2d_mcad16*/\
+       MUX_VAL(CP(D2D_MCAD17),     (IEN  | PTD | EN  | M0)) /*d2d_mcad17*/\
+       MUX_VAL(CP(D2D_MCAD18),     (IEN  | PTD | EN  | M0)) /*d2d_mcad18*/\
+       MUX_VAL(CP(D2D_MCAD19),     (IEN  | PTD | EN  | M0)) /*d2d_mcad19*/\
+       MUX_VAL(CP(D2D_MCAD20),     (IEN  | PTD | EN  | M0)) /*d2d_mcad20*/\
+       MUX_VAL(CP(D2D_MCAD21),     (IEN  | PTD | EN  | M0)) /*d2d_mcad21*/\
+       MUX_VAL(CP(D2D_MCAD22),     (IEN  | PTD | EN  | M0)) /*d2d_mcad22*/\
+       MUX_VAL(CP(D2D_MCAD23),     (IEN  | PTD | EN  | M0)) /*d2d_mcad23*/\
+       MUX_VAL(CP(D2D_MCAD24),     (IEN  | PTD | EN  | M0)) /*d2d_mcad24*/\
+       MUX_VAL(CP(D2D_MCAD25),     (IEN  | PTD | EN  | M0)) /*d2d_mcad25*/\
+       MUX_VAL(CP(D2D_MCAD26),     (IEN  | PTD | EN  | M0)) /*d2d_mcad26*/\
+       MUX_VAL(CP(D2D_MCAD27),     (IEN  | PTD | EN  | M0)) /*d2d_mcad27*/\
+       MUX_VAL(CP(D2D_MCAD28),     (IEN  | PTD | EN  | M0)) /*d2d_mcad28*/\
+       MUX_VAL(CP(D2D_MCAD29),     (IEN  | PTD | EN  | M0)) /*d2d_mcad29*/\
+       MUX_VAL(CP(D2D_MCAD30),     (IEN  | PTD | EN  | M0)) /*d2d_mcad30*/\
+       MUX_VAL(CP(D2D_MCAD31),     (IEN  | PTD | EN  | M0)) /*d2d_mcad31*/\
+       MUX_VAL(CP(D2D_MCAD32),     (IEN  | PTD | EN  | M0)) /*d2d_mcad32*/\
+       MUX_VAL(CP(D2D_MCAD33),     (IEN  | PTD | EN  | M0)) /*d2d_mcad33*/\
+       MUX_VAL(CP(D2D_MCAD34),     (IEN  | PTD | EN  | M0)) /*d2d_mcad34*/\
+       MUX_VAL(CP(D2D_MCAD35),     (IEN  | PTD | EN  | M0)) /*d2d_mcad35*/\
+       MUX_VAL(CP(D2D_MCAD36),     (IEN  | PTD | EN  | M0)) /*d2d_mcad36*/\
+       MUX_VAL(CP(D2D_CLK26MI),    (IEN  | PTD | DIS | M0)) /*d2d_clk26mi*/\
+       MUX_VAL(CP(D2D_NRESPWRON),  (IEN  | PTD | EN  | M0)) /*d2d_nrespwron*/\
+       MUX_VAL(CP(D2D_NRESWARM),   (IEN  | PTU | EN  | M0)) /*d2d_nreswarm */\
+       MUX_VAL(CP(D2D_ARM9NIRQ),   (IEN  | PTD | DIS | M0)) /*d2d_arm9nirq */\
+       MUX_VAL(CP(D2D_UMA2P6FIQ),  (IEN  | PTD | DIS | M0)) /*d2d_uma2p6fiq*/\
+       MUX_VAL(CP(D2D_SPINT),      (IEN  | PTD | EN  | M0)) /*d2d_spint*/\
+       MUX_VAL(CP(D2D_FRINT),      (IEN  | PTD | EN  | M0)) /*d2d_frint*/\
+       MUX_VAL(CP(D2D_DMAREQ0),    (IEN  | PTD | DIS | M0)) /*d2d_dmareq0*/\
+       MUX_VAL(CP(D2D_DMAREQ1),    (IEN  | PTD | DIS | M0)) /*d2d_dmareq1*/\
+       MUX_VAL(CP(D2D_DMAREQ2),    (IEN  | PTD | DIS | M0)) /*d2d_dmareq2*/\
+       MUX_VAL(CP(D2D_DMAREQ3),    (IEN  | PTD | DIS | M0)) /*d2d_dmareq3*/\
+       MUX_VAL(CP(D2D_N3GTRST),    (IEN  | PTD | DIS | M0)) /*d2d_n3gtrst*/\
+       MUX_VAL(CP(D2D_N3GTDI),     (IEN  | PTD | DIS | M0)) /*d2d_n3gtdi*/\
+       MUX_VAL(CP(D2D_N3GTDO),     (IEN  | PTD | DIS | M0)) /*d2d_n3gtdo*/\
+       MUX_VAL(CP(D2D_N3GTMS),     (IEN  | PTD | DIS | M0)) /*d2d_n3gtms*/\
+       MUX_VAL(CP(D2D_N3GTCK),     (IEN  | PTD | DIS | M0)) /*d2d_n3gtck*/\
+       MUX_VAL(CP(D2D_N3GRTCK),    (IEN  | PTD | DIS | M0)) /*d2d_n3grtck*/\
+       MUX_VAL(CP(D2D_MSTDBY),     (IEN  | PTU | EN  | M0)) /*d2d_mstdby*/\
+       MUX_VAL(CP(D2D_SWAKEUP),    (IEN  | PTD | EN  | M0)) /*d2d_swakeup*/\
+       MUX_VAL(CP(D2D_IDLEREQ),    (IEN  | PTD | DIS | M0)) /*d2d_idlereq*/\
+       MUX_VAL(CP(D2D_IDLEACK),    (IEN  | PTU | EN  | M0)) /*d2d_idleack*/\
+       MUX_VAL(CP(D2D_MWRITE),     (IEN  | PTD | DIS | M0)) /*d2d_mwrite*/\
+       MUX_VAL(CP(D2D_SWRITE),     (IEN  | PTD | DIS | M0)) /*d2d_swrite*/\
+       MUX_VAL(CP(D2D_MREAD),      (IEN  | PTD | DIS | M0)) /*d2d_mread*/\
+       MUX_VAL(CP(D2D_SREAD),      (IEN  | PTD | DIS | M0)) /*d2d_sread*/\
+       MUX_VAL(CP(D2D_MBUSFLAG),   (IEN  | PTD | DIS | M0)) /*d2d_mbusflag*/\
+       MUX_VAL(CP(D2D_SBUSFLAG),   (IEN  | PTD | DIS | M0)) /*d2d_sbusflag */
+
+#endif
index 20c32b73e3cb6a8925a025a6bc7fd0aacd966889..3b1011435405e3ff2dfe96aa7912248349b6e91b 100644 (file)
@@ -55,9 +55,10 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
index 656d5cde95a4933b81bbbbcd1eee962a92118abf..789acf0696563a78509959e63f66afc0661ec03c 100644 (file)
@@ -23,8 +23,8 @@
  */
 
 #include <common.h>
-#include <asm/arch/mx31.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/imx-regs.h>
 #include <mxc_gpio.h>
 #include <fpga.h>
 #include <lattice.h>
index 80bed923292654cddc442c3be794f4cbbae5ea16..85fbfc36467bf9ffea276b4b28f94cc83d8f52bc 100644 (file)
@@ -20,7 +20,7 @@
  * MA 02111-1307 USA
  */
 
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 
 .macro REG reg, val
        ldr r2, =\reg
index 8a81cfc68615617b63c55ef1de496d3a1d9c9c0c..b1238d505ab844e691229e886e64bfb1e5702cd7 100644 (file)
 
 #include <common.h>
 #include <netdev.h>
-#include <asm/arch/mx31.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/imx-regs.h>
 #include <asm/io.h>
 #include <nand.h>
 #include <fsl_pmic.h>
 #include <mxc_gpio.h>
 #include "qong_fpga.h"
+#include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_HW_WATCHDOG
+void hw_watchdog_reset(void)
+{
+       mxc_hw_watchdog_reset();
+}
+#endif
+
 int dram_init (void)
 {
        /* dram_init must store complete ramsize in gd->ram_size */
@@ -202,6 +210,10 @@ int board_late_init(void)
        pmic_reg_write(REG_POWER_CTL0, val | COINCHEN);
        pmic_reg_write(REG_INT_STATUS1, RTCRSTI);
 
+#ifdef CONFIG_HW_WATCHDOG
+       mxc_hw_watchdog_enable();
+#endif
+
        return 0;
 }
 
index ddd256426937f4141ae35b10940bc307fc42224c..67ec4612a93b3c6bccda430bfa024bb01d86f2cc 100644 (file)
@@ -25,7 +25,7 @@
 
 include $(TOPDIR)/config.mk
 
-LIB    = $(obj)lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).o
 
 COBJS-y        += ea20.o
 
index cbfdc9edff6755b07ad3e4bc4aecc8725b51a8f4..9f13a3d1070fb946f82a106e2b579a99ef614b16 100644 (file)
@@ -42,6 +42,7 @@
 #if defined(CONFIG_DIGSY_REV5)
 #include "is45s16800a2.h"
 #include <mtd/cfi_flash.h>
+#include <flash.h>
 #else
 #include "is42s16800a-7t.h"
 #endif
@@ -398,6 +399,7 @@ int update_flash_size (int flash_size)
                        size += flash_get_size(base, i);
                }
        }
+       flash_protect_default();
        gd->bd->bi_flashstart = base;
        return 0;
 }
@@ -405,6 +407,9 @@ int update_flash_size (int flash_size)
 
 void ft_board_setup(void *blob, bd_t *bd)
 {
+       int phy_addr = CONFIG_PHY_ADDR;
+       char eth_path[] = "/soc5200@f0000000/mdio@3000/ethernet-phy@0";
+
        ft_cpu_setup(blob, bd);
        /*
         * There are 2 RTC nodes in the DTS, so remove
@@ -422,5 +427,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
        ft_adapt_flash_base(blob);
 #endif
+       /* fix up the phy address */
+       do_fixup_by_path(blob, eth_path, "reg", &phy_addr, sizeof(int), 0);
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/board/dnp5370/Makefile b/board/dnp5370/Makefile
new file mode 100644 (file)
index 0000000..0d17676
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# U-boot - Makefile
+#
+# Copyright (c) 2005-2007 Analog Device Inc.
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS-y        := $(BOARD).o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/dnp5370/dnp5370.c b/board/dnp5370/dnp5370.c
new file mode 100644 (file)
index 0000000..da9eb5f
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * U-boot - main board file
+ *
+ * (C) Copyright 2010 3ality Digital Systems
+ *
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ *
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <config.h>
+#include <asm/blackfin.h>
+#include <asm/net.h>
+#include <net.h>
+#include <netdev.h>
+#include <asm/gpio.h>
+
+static void disable_external_watchdog(void)
+{
+#ifdef CONFIG_DNP5370_EXT_WD_DISABLE
+       /* disable external HW watchdog with PH13 = WD1 = 1 */
+       gpio_request(GPIO_PH13, "ext_wd");
+       gpio_direction_output(GPIO_PH13, 1);
+#endif
+}
+
+int checkboard(void)
+{
+       printf("Board: SSV DilNet DNP5370\n");
+       return 0;
+}
+
+#ifdef CONFIG_BFIN_MAC
+static void board_init_enetaddr(uchar *mac_addr)
+{
+#ifdef CONFIG_SYS_NO_FLASH
+# define USE_MAC_IN_FLASH 0
+#else
+# define USE_MAC_IN_FLASH 1
+#endif
+       bool valid_mac = false;
+
+       if (USE_MAC_IN_FLASH) {
+               /* we cram the MAC in the last flash sector */
+               uchar *board_mac_addr = (uchar *)0x202F0000;
+               if (is_valid_ether_addr(board_mac_addr)) {
+                       memcpy(mac_addr, board_mac_addr, 6);
+                       valid_mac = true;
+               }
+       }
+
+       if (!valid_mac) {
+               puts("Warning: Generating 'random' MAC address\n");
+               bfin_gen_rand_mac(mac_addr);
+       }
+
+       eth_setenv_enetaddr("ethaddr", mac_addr);
+}
+
+int board_eth_init(bd_t *bis)
+{
+       return bfin_EMAC_initialize(bis);
+}
+#endif
+
+/* miscellaneous platform dependent initialisations */
+int misc_init_r(void)
+{
+       disable_external_watchdog();
+
+#ifdef CONFIG_BFIN_MAC
+       uchar enetaddr[6];
+       if (!eth_getenv_enetaddr("ethaddr", enetaddr))
+               board_init_enetaddr(enetaddr);
+#endif
+
+#ifndef CONFIG_SYS_NO_FLASH
+       /* we use the last sector for the MAC address / POST LDR */
+       extern flash_info_t flash_info[];
+       flash_protect(FLAG_PROTECT_SET, 0x202F0000, 0x202FFFFF, &flash_info[0]);
+#endif
+
+       return 0;
+}
index dd0ce545163ae33c7fea51009a4b9eae370cefa3..2a5636c0737360bbbac273b2e2a7c41057988202 100644 (file)
@@ -35,6 +35,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN;
+
 static void enet_timer_isr(void);
 static void enet_toggle_run_led(void);
 static void enet_setup_pars(void);
index fefb1a4fbeb1efdbe4129f5e482c68d3b2f56165..a03090e54061ad15748cb4a0072fbbad5b5a933f 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * (C) Copyright 2008
- * Graeme Russ, graeme.russ@gmail.com.
+ * (C) Copyright 2008,2009
+ * Graeme Russ, <graeme.russ@gmail.com>
  *
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB <daniel@omicron.se>.
+ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -23,6 +23,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
+
 #include <common.h>
 #include <pci.h>
 #include <asm/pci.h>
index f8bc88dbe3d622fc992a6e35a9d2699ced4d1f3f..284f7ff32e6f86a933c8a34e8e37b833cbac5e74 100644 (file)
@@ -1,4 +1,3 @@
 PLATFORM_RELFLAGS      += -ffunction-sections -fdata-sections
 PLATFORM_LDFLAGS       += --gc-sections
 CONFIG_SYS_TEXT_BASE           = 0x00000000
-LDSCRIPT               = $(src)board/earthlcd/favr-32-ezkit/u-boot.lds
index 2fac727b84f6933997ccffe91eed55c185098cf6..fd4e8a50d543a62df0422cdb6c30af81e7cd8752 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 32dcbd3ef51304fa9b27f7f60c0a9f837c75c318..fb066486633a8b184ccd5a503ee19a64169e5d43 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index e2dd1c20f2c4242309993664e8cd8f62a516564f..332b35a57d68bba3be2dd450bac71168348813ed 100644 (file)
@@ -43,9 +43,10 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
index 2bf60f5804a0cb670d39652b11a7772f7187d1cf..b15948d34c7d3a58d469171ab17005efd3bf856f 100644 (file)
@@ -54,13 +54,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 8455f0b9f4098b252d8a01c8ac92cdfa51b092ff..163b83d8199d0fc4941407c2760b711a3f823dc1 100644 (file)
@@ -56,13 +56,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 04233d86a1d3d824e22fb83a6a3dc43c552e213c..b68d9eadcc4deb380b5b75767948ccc1765ec374 100644 (file)
@@ -56,13 +56,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
diff --git a/board/eukrea/cpu9260/config.mk b/board/eukrea/cpu9260/config.mk
deleted file mode 100644 (file)
index 2077692..0000000
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x21f00000
index 61b6c3323dd37a74adfe07bb9891f833be74c7ec..9ec48a0d21cbcac105d034be345cf50dfdc1fe52 100644 (file)
 #include <common.h>
 #include <asm/sizes.h>
 #include <asm/arch/at91sam9260.h>
-#include <asm/arch/at91sam9_matrix.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
-#include <asm/arch/gpio.h>
+#include <asm/arch/at91_matrix.h>
+#include <asm/arch/at91_pio.h>
+#include <asm/arch/clk.h>
 #include <asm/arch/io.h>
 #include <asm/arch/hardware.h>
 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
@@ -53,116 +54,103 @@ DECLARE_GLOBAL_DATA_PTR;
 static void cpu9260_nand_hw_init(void)
 {
        unsigned long csa;
+       at91_smc_t *smc = (at91_smc_t *) AT91_SMC_BASE;
+       at91_matrix_t *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
+       at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
 
        /* Enable CS3 */
-       csa = at91_sys_read(AT91_MATRIX_EBICSA);
-       at91_sys_write(AT91_MATRIX_EBICSA,
-                      csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
+       csa = readl(&matrix->csa) | AT91_MATRIX_CSA_EBI_CS3A;
+       writel(csa, &matrix->csa);
 
        /* Configure SMC CS3 for NAND/SmartMedia */
 #if defined(CONFIG_CPU9G20)
-       at91_sys_write(AT91_SMC_SETUP(3),
-                      AT91_SMC_NWESETUP_(2) | AT91_SMC_NCS_WRSETUP_(0) |
-                      AT91_SMC_NRDSETUP_(2) | AT91_SMC_NCS_RDSETUP_(0));
-       at91_sys_write(AT91_SMC_PULSE(3),
-                      AT91_SMC_NWEPULSE_(4) | AT91_SMC_NCS_WRPULSE_(4) |
-                      AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(4));
-       at91_sys_write(AT91_SMC_CYCLE(3),
-                      AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7));
-       at91_sys_write(AT91_SMC_MODE(3),
-                      AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
-                      AT91_SMC_EXNWMODE_DISABLE |
-                      AT91_SMC_DBW_8 |
-                      AT91_SMC_TDF_(3));
+       writel(AT91_SMC_SETUP_NWE(2) | AT91_SMC_SETUP_NCS_WR(0) |
+               AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(0),
+               &smc->cs[3].setup);
+       writel(AT91_SMC_PULSE_NWE(4) | AT91_SMC_PULSE_NCS_WR(4) |
+               AT91_SMC_PULSE_NRD(4) | AT91_SMC_PULSE_NCS_RD(4),
+               &smc->cs[3].pulse);
+       writel(AT91_SMC_CYCLE_NWE(7) | AT91_SMC_CYCLE_NRD(7),
+               &smc->cs[3].cycle);
+       writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+               AT91_SMC_MODE_EXNW_DISABLE |
+               AT91_SMC_MODE_DBW_8 |
+               AT91_SMC_MODE_TDF_CYCLE(3),
+               &smc->cs[3].mode);
 #elif defined(CONFIG_CPU9260)
-       at91_sys_write(AT91_SMC_SETUP(3),
-                      AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) |
-                      AT91_SMC_NRDSETUP_(1) | 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));
-       at91_sys_write(AT91_SMC_MODE(3),
-                      AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
-                      AT91_SMC_EXNWMODE_DISABLE |
-                      AT91_SMC_DBW_8 |
-                      AT91_SMC_TDF_(2));
+       writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+               AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+               &smc->cs[3].setup);
+       writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
+               AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
+               &smc->cs[3].pulse);
+       writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+               &smc->cs[3].cycle);
+       writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+               AT91_SMC_MODE_EXNW_DISABLE |
+               AT91_SMC_MODE_DBW_8 |
+               AT91_SMC_MODE_TDF_CYCLE(2),
+               &smc->cs[3].mode);
 #endif
 
-       at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_PIOC);
+       writel(1 << AT91SAM9260_ID_PIOC, &pmc->pcer);
 
        /* Configure RDY/BSY */
-       at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+       at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
 
        /* Enable NandFlash */
-       at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif
 
 #ifdef CONFIG_MACB
 static void cpu9260_macb_hw_init(void)
 {
-       unsigned long rstc;
+       unsigned long rstcmr;
+       at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+       at91_rstc_t *rstc = (at91_rstc_t *) AT91_RSTC_BASE;
 
        /* Enable clock */
-       at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_EMAC);
-
-       /*
-        * Disable pull-up on:
-        *      RXDV (PA17) => PHY normal mode (not Test mode)
-        *      ERX0 (PA14) => PHY ADDR0
-        *      ERX1 (PA15) => PHY ADDR1
-        *      ERX2 (PA25) => PHY ADDR2
-        *      ERX3 (PA26) => PHY ADDR3
-        *      ECRS (PA28) => PHY ADDR4  => PHYADDR = 0x0
-        *
-        * PHY has internal pull-down
-        */
-       writel(pin_to_mask(AT91_PIN_PA14) |
-              pin_to_mask(AT91_PIN_PA15) |
-              pin_to_mask(AT91_PIN_PA17) |
-              pin_to_mask(AT91_PIN_PA25) |
-              pin_to_mask(AT91_PIN_PA26) |
-              pin_to_mask(AT91_PIN_PA28),
-              pin_to_controller(AT91_PIN_PA0) + PIO_PUDR);
-
-       rstc = at91_sys_read(AT91_RSTC_MR) & AT91_RSTC_ERSTL;
+       writel(1 << AT91SAM9260_ID_EMAC, &pmc->pcer);
+
+       at91_set_pio_pullup(AT91_PIO_PORTA, 17, 1);
+
+       rstcmr = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
 
        /* Need to reset PHY -> 500ms reset */
-       at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
-                      (AT91_RSTC_ERSTL & (0x0D << 8)) |
-                      AT91_RSTC_URSTEN);
+       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(0xD) |
+                               AT91_RSTC_MR_URSTEN, &rstc->mr);
 
-       at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_EXTRST);
+       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
 
        /* Wait for end hardware reset */
-       while (!(at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_NRSTL))
+       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
                ;
 
        /* Restore NRST value */
-       at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
-                      (rstc) |
-                      AT91_RSTC_URSTEN);
-
-       /* Re-enable pull-up */
-       writel(pin_to_mask(AT91_PIN_PA14) |
-              pin_to_mask(AT91_PIN_PA15) |
-              pin_to_mask(AT91_PIN_PA17) |
-              pin_to_mask(AT91_PIN_PA25) |
-              pin_to_mask(AT91_PIN_PA26) |
-              pin_to_mask(AT91_PIN_PA28),
-              pin_to_controller(AT91_PIN_PA0) + PIO_PUER);
+       writel(AT91_RSTC_KEY | rstcmr | AT91_RSTC_MR_URSTEN, &rstc->mr);
 
        at91_macb_hw_init();
 }
 #endif
 
-int board_init(void)
+int board_early_init_f(void)
 {
-       /* Enable Ctrlc */
-       console_init_f();
+       at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+
+       writel((1 << AT91SAM9260_ID_PIOA) |
+               (1 << AT91SAM9260_ID_PIOC) |
+               (1 << AT91SAM9260_ID_PIOB),
+               &pmc->pcer);
+
+       at91_serial_hw_init();
+
+       return 0;
+}
 
+
+int board_init(void)
+{
        /* arch number of the board */
 #if defined(CONFIG_CPU9G20)
        gd->bd->bi_arch_number = MACH_TYPE_CPUAT9G20;
@@ -171,9 +159,8 @@ int board_init(void)
 #endif
 
        /* adress of boot parameters */
-       gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+       gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
-       at91_serial_hw_init();
 #ifdef CONFIG_CMD_NAND
        cpu9260_nand_hw_init();
 #endif
@@ -188,26 +175,16 @@ int board_init(void)
 
 int dram_init(void)
 {
-       gd->bd->bi_dram[0].start = PHYS_SDRAM;
-       if (get_ram_size((long *) PHYS_SDRAM, PHYS_SDRAM_SIZE) !=
-           PHYS_SDRAM_SIZE)
-               return -1;
-
-       gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
+       gd->ram_size = get_ram_size((volatile long *)CONFIG_SYS_SDRAM_BASE,
+                       CONFIG_SYS_SDRAM_SIZE);
        return 0;
 }
 
-#ifdef CONFIG_RESET_PHY_R
-void reset_phy(void)
-{
-}
-#endif
-
 int board_eth_init(bd_t *bis)
 {
        int rc = 0;
 #ifdef CONFIG_MACB
-       rc = macb_eth_initialize(0, (void *)AT91SAM9260_BASE_EMAC, 0x00);
+       rc = macb_eth_initialize(0, (void *)AT91_EMAC_BASE, 0);
 #endif
        return rc;
 }
index e73543bb12736e2a3052b45f9d6a810480cea541..d0906bc894d1f84bc25d5fc555308a78838ad670 100644 (file)
@@ -35,65 +35,67 @@ static unsigned int saved_state[4] = {STATUS_LED_OFF, STATUS_LED_OFF,
 
 void coloured_LED_init(void)
 {
+       at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+
        /* Enable clock */
-       at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_PIOC);
+       writel(1 << AT91SAM9260_ID_PIOC, &pmc->pcer);
 
-       at91_set_gpio_output(CONFIG_RED_LED, 1);
-       at91_set_gpio_output(CONFIG_GREEN_LED, 1);
-       at91_set_gpio_output(CONFIG_YELLOW_LED, 1);
-       at91_set_gpio_output(CONFIG_BLUE_LED, 1);
+       at91_set_pio_output(CONFIG_RED_LED, 1);
+       at91_set_pio_output(CONFIG_GREEN_LED, 1);
+       at91_set_pio_output(CONFIG_YELLOW_LED, 1);
+       at91_set_pio_output(CONFIG_BLUE_LED, 1);
 
-       at91_set_gpio_value(CONFIG_RED_LED, 1);
-       at91_set_gpio_value(CONFIG_GREEN_LED, 1);
-       at91_set_gpio_value(CONFIG_YELLOW_LED, 1);
-       at91_set_gpio_value(CONFIG_BLUE_LED, 1);
+       at91_set_pio_value(CONFIG_RED_LED, 1);
+       at91_set_pio_value(CONFIG_GREEN_LED, 1);
+       at91_set_pio_value(CONFIG_YELLOW_LED, 1);
+       at91_set_pio_value(CONFIG_BLUE_LED, 1);
 }
 
 void red_LED_off(void)
 {
-       at91_set_gpio_value(CONFIG_RED_LED, 1);
+       at91_set_pio_value(CONFIG_RED_LED, 1);
        saved_state[STATUS_LED_RED] = STATUS_LED_OFF;
 }
 
 void green_LED_off(void)
 {
-       at91_set_gpio_value(CONFIG_GREEN_LED, 1);
+       at91_set_pio_value(CONFIG_GREEN_LED, 1);
        saved_state[STATUS_LED_GREEN] = STATUS_LED_OFF;
 }
 
 void yellow_LED_off(void)
 {
-       at91_set_gpio_value(CONFIG_YELLOW_LED, 1);
+       at91_set_pio_value(CONFIG_YELLOW_LED, 1);
        saved_state[STATUS_LED_YELLOW] = STATUS_LED_OFF;
 }
 
 void blue_LED_off(void)
 {
-       at91_set_gpio_value(CONFIG_BLUE_LED, 1);
+       at91_set_pio_value(CONFIG_BLUE_LED, 1);
        saved_state[STATUS_LED_BLUE] = STATUS_LED_OFF;
 }
 
 void red_LED_on(void)
 {
-       at91_set_gpio_value(CONFIG_RED_LED, 0);
+       at91_set_pio_value(CONFIG_RED_LED, 0);
        saved_state[STATUS_LED_RED] = STATUS_LED_ON;
 }
 
 void green_LED_on(void)
 {
-       at91_set_gpio_value(CONFIG_GREEN_LED, 0);
+       at91_set_pio_value(CONFIG_GREEN_LED, 0);
        saved_state[STATUS_LED_GREEN] = STATUS_LED_ON;
 }
 
 void yellow_LED_on(void)
 {
-       at91_set_gpio_value(CONFIG_YELLOW_LED, 0);
+       at91_set_pio_value(CONFIG_YELLOW_LED, 0);
        saved_state[STATUS_LED_YELLOW] = STATUS_LED_ON;
 }
 
 void blue_LED_on(void)
 {
-       at91_set_gpio_value(CONFIG_BLUE_LED, 0);
+       at91_set_pio_value(CONFIG_BLUE_LED, 0);
        saved_state[STATUS_LED_BLUE] = STATUS_LED_ON;
 }
 
index 15da3d87ab66acb4f814607bd6adc557072a384a..1d62b13099115b41fc6d4ca9a627f6f27f41d7cc 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).o
 
-COBJS  := cpuat91.o
+COBJS  := $(BOARD).o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
@@ -38,7 +38,7 @@ clean:
        rm -f $(SOBJS) $(OBJS)
 
 distclean:     clean
-       rm -f $(LIB) core *.bak .depend
+       rm -f $(LIB) core *.bak $(obj).depend
 
 #########################################################################
 
diff --git a/board/eukrea/cpuat91/config.mk b/board/eukrea/cpuat91/config.mk
deleted file mode 100644 (file)
index 463f46b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x21F00000
index cd4d42c6b79791835e8927a0b780703343adfa23..4c4dad655c999ddf6c0ead88a70eaaa88d19c1c1 100644 (file)
@@ -47,24 +47,23 @@ int board_init(void)
        /* arch number of CPUAT91-Board */
        gd->bd->bi_arch_number = MACH_TYPE_CPUAT91;
        /* adress of boot parameters */
-       gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+       gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
        return 0;
 }
 
 int dram_init(void)
 {
-       gd->bd->bi_dram[0].start = PHYS_SDRAM;
-       gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
+       /* dram_init must store complete ramsize in gd->ram_size */
+       gd->ram_size = get_ram_size((volatile long *)CONFIG_SYS_SDRAM_BASE,
+                       CONFIG_SYS_SDRAM_SIZE);
        return 0;
 }
 
 #ifdef CONFIG_DRIVER_AT91EMAC
 int board_eth_init(bd_t *bis)
 {
-       int rc = 0;
-       rc = at91emac_register(bis, 0);
-       return rc;
+       return at91emac_register(bis, (u32) AT91_EMAC_BASE);
 }
 #endif
 
index 0648f62feb8be65ba6b6048ee5d0d38062f7a103..2d031efc4e93fde4868428ff775c7fba6f65a9cb 100644 (file)
@@ -51,13 +51,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 63d0ea112100736defc502caa41d27b4c74fac0a..9ea0674b887a40b588821eb4c8082984a986c164 100644 (file)
@@ -49,13 +49,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index b9343e42da67f2d9c6b475294869cfffe08cec83..2578be4f92c469e6eef4ee5f86ed48580244c908 100644 (file)
@@ -21,7 +21,7 @@
 #include <netdev.h>
 #include <asm/io.h>
 
-#include <asm/arch/ftsmc020.h>
+#include <faraday/ftsmc020.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 97718c0c0de01d15eb30d8489f9f4a3e5a956217..4262c116c3ba12e8b5ce47b31cdded67018b7b3c 100644 (file)
@@ -21,7 +21,7 @@
 #include <version.h>
 
 #include <asm/macro.h>
-#include <asm/arch/ftsdmc020.h>
+#include <faraday/ftsdmc020.h>
 
 /*
  * parameters for the SDRAM controller
index 2fac727b84f6933997ccffe91eed55c185098cf6..fd4e8a50d543a62df0422cdb6c30af81e7cd8752 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 1abd3e56703b014d0a0085ae332d139e8634e170..dbf1da81bd04655013fa031d5ea432defcbb40ab 100644 (file)
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_FSL_NGPIXIS)   += ngpixis.o
 COBJS-$(CONFIG_PQ_MDS_PIB)     += pq-mds-pib.o
 COBJS-$(CONFIG_ID_EEPROM)      += sys_eeprom.o
 COBJS-$(CONFIG_FSL_SGMII_RISER)        += sgmii_riser.o
+COBJS-$(CONFIG_ENV_IS_IN_MMC)  += sdhc_boot.o
 
 COBJS-$(CONFIG_MPC8541CDS)     += cds_pci_ft.o
 COBJS-$(CONFIG_MPC8548CDS)     += cds_pci_ft.o
@@ -45,7 +46,9 @@ COBJS-$(CONFIG_MPC8536DS)     += ics307_clk.o
 COBJS-$(CONFIG_MPC8572DS)      += ics307_clk.o
 COBJS-$(CONFIG_P1022DS)                += ics307_clk.o
 COBJS-$(CONFIG_P2020DS)                += ics307_clk.o
+COBJS-$(CONFIG_P3041DS)                += ics307_clk.o
 COBJS-$(CONFIG_P4080DS)                += ics307_clk.o
+COBJS-$(CONFIG_P5020DS)                += ics307_clk.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y))
index a135fbe5ef50d8a1ce4f4f0e604063109ff0e45c..765f0359bfb03abdbf7cb19ee83be27252518e09 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright 2010 Freescale Semiconductor
+ * Copyright 2010-2011 Freescale Semiconductor
  * Author: Timur Tabi <timur@freescale.com>
  *
  * This program is free software; you can redistribute it and/or modify it
 
 #include <common.h>
 #include <command.h>
-#include <watchdog.h>
-#include <asm/cache.h>
 #include <asm/io.h>
 
 #include "ngpixis.h"
 
+static u8 __pixis_read(unsigned int reg)
+{
+       void *p = (void *)PIXIS_BASE;
+
+       return in_8(p + reg);
+}
+u8 pixis_read(unsigned int reg) __attribute__((weak, alias("__pixis_read")));
+
+static void __pixis_write(unsigned int reg, u8 value)
+{
+       void *p = (void *)PIXIS_BASE;
+
+       out_8(p + reg, value);
+}
+void pixis_write(unsigned int reg, u8 value)
+       __attribute__((weak, alias("__pixis_write")));
+
 /*
  * Reset the board. This ignores the ENx registers.
  */
-void pixis_reset(void)
+void __pixis_reset(void)
 {
-       out_8(&pixis->rst, 0);
+       PIXIS_WRITE(rst, 0);
 
        while (1);
 }
+void pixis_reset(void) __attribute__((weak, alias("__pixis_reset")));
 
 /*
  * Reset the board.  Like pixis_reset(), but it honors the ENx registers.
  */
-void pixis_bank_reset(void)
+void __pixis_bank_reset(void)
 {
-       out_8(&pixis->vctl, 0);
-       out_8(&pixis->vctl, 1);
+       PIXIS_WRITE(vctl, 0);
+       PIXIS_WRITE(vctl, 1);
 
        while (1);
 }
+void pixis_bank_reset(void) __attribute__((weak, alias("__pixis_bank_reset")));
 
 /**
  * Set the boot bank to the power-on default bank
  */
-void clear_altbank(void)
+void __clear_altbank(void)
 {
+       u8 reg;
+
        /* Tell the ngPIXIS to use this the bits in the physical switch for the
         * boot bank value, instead of the SWx register.  We need to be careful
         * only to set the bits in SWx that correspond to the boot bank.
         */
-       clrbits_8(&PIXIS_EN(PIXIS_LBMAP_SWITCH), PIXIS_LBMAP_MASK);
+       reg = PIXIS_READ(s[PIXIS_LBMAP_SWITCH - 1].en);
+       reg &= ~PIXIS_LBMAP_MASK;
+       PIXIS_WRITE(s[PIXIS_LBMAP_SWITCH - 1].en, reg);
 }
+void clear_altbank(void) __attribute__((weak, alias("__clear_altbank")));
 
 /**
  * Set the boot bank to the alternate bank
  */
-void set_altbank(void)
+void __set_altbank(void)
 {
+       u8 reg;
+
        /* Program the alternate bank number into the SWx register.
         */
-       clrsetbits_8(&PIXIS_SW(PIXIS_LBMAP_SWITCH), PIXIS_LBMAP_MASK,
-                    PIXIS_LBMAP_ALTBANK);
+       reg = PIXIS_READ(s[PIXIS_LBMAP_SWITCH - 1].sw);
+       reg = (reg & ~PIXIS_LBMAP_MASK) | PIXIS_LBMAP_ALTBANK;
+       PIXIS_WRITE(s[PIXIS_LBMAP_SWITCH - 1].sw, reg);
 
        /* Tell the ngPIXIS to use this the bits in the SWx register for the
         * boot bank value, instead of the physical switch.  We need to be
         * careful only to set the bits in SWx that correspond to the boot bank.
         */
-       setbits_8(&PIXIS_EN(PIXIS_LBMAP_SWITCH), PIXIS_LBMAP_MASK);
+       reg = PIXIS_READ(s[PIXIS_LBMAP_SWITCH - 1].en);
+       reg |= PIXIS_LBMAP_MASK;
+       PIXIS_WRITE(s[PIXIS_LBMAP_SWITCH - 1].en, reg);
 }
+void set_altbank(void) __attribute__((weak, alias("__set_altbank")));
 
+#ifdef DEBUG
+static void pixis_dump_regs(void)
+{
+       unsigned int i;
+
+       printf("id=%02x\n", PIXIS_READ(id));
+       printf("arch=%02x\n", PIXIS_READ(arch));
+       printf("scver=%02x\n", PIXIS_READ(scver));
+       printf("csr=%02x\n", PIXIS_READ(csr));
+       printf("rst=%02x\n", PIXIS_READ(rst));
+       printf("aux=%02x\n", PIXIS_READ(aux));
+       printf("spd=%02x\n", PIXIS_READ(spd));
+       printf("brdcfg0=%02x\n", PIXIS_READ(brdcfg0));
+       printf("brdcfg1=%02x\n", PIXIS_READ(brdcfg1));
+       printf("addr=%02x\n", PIXIS_READ(addr));
+       printf("data=%02x\n", PIXIS_READ(data));
+       printf("led=%02x\n", PIXIS_READ(led));
+       printf("vctl=%02x\n", PIXIS_READ(vctl));
+       printf("vstat=%02x\n", PIXIS_READ(vstat));
+       printf("vcfgen0=%02x\n", PIXIS_READ(vcfgen0));
+       printf("ocmcsr=%02x\n", PIXIS_READ(ocmcsr));
+       printf("ocmmsg=%02x\n", PIXIS_READ(ocmmsg));
+       printf("gmdbg=%02x\n", PIXIS_READ(gmdbg));
+       printf("sclk=%02x%02x%02x\n",
+              PIXIS_READ(sclk[0]), PIXIS_READ(sclk[1]), PIXIS_READ(sclk[2]));
+       printf("dclk=%02x%02x%02x\n",
+              PIXIS_READ(dclk[0]), PIXIS_READ(dclk[1]), PIXIS_READ(dclk[2]));
+       printf("watch=%02x\n", PIXIS_READ(watch));
+
+       for (i = 0; i < 8; i++) {
+               printf("SW%u=%02x/%02x ", i + 1,
+                       PIXIS_READ(s[i].sw), PIXIS_READ(s[i].en));
+       }
+       putc('\n');
+}
+#endif
 
 int pixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        unsigned int i;
        char *p_altbank = NULL;
+#ifdef DEBUG
+       char *p_dump = NULL;
+#endif
        char *unknown_param = NULL;
 
        /* No args is a simple reset request.
@@ -109,6 +176,13 @@ int pixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                        continue;
                }
 
+#ifdef DEBUG
+               if (strcmp(argv[i], "dump") == 0) {
+                       p_dump = argv[i];
+                       continue;
+               }
+#endif
+
                unknown_param = argv[i];
        }
 
@@ -117,6 +191,15 @@ int pixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                return 1;
        }
 
+#ifdef DEBUG
+       if (p_dump) {
+               pixis_dump_regs();
+
+               /* 'dump' ignores other commands */
+               return 0;
+       }
+#endif
+
        if (p_altbank)
                set_altbank();
        else
@@ -133,4 +216,7 @@ U_BOOT_CMD(
        "Reset the board using the FPGA sequencer",
        "- hard reset to default bank\n"
        "pixis_reset altbank - reset to alternate bank\n"
+#ifdef DEBUG
+       "pixis_reset dump - display the PIXIS registers\n"
+#endif
        );
index 089408b769d07aa9c80e6d89a794ac252d2cab7a..1d4483d8b9d21cce33b01a48476538dbbf457154 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright 2010 Freescale Semiconductor
+ * Copyright 2010-2011 Freescale Semiconductor
  * Author: Timur Tabi <timur@freescale.com>
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -20,16 +20,17 @@ typedef struct ngpixis {
        u8 scver;
        u8 csr;
        u8 rst;
-       u8 res1;
+       u8 serclk;
        u8 aux;
        u8 spd;
        u8 brdcfg0;
        u8 brdcfg1;     /* On some boards, this register is called 'dma' */
        u8 addr;
-       u8 res2[2];
+       u8 brdcfg2;
+       u8 gpiodir;
        u8 data;
        u8 led;
-       u8 res3;
+       u8 tag;
        u8 vctl;
        u8 vstat;
        u8 vcfgen0;
@@ -55,3 +56,9 @@ typedef struct ngpixis {
 
 /* The PIXIS EN register that corresponds to board switch X, where x >= 1 */
 #define PIXIS_EN(x)            (pixis->s[(x) - 1].en)
+
+u8 pixis_read(unsigned int reg);
+void pixis_write(unsigned int reg, u8 value);
+
+#define PIXIS_READ(reg) pixis_read(offsetof(ngpixis_t, reg))
+#define PIXIS_WRITE(reg, value) pixis_write(offsetof(ngpixis_t, reg), value)
diff --git a/board/freescale/common/sdhc_boot.c b/board/freescale/common/sdhc_boot.c
new file mode 100644 (file)
index 0000000..964c6b8
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 <common.h>
+#include <mmc.h>
+#include <malloc.h>
+
+/*
+ * The environment variables are written to just after the u-boot image
+ * on SDCard, so we must read the MBR to get the start address and code
+ * length of the u-boot image, then calculate the address of the env.
+ */
+#define ESDHC_BOOT_IMAGE_SIZE  0x48
+#define ESDHC_BOOT_IMAGE_ADDR  0x50
+
+int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr)
+{
+       u8 *tmp_buf;
+       u32 blklen, code_offset, code_len, n;
+
+       blklen = mmc->read_bl_len;
+       tmp_buf = malloc(blklen);
+       if (!tmp_buf)
+               return 1;
+
+       /* read out the first block, get the config data information */
+       n = mmc->block_dev.block_read(mmc->block_dev.dev, 0, 1, tmp_buf);
+       if (!n) {
+               free(tmp_buf);
+               return 1;
+       }
+
+       /* Get the Source Address, from offset 0x50 */
+       code_offset = *(u32 *)(tmp_buf + ESDHC_BOOT_IMAGE_ADDR);
+
+       /* Get the code size from offset 0x48 */
+       code_len = *(u32 *)(tmp_buf + ESDHC_BOOT_IMAGE_SIZE);
+
+       *env_addr = code_offset + code_len;
+
+       free(tmp_buf);
+
+       return 0;
+}
+
index 3ecfb06cc84d5a7a85973f03a7c256b2362d0740..d2ed0361e246f05041e92d890675436135c0c016 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006, 2008-2009 Freescale Semiconductor
+ * Copyright 2006, 2008-2009, 2011 Freescale Semiconductor
  * York Sun (yorksun@freescale.com)
  * Haiying Wang (haiying.wang@freescale.com)
  * Timur Tabi (timur@freescale.com)
 #endif
 
 #ifdef CONFIG_SYS_I2C_EEPROM_NXID
-#define MAX_NUM_PORTS  8
-#define NXID_VERSION   0
-#endif
-
-#ifdef CONFIG_SYS_I2C_EEPROM_NXID_1
-#define CONFIG_SYS_I2C_EEPROM_NXID
 #define MAX_NUM_PORTS  23
 #define NXID_VERSION   1
 #endif
@@ -428,11 +422,16 @@ int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  * This ensures that any user-saved variables are never overwritten.
  *
  * This function must be called after relocation.
+ *
+ * For NXID v1 EEPROMs, we support loading and up-converting the older NXID v0
+ * format.  In a v0 EEPROM, there are only eight MAC addresses and the CRC is
+ * located at a different offset.
  */
 int mac_read_from_eeprom(void)
 {
        unsigned int i;
-       u32 crc;
+       u32 crc, crc_offset = offsetof(struct eeprom, crc);
+       u32 *crcp; /* Pointer to the CRC in the data read from the EEPROM */
 
        puts("EEPROM: ");
 
@@ -447,12 +446,32 @@ int mac_read_from_eeprom(void)
                return -1;
        }
 
-       crc = crc32(0, (void *)&e, sizeof(e) - 4);
-       if (crc != be32_to_cpu(e.crc)) {
+#ifdef CONFIG_SYS_I2C_EEPROM_NXID
+       /*
+        * If we've read an NXID v0 EEPROM, then we need to set the CRC offset
+        * to where it is in v0.
+        */
+       if (e.version == 0)
+               crc_offset = 0x72;
+#endif
+
+       crc = crc32(0, (void *)&e, crc_offset);
+       crcp = (void *)&e + crc_offset;
+       if (crc != be32_to_cpu(*crcp)) {
                printf("CRC mismatch (%08x != %08x)\n", crc, be32_to_cpu(e.crc));
                return -1;
        }
 
+#ifdef CONFIG_SYS_I2C_EEPROM_NXID
+       /*
+        * MAC address #9 in v1 occupies the same position as the CRC in v0.
+        * Erase it so that it's not mistaken for a MAC address.  We'll
+        * update the CRC later.
+        */
+       if (e.version == 0)
+               memset(e.mac[8], 0xff, 6);
+#endif
+
        for (i = 0; i < min(e.mac_count, MAX_NUM_PORTS); i++) {
                if (memcmp(&e.mac[i], "\0\0\0\0\0\0", 6) &&
                    memcmp(&e.mac[i], "\xFF\xFF\xFF\xFF\xFF\xFF", 6)) {
@@ -482,6 +501,17 @@ int mac_read_from_eeprom(void)
        printf("%c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
 #endif
 
+#ifdef CONFIG_SYS_I2C_EEPROM_NXID
+       /*
+        * Now we need to upconvert the data into v1 format.  We do this last so
+        * that at boot time, U-Boot will still say "NXID v0".
+        */
+       if (e.version == 0) {
+               e.version = NXID_VERSION;
+               update_crc();
+       }
+#endif
+
        return 0;
 }
 
index 1047d783f498dfcc48fa9faf4962128193bf5d08..69e81a4d362ad031ea30c6a0b797634633cbaa6c 100644 (file)
@@ -28,7 +28,9 @@ LIB   = $(obj)lib$(BOARD).o
 
 COBJS-y        += $(BOARD).o
 COBJS-y        += ddr.o
+COBJS-$(CONFIG_P3041DS)        += p3041ds_ddr.o
 COBJS-$(CONFIG_P4080DS)        += p4080ds_ddr.o
+COBJS-$(CONFIG_P5020DS)        += p5020ds_ddr.o
 COBJS-$(CONFIG_PCI)    += pci.o
 COBJS-y        += law.o
 COBJS-y        += tlb.o
index 232dc7297a0c9d2d15d4cfa8530a112af61a8f28..93241251b8e003af471eb63ce9efbb8c0197a475 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009-2010 Freescale Semiconductor, Inc.
+ * Copyright 2009-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -39,8 +39,6 @@ extern void pci_of_setup(void *blob, bd_t *bd);
 
 DECLARE_GLOBAL_DATA_PTR;
 
-void cpu_mp_lmb_reserve(struct lmb *lmb);
-
 int checkboard (void)
 {
        u8 sw;
@@ -89,10 +87,21 @@ int checkboard (void)
         * don't match.
         */
        puts("SERDES Reference Clocks: ");
+#if defined(CONFIG_P3041DS) || defined(CONFIG_P5020DS)
+       sw = in_8(&PIXIS_SW(5));
+       for (i = 0; i < 3; i++) {
+               static const char *freq[] = {"100", "125", "156.25", "212.5" };
+               unsigned int clock = (sw >> (6 - (2 * i))) & 3;
+
+               printf("Bank%u=%sMhz ", i+1, freq[clock]);
+       }
+       puts("\n");
+#else
        sw = in_8(&PIXIS_SW(3));
        printf("Bank1=%uMHz ", (sw & 0x40) ? 125 : 100);
        printf("Bank2=%sMHz ", (sw & 0x20) ? "156.25" : "125");
        printf("Bank3=%sMHz\n", (sw & 0x10) ? "156.25" : "125");
+#endif
 
        return 0;
 }
@@ -148,7 +157,7 @@ static const char *serdes_clock_to_string(u32 clock)
        case SRDS_PLLCR0_RFCK_SEL_156_25:
                return "156.25";
        default:
-               return "???";
+               return "150";
        }
 }
 
@@ -159,19 +168,41 @@ int misc_init_r(void)
        serdes_corenet_t *srds_regs = (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
        u32 actual[NUM_SRDS_BANKS];
        unsigned int i;
-       u8 sw3;
+       u8 sw;
 
+#if defined(CONFIG_P3041DS) || defined(CONFIG_P5020DS)
+       sw = in_8(&PIXIS_SW(5));
+       for (i = 0; i < 3; i++) {
+               unsigned int clock = (sw >> (6 - (2 * i))) & 3;
+               switch (clock) {
+               case 0:
+                       actual[i] = SRDS_PLLCR0_RFCK_SEL_100;
+                       break;
+               case 1:
+                       actual[i] = SRDS_PLLCR0_RFCK_SEL_125;
+                       break;
+               case 2:
+                       actual[i] = SRDS_PLLCR0_RFCK_SEL_156_25;
+                       break;
+               default:
+                       printf("Warning: SDREFCLK%u switch setting of '11' is "
+                              "unsupported\n", i + 1);
+                       break;
+               }
+       }
+#else
        /* Warn if the expected SERDES reference clocks don't match the
         * actual reference clocks.  This needs to be done after calling
         * p4080_erratum_serdes8(), since that function may modify the clocks.
         */
-       sw3 = in_8(&PIXIS_SW(3));
-       actual[0] = (sw3 & 0x40) ?
+       sw = in_8(&PIXIS_SW(3));
+       actual[0] = (sw & 0x40) ?
                SRDS_PLLCR0_RFCK_SEL_125 : SRDS_PLLCR0_RFCK_SEL_100;
-       actual[1] = (sw3 & 0x20) ?
+       actual[1] = (sw & 0x20) ?
                SRDS_PLLCR0_RFCK_SEL_156_25 : SRDS_PLLCR0_RFCK_SEL_125;
-       actual[2] = (sw3 & 0x10) ?
+       actual[2] = (sw & 0x10) ?
                SRDS_PLLCR0_RFCK_SEL_156_25 : SRDS_PLLCR0_RFCK_SEL_125;
+#endif
 
        for (i = 0; i < NUM_SRDS_BANKS; i++) {
                u32 expected = srds_regs->bank[i].pllcr0 & SRDS_PLLCR0_RFCK_SEL_MASK;
@@ -186,13 +217,6 @@ int misc_init_r(void)
        return 0;
 }
 
-#ifdef CONFIG_MP
-void board_lmb_reserve(struct lmb *lmb)
-{
-       cpu_mp_lmb_reserve(lmb);
-}
-#endif
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
index 07b950f4ba7e0d886161c1c870c0056080013bf5..98024c72d7f02ed8f347d6720403f16a9a967a4b 100644 (file)
@@ -16,9 +16,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
-                                  unsigned int ctrl_num);
-
 
 /*
  * Fixed sdram init -- doesn't use serial presence detect.
@@ -31,19 +28,21 @@ extern fixed_ddr_parm_t fixed_ddr_parm_1[];
 phys_size_t fixed_sdram(void)
 {
        int i;
-       sys_info_t sysinfo;
        char buf[32];
        fsl_ddr_cfg_regs_t ddr_cfg_regs;
        phys_size_t ddr_size;
        unsigned int lawbar1_target_id;
+       ulong ddr_freq, ddr_freq_mhz;
+
+       ddr_freq = get_ddr_freq(0);
+       ddr_freq_mhz = ddr_freq / 1000000;
 
-       get_sys_info(&sysinfo);
        printf("Configuring DDR for %s MT/s data rate\n",
-                               strmhz(buf, sysinfo.freqDDRBus));
+                               strmhz(buf, ddr_freq));
 
        for (i = 0; fixed_ddr_parm_0[i].max_freq > 0; i++) {
-               if ((sysinfo.freqDDRBus > fixed_ddr_parm_0[i].min_freq) &&
-                  (sysinfo.freqDDRBus <= fixed_ddr_parm_0[i].max_freq)) {
+               if ((ddr_freq_mhz > fixed_ddr_parm_0[i].min_freq) &&
+                  (ddr_freq_mhz <= fixed_ddr_parm_0[i].max_freq)) {
                        memcpy(&ddr_cfg_regs,
                                fixed_ddr_parm_0[i].ddr_settings,
                                sizeof(ddr_cfg_regs));
@@ -53,7 +52,7 @@ phys_size_t fixed_sdram(void)
 
        if (fixed_ddr_parm_0[i].max_freq == 0)
                panic("Unsupported DDR data rate %s MT/s data rate\n",
-                       strmhz(buf, sysinfo.freqDDRBus));
+                       strmhz(buf, ddr_freq));
 
        ddr_size = (phys_size_t) CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
        ddr_cfg_regs.ddr_cdr1 = DDR_CDR1_DHC_EN;
@@ -108,38 +107,6 @@ phys_size_t fixed_sdram(void)
        return ddr_size;
 }
 
-static void get_spd(ddr3_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       int ret;
-
-       ret = i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr3_spd_eeprom_t));
-       if (ret) {
-               debug("DDR: failed to read SPD from address %u\n", i2c_address);
-               memset(spd, 0, sizeof(ddr3_spd_eeprom_t));
-       }
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr3_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0)
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-               else if (ctrl_num == 1 && i == 0)
-                       i2c_address = SPD_EEPROM_ADDRESS2;
-
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 typedef struct {
        u32 datarate_mhz_low;
        u32 datarate_mhz_high;
index 43b4b97de184972381debfe51444c3d04ea1622f..d2ba556b636095cf6c269992cd259c10f5e89588 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2010 Freescale Semiconductor, Inc.
+ * Copyright 2008-2011 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -35,6 +35,9 @@ struct law_entry law_table[] = {
 #ifdef CONFIG_SYS_DCSRBAR_PHYS
        SET_LAW(CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_4M, LAW_TRGT_IF_DCSR),
 #endif
+#ifdef CONFIG_SYS_NAND_BASE_PHYS
+       SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
+#endif
 };
 
 int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/corenet_ds/p3041ds_ddr.c b/board/freescale/corenet_ds/p3041ds_ddr.c
new file mode 100644 (file)
index 0000000..5a8ed94
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * Copyright 2009-2010 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
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include <common.h>
+#include <asm/fsl_ddr_sdram.h>
+
+fixed_ddr_parm_t fixed_ddr_parm_0[] = {
+       {0, 0, NULL}
+};
index 4ad89ff48a970279d828c10696df1c5080075028..844e1d736a7a54752105a546cf86cbee70469255 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009-2010 Freescale Semiconductor, Inc.
+ * Copyright 2009-2011 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
@@ -9,12 +9,6 @@
 #include <common.h>
 #include <asm/fsl_ddr_sdram.h>
 
-#define DATARATE_800MHZ                        800000000
-#define DATARATE_900MHZ                        900000000
-#define DATARATE_1000MHZ               1000000000
-#define DATARATE_1200MHZ               1200000000
-#define DATARATE_1300MHZ               1300000000
-
 #define CONFIG_SYS_DDR_TIMING_3_1200   0x01030000
 #define CONFIG_SYS_DDR_TIMING_0_1200   0xCC550104
 #define CONFIG_SYS_DDR_TIMING_1_1200   0x868FAA45
@@ -340,17 +334,17 @@ fsl_ddr_cfg_regs_t ddr_cfg_regs_1200_2nd = {
 };
 
 fixed_ddr_parm_t fixed_ddr_parm_0[] = {
-       {DATARATE_800MHZ, DATARATE_900MHZ, &ddr_cfg_regs_800},
-       {DATARATE_900MHZ, DATARATE_1000MHZ, &ddr_cfg_regs_900},
-       {DATARATE_1000MHZ, DATARATE_1200MHZ, &ddr_cfg_regs_1000},
-       {DATARATE_1200MHZ, DATARATE_1300MHZ, &ddr_cfg_regs_1200},
+       {750, 850, &ddr_cfg_regs_800},
+       {850, 950, &ddr_cfg_regs_900},
+       {950, 1050, &ddr_cfg_regs_1000},
+       {1050, 1250, &ddr_cfg_regs_1200},
        {0, 0, NULL}
 };
 
 fixed_ddr_parm_t fixed_ddr_parm_1[] = {
-       {DATARATE_800MHZ, DATARATE_900MHZ, &ddr_cfg_regs_800_2nd},
-       {DATARATE_900MHZ, DATARATE_1000MHZ, &ddr_cfg_regs_900_2nd},
-       {DATARATE_1000MHZ, DATARATE_1200MHZ, &ddr_cfg_regs_1000_2nd},
-       {DATARATE_1200MHZ, DATARATE_1300MHZ, &ddr_cfg_regs_1200_2nd},
+       {750, 850, &ddr_cfg_regs_800_2nd},
+       {850, 950, &ddr_cfg_regs_900_2nd},
+       {950, 1050, &ddr_cfg_regs_1000_2nd},
+       {1050, 1250, &ddr_cfg_regs_1200_2nd},
        {0, 0, NULL}
 };
diff --git a/board/freescale/corenet_ds/p5020ds_ddr.c b/board/freescale/corenet_ds/p5020ds_ddr.c
new file mode 100644 (file)
index 0000000..e65de36
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2009-2010 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
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include <common.h>
+#include <asm/fsl_ddr_sdram.h>
+
+fixed_ddr_parm_t fixed_ddr_parm_0[] = {
+       {0, 0, NULL}
+};
+
+fixed_ddr_parm_t fixed_ddr_parm_1[] = {
+       {0, 0, NULL}
+};
index 1ae0416248c7f8d0311108198803ad8d9be693bc..38736b449687b1c750689da61a7e530d32ff57f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2010 Freescale Semiconductor, Inc.
+ * Copyright 2008-2011 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -51,9 +51,19 @@ struct fsl_e_tlb_entry tlb_table[] = {
 
        /* TLB 1 */
        /* *I*** - Covers boot page */
+#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L3_ADDR)
+       /*
+        * *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the
+        * SRAM is at 0xfff00000, it covered the 0xfffff000.
+        */
+       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L3_ADDR, CONFIG_SYS_INIT_L3_ADDR,
+                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+                       0, 0, BOOKE_PAGESZ_1M, 1),
+#else
        SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 0, BOOKE_PAGESZ_4K, 1),
+#endif
 
        /* *I*G* - CCSRBAR */
        SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
@@ -107,6 +117,16 @@ struct fsl_e_tlb_entry tlb_table[] = {
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 13, BOOKE_PAGESZ_4M, 1),
 #endif
+#ifdef CONFIG_SYS_NAND_BASE
+       /*
+        * *I*G - NAND
+        * entry 14 and 15 has been used hard coded, they will be disabled
+        * in cpu_init_f, so we use entry 16 for nand.
+        */
+       SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS,
+                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+                       0, 16, BOOKE_PAGESZ_1M, 1),
+#endif
 };
 
 int num_tlb_entries = ARRAY_SIZE(tlb_table);
index 0babd2648afce1f0661e9d8c86238a3dfce8e493..51d8035203fec240e0e247e28fdbea977f47dd65 100644 (file)
@@ -16,6 +16,7 @@
 #include <mpc83xx.h>
 #include <i2c.h>
 #include <miiphy.h>
+#include <phy.h>
 #if defined(CONFIG_PCI)
 #include <pci.h>
 #endif
@@ -160,8 +161,9 @@ int board_eth_init(bd_t *bd)
                int i;
 
                for (i = 0; i < ARRAY_SIZE(uec_info); i++)
-                       uec_info[i].enet_interface_type = RGMII_RXID;
-                       uec_info[i].speed = 1000;
+                       uec_info[i].enet_interface_type =
+                               PHY_INTERFACE_MODE_RGMII_RXID;
+                       uec_info[i].speed = SPEED_1000;
        }
        return uec_eth_init(bd, uec_info, ARRAY_SIZE(uec_info));
 }
@@ -398,7 +400,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                                                   "phy-connection-type", 0);
                                if (prop && (strcmp(prop, "rgmii-id") == 0))
                                        fdt_fixup_phy_connection(blob, path,
-                                                               RGMII_RXID);
+                                               PHY_INTERFACE_MODE_RGMII_RXID);
                        }
 #endif
 #if defined(CONFIG_HAS_ETH1)
@@ -410,7 +412,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                                                   "phy-connection-type", 0);
                                if (prop && (strcmp(prop, "rgmii-id") == 0))
                                        fdt_fixup_phy_connection(blob, path,
-                                                               RGMII_RXID);
+                                               PHY_INTERFACE_MODE_RGMII_RXID);
                        }
 #endif
                }
index 51dd692c2e41b93b8e17ce7e3cecacd44c8cbd7b..650a4fe483955740d5d67ee65479e0ac5d984324 100644 (file)
@@ -21,6 +21,8 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <fsl_esdhc.h>
+#include <fsl_mdio.h>
+#include <phy.h>
 #include "pci.h"
 #include "../common/pq-mds-pib.h"
 
@@ -86,6 +88,7 @@ int board_mmc_init(bd_t *bd)
 #if defined(CONFIG_TSEC1) || defined(CONFIG_TSEC2)
 int board_eth_init(bd_t *bd)
 {
+       struct fsl_pq_mdio_info mdio_info;
        struct tsec_info_struct tsec_info[2];
        struct immap __iomem *im = (struct immap __iomem *)CONFIG_SYS_IMMR;
        u32 rcwh = in_be32(&im->reset.rcwh);
@@ -131,6 +134,11 @@ int board_eth_init(bd_t *bd)
        }
        num++;
 #endif
+
+       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       mdio_info.name = DEFAULT_MII_NAME;
+       fsl_pq_mdio_init(bd, &mdio_info);
+
        return tsec_eth_init(bd, tsec_info, num);
 }
 
@@ -148,7 +156,7 @@ static void __ft_tsec_fixup(void *blob, bd_t *bd, const char *alias,
                return;
        }
 
-       err = fdt_fixup_phy_connection(blob, off, SGMII);
+       err = fdt_fixup_phy_connection(blob, off, PHY_INTERFACE_MODE_SGMII);
 
        if (err) {
                printf("WARNING: could not set phy-connection-type for %s: "
diff --git a/board/freescale/mpc8536ds/config.mk b/board/freescale/mpc8536ds/config.mk
deleted file mode 100644 (file)
index 228d8c0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright 2008, 2011 Freescale Semiconductor.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-
-#
-# mpc8536ds board
-#
-ifndef NAND_SPL
-ifeq ($(CONFIG_NAND), y)
-LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
-endif
-endif
index 2bad787d60685dc1a8b27125632060e5267c26e0..d10370c9f20fc0866f12a739b37c776eba7224ee 100644 (file)
@@ -7,36 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-
-       if (ctrl_num) {
-               printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
-               return;
-       }
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               get_spd(&(ctrl_dimms_spd[i]), SPD_EEPROM_ADDRESS);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index f83f629d4689584714352f4a1022a0a7fa6ab792..b292e1354187f0fa51df9e93dd88bea0c4ee00a0 100644 (file)
@@ -36,6 +36,7 @@
 #include <libfdt.h>
 #include <spd_sdram.h>
 #include <fdt_support.h>
+#include <fsl_mdio.h>
 #include <tsec.h>
 #include <netdev.h>
 #include <sata.h>
@@ -234,6 +235,7 @@ int board_early_init_r(void)
 int board_eth_init(bd_t *bis)
 {
 #ifdef CONFIG_TSEC_ENET
+       struct fsl_pq_mdio_info mdio_info;
        struct tsec_info_struct tsec_info[2];
        int num = 0;
 
@@ -268,6 +270,10 @@ int board_eth_init(bd_t *bis)
        }
 #endif
 
+       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       mdio_info.name = DEFAULT_MII_NAME;
+       fsl_pq_mdio_init(bis, &mdio_info);
+
        tsec_eth_init(bis, tsec_info, num);
 #endif
        return pci_eth_init(bis);
index 93d1100717f8fe5216574c9ccfca3bd05074a993..571137443ebd4d12a3b7239f6d044533df451dcc 100644 (file)
@@ -7,40 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
-}
-
-
-unsigned int
-fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-
-void
-fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index c84a6cbe1c7715fcfd1b7ec11aecef5a32339da7..78d73b0ea8838f2890b81cd61de9cc4e5837c5d9 100644 (file)
@@ -7,36 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index b8330eb961de4d03e2edf39d2219699656633de2..94219b9471e395ae2286f283ec698a70a83a1911 100644 (file)
@@ -7,37 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-
-       if (ctrl_num) {
-               printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
-               return;
-       }
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               get_spd(&(ctrl_dimms_spd[i]), SPD_EEPROM_ADDRESS);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index a48c8155c5086be73a23cea3785ed67fa6727566..6fe8d3963214cf538228f2960545343fae51820b 100644 (file)
@@ -33,6 +33,7 @@
 #include <miiphy.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <fsl_mdio.h>
 #include <tsec.h>
 #include <netdev.h>
 
@@ -248,9 +249,35 @@ get_board_sys_clk(ulong dummy)
        return val;
 }
 
+
+#define MIIM_CIS8204_SLED_CON          0x1b
+#define MIIM_CIS8204_SLEDCON_INIT      0x1115
+/*
+ * Hack to write all 4 PHYs with the LED values
+ */
+int board_phy_config(struct phy_device *phydev)
+{
+       static int do_once;
+       uint phyid;
+       struct mii_dev *bus = phydev->bus;
+
+       if (do_once)
+               return 0;
+
+       for (phyid = 0; phyid < 4; phyid++)
+               bus->write(bus, phyid, MDIO_DEVAD_NONE, MIIM_CIS8204_SLED_CON,
+                               MIIM_CIS8204_SLEDCON_INIT);
+
+       do_once = 1;
+
+       return 0;
+}
+
+
 int board_eth_init(bd_t *bis)
 {
 #ifdef CONFIG_TSEC_ENET
+       struct fsl_pq_mdio_info mdio_info;
        struct tsec_info_struct tsec_info[2];
        int num = 0;
 
@@ -282,6 +309,9 @@ int board_eth_init(bd_t *bis)
                fsl_sgmii_riser_init(tsec_info, num);
        }
 
+       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       mdio_info.name = DEFAULT_MII_NAME;
+       fsl_pq_mdio_init(bis, &mdio_info);
 
        tsec_eth_init(bis, tsec_info, num);
 #endif
index ab64fa88f2655916348963351f08d0e277fbc3f1..996ffe206da7bb31a7f3228c84b359709dfaa120 100644 (file)
@@ -7,37 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                       unsigned int ctrl_num)
-{
-       unsigned int i;
-
-       if (ctrl_num) {
-               printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
-               return;
-       }
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               get_spd(&(ctrl_dimms_spd[i]), SPD_EEPROM_ADDRESS);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index c84a6cbe1c7715fcfd1b7ec11aecef5a32339da7..78d73b0ea8838f2890b81cd61de9cc4e5837c5d9 100644 (file)
@@ -7,36 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index 93d1100717f8fe5216574c9ccfca3bd05074a993..571137443ebd4d12a3b7239f6d044533df451dcc 100644 (file)
@@ -7,40 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
-}
-
-
-unsigned int
-fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-
-void
-fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index 482fd919f5428ad60cdbfb19dda4c57402d1e3ee..b1f4f1f8481f0c09a9b3dbe043b59eb68810ae7d 100644 (file)
@@ -7,38 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
-}
-
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-
-       if (ctrl_num) {
-               printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
-               return;
-       }
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               get_spd(&(ctrl_dimms_spd[i]), SPD_EEPROM_ADDRESS);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
diff --git a/board/freescale/mpc8569mds/config.mk b/board/freescale/mpc8569mds/config.mk
deleted file mode 100644 (file)
index 54b2eb1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright (C) 2009 Freescale Semiconductor, Inc.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-
-#
-# mpc8569mds board
-#
-ifndef NAND_SPL
-ifeq ($(CONFIG_NAND), y)
-LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
-endif
-endif
index e3f5b4aa21dae5ee9d2e6439d41b2f867af9eceb..68f686b7e6abdef1c07e8494639eb1da2e5b20ac 100644 (file)
@@ -7,38 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr3_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr3_spd_eeprom_t));
-}
-
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr3_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0)
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-               if (ctrl_num == 0 && i == 1)
-                       i2c_address = SPD_EEPROM_ADDRESS2;
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index ecda2229902dd7b863ac23fbf4370cff05c91479..89557d221f99895e65c0012464602d9f1a346453 100644 (file)
@@ -39,6 +39,7 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <fsl_esdhc.h>
+#include <phy.h>
 
 #include "bcsr.h"
 #if defined(CONFIG_PQ_MDS_PIB)
@@ -550,7 +551,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                        break;
                }
 
-               err = fdt_fixup_phy_connection(blob, nodeoff, RMII);
+               err = fdt_fixup_phy_connection(blob, nodeoff,
+                               PHY_INTERFACE_MODE_RMII);
 
                if (err < 0) {
                        printf("WARNING: could not set phy-connection-type "
diff --git a/board/freescale/mpc8572ds/config.mk b/board/freescale/mpc8572ds/config.mk
deleted file mode 100644 (file)
index 9fd30f9..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright 2007-2008,2010-2011 Freescale Semiconductor, Inc.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-
-#
-# mpc8572ds board
-#
-ifndef NAND_SPL
-ifeq ($(CONFIG_NAND), y)
-LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
-endif
-endif
index cdde6ec70fc90c9d5b83967f5fb7d51c7ef2b8e7..ab471afb977b6cf937ff71a9dab3cc69ae235afa 100644 (file)
@@ -7,38 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-               }
-               if (ctrl_num == 1 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS2;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 typedef struct {
        u32 datarate_mhz_low;
        u32 datarate_mhz_high;
index 4b2ef4e5e6ce420eae29f5a942b9de8b6aa5fd19..b20299e36f678ec94a8a69ffb56623d976f0ccd8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2010 Freescale Semiconductor, Inc.
+ * Copyright 2007-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -35,6 +35,7 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <tsec.h>
+#include <fsl_mdio.h>
 #include <netdev.h>
 
 #include "../common/sgmii_riser.h"
@@ -187,6 +188,7 @@ int board_early_init_r(void)
 #ifdef CONFIG_TSEC_ENET
 int board_eth_init(bd_t *bis)
 {
+       struct fsl_pq_mdio_info mdio_info;
        struct tsec_info_struct tsec_info[4];
        int num = 0;
 
@@ -233,6 +235,10 @@ int board_eth_init(bd_t *bis)
        fsl_sgmii_riser_init(tsec_info, num);
 #endif
 
+       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       mdio_info.name = DEFAULT_MII_NAME;
+       fsl_pq_mdio_init(bis, &mdio_info);
+
        tsec_eth_init(bis, tsec_info, num);
 
        return pci_eth_init(bis);
@@ -259,12 +265,3 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 }
 #endif
-
-#ifdef CONFIG_MP
-extern void cpu_mp_lmb_reserve(struct lmb *lmb);
-
-void board_lmb_reserve(struct lmb *lmb)
-{
-       cpu_mp_lmb_reserve(lmb);
-}
-#endif
index 0117d136bbbbaaa984aa38f00ebd79511a1323c8..94219b9471e395ae2286f283ec698a70a83a1911 100644 (file)
@@ -7,36 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_bus_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index 81e53e734ffbfbb4d1cb28b98b7b0726246fcaee..3011bb805030418acf4670d3cbdad20236d516f8 100644 (file)
@@ -1,6 +1,7 @@
 /*
- * Copyright 2007 Freescale Semiconductor, Inc.
- * York Sun <yorksun@freescale.com>
+ * Copyright 2007-2011 Freescale Semiconductor, Inc.
+ * Authors: York Sun <yorksun@freescale.com>
+ *          Timur Tabi <timur@freescale.com>
  *
  * FSL DIU Framebuffer driver
  *
 #include <command.h>
 #include <asm/io.h>
 #include <fsl_diu_fb.h>
+#include "../common/pixis.h"
+
+#define PX_BRDCFG0_DLINK       0x10
+#define PX_BRDCFG0_DVISEL      0x08
 
 void diu_set_pixel_clock(unsigned int pixclock)
 {
@@ -49,50 +54,34 @@ void diu_set_pixel_clock(unsigned int pixclock)
        debug("DIU: Modified value of CLKDVDR = 0x%08x\n", *guts_clkdvdr);
 }
 
-int platform_diu_init(unsigned int *xres, unsigned int *yres)
+int platform_diu_init(unsigned int xres, unsigned int yres, const char *port)
 {
-       char *monitor_port;
-       int gamma_fix;
-       unsigned int pixel_format;
-       unsigned char tmp_val;
-       unsigned char pixis_arch;
-       u8 *pixis_base = (u8 *)PIXIS_BASE;
-
-       tmp_val = in_8(pixis_base + PIXIS_BRDCFG0);
-       pixis_arch = in_8(pixis_base + PIXIS_VER);
-
-       monitor_port = getenv("monitor");
-       if (!strncmp(monitor_port, "0", 1)) {   /* 0 - DVI */
-               *xres = 1280;
-               *yres = 1024;
-               if (pixis_arch == 0x01)
-                       pixel_format = 0x88882317;
-               else
-                       pixel_format = 0x88883316;
-               gamma_fix = 0;
-               out_8(pixis_base + PIXIS_BRDCFG0, tmp_val | 0x08);
+       const char *name;
+       int gamma_fix = 0;
+       u32 pixel_format = 0x88883316;
+       u8 temp;
 
-       } else if (!strncmp(monitor_port, "1", 1)) { /* 1 - Single link LVDS */
-               *xres = 1024;
-               *yres = 768;
-               pixel_format = 0x88883316;
-               gamma_fix = 0;
-               out_8(pixis_base + PIXIS_BRDCFG0, (tmp_val & 0xf7) | 0x10);
+       temp = in_8(&pixis->brdcfg0);
 
-       } else if (!strncmp(monitor_port, "2", 1)) { /* 2 - Double link LVDS */
-               *xres = 1280;
-               *yres = 1024;
-               pixel_format = 0x88883316;
+       if (strncmp(port, "dlvds", 5) == 0) {
+               /* Dual link LVDS */
                gamma_fix = 1;
-               out_8(pixis_base + PIXIS_BRDCFG0, tmp_val & 0xe7);
-
-       } else {        /* DVI */
-               *xres = 1280;
-               *yres = 1024;
-               pixel_format = 0x88882317;
-               gamma_fix = 0;
-               out_8(pixis_base + PIXIS_BRDCFG0, tmp_val | 0x08);
+               temp &= ~(PX_BRDCFG0_DLINK | PX_BRDCFG0_DVISEL);
+               name = "Dual-Link LVDS";
+       } else if (strncmp(port, "lvds", 4) == 0) {
+               /* Single link LVDS */
+               temp = (temp & ~PX_BRDCFG0_DVISEL) | PX_BRDCFG0_DLINK;
+               name = "Single-Link LVDS";
+       } else {
+               /* DVI */
+               if (in_8(&pixis->ver) == 1)     /* Board version */
+                       pixel_format = 0x88882317;
+               temp |= PX_BRDCFG0_DVISEL;
+               name = "DVI";
        }
 
-       return fsl_diu_init(*xres, pixel_format, gamma_fix);
+       printf("DIU:   Switching to %s monitor @ %ux%u\n", name, xres, yres);
+       out_8(&pixis->brdcfg0, temp);
+
+       return fsl_diu_init(xres, pixel_format, gamma_fix);
 }
index 8dc249b99dc89180a76ea891ed7d3e7c13b41273..bd0b299d0b40175abc886e5eea6e8d687f147917 100644 (file)
@@ -7,45 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_bus_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-               }
-               if (ctrl_num == 0 && i == 1) {
-                       i2c_address = SPD_EEPROM_ADDRESS2;
-               }
-               if (ctrl_num == 1 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS3;
-               }
-               if (ctrl_num == 1 && i == 1) {
-                       i2c_address = SPD_EEPROM_ADDRESS4;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 typedef struct {
        u32 datarate_mhz_low;
        u32 datarate_mhz_high;
@@ -144,7 +109,7 @@ void fsl_ddr_board_options(memctl_options_t *popts,
        /* Get clk_adjust, cpo, write_data_delay, according to the board ddr
         * freqency and n_banks specified in board_specific_parameters table.
         */
-       ddr_freq = fsl_ddr_get_mem_data_rate() / 1000000;
+       ddr_freq = get_ddr_freq(0) / 1000000;
        for (j = 0; j < CONFIG_DIMM_SLOTS_PER_CTLR; j++) {
                if (pdimm[j].n_ranks > 0) {
                        for (i = 0; i < num_params; i++) {
index 166ff0c97b0df494aa269c823fa898f62259619a..e3916fc8e431d58de4f2254cef417a2183ff6f89 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006, 2007, 2010 Freescale Semiconductor.
+ * Copyright 2006, 2007, 2010-2011 Freescale Semiconductor.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
 
 phys_size_t fixed_sdram(void);
 
-int board_early_init_f(void)
-{
-       return 0;
-}
-
 int checkboard(void)
 {
        u8 vboot;
@@ -261,12 +256,3 @@ void board_reset(void)
        while (1)
                ;
 }
-
-#ifdef CONFIG_MP
-extern void cpu_mp_lmb_reserve(struct lmb *lmb);
-
-void board_lmb_reserve(struct lmb *lmb)
-{
-       cpu_mp_lmb_reserve(lmb);
-}
-#endif
index 2303f30bd7e681fd54d357a8a7fef9740e12f70d..0131edfbe9a651f510cb781d7c6cd3d673f8d4cc 100644 (file)
@@ -1,3 +1 @@
 CONFIG_SYS_TEXT_BASE = 0x87f00000
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
index e16605836be00c538c90ef4a34682d751615b456..5c18bc19648a9bb038415bf2b78e6ecb95894eb7 100644 (file)
@@ -17,7 +17,7 @@
  * MA 02111-1307 USA
  */
 
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 
 .macro REG reg, val
        ldr r2, =\reg
index bc25c6deb5cb8c04b6b07c5d15f5935eaa843cf3..a298e0530f52b4707d9c39f11bc131bcf4fc0fd0 100644 (file)
@@ -23,8 +23,8 @@
 #include <common.h>
 #include <netdev.h>
 #include <asm/io.h>
-#include <asm/arch/mx31.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/imx-regs.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index cd0503ec3a56e0f53be09fd3424d514b973ae297..5b35bb47620217eead027678a598fcbf208c94b1 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #include <config.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 #include <asm/macro.h>
 
 .globl lowlevel_init
index a9f0fb477a48dac668cee1d700070118e41eb1fc..826fb4a86d9430bab38a9ca3a5db38dda2ef252a 100644 (file)
@@ -26,8 +26,8 @@
 
 #include <common.h>
 #include <netdev.h>
-#include <asm/arch/mx31.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/imx-regs.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -70,7 +70,7 @@ int board_init(void)
 
 int checkboard(void)
 {
-       printf("Board: i.MX31 MAX PDK (3DS)\n");
+       printf("Board: MX31PDK\n");
        return 0;
 }
 
diff --git a/board/freescale/mx51evk/config.mk b/board/freescale/mx51evk/config.mk
deleted file mode 100644 (file)
index 6e90671..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-
-CONFIG_SYS_TEXT_BASE = 0x97800000
-IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage.cfg
-ALL += $(obj)u-boot.imx
diff --git a/board/freescale/mx53evk/config.mk b/board/freescale/mx53evk/config.mk
deleted file mode 100644 (file)
index 0e60454..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-
-IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage.cfg
-ALL += $(obj)u-boot.imx
index 7ecfb3e81b5046f3796cb89c90e1dcbce3d2418c..20b996e52a9872f27eefff66752d32796f7edcd1 100644 (file)
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr3_spd_eeprom_t *ctrl_dimms_spd, unsigned int ctrl_num)
-{
-       int ret;
-
-       /*
-        * The P1022 has only one DDR controller, and the board has only one
-        * DIMM slot.
-        */
-       ret = i2c_read(SPD_EEPROM_ADDRESS1, 0, 1, (u8 *)ctrl_dimms_spd,
-                      sizeof(ddr3_spd_eeprom_t));
-       if (ret) {
-               debug("DDR: failed to read SPD from address %u\n",
-                     SPD_EEPROM_ADDRESS1);
-               memset(ctrl_dimms_spd, 0, sizeof(ddr3_spd_eeprom_t));
-       }
-}
-
 typedef struct {
        u32 datarate_mhz_low;
        u32 datarate_mhz_high;
index 8f5305ca1f9c448283359c6794ecda69df6fe367..7d1f6aa1246113373ef4e83baaade14cddcf798a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
  * Authors: Timur Tabi <timur@freescale.com>
  *
  * FSL DIU Framebuffer driver
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <linux/ctype.h>
 #include <asm/io.h>
 #include <stdio_dev.h>
 #include <video_fb.h>
@@ -81,10 +82,10 @@ void diu_set_pixel_clock(unsigned int pixclock)
        out_be32(&gur->clkdvdr, temp | 0x80000000 | ((pixval & 0x1F) << 16));
 }
 
-int platform_diu_init(unsigned int *xres, unsigned int *yres)
+int platform_diu_init(unsigned int xres, unsigned int yres, const char *port)
 {
        ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-       char *monitor_port;
+       const char *name;
        u32 pixel_format;
        u8 temp;
 
@@ -100,21 +101,23 @@ int platform_diu_init(unsigned int *xres, unsigned int *yres)
 
        temp = in_8(&pixis->brdcfg1);
 
-       monitor_port = getenv("monitor");
-       if (!strncmp(monitor_port, "1", 1)) { /* 1 - Single link LVDS */
-               *xres = 1024;
-               *yres = 768;
-               /* Enable the DFP port, disable the DVI and the backlight */
-               temp &= ~(PX_BRDCFG1_DVIEN | PX_BRDCFG1_BACKLIGHT);
-               temp |= PX_BRDCFG1_DFPEN;
+       if (strncmp(port, "lvds", 4) == 0) {
+               /* Single link LVDS */
+               temp &= ~PX_BRDCFG1_DVIEN;
+               /*
+                * LVDS also needs backlight enabled, otherwise the display
+                * will be blank.
+                */
+               temp |= (PX_BRDCFG1_DFPEN | PX_BRDCFG1_BACKLIGHT);
+               name = "Single-Link LVDS";
        } else {        /* DVI */
-               *xres = 1280;
-               *yres = 1024;
                /* Enable the DVI port, disable the DFP and the backlight */
                temp &= ~(PX_BRDCFG1_DFPEN | PX_BRDCFG1_BACKLIGHT);
                temp |= PX_BRDCFG1_DVIEN;
+               name = "DVI";
        }
 
+       printf("DIU:   Switching to %s monitor @ %ux%u\n", name, xres, yres);
        out_8(&pixis->brdcfg1, temp);
 
        /*
@@ -136,11 +139,9 @@ int platform_diu_init(unsigned int *xres, unsigned int *yres)
        clrsetbits_be32(&gur->pmuxcr, PMUXCR_ELBCDIU_MASK, PMUXCR_ELBCDIU_DIU);
        pmuxcr = in_be32(&gur->pmuxcr);
 
-       return fsl_diu_init(*xres, pixel_format, 0);
+       return fsl_diu_init(xres, pixel_format, 0);
 }
 
-#ifdef CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
-
 /*
  * set_mux_to_lbc - disable the DIU so that we can read/write to elbc
  *
@@ -211,6 +212,68 @@ static void set_mux_to_diu(void)
        in_be32(&gur->pmuxcr);
 }
 
+/*
+ * pixis_read - board-specific function to read from the PIXIS
+ *
+ * This function overrides the generic pixis_read() function, so that it can
+ * use PIXIS indirect mode if necessary.
+ */
+u8 pixis_read(unsigned int reg)
+{
+       ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+
+       /* Use indirect mode if the mux is currently set to DIU mode */
+       if ((in_be32(&gur->pmuxcr) & PMUXCR_ELBCDIU_MASK) !=
+           PMUXCR_ELBCDIU_NOR16) {
+               out_8(lbc_lcs0_ba, reg);
+               return in_8(lbc_lcs1_ba);
+       } else {
+               void *p = (void *)PIXIS_BASE;
+
+               return in_8(p + reg);
+       }
+}
+
+/*
+ * pixis_write - board-specific function to write to the PIXIS
+ *
+ * This function overrides the generic pixis_write() function, so that it can
+ * use PIXIS indirect mode if necessary.
+ */
+void pixis_write(unsigned int reg, u8 value)
+{
+       ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+
+       /* Use indirect mode if the mux is currently set to DIU mode */
+       if ((in_be32(&gur->pmuxcr) & PMUXCR_ELBCDIU_MASK) !=
+           PMUXCR_ELBCDIU_NOR16) {
+               out_8(lbc_lcs0_ba, reg);
+               out_8(lbc_lcs1_ba, value);
+               /* Do a read-back to ensure the write completed */
+               in_8(lbc_lcs1_ba);
+       } else {
+               void *p = (void *)PIXIS_BASE;
+
+               out_8(p + reg, value);
+       }
+}
+
+void pixis_bank_reset(void)
+{
+       /*
+        * For some reason, a PIXIS bank reset does not work if the PIXIS is
+        * in indirect mode, so switch to direct mode first.
+        */
+       set_mux_to_lbc();
+
+       out_8(&pixis->vctl, 0);
+       out_8(&pixis->vctl, 1);
+
+       while (1);
+}
+
+#ifdef CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
+
 void flash_write8(u8 value, void *addr)
 {
        int sw = set_mux_to_lbc();
index 0ea0bdf28e9e5977c95a4e36867678e61b6e2ea7..8ef627fc7b452cbf64b67f59ef5b80b25f7a547b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
  * Authors: Srikanth Srinivasan <srikanth.srinivasan@freescale.com>
  *          Timur Tabi <timur@freescale.com>
  *
@@ -22,9 +22,9 @@
 #include <asm/io.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <fsl_mdio.h>
 #include <tsec.h>
 #include <asm/fsl_law.h>
-#include <asm/mp.h>
 #include <netdev.h>
 #include <i2c.h>
 #include <hwconfig.h>
@@ -46,6 +46,9 @@ int board_early_init_f(void)
        /* Set the pin muxing to enable ETSEC2. */
        clrbits_be32(&gur->pmuxcr2, 0x001F8000);
 
+       /* Enable the SPI */
+       clrsetbits_8(&pixis->brdcfg0, PIXIS_ELBC_SPI_MASK, PIXIS_SPI);
+
        return 0;
 }
 
@@ -54,6 +57,9 @@ int checkboard(void)
        u8 sw;
 
        puts("Board: P1022DS ");
+#ifdef CONFIG_PHYS_64BIT
+       puts("(36-bit addrmap) ");
+#endif
 
        printf("Sys ID: 0x%02x, Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ",
                in_8(&pixis->id), in_8(&pixis->arch), in_8(&pixis->scver));
@@ -91,11 +97,19 @@ int checkboard(void)
 /* Choose the 11.2896Mhz codec reference clock */
 #define CONFIG_PIXIS_BRDCFG1_AUDCLK_11         0x01
 
+/* Connect to USB2 */
+#define CONFIG_PIXIS_BRDCFG0_USB2              0x10
+/* Connect to TFM bus */
+#define CONFIG_PIXIS_BRDCFG1_TDM               0x0c
+/* Connect to SPI */
+#define CONFIG_PIXIS_BRDCFG0_SPI               0x80
+
 int misc_init_r(void)
 {
        u8 temp;
        const char *audclk;
        size_t arglen;
+       ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 
        /* For DVI, enable the TFP410 Encoder. */
 
@@ -113,22 +127,48 @@ int misc_init_r(void)
                return -1;
        debug("DVI Encoder Read: 0x%02x\n",temp);
 
+       /* Enable the USB2 in PMUXCR2 and FGPA */
+       if (hwconfig("usb2")) {
+               clrsetbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_ETSECUSB_MASK,
+                       MPC85xx_PMUXCR2_USB);
+               setbits_8(&pixis->brdcfg0, CONFIG_PIXIS_BRDCFG0_USB2);
+       }
+
+       /* tdm and audio can not enable simultaneous*/
+       if (hwconfig("tdm") && hwconfig("audclk")){
+               printf("WARNING: TDM and AUDIO can not be enabled simultaneous !\n");
+               return -1;
+       }
+
+       /* Enable the TDM in PMUXCR and FGPA */
+       if (hwconfig("tdm")) {
+               clrsetbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_TDM_MASK,
+                       MPC85xx_PMUXCR_TDM);
+               setbits_8(&pixis->brdcfg1, CONFIG_PIXIS_BRDCFG1_TDM);
+               /* TDM need some configration option by SPI */
+               clrsetbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_SPI_MASK,
+                       MPC85xx_PMUXCR_SPI);
+               setbits_8(&pixis->brdcfg0, CONFIG_PIXIS_BRDCFG0_SPI);
+       }
+
        /*
         * Enable the reference clock for the WM8776 codec, and route the MUX
         * pins for SSI. The default is the 12.288 MHz clock
         */
 
-       temp = in_8(&pixis->brdcfg1) & ~(CONFIG_PIXIS_BRDCFG1_SSI_TDM_MASK |
-               CONFIG_PIXIS_BRDCFG1_AUDCLK_MASK);
-       temp |= CONFIG_PIXIS_BRDCFG1_SSI_TDM_SSI;
-
-       audclk = hwconfig_arg("audclk", &arglen);
-       /* Check the first two chars only */
-       if (audclk && (strncmp(audclk, "11", 2) == 0))
-               temp |= CONFIG_PIXIS_BRDCFG1_AUDCLK_11;
-       else
-               temp |= CONFIG_PIXIS_BRDCFG1_AUDCLK_12;
-       out_8(&pixis->brdcfg1, temp);
+       if (hwconfig("audclk")) {
+               temp = in_8(&pixis->brdcfg1) & ~(CONFIG_PIXIS_BRDCFG1_SSI_TDM_MASK |
+                       CONFIG_PIXIS_BRDCFG1_AUDCLK_MASK);
+               temp |= CONFIG_PIXIS_BRDCFG1_SSI_TDM_SSI;
+
+               audclk = hwconfig_arg("audclk", &arglen);
+               /* Check the first two chars only */
+               if (audclk && (strncmp(audclk, "11", 2) == 0))
+                       temp |= CONFIG_PIXIS_BRDCFG1_AUDCLK_11;
+               else
+                       temp |= CONFIG_PIXIS_BRDCFG1_AUDCLK_12;
+               setbits_8(&pixis->brdcfg1, temp);
+       }
 
        return 0;
 }
@@ -243,6 +283,7 @@ int board_early_init_r(void)
  */
 int board_eth_init(bd_t *bis)
 {
+       struct fsl_pq_mdio_info mdio_info;
        struct tsec_info_struct tsec_info[2];
        unsigned int num = 0;
 
@@ -255,6 +296,10 @@ int board_eth_init(bd_t *bis)
        num++;
 #endif
 
+       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       mdio_info.name = DEFAULT_MII_NAME;
+       fsl_pq_mdio_init(bis, &mdio_info);
+
        return tsec_eth_init(bis, tsec_info, num) + pci_eth_init(bis);
 }
 
@@ -302,10 +347,3 @@ void ft_board_setup(void *blob, bd_t *bd)
        ft_codec_setup(blob, "wlf,wm8776");
 }
 #endif
-
-#ifdef CONFIG_MP
-void board_lmb_reserve(struct lmb *lmb)
-{
-       cpu_mp_lmb_reserve(lmb);
-}
-#endif
diff --git a/board/freescale/p1_p2_rdb/config.mk b/board/freescale/p1_p2_rdb/config.mk
deleted file mode 100644 (file)
index 0769804..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright 2009, 2011 Freescale Semiconductor, Inc.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-
-#
-# p1_p2rdb board
-#
-
-ifndef NAND_SPL
-ifeq ($(CONFIG_NAND), y)
-LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
-endif
-endif
index e54fde25309ed393d26ec10777874582bb7ab50e..71c60888ac1d546673a8c9f1b97eda91ea630681 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009 Freescale Semiconductor, Inc.
+ * Copyright 2009, 2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
-                                  unsigned int ctrl_num);
-
-#define DATARATE_400MHZ 400000000
-#define DATARATE_533MHZ 533333333
-#define DATARATE_667MHZ 666666666
-#define DATARATE_800MHZ 800000000
-
 #define CONFIG_SYS_DDR_CS0_BNDS                0x0000003F
 #define CONFIG_SYS_DDR_CS0_CONFIG      0x80014202
 #define CONFIG_SYS_DDR_CS0_CONFIG_2    0x00000000
@@ -82,13 +74,13 @@ extern void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
 #define CONFIG_SYS_DDR_INTERVAL_667    0x0a280100
 
 #define CONFIG_SYS_DDR_TIMING_3_800    0x00040000
-#define CONFIG_SYS_DDR_TIMING_0_800    0x55770802
+#define CONFIG_SYS_DDR_TIMING_0_800    0x00770802
 #define CONFIG_SYS_DDR_TIMING_1_800    0x6f6b6543
 #define CONFIG_SYS_DDR_TIMING_2_800    0x0fa074d1
 #define CONFIG_SYS_DDR_CLK_CTRL_800    0x02800000
 #define CONFIG_SYS_DDR_MODE_1_800      0x00040852
 #define CONFIG_SYS_DDR_MODE_2_800      0x00000000
-#define CONFIG_SYS_DDR_INTERVAL_800    0x0a280100
+#define CONFIG_SYS_DDR_INTERVAL_800    0x0c300100
 
 fsl_ddr_cfg_regs_t ddr_cfg_regs_400 = {
        .cs[0].bnds = CONFIG_SYS_DDR_CS0_BNDS,
@@ -204,38 +196,47 @@ fsl_ddr_cfg_regs_t ddr_cfg_regs_800 = {
 
 phys_size_t fixed_sdram (void)
 {
-       sys_info_t sysinfo;
        char buf[32];
        fsl_ddr_cfg_regs_t ddr_cfg_regs;
        size_t ddr_size;
        struct cpu_type *cpu;
+       ulong ddr_freq, ddr_freq_mhz;
+
+       cpu = gd->cpu;
+       /* P1020 and it's derivatives support max 32bit DDR width */
+       if (cpu->soc_ver == SVR_P1020 || cpu->soc_ver == SVR_P1020_E ||
+               cpu->soc_ver == SVR_P1011 || cpu->soc_ver == SVR_P1011_E) {
+               ddr_size = (CONFIG_SYS_SDRAM_SIZE * 1024 * 1024 / 2);
+       } else {
+               ddr_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
+       }
+#if defined(CONFIG_SYS_RAMBOOT)
+       return ddr_size;
+#endif
+       ddr_freq = get_ddr_freq(0);
+       ddr_freq_mhz = ddr_freq / 1000000;
 
-       get_sys_info(&sysinfo);
        printf("Configuring DDR for %s MT/s data rate\n",
-                               strmhz(buf, sysinfo.freqDDRBus));
+                               strmhz(buf, ddr_freq));
 
-       if(sysinfo.freqDDRBus <= DATARATE_400MHZ)
+       if(ddr_freq_mhz <= 400)
                memcpy(&ddr_cfg_regs, &ddr_cfg_regs_400, sizeof(ddr_cfg_regs));
-       else if(sysinfo.freqDDRBus <= DATARATE_533MHZ)
+       else if(ddr_freq_mhz <= 533)
                memcpy(&ddr_cfg_regs, &ddr_cfg_regs_533, sizeof(ddr_cfg_regs));
-       else if(sysinfo.freqDDRBus <= DATARATE_667MHZ)
+       else if(ddr_freq_mhz <= 667)
                memcpy(&ddr_cfg_regs, &ddr_cfg_regs_667, sizeof(ddr_cfg_regs));
-       else if(sysinfo.freqDDRBus <= DATARATE_800MHZ)
+       else if(ddr_freq_mhz <= 800)
                memcpy(&ddr_cfg_regs, &ddr_cfg_regs_800, sizeof(ddr_cfg_regs));
        else
                panic("Unsupported DDR data rate %s MT/s data rate\n",
-                                       strmhz(buf, sysinfo.freqDDRBus));
+                                       strmhz(buf, ddr_freq));
 
-       cpu = gd->cpu;
        /* P1020 and it's derivatives support max 32bit DDR width */
        if(cpu->soc_ver == SVR_P1020 || cpu->soc_ver == SVR_P1020_E ||
                cpu->soc_ver == SVR_P1011 || cpu->soc_ver == SVR_P1011_E) {
                ddr_cfg_regs.ddr_sdram_cfg |= SDRAM_CFG_32_BE;
                ddr_cfg_regs.cs[0].bnds = 0x0000001F;
-               ddr_size = (CONFIG_SYS_SDRAM_SIZE * 1024 * 1024 / 2);
        }
-       else
-               ddr_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
 
        fsl_ddr_set_memctl_regs(&ddr_cfg_regs, 0);
 
index 078094200fb9b823033d1e7b5aeac2bda92de655..d66b130e6d4a20dee8179f6da7b29fbde2207efd 100644 (file)
 #include <miiphy.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <fsl_mdio.h>
 #include <tsec.h>
 #include <vsc7385.h>
 #include <netdev.h>
 #include <rtc.h>
+#include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -45,6 +47,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define RGMII_PHY_RST_SET      0x02000000
 
 #define USB_RST_CLR            0x04000000
+#define USB2_PORT_OUT_EN        0x01000000
 
 #define GPIO_DIR               0x060f0000
 
@@ -54,38 +57,25 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define SYSCLK_MASK    0x00200000
 #define BOARDREV_MASK  0x10100000
-#define BOARDREV_B     0x10100000
 #define BOARDREV_C     0x00100000
 #define BOARDREV_D     0x00000000
 
 #define SYSCLK_66      66666666
-#define SYSCLK_50      50000000
 #define SYSCLK_100     100000000
 
 unsigned long get_board_sys_clk(ulong dummy)
 {
        volatile ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
-       u32 val_gpdat, sysclk_gpio, board_rev_gpio;
+       u32 val_gpdat, sysclk_gpio;
 
        val_gpdat = in_be32(&pgpio->gpdat);
        sysclk_gpio = val_gpdat & SYSCLK_MASK;
-       board_rev_gpio = val_gpdat & BOARDREV_MASK;
-       if (board_rev_gpio == BOARDREV_C) {
-               if(sysclk_gpio == 0)
-                       return SYSCLK_66;
-               else
-                       return SYSCLK_100;
-       } else if (board_rev_gpio == BOARDREV_B) {
-               if(sysclk_gpio == 0)
-                       return SYSCLK_66;
-               else
-                       return SYSCLK_50;
-       } else if (board_rev_gpio == BOARDREV_D) {
-               if(sysclk_gpio == 0)
-                       return SYSCLK_66;
-               else
-                       return SYSCLK_100;
-       }
+
+       if(sysclk_gpio == 0)
+               return SYSCLK_66;
+       else
+               return SYSCLK_100;
+
        return 0;
 }
 
@@ -112,8 +102,6 @@ int checkboard (void)
        board_rev_gpio = val_gpdat & BOARDREV_MASK;
        if (board_rev_gpio == BOARDREV_C)
                board_rev = 'C';
-       else if (board_rev_gpio == BOARDREV_B)
-               board_rev = 'B';
        else if (board_rev_gpio == BOARDREV_D)
                board_rev = 'D';
        else
@@ -121,6 +109,9 @@ int checkboard (void)
 
        cpu = gd->cpu;
        printf ("Board: %sRDB Rev%c\n", cpu->name, board_rev);
+#ifdef CONFIG_PHYS_64BIT
+       puts ("(36-bit addrmap) \n");
+#endif
        setbits_be32(&pgpio->gpdir, GPIO_DIR);
 
 /*
@@ -138,10 +129,47 @@ int checkboard (void)
        return 0;
 }
 
+int misc_init_r(void)
+{
+#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
+       ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+       ccsr_gpio_t *gpio = (void *)CONFIG_SYS_MPC85xx_GPIO_ADDR;
+
+       setbits_be32(&gpio->gpdir, USB2_PORT_OUT_EN);
+       setbits_be32(&gpio->gpdat, USB2_PORT_OUT_EN);
+       setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_ELBC_OFF_USB2_ON);
+#endif
+       return 0;
+}
+
 int board_early_init_r(void)
 {
        const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
        const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
+       volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+       unsigned int orig_bus = i2c_get_bus_num();
+       u8 i2c_data;
+
+       i2c_set_bus_num(1);
+       if (i2c_read(CONFIG_SYS_I2C_PCA9557_ADDR, 0,
+               1, &i2c_data, sizeof(i2c_data)) == 0) {
+               if (i2c_data & 0x2)
+                       puts("NOR Flash Bank : Secondary\n");
+               else
+                       puts("NOR Flash Bank : Primary\n");
+
+               if (i2c_data & 0x1) {
+                       setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_SD_DATA);
+                       puts("SD/MMC : 8-bit Mode\n");
+                       puts("eSPI : Disabled\n");
+               } else {
+                       puts("SD/MMC : 4-bit Mode\n");
+                       puts("eSPI : Enabled\n");
+               }
+       } else {
+               puts("Failed reading I2C Chip 0x18 on bus 1\n");
+       }
+       i2c_set_bus_num(orig_bus);
 
        /*
         * Remap Boot flash region to caching-inhibited
@@ -166,6 +194,7 @@ int board_early_init_r(void)
 #ifdef CONFIG_TSEC_ENET
 int board_eth_init(bd_t *bis)
 {
+       struct fsl_pq_mdio_info mdio_info;
        struct tsec_info_struct tsec_info[4];
        int num = 0;
        char *tmp;
@@ -203,6 +232,10 @@ int board_eth_init(bd_t *bis)
                puts("No address specified for VSC7385 microcode.\n");
 #endif
 
+       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       mdio_info.name = DEFAULT_MII_NAME;
+       fsl_pq_mdio_init(bis, &mdio_info);
+
        tsec_eth_init(bis, tsec_info, num);
 
        return pci_eth_init(bis);
@@ -229,12 +262,3 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_memory(blob, (u64)base, (u64)size);
 }
 #endif
-
-#ifdef CONFIG_MP
-extern void cpu_mp_lmb_reserve(struct lmb *lmb);
-
-void board_lmb_reserve(struct lmb *lmb)
-{
-       cpu_mp_lmb_reserve(lmb);
-}
-#endif
index a46b1b5670a83f0697ddf1f788b173074b08fd94..1847935a73761b646437c9299e321b818086ef6a 100644 (file)
 
 struct fsl_e_tlb_entry tlb_table[] = {
        /* TLB 0 - for temp stack in cache */
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
+       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR,
+                       CONFIG_SYS_INIT_RAM_ADDR_PHYS,
                        MAS3_SX|MAS3_SW|MAS3_SR, 0,
                        0, 0, BOOKE_PAGESZ_4K, 0),
        SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 ,
-                       CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
+                       CONFIG_SYS_INIT_RAM_ADDR_PHYS + 4 * 1024,
                        MAS3_SX|MAS3_SW|MAS3_SR, 0,
                        0, 0, BOOKE_PAGESZ_4K, 0),
        SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 ,
-                       CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
+                       CONFIG_SYS_INIT_RAM_ADDR_PHYS + 8 * 1024,
                        MAS3_SX|MAS3_SW|MAS3_SR, 0,
                        0, 0, BOOKE_PAGESZ_4K, 0),
        SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 ,
-                       CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
+                       CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024,
                        MAS3_SX|MAS3_SW|MAS3_SR, 0,
                        0, 0, BOOKE_PAGESZ_4K, 0),
 
@@ -80,15 +81,10 @@ struct fsl_e_tlb_entry tlb_table[] = {
                        MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                        0, 6, BOOKE_PAGESZ_1M, 1),
 
-#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
-       /* *I*G - L2SRAM */
-       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 7, BOOKE_PAGESZ_256K, 1),
-       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,
-                       CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 8, BOOKE_PAGESZ_256K, 1),
+#if defined(CONFIG_SYS_RAMBOOT)
+       SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE, CONFIG_SYS_DDR_SDRAM_BASE,
+                       MAS3_SX|MAS3_SW|MAS3_SR, 0,
+                       0, 7, BOOKE_PAGESZ_1G, 1)
 #endif
 };
 
index 9a1b07554feeffcb7961eece77e3dbc3ab88f99c..9bf7d2f587ad80870cc5ad2c8ef444ef8d81f8a6 100644 (file)
@@ -7,34 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void get_spd(generic_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr3_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(generic_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0)
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 typedef struct {
        u32 datarate_mhz_low;
        u32 datarate_mhz_high;
index 8546aa903f0413eaa417ba2008783637e812492e..d3af6cf185167e3fc4af9b76f38d1ff1291b349d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2010 Freescale Semiconductor, Inc.
+ * Copyright 2007-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -34,9 +34,9 @@
 #include <miiphy.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <fsl_mdio.h>
 #include <tsec.h>
 #include <asm/fsl_law.h>
-#include <asm/mp.h>
 #include <netdev.h>
 
 #include "../common/ngpixis.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
+int board_early_init_f(void)
+{
+#ifdef CONFIG_MMC
+       ccsr_gur_t *gur = (ccsr_gur_t *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+       setbits_be32(&gur->pmuxcr,
+                        (MPC85xx_PMUXCR_SDHC_CD |
+                        MPC85xx_PMUXCR_SDHC_WP));
+#endif
+
+       return 0;
+}
+
 int checkboard(void)
 {
        u8 sw;
@@ -189,6 +202,7 @@ int board_early_init_r(void)
 #ifdef CONFIG_TSEC_ENET
 int board_eth_init(bd_t *bis)
 {
+       struct fsl_pq_mdio_info mdio_info;
        struct tsec_info_struct tsec_info[4];
        int num = 0;
 
@@ -223,6 +237,11 @@ int board_eth_init(bd_t *bis)
        fsl_sgmii_riser_init(tsec_info, num);
 #endif
 
+       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       mdio_info.name = DEFAULT_MII_NAME;
+
+       fsl_pq_mdio_init(bis, &mdio_info);
+
        tsec_eth_init(bis, tsec_info, num);
 
        return pci_eth_init(bis);
@@ -249,10 +268,3 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 }
 #endif
-
-#ifdef CONFIG_MP
-void board_lmb_reserve(struct lmb *lmb)
-{
-       cpu_mp_lmb_reserve(lmb);
-}
-#endif
index 824b3b29f08aace97855143b6dd3f57b437db46a..fd914a16a8cbd05f3f6eaad12c4918219b6f7465 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2009 Freescale Semiconductor, Inc.
+ * Copyright 2008-2011 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -90,6 +90,17 @@ struct fsl_e_tlb_entry tlb_table[] = {
        SET_TLB_ENTRY(1, PIXIS_BASE, PIXIS_BASE_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 8, BOOKE_PAGESZ_4K, 1),
+
+#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
+       /* *I*G - L2SRAM */
+       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
+                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+                     0, 9, BOOKE_PAGESZ_256K, 1),
+       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,
+                     CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,
+                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+                     0, 10, BOOKE_PAGESZ_256K, 1),
+#endif
 };
 
 int num_tlb_entries = ARRAY_SIZE(tlb_table);
index 86a3ec882b98878916927f8b03bb01877debb2ef..8b80533d9828c9737811488c27d1620258a462c3 100644 (file)
@@ -110,6 +110,11 @@ int board_early_init_f(void)
 
        for (k = 0; k < CONFIG_SYS_FPGA_COUNT; ++k) {
                ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(k);
+#ifdef CONFIG_SYS_FPGA_NO_RFL_HI
+               u16 *reflection_target = &fpga->reflection_low;
+#else
+               u16 *reflection_target = &fpga->reflection_high;
+#endif
                /*
                 * wait for fpga out of reset
                 */
@@ -117,9 +122,11 @@ int board_early_init_f(void)
                while (1) {
                        out_le16(&fpga->reflection_low,
                                REFLECTION_TESTPATTERN);
-                       if (in_le16(&fpga->reflection_high) ==
+
+                       if (in_le16(reflection_target) ==
                                REFLECTION_TESTPATTERN_INV)
                                break;
+
                        udelay(100000);
                        if (ctr++ > 5) {
                                gd->fpga_state[k] |=
index df7fb143c43ca56432caa2abb8b1fc0fd990a6d9..038854161fc505ee3df975d916cc803dfec3be67 100644 (file)
 
 #include "../common/osd.h"
 
+#define LATCH2_BASE (CONFIG_SYS_LATCH_BASE + 0x200)
+#define LATCH2_MC2_PRESENT_N 0x0080
+
+#define LATCH3_BASE (CONFIG_SYS_LATCH_BASE + 0x300)
+
 enum {
        UNITTYPE_VIDEO_USER = 0,
        UNITTYPE_MAIN_USER = 1,
@@ -60,6 +65,20 @@ enum {
        RAM_DDR2_64 = 2,
 };
 
+static unsigned int get_hwver(void)
+{
+       u16 latch3 = in_le16((void *)LATCH3_BASE);
+
+       return latch3 & 0x0003;
+}
+
+static unsigned int get_mc2_present(void)
+{
+       u16 latch2 = in_le16((void *)LATCH2_BASE);
+
+       return !(latch2 & LATCH2_MC2_PRESENT_N);
+}
+
 static void print_fpga_info(unsigned dev)
 {
        ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(dev);
@@ -206,7 +225,6 @@ static void print_fpga_info(unsigned dev)
  */
 int checkboard(void)
 {
-       unsigned k;
        char *s = getenv("serial#");
 
        printf("Board: ");
@@ -220,20 +238,27 @@ int checkboard(void)
 
        puts("\n");
 
-       for (k = 0; k < CONFIG_SYS_FPGA_COUNT; ++k)
-               print_fpga_info(k);
+       print_fpga_info(0);
+       if (get_mc2_present())
+               print_fpga_info(1);
 
        return 0;
 }
 
 int last_stage_init(void)
 {
-       unsigned k;
+       ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(0);
+       u16 versions = in_le16(&fpga->versions);
+
+       if (((versions >> 4) & 0x000f) != UNITTYPE_MAIN_USER)
+               return 0;
+
+       if (!get_fpga_state(0) || (get_hwver() == HWVER_101))
+               osd_probe(0);
 
-       for (k = 0; k < CONFIG_SYS_OSD_SCREENS; ++k)
-               if (!get_fpga_state(k)
-                   || (get_fpga_state(k) == FPGA_STATE_DONE_FAILED))
-                       osd_probe(k);
+       if (get_mc2_present() &&
+           (!get_fpga_state(1) || (get_hwver() == HWVER_101)))
+               osd_probe(1);
 
        return 0;
 }
index 4d8c046a8ab14ca2c90d026bdc1d1e0840b2f71a..5065f9d5e40a3ad729e88c5be2d1ec14036f0464 100644 (file)
 #define CH7301_I2C_ADDR 0x75
 
 #define ICS8N3QV01_I2C_ADDR 0x6E
-#define ICS8N3QV01_FREF 114285
+#define ICS8N3QV01_FREF 114285000
+#define ICS8N3QV01_FREF_LL 114285000LL
+#define ICS8N3QV01_F_DEFAULT_0 156250000LL
+#define ICS8N3QV01_F_DEFAULT_1 125000000LL
+#define ICS8N3QV01_F_DEFAULT_2 100000000LL
+#define ICS8N3QV01_F_DEFAULT_3  25175000LL
 
 #define SIL1178_MASTER_I2C_ADDRESS 0x38
 #define SIL1178_SLAVE_I2C_ADDRESS 0x39
@@ -150,6 +155,41 @@ static void mpc92469ac_set(unsigned screen, unsigned int fout)
 #endif
 
 #ifdef CONFIG_SYS_ICS8N3QV01
+
+static unsigned int ics8n3qv01_get_fout_calc(unsigned screen, unsigned index)
+{
+       unsigned long long n;
+       unsigned long long mint;
+       unsigned long long mfrac;
+       u8 reg_a, reg_b, reg_c, reg_d, reg_f;
+       unsigned long long fout_calc;
+
+       if (index > 3)
+               return 0;
+
+       reg_a = fpga_iic_read(screen, ICS8N3QV01_I2C_ADDR, 0 + index);
+       reg_b = fpga_iic_read(screen, ICS8N3QV01_I2C_ADDR, 4 + index);
+       reg_c = fpga_iic_read(screen, ICS8N3QV01_I2C_ADDR, 8 + index);
+       reg_d = fpga_iic_read(screen, ICS8N3QV01_I2C_ADDR, 12 + index);
+       reg_f = fpga_iic_read(screen, ICS8N3QV01_I2C_ADDR, 20 + index);
+
+       mint = ((reg_a >> 1) & 0x1f) | (reg_f & 0x20);
+       mfrac = ((reg_a & 0x01) << 17) | (reg_b << 9) | (reg_c << 1)
+               | (reg_d >> 7);
+       n = reg_d & 0x7f;
+
+       fout_calc = (mint * ICS8N3QV01_FREF_LL
+                    + mfrac * ICS8N3QV01_FREF_LL / 262144LL
+                    + ICS8N3QV01_FREF_LL / 524288LL
+                    + n / 2)
+                   / n
+                   * 1000000
+                   / (1000000 - 100);
+
+       return fout_calc;
+}
+
+
 static void ics8n3qv01_calc_parameters(unsigned int fout,
        unsigned int *_mint, unsigned int *_mfrac,
        unsigned int *_n)
@@ -160,7 +200,7 @@ static void ics8n3qv01_calc_parameters(unsigned int fout,
        unsigned int mint;
        unsigned long long mfrac;
 
-       n = 2550000000U / fout;
+       n = (2215000000U + fout / 2) / fout;
        if ((n & 1) && (n > 5))
                n -= 1;
 
@@ -184,9 +224,18 @@ static void ics8n3qv01_set(unsigned screen, unsigned int fout)
        unsigned int n;
        unsigned int mint;
        unsigned int mfrac;
+       unsigned int fout_calc;
+       unsigned long long fout_prog;
+       long long off_ppm;
        u8 reg0, reg4, reg8, reg12, reg18, reg20;
 
-       ics8n3qv01_calc_parameters(fout, &mint, &mfrac, &n);
+       fout_calc = ics8n3qv01_get_fout_calc(screen, 1);
+       off_ppm = (fout_calc - ICS8N3QV01_F_DEFAULT_1) * 1000000
+                 / ICS8N3QV01_F_DEFAULT_1;
+       printf("       PLL is off by %lld ppm\n", off_ppm);
+       fout_prog = (unsigned long long)fout * (unsigned long long)fout_calc
+                   / ICS8N3QV01_F_DEFAULT_1;
+       ics8n3qv01_calc_parameters(fout_prog, &mint, &mfrac, &n);
 
        reg0 = fpga_iic_read(screen, ICS8N3QV01_I2C_ADDR, 0) & 0xc0;
        reg0 |= (mint & 0x1f) << 1;
@@ -327,6 +376,8 @@ int osd_probe(unsigned screen)
        out_le16(&osd->control, 0x0049);
 
        out_le16(&osd->xy_size, ((32 - 1) << 8) | (16 - 1));
+       out_le16(&osd->x_pos, 0x007f);
+       out_le16(&osd->y_pos, 0x005f);
 
        return 0;
 }
index 8e854db22d81f3a62637cd1dbbc23e8a68421ee0..be99b512088fc0a84425efcb73e7894dc79731b3 100644 (file)
@@ -52,13 +52,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 3e396e4fae75a711135ad6f7a0155490de582563..1d66a9b2bda15f129b7480b5d3a121c12f72ec87 100644 (file)
@@ -61,13 +61,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index d50c5865b175959174fcf316a7424772c123bb9d..ca9711575d31af81e7d6a07533bac77b389d8045 100644 (file)
@@ -53,13 +53,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index ae766bc857cde9afc81adb9faafff78beac52b36..ea64004863f5f52672c189648905264cb73c0c7b 100644 (file)
@@ -28,5 +28,3 @@
 PLATFORM_CPPFLAGS += -I$(TOPDIR)
 
 OBJCFLAGS = --remove-section=.ppcenv
-
-LDSCRIPT := $(SRCTREE)/board/hymod/u-boot.lds
index 1592f4f6e8ceeb6a9c2c1c82fb97794298e9106f..1efa8b3237d35b54a24db68d378b04bbd1446813 100644 (file)
@@ -93,7 +93,7 @@ SECTIONS
     _FIXUP_TABLE_ = .;
     *(.fixup)
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 80b527c6c5a9b233bcc89ef9e42211c63b89dc72..afa71418167500ee6655eace3a39f779e64478aa 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf561-0.5
-
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index cb5afc113b804418c42f01bc4201012b40193622..93c79a64b4eddb5d8ef1865ac40f4086f3cf01ab 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 3d7b7f70ce6e323f982b09d0cec4942babd0bfca..82daaa3245cf60d49128f8e9826a4f6ac53f2828 100644 (file)
@@ -25,8 +25,8 @@
 #include <common.h>
 #include <s6e63d6.h>
 #include <netdev.h>
-#include <asm/arch/mx31.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/imx-regs.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index c5d6eb05fe20bfae98206385c238549070a56bb3..c47137d097a3ac632b94fdfb87dafe364dea1457 100644 (file)
@@ -21,7 +21,7 @@
  * MA 02111-1307 USA
  */
 
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 
 .macro REG reg, val
        ldr r2, =\reg
index e658c3529a8f5690c907fa35dbbecb291e040e47..22de7e34059dd6542f4337d5c152f1b4acee5c93 100644 (file)
@@ -45,12 +45,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 int i2c_init_board(void)
 {
-       int i, icr;
-
-       /* disable I2C controller first, otherwhise it thinks we want to    */
-       /* talk to the slave port...                                        */
-       icr = readl(ICR);
-       writel(readl(ICR) & ~(ICR_SCLE | ICR_IUE), ICR);
+       int i;
 
        /* set gpio pin low _before_ we change direction to output          */
        writel(GPIO_bit(70), GPCR(70));
@@ -63,8 +58,6 @@ int i2c_init_board(void)
                udelay(10);
        }
 
-       writel(icr, ICR);
-
        return 0;
 }
 
index fc818fba43444be0005ea1f9e8c9185ff982f928..7c023d1fea895366d6fe2f562d6d3b22b5201ae5 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf532-0.5
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
 LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index ff7012afbc230d766971babdef87464afd9a8dd1..1e843eb24ed300f6845cc4410e73649a97cb5f97 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index dc57d5c48506ea33eb128290e2f3a7984dcb1ad3..269858c6eec1ade73d128fb0767a7a330f1a89f2 100644 (file)
@@ -141,9 +141,9 @@ void tx25_fec_init(void)
 int board_init()
 {
 #ifdef CONFIG_MXC_UART
-       extern void mx25_uart_init_pins(void);
+       extern void mx25_uart1_init_pins(void);
 
-       mx25_uart_init_pins();
+       mx25_uart1_init_pins();
 #endif
        /* board id for linux */
        gd->bd->bi_arch_number = MACH_TYPE_TX25;
index 7b4eefd5c828565b4d93c383bcc6aa32cef49e88..4883fe588b80c23a23ed1c01199e00b5a0c8adc8 100644 (file)
  */
 
 #include <common.h>
-#if defined(CONFIG_MGCOGE)
+#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
 #include <mpc8260.h>
 #endif
 #include <ioports.h>
 #include <malloc.h>
 #include <hush.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
 #include <i2c.h>
 
-extern int i2c_soft_read_pin (void);
+static void i2c_write_start_seq(void);
+static int i2c_make_abort(void);
+DECLARE_GLOBAL_DATA_PTR;
 
-int ivm_calc_crc (unsigned char *buf, int len)
+int ivm_calc_crc(unsigned char *buf, int len)
 {
        const unsigned short crc_tab[16] = {
                0x0000, 0xCC01, 0xD801, 0x1400,
@@ -71,20 +74,55 @@ int ivm_calc_crc (unsigned char *buf, int len)
        return crc;
 }
 
-static int  ivm_set_value (char *name, char *value)
+/*
+ * Set Keymile specific environment variables
+ * Currently only some memory layout variables are calculated here
+ * ... ------------------------------------------------
+ * ... |@rootfsaddr |@pnvramaddr |@varaddr |@reserved |@END_OF_RAM
+ * ... |<------------------- pram ------------------->|
+ * ... ------------------------------------------------
+ * @END_OF_RAM: denotes the RAM size
+ * @pnvramaddr: Startadress of pseudo non volatile RAM in hex
+ * @pram      : preserved ram size in k
+ * @varaddr   : startadress for /var mounted into RAM
+ */
+int set_km_env(void)
+{
+       uchar buf[32];
+       unsigned int pnvramaddr;
+       unsigned int pram;
+       unsigned int varaddr;
+
+       pnvramaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM
+                       - CONFIG_KM_PNVRAM;
+       sprintf((char *)buf, "0x%x", pnvramaddr);
+       setenv("pnvramaddr", (char *)buf);
+
+       pram = (CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM + CONFIG_KM_PNVRAM) /
+               0x400;
+       sprintf((char *)buf, "0x%x", pram);
+       setenv("pram", (char *)buf);
+
+       varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
+       sprintf((char *)buf, "0x%x", varaddr);
+       setenv("varaddr", (char *)buf);
+       return 0;
+}
+
+static int ivm_set_value(char *name, char *value)
 {
        char tempbuf[256];
 
        if (value != NULL) {
-               sprintf (tempbuf, "%s=%s", name, value);
-               return set_local_var (tempbuf, 0);
+               sprintf(tempbuf, "%s=%s", name, value);
+               return set_local_var(tempbuf, 0);
        } else {
-               unset_local_var (name);
+               unset_local_var(name);
        }
        return 0;
 }
 
-static int ivm_get_value (unsigned char *buf, int len, char *name, int off,
+static int ivm_get_value(unsigned char *buf, int len, char *name, int off,
                                int check)
 {
        unsigned short  val;
@@ -92,21 +130,21 @@ static int ivm_get_value (unsigned char *buf, int len, char *name, int off,
 
        if ((buf[off + 0] != buf[off + 2]) &&
            (buf[off + 2] != buf[off + 4])) {
-               printf ("%s Error corrupted %s\n", __FUNCTION__, name);
+               printf("%s Error corrupted %s\n", __func__, name);
                val = -1;
        } else {
                val = buf[off + 0] + (buf[off + 1] << 8);
                if ((val == 0) && (check == 1))
                        val = -1;
        }
-       sprintf ((char *)valbuf, "%x", val);
-       ivm_set_value (name, (char *)valbuf);
+       sprintf((char *)valbuf, "%x", val);
+       ivm_set_value(name, (char *)valbuf);
        return val;
 }
 
-#define INVENTORYBLOCKSIZE     0x100
-#define INVENTORYDATAADDRESS   0x21
-#define INVENTORYDATASIZE      (INVENTORYBLOCKSIZE - INVENTORYDATAADDRESS - 3)
+#define INV_BLOCKSIZE          0x100
+#define INV_DATAADDRESS                0x21
+#define INVENTORYDATASIZE      (INV_BLOCKSIZE - INV_DATAADDRESS - 3)
 
 #define IVM_POS_SHORT_TEXT             0
 #define IVM_POS_MANU_ID                        1
@@ -121,19 +159,19 @@ static int ivm_get_value (unsigned char *buf, int len, char *name, int off,
 #define IVM_POS_HISTORY                        10
 #define IVM_POS_SYMBOL_ONLY            11
 
-static char convert_char (char c)
+static char convert_char(char c)
 {
        return (c < ' ' || c > '~') ? '.' : c;
 }
 
-static int ivm_findinventorystring (int type,
+static int ivm_findinventorystring(int type,
                                        unsigned char* const string,
                                        unsigned long maxlen,
                                        unsigned char *buf)
 {
        int xcode = 0;
        unsigned long cr = 0;
-       unsigned long addr = INVENTORYDATAADDRESS;
+       unsigned long addr = INV_DATAADDRESS;
        unsigned long size = 0;
        unsigned long nr = type;
        int stop = 0;   /* stop on semicolon */
@@ -157,8 +195,10 @@ static int ivm_findinventorystring (int type,
                addr++;
        }
 
-       /* the expected number of CR was found until the end of the IVM
-        *  content --> fill string */
+       /*
+        * the expected number of CR was found until the end of the IVM
+        *  content --> fill string
+        */
        if (addr < INVENTORYDATASIZE) {
                /* Copy the IVM string in the corresponding string */
                for (; (buf[addr] != '\r')                      &&
@@ -170,64 +210,75 @@ static int ivm_findinventorystring (int type,
                                                convert_char (buf[addr]));
                }
 
-               /* copy phase is done: check if everything is ok. If not,
+               /*
+                * copy phase is done: check if everything is ok. If not,
                 * the inventory data is most probably corrupted: tell
-                * the world there is a problem! */
+                * the world there is a problem!
+                */
                if (addr == INVENTORYDATASIZE) {
                        xcode = -1;
-                       printf ("Error end of string not found\n");
+                       printf("Error end of string not found\n");
                } else if ((size >= (maxlen - 1)) &&
                           (buf[addr] != '\r')) {
                        xcode = -1;
-                       printf ("string too long till next CR\n");
+                       printf("string too long till next CR\n");
                }
        } else {
-               /* some CR are missing...
-                * the inventory data is most probably corrupted */
+               /*
+                * some CR are missing...
+                * the inventory data is most probably corrupted
+                */
                xcode = -1;
-               printf ("not enough cr found\n");
+               printf("not enough cr found\n");
        }
        return xcode;
 }
 
 #define GET_STRING(name, which, len) \
-       if (ivm_findinventorystring (which, valbuf, len, buf) == 0) { \
-               ivm_set_value (name, (char *)valbuf); \
+       if (ivm_findinventorystring(which, valbuf, len, buf) == 0) { \
+               ivm_set_value(name, (char *)valbuf); \
        }
 
-static int ivm_check_crc (unsigned char *buf, int block)
+static int ivm_check_crc(unsigned char *buf, int block)
 {
        unsigned long   crc;
        unsigned long   crceeprom;
 
-       crc = ivm_calc_crc (buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 2);
+       crc = ivm_calc_crc(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 2);
        crceeprom = (buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 1] + \
                        buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 2] * 256);
        if (crc != crceeprom) {
                if (block == 0)
-                       printf ("Error CRC Block: %d EEprom: calculated: \
+                       printf("Error CRC Block: %d EEprom: calculated: \
                        %lx EEprom: %lx\n", block, crc, crceeprom);
                return -1;
        }
        return 0;
 }
 
-static int ivm_analyze_block2 (unsigned char *buf, int len)
+static int ivm_analyze_block2(unsigned char *buf, int len)
 {
        unsigned char   valbuf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN];
        unsigned long   count;
 
        /* IVM_MacAddress */
-       sprintf ((char *)valbuf, "%02X:%02X:%02X:%02X:%02X:%02X",
-                       buf[1],
-                       buf[2],
-                       buf[3],
-                       buf[4],
-                       buf[5],
-                       buf[6]);
-       ivm_set_value ("IVM_MacAddress", (char *)valbuf);
-       if (getenv ("ethaddr") == NULL)
-               setenv ((char *)"ethaddr", (char *)valbuf);
+       sprintf((char *)valbuf, "%pM", buf);
+       ivm_set_value("IVM_MacAddress", (char *)valbuf);
+       /* if an offset is defined, add it */
+#if defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET)
+       if (CONFIG_PIGGY_MAC_ADRESS_OFFSET > 0) {
+               unsigned long val = (buf[4] << 16) + (buf[5] << 8) + buf[6];
+
+               val += CONFIG_PIGGY_MAC_ADRESS_OFFSET;
+               buf[4] = (val >> 16) & 0xff;
+               buf[5] = (val >> 8) & 0xff;
+               buf[6] = val & 0xff;
+               sprintf((char *)valbuf, "%pM", buf);
+       }
+#endif
+       if (getenv("ethaddr") == NULL)
+               setenv((char *)"ethaddr", (char *)valbuf);
+
        /* IVM_MacCount */
        count = (buf[10] << 24) +
                   (buf[11] << 16) +
@@ -235,48 +286,52 @@ static int ivm_analyze_block2 (unsigned char *buf, int len)
                    buf[13];
        if (count == 0xffffffff)
                count = 1;
-       sprintf ((char *)valbuf, "%lx", count);
-       ivm_set_value ("IVM_MacCount", (char *)valbuf);
+       sprintf((char *)valbuf, "%lx", count);
+       ivm_set_value("IVM_MacCount", (char *)valbuf);
        return 0;
 }
 
-int ivm_analyze_eeprom (unsigned char *buf, int len)
+int ivm_analyze_eeprom(unsigned char *buf, int len)
 {
        unsigned short  val;
        unsigned char   valbuf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN];
        unsigned char   *tmp;
 
-       if (ivm_check_crc (buf, 0) != 0)
+       if (ivm_check_crc(buf, 0) != 0)
                return -1;
 
-       ivm_get_value (buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN, "IVM_BoardId", 0, 1);
-       val = ivm_get_value (buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN, "IVM_HWKey", 6, 1);
+       ivm_get_value(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN,
+                       "IVM_BoardId", 0, 1);
+       val = ivm_get_value(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN,
+                       "IVM_HWKey", 6, 1);
        if (val != 0xffff) {
-               sprintf ((char *)valbuf, "%x", ((val /100) % 10));
-               ivm_set_value ("IVM_HWVariant", (char *)valbuf);
-               sprintf ((char *)valbuf, "%x", (val % 100));
-               ivm_set_value ("IVM_HWVersion", (char *)valbuf);
+               sprintf((char *)valbuf, "%x", ((val / 100) % 10));
+               ivm_set_value("IVM_HWVariant", (char *)valbuf);
+               sprintf((char *)valbuf, "%x", (val % 100));
+               ivm_set_value("IVM_HWVersion", (char *)valbuf);
        }
-       ivm_get_value (buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN, "IVM_Functions", 12, 0);
+       ivm_get_value(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN,
+               "IVM_Functions", 12, 0);
 
        GET_STRING("IVM_Symbol", IVM_POS_SYMBOL_ONLY, 8)
        GET_STRING("IVM_DeviceName", IVM_POS_SHORT_TEXT, 64)
        tmp = (unsigned char *) getenv("IVM_DeviceName");
        if (tmp) {
-               int     len = strlen ((char *)tmp);
+               int     len = strlen((char *)tmp);
                int     i = 0;
 
                while (i < len) {
                        if (tmp[i] == ';') {
-                               ivm_set_value ("IVM_ShortText", (char *)&tmp[i + 1]);
+                               ivm_set_value("IVM_ShortText",
+                                       (char *)&tmp[i + 1]);
                                break;
                        }
                        i++;
                }
                if (i >= len)
-                       ivm_set_value ("IVM_ShortText", NULL);
+                       ivm_set_value("IVM_ShortText", NULL);
        } else {
-               ivm_set_value ("IVM_ShortText", NULL);
+               ivm_set_value("IVM_ShortText", NULL);
        }
        GET_STRING("IVM_ManufacturerID", IVM_POS_MANU_ID, 32)
        GET_STRING("IVM_ManufacturerSerialNumber", IVM_POS_MANU_SERIAL, 20)
@@ -288,14 +343,15 @@ int ivm_analyze_eeprom (unsigned char *buf, int len)
        GET_STRING("IVM_CustomerID", IVM_POS_CUSTOMER_ID, 32)
        GET_STRING("IVM_CustomerProductID", IVM_POS_CUSTOMER_PROD_ID, 32)
 
-       if (ivm_check_crc (&buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2], 2) != 0)
+       if (ivm_check_crc(&buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2], 2) != 0)
                return 0;
-       ivm_analyze_block2 (&buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2], CONFIG_SYS_IVM_EEPROM_PAGE_LEN);
+       ivm_analyze_block2(&buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2],
+               CONFIG_SYS_IVM_EEPROM_PAGE_LEN);
 
        return 0;
 }
 
-int ivm_read_eeprom (void)
+int ivm_read_eeprom(void)
 {
 #if defined(CONFIG_I2C_MUX)
        I2C_MUX_DEVICE *dev = NULL;
@@ -303,229 +359,259 @@ int ivm_read_eeprom (void)
        uchar i2c_buffer[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
        uchar   *buf;
        unsigned dev_addr = CONFIG_SYS_IVM_EEPROM_ADR;
+       int ret;
 
 #if defined(CONFIG_I2C_MUX)
        /* First init the Bus, select the Bus */
 #if defined(CONFIG_SYS_I2C_IVM_BUS)
-       dev = i2c_mux_ident_muxstring ((uchar *)CONFIG_SYS_I2C_IVM_BUS);
+       dev = i2c_mux_ident_muxstring((uchar *)CONFIG_SYS_I2C_IVM_BUS);
 #else
-       buf = (unsigned char *) getenv ("EEprom_ivm");
+       buf = (unsigned char *) getenv("EEprom_ivm");
        if (buf != NULL)
-               dev = i2c_mux_ident_muxstring (buf);
+               dev = i2c_mux_ident_muxstring(buf);
 #endif
        if (dev == NULL) {
-               printf ("Error couldnt add Bus for IVM\n");
+               printf("Error couldnt add Bus for IVM\n");
                return -1;
        }
-       i2c_set_bus_num (dev->busid);
+       i2c_set_bus_num(dev->busid);
 #endif
 
-       buf = (unsigned char *) getenv ("EEprom_ivm_addr");
+       buf = (unsigned char *) getenv("EEprom_ivm_addr");
        if (buf != NULL)
-               dev_addr = simple_strtoul ((char *)buf, NULL, 16);
+               dev_addr = simple_strtoul((char *)buf, NULL, 16);
 
-       if (i2c_read(dev_addr, 0, 1, i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN) != 0) {
+       /* add deblocking here */
+       i2c_make_abort();
+
+       ret = i2c_read(dev_addr, 0, 1, i2c_buffer,
+               CONFIG_SYS_IVM_EEPROM_MAX_LEN);
+       if (ret != 0) {
                printf ("Error reading EEprom\n");
                return -2;
        }
 
-       return ivm_analyze_eeprom (i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
+       return ivm_analyze_eeprom(i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
 }
 
 #if defined(CONFIG_SYS_I2C_INIT_BOARD)
-#define DELAY_ABORT_SEQ                62
+#define DELAY_ABORT_SEQ                62  /* @200kHz 9 clocks = 44us, 62us is ok */
 #define DELAY_HALF_PERIOD      (500 / (CONFIG_SYS_I2C_SPEED / 1000))
 
-#if defined(CONFIG_MGCOGE)
+#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
 #define SDA_MASK       0x00010000
 #define SCL_MASK       0x00020000
-static void set_pin (int state, unsigned long mask)
+static void set_pin(int state, unsigned long mask)
 {
-       volatile ioport_t *iop = ioport_addr ((immap_t *)CONFIG_SYS_IMMR, 3);
+       ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, 3);
 
        if (state)
-               iop->pdat |= (mask);
+               setbits_be32(&iop->pdat, mask);
        else
-               iop->pdat &= ~(mask);
+               clrbits_be32(&iop->pdat, mask);
 
-       iop->pdir |= (mask);
+       setbits_be32(&iop->pdir, mask);
 }
 
-static int get_pin (unsigned long mask)
+static int get_pin(unsigned long mask)
 {
-       volatile ioport_t *iop = ioport_addr ((immap_t *)CONFIG_SYS_IMMR, 3);
+       ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, 3);
 
-       iop->pdir &= ~(mask);
-       return (0 != (iop->pdat & (mask)));
+       clrbits_be32(&iop->pdir, mask);
+       return 0 != (in_be32(&iop->pdat) & mask);
 }
 
-static void set_sda (int state)
+static void set_sda(int state)
 {
-       set_pin (state, SDA_MASK);
+       set_pin(state, SDA_MASK);
 }
 
-static void set_scl (int state)
+static void set_scl(int state)
 {
-       set_pin (state, SCL_MASK);
+       set_pin(state, SCL_MASK);
 }
 
-static int get_sda (void)
+static int get_sda(void)
 {
-       return get_pin (SDA_MASK);
+       return get_pin(SDA_MASK);
 }
 
-static int get_scl (void)
+static int get_scl(void)
 {
-       return get_pin (SCL_MASK);
+       return get_pin(SCL_MASK);
 }
 
 #if defined(CONFIG_HARD_I2C)
-static void setports (int gpio)
+static void setports(int gpio)
 {
-       volatile ioport_t *iop = ioport_addr ((immap_t *)CONFIG_SYS_IMMR, 3);
+       ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, 3);
 
        if (gpio) {
-               iop->ppar &= ~(SDA_MASK | SCL_MASK);
-               iop->podr &= ~(SDA_MASK | SCL_MASK);
+               clrbits_be32(&iop->ppar, (SDA_MASK | SCL_MASK));
+               clrbits_be32(&iop->podr, (SDA_MASK | SCL_MASK));
        } else {
-               iop->ppar |= (SDA_MASK | SCL_MASK);
-               iop->pdir &= ~(SDA_MASK | SCL_MASK);
-               iop->podr |= (SDA_MASK | SCL_MASK);
+               setbits_be32(&iop->ppar, (SDA_MASK | SCL_MASK));
+               clrbits_be32(&iop->pdir, (SDA_MASK | SCL_MASK));
+               setbits_be32(&iop->podr, (SDA_MASK | SCL_MASK));
        }
 }
 #endif
 #endif
 
-#if defined(CONFIG_KM8XX)
-static void set_sda (int state)
-{
-       I2C_SDA(state);
-}
-
-static void set_scl (int state)
+#if !defined(CONFIG_MPC83xx)
+static void i2c_write_start_seq(void)
 {
-       I2C_SCL(state);
+       set_sda(1);
+       udelay(DELAY_HALF_PERIOD);
+       set_scl(1);
+       udelay(DELAY_HALF_PERIOD);
+       set_sda(0);
+       udelay(DELAY_HALF_PERIOD);
+       set_scl(0);
+       udelay(DELAY_HALF_PERIOD);
 }
 
-static int get_sda (void)
+/*
+ * I2C is a synchronous protocol and resets of the processor in the middle
+ * of an access can block the I2C Bus until a powerdown of the full unit is
+ * done. This function toggles the SCL until the SCL and SCA line are
+ * released, but max. 16 times, after this a I2C start-sequence is sent.
+ * This I2C Deblocking mechanism was developed by Keymile in association
+ * with Anatech and Atmel in 1998.
+ */
+static int i2c_make_abort(void)
 {
-       return I2C_READ;
-}
 
-static int get_scl (void)
-{
-       int     val;
+#if defined(CONFIG_HARD_I2C) && !defined(MACH_TYPE_KM_KIRKWOOD)
+       immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ;
+       i2c8260_t *i2c  = (i2c8260_t *)&immap->im_i2c;
 
-       *(unsigned short *)(I2C_BASE_DIR) &=  ~SCL_CONF;
-       udelay (1);
-       val = *(unsigned char *)(I2C_BASE_PORT);
+       /*
+        * disable I2C controller first, otherwhise it thinks we want to
+        * talk to the slave port...
+        */
+       clrbits_8(&i2c->i2c_i2mod, 0x01);
 
-       return ((val & SCL_BIT) == SCL_BIT);
-}
+       /* Set the PortPins to GPIO */
+       setports(1);
 #endif
 
-#if !defined(CONFIG_KMETER1)
-static void writeStartSeq (void)
-{
-       set_sda (1);
-       udelay (DELAY_HALF_PERIOD);
-       set_scl (1);
-       udelay (DELAY_HALF_PERIOD);
-       set_sda (0);
-       udelay (DELAY_HALF_PERIOD);
-       set_scl (0);
-       udelay (DELAY_HALF_PERIOD);
-}
-
-/* I2C is a synchronous protocol and resets of the processor in the middle
-   of an access can block the I2C Bus until a powerdown of the full unit is
-   done. This function toggles the SCL until the SCL and SCA line are
-   released, but max. 16 times, after this a I2C start-sequence is sent.
-   This I2C Deblocking mechanism was developed by Keymile in association
-   with Anatech and Atmel in 1998.
- */
-static int i2c_make_abort (void)
-{
        int     scl_state = 0;
        int     sda_state = 0;
        int     i = 0;
        int     ret = 0;
 
-       if (!get_sda ()) {
+       if (!get_sda()) {
                ret = -1;
                while (i < 16) {
                        i++;
-                       set_scl (0);
-                       udelay (DELAY_ABORT_SEQ);
-                       set_scl (1);
-                       udelay (DELAY_ABORT_SEQ);
-                       scl_state = get_scl ();
-                       sda_state = get_sda ();
+                       set_scl(0);
+                       udelay(DELAY_ABORT_SEQ);
+                       set_scl(1);
+                       udelay(DELAY_ABORT_SEQ);
+                       scl_state = get_scl();
+                       sda_state = get_sda();
                        if (scl_state && sda_state) {
                                ret = 0;
                                break;
                        }
                }
        }
-       if (ret == 0) {
-               for (i =0; i < 5; i++) {
-                       writeStartSeq ();
-               }
-       }
-       get_sda ();
+       if (ret == 0)
+               for (i = 0; i < 5; i++)
+                       i2c_write_start_seq();
+
+       /* respect stop setup time */
+       udelay(DELAY_ABORT_SEQ);
+       set_scl(1);
+       udelay(DELAY_ABORT_SEQ);
+       set_sda(1);
+       get_sda();
+
+#if defined(CONFIG_HARD_I2C)
+       /* Set the PortPins back to use for I2C */
+       setports(0);
+#endif
        return ret;
 }
 #endif
 
-/**
- * i2c_init_board - reset i2c bus. When the board is powercycled during a
- * bus transfer it might hang; for details see doc/I2C_Edge_Conditions.
- */
-void i2c_init_board(void)
+#if defined(CONFIG_MPC83xx)
+static void i2c_write_start_seq(void)
 {
-#if defined(CONFIG_KMETER1)
        struct fsl_i2c *dev;
        dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
-       uchar   dummy;
+       udelay(DELAY_ABORT_SEQ);
+       out_8(&dev->cr, (I2C_CR_MEN | I2C_CR_MSTA));
+       udelay(DELAY_ABORT_SEQ);
+       out_8(&dev->cr, (I2C_CR_MEN));
+}
 
-       out_8 (&dev->cr, (I2C_CR_MSTA));
-       out_8 (&dev->cr, (I2C_CR_MEN | I2C_CR_MSTA));
-       dummy = in_8(&dev->dr);
+static int i2c_make_abort(void)
+{
+       struct fsl_i2c *dev;
+       dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
+       uchar   dummy;
+       uchar   last;
+       int     nbr_read = 0;
+       int     i = 0;
+       int         ret = 0;
+
+       /* wait after each operation to finsh with a delay */
+       out_8(&dev->cr, (I2C_CR_MSTA));
+       udelay(DELAY_ABORT_SEQ);
+       out_8(&dev->cr, (I2C_CR_MEN | I2C_CR_MSTA));
+       udelay(DELAY_ABORT_SEQ);
        dummy = in_8(&dev->dr);
-       if (dummy != 0xff) {
-               dummy = in_8(&dev->dr);
+       udelay(DELAY_ABORT_SEQ);
+       last = in_8(&dev->dr);
+       nbr_read++;
+
+       /*
+        * do read until the last bit is 1, but stop if the full eeprom is
+        * read.
+        */
+       while (((last & 0x01) != 0x01) &&
+               (nbr_read < CONFIG_SYS_IVM_EEPROM_MAX_LEN)) {
+               udelay(DELAY_ABORT_SEQ);
+               last = in_8(&dev->dr);
+               nbr_read++;
        }
-       out_8 (&dev->cr, (I2C_CR_MEN));
-       out_8 (&dev->cr, 0x00);
-       out_8 (&dev->cr, (I2C_CR_MEN));
-
-#else
-#if defined(CONFIG_HARD_I2C) && !defined(CONFIG_MACH_SUEN3)
-       volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ;
-       volatile i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c;
-
-       /* disable I2C controller first, otherwhise it thinks we want to    */
-       /* talk to the slave port...                                        */
-       i2c->i2c_i2mod &= ~0x01;
+       if ((last & 0x01) != 0x01)
+               ret = -2;
+       if ((last != 0xff) || (nbr_read > 1))
+               printf("[INFO] i2c abort after %d bytes (0x%02x)\n",
+                       nbr_read, last);
+       udelay(DELAY_ABORT_SEQ);
+       out_8(&dev->cr, (I2C_CR_MEN));
+       udelay(DELAY_ABORT_SEQ);
+       /* clear status reg */
+       out_8(&dev->sr, 0);
+
+       for (i = 0; i < 5; i++)
+               i2c_write_start_seq();
+       if (ret != 0)
+               printf("[ERROR] i2c abort failed after %d bytes (0x%02x)\n",
+                       nbr_read, last);
 
-       /* Set the PortPins to GPIO */
-       setports (1);
+       return ret;
+}
 #endif
 
+/**
+ * i2c_init_board - reset i2c bus. When the board is powercycled during a
+ * bus transfer it might hang; for details see doc/I2C_Edge_Conditions.
+ */
+void i2c_init_board(void)
+{
        /* Now run the AbortSequence() */
-       i2c_make_abort ();
-
-#if defined(CONFIG_HARD_I2C)
-       /* Set the PortPins back to use for I2C */
-       setports (0);
-#endif
-#endif
+       i2c_make_abort();
 }
 #endif
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-int fdt_set_node_and_value (void *blob,
+int fdt_set_node_and_value(void *blob,
                                char *nodename,
                                char *regname,
                                void *var,
@@ -534,21 +620,22 @@ int fdt_set_node_and_value (void *blob,
        int ret = 0;
        int nodeoffset = 0;
 
-       nodeoffset = fdt_path_offset (blob, nodename);
+       nodeoffset = fdt_path_offset(blob, nodename);
        if (nodeoffset >= 0) {
-               ret = fdt_setprop (blob, nodeoffset, regname, var,
+               ret = fdt_setprop(blob, nodeoffset, regname, var,
                                        size);
                if (ret < 0)
                        printf("ft_blob_update(): cannot set %s/%s "
                                "property err:%s\n", nodename, regname,
-                               fdt_strerror (ret));
+                               fdt_strerror(ret));
        } else {
                printf("ft_blob_update(): cannot find %s node "
-                       "err:%s\n", nodename, fdt_strerror (nodeoffset));
+                       "err:%s\n", nodename, fdt_strerror(nodeoffset));
        }
        return ret;
 }
-int fdt_get_node_and_value (void *blob,
+
+int fdt_get_node_and_value(void *blob,
                                char *nodename,
                                char *propname,
                                void **var)
@@ -556,42 +643,45 @@ int fdt_get_node_and_value (void *blob,
        int len;
        int nodeoffset = 0;
 
-       nodeoffset = fdt_path_offset (blob, nodename);
+       nodeoffset = fdt_path_offset(blob, nodename);
        if (nodeoffset >= 0) {
-               *var = (void *)fdt_getprop (blob, nodeoffset, propname, &len);
+               *var = (void *)fdt_getprop(blob, nodeoffset, propname, &len);
                if (len == 0) {
                        /* no value */
-                       printf ("%s no value\n", __FUNCTION__);
+                       printf("%s no value\n", __func__);
                        return -1;
                } else if (len > 0) {
                        return len;
                } else {
-                       printf ("libfdt fdt_getprop(): %s\n",
+                       printf("libfdt fdt_getprop(): %s\n",
                                fdt_strerror(len));
                        return -2;
                }
        } else {
-               printf("%s: cannot find %s node err:%s\n", __FUNCTION__,
-                       nodename, fdt_strerror (nodeoffset));
+               printf("%s: cannot find %s node err:%s\n", __func__,
+                       nodename, fdt_strerror(nodeoffset));
                return -3;
        }
 }
 #endif
 
-#if !defined(CONFIG_MACH_SUEN3)
-int ethernet_present (void)
+#if !defined(MACH_TYPE_KM_KIRKWOOD)
+int ethernet_present(void)
 {
-       return (in_8((u8 *)CONFIG_SYS_PIGGY_BASE + CONFIG_SYS_SLOT_ID_OFF) & 0x80);
+       struct km_bec_fpga *base =
+               (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+
+       return in_8(&base->bprth) & PIGGY_PRESENT;
 }
 #endif
 
-int board_eth_init (bd_t *bis)
+int board_eth_init(bd_t *bis)
 {
 #ifdef CONFIG_KEYMILE_HDLC_ENET
-       (void)keymile_hdlc_enet_initialize (bis);
+       (void)keymile_hdlc_enet_initialize(bis);
 #endif
-       if (ethernet_present ()) {
-               return -1;
-       }
-       return 0;
+       if (ethernet_present())
+               return cpu_eth_init(bis);
+
+       return -1;
 }
index a38c72772ce75f4659c50378c8d16c4098ec2b6c..099de98c6d9e02e818daf55131433a33871dc82f 100644 (file)
 #ifndef __KEYMILE_COMMON_H
 #define __KEYMILE_COMMON_H
 
-int ethernet_present (void);
-int ivm_read_eeprom (void);
+#define WRG_RESET      0x80
+#define H_OPORTS_14    0x40
+#define WRG_LED                0x02
+#define WRL_BOOT       0x01
+
+#define H_OPORTS_SCC4_ENA      0x10
+#define H_OPORTS_SCC4_FD_ENA   0x04
+#define H_OPORTS_FCC1_PW_DWN   0x01
+
+#define PIGGY_PRESENT  0x80
+
+struct km_bec_fpga {
+       unsigned char   id;
+       unsigned char   rev;
+       unsigned char   oprth;
+       unsigned char   oprtl;
+       unsigned char   res1[3];
+       unsigned char   bprth;
+       unsigned char   bprtl;
+       unsigned char   res2[6];
+       unsigned char   prst;
+       unsigned char   res3[0xfff0];
+       unsigned char   pgy_id;
+       unsigned char   pgy_rev;
+       unsigned char   pgy_outputs;
+       unsigned char   pgy_eth;
+};
+
+#if !defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET)
+#define CONFIG_PIGGY_MAC_ADRESS_OFFSET 0
+#endif
+
+int ethernet_present(void);
+int ivm_read_eeprom(void);
 
 #ifdef CONFIG_KEYMILE_HDLC_ENET
-int keymile_hdlc_enet_initialize (bd_t *bis);
+int keymile_hdlc_enet_initialize(bd_t *bis);
 #endif
 
-int fdt_set_node_and_value (void *blob,
+int set_km_env(void);
+int fdt_set_node_and_value(void *blob,
                        char *nodename,
                        char *regname,
                        void *var,
                        int size);
-int fdt_get_node_and_value (void *blob,
+int fdt_get_node_and_value(void *blob,
                                char *nodename,
                                char *propname,
                                void **var);
+
+int i2c_soft_read_pin(void);
 #endif /* __KEYMILE_COMMON_H */
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
new file mode 100644 (file)
index 0000000..17560c8
--- /dev/null
@@ -0,0 +1,288 @@
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <daveliu@freescale.com>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <peterb@logicpd.com>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * (C) Copyright 2008 - 2010
+ * Heiko Schocher, DENX Software Engineering, hs@denx.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; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#include <common.h>
+#include <ioports.h>
+#include <mpc83xx.h>
+#include <i2c.h>
+#include <miiphy.h>
+#include <asm/io.h>
+#include <asm/mmu.h>
+#include <asm/processor.h>
+#include <pci.h>
+#include <libfdt.h>
+
+#include "../common/common.h"
+
+const qe_iop_conf_t qe_iop_conf_tab[] = {
+       /* port pin dir open_drain assign */
+#if defined(CONFIG_KMETER1)
+       /* MDIO */
+       {0,  1, 3, 0, 2}, /* MDIO */
+       {0,  2, 1, 0, 1}, /* MDC */
+
+       /* UCC4 - UEC */
+       {1, 14, 1, 0, 1}, /* TxD0 */
+       {1, 15, 1, 0, 1}, /* TxD1 */
+       {1, 20, 2, 0, 1}, /* RxD0 */
+       {1, 21, 2, 0, 1}, /* RxD1 */
+       {1, 18, 1, 0, 1}, /* TX_EN */
+       {1, 26, 2, 0, 1}, /* RX_DV */
+       {1, 27, 2, 0, 1}, /* RX_ER */
+       {1, 24, 2, 0, 1}, /* COL */
+       {1, 25, 2, 0, 1}, /* CRS */
+       {2, 15, 2, 0, 1}, /* TX_CLK - CLK16 */
+       {2, 16, 2, 0, 1}, /* RX_CLK - CLK17 */
+
+       /* DUART - UART2 */
+       {5,  0, 1, 0, 2}, /* UART2_SOUT */
+       {5,  2, 1, 0, 1}, /* UART2_RTS */
+       {5,  3, 2, 0, 2}, /* UART2_SIN */
+       {5,  1, 2, 0, 3}, /* UART2_CTS */
+#else
+       /* Local Bus */
+       {0, 16, 1, 0, 3}, /* LA00 */
+       {0, 17, 1, 0, 3}, /* LA01 */
+       {0, 18, 1, 0, 3}, /* LA02 */
+       {0, 19, 1, 0, 3}, /* LA03 */
+       {0, 20, 1, 0, 3}, /* LA04 */
+       {0, 21, 1, 0, 3}, /* LA05 */
+       {0, 22, 1, 0, 3}, /* LA06 */
+       {0, 23, 1, 0, 3}, /* LA07 */
+       {0, 24, 1, 0, 3}, /* LA08 */
+       {0, 25, 1, 0, 3}, /* LA09 */
+       {0, 26, 1, 0, 3}, /* LA10 */
+       {0, 27, 1, 0, 3}, /* LA11 */
+       {0, 28, 1, 0, 3}, /* LA12 */
+       {0, 29, 1, 0, 3}, /* LA13 */
+       {0, 30, 1, 0, 3}, /* LA14 */
+       {0, 31, 1, 0, 3}, /* LA15 */
+
+       /* MDIO */
+       {3,  4, 3, 0, 2}, /* MDIO */
+       {3,  5, 1, 0, 2}, /* MDC */
+
+       /* UCC4 - UEC */
+       {1, 18, 1, 0, 1}, /* TxD0 */
+       {1, 19, 1, 0, 1}, /* TxD1 */
+       {1, 22, 2, 0, 1}, /* RxD0 */
+       {1, 23, 2, 0, 1}, /* RxD1 */
+       {1, 26, 2, 0, 1}, /* RxER */
+       {1, 28, 2, 0, 1}, /* Rx_DV */
+       {1, 30, 1, 0, 1}, /* TxEN */
+       {1, 31, 2, 0, 1}, /* CRS */
+       {3, 10, 2, 0, 3}, /* TxCLK->CLK17 */
+#endif
+
+       /* END of table */
+       {0,  0, 0, 0, QE_IOP_TAB_END},
+};
+
+static int board_init_i2c_busses(void)
+{
+       I2C_MUX_DEVICE *dev = NULL;
+       uchar   *buf;
+
+       /* Set up the Bus for the DTTs */
+       buf = (unsigned char *) getenv("dtt_bus");
+       if (buf != NULL)
+               dev = i2c_mux_ident_muxstring(buf);
+       if (dev == NULL) {
+               printf("Error couldn't add Bus for DTT\n");
+               printf("please setup dtt_bus to where your\n");
+               printf("DTT is found.\n");
+       }
+       return 0;
+}
+
+#if defined(CONFIG_SUVD3)
+const uint upma_table[] = {
+       0x1ffedc00, 0x0ffcdc80, 0x0ffcdc80, 0x0ffcdc04, /* Words 0 to 3 */
+       0x0ffcdc00, 0xffffcc00, 0xffffcc01, 0xfffffc01, /* Words 4 to 7 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 8 to 11 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 12 to 15 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 16 to 19 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 20 to 23 */
+       0x9cfffc00, 0x00fffc80, 0x00fffc80, 0x00fffc00, /* Words 24 to 27 */
+       0xffffec04, 0xffffec01, 0xfffffc01, 0xfffffc01, /* Words 28 to 31 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 32 to 35 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 36 to 39 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 40 to 43 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 44 to 47 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 48 to 51 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 52 to 55 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 56 to 59 */
+       0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01  /* Words 60 to 63 */
+};
+#endif
+
+int board_early_init_r(void)
+{
+       struct km_bec_fpga *base =
+               (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+#if defined(CONFIG_SUVD3)
+       immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
+       fsl_lbc_t *lbc = &immap->im_lbc;
+       u32 *mxmr = &lbc->mamr;
+#endif
+
+#if defined(CONFIG_MPC8360)
+       unsigned short  svid;
+       /*
+        * Because of errata in the UCCs, we have to write to the reserved
+        * registers to slow the clocks down.
+        */
+       svid =  SVR_REV(mfspr(SVR));
+       switch (svid) {
+       case 0x0020:
+               /*
+                * MPC8360ECE.pdf QE_ENET10 table 4:
+                * IMMR + 0x14A8[4:5] = 11 (clk delay for UCC 2)
+                * IMMR + 0x14A8[18:19] = 11 (clk delay for UCC 1)
+                */
+               setbits_be32((void *)(CONFIG_SYS_IMMR + 0x14a8), 0x0c003000);
+               break;
+       case 0x0021:
+               /*
+                * MPC8360ECE.pdf QE_ENET10 table 4:
+                * IMMR + 0x14AC[24:27] = 1010
+                */
+               clrsetbits_be32((void *)(CONFIG_SYS_IMMR + 0x14ac),
+                       0x00000050, 0x000000a0);
+               break;
+       }
+#endif
+
+       /* enable the PHY on the PIGGY */
+       setbits_8(&base->pgy_eth, 0x01);
+       /* enable the Unit LED (green) */
+       setbits_8(&base->oprth, WRL_BOOT);
+
+#if defined(CONFIG_SUVD3)
+       /* configure UPMA for APP1 */
+       upmconfig(UPMA, (uint *) upma_table,
+               sizeof(upma_table) / sizeof(uint));
+       out_be32(mxmr, CONFIG_SYS_MAMR);
+#endif
+       return 0;
+}
+
+int misc_init_r(void)
+{
+       /* add board specific i2c busses */
+       board_init_i2c_busses();
+       return 0;
+}
+
+int last_stage_init(void)
+{
+       set_km_env();
+       return 0;
+}
+
+int fixed_sdram(void)
+{
+       immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
+       u32 msize = 0;
+       u32 ddr_size;
+       u32 ddr_size_log2;
+
+       out_be32(&im->sysconf.ddrlaw[0].ar, (LAWAR_EN | 0x1e));
+       out_be32(&im->ddr.csbnds[0].csbnds, CONFIG_SYS_DDR_CS0_BNDS);
+       out_be32(&im->ddr.cs_config[0], CONFIG_SYS_DDR_CS0_CONFIG);
+       out_be32(&im->ddr.timing_cfg_0, CONFIG_SYS_DDR_TIMING_0);
+       out_be32(&im->ddr.timing_cfg_1, CONFIG_SYS_DDR_TIMING_1);
+       out_be32(&im->ddr.timing_cfg_2, CONFIG_SYS_DDR_TIMING_2);
+       out_be32(&im->ddr.timing_cfg_3, CONFIG_SYS_DDR_TIMING_3);
+       out_be32(&im->ddr.sdram_cfg, CONFIG_SYS_DDR_SDRAM_CFG);
+       out_be32(&im->ddr.sdram_cfg2, CONFIG_SYS_DDR_SDRAM_CFG2);
+       out_be32(&im->ddr.sdram_mode, CONFIG_SYS_DDR_MODE);
+       out_be32(&im->ddr.sdram_mode2, CONFIG_SYS_DDR_MODE2);
+       out_be32(&im->ddr.sdram_interval, CONFIG_SYS_DDR_INTERVAL);
+       out_be32(&im->ddr.sdram_clk_cntl, CONFIG_SYS_DDR_CLK_CNTL);
+       udelay(200);
+       out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);
+
+       msize = CONFIG_SYS_DDR_SIZE << 20;
+       disable_addr_trans();
+       msize = get_ram_size(CONFIG_SYS_DDR_BASE, msize);
+       enable_addr_trans();
+       msize /= (1024 * 1024);
+       if (CONFIG_SYS_DDR_SIZE != msize) {
+               for (ddr_size = msize << 20, ddr_size_log2 = 0;
+                       (ddr_size > 1);
+                       ddr_size = ddr_size >> 1, ddr_size_log2++)
+                       if (ddr_size & 1)
+                               return -1;
+               out_be32(&im->sysconf.ddrlaw[0].ar,
+                       (LAWAR_EN | ((ddr_size_log2 - 1) & LAWAR_SIZE)));
+               out_be32(&im->ddr.csbnds[0].csbnds,
+                       (((msize / 16) - 1) & 0xff));
+       }
+
+       return msize;
+}
+
+phys_size_t initdram(int board_type)
+{
+       immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
+       u32 msize = 0;
+
+       if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im)
+               return -1;
+
+       out_be32(&im->sysconf.ddrlaw[0].bar,
+               CONFIG_SYS_DDR_BASE & LAWBAR_BAR);
+       msize = fixed_sdram();
+
+#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
+       /*
+        * Initialize DDR ECC byte
+        */
+       ddr_enable_ecc(msize * 1024 * 1024);
+#endif
+
+       /* return total bus SDRAM size(bytes)  -- DDR */
+       return msize * 1024 * 1024;
+}
+
+int checkboard(void)
+{
+       puts("Board: Keymile " CONFIG_KM_BOARD_NAME);
+
+       if (ethernet_present())
+               puts(" with PIGGY.");
+       puts("\n");
+       return 0;
+}
+
+#if defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+       ft_cpu_setup(blob, bd);
+}
+#endif
+
+#if defined(CONFIG_HUSH_INIT_VAR)
+int hush_init_var(void)
+{
+       ivm_read_eeprom();
+       return 0;
+}
+#endif
index 2e20644fbaff742e5758a46e8b480e7bb33d8556..c772ee2a55881864332dfccf80299f917a4b1ee6 100644 (file)
@@ -41,9 +41,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static int     io_dev;
-extern I2C_MUX_DEVICE *i2c_mux_ident_muxstring (uchar *buf);
-
 /* Multi-Purpose Pins Functionality configuration */
 u32 kwmpp_config[] = {
        MPP0_NF_IO2,
@@ -96,7 +93,7 @@ u32 kwmpp_config[] = {
        MPP41_GPIO,             /* Piggy3 LED[4] */
        MPP42_GPIO,             /* Piggy3 LED[5] */
        MPP43_GPIO,             /* Piggy3 LED[6] */
-       MPP44_GPIO,             /* Piggy3 LED[7] */
+       MPP44_GPIO,             /* Piggy3 LED[7], BIST_EN_L */
        MPP45_GPIO,             /* Piggy3 LED[8] */
        MPP46_GPIO,             /* Reserved */
        MPP47_GPIO,             /* Reserved */
@@ -111,24 +108,48 @@ int ethernet_present(void)
        int     ret = 0;
 
        if (i2c_read(0x10, 2, 1, &buf, 1) != 0) {
-               printf ("%s: Error reading Boco\n", __FUNCTION__);
+               printf("%s: Error reading Boco\n", __func__);
                return -1;
        }
-       if ((buf & 0x40) == 0x40) {
+       if ((buf & 0x40) == 0x40)
                ret = 1;
-       }
+
        return ret;
 }
 
+int initialize_unit_leds(void)
+{
+       /*
+        * init the unit LEDs
+        * per default they all are
+        * ok apart from bootstat
+        * LED connected through BOCO
+        * BOCO lies at the address  0x10
+        * LEDs are in the block CTRL_H (addr 0x02)
+        * BOOTSTAT LED is the first 0x01
+        */
+       #define BOCO        0x10
+       #define CTRL_H      0x02
+       #define APPLEDMASK  0x01
+       uchar buf;
+
+       if (i2c_read(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+               printf("%s: Error reading Boco\n", __func__);
+               return -1;
+       }
+       buf |= APPLEDMASK;
+       if (i2c_write(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+               printf("%s: Error writing Boco\n", __func__);
+               return -1;
+       }
+       return 0;
+}
+
 int misc_init_r(void)
 {
-       I2C_MUX_DEVICE  *i2cdev;
        char *str;
        int mach_type;
 
-       /* add I2C Bus for I/O Expander */
-       i2cdev = i2c_mux_ident_muxstring((uchar *)"pca9554a:70:a");
-       io_dev = i2cdev->busid;
        puts("Piggy:");
        if (ethernet_present() == 0)
                puts (" not");
@@ -140,6 +161,9 @@ int misc_init_r(void)
                printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
                gd->bd->bi_arch_number = mach_type;
        }
+
+       initialize_unit_leds();
+
        return 0;
 }
 
@@ -162,14 +186,14 @@ int board_early_init_f(void)
 
 #if defined(CONFIG_SOFT_I2C)
        /* init the GPIO for I2C Bitbang driver */
-       kw_gpio_set_valid(SUEN3_SDA_PIN, 1);
-       kw_gpio_set_valid(SUEN3_SCL_PIN, 1);
-       kw_gpio_direction_output(SUEN3_SDA_PIN, 0);
-       kw_gpio_direction_output(SUEN3_SCL_PIN, 0);
+       kw_gpio_set_valid(KM_KIRKWOOD_SDA_PIN, 1);
+       kw_gpio_set_valid(KM_KIRKWOOD_SCL_PIN, 1);
+       kw_gpio_direction_output(KM_KIRKWOOD_SDA_PIN, 0);
+       kw_gpio_direction_output(KM_KIRKWOOD_SCL_PIN, 0);
 #endif
 #if defined(CONFIG_SYS_EEPROM_WREN)
-       kw_gpio_set_valid(SUEN3_ENV_WP, 38);
-       kw_gpio_direction_output(SUEN3_ENV_WP, 1);
+       kw_gpio_set_valid(KM_KIRKWOOD_ENV_WP, 38);
+       kw_gpio_direction_output(KM_KIRKWOOD_ENV_WP, 1);
 #endif
 
        return 0;
@@ -180,7 +204,7 @@ int board_init(void)
        /*
         * arch number of board
         */
-       gd->bd->bi_arch_number = MACH_TYPE_SUEN3;
+       gd->bd->bi_arch_number = MACH_TYPE_KM_KIRKWOOD;
 
        /* address of boot parameters */
        gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
@@ -188,6 +212,12 @@ int board_init(void)
        return 0;
 }
 
+int last_stage_init(void)
+{
+       set_km_env();
+       return 0;
+}
+
 #if defined(CONFIG_CMD_SF)
 int do_spi_toggle(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
@@ -246,7 +276,6 @@ void dram_init_banksize(void)
 
        for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
                gd->bd->bi_dram[i].start = kw_sdram_bar(i);
-               gd->bd->bi_dram[i].size = kw_sdram_bs(i);
                gd->bd->bi_dram[i].size = get_ram_size((long *)kw_sdram_bar(i),
                                                       kw_sdram_bs(i));
        }
@@ -265,15 +294,15 @@ void reset_phy(void)
 }
 
 #if defined(CONFIG_HUSH_INIT_VAR)
-int hush_init_var (void)
+int hush_init_var(void)
 {
-       ivm_read_eeprom ();
+       ivm_read_eeprom();
        return 0;
 }
 #endif
 
 #if defined(CONFIG_BOOTCOUNT_LIMIT)
-void bootcount_store (ulong a)
+void bootcount_store(ulong a)
 {
        volatile ulong *save_addr;
        volatile ulong size = 0;
@@ -286,7 +315,7 @@ void bootcount_store (ulong a)
        writel(BOOTCOUNT_MAGIC, &save_addr[1]);
 }
 
-ulong bootcount_load (void)
+ulong bootcount_load(void)
 {
        volatile ulong *save_addr;
        volatile ulong size = 0;
@@ -303,34 +332,34 @@ ulong bootcount_load (void)
 #endif
 
 #if defined(CONFIG_SOFT_I2C)
-void set_sda (int state)
+void set_sda(int state)
 {
        I2C_ACTIVE;
        I2C_SDA(state);
 }
 
-void set_scl (int state)
+void set_scl(int state)
 {
        I2C_SCL(state);
 }
 
-int get_sda (void)
+int get_sda(void)
 {
        I2C_TRISTATE;
        return I2C_READ;
 }
 
-int get_scl (void)
+int get_scl(void)
 {
-       return (kw_gpio_get_value(SUEN3_SCL_PIN) ? 1 : 0);
+       return kw_gpio_get_value(KM_KIRKWOOD_SCL_PIN) ? 1 : 0;
 }
 #endif
 
 #if defined(CONFIG_SYS_EEPROM_WREN)
-int eeprom_write_enable (unsigned dev_addr, int state)
+int eeprom_write_enable(unsigned dev_addr, int state)
 {
-       kw_gpio_set_value(SUEN3_ENV_WP, !state);
+       kw_gpio_set_value(KM_KIRKWOOD_ENV_WP, !state);
 
-       return !kw_gpio_get_value(SUEN3_ENV_WP);
+       return !kw_gpio_get_value(KM_KIRKWOOD_ENV_WP);
 }
 #endif
index 26d6aa09d97abe9210408fbb6d81a27f0c6f569d..b2f51936f4debff917a3c2c4f843c6b4a0fbb00f 100644 (file)
 # Boot Media configurations
 BOOT_FROM      spi     # Boot from SPI flash
 
-DATA 0xFFD10000 0x01111111     # MPP Control 0 Register
-# bit 3-0:   MPPSel0   1, NF_IO[2]
-# bit 7-4:   MPPSel1   1, NF_IO[3]
-# bit 12-8:  MPPSel2   1, NF_IO[4]
-# bit 15-12: MPPSel3   1, NF_IO[5]
+DATA 0xFFD10000 0x01112222     # MPP Control 0 Register
+# bit 3-0:   MPPSel0   2, NF_IO[2]
+# bit 7-4:   MPPSel1   2, NF_IO[3]
+# bit 12-8:  MPPSel2   2, NF_IO[4]
+# bit 15-12: MPPSel3   2, NF_IO[5]
 # bit 19-16: MPPSel4   1, NF_IO[6]
 # bit 23-20: MPPSel5   1, NF_IO[7]
 # bit 27-24: MPPSel6   1, SYSRST_O
 # bit 31-28: MPPSel7   0, GPO[7]
 
+DATA 0xFFD10004 0x03303300
+
 DATA 0xFFD10008 0x00001100     # MPP Control 2 Register
 # bit 3-0:   MPPSel16  0, GPIO[16]
 # bit 7-4:   MPPSel17  0, GPIO[17]
@@ -48,8 +50,8 @@ DATA 0xFFD10008 0x00001100    # MPP Control 2 Register
 # bit 31-28: MPPSel23  0, GPIO[23]
 
 DATA 0xFFD100E0 0x1B1B1B1B     # IO Configuration 0 Register
-DATA 0xFFD20134 0xBBBBBBBB     # L2 RAM Timing 0 Register
-DATA 0xFFD20138 0x00BBBBBB     # L2 RAM Timing 1 Register
+DATA 0xFFD20134 0x66666666     # L2 RAM Timing 0 Register
+DATA 0xFFD20138 0x66666666     # L2 RAM Timing 1 Register
 DATA 0xFFD20154 0x00000200     # CPU RAM Management Control3 Register
 DATA 0xFFD2014C 0x00001C00     # CPU RAM Management Control1 Register
 DATA 0xFFD20148 0x00000001     # CPU RAM Management Control0 Register
@@ -63,7 +65,7 @@ DATA 0xFFD01400 0x43000400    # SDRAM Configuration Register
 # bit29-26: zero
 # bit31-30: 01
 
-DATA 0xFFD01404 0x36343000     # DDR Controller Control Low
+DATA 0xFFD01404 0x39543000     # DDR Controller Control Low
 # bit 3-0:  0 reserved
 # bit 4:    0=addr/cmd in smame cycle
 # bit 5:    0=clk is driven during self refresh, we don't care for APX
@@ -75,7 +77,7 @@ DATA 0xFFD01404 0x36343000    # DDR Controller Control Low
 # bit30-28: 3 required
 # bit31:    0=no additional STARTBURST delay
 
-DATA 0xFFD01408 0x2302544B     # DDR Timing (Low) (active cycles value +1)
+DATA 0xFFD01408 0x34136552     # DDR Timing (Low) (active cycles value +1)
 # bit3-0:   TRAS lsbs
 # bit7-4:   TRCD
 # bit11- 8: TRP
@@ -86,7 +88,7 @@ DATA 0xFFD01408 0x2302544B    # DDR Timing (Low) (active cycles value +1)
 # bit27-24: TRRD
 # bit31-28: TRTP
 
-DATA 0xFFD0140C 0x00000032     #  DDR Timing (High)
+DATA 0xFFD0140C 0x00000033     #  DDR Timing (High)
 # bit6-0:   TRFC
 # bit8-7:   TR2R
 # bit10-9:  TR2W
@@ -116,8 +118,8 @@ DATA 0xFFD01418 0x00000000  #  DDR Operation
 # bit3-0:   0x0, DDR cmd
 # bit31-4:  0 required
 
-DATA 0xFFD0141C 0x00000642     #  DDR Mode
-DATA 0xFFD01420 0x00000040     #  DDR Extended Mode
+DATA 0xFFD0141C 0x00000652     #  DDR Mode
+DATA 0xFFD01420 0x00000044     #  DDR Extended Mode
 # bit0:    0,  DDR DLL enabled
 # bit1:    0,  DDR drive strenght normal
 # bit2:    1,  DDR ODT control lsd disabled
@@ -140,6 +142,8 @@ DATA 0xFFD01424 0x0000F07F  #  DDR Controller Control High
 # bit11 :  0  , 1/4 clock cycle skew disabled for write mesh
 # bit15-12: 1111 required
 # bit31-16: 0    required
+DATA 0xFFD01428 0x00074510
+DATA 0xFFD0147c 0x00007451
 
 DATA 0xFFD01500 0x00000000     # CS[0]n Base address to 0x0
 DATA 0xFFD01504 0x07FFFFF1     # CS[0]n Size
@@ -153,7 +157,7 @@ DATA 0xFFD0150C 0x00000000  # CS[1]n Size, window disabled
 DATA 0xFFD01514 0x00000000     # CS[2]n Size, window disabled
 DATA 0xFFD0151C 0x00000000     # CS[3]n Size, window disabled
 
-DATA 0xFFD01494 0x00000000     #  DDR ODT Control (Low)
+DATA 0xFFD01494 0x00010001     #  DDR ODT Control (Low)
 # bit3-0:  0, ODT0Rd, MODT[0] asserted during read from DRAM CS0
 # bit19-16:0, ODT0Wr, MODT[0] asserted during write to DRAM CS0
 
@@ -162,7 +166,7 @@ DATA 0xFFD01498 0x00000000  #  DDR ODT Control (High)
 # bit3-2:  00, ODT1 controlled by register
 # bit31-4: zero, required
 
-DATA 0xFFD0149C 0x0000E90F     # CPU ODT Control
+DATA 0xFFD0149C 0x0000FC11     # CPU ODT Control
 # bit3-0:  F, ODT0Rd, Internal ODT asserted during read from DRAM bank0
 # bit7-4:  0, ODT0Wr, Internal ODT asserted during write to DRAM bank0
 # bit9-8:  1, ODTEn, never active
diff --git a/board/keymile/kmeter1/kmeter1.c b/board/keymile/kmeter1/kmeter1.c
deleted file mode 100644 (file)
index bbcaf5d..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (C) 2006 Freescale Semiconductor, Inc.
- *                    Dave Liu <daveliu@freescale.com>
- *
- * Copyright (C) 2007 Logic Product Development, Inc.
- *                    Peter Barada <peterb@logicpd.com>
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- *                    Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * (C) Copyright 2008
- * Heiko Schocher, DENX Software Engineering, hs@denx.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; either version 2 of
- * the License, or (at your option) any later version.
- */
-
-#include <common.h>
-#include <ioports.h>
-#include <mpc83xx.h>
-#include <i2c.h>
-#include <miiphy.h>
-#include <asm/io.h>
-#include <asm/mmu.h>
-#include <asm/processor.h>
-#include <pci.h>
-#include <libfdt.h>
-
-#include "../common/common.h"
-
-extern void disable_addr_trans (void);
-extern void enable_addr_trans (void);
-const qe_iop_conf_t qe_iop_conf_tab[] = {
-       /* port pin dir open_drain assign */
-
-       /* MDIO */
-       {0,  1, 3, 0, 2}, /* MDIO */
-       {0,  2, 1, 0, 1}, /* MDC */
-
-       /* UCC4 - UEC */
-       {1, 14, 1, 0, 1}, /* TxD0 */
-       {1, 15, 1, 0, 1}, /* TxD1 */
-       {1, 20, 2, 0, 1}, /* RxD0 */
-       {1, 21, 2, 0, 1}, /* RxD1 */
-       {1, 18, 1, 0, 1}, /* TX_EN */
-       {1, 26, 2, 0, 1}, /* RX_DV */
-       {1, 27, 2, 0, 1}, /* RX_ER */
-       {1, 24, 2, 0, 1}, /* COL */
-       {1, 25, 2, 0, 1}, /* CRS */
-       {2, 15, 2, 0, 1}, /* TX_CLK - CLK16 */
-       {2, 16, 2, 0, 1}, /* RX_CLK - CLK17 */
-
-       /* DUART - UART2 */
-       {5,  0, 1, 0, 2}, /* UART2_SOUT */
-       {5,  2, 1, 0, 1}, /* UART2_RTS */
-       {5,  3, 2, 0, 2}, /* UART2_SIN */
-       {5,  1, 2, 0, 3}, /* UART2_CTS */
-
-       /* END of table */
-       {0,  0, 0, 0, QE_IOP_TAB_END},
-};
-
-static int board_init_i2c_busses (void)
-{
-       I2C_MUX_DEVICE *dev = NULL;
-       uchar   *buf;
-
-       /* Set up the Bus for the DTTs */
-       buf = (unsigned char *) getenv ("dtt_bus");
-       if (buf != NULL)
-               dev = i2c_mux_ident_muxstring (buf);
-       if (dev == NULL) {
-               printf ("Error couldn't add Bus for DTT\n");
-               printf ("please setup dtt_bus to where your\n");
-               printf ("DTT is found.\n");
-       }
-       return 0;
-}
-
-int board_early_init_r (void)
-{
-       unsigned short  svid;
-
-       /*
-        * Because of errata in the UCCs, we have to write to the reserved
-        * registers to slow the clocks down.
-        */
-       svid =  SVR_REV(mfspr (SVR));
-       switch (svid) {
-       case 0x0020:
-               setbits_be32((void *)(CONFIG_SYS_IMMR + 0x14a8), 0x0c003000);
-               break;
-       case 0x0021:
-               clrsetbits_be32((void *)(CONFIG_SYS_IMMR + 0x14ac),
-                       0x00000050, 0x000000a0);
-               break;
-       }
-       /* enable the PHY on the PIGGY */
-       setbits (8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x10003), 0x01);
-       /* enable the Unit LED (green) */
-       setbits (8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x00002), 0x01);
-       /* take FE/GbE PHYs out of reset */
-       setbits (8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x0000f), 0x1c);
-
-       return 0;
-}
-
-int misc_init_r (void)
-{
-       /* add board specific i2c busses */
-       board_init_i2c_busses ();
-       return 0;
-}
-
-int fixed_sdram(void)
-{
-       volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
-       u32 msize = 0;
-       u32 ddr_size;
-       u32 ddr_size_log2;
-
-       im->sysconf.ddrlaw[0].ar = LAWAR_EN | 0x1e;
-       im->ddr.csbnds[0].csbnds = CONFIG_SYS_DDR_CS0_BNDS;
-       im->ddr.cs_config[0] = CONFIG_SYS_DDR_CS0_CONFIG;
-       im->ddr.timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0;
-       im->ddr.timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
-       im->ddr.timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;
-       im->ddr.timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3;
-       im->ddr.sdram_cfg = CONFIG_SYS_DDR_SDRAM_CFG;
-       im->ddr.sdram_cfg2 = CONFIG_SYS_DDR_SDRAM_CFG2;
-       im->ddr.sdram_mode = CONFIG_SYS_DDR_MODE;
-       im->ddr.sdram_mode2 = CONFIG_SYS_DDR_MODE2;
-       im->ddr.sdram_interval = CONFIG_SYS_DDR_INTERVAL;
-       im->ddr.sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CNTL;
-       udelay (200);
-       im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
-
-       msize = CONFIG_SYS_DDR_SIZE << 20;
-       disable_addr_trans ();
-       msize = get_ram_size (CONFIG_SYS_DDR_BASE, msize);
-       enable_addr_trans ();
-       msize /= (1024 * 1024);
-       if (CONFIG_SYS_DDR_SIZE != msize) {
-               for (ddr_size = msize << 20, ddr_size_log2 = 0;
-                    (ddr_size > 1); ddr_size = ddr_size >> 1, ddr_size_log2++)
-                       if (ddr_size & 1)
-                               return -1;
-               im->sysconf.ddrlaw[0].ar =
-                   LAWAR_EN | ((ddr_size_log2 - 1) & LAWAR_SIZE);
-               im->ddr.csbnds[0].csbnds = (((msize / 16) - 1) & 0xff);
-       }
-
-       return msize;
-}
-
-phys_size_t initdram (int board_type)
-{
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
-       extern void ddr_enable_ecc (unsigned int dram_size);
-#endif
-       volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
-       u32 msize = 0;
-
-       if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im)
-               return -1;
-
-       /* DDR SDRAM - Main SODIMM */
-       im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
-       msize = fixed_sdram ();
-
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
-       /*
-        * Initialize DDR ECC byte
-        */
-       ddr_enable_ecc (msize * 1024 * 1024);
-#endif
-
-       /* return total bus SDRAM size(bytes)  -- DDR */
-       return (msize * 1024 * 1024);
-}
-
-int checkboard (void)
-{
-       puts ("Board: Keymile kmeter1");
-       if (ethernet_present ())
-               puts (" with PIGGY.");
-       puts ("\n");
-       return 0;
-}
-
-#if defined(CONFIG_OF_BOARD_SETUP)
-/*
- * update property in the blob
- */
-void ft_blob_update (void *blob, bd_t *bd)
-{
-  /* no board specific update */
-}
-
-
-void ft_board_setup (void *blob, bd_t *bd)
-{
-       ft_cpu_setup (blob, bd);
-       ft_blob_update (blob, bd);
-}
-#endif
-
-#if defined(CONFIG_HUSH_INIT_VAR)
-extern int ivm_read_eeprom (void);
-int hush_init_var (void)
-{
-       ivm_read_eeprom ();
-       return 0;
-}
-#endif
index 5c9496c3ceef727739835f997cc78cf17e537f76..7b346849bae4878327939a1982d618fdd154f93b 100644 (file)
@@ -195,33 +195,30 @@ const iop_conf_t iop_conf_tab[4][32] = {
     }
 };
 
-/* Try SDRAM initialization with P/LSDMR=sdmr and ORx=orx
+/*
+ * Try SDRAM initialization with P/LSDMR=sdmr and ORx=orx
  *
  * This routine performs standard 8260 initialization sequence
  * and calculates the available memory size. It may be called
  * several times to try different SDRAM configurations on both
  * 60x and local buses.
  */
-static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
-                                                 ulong orx, volatile uchar * base)
+static long int try_init(memctl8260_t *memctl, ulong sdmr,
+                                 ulong orx, uchar *base)
 {
-       volatile uchar c = 0xff;
-       volatile uint *sdmr_ptr;
-       volatile uint *orx_ptr;
+       uchar c = 0xff;
        ulong maxsize, size;
        int i;
 
-       /* We must be able to test a location outsize the maximum legal size
+       /*
+        * We must be able to test a location outsize the maximum legal size
         * to find out THAT we are outside; but this address still has to be
         * mapped by the controller. That means, that the initial mapping has
         * to be (at least) twice as large as the maximum expected size.
         */
        maxsize = (1 + (~orx | 0x7fff))/* / 2*/;
 
-       sdmr_ptr = &memctl->memc_psdmr;
-       orx_ptr = &memctl->memc_or1;
-
-       *orx_ptr = orx;
+       out_be32(&memctl->memc_or1, orx);
 
        /*
         * Quote from 8260 UM (10.4.2 SDRAM Power-On Initialization, 10-35):
@@ -243,78 +240,107 @@ static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
         * get here. The SDRAM can be accessed at the address CONFIG_SYS_SDRAM_BASE.
         */
 
-       *sdmr_ptr = sdmr | PSDMR_OP_PREA;
-       *base = c;
+       out_be32(&memctl->memc_psdmr, sdmr | PSDMR_OP_PREA);
+       out_8(base, c);
 
-       *sdmr_ptr = sdmr | PSDMR_OP_CBRR;
+       out_be32(&memctl->memc_psdmr, sdmr | PSDMR_OP_CBRR);
        for (i = 0; i < 8; i++)
-               *base = c;
+               out_8(base, c);
 
-       *sdmr_ptr = sdmr | PSDMR_OP_MRW;
-       *(base + CONFIG_SYS_MRS_OFFS) = c;      /* setting MR on address lines */
+       out_be32(&memctl->memc_psdmr, sdmr | PSDMR_OP_MRW);
+       /* setting MR on address lines */
+       out_8((uchar *)(base + CONFIG_SYS_MRS_OFFS), c);
 
-       *sdmr_ptr = sdmr | PSDMR_OP_NORM | PSDMR_RFEN;
-       *base = c;
+       out_be32(&memctl->memc_psdmr, sdmr | PSDMR_OP_NORM | PSDMR_RFEN);
+       out_8(base, c);
 
-       size = get_ram_size ((long *)base, maxsize);
-       *orx_ptr = orx | ~(size - 1);
+       size = get_ram_size((long *)base, maxsize);
+       out_be32(&memctl->memc_or1, orx | ~(size - 1));
 
        return (size);
 }
 
-phys_size_t initdram (int board_type)
+phys_size_t initdram(int board_type)
 {
-       volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
-       volatile memctl8260_t *memctl = &immap->im_memctl;
+       immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
+       memctl8260_t *memctl = &immap->im_memctl;
 
        long psize;
 
-       memctl->memc_psrt = CONFIG_SYS_PSRT;
-       memctl->memc_mptpr = CONFIG_SYS_MPTPR;
+       out_8(&memctl->memc_psrt, CONFIG_SYS_PSRT);
+       out_be16(&memctl->memc_mptpr, CONFIG_SYS_MPTPR);
 
 #ifndef CONFIG_SYS_RAMBOOT
        /* 60x SDRAM setup:
         */
-       psize = try_init (memctl, CONFIG_SYS_PSDMR, CONFIG_SYS_OR1,
-                                                 (uchar *) CONFIG_SYS_SDRAM_BASE);
+       psize = try_init(memctl, CONFIG_SYS_PSDMR, CONFIG_SYS_OR1,
+                                 (uchar *) CONFIG_SYS_SDRAM_BASE);
 #endif /* CONFIG_SYS_RAMBOOT */
 
-       icache_enable ();
+       icache_enable();
 
        return (psize);
 }
 
 int checkboard(void)
 {
-       puts ("Board: Keymile mgcoge");
-       if (ethernet_present ())
-               puts (" with PIGGY.");
-       puts ("\n");
+#if defined(CONFIG_MGCOGE)
+       puts("Board: Keymile mgcoge");
+#else
+       puts("Board: Keymile mgcoge2ne");
+#endif
+       if (ethernet_present())
+               puts(" with PIGGY.");
+       puts("\n");
+       return 0;
+}
+
+#define DIPSWITCH_OFFSET 0x89
+#define DIPSWITCH_MASK   0x0f
+
+int last_stage_init(void)
+{
+       u8 dip_switch;
+       /* Dip switch */
+       dip_switch = readb(CONFIG_SYS_BFTICU_BASE + DIPSWITCH_OFFSET);
+       dip_switch &= DIPSWITCH_MASK;
+       /* dip switch 'full reset' or 'db erase' */
+       if (dip_switch & 0x1 || dip_switch & 0x2) {
+               /* start bootloader */
+               puts("DIP:   Enabled\n");
+               setenv("actual_bank", "0");
+       }
+       set_km_env();
        return 0;
 }
 
 /*
  * Early board initalization.
  */
-int board_early_init_r (void)
+int board_early_init_r(void)
 {
+       struct km_bec_fpga *base =
+               (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+
        /* setup the UPIOx */
        /* General Unit Reset disabled, Flash Bank enabled, UnitLed on */
-       out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x02), 0xc2);
+       out_8(&base->oprth, (WRG_RESET | H_OPORTS_14 | WRG_LED));
        /* SCC4 enable, halfduplex, FCC1 powerdown */
-       out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x03), 0x15);
+       out_8(&base->oprtl, (H_OPORTS_SCC4_ENA | H_OPORTS_SCC4_FD_ENA |
+               H_OPORTS_FCC1_PW_DWN));
+
        return 0;
 }
 
-int hush_init_var (void)
+int hush_init_var(void)
 {
-       ivm_read_eeprom ();
+       ivm_read_eeprom();
        return 0;
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-void ft_board_setup (void *blob, bd_t *bd)
+void ft_board_setup(void *blob, bd_t *bd)
 {
-       ft_cpu_setup (blob, bd);
+       ft_cpu_setup(blob, bd);
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 25e7a4def20fda10e7a21748122e32d7214f5bd0..de0b355a6287a6ecb69c62a62ec4cf22a4215cf7 100644 (file)
@@ -56,13 +56,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index a07ba0efc7ed5f65c8eb6c1fae3b0e2f74cba489..2ed742fb56bf2cd94ed64ccb9ff81b88e83ad1a7 100644 (file)
@@ -24,8 +24,8 @@
 
 #include <common.h>
 #include <netdev.h>
-#include <asm/arch/mx31.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/imx-regs.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 0003a4242464afec9e892b41b86cf270238f2718..95b0c080c5d1cd4f45643dd64b01bcbd9d41db86 100644 (file)
@@ -21,7 +21,7 @@
  * MA 02111-1307 USA
  */
 
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 
 .macro REG reg, val
        ldr r2, =\reg
index d02db17ccb50d6b9c474aee5bf41bb139b5381a6..8bf7324f37a240d4c111c2d8690e5c84ff97261c 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 344cbde3b0774f77b21a03a5c7b7506dcb47d643..731cec9af70bc3d67f1942c885656ac9a6299832 100644 (file)
@@ -50,13 +50,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index f3d01e73f0450ad798b882dd01115309f42d861d..57c37deb8928a4db7080e9b9f51f0cab0fec232d 100644 (file)
@@ -55,13 +55,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 0f2593de89096db713ec0e19d19a157d25c240cf..9f9ddb8bf0166c617603c9ae80e21e6c79a09913 100644 (file)
@@ -44,13 +44,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index ef73e2b53ababd90b3c797bcadea44b75b4d9db8..dae2cfc7dae8b6dbd11b88ca2e851b52c72a639c 100644 (file)
@@ -41,13 +41,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
diff --git a/board/mp2usb/config.mk b/board/mp2usb/config.mk
deleted file mode 100644 (file)
index 948e4ff..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x27F00000
-## For testing: load at 0x20100000 and "go" at 0x201000A4
-#CONFIG_SYS_TEXT_BASE = 0x20100000
diff --git a/board/mp2usb/flash.c b/board/mp2usb/flash.c
deleted file mode 100644 (file)
index 21a8ef9..0000000
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- * (C) Copyright 2001
- * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
- *
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * Modified for the MP2USB by (C) Copyright 2005 Eric Benard
- * ebenard@eukrea.com
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 <common.h>
-#include <linux/byteorder/swab.h>
-
-#define CONFIG_SYS_MAX_FLASH_BANKS     1
-#define PHYS_FLASH_SECT_SIZE   0x00020000 /* 128 KB sectors (x1) */
-
-flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];   /* info for FLASH chips */
-
-#define FLASH_PORT_WIDTH       ushort
-#define FLASH_PORT_WIDTHV      vu_short
-#define SWAP(x)                        __swab16(x)
-
-#define FPW                    FLASH_PORT_WIDTH
-#define FPWV                   FLASH_PORT_WIDTHV
-
-#define mb() __asm__ __volatile__ ("" : : : "memory")
-
-/* Intel-compatible flash commands */
-#define INTEL_PROGRAM  0x00100010
-#define INTEL_ERASE    0x00200020
-#define INTEL_PROG     0x00400040
-#define INTEL_CLEAR    0x00500050
-#define INTEL_LOCKBIT  0x00600060
-#define INTEL_PROTECT  0x00010001
-#define INTEL_STATUS   0x00700070
-#define INTEL_READID   0x00900090
-#define INTEL_SUSPEND  0x00B000B0
-#define INTEL_CONFIRM  0x00D000D0
-#define INTEL_RESET    0xFFFFFFFF
-
-/* Intel-compatible flash status bits */
-#define INTEL_FINISHED 0x00800080
-#define INTEL_OK       0x00800080
-
-/*-----------------------------------------------------------------------
- * Functions
- */
-static ulong flash_get_size (FPW *addr, flash_info_t *info);
-static int write_data (flash_info_t *info, ulong dest, FPW data);
-static void flash_get_offsets (ulong base, flash_info_t *info);
-void inline spin_wheel (void);
-
-/*-----------------------------------------------------------------------
- */
-
-unsigned long flash_init (void)
-{
-       int i;
-       ulong size = 0;
-
-       for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
-               switch (i) {
-               case 0:
-                       flash_get_size ((FPW *) PHYS_FLASH_1, &flash_info[i]);
-                       flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
-                       break;
-               default:
-                       panic ("configured too many flash banks!\n");
-                       break;
-               }
-               size += flash_info[i].size;
-       }
-
-       /* Protect monitor and environment sectors
-        */
-       flash_protect ( FLAG_PROTECT_SET,
-                       CONFIG_SYS_FLASH_BASE,
-                       CONFIG_SYS_FLASH_BASE + monitor_flash_len - 1,
-                       &flash_info[0] );
-
-       flash_protect ( FLAG_PROTECT_SET,
-                       CONFIG_ENV_ADDR,
-                       CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, &flash_info[0] );
-
-       return size;
-}
-
-/*-----------------------------------------------------------------------
- */
-static void flash_get_offsets (ulong base, flash_info_t *info)
-{
-       int i;
-
-       if (info->flash_id == FLASH_UNKNOWN) {
-               return;
-       }
-
-       if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
-               for (i = 0; i < info->sector_count; i++) {
-                       info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE);
-                       info->protect[i] = 0;
-               }
-       }
-}
-
-/*-----------------------------------------------------------------------
- */
-void flash_print_info (flash_info_t *info)
-{
-       int i;
-
-       if (info->flash_id == FLASH_UNKNOWN) {
-               printf ("missing or unknown FLASH type\n");
-               return;
-       }
-
-       switch (info->flash_id & FLASH_VENDMASK) {
-       case FLASH_MAN_INTEL:
-               printf ("INTEL ");
-               break;
-       default:
-               printf ("Unknown Vendor ");
-               break;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case FLASH_28F640J3A:
-               printf ("28F640J3A\n");
-               break;
-       case FLASH_28F128J3A:
-               printf ("28F128J3A\n");
-               break;
-       default:
-               printf ("Unknown Chip Type\n");
-               break;
-       }
-
-       printf ("  Size: %ld MB in %d Sectors\n",
-                       info->size >> 20, info->sector_count);
-
-       printf ("  Sector Start Addresses:");
-       for (i = 0; i < info->sector_count; ++i) {
-               if ((i % 5) == 0)
-                       printf ("\n   ");
-               printf (" %08lX%s",
-                       info->start[i],
-                       info->protect[i] ? " (RO)" : "     ");
-       }
-       printf ("\n");
-       return;
-}
-
-/*
- * The following code cannot be run from FLASH!
- */
-static ulong flash_get_size (FPW *addr, flash_info_t *info)
-{
-       volatile FPW value;
-
-       /* Write auto select command: read Manufacturer ID */
-       addr[0x5555] = (FPW) 0x00AA00AA;
-       addr[0x2AAA] = (FPW) 0x00550055;
-       addr[0x5555] = (FPW) 0x00900090;
-
-       mb ();
-       value = addr[0];
-
-       switch (value) {
-
-       case (FPW) INTEL_MANUFACT:
-               info->flash_id = FLASH_MAN_INTEL;
-               break;
-
-       default:
-               info->flash_id = FLASH_UNKNOWN;
-               info->sector_count = 0;
-               info->size = 0;
-               addr[0] = (FPW) INTEL_RESET;    /* restore read mode */
-               return (0);                     /* no or unknown flash  */
-       }
-
-       mb ();
-       value = addr[1];                        /* device ID        */
-
-       switch (value) {
-
-       case (FPW) INTEL_ID_28F640J3A:
-               info->flash_id += FLASH_28F640J3A;
-               info->sector_count = 64;
-               info->size = 0x00800000;
-               break;                          /* => 8 MB     */
-
-       case (FPW) INTEL_ID_28F128J3A:
-               info->flash_id += FLASH_28F128J3A;
-               info->sector_count = 128;
-               info->size = 0x01000000;
-               break;                          /* => 16 MB     */
-
-       default:
-               info->flash_id = FLASH_UNKNOWN;
-               break;
-       }
-
-       if (info->sector_count > CONFIG_SYS_MAX_FLASH_SECT) {
-               printf ("** ERROR: sector count %d > max (%d) **\n",
-                       info->sector_count, CONFIG_SYS_MAX_FLASH_SECT);
-               info->sector_count = CONFIG_SYS_MAX_FLASH_SECT;
-       }
-
-       addr[0] = (FPW) INTEL_RESET;            /* restore read mode */
-
-       return (info->size);
-}
-
-
-/*-----------------------------------------------------------------------
- */
-
-int flash_erase (flash_info_t *info, int s_first, int s_last)
-{
-       int prot, sect;
-       ulong type, start, last;
-       int rcode = 0;
-       int cflag, iflag;
-
-       if ((s_first < 0) || (s_first > s_last)) {
-               if (info->flash_id == FLASH_UNKNOWN) {
-                       printf ("- missing\n");
-               } else {
-                       printf ("- no sectors to erase\n");
-               }
-               return 1;
-       }
-
-       type = (info->flash_id & FLASH_VENDMASK);
-       if ((type != FLASH_MAN_INTEL)) {
-               printf ("Can't erase unknown flash type %08lx - aborted\n",
-                       info->flash_id);
-               return 1;
-       }
-
-       prot = 0;
-       for (sect = s_first; sect <= s_last; ++sect) {
-               if (info->protect[sect]) {
-                       prot++;
-               }
-       }
-
-       if (prot) {
-               printf ("- Warning: %d protected sectors will not be erased!\n",
-                       prot);
-       } else {
-               printf ("\n");
-       }
-
-       start = get_timer (0);
-       last = start;
-
-       /*
-        * Disable interrupts which might cause a timeout
-        * here. Remember that our exception vectors are
-        * at address 0 in the flash, and we don't want a
-        * (ticker) exception to happen while the flash
-        * chip is in programming mode.
-        */
-       cflag = icache_status ();
-       icache_disable ();
-       /* Disable interrupts which might cause a timeout here */
-       iflag = disable_interrupts ();
-
-       /* Start erase on unprotected sectors */
-       for (sect = s_first; sect <= s_last; sect++) {
-               if (info->protect[sect] == 0) { /* not protected */
-                       FPWV *addr = (FPWV *) (info->start[sect]);
-                       FPW status;
-
-                       printf ("Erasing sector %2d ... ", sect);
-
-                       /* arm simple, non interrupt dependent timer */
-                       reset_timer_masked ();
-
-                       *addr = (FPW) INTEL_CLEAR;      /* clear status register */
-                       *addr = (FPW) INTEL_ERASE;      /* erase setup */
-                       *addr = (FPW) INTEL_CONFIRM;    /* erase confirm */
-
-                       while (((status = *addr) & (FPW) INTEL_FINISHED) != (FPW) INTEL_FINISHED) {
-                               if (get_timer_masked () > CONFIG_SYS_FLASH_ERASE_TOUT) {
-                                       printf ("Timeout\n");
-                                       *addr = (FPW) INTEL_SUSPEND;    /* suspend erase     */
-                                       *addr = (FPW) INTEL_RESET;      /* reset to read mode */
-                                       rcode = 1;
-                                       break;
-                               }
-                       }
-
-                       *addr = (FPWV)INTEL_CLEAR;      /* clear status register cmd.   */
-                       *addr = (FPWV)INTEL_RESET;      /* resest to read mode          */
-
-                       printf (" done\n");
-               }
-       }
-
-       if (iflag)
-               enable_interrupts ();
-
-       if (cflag)
-               icache_enable ();
-
-       return rcode;
-}
-
-/*-----------------------------------------------------------------------
- * Copy memory to flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- * 4 - Flash not identified
- */
-
-int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
-{
-       ulong cp, wp;
-       FPW data;
-       int count, i, l, rc, port_width;
-
-       if (info->flash_id == FLASH_UNKNOWN) {
-               return 4;
-       }
-
-       /* get lower word aligned address */
-       wp = (addr & ~1);
-       port_width = 2;
-
-       /*
-        * handle unaligned start bytes
-        */
-       if ((l = addr - wp) != 0) {
-               data = 0;
-               for (i = 0, cp = wp; i < l; ++i, ++cp) {
-                       data = (data << 8) | (*(uchar *) cp);
-               }
-               for (; i < port_width && cnt > 0; ++i) {
-                       data = (data << 8) | *src++;
-                       --cnt;
-                       ++cp;
-               }
-               for (; cnt == 0 && i < port_width; ++i, ++cp) {
-                       data = (data << 8) | (*(uchar *) cp);
-               }
-
-               if ((rc = write_data (info, wp, SWAP (data))) != 0) {
-                       return (rc);
-               }
-               wp += port_width;
-       }
-
-       /*
-        * handle word aligned part
-        */
-       count = 0;
-       while (cnt >= port_width) {
-               data = 0;
-               for (i = 0; i < port_width; ++i) {
-                       data = (data << 8) | *src++;
-               }
-               if ((rc = write_data (info, wp, SWAP (data))) != 0) {
-                       return (rc);
-               }
-               wp += port_width;
-               cnt -= port_width;
-               if (count++ > 0x800) {
-                       spin_wheel ();
-                       count = 0;
-               }
-       }
-
-       if (cnt == 0) {
-               return (0);
-       }
-
-       /*
-        * handle unaligned tail bytes
-        */
-       data = 0;
-       for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) {
-               data = (data << 8) | *src++;
-               --cnt;
-       }
-       for (; i < port_width; ++i, ++cp) {
-               data = (data << 8) | (*(uchar *) cp);
-       }
-
-       return (write_data (info, wp, SWAP (data)));
-}
-
-/*-----------------------------------------------------------------------
- * Write a word or halfword to Flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-static int write_data (flash_info_t *info, ulong dest, FPW data)
-{
-       FPWV *addr = (FPWV *) dest;
-       ulong status;
-       int cflag, iflag;
-
-       /* Check if Flash is (sufficiently) erased */
-       if ((*addr & data) != data) {
-               printf ("not erased at %08lx (%lx)\n", (ulong) addr, (ulong) *addr);
-               return (2);
-       }
-       /*
-        * Disable interrupts which might cause a timeout
-        * here. Remember that our exception vectors are
-        * at address 0 in the flash, and we don't want a
-        * (ticker) exception to happen while the flash
-        * chip is in programming mode.
-        */
-       cflag = icache_status ();
-       icache_disable ();
-       /* Disable interrupts which might cause a timeout here */
-       iflag = disable_interrupts ();
-
-       *addr = (FPW) INTEL_PROG;       /* write setup */
-       *addr = data;
-
-       /* arm simple, non interrupt dependent timer */
-       reset_timer_masked ();
-
-       /* wait while polling the status register */
-       while (((status = *addr) & (FPW) INTEL_FINISHED) != (FPW) INTEL_FINISHED) {
-               if (get_timer_masked () > CONFIG_SYS_FLASH_WRITE_TOUT) {
-                       *addr = (FPW) INTEL_RESET;      /* restore read mode */
-                       return (1);
-               }
-       }
-
-       *addr = (FPW) INTEL_RESET;      /* restore read mode */
-
-       if (iflag)
-               enable_interrupts ();
-
-       if (cflag)
-               icache_enable ();
-
-       return (0);
-}
-
-void inline spin_wheel (void)
-{
-       static int p = 0;
-       static char w[] = "\\/-";
-
-       printf ("\010%c", w[p]);
-       (++p == 3) ? (p = 0) : 0;
-}
-
-/*-----------------------------------------------------------------------
- * Set/Clear sector's lock bit, returns:
- * 0 - OK
- * 1 - Error (timeout, voltage problems, etc.)
- */
-int flash_real_protect(flash_info_t *info, long sector, int prot)
-{
-       int i;
-       int rc = 0;
-       FPWV *addr = (FPWV *)(info->start[sector]);
-       int flag = disable_interrupts();
-
-       *addr = (FPW) INTEL_CLEAR;      /* Clear status register */
-       if (prot) {                     /* Set sector lock bit */
-               *addr = (FPW) INTEL_LOCKBIT;    /* Sector lock bit */
-               *addr = (FPW) INTEL_PROTECT;    /* set */
-       }
-       else {                          /* Clear sector lock bit */
-               *addr = (FPW) INTEL_LOCKBIT;    /* All sectors lock bits */
-               *addr = (FPW) INTEL_CONFIRM;    /* clear */
-       }
-
-       reset_timer_masked ();
-
-       while ((*addr & (FPW) INTEL_FINISHED) != (FPW) INTEL_FINISHED) {
-               if (get_timer_masked () > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
-                       printf("Flash lock bit operation timed out\n");
-                       rc = 1;
-                       break;
-               }
-       }
-
-       if (*addr != (FPW) INTEL_OK) {
-               printf("Flash lock bit operation failed at %08X, CSR=%08X\n",
-                      (uint)addr, (uint)*addr);
-               rc = 1;
-       }
-
-       if (!rc)
-               info->protect[sector] = prot;
-
-       /*
-        * Clear lock bit command clears all sectors lock bits, so
-        * we have to restore lock bits of protected sectors.
-        */
-       if (!prot)
-       {
-               for (i = 0; i < info->sector_count; i++)
-               {
-                       if (info->protect[i])
-                       {
-                               reset_timer_masked ();
-                               addr = (FPWV *) (info->start[i]);
-                               *addr = (FPW) INTEL_LOCKBIT;    /* Sector lock bit */
-                               *addr = (FPW) INTEL_PROTECT;    /* set */
-                               while ((*addr & (FPW) INTEL_FINISHED) != (FPW) INTEL_FINISHED)
-                               {
-                                       if (get_timer_masked () > CONFIG_SYS_FLASH_UNLOCK_TOUT)
-                                       {
-                                               printf("Flash lock bit operation timed out\n");
-                                               rc = 1;
-                                               break;
-                                       }
-                               }
-                       }
-               }
-       }
-
-       if (flag)
-               enable_interrupts();
-
-       *addr = (FPW) INTEL_RESET;              /* Reset to read array mode */
-
-       return rc;
-}
diff --git a/board/mp2usb/mp2usb.c b/board/mp2usb/mp2usb.c
deleted file mode 100644 (file)
index e5eba6b..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * Modified for the MP2USB by (C) Copyright 2005 Eric Benard
- * ebenard@eukrea.com
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 <common.h>
-#include <asm/arch/AT91RM9200.h>
-#include <netdev.h>
-#include <asm/io.h>
-#if defined(CONFIG_DRIVER_ETHER)
-#include <at91rm9200_net.h>
-#include <dm9161.h>
-#endif
-#include <asm/mach-types.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/*
- * Miscelaneous platform dependent initialisations
- */
-
-int board_init (void)
-{
-       /* Enable Ctrlc */
-       console_init_f ();
-
-       /* memory and cpu-speed are setup before relocation */
-       /* so we do _nothing_ here */
-
-       /* arch number of MP2USB-Board. */
-       gd->bd->bi_arch_number = MACH_TYPE_MP2USB;
-       /* adress of boot parameters */
-       gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
-
-       return 0;
-}
-
-int dram_init (void)
-{
-       gd->bd->bi_dram[0].start = PHYS_SDRAM;
-       gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
-       return 0;
-}
-
-#ifdef CONFIG_DRIVER_ETHER
-#if defined(CONFIG_CMD_NET)
-
-/*
- * Name:
- *     at91rm9200_GetPhyInterface
- * Description:
- *     Initialise the interface functions to the PHY
- * Arguments:
- *     None
- * Return value:
- *     None
- */
-void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
-{
-       p_phyops->Init = dm9161_InitPhy;
-       p_phyops->IsPhyConnected = dm9161_IsPhyConnected;
-       p_phyops->GetLinkSpeed = dm9161_GetLinkSpeed;
-       p_phyops->AutoNegotiate = dm9161_AutoNegotiate;
-}
-
-#endif
-#endif /* CONFIG_DRIVER_ETHER */
-
-#ifdef CONFIG_DRIVER_AT91EMAC
-int board_eth_init(bd_t *bis)
-{
-       int rc = 0;
-       rc = at91emac_register(bis, 0);
-       return rc;
-}
-#endif
diff --git a/board/munices/u-boot.lds b/board/munices/u-boot.lds
deleted file mode 100644 (file)
index 99576bf..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * (C) Copyright 2007
- * Heiko Schocher, DENX Software Engineering, hs@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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
- */
-
-OUTPUT_ARCH(powerpc)
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    arch/powerpc/cpu/mpc5xxx/start.o   (.text)
-    *(.text)
-    *(.got1)
-    . = ALIGN(16);
-    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss (NOLOAD)       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-   . = ALIGN(4);
-  }
-  __bss_end__ = . ;
-  PROVIDE (end = .);
-}
index 03ba15578bdd40738bd4c97a2d4c740dba6346b9..11624d21f5412c85461bf2530488fa5fc5d81e50 100644 (file)
@@ -51,13 +51,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
index b7b6c1aa14aeb286ad40d92c46a264f40a1225f1..a949e4f59201a000a805c9ae0746ca767246344d 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index b7b6c1aa14aeb286ad40d92c46a264f40a1225f1..a949e4f59201a000a805c9ae0746ca767246344d 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index b7b6c1aa14aeb286ad40d92c46a264f40a1225f1..a949e4f59201a000a805c9ae0746ca767246344d 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index b7b6c1aa14aeb286ad40d92c46a264f40a1225f1..a949e4f59201a000a805c9ae0746ca767246344d 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 369cb2228eee46c24cc623786ca595d324c6362b..3d6c248479327e896fcc92722e51c00ec08b43ea 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/arch/clk_rst.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/uart.h>
+#include "board.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -37,6 +38,24 @@ const struct tegra2_sysinfo sysinfo = {
        CONFIG_TEGRA2_BOARD_STRING
 };
 
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+       /* Initialize periph clocks */
+       clock_init();
+
+       /* Initialize periph pinmuxes */
+       pinmux_init();
+
+       /* Initialize periph GPIOs */
+       gpio_init();
+
+       /* Init UART, scratch regs, and start CPU */
+       tegra2_start();
+       return 0;
+}
+#endif /* EARLY_INIT */
+
 /*
  * Routine: timer_init
  * Description: init the timestamp and lastinc value
@@ -54,10 +73,10 @@ int timer_init(void)
 static void clock_init_uart(void)
 {
        struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
-       static int pllp_init_done;
        u32 reg;
 
-       if (!pllp_init_done) {
+       reg = readl(&clkrst->crc_pllp_base);
+       if (!(reg & PLL_BASE_OVRRIDE)) {
                /* Override pllp setup for 216MHz operation. */
                reg = (PLL_BYPASS | PLL_BASE_OVRRIDE | PLL_DIVP);
                reg |= (((NVRM_PLLP_FIXED_FREQ_KHZ/500) << 8) | PLL_DIVM);
@@ -68,8 +87,6 @@ static void clock_init_uart(void)
 
                reg &= ~PLL_BYPASS;
                writel(reg, &clkrst->crc_pllp_base);
-
-               pllp_init_done++;
        }
 
        /* Now do the UART reset/clock enable */
@@ -171,6 +188,15 @@ void pinmux_init(void)
        pin_mux_uart();
 }
 
+/*
+ * Routine: gpio_init
+ * Description: Do individual peripheral GPIO configs
+ */
+void gpio_init(void)
+{
+       gpio_config_uart();
+}
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -182,11 +208,5 @@ int board_init(void)
        /* board id for Linux */
        gd->bd->bi_arch_number = CONFIG_MACH_TYPE;
 
-       /* Initialize peripheral clocks */
-       clock_init();
-
-       /* Initialize periph pinmuxes */
-       pinmux_init();
-
        return 0;
 }
similarity index 73%
rename from board/purple/lowlevel_init.S
rename to board/nvidia/common/board.h
index 1bd3edb8154d4a43e5584b3238fdb13cde6a746e..350bc5750e71b68ee143e4814ffb5eea218473e2 100644 (file)
@@ -1,7 +1,6 @@
 /*
- *  Memory sub-system initialization code for PURPLE development board.
- *
- *  Copyright (c) 2003 Wolfgang Denk <wd@denx.de>
+ *  (C) Copyright 2010,2011
+ *  NVIDIA Corporation <www.nvidia.com>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
  * MA 02111-1307 USA
  */
 
-#include <config.h>
-#include <asm/regdef.h>
+#ifndef _BOARD_H_
+#define _BOARD_H_
 
-#define MC_IOGP        0xBF800800
+void tegra2_start(void);
+void clock_init(void);
+void pinmux_init(void);
+void gpio_init(void);
+void gpio_config_uart(void);
 
-       .globl  lowlevel_init
-lowlevel_init:
-       li      t0, MC_IOGP
-       li      t1, 0xf24
-       sw      t1, 0(t0)
-       jr      ra
-       nop
+#endif /* BOARD_H */
index 3a146cb9cab17bdd57c72f19b6675ca75aa6ce5c..9fb6b575a8a72ee380c7e1fb24566b2a714d0089 100644 (file)
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).o
 
+COBJS  := $(BOARD).o
 COBJS  += ../common/board.o
 
 SRCS   := $(COBJS:.o=.c)
diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c
new file mode 100644 (file)
index 0000000..f1ab050
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ *  (C) Copyright 2010,2011
+ *  NVIDIA Corporation <www.nvidia.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 <common.h>
+#include <asm/io.h>
+#include <asm/arch/tegra2.h>
+
+/*
+ * Routine: gpio_config_uart
+ * Description: Does nothing on Harmony - no conflict w/SPI.
+ */
+void gpio_config_uart(void)
+{
+}
index 3a146cb9cab17bdd57c72f19b6675ca75aa6ce5c..9fb6b575a8a72ee380c7e1fb24566b2a714d0089 100644 (file)
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).o
 
+COBJS  := $(BOARD).o
 COBJS  += ../common/board.o
 
 SRCS   := $(COBJS:.o=.c)
diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
new file mode 100644 (file)
index 0000000..4b9a8f3
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ *  (C) Copyright 2010,2011
+ *  NVIDIA Corporation <www.nvidia.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 <common.h>
+#include <asm/io.h>
+#include <asm/arch/tegra2.h>
+#include <asm/arch/gpio.h>
+
+/*
+ * Routine: gpio_config_uart
+ * Description: Force GPIO_PI3 low on Seaboard so UART4 works.
+ */
+void gpio_config_uart(void)
+{
+       int gp = GPIO_PI3;
+       struct gpio_ctlr *gpio = (struct gpio_ctlr *)NV_PA_GPIO_BASE;
+       struct gpio_ctlr_bank *bank = &gpio->gpio_bank[GPIO_BANK(gp)];
+       u32 val;
+
+       /* Enable UART via GPIO_PI3 (port 8, bit 3) so serial console works */
+       val = readl(&bank->gpio_config[GPIO_PORT(gp)]);
+       val |= 1 << GPIO_BIT(gp);
+       writel(val, &bank->gpio_config[GPIO_PORT(gp)]);
+
+       val = readl(&bank->gpio_out[GPIO_PORT(gp)]);
+       val &= ~(1 << GPIO_BIT(gp));
+       writel(val, &bank->gpio_out[GPIO_PORT(gp)]);
+
+       val = readl(&bank->gpio_dir_out[GPIO_PORT(gp)]);
+       val |= 1 << GPIO_BIT(gp);
+       writel(val, &bank->gpio_dir_out[GPIO_PORT(gp)]);
+}
index 2fac727b84f6933997ccffe91eed55c185098cf6..fd4e8a50d543a62df0422cdb6c30af81e7cd8752 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
diff --git a/board/purple/config.mk b/board/purple/config.mk
deleted file mode 100644 (file)
index 404c3fb..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# (C) Copyright 2003
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# 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
-#
-
-#
-# Purple board with MIPS 5Kc CPU core
-#
-
-# ROM version
-CONFIG_SYS_TEXT_BASE = 0xB0000000
-
-# RAM version
-#CONFIG_SYS_TEXT_BASE = 0x80100000
diff --git a/board/purple/flash.c b/board/purple/flash.c
deleted file mode 100644 (file)
index 5cee35e..0000000
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 <common.h>
-#include <asm/inca-ip.h>
-
-flash_info_t   flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
-
-typedef unsigned long FLASH_PORT_WIDTH;
-typedef volatile unsigned long FLASH_PORT_WIDTHV;
-
-#define        FLASH_ID_MASK   0xFFFFFFFF
-
-#define FPW    FLASH_PORT_WIDTH
-#define FPWV   FLASH_PORT_WIDTHV
-
-#define ORMASK(size) ((-size) & OR_AM_MSK)
-
-#define FLASH29_REG_ADRS(reg) ((FPWV *)PHYS_FLASH_1 + (reg))
-
-/* FLASH29 command register addresses */
-
-#define FLASH29_REG_FIRST_CYCLE                FLASH29_REG_ADRS (0x1555)
-#define FLASH29_REG_SECOND_CYCLE       FLASH29_REG_ADRS (0x2aaa)
-#define FLASH29_REG_THIRD_CYCLE                FLASH29_REG_ADRS (0x3555)
-#define        FLASH29_REG_FOURTH_CYCLE        FLASH29_REG_ADRS (0x4555)
-#define        FLASH29_REG_FIFTH_CYCLE         FLASH29_REG_ADRS (0x5aaa)
-#define        FLASH29_REG_SIXTH_CYCLE         FLASH29_REG_ADRS (0x6555)
-
-/* FLASH29 command definitions */
-
-#define        FLASH29_CMD_FIRST               0xaaaaaaaa
-#define        FLASH29_CMD_SECOND              0x55555555
-#define        FLASH29_CMD_FOURTH              0xaaaaaaaa
-#define        FLASH29_CMD_FIFTH               0x55555555
-#define        FLASH29_CMD_SIXTH               0x10101010
-
-#define        FLASH29_CMD_SECTOR              0x30303030
-#define        FLASH29_CMD_PROGRAM             0xa0a0a0a0
-#define        FLASH29_CMD_CHIP_ERASE          0x80808080
-#define        FLASH29_CMD_READ_RESET          0xf0f0f0f0
-#define        FLASH29_CMD_AUTOSELECT          0x90909090
-#define FLASH29_CMD_READ               0x70707070
-
-#define IN_RAM_CMD_READ                0x1
-#define IN_RAM_CMD_WRITE       0x2
-
-#define FLASH_WRITE_CMD        ((ulong)(flash_write_cmd) & 0x7)+0xbf008000
-#define FLASH_READ_CMD  ((ulong)(flash_read_cmd) & 0x7)+0xbf008000
-
-typedef void (*FUNCPTR_CP)(ulong *source, ulong *destination, ulong nlongs);
-typedef void (*FUNCPTR_RD)(int cmd, FPWV * pFA, char * string, int strLen);
-typedef void (*FUNCPTR_WR)(int cmd, FPWV * pFA, FPW value);
-
-static ulong flash_get_size(FPWV *addr, flash_info_t *info);
-static int write_word(flash_info_t *info, FPWV *dest, FPW data);
-static void flash_get_offsets(ulong base, flash_info_t *info);
-static flash_info_t *flash_get_info(ulong base);
-
-static void load_cmd(ulong cmd);
-static ulong in_ram_cmd = 0;
-
-
-/******************************************************************************
-*
-* Don't change the program architecture
-* This architecture assure the program
-* can be relocated to scratch ram
-*/
-static void flash_read_cmd(int cmd, FPWV * pFA, char * string, int strLen)
-{
-       int i,j;
-       FPW temp,temp1;
-       FPWV *str;
-
-       str = (FPWV *)string;
-
-       j=  strLen/4;
-
-       if(cmd == FLASH29_CMD_AUTOSELECT)
-          {
-           *(FLASH29_REG_FIRST_CYCLE)  = FLASH29_CMD_FIRST;
-           *(FLASH29_REG_SECOND_CYCLE) = FLASH29_CMD_SECOND;
-           *(FLASH29_REG_THIRD_CYCLE)  = FLASH29_CMD_AUTOSELECT;
-          }
-
-       if(cmd == FLASH29_CMD_READ)
-          {
-           i = 0;
-           while(i<j)
-           {
-               temp = *pFA++;
-               temp1 = *(int *)0xa0000000;
-               *(int *)0xbf0081f8 = temp1 + temp;
-               *str++ = temp;
-               i++;
-           }
-          }
-
-        if(cmd == FLASH29_CMD_READ_RESET)
-        {
-           *(FLASH29_REG_FIRST_CYCLE)  = FLASH29_CMD_FIRST;
-           *(FLASH29_REG_SECOND_CYCLE) = FLASH29_CMD_SECOND;
-           *(FLASH29_REG_THIRD_CYCLE)  = FLASH29_CMD_READ_RESET;
-        }
-
-       *(int *)0xbf0081f8 = *(int *)0xa0000000;        /* dummy read switch back to sdram interface */
-}
-
-/******************************************************************************
-*
-* Don't change the program architecture
-* This architecture assure the program
-* can be relocated to scratch ram
-*/
-static void flash_write_cmd(int cmd, FPWV * pFA, FPW value)
-{
-       *(FLASH29_REG_FIRST_CYCLE)  = FLASH29_CMD_FIRST;
-       *(FLASH29_REG_SECOND_CYCLE) = FLASH29_CMD_SECOND;
-
-       if (cmd == FLASH29_CMD_SECTOR)
-          {
-           *(FLASH29_REG_THIRD_CYCLE)  = FLASH29_CMD_CHIP_ERASE;
-           *(FLASH29_REG_FOURTH_CYCLE) = FLASH29_CMD_FOURTH;
-           *(FLASH29_REG_FIFTH_CYCLE)  = FLASH29_CMD_FIFTH;
-           *pFA                        = FLASH29_CMD_SECTOR;
-          }
-
-       if (cmd == FLASH29_CMD_SIXTH)
-          {
-           *(FLASH29_REG_THIRD_CYCLE)  = FLASH29_CMD_CHIP_ERASE;
-           *(FLASH29_REG_FOURTH_CYCLE) = FLASH29_CMD_FOURTH;
-           *(FLASH29_REG_FIFTH_CYCLE)  = FLASH29_CMD_FIFTH;
-           *(FLASH29_REG_SIXTH_CYCLE)  = FLASH29_CMD_SIXTH;
-          }
-
-       if (cmd == FLASH29_CMD_PROGRAM)
-          {
-           *(FLASH29_REG_THIRD_CYCLE)  = FLASH29_CMD_PROGRAM;
-           *pFA = value;
-          }
-
-       if (cmd == FLASH29_CMD_READ_RESET)
-          {
-           *(FLASH29_REG_THIRD_CYCLE)  = FLASH29_CMD_READ_RESET;
-          }
-
-       *(int *)0xbf0081f8 = *(int *)0xa0000000;        /* dummy read switch back to sdram interface */
-}
-
-static void load_cmd(ulong cmd)
-{
-       ulong *src;
-       ulong *dst;
-       FUNCPTR_CP absEntry;
-       ulong func;
-
-       if (in_ram_cmd & cmd) return;
-
-       if (cmd == IN_RAM_CMD_READ)
-       {
-               func = (ulong)flash_read_cmd;
-       }
-       else
-       {
-               func = (ulong)flash_write_cmd;
-       }
-
-       src = (ulong *)(func & 0xfffffff8);
-       dst = (ulong *)0xbf008000;
-       absEntry = (FUNCPTR_CP)(0xbf0081d0);
-       absEntry(src,dst,0x38);
-
-       in_ram_cmd = cmd;
-}
-
-/*-----------------------------------------------------------------------
- * flash_init()
- *
- * sets up flash_info and returns size of FLASH (bytes)
- */
-unsigned long flash_init (void)
-{
-       unsigned long size = 0;
-       int i;
-
-       load_cmd(IN_RAM_CMD_READ);
-
-       /* Init: no FLASHes known */
-       for (i=0; i < CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
-               ulong flashbase = PHYS_FLASH_1;
-               ulong * buscon = (ulong *) INCA_IP_EBU_EBU_BUSCON0;
-
-               /* Disable write protection */
-               *buscon &= ~INCA_IP_EBU_EBU_BUSCON1_WRDIS;
-
-#if 1
-               memset(&flash_info[i], 0, sizeof(flash_info_t));
-#endif
-
-               flash_info[i].size =
-                       flash_get_size((FPW *)flashbase, &flash_info[i]);
-
-               if (flash_info[i].flash_id == FLASH_UNKNOWN) {
-                       printf ("## Unknown FLASH on Bank %d - Size = 0x%08lx\n",
-                       i, flash_info[i].size);
-               }
-
-               size += flash_info[i].size;
-       }
-
-#if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE
-       /* monitor protection ON by default */
-       flash_protect(FLAG_PROTECT_SET,
-                     CONFIG_SYS_MONITOR_BASE,
-                     CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1,
-                     flash_get_info(CONFIG_SYS_MONITOR_BASE));
-#endif
-
-#ifdef CONFIG_ENV_IS_IN_FLASH
-       /* ENV protection ON by default */
-       flash_protect(FLAG_PROTECT_SET,
-                     CONFIG_ENV_ADDR,
-                     CONFIG_ENV_ADDR+CONFIG_ENV_SIZE-1,
-                     flash_get_info(CONFIG_ENV_ADDR));
-#endif
-
-       return size;
-}
-
-/*-----------------------------------------------------------------------
- */
-static void flash_get_offsets (ulong base, flash_info_t *info)
-{
-       int i;
-
-       if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_AMD
-                && (info->flash_id & FLASH_TYPEMASK) == FLASH_AM160B) {
-
-               int bootsect_size[4];   /* number of bytes/boot sector  */
-               int sect_size;          /* number of bytes/regular sector */
-
-               bootsect_size[0] = 0x00008000;
-               bootsect_size[1] = 0x00004000;
-               bootsect_size[2] = 0x00004000;
-               bootsect_size[3] = 0x00010000;
-               sect_size =        0x00020000;
-
-               /* set sector offsets for bottom boot block type        */
-               for (i = 0; i < info->sector_count; i++) {
-                       info->start[i] = base;
-                       base += i < 4 ? bootsect_size[i] : sect_size;
-               }
-       }
-}
-
-/*-----------------------------------------------------------------------
- */
-
-static flash_info_t *flash_get_info(ulong base)
-{
-       int i;
-       flash_info_t * info;
-
-       for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i ++) {
-               info = & flash_info[i];
-               if (info->start[0] <= base && base < info->start[0] + info->size)
-                       break;
-       }
-
-       return i == CONFIG_SYS_MAX_FLASH_BANKS ? 0 : info;
-}
-
-/*-----------------------------------------------------------------------
- */
-
-void flash_print_info (flash_info_t *info)
-{
-       int i;
-       uchar *boottype;
-       uchar *bootletter;
-       char *fmt;
-       uchar botbootletter[] = "B";
-       uchar topbootletter[] = "T";
-       uchar botboottype[] = "bottom boot sector";
-       uchar topboottype[] = "top boot sector";
-
-       if (info->flash_id == FLASH_UNKNOWN) {
-               printf ("missing or unknown FLASH type\n");
-               return;
-       }
-
-       switch (info->flash_id & FLASH_VENDMASK) {
-       case FLASH_MAN_AMD:     printf ("AMD ");                break;
-       case FLASH_MAN_BM:      printf ("BRIGHT MICRO ");       break;
-       case FLASH_MAN_FUJ:     printf ("FUJITSU ");            break;
-       case FLASH_MAN_SST:     printf ("SST ");                break;
-       case FLASH_MAN_STM:     printf ("STM ");                break;
-       case FLASH_MAN_INTEL:   printf ("INTEL ");              break;
-       default:                printf ("Unknown Vendor ");     break;
-       }
-
-       /* check for top or bottom boot, if it applies */
-       if (info->flash_id & FLASH_BTYPE) {
-               boottype = botboottype;
-               bootletter = botbootletter;
-       }
-       else {
-               boottype = topboottype;
-               bootletter = topbootletter;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case FLASH_AM160B:
-               fmt = "29LV160B%s (16 Mbit, %s)\n";
-               break;
-       case FLASH_28F800C3B:
-       case FLASH_28F800C3T:
-               fmt = "28F800C3%s (8 Mbit, %s)\n";
-               break;
-       case FLASH_INTEL800B:
-       case FLASH_INTEL800T:
-               fmt = "28F800B3%s (8 Mbit, %s)\n";
-               break;
-       case FLASH_28F160C3B:
-       case FLASH_28F160C3T:
-               fmt = "28F160C3%s (16 Mbit, %s)\n";
-               break;
-       case FLASH_INTEL160B:
-       case FLASH_INTEL160T:
-               fmt = "28F160B3%s (16 Mbit, %s)\n";
-               break;
-       case FLASH_28F320C3B:
-       case FLASH_28F320C3T:
-               fmt = "28F320C3%s (32 Mbit, %s)\n";
-               break;
-       case FLASH_INTEL320B:
-       case FLASH_INTEL320T:
-               fmt = "28F320B3%s (32 Mbit, %s)\n";
-               break;
-       case FLASH_28F640C3B:
-       case FLASH_28F640C3T:
-               fmt = "28F640C3%s (64 Mbit, %s)\n";
-               break;
-       case FLASH_INTEL640B:
-       case FLASH_INTEL640T:
-               fmt = "28F640B3%s (64 Mbit, %s)\n";
-               break;
-       default:
-               fmt = "Unknown Chip Type\n";
-               break;
-       }
-
-       printf (fmt, bootletter, boottype);
-
-       printf ("  Size: %ld MB in %d Sectors\n",
-               info->size >> 20,
-               info->sector_count);
-
-       printf ("  Sector Start Addresses:");
-
-       for (i=0; i<info->sector_count; ++i) {
-               if ((i % 5) == 0) {
-                       printf ("\n   ");
-               }
-
-               printf (" %08lX%s", info->start[i],
-                       info->protect[i] ? " (RO)" : "     ");
-       }
-
-       printf ("\n");
-}
-
-/*-----------------------------------------------------------------------
- */
-
-/*
- * The following code cannot be run from FLASH!
- */
-
-ulong flash_get_size (FPWV *addr, flash_info_t *info)
-{
-       FUNCPTR_RD absEntry;
-       FPW retValue;
-       int flag;
-
-       load_cmd(IN_RAM_CMD_READ);
-       absEntry = (FUNCPTR_RD)FLASH_READ_CMD;
-
-       flag = disable_interrupts();
-       absEntry(FLASH29_CMD_AUTOSELECT,0,0,0);
-       if (flag) enable_interrupts();
-
-       udelay(100);
-
-       flag = disable_interrupts();
-       absEntry(FLASH29_CMD_READ, addr + 1, (char *)&retValue, sizeof(retValue));
-       absEntry(FLASH29_CMD_READ_RESET,0,0,0);
-       if (flag) enable_interrupts();
-
-       udelay(100);
-
-       switch (retValue) {
-
-       case (FPW)AMD_ID_LV160B:
-               info->flash_id += FLASH_AM160B;
-               info->sector_count = 35;
-               info->size = 0x00400000;
-               break;                          /* => 8 or 16 MB        */
-
-       default:
-               info->flash_id = FLASH_UNKNOWN;
-               info->sector_count = 0;
-               info->size = 0;
-               return (0);                     /* => no or unknown flash */
-       }
-
-       flash_get_offsets((ulong)addr, info);
-
-       return (info->size);
-}
-
-/*-----------------------------------------------------------------------
- */
-
-int    flash_erase (flash_info_t *info, int s_first, int s_last)
-{
-       FPWV *addr;
-       int flag, prot, sect;
-       ulong start, now, last;
-       FUNCPTR_WR absEntry;
-
-       load_cmd(IN_RAM_CMD_WRITE);
-       absEntry = (FUNCPTR_WR)FLASH_WRITE_CMD;
-
-       if ((s_first < 0) || (s_first > s_last)) {
-               if (info->flash_id == FLASH_UNKNOWN) {
-                       printf ("- missing\n");
-               } else {
-                       printf ("- no sectors to erase\n");
-               }
-               return 1;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case FLASH_AM160B:
-               break;
-       case FLASH_UNKNOWN:
-       default:
-               printf ("Can't erase unknown flash type %08lx - aborted\n",
-                       info->flash_id);
-               return 1;
-       }
-
-       prot = 0;
-       for (sect=s_first; sect<=s_last; ++sect) {
-               if (info->protect[sect]) {
-                       prot++;
-               }
-       }
-
-       if (prot) {
-               printf ("- Warning: %d protected sectors will not be erased!\n",
-                       prot);
-       } else {
-               printf ("\n");
-       }
-
-       last  = get_timer(0);
-
-       /* Start erase on unprotected sectors */
-       for (sect = s_first; sect<=s_last; sect++) {
-
-               if (info->protect[sect] != 0)   /* protected, skip it */
-                       continue;
-
-               /* Disable interrupts which might cause a timeout here */
-               flag = disable_interrupts();
-
-               addr = (FPWV *)(info->start[sect]);
-               absEntry(FLASH29_CMD_SECTOR, addr, 0);
-
-               /* re-enable interrupts if necessary */
-               if (flag)
-                       enable_interrupts();
-
-               start = get_timer(0);
-
-               while ((now = get_timer(start)) <= CONFIG_SYS_FLASH_ERASE_TOUT) {
-
-                       /* show that we're waiting */
-                       if ((get_timer(last)) > CONFIG_SYS_HZ) {/* every second */
-                               putc ('.');
-                               last = get_timer(0);
-                       }
-               }
-
-               flag = disable_interrupts();
-               absEntry(FLASH29_CMD_READ_RESET,0,0);
-               if (flag)
-                       enable_interrupts();
-       }
-
-       printf (" done\n");
-       return 0;
-}
-
-/*-----------------------------------------------------------------------
- * Copy memory to flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
-{
-    FPW data = 0; /* 16 or 32 bit word, matches flash bus width on MPC8XX */
-    int bytes;   /* number of bytes to program in current word         */
-    int left;    /* number of bytes left to program                    */
-    int i, res;
-
-    for (left = cnt, res = 0;
-        left > 0 && res == 0;
-        addr += sizeof(data), left -= sizeof(data) - bytes) {
-
-       bytes = addr & (sizeof(data) - 1);
-       addr &= ~(sizeof(data) - 1);
-
-       /* combine source and destination data so can program
-        * an entire word of 16 or 32 bits
-        */
-       for (i = 0; i < sizeof(data); i++) {
-           data <<= 8;
-           if (i < bytes || i - bytes >= left )
-               data += *((uchar *)addr + i);
-           else
-               data += *src++;
-       }
-
-       res = write_word(info, (FPWV *)addr, data);
-    }
-
-    return (res);
-}
-
-static int write_word (flash_info_t *info, FPWV *dest, FPW data)
-{
-    int res = 0;       /* result, assume success       */
-    FUNCPTR_WR absEntry;
-    int flag;
-
-    /* Check if Flash is (sufficiently) erased */
-    if ((*dest & data) != data) {
-       return (2);
-    }
-
-    if (info->start[0] != PHYS_FLASH_1)
-    {
-       return (3);
-    }
-
-    load_cmd(IN_RAM_CMD_WRITE);
-    absEntry = (FUNCPTR_WR)FLASH_WRITE_CMD;
-
-    flag = disable_interrupts();
-    absEntry(FLASH29_CMD_PROGRAM,dest,data);
-    if (flag) enable_interrupts();
-
-    udelay(100);
-
-    flag = disable_interrupts();
-    absEntry(FLASH29_CMD_READ_RESET,0,0);
-    if (flag) enable_interrupts();
-
-    return (res);
-}
diff --git a/board/purple/purple.c b/board/purple/purple.c
deleted file mode 100644 (file)
index 4e9e700..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 <common.h>
-#include <command.h>
-#include <netdev.h>
-#include <asm/inca-ip.h>
-#include <asm/regdef.h>
-#include <asm/mipsregs.h>
-#include <asm/io.h>
-#include <asm/addrspace.h>
-#include <asm/cacheops.h>
-#include <asm/reboot.h>
-
-#include "sconsole.h"
-
-#define cache_unroll(base,op)          \
-       __asm__ __volatile__("          \
-               .set noreorder;         \
-               .set mips3;             \
-               cache %1, (%0);         \
-               .set mips0;             \
-               .set reorder"           \
-               :                       \
-               : "r" (base),           \
-                 "i" (op));
-
-typedef void (*FUNCPTR)(ulong *source, ulong *destination, ulong nlongs);
-
-extern void    asc_serial_init         (void);
-extern void    asc_serial_putc         (char);
-extern void    asc_serial_puts         (const char *);
-extern int     asc_serial_getc         (void);
-extern int     asc_serial_tstc         (void);
-extern void    asc_serial_setbrg       (void);
-
-void _machine_restart(void)
-{
-       void (*f)(void) = (void *) 0xbfc00000;
-
-       f();
-}
-
-static void sdram_timing_init (ulong size)
-{
-       register uint pass;
-       register uint done;
-       register uint count;
-       register uint p0, p1, p2, p3, p4;
-       register uint addr;
-
-#define WRITE_MC_IOGP_1 *(uint *)0xbf800800 = (p1<<14)+(p2<<13)+(p4<<8)+(p0<<4)+p3;
-#define WRITE_MC_IOGP_2 *(uint *)0xbf800800 = (p1<<14)+(p2<<13)+((p4-16)<<8)+(p0<<4)+p3;
-
-       done = 0;
-       p0 = 2;
-       while (p0 < 4 && done == 0) {
-           p1 = 0;
-           while (p1 < 2 && done == 0) {
-               p2 = 0;
-               while (p2 < 2 && done == 0) {
-                   p3 = 0;
-                   while (p3 < 16 && done == 0) {
-                       count = 0;
-                       p4 = 0;
-                       while (p4 < 32 && done == 0) {
-                           WRITE_MC_IOGP_1;
-
-                           for (addr = CKSEG1 + 0x4000;
-                                addr < CKSEG1ADDR (size);
-                                addr = addr + 4) {
-                                       *(uint *) addr = 0xaa55aa55;
-                           }
-
-                           pass = 1;
-
-                           for (addr = CKSEG1 + 0x4000;
-                                addr < CKSEG1ADDR (size) && pass == 1;
-                                addr = addr + 4) {
-                                       if (*(uint *) addr != 0xaa55aa55)
-                                               pass = 0;
-                           }
-
-                           if (pass == 1) {
-                               count++;
-                           } else {
-                               count = 0;
-                           }
-
-                           if (count == 32) {
-                               WRITE_MC_IOGP_2;
-                               done = 1;
-                           }
-                           p4++;
-                       }
-                       p3++;
-                   }
-                   p2++;
-               }
-               p1++;
-           }
-           p0++;
-           if (p0 == 1)
-               p0++;
-       }
-}
-
-phys_size_t initdram(int board_type)
-{
-       /* The only supported number of SDRAM banks is 4.
-        */
-#define CONFIG_SYS_NB  4
-
-       ulong   cfgpb0  = *INCA_IP_SDRAM_MC_CFGPB0;
-       ulong   cfgdw   = *INCA_IP_SDRAM_MC_CFGDW;
-       int     cols    = cfgpb0 & 0xF;
-       int     rows    = (cfgpb0 & 0xF0) >> 4;
-       int     dw      = cfgdw & 0xF;
-       ulong   size    = (1 << (rows + cols)) * (1 << (dw - 1)) * CONFIG_SYS_NB;
-       void (*  sdram_init) (ulong);
-
-       sdram_init = (void (*)(ulong)) CKSEG0ADDR(&sdram_timing_init);
-
-       sdram_init(0x10000);
-
-       return size;
-}
-
-int checkboard (void)
-{
-
-       unsigned long chipid = *(unsigned long *)0xB800C800;
-
-       printf ("Board: Purple PLB 2800 chip version %ld, ", chipid & 0xF);
-
-       printf("CPU Speed %d MHz\n", CPU_CLOCK_RATE/1000000);
-
-       set_io_port_base(0);
-
-       return 0;
-}
-
-int misc_init_r (void)
-{
-       asc_serial_init ();
-
-       sconsole_putc   = asc_serial_putc;
-       sconsole_puts   = asc_serial_puts;
-       sconsole_getc   = asc_serial_getc;
-       sconsole_tstc   = asc_serial_tstc;
-       sconsole_setbrg = asc_serial_setbrg;
-
-       sconsole_flush ();
-       return (0);
-}
-
-/*******************************************************************************
-*
-* copydwords - copy one buffer to another a long at a time
-*
-* This routine copies the first <nlongs> longs from <source> to <destination>.
-*/
-static void copydwords (ulong *source, ulong *destination, ulong nlongs)
-{
-       ulong temp,temp1;
-       ulong *dstend = destination + nlongs;
-
-       while (destination < dstend) {
-               temp = *source++;
-               /* dummy read from sdram */
-               temp1 = *(ulong *)0xa0000000;
-               /* avoid optimization from compliler */
-               *(ulong *)0xbf0081f8 = temp1 + temp;
-               *destination++ = temp;
-
-       }
-}
-
-/*******************************************************************************
-*
-* copyLongs - copy one buffer to another a long at a time
-*
-* This routine copies the first <nlongs> longs from <source> to <destination>.
-*/
-static void copyLongs (ulong *source, ulong *destination, ulong nlongs)
-{
-       FUNCPTR absEntry;
-
-       absEntry = (FUNCPTR)(0xbf008000+((ulong)copydwords & 0x7));
-       absEntry(source, destination, nlongs);
-}
-
-/*******************************************************************************
-*
-* programLoad - load program into ram
-*
-* This routine load copydwords into ram
-*
-*/
-static void programLoad(void)
-{
-       FUNCPTR absEntry;
-       ulong *src,*dst;
-
-       src = (ulong *)(CONFIG_SYS_TEXT_BASE + 0x428);
-       dst = (ulong *)0xbf0081d0;
-
-       absEntry = (FUNCPTR)(CONFIG_SYS_TEXT_BASE + 0x400);
-       absEntry(src,dst,0x6);
-
-       src = (ulong *)((ulong)copydwords & 0xfffffff8);
-       dst = (ulong *)0xbf008000;
-
-       absEntry(src,dst,0x38);
-}
-
-/*******************************************************************************
-*
-* copy_code - copy u-boot image from flash to RAM
-*
-* This routine is needed to solve flash problems on this board
-*
-*/
-void copy_code (ulong dest_addr)
-{
-       extern long uboot_end_data;
-       unsigned long start;
-       unsigned long end;
-
-       /* load copydwords into ram
-        */
-       programLoad();
-
-       /* copy u-boot code
-        */
-       copyLongs((ulong *)CONFIG_SYS_MONITOR_BASE,
-                 (ulong *)dest_addr,
-                 ((ulong)&uboot_end_data - CONFIG_SYS_MONITOR_BASE + 3) / 4);
-
-
-       /* flush caches
-        */
-
-       start = CKSEG0;
-       end = start + CONFIG_SYS_DCACHE_SIZE;
-       while(start < end) {
-               cache_unroll(start,Index_Writeback_Inv_D);
-               start += CONFIG_SYS_CACHELINE_SIZE;
-       }
-
-       start = CKSEG0;
-       end = start + CONFIG_SYS_ICACHE_SIZE;
-       while(start < end) {
-               cache_unroll(start,Index_Invalidate_I);
-               start += CONFIG_SYS_CACHELINE_SIZE;
-       }
-}
-
-#ifdef CONFIG_PLB2800_ETHER
-int board_eth_init(bd_t *bis)
-{
-       return plb2800_eth_initialize(bis);
-}
-#endif
diff --git a/board/purple/sconsole.c b/board/purple/sconsole.c
deleted file mode 100644 (file)
index cd9d871..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2002
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 <config.h>
-#include <common.h>
-
-#include "sconsole.h"
-
-void   (*sconsole_putc) (char) = 0;
-void   (*sconsole_puts) (const char *) = 0;
-int    (*sconsole_getc) (void) = 0;
-int    (*sconsole_tstc) (void) = 0;
-void   (*sconsole_setbrg) (void) = 0;
-
-int serial_init (void)
-{
-       sconsole_buffer_t *sb = SCONSOLE_BUFFER;
-
-       sb->pos  = 0;
-       sb->size = 0;
-       sb->max_size = CONFIG_SYS_SCONSOLE_SIZE - sizeof (sconsole_buffer_t);
-
-       return (0);
-}
-
-void serial_putc (char c)
-{
-       if (sconsole_putc) {
-               (*sconsole_putc) (c);
-       } else {
-               sconsole_buffer_t *sb = SCONSOLE_BUFFER;
-
-               if (c) {
-                       sb->data[sb->pos++] = c;
-                       if (sb->pos == sb->max_size) {
-                               sb->pos = 0;
-                       }
-                       if (sb->size < sb->max_size) {
-                               sb->size++;
-                       }
-               }
-       }
-}
-
-void serial_puts (const char *s)
-{
-       if (sconsole_puts) {
-               (*sconsole_puts) (s);
-       } else {
-               sconsole_buffer_t *sb = SCONSOLE_BUFFER;
-
-               while (*s) {
-                       sb->data[sb->pos++] = *s++;
-                       if (sb->pos == sb->max_size) {
-                               sb->pos = 0;
-                       }
-                       if (sb->size < sb->max_size) {
-                               sb->size++;
-                       }
-               }
-       }
-}
-
-int serial_getc (void)
-{
-       if (sconsole_getc) {
-               return (*sconsole_getc) ();
-       } else {
-               return 0;
-       }
-}
-
-int serial_tstc (void)
-{
-       if (sconsole_tstc) {
-               return (*sconsole_tstc) ();
-       } else {
-               return 0;
-       }
-}
-
-void serial_setbrg (void)
-{
-       if (sconsole_setbrg) {
-               (*sconsole_setbrg) ();
-       }
-}
-
-void sconsole_flush (void)
-{
-       if (sconsole_putc) {
-               sconsole_buffer_t *sb = SCONSOLE_BUFFER;
-               unsigned int end = sb->pos < sb->size
-                               ? sb->pos + sb->max_size - sb->size
-                               : sb->pos - sb->size;
-
-               while (sb->size) {
-                       (*sconsole_putc) (sb->data[end++]);
-                       if (end == sb->max_size) {
-                               end = 0;
-                       }
-                       sb->size--;
-               }
-       }
-}
diff --git a/board/purple/u-boot.lds b/board/purple/u-boot.lds
deleted file mode 100644 (file)
index 719f268..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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
- */
-
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
-OUTPUT_ARCH(mips)
-ENTRY(_start)
-SECTIONS
-{
-       . = 0x00000000;
-
-       . = ALIGN(4);
-       .text       :
-       {
-         arch/mips/cpu/start.o         (.text)
-         board/purple/lowlevel_init.o  (.text)
-         . = DEFINED(env_offset) ? env_offset : .;
-         common/env_embedded.o (.ppcenv)
-
-         *(.text)
-       }
-
-       . = ALIGN(4);
-       .rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
-
-       . = ALIGN(4);
-       .data  : { *(.data) }
-
-       . = .;
-       _gp = ALIGN(16) + 0x7ff0;
-
-       .got : {
-         __got_start = .;
-         *(.got)
-         __got_end = .;
-       }
-
-       .sdata  : { *(.sdata) }
-
-       .u_boot_cmd : {
-         __u_boot_cmd_start = .;
-         *(.u_boot_cmd)
-         __u_boot_cmd_end = .;
-       }
-
-       uboot_end_data = .;
-       num_got_entries = (__got_end - __got_start) >> 2;
-
-       . = ALIGN(4);
-       .sbss (NOLOAD)  : { *(.sbss) }
-       .bss (NOLOAD)  : { *(.bss) . = ALIGN(4); }
-       uboot_end = .;
-}
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 60b3cbfaca2fd37d93e894c7e9ae5a8933da61e7..2fa085a3d9bf90698167952f0c514d41c82d6be9 100644 (file)
@@ -49,13 +49,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 7b790ab9fd570d961ea0a5caf6eadcf4782e388a..d943fb6de73860b15070fcfa27b593e0f7770e39 100644 (file)
@@ -58,13 +58,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index b36047ad5e8a5d4f7a982337e6c85846cdbe4724..a729c52626661f702b4409e11dfff2603f649c03 100644 (file)
@@ -74,13 +74,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    *(.got)
     _GOT2_TABLE_ = .;
-    *(.got2)
+    KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
-    *(.fixup)
+    KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 90cbcf25d4554b31447574d2a648ee06ce7f51c9..6f04c2f568cc81b687f549a6a6c4d67cb61cfe91 100644 (file)
@@ -28,5 +28,3 @@ CONFIG_SYS_TEXT_BASE = $(RAM_TEXT)
 else
 CONFIG_SYS_TEXT_BASE = 0
 endif
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot-nand.lds
index 841a29b60c85ee7ad4af1df52a01f30f34d623ea..e382fd1a1e667de44ba416e0f03337d6de51da74 100644 (file)
@@ -49,13 +49,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
index ab64fa88f2655916348963351f08d0e277fbc3f1..996ffe206da7bb31a7f3228c84b359709dfaa120 100644 (file)
@@ -7,37 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                       unsigned int ctrl_num)
-{
-       unsigned int i;
-
-       if (ctrl_num) {
-               printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
-               return;
-       }
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               get_spd(&(ctrl_dimms_spd[i]), SPD_EEPROM_ADDRESS);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index 7850794d64ff0f6339bc07c3bd4097e73421f73e..e9babc6477e87b154e2834139c89f37b42814508 100644 (file)
@@ -7,40 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
-}
-
-
-unsigned int
-fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-
-void
-fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index 23497f982587748d872b8b6ce2da4c7c69b67756..996ffe206da7bb31a7f3228c84b359709dfaa120 100644 (file)
@@ -7,45 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_bus_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-               }
-               if (ctrl_num == 0 && i == 1) {
-                       i2c_address = SPD_EEPROM_ADDRESS2;
-               }
-               if (ctrl_num == 1 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS3;
-               }
-               if (ctrl_num == 1 && i == 1) {
-                       i2c_address = SPD_EEPROM_ADDRESS4;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index 5c30b2676e4d573b13ea047c27a95a0e04520ef5..dd585412b4b8b5877edb901fbd2e6b8547868bf7 100644 (file)
@@ -273,12 +273,3 @@ void board_reset(void)
        __asm__ __volatile__ ("rfi");
 #endif
 }
-
-#ifdef CONFIG_MP
-extern void cpu_mp_lmb_reserve(struct lmb *lmb);
-
-void board_lmb_reserve(struct lmb *lmb)
-{
-       cpu_mp_lmb_reserve(lmb);
-}
-#endif
diff --git a/board/sc3/u-boot.lds b/board/sc3/u-boot.lds
deleted file mode 100644 (file)
index 2cbbca5..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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
- */
-
-OUTPUT_ARCH(powerpc)
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  .resetvec 0xFFFFFFFC :
-  {
-    *(.resetvec)
-  } = 0xffff
-
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within */
-    /* the sector layout of our flash chips!   XXX FIXME XXX   */
-
-    arch/powerpc/cpu/ppc4xx/start.o    (.text)
-    board/sc3/init.o   (.text)
-    arch/powerpc/cpu/ppc4xx/kgdb.o     (.text)
-    arch/powerpc/cpu/ppc4xx/traps.o    (.text)
-    arch/powerpc/cpu/ppc4xx/interrupts.o       (.text)
-    arch/powerpc/cpu/ppc4xx/4xx_uart.o (.text)
-    arch/powerpc/cpu/ppc4xx/cpu_init.o (.text)
-    arch/powerpc/cpu/ppc4xx/speed.o    (.text)
-    common/dlmalloc.o  (.text)
-    lib/crc32.o                (.text)
-    arch/powerpc/lib/extable.o (.text)
-    lib/zlib.o         (.text)
-
-/*    . = env_offset;*/
-/*    common/env_embedded.o(.text)*/
-
-    *(.text)
-    *(.got1)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata    :
-  {
-    *(.eh_frame)
-    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x00FF) & 0xFFFFFF00;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
-  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss (NOLOAD)       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-   . = ALIGN(4);
-  }
-  __bss_end__ = . ;
-  PROVIDE (end = .);
-}
index 725bef8293c1768643ee15c8bc09278513583da8..0e78e4fd477ce6ca1fb69f620b407a8b6776fc24 100644 (file)
@@ -56,13 +56,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 2711f2c4087d396b167e53008c0ecdcb0fc26a7e..02d198001fd5d368ee8bff736aa624fe99ced201 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 007ae00f46e89e9cf9caa579e428b3d03cac1763..9ab248a4e97f8ad12f2aefcb165360d217935c34 100644 (file)
@@ -50,13 +50,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 2b62b847054accf192d5fa77513cf3e9c70e98ec..e9db476f4831f187db64c1228759e3e3aa66b3f3 100644 (file)
@@ -7,37 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-
-       if (ctrl_num) {
-               printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
-               return;
-       }
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               get_spd(&(ctrl_dimms_spd[i]), SPD_EEPROM_ADDRESS);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 796c283b344cc56441b8874f0a3e36c059132fc7..950e1e6e2cb8af441c37015cab6392fc794ef77d 100644 (file)
@@ -57,13 +57,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 3f360dcf29ada5f7c2b1fd17ec413788876a0461..60b87b192016abe196532fedd57e53b5b3ff7b15 100644 (file)
@@ -30,7 +30,7 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)lib$(BOARD).o
 
 COBJS  := nhk8815.o
-SOBJS  := platform.o
+SOBJS  :=
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
index faef8109db84ce0757e8fb17085ba2d91297ced0..9b62011277a28b0abcf39d5ab0186ee3b45a5574 100644 (file)
@@ -82,13 +82,18 @@ int board_late_init(void)
 
 int dram_init(void)
 {
-       /* set dram bank start addr and size */
+       gd->ram_size = get_ram_size(CONFIG_SYS_SDRAM_BASE,
+                                   CONFIG_SYS_SDRAM_SIZE);
+       return 0;
+}
+
+void dram_init_banksize(void)
+{
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
        gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
-       return 0;
 }
 
 #ifdef CONFIG_CMD_NET
diff --git a/board/st/nhk8815/platform.S b/board/st/nhk8815/platform.S
deleted file mode 100644 (file)
index 2a67110..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Board specific setup info
- *
- * (C) Copyright 2005
- * STMicrolelctronics, <www.st.com>
- *
- * (C) Copyright 2004, ARM Ltd.
- * Philippe Robin, <philippe.robin@arm.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 <config.h>
-#include <version.h>
-
-.globl lowlevel_init
-lowlevel_init:
-       /* Jump to the flash address */
-       ldr r0, =CFG_ONENAND_BASE
-
-       /*
-        * Make it independent whether we boot from 0x0 or 0x30000000.
-        * Non-portable: it relies on the knowledge that ip has to be updated
-        */
-       orr ip, ip, r0  /* adjust return address of cpu_init_crit */
-       orr lr, lr, r0  /* adjust return address */
-       orr pc, pc, r0  /* jump to the normal address */
-       nop
-
-       /* Initialize PLL, Remap clear, FSMC, MPMC here! */
-       /* What about GPIO, CLCD and UART */
-
-       /* PLL Initialization */
-       /* Prog the PLL1 @ 266 MHz ==> SDRAM Clock = 100.8 MHz */
-       ldr r0, =NOMADIK_SRC_BASE
-
-       ldr r1, =0x2B013502
-
-       str r1, [r0, #0x14]
-
-       /* Used to set all the timers clock to 2.4MHZ */
-       ldr r1, =0x2AAAA004
-       str r1, [r0]
-
-       ldr r1, =0x10000000
-       str r1, [r0, #0x10]
-
-       /* FSMC setup ---- */
-       ldr r0, =NOMADIK_FSMC_BASE
-
-       ldr r1, =0x10DB         /* For 16-bit NOR flash */
-       str r1, [r0, #0x08]
-
-       ldr r1, =0x03333333     /* For 16-bit NOR flash */
-       str r1, [r0, #0xc]
-
-       /* oneNAND setting */
-       ldr r1, =0x0000105B     /* BCR0 Prog control register */
-       str r1, [r0]
-
-       ldr r1, =0x0A200551     /* BTR0 Prog timing register */
-       str r1, [r0, #0x04]
-
-       /* preload the instructions into icache */
-       add r0, pc, #0x1F
-       bic r0, r0, #0x1F
-       mcr p15, 0, r0, c7, c13, 1
-       add r0, r0, #0x20
-       mcr p15, 0, r0, c7, c13, 1
-
-       /* Now Clear Remap */
-       ldr r0, =NOMADIK_SRC_BASE
-
-       ldr r1, =0x2004
-       str r1, [r0]
-
-       ldr r1, =0x10000000
-       str r1, [r0, #0x10]
-
-       ldr r0, =0x101E9000
-       ldr r1, =0x2004
-       str r1, [r0]
-
-       ldr r0, =NOMADIK_SRC_BASE
-       ldr r1, =0x2104
-       str r1, [r0]
-
-       /* FSMC setup -- */
-       mov r0, #(NOMADIK_FSMC_BASE & 0x10000000)
-       orr r0, r0, #(NOMADIK_FSMC_BASE & 0x0FFFFFFF)
-
-       ldr r1, =0x10DB         /* For 16-bit NOR flash */
-       str r1, [r0, #0x8]
-
-       ldr r1, =0x03333333     /* For 16-bit NOR flash */
-       str r1, [r0, #0xc]
-
-       /* MPMC Setup */
-       ldr r0, =NOMADIK_MPMC_BASE
-
-       ldr r1, =0xF00003
-       str r1, [r0]            /* Enable the MPMC and the DLL */
-
-       ldr r1, =0x183
-       str r1, [r0, #0x20]
-
-       ldr r2, =NOMADIK_PMU_BASE
-
-       ldr r1, =0x1111
-       str r1, [r2]
-
-       ldr r1, =0x1111         /* Prog the, mand delay strategy */
-       str r1, [r0, #0x28]
-
-       ldr r1, =0x103          /* NOP ,mand */
-       str r1, [r0, #0x20]
-
-       /* FIXME -- Wait required here */
-
-       ldr r1, =0x103          /* PALL ,mand*/
-       str r1, [r0, #0x20]
-
-       ldr r1, =0x1
-       str r1, [r0, #0x24]     /* To do at least two auto-refresh */
-
-       /* FIXME -- Wait required here */
-
-       /* Auto-refresh period = 7.8us @ SDRAM Clock = 100.8 MHz */
-       ldr r1, =0x31
-       str r1, [r0, #0x24]
-
-       /* Prog Little Endian, Not defined in 8800 board */
-       ldr r1, =0x0
-       str r1, [r0, #0x8]
-
-
-       ldr r1, =0x2
-       str r1, [r0, #0x30]             /* Prog tRP timing */
-
-       ldr r1, =0x4                    /* Change for 8815 */
-       str r1, [r0, #0x34]             /* Prog tRAS timing */
-
-       ldr r1, =0xB
-       str r1, [r0, #0x38]             /* Prog tSREX timing */
-
-
-       ldr r1, =0x1
-       str r1, [r0, #0x44]             /* Prog tWR timing */
-
-       ldr r1, =0x8
-       str r1, [r0, #0x48]             /* Prog tRC timing */
-
-       ldr r1, =0xA
-       str r1, [r0, #0x4C]             /* Prog tRFC timing */
-
-       ldr r1, =0xB
-       str r1, [r0, #0x50]             /* Prog tXSR timing */
-
-       ldr r1, =0x1
-       str r1, [r0, #0x54]             /* Prog tRRD timing */
-
-       ldr r1, =0x1
-       str r1, [r0, #0x58]             /* Prog tMRD timing */
-
-       ldr r1, =0x1
-       str r1, [r0, #0x5C]             /* Prog tCDLR timing */
-
-       /* DDR-SDRAM MEMORY IS ON BANK0 8815 */
-       ldr r1, =0x304                  /* Prog RAS and CAS for CS 0 */
-       str r1, [r0, #0x104]
-
-       /* SDR-SDRAM MEMORY IS ON BANK1 8815 */
-       ldr r1, =0x304                  /* Prog RAS and CAS for CS 1 */
-       str r1, [r0, #0x124]
-       /* THE DATA BUS WIDE IS PROGRAM FOR 16-BITS */
-       /* DDR-SDRAM MEMORY IS ON BANK0*/
-
-       ldr r1, =0x884                  /* 8815 : config reg in BRC for CS0 */
-       str r1, [r0, #0x100]
-
-       /*SDR-SDRAM MEMORY IS ON BANK1*/
-
-       ldr r1, =0x884                  /* 8815 : config reg in BRC for CS1 */
-       str r1, [r0, #0x120]
-
-       ldr r1, =0x83                   /*MODE Mand*/
-       str r1, [r0, #0x20]
-
-       /* LOAD MODE REGISTER FOR 2 bursts of 16b, with DDR mem ON BANK0 */
-
-       ldr r1, =0x62000                        /*Data in*/
-       ldr r1, [r1]
-
-       /* LOAD MODE REGISTER FOR 2 bursts of 16b, with DDR mem ON BANK1 */
-
-       ldr r1, =0x8062000
-       ldr r1, [r1]
-
-       ldr r1, =0x003
-       str r1, [r0, #0x20]
-
-       /* ENABLE ALL THE BUFFER FOR EACH AHB PORT*/
-
-       ldr r1, =0x01                   /* Enable buffer 0 */
-       str r1, [r0, #0x400]
-
-       ldr r1, =0x01                   /* Enable buffer 1 */
-       str r1, [r0, #0x420]
-
-       ldr r1, =0x01                   /* Enable buffer 2 */
-       str r1, [r0, #0x440]
-
-       ldr r1, =0x01                   /* Enable buffer 3 */
-       str r1, [r0, #0x460]
-
-       ldr r1, =0x01                   /* Enable buffer 4 */
-       str r1, [r0, #0x480]
-
-       ldr r1, =0x01                   /* Enable buffer 5 */
-       str r1, [r0, #0x4A0]
-
-       /* GPIO settings */
-
-       ldr r0, =NOMADIK_GPIO1_BASE
-
-       ldr r1, =0xC0600000
-       str r1, [r0, #0x20]
-
-       ldr r1, =0x3F9FFFFF             /* ABHI change this for uart1 */
-       str r1, [r0, #0x24]
-
-       ldr r1, =0x3F9FFFFF             /* ABHI change this for uart1 */
-       str r1, [r0, #0x28]
-
-       ldr r0, =NOMADIK_GPIO0_BASE
-
-       ldr r1, =0xFFFFFFFF
-       str r1, [r0, #0x20]
-
-       ldr r1, =0x00
-       str r1, [r0, #0x24]
-
-       ldr r1, =0x00
-       str r1, [r0, #0x28]
-
-       /* Configure CPLD_CTRL register for enabling MUX logic for UART0/UART2 */
-
-       ldr r0, =NOMADIK_FSMC_BASE
-
-       ldr r1, =0x10DB                 /* INIT FSMC bank 0 */
-       str r1, [r0, #0x00]
-
-       ldr r1, =0x0FFFFFFF
-       str r1, [r0, #0x04]
-
-       ldr r1, =0x010DB                /* INIT FSMC bank 1 */
-       str r1, [r0, #0x08]
-
-       ldr r1, =0x00FFFFFFF
-       str r1, [r0, #0x0C]
-
-       ldr r0, =NOMADIK_UART0_BASE
-
-       ldr r1, =0x00000000
-       str r1, [r0, #0x30]
-
-       ldr r1, =0x0000004e
-       str r1, [r0, #0x24]
-
-       ldr r1, =0x00000008
-       str r1, [r0, #0x28]
-
-       ldr r1, =0x00000060
-       str r1, [r0, #0x2C]
-
-       ldr r1, =0x00000301
-       str r1, [r0, #0x30]
-
-       ldr r1, =0x00000066
-       str r1, [r0]
-
-       ldr r0, =NOMADIK_UART1_BASE
-
-       ldr r1, =0x00000000
-       str r1, [r0, #0x30]
-
-       ldr r1, =0x0000004e
-       str r1, [r0, #0x24]
-
-       ldr r1, =0x00000008
-       str r1, [r0, #0x28]
-
-       ldr r1, =0x00000060
-       str r1, [r0, #0x2C]
-
-       ldr r1, =0x00000301
-       str r1, [r0, #0x30]
-
-       ldr r1, =0x00000066
-       str r1, [r0]
-
-       ldr r0, =NOMADIK_UART2_BASE
-
-       ldr r1, =0x00000000
-       str r1, [r0, #0x30]
-
-       ldr r1, =0x0000004e
-       str r1, [r0, #0x24]
-
-       ldr r1, =0x00000008
-       str r1, [r0, #0x28]
-
-       ldr r1, =0x00000060
-       str r1, [r0, #0x2C]
-
-       ldr r1, =0x00000301
-       str r1, [r0, #0x30]
-
-       ldr r1, =0x00000066
-       str r1, [r0]
-
-       /* Configure CPLD to enable UART0 */
-
-       mov pc, lr
index 93d1100717f8fe5216574c9ccfca3bd05074a993..571137443ebd4d12a3b7239f6d044533df451dcc 100644 (file)
@@ -7,40 +7,10 @@
  */
 
 #include <common.h>
-#include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
-}
-
-
-unsigned int
-fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-
-void
-fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index 93d1100717f8fe5216574c9ccfca3bd05074a993..56c87b2fc6b12bbf2578cca6be167eb582487ad9 100644 (file)
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
-{
-       i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
-}
-
-
-unsigned int
-fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-
-void
-fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS;
-               }
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index b7b6c1aa14aeb286ad40d92c46a264f40a1225f1..a949e4f59201a000a805c9ae0746ca767246344d 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index c4ce968735c403dbd303e6288585c14a793d5b08..c65f0228c3fd6f8e86b5e4164ced2476a9383d59 100644 (file)
@@ -63,13 +63,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 9a54dbfb86fce39e840723329dfb219b4fa7a7c1..799a6828ac015f700d70e7b8c72426e936ead30e 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf518-0.0
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
-
-# Set some default LDR flags based on boot mode.
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index c5d45c7db7f96787a1fa11501c0316cd83669644..c0cb9ffc41e1dab3ab1d37e59cd7a625b2c3cd18 100644 (file)
 # MA 02111-1307 USA
 #
 
-# This is not actually used for Blackfin boards so do not change it
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
-CONFIG_BFIN_CPU = bf537-0.2
-
 CFLAGS_lib += -O2
 CFLAGS_lib/lzma += -O2
 
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
-LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
diff --git a/board/ti/am3517crane/Makefile b/board/ti/am3517crane/Makefile
new file mode 100644 (file)
index 0000000..1fe2bca
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Author: Srinath R <srinath@mistralsolutions.com>
+#
+# Based on logicpd/am3517evm/Makefile
+#
+# Copyright (C) 2011 Mistral Solutions Pvt 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.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS  := am3517crane.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
+
+clean:
+       rm -f $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/ti/am3517crane/am3517crane.c b/board/ti/am3517crane/am3517crane.c
new file mode 100644 (file)
index 0000000..d007044
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * am3517crane.c - board file for AM3517 CraneBoard
+ *
+ * Author: Srinath.R <srinath@mistralsolutions.com>
+ *
+ * Based on logicpd/am3517evm/am3517evm.c
+ *
+ * Copyright (C) 2011 Mistral Solutions Pvt 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.
+ *
+ * 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 <common.h>
+#include <asm/io.h>
+#include <asm/arch/mem.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/mach-types.h>
+#include <i2c.h>
+#include "am3517crane.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Routine: board_init
+ * Description: Early hardware init.
+ */
+int board_init(void)
+{
+       gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+       /* board id for Linux */
+       gd->bd->bi_arch_number = MACH_TYPE_CRANEBOARD;
+       /* boot param addr */
+       gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
+
+       return 0;
+}
+
+/*
+ * Routine: misc_init_r
+ * Description: Init i2c, ethernet, etc... (done here so udelay works)
+ */
+int misc_init_r(void)
+{
+#ifdef CONFIG_DRIVER_OMAP34XX_I2C
+       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
+
+       dieid_num_r();
+
+       return 0;
+}
+
+/*
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ *             hardware. Many pins need to be moved from protect to primary
+ *             mode.
+ */
+void set_muxconf_regs(void)
+{
+       MUX_AM3517CRANE();
+}
diff --git a/board/ti/am3517crane/am3517crane.h b/board/ti/am3517crane/am3517crane.h
new file mode 100644 (file)
index 0000000..41db972
--- /dev/null
@@ -0,0 +1,395 @@
+/*
+ * am3517crane.h - Header file for the AM3517 CraneBoard.
+ *
+ * Author: Srinath R <srinath@mistralsolutions.com>
+ *
+ * Based on logicpd/am3517evm/am3517evm.h
+ *
+ * Copyright (C) 2011 Mistral Solutions Pvt 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.
+ *
+ * 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.
+ */
+
+#ifndef _AM3517CRANE_H_
+#define _AM3517CRANE_H_
+
+const omap3_sysinfo sysinfo = {
+       DDR_DISCRETE,
+       "CraneBoard",
+       "NAND",
+};
+/* AM3517 specific mux configuration */
+#define CONTROL_PADCONF_SYS_NRESWARM   0x0A08
+/* CCDC */
+#define CONTROL_PADCONF_CCDC_PCLK      0x01E4
+#define CONTROL_PADCONF_CCDC_FIELD     0x01E6
+#define CONTROL_PADCONF_CCDC_HD                0x01E8
+#define CONTROL_PADCONF_CCDC_VD                0x01EA
+#define CONTROL_PADCONF_CCDC_WEN       0x01EC
+#define CONTROL_PADCONF_CCDC_DATA0     0x01EE
+#define CONTROL_PADCONF_CCDC_DATA1     0x01F0
+#define CONTROL_PADCONF_CCDC_DATA2     0x01F2
+#define CONTROL_PADCONF_CCDC_DATA3     0x01F4
+#define CONTROL_PADCONF_CCDC_DATA4     0x01F6
+#define CONTROL_PADCONF_CCDC_DATA5     0x01F8
+#define CONTROL_PADCONF_CCDC_DATA6     0x01FA
+#define CONTROL_PADCONF_CCDC_DATA7     0x01FC
+/* RMII */
+#define CONTROL_PADCONF_RMII_MDIO_DATA 0x01FE
+#define CONTROL_PADCONF_RMII_MDIO_CLK  0x0200
+#define CONTROL_PADCONF_RMII_RXD0      0x0202
+#define CONTROL_PADCONF_RMII_RXD1      0x0204
+#define CONTROL_PADCONF_RMII_CRS_DV    0x0206
+#define CONTROL_PADCONF_RMII_RXER      0x0208
+#define CONTROL_PADCONF_RMII_TXD0      0x020A
+#define CONTROL_PADCONF_RMII_TXD1      0x020C
+#define CONTROL_PADCONF_RMII_TXEN      0x020E
+#define CONTROL_PADCONF_RMII_50MHZ_CLK 0x0210
+#define CONTROL_PADCONF_USB0_DRVBUS    0x0212
+/* CAN */
+#define CONTROL_PADCONF_HECC1_TXD      0x0214
+#define CONTROL_PADCONF_HECC1_RXD      0x0216
+#define CONTROL_PADCONF_SYS_BOOT7      0x0218
+#define CONTROL_PADCONF_SDRC_DQS0N     0x021A
+#define CONTROL_PADCONF_SDRC_DQS1N     0x021C
+#define CONTROL_PADCONF_SDRC_DQS2N     0x021E
+#define CONTROL_PADCONF_SDRC_DQS3N     0x0220
+#define CONTROL_PADCONF_STRBEN_DLY0    0x0222
+#define CONTROL_PADCONF_STRBEN_DLY1    0x0224
+#define CONTROL_PADCONF_SYS_BOOT8      0x0226
+
+/*
+ * IEN  - Input Enable
+ * IDIS - Input Disable
+ * PTD  - Pull type Down
+ * PTU  - Pull type Up
+ * DIS  - Pull type selection is inactive
+ * EN   - Pull type selection is active
+ * M0   - Mode 0
+ * The commented string gives the final mux configuration for that pin
+ */
+#define MUX_AM3517CRANE()\
+       /*SDRC*/\
+       MUX_VAL(CP(SDRC_D0),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D1),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D2),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D3),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D4),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D5),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D6),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D7),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D8),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D9),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D10),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D11),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D12),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D13),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D14),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D15),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D16),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D17),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D18),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D19),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D20),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D21),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D22),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D23),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D24),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D25),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D26),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D27),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D28),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D29),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D30),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_D31),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_CLK),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_DQS0),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_CKE0),  (M0))\
+       MUX_VAL(CP(SDRC_DQS1),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_DQS2),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_DQS3),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SDRC_DQS0N), (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(SDRC_DQS1N), (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(SDRC_DQS2N), (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(SDRC_DQS3N), (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(SDRC_CKE0),  (M0))\
+       MUX_VAL(CP(SDRC_CKE1),  (M0))\
+       /*sdrc_strben_dly0*/\
+       MUX_VAL(CP(STRBEN_DLY0),    (IEN  | PTD | EN  | M0))\
+       /*sdrc_strben_dly1*/\
+       MUX_VAL(CP(STRBEN_DLY1),        (IEN  | PTD | EN  | M0))\
+       /*GPMC*/\
+       MUX_VAL(CP(GPMC_A1),    (M7))\
+       MUX_VAL(CP(GPMC_A2),    (IDIS | PTU | DIS | M4))\
+       MUX_VAL(CP(GPMC_A3),    (IDIS | PTU | EN  | M4))\
+       MUX_VAL(CP(GPMC_A4),    (IDIS | PTU | EN  | M4))\
+       MUX_VAL(CP(GPMC_A5),    (IDIS | PTU | EN  | M4))\
+       MUX_VAL(CP(GPMC_A6),    (M7))\
+       MUX_VAL(CP(GPMC_A7),    (IDIS | PTU | EN  | M4))\
+       MUX_VAL(CP(GPMC_A8),    (IEN  | PTU | EN  | M4))\
+       MUX_VAL(CP(GPMC_A9),    (M7))\
+       MUX_VAL(CP(GPMC_A10),   (M7))\
+       MUX_VAL(CP(GPMC_D0),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D1),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D2),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D3),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D4),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D5),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D6),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D7),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D8),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D9),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D10),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D11),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D12),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D13),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D14),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_D15),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_NCS0),  (IDIS | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_NCS1),  (IDIS | PTU | EN  | M4))\
+       MUX_VAL(CP(GPMC_NCS2),  (M7))\
+       MUX_VAL(CP(GPMC_NCS3),  (M7))\
+       MUX_VAL(CP(GPMC_NCS4),  (M7))\
+       MUX_VAL(CP(GPMC_NCS5),  (M7))\
+       MUX_VAL(CP(GPMC_NCS6),  (M7))\
+       MUX_VAL(CP(GPMC_NCS7),  (M7))\
+       MUX_VAL(CP(GPMC_CLK),   (IDIS | PTU | EN  | M0))/*TP*/\
+       MUX_VAL(CP(GPMC_NADV_ALE),      (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(GPMC_NOE),   (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(GPMC_NWE),   (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(GPMC_NBE0_CLE),      (IDIS | PTU | EN  | M0))\
+       MUX_VAL(CP(GPMC_NBE1),  (M7))\
+       MUX_VAL(CP(GPMC_NWP),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(GPMC_WAIT0), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(GPMC_WAIT1), (M7))\
+       MUX_VAL(CP(GPMC_WAIT2), (M7))\
+       MUX_VAL(CP(GPMC_WAIT3), (IDIS | PTU | EN  | M4))/*GPIO_65*/\
+       /*DSS*/\
+       MUX_VAL(CP(DSS_PCLK),   (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_HSYNC),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_VSYNC),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_ACBIAS), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA0),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA1),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA2),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA3),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA4),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA5),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA6),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA7),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA8),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA9),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA10), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA11), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA12), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA13), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA14), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA15), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA16), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA17), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA18), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA19), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA20), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA21), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA22), (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA23), (IDIS | PTD | DIS | M0))\
+       /*MMC1*/\
+       MUX_VAL(CP(MMC1_CLK),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(MMC1_CMD),   (IEN  | PTU | DIS | M0))\
+       MUX_VAL(CP(MMC1_DAT0),  (IEN  | PTU | DIS | M0))\
+       MUX_VAL(CP(MMC1_DAT1),  (IEN  | PTU | DIS | M0))\
+       MUX_VAL(CP(MMC1_DAT2),  (IEN  | PTU | DIS | M0))\
+       MUX_VAL(CP(MMC1_DAT3),  (IEN  | PTU | DIS | M0))\
+       MUX_VAL(CP(MMC1_DAT4),  (IEN  | PTU | DIS | M0))\
+       MUX_VAL(CP(MMC1_DAT5),  (IEN  | PTU | DIS | M0))\
+       MUX_VAL(CP(MMC1_DAT6),  (IEN  | PTU | DIS | M0))\
+       MUX_VAL(CP(MMC1_DAT7),  (IEN  | PTU | DIS | M0))\
+       /*MMC2*/\
+       MUX_VAL(CP(MMC2_CLK),   (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(MMC2_CMD),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MMC2_DAT0),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MMC2_DAT1),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MMC2_DAT2),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MMC2_DAT3),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MMC2_DAT4),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MMC2_DAT5),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MMC2_DAT6),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MMC2_DAT7),  (IEN  | PTD | DIS | M0))\
+       /*McBSP*/\
+       MUX_VAL(CP(MCBSP_CLKS), (IEN  | PTU | DIS | M0))\
+       MUX_VAL(CP(MCBSP1_CLKR),        (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MCBSP1_FSR), (IDIS | PTU | EN  | M0))\
+       MUX_VAL(CP(MCBSP1_DX),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(MCBSP1_DR),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MCBSP1_FSX), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MCBSP1_CLKX),        (IEN  | PTD | DIS | M0))\
+       \
+       MUX_VAL(CP(MCBSP2_FSX), (M7))\
+       MUX_VAL(CP(MCBSP2_CLKX),        (M7))\
+       MUX_VAL(CP(MCBSP2_DR),  (M7))\
+       MUX_VAL(CP(MCBSP2_DX),  (M7))\
+       \
+       MUX_VAL(CP(MCBSP3_DX),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(MCBSP3_DR),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MCBSP3_CLKX),        (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(MCBSP3_FSX), (IEN  | PTD | DIS | M0))\
+       \
+       MUX_VAL(CP(MCBSP4_CLKX),        (M7))\
+       MUX_VAL(CP(MCBSP4_DR),  (M7))\
+       MUX_VAL(CP(MCBSP4_DX),  (M7))\
+       MUX_VAL(CP(MCBSP4_FSX), (M7))\
+       /*UART*/\
+       MUX_VAL(CP(UART1_TX),   (M7))\
+       MUX_VAL(CP(UART1_RTS),  (M7))\
+       MUX_VAL(CP(UART1_CTS),  (M7))\
+       MUX_VAL(CP(UART1_RX),   (M7))\
+       \
+       MUX_VAL(CP(UART2_CTS),  (M7))\
+       MUX_VAL(CP(UART2_RTS),  (M7))\
+       MUX_VAL(CP(UART2_TX),   (M7))\
+       MUX_VAL(CP(UART2_RX),   (M7))\
+       \
+       MUX_VAL(CP(UART3_CTS_RCTX),     (IEN  | PTU | DIS | M0))\
+       MUX_VAL(CP(UART3_RTS_SD),       (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(UART3_RX_IRRX),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(UART3_TX_IRTX),      (IDIS | PTD | DIS | M0))\
+       /*I2C 1, 2, 3*/\
+       MUX_VAL(CP(I2C1_SCL),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(I2C1_SDA),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(I2C2_SCL),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(I2C2_SDA),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(I2C3_SCL),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(I2C3_SDA),   (IEN  | PTU | EN  | M0))\
+       /*McSPI*/\
+       MUX_VAL(CP(MCSPI1_CLK), (IEN  | PTU | EN  | M4))/*GPIO_171 TP*/\
+       MUX_VAL(CP(MCSPI1_SIMO),    (IEN  | PTU | EN  | M4))/*GPIO_172 TP*/\
+       MUX_VAL(CP(MCSPI1_SOMI),        (IEN  | PTU | EN  | M4))/*GPIO_173 TP*/\
+       MUX_VAL(CP(MCSPI1_CS0), (IEN  | PTU | EN  | M4))/*GPIO_174 TP*/\
+       MUX_VAL(CP(MCSPI1_CS1), (IEN  | PTU | EN  | M4))/*GPIO_175 TP*/\
+       MUX_VAL(CP(MCSPI1_CS2), (IEN  | PTU | EN  | M4))/*GPIO_176 TP*/\
+       MUX_VAL(CP(MCSPI1_CS3), (IEN  | PTD | EN  | M4))/*GPIO_176 TP*/\
+       \
+       MUX_VAL(CP(MCSPI2_CLK), (M7))\
+       MUX_VAL(CP(MCSPI2_SIMO),    (M7))\
+       MUX_VAL(CP(MCSPI2_SOMI),        (M7))\
+       MUX_VAL(CP(MCSPI2_CS0), (M7))\
+       MUX_VAL(CP(MCSPI2_CS1), (M7))\
+       /*CCDC*/\
+       MUX_VAL(CP(CCDC_PCLK),  (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(CCDC_FIELD), (IEN  | PTD | DIS | M1))/*CCDC_DATA8*/\
+       MUX_VAL(CP(CCDC_HD),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(CCDC_VD),    (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(CCDC_WEN),   (IEN  | PTD | DIS | M1))/*CCDC_DATA9 */\
+       MUX_VAL(CP(CCDC_DATA0), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(CCDC_DATA1), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(CCDC_DATA2), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(CCDC_DATA3), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(CCDC_DATA4), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(CCDC_DATA5), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(CCDC_DATA6), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(CCDC_DATA7), (IEN  | PTD | DIS | M0))\
+       /*RMII*/\
+       MUX_VAL(CP(RMII_MDIO_DATA),     (IEN  |  M0))\
+       MUX_VAL(CP(RMII_MDIO_CLK),      (M0))\
+       MUX_VAL(CP(RMII_RXD0),  (IEN  | PTD | M0))\
+       MUX_VAL(CP(RMII_RXD1),  (IEN  | PTD | M0))\
+       MUX_VAL(CP(RMII_CRS_DV),        (IEN  | PTD | M0))\
+       MUX_VAL(CP(RMII_RXER),  (PTD  | M0))\
+       MUX_VAL(CP(RMII_TXD0),  (PTD  | M0))\
+       MUX_VAL(CP(RMII_TXD1),  (PTD  | M0))\
+       MUX_VAL(CP(RMII_TXEN),  (PTD  | M0))\
+       MUX_VAL(CP(RMII_50MHZ_CLK),     (IEN  | PTD | EN  | M0))\
+       /*HECC*/\
+       MUX_VAL(CP(HECC1_TXD),  (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(HECC1_RXD),  (IEN  | PTU | EN  | M0))\
+       /*HSUSB*/\
+       MUX_VAL(CP(USB0_DRVBUS),        (IEN  | PTD | EN  | M0))\
+       /*HDQ*/\
+       MUX_VAL(CP(HDQ_SIO),    (IEN  | PTU | EN  | M4))\
+       /*Control and debug*/\
+       MUX_VAL(CP(SYS_32K),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SYS_CLKREQ), (IEN  | PTD | DIS | M4))/*GPIO_1 TPS_SLEEP*/\
+       MUX_VAL(CP(SYS_NIRQ),   (IEN  | PTU | EN  | M0))\
+       /*SYS_nRESWARM*/\
+       MUX_VAL(CP(SYS_NRESWARM),       (IEN | PTU | EN | M0))/*GPIO_30 ToExp*/\
+       MUX_VAL(CP(SYS_BOOT1),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SYS_BOOT2),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SYS_BOOT3),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SYS_BOOT4),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SYS_BOOT5),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(SYS_BOOT6),  (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(SYS_BOOT7),  (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(SYS_BOOT8),  (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(SYS_CLKOUT1),    (IEN  | PTD | DIS | M4))/*GPIO_10 TP*/\
+       MUX_VAL(CP(SYS_CLKOUT2),        (IEN  | PTU | EN  | M0))\
+       /*JTAG*/\
+       MUX_VAL(CP(JTAG_nTRST), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(JTAG_TCK),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(JTAG_TMS),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(JTAG_TDI),   (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(JTAG_EMU0),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(JTAG_EMU1),  (IEN  | PTD | DIS | M0))\
+       /*ETK (ES2 onwards)*/\
+       MUX_VAL(CP(ETK_CLK_ES2),    (IEN  | PTU | EN  | M3))\
+       MUX_VAL(CP(ETK_CTL_ES2),        (IDIS | PTD | DIS | M3))\
+       MUX_VAL(CP(ETK_D0_ES2), (IEN  | PTD | DIS | M3))\
+       MUX_VAL(CP(ETK_D1_ES2), (IEN  | PTD | DIS | M3))\
+       MUX_VAL(CP(ETK_D2_ES2), (IEN  | PTD | EN  | M3))\
+       MUX_VAL(CP(ETK_D3_ES2), (IEN  | PTD | DIS | M3))\
+       MUX_VAL(CP(ETK_D4_ES2), (IEN  | PTD | DIS | M3))\
+       MUX_VAL(CP(ETK_D5_ES2), (IEN  | PTD | DIS | M3))\
+       MUX_VAL(CP(ETK_D6_ES2), (IEN  | PTD | DIS | M3))\
+       MUX_VAL(CP(ETK_D7_ES2), (IEN  | PTD | DIS | M3))\
+       MUX_VAL(CP(ETK_D8_ES2), (IEN  | PTD | DIS | M3))\
+       MUX_VAL(CP(ETK_D9_ES2), (IEN  | PTD | DIS | M3))\
+       MUX_VAL(CP(ETK_D10_ES2),    (M7))\
+       MUX_VAL(CP(ETK_D11_ES2),    (M7))\
+       MUX_VAL(CP(ETK_D12_ES2),    (M7))\
+       MUX_VAL(CP(ETK_D13_ES2),    (M7))\
+       MUX_VAL(CP(ETK_D14_ES2),    (M7))\
+       MUX_VAL(CP(ETK_D15_ES2),        (M7))\
+       /*Die to Die*/\
+       MUX_VAL(CP(D2D_MCAD34), (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(D2D_MCAD35), (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(D2D_MCAD36), (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(D2D_CLK26MI),        (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_NRESPWRON),  (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(D2D_NRESWARM),   (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(D2D_ARM9NIRQ),       (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_UMA2P6FIQ),      (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_SPINT),  (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(D2D_FRINT),  (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(D2D_DMAREQ0),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_DMAREQ1),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_DMAREQ2),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_DMAREQ3),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_N3GTRST),        (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_N3GTDI), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_N3GTDO), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_N3GTMS), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_N3GTCK), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_N3GRTCK),        (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_MSTDBY), (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(D2D_SWAKEUP),    (IEN  | PTD | EN  | M0))\
+       MUX_VAL(CP(D2D_IDLEREQ),    (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_IDLEACK),        (IEN  | PTU | EN  | M0))\
+       MUX_VAL(CP(D2D_MWRITE), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_SWRITE), (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_MREAD),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_SREAD),  (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_MBUSFLAG),       (IEN  | PTD | DIS | M0))\
+       MUX_VAL(CP(D2D_SBUSFLAG),       (IEN  | PTD | DIS | M0))\
+
+#endif /* _AM3517CRANE_H_ */
diff --git a/board/ti/am3517crane/config.mk b/board/ti/am3517crane/config.mk
new file mode 100644 (file)
index 0000000..c6a18b5
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# Author: Srinath R <srinath@mistralsolutions.com>
+#
+# Based on logicpd/am3517evm/config.mk
+#
+# Copyright (C) 2011 Mistral Solutions Pvt 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.
+#
+# 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.
+#
+# Physical Address:
+# 8000'0000 (bank0)
+# A000/0000 (bank1)
+# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
+# (mem base + reserved)
+
+# For use with external or internal boots.
+CONFIG_SYS_TEXT_BASE = 0x80008000
index 3b4aaace231bc802a673fa82c4ea3441ff2024f1..d9f445f000875d4545cbedc8d0a98e86dfb63d32 100644 (file)
@@ -25,8 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).o
 
-COBJS  := beagle.o
+COBJS-y        := $(BOARD).o
+COBJS-$(CONFIG_STATUS_LED) += led.o
 
+COBJS  := $(sort $(COBJS-y))
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 
index c066d6ef52ba6ed7cd26babba65b6ff2c3784d60..4e194a2d7b4a515a741858f8eef12f86d9e09932 100644 (file)
@@ -30,6 +30,9 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#ifdef CONFIG_STATUS_LED
+#include <status_led.h>
+#endif
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/gpio.h>
 #include <asm/mach-types.h>
+#ifdef CONFIG_USB_EHCI
+#include <usb.h>
+#include <asm/arch/clocks.h>
+#include <asm/arch/clocks_omap3.h>
+#include <asm/arch/ehci_omap3.h>
+/* from drivers/usb/host/ehci-core.h */
+extern struct ehci_hccr *hccr;
+extern volatile struct ehci_hcor *hcor;
+#endif
 #include "beagle.h"
 
+#define pr_debug(fmt, args...) debug(fmt, ##args)
+
 #define TWL4030_I2C_BUS                        0
 #define EXPANSION_EEPROM_I2C_BUS       1
 #define EXPANSION_EEPROM_I2C_ADDRESS   0x50
 #define TINCANTOOLS_TRAINER            0x04000100
 #define TINCANTOOLS_SHOWDOG            0x03000100
 #define KBADC_BEAGLEFPGA               0x01000600
-
+#define LW_BEAGLETOUCH                 0x01000700
+#define BRAINMUX_LCDOG                 0x01000800
+#define BRAINMUX_LCDOGTOUCH            0x02000800
+#define BBTOYS_WIFI                    0x01000B00
+#define BBTOYS_VGA                     0x02000B00
+#define BBTOYS_LCD                     0x03000B00
 #define BEAGLE_NO_EEPROM               0xffffffff
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -74,6 +93,10 @@ int board_init(void)
        /* boot param addr */
        gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
 
+#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
+       status_led_set (STATUS_LED_BOOT, STATUS_LED_ON);
+#endif
+
        return 0;
 }
 
@@ -148,23 +171,24 @@ int misc_init_r(void)
 {
        struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
        struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
+       struct control_prog_io *prog_io_base = (struct gpio *)OMAP34XX_CTRL_BASE;
+
+       /* Enable i2c2 pullup resisters */
+       writel(~(PRG_I2C2_PULLUPRESX), &prog_io_base->io1);
 
        switch (get_board_revision()) {
        case REVISION_AXBX:
                printf("Beagle Rev Ax/Bx\n");
                setenv("beaglerev", "AxBx");
-               setenv("mpurate", "600");
                break;
        case REVISION_CX:
                printf("Beagle Rev C1/C2/C3\n");
                setenv("beaglerev", "Cx");
-               setenv("mpurate", "600");
                MUX_BEAGLE_C();
                break;
        case REVISION_C4:
                printf("Beagle Rev C4\n");
                setenv("beaglerev", "C4");
-               setenv("mpurate", "720");
                MUX_BEAGLE_C();
                /* Set VAUX2 to 1.8V for EHCI PHY */
                twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
@@ -172,10 +196,19 @@ int misc_init_r(void)
                                        TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
                                        TWL4030_PM_RECEIVER_DEV_GRP_P1);
                break;
-       case REVISION_XM:
+       case REVISION_XM_A:
                printf("Beagle xM Rev A\n");
                setenv("beaglerev", "xMA");
-               setenv("mpurate", "1000");
+               MUX_BEAGLE_XM();
+               /* Set VAUX2 to 1.8V for EHCI PHY */
+               twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
+                                       TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
+                                       TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
+                                       TWL4030_PM_RECEIVER_DEV_GRP_P1);
+               break;
+       case REVISION_XM_B:
+               printf("Beagle xM Rev B\n");
+               setenv("beaglerev", "xMB");
                MUX_BEAGLE_XM();
                /* Set VAUX2 to 1.8V for EHCI PHY */
                twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
@@ -185,6 +218,12 @@ int misc_init_r(void)
                break;
        default:
                printf("Beagle unknown 0x%02x\n", get_board_revision());
+               MUX_BEAGLE_XM();
+               /* Set VAUX2 to 1.8V for EHCI PHY */
+               twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
+                                       TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
+                                       TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
+                                       TWL4030_PM_RECEIVER_DEV_GRP_P1);
        }
 
        switch (get_expansion_id()) {
@@ -223,6 +262,29 @@ int misc_init_r(void)
                MUX_KBADC_BEAGLEFPGA();
                setenv("buddy", "beaglefpga");
                break;
+       case LW_BEAGLETOUCH:
+               printf("Recognized Liquidware BeagleTouch board\n");
+               setenv("buddy", "beagletouch");
+               break;
+       case BRAINMUX_LCDOG:
+               printf("Recognized Brainmux LCDog board\n");
+               setenv("buddy", "lcdog");
+               break;
+       case BRAINMUX_LCDOGTOUCH:
+               printf("Recognized Brainmux LCDog Touch board\n");
+               setenv("buddy", "lcdogtouch");
+               break;
+       case BBTOYS_WIFI:
+               printf("Recognized BeagleBoardToys WiFi board\n");
+               MUX_BBTOYS_WIFI()
+               setenv("buddy", "bbtoys-wifi");
+               break;;
+       case BBTOYS_VGA:
+               printf("Recognized BeagleBoardToys VGA board\n");
+               break;;
+       case BBTOYS_LCD:
+               printf("Recognized BeagleBoardToys LCD board\n");
+               break;;
        case BEAGLE_NO_EEPROM:
                printf("No EEPROM on expansion board\n");
                setenv("buddy", "none");
@@ -273,3 +335,98 @@ int board_mmc_init(bd_t *bis)
        return 0;
 }
 #endif
+
+#ifdef CONFIG_USB_EHCI
+
+#define GPIO_PHY_RESET 147
+
+/* Reset is needed otherwise the kernel-driver will throw an error. */
+int ehci_hcd_stop(void)
+{
+       pr_debug("Resetting OMAP3 EHCI\n");
+       omap_set_gpio_dataout(GPIO_PHY_RESET, 0);
+       writel(OMAP_UHH_SYSCONFIG_SOFTRESET, OMAP3_UHH_BASE + OMAP_UHH_SYSCONFIG);
+       return 0;
+}
+
+/* Call usb_stop() before starting the kernel */
+void show_boot_progress(int val)
+{
+       if(val == 15)
+               usb_stop();
+}
+
+/*
+ * Initialize the OMAP3 EHCI controller and PHY on the BeagleBoard.
+ * Based on "drivers/usb/host/ehci-omap.c" from Linux 2.6.37.
+ * See there for additional Copyrights.
+ */
+int ehci_hcd_init(void)
+{
+       pr_debug("Initializing OMAP3 ECHI\n");
+
+       /* Put the PHY in RESET */
+       omap_request_gpio(GPIO_PHY_RESET);
+       omap_set_gpio_direction(GPIO_PHY_RESET, 0);
+       omap_set_gpio_dataout(GPIO_PHY_RESET, 0);
+
+       /* Hold the PHY in RESET for enough time till DIR is high */
+       /* Refer: ISSUE1 */
+       udelay(10);
+
+       struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
+       /* Enable USBHOST_L3_ICLK (USBHOST_MICLK) */
+       sr32(&prcm_base->iclken_usbhost, 0, 1, 1);
+       /*
+        * Enable USBHOST_48M_FCLK (USBHOST_FCLK1)
+        * and USBHOST_120M_FCLK (USBHOST_FCLK2)
+        */
+       sr32(&prcm_base->fclken_usbhost, 0, 2, 3);
+       /* Enable USBTTL_ICLK */
+       sr32(&prcm_base->iclken3_core, 2, 1, 1);
+       /* Enable USBTTL_FCLK */
+       sr32(&prcm_base->fclken3_core, 2, 1, 1);
+       pr_debug("USB clocks enabled\n");
+
+       /* perform TLL soft reset, and wait until reset is complete */
+       writel(OMAP_USBTLL_SYSCONFIG_SOFTRESET,
+               OMAP3_USBTLL_BASE + OMAP_USBTLL_SYSCONFIG);
+       /* Wait for TLL reset to complete */
+       while (!(readl(OMAP3_USBTLL_BASE + OMAP_USBTLL_SYSSTATUS)
+                       & OMAP_USBTLL_SYSSTATUS_RESETDONE));
+       pr_debug("TLL reset done\n");
+
+       writel(OMAP_USBTLL_SYSCONFIG_ENAWAKEUP |
+               OMAP_USBTLL_SYSCONFIG_SIDLEMODE |
+               OMAP_USBTLL_SYSCONFIG_CACTIVITY,
+               OMAP3_USBTLL_BASE + OMAP_USBTLL_SYSCONFIG);
+
+       /* Put UHH in NoIdle/NoStandby mode */
+       writel(OMAP_UHH_SYSCONFIG_ENAWAKEUP
+               | OMAP_UHH_SYSCONFIG_SIDLEMODE
+               | OMAP_UHH_SYSCONFIG_CACTIVITY
+               | OMAP_UHH_SYSCONFIG_MIDLEMODE,
+               OMAP3_UHH_BASE + OMAP_UHH_SYSCONFIG);
+
+       /* setup burst configurations */
+       writel(OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN
+               | OMAP_UHH_HOSTCONFIG_INCR8_BURST_EN
+               | OMAP_UHH_HOSTCONFIG_INCR16_BURST_EN,
+               OMAP3_UHH_BASE + OMAP_UHH_HOSTCONFIG);
+
+       /*
+        * Refer ISSUE1:
+        * Hold the PHY in RESET for enough time till
+        * PHY is settled and ready
+        */
+       udelay(10);
+       omap_set_gpio_dataout(GPIO_PHY_RESET, 1);
+
+       hccr = (struct ehci_hccr *)(OMAP3_EHCI_BASE);
+       hcor = (struct ehci_hcor *)(OMAP3_EHCI_BASE + 0x10);
+
+       pr_debug("OMAP3 EHCI init done\n");
+       return 0;
+}
+
+#endif /* CONFIG_USB_EHCI */
index b22b65337da5ecaecca101e31c5efb42233f2261..a7401b1e7ceb21f3ff572e51648ab3fbae2516a2 100644 (file)
@@ -37,7 +37,8 @@ const omap3_sysinfo sysinfo = {
 #define REVISION_AXBX  0x7
 #define REVISION_CX    0x6
 #define REVISION_C4    0x5
-#define REVISION_XM    0x0
+#define REVISION_XM_A  0x0
+#define REVISION_XM_B  0x1
 
 /*
  * IEN  - Input Enable
@@ -273,18 +274,18 @@ const omap3_sysinfo sysinfo = {
        MUX_VAL(CP(MCSPI1_CS1),         (IDIS | PTD | EN  | M0)) /*McSPI1_CS1*/\
        MUX_VAL(CP(MCSPI1_CS2),         (IDIS | PTD | DIS | M4)) /*GPIO_176*/\
  /* USB EHCI (port 2) */\
-       MUX_VAL(CP(MCSPI1_CS3),         (IEN  | PTU | DIS | M3)) /*HSUSB2_DATA2*/\
-       MUX_VAL(CP(MCSPI2_CLK),         (IEN  | PTU | DIS | M3)) /*HSUSB2_DATA7*/\
-       MUX_VAL(CP(MCSPI2_SIMO),        (IEN  | PTU | DIS | M3)) /*HSUSB2_DATA4*/\
-       MUX_VAL(CP(MCSPI2_SOMI),        (IEN  | PTU | DIS | M3)) /*HSUSB2_DATA5*/\
-       MUX_VAL(CP(MCSPI2_CS0),         (IEN  | PTU | DIS | M3)) /*HSUSB2_DATA6*/\
-       MUX_VAL(CP(MCSPI2_CS1),         (IEN  | PTU | DIS | M3)) /*HSUSB2_DATA3*/\
-       MUX_VAL(CP(ETK_D10_ES2),        (IDIS | PTU | DIS | M3)) /*HSUSB2_CLK*/\
-       MUX_VAL(CP(ETK_D11_ES2),        (IDIS | PTU | DIS | M3)) /*HSUSB2_STP*/\
-       MUX_VAL(CP(ETK_D12_ES2),        (IEN  | PTU | DIS | M3)) /*HSUSB2_DIR*/\
-       MUX_VAL(CP(ETK_D13_ES2),        (IEN  | PTU | DIS | M3)) /*HSUSB2_NXT*/\
-       MUX_VAL(CP(ETK_D14_ES2),        (IEN  | PTU | DIS | M3)) /*HSUSB2_DATA0*/\
-       MUX_VAL(CP(ETK_D15_ES2),        (IEN  | PTU | DIS | M3)) /*HSUSB2_DATA1*/\
+       MUX_VAL(CP(MCSPI1_CS3),         (IEN  | PTD | EN  | M3)) /*HSUSB2_DATA2*/\
+       MUX_VAL(CP(MCSPI2_CLK),         (IEN  | PTD | EN  | M3)) /*HSUSB2_DATA7*/\
+       MUX_VAL(CP(MCSPI2_SIMO),        (IEN  | PTD | EN  | M3)) /*HSUSB2_DATA4*/\
+       MUX_VAL(CP(MCSPI2_SOMI),        (IEN  | PTD | EN  | M3)) /*HSUSB2_DATA5*/\
+       MUX_VAL(CP(MCSPI2_CS0),         (IEN  | PTD | EN  | M3)) /*HSUSB2_DATA6*/\
+       MUX_VAL(CP(MCSPI2_CS1),         (IEN  | PTD | EN  | M3)) /*HSUSB2_DATA3*/\
+       MUX_VAL(CP(ETK_D10_ES2),        (IDIS | PTD | DIS | M3)) /*HSUSB2_CLK*/\
+       MUX_VAL(CP(ETK_D11_ES2),        (IDIS | PTD | DIS | M3)) /*HSUSB2_STP*/\
+       MUX_VAL(CP(ETK_D12_ES2),        (IEN  | PTD | EN  | M3)) /*HSUSB2_DIR*/\
+       MUX_VAL(CP(ETK_D13_ES2),        (IEN  | PTD | EN  | M3)) /*HSUSB2_NXT*/\
+       MUX_VAL(CP(ETK_D14_ES2),        (IEN  | PTD | EN  | M3)) /*HSUSB2_DATA0*/\
+       MUX_VAL(CP(ETK_D15_ES2),        (IEN  | PTD | EN  | M3)) /*HSUSB2_DATA1*/\
  /*Control and debug */\
        MUX_VAL(CP(SYS_32K),            (IEN  | PTD | DIS | M0)) /*SYS_32K*/\
        MUX_VAL(CP(SYS_CLKREQ),         (IEN  | PTD | DIS | M0)) /*SYS_CLKREQ*/\
@@ -383,7 +384,8 @@ const omap3_sysinfo sysinfo = {
        MUX_VAL(CP(MCBSP3_CLKX),        (IEN  | PTD | DIS | M4)) /*GPIO_141*/\
        MUX_VAL(CP(UART2_CTS),          (IEN  | PTU | EN  | M0)) /*UART2_CTS*/\
        MUX_VAL(CP(UART2_RTS),          (IDIS | PTD | DIS | M0)) /*UART2_RTS*/\
-       MUX_VAL(CP(UART2_TX),           (IDIS | PTD | DIS | M0)) /*UART2_TX*/
+       MUX_VAL(CP(UART2_TX),           (IDIS | PTD | DIS | M0)) /*UART2_TX*/\
+       MUX_VAL(CP(UART2_RX),           (IDIS | PTU | EN  | M4)) /*GPIO_147*/
 
 #define MUX_BEAGLE_XM() \
        MUX_VAL(CP(GPMC_NCS5),          (IDIS | PTD | EN  | M4)) /*GPIO_56*/\
@@ -457,4 +459,16 @@ const omap3_sysinfo sysinfo = {
        MUX_VAL(CP(MCBSP1_DR),      (IEN  | PTU | EN  | M1)) /*MCSPI4_SOMI*/\
        MUX_VAL(CP(MCBSP1_FSX),     (IDIS | PTU | DIS | M1)) /*MCSPI4_CS0*/
 
+#define MUX_BBTOYS_WIFI() \
+       MUX_VAL(CP(MMC2_CLK),       (IEN  | PTU | EN  | M0)) /*MMC2_CLK*/\
+       MUX_VAL(CP(MMC2_CMD),       (IEN  | PTU | EN  | M0)) /*MMC2_CMD*/\
+       MUX_VAL(CP(MMC2_DAT0),      (IEN  | PTU | EN  | M0)) /*MMC2_DAT0*/\
+       MUX_VAL(CP(MMC2_DAT1),      (IEN  | PTU | EN  | M0)) /*MMC2_DAT1*/\
+       MUX_VAL(CP(MMC2_DAT2),      (IEN  | PTU | EN  | M0)) /*MMC2_DAT2*/\
+       MUX_VAL(CP(MMC2_DAT3),      (IEN  | PTU | EN  | M0)) /*MMC2_DAT3*/\
+       MUX_VAL(CP(MMC2_DAT4),      (IDIS | PTU | EN  | M4)) /*GPIO_136 FM_EN/BT_WU*/\
+       MUX_VAL(CP(MMC2_DAT5),      (IEN  | PTU | EN  | M4)) /*GPIO_137 WLAN_IRQ*/\
+       MUX_VAL(CP(MMC2_DAT6),      (IDIS | PTU | EN  | M4)) /*GPIO_138 BT_EN*/\
+       MUX_VAL(CP(MMC2_DAT7),      (IDIS | PTU | EN  | M4)) /*GPIO_139 WLAN_EN*/
+
 #endif
diff --git a/board/ti/beagle/led.c b/board/ti/beagle/led.c
new file mode 100644 (file)
index 0000000..df26552
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2010 Texas Instruments, Inc.
+ * Jason Kridner <jkridner@beagleboard.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 <common.h>
+#include <status_led.h>
+#include <asm/arch/cpu.h>
+#include <asm/io.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/gpio.h>
+
+static unsigned int saved_state[2] = {STATUS_LED_OFF, STATUS_LED_OFF};
+
+/* GPIO pins for the LEDs */
+#define BEAGLE_LED_USR0        149
+#define BEAGLE_LED_USR1        150
+
+#ifdef STATUS_LED_GREEN
+void green_LED_off (void)
+{
+       __led_set (STATUS_LED_GREEN, 0);
+}
+
+void green_LED_on (void)
+{
+       __led_set (STATUS_LED_GREEN, 1);
+}
+#endif
+
+void __led_init (led_id_t mask, int state)
+{
+       __led_set (mask, state);
+}
+
+void __led_toggle (led_id_t mask)
+{
+#ifdef STATUS_LED_BIT
+       if (STATUS_LED_BIT & mask) {
+               if (STATUS_LED_ON == saved_state[0])
+                       __led_set(STATUS_LED_BIT, 0);
+               else
+                       __led_set(STATUS_LED_BIT, 1);
+       }
+#endif
+#ifdef STATUS_LED_BIT1
+       if (STATUS_LED_BIT1 & mask) {
+               if (STATUS_LED_ON == saved_state[1])
+                       __led_set(STATUS_LED_BIT1, 0);
+               else
+                       __led_set(STATUS_LED_BIT1, 1);
+       }
+#endif
+}
+
+void __led_set (led_id_t mask, int state)
+{
+#ifdef STATUS_LED_BIT
+       if (STATUS_LED_BIT & mask) {
+               if (!omap_request_gpio(BEAGLE_LED_USR0)) {
+                       omap_set_gpio_direction(BEAGLE_LED_USR0, 0);
+                       omap_set_gpio_dataout(BEAGLE_LED_USR0, state);
+               }
+               saved_state[0] = state;
+       }
+#endif
+#ifdef STATUS_LED_BIT1
+       if (STATUS_LED_BIT1 & mask) {
+               if (!omap_request_gpio(BEAGLE_LED_USR1)) {
+                       omap_set_gpio_direction(BEAGLE_LED_USR1, 0);
+                       omap_set_gpio_dataout(BEAGLE_LED_USR1, state);
+               }
+               saved_state[1] = state;
+       }
+#endif
+}
+
index 83a09b047168fd007cbf4c82f4d641205673e13f..f625c3dbdf3dfd7200c87e440279c52bfcafe982 100644 (file)
@@ -63,13 +63,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index a349b8c1ddfa821ad46d335540c0e301e485ba27..367f0b72a32ddc5ecaa199fed6cf9707a0d7a432 100644 (file)
@@ -24,5 +24,3 @@ sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 ifndef CONFIG_SYS_TEXT_BASE
 CONFIG_SYS_TEXT_BASE = 0x0DF40000
 endif
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
index 578a49b04bc640f7b094c462399c1b6ff3f46569..e62d53db54fa048d4c0966f06dde05b6bbfb29f5 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 3514a66d6872fe5438db7c6d72f98eef5f0edff1..3470b437e82583a8e7b39f62451c357d488585d7 100644 (file)
@@ -56,13 +56,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 1d57d0909a6caf1b9fc4c680f2b75f1ab06e70b5..3a6e297f457173dae9cd1610a5044fe732781d81 100644 (file)
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
+void get_spd(ddr2_spd_eeprom_t *spd, u8 i2c_address)
 {
        i2c_read(i2c_address, SPD_EEPROM_OFFSET, 2, (uchar *)spd,
                sizeof(ddr2_spd_eeprom_t));
 }
 
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_bus_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                       unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0) {
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-#ifdef SPD_EEPROM_ADDRESS2
-               } else if (ctrl_num == 1) {
-                       i2c_address = SPD_EEPROM_ADDRESS2;
-#endif
-               } else {
-                       /* An inalid ctrl number was give, use default SPD */
-                       printf("ERROR: invalid DDR ctrl: %d\n", ctrl_num);
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-               }
-
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 /*
  * There are four board-specific SDRAM timing parameters which must be
  * calculated based on the particular PCB artwork.  These are:
@@ -144,7 +116,7 @@ void fsl_ddr_board_options(memctl_options_t *popts,
        unsigned int datarate;
 
        get_sys_info(&sysinfo);
-       datarate = fsl_ddr_get_mem_data_rate() / 1000000;
+       datarate = get_ddr_freq(0) / 1000000;
 
        for (i = 0; i < ARRAY_SIZE(bopts_ctrl[ctrl_num]); i++) {
                if ((bopts[i].datarate_mhz_low <= datarate) &&
index 61443aab841987bfa33615b74f9df7f0392cfea7..179b2380603b94c81b56010a82c2766cc30ac309 100644 (file)
@@ -93,12 +93,3 @@ void ft_board_setup(void *blob, bd_t *bd)
        ft_cpu_setup(blob, bd);
 }
 #endif
-
-#ifdef CONFIG_MP
-extern void cpu_mp_lmb_reserve(struct lmb *lmb);
-
-void board_lmb_reserve(struct lmb *lmb)
-{
-       cpu_mp_lmb_reserve(lmb);
-}
-#endif
index c5616d546b8261af8ce7e9b4f565da28aad6d8e4..3671cb8af9a8af700c8e17863cc896629f70ca42 100644 (file)
@@ -12,8 +12,7 @@
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void
-get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
+void get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
 {
        i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
 
@@ -27,25 +26,6 @@ get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
        }
 }
 
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                       unsigned int ctrl_num)
-{
-       unsigned int i;
-
-       if (ctrl_num) {
-               printf("%s: invalid ctrl_num = %d\n", __func__, ctrl_num);
-               return;
-       }
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++)
-               get_spd(&(ctrl_dimms_spd[i]), SPD_EEPROM_ADDRESS);
-}
-
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
index 4d3f255d70520d6e7d12dd93125270befd58140e..d0662b0c57de7af6eebf9d6dec69e9a71b804cce 100644 (file)
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
+void get_spd(ddr2_spd_eeprom_t *spd, u8 i2c_address)
 {
        i2c_read(i2c_address, SPD_EEPROM_OFFSET, 2, (uchar *)spd,
                 sizeof(ddr2_spd_eeprom_t));
 }
 
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
-void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0)
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-               if (ctrl_num == 1)
-                       i2c_address = SPD_EEPROM_ADDRESS2;
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
 /*
  * There are four board-specific SDRAM timing parameters which must be
  * calculated based on the particular PCB artwork.  These are:
index d074495f96674d0d93b639491e39a8a195fcb710..9d9afaefbcc34a2fe46cfc299cf57ccc03291922 100644 (file)
@@ -96,12 +96,3 @@ void ft_board_setup(void *blob, bd_t *bd)
        ft_cpu_setup(blob, bd);
 }
 #endif
-
-#ifdef CONFIG_MP
-extern void cpu_mp_lmb_reserve(struct lmb *lmb);
-
-void board_lmb_reserve(struct lmb *lmb)
-{
-       cpu_mp_lmb_reserve(lmb);
-}
-#endif
index 38a459715fda4aa6642316aa7cbb6a05a7d85593..3b6e08bfcdd1449454eb76cf8c2428e2d717ea11 100644 (file)
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_ddr_dimm_params.h>
 
-static void get_spd(ddr3_spd_eeprom_t *spd, unsigned char i2c_address)
+void get_spd(ddr3_spd_eeprom_t *spd, u8 i2c_address)
 {
        i2c_read(i2c_address, SPD_EEPROM_OFFSET, 2, (uchar *)spd,
                 sizeof(ddr3_spd_eeprom_t));
 }
 
-void fsl_ddr_get_spd(ddr3_spd_eeprom_t *ctrl_dimms_spd,
-                     unsigned int ctrl_num)
-{
-       unsigned int i;
-       unsigned int i2c_address = 0;
-
-       for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
-               if (ctrl_num == 0 && i == 0)
-                       i2c_address = SPD_EEPROM_ADDRESS1;
-               get_spd(&(ctrl_dimms_spd[i]), i2c_address);
-       }
-}
-
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-       return get_ddr_freq(0);
-}
-
 /*
  *     There are traditionally three board-specific SDRAM timing parameters
  *     which must be calculated based on the particular PCB artwork.  These are:
index 6f91c83b6c202340995ddd7fea978f167774867e..24b2b0ea0621444370b9c1fa13ba7a1acc5b891a 100644 (file)
@@ -96,12 +96,3 @@ void ft_board_setup(void *blob, bd_t *bd)
        ft_cpu_setup(blob, bd);
 }
 #endif
-
-#ifdef CONFIG_MP
-extern void cpu_mp_lmb_reserve(struct lmb *lmb);
-
-void board_lmb_reserve(struct lmb *lmb)
-{
-       cpu_mp_lmb_reserve(lmb);
-}
-#endif
diff --git a/board/xilinx/ml507/config.mk b/board/xilinx/ml507/config.mk
deleted file mode 100644 (file)
index 4df1d9c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# need to strip off double quotes
-ifneq ($(CONFIG_SYS_LDSCRIPT),)
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-endif
diff --git a/board/xilinx/ppc405-generic/config.mk b/board/xilinx/ppc405-generic/config.mk
deleted file mode 100644 (file)
index 4df1d9c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# need to strip off double quotes
-ifneq ($(CONFIG_SYS_LDSCRIPT),)
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-endif
diff --git a/board/xilinx/ppc440-generic/config.mk b/board/xilinx/ppc440-generic/config.mk
deleted file mode 100644 (file)
index 4df1d9c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# need to strip off double quotes
-ifneq ($(CONFIG_SYS_LDSCRIPT),)
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-endif
index 45c3102b0d5abc38551dee79c4a43b823305021a..2b0900ab2690f6c444ad018405b8f78e150b622e 100644 (file)
@@ -52,6 +52,8 @@ a320evb                      arm         arm920t     -                   faraday
 at91rm9200ek                 arm         arm920t     at91rm9200ek        atmel          at91        at91rm9200ek
 at91rm9200ek_ram             arm         arm920t     at91rm9200ek        atmel          at91        at91rm9200ek:RAMBOOT
 eb_cpux9k2                   arm         arm920t     -                   BuS            at91
+cpuat91                      arm         arm920t     cpuat91             eukrea         at91        cpuat91
+cpuat91_ram                  arm         arm920t     cpuat91             eukrea         at91        cpuat91:RAMBOOT
 cmc_pu2                      arm         arm920t     -                   -              at91rm9200
 csb637                       arm         arm920t     -                   -              at91rm9200
 kb9202                       arm         arm920t     -                   -              at91rm9200
@@ -73,6 +75,14 @@ omap1510inn                  arm         arm925t     -                   ti
 aspenite                     arm         arm926ejs   -                   Marvell        armada100
 afeb9260                     arm         arm926ejs   -                   -              at91
 at91cap9adk                  arm         arm926ejs   -                   atmel          at91
+cpu9260                      arm         arm926ejs   cpu9260             eukrea         at91        cpu9260:CPU9260
+cpu9260_nand                 arm         arm926ejs   cpu9260             eukrea         at91        cpu9260:CPU9260,NANDBOOT
+cpu9260_128M                 arm         arm926ejs   cpu9260             eukrea         at91        cpu9260:CPU9260,CPU9260_128M
+cpu9260_nand_128M            arm         arm926ejs   cpu9260             eukrea         at91        cpu9260:CPU9260,CPU9260_128M,NANDBOOT
+cpu9G20                      arm         arm926ejs   cpu9260             eukrea         at91        cpu9260:CPU9G20
+cpu9G20_nand                 arm         arm926ejs   cpu9260             eukrea         at91        cpu9260:CPU9G20,NANDBOOT
+cpu9G20_128M                 arm         arm926ejs   cpu9260             eukrea         at91        cpu9260:CPU9G20,CPU9G20_128M
+cpu9G20_nand_128M            arm         arm926ejs   cpu9260             eukrea         at91        cpu9260:CPU9G20,CPU9G20_128M,NANDBOOT
 top9000eval_xe               arm         arm926ejs   top9000             emk            at91        top9000:EVAL9000
 top9000su_xe                 arm         arm926ejs   top9000             emk            at91        top9000:SU9000
 meesc                        arm         arm926ejs   -                   esd            at91
@@ -94,6 +104,8 @@ davinci_schmoogie            arm         arm926ejs   schmoogie           davinci
 davinci_sffsdr               arm         arm926ejs   sffsdr              davinci        davinci
 davinci_sonata               arm         arm926ejs   sonata              davinci        davinci
 suen3                        arm         arm926ejs   km_arm              keymile        kirkwood
+suen8                        arm         arm926ejs   km_arm              keymile        kirkwood
+mgcoge2un                    arm         arm926ejs   km_arm              keymile        kirkwood
 guruplug                     arm         arm926ejs   -                   Marvell        kirkwood
 mv88f6281gtw_ge              arm         arm926ejs   -                   Marvell        kirkwood
 openrd_base                  arm         arm926ejs   -                   Marvell        kirkwood
@@ -103,20 +115,24 @@ dockstar                     arm         arm926ejs   -                   Seagate
 jadecpu                      arm         arm926ejs   jadecpu             syteco         mb86r0x
 imx27lite                    arm         arm926ejs   imx27lite           logicpd        mx27
 magnesium                    arm         arm926ejs   imx27lite           logicpd        mx27
+nhk8815                      arm         arm926ejs   nhk8815             st             nomadik
+nhk8815_onenand              arm         arm926ejs   nhk8815             st             nomadik       nhk8815:BOOT_ONENAND
 omap5912osk                  arm         arm926ejs   -                   ti             omap
 edminiv2                     arm         arm926ejs   -                   LaCie          orion5x
 dkb                         arm         arm926ejs   -                   Marvell        pantheon
 ca9x4_ct_vxp                 arm         armv7       vexpress            armltd
 efikamx                      arm         armv7       efikamx             -              mx5
-mx51evk                      arm         armv7       mx51evk             freescale      mx5
-mx53evk                      arm         armv7       mx53evk             freescale      mx5
+mx51evk                      arm         armv7       mx51evk             freescale      mx5            mx51evk:IMX_CONFIG=board/freescale/mx51evk/imximage.cfg
+mx53evk                      arm         armv7       mx53evk             freescale      mx5            mx53evk:IMX_CONFIG=board/freescale/mx53evk/imximage.cfg
 vision2                      arm         armv7       vision2             ttcontrol      mx5
 cm_t35                       arm         armv7       cm_t35              -              omap3
 omap3_overo                  arm         armv7       overo               -              omap3
 omap3_pandora                arm         armv7       pandora             -              omap3
 igep0020                     arm         armv7       igep0020            isee           omap3
 igep0030                     arm         armv7       igep0030            isee           omap3
+am3517_crane                 arm         armv7       am3517crane         ti             omap3
 am3517_evm                   arm         armv7       am3517evm           logicpd        omap3
+dig297                       arm         armv7       dig297              comelit        omap3
 omap3_zoom1                  arm         armv7       zoom1               logicpd        omap3
 omap3_zoom2                  arm         armv7       zoom2               logicpd        omap3
 omap3_beagle                 arm         armv7       beagle              ti             omap3
@@ -174,7 +190,9 @@ favr-32-ezkit                avr32       at32ap      -                   earthlc
 mimc200                      avr32       at32ap      -                   mimc           at32ap700x
 hammerhead                   avr32       at32ap      -                   miromico       at32ap700x
 bct-brettl2                  blackfin    blackfin
+bf506f-ezkit                 blackfin    blackfin
 bf518f-ezbrd                 blackfin    blackfin
+bf525-ucr2                   blackfin    blackfin
 bf526-ezbrd                  blackfin    blackfin
 bf527-ad7160-eval            blackfin    blackfin
 bf527-ezkit                  blackfin    blackfin
@@ -198,12 +216,13 @@ cm-bf537e                    blackfin    blackfin
 cm-bf537u                    blackfin    blackfin
 cm-bf548                     blackfin    blackfin
 cm-bf561                     blackfin    blackfin
+dnp5370                      blackfin    blackfin
 ibf-dsp561                   blackfin    blackfin
 ip04                         blackfin    blackfin
 tcm-bf518                    blackfin    blackfin
 tcm-bf537                    blackfin    blackfin
-eNET                         i386        i386        eNET                -              sc520       eNET:SYS_TEXT_BASE=0x38040000
-eNET_SRAM                    i386        i386        eNET                -              sc520       eNET:SYS_TEXT_BASE=0x19000000
+eNET                         x86         x86        eNET                -              sc520       eNET:SYS_TEXT_BASE=0x38040000
+eNET_SRAM                    x86         x86        eNET                -              sc520       eNET:SYS_TEXT_BASE=0x19000000
 idmr                         m68k        mcf52x2
 TASREG                       m68k        mcf52x2     tasreg              esd
 M5208EVBE                    m68k        mcf52x2     m5208evbe           freescale
@@ -217,32 +236,31 @@ M5282EVB                     m68k        mcf52x2     m5282evb            freesca
 M53017EVB                    m68k        mcf52x2     m53017evb           freescale
 EP2500                       m68k        mcf52x2     ep2500              Mercury
 microblaze-generic           microblaze  microblaze  microblaze-generic  xilinx
-dbau1000                     mips        mips        dbau1x00            -              -           dbau1x00:DBAU1000
-dbau1100                     mips        mips        dbau1x00            -              -           dbau1x00:DBAU1100
-dbau1500                     mips        mips        dbau1x00            -              -           dbau1x00:DBAU1500
-dbau1550                     mips        mips        dbau1x00            -              -           dbau1x00:DBAU1550
-dbau1550_el                  mips        mips        dbau1x00            -              -           dbau1x00:DBAU1550
-gth2                         mips        mips
-incaip                       mips        mips
-incaip_100MHz                mips        mips        incaip              -              -           incaip:CPU_CLOCK_RATE=100000000
-incaip_133MHz                mips        mips        incaip              -              -           incaip:CPU_CLOCK_RATE=133000000
-incaip_150MHz                mips        mips        incaip              -              -           incaip:CPU_CLOCK_RATE=150000000
-pb1000                       mips        mips        pb1x00              -              -           pb1x00:PB1000
-purple                       mips        mips
-qemu_mips                    mips        mips        qemu-mips           -              -           qemu-mips
-tb0229                       mips        mips
-vct_premium                  mips        mips        vct                 micronas       -           vct:VCT_PREMIUM
-vct_premium_small            mips        mips        vct                 micronas       -           vct:VCT_PREMIUM,VCT_SMALL_IMAGE
-vct_premium_onenand          mips        mips        vct                 micronas       -           vct:VCT_PREMIUM,VCT_ONENAND
-vct_premium_onenand_small    mips        mips        vct                 micronas       -           vct:VCT_PREMIUM,VCT_ONENAND,VCT_SMALL_IMAGE
-vct_platinum                 mips        mips        vct                 micronas       -           vct:VCT_PLATINUM
-vct_platinum_small           mips        mips        vct                 micronas       -           vct:VCT_PLATINUM,VCT_SMALL_IMAGE
-vct_platinum_onenand         mips        mips        vct                 micronas       -           vct:VCT_PLATINUM,VCT_ONENAND
-vct_platinum_onenand_small   mips        mips        vct                 micronas       -           vct:VCT_PLATINUM,VCT_ONENAND,VCT_SMALL_IMAGE
-vct_platinumavc              mips        mips        vct                 micronas       -           vct:VCT_PLATINUMAVC
-vct_platinumavc_small        mips        mips        vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_SMALL_IMAGE
-vct_platinumavc_onenand      mips        mips        vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND
-vct_platinumavc_onenand_small mips       mips        vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND,VCT_SMALL_IMAGE
+dbau1000                     mips        mips32      dbau1x00            -              au1x00      dbau1x00:DBAU1000
+dbau1100                     mips        mips32      dbau1x00            -              au1x00      dbau1x00:DBAU1100
+dbau1500                     mips        mips32      dbau1x00            -              au1x00      dbau1x00:DBAU1500
+dbau1550                     mips        mips32      dbau1x00            -              au1x00      dbau1x00:DBAU1550
+dbau1550_el                  mips        mips32      dbau1x00            -              au1x00      dbau1x00:DBAU1550
+gth2                         mips        mips32      -                   -              au1x00
+incaip                       mips        mips32      incaip              -              incaip
+incaip_100MHz                mips        mips32      incaip              -              incaip      incaip:CPU_CLOCK_RATE=100000000
+incaip_133MHz                mips        mips32      incaip              -              incaip      incaip:CPU_CLOCK_RATE=133000000
+incaip_150MHz                mips        mips32      incaip              -              incaip      incaip:CPU_CLOCK_RATE=150000000
+pb1000                       mips        mips32      pb1x00              -              au1x00      pb1x00:PB1000
+qemu_mips                    mips        mips32      qemu-mips           -              -           qemu-mips
+tb0229                       mips        mips32
+vct_premium                  mips        mips32      vct                 micronas       -           vct:VCT_PREMIUM
+vct_premium_small            mips        mips32      vct                 micronas       -           vct:VCT_PREMIUM,VCT_SMALL_IMAGE
+vct_premium_onenand          mips        mips32      vct                 micronas       -           vct:VCT_PREMIUM,VCT_ONENAND
+vct_premium_onenand_small    mips        mips32      vct                 micronas       -           vct:VCT_PREMIUM,VCT_ONENAND,VCT_SMALL_IMAGE
+vct_platinum                 mips        mips32      vct                 micronas       -           vct:VCT_PLATINUM
+vct_platinum_small           mips        mips32      vct                 micronas       -           vct:VCT_PLATINUM,VCT_SMALL_IMAGE
+vct_platinum_onenand         mips        mips32      vct                 micronas       -           vct:VCT_PLATINUM,VCT_ONENAND
+vct_platinum_onenand_small   mips        mips32      vct                 micronas       -           vct:VCT_PLATINUM,VCT_ONENAND,VCT_SMALL_IMAGE
+vct_platinumavc              mips        mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC
+vct_platinumavc_small        mips        mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_SMALL_IMAGE
+vct_platinumavc_onenand      mips        mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND
+vct_platinumavc_onenand_small mips       mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND,VCT_SMALL_IMAGE
 PCI5441                      nios2       nios2       pci5441             psyent
 PK1C20                       nios2       nios2       pk1c20              psyent
 EVB64260                     powerpc     74xx_7xx    evb64260            -              -           EVB64260
@@ -422,6 +440,7 @@ PQ2FADS-ZU_66MHz_lowboot     powerpc     mpc8260     mpc8260ads          freesca
 PQ2FADS-ZU_lowboot           powerpc     mpc8260     mpc8260ads          freescale      -           MPC8260ADS:ADSTYPE=CONFIG_SYS_PQ2FADS,SYS_TEXT_BASE=0xFF800000
 VoVPN-GW_66MHz               powerpc     mpc8260     vovpn-gw            funkwerk       -           VoVPN-GW:CLKIN_66MHz
 mgcoge                       powerpc     mpc8260     -                   keymile
+mgcoge2ne                    powerpc     mpc8260     mgcoge              keymile
 SCM                          powerpc     mpc8260     -                   siemens
 TQM8255_AA                   powerpc     mpc8260     tqm8260             tqc            -           TQM8260:MPC8255,300MHz
 TQM8260_AA                   powerpc     mpc8260     tqm8260             tqc            -           TQM8260:MPC8260,200MHz
@@ -470,11 +489,15 @@ MPC8360ERDK_66               powerpc     mpc83xx     mpc8360erdk         freesca
 MPC837XEMDS                  powerpc     mpc83xx     mpc837xemds         freescale      -           MPC837XEMDS
 MPC837XEMDS_HOST             powerpc     mpc83xx     mpc837xemds         freescale      -           MPC837XEMDS:PCI
 MPC837XERDB                  powerpc     mpc83xx     mpc837xerdb         freescale
-kmeter1                      powerpc     mpc83xx     kmeter1             keymile
+kmeter1                      powerpc     mpc83xx     km83xx              keymile
 MVBLM7                       powerpc     mpc83xx     mvblm7              matrix_vision
 SIMPC8313_LP                 powerpc     mpc83xx     simpc8313           sheldon        -           SIMPC8313:NAND_LP
 SIMPC8313_SP                 powerpc     mpc83xx     simpc8313           sheldon        -           SIMPC8313:NAND_SP
+kmsupx5                      powerpc     mpc83xx     km83xx              keymile
+suvd3                        powerpc     mpc83xx     km83xx              keymile
 TQM834x                      powerpc     mpc83xx     tqm834x             tqc
+tuda1                        powerpc     mpc83xx     km83xx              keymile
+tuxa1                        powerpc     mpc83xx     km83xx              keymile
 sbc8540                      powerpc     mpc85xx     sbc8560             -              -           SBC8540
 sbc8540_33                   powerpc     mpc85xx     sbc8560             -              -           SBC8540
 sbc8540_66                   powerpc     mpc85xx     sbc8560             -              -           SBC8540
@@ -509,26 +532,44 @@ MPC8572DS                    powerpc     mpc85xx     mpc8572ds           freesca
 MPC8572DS_36BIT              powerpc     mpc85xx     mpc8572ds           freescale      -           MPC8572DS:36BIT
 MPC8572DS_NAND               powerpc     mpc85xx     mpc8572ds           freescale      -           MPC8572DS:NAND
 P1011RDB                     powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1011RDB
+P1011RDB_36BIT               powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1011RDB,36BIT
+P1011RDB_36BIT_SDCARD        powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1011RDB,36BIT,SDCARD
+P1011RDB_36BIT_SPIFLASH      powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1011RDB,36BIT,SPIFLASH
 P1011RDB_NAND                powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1011RDB,NAND
 P1011RDB_SDCARD              powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1011RDB,SDCARD
 P1011RDB_SPIFLASH            powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1011RDB,SPIFLASH
 P1020RDB                     powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1020RDB
+P1020RDB_36BIT               powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1020RDB,36BIT
+P1020RDB_36BIT_SDCARD        powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1020RDB,36BIT,SDCARD
+P1020RDB_36BIT_SPIFLASH      powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1020RDB,36BIT,SPIFLASH
 P1020RDB_NAND                powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1020RDB,NAND
 P1020RDB_SDCARD              powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1020RDB,SDCARD
 P1020RDB_SPIFLASH            powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1020RDB,SPIFLASH
 P1022DS                      powerpc     mpc85xx     p1022ds             freescale
+P1022DS_36BIT                powerpc     mpc85xx     p1022ds             freescale      -           P1022DS:36BIT
 P2010RDB                     powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2010RDB
+P2010RDB_36BIT               powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2010RDB,36BIT
+P2010RDB_36BIT_SDCARD        powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2010RDB,36BIT,SDCARD
+P2010RDB_36BIT_SPIFLASH      powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2010RDB,36BIT,SPIFLASH
 P2010RDB_NAND                powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2010RDB,NAND
 P2010RDB_SDCARD              powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2010RDB,SDCARD
 P2010RDB_SPIFLASH            powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2010RDB,SPIFLASH
 P2020DS                      powerpc     mpc85xx     p2020ds             freescale
 P2020DS_36BIT                powerpc     mpc85xx     p2020ds             freescale      -           P2020DS:36BIT
 P2020DS_DDR2                 powerpc     mpc85xx     p2020ds             freescale      -           P2020DS:DDR2
+P2020DS_SDCARD               powerpc     mpc85xx     p2020ds             freescale      -           P2020DS:SDCARD
+P2020DS_SPIFLASH             powerpc     mpc85xx     p2020ds             freescale      -           P2020DS:SPIFLASH
 P2020RDB                     powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2020RDB
+P2020RDB_36BIT               powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2020RDB,36BIT
+P2020RDB_36BIT_SDCARD        powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2020RDB,36BIT,SDCARD
+P2020RDB_36BIT_SPIFLASH      powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2020RDB,36BIT,SPIFLASH
 P2020RDB_NAND                powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2020RDB,NAND
 P2020RDB_SDCARD              powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2020RDB,SDCARD
 P2020RDB_SPIFLASH            powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P2020RDB,SPIFLASH
+P3041DS                      powerpc     mpc85xx     corenet_ds          freescale
 P4080DS                      powerpc     mpc85xx     corenet_ds          freescale
+P4080DS_RAMBOOT_PBL          powerpc     mpc85xx     corenet_ds          freescale      -           P4080DS:RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF80000
+P5020DS                      powerpc     mpc85xx     corenet_ds          freescale
 mpq101                       powerpc     mpc85xx     mpq101              mercury        -           mpq101
 stxgp3                       powerpc     mpc85xx     stxgp3              stx
 stxssa                       powerpc     mpc85xx     stxssa              stx            -           stxssa
@@ -701,9 +742,9 @@ yellowstone                  powerpc     ppc4xx      yosemite            amcc
 yosemite                     powerpc     ppc4xx      yosemite            amcc           -           yosemite:YOSEMITE
 yucca                        powerpc     ppc4xx      -                   amcc
 AP1000                       powerpc     ppc4xx      ap1000              amirix
-fx12mm                       powerpc     ppc4xx      fx12mm              avnet          -           fx12mm:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x03FFFFFC,INIT_TLB=board/xilinx/ppc405-generic/init.o
+fx12mm                       powerpc     ppc4xx      fx12mm              avnet          -           fx12mm:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x04100000,INIT_TLB=board/xilinx/ppc405-generic/init.o
 fx12mm_flash                 powerpc     ppc4xx      fx12mm              avnet          -           fx12mm:SYS_TEXT_BASE=0xF7F60000,RESET_VECTOR_ADDRESS=0xF7FFFFFC,INIT_TLB=board/xilinx/ppc405-generic/init.o
-v5fx30teval                  powerpc     ppc4xx      v5fx30teval         avnet          -           v5fx30teval:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x03FFFFFC,BOOT_FROM_XMD=1,INIT_TLB=board/xilinx/ppc440-generic/init.o
+v5fx30teval                  powerpc     ppc4xx      v5fx30teval         avnet          -           v5fx30teval:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x04100000,BOOT_FROM_XMD=1,INIT_TLB=board/xilinx/ppc440-generic/init.o
 v5fx30teval_flash            powerpc     ppc4xx      v5fx30teval         avnet          -           v5fx30teval:SYS_TEXT_BASE=0xF7F60000,RESET_VECTOR_ADDRESS=0xF7FFFFFC,INIT_TLB=board/xilinx/ppc440-generic/init.o
 CRAYL1                       powerpc     ppc4xx      L1                  cray
 CATcenter                    powerpc     ppc4xx      PPChameleonEVB      dave           -           CATcenter:PPCHAMELEON_MODULE_MODEL=1
@@ -763,11 +804,11 @@ p3p440                       powerpc     ppc4xx      -                   prodriv
 KAREF                        powerpc     ppc4xx      karef               sandburst
 METROBOX                     powerpc     ppc4xx      metrobox            sandburst
 xpedite1000                  powerpc     ppc4xx      -                   xes
-ml507                        powerpc     ppc4xx      ml507               xilinx         -           ml507:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x03FFFFFC,BOOT_FROM_XMD=1,INIT_TLB=board/xilinx/ppc440-generic/init.o
+ml507                        powerpc     ppc4xx      ml507               xilinx         -           ml507:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x04100000,BOOT_FROM_XMD=1,INIT_TLB=board/xilinx/ppc440-generic/init.o
 ml507_flash                  powerpc     ppc4xx      ml507               xilinx         -           ml507:SYS_TEXT_BASE=0xF7F60000,RESET_VECTOR_ADDRESS=0xF7FFFFFC,INIT_TLB=board/xilinx/ppc440-generic/init.o
-xilinx-ppc405-generic        powerpc     ppc4xx      ppc405-generic      xilinx         -           xilinx-ppc405-generic:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x03FFFFFC
+xilinx-ppc405-generic        powerpc     ppc4xx      ppc405-generic      xilinx         -           xilinx-ppc405-generic:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x04100000
 xilinx-ppc405-generic_flash  powerpc     ppc4xx      ppc405-generic      xilinx         -           xilinx-ppc405-generic:SYS_TEXT_BASE=0xF7F60000,RESET_VECTOR_ADDRESS=0xF7FFFFFC
-xilinx-ppc440-generic        powerpc     ppc4xx      ppc440-generic      xilinx         -           xilinx-ppc440-generic:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x03FFFFFC,BOOT_FROM_XMD=1
+xilinx-ppc440-generic        powerpc     ppc4xx      ppc440-generic      xilinx         -           xilinx-ppc440-generic:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x04100000,BOOT_FROM_XMD=1
 xilinx-ppc440-generic_flash  powerpc     ppc4xx      ppc440-generic      xilinx         -           xilinx-ppc440-generic:SYS_TEXT_BASE=0xF7F60000,RESET_VECTOR_ADDRESS=0xF7FFFFFC
 rsk7203                      sh          sh2         rsk7203             renesas        -
 mpr2                         sh          sh3         mpr2                -              -
index 048df0cbcaeeeacf38bbb9c68cf678aea56bcc0f..f81cff93c973309bdfcedab9a54acaed8add2f68 100644 (file)
@@ -98,6 +98,7 @@ COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
 ifdef CONFIG_FPGA
 COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
 endif
+COBJS-$(CONFIG_CMD_GPIO) += cmd_gpio.o
 COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
 COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
 COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
@@ -105,18 +106,25 @@ COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
 COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
 COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
 COBJS-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o
+COBJS-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o
 COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
 COBJS-y += cmd_load.o
 COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
 COBJS-$(CONFIG_ID_EEPROM) += cmd_mac.o
+COBJS-$(CONFIG_CMD_MD5SUM) += cmd_md5sum.o
 COBJS-$(CONFIG_CMD_MEMORY) += cmd_mem.o
 COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
 COBJS-$(CONFIG_CMD_MG_DISK) += cmd_mgdisk.o
 COBJS-$(CONFIG_MII) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
+COBJS-$(CONFIG_PHYLIB) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
+ifdef CONFIG_PHYLIB
+COBJS-$(CONFIG_CMD_MII) += cmd_mdio.o
+endif
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
+COBJS-$(CONFIG_CMD_MMC_SPI) += cmd_mmc_spi.o
 COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
 COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o
@@ -133,6 +141,7 @@ COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
 COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
 COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
+COBJS-$(CONFIG_CMD_SHA1SUM) += cmd_sha1sum.o
 COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
 COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
 COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
@@ -143,6 +152,7 @@ COBJS-$(CONFIG_CMD_TSI148) += cmd_tsi148.o
 COBJS-$(CONFIG_CMD_UBI) += cmd_ubi.o
 COBJS-$(CONFIG_CMD_UBIFS) += cmd_ubifs.o
 COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
+COBJS-$(CONFIG_CMD_UNZIP) += cmd_unzip.o
 ifdef CONFIG_CMD_USB
 COBJS-y += cmd_usb.o
 COBJS-y += usb.o
index bba73746097757f969bdb7a7e8ed335b6073fb2d..1d76ffaa27e0bae191cb45579a7e25d2fd9d0238 100644 (file)
@@ -304,7 +304,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #elif defined(CONFIG_AVR32)
 
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        bd_t *bd = gd->bd;
 
index 7b603d3502f2a7bec3cc111b9490e43dc568b658..0afd93964d7af31dba01ada22b00a429326be1f8 100644 (file)
@@ -28,6 +28,8 @@
 #include <command.h>
 #include <net.h>
 
+#ifdef CONFIG_CMD_GO
+
 /* Allow ports to override the default behavior */
 __attribute__((weak))
 unsigned long do_go_exec (ulong (*entry)(int, char * const []), int argc, char * const argv[])
@@ -67,6 +69,8 @@ U_BOOT_CMD(
        "      passing 'arg' as arguments"
 );
 
+#endif
+
 U_BOOT_CMD(
        reset, 1, 0,    do_reset,
        "Perform RESET of the CPU",
index 535b931ff342ccf2385ef6ee90f2de06b451752b..bc5c1f95eaff9cdf783347e8ded104d16035bb29 100644 (file)
@@ -24,7 +24,7 @@ static bool ldr_valid_signature(uint8_t *data)
 #if defined(__ADSPBF561__)
 
        /* BF56x has a 4 byte global header */
-       if (data[3] == 0xA0)
+       if (data[3] == (GFLAG_56X_SIGN_MAGIC << (GFLAG_56X_SIGN_SHIFT - 24)))
                return true;
 
 #elif defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \
@@ -53,11 +53,6 @@ static bool ldr_valid_signature(uint8_t *data)
  * LDRs from random memory addresses.  So whenever possible, use that.  In
  * the older cases (BF53x/BF561), parse the LDR format ourselves.
  */
-#define ZEROFILL  0x0001
-#define RESVECT   0x0002
-#define INIT      0x0008
-#define IGNORE    0x0010
-#define FINAL     0x8000
 static void ldr_load(uint8_t *base_addr)
 {
 #if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \
@@ -76,7 +71,7 @@ static void ldr_load(uint8_t *base_addr)
 # endif
 
        memmove(&flags, base_addr + 8, sizeof(flags));
-       bfin_write_EVT1(flags & RESVECT ? 0xFFA00000 : 0xFFA08000);
+       bfin_write_EVT1(flags & BFLAG_53X_RESVECT ? 0xFFA00000 : 0xFFA08000);
 
        do {
                /* block header may not be aligned */
@@ -85,24 +80,24 @@ static void ldr_load(uint8_t *base_addr)
                memmove(&flags, base_addr+8, sizeof(flags));
                base_addr += sizeof(addr) + sizeof(count) + sizeof(flags);
 
-               printf("loading to 0x%08x (0x%x bytes) flags: 0x%04x\n",
+               printf("loading to 0x%08x (%#x bytes) flags: 0x%04x\n",
                        addr, count, flags);
 
-               if (!(flags & IGNORE)) {
-                       if (flags & ZEROFILL)
+               if (!(flags & BFLAG_53X_IGNORE)) {
+                       if (flags & BFLAG_53X_ZEROFILL)
                                memset((void *)addr, 0x00, count);
                        else
                                memcpy((void *)addr, base_addr, count);
 
-                       if (flags & INIT) {
+                       if (flags & BFLAG_53X_INIT) {
                                void (*init)(void) = (void *)addr;
                                init();
                        }
                }
 
-               if (!(flags & ZEROFILL))
+               if (!(flags & BFLAG_53X_ZEROFILL))
                        base_addr += count;
-       } while (!(flags & FINAL));
+       } while (!(flags & BFLAG_53X_FINAL));
 
 #endif
 }
index 18019d65263ca55086f8b2a412cd0e0de9fcf36f..1966da48ca49ea1a250b429b1a11a6d76bac2e5d 100644 (file)
@@ -344,7 +344,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
 
        switch (comp) {
        case IH_COMP_NONE:
-               if (load == blob_start) {
+               if (load == blob_start || load == image_start) {
                        printf ("   XIP %s ... ", type_name);
                } else {
                        printf ("   Loading %s ... ", type_name);
@@ -544,11 +544,12 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
                }
                        break;
 #endif
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_SYS_BOOTMAPSZ)
+#if defined(CONFIG_OF_LIBFDT)
                case BOOTM_STATE_FDT:
                {
-                       ulong bootmap_base = getenv_bootm_low();
-                       ret = boot_relocate_fdt(&images.lmb, bootmap_base,
+                       boot_fdt_add_mem_rsv_regions(&images.lmb,
+                                                    images.ft_addr);
+                       ret = boot_relocate_fdt(&images.lmb,
                                &images.ft_addr, &images.ft_len);
                        break;
                }
diff --git a/common/cmd_gpio.c b/common/cmd_gpio.c
new file mode 100644 (file)
index 0000000..9cc790a
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Control GPIO pins on the fly
+ *
+ * Copyright (c) 2008-2011 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <command.h>
+
+#include <asm/gpio.h>
+
+#ifndef name_to_gpio
+#define name_to_gpio(name) simple_strtoul(name, NULL, 10)
+#endif
+
+enum gpio_cmd {
+       GPIO_INPUT,
+       GPIO_SET,
+       GPIO_CLEAR,
+       GPIO_TOGGLE,
+};
+
+static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       int gpio;
+       enum gpio_cmd sub_cmd;
+       ulong value;
+       const char *str_cmd, *str_gpio;
+
+#ifdef gpio_status
+       if (argc == 2 && !strcmp(argv[1], "status")) {
+               gpio_status();
+               return 0;
+       }
+#endif
+
+       if (argc != 3)
+ show_usage:
+               return cmd_usage(cmdtp);
+       str_cmd = argv[1];
+       str_gpio = argv[2];
+
+       /* parse the behavior */
+       switch (*str_cmd) {
+               case 'i': sub_cmd = GPIO_INPUT;  break;
+               case 's': sub_cmd = GPIO_SET;    break;
+               case 'c': sub_cmd = GPIO_CLEAR;  break;
+               case 't': sub_cmd = GPIO_TOGGLE; break;
+               default:  goto show_usage;
+       }
+
+       /* turn the gpio name into a gpio number */
+       gpio = name_to_gpio(str_gpio);
+       if (gpio < 0)
+               goto show_usage;
+
+       /* grab the pin before we tweak it */
+       if (gpio_request(gpio, "cmd_gpio")) {
+               printf("gpio: requesting pin %u failed\n", gpio);
+               return -1;
+       }
+
+       /* finally, let's do it: set direction and exec command */
+       if (sub_cmd == GPIO_INPUT) {
+               gpio_direction_input(gpio);
+               value = gpio_get_value(gpio);
+       } else {
+               switch (sub_cmd) {
+                       case GPIO_SET:    value = 1; break;
+                       case GPIO_CLEAR:  value = 0; break;
+                       case GPIO_TOGGLE: value = !gpio_get_value(gpio); break;
+                       default:          goto show_usage;
+               }
+               gpio_direction_output(gpio, value);
+       }
+       printf("gpio: pin %s (gpio %i) value is %lu\n",
+               str_gpio, gpio, value);
+
+       gpio_free(gpio);
+
+       return value;
+}
+
+U_BOOT_CMD(gpio, 3, 0, do_gpio,
+       "input/set/clear/toggle gpio pins",
+       "<input|set|clear|toggle> <pin>\n"
+       "    - input/set/clear/toggle the specified pin");
index c272b0dd4f7dda1782c2abe8b24cff299e0f99ee..d913e13665b41728fbbd953c17db5c7ae0ac1026 100644 (file)
@@ -132,6 +132,14 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define DISP_LINE_LEN  16
 
+/* implement possible board specific board init */
+void __def_i2c_init_board(void)
+{
+       return;
+}
+void i2c_init_board(void)
+       __attribute__((weak, alias("__def_i2c_init_board")));
+
 /* TODO: Implement architecture-specific get/set functions */
 unsigned int __def_i2c_get_bus_speed(void)
 {
@@ -1541,6 +1549,8 @@ int i2x_mux_select_mux(int bus)
 
        mux = dev->mux;
        while (mux != NULL) {
+               /* do deblocking on each level of mux, before mux config */
+               i2c_init_board();
                if (i2c_write(mux->chip, 0, 0, &mux->channel, 1) != 0) {
                        printf ("Error setting Mux: chip:%x channel: \
                                %x\n", mux->chip, mux->channel);
@@ -1548,6 +1558,8 @@ int i2x_mux_select_mux(int bus)
                }
                mux = mux->next;
        }
+       /* do deblocking on each level of mux and after mux config */
+       i2c_init_board();
        return 0;
 }
 #endif /* CONFIG_I2C_MUX */
index a1f7e57155b74a25936e73d92578214f661cff2e..21fe1eabadb5c4d2ba4fc3746e463388cd6efca6 100644 (file)
@@ -160,7 +160,7 @@ static uchar ide_wait  (int dev, ulong t);
 #define IDE_SPIN_UP_TIME_OUT 5000 /* 5 sec spin-up timeout */
 
 static void input_data(int dev, ulong *sect_buf, int words);
-static void output_data(int dev, ulong *sect_buf, int words);
+static void output_data(int dev, const ulong *sect_buf, int words);
 static void ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len);
 
 #ifndef CONFIG_SYS_ATA_PORT_ADDR
@@ -517,8 +517,20 @@ __ide_outb(int dev, int port, unsigned char val)
 {
        debug ("ide_outb (dev= %d, port= 0x%x, val= 0x%02x) : @ 0x%08lx\n",
                dev, port, val, (ATA_CURR_BASE(dev)+CONFIG_SYS_ATA_PORT_ADDR(port)));
+
+#if defined(CONFIG_IDE_AHB)
+       if (port) {
+               /* write command */
+               ide_write_register(dev, port, val);
+       } else {
+               /* write data */
+               outb(val, (ATA_CURR_BASE(dev)));
+       }
+#else
        outb(val, (ATA_CURR_BASE(dev)+CONFIG_SYS_ATA_PORT_ADDR(port)));
+#endif
 }
+
 void ide_outb (int dev, int port, unsigned char val)
                __attribute__((weak, alias("__ide_outb")));
 
@@ -526,7 +538,13 @@ unsigned char inline
 __ide_inb(int dev, int port)
 {
        uchar val;
+
+#if defined(CONFIG_IDE_AHB)
+       val = ide_read_register(dev, port);
+#else
        val = inb((ATA_CURR_BASE(dev)+CONFIG_SYS_ATA_PORT_ADDR(port)));
+#endif
+
        debug ("ide_inb (dev= %d, port= 0x%x) : @ 0x%08lx -> 0x%02x\n",
                dev, port, (ATA_CURR_BASE(dev)+CONFIG_SYS_ATA_PORT_ADDR(port)), val);
        return val;
@@ -695,6 +713,7 @@ void ide_init (void)
                ide_dev_desc[i].blksz=0;
                ide_dev_desc[i].lba=0;
                ide_dev_desc[i].block_read=ide_read;
+               ide_dev_desc[i].block_write = ide_write;
                if (!ide_bus_ok[IDE_BUS(i)])
                        continue;
                ide_led (led, 1);               /* LED on       */
@@ -856,7 +875,7 @@ input_swap_data(int dev, ulong *sect_buf, int words)
 
 #if defined(CONFIG_IDE_SWAP_IO)
 static void
-output_data(int dev, ulong *sect_buf, int words)
+output_data(int dev, const ulong *sect_buf, int words)
 {
 #if defined(CONFIG_CPC45)
        uchar   *dbuf;
@@ -900,9 +919,13 @@ output_data(int dev, ulong *sect_buf, int words)
 }
 #else  /* ! CONFIG_IDE_SWAP_IO */
 static void
-output_data(int dev, ulong *sect_buf, int words)
+output_data(int dev, const ulong *sect_buf, int words)
 {
-       outsw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words<<1);
+#if defined(CONFIG_IDE_AHB)
+       ide_write_data(dev, sect_buf, words);
+#else
+       outsw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words << 1);
+#endif
 }
 #endif /* CONFIG_IDE_SWAP_IO */
 
@@ -960,7 +983,11 @@ input_data(int dev, ulong *sect_buf, int words)
 static void
 input_data(int dev, ulong *sect_buf, int words)
 {
+#if defined(CONFIG_IDE_AHB)
+       ide_read_data(dev, sect_buf, words);
+#else
        insw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words << 1);
+#endif
 }
 
 #endif /* CONFIG_IDE_SWAP_IO */
@@ -1321,7 +1348,7 @@ IDE_READ_E:
 /* ------------------------------------------------------------------------- */
 
 
-ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, const void *buffer)
 {
        ulong n = 0;
        unsigned char c;
diff --git a/common/cmd_ldrinfo.c b/common/cmd_ldrinfo.c
new file mode 100644 (file)
index 0000000..2aa56bd
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * U-boot - ldrinfo
+ *
+ * Copyright (c) 2010 Analog Devices Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <config.h>
+#include <common.h>
+#include <command.h>
+
+#include <asm/blackfin.h>
+#include <asm/mach-common/bits/bootrom.h>
+
+static uint32_t ldrinfo_header(const void *addr)
+{
+       uint32_t skip = 0;
+
+#if defined(__ADSPBF561__)
+       /* BF56x has a 4 byte global header */
+       uint32_t header, sign;
+       static const char * const spi_speed[] = {
+               "500K", "1M", "2M", "??",
+       };
+
+       memcpy(&header, addr, sizeof(header));
+
+       sign = (header & GFLAG_56X_SIGN_MASK) >> GFLAG_56X_SIGN_SHIFT;
+       printf("Header: %08X ( %s-bit-flash wait:%i hold:%i spi:%s %s)\n",
+               header,
+               (header & GFLAG_56X_16BIT_FLASH) ? "16" : "8",
+               (header & GFLAG_56X_WAIT_MASK) >> GFLAG_56X_WAIT_SHIFT,
+               (header & GFLAG_56X_HOLD_MASK) >> GFLAG_56X_HOLD_SHIFT,
+               spi_speed[(header & GFLAG_56X_SPI_MASK) >> GFLAG_56X_SPI_SHIFT],
+               sign == GFLAG_56X_SIGN_MAGIC ? "" : "!!hdrsign!! ");
+
+       skip = 4;
+#endif
+
+           /* |Block @ 12345678: 12345678 12345678 12345678 12345678 | */
+#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \
+    defined(__ADSPBF534__) || defined(__ADSPBF536__) || defined(__ADSPBF537__) || \
+    defined(__ADSPBF538__) || defined(__ADSPBF539__) || defined(__ADSPBF561__)
+       printf("                  Address  Count    Flags\n");
+#else
+       printf("                  BCode    Address  Count    Argument\n");
+#endif
+
+       return skip;
+}
+
+struct ldr_flag {
+       uint16_t flag;
+       const char *desc;
+};
+
+static uint32_t ldrinfo_block(const void *base_addr)
+{
+       uint32_t count;
+
+       printf("Block @ %08X: ", (uint32_t)base_addr);
+
+#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \
+    defined(__ADSPBF534__) || defined(__ADSPBF536__) || defined(__ADSPBF537__) || \
+    defined(__ADSPBF538__) || defined(__ADSPBF539__) || defined(__ADSPBF561__)
+
+       uint32_t addr, pval;
+       uint16_t flags;
+       int i;
+       static const struct ldr_flag ldr_flags[] = {
+               { BFLAG_53X_ZEROFILL,    "zerofill"  },
+               { BFLAG_53X_RESVECT,     "resvect"   },
+               { BFLAG_53X_INIT,        "init"      },
+               { BFLAG_53X_IGNORE,      "ignore"    },
+               { BFLAG_53X_COMPRESSED,  "compressed"},
+               { BFLAG_53X_FINAL,       "final"     },
+       };
+
+       memcpy(&addr, base_addr, sizeof(addr));
+       memcpy(&count, base_addr+4, sizeof(count));
+       memcpy(&flags, base_addr+8, sizeof(flags));
+
+       printf("%08X %08X %04X ( ", addr, count, flags);
+
+       for (i = 0; i < ARRAY_SIZE(ldr_flags); ++i)
+               if (flags & ldr_flags[i].flag)
+                       printf("%s ", ldr_flags[i].desc);
+
+       pval = (flags & BFLAG_53X_PFLAG_MASK) >> BFLAG_53X_PFLAG_SHIFT;
+       if (pval)
+               printf("gpio%i ", pval);
+       pval = (flags & BFLAG_53X_PPORT_MASK) >> BFLAG_53X_PPORT_SHIFT;
+       if (pval)
+               printf("port%c ", 'e' + pval);
+
+       if (flags & BFLAG_53X_ZEROFILL)
+               count = 0;
+       if (flags & BFLAG_53X_FINAL)
+               count = 0;
+       else
+               count += sizeof(addr) + sizeof(count) + sizeof(flags);
+
+#else
+
+       const uint8_t *raw8 = base_addr;
+       uint32_t bcode, addr, arg, sign, chk;
+       int i;
+       static const struct ldr_flag ldr_flags[] = {
+               { BFLAG_SAFE,        "safe"      },
+               { BFLAG_AUX,         "aux"       },
+               { BFLAG_FILL,        "fill"      },
+               { BFLAG_QUICKBOOT,   "quickboot" },
+               { BFLAG_CALLBACK,    "callback"  },
+               { BFLAG_INIT,        "init"      },
+               { BFLAG_IGNORE,      "ignore"    },
+               { BFLAG_INDIRECT,    "indirect"  },
+               { BFLAG_FIRST,       "first"     },
+               { BFLAG_FINAL,       "final"     },
+       };
+
+       memcpy(&bcode, base_addr, sizeof(bcode));
+       memcpy(&addr, base_addr+4, sizeof(addr));
+       memcpy(&count, base_addr+8, sizeof(count));
+       memcpy(&arg, base_addr+12, sizeof(arg));
+
+       printf("%08X %08X %08X %08X ( ", bcode, addr, count, arg);
+
+       if (addr % 4)
+               printf("!!addralgn!! ");
+       if (count % 4)
+               printf("!!cntalgn!! ");
+
+       sign = (bcode & BFLAG_HDRSIGN_MASK) >> BFLAG_HDRSIGN_SHIFT;
+       if (sign != BFLAG_HDRSIGN_MAGIC)
+               printf("!!hdrsign!! ");
+
+       chk = 0;
+       for (i = 0; i < 16; ++i)
+               chk ^= raw8[i];
+       if (chk)
+               printf("!!hdrchk!! ");
+
+       printf("dma:%i ", bcode & BFLAG_DMACODE_MASK);
+
+       for (i = 0; i < ARRAY_SIZE(ldr_flags); ++i)
+               if (bcode & ldr_flags[i].flag)
+                       printf("%s ", ldr_flags[i].desc);
+
+       if (bcode & BFLAG_FILL)
+               count = 0;
+       if (bcode & BFLAG_FINAL)
+               count = 0;
+       else
+               count += sizeof(bcode) + sizeof(addr) + sizeof(count) + sizeof(arg);
+
+#endif
+
+       printf(")\n");
+
+       return count;
+}
+
+static int do_ldrinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       const void *addr;
+       uint32_t skip;
+
+       /* Get the address */
+       if (argc < 2)
+               addr = (void *)load_addr;
+       else
+               addr = (void *)simple_strtoul(argv[1], NULL, 16);
+
+       /* Walk the LDR */
+       addr += ldrinfo_header(addr);
+       do {
+               skip = ldrinfo_block(addr);
+               addr += skip;
+       } while (skip);
+
+       return 0;
+}
+
+U_BOOT_CMD(
+       ldrinfo, 2, 0, do_ldrinfo,
+       "validate ldr image in memory",
+       "[addr]\n"
+);
diff --git a/common/cmd_led.c b/common/cmd_led.c
new file mode 100644 (file)
index 0000000..f1e8a62
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * (C) Copyright 2010
+ * Jason Kridner <jkridner@beagleboard.org>
+ *
+ * Based on cmd_led.c patch from:
+ * http://www.mail-archive.com/u-boot@lists.denx.de/msg06873.html
+ * (C) Copyright 2008
+ * Ulf Samuelsson <ulf.samuelsson@atmel.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 <common.h>
+#include <config.h>
+#include <command.h>
+#include <status_led.h>
+
+struct led_tbl_s {
+       char            *string;        /* String for use in the command */
+       led_id_t        mask;           /* Mask used for calling __led_set() */
+       void            (*on)(void);    /* Optional fucntion for turning LED on */
+       void            (*off)(void);   /* Optional fucntion for turning LED on */
+};
+
+typedef struct led_tbl_s led_tbl_t;
+
+static const led_tbl_t led_commands[] = {
+#ifdef CONFIG_BOARD_SPECIFIC_LED
+#ifdef STATUS_LED_BIT
+       { "0", STATUS_LED_BIT, NULL, NULL },
+#endif
+#ifdef STATUS_LED_BIT1
+       { "1", STATUS_LED_BIT1, NULL, NULL },
+#endif
+#ifdef STATUS_LED_BIT2
+       { "2", STATUS_LED_BIT2, NULL, NULL },
+#endif
+#ifdef STATUS_LED_BIT3
+       { "3", STATUS_LED_BIT3, NULL, NULL },
+#endif
+#endif
+#ifdef STATUS_LED_GREEN
+       { "green", STATUS_LED_GREEN, green_LED_off, green_LED_on },
+#endif
+#ifdef STATUS_LED_YELLOW
+       { "yellow", STATUS_LED_YELLOW, yellow_LED_off, yellow_LED_on },
+#endif
+#ifdef STATUS_LED_RED
+       { "red", STATUS_LED_RED, red_LED_off, red_LED_on },
+#endif
+#ifdef STATUS_LED_BLUE
+       { "blue", STATUS_LED_BLUE, blue_LED_off, blue_LED_on },
+#endif
+       { NULL, 0, NULL, NULL }
+};
+
+int str_onoff (char *var)
+{
+       if (strcmp(var, "off") == 0) {
+               return 0;
+       }
+       if (strcmp(var, "on") == 0) {
+               return 1;
+       }
+       return -1;
+}
+
+int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       int state, i;
+
+       /* Validate arguments */
+       if ((argc != 3)) {
+               return cmd_usage(cmdtp);
+       }
+
+       state = str_onoff(argv[2]);
+       if (state < 0) {
+               return cmd_usage(cmdtp);
+       }
+
+       for (i = 0; led_commands[i].string; i++) {
+               if ((strcmp("all", argv[1]) == 0) || 
+                   (strcmp(led_commands[i].string, argv[1]) == 0)) {
+                       if (led_commands[i].on) {
+                               if (state) {
+                                       led_commands[i].on();
+                               } else {
+                                       led_commands[i].off();
+                               }
+                       } else {
+                               __led_set(led_commands[i].mask, state);
+                       }
+                       break;
+               }
+       }
+
+       /* If we ran out of matches, print Usage */
+       if (!led_commands[i].string && !(strcmp("all", argv[1]) == 0)) {
+               return cmd_usage(cmdtp);
+       }
+
+       return 0;
+}
+
+U_BOOT_CMD(
+       led, 3, 1, do_led,
+       "led\t- ["
+#ifdef CONFIG_BOARD_SPECIFIC_LED
+#ifdef STATUS_LED_BIT
+       "0|"
+#endif
+#ifdef STATUS_LED_BIT1
+       "1|"
+#endif
+#ifdef STATUS_LED_BIT2
+       "2|"
+#endif
+#ifdef STATUS_LED_BIT3
+       "3|"
+#endif
+#endif
+#ifdef STATUS_LED_GREEN
+       "green|"
+#endif
+#ifdef STATUS_LED_YELLOW
+       "yellow|"
+#endif
+#ifdef STATUS_LED_RED
+       "red|"
+#endif
+#ifdef STATUS_LED_BLUE
+       "blue|"
+#endif
+       "all] [on|off]\n",
+       "led [led_name] [on|off] sets or clears led(s)\n"
+);
diff --git a/common/cmd_md5sum.c b/common/cmd_md5sum.c
new file mode 100644 (file)
index 0000000..d6ebb80
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 <common.h>
+#include <command.h>
+#include <u-boot/md5.h>
+
+static int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       unsigned long addr, len;
+       unsigned int i;
+       u8 output[16];
+
+       if (argc < 3)
+               return cmd_usage(cmdtp);
+
+       addr = simple_strtoul(argv[1], NULL, 16);
+       len = simple_strtoul(argv[2], NULL, 16);
+
+       md5((unsigned char *) addr, len, output);
+       printf("md5 for %08lx ... %08lx ==> ", addr, addr + len - 1);
+       for (i = 0; i < 16; i++)
+               printf("%02x", output[i]);
+       printf("\n");
+
+       return 0;
+}
+
+U_BOOT_CMD(
+       md5sum, 3,      1,      do_md5sum,
+       "compute MD5 message digest",
+       "address count"
+);
diff --git a/common/cmd_mdio.c b/common/cmd_mdio.c
new file mode 100644 (file)
index 0000000..4ac9de4
--- /dev/null
@@ -0,0 +1,286 @@
+/*
+ * (C) Copyright 2011 Freescale Semiconductor, Inc
+ * Andy Fleming
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/*
+ * MDIO Commands
+ */
+
+#include <common.h>
+#include <command.h>
+#include <miiphy.h>
+#include <phy.h>
+
+
+static char last_op[2];
+static uint last_data;
+static uint last_addr_lo;
+static uint last_addr_hi;
+static uint last_devad_lo;
+static uint last_devad_hi;
+static uint last_reg_lo;
+static uint last_reg_hi;
+
+static int extract_range(char *input, int *plo, int *phi)
+{
+       char *end;
+       *plo = simple_strtol(input, &end, 0);
+       if (end == input)
+               return -1;
+
+       if ((*end == '-') && *(++end))
+               *phi = simple_strtol(end, NULL, 0);
+       else if (*end == '\0')
+               *phi = *plo;
+       else
+               return -1;
+
+       return 0;
+}
+
+int mdio_write_ranges(struct mii_dev *bus, int addrlo,
+                       int addrhi, int devadlo, int devadhi,
+                       int reglo, int reghi, unsigned short data)
+{
+       int addr, devad, reg;
+       int err = 0;
+
+       for (addr = addrlo; addr <= addrhi; addr++) {
+               for (devad = devadlo; devad <= devadhi; devad++) {
+                       for (reg = reglo; reg <= reghi; reg++) {
+                               err = bus->write(bus, addr, devad, reg, data);
+
+                               if (err)
+                                       goto err_out;
+                       }
+               }
+       }
+
+err_out:
+       return err;
+}
+
+int mdio_read_ranges(struct mii_dev *bus, int addrlo,
+                       int addrhi, int devadlo, int devadhi,
+                       int reglo, int reghi)
+{
+       int addr, devad, reg;
+
+       printf("Reading from bus %s\n", bus->name);
+       for (addr = addrlo; addr <= addrhi; addr++) {
+               printf("PHY at address %d:\n", addr);
+
+               for (devad = devadlo; devad <= devadhi; devad++) {
+                       for (reg = reglo; reg <= reghi; reg++) {
+                               int val;
+
+                               val = bus->read(bus, addr, devad, reg);
+                               if (val < 0) {
+                                       printf("Error\n");
+
+                                       return val;
+                               }
+
+                               if (devad >= 0)
+                                       printf("%d.", devad);
+
+                               printf("%d - 0x%x\n", reg, val & 0xffff);
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/* The register will be in the form [a[-b].]x[-y] */
+int extract_reg_range(char *input, int *devadlo, int *devadhi,
+               int *reglo, int *reghi)
+{
+       char *regstr;
+
+       /* use strrchr to find the last string after a '.' */
+       regstr = strrchr(input, '.');
+
+       /* If it exists, extract the devad(s) */
+       if (regstr) {
+               char devadstr[32];
+
+               strncpy(devadstr, input, regstr - input);
+               devadstr[regstr - input] = '\0';
+
+               if (extract_range(devadstr, devadlo, devadhi))
+                       return -1;
+
+               regstr++;
+       } else {
+               /* Otherwise, we have no devad, and we just got regs */
+               *devadlo = *devadhi = MDIO_DEVAD_NONE;
+
+               regstr = input;
+       }
+
+       return extract_range(regstr, reglo, reghi);
+}
+
+int extract_phy_range(char *const argv[], int argc, struct mii_dev **bus,
+               int *addrlo, int *addrhi)
+{
+       struct phy_device *phydev;
+
+       if ((argc < 1) || (argc > 2))
+               return -1;
+
+       /* If there are two arguments, it's busname addr */
+       if (argc == 2) {
+               *bus = miiphy_get_dev_by_name(argv[0]);
+
+               if (!*bus)
+                       return -1;
+
+               return extract_range(argv[1], addrlo, addrhi);
+       }
+
+       /* It must be one argument, here */
+
+       /*
+        * This argument can be one of two things:
+        * 1) Ethernet device name
+        * 2) Just an address (use the previously-used bus)
+        *
+        * We check all buses for a PHY which is connected to an ethernet
+        * device by the given name.  If none are found, we call
+        * extract_range() on the string, and see if it's an address range.
+        */
+       phydev = mdio_phydev_for_ethname(argv[0]);
+
+       if (phydev) {
+               *addrlo = *addrhi = phydev->addr;
+               *bus = phydev->bus;
+
+               return 0;
+       }
+
+       /* It's an address or nothing useful */
+       return extract_range(argv[0], addrlo, addrhi);
+}
+
+/* ---------------------------------------------------------------- */
+static int do_mdio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       char op[2];
+       int addrlo, addrhi, reglo, reghi, devadlo, devadhi;
+       unsigned short  data;
+       int pos = argc - 1;
+       struct mii_dev *bus;
+
+       if (argc < 2)
+               return cmd_usage(cmdtp);
+
+       /*
+        * We use the last specified parameters, unless new ones are
+        * entered.
+        */
+       op[0] = argv[1][0];
+       addrlo = last_addr_lo;
+       addrhi = last_addr_hi;
+       devadlo = last_devad_lo;
+       devadhi = last_devad_hi;
+       reglo  = last_reg_lo;
+       reghi  = last_reg_hi;
+       data   = last_data;
+
+       bus = mdio_get_current_dev();
+
+       if (flag & CMD_FLAG_REPEAT)
+               op[0] = last_op[0];
+
+       switch (op[0]) {
+       case 'w':
+               if (pos > 1)
+                       data = simple_strtoul(argv[pos--], NULL, 16);
+       case 'r':
+               if (pos > 1)
+                       if (extract_reg_range(argv[pos--], &devadlo, &devadhi,
+                                       &reglo, &reghi))
+                               return -1;
+
+       default:
+               if (pos > 1)
+                       if (extract_phy_range(&(argv[2]), pos - 1, &bus,
+                                       &addrlo, &addrhi))
+                               return -1;
+
+               break;
+       }
+
+       if (op[0] == 'l') {
+               mdio_list_devices();
+
+               return 0;
+       }
+
+       /* Save the chosen bus */
+       miiphy_set_current_dev(bus->name);
+
+       switch (op[0]) {
+       case 'w':
+               mdio_write_ranges(bus, addrlo, addrhi, devadlo, devadhi,
+                               reglo, reghi, data);
+               break;
+
+       case 'r':
+               mdio_read_ranges(bus, addrlo, addrhi, devadlo, devadhi,
+                               reglo, reghi);
+               break;
+       }
+
+       /*
+        * Save the parameters for repeats.
+        */
+       last_op[0] = op[0];
+       last_addr_lo = addrlo;
+       last_addr_hi = addrhi;
+       last_devad_lo = devadlo;
+       last_devad_hi = devadhi;
+       last_reg_lo  = reglo;
+       last_reg_hi  = reghi;
+       last_data    = data;
+
+       return 0;
+}
+
+/***************************************************/
+
+U_BOOT_CMD(
+       mdio,   6,      1,      do_mdio,
+       "MDIO utility commands",
+       "list                   - List MDIO buses\n"
+       "mdio read <phydev> [<devad>.]<reg> - "
+               "read PHY's register at <devad>.<reg>\n"
+       "mdio write <phydev> [<devad>.]<reg> <data> - "
+               "write PHY's register at <devad>.<reg>\n"
+       "<phydev> may be:\n"
+       "   <busname>  <addr>\n"
+       "   <addr>\n"
+       "   <eth name>\n"
+       "<addr> <devad>, and <reg> may be ranges, e.g. 1-5.4-0x1f.\n"
+);
index 4b524cfc160396e7b64bc5424cbc4c525dfe8760..a5576aaab00df0f16f2342c311dd376d1594503f 100644 (file)
@@ -34,9 +34,6 @@
 #endif
 #include <watchdog.h>
 
-#include <u-boot/md5.h>
-#include <sha1.h>
-
 #ifdef CMD_MEM_DEBUG
 #define        PRINTF(fmt,args...)     printf (fmt ,##args)
 #else
@@ -1077,6 +1074,8 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
        return 0;
 }
 
+#ifdef CONFIG_CMD_CRC32
+
 #ifndef CONFIG_CRC32_VERIFY
 
 int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
@@ -1161,83 +1160,8 @@ usage:
 }
 #endif /* CONFIG_CRC32_VERIFY */
 
-#ifdef CONFIG_CMD_MD5SUM
-int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       unsigned long addr, len;
-       unsigned int i;
-       u8 output[16];
-
-       if (argc < 3)
-               return cmd_usage(cmdtp);
-
-       addr = simple_strtoul(argv[1], NULL, 16);
-       len = simple_strtoul(argv[2], NULL, 16);
-
-       md5((unsigned char *) addr, len, output);
-       printf("md5 for %08lx ... %08lx ==> ", addr, addr + len - 1);
-       for (i = 0; i < 16; i++)
-               printf("%02x", output[i]);
-       printf("\n");
-
-       return 0;
-}
-#endif
-
-#ifdef CONFIG_CMD_SHA1SUM
-int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       unsigned long addr, len;
-       unsigned int i;
-       u8 output[20];
-
-       if (argc < 3)
-               return cmd_usage(cmdtp);
-
-       addr = simple_strtoul(argv[1], NULL, 16);
-       len = simple_strtoul(argv[2], NULL, 16);
-
-       sha1_csum((unsigned char *) addr, len, output);
-       printf("SHA1 for %08lx ... %08lx ==> ", addr, addr + len - 1);
-       for (i = 0; i < 20; i++)
-               printf("%02x", output[i]);
-       printf("\n");
-
-       return 0;
-}
 #endif
 
-#ifdef CONFIG_CMD_UNZIP
-int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       unsigned long src, dst;
-       unsigned long src_len = ~0UL, dst_len = ~0UL;
-       char buf[32];
-
-       switch (argc) {
-               case 4:
-                       dst_len = simple_strtoul(argv[3], NULL, 16);
-                       /* fall through */
-               case 3:
-                       src = simple_strtoul(argv[1], NULL, 16);
-                       dst = simple_strtoul(argv[2], NULL, 16);
-                       break;
-               default:
-                       return cmd_usage(cmdtp);
-       }
-
-       if (gunzip((void *) dst, dst_len, (void *) src, &src_len) != 0)
-               return 1;
-
-       printf("Uncompressed size: %ld = 0x%lX\n", src_len, src_len);
-       sprintf(buf, "%lX", src_len);
-       setenv("filesize", buf);
-
-       return 0;
-}
-#endif /* CONFIG_CMD_UNZIP */
-
-
 /**************************************************/
 U_BOOT_CMD(
        md,     3,      1,      do_mem_md,
@@ -1277,6 +1201,8 @@ U_BOOT_CMD(
        "[.b, .w, .l] addr1 addr2 count"
 );
 
+#ifdef CONFIG_CMD_CRC32
+
 #ifndef CONFIG_CRC32_VERIFY
 
 U_BOOT_CMD(
@@ -1296,6 +1222,8 @@ U_BOOT_CMD(
 
 #endif /* CONFIG_CRC32_VERIFY */
 
+#endif
+
 U_BOOT_CMD(
        base,   2,      1,      do_mem_base,
        "print or set address offset",
@@ -1336,27 +1264,3 @@ U_BOOT_CMD(
        "[.b, .w, .l] address value delay(ms)"
 );
 #endif /* CONFIG_MX_CYCLIC */
-
-#ifdef CONFIG_CMD_MD5SUM
-U_BOOT_CMD(
-       md5sum, 3,      1,      do_md5sum,
-       "compute MD5 message digest",
-       "address count"
-);
-#endif
-
-#ifdef CONFIG_CMD_SHA1SUM
-U_BOOT_CMD(
-       sha1sum,        3,      1,      do_sha1sum,
-       "compute SHA1 message digest",
-       "address count"
-);
-#endif /* CONFIG_CMD_SHA1SUM */
-
-#ifdef CONFIG_CMD_UNZIP
-U_BOOT_CMD(
-       unzip,  4,      1,      do_unzip,
-       "unzip a memory region",
-       "srcaddr dstaddr [dstsize]"
-);
-#endif /* CONFIG_CMD_UNZIP */
index 4323f76b30549cb0a83b19c8c95b755259d2af14..6166749ad5a5c81d85585bae5976bcfdc97a6681 100644 (file)
@@ -104,7 +104,8 @@ static void print_mmcinfo(struct mmc *mmc)
                        (mmc->version >> 4) & 0xf, mmc->version & 0xf);
 
        printf("High Capacity: %s\n", mmc->high_capacity ? "Yes" : "No");
-       printf("Capacity: %lld\n", mmc->capacity);
+       puts("Capacity: ");
+       print_size(mmc->capacity, "\n");
 
        printf("Bus Width: %d-bit\n", mmc->bus_width);
 }
diff --git a/common/cmd_mmc_spi.c b/common/cmd_mmc_spi.c
new file mode 100644 (file)
index 0000000..cfd0fb1
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Command for mmc_spi setup.
+ *
+ * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <mmc.h>
+#include <spi.h>
+
+#ifndef CONFIG_MMC_SPI_BUS
+# define CONFIG_MMC_SPI_BUS 0
+#endif
+#ifndef CONFIG_MMC_SPI_CS
+# define CONFIG_MMC_SPI_CS 1
+#endif
+/* in SPI mode, MMC speed limit is 20MHz, while SD speed limit is 25MHz */
+#ifndef CONFIG_MMC_SPI_SPEED
+# define CONFIG_MMC_SPI_SPEED 25000000
+#endif
+/* MMC and SD specs only seem to care that sampling is on the
+ * rising edge ... meaning SPI modes 0 or 3.  So either SPI mode
+ * should be legit.  We'll use mode 0 since the steady state is 0,
+ * which is appropriate for hotplugging, unless the platform data
+ * specify mode 3 (if hardware is not compatible to mode 0).
+ */
+#ifndef CONFIG_MMC_SPI_MODE
+# define CONFIG_MMC_SPI_MODE SPI_MODE_0
+#endif
+
+static int do_mmc_spi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       uint bus = CONFIG_MMC_SPI_BUS;
+       uint cs = CONFIG_MMC_SPI_CS;
+       uint speed = CONFIG_MMC_SPI_SPEED;
+       uint mode = CONFIG_MMC_SPI_MODE;
+       char *endp;
+       struct mmc *mmc;
+
+       if (argc < 2)
+               goto usage;
+
+       cs = simple_strtoul(argv[1], &endp, 0);
+       if (*argv[1] == 0 || (*endp != 0 && *endp != ':'))
+               goto usage;
+       if (*endp == ':') {
+               if (endp[1] == 0)
+                       goto usage;
+               bus = cs;
+               cs = simple_strtoul(endp + 1, &endp, 0);
+               if (*endp != 0)
+                       goto usage;
+       }
+       if (argc >= 3) {
+               speed = simple_strtoul(argv[2], &endp, 0);
+               if (*argv[2] == 0 || *endp != 0)
+                       goto usage;
+       }
+       if (argc >= 4) {
+               mode = simple_strtoul(argv[3], &endp, 16);
+               if (*argv[3] == 0 || *endp != 0)
+                       goto usage;
+       }
+       if (!spi_cs_is_valid(bus, cs)) {
+               printf("Invalid SPI bus %u cs %u\n", bus, cs);
+               return 1;
+       }
+
+       mmc = mmc_spi_init(bus, cs, speed, mode);
+       if (!mmc) {
+               printf("Failed to create MMC Device\n");
+               return 1;
+       }
+       printf("%s: %d at %u:%u hz %u mode %u\n", mmc->name, mmc->block_dev.dev,
+              bus, cs, speed, mode);
+       mmc_init(mmc);
+       return 0;
+
+usage:
+       cmd_usage(cmdtp);
+       return 1;
+}
+
+U_BOOT_CMD(
+       mmc_spi,        4,      0,      do_mmc_spi,
+       "mmc_spi setup",
+       "[bus:]cs [hz] [mode]   - setup mmc_spi device"
+);
index fb69c242f1c890c5febd75a92afa9b304fe42585..aa9de3a4ea31a8f141d066c6bbafd19a60fb2a4c 100644 (file)
@@ -4,7 +4,9 @@
  *
  * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  * Andreas Heppel <aheppel@sysgo.de>
-
+ *
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if !defined(CONFIG_ENV_IS_IN_EEPROM)  && \
-    !defined(CONFIG_ENV_IS_IN_FLASH)   && \
-    !defined(CONFIG_ENV_IS_IN_DATAFLASH)       && \
-    !defined(CONFIG_ENV_IS_IN_MG_DISK) && \
-    !defined(CONFIG_ENV_IS_IN_MMC)  && \
-    !defined(CONFIG_ENV_IS_IN_NAND)    && \
-    !defined(CONFIG_ENV_IS_IN_NVRAM)   && \
-    !defined(CONFIG_ENV_IS_IN_ONENAND) && \
-    !defined(CONFIG_ENV_IS_IN_SPI_FLASH)       && \
-    !defined(CONFIG_ENV_IS_NOWHERE)
+#if    !defined(CONFIG_ENV_IS_IN_EEPROM)       && \
+       !defined(CONFIG_ENV_IS_IN_FLASH)        && \
+       !defined(CONFIG_ENV_IS_IN_DATAFLASH)    && \
+       !defined(CONFIG_ENV_IS_IN_MG_DISK)      && \
+       !defined(CONFIG_ENV_IS_IN_MMC)          && \
+       !defined(CONFIG_ENV_IS_IN_NAND)         && \
+       !defined(CONFIG_ENV_IS_IN_NVRAM)        && \
+       !defined(CONFIG_ENV_IS_IN_ONENAND)      && \
+       !defined(CONFIG_ENV_IS_IN_SPI_FLASH)    && \
+       !defined(CONFIG_ENV_IS_NOWHERE)
 # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\
-SPI_FLASH|MG_DISK|NVRAM|MMC|NOWHERE}
+SPI_FLASH|MG_DISK|NVRAM|MMC} or CONFIG_ENV_IS_NOWHERE
 #endif
 
 #define XMK_STR(x)     #x
@@ -93,7 +95,7 @@ static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
  */
 static int env_id = 1;
 
-int get_env_id (void)
+int get_env_id(void)
 {
        return env_id;
 }
@@ -116,7 +118,7 @@ static int env_print(char *name)
                hsearch_r(e, FIND, &ep, &env_htab);
                if (ep == NULL)
                        return 0;
-               len = printf ("%s=%s\n", ep->key, ep->data);
+               len = printf("%s=%s\n", ep->key, ep->data);
                return len;
        }
 
@@ -160,6 +162,37 @@ int do_env_print (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        return rcode;
 }
 
+#ifdef CONFIG_CMD_GREPENV
+static int do_env_grep (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       ENTRY *match;
+       unsigned char matched[env_htab.size / 8];
+       int rcode = 1, arg = 1, idx;
+
+       if (argc < 2)
+               return cmd_usage(cmdtp);
+
+       memset(matched, 0, env_htab.size / 8);
+
+       while (arg <= argc) {
+               idx = 0;
+               while ((idx = hstrstr_r(argv[arg], idx, &match, &env_htab))) {
+                       if (!(matched[idx / 8] & (1 << (idx & 7)))) {
+                               puts(match->key);
+                               puts("=");
+                               puts(match->data);
+                               puts("\n");
+                       }
+                       matched[idx / 8] |= 1 << (idx & 7);
+                       rcode = 0;
+               }
+               arg++;
+       }
+
+       return rcode;
+}
+#endif
+
 /*
  * Set a new environment variable,
  * or replace or delete an existing one.
@@ -176,7 +209,7 @@ int _do_env_set (int flag, int argc, char * const argv[])
        name = argv[1];
 
        if (strchr(name, '=')) {
-               printf ("## Error: illegal character '=' in variable name \"%s\"\n", name);
+               printf("## Error: illegal character '=' in variable name \"%s\"\n", name);
                return 1;
        }
 
@@ -189,13 +222,12 @@ int _do_env_set (int flag, int argc, char * const argv[])
        hsearch_r(e, FIND, &ep, &env_htab);
 
        /* Check for console redirection */
-       if (strcmp(name,"stdin") == 0) {
+       if (strcmp(name, "stdin") == 0)
                console = stdin;
-       } else if (strcmp(name,"stdout") == 0) {
+       else if (strcmp(name, "stdout") == 0)
                console = stdout;
-       } else if (strcmp(name,"stderr") == 0) {
+       else if (strcmp(name, "stderr") == 0)
                console = stderr;
-       }
 
        if (console != -1) {
                if (argc < 3) {         /* Cannot delete it! */
@@ -209,11 +241,11 @@ int _do_env_set (int flag, int argc, char * const argv[])
                        return i;
 #else
                /* Try assigning specified device */
-               if (console_assign (console, argv[2]) < 0)
+               if (console_assign(console, argv[2]) < 0)
                        return 1;
 
 #ifdef CONFIG_SERIAL_MULTI
-               if (serial_assign (argv[2]) < 0)
+               if (serial_assign(argv[2]) < 0)
                        return 1;
 #endif
 #endif /* CONFIG_CONSOLE_MUX */
@@ -225,28 +257,28 @@ int _do_env_set (int flag, int argc, char * const argv[])
         */
        if (ep) {               /* variable exists */
 #ifndef CONFIG_ENV_OVERWRITE
-               if ((strcmp (name, "serial#") == 0) ||
-                   ((strcmp (name, "ethaddr") == 0)
+               if ((strcmp(name, "serial#") == 0) ||
+                   ((strcmp(name, "ethaddr") == 0)
 #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR)
-                    && (strcmp (ep->data,MK_STR(CONFIG_ETHADDR)) != 0)
+                    && (strcmp(ep->data, MK_STR(CONFIG_ETHADDR)) != 0)
 #endif /* CONFIG_OVERWRITE_ETHADDR_ONCE && CONFIG_ETHADDR */
                    ) ) {
-                       printf ("Can't overwrite \"%s\"\n", name);
+                       printf("Can't overwrite \"%s\"\n", name);
                        return 1;
                }
 #endif
                /*
                 * Switch to new baudrate if new baudrate is supported
                 */
-               if (strcmp(name,"baudrate") == 0) {
+               if (strcmp(name, "baudrate") == 0) {
                        int baudrate = simple_strtoul(argv[2], NULL, 10);
                        int i;
-                       for (i=0; i<N_BAUDRATES; ++i) {
+                       for (i = 0; i < N_BAUDRATES; ++i) {
                                if (baudrate == baudrate_table[i])
                                        break;
                        }
                        if (i == N_BAUDRATES) {
-                               printf ("## Baudrate %d bps not supported\n",
+                               printf("## Baudrate %d bps not supported\n",
                                        baudrate);
                                return 1;
                        }
@@ -258,11 +290,11 @@ int _do_env_set (int flag, int argc, char * const argv[])
                        gd->bd->bi_baudrate = baudrate;
 #endif
 
-                       serial_setbrg ();
+                       serial_setbrg();
                        udelay(50000);
                        for (;;) {
                                if (getc() == '\r')
-                                     break;
+                                       break;
                        }
                }
        }
@@ -276,14 +308,15 @@ int _do_env_set (int flag, int argc, char * const argv[])
        /*
         * Insert / replace new value
         */
-       for (i=2,len=0; i<argc; ++i) {
+       for (i = 2, len = 0; i < argc; ++i)
                len += strlen(argv[i]) + 1;
-       }
-       if ((value = malloc(len)) == NULL) {
+
+       value = malloc(len);
+       if (value == NULL) {
                printf("## Can't malloc %d bytes\n", len);
                return 1;
        }
-       for (i=2,s=value; i<argc; ++i) {
+       for (i = 2, s = value; i < argc; ++i) {
                char *v = argv[i];
 
                while ((*s++ = *v++) != '\0')
@@ -308,12 +341,12 @@ int _do_env_set (int flag, int argc, char * const argv[])
         * entry in the environment is changed
         */
 
-       if (strcmp(name,"ipaddr") == 0) {
+       if (strcmp(name, "ipaddr") == 0) {
                char *s = argv[2];      /* always use only one arg */
                char *e;
                unsigned long addr;
                bd->bi_ip_addr = 0;
-               for (addr=0, i=0; i<4; ++i) {
+               for (addr = 0, i = 0; i < 4; ++i) {
                        ulong val = s ? simple_strtoul(s, &e, 10) : 0;
                        addr <<= 8;
                        addr  |= (val & 0xFF);
@@ -321,20 +354,20 @@ int _do_env_set (int flag, int argc, char * const argv[])
                }
                bd->bi_ip_addr = htonl(addr);
                return 0;
-       } else if (strcmp(argv[1],"loadaddr") == 0) {
+       } else if (strcmp(argv[1], "loadaddr") == 0) {
                load_addr = simple_strtoul(argv[2], NULL, 16);
                return 0;
        }
 #if defined(CONFIG_CMD_NET)
-       else if (strcmp(argv[1],"bootfile") == 0) {
-               copy_filename (BootFile, argv[2], sizeof(BootFile));
+       else if (strcmp(argv[1], "bootfile") == 0) {
+               copy_filename(BootFile, argv[2], sizeof(BootFile));
                return 0;
        }
 #endif
        return 0;
 }
 
-int setenv (char *varname, char *varvalue)
+int setenv(char *varname, char *varvalue)
 {
        char * const argv[4] = { "setenv", varname, varvalue, NULL };
        if ((varvalue == NULL) || (varvalue[0] == '\0'))
@@ -343,7 +376,7 @@ int setenv (char *varname, char *varvalue)
                return _do_env_set(0, 3, argv);
 }
 
-int do_env_set (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_env_set(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        if (argc < 2)
                return cmd_usage(cmdtp);
@@ -355,7 +388,7 @@ int do_env_set (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  * Prompt for environment variable
  */
 #if defined(CONFIG_CMD_ASKENV)
-int do_env_ask ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_env_ask(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        extern char console_buffer[CONFIG_SYS_CBSIZE];
        char message[CONFIG_SYS_CBSIZE];
@@ -383,10 +416,10 @@ int do_env_ask ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                break;
 
        default:        /* env_ask envname message1 ... messagen size */
-               for (i=2,pos=0; i < argc - 1; i++) {
-                       if (pos) {
+               for (i = 2, pos = 0; i < argc - 1; i++) {
+                       if (pos)
                                message[pos++] = ' ';
-                       }
+
                        strcpy(message+pos, argv[i]);
                        pos += strlen(argv[i]);
                }
@@ -449,7 +482,7 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  * return address of storage for that variable,
  * or NULL if not found
  */
-char *getenv (char *name)
+char *getenv(char *name)
 {
        if (gd->flags & GD_FLG_ENV_READY) {     /* after import into hashtable */
                ENTRY e, *ep;
@@ -460,7 +493,7 @@ char *getenv (char *name)
                e.data = NULL;
                hsearch_r(e, FIND, &ep, &env_htab);
 
-               return (ep ? ep->data : NULL);
+               return ep ? ep->data : NULL;
        }
 
        /* restricted capabilities before import */
@@ -474,23 +507,24 @@ char *getenv (char *name)
 /*
  * Look up variable from environment for restricted C runtime env.
  */
-int getenv_f (char *name, char *buf, unsigned len)
+int getenv_f(char *name, char *buf, unsigned len)
 {
        int i, nxt;
 
-       for (i=0; env_get_char(i) != '\0'; i=nxt+1) {
+       for (i = 0; env_get_char(i) != '\0'; i = nxt+1) {
                int val, n;
 
-               for (nxt=i; env_get_char(nxt) != '\0'; ++nxt) {
-                       if (nxt >= CONFIG_ENV_SIZE) {
-                               return (-1);
-                       }
+               for (nxt = i; env_get_char(nxt) != '\0'; ++nxt) {
+                       if (nxt >= CONFIG_ENV_SIZE)
+                               return -1;
                }
-               if ((val=envmatch((uchar *)name, i)) < 0)
+
+               val = envmatch((uchar *)name, i);
+               if (val < 0)
                        continue;
 
                /* found; copy out */
-               for (n=0; n<len; ++n, ++buf) {
+               for (n = 0; n < len; ++n, ++buf) {
                        if ((*buf = env_get_char(val++)) == '\0')
                                return n;
                }
@@ -502,18 +536,18 @@ int getenv_f (char *name, char *buf, unsigned len)
 
                return n;
        }
-       return (-1);
+       return -1;
 }
 
 #if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
 
-int do_env_save (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_env_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       extern char * env_name_spec;
+       extern char *env_name_spec;
 
-       printf ("Saving Environment to %s...\n", env_name_spec);
+       printf("Saving Environment to %s...\n", env_name_spec);
 
-       return (saveenv() ? 1 : 0);
+       return saveenv() ? 1 : 0;
 }
 
 U_BOOT_CMD(
@@ -533,32 +567,32 @@ U_BOOT_CMD(
  * If the names match, return the index for the value2, else NULL.
  */
 
-int envmatch (uchar *s1, int i2)
+int envmatch(uchar *s1, int i2)
 {
-
        while (*s1 == env_get_char(i2++))
                if (*s1++ == '=')
-                       return(i2);
+                       return i2;
        if (*s1 == '\0' && env_get_char(i2-1) == '=')
-               return(i2);
-       return(-1);
+               return i2;
+       return -1;
 }
 
-static int do_env_default(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_env_default(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       if ((argc != 2) || (strcmp(argv[1], "-f") != 0)) {
+       if ((argc != 2) || (strcmp(argv[1], "-f") != 0))
                return cmd_usage(cmdtp);
-       }
+
        set_default_env("## Resetting to default environment\n");
        return 0;
 }
 
-static int do_env_delete(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_env_delete(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        printf("Not implemented yet\n");
        return 0;
 }
 
+#ifdef CONFIG_CMD_EXPORTENV
 /*
  * env export [-t | -b | -c] addr [size]
  *     -t:     export as text format; if size is given, data will be
@@ -639,9 +673,8 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
                }
        }
 
-       if (argc < 1) {
+       if (argc < 1)
                return cmd_usage(cmdtp);
-       }
 
        addr = (char *)simple_strtoul(argv[0], NULL, 16);
 
@@ -659,7 +692,7 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
                                errno);
                        return 1;
                }
-               sprintf(buf, "%zX", len);
+               sprintf(buf, "%zX", (size_t)len);
                setenv("filesize", buf);
 
                return 0;
@@ -685,7 +718,7 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
                envp->flags = ACTIVE_FLAG;
 #endif
        }
-       sprintf(buf, "%zX", len + offsetof(env_t,data));
+       sprintf(buf, "%zX", (size_t)(len + offsetof(env_t, data)));
        setenv("filesize", buf);
 
        return 0;
@@ -695,7 +728,9 @@ sep_err:
                cmd);
        return 1;
 }
+#endif
 
+#ifdef CONFIG_CMD_IMPORTENV
 /*
  * env import [-d] [-t | -b | -c] addr [size]
  *     -d:     delete existing environment before importing;
@@ -708,7 +743,7 @@ sep_err:
  *     size:   length of input data; if missing, proper '\0'
  *             termination is mandatory
  */
-static int do_env_import(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_env_import(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        char    *cmd, *addr;
        char    sep = '\n';
@@ -748,9 +783,8 @@ static int do_env_import(cmd_tbl_t * cmdtp, int flag, int argc, char * const arg
                }
        }
 
-       if (argc < 1) {
+       if (argc < 1)
                return cmd_usage(cmdtp);
-       }
 
        if (!fmt)
                printf("## Warning: defaulting to text format\n");
@@ -805,9 +839,10 @@ sep_err:
                cmd);
        return 1;
 }
+#endif
 
 #if defined(CONFIG_CMD_RUN)
-extern int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+extern int do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 #endif
 
 /*
@@ -822,8 +857,15 @@ static cmd_tbl_t cmd_env_sub[] = {
 #if defined(CONFIG_CMD_EDITENV)
        U_BOOT_CMD_MKENT(edit, 2, 0, do_env_edit, "", ""),
 #endif
+#if defined(CONFIG_CMD_EXPORTENV)
        U_BOOT_CMD_MKENT(export, 4, 0, do_env_export, "", ""),
+#endif
+#if defined(CONFIG_CMD_GREPENV)
+       U_BOOT_CMD_MKENT(grep, CONFIG_SYS_MAXARGS, 1, do_env_grep, "", ""),
+#endif
+#if defined(CONFIG_CMD_IMPORTENV)
        U_BOOT_CMD_MKENT(import, 5, 0, do_env_import, "", ""),
+#endif
        U_BOOT_CMD_MKENT(print, CONFIG_SYS_MAXARGS, 1, do_env_print, "", ""),
 #if defined(CONFIG_CMD_RUN)
        U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
@@ -841,7 +883,7 @@ void env_reloc(void)
 }
 #endif
 
-static int do_env (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_env(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        cmd_tbl_t *cp;
 
@@ -870,8 +912,11 @@ U_BOOT_CMD(
 #if defined(CONFIG_CMD_EDITENV)
        "env edit name - edit environment variable\n"
 #endif
-       "env export [-t | -b | -c] addr [size] - export environmnt\n"
-       "env import [-d] [-t | -b | -c] addr [size] - import environmnt\n"
+       "env export [-t | -b | -c] addr [size] - export environment\n"
+#if defined(CONFIG_CMD_GREPENV)
+       "env grep string [...] - search environment\n"
+#endif
+       "env import [-d] [-t | -b | -c] addr [size] - import environment\n"
        "env print [name ...] - print environment\n"
 #if defined(CONFIG_CMD_RUN)
        "env run var [...] - run commands in an environment variable\n"
@@ -903,6 +948,16 @@ U_BOOT_CMD_COMPLETE(
        var_complete
 );
 
+#ifdef CONFIG_CMD_GREPENV
+U_BOOT_CMD_COMPLETE(
+       grepenv, CONFIG_SYS_MAXARGS, 0,  do_env_grep,
+       "search environment variables",
+       "string ...\n"
+       "    - list environment name=value pairs matching 'string'",
+       var_complete
+);
+#endif
+
 U_BOOT_CMD_COMPLETE(
        setenv, CONFIG_SYS_MAXARGS, 0,  do_env_set,
        "set environment variables",
index 6e7be818ebe8cae981d2cfe2f68991dfac20603c..11a491df769fc81206d9dfe82584b443e468c029 100644 (file)
 
 static struct spi_flash *flash;
 
+
+/*
+ * This function computes the length argument for the erase command.
+ * The length on which the command is to operate can be given in two forms:
+ * 1. <cmd> offset len  - operate on <'offset',  'len')
+ * 2. <cmd> offset +len - operate on <'offset',  'round_up(len)')
+ * If the second form is used and the length doesn't fall on the
+ * sector boundary, than it will be adjusted to the next sector boundary.
+ * If it isn't in the flash, the function will fail (return -1).
+ * Input:
+ *    arg: length specification (i.e. both command arguments)
+ * Output:
+ *    len: computed length for operation
+ * Return:
+ *    1: success
+ *   -1: failure (bad format, bad address).
+ */
+static int sf_parse_len_arg(char *arg, ulong *len)
+{
+       char *ep;
+       char round_up_len; /* indicates if the "+length" form used */
+       ulong len_arg;
+
+       round_up_len = 0;
+       if (*arg == '+') {
+               round_up_len = 1;
+               ++arg;
+       }
+
+       len_arg = simple_strtoul(arg, &ep, 16);
+       if (ep == arg || *ep != '\0')
+               return -1;
+
+       if (round_up_len && flash->sector_size > 0)
+               *len = ROUND(len_arg - 1, flash->sector_size);
+       else
+               *len = len_arg;
+
+       return 1;
+}
+
 static int do_spi_flash_probe(int argc, char * const argv[])
 {
        unsigned int bus = 0;
@@ -29,30 +70,30 @@ static int do_spi_flash_probe(int argc, char * const argv[])
        struct spi_flash *new;
 
        if (argc < 2)
-               goto usage;
+               return -1;
 
        cs = simple_strtoul(argv[1], &endp, 0);
        if (*argv[1] == 0 || (*endp != 0 && *endp != ':'))
-               goto usage;
+               return -1;
        if (*endp == ':') {
                if (endp[1] == 0)
-                       goto usage;
+                       return -1;
 
                bus = cs;
                cs = simple_strtoul(endp + 1, &endp, 0);
                if (*endp != 0)
-                       goto usage;
+                       return -1;
        }
 
        if (argc >= 3) {
                speed = simple_strtoul(argv[2], &endp, 0);
                if (*argv[2] == 0 || *endp != 0)
-                       goto usage;
+                       return -1;
        }
        if (argc >= 4) {
                mode = simple_strtoul(argv[3], &endp, 16);
                if (*argv[3] == 0 || *endp != 0)
-                       goto usage;
+                       return -1;
        }
 
        new = spi_flash_probe(bus, cs, speed, mode);
@@ -65,14 +106,7 @@ static int do_spi_flash_probe(int argc, char * const argv[])
                spi_flash_free(flash);
        flash = new;
 
-       printf("%u KiB %s at %u:%u is now current device\n",
-                       flash->size >> 10, flash->name, bus, cs);
-
        return 0;
-
-usage:
-       puts("Usage: sf probe [bus:]cs [hz] [mode]\n");
-       return 1;
 }
 
 static int do_spi_flash_read_write(int argc, char * const argv[])
@@ -85,17 +119,17 @@ static int do_spi_flash_read_write(int argc, char * const argv[])
        int ret;
 
        if (argc < 4)
-               goto usage;
+               return -1;
 
        addr = simple_strtoul(argv[1], &endp, 16);
        if (*argv[1] == 0 || *endp != 0)
-               goto usage;
+               return -1;
        offset = simple_strtoul(argv[2], &endp, 16);
        if (*argv[2] == 0 || *endp != 0)
-               goto usage;
+               return -1;
        len = simple_strtoul(argv[3], &endp, 16);
        if (*argv[3] == 0 || *endp != 0)
-               goto usage;
+               return -1;
 
        buf = map_physmem(addr, len, MAP_WRBACK);
        if (!buf) {
@@ -116,10 +150,6 @@ static int do_spi_flash_read_write(int argc, char * const argv[])
        }
 
        return 0;
-
-usage:
-       printf("Usage: sf %s addr offset len\n", argv[0]);
-       return 1;
 }
 
 static int do_spi_flash_erase(int argc, char * const argv[])
@@ -130,14 +160,15 @@ static int do_spi_flash_erase(int argc, char * const argv[])
        int ret;
 
        if (argc < 3)
-               goto usage;
+               return -1;
 
        offset = simple_strtoul(argv[1], &endp, 16);
        if (*argv[1] == 0 || *endp != 0)
-               goto usage;
-       len = simple_strtoul(argv[2], &endp, 16);
-       if (*argv[2] == 0 || *endp != 0)
-               goto usage;
+               return -1;
+
+       ret = sf_parse_len_arg(argv[2], &len);
+       if (ret != 1)
+               return -1;
 
        ret = spi_flash_erase(flash, offset, len);
        if (ret) {
@@ -146,24 +177,25 @@ static int do_spi_flash_erase(int argc, char * const argv[])
        }
 
        return 0;
-
-usage:
-       puts("Usage: sf erase offset len\n");
-       return 1;
 }
 
 static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        const char *cmd;
+       int ret;
 
        /* need at least two arguments */
        if (argc < 2)
                goto usage;
 
        cmd = argv[1];
+       --argc;
+       ++argv;
 
-       if (strcmp(cmd, "probe") == 0)
-               return do_spi_flash_probe(argc - 1, argv + 1);
+       if (strcmp(cmd, "probe") == 0) {
+               ret = do_spi_flash_probe(argc, argv);
+               goto done;
+       }
 
        /* The remaining commands require a selected device */
        if (!flash) {
@@ -172,9 +204,15 @@ static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[
        }
 
        if (strcmp(cmd, "read") == 0 || strcmp(cmd, "write") == 0)
-               return do_spi_flash_read_write(argc - 1, argv + 1);
-       if (strcmp(cmd, "erase") == 0)
-               return do_spi_flash_erase(argc - 1, argv + 1);
+               ret = do_spi_flash_read_write(argc, argv);
+       else if (strcmp(cmd, "erase") == 0)
+               ret = do_spi_flash_erase(argc, argv);
+       else
+               ret = -1;
+
+done:
+       if (ret != -1)
+               return ret;
 
 usage:
        return cmd_usage(cmdtp);
@@ -189,5 +227,6 @@ U_BOOT_CMD(
        "                                 `offset' to memory at `addr'\n"
        "sf write addr offset len       - write `len' bytes from memory\n"
        "                                 at `addr' to flash at `offset'\n"
-       "sf erase offset len            - erase `len' bytes from `offset'"
+       "sf erase offset [+]len         - erase `len' bytes from `offset'\n"
+       "                                 `+len' round up `len' to block size"
 );
diff --git a/common/cmd_sha1sum.c b/common/cmd_sha1sum.c
new file mode 100644 (file)
index 0000000..bb3cff0
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 <common.h>
+#include <command.h>
+#include <sha1.h>
+
+static int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       unsigned long addr, len;
+       unsigned int i;
+       u8 output[20];
+
+       if (argc < 3)
+               return cmd_usage(cmdtp);
+
+       addr = simple_strtoul(argv[1], NULL, 16);
+       len = simple_strtoul(argv[2], NULL, 16);
+
+       sha1_csum((unsigned char *) addr, len, output);
+       printf("SHA1 for %08lx ... %08lx ==> ", addr, addr + len - 1);
+       for (i = 0; i < 20; i++)
+               printf("%02x", output[i]);
+       printf("\n");
+
+       return 0;
+}
+
+U_BOOT_CMD(
+       sha1sum,        3,      1,      do_sha1sum,
+       "compute SHA1 message digest",
+       "address count"
+);
diff --git a/common/cmd_unzip.c b/common/cmd_unzip.c
new file mode 100644 (file)
index 0000000..6483b92
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 <common.h>
+#include <command.h>
+
+static int do_unzip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       unsigned long src, dst;
+       unsigned long src_len = ~0UL, dst_len = ~0UL;
+       char buf[32];
+
+       switch (argc) {
+               case 4:
+                       dst_len = simple_strtoul(argv[3], NULL, 16);
+                       /* fall through */
+               case 3:
+                       src = simple_strtoul(argv[1], NULL, 16);
+                       dst = simple_strtoul(argv[2], NULL, 16);
+                       break;
+               default:
+                       return cmd_usage(cmdtp);
+       }
+
+       if (gunzip((void *) dst, dst_len, (void *) src, &src_len) != 0)
+               return 1;
+
+       printf("Uncompressed size: %ld = 0x%lX\n", src_len, src_len);
+       sprintf(buf, "%lX", src_len);
+       setenv("filesize", buf);
+
+       return 0;
+}
+
+U_BOOT_CMD(
+       unzip,  4,      1,      do_unzip,
+       "unzip a memory region",
+       "srcaddr dstaddr [dstsize]"
+);
index b5731a7bb8d2235df31e607f74ac514df1bcd71b..3ba6fff4fd325f7e83605a4d0313fa803ad27133 100644 (file)
@@ -588,7 +588,7 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                                        break;
                        }
                        if (dev == NULL) {
-                               printf("*** NO Device avaiable ***\n");
+                               printf("*** No device available ***\n");
                                return 0;
                        } else {
                                usb_display_desc(dev);
index a7a30de22bb567777f600f00e0b9d670523a316e..7a388bb9fa10ac03915224110ebef119d9ae83e3 100644 (file)
@@ -18,7 +18,7 @@ spd_check(const u8 *buf, u8 spd_rev, u8 spd_cksum)
 
        /*
         * Check SPD revision supported
-        * Rev 1.2 or less supported by this code
+        * Rev 1.X or less supported by this code
         */
        if (spd_rev >= 0x20) {
                printf("SPD revision %02X not supported by this code\n",
index 71dcc4c3e2547c54e104dc0ac10fac802b7a54b5..83f40f43417ef39ca88b6b94e9e03e84924da920 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
+ * (C) Copyright 2008-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -51,6 +51,19 @@ static void use_default(void);
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if !defined(CONFIG_ENV_OFFSET)
+#define CONFIG_ENV_OFFSET 0
+#endif
+
+static int __mmc_get_env_addr(struct mmc *mmc, u32 *env_addr)
+{
+       *env_addr = CONFIG_ENV_OFFSET;
+       return 0;
+}
+__attribute__((weak, alias("__mmc_get_env_addr")))
+int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr);
+
+
 uchar env_get_char_spec(int index)
 {
        return *((uchar *)(gd->env_addr + index));
@@ -102,10 +115,14 @@ int saveenv(void)
        ssize_t len;
        char    *res;
        struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
+       u32 offset;
 
        if (init_mmc_for_env(mmc))
                return 1;
 
+       if(mmc_get_env_addr(mmc, &offset))
+               return 1;
+
        res = (char *)&env_new.data;
        len = hexport_r(&env_htab, '\0', &res, ENV_SIZE);
        if (len < 0) {
@@ -114,7 +131,7 @@ int saveenv(void)
        }
        env_new.crc   = crc32(0, env_new.data, ENV_SIZE);
        printf("Writing to MMC(%d)... ", CONFIG_SYS_MMC_ENV_DEV);
-       if (write_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, (u_char *)&env_new)) {
+       if (write_env(mmc, CONFIG_ENV_SIZE, offset, (u_char *)&env_new)) {
                puts("failed\n");
                return 1;
        }
@@ -141,16 +158,22 @@ inline int read_env(struct mmc *mmc, unsigned long size,
 void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
-       char buf[CONFIG_ENV_SIZE];
+       char buf[CONFIG_ENV_SIZE];
 
        struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
+       u32 offset;
 
        if (init_mmc_for_env(mmc)) {
                use_default();
                return;
        }
 
-       if (read_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, buf)) {
+       if(mmc_get_env_addr(mmc, &offset)) {
+               use_default();
+               return ;
+       }
+
+       if (read_env(mmc, CONFIG_ENV_SIZE, offset, buf)) {
                use_default();
                return;
        }
index 41cc00aeabb141d83f37039af054136944a7ad6a..d3b36d01053586b3f8bb155b3eade8460efecc1b 100644 (file)
@@ -59,7 +59,6 @@ DECLARE_GLOBAL_DATA_PTR;
 extern uchar default_environment[];
 
 char * env_name_spec = "SPI Flash";
-env_t *env_ptr;
 
 static struct spi_flash *env_flash;
 
@@ -79,7 +78,7 @@ int saveenv(void)
        char    *saved_buffer = NULL;
        u32     sector = 1;
        int     ret;
-       char    flag = OBSOLETE_FLAG, new_flag = ACTIVE_FLAG;
+       char    flag = OBSOLETE_FLAG;
 
        if (!env_flash) {
                env_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS,
@@ -159,7 +158,7 @@ int saveenv(void)
 
        gd->env_valid = (gd->env_valid == 2 ? 1 : 2);
 
-       printf("Valid environment: %d\n", gd->env_valid);
+       printf("Valid environment: %d\n", (int)gd->env_valid);
 
  done:
        if (saved_buffer)
@@ -174,25 +173,20 @@ void env_relocate_spec(void)
        env_t *tmp_env1 = NULL;
        env_t *tmp_env2 = NULL;
        env_t *ep = NULL;
-       uchar flag1, flag2;
-       /* current_env is set only in case both areas are valid! */
-       int current_env = 0;
 
        tmp_env1 = (env_t *)malloc(CONFIG_ENV_SIZE);
        tmp_env2 = (env_t *)malloc(CONFIG_ENV_SIZE);
 
        if (!tmp_env1 || !tmp_env2) {
-               free(tmp_env1);
-               free(tmp_env2);
                set_default_env("!malloc() failed");
-               return;
+               goto out;
        }
 
        env_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
                        CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
        if (!env_flash) {
                set_default_env("!spi_flash_probe() failed");
-               return;
+               goto out;
        }
 
        ret = spi_flash_read(env_flash, CONFIG_ENV_OFFSET,
@@ -204,33 +198,30 @@ void env_relocate_spec(void)
 
        if (crc32(0, tmp_env1->data, ENV_SIZE) == tmp_env1->crc)
                crc1_ok = 1;
-       flag1 = tmp_env1->flags;
 
        ret = spi_flash_read(env_flash, CONFIG_ENV_OFFSET_REDUND,
                                CONFIG_ENV_SIZE, tmp_env2);
        if (!ret) {
                if (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc)
                        crc2_ok = 1;
-               flag2 = tmp_env2->flags;
        }
 
        if (!crc1_ok && !crc2_ok) {
-               free(tmp_env1);
-               free(tmp_env2);
                set_default_env("!bad CRC");
-               return;
+               goto err_read;
        } else if (crc1_ok && !crc2_ok) {
                gd->env_valid = 1;
-               ep = tmp_env1;
        } else if (!crc1_ok && crc2_ok) {
+               gd->env_valid = 2;
+       } else if (tmp_env1->flags == ACTIVE_FLAG &&
+                  tmp_env2->flags == OBSOLETE_FLAG) {
                gd->env_valid = 1;
-       } else if (flag1 == ACTIVE_FLAG && flag2 == OBSOLETE_FLAG) {
-               gd->env_valid = 1;
-       } else if (flag1 == OBSOLETE_FLAG && flag2 == ACTIVE_FLAG) {
+       } else if (tmp_env1->flags == OBSOLETE_FLAG &&
+                  tmp_env2->flags == ACTIVE_FLAG) {
                gd->env_valid = 2;
-       } else if (flag1 == flag2) {
+       } else if (tmp_env1->flags == tmp_env2->flags) {
                gd->env_valid = 2;
-       } else if (flag1 == 0xFF) {
+       } else if (tmp_env1->flags == 0xFF) {
                gd->env_valid = 2;
        } else {
                /*
@@ -240,8 +231,6 @@ void env_relocate_spec(void)
                gd->env_valid = 2;
        }
 
-       free(env_ptr);
-
        if (gd->env_valid == 1)
                ep = tmp_env1;
        else
@@ -257,10 +246,6 @@ err_read:
        spi_flash_free(env_flash);
        env_flash = NULL;
 out:
-       if (tmp_env1)
-               free(tmp_env1);
-       if (tmp_env2)
-               free(tmp_env2);
        free(tmp_env1);
        free(tmp_env2);
 
index 3dff7351bc3d3a5204d4fde0cdeb5d16b28d4bc9..717e4afe6d877eca2f5c62e5bcd145cac97f9537 100644 (file)
@@ -15,7 +15,7 @@ unsigned long get_version(void)
 /* Reuse _exports.h with a little trickery to avoid bitrot */
 #define EXPORT_FUNC(sym) gd->jt[XF_##sym] = (void *)sym;
 
-#if !defined(CONFIG_I386) && !defined(CONFIG_PPC)
+#if !defined(CONFIG_X86) && !defined(CONFIG_PPC)
 # define install_hdlr      dummy
 # define free_hdlr         dummy
 #else /* kludge for non-standard function naming */
index 6c98e5b07a47269789935160ff8912da21bd034c..496040b54c8daf0188eef1f8680d3ac45809d9ad 100644 (file)
@@ -183,7 +183,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force)
                }
        }
 
-       err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start + 1);
+       err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start);
        if (err < 0) {
                printf("fdt_initrd: %s\n", fdt_strerror(err));
                return err;
@@ -394,7 +394,7 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
 {
        int err, nodeoffset;
        int addr_cell_len, size_cell_len, len;
-       u8 tmp[banks * 8];
+       u8 tmp[banks * 16]; /* Up to 64-bit address + 64-bit size */
        int bank;
 
        err = fdt_check_header(blob);
index f63a2ff1a05b4d5aa3d38df62b3553ad31d6b21f..e542a5736710ec94ef547158211c0365bc2372e3 100644 (file)
@@ -454,6 +454,22 @@ phys_size_t getenv_bootm_size(void)
 #endif
 }
 
+phys_size_t getenv_bootm_mapsize(void)
+{
+       phys_size_t tmp;
+       char *s = getenv ("bootm_mapsize");
+       if (s) {
+               tmp = (phys_size_t)simple_strtoull (s, NULL, 16);
+               return tmp;
+       }
+
+#if defined(CONFIG_SYS_BOOTMAPSZ)
+       return CONFIG_SYS_BOOTMAPSZ;
+#else
+       return getenv_bootm_size();
+#endif
+}
+
 void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
 {
        if (to == from)
@@ -1169,10 +1185,37 @@ static int fit_check_fdt (const void *fit, int fdt_noffset, int verify)
 #define CONFIG_SYS_FDT_PAD 0x3000
 #endif
 
+#if defined(CONFIG_OF_LIBFDT)
+/**
+ * boot_fdt_add_mem_rsv_regions - Mark the memreserve sections as unusable
+ * @lmb: pointer to lmb handle, will be used for memory mgmt
+ * @fdt_blob: pointer to fdt blob base address
+ *
+ * Adds the memreserve regions in the dtb to the lmb block.  Adding the
+ * memreserve regions prevents u-boot from using them to store the initrd
+ * or the fdt blob.
+ */
+void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob)
+{
+       uint64_t addr, size;
+       int i, total;
+
+       if (fdt_check_header (fdt_blob) != 0)
+               return;
+
+       total = fdt_num_mem_rsv(fdt_blob);
+       for (i = 0; i < total; i++) {
+               if (fdt_get_mem_rsv(fdt_blob, i, &addr, &size) != 0)
+                       continue;
+               printf("   reserving fdt memory region: addr=%llx size=%llx\n",
+                       (unsigned long long)addr, (unsigned long long)size);
+               lmb_reserve(lmb, addr, size);
+       }
+}
+
 /**
  * boot_relocate_fdt - relocate flat device tree
  * @lmb: pointer to lmb handle, will be used for memory mgmt
- * @bootmap_base: base address of the bootmap region
  * @of_flat_tree: pointer to a char* variable, will hold fdt start address
  * @of_size: pointer to a ulong variable, will hold fdt length
  *
@@ -1187,9 +1230,7 @@ static int fit_check_fdt (const void *fit, int fdt_noffset, int verify)
  *      0 - success
  *      1 - failure
  */
-#if defined(CONFIG_SYS_BOOTMAPSZ)
-int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
-               char **of_flat_tree, ulong *of_size)
+int boot_relocate_fdt (struct lmb *lmb, char **of_flat_tree, ulong *of_size)
 {
        void    *fdt_blob = *of_flat_tree;
        void    *of_start = 0;
@@ -1209,7 +1250,7 @@ int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
        /* Pad the FDT by a specified amount */
        of_len = *of_size + CONFIG_SYS_FDT_PAD;
        of_start = (void *)(unsigned long)lmb_alloc_base(lmb, of_len, 0x1000,
-                       (CONFIG_SYS_BOOTMAPSZ + bootmap_base));
+                       getenv_bootm_mapsize() + getenv_bootm_low());
 
        if (of_start == 0) {
                puts("device tree - allocation error\n");
@@ -1238,7 +1279,7 @@ int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
 error:
        return 1;
 }
-#endif /* CONFIG_SYS_BOOTMAPSZ */
+#endif /* CONFIG_OF_LIBFDT */
 
 /**
  * boot_get_fdt - main fdt handling routine
@@ -1567,11 +1608,9 @@ error:
  * @lmb: pointer to lmb handle, will be used for memory mgmt
  * @cmd_start: pointer to a ulong variable, will hold cmdline start
  * @cmd_end: pointer to a ulong variable, will hold cmdline end
- * @bootmap_base: ulong variable, holds offset in physical memory to
- * base of bootmap
  *
  * boot_get_cmdline() allocates space for kernel command line below
- * BOOTMAPSZ + bootmap_base address. If "bootargs" U-boot environemnt
+ * BOOTMAPSZ + getenv_bootm_low() address. If "bootargs" U-boot environemnt
  * variable is present its contents is copied to allocated kernel
  * command line.
  *
@@ -1579,14 +1618,13 @@ error:
  *      0 - success
  *     -1 - failure
  */
-int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
-                       ulong bootmap_base)
+int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end)
 {
        char *cmdline;
        char *s;
 
        cmdline = (char *)(ulong)lmb_alloc_base(lmb, CONFIG_SYS_BARGSIZE, 0xf,
-                                        CONFIG_SYS_BOOTMAPSZ + bootmap_base);
+                               getenv_bootm_mapsize() + getenv_bootm_low());
 
        if (cmdline == NULL)
                return -1;
@@ -1610,21 +1648,19 @@ int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
  * boot_get_kbd - allocate and initialize kernel copy of board info
  * @lmb: pointer to lmb handle, will be used for memory mgmt
  * @kbd: double pointer to board info data
- * @bootmap_base: ulong variable, holds offset in physical memory to
- * base of bootmap
  *
  * boot_get_kbd() allocates space for kernel copy of board info data below
- * BOOTMAPSZ + bootmap_base address and kernel board info is initialized with
- * the current u-boot board info data.
+ * BOOTMAPSZ + getenv_bootm_low() address and kernel board info is initialized
+ * with the current u-boot board info data.
  *
  * returns:
  *      0 - success
  *     -1 - failure
  */
-int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base)
+int boot_get_kbd (struct lmb *lmb, bd_t **kbd)
 {
        *kbd = (bd_t *)(ulong)lmb_alloc_base(lmb, sizeof(bd_t), 0xf,
-                                     CONFIG_SYS_BOOTMAPSZ + bootmap_base);
+                               getenv_bootm_mapsize() + getenv_bootm_low());
        if (*kbd == NULL)
                return -1;
 
index e282096a13460866c9f7b2054b3ce8c38de48f7f..bcab74e73a9d769d9631310aea0791a834d447bc 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <phy.h>
 
 #include <asm/types.h>
 #include <linux/list.h>
 
 #undef debug
 #ifdef MII_DEBUG
-#define debug(fmt,args...)     printf (fmt ,##args)
+#define debug(fmt, args...)    printf(fmt, ##args)
 #else
-#define debug(fmt,args...)
+#define debug(fmt, args...)
 #endif /* MII_DEBUG */
 
-struct mii_dev {
-       struct list_head link;
-       const char *name;
-       int (*read) (const char *devname, unsigned char addr,
-                    unsigned char reg, unsigned short *value);
-       int (*write) (const char *devname, unsigned char addr,
-                     unsigned char reg, unsigned short value);
-};
-
 static struct list_head mii_devs;
 static struct mii_dev *current_mii;
 
 /*
  * Lookup the mii_dev struct by the registered device name.
  */
-static struct mii_dev *miiphy_get_dev_by_name(const char *devname, int quiet)
+struct mii_dev *miiphy_get_dev_by_name(const char *devname)
 {
        struct list_head *entry;
        struct mii_dev *dev;
@@ -75,8 +67,6 @@ static struct mii_dev *miiphy_get_dev_by_name(const char *devname, int quiet)
                        return dev;
        }
 
-       if (!quiet)
-               printf("No such device: %s\n", devname);
        return NULL;
 }
 
@@ -86,74 +76,190 @@ static struct mii_dev *miiphy_get_dev_by_name(const char *devname, int quiet)
  */
 void miiphy_init(void)
 {
-       INIT_LIST_HEAD (&mii_devs);
+       INIT_LIST_HEAD(&mii_devs);
        current_mii = NULL;
 }
 
+static int legacy_miiphy_read(struct mii_dev *bus, int addr, int devad, int reg)
+{
+       unsigned short val;
+       int ret;
+       struct legacy_mii_dev *ldev = bus->priv;
+
+       ret = ldev->read(bus->name, addr, reg, &val);
+
+       return ret ? -1 : (int)val;
+}
+
+static int legacy_miiphy_write(struct mii_dev *bus, int addr, int devad,
+                               int reg, u16 val)
+{
+       struct legacy_mii_dev *ldev = bus->priv;
+
+       return ldev->write(bus->name, addr, reg, val);
+}
+
 /*****************************************************************************
  *
  * Register read and write MII access routines for the device <name>.
  */
 void miiphy_register(const char *name,
-                     int (*read) (const char *devname, unsigned char addr,
+                     int (*read)(const char *devname, unsigned char addr,
                                   unsigned char reg, unsigned short *value),
-                     int (*write) (const char *devname, unsigned char addr,
+                     int (*write)(const char *devname, unsigned char addr,
                                    unsigned char reg, unsigned short value))
 {
        struct mii_dev *new_dev;
+       struct legacy_mii_dev *ldev;
        unsigned int name_len;
-       char *new_name;
 
        /* check if we have unique name */
-       new_dev = miiphy_get_dev_by_name(name, 1);
+       new_dev = miiphy_get_dev_by_name(name);
        if (new_dev) {
                printf("miiphy_register: non unique device name '%s'\n", name);
                return;
        }
 
        /* allocate memory */
-       name_len = strlen (name);
-       new_dev =
-           (struct mii_dev *)malloc (sizeof (struct mii_dev) + name_len + 1);
+       name_len = strlen(name);
+       if (name_len > MDIO_NAME_LEN - 1) {
+               /* Hopefully this won't happen, but if it does, we'll know */
+               printf("miiphy_register: MDIO name was longer than %d\n",
+                       MDIO_NAME_LEN);
+               return;
+       }
+
+       new_dev = mdio_alloc();
+       ldev = malloc(sizeof(*ldev));
 
-       if (new_dev == NULL) {
-               printf ("miiphy_register: cannot allocate memory for '%s'\n",
+       if (new_dev == NULL || ldev == NULL) {
+               printf("miiphy_register: cannot allocate memory for '%s'\n",
                        name);
                return;
        }
-       memset (new_dev, 0, sizeof (struct mii_dev) + name_len);
 
        /* initalize mii_dev struct fields */
-       INIT_LIST_HEAD (&new_dev->link);
-       new_dev->read = read;
-       new_dev->write = write;
-       new_dev->name = new_name = (char *)(new_dev + 1);
-       strncpy (new_name, name, name_len);
-       new_name[name_len] = '\0';
+       new_dev->read = legacy_miiphy_read;
+       new_dev->write = legacy_miiphy_write;
+       sprintf(new_dev->name, name);
+       ldev->read = read;
+       ldev->write = write;
+       new_dev->priv = ldev;
 
-       debug ("miiphy_register: added '%s', read=0x%08lx, write=0x%08lx\n",
-              new_dev->name, new_dev->read, new_dev->write);
+       debug("miiphy_register: added '%s', read=0x%08lx, write=0x%08lx\n",
+              new_dev->name, ldev->read, ldev->write);
 
        /* add it to the list */
-       list_add_tail (&new_dev->link, &mii_devs);
+       list_add_tail(&new_dev->link, &mii_devs);
 
        if (!current_mii)
                current_mii = new_dev;
 }
 
+struct mii_dev *mdio_alloc(void)
+{
+       struct mii_dev *bus;
+
+       bus = malloc(sizeof(*bus));
+       if (!bus)
+               return bus;
+
+       memset(bus, 0, sizeof(*bus));
+
+       /* initalize mii_dev struct fields */
+       INIT_LIST_HEAD(&bus->link);
+
+       return bus;
+}
+
+int mdio_register(struct mii_dev *bus)
+{
+       if (!bus || !bus->name || !bus->read || !bus->write)
+               return -1;
+
+       /* check if we have unique name */
+       if (miiphy_get_dev_by_name(bus->name)) {
+               printf("mdio_register: non unique device name '%s'\n",
+                       bus->name);
+               return -1;
+       }
+
+       /* add it to the list */
+       list_add_tail(&bus->link, &mii_devs);
+
+       if (!current_mii)
+               current_mii = bus;
+
+       return 0;
+}
+
+void mdio_list_devices(void)
+{
+       struct list_head *entry;
+
+       list_for_each(entry, &mii_devs) {
+               int i;
+               struct mii_dev *bus = list_entry(entry, struct mii_dev, link);
+
+               printf("%s:\n", bus->name);
+
+               for (i = 0; i < PHY_MAX_ADDR; i++) {
+                       struct phy_device *phydev = bus->phymap[i];
+
+                       if (phydev) {
+                               printf("%d - %s", i, phydev->drv->name);
+
+                               if (phydev->dev)
+                                       printf(" <--> %s\n", phydev->dev->name);
+                               else
+                                       printf("\n");
+                       }
+               }
+       }
+}
+
 int miiphy_set_current_dev(const char *devname)
 {
        struct mii_dev *dev;
 
-       dev = miiphy_get_dev_by_name(devname, 0);
+       dev = miiphy_get_dev_by_name(devname);
        if (dev) {
                current_mii = dev;
                return 0;
        }
 
+       printf("No such device: %s\n", devname);
+
        return 1;
 }
 
+struct mii_dev *mdio_get_current_dev(void)
+{
+       return current_mii;
+}
+
+struct phy_device *mdio_phydev_for_ethname(const char *ethname)
+{
+       struct list_head *entry;
+       struct mii_dev *bus;
+
+       list_for_each(entry, &mii_devs) {
+               int i;
+               bus = list_entry(entry, struct mii_dev, link);
+
+               for (i = 0; i < PHY_MAX_ADDR; i++) {
+                       if (!bus->phymap[i] || !bus->phymap[i]->dev)
+                               continue;
+
+                       if (strcmp(bus->phymap[i]->dev->name, ethname) == 0)
+                               return bus->phymap[i];
+               }
+       }
+
+       printf("%s is not a known ethernet\n", ethname);
+       return NULL;
+}
+
 const char *miiphy_get_current_dev(void)
 {
        if (current_mii)
@@ -187,13 +293,19 @@ static struct mii_dev *miiphy_get_active_dev(const char *devname)
 int miiphy_read(const char *devname, unsigned char addr, unsigned char reg,
                 unsigned short *value)
 {
-       struct mii_dev *dev;
+       struct mii_dev *bus;
+       int ret;
 
-       dev = miiphy_get_active_dev(devname);
-       if (dev)
-               return dev->read(devname, addr, reg, value);
+       bus = miiphy_get_active_dev(devname);
+       if (!bus)
+               return 1;
 
-       return 1;
+       ret = bus->read(bus, addr, MDIO_DEVAD_NONE, reg);
+       if (ret < 0)
+               return 1;
+
+       *value = (unsigned short)ret;
+       return 0;
 }
 
 /*****************************************************************************
@@ -207,11 +319,11 @@ int miiphy_read(const char *devname, unsigned char addr, unsigned char reg,
 int miiphy_write(const char *devname, unsigned char addr, unsigned char reg,
                  unsigned short value)
 {
-       struct mii_dev *dev;
+       struct mii_dev *bus;
 
-       dev = miiphy_get_active_dev(devname);
-       if (dev)
-               return dev->write(devname, addr, reg, value);
+       bus = miiphy_get_active_dev(devname);
+       if (bus)
+               return bus->write(bus, addr, MDIO_DEVAD_NONE, reg, value);
 
        return 1;
 }
@@ -220,20 +332,20 @@ int miiphy_write(const char *devname, unsigned char addr, unsigned char reg,
  *
  * Print out list of registered MII capable devices.
  */
-void miiphy_listdev (void)
+void miiphy_listdev(void)
 {
        struct list_head *entry;
        struct mii_dev *dev;
 
-       puts ("MII devices: ");
-       list_for_each (entry, &mii_devs) {
-               dev = list_entry (entry, struct mii_dev, link);
-               printf ("'%s' ", dev->name);
+       puts("MII devices: ");
+       list_for_each(entry, &mii_devs) {
+               dev = list_entry(entry, struct mii_dev, link);
+               printf("'%s' ", dev->name);
        }
-       puts ("\n");
+       puts("\n");
 
        if (current_mii)
-               printf ("Current device: '%s'\n", current_mii->name);
+               printf("Current device: '%s'\n", current_mii->name);
 }
 
 /*****************************************************************************
@@ -253,32 +365,33 @@ int miiphy_info(const char *devname, unsigned char addr, unsigned int *oui,
        unsigned int reg = 0;
        unsigned short tmp;
 
-       if (miiphy_read (devname, addr, MII_PHYSID2, &tmp) != 0) {
-               debug ("PHY ID register 2 read failed\n");
-               return (-1);
+       if (miiphy_read(devname, addr, MII_PHYSID2, &tmp) != 0) {
+               debug("PHY ID register 2 read failed\n");
+               return -1;
        }
        reg = tmp;
 
-       debug ("MII_PHYSID2 @ 0x%x = 0x%04x\n", addr, reg);
+       debug("MII_PHYSID2 @ 0x%x = 0x%04x\n", addr, reg);
 
        if (reg == 0xFFFF) {
                /* No physical device present at this address */
-               return (-1);
+               return -1;
        }
 
-       if (miiphy_read (devname, addr, MII_PHYSID1, &tmp) != 0) {
-               debug ("PHY ID register 1 read failed\n");
-               return (-1);
+       if (miiphy_read(devname, addr, MII_PHYSID1, &tmp) != 0) {
+               debug("PHY ID register 1 read failed\n");
+               return -1;
        }
        reg |= tmp << 16;
-       debug ("PHY_PHYIDR[1,2] @ 0x%x = 0x%08x\n", addr, reg);
+       debug("PHY_PHYIDR[1,2] @ 0x%x = 0x%08x\n", addr, reg);
 
        *oui = (reg >> 10);
        *model = (unsigned char)((reg >> 4) & 0x0000003F);
        *rev = (unsigned char)(reg & 0x0000000F);
-       return (0);
+       return 0;
 }
 
+#ifndef CONFIG_PHYLIB
 /*****************************************************************************
  *
  * Reset the PHY.
@@ -290,16 +403,16 @@ int miiphy_reset(const char *devname, unsigned char addr)
        unsigned short reg;
        int timeout = 500;
 
-       if (miiphy_read (devname, addr, MII_BMCR, &reg) != 0) {
-               debug ("PHY status read failed\n");
-               return (-1);
+       if (miiphy_read(devname, addr, MII_BMCR, &reg) != 0) {
+               debug("PHY status read failed\n");
+               return -1;
        }
-       if (miiphy_write (devname, addr, MII_BMCR, reg | BMCR_RESET) != 0) {
-               debug ("PHY reset failed\n");
-               return (-1);
+       if (miiphy_write(devname, addr, MII_BMCR, reg | BMCR_RESET) != 0) {
+               debug("PHY reset failed\n");
+               return -1;
        }
 #ifdef CONFIG_PHY_RESET_DELAY
-       udelay (CONFIG_PHY_RESET_DELAY);        /* Intel LXT971A needs this */
+       udelay(CONFIG_PHY_RESET_DELAY); /* Intel LXT971A needs this */
 #endif
        /*
         * Poll the control register for the reset bit to go to 0 (it is
@@ -315,13 +428,14 @@ int miiphy_reset(const char *devname, unsigned char addr)
                udelay(1000);
        }
        if ((reg & 0x8000) == 0) {
-               return (0);
+               return 0;
        } else {
-               puts ("PHY reset timed out\n");
-               return (-1);
+               puts("PHY reset timed out\n");
+               return -1;
        }
-       return (0);
+       return 0;
 }
+#endif /* !PHYLIB */
 
 /*****************************************************************************
  *
@@ -338,33 +452,32 @@ int miiphy_speed(const char *devname, unsigned char addr)
         * Check for 1000BASE-X.  If it is supported, then assume that the speed
         * is 1000.
         */
-       if (miiphy_is_1000base_x (devname, addr)) {
+       if (miiphy_is_1000base_x(devname, addr))
                return _1000BASET;
-       }
+
        /*
         * No 1000BASE-X, so assume 1000BASE-T/100BASE-TX/10BASE-T register set.
         */
        /* Check for 1000BASE-T. */
-       if (miiphy_read (devname, addr, MII_STAT1000, &btsr)) {
-               printf ("PHY 1000BT status");
+       if (miiphy_read(devname, addr, MII_STAT1000, &btsr)) {
+               printf("PHY 1000BT status");
                goto miiphy_read_failed;
        }
        if (btsr != 0xFFFF &&
-           (btsr & (PHY_1000BTSR_1000FD | PHY_1000BTSR_1000HD))) {
+                       (btsr & (PHY_1000BTSR_1000FD | PHY_1000BTSR_1000HD)))
                return _1000BASET;
-       }
 #endif /* CONFIG_PHY_GIGE */
 
        /* Check Basic Management Control Register first. */
-       if (miiphy_read (devname, addr, MII_BMCR, &bmcr)) {
-               printf ("PHY speed");
+       if (miiphy_read(devname, addr, MII_BMCR, &bmcr)) {
+               printf("PHY speed");
                goto miiphy_read_failed;
        }
        /* Check if auto-negotiation is on. */
        if (bmcr & BMCR_ANENABLE) {
                /* Get auto-negotiation results. */
-               if (miiphy_read (devname, addr, MII_LPA, &anlpar)) {
-                       printf ("PHY AN speed");
+               if (miiphy_read(devname, addr, MII_LPA, &anlpar)) {
+                       printf("PHY AN speed");
                        goto miiphy_read_failed;
                }
                return (anlpar & LPA_100) ? _100BASET : _10BASET;
@@ -373,7 +486,7 @@ int miiphy_speed(const char *devname, unsigned char addr)
        return (bmcr & BMCR_SPEED100) ? _100BASET : _10BASET;
 
 miiphy_read_failed:
-       printf (" read failed, assuming 10BASE-T\n");
+       printf(" read failed, assuming 10BASE-T\n");
        return _10BASET;
 }
 
@@ -389,10 +502,10 @@ int miiphy_duplex(const char *devname, unsigned char addr)
        u16 btsr;
 
        /* Check for 1000BASE-X. */
-       if (miiphy_is_1000base_x (devname, addr)) {
+       if (miiphy_is_1000base_x(devname, addr)) {
                /* 1000BASE-X */
-               if (miiphy_read (devname, addr, MII_LPA, &anlpar)) {
-                       printf ("1000BASE-X PHY AN duplex");
+               if (miiphy_read(devname, addr, MII_LPA, &anlpar)) {
+                       printf("1000BASE-X PHY AN duplex");
                        goto miiphy_read_failed;
                }
        }
@@ -400,8 +513,8 @@ int miiphy_duplex(const char *devname, unsigned char addr)
         * No 1000BASE-X, so assume 1000BASE-T/100BASE-TX/10BASE-T register set.
         */
        /* Check for 1000BASE-T. */
-       if (miiphy_read (devname, addr, MII_STAT1000, &btsr)) {
-               printf ("PHY 1000BT status");
+       if (miiphy_read(devname, addr, MII_STAT1000, &btsr)) {
+               printf("PHY 1000BT status");
                goto miiphy_read_failed;
        }
        if (btsr != 0xFFFF) {
@@ -414,15 +527,15 @@ int miiphy_duplex(const char *devname, unsigned char addr)
 #endif /* CONFIG_PHY_GIGE */
 
        /* Check Basic Management Control Register first. */
-       if (miiphy_read (devname, addr, MII_BMCR, &bmcr)) {
-               puts ("PHY duplex");
+       if (miiphy_read(devname, addr, MII_BMCR, &bmcr)) {
+               puts("PHY duplex");
                goto miiphy_read_failed;
        }
        /* Check if auto-negotiation is on. */
        if (bmcr & BMCR_ANENABLE) {
                /* Get auto-negotiation results. */
-               if (miiphy_read (devname, addr, MII_LPA, &anlpar)) {
-                       puts ("PHY AN duplex");
+               if (miiphy_read(devname, addr, MII_LPA, &anlpar)) {
+                       puts("PHY AN duplex");
                        goto miiphy_read_failed;
                }
                return (anlpar & (LPA_10FULL | LPA_100FULL)) ?
@@ -432,7 +545,7 @@ int miiphy_duplex(const char *devname, unsigned char addr)
        return (bmcr & BMCR_FULLDPLX) ? FULL : HALF;
 
 miiphy_read_failed:
-       printf (" read failed, assuming half duplex\n");
+       printf(" read failed, assuming half duplex\n");
        return HALF;
 }
 
@@ -446,8 +559,8 @@ int miiphy_is_1000base_x(const char *devname, unsigned char addr)
 #if defined(CONFIG_PHY_GIGE)
        u16 exsr;
 
-       if (miiphy_read (devname, addr, MII_ESTATUS, &exsr)) {
-               printf ("PHY extended status read failed, assuming no "
+       if (miiphy_read(devname, addr, MII_ESTATUS, &exsr)) {
+               printf("PHY extended status read failed, assuming no "
                        "1000BASE-X\n");
                return 0;
        }
@@ -467,17 +580,17 @@ int miiphy_link(const char *devname, unsigned char addr)
        unsigned short reg;
 
        /* dummy read; needed to latch some phys */
-       (void)miiphy_read (devname, addr, MII_BMSR, &reg);
-       if (miiphy_read (devname, addr, MII_BMSR, &reg)) {
-               puts ("MII_BMSR read failed, assuming no link\n");
-               return (0);
+       (void)miiphy_read(devname, addr, MII_BMSR, &reg);
+       if (miiphy_read(devname, addr, MII_BMSR, &reg)) {
+               puts("MII_BMSR read failed, assuming no link\n");
+               return 0;
        }
 
        /* Determine if a link is active */
        if ((reg & BMSR_LSTATUS) != 0) {
-               return (1);
+               return 1;
        } else {
-               return (0);
+               return 0;
        }
 }
 #endif
index 1e6cd6af27491467870ad76cc61d7c631a8a277f..9ecf165d1af0e443dcb0b67f3eb657a87541c841 100644 (file)
@@ -254,7 +254,7 @@ int usb_stor_scan(int mode)
                dev = usb_get_dev_index(i); /* get device */
                USB_STOR_PRINTF("i=%d\n", i);
                if (dev == NULL)
-                       break; /* no more devices avaiable */
+                       break; /* no more devices available */
 
                if (usb_storage_probe(dev, 0, &usb_stor[usb_max_devs])) {
                        /* OK, it's a storage device.  Iterate over its LUNs
@@ -1346,31 +1346,6 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
        unsigned long *capacity, *blksz;
        ccb *pccb = &usb_ccb;
 
-       /* for some reasons a couple of devices would not survive this reset */
-       if (
-           /* Sony USM256E */
-           (dev->descriptor.idVendor == 0x054c &&
-            dev->descriptor.idProduct == 0x019e)
-           ||
-           /* USB007 Mini-USB2 Flash Drive */
-           (dev->descriptor.idVendor == 0x066f &&
-            dev->descriptor.idProduct == 0x2010)
-           ||
-           /* SanDisk Corporation Cruzer Micro 20044318410546613953 */
-           (dev->descriptor.idVendor == 0x0781 &&
-            dev->descriptor.idProduct == 0x5151)
-           ||
-           /*
-            * SanDisk Corporation U3 Cruzer Micro 1/4GB
-            * Flash Drive 000016244373FFB4
-            */
-           (dev->descriptor.idVendor == 0x0781 &&
-            dev->descriptor.idProduct == 0x5406)
-           )
-               USB_STOR_PRINTF("usb_stor_get_info: skipping RESET..\n");
-       else
-               ss->transport_reset(ss);
-
        pccb->pdata = usb_stor_buf;
 
        dev_desc->target = dev->devnum;
index fa46ff1a5138adcfc0d4bf068acb10420e06a29e..7ce554ecfec32beb8479c353c40b2b31dfdcf7f3 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -153,14 +153,37 @@ endif
 RELFLAGS= $(PLATFORM_RELFLAGS)
 DBGFLAGS= -g # -DDEBUG
 OPTFLAGS= -Os #-fomit-frame-pointer
+
+# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
+# that (or fail if absent).  Otherwise, search for a linker script in a
+# standard location.
+
 ifndef LDSCRIPT
-#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
-ifeq ($(CONFIG_NAND_U_BOOT),y)
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-else
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
+       #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
+       ifdef CONFIG_SYS_LDSCRIPT
+               # need to strip off double quotes
+               LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
+       endif
 endif
+
+ifndef LDSCRIPT
+       ifeq ($(CONFIG_NAND_U_BOOT),y)
+               LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
+               ifeq ($(wildcard $(LDSCRIPT)),)
+                       LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
+               endif
+       endif
+       ifeq ($(wildcard $(LDSCRIPT)),)
+               LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
+       endif
+       ifeq ($(wildcard $(LDSCRIPT)),)
+               LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
+       endif
+       ifeq ($(wildcard $(LDSCRIPT)),)
+$(error could not find linker script)
+       endif
 endif
+
 OBJCFLAGS += --gap-fill=0xff
 
 gccincdir := $(shell $(CC) -print-file-name=include)
index 13723f23b3113c74fa7b2590de65bf0d7d3c5a6b..f07a17feb8a0e5e03663d986754e346779efe0ad 100644 (file)
@@ -84,7 +84,7 @@ block_dev_desc_t *get_dev(char* ifname, int dev)
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
        name += gd->reloc_off;
 #endif
-       while (name) {
+       while (drvr->name) {
                name = drvr->name;
                reloc_get_dev = drvr->get_dev;
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
diff --git a/doc/README-i386 b/doc/README-i386
deleted file mode 100644 (file)
index c560d22..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-This is my attempt to port U-Boot to the i386 platform. This
-work was sponsored by my emplyer, Omicron Ceti AB. http://www.omicron.se
-
-It is currently capable of booting a linux bzImage from flash on
-the AMD SC520 CDP platform.
-
-It was originally based on PPCBoot taken from the CVS October 28 2002.
-
-To compile:
-
-1) Unpack the source tree, either from the complete tarball or
-   from the virgin snapshot + the patch
-
-2) Configure the source
-   $ make sc520_cdp_comfig
-   $ make
-
-To use this code on the CDP:
-1) Make a suitable kernel, I used 2.4.19 with the mtd-support updated
-   from the MTD CVS and a patch to allow root=/dev/mtdblock1 which I
-   included at the end of this file.
-   The following options in the MTD section might be useful:
-
-   CONFIG_MTD_PHYSMAP=y
-   CONFIG_MTD_PHYSMAP_START=38100000
-   CONFIG_MTD_PHYSMAP_LEN=7a0000
-   CONFIG_MTD_PHYSMAP_BUSWIDTH=2
-
-
-2) Program it in to the CDP flashbank with remon
-   u-boot.bin should be programmed att offset 0x7e000 and the kernel at
-   offset 0. If you want to use a jffs2 root file system (not included here),
-   it should be  programmed to offset 0x100000.
-
-   remon> z
-   remon> yi
-   remon> ns u-boot.bin 7e0000
-   remon> ns bzImage 0
-   remon> ns image.jffs2 100000
-
-3) Connect a terminal to the 25pin serial port at 9600bps, and start the CDP.
-
-   remon> z
-   remon> g
-
-4) U-Boot should output some message and a prompt on the terminal, to
-   start the kernel issue the following command:
-
-   BOOT> bootm
-
-5) The kernel should boot, and mount the root filesystem if present.
-
-We hope you find this stuff useful
-Daniel Engström, Omicron Ceti AB, daniel@omicron.se
-
-
---- linux-2.4.19-orig/init/do_mounts.c Sat Aug  3 02:39:46 2002
-+++ linux-2.4.19/init/do_mounts.c      Mon Sep 23 16:21:33 2002
-@@ -224,6 +224,14 @@
-       { "ftlc", 0x2c10 },
-       { "ftld", 0x2c18 },
-       { "mtdblock", 0x1f00 },
-+      { "mtdblock0", 0x1f00 },
-+      { "mtdblock1", 0x1f01 },
-+      { "mtdblock2", 0x1f02 },
-+      { "mtdblock3", 0x1f03 },
-+      { "mtdblock4", 0x1f04 },
-+      { "mtdblock5", 0x1f05 },
-+      { "mtdblock6", 0x1f06 },
-+      { "mtdblock7", 0x1f07 },
-       { NULL, 0 }
- };
-
--------------------
diff --git a/doc/README.Purple b/doc/README.Purple
deleted file mode 100644 (file)
index 0098e26..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-Installation Instructions:
---------------------------
-
-1. Put the s2 switch into the following position:
-
-       Off On
-       ------
-       |x   |
-       |   x|
-       |x   |
-       |   X|
-       ------
-
-   Put the s3 switch into the following position:
-
-       Off On
-       ------
-       | x  |
-       | x  |
-       |   x|
-       |   x|
-       ------
-
-   Put the s4 switch into the following position:
-
-       Off On
-       ------
-       |x   |
-       |x   |
-       |x   |
-       |x   |
-       |x   |
-       |   x|
-       |   x|
-       |x   |
-       ------
-
-2. Connect to the serial console and to the BDI. Power on. On the
-   serial line, you should see:
-
-       PURPLE@1.2>
-
-3. Type '8'. No echo will be displayed. In response, you should get:
-
-       7A(pass)
-
-4. From BDI, enter command:
-
-       mmw 0xb800d860 0x0042c7ff
-
-5. Then, from BDI:
-
-       erase 0xB0000000
-       erase 0xB0008000
-       erase 0xB000C000
-       erase 0xB0010000
-       erase 0xB0020000
-
-       prog 0xB0000000 <u-boot.bin> bin
-
-6. Power off. Restore the original S2 switch position:
-
-       Off On
-       ------
-       |   x|
-       |   x|
-       |x   |
-       |   X|
-       ------
-
-   Power on.  U-Boot should come up.
-
-
-Implementation Notes:
----------------------
-
-Due to the RAM/flash bus arbitration problem the suggested workaround
-had to be implemented. It works okay. On the downside is that you
-can't really check whether 'erase' is complete by polling flash as it
-is usually done. Instead, the flash driver simply waits for a given
-time and assumes that erase then has passed. This behaviour is
-identical to what the VxWorks driver does; also, the same timeout (6
-seconds) was chosen. Note that this timeout applies for each erase
-operation, i. e. per erased sector.
diff --git a/doc/README.dnp5370 b/doc/README.dnp5370
new file mode 100644 (file)
index 0000000..0172698
--- /dev/null
@@ -0,0 +1,67 @@
+This document describes the board support for
+Dil/NetPC DNP/5370 (http://www.dilnetpc.com/dnp0086.htm) module.
+The distributor is SSV (http://www.ssv-embedded.de),
+
+The module used to develop the support files contains:
+
+*   Processor: Blackfin BF537 Rev 0.3 (600 MHz core / 120MHz RAM)
+
+*   RAM: 32 MB SDRAM
+    Hynix HY57V561620FTP-H 810EA
+    Connected to Blackfin via "Expansion Bus"
+    Address range 0x0000.0000 - 0x1fff.ffff
+
+*   NOR flash: 32 MBit (4 MByte)
+    Exel Semiconductor ES29LVS320EB
+    Connected to Blackfin via "Expansion Bus",
+    Chip Selects 0, 1 and 2, each is connected
+    to a 1 MB memory bank at Blackfin, therefore
+    only 3 MB accessible.
+    Address range 0x2000.0000 - 0x202f.ffff
+    CFI compatible
+
+    Exel Semiconductor was bought by Rohm Semiconductor (www.rohm.com).
+
+*   NAND flash: 64 MBit (8 MByte)
+    Atmel 45DB642D-CNU
+    Connected to Blackfin via SPI
+    CFI compatible
+
+*   Davicom DM9161EP Ethernet PHY
+
+*   A SD card reader, connected via SPI
+
+*   Hardware watchdog MAX823 or TPS3823
+
+(other devices not listed here)
+
+To run it, the module must be inserted in a 64 pin DIL socket
+on another board, e.g. DNP/EVA13 (together: SSV SK28).
+
+The Blackfin is booted from NOR flash. The NOR flash data begins
+with the U-Boot code and is then followed by the Linux code.
+Finally, the MAC is stored in the last sector.
+You may need to adjust these settings to your needs.
+The memory map used to develop the board support is:
+
+Memory map:
+0x00000000 .. 0x01ffffff SDRAM
+0x20000000 .. 0x202fffff NOR flash
+
+RAM use:
+0x01f9bffc .. 0x01fbbffb U-Boot stack
+0x01f9c000 .. 0x01f9ffff U-Boot global data
+0x01fa0000 .. 0x01fbffff U-Boot malloc() RAM
+0x01fc0000 .. 0x01ffffff U-Boot execution RAM
+
+NOR flash use:
+0x20000000 .. 0x0002ffff U-Boot
+0x20004000 .. 0x20005fff U-Boot environment
+0x20030000 .. 0x202effff Linux kernel image
+0x202f0000 .. 0x202fffff MAC address sector
+
+NOR flash is 0x00300000 (3145728) bytes large (3 MB).
+Max space for compressed kernel in flash is 0x002c0000 (2883584) bytes (2.75 MB)
+Max space for u-boot in flash is 0x00030000 (196608) bytes (192 KB)
+
+The module is hardwired to BYPASS boot mode.
diff --git a/doc/README.p1022ds b/doc/README.p1022ds
new file mode 100644 (file)
index 0000000..473ecf6
--- /dev/null
@@ -0,0 +1,24 @@
+Overview
+--------
+P1022ds is a Low End Dual core platform supporting the P1022 processor
+of QorIQ series. P1022 is an e500 based dual core SOC.
+
+
+Pin Multiplex(hwconfig setting)
+-------------------------------
+Add the environment 'usb2', 'audclk' and 'tdm' to support pin multiplex
+via hwconfig, i.e:
+'setenv hwconfig usb2' to enable USB2 and disable eTsec2
+'setenv hwconfig tdm' to enable TDM and disable Audio
+'setenv hwconfig audclk:12' to enable Audio(codec clock sources is 12MHz)
+ and disable TDM
+'setenv hwconfig 'usb2;tdm' to enable USB2 and TDM, disable eTsec2 and Audio
+'setenv hwconfig 'usb2;audclk:11' to enable USB2 and Audio(codec clock sources
+ is 11MHz), disable eTsec2 and TDM
+
+Warning: TDM and AUDIO can not enable simultaneous !
+and AUDIO codec clock sources only setting as 11MHz or 12MHz !
+'setenv hwconfig 'audclk:12;tdm'       --- error !
+'setenv hwconfig 'audclk:11;tdm'       --- error !
+'setenv hwconfig 'audclk:10'           --- error !
+
diff --git a/doc/README.p4080ds b/doc/README.p4080ds
new file mode 100644 (file)
index 0000000..3ed59a8
--- /dev/null
@@ -0,0 +1,32 @@
+Overview
+--------
+The P4080DS is a Freescale reference board that hosts the eight-core P4080 SOC.
+
+SerDes hwconfig configuration
+-----------------------------
+The P4080 RCW includes three sets of bits the specify which SerDes lanes
+should be powered down: SRDS_LPD_B1 (for bank one), SRDS_LPD_B2 (for bank two),
+and SRDS_LPD_B3 (for bank three).  Each of these contains four bits, one for
+each lane in the bank.  SerDes Erratum SERDES8 requires that SRDS_LPD_B2 and
+SRDS_LPD_B3 be set to 0b1111.  This forces banks two and three to be powered
+down at reset.
+
+To re-enable these banks in U-Boot, two hwconfig are available:
+"fsl_srds_lpd_b2" and "fsl_srds_lpd_b3".  The value passed via fsl_srds_lpd_b2
+is written into SRDS_LPD_B2, and the value passed via fsl_srds_lpd_b3 is into
+SRDS_LPD_B3.  Each bit represents one of each bank, and a value of '1'
+indicates that the lane should be powered down.
+
+For example, to indicate that both SerDes banks 2 and 3 are powered down, add
+the following to hwconfig:
+
+       serdes:fsl_srds_lpd_b2=0xf,fsl_srds_lpd_b3=0xf
+
+The "0xf" is a mask that corresponds to the 4 lanes A-D. The most significant
+bit corresponds to lane A.  To indicate that just lane A of bank 3 is to be
+powered down, use:
+
+       serdes:fsl_srds_lpd_b3=8
+
+These options should be specified only if U-Boot does not automatically power
+on the correct lanes.
index 34e199c2d29d67dd475ec2ea76ca36c2ca4a9691..0c04bea571b7b6e8fd8c514a149bd634b8d782d5 100644 (file)
@@ -28,3 +28,22 @@ The driver has been tested with the following configurations:
 
 - MPC823FADS with AD7176 on a PAL TV (YCbYCr)  - arsenio@tin.it
 - GENIETV    with AD7177 on a PAL TV (YCbYCr)  - arsenio@tin.it
+
+
+"video-mode" environment variable
+===============================
+
+The 'video-mode' environment variable can be used to enable and configure
+some video drivers.  The format matches the video= command-line option used
+for Linux:
+
+       video-mode=<driver>:<xres>x<yres>-<depth>@<freq><,option=string>
+
+       <driver>        The video driver name, ignored by U-Boot
+       <xres>          The X resolution (in pixels) to use.
+       <yres>          The Y resolution (in pixels) to use.
+       <depth>         The color depth (in bits) to use.
+       <freq>          The frequency (in Hz) to use.
+       <options>       A comma-separated list of device-specific options
+
+Example: video-mode=fslfb:1280x1024-32@60,monitor=dvi
diff --git a/doc/TODO-i386 b/doc/TODO-i386
deleted file mode 100644 (file)
index 9b6c5d4..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-i386 port missing features:
-* i386 cleaness (wbinvld is 486+ ... )
-* Pentium TSC timer/udelay
-* setup the BIOS data area and BIOS equipment word to reflect machine config. 
-* Make reset work (from Linux and from the boot prompt)
-* DMA, FDC, RTC, KBC initialization
-* split of part of arch/i386/cpu/interrupt.c to cpu/i385/entry.c?
-* re-entry of protected mode from real mode, should be added to realmode_switch.S 
-  (and used by INT 10h and INT 16h handlers for console I/O during early
-   linux boot...) 
-* missing functions in arch/i386/lib and arch/i386/cpu
-* speaker beep interface
-
-
-SC520 missing features:
-* Watchdog
-* SC520 timer/udelay
-* SC520 3rd PIC
-* SC520 ICE serial
-* SC520 MMCR reset 
-
-SC520 CDP board support missing features:
-* environment in sram
-
-SC520 CDP board support bugs:
-* SPI EEPROM support does not work
-* 0x680 LEDS dos not work for me
-* is it possible to make both the internal serial ports and the 
-  ports on the sio work at the same time?
index 3d6993ac2af21643fd96e5191943afd33f19620d..e0e40975937f3b972c62e8fe14e00022992c939f 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+ * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
- * Written-by: Albert ARIBAUD <albert.aribaud@free.fr>
+ * Written-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
index 53a06734147f39881d6c29a9132aab2060e14003..103786209cfa972b7b17f41285b3070bf04d696c 100644 (file)
  * MA 02111-1307 USA
  */
 #include <common.h>
-#ifdef CONFIG_MX31
-#include <asm/arch/mx31-regs.h>
-#endif
-#if defined(CONFIG_MX51) || defined(CONFIG_MX53)
 #include <asm/arch/imx-regs.h>
-#endif
 #include <asm/io.h>
 #include <mxc_gpio.h>
 
index 052fe360c075a0a8e22ada68951b0b2fe2c0b466..00a12cc28405c83075df0463b5e2b813d1675cf4 100644 (file)
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
 COBJS-$(CONFIG_DRIVER_DAVINCI_I2C) += davinci_i2c.o
 COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o
+COBJS-$(CONFIG_I2C_MV) += mv_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
similarity index 65%
rename from arch/arm/cpu/pxa/i2c.c
rename to drivers/i2c/mv_i2c.c
index 7aa49ae4a00658cd88dfb9c7ee880f5f70337956..dcbe1aefad7f6ff8b783d1e61e1a7d9dc62955b9 100644 (file)
@@ -8,6 +8,9 @@
  * (C) Copyright 2003 Pengutronix e.K.
  * Robert Schwebel <r.schwebel@pengutronix.de>
  *
+ * (C) Copyright 2011 Marvell Inc.
+ * Lei Wen <leiwen@marvell.com>
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
  * Murray.Jensen@cmst.csiro.au, 27-Jan-01.
  */
 
-/* FIXME: this file is PXA255 specific! What about other XScales? */
-
 #include <common.h>
 #include <asm/io.h>
 
 #ifdef CONFIG_HARD_I2C
-
-/*
- *     - CONFIG_SYS_I2C_SPEED
- *     - I2C_PXA_SLAVE_ADDR
- */
-
-#include <asm/arch/hardware.h>
-#include <asm/arch/pxa-regs.h>
 #include <i2c.h>
-
-/*#define      DEBUG_I2C       1       /###* activate local debugging output  */
-#define I2C_PXA_SLAVE_ADDR     0x1     /* slave pxa unit address           */
-
-#if (CONFIG_SYS_I2C_SPEED == 400000)
-#define I2C_ICR_INIT   (ICR_FM | ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD | ICR_SCLE)
-#else
-#define I2C_ICR_INIT   (ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD | ICR_SCLE)
-#endif
-
-#define I2C_ISR_INIT           0x7FF
+#include "mv_i2c.h"
 
 #ifdef DEBUG_I2C
 #define PRINTD(x) printf x
 #define PRINTD(x)
 #endif
 
-
-/* Shall the current transfer have a start/stop condition? */
-#define I2C_COND_NORMAL                0
-#define I2C_COND_START         1
-#define I2C_COND_STOP          2
-
-/* Shall the current transfer be ack/nacked or being waited for it? */
-#define I2C_ACKNAK_WAITACK     1
-#define I2C_ACKNAK_SENDACK     2
-#define I2C_ACKNAK_SENDNAK     4
-
-/* Specify who shall transfer the data (master or slave) */
-#define I2C_READ               0
-#define I2C_WRITE              1
-
 /* All transfers are described by this data structure */
 struct i2c_msg {
        u8 condition;
@@ -86,53 +54,91 @@ struct i2c_msg {
        u8 data;
 };
 
+struct mv_i2c {
+       u32 ibmr;
+       u32 pad0;
+       u32 idbr;
+       u32 pad1;
+       u32 icr;
+       u32 pad2;
+       u32 isr;
+       u32 pad3;
+       u32 isar;
+};
+
+static struct mv_i2c *base;
+#ifdef CONFIG_I2C_MULTI_BUS
+static u32 i2c_regs[CONFIG_MV_I2C_NUM] = CONFIG_MV_I2C_REG;
+static unsigned int bus_initialized[CONFIG_MV_I2C_NUM];
+static unsigned int current_bus;
+
+int i2c_set_bus_num(unsigned int bus)
+{
+       if ((bus < 0) || (bus >= CONFIG_MV_I2C_NUM)) {
+               printf("Bad bus: %d\n", bus);
+               return -1;
+       }
+
+       base = (struct mv_i2c *)i2c_regs[bus];
+       current_bus = bus;
+
+       if (!bus_initialized[current_bus]) {
+               i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+               bus_initialized[current_bus] = 1;
+       }
+
+       return 0;
+}
 
-/**
- * i2c_pxa_reset: - reset the host controller
+unsigned int i2c_get_bus_num(void)
+{
+       return current_bus;
+}
+#endif
+
+/*
+ * i2c_reset: - reset the host controller
  *
  */
-
-static void i2c_reset( void )
+static void i2c_reset(void)
 {
-       writel(readl(ICR) & ~ICR_IUE, ICR);     /* disable unit */
-       writel(readl(ICR) | ICR_UR, ICR);       /* reset the unit */
+       writel(readl(&base->icr) & ~ICR_IUE, &base->icr); /* disable unit */
+       writel(readl(&base->icr) | ICR_UR, &base->icr);   /* reset the unit */
        udelay(100);
-       writel(readl(ICR) & ~ICR_IUE, ICR);     /* disable unit */
-#ifdef CONFIG_CPU_MONAHANS
-       /* | CKENB_1_PWM1 | CKENB_0_PWM0); */
-       writel(readl(CKENB) | (CKENB_4_I2C), CKENB);
-#else /* CONFIG_CPU_MONAHANS */
-       /* set the global I2C clock on */
-       writel(readl(CKEN) | CKEN14_I2C, CKEN);
-#endif
-       writel(I2C_PXA_SLAVE_ADDR, ISAR);       /* set our slave address */
-       writel(I2C_ICR_INIT, ICR);              /* set control reg values */
-       writel(I2C_ISR_INIT, ISR);              /* set clear interrupt bits */
-       writel(readl(ICR) | ICR_IUE, ICR);      /* enable unit */
+       writel(readl(&base->icr) & ~ICR_IUE, &base->icr); /* disable unit */
+
+       i2c_clk_enable();
+
+       writel(CONFIG_SYS_I2C_SLAVE, &base->isar); /* set our slave address */
+       writel(I2C_ICR_INIT, &base->icr); /* set control reg values */
+       writel(I2C_ISR_INIT, &base->isr); /* set clear interrupt bits */
+       writel(readl(&base->icr) | ICR_IUE, &base->icr); /* enable unit */
        udelay(100);
 }
 
-
-/**
+/*
  * i2c_isr_set_cleared: - wait until certain bits of the I2C status register
  *                       are set and cleared
  *
  * @return: 1 in case of success, 0 means timeout (no match within 10 ms).
  */
-static int i2c_isr_set_cleared( unsigned long set_mask, unsigned long cleared_mask )
+static int i2c_isr_set_cleared(unsigned long set_mask,
+                              unsigned long cleared_mask)
 {
-       int timeout = 10000;
+       int timeout = 1000, isr;
 
-       while( ((ISR & set_mask)!=set_mask) || ((ISR & cleared_mask)!=0) ){
-               udelay( 10 );
-               if( timeout-- < 0 ) return 0;
-       }
+       do {
+               isr = readl(&base->isr);
+               udelay(10);
+               if (timeout-- < 0)
+                       return 0;
+       } while (((isr & set_mask) != set_mask)
+               || ((isr & cleared_mask) != 0));
 
        return 1;
 }
 
-
-/**
+/*
  * i2c_transfer: - Transfer one byte over the i2c bus
  *
  * This function can tranfer a byte over the i2c bus in both directions.
@@ -153,77 +159,71 @@ int i2c_transfer(struct i2c_msg *msg)
        if (!msg)
                goto transfer_error_msg_empty;
 
-       switch(msg->direction) {
-
+       switch (msg->direction) {
        case I2C_WRITE:
-
                /* check if bus is not busy */
-               if (!i2c_isr_set_cleared(0,ISR_IBB))
+               if (!i2c_isr_set_cleared(0, ISR_IBB))
                        goto transfer_error_bus_busy;
 
                /* start transmission */
-               writel(readl(ICR) & ~ICR_START, ICR);
-               writel(readl(ICR) & ~ICR_STOP, ICR);
-               writel(msg->data, IDBR);
+               writel(readl(&base->icr) & ~ICR_START, &base->icr);
+               writel(readl(&base->icr) & ~ICR_STOP, &base->icr);
+               writel(msg->data, &base->idbr);
                if (msg->condition == I2C_COND_START)
-                       writel(readl(ICR) | ICR_START, ICR);
+                       writel(readl(&base->icr) | ICR_START, &base->icr);
                if (msg->condition == I2C_COND_STOP)
-                       writel(readl(ICR) | ICR_STOP, ICR);
+                       writel(readl(&base->icr) | ICR_STOP, &base->icr);
                if (msg->acknack == I2C_ACKNAK_SENDNAK)
-                       writel(readl(ICR) | ICR_ACKNAK, ICR);
+                       writel(readl(&base->icr) | ICR_ACKNAK, &base->icr);
                if (msg->acknack == I2C_ACKNAK_SENDACK)
-                       writel(readl(ICR) & ~ICR_ACKNAK, ICR);
-               writel(readl(ICR) & ~ICR_ALDIE, ICR);
-               writel(readl(ICR) | ICR_TB, ICR);
+                       writel(readl(&base->icr) & ~ICR_ACKNAK, &base->icr);
+               writel(readl(&base->icr) & ~ICR_ALDIE, &base->icr);
+               writel(readl(&base->icr) | ICR_TB, &base->icr);
 
                /* transmit register empty? */
-               if (!i2c_isr_set_cleared(ISR_ITE,0))
+               if (!i2c_isr_set_cleared(ISR_ITE, 0))
                        goto transfer_error_transmit_timeout;
 
                /* clear 'transmit empty' state */
-               writel(readl(ISR) | ISR_ITE, ISR);
+               writel(readl(&base->isr) | ISR_ITE, &base->isr);
 
                /* wait for ACK from slave */
                if (msg->acknack == I2C_ACKNAK_WAITACK)
-                       if (!i2c_isr_set_cleared(0,ISR_ACKNAK))
+                       if (!i2c_isr_set_cleared(0, ISR_ACKNAK))
                                goto transfer_error_ack_missing;
                break;
 
        case I2C_READ:
 
                /* check if bus is not busy */
-               if (!i2c_isr_set_cleared(0,ISR_IBB))
+               if (!i2c_isr_set_cleared(0, ISR_IBB))
                        goto transfer_error_bus_busy;
 
                /* start receive */
-               writel(readl(ICR) & ~ICR_START, ICR);
-               writel(readl(ICR) & ~ICR_STOP, ICR);
+               writel(readl(&base->icr) & ~ICR_START, &base->icr);
+               writel(readl(&base->icr) & ~ICR_STOP, &base->icr);
                if (msg->condition == I2C_COND_START)
-                       writel(readl(ICR) | ICR_START, ICR);
+                       writel(readl(&base->icr) | ICR_START, &base->icr);
                if (msg->condition == I2C_COND_STOP)
-                       writel(readl(ICR) | ICR_STOP, ICR);
+                       writel(readl(&base->icr) | ICR_STOP, &base->icr);
                if (msg->acknack == I2C_ACKNAK_SENDNAK)
-                       writel(readl(ICR) | ICR_ACKNAK, ICR);
+                       writel(readl(&base->icr) | ICR_ACKNAK, &base->icr);
                if (msg->acknack == I2C_ACKNAK_SENDACK)
-                       writel(readl(ICR) & ~ICR_ACKNAK, ICR);
-               writel(readl(ICR) & ~ICR_ALDIE, ICR);
-               writel(readl(ICR) | ICR_TB, ICR);
+                       writel(readl(&base->icr) & ~ICR_ACKNAK, &base->icr);
+               writel(readl(&base->icr) & ~ICR_ALDIE, &base->icr);
+               writel(readl(&base->icr) | ICR_TB, &base->icr);
 
                /* receive register full? */
-               if (!i2c_isr_set_cleared(ISR_IRF,0))
+               if (!i2c_isr_set_cleared(ISR_IRF, 0))
                        goto transfer_error_receive_timeout;
 
-               msg->data = readl(IDBR);
+               msg->data = readl(&base->idbr);
 
                /* clear 'receive empty' state */
-               writel(readl(ISR) | ISR_IRF, ISR);
-
+               writel(readl(&base->isr) | ISR_IRF, &base->isr);
                break;
-
        default:
-
                goto transfer_error_illegal_param;
-
        }
 
        return 0;
@@ -253,34 +253,47 @@ transfer_error_bus_busy:
                ret = -6; goto i2c_transfer_finish;
 
 i2c_transfer_finish:
-               PRINTD(("i2c_transfer: ISR: 0x%04x\n",ISR));
+               PRINTD(("i2c_transfer: ISR: 0x%04x\n", ISR));
                i2c_reset();
                return ret;
-
 }
 
 /* ------------------------------------------------------------------------ */
 /* API Functions                                                            */
 /* ------------------------------------------------------------------------ */
-
 void i2c_init(int speed, int slaveaddr)
 {
+#ifdef CONFIG_I2C_MULTI_BUS
+       base = (struct mv_i2c *)i2c_regs[current_bus];
+#else
+       base = (struct mv_i2c *)CONFIG_MV_I2C_REG;
+#endif
+
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
-       /* call board specific i2c bus reset routine before accessing the   */
-       /* environment, which might be in a chip on that bus. For details   */
-       /* about this problem see doc/I2C_Edge_Conditions.                  */
+       u32 icr;
+       /*
+        * call board specific i2c bus reset routine before accessing the
+        * environment, which might be in a chip on that bus. For details
+        * about this problem see doc/I2C_Edge_Conditions.
+        *
+        * disable I2C controller first, otherwhise it thinks we want to
+        * talk to the slave port...
+        */
+       icr = readl(&base->icr);
+       writel(readl(&base->icr) & ~(ICR_SCLE | ICR_IUE), &base->icr);
+
        i2c_init_board();
+
+       writel(icr, &base->icr);
 #endif
 }
 
-
-/**
+/*
  * i2c_probe: - Test if a chip answers for a given i2c address
  *
  * @chip:      address of the chip which is searched for
  * @return:    0 if a chip was found, -1 otherwhise
  */
-
 int i2c_probe(uchar chip)
 {
        struct i2c_msg msg;
@@ -291,19 +304,20 @@ int i2c_probe(uchar chip)
        msg.acknack   = I2C_ACKNAK_WAITACK;
        msg.direction = I2C_WRITE;
        msg.data      = (chip << 1) + 1;
-       if (i2c_transfer(&msg)) return -1;
+       if (i2c_transfer(&msg))
+               return -1;
 
        msg.condition = I2C_COND_STOP;
        msg.acknack   = I2C_ACKNAK_SENDNAK;
        msg.direction = I2C_READ;
        msg.data      = 0x00;
-       if (i2c_transfer(&msg)) return -1;
+       if (i2c_transfer(&msg))
+               return -1;
 
        return 0;
 }
 
-
-/**
+/*
  * i2c_read: - Read multiple bytes from an i2c device
  *
  * The higher level routines take into account that this function is only
@@ -316,14 +330,13 @@ int i2c_probe(uchar chip)
  * @len:       how much byte do we want to read
  * @return:    0 in case of success
  */
-
 int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
        struct i2c_msg msg;
        u8 addr_bytes[3]; /* lowest...highest byte of data address */
-       int ret;
 
-       PRINTD(("i2c_read(chip=0x%02x, addr=0x%02x, alen=0x%02x, len=0x%02x)\n",chip,addr,alen,len));
+       PRINTD(("i2c_read(chip=0x%02x, addr=0x%02x, alen=0x%02x, "
+               "len=0x%02x)\n", chip, addr, alen, len));
 
        i2c_reset();
 
@@ -332,9 +345,10 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
        msg.condition = I2C_COND_START;
        msg.acknack   = I2C_ACKNAK_WAITACK;
        msg.direction = I2C_WRITE;
-       msg.data      = (chip << 1);
-       msg.data     &= 0xFE;
-       if ((ret=i2c_transfer(&msg))) return -1;
+       msg.data = (chip << 1);
+       msg.data &= 0xFE;
+       if (i2c_transfer(&msg))
+               return -1;
 
        /*
         * send memory address bytes;
@@ -346,16 +360,15 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
        addr_bytes[2] = (u8)((addr >> 16) & 0x000000FF);
 
        while (--alen >= 0) {
-
-               PRINTD(("i2c_read: send memory word address byte %1d\n",alen));
+               PRINTD(("i2c_read: send memory word address byte %1d\n", alen));
                msg.condition = I2C_COND_NORMAL;
                msg.acknack   = I2C_ACKNAK_WAITACK;
                msg.direction = I2C_WRITE;
                msg.data      = addr_bytes[alen];
-               if ((ret=i2c_transfer(&msg))) return -1;
+               if (i2c_transfer(&msg))
+                       return -1;
        }
 
-
        /* start read sequence */
        PRINTD(("i2c_read: start read sequence\n"));
        msg.condition = I2C_COND_START;
@@ -363,12 +376,12 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
        msg.direction = I2C_WRITE;
        msg.data      = (chip << 1);
        msg.data     |= 0x01;
-       if ((ret=i2c_transfer(&msg))) return -1;
+       if (i2c_transfer(&msg))
+               return -1;
 
        /* read bytes; send NACK at last byte */
        while (len--) {
-
-               if (len==0) {
+               if (len == 0) {
                        msg.condition = I2C_COND_STOP;
                        msg.acknack   = I2C_ACKNAK_SENDNAK;
                } else {
@@ -378,12 +391,13 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
 
                msg.direction = I2C_READ;
                msg.data      = 0x00;
-               if ((ret=i2c_transfer(&msg))) return -1;
+               if (i2c_transfer(&msg))
+                       return -1;
 
                *buffer = msg.data;
-               PRINTD(("i2c_read: reading byte (0x%08x)=0x%02x\n",(unsigned int)buffer,*buffer));
+               PRINTD(("i2c_read: reading byte (0x%08x)=0x%02x\n",
+                       (unsigned int)buffer, *buffer));
                buffer++;
-
        }
 
        i2c_reset();
@@ -391,8 +405,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
        return 0;
 }
 
-
-/**
+/*
  * i2c_write: -  Write multiple bytes to an i2c device
  *
  * The higher level routines take into account that this function is only
@@ -405,13 +418,13 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
  * @len:       how much byte do we want to read
  * @return:    0 in case of success
  */
-
 int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
        struct i2c_msg msg;
        u8 addr_bytes[3]; /* lowest...highest byte of data address */
 
-       PRINTD(("i2c_write(chip=0x%02x, addr=0x%02x, alen=0x%02x, len=0x%02x)\n",chip,addr,alen,len));
+       PRINTD(("i2c_write(chip=0x%02x, addr=0x%02x, alen=0x%02x, "
+               "len=0x%02x)\n", chip, addr, alen, len));
 
        i2c_reset();
 
@@ -420,9 +433,10 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
        msg.condition = I2C_COND_START;
        msg.acknack   = I2C_ACKNAK_WAITACK;
        msg.direction = I2C_WRITE;
-       msg.data      = (chip << 1);
-       msg.data     &= 0xFE;
-       if (i2c_transfer(&msg)) return -1;
+       msg.data = (chip << 1);
+       msg.data &= 0xFE;
+       if (i2c_transfer(&msg))
+               return -1;
 
        /*
         * send memory address bytes;
@@ -433,21 +447,21 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
        addr_bytes[2] = (u8)((addr >> 16) & 0x000000FF);
 
        while (--alen >= 0) {
-
                PRINTD(("i2c_write: send memory word address\n"));
                msg.condition = I2C_COND_NORMAL;
                msg.acknack   = I2C_ACKNAK_WAITACK;
                msg.direction = I2C_WRITE;
                msg.data      = addr_bytes[alen];
-               if (i2c_transfer(&msg)) return -1;
+               if (i2c_transfer(&msg))
+                       return -1;
        }
 
        /* write bytes; send NACK at last byte */
        while (len--) {
+               PRINTD(("i2c_write: writing byte (0x%08x)=0x%02x\n",
+                       (unsigned int)buffer, *buffer));
 
-               PRINTD(("i2c_write: writing byte (0x%08x)=0x%02x\n",(unsigned int)buffer,*buffer));
-
-               if (len==0)
+               if (len == 0)
                        msg.condition = I2C_COND_STOP;
                else
                        msg.condition = I2C_COND_NORMAL;
@@ -456,14 +470,12 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
                msg.direction = I2C_WRITE;
                msg.data      = *(buffer++);
 
-               if (i2c_transfer(&msg)) return -1;
-
+               if (i2c_transfer(&msg))
+                       return -1;
        }
 
        i2c_reset();
 
        return 0;
-
 }
-
 #endif /* CONFIG_HARD_I2C */
diff --git a/drivers/i2c/mv_i2c.h b/drivers/i2c/mv_i2c.h
new file mode 100644 (file)
index 0000000..41af0d9
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * (C) Copyright 2011
+ * Marvell Inc, <www.marvell.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 _MV_I2C_H_
+#define _MV_I2C_H_
+extern void i2c_clk_enable(void);
+
+/* Shall the current transfer have a start/stop condition? */
+#define I2C_COND_NORMAL                0
+#define I2C_COND_START         1
+#define I2C_COND_STOP          2
+
+/* Shall the current transfer be ack/nacked or being waited for it? */
+#define I2C_ACKNAK_WAITACK     1
+#define I2C_ACKNAK_SENDACK     2
+#define I2C_ACKNAK_SENDNAK     4
+
+/* Specify who shall transfer the data (master or slave) */
+#define I2C_READ               0
+#define I2C_WRITE              1
+
+#if (CONFIG_SYS_I2C_SPEED == 400000)
+#define I2C_ICR_INIT   (ICR_FM | ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD \
+               | ICR_SCLE)
+#else
+#define I2C_ICR_INIT   (ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD | ICR_SCLE)
+#endif
+
+#define I2C_ISR_INIT           0x7FF
+/* ----- Control register bits ---------------------------------------- */
+
+#define ICR_START      0x1             /* start bit */
+#define ICR_STOP       0x2             /* stop bit */
+#define ICR_ACKNAK     0x4             /* send ACK(0) or NAK(1) */
+#define ICR_TB         0x8             /* transfer byte bit */
+#define ICR_MA         0x10            /* master abort */
+#define ICR_SCLE       0x20            /* master clock enable, mona SCLEA */
+#define ICR_IUE                0x40            /* unit enable */
+#define ICR_GCD                0x80            /* general call disable */
+#define ICR_ITEIE      0x100           /* enable tx interrupts */
+#define ICR_IRFIE      0x200           /* enable rx interrupts, mona: DRFIE */
+#define ICR_BEIE       0x400           /* enable bus error ints */
+#define ICR_SSDIE      0x800           /* slave STOP detected int enable */
+#define ICR_ALDIE      0x1000          /* enable arbitration interrupt */
+#define ICR_SADIE      0x2000          /* slave address detected int enable */
+#define ICR_UR         0x4000          /* unit reset */
+#define ICR_FM         0x8000          /* Fast Mode */
+
+/* ----- Status register bits ----------------------------------------- */
+
+#define ISR_RWM                0x1             /* read/write mode */
+#define ISR_ACKNAK     0x2             /* ack/nak status */
+#define ISR_UB         0x4             /* unit busy */
+#define ISR_IBB                0x8             /* bus busy */
+#define ISR_SSD                0x10            /* slave stop detected */
+#define ISR_ALD                0x20            /* arbitration loss detected */
+#define ISR_ITE                0x40            /* tx buffer empty */
+#define ISR_IRF                0x80            /* rx buffer full */
+#define ISR_GCAD       0x100           /* general call address detected */
+#define ISR_SAD                0x200           /* slave address detected */
+#define ISR_BED                0x400           /* bus error no ACK/NAK */
+
+#endif
index 16a536f2fe7ce88bbda3a4288d6b166c613ed38b..5be6dbb403ee61433b484fbe61f9e9c50845acdd 100644 (file)
@@ -2,7 +2,7 @@
  * Driver for the TWSI (i2c) controller found on the Marvell
  * orion5x and kirkwood SoC families.
  *
- * Author: Albert Aribaud <albert.aribaud@free.fr>
+ * Author: Albert Aribaud <albert.u.boot@aribaud.net>
  * Copyright (c) 2010 Albert Aribaud.
  *
  * See file CREDITS for list of people who contributed to this
index c5ec486a7b8a8eb912b0480125d2aedb57fed1f6..89d1973bf5e7ab3e55c58f4d18a5c12760062587 100644 (file)
 
 #if defined(CONFIG_HARD_I2C)
 
-#if defined(CONFIG_MX31)
-#include <asm/arch/mx31.h>
-#include <asm/arch/mx31-regs.h>
-#else
-#include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
-#endif
+#include <asm/arch/imx-regs.h>
 
 #define IADR   0x00
 #define IFDR   0x04
index 215be3419d1b58326ee5a38a16bb7261c76e2a88..71251d8007f6bb89e35be1ffdc92dc4ef8f87eb6 100644 (file)
@@ -321,43 +321,23 @@ int i2c_probe (uchar chip)
        /* wait until bus not busy */
        wait_for_bb ();
 
-       /* try to read one byte */
+       /* try to write one byte */
        writew (1, &i2c_base->cnt);
        /* set slave address */
        writew (chip, &i2c_base->sa);
        /* stop bit needed here */
-       writew (I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_STP, &i2c_base->con);
+       writew(I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX |
+              I2C_CON_STP, &i2c_base->con);
 
-       while (1) {
-               status = wait_for_pin();
-               if (status == 0 || status & I2C_STAT_AL) {
-                       res = 1;
-                       goto probe_exit;
-               }
-               if (status & I2C_STAT_NACK) {
-                       res = 1;
-                       writew(0xff, &i2c_base->stat);
-                       writew (readw (&i2c_base->con) | I2C_CON_STP, &i2c_base->con);
-                       wait_for_bb ();
-                       break;
-               }
-               if (status & I2C_STAT_ARDY) {
-                       writew(I2C_STAT_ARDY, &i2c_base->stat);
-                       break;
-               }
-               if (status & I2C_STAT_RRDY) {
-                       res = 0;
-#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-    defined(CONFIG_OMAP44XX)
-                       readb(&i2c_base->data);
-#else
-                       readw(&i2c_base->data);
-#endif
-                       writew(I2C_STAT_RRDY, &i2c_base->stat);
-               }
-       }
+       status = wait_for_pin();
+
+       /* check for ACK (!NAK) */
+       if (!(status & I2C_STAT_NACK))
+               res = 0;
+
+       /* abort transfer (force idle state) */
+       writew(0, &i2c_base->con);
 
-probe_exit:
        flush_fifo();
        writew (0, &i2c_base->cnt); /* don't allow any more data in...we don't want it.*/
        writew(0xFFFF, &i2c_base->stat);
index 69b5f42205f427255344ad55913896d426774464..9b02e89e0392c975bf71879ad4a056d4dddd1d10 100644 (file)
@@ -286,6 +286,7 @@ int i2c_set_bus_num(unsigned int bus)
                int     ret;
 
                ret = i2x_mux_select_mux(bus);
+               i2c_init_board();
                if (ret == 0)
                        i2c_bus_num = bus;
                else
index 031c9748f4d0692a2707ea7689c0b778a5055714..3233ff2e49a37d42aed1be973259441d0bc1658f 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <linux/compiler.h>
 #include <asm/fsl_law.h>
 #include <asm/io.h>
 
@@ -246,6 +247,25 @@ void init_laws(void)
 #error FSL_HW_NUM_LAWS can not be greater than 32 w/o code changes
 #endif
 
+       /* 
+        * Any LAWs that were set up before we booted assume they are meant to
+        * be around and mark them used.
+        */
+       for (i = 0; i < FSL_HW_NUM_LAWS; i++) {
+               u32 lawar = in_be32(LAWAR_ADDR(i));
+               
+               if (lawar & LAW_EN)
+                       gd->used_laws |= (1 << i);
+       }
+
+#if defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
+       /*
+        * in NAND boot we've already parsed the law_table and setup those LAWs
+        * so don't do it again.
+        */
+       return;
+#endif
+
        for (i = 0; i < num_law_entries; i++) {
                if (law_table[i].index == -1)
                        set_next_law(law_table[i].addr, law_table[i].size,
index 3496f0aa0feea3bf649f3904d8ac52690fbcb3db..a8fe17a6f7bffd14769e8d09a0f5565c181282d9 100644 (file)
@@ -31,6 +31,8 @@ COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 COBJS-$(CONFIG_GENERIC_MMC) += mmc.o
 COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
+COBJS-$(CONFIG_MMC_SPI) += mmc_spi.o
+COBJS-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o
 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
new file mode 100644 (file)
index 0000000..ed296ee
--- /dev/null
@@ -0,0 +1,443 @@
+/*
+ * ARM PrimeCell MultiMedia Card Interface - PL180
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * Author: Ulf Hansson <ulf.hansson@stericsson.com>
+ * Author: Martin Lundholm <martin.xa.lundholm@stericsson.com>
+ * Ported to drivers/mmc/ by: Matt Waddel <matt.waddel@linaro.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
+ */
+
+/* #define DEBUG */
+
+#include <asm/io.h>
+#include "common.h"
+#include <errno.h>
+#include <mmc.h>
+#include "arm_pl180_mmci.h"
+#include <malloc.h>
+
+struct mmc_host {
+       struct sdi_registers *base;
+};
+
+static int wait_for_command_end(struct mmc *dev, struct mmc_cmd *cmd)
+{
+       u32 hoststatus, statusmask;
+       struct mmc_host *host = dev->priv;
+
+       statusmask = SDI_STA_CTIMEOUT | SDI_STA_CCRCFAIL;
+       if ((cmd->resp_type & MMC_RSP_PRESENT))
+               statusmask |= SDI_STA_CMDREND;
+       else
+               statusmask |= SDI_STA_CMDSENT;
+
+       do
+               hoststatus = readl(&host->base->status) & statusmask;
+       while (!hoststatus);
+
+       writel(statusmask, &host->base->status_clear);
+       if (hoststatus & SDI_STA_CTIMEOUT) {
+               printf("CMD%d time out\n", cmd->cmdidx);
+               return -ETIMEDOUT;
+       } else if ((hoststatus & SDI_STA_CCRCFAIL) &&
+                  (cmd->flags & MMC_RSP_CRC)) {
+               printf("CMD%d CRC error\n", cmd->cmdidx);
+               return -EILSEQ;
+       }
+
+       if (cmd->resp_type & MMC_RSP_PRESENT) {
+               cmd->response[0] = readl(&host->base->response0);
+               cmd->response[1] = readl(&host->base->response1);
+               cmd->response[2] = readl(&host->base->response2);
+               cmd->response[3] = readl(&host->base->response3);
+               debug("CMD%d response[0]:0x%08X, response[1]:0x%08X, "
+                       "response[2]:0x%08X, response[3]:0x%08X\n",
+                       cmd->cmdidx, cmd->response[0], cmd->response[1],
+                       cmd->response[2], cmd->response[3]);
+       }
+
+       return 0;
+}
+
+/* send command to the mmc card and wait for results */
+static int do_command(struct mmc *dev, struct mmc_cmd *cmd)
+{
+       int result;
+       u32 sdi_cmd = 0;
+       struct mmc_host *host = dev->priv;
+
+       sdi_cmd = ((cmd->cmdidx & SDI_CMD_CMDINDEX_MASK) | SDI_CMD_CPSMEN);
+
+       if (cmd->resp_type) {
+               sdi_cmd |= SDI_CMD_WAITRESP;
+               if (cmd->resp_type & MMC_RSP_136)
+                       sdi_cmd |= SDI_CMD_LONGRESP;
+       }
+
+       writel((u32)cmd->cmdarg, &host->base->argument);
+       udelay(COMMAND_REG_DELAY);
+       writel(sdi_cmd, &host->base->command);
+       result = wait_for_command_end(dev, cmd);
+
+       /* After CMD2 set RCA to a none zero value. */
+       if ((result == 0) && (cmd->cmdidx == MMC_CMD_ALL_SEND_CID))
+               dev->rca = 10;
+
+       /* After CMD3 open drain is switched off and push pull is used. */
+       if ((result == 0) && (cmd->cmdidx == MMC_CMD_SET_RELATIVE_ADDR)) {
+               u32 sdi_pwr = readl(&host->base->power) & ~SDI_PWR_OPD;
+               writel(sdi_pwr, &host->base->power);
+       }
+
+       return result;
+}
+
+static int read_bytes(struct mmc *dev, u32 *dest, u32 blkcount, u32 blksize)
+{
+       u32 *tempbuff = dest;
+       int i;
+       u64 xfercount = blkcount * blksize;
+       struct mmc_host *host = dev->priv;
+       u32 status, status_err;
+
+       debug("read_bytes: blkcount=%u blksize=%u\n", blkcount, blksize);
+
+       status = readl(&host->base->status);
+       status_err = status & (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT |
+                              SDI_STA_RXOVERR);
+       while (!status_err &&
+              (xfercount >= SDI_FIFO_BURST_SIZE * sizeof(u32))) {
+               if (status & SDI_STA_RXFIFOBR) {
+                       for (i = 0; i < SDI_FIFO_BURST_SIZE; i++)
+                               *(tempbuff + i) = readl(&host->base->fifo);
+                       tempbuff += SDI_FIFO_BURST_SIZE;
+                       xfercount -= SDI_FIFO_BURST_SIZE * sizeof(u32);
+               }
+               status = readl(&host->base->status);
+               status_err = status &
+                       (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT | SDI_STA_RXOVERR);
+       }
+
+       if (status & SDI_STA_DTIMEOUT) {
+               printf("Read data timed out, xfercount: %llu, status: 0x%08X\n",
+                       xfercount, status);
+               return -ETIMEDOUT;
+       } else if (status & SDI_STA_DCRCFAIL) {
+               printf("Read data blk CRC error: 0x%x\n", status);
+               return -EILSEQ;
+       } else if (status & SDI_STA_RXOVERR) {
+               printf("Read data RX overflow error\n");
+               return -EIO;
+       }
+
+       while ((!status_err) && (xfercount >= sizeof(u32))) {
+               if (status & SDI_STA_RXDAVL) {
+                       *(tempbuff) = readl(&host->base->fifo);
+                       tempbuff++;
+                       xfercount -= sizeof(u32);
+               }
+               status = readl(&host->base->status);
+               status_err = status & (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT |
+                                      SDI_STA_RXOVERR);
+       }
+
+       status_err = status &
+               (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT | SDI_STA_DBCKEND |
+                SDI_STA_RXOVERR);
+       while (!status_err) {
+               status = readl(&host->base->status);
+               status_err = status &
+                       (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT | SDI_STA_DBCKEND |
+                        SDI_STA_RXOVERR);
+       }
+
+       if (status & SDI_STA_DTIMEOUT) {
+               printf("Read data timed out, xfercount: %llu, status: 0x%08X\n",
+                       xfercount, status);
+               return -ETIMEDOUT;
+       } else if (status & SDI_STA_DCRCFAIL) {
+               printf("Read data bytes CRC error: 0x%x\n", status);
+               return -EILSEQ;
+       } else if (status & SDI_STA_RXOVERR) {
+               printf("Read data RX overflow error\n");
+               return -EIO;
+       }
+
+       writel(SDI_ICR_MASK, &host->base->status_clear);
+
+       if (xfercount) {
+               printf("Read data error, xfercount: %llu\n", xfercount);
+               return -ENOBUFS;
+       }
+
+       return 0;
+}
+
+static int write_bytes(struct mmc *dev, u32 *src, u32 blkcount, u32 blksize)
+{
+       u32 *tempbuff = src;
+       int i;
+       u64 xfercount = blkcount * blksize;
+       struct mmc_host *host = dev->priv;
+       u32 status, status_err;
+
+       debug("write_bytes: blkcount=%u blksize=%u\n", blkcount, blksize);
+
+       status = readl(&host->base->status);
+       status_err = status & (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT);
+       while (!status_err && xfercount) {
+               if (status & SDI_STA_TXFIFOBW) {
+                       if (xfercount >= SDI_FIFO_BURST_SIZE * sizeof(u32)) {
+                               for (i = 0; i < SDI_FIFO_BURST_SIZE; i++)
+                                       writel(*(tempbuff + i),
+                                               &host->base->fifo);
+                               tempbuff += SDI_FIFO_BURST_SIZE;
+                               xfercount -= SDI_FIFO_BURST_SIZE * sizeof(u32);
+                       } else {
+                               while (xfercount >= sizeof(u32)) {
+                                       writel(*(tempbuff), &host->base->fifo);
+                                       tempbuff++;
+                                       xfercount -= sizeof(u32);
+                               }
+                       }
+               }
+               status = readl(&host->base->status);
+               status_err = status & (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT);
+       }
+
+       status_err = status &
+               (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT | SDI_STA_DBCKEND);
+       while (!status_err) {
+               status = readl(&host->base->status);
+               status_err = status &
+                       (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT | SDI_STA_DBCKEND);
+       }
+
+       if (status & SDI_STA_DTIMEOUT) {
+               printf("Write data timed out, xfercount:%llu,status:0x%08X\n",
+                      xfercount, status);
+               return -ETIMEDOUT;
+       } else if (status & SDI_STA_DCRCFAIL) {
+               printf("Write data CRC error\n");
+               return -EILSEQ;
+       }
+
+       writel(SDI_ICR_MASK, &host->base->status_clear);
+
+       if (xfercount) {
+               printf("Write data error, xfercount:%llu", xfercount);
+               return -ENOBUFS;
+       }
+
+       return 0;
+}
+
+static int do_data_transfer(struct mmc *dev,
+                           struct mmc_cmd *cmd,
+                           struct mmc_data *data)
+{
+       int error = -ETIMEDOUT;
+       struct mmc_host *host = dev->priv;
+       u32 blksz = 0;
+       u32 data_ctrl = 0;
+       u32 data_len = (u32) (data->blocks * data->blocksize);
+
+       blksz = (ffs(data->blocksize) - 1);
+       data_ctrl |= ((blksz << 4) & SDI_DCTRL_DBLKSIZE_MASK);
+       data_ctrl |= SDI_DCTRL_DTEN;
+
+       writel(SDI_DTIMER_DEFAULT, &host->base->datatimer);
+       writel(data_len, &host->base->datalength);
+       udelay(DATA_REG_DELAY);
+
+       if (data->flags & MMC_DATA_READ) {
+               data_ctrl |= SDI_DCTRL_DTDIR_IN;
+               writel(data_ctrl, &host->base->datactrl);
+
+               error = do_command(dev, cmd);
+               if (error)
+                       return error;
+
+               error = read_bytes(dev, (u32 *)data->dest, (u32)data->blocks,
+                                  (u32)data->blocksize);
+       } else if (data->flags & MMC_DATA_WRITE) {
+               error = do_command(dev, cmd);
+               if (error)
+                       return error;
+
+               writel(data_ctrl, &host->base->datactrl);
+               error = write_bytes(dev, (u32 *)data->src, (u32)data->blocks,
+                                   (u32)data->blocksize);
+       }
+
+       return error;
+}
+
+static int host_request(struct mmc *dev,
+                       struct mmc_cmd *cmd,
+                       struct mmc_data *data)
+{
+       int result;
+
+       if (data)
+               result = do_data_transfer(dev, cmd, data);
+       else
+               result = do_command(dev, cmd);
+
+       return result;
+}
+
+/* MMC uses open drain drivers in the enumeration phase */
+static int mmc_host_reset(struct mmc *dev)
+{
+       struct mmc_host *host = dev->priv;
+       u32 sdi_u32 = SDI_PWR_OPD | SDI_PWR_PWRCTRL_ON;
+
+       writel(sdi_u32, &host->base->power);
+
+       return 0;
+}
+
+static void host_set_ios(struct mmc *dev)
+{
+       struct mmc_host *host = dev->priv;
+       u32 sdi_clkcr;
+
+       sdi_clkcr = readl(&host->base->clock);
+
+       /* Ramp up the clock rate */
+       if (dev->clock) {
+               u32 clkdiv = 0;
+
+               if (dev->clock >= dev->f_max)
+                       dev->clock = dev->f_max;
+
+               clkdiv = ((ARM_MCLK / dev->clock) / 2) - 1;
+
+               if (clkdiv > SDI_CLKCR_CLKDIV_MASK)
+                       clkdiv = SDI_CLKCR_CLKDIV_MASK;
+
+               sdi_clkcr &= ~(SDI_CLKCR_CLKDIV_MASK);
+               sdi_clkcr |= clkdiv;
+       }
+
+       /* Set the bus width */
+       if (dev->bus_width) {
+               u32 buswidth = 0;
+
+               switch (dev->bus_width) {
+               case 1:
+                       buswidth |= SDI_CLKCR_WIDBUS_1;
+                       break;
+               case 4:
+                       buswidth |= SDI_CLKCR_WIDBUS_4;
+                       break;
+               default:
+                       printf("Invalid bus width\n");
+                       break;
+               }
+               sdi_clkcr &= ~(SDI_CLKCR_WIDBUS_MASK);
+               sdi_clkcr |= buswidth;
+       }
+
+       writel(sdi_clkcr, &host->base->clock);
+       udelay(CLK_CHANGE_DELAY);
+}
+
+struct mmc *alloc_mmc_struct(void)
+{
+       struct mmc_host *host = NULL;
+       struct mmc *mmc_device = NULL;
+
+       host = malloc(sizeof(struct mmc_host));
+       if (!host)
+               return NULL;
+
+       mmc_device = malloc(sizeof(struct mmc));
+       if (!mmc_device)
+               goto err;
+
+       mmc_device->priv = host;
+       return mmc_device;
+
+err:
+       free(host);
+       return NULL;
+}
+
+/*
+ * mmc_host_init - initialize the mmc controller.
+ * Set initial clock and power for mmc slot.
+ * Initialize mmc struct and register with mmc framework.
+ */
+static int arm_pl180_mmci_host_init(struct mmc *dev)
+{
+       struct mmc_host *host = dev->priv;
+       u32 sdi_u32;
+
+       host->base = (struct sdi_registers *)CONFIG_ARM_PL180_MMCI_BASE;
+
+       /* Initially set power-on, full voltage & MMCI read */
+       sdi_u32 = INIT_PWR;
+       writel(sdi_u32, &host->base->power);
+
+       /* setting clk freq 505KHz */
+       sdi_u32 = SDI_CLKCR_CLKDIV_INIT | SDI_CLKCR_CLKEN;
+       writel(sdi_u32, &host->base->clock);
+       udelay(CLK_CHANGE_DELAY);
+
+       /* Disable mmc interrupts */
+       sdi_u32 = readl(&host->base->mask0) & ~SDI_MASK0_MASK;
+       writel(sdi_u32, &host->base->mask0);
+
+       sprintf(dev->name, "MMC");
+       dev->clock = ARM_MCLK / (2 * (SDI_CLKCR_CLKDIV_INIT + 1));
+       dev->send_cmd = host_request;
+       dev->set_ios = host_set_ios;
+       dev->init = mmc_host_reset;
+       dev->host_caps = 0;
+       dev->voltages = VOLTAGE_WINDOW_MMC;
+       dev->f_min = dev->clock;
+       dev->f_max = CONFIG_ARM_PL180_MMCI_CLOCK_FREQ;
+
+       return 0;
+}
+
+int arm_pl180_mmci_init(void)
+{
+       int error;
+       struct mmc *dev;
+
+       dev = alloc_mmc_struct();
+       if (!dev)
+               return -1;
+
+       error = arm_pl180_mmci_host_init(dev);
+       if (error) {
+               printf("mmci_host_init error - %d\n", error);
+               return -1;
+       }
+
+       dev->b_max = 0;
+
+       mmc_register(dev);
+       debug("registered mmc interface number is:%d\n", dev->block_dev.dev);
+
+       return 0;
+}
diff --git a/drivers/mmc/arm_pl180_mmci.h b/drivers/mmc/arm_pl180_mmci.h
new file mode 100644 (file)
index 0000000..42fbe3e
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * ARM PrimeCell MultiMedia Card Interface - PL180
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * Author: Ulf Hansson <ulf.hansson@stericsson.com>
+ * Author: Martin Lundholm <martin.xa.lundholm@stericsson.com>
+ * Ported to drivers/mmc/ by: Matt Waddel <matt.waddel@linaro.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
+ */
+
+#ifndef __ARM_PL180_MMCI_H__
+#define __ARM_PL180_MMCI_H__
+
+int arm_pl180_mmci_init(void);
+
+#define COMMAND_REG_DELAY      300
+#define DATA_REG_DELAY         1000
+#define CLK_CHANGE_DELAY       2000
+
+#define INIT_PWR               0xBF /* Power on, full power, not open drain */
+#define ARM_MCLK               (100*1000*1000)
+
+/* SDI Power Control register bits */
+#define SDI_PWR_PWRCTRL_MASK   0x00000003
+#define SDI_PWR_PWRCTRL_ON     0x00000003
+#define SDI_PWR_PWRCTRL_OFF    0x00000000
+#define SDI_PWR_DAT2DIREN      0x00000004
+#define SDI_PWR_CMDDIREN       0x00000008
+#define SDI_PWR_DAT0DIREN      0x00000010
+#define SDI_PWR_DAT31DIREN     0x00000020
+#define SDI_PWR_OPD            0x00000040
+#define SDI_PWR_FBCLKEN                0x00000080
+#define SDI_PWR_DAT74DIREN     0x00000100
+#define SDI_PWR_RSTEN          0x00000200
+
+#define VOLTAGE_WINDOW_MMC     0x00FF8080
+#define VOLTAGE_WINDOW_SD      0x80010000
+
+/* SDI clock control register bits */
+#define SDI_CLKCR_CLKDIV_MASK  0x000000FF
+#define SDI_CLKCR_CLKEN                0x00000100
+#define SDI_CLKCR_PWRSAV       0x00000200
+#define SDI_CLKCR_BYPASS       0x00000400
+#define SDI_CLKCR_WIDBUS_MASK  0x00001800
+#define SDI_CLKCR_WIDBUS_1     0x00000000
+#define SDI_CLKCR_WIDBUS_4     0x00000800
+
+#define SDI_CLKCR_CLKDIV_INIT  0x000000C6 /* MCLK/(2*(0xC6+1)) => 505KHz */
+
+/* SDI command register bits */
+#define SDI_CMD_CMDINDEX_MASK  0x000000FF
+#define SDI_CMD_WAITRESP       0x00000040
+#define SDI_CMD_LONGRESP       0x00000080
+#define SDI_CMD_WAITINT                0x00000100
+#define SDI_CMD_WAITPEND       0x00000200
+#define SDI_CMD_CPSMEN         0x00000400
+#define SDI_CMD_SDIOSUSPEND    0x00000800
+#define SDI_CMD_ENDCMDCOMPL    0x00001000
+#define SDI_CMD_NIEN           0x00002000
+#define SDI_CMD_CE_ATACMD      0x00004000
+#define SDI_CMD_CBOOTMODEEN    0x00008000
+
+#define SDI_DTIMER_DEFAULT     0xFFFF0000
+
+/* SDI Status register bits */
+#define SDI_STA_CCRCFAIL       0x00000001
+#define SDI_STA_DCRCFAIL       0x00000002
+#define SDI_STA_CTIMEOUT       0x00000004
+#define SDI_STA_DTIMEOUT       0x00000008
+#define SDI_STA_TXUNDERR       0x00000010
+#define SDI_STA_RXOVERR                0x00000020
+#define SDI_STA_CMDREND                0x00000040
+#define SDI_STA_CMDSENT                0x00000080
+#define SDI_STA_DATAEND                0x00000100
+#define SDI_STA_STBITERR       0x00000200
+#define SDI_STA_DBCKEND                0x00000400
+#define SDI_STA_CMDACT         0x00000800
+#define SDI_STA_TXACT          0x00001000
+#define SDI_STA_RXACT          0x00002000
+#define SDI_STA_TXFIFOBW       0x00004000
+#define SDI_STA_RXFIFOBR       0x00008000
+#define SDI_STA_TXFIFOF                0x00010000
+#define SDI_STA_RXFIFOF                0x00020000
+#define SDI_STA_TXFIFOE                0x00040000
+#define SDI_STA_RXFIFOE                0x00080000
+#define SDI_STA_TXDAVL         0x00100000
+#define SDI_STA_RXDAVL         0x00200000
+#define SDI_STA_SDIOIT         0x00400000
+#define SDI_STA_CEATAEND       0x00800000
+#define SDI_STA_CARDBUSY       0x01000000
+#define SDI_STA_BOOTMODE       0x02000000
+#define SDI_STA_BOOTACKERR     0x04000000
+#define SDI_STA_BOOTACKTIMEOUT 0x08000000
+#define SDI_STA_RSTNEND                0x10000000
+
+/* SDI Interrupt Clear register bits */
+#define SDI_ICR_MASK           0x1DC007FF
+#define SDI_ICR_CCRCFAILC      0x00000001
+#define SDI_ICR_DCRCFAILC      0x00000002
+#define SDI_ICR_CTIMEOUTC      0x00000004
+#define SDI_ICR_DTIMEOUTC      0x00000008
+#define SDI_ICR_TXUNDERRC      0x00000010
+#define SDI_ICR_RXOVERRC       0x00000020
+#define SDI_ICR_CMDRENDC       0x00000040
+#define SDI_ICR_CMDSENTC       0x00000080
+#define SDI_ICR_DATAENDC       0x00000100
+#define SDI_ICR_STBITERRC      0x00000200
+#define SDI_ICR_DBCKENDC       0x00000400
+#define SDI_ICR_SDIOITC                0x00400000
+#define SDI_ICR_CEATAENDC      0x00800000
+#define SDI_ICR_BUSYENDC       0x01000000
+#define SDI_ICR_BOOTACKERRC    0x04000000
+#define SDI_ICR_BOOTACKTIMEOUTC        0x08000000
+#define SDI_ICR_RSTNENDC       0x10000000
+
+#define SDI_MASK0_MASK         0x1FFFFFFF
+
+/* SDI Data control register bits */
+#define SDI_DCTRL_DTEN         0x00000001
+#define SDI_DCTRL_DTDIR_IN     0x00000002
+#define SDI_DCTRL_DTMODE_STREAM        0x00000004
+#define SDI_DCTRL_DMAEN                0x00000008
+#define SDI_DCTRL_DBLKSIZE_MASK        0x000000F0
+#define SDI_DCTRL_RWSTART      0x00000100
+#define SDI_DCTRL_RWSTOP       0x00000200
+#define SDI_DCTRL_RWMOD                0x00000200
+#define SDI_DCTRL_SDIOEN       0x00000800
+#define SDI_DCTRL_DMAREQCTL    0x00001000
+#define SDI_DCTRL_DBOOTMODEEN  0x00002000
+#define SDI_DCTRL_BUSYMODE     0x00004000
+#define SDI_DCTRL_DDR_MODE     0x00008000
+
+#define SDI_FIFO_BURST_SIZE    8
+
+struct sdi_registers {
+       u32 power;              /* 0x00*/
+       u32 clock;              /* 0x04*/
+       u32 argument;           /* 0x08*/
+       u32 command;            /* 0x0c*/
+       u32 respcommand;        /* 0x10*/
+       u32 response0;          /* 0x14*/
+       u32 response1;          /* 0x18*/
+       u32 response2;          /* 0x1c*/
+       u32 response3;          /* 0x20*/
+       u32 datatimer;          /* 0x24*/
+       u32 datalength;         /* 0x28*/
+       u32 datactrl;           /* 0x2c*/
+       u32 datacount;          /* 0x30*/
+       u32 status;             /* 0x34*/
+       u32 status_clear;       /* 0x38*/
+       u32 mask0;              /* 0x3c*/
+       u32 mask1;              /* 0x40*/
+       u32 card_select;        /* 0x44*/
+       u32 fifo_count;         /* 0x48*/
+       u32 padding1[(0x80-0x4C)>>2];
+       u32 fifo;               /* 0x80*/
+       u32 padding2[(0xFE0-0x84)>>2];
+       u32 periph_id0;         /* 0xFE0 mmc Peripheral Identifcation Register*/
+       u32 periph_id1;         /* 0xFE4*/
+       u32 periph_id2;         /* 0xFE8*/
+       u32 periph_id3;         /* 0xFEC*/
+       u32 pcell_id0;          /* 0xFF0*/
+       u32 pcell_id1;          /* 0xFF4*/
+       u32 pcell_id2;          /* 0xFF8*/
+       u32 pcell_id3;          /* 0xFFC*/
+};
+
+#endif
index 27d9bf6cbf985d167ec116c4fadc25bd5752744f..bc9057fa9a5a444c359eb93d34032ec8e19cf384 100644 (file)
@@ -19,7 +19,7 @@
 #include <asm/mach-common/bits/sdh.h>
 #include <asm/mach-common/bits/dma.h>
 
-#if defined(__ADSPBF51x__)
+#if defined(__ADSPBF50x__) || defined(__ADSPBF51x__)
 # define bfin_read_SDH_PWR_CTL         bfin_read_RSI_PWR_CONTROL
 # define bfin_write_SDH_PWR_CTL                bfin_write_RSI_PWR_CONTROL
 # define bfin_read_SDH_CLK_CTL         bfin_read_RSI_CLK_CONTROL
@@ -114,25 +114,26 @@ static int sdh_setup_data(struct mmc *mmc, struct mmc_data *data)
        u16 data_ctl = 0;
        u16 dma_cfg = 0;
        int ret = 0;
+       unsigned long data_size = data->blocksize * data->blocks;
 
        /* Don't support write yet. */
        if (data->flags & MMC_DATA_WRITE)
                return UNUSABLE_ERR;
-       data_ctl |= ((ffs(data->blocksize) - 1) << 4);
+       data_ctl |= ((ffs(data_size) - 1) << 4);
        data_ctl |= DTX_DIR;
        bfin_write_SDH_DATA_CTL(data_ctl);
        dma_cfg = WDSIZE_32 | RESTART | WNR | DMAEN;
 
-       bfin_write_SDH_DATA_TIMER(0xFFFF);
+       bfin_write_SDH_DATA_TIMER(-1);
 
        blackfin_dcache_flush_invalidate_range(data->dest,
-                       data->dest + data->blocksize);
+                       data->dest + data_size);
        /* configure DMA */
        bfin_write_DMA_START_ADDR(data->dest);
-       bfin_write_DMA_X_COUNT(data->blocksize / 4);
+       bfin_write_DMA_X_COUNT(data_size / 4);
        bfin_write_DMA_X_MODIFY(4);
        bfin_write_DMA_CONFIG(dma_cfg);
-       bfin_write_SDH_DATA_LGTH(data->blocksize);
+       bfin_write_SDH_DATA_LGTH(data_size);
        /* kick off transfer */
        bfin_write_SDH_DATA_CTL(bfin_read_SDH_DATA_CTL() | DTX_DMA_E | DTX_E);
 
@@ -256,6 +257,8 @@ int bfin_mmc_init(bd_t *bis)
        mmc->f_min = mmc->f_max >> 9;
        mmc->block_dev.part_type = PART_TYPE_DOS;
 
+       mmc->b_max = 0;
+
        mmc_register(mmc);
 
        return 0;
index d5d19ebee30ea679637b71137c3be1132bea7bd9..5d918e6ffcac8139a9dfa28ea344b05a6d06b801 100644 (file)
@@ -394,9 +394,8 @@ int davinci_mmc_init(bd_t *bis, struct davinci_mmc *host)
        mmc->voltages = host->voltages;
        mmc->host_caps = host->host_caps;
 
-#ifdef CONFIG_MMC_MBLOCK
        mmc->b_max = DAVINCI_MAX_BLOCKS;
-#endif
+
        mmc_register(mmc);
 
        return 0;
index 0962ac4476aaef82b51616c08add152330fccb78..d2355be6b0101f257fc90edcdca163487695248a 100644 (file)
@@ -99,6 +99,10 @@ uint esdhc_xfertyp(struct mmc_cmd *cmd, struct mmc_data *data)
        else if (cmd->resp_type & MMC_RSP_PRESENT)
                xfertyp |= XFERTYP_RSPTYP_48;
 
+#ifdef CONFIG_MX53
+       if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
+               xfertyp |= XFERTYP_CMDTYP_ABORT;
+#endif
        return XFERTYP_CMD(cmd->cmdidx) | xfertyp;
 }
 
@@ -178,14 +182,14 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)
        wml_value = data->blocksize/4;
 
        if (data->flags & MMC_DATA_READ) {
-               if (wml_value > 0x10)
-                       wml_value = 0x10;
+               if (wml_value > WML_RD_WML_MAX)
+                       wml_value = WML_RD_WML_MAX_VAL;
 
                esdhc_clrsetbits32(&regs->wml, WML_RD_WML_MASK, wml_value);
                esdhc_write32(&regs->dsaddr, (u32)data->dest);
        } else {
-               if (wml_value > 0x80)
-                       wml_value = 0x80;
+               if (wml_value > WML_WR_WML_MAX)
+                       wml_value = WML_WR_WML_MAX_VAL;
                if ((esdhc_read32(&regs->prsstat) & PRSSTAT_WPSPL) == 0) {
                        printf("\nThe SD card is locked. Can not write to a locked card.\n\n");
                        return TIMEOUT;
@@ -332,11 +336,11 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
                do {
                        irqstat = esdhc_read32(&regs->irqstat);
 
-                       if (irqstat & DATA_ERR)
-                               return COMM_ERR;
-
                        if (irqstat & IRQSTAT_DTOE)
                                return TIMEOUT;
+
+                       if (irqstat & DATA_ERR)
+                               return COMM_ERR;
                } while (!(irqstat & IRQSTAT_TC) &&
                                (esdhc_read32(&regs->prsstat) & PRSSTAT_DLA));
 #endif
index 2984d645c9ddab0dfba0f9229eecc52f1d3e20bd..6577925b8ecc558e91b160acc571c6b2690d9c2d 100644 (file)
@@ -348,6 +348,8 @@ int atmel_mci_init(void *regs)
        mmc->f_min = get_mci_clk_rate() / (2*256);
        mmc->f_max = get_mci_clk_rate() / (2*1);
 
+       mmc->b_max = 0;
+
        mmc_register(mmc);
 
        return 0;
index 6805b33f7a13285256c3a71f363e08fdb03d0199..f6d31f58488f427c8099be59e7624533efcd492e 100644 (file)
 #include <part.h>
 #include <malloc.h>
 #include <linux/list.h>
-#include <mmc.h>
 #include <div64.h>
 
+/* Set block count limit because of 16 bit register limit on some hardware*/
+#ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535
+#endif
+
 static struct list_head mmc_devices;
 static int cur_dev_num = -1;
 
@@ -45,7 +49,100 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)__attribute__((weak,
 
 int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 {
+#ifdef CONFIG_MMC_TRACE
+       int ret;
+       int i;
+       u8 *ptr;
+
+       printf("CMD_SEND:%d\n", cmd->cmdidx);
+       printf("\t\tARG\t\t\t 0x%08X\n", cmd->cmdarg);
+       printf("\t\tFLAG\t\t\t %d\n", cmd->flags);
+       ret = mmc->send_cmd(mmc, cmd, data);
+       switch (cmd->resp_type) {
+               case MMC_RSP_NONE:
+                       printf("\t\tMMC_RSP_NONE\n");
+                       break;
+               case MMC_RSP_R1:
+                       printf("\t\tMMC_RSP_R1,5,6,7 \t 0x%08X \n",
+                               cmd->response[0]);
+                       break;
+               case MMC_RSP_R1b:
+                       printf("\t\tMMC_RSP_R1b\t\t 0x%08X \n",
+                               cmd->response[0]);
+                       break;
+               case MMC_RSP_R2:
+                       printf("\t\tMMC_RSP_R2\t\t 0x%08X \n",
+                               cmd->response[0]);
+                       printf("\t\t          \t\t 0x%08X \n",
+                               cmd->response[1]);
+                       printf("\t\t          \t\t 0x%08X \n",
+                               cmd->response[2]);
+                       printf("\t\t          \t\t 0x%08X \n",
+                               cmd->response[3]);
+                       printf("\n");
+                       printf("\t\t\t\t\tDUMPING DATA\n");
+                       for (i = 0; i < 4; i++) {
+                               int j;
+                               printf("\t\t\t\t\t%03d - ", i*4);
+                               ptr = &cmd->response[i];
+                               ptr += 3;
+                               for (j = 0; j < 4; j++)
+                                       printf("%02X ", *ptr--);
+                               printf("\n");
+                       }
+                       break;
+               case MMC_RSP_R3:
+                       printf("\t\tMMC_RSP_R3,4\t\t 0x%08X \n",
+                               cmd->response[0]);
+                       break;
+               default:
+                       printf("\t\tERROR MMC rsp not supported\n");
+                       break;
+       }
+       return ret;
+#else
        return mmc->send_cmd(mmc, cmd, data);
+#endif
+}
+
+int mmc_send_status(struct mmc *mmc, int timeout)
+{
+       struct mmc_cmd cmd;
+       int err;
+#ifdef CONFIG_MMC_TRACE
+       int status;
+#endif
+
+       cmd.cmdidx = MMC_CMD_SEND_STATUS;
+       cmd.resp_type = MMC_RSP_R1;
+       cmd.cmdarg = 0;
+       cmd.flags = 0;
+
+       do {
+               err = mmc_send_cmd(mmc, &cmd, NULL);
+               if (err)
+                       return err;
+               else if (cmd.response[0] & MMC_STATUS_RDY_FOR_DATA)
+                       break;
+
+               udelay(1000);
+
+               if (cmd.response[0] & MMC_STATUS_MASK) {
+                       printf("Status Error: 0x%08X\n", cmd.response[0]);
+                       return COMM_ERR;
+               }
+       } while (timeout--);
+
+#ifdef CONFIG_MMC_TRACE
+       status = (cmd.response[0] & MMC_STATUS_CURR_STATE) >> 9;
+       printf("CURR STATE:%d\n", status);
+#endif
+       if (!timeout) {
+               printf("Timeout waiting card ready\n");
+               return TIMEOUT;
+       }
+
+       return 0;
 }
 
 int mmc_set_blocklen(struct mmc *mmc, int len)
@@ -82,6 +179,7 @@ mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src)
 {
        struct mmc_cmd cmd;
        struct mmc_data data;
+       int timeout = 1000;
 
        if ((start + blkcnt) > mmc->block_dev.lba) {
                printf("MMC: block number 0x%lx exceeds max(0x%lx)\n",
@@ -112,7 +210,10 @@ mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src)
                return 0;
        }
 
-       if (blkcnt > 1) {
+       /* SPI multiblock writes terminate using a special
+        * token, not a STOP_TRANSMISSION request.
+        */
+       if (!mmc_host_is_spi(mmc) && blkcnt > 1) {
                cmd.cmdidx = MMC_CMD_STOP_TRANSMISSION;
                cmd.cmdarg = 0;
                cmd.resp_type = MMC_RSP_R1b;
@@ -121,6 +222,9 @@ mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src)
                        printf("mmc fail to send stop cmd\n");
                        return 0;
                }
+
+               /* Waiting for the ready status */
+               mmc_send_status(mmc, timeout);
        }
 
        return blkcnt;
@@ -139,11 +243,7 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src)
                return 0;
 
        do {
-               /*
-                * The 65535 constraint comes from some hardware has
-                * only 16 bit width block number counter
-                */
-               cur = (blocks_todo > 65535) ? 65535 : blocks_todo;
+               cur = (blocks_todo > mmc->b_max) ?  mmc->b_max : blocks_todo;
                if(mmc_write_blocks(mmc, start, cur, src) != cur)
                        return 0;
                blocks_todo -= cur;
@@ -158,6 +258,7 @@ int mmc_read_blocks(struct mmc *mmc, void *dst, ulong start, lbaint_t blkcnt)
 {
        struct mmc_cmd cmd;
        struct mmc_data data;
+       int timeout = 1000;
 
        if (blkcnt > 1)
                cmd.cmdidx = MMC_CMD_READ_MULTIPLE_BLOCK;
@@ -189,6 +290,9 @@ int mmc_read_blocks(struct mmc *mmc, void *dst, ulong start, lbaint_t blkcnt)
                        printf("mmc fail to send stop cmd\n");
                        return 0;
                }
+
+               /* Waiting for the ready status */
+               mmc_send_status(mmc, timeout);
        }
 
        return blkcnt;
@@ -215,11 +319,7 @@ static ulong mmc_bread(int dev_num, ulong start, lbaint_t blkcnt, void *dst)
                return 0;
 
        do {
-               /*
-                * The 65535 constraint comes from some hardware has
-                * only 16 bit width block number counter
-                */
-               cur = (blocks_todo > 65535) ? 65535 : blocks_todo;
+               cur = (blocks_todo > mmc->b_max) ?  mmc->b_max : blocks_todo;
                if(mmc_read_blocks(mmc, dst, start, cur) != cur)
                        return 0;
                blocks_todo -= cur;
@@ -280,7 +380,8 @@ sd_send_op_cond(struct mmc *mmc)
                 * how to manage low voltages SD card is not yet
                 * specified.
                 */
-               cmd.cmdarg = mmc->voltages & 0xff8000;
+               cmd.cmdarg = mmc_host_is_spi(mmc) ? 0 :
+                       (mmc->voltages & 0xff8000);
 
                if (mmc->version == SD_VERSION_2)
                        cmd.cmdarg |= OCR_HCS;
@@ -299,6 +400,18 @@ sd_send_op_cond(struct mmc *mmc)
        if (mmc->version != SD_VERSION_2)
                mmc->version = SD_VERSION_1_0;
 
+       if (mmc_host_is_spi(mmc)) { /* read OCR for spi */
+               cmd.cmdidx = MMC_CMD_SPI_READ_OCR;
+               cmd.resp_type = MMC_RSP_R3;
+               cmd.cmdarg = 0;
+               cmd.flags = 0;
+
+               err = mmc_send_cmd(mmc, &cmd, NULL);
+
+               if (err)
+                       return err;
+       }
+
        mmc->ocr = cmd.response[0];
 
        mmc->high_capacity = ((mmc->ocr & OCR_HCS) == OCR_HCS);
@@ -309,17 +422,33 @@ sd_send_op_cond(struct mmc *mmc)
 
 int mmc_send_op_cond(struct mmc *mmc)
 {
-       int timeout = 1000;
+       int timeout = 10000;
        struct mmc_cmd cmd;
        int err;
 
        /* Some cards seem to need this */
        mmc_go_idle(mmc);
 
+       /* Asking to the card its capabilities */
+       cmd.cmdidx = MMC_CMD_SEND_OP_COND;
+       cmd.resp_type = MMC_RSP_R3;
+       cmd.cmdarg = 0;
+       cmd.flags = 0;
+       err = mmc_send_cmd(mmc, &cmd, NULL);
+       if (err)
+               return err;
+       udelay(1000);
        do {
                cmd.cmdidx = MMC_CMD_SEND_OP_COND;
                cmd.resp_type = MMC_RSP_R3;
-               cmd.cmdarg = OCR_HCS | mmc->voltages;
+               cmd.cmdarg = (mmc_host_is_spi(mmc) ? 0 :
+                               (mmc->voltages &
+                               (cmd.response[0] & OCR_VOLTAGE_MASK)) |
+                               (cmd.response[0] & OCR_ACCESS_MODE));
                cmd.flags = 0;
 
                err = mmc_send_cmd(mmc, &cmd, NULL);
@@ -333,6 +462,18 @@ int mmc_send_op_cond(struct mmc *mmc)
        if (timeout <= 0)
                return UNUSABLE_ERR;
 
+       if (mmc_host_is_spi(mmc)) { /* read OCR for spi */
+               cmd.cmdidx = MMC_CMD_SPI_READ_OCR;
+               cmd.resp_type = MMC_RSP_R3;
+               cmd.cmdarg = 0;
+               cmd.flags = 0;
+
+               err = mmc_send_cmd(mmc, &cmd, NULL);
+
+               if (err)
+                       return err;
+       }
+
        mmc->version = MMC_VERSION_UNKNOWN;
        mmc->ocr = cmd.response[0];
 
@@ -369,15 +510,23 @@ int mmc_send_ext_csd(struct mmc *mmc, char *ext_csd)
 int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value)
 {
        struct mmc_cmd cmd;
+       int timeout = 1000;
+       int ret;
 
        cmd.cmdidx = MMC_CMD_SWITCH;
        cmd.resp_type = MMC_RSP_R1b;
        cmd.cmdarg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) |
-               (index << 16) |
-               (value << 8);
+                                (index << 16) |
+                                (value << 8);
        cmd.flags = 0;
 
-       return mmc_send_cmd(mmc, &cmd, NULL);
+       ret = mmc_send_cmd(mmc, &cmd, NULL);
+
+       /* Waiting for the ready status */
+       mmc_send_status(mmc, timeout);
+
+       return ret;
+
 }
 
 int mmc_change_freq(struct mmc *mmc)
@@ -388,6 +537,9 @@ int mmc_change_freq(struct mmc *mmc)
 
        mmc->card_caps = 0;
 
+       if (mmc_host_is_spi(mmc))
+               return 0;
+
        /* Only version 4 supports high-speed */
        if (mmc->version < MMC_VERSION_4)
                return 0;
@@ -399,9 +551,6 @@ int mmc_change_freq(struct mmc *mmc)
        if (err)
                return err;
 
-       if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215])
-               mmc->high_capacity = 1;
-
        cardtype = ext_csd[196] & 0xf;
 
        err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1);
@@ -461,6 +610,9 @@ int sd_change_freq(struct mmc *mmc)
 
        mmc->card_caps = 0;
 
+       if (mmc_host_is_spi(mmc))
+               return 0;
+
        /* Read the SCR to find out if this card supports higher speeds */
        cmd.cmdidx = MMC_CMD_APP_CMD;
        cmd.resp_type = MMC_RSP_R1;
@@ -512,6 +664,9 @@ retry_scr:
                        break;
        }
 
+       if (mmc->scr[0] & SD_DATA_4BIT)
+               mmc->card_caps |= MMC_MODE_4BIT;
+
        /* Version 1.0 doesn't support switching */
        if (mmc->version == SD_VERSION_1_0)
                return 0;
@@ -529,9 +684,6 @@ retry_scr:
                        break;
        }
 
-       if (mmc->scr[0] & SD_DATA_4BIT)
-               mmc->card_caps |= MMC_MODE_4BIT;
-
        /* If high-speed isn't supported, we return */
        if (!(__be32_to_cpu(switch_status[3]) & SD_HIGHSPEED_SUPPORTED))
                return 0;
@@ -549,7 +701,7 @@ retry_scr:
 
 /* frequency bases */
 /* divided by 10 to be nice to platforms without floating point */
-int fbase[] = {
+static const int fbase[] = {
        10000,
        100000,
        1000000,
@@ -559,7 +711,7 @@ int fbase[] = {
 /* Multiplier values for TRAN_SPEED.  Multiplied by 10 to be nice
  * to platforms without floating point.
  */
-int multipliers[] = {
+static const int multipliers[] = {
        0,      /* reserved */
        10,
        12,
@@ -610,9 +762,24 @@ int mmc_startup(struct mmc *mmc)
        u64 cmult, csize;
        struct mmc_cmd cmd;
        char ext_csd[512];
+       int timeout = 1000;
+
+#ifdef CONFIG_MMC_SPI_CRC_ON
+       if (mmc_host_is_spi(mmc)) { /* enable CRC check for spi */
+               cmd.cmdidx = MMC_CMD_SPI_CRC_ON_OFF;
+               cmd.resp_type = MMC_RSP_R1;
+               cmd.cmdarg = 1;
+               cmd.flags = 0;
+               err = mmc_send_cmd(mmc, &cmd, NULL);
+
+               if (err)
+                       return err;
+       }
+#endif
 
        /* Put the Card in Identify Mode */
-       cmd.cmdidx = MMC_CMD_ALL_SEND_CID;
+       cmd.cmdidx = mmc_host_is_spi(mmc) ? MMC_CMD_SEND_CID :
+               MMC_CMD_ALL_SEND_CID; /* cmd not supported in spi */
        cmd.resp_type = MMC_RSP_R2;
        cmd.cmdarg = 0;
        cmd.flags = 0;
@@ -629,18 +796,20 @@ int mmc_startup(struct mmc *mmc)
         * For SD cards, get the Relatvie Address.
         * This also puts the cards into Standby State
         */
-       cmd.cmdidx = SD_CMD_SEND_RELATIVE_ADDR;
-       cmd.cmdarg = mmc->rca << 16;
-       cmd.resp_type = MMC_RSP_R6;
-       cmd.flags = 0;
+       if (!mmc_host_is_spi(mmc)) { /* cmd not supported in spi */
+               cmd.cmdidx = SD_CMD_SEND_RELATIVE_ADDR;
+               cmd.cmdarg = mmc->rca << 16;
+               cmd.resp_type = MMC_RSP_R6;
+               cmd.flags = 0;
 
-       err = mmc_send_cmd(mmc, &cmd, NULL);
+               err = mmc_send_cmd(mmc, &cmd, NULL);
 
-       if (err)
-               return err;
+               if (err)
+                       return err;
 
-       if (IS_SD(mmc))
-               mmc->rca = (cmd.response[0] >> 16) & 0xffff;
+               if (IS_SD(mmc))
+                       mmc->rca = (cmd.response[0] >> 16) & 0xffff;
+       }
 
        /* Get the Card-Specific Data */
        cmd.cmdidx = MMC_CMD_SEND_CSD;
@@ -650,6 +819,9 @@ int mmc_startup(struct mmc *mmc)
 
        err = mmc_send_cmd(mmc, &cmd, NULL);
 
+       /* Waiting for the ready status */
+       mmc_send_status(mmc, timeout);
+
        if (err)
                return err;
 
@@ -716,14 +888,16 @@ int mmc_startup(struct mmc *mmc)
                mmc->write_bl_len = 512;
 
        /* Select the card, and put it into Transfer Mode */
-       cmd.cmdidx = MMC_CMD_SELECT_CARD;
-       cmd.resp_type = MMC_RSP_R1b;
-       cmd.cmdarg = mmc->rca << 16;
-       cmd.flags = 0;
-       err = mmc_send_cmd(mmc, &cmd, NULL);
+       if (!mmc_host_is_spi(mmc)) { /* cmd not supported in spi */
+               cmd.cmdidx = MMC_CMD_SELECT_CARD;
+               cmd.resp_type = MMC_RSP_R1b;
+               cmd.cmdarg = mmc->rca << 16;
+               cmd.flags = 0;
+               err = mmc_send_cmd(mmc, &cmd, NULL);
 
-       if (err)
-               return err;
+               if (err)
+                       return err;
+       }
 
        if (!IS_SD(mmc) && (mmc->version >= MMC_VERSION_4)) {
                /* check  ext_csd version and capacity */
@@ -853,6 +1027,8 @@ int mmc_register(struct mmc *mmc)
        mmc->block_dev.removable = 1;
        mmc->block_dev.block_read = mmc_bread;
        mmc->block_dev.block_write = mmc_bwrite;
+       if (!mmc->b_max)
+               mmc->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
 
        INIT_LIST_HEAD (&mmc->link);
 
diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
new file mode 100644 (file)
index 0000000..dc7574c
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * generic mmc spi driver
+ *
+ * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
+ * Licensed under the GPL-2 or later.
+ */
+#include <common.h>
+#include <malloc.h>
+#include <part.h>
+#include <mmc.h>
+#include <spi.h>
+#include <crc.h>
+#include <linux/crc7.h>
+#include <linux/byteorder/swab.h>
+
+/* MMC/SD in SPI mode reports R1 status always */
+#define R1_SPI_IDLE            (1 << 0)
+#define R1_SPI_ERASE_RESET     (1 << 1)
+#define R1_SPI_ILLEGAL_COMMAND (1 << 2)
+#define R1_SPI_COM_CRC         (1 << 3)
+#define R1_SPI_ERASE_SEQ       (1 << 4)
+#define R1_SPI_ADDRESS         (1 << 5)
+#define R1_SPI_PARAMETER       (1 << 6)
+/* R1 bit 7 is always zero, reuse this bit for error */
+#define R1_SPI_ERROR           (1 << 7)
+
+/* Response tokens used to ack each block written: */
+#define SPI_MMC_RESPONSE_CODE(x)       ((x) & 0x1f)
+#define SPI_RESPONSE_ACCEPTED          ((2 << 1)|1)
+#define SPI_RESPONSE_CRC_ERR           ((5 << 1)|1)
+#define SPI_RESPONSE_WRITE_ERR         ((6 << 1)|1)
+
+/* Read and write blocks start with these tokens and end with crc;
+ * on error, read tokens act like a subset of R2_SPI_* values.
+ */
+#define SPI_TOKEN_SINGLE       0xfe    /* single block r/w, multiblock read */
+#define SPI_TOKEN_MULTI_WRITE  0xfc    /* multiblock write */
+#define SPI_TOKEN_STOP_TRAN    0xfd    /* terminate multiblock write */
+
+/* MMC SPI commands start with a start bit "0" and a transmit bit "1" */
+#define MMC_SPI_CMD(x) (0x40 | (x & 0x3f))
+
+/* bus capability */
+#define MMC_SPI_VOLTAGE (MMC_VDD_32_33 | MMC_VDD_33_34)
+#define MMC_SPI_MIN_CLOCK 400000 /* 400KHz to meet MMC spec */
+
+/* timeout value */
+#define CTOUT 8
+#define RTOUT 3000000 /* 1 sec */
+#define WTOUT 3000000 /* 1 sec */
+
+static uint mmc_spi_sendcmd(struct mmc *mmc, ushort cmdidx, u32 cmdarg)
+{
+       struct spi_slave *spi = mmc->priv;
+       u8 cmdo[7];
+       u8 r1;
+       int i;
+       cmdo[0] = 0xff;
+       cmdo[1] = MMC_SPI_CMD(cmdidx);
+       cmdo[2] = cmdarg >> 24;
+       cmdo[3] = cmdarg >> 16;
+       cmdo[4] = cmdarg >> 8;
+       cmdo[5] = cmdarg;
+       cmdo[6] = (crc7(0, &cmdo[1], 5) << 1) | 0x01;
+       spi_xfer(spi, sizeof(cmdo) * 8, cmdo, NULL, 0);
+       for (i = 0; i < CTOUT; i++) {
+               spi_xfer(spi, 1 * 8, NULL, &r1, 0);
+               if (i && (r1 & 0x80) == 0) /* r1 response */
+                       break;
+       }
+       debug("%s:cmd%d resp%d %x\n", __func__, cmdidx, i, r1);
+       return r1;
+}
+
+static uint mmc_spi_readdata(struct mmc *mmc, void *xbuf,
+                               u32 bcnt, u32 bsize)
+{
+       struct spi_slave *spi = mmc->priv;
+       u8 *buf = xbuf;
+       u8 r1;
+       u16 crc;
+       int i;
+       while (bcnt--) {
+               for (i = 0; i < RTOUT; i++) {
+                       spi_xfer(spi, 1 * 8, NULL, &r1, 0);
+                       if (r1 != 0xff) /* data token */
+                               break;
+               }
+               debug("%s:tok%d %x\n", __func__, i, r1);
+               if (r1 == SPI_TOKEN_SINGLE) {
+                       spi_xfer(spi, bsize * 8, NULL, buf, 0);
+                       spi_xfer(spi, 2 * 8, NULL, &crc, 0);
+#ifdef CONFIG_MMC_SPI_CRC_ON
+                       if (swab16(cyg_crc16(buf, bsize)) != crc) {
+                               debug("%s: CRC error\n", mmc->name);
+                               r1 = R1_SPI_COM_CRC;
+                               break;
+                       }
+#endif
+                       r1 = 0;
+               } else {
+                       r1 = R1_SPI_ERROR;
+                       break;
+               }
+               buf += bsize;
+       }
+       return r1;
+}
+
+static uint mmc_spi_writedata(struct mmc *mmc, const void *xbuf,
+                             u32 bcnt, u32 bsize, int multi)
+{
+       struct spi_slave *spi = mmc->priv;
+       const u8 *buf = xbuf;
+       u8 r1;
+       u16 crc;
+       u8 tok[2];
+       int i;
+       tok[0] = 0xff;
+       tok[1] = multi ? SPI_TOKEN_MULTI_WRITE : SPI_TOKEN_SINGLE;
+       while (bcnt--) {
+#ifdef CONFIG_MMC_SPI_CRC_ON
+               crc = swab16(cyg_crc16((u8 *)buf, bsize));
+#endif
+               spi_xfer(spi, 2 * 8, tok, NULL, 0);
+               spi_xfer(spi, bsize * 8, buf, NULL, 0);
+               spi_xfer(spi, 2 * 8, &crc, NULL, 0);
+               for (i = 0; i < CTOUT; i++) {
+                       spi_xfer(spi, 1 * 8, NULL, &r1, 0);
+                       if ((r1 & 0x10) == 0) /* response token */
+                               break;
+               }
+               debug("%s:tok%d %x\n", __func__, i, r1);
+               if (SPI_MMC_RESPONSE_CODE(r1) == SPI_RESPONSE_ACCEPTED) {
+                       for (i = 0; i < WTOUT; i++) { /* wait busy */
+                               spi_xfer(spi, 1 * 8, NULL, &r1, 0);
+                               if (i && r1 == 0xff) {
+                                       r1 = 0;
+                                       break;
+                               }
+                       }
+                       if (i == WTOUT) {
+                               debug("%s:wtout %x\n", __func__, r1);
+                               r1 = R1_SPI_ERROR;
+                               break;
+                       }
+               } else {
+                       debug("%s: err %x\n", __func__, r1);
+                       r1 = R1_SPI_COM_CRC;
+                       break;
+               }
+               buf += bsize;
+       }
+       if (multi && bcnt == -1) { /* stop multi write */
+               tok[1] = SPI_TOKEN_STOP_TRAN;
+               spi_xfer(spi, 2 * 8, tok, NULL, 0);
+               for (i = 0; i < WTOUT; i++) { /* wait busy */
+                       spi_xfer(spi, 1 * 8, NULL, &r1, 0);
+                       if (i && r1 == 0xff) {
+                               r1 = 0;
+                               break;
+                       }
+               }
+               if (i == WTOUT) {
+                       debug("%s:wstop %x\n", __func__, r1);
+                       r1 = R1_SPI_ERROR;
+               }
+       }
+       return r1;
+}
+
+static int mmc_spi_request(struct mmc *mmc, struct mmc_cmd *cmd,
+               struct mmc_data *data)
+{
+       struct spi_slave *spi = mmc->priv;
+       u8 r1;
+       int i;
+       int ret = 0;
+       debug("%s:cmd%d %x %x %x\n", __func__,
+             cmd->cmdidx, cmd->resp_type, cmd->cmdarg, cmd->flags);
+       spi_claim_bus(spi);
+       spi_cs_activate(spi);
+       r1 = mmc_spi_sendcmd(mmc, cmd->cmdidx, cmd->cmdarg);
+       if (r1 == 0xff) { /* no response */
+               ret = NO_CARD_ERR;
+               goto done;
+       } else if (r1 & R1_SPI_COM_CRC) {
+               ret = COMM_ERR;
+               goto done;
+       } else if (r1 & ~R1_SPI_IDLE) { /* other errors */
+               ret = TIMEOUT;
+               goto done;
+       } else if (cmd->resp_type == MMC_RSP_R2) {
+               r1 = mmc_spi_readdata(mmc, cmd->response, 1, 16);
+               for (i = 0; i < 4; i++)
+                       cmd->response[i] = swab32(cmd->response[i]);
+               debug("r128 %x %x %x %x\n", cmd->response[0], cmd->response[1],
+                     cmd->response[2], cmd->response[3]);
+       } else if (!data) {
+               switch (cmd->cmdidx) {
+               case SD_CMD_APP_SEND_OP_COND:
+               case MMC_CMD_SEND_OP_COND:
+                       cmd->response[0] = (r1 & R1_SPI_IDLE) ? 0 : OCR_BUSY;
+                       break;
+               case SD_CMD_SEND_IF_COND:
+               case MMC_CMD_SPI_READ_OCR:
+                       spi_xfer(spi, 4 * 8, NULL, cmd->response, 0);
+                       cmd->response[0] = swab32(cmd->response[0]);
+                       debug("r32 %x\n", cmd->response[0]);
+                       break;
+               }
+       } else {
+               debug("%s:data %x %x %x\n", __func__,
+                     data->flags, data->blocks, data->blocksize);
+               if (data->flags == MMC_DATA_READ)
+                       r1 = mmc_spi_readdata(mmc, data->dest,
+                               data->blocks, data->blocksize);
+               else if  (data->flags == MMC_DATA_WRITE)
+                       r1 = mmc_spi_writedata(mmc, data->src,
+                               data->blocks, data->blocksize,
+                               (cmd->cmdidx == MMC_CMD_WRITE_MULTIPLE_BLOCK));
+               if (r1 & R1_SPI_COM_CRC)
+                       ret = COMM_ERR;
+               else if (r1) /* other errors */
+                       ret = TIMEOUT;
+       }
+done:
+       spi_cs_deactivate(spi);
+       spi_release_bus(spi);
+       return ret;
+}
+
+static void mmc_spi_set_ios(struct mmc *mmc)
+{
+       struct spi_slave *spi = mmc->priv;
+       debug("%s: clock %u\n", __func__, mmc->clock);
+       if (mmc->clock)
+               spi_set_speed(spi, mmc->clock);
+}
+
+static int mmc_spi_init_p(struct mmc *mmc)
+{
+       struct spi_slave *spi = mmc->priv;
+       mmc->clock = 0;
+       spi_set_speed(spi, MMC_SPI_MIN_CLOCK);
+       spi_claim_bus(spi);
+       /* cs deactivated for 100+ clock */
+       spi_xfer(spi, 18 * 8, NULL, NULL, 0);
+       spi_release_bus(spi);
+       return 0;
+}
+
+struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode)
+{
+       struct mmc *mmc;
+
+       mmc = malloc(sizeof(*mmc));
+       if (!mmc)
+               return NULL;
+       memset(mmc, 0, sizeof(*mmc));
+       mmc->priv = spi_setup_slave(bus, cs, speed, mode);
+       if (!mmc->priv) {
+               free(mmc);
+               return NULL;
+       }
+       sprintf(mmc->name, "MMC_SPI");
+       mmc->send_cmd = mmc_spi_request;
+       mmc->set_ios = mmc_spi_set_ios;
+       mmc->init = mmc_spi_init_p;
+       mmc->host_caps = MMC_MODE_SPI;
+
+       mmc->voltages = MMC_SPI_VOLTAGE;
+       mmc->f_max = speed;
+       mmc->f_min = MMC_SPI_MIN_CLOCK;
+       mmc->block_dev.part_type = PART_TYPE_DOS;
+
+       mmc_register(mmc);
+
+       return mmc;
+}
index 59639539f304c43409650de56e3689fc246e191c..ab1fc82fbb68dd3f0d6f90f55b3be916fd8eac56 100644 (file)
@@ -511,6 +511,8 @@ static int mxcmci_initialize(bd_t *bis)
        mmc->f_min = imx_get_perclk2() >> 7;
        mmc->f_max = imx_get_perclk2() >> 1;
 
+       mmc->b_max = 0;
+
        mmc_register(mmc);
 
        return 0;
index 6f2280abff91af577644e0249a175702d477524e..957b9877a01adaa59a7aef6364bec3d8f82672bc 100644 (file)
@@ -465,6 +465,16 @@ int omap_mmc_init(int dev_index)
        mmc->f_min = 400000;
        mmc->f_max = 52000000;
 
+       mmc->b_max = 0;
+
+#if defined(CONFIG_OMAP34XX)
+       /*
+        * Silicon revs 2.1 and older do not support multiblock transfers.
+        */
+       if ((get_cpu_family() == CPU_OMAP34XX) && (get_cpu_rev() <= CPU_3XX_ES21))
+               mmc->b_max = 1;
+#endif
+
        mmc_register(mmc);
 
        return 0;
index 0323800711ba16104c9b1a092b4e88b5ba70ece6..668c28bded9c0b505235f0828a3c2b8d3ee26de3 100644 (file)
@@ -466,6 +466,7 @@ static int s5p_mmc_initialize(int dev_index, int bus_width)
 
        mmc_host[dev_index].clock = 0;
        mmc_host[dev_index].reg = s5p_get_base_mmc(dev_index);
+       mmc->m_bmax = 0;
        mmc_register(mmc);
 
        return 0;
index 999431c3c0df590c7b4dfa6318bdd6b49ffffe88..5a5ecdfe3c691cb5c9d5248cc7608c136cb540d3 100644 (file)
@@ -32,6 +32,7 @@ COBJS-$(CONFIG_HAS_DATAFLASH) += at45.o
 COBJS-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o
 COBJS-$(CONFIG_FLASH_CFI_MTD) += cfi_mtd.o
 COBJS-$(CONFIG_HAS_DATAFLASH) += dataflash.o
+COBJS-$(CONFIG_FTSMC020) += ftsmc020.o
 COBJS-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
 COBJS-$(CONFIG_MW_EEPROM) += mw_eeprom.o
 COBJS-$(CONFIG_SPEARSMI) += spr_smi.o
index 0909fe715ac4a1962d742ce704f0506d3d969e20..6039e1fadc0aa0003a9e34ab80284c46c0d180e3 100644 (file)
@@ -581,6 +581,7 @@ static int flash_status_check (flash_info_t * info, flash_sect_t sector,
                                prompt, info->start[sector],
                                flash_read_long (info, sector, 0));
                        flash_write_cmd (info, sector, 0, info->cmd_reset);
+                       udelay(1);
                        return ERR_TIMOUT;
                }
                udelay (1);             /* also triggers watchdog */
@@ -628,6 +629,7 @@ static int flash_full_status_check (flash_info_t * info, flash_sect_t sector,
                                puts ("Vpp Low Error.\n");
                }
                flash_write_cmd (info, sector, 0, info->cmd_reset);
+               udelay(1);
                break;
        default:
                break;
@@ -1202,8 +1204,9 @@ void flash_print_info (flash_info_t * info)
                info->manufacturer_id);
        printf (info->chipwidth == FLASH_CFI_16BIT ? "%04X" : "%02X",
                info->device_id);
-       if (info->device_id == 0x7E) {
-               printf("%04X", info->device_id2);
+       if ((info->device_id & 0xff) == 0x7E) {
+               printf(info->chipwidth == FLASH_CFI_16BIT ? "%04X" : "%02X",
+               info->device_id2);
        }
        printf ("\n  Erase timeout: %ld ms, write timeout: %ld ms\n",
                info->erase_blk_tout,
@@ -1490,6 +1493,7 @@ void flash_read_user_serial (flash_info_t * info, void *buffer, int offset,
        flash_write_cmd (info, 0, 0, FLASH_CMD_READ_ID);
        memcpy (dst, src + offset, len);
        flash_write_cmd (info, 0, 0, info->cmd_reset);
+       udelay(1);
        flash_unmap(info, 0, FLASH_OFFSET_USER_PROTECTION, src);
 }
 
@@ -1505,6 +1509,7 @@ void flash_read_factory_serial (flash_info_t * info, void *buffer, int offset,
        flash_write_cmd (info, 0, 0, FLASH_CMD_READ_ID);
        memcpy (buffer, src + offset, len);
        flash_write_cmd (info, 0, 0, info->cmd_reset);
+       udelay(1);
        flash_unmap(info, 0, FLASH_OFFSET_INTEL_PROTECTION, src);
 }
 
@@ -1536,6 +1541,7 @@ static void cfi_reverse_geometry(struct cfi_qry *qry)
 static void cmdset_intel_read_jedec_ids(flash_info_t *info)
 {
        flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
+       udelay(1);
        flash_write_cmd(info, 0, 0, FLASH_CMD_READ_ID);
        udelay(1000); /* some flash are slow to respond */
        info->manufacturer_id = flash_read_uchar (info,
@@ -1599,11 +1605,20 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
        case FLASH_CFI_16BIT:
                info->device_id = flash_read_word (info,
                                                FLASH_OFFSET_DEVICE_ID);
+               if ((info->device_id & 0xff) == 0x7E) {
+                       /* AMD 3-byte (expanded) device ids */
+                       info->device_id2 = flash_read_uchar (info,
+                                               FLASH_OFFSET_DEVICE_ID2);
+                       info->device_id2 <<= 8;
+                       info->device_id2 |= flash_read_uchar (info,
+                                               FLASH_OFFSET_DEVICE_ID3);
+               }
                break;
        default:
                break;
        }
        flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
+       udelay(1);
 }
 
 static int cmdset_amd_init(flash_info_t *info, struct cfi_qry *qry)
@@ -1730,6 +1745,7 @@ void __flash_cmd_reset(flash_info_t *info)
         * that AMD flash roms ignore the Intel command.
         */
        flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
+       udelay(1);
        flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
 }
 void flash_cmd_reset(flash_info_t *info)
@@ -1852,9 +1868,10 @@ static void flash_fixup_stm(flash_info_t *info, struct cfi_qry *qry)
        if (qry->num_erase_regions > 1) {
                /* reverse geometry if top boot part */
                if (info->cfi_version < 0x3131) {
-                       /* CFI < 1.1, guess by device id (M29W320{DT,ET} only) */
-                       if (info->device_id == 0x22CA ||
-                           info->device_id == 0x2256) {
+                       /* CFI < 1.1, guess by device id */
+                       if (info->device_id == 0x22CA || /* M29W320DT */
+                           info->device_id == 0x2256 || /* M29W320ET */
+                           info->device_id == 0x22D7) { /* M29W800DT */
                                cfi_reverse_geometry(qry);
                        }
                }
@@ -1929,7 +1946,8 @@ ulong flash_get_size (phys_addr_t base, int banknum)
 
                /* Do manufacturer-specific fixups */
                switch (info->manufacturer_id) {
-               case 0x0001:
+               case 0x0001: /* AMD */
+               case 0x0037: /* AMIC */
                        flash_fixup_amd(info, &qry);
                        break;
                case 0x001f:
@@ -2085,17 +2103,59 @@ static void cfi_flash_set_config_reg(u32 base, u16 val)
 
 /*-----------------------------------------------------------------------
  */
-unsigned long flash_init (void)
+
+void flash_protect_default(void)
 {
-       unsigned long size = 0;
-       int i;
 #if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
+       int i;
        struct apl_s {
                ulong start;
                ulong size;
        } apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST;
 #endif
 
+       /* Monitor protection ON by default */
+#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
+       (!defined(CONFIG_MONITOR_IS_IN_RAM))
+       flash_protect(FLAG_PROTECT_SET,
+                      CONFIG_SYS_MONITOR_BASE,
+                      CONFIG_SYS_MONITOR_BASE + monitor_flash_len  - 1,
+                      flash_get_info(CONFIG_SYS_MONITOR_BASE));
+#endif
+
+       /* Environment protection ON by default */
+#ifdef CONFIG_ENV_IS_IN_FLASH
+       flash_protect(FLAG_PROTECT_SET,
+                      CONFIG_ENV_ADDR,
+                      CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1,
+                      flash_get_info(CONFIG_ENV_ADDR));
+#endif
+
+       /* Redundant environment protection ON by default */
+#ifdef CONFIG_ENV_ADDR_REDUND
+       flash_protect(FLAG_PROTECT_SET,
+                      CONFIG_ENV_ADDR_REDUND,
+                      CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1,
+                      flash_get_info(CONFIG_ENV_ADDR_REDUND));
+#endif
+
+#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
+       for (i = 0; i < (sizeof(apl) / sizeof(struct apl_s)); i++) {
+               debug("autoprotecting from %08x to %08x\n",
+                     apl[i].start, apl[i].start + apl[i].size - 1);
+               flash_protect(FLAG_PROTECT_SET,
+                              apl[i].start,
+                              apl[i].start + apl[i].size - 1,
+                              flash_get_info(apl[i].start));
+       }
+#endif
+}
+
+unsigned long flash_init (void)
+{
+       unsigned long size = 0;
+       int i;
+
 #ifdef CONFIG_SYS_FLASH_PROTECTION
        /* read environment from EEPROM */
        char s[64];
@@ -2171,42 +2231,7 @@ unsigned long flash_init (void)
 #endif /* CONFIG_SYS_FLASH_PROTECTION */
        }
 
-       /* Monitor protection ON by default */
-#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
-       (!defined(CONFIG_MONITOR_IS_IN_RAM))
-       flash_protect (FLAG_PROTECT_SET,
-                      CONFIG_SYS_MONITOR_BASE,
-                      CONFIG_SYS_MONITOR_BASE + monitor_flash_len  - 1,
-                      flash_get_info(CONFIG_SYS_MONITOR_BASE));
-#endif
-
-       /* Environment protection ON by default */
-#ifdef CONFIG_ENV_IS_IN_FLASH
-       flash_protect (FLAG_PROTECT_SET,
-                      CONFIG_ENV_ADDR,
-                      CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1,
-                      flash_get_info(CONFIG_ENV_ADDR));
-#endif
-
-       /* Redundant environment protection ON by default */
-#ifdef CONFIG_ENV_ADDR_REDUND
-       flash_protect (FLAG_PROTECT_SET,
-                      CONFIG_ENV_ADDR_REDUND,
-                      CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1,
-                      flash_get_info(CONFIG_ENV_ADDR_REDUND));
-#endif
-
-#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
-       for (i = 0; i < (sizeof(apl) / sizeof(struct apl_s)); i++) {
-               debug("autoprotecting from %08x to %08x\n",
-                     apl[i].start, apl[i].start + apl[i].size - 1);
-               flash_protect (FLAG_PROTECT_SET,
-                              apl[i].start,
-                              apl[i].start + apl[i].size - 1,
-                              flash_get_info(apl[i].start));
-       }
-#endif
-
+       flash_protect_default();
 #ifdef CONFIG_FLASH_CFI_MTD
        cfi_mtd_init();
 #endif
similarity index 97%
rename from arch/arm/cpu/arm920t/a320/ftsmc020.c
rename to drivers/mtd/ftsmc020.c
index 76465373ec1a8e044cd118dabb03d55a827482f0..b027685b11dcce3bc39867973be88dbd544efede 100644 (file)
@@ -20,7 +20,7 @@
 #include <config.h>
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/ftsmc020.h>
+#include <faraday/ftsmc020.h>
 
 struct ftsmc020_config {
        unsigned int    config;
index fa286a8d8101dee5d50f57637172459c27984169..52f8575aac67f0e1933dabb4c0ce4e304ef26618 100644 (file)
@@ -2461,20 +2461,24 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd,
 
        /* check version */
        val = le16_to_cpu(p->revision);
-       if (val == 1 || val > (1 << 4)) {
-               printk(KERN_INFO "%s: unsupported ONFI "
-                                       "version: %d\n", __func__, val);
-               return 0;
-       }
-
-       if (val & (1 << 4))
+       if (val & (1 << 5))
+               chip->onfi_version = 23;
+       else if (val & (1 << 4))
                chip->onfi_version = 22;
        else if (val & (1 << 3))
                chip->onfi_version = 21;
        else if (val & (1 << 2))
                chip->onfi_version = 20;
-       else
+       else if (val & (1 << 1))
                chip->onfi_version = 10;
+       else
+               chip->onfi_version = 0;
+
+       if (!chip->onfi_version) {
+               printk(KERN_INFO "%s: unsupported ONFI "
+                                       "version: %d\n", __func__, val);
+               return 0;
+       }
 
        if (!mtd->name)
                mtd->name = p->model;
@@ -2482,7 +2486,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd,
        mtd->writesize = le32_to_cpu(p->byte_per_page);
        mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
        mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
-       chip->chipsize = le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
+       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
        *busw = 0;
        if (le16_to_cpu(p->features) & 1)
                *busw = NAND_BUSWIDTH_16;
index 8d0216956d7847b0063d9acdd698f6e6ef52178e..1ecece0d7808269f55f1f702f39fb1e45d070566 100644 (file)
@@ -170,20 +170,6 @@ static void at45_build_address(struct atmel_spi_flash *asf, u8 *cmd, u32 offset)
        cmd[2] = byte_addr;
 }
 
-static int dataflash_read_fast_p2(struct spi_flash *flash,
-               u32 offset, size_t len, void *buf)
-{
-       u8 cmd[5];
-
-       cmd[0] = CMD_READ_ARRAY_FAST;
-       cmd[1] = offset >> 16;
-       cmd[2] = offset >> 8;
-       cmd[3] = offset;
-       cmd[4] = 0x00;
-
-       return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
-}
-
 static int dataflash_read_fast_at45(struct spi_flash *flash,
                u32 offset, size_t len, void *buf)
 {
@@ -342,7 +328,7 @@ out:
 /*
  * TODO: the two erase funcs (_p2/_at45) should get unified ...
  */
-int dataflash_erase_p2(struct spi_flash *flash, u32 offset, size_t len)
+static int dataflash_erase_p2(struct spi_flash *flash, u32 offset, size_t len)
 {
        struct atmel_spi_flash *asf = to_atmel_spi_flash(flash);
        unsigned long page_size;
@@ -401,7 +387,7 @@ out:
        return ret;
 }
 
-int dataflash_erase_at45(struct spi_flash *flash, u32 offset, size_t len)
+static int dataflash_erase_at45(struct spi_flash *flash, u32 offset, size_t len)
 {
        struct atmel_spi_flash *asf = to_atmel_spi_flash(flash);
        unsigned long page_addr;
@@ -519,7 +505,7 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
                        asf->flash.erase = dataflash_erase_at45;
                        page_size += 1 << (params->l2_page_size - 5);
                } else {
-                       asf->flash.read = dataflash_read_fast_p2;
+                       asf->flash.read = spi_flash_cmd_read_fast;
                        asf->flash.write = dataflash_write_p2;
                        asf->flash.erase = dataflash_erase_p2;
                }
@@ -528,7 +514,7 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
 
        case DF_FAMILY_AT26F:
        case DF_FAMILY_AT26DF:
-               asf->flash.read = dataflash_read_fast_p2;
+               asf->flash.read = spi_flash_cmd_read_fast;
                break;
 
        default:
@@ -536,14 +522,11 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
                goto err;
        }
 
+       asf->flash.sector_size = page_size;
        asf->flash.size = page_size * params->pages_per_block
                                * params->blocks_per_sector
                                * params->nr_sectors;
 
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, page_size);
-       print_size(asf->flash.size, "\n");
-
        return &asf->flash;
 
 err:
index 02c3bb93047850ba2269bcf3f5d7d048cc4942db..e3de3aabbdff9d52868b4cc3796332cbecb6d388 100644 (file)
@@ -25,8 +25,6 @@
 
 #define EON_ID_EN25Q128                0x18
 
-#define EON_SR_WIP             (1 << 0)        /* Write-in-Progress */
-
 struct eon_spi_flash_params {
        u8 idcode1;
        u16 page_size;
@@ -58,60 +56,6 @@ static const struct eon_spi_flash_params eon_spi_flash_table[] = {
        },
 };
 
-static int eon_wait_ready(struct spi_flash *flash, unsigned long timeout)
-{
-       struct spi_slave *spi = flash->spi;
-       unsigned long timebase;
-       int ret;
-       u8 cmd = CMD_EN25Q128_RDSR;
-       u8 status;
-
-       ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN);
-       if (ret) {
-               debug("SF: Failed to send command %02x: %d\n", cmd, ret);
-               return ret;
-       }
-
-       timebase = get_timer(0);
-       do {
-               ret = spi_xfer(spi, 8, NULL, &status, 0);
-               if (ret)
-                       return -1;
-
-               if ((status & EON_SR_WIP) == 0)
-                       break;
-
-       } while (get_timer(timebase) < timeout);
-
-       spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);
-
-       if ((status & EON_SR_WIP) == 0)
-               return 0;
-
-       /* Timed out */
-       return -1;
-}
-
-static int eon_read_fast(struct spi_flash *flash,
-                        u32 offset, size_t len, void *buf)
-{
-       struct eon_spi_flash *eon = to_eon_spi_flash(flash);
-       unsigned long page_addr;
-       unsigned long page_size;
-       u8 cmd[5];
-
-       page_size = eon->params->page_size;
-       page_addr = offset / page_size;
-
-       cmd[0] = CMD_READ_ARRAY_FAST;
-       cmd[1] = page_addr >> 8;
-       cmd[2] = page_addr;
-       cmd[3] = offset % page_size;
-       cmd[4] = 0x00;
-
-       return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
-}
-
 static int eon_write(struct spi_flash *flash,
                     u32 offset, size_t len, const void *buf)
 {
@@ -160,11 +104,9 @@ static int eon_write(struct spi_flash *flash,
                        break;
                }
 
-               ret = eon_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
-               if (ret < 0) {
-                       debug("SF: EON page programming timed out\n");
+               ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+               if (ret)
                        break;
-               }
 
                page_addr++;
                byte_addr = 0;
@@ -177,62 +119,9 @@ static int eon_write(struct spi_flash *flash,
        return ret;
 }
 
-int eon_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int eon_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       /* block erase */
-       struct eon_spi_flash *eon = to_eon_spi_flash(flash);
-       unsigned long block_size;
-       size_t actual;
-       int ret;
-       u8 cmd[4];
-
-
-       block_size = eon->params->page_size * eon->params->pages_per_sector
-              * eon->params->sectors_per_block;
-
-       if (offset % block_size || len % block_size) {
-               debug("SF: Erase offset/length not multiple of block size\n");
-               return -1;
-       }
-
-       len /= block_size;
-       cmd[0] = CMD_EN25Q128_BE;
-       cmd[2] = 0x00;
-       cmd[3] = 0x00;
-
-       ret = spi_claim_bus(flash->spi);
-       if (ret) {
-               debug("SF: Unable to claim SPI bus\n");
-               return ret;
-       }
-
-       ret = 0;
-       for (actual = 0; actual < len; actual++) {
-               cmd[1] = (offset / block_size) + actual;
-               ret = spi_flash_cmd(flash->spi, CMD_EN25Q128_WREN, NULL, 0);
-               if (ret < 0) {
-                       debug("SF: Enabling Write failed\n");
-                       break;
-               }
-
-               ret = spi_flash_cmd_write(flash->spi, cmd, 4, NULL, 0);
-               if (ret < 0) {
-                       debug("SF: EON page erase failed\n");
-                       break;
-               }
-
-               ret = eon_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
-               if (ret < 0) {
-                       debug("SF: EON page erase timed out\n");
-                       break;
-               }
-       }
-
-       debug("SF: EON: Successfully erased %u bytes @ 0x%x\n",
-             len * block_size, offset);
-
-       spi_release_bus(flash->spi);
-       return ret;
+       return spi_flash_cmd_erase(flash, CMD_EN25Q128_BE, offset, len);
 }
 
 struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode)
@@ -264,12 +153,11 @@ struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode)
 
        eon->flash.write = eon_write;
        eon->flash.erase = eon_erase;
-       eon->flash.read = eon_read_fast;
+       eon->flash.read = spi_flash_cmd_read_fast;
+       eon->flash.sector_size = params->page_size * params->pages_per_sector
+           * params->sectors_per_block;
        eon->flash.size = params->page_size * params->pages_per_sector
            * params->nr_sectors;
 
-       debug("SF: Detected %s with page size %u, total %u bytes\n",
-             params->name, params->page_size, eon->flash.size);
-
        return &eon->flash;
 }
index 76d52841d1ccbb99a3eeb595e465de1a926a3256..ff66f2aa35c03a522d91094b6d047b40ced13976 100644 (file)
@@ -49,8 +49,6 @@
 #define CMD_MX25XX_DP          0xb9    /* Deep Power-down */
 #define CMD_MX25XX_RES         0xab    /* Release from DP, and Read Signature */
 
-#define MACRONIX_SR_WIP                (1 << 0)        /* Write-in-Progress */
-
 struct macronix_spi_flash_params {
        u16 idcode;
        u16 page_size;
@@ -114,60 +112,6 @@ static const struct macronix_spi_flash_params macronix_spi_flash_table[] = {
        },
 };
 
-static int macronix_wait_ready(struct spi_flash *flash, unsigned long timeout)
-{
-       struct spi_slave *spi = flash->spi;
-       unsigned long timebase;
-       int ret;
-       u8 status;
-       u8 cmd = CMD_MX25XX_RDSR;
-
-       ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN);
-       if (ret) {
-               debug("SF: Failed to send command %02x: %d\n", cmd, ret);
-               return ret;
-       }
-
-       timebase = get_timer(0);
-       do {
-               ret = spi_xfer(spi, 8, NULL, &status, 0);
-               if (ret)
-                       return -1;
-
-               if ((status & MACRONIX_SR_WIP) == 0)
-                       break;
-
-       } while (get_timer(timebase) < timeout);
-
-       spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);
-
-       if ((status & MACRONIX_SR_WIP) == 0)
-               return 0;
-
-       /* Timed out */
-       return -1;
-}
-
-static int macronix_read_fast(struct spi_flash *flash,
-                             u32 offset, size_t len, void *buf)
-{
-       struct macronix_spi_flash *mcx = to_macronix_spi_flash(flash);
-       unsigned long page_addr;
-       unsigned long page_size;
-       u8 cmd[5];
-
-       page_size = mcx->params->page_size;
-       page_addr = offset / page_size;
-
-       cmd[0] = CMD_READ_ARRAY_FAST;
-       cmd[1] = page_addr >> 8;
-       cmd[2] = page_addr;
-       cmd[3] = offset % page_size;
-       cmd[4] = 0x00;
-
-       return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
-}
-
 static int macronix_write(struct spi_flash *flash,
                          u32 offset, size_t len, const void *buf)
 {
@@ -216,11 +160,9 @@ static int macronix_write(struct spi_flash *flash,
                        break;
                }
 
-               ret = macronix_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
-               if (ret < 0) {
-                       debug("SF: Macronix page programming timed out\n");
+               ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+               if (ret)
                        break;
-               }
 
                page_addr++;
                byte_addr = 0;
@@ -233,67 +175,9 @@ static int macronix_write(struct spi_flash *flash,
        return ret;
 }
 
-int macronix_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int macronix_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       struct macronix_spi_flash *mcx = to_macronix_spi_flash(flash);
-       unsigned long sector_size;
-       size_t actual;
-       int ret;
-       u8 cmd[4];
-
-       /*
-        * This function currently uses sector erase only.
-        * probably speed things up by using bulk erase
-        * when possible.
-        */
-
-       sector_size = mcx->params->page_size * mcx->params->pages_per_sector
-                       * mcx->params->sectors_per_block;
-
-       if (offset % sector_size || len % sector_size) {
-               debug("SF: Erase offset/length not multiple of sector size\n");
-               return -1;
-       }
-
-       len /= sector_size;
-       cmd[0] = CMD_MX25XX_BE;
-       cmd[2] = 0x00;
-       cmd[3] = 0x00;
-
-       ret = spi_claim_bus(flash->spi);
-       if (ret) {
-               debug("SF: Unable to claim SPI bus\n");
-               return ret;
-       }
-
-       ret = 0;
-       for (actual = 0; actual < len; actual++) {
-               cmd[1] = (offset / sector_size) + actual;
-
-               ret = spi_flash_cmd(flash->spi, CMD_MX25XX_WREN, NULL, 0);
-               if (ret < 0) {
-                       debug("SF: Enabling Write failed\n");
-                       break;
-               }
-
-               ret = spi_flash_cmd_write(flash->spi, cmd, 4, NULL, 0);
-               if (ret < 0) {
-                       debug("SF: Macronix page erase failed\n");
-                       break;
-               }
-
-               ret = macronix_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
-               if (ret < 0) {
-                       debug("SF: Macronix page erase timed out\n");
-                       break;
-               }
-       }
-
-       debug("SF: Macronix: Successfully erased %u bytes @ 0x%x\n",
-             len * sector_size, offset);
-
-       spi_release_bus(flash->spi);
-       return ret;
+       return spi_flash_cmd_erase(flash, CMD_MX25XX_BE, offset, len);
 }
 
 struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
@@ -326,13 +210,10 @@ struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
 
        mcx->flash.write = macronix_write;
        mcx->flash.erase = macronix_erase;
-       mcx->flash.read = macronix_read_fast;
-       mcx->flash.size = params->page_size * params->pages_per_sector
-           * params->sectors_per_block * params->nr_blocks;
-
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, params->page_size);
-       print_size(mcx->flash.size, "\n");
+       mcx->flash.read = spi_flash_cmd_read_fast;
+       mcx->flash.sector_size = params->page_size * params->pages_per_sector
+               * params->sectors_per_block;
+       mcx->flash.size = mcx->flash.sector_size * params->nr_blocks;
 
        return &mcx->flash;
 }
index 171390d5c326ac3f57645e88df9eda13dc990c5b..078d16ce1bc6d5ec15ec1b15373c575ae51e2ac9 100644 (file)
@@ -233,7 +233,7 @@ static int ramtron_write(struct spi_flash *flash,
                CMD_RAMTRON_WRITE);
 }
 
-int ramtron_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int ramtron_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
        debug("SF: Erase of RAMTRON FRAMs is pointless\n");
        return -1;
@@ -312,8 +312,5 @@ found:
        sn->flash.erase = ramtron_erase;
        sn->flash.size = params->size;
 
-       printf("SF: Detected %s with size ", params->name);
-       print_size(sn->flash.size, "\n");
-
        return &sn->flash;
 }
index c0900f978f25710bf86ecab0e62546b1d4d6fad5..a3401b32e18570ed58ca19dc8ad440d834a30434 100644 (file)
@@ -54,8 +54,6 @@
 #define SPSN_EXT_ID_S25FL128P_64KB     0x0301
 #define SPSN_EXT_ID_S25FL032P          0x4d00
 
-#define SPANSION_SR_WIP                (1 << 0)        /* Write-in-Progress */
-
 struct spansion_spi_flash_params {
        u16 idcode1;
        u16 idcode2;
@@ -135,56 +133,6 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
        },
 };
 
-static int spansion_wait_ready(struct spi_flash *flash, unsigned long timeout)
-{
-       struct spi_slave *spi = flash->spi;
-       unsigned long timebase;
-       int ret;
-       u8 status;
-
-       timebase = get_timer(0);
-       do {
-               ret = spi_flash_cmd(spi, CMD_S25FLXX_RDSR, &status, sizeof(status));
-               if (ret)
-                       return -1;
-
-               if ((status & SPANSION_SR_WIP) == 0)
-                       break;
-
-       } while (get_timer(timebase) < timeout);
-
-
-       if ((status & SPANSION_SR_WIP) == 0)
-               return 0;
-
-       /* Timed out */
-       return -1;
-}
-
-static int spansion_read_fast(struct spi_flash *flash,
-                            u32 offset, size_t len, void *buf)
-{
-       struct spansion_spi_flash *spsn = to_spansion_spi_flash(flash);
-       unsigned long page_addr;
-       unsigned long page_size;
-       u8 cmd[5];
-
-       page_size = spsn->params->page_size;
-       page_addr = offset / page_size;
-
-       cmd[0] = CMD_READ_ARRAY_FAST;
-       cmd[1] = page_addr >> 8;
-       cmd[2] = page_addr;
-       cmd[3] = offset % page_size;
-       cmd[4] = 0x00;
-
-       debug
-               ("READ: 0x%x => cmd = { 0x%02x 0x%02x%02x%02x%02x } len = 0x%x\n",
-                offset, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], len);
-
-       return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
-}
-
 static int spansion_write(struct spi_flash *flash,
                         u32 offset, size_t len, const void *buf)
 {
@@ -233,11 +181,9 @@ static int spansion_write(struct spi_flash *flash,
                        break;
                }
 
-               ret = spansion_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
-               if (ret < 0) {
-                       debug("SF: SPANSION page programming timed out\n");
+               ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+               if (ret)
                        break;
-               }
 
                page_addr++;
                byte_addr = 0;
@@ -250,66 +196,9 @@ static int spansion_write(struct spi_flash *flash,
        return ret;
 }
 
-int spansion_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int spansion_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       struct spansion_spi_flash *spsn = to_spansion_spi_flash(flash);
-       unsigned long sector_size;
-       size_t actual;
-       int ret;
-       u8 cmd[4];
-
-       /*
-        * This function currently uses sector erase only.
-        * probably speed things up by using bulk erase
-        * when possible.
-        */
-
-       sector_size = spsn->params->page_size * spsn->params->pages_per_sector;
-
-       if (offset % sector_size || len % sector_size) {
-               debug("SF: Erase offset/length not multiple of sector size\n");
-               return -1;
-       }
-
-       cmd[0] = CMD_S25FLXX_SE;
-       cmd[2] = 0x00;
-       cmd[3] = 0x00;
-
-       ret = spi_claim_bus(flash->spi);
-       if (ret) {
-               debug("SF: Unable to claim SPI bus\n");
-               return ret;
-       }
-
-       ret = 0;
-       for (actual = 0; actual < len; actual += sector_size) {
-               cmd[1] = (offset + actual) >> 16;
-
-               ret = spi_flash_cmd(flash->spi, CMD_S25FLXX_WREN, NULL, 0);
-               if (ret < 0) {
-                       debug("SF: Enabling Write failed\n");
-                       break;
-               }
-
-               ret = spi_flash_cmd_write(flash->spi, cmd, 4, NULL, 0);
-               if (ret < 0) {
-                       debug("SF: SPANSION page erase failed\n");
-                       break;
-               }
-
-               /* Up to 2 seconds */
-               ret = spansion_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
-               if (ret < 0) {
-                       debug("SF: SPANSION page erase timed out\n");
-                       break;
-               }
-       }
-
-       debug("SF: SPANSION: Successfully erased %u bytes @ 0x%x\n",
-             len, offset);
-
-       spi_release_bus(flash->spi);
-       return ret;
+       return spi_flash_cmd_erase(flash, CMD_S25FLXX_SE, offset, len);
 }
 
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
@@ -347,13 +236,9 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
 
        spsn->flash.write = spansion_write;
        spsn->flash.erase = spansion_erase;
-       spsn->flash.read = spansion_read_fast;
-       spsn->flash.size = params->page_size * params->pages_per_sector
-           * params->nr_sectors;
-
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, params->page_size);
-       print_size(spsn->flash.size, "\n");
+       spsn->flash.read = spi_flash_cmd_read_fast;
+       spsn->flash.sector_size = params->page_size * params->pages_per_sector;
+       spsn->flash.size = spsn->flash.sector_size * params->nr_sectors;
 
        return &spsn->flash;
 }
index b61d2198cd1f6b674beab77b905b3b29dd265308..c75b716fd43b6f984769348e4d95873d36030c6d 100644 (file)
 
 #include "spi_flash_internal.h"
 
-int spi_flash_cmd(struct spi_slave *spi, u8 cmd, void *response, size_t len)
+static void spi_flash_addr(u32 addr, u8 *cmd)
 {
-       unsigned long flags = SPI_XFER_BEGIN;
-       int ret;
-
-       if (len == 0)
-               flags |= SPI_XFER_END;
-
-       ret = spi_xfer(spi, 8, &cmd, NULL, flags);
-       if (ret) {
-               debug("SF: Failed to send command %02x: %d\n", cmd, ret);
-               return ret;
-       }
-
-       if (len) {
-               ret = spi_xfer(spi, len * 8, NULL, response, SPI_XFER_END);
-               if (ret)
-                       debug("SF: Failed to read response (%zu bytes): %d\n",
-                                       len, ret);
-       }
-
-       return ret;
+       /* cmd[0] is actual command */
+       cmd[1] = addr >> 16;
+       cmd[2] = addr >> 8;
+       cmd[3] = addr >> 0;
 }
 
-int spi_flash_cmd_read(struct spi_slave *spi, const u8 *cmd,
-               size_t cmd_len, void *data, size_t data_len)
+static int spi_flash_read_write(struct spi_slave *spi,
+                               const u8 *cmd, size_t cmd_len,
+                               const u8 *data_out, u8 *data_in,
+                               size_t data_len)
 {
        unsigned long flags = SPI_XFER_BEGIN;
        int ret;
@@ -49,52 +35,149 @@ int spi_flash_cmd_read(struct spi_slave *spi, const u8 *cmd,
 
        ret = spi_xfer(spi, cmd_len * 8, cmd, NULL, flags);
        if (ret) {
-               debug("SF: Failed to send read command (%zu bytes): %d\n",
+               debug("SF: Failed to send command (%zu bytes): %d\n",
                                cmd_len, ret);
        } else if (data_len != 0) {
-               ret = spi_xfer(spi, data_len * 8, NULL, data, SPI_XFER_END);
+               ret = spi_xfer(spi, data_len * 8, data_out, data_in, SPI_XFER_END);
                if (ret)
-                       debug("SF: Failed to read %zu bytes of data: %d\n",
+                       debug("SF: Failed to transfer %zu bytes of data: %d\n",
                                        data_len, ret);
        }
 
        return ret;
 }
 
+int spi_flash_cmd(struct spi_slave *spi, u8 cmd, void *response, size_t len)
+{
+       return spi_flash_cmd_read(spi, &cmd, 1, response, len);
+}
+
+int spi_flash_cmd_read(struct spi_slave *spi, const u8 *cmd,
+               size_t cmd_len, void *data, size_t data_len)
+{
+       return spi_flash_read_write(spi, cmd, cmd_len, NULL, data, data_len);
+}
+
 int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len,
                const void *data, size_t data_len)
 {
-       unsigned long flags = SPI_XFER_BEGIN;
+       return spi_flash_read_write(spi, cmd, cmd_len, data, NULL, data_len);
+}
+
+int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
+               size_t cmd_len, void *data, size_t data_len)
+{
+       struct spi_slave *spi = flash->spi;
        int ret;
 
-       if (data_len == 0)
-               flags |= SPI_XFER_END;
+       spi_claim_bus(spi);
+       ret = spi_flash_cmd_read(spi, cmd, cmd_len, data, data_len);
+       spi_release_bus(spi);
 
-       ret = spi_xfer(spi, cmd_len * 8, cmd, NULL, flags);
+       return ret;
+}
+
+int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
+               size_t len, void *data)
+{
+       u8 cmd[5];
+
+       cmd[0] = CMD_READ_ARRAY_FAST;
+       spi_flash_addr(offset, cmd);
+       cmd[4] = 0x00;
+
+       return spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
+}
+
+int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
+                          u8 cmd, u8 poll_bit)
+{
+       struct spi_slave *spi = flash->spi;
+       unsigned long timebase;
+       int ret;
+       u8 status;
+
+       ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN);
        if (ret) {
-               debug("SF: Failed to send read command (%zu bytes): %d\n",
-                               cmd_len, ret);
-       } else if (data_len != 0) {
-               ret = spi_xfer(spi, data_len * 8, data, NULL, SPI_XFER_END);
-               if (ret)
-                       debug("SF: Failed to read %zu bytes of data: %d\n",
-                                       data_len, ret);
+               debug("SF: Failed to send command %02x: %d\n", cmd, ret);
+               return ret;
        }
 
-       return ret;
+       timebase = get_timer(0);
+       do {
+               ret = spi_xfer(spi, 8, NULL, &status, 0);
+               if (ret)
+                       return -1;
+
+               if ((status & poll_bit) == 0)
+                       break;
+
+       } while (get_timer(timebase) < timeout);
+
+       spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);
+
+       if ((status & poll_bit) == 0)
+               return 0;
+
+       /* Timed out */
+       debug("SF: time out!\n");
+       return -1;
 }
 
+int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout)
+{
+       return spi_flash_cmd_poll_bit(flash, timeout,
+               CMD_READ_STATUS, STATUS_WIP);
+}
 
-int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
-               size_t cmd_len, void *data, size_t data_len)
+int spi_flash_cmd_erase(struct spi_flash *flash, u8 erase_cmd,
+                       u32 offset, size_t len)
 {
-       struct spi_slave *spi = flash->spi;
+       u32 start, end, erase_size;
        int ret;
+       u8 cmd[4];
 
-       spi_claim_bus(spi);
-       ret = spi_flash_cmd_read(spi, cmd, cmd_len, data, data_len);
-       spi_release_bus(spi);
+       erase_size = flash->sector_size;
+       if (offset % erase_size || len % erase_size) {
+               debug("SF: Erase offset/length not multiple of erase size\n");
+               return -1;
+       }
+
+       ret = spi_claim_bus(flash->spi);
+       if (ret) {
+               debug("SF: Unable to claim SPI bus\n");
+               return ret;
+       }
+
+       cmd[0] = erase_cmd;
+       start = offset;
+       end = start + len;
 
+       while (offset < end) {
+               spi_flash_addr(offset, cmd);
+               offset += erase_size;
+
+               debug("SF: erase %2x %2x %2x %2x (%x)\n", cmd[0], cmd[1],
+                     cmd[2], cmd[3], offset);
+
+               ret = spi_flash_cmd(flash->spi, CMD_WRITE_ENABLE, NULL, 0);
+               if (ret)
+                       goto out;
+
+               ret = spi_flash_cmd_write(flash->spi, cmd, sizeof(cmd), NULL, 0);
+               if (ret)
+                       goto out;
+
+               ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
+               if (ret)
+                       goto out;
+       }
+
+       debug("SF: Successfully erased %lu bytes @ %#x\n",
+             len * erase_size, start);
+
+ out:
+       spi_release_bus(flash->spi);
        return ret;
 }
 
@@ -214,6 +297,10 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
                goto err_manufacturer_probe;
        }
 
+       printf("SF: Detected %s with page size ", flash->name);
+       print_size(flash->sector_size, ", total ");
+       print_size(flash->size, "\n");
+
        spi_release_bus(spi);
 
        return flash;
index 68dcffb97174bc3c17a96c74d8d2ec452ba7c315..fc109cef53e73eb62914d48f2b6d357284b673e2 100644 (file)
 #define CMD_READ_ARRAY_FAST            0x0b
 #define CMD_READ_ARRAY_LEGACY          0xe8
 
+#define CMD_READ_STATUS                        0x05
+#define CMD_WRITE_ENABLE               0x06
+
+/* Common status */
+#define STATUS_WIP                     0x01
+
 /* Send a single-byte command to the device and read the response */
 int spi_flash_cmd(struct spi_slave *spi, u8 cmd, void *response, size_t len);
 
@@ -29,6 +35,9 @@ int spi_flash_cmd(struct spi_slave *spi, u8 cmd, void *response, size_t len);
 int spi_flash_cmd_read(struct spi_slave *spi, const u8 *cmd,
                size_t cmd_len, void *data, size_t data_len);
 
+int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
+               size_t len, void *data);
+
 /*
  * Send a multi-byte command to the device followed by (optional)
  * data. Used for programming the flash array, etc.
@@ -43,6 +52,20 @@ int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len,
 int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
                size_t cmd_len, void *data, size_t data_len);
 
+/* Send a command to the device and wait for some bit to clear itself. */
+int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
+                          u8 cmd, u8 poll_bit);
+
+/*
+ * Send the read status command to the device and wait for the wip
+ * (write-in-progress) bit to clear itself.
+ */
+int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout);
+
+/* Erase sectors. */
+int spi_flash_cmd_erase(struct spi_flash *flash, u8 erase_cmd,
+                       u32 offset, size_t len);
+
 /* Manufacturer-specific probe functions */
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode);
index 25578914c68fab2b3a001b05b724e18e788b247b..4dc2db2ba7b83e4aa269b42780fa939f109b8702 100644 (file)
@@ -70,6 +70,10 @@ static const struct sst_spi_flash_params sst_spi_flash_table[] = {
                .idcode1 = 0x4a,
                .nr_sectors = 1024,
                .name = "SST25VF032B",
+       },{
+               .idcode1 = 0x4b,
+               .nr_sectors = 2048,
+               .name = "SST25VF064C",
        },{
                .idcode1 = 0x01,
                .nr_sectors = 16,
@@ -89,41 +93,6 @@ static const struct sst_spi_flash_params sst_spi_flash_table[] = {
        },
 };
 
-static int
-sst_wait_ready(struct spi_flash *flash, unsigned long timeout)
-{
-       struct spi_slave *spi = flash->spi;
-       unsigned long timebase;
-       int ret;
-       u8 byte = CMD_SST_RDSR;
-
-       ret = spi_xfer(spi, sizeof(byte) * 8, &byte, NULL, SPI_XFER_BEGIN);
-       if (ret) {
-               debug("SF: Failed to send command %02x: %d\n", byte, ret);
-               return ret;
-       }
-
-       timebase = get_timer(0);
-       do {
-               ret = spi_xfer(spi, sizeof(byte) * 8, NULL, &byte, 0);
-               if (ret)
-                       break;
-
-               if ((byte & SST_SR_WIP) == 0)
-                       break;
-
-       } while (get_timer(timebase) < timeout);
-
-       spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);
-
-       if (!ret && (byte & SST_SR_WIP) != 0)
-               ret = -1;
-
-       if (ret)
-               debug("SF: sst wait for ready timed out\n");
-       return ret;
-}
-
 static int
 sst_enable_writing(struct spi_flash *flash)
 {
@@ -142,19 +111,6 @@ sst_disable_writing(struct spi_flash *flash)
        return ret;
 }
 
-static int
-sst_read_fast(struct spi_flash *flash, u32 offset, size_t len, void *buf)
-{
-       u8 cmd[5] = {
-               CMD_READ_ARRAY_FAST,
-               offset >> 16,
-               offset >> 8,
-               offset,
-               0x00,
-       };
-       return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
-}
-
 static int
 sst_byte_write(struct spi_flash *flash, u32 offset, const void *buf)
 {
@@ -177,7 +133,7 @@ sst_byte_write(struct spi_flash *flash, u32 offset, const void *buf)
        if (ret)
                return ret;
 
-       return sst_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+       return spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
 }
 
 static int
@@ -224,7 +180,7 @@ sst_write(struct spi_flash *flash, u32 offset, size_t len, const void *buf)
                        break;
                }
 
-               ret = sst_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+               ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
                if (ret)
                        break;
 
@@ -247,67 +203,9 @@ sst_write(struct spi_flash *flash, u32 offset, size_t len, const void *buf)
        return ret;
 }
 
-int
-sst_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int sst_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       unsigned long sector_size;
-       u32 start, end;
-       int ret;
-       u8 cmd[4];
-
-       /*
-        * This function currently uses sector erase only.
-        * Probably speed things up by using bulk erase
-        * when possible.
-        */
-
-       sector_size = SST_SECTOR_SIZE;
-
-       if (offset % sector_size) {
-               debug("SF: Erase offset not multiple of sector size\n");
-               return -1;
-       }
-
-       ret = spi_claim_bus(flash->spi);
-       if (ret) {
-               debug("SF: Unable to claim SPI bus\n");
-               return ret;
-       }
-
-       cmd[0] = CMD_SST_SE;
-       cmd[3] = 0;
-       start = offset;
-       end = start + len;
-
-       ret = 0;
-       while (offset < end) {
-               cmd[1] = offset >> 16;
-               cmd[2] = offset >> 8;
-               offset += sector_size;
-
-               debug("SF: erase %2x %2x %2x %2x (%x)\n", cmd[0], cmd[1],
-                     cmd[2], cmd[3], offset);
-
-               ret = sst_enable_writing(flash);
-               if (ret)
-                       break;
-
-               ret = spi_flash_cmd_write(flash->spi, cmd, sizeof(cmd), NULL, 0);
-               if (ret) {
-                       debug("SF: sst page erase failed\n");
-                       break;
-               }
-
-               ret = sst_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
-               if (ret)
-                       break;
-       }
-
-       debug("SF: sst: Successfully erased %lu bytes @ 0x%x\n",
-             len * sector_size, start);
-
-       spi_release_bus(flash->spi);
-       return ret;
+       return spi_flash_cmd_erase(flash, CMD_SST_SE, offset, len);
 }
 
 static int
@@ -361,12 +259,9 @@ spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode)
 
        stm->flash.write = sst_write;
        stm->flash.erase = sst_erase;
-       stm->flash.read = sst_read_fast;
-       stm->flash.size = SST_SECTOR_SIZE * params->nr_sectors;
-
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, SST_SECTOR_SIZE);
-       print_size(stm->flash.size, "\n");
+       stm->flash.read = spi_flash_cmd_read_fast;
+       stm->flash.sector_size = SST_SECTOR_SIZE;
+       stm->flash.size = stm->flash.sector_size * params->nr_sectors;
 
        /* Flash powers up read-only, so clear BP# bits */
        sst_unlock(&stm->flash);
index 31340279cb872f98e0fdafe84f087ff0dc0f7786..a1959ca984019c9ebcf54752911a9d730ab6cb21 100644 (file)
@@ -55,8 +55,6 @@
 #define STM_ID_M25P80          0x14
 #define STM_ID_M25P128         0x18
 
-#define STMICRO_SR_WIP         (1 << 0)        /* Write-in-Progress */
-
 struct stmicro_spi_flash_params {
        u8 idcode1;
        u16 page_size;
@@ -136,60 +134,6 @@ static const struct stmicro_spi_flash_params stmicro_spi_flash_table[] = {
        },
 };
 
-static int stmicro_wait_ready(struct spi_flash *flash, unsigned long timeout)
-{
-       struct spi_slave *spi = flash->spi;
-       unsigned long timebase;
-       int ret;
-       u8 cmd = CMD_M25PXX_RDSR;
-       u8 status;
-
-       ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN);
-       if (ret) {
-               debug("SF: Failed to send command %02x: %d\n", cmd, ret);
-               return ret;
-       }
-
-       timebase = get_timer(0);
-       do {
-               ret = spi_xfer(spi, 8, NULL, &status, 0);
-               if (ret)
-                       return -1;
-
-               if ((status & STMICRO_SR_WIP) == 0)
-                       break;
-
-       } while (get_timer(timebase) < timeout);
-
-       spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);
-
-       if ((status & STMICRO_SR_WIP) == 0)
-               return 0;
-
-       /* Timed out */
-       return -1;
-}
-
-static int stmicro_read_fast(struct spi_flash *flash,
-                            u32 offset, size_t len, void *buf)
-{
-       struct stmicro_spi_flash *stm = to_stmicro_spi_flash(flash);
-       unsigned long page_addr;
-       unsigned long page_size;
-       u8 cmd[5];
-
-       page_size = stm->params->page_size;
-       page_addr = offset / page_size;
-
-       cmd[0] = CMD_READ_ARRAY_FAST;
-       cmd[1] = page_addr >> 8;
-       cmd[2] = page_addr;
-       cmd[3] = offset % page_size;
-       cmd[4] = 0x00;
-
-       return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
-}
-
 static int stmicro_write(struct spi_flash *flash,
                         u32 offset, size_t len, const void *buf)
 {
@@ -238,11 +182,9 @@ static int stmicro_write(struct spi_flash *flash,
                        break;
                }
 
-               ret = stmicro_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
-               if (ret < 0) {
-                       debug("SF: STMicro page programming timed out\n");
+               ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+               if (ret)
                        break;
-               }
 
                page_addr++;
                byte_addr = 0;
@@ -255,67 +197,9 @@ static int stmicro_write(struct spi_flash *flash,
        return ret;
 }
 
-int stmicro_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int stmicro_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       struct stmicro_spi_flash *stm = to_stmicro_spi_flash(flash);
-       unsigned long sector_size;
-       size_t actual;
-       int ret;
-       u8 cmd[4];
-
-       /*
-        * This function currently uses sector erase only.
-        * probably speed things up by using bulk erase
-        * when possible.
-        */
-
-       sector_size = stm->params->page_size * stm->params->pages_per_sector;
-
-       if (offset % sector_size || len % sector_size) {
-               debug("SF: Erase offset/length not multiple of sector size\n");
-               return -1;
-       }
-
-       len /= sector_size;
-       cmd[0] = CMD_M25PXX_SE;
-       cmd[2] = 0x00;
-       cmd[3] = 0x00;
-
-       ret = spi_claim_bus(flash->spi);
-       if (ret) {
-               debug("SF: Unable to claim SPI bus\n");
-               return ret;
-       }
-
-       ret = 0;
-       for (actual = 0; actual < len; actual++) {
-               cmd[1] = offset >> 16;
-               offset += sector_size;
-
-               ret = spi_flash_cmd(flash->spi, CMD_M25PXX_WREN, NULL, 0);
-               if (ret < 0) {
-                       debug("SF: Enabling Write failed\n");
-                       break;
-               }
-
-               ret = spi_flash_cmd_write(flash->spi, cmd, 4, NULL, 0);
-               if (ret < 0) {
-                       debug("SF: STMicro page erase failed\n");
-                       break;
-               }
-
-               ret = stmicro_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
-               if (ret < 0) {
-                       debug("SF: STMicro page erase timed out\n");
-                       break;
-               }
-       }
-
-       debug("SF: STMicro: Successfully erased %u bytes @ 0x%x\n",
-             len * sector_size, offset);
-
-       spi_release_bus(flash->spi);
-       return ret;
+       return spi_flash_cmd_erase(flash, CMD_M25PXX_SE, offset, len);
 }
 
 struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
@@ -361,13 +245,9 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
 
        stm->flash.write = stmicro_write;
        stm->flash.erase = stmicro_erase;
-       stm->flash.read = stmicro_read_fast;
-       stm->flash.size = params->page_size * params->pages_per_sector
-           * params->nr_sectors;
-
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, params->page_size);
-       print_size(stm->flash.size, "\n");
+       stm->flash.read = spi_flash_cmd_read_fast;
+       stm->flash.sector_size = params->page_size * params->pages_per_sector;
+       stm->flash.size = stm->flash.sector_size * params->nr_sectors;
 
        return &stm->flash;
 }
index 44523555d9ef3eb847a33a1470bc038dca0b3d1d..e8d30ae2b9d02933a812621e0cdb47511c931bba 100644 (file)
@@ -24,8 +24,6 @@
 #define CMD_W25_DP             0xb9    /* Deep Power-down */
 #define CMD_W25_RES            0xab    /* Release from DP, and Read Signature */
 
-#define WINBOND_SR_WIP         (1 << 0)        /* Write-in-Progress */
-
 struct winbond_spi_flash_params {
        uint16_t        id;
        /* Log2 of page size in power-of-two mode */
@@ -107,81 +105,6 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
        },
 };
 
-static int winbond_wait_ready(struct spi_flash *flash, unsigned long timeout)
-{
-       struct spi_slave *spi = flash->spi;
-       unsigned long timebase;
-       int ret;
-       u8 status;
-       u8 cmd[4] = { CMD_W25_RDSR, 0xff, 0xff, 0xff };
-
-       ret = spi_xfer(spi, 32, &cmd[0], NULL, SPI_XFER_BEGIN);
-       if (ret) {
-               debug("SF: Failed to send command %02x: %d\n", cmd, ret);
-               return ret;
-       }
-
-       timebase = get_timer(0);
-       do {
-               ret = spi_xfer(spi, 8, NULL, &status, 0);
-               if (ret) {
-                       debug("SF: Failed to get status for cmd %02x: %d\n", cmd, ret);
-                       return -1;
-               }
-
-               if ((status & WINBOND_SR_WIP) == 0)
-                       break;
-
-       } while (get_timer(timebase) < timeout);
-
-       spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);
-
-       if ((status & WINBOND_SR_WIP) == 0)
-               return 0;
-
-       debug("SF: Timed out on command %02x: %d\n", cmd, ret);
-       /* Timed out */
-       return -1;
-}
-
-/*
- * Assemble the address part of a command for Winbond devices in
- * non-power-of-two page size mode.
- */
-static void winbond_build_address(struct winbond_spi_flash *stm, u8 *cmd, u32 offset)
-{
-       unsigned long page_addr;
-       unsigned long byte_addr;
-       unsigned long page_size;
-       unsigned int page_shift;
-
-       /*
-        * The "extra" space per page is the power-of-two page size
-        * divided by 32.
-        */
-       page_shift = stm->params->l2_page_size;
-       page_size = (1 << page_shift);
-       page_addr = offset / page_size;
-       byte_addr = offset % page_size;
-
-       cmd[0] = page_addr >> (16 - page_shift);
-       cmd[1] = page_addr << (page_shift - 8) | (byte_addr >> 8);
-       cmd[2] = byte_addr;
-}
-
-static int winbond_read_fast(struct spi_flash *flash,
-               u32 offset, size_t len, void *buf)
-{
-       struct winbond_spi_flash *stm = to_winbond_spi_flash(flash);
-       u8 cmd[5];
-
-       cmd[0] = CMD_READ_ARRAY_FAST;
-       winbond_build_address(stm, cmd + 1, offset);
-       cmd[4] = 0x00;
-
-       return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
-}
-
 static int winbond_write(struct spi_flash *flash,
                u32 offset, size_t len, const void *buf)
 {
@@ -230,11 +153,9 @@ static int winbond_write(struct spi_flash *flash,
                        goto out;
                }
 
-               ret = winbond_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
-               if (ret < 0) {
-                       debug("SF: Winbond page programming timed out\n");
+               ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+               if (ret)
                        goto out;
-               }
 
                page_addr++;
                byte_addr = 0;
@@ -249,69 +170,9 @@ out:
        return ret;
 }
 
-int winbond_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int winbond_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       struct winbond_spi_flash *stm = to_winbond_spi_flash(flash);
-       unsigned long sector_size;
-       unsigned int page_shift;
-       size_t actual;
-       int ret;
-       u8 cmd[4];
-
-       /*
-        * This function currently uses sector erase only.
-        * probably speed things up by using bulk erase
-        * when possible.
-        */
-
-       page_shift = stm->params->l2_page_size;
-       sector_size = (1 << page_shift) * stm->params->pages_per_sector;
-
-       if (offset % sector_size || len % sector_size) {
-               debug("SF: Erase offset/length not multiple of sector size\n");
-               return -1;
-       }
-
-       len /= sector_size;
-       cmd[0] = CMD_W25_SE;
-
-       ret = spi_claim_bus(flash->spi);
-       if (ret) {
-               debug("SF: Unable to claim SPI bus\n");
-               return ret;
-       }
-
-       for (actual = 0; actual < len; actual++) {
-               winbond_build_address(stm, &cmd[1], offset + actual * sector_size);
-               printf("Erase: %02x %02x %02x %02x\n",
-                               cmd[0], cmd[1], cmd[2], cmd[3]);
-
-               ret = spi_flash_cmd(flash->spi, CMD_W25_WREN, NULL, 0);
-               if (ret < 0) {
-                       debug("SF: Enabling Write failed\n");
-                       goto out;
-               }
-
-               ret = spi_flash_cmd_write(flash->spi, cmd, 4, NULL, 0);
-               if (ret < 0) {
-                       debug("SF: Winbond sector erase failed\n");
-                       goto out;
-               }
-
-               ret = winbond_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
-               if (ret < 0) {
-                       debug("SF: Winbond sector erase timed out\n");
-                       goto out;
-               }
-       }
-
-       debug("SF: Winbond: Successfully erased %u bytes @ 0x%x\n",
-                       len * sector_size, offset);
-       ret = 0;
-
-out:
-       spi_release_bus(flash->spi);
-       return ret;
+       return spi_flash_cmd_erase(flash, CMD_W25_SE, offset, len);
 }
 
 struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
@@ -348,14 +209,12 @@ struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
 
        stm->flash.write = winbond_write;
        stm->flash.erase = winbond_erase;
-       stm->flash.read = winbond_read_fast;
+       stm->flash.read = spi_flash_cmd_read_fast;
+       stm->flash.sector_size = (1 << stm->params->l2_page_size) *
+               stm->params->pages_per_sector;
        stm->flash.size = page_size * params->pages_per_sector
                                * params->sectors_per_block
                                * params->nr_blocks;
 
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, page_size);
-       print_size(stm->flash.size, "\n");
-
        return &stm->flash;
 }
index fd9d0b4be115a10674f1ab5d9cdd5909c966dfa3..819b197673b28efc3abd8ada48b9f6e166891df0 100644 (file)
@@ -79,7 +79,7 @@ COBJS-$(CONFIG_TIGON3) += tigon3.o
 COBJS-$(CONFIG_TIGON3) += bcm570x_autoneg.o
 COBJS-$(CONFIG_TIGON3) += 5701rls.o
 COBJS-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
-COBJS-$(CONFIG_TSEC_ENET) += tsec.o
+COBJS-$(CONFIG_TSEC_ENET) += tsec.o fsl_mdio.o
 COBJS-$(CONFIG_TSI108_ETH) += tsi108_eth.o
 COBJS-$(CONFIG_ULI526X) += uli526x.o
 COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
index 4e5685c0c32b83fae2a46be6e6c33c43e9f4eacb..90eb5152409b8b2d0ece526de1ec711afd3a5c6f 100644 (file)
@@ -93,7 +93,7 @@
 #define RBF_MULTICAST (1<<30)
 #define RBF_UNICAST   (1<<29)
 #define RBF_EXTERNAL  (1<<28)
-#define RBF_UNKOWN    (1<<27)
+#define RBF_UNKNOWN   (1<<27)
 #define RBF_SIZE      0x07ff
 #define RBF_LOCAL4    (1<<26)
 #define RBF_LOCAL3    (1<<25)
index c359f54f9df8040249ef50ec5c9c4e3c8534bcc8..66c0d13c2bd9ec42ba2eab1ffca39f6349430fcd 100644 (file)
@@ -247,10 +247,10 @@ static int gen_get_link_speed(int phy_addr)
                        (tmp & 0x04)) {
 #if defined(CONFIG_DRIVER_TI_EMAC_USE_RMII) && \
                defined(CONFIG_MACH_DAVINCI_DA850_EVM)
-               davinci_eth_phy_read(phy_addr, PHY_ANLPAR, &tmp);
+               davinci_eth_phy_read(phy_addr, MII_LPA, &tmp);
 
                /* Speed doesn't matter, there is no setting for it in EMAC. */
-               if (tmp & (PHY_ANLPAR_TXFD | PHY_ANLPAR_10FD)) {
+               if (tmp & (LPA_100FULL | LPA_10FULL)) {
                        /* set EMAC for Full Duplex  */
                        writel(EMAC_MACCONTROL_MIIEN_ENABLE |
                                        EMAC_MACCONTROL_FULLDUPLEX_ENABLE,
@@ -261,7 +261,7 @@ static int gen_get_link_speed(int phy_addr)
                                        &adap_emac->MACCONTROL);
                }
 
-               if (tmp & (PHY_ANLPAR_TXFD | PHY_ANLPAR_TX))
+               if (tmp & (LPA_100FULL | LPA_100HALF))
                        writel(readl(&adap_emac->MACCONTROL) |
                                        EMAC_MACCONTROL_RMIISPEED_100,
                                         &adap_emac->MACCONTROL);
index 709f67aac2c0fa51a01473b958864a33ad3a5984..b5c55738f76aefaaf3018be54c76edf89f53d898 100644 (file)
@@ -110,8 +110,8 @@ static board_info_t dm9000_info;
 
 /* function declaration ------------------------------------- */
 static int dm9000_probe(void);
-static u16 phy_read(int);
-static void phy_write(int, u16);
+static u16 dm9000_phy_read(int);
+static void dm9000_phy_write(int, u16);
 static u8 DM9000_ior(int);
 static void DM9000_iow(int reg, u8 value);
 
@@ -361,7 +361,7 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd)
        DM9000_iow(DM9000_IMR, IMR_PAR);
 
        i = 0;
-       while (!(phy_read(1) & 0x20)) { /* autonegation complete bit */
+       while (!(dm9000_phy_read(1) & 0x20)) {  /* autonegation complete bit */
                udelay(1000);
                i++;
                if (i == 10000) {
@@ -371,7 +371,7 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd)
        }
 
        /* see what we've got */
-       lnk = phy_read(17) >> 12;
+       lnk = dm9000_phy_read(17) >> 12;
        printf("operating at ");
        switch (lnk) {
        case 1:
@@ -445,7 +445,7 @@ static void dm9000_halt(struct eth_device *netdev)
        DM9000_DBG("%s\n", __func__);
 
        /* RESET devie */
-       phy_write(0, 0x8000);   /* PHY RESET */
+       dm9000_phy_write(0, 0x8000);    /* PHY RESET */
        DM9000_iow(DM9000_GPR, 0x01);   /* Power-Down PHY */
        DM9000_iow(DM9000_IMR, 0x80);   /* Disable all interrupt */
        DM9000_iow(DM9000_RCR, 0x00);   /* Disable RX */
@@ -581,7 +581,7 @@ DM9000_iow(int reg, u8 value)
    Read a word from phyxcer
 */
 static u16
-phy_read(int reg)
+dm9000_phy_read(int reg)
 {
        u16 val;
 
@@ -593,7 +593,7 @@ phy_read(int reg)
        val = (DM9000_ior(DM9000_EPDRH) << 8) | DM9000_ior(DM9000_EPDRL);
 
        /* The read data keeps on REG_0D & REG_0E */
-       DM9000_DBG("phy_read(0x%x): 0x%x\n", reg, val);
+       DM9000_DBG("dm9000_phy_read(0x%x): 0x%x\n", reg, val);
        return val;
 }
 
@@ -601,7 +601,7 @@ phy_read(int reg)
    Write a word to phyxcer
 */
 static void
-phy_write(int reg, u16 value)
+dm9000_phy_write(int reg, u16 value)
 {
 
        /* Fill the phyxcer register into REG_0C */
@@ -613,7 +613,7 @@ phy_write(int reg, u16 value)
        DM9000_iow(DM9000_EPCR, 0xa);   /* Issue phyxcer write command */
        udelay(500);                    /* Wait write complete */
        DM9000_iow(DM9000_EPCR, 0x0);   /* Clear phyxcer write command */
-       DM9000_DBG("phy_write(reg:0x%x, value:0x%x)\n", reg, value);
+       DM9000_DBG("dm9000_phy_write(reg:0x%x, value:0x%x)\n", reg, value);
 }
 
 int dm9000_initialize(bd_t *bis)
index 5f390bddbdb481b8bb810bf86ad393a36af94e5b..98145bc6edd3ff932147e8d56afacccbb7f3dd41 100644 (file)
@@ -40,6 +40,8 @@ tested on both gig copper and gig fiber boards
  *  Copyright (C) Linux Networx.
  *  Massive upgrade to work with the new intel gigabit NICs.
  *  <ebiederman at lnxi dot com>
+ *
+ *  Copyright 2011 Freescale Semiconductor, Inc.
  */
 
 #include "e1000.h"
@@ -100,6 +102,7 @@ static struct pci_device_id supported[] = {
        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82573E},
        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82573E_IAMT},
        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82573L},
+       {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82574L},
        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546GB_QUAD_COPPER_KSP3},
        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80003ES2LAN_COPPER_DPT},
        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80003ES2LAN_SERDES_DPT},
@@ -331,7 +334,7 @@ static boolean_t e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw)
        if (hw->mac_type == e1000_ich8lan)
                return FALSE;
 
-       if (hw->mac_type == e1000_82573) {
+       if (hw->mac_type == e1000_82573 || hw->mac_type == e1000_82574) {
                eecd = E1000_READ_REG(hw, EECD);
 
                /* Isolate bits 15 & 16 */
@@ -364,7 +367,7 @@ e1000_acquire_eeprom(struct e1000_hw *hw)
                return -E1000_ERR_SWFW_SYNC;
        eecd = E1000_READ_REG(hw, EECD);
 
-       if (hw->mac_type != e1000_82573) {
+       if (hw->mac_type != e1000_82573 || hw->mac_type != e1000_82574) {
                /* Request EEPROM Access */
                if (hw->mac_type > e1000_82544) {
                        eecd |= E1000_EECD_REQ;
@@ -498,6 +501,7 @@ static int32_t e1000_init_eeprom_params(struct e1000_hw *hw)
                eeprom->use_eewr = FALSE;
                break;
        case e1000_82573:
+       case e1000_82574:
                eeprom->type = e1000_eeprom_spi;
                eeprom->opcode_bits = 8;
                eeprom->delay_usec = 1;
@@ -1317,6 +1321,9 @@ e1000_set_mac_type(struct e1000_hw *hw)
        case E1000_DEV_ID_82573L:
                hw->mac_type = e1000_82573;
                break;
+       case E1000_DEV_ID_82574L:
+               hw->mac_type = e1000_82574;
+               break;
        case E1000_DEV_ID_80003ES2LAN_COPPER_SPT:
        case E1000_DEV_ID_80003ES2LAN_SERDES_SPT:
        case E1000_DEV_ID_80003ES2LAN_COPPER_DPT:
@@ -1487,6 +1494,7 @@ e1000_initialize_hardware_bits(struct e1000_hw *hw)
                        E1000_WRITE_REG(hw, TARC1, reg_tarc1);
                        break;
                case e1000_82573:
+               case e1000_82574:
                        reg_ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
                        reg_ctrl_ext &= ~(1 << 23);
                        reg_ctrl_ext |= (1 << 22);
@@ -1728,12 +1736,11 @@ e1000_init_hw(struct eth_device *nic)
                        | E1000_TXDCTL_FULL_TX_DESC_WB;
                E1000_WRITE_REG(hw, TXDCTL1, ctrl);
                break;
-       }
-
-       if (hw->mac_type == e1000_82573) {
-               uint32_t gcr = E1000_READ_REG(hw, GCR);
-               gcr |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
-               E1000_WRITE_REG(hw, GCR, gcr);
+       case e1000_82573:
+       case e1000_82574:
+               reg_data = E1000_READ_REG(hw, GCR);
+               reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
+               E1000_WRITE_REG(hw, GCR, reg_data);
        }
 
 #if 0
@@ -1812,6 +1819,7 @@ e1000_setup_link(struct eth_device *nic)
                switch (hw->mac_type) {
                case e1000_ich8lan:
                case e1000_82573:
+               case e1000_82574:
                        hw->fc = e1000_fc_full;
                        break;
                default:
@@ -4560,6 +4568,9 @@ static int e1000_set_phy_type (struct e1000_hw *hw)
                        hw->phy_type = e1000_phy_gg82563;
                        break;
                }
+       case BME1000_E_PHY_ID:
+               hw->phy_type = e1000_phy_bm;
+               break;
                /* Fall Through */
        default:
                /* Should never have loaded on this device */
@@ -4646,6 +4657,10 @@ e1000_detect_gig_phy(struct e1000_hw *hw)
                if (hw->phy_id == M88E1111_I_PHY_ID)
                        match = TRUE;
                break;
+       case e1000_82574:
+               if (hw->phy_id == BME1000_E_PHY_ID)
+                       match = TRUE;
+               break;
        case e1000_80003es2lan:
                if (hw->phy_id == GG82563_E_PHY_ID)
                        match = TRUE;
@@ -4710,6 +4725,7 @@ e1000_set_media_type(struct e1000_hw *hw)
                        break;
                case e1000_ich8lan:
                case e1000_82573:
+               case e1000_82574:
                        /* The STATUS_TBIMODE bit is reserved or reused
                         * for the this device.
                         */
@@ -5125,6 +5141,7 @@ void e1000_get_bus_type(struct e1000_hw *hw)
        case e1000_82571:
        case e1000_82572:
        case e1000_82573:
+       case e1000_82574:
        case e1000_80003es2lan:
                hw->bus_type = e1000_bus_type_pci_express;
                break;
index eb0804b412b80fe35a69fb8956c73debea8ac8e0..720d8c67ca6e741d0b367d8b175e6e9a5ad64026 100644 (file)
@@ -2,6 +2,7 @@
 
 
   Copyright(c) 1999 - 2002 Intel Corporation. All rights reserved.
+  Copyright 2011 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
@@ -81,6 +82,7 @@ typedef enum {
        e1000_82571,
        e1000_82572,
        e1000_82573,
+       e1000_82574,
        e1000_80003es2lan,
        e1000_ich8lan,
        e1000_num_macs
@@ -200,6 +202,7 @@ typedef enum {
        e1000_phy_gg82563,
        e1000_phy_igp_3,
        e1000_phy_ife,
+       e1000_phy_bm,
        e1000_phy_undefined = 0xFF
 } e1000_phy_type;
 
@@ -286,6 +289,7 @@ struct e1000_phy_stats {
 #define E1000_DEV_ID_82573E              0x108B
 #define E1000_DEV_ID_82573E_IAMT         0x108C
 #define E1000_DEV_ID_82573L              0x109A
+#define E1000_DEV_ID_82574L              0x10D3
 #define E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 0x10B5
 #define E1000_DEV_ID_80003ES2LAN_COPPER_DPT     0x1096
 #define E1000_DEV_ID_80003ES2LAN_SERDES_DPT     0x1098
@@ -2417,6 +2421,8 @@ struct e1000_hw {
 #define L1LXT971A_PHY_ID   0x001378E0
 #define GG82563_E_PHY_ID   0x01410CA0
 
+#define BME1000_E_PHY_ID     0x01410CB0
+
 /* Miscellaneous PHY bit definitions. */
 #define PHY_PREAMBLE                   0xFFFFFFFF
 #define PHY_SOF                                0x01
index 6c161b632f4165b87e7939c5ae494f736d72e855..d55cacdac8c0acf9b453d0341c779b2856b77571 100644 (file)
@@ -314,7 +314,7 @@ static void enc_release_bus(enc_dev_t *enc)
 /*
  * Read PHY register
  */
-static u16 phy_read(enc_dev_t *enc, const u8 addr)
+static u16 enc_phy_read(enc_dev_t *enc, const u8 addr)
 {
        uint64_t etime;
        u8 status;
@@ -339,7 +339,7 @@ static u16 phy_read(enc_dev_t *enc, const u8 addr)
 /*
  * Write PHY register
  */
-static void phy_write(enc_dev_t *enc, const u8 addr, const u16 data)
+static void enc_phy_write(enc_dev_t *enc, const u8 addr, const u16 data)
 {
        uint64_t etime;
        u8 status;
@@ -374,7 +374,7 @@ static int enc_phy_link_wait(enc_dev_t *enc)
 
 #ifdef CONFIG_ENC_SILENTLINK
        /* check if we have a link, then just return */
-       status = phy_read(enc, PHY_REG_PHSTAT1);
+       status = enc_phy_read(enc, PHY_REG_PHSTAT1);
        if (status & ENC_PHSTAT1_LLSTAT)
                return 0;
 #endif
@@ -382,10 +382,10 @@ static int enc_phy_link_wait(enc_dev_t *enc)
        /* wait for link with 1 second timeout */
        etime = get_ticks() + get_tbclk();
        while (get_ticks() <= etime) {
-               status = phy_read(enc, PHY_REG_PHSTAT1);
+               status = enc_phy_read(enc, PHY_REG_PHSTAT1);
                if (status & ENC_PHSTAT1_LLSTAT) {
                        /* now we have a link */
-                       status = phy_read(enc, PHY_REG_PHSTAT2);
+                       status = enc_phy_read(enc, PHY_REG_PHSTAT2);
                        duplex = (status & ENC_PHSTAT2_DPXSTAT) ? 1 : 0;
                        printf("%s: link up, 10Mbps %s-duplex\n",
                                enc->dev->name, duplex ? "full" : "half");
@@ -678,8 +678,8 @@ static int enc_setup(enc_dev_t *enc)
        enc->bank = 0xff;       /* invalidate current bank in enc28j60 */
 
        /* verify PHY identification */
-       phid1 = phy_read(enc, PHY_REG_PHID1);
-       phid2 = phy_read(enc, PHY_REG_PHID2) & ENC_PHID2_MASK;
+       phid1 = enc_phy_read(enc, PHY_REG_PHID1);
+       phid2 = enc_phy_read(enc, PHY_REG_PHID2) & ENC_PHID2_MASK;
        if (phid1 != ENC_PHID1_VALUE || phid2 != ENC_PHID2_VALUE) {
                printf("%s: failed to identify PHY. Found %04x:%04x\n",
                        enc->dev->name, phid1, phid2);
@@ -694,7 +694,7 @@ static int enc_setup(enc_dev_t *enc)
         * Prevent automatic loopback of data beeing transmitted by setting
         * ENC_PHCON2_HDLDIS
         */
-       phy_write(enc, PHY_REG_PHCON2, (1<<8));
+       enc_phy_write(enc, PHY_REG_PHCON2, (1<<8));
 
        /*
         * LEDs configuration
@@ -702,10 +702,10 @@ static int enc_setup(enc_dev_t *enc)
         * LEDB: LBCFG = 0111 -> display TX & RX activity
         * STRCH = 1 -> LED pulses
         */
-       phy_write(enc, PHY_REG_PHLCON, 0x0472);
+       enc_phy_write(enc, PHY_REG_PHLCON, 0x0472);
 
        /* Reset PDPXMD-bit => half duplex */
-       phy_write(enc, PHY_REG_PHCON1, 0);
+       enc_phy_write(enc, PHY_REG_PHCON1, 0);
 
 #ifdef CONFIG_USE_IRQ
        /* enable interrupts */
@@ -771,7 +771,7 @@ int enc_miiphy_read(const char *devname, u8 phy_adr, u8 reg, u16 *value)
                enc_release_bus(enc);
                return -1;
        }
-       *value = phy_read(enc, reg);
+       *value = enc_phy_read(enc, reg);
        enc_release_bus(enc);
        return 0;
 }
@@ -796,7 +796,7 @@ int enc_miiphy_write(const char *devname, u8 phy_adr, u8 reg, u16 value)
                enc_release_bus(enc);
                return -1;
        }
-       phy_write(enc, reg, value);
+       enc_phy_write(enc, reg, value);
        enc_release_bus(enc);
        return 0;
 }
diff --git a/drivers/net/fsl_mdio.c b/drivers/net/fsl_mdio.c
new file mode 100644 (file)
index 0000000..1aab307
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2009-2010 Freescale Semiconductor, Inc.
+ *     Jun-jie Zhang <b18070@freescale.com>
+ *     Mingkai Hu <Mingkai.hu@freescale.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 <common.h>
+#include <miiphy.h>
+#include <phy.h>
+#include <fsl_mdio.h>
+#include <asm/io.h>
+#include <asm/errno.h>
+#include <asm/fsl_enet.h>
+
+void tsec_local_mdio_write(struct tsec_mii_mng *phyregs, int port_addr,
+               int dev_addr, int regnum, int value)
+{
+       int timeout = 1000000;
+
+       out_be32(&phyregs->miimadd, (port_addr << 8) | (regnum & 0x1f));
+       out_be32(&phyregs->miimcon, value);
+       asm("sync");
+
+       while ((in_be32(&phyregs->miimind) & MIIMIND_BUSY) && timeout--)
+               ;
+}
+
+int tsec_local_mdio_read(struct tsec_mii_mng *phyregs, int port_addr,
+               int dev_addr, int regnum)
+{
+       int value;
+       int timeout = 1000000;
+
+       /* Put the address of the phy, and the register
+        * number into MIIMADD */
+       out_be32(&phyregs->miimadd, (port_addr << 8) | (regnum & 0x1f));
+
+       /* Clear the command register, and wait */
+       out_be32(&phyregs->miimcom, 0);
+       asm("sync");
+
+       /* Initiate a read command, and wait */
+       out_be32(&phyregs->miimcom, MIIMCOM_READ_CYCLE);
+       asm("sync");
+
+       /* Wait for the the indication that the read is done */
+       while ((in_be32(&phyregs->miimind) & (MIIMIND_NOTVALID | MIIMIND_BUSY))
+                       && timeout--)
+               ;
+
+       /* Grab the value read from the PHY */
+       value = in_be32(&phyregs->miimstat);
+
+       return value;
+}
+
+static int fsl_pq_mdio_reset(struct mii_dev *bus)
+{
+       struct tsec_mii_mng *regs = bus->priv;
+
+       /* Reset MII (due to new addresses) */
+       out_be32(&regs->miimcfg, MIIMCFG_RESET_MGMT);
+
+       out_be32(&regs->miimcfg, MIIMCFG_INIT_VALUE);
+
+       while (in_be32(&regs->miimind) & MIIMIND_BUSY)
+               ;
+
+       return 0;
+}
+
+int tsec_phy_read(struct mii_dev *bus, int addr, int dev_addr, int regnum)
+{
+       struct tsec_mii_mng *phyregs = bus->priv;
+
+       return tsec_local_mdio_read(phyregs, addr, dev_addr, regnum);
+}
+
+int tsec_phy_write(struct mii_dev *bus, int addr, int dev_addr, int regnum,
+                       u16 value)
+{
+       struct tsec_mii_mng *phyregs = bus->priv;
+
+       tsec_local_mdio_write(phyregs, addr, dev_addr, regnum, value);
+
+       return 0;
+}
+
+int fsl_pq_mdio_init(bd_t *bis, struct fsl_pq_mdio_info *info)
+{
+       struct mii_dev *bus = mdio_alloc();
+
+       if (!bus) {
+               printf("Failed to allocate FSL MDIO bus\n");
+               return -1;
+       }
+
+       bus->read = tsec_phy_read;
+       bus->write = tsec_phy_write;
+       bus->reset = fsl_pq_mdio_reset;
+       sprintf(bus->name, info->name);
+
+       bus->priv = info->regs;
+
+       return mdio_register(bus);
+}
index bba890189a2c7bfdc1ba8afcfc104f3c99b1a5f2..a59834b292d8cb1503db30ae8d1f7474bb3e4cfb 100644 (file)
@@ -28,6 +28,19 @@ LIB  := $(obj)libphy.o
 COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-$(CONFIG_MV88E61XX_SWITCH) += mv88e61xx.o
 
+COBJS-$(CONFIG_PHYLIB) += phy.o
+COBJS-$(CONFIG_PHYLIB_10G) += generic_10g.o
+COBJS-$(CONFIG_PHY_ATHEROS) += atheros.o
+COBJS-$(CONFIG_PHY_BROADCOM) += broadcom.o
+COBJS-$(CONFIG_PHY_DAVICOM) += davicom.o
+COBJS-$(CONFIG_PHY_LXT) += lxt.o
+COBJS-$(CONFIG_PHY_MARVELL) += marvell.o
+COBJS-$(CONFIG_PHY_MICREL) += micrel.o
+COBJS-$(CONFIG_PHY_NATSEMI) += natsemi.o
+COBJS-$(CONFIG_PHY_REALTEK) += realtek.o
+COBJS-$(CONFIG_PHY_TERANETICS) += teranetics.o
+COBJS-$(CONFIG_PHY_VITESSE) += vitesse.o
+
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c
new file mode 100644 (file)
index 0000000..798473d
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Atheros PHY drivers
+ *
+ * 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
+ *
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#include <phy.h>
+
+static int ar8021_config(struct phy_device *phydev)
+{
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05);
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x3D47);
+
+       return 0;
+}
+
+struct phy_driver AR8021_driver =  {
+       .name = "AR8021",
+       .uid = 0x4dd040,
+       .mask = 0xfffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = ar8021_config,
+       .startup = genphy_startup,
+       .shutdown = genphy_shutdown,
+};
+
+int phy_atheros_init(void)
+{
+       phy_register(&AR8021_driver);
+
+       return 0;
+}
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
new file mode 100644 (file)
index 0000000..427ac60
--- /dev/null
@@ -0,0 +1,288 @@
+/*
+ * Broadcom PHY drivers
+ *
+ * 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
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#include <config.h>
+#include <common.h>
+#include <phy.h>
+
+/* Broadcom BCM54xx -- taken from linux sungem_phy */
+#define MIIM_BCM54xx_AUXCNTL                   0x18
+#define MIIM_BCM54xx_AUXCNTL_ENCODE(val) (((val & 0x7) << 12)|(val & 0x7))
+#define MIIM_BCM54xx_AUXSTATUS                 0x19
+#define MIIM_BCM54xx_AUXSTATUS_LINKMODE_MASK   0x0700
+#define MIIM_BCM54xx_AUXSTATUS_LINKMODE_SHIFT  8
+
+#define MIIM_BCM54XX_SHD                       0x1c
+#define MIIM_BCM54XX_SHD_WRITE                 0x8000
+#define MIIM_BCM54XX_SHD_VAL(x)                        ((x & 0x1f) << 10)
+#define MIIM_BCM54XX_SHD_DATA(x)               ((x & 0x3ff) << 0)
+#define MIIM_BCM54XX_SHD_WR_ENCODE(val, data)  \
+       (MIIM_BCM54XX_SHD_WRITE | MIIM_BCM54XX_SHD_VAL(val) | \
+        MIIM_BCM54XX_SHD_DATA(data))
+
+#define MIIM_BCM54XX_EXP_DATA          0x15    /* Expansion register data */
+#define MIIM_BCM54XX_EXP_SEL           0x17    /* Expansion register select */
+#define MIIM_BCM54XX_EXP_SEL_SSD       0x0e00  /* Secondary SerDes select */
+#define MIIM_BCM54XX_EXP_SEL_ER                0x0f00  /* Expansion register select */
+
+/* Broadcom BCM5461S */
+static int bcm5461_config(struct phy_device *phydev)
+{
+       genphy_config_aneg(phydev);
+
+       phy_reset(phydev);
+
+       return 0;
+}
+
+static int bcm54xx_parse_status(struct phy_device *phydev)
+{
+       unsigned int mii_reg;
+
+       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_BCM54xx_AUXSTATUS);
+
+       switch ((mii_reg & MIIM_BCM54xx_AUXSTATUS_LINKMODE_MASK) >>
+                       MIIM_BCM54xx_AUXSTATUS_LINKMODE_SHIFT) {
+       case 1:
+               phydev->duplex = DUPLEX_HALF;
+               phydev->speed = SPEED_10;
+               break;
+       case 2:
+               phydev->duplex = DUPLEX_FULL;
+               phydev->speed = SPEED_10;
+               break;
+       case 3:
+               phydev->duplex = DUPLEX_HALF;
+               phydev->speed = SPEED_100;
+               break;
+       case 5:
+               phydev->duplex = DUPLEX_FULL;
+               phydev->speed = SPEED_100;
+               break;
+       case 6:
+               phydev->duplex = DUPLEX_HALF;
+               phydev->speed = SPEED_1000;
+               break;
+       case 7:
+               phydev->duplex = DUPLEX_FULL;
+               phydev->speed = SPEED_1000;
+               break;
+       default:
+               printf("Auto-neg error, defaulting to 10BT/HD\n");
+               phydev->duplex = DUPLEX_HALF;
+               phydev->speed = SPEED_10;
+               break;
+       }
+
+       return 0;
+}
+
+static int bcm54xx_startup(struct phy_device *phydev)
+{
+       /* Read the Status (2x to make sure link is right) */
+       genphy_update_link(phydev);
+       bcm54xx_parse_status(phydev);
+
+       return 0;
+}
+
+/* Broadcom BCM5482S */
+/*
+ * "Ethernet@Wirespeed" needs to be enabled to achieve link in certain
+ * circumstances.  eg a gigabit TSEC connected to a gigabit switch with
+ * a 4-wire ethernet cable.  Both ends advertise gigabit, but can't
+ * link.  "Ethernet@Wirespeed" reduces advertised speed until link
+ * can be achieved.
+ */
+static u32 bcm5482_read_wirespeed(struct phy_device *phydev, u32 reg)
+{
+       return (phy_read(phydev, MDIO_DEVAD_NONE, reg) & 0x8FFF) | 0x8010;
+}
+
+static int bcm5482_config(struct phy_device *phydev)
+{
+       unsigned int reg;
+
+       /* reset the PHY */
+       reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR);
+       reg |= BMCR_RESET;
+       phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, reg);
+
+       /* Setup read from auxilary control shadow register 7 */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_BCM54xx_AUXCNTL,
+                       MIIM_BCM54xx_AUXCNTL_ENCODE(7));
+       /* Read Misc Control register and or in Ethernet@Wirespeed */
+       reg = bcm5482_read_wirespeed(phydev, MIIM_BCM54xx_AUXCNTL);
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_BCM54xx_AUXCNTL, reg);
+
+       /* Initial config/enable of secondary SerDes interface */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_BCM54XX_SHD,
+                       MIIM_BCM54XX_SHD_WR_ENCODE(0x14, 0xf));
+       /* Write intial value to secondary SerDes Contol */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_BCM54XX_EXP_SEL,
+                       MIIM_BCM54XX_EXP_SEL_SSD | 0);
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_BCM54XX_EXP_DATA,
+                       BMCR_ANRESTART);
+       /* Enable copper/fiber auto-detect */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_BCM54XX_SHD,
+                       MIIM_BCM54XX_SHD_WR_ENCODE(0x1e, 0x201));
+
+       genphy_config_aneg(phydev);
+
+       return 0;
+}
+
+/*
+ * Find out if PHY is in copper or serdes mode by looking at Expansion Reg
+ * 0x42 - "Operating Mode Status Register"
+ */
+static int bcm5482_is_serdes(struct phy_device *phydev)
+{
+       u16 val;
+       int serdes = 0;
+
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_BCM54XX_EXP_SEL,
+                       MIIM_BCM54XX_EXP_SEL_ER | 0x42);
+       val = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_BCM54XX_EXP_DATA);
+
+       switch (val & 0x1f) {
+       case 0x0d:      /* RGMII-to-100Base-FX */
+       case 0x0e:      /* RGMII-to-SGMII */
+       case 0x0f:      /* RGMII-to-SerDes */
+       case 0x12:      /* SGMII-to-SerDes */
+       case 0x13:      /* SGMII-to-100Base-FX */
+       case 0x16:      /* SerDes-to-Serdes */
+               serdes = 1;
+               break;
+       case 0x6:       /* RGMII-to-Copper */
+       case 0x14:      /* SGMII-to-Copper */
+       case 0x17:      /* SerDes-to-Copper */
+               break;
+       default:
+               printf("ERROR, invalid PHY mode (0x%x\n)", val);
+               break;
+       }
+
+       return serdes;
+}
+
+/*
+ * Determine SerDes link speed and duplex from Expansion reg 0x42 "Operating
+ * Mode Status Register"
+ */
+static u32 bcm5482_parse_serdes_sr(struct phy_device *phydev)
+{
+       u16 val;
+       int i = 0;
+
+       /* Wait 1s for link - Clause 37 autonegotiation happens very fast */
+       while (1) {
+               phy_write(phydev, MDIO_DEVAD_NONE, MIIM_BCM54XX_EXP_SEL,
+                               MIIM_BCM54XX_EXP_SEL_ER | 0x42);
+               val = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_BCM54XX_EXP_DATA);
+
+               if (val & 0x8000)
+                       break;
+
+               if (i++ > 1000) {
+                       phydev->link = 0;
+                       return 1;
+               }
+
+               udelay(1000);   /* 1 ms */
+       }
+
+       phydev->link = 1;
+       switch ((val >> 13) & 0x3) {
+       case (0x00):
+               phydev->speed = 10;
+               break;
+       case (0x01):
+               phydev->speed = 100;
+               break;
+       case (0x02):
+               phydev->speed = 1000;
+               break;
+       }
+
+       phydev->duplex = (val & 0x1000) == 0x1000;
+
+       return 0;
+}
+
+/*
+ * Figure out if BCM5482 is in serdes or copper mode and determine link
+ * configuration accordingly
+ */
+static int bcm5482_startup(struct phy_device *phydev)
+{
+       if (bcm5482_is_serdes(phydev)) {
+               bcm5482_parse_serdes_sr(phydev);
+               phydev->port = PORT_FIBRE;
+       } else {
+               /* Wait for auto-negotiation to complete or fail */
+               genphy_update_link(phydev);
+               /* Parse BCM54xx copper aux status register */
+               bcm54xx_parse_status(phydev);
+       }
+
+       return 0;
+}
+
+static struct phy_driver BCM5461S_driver = {
+       .name = "Broadcom BCM5461S",
+       .uid = 0x2060c0,
+       .mask = 0xfffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &bcm5461_config,
+       .startup = &bcm54xx_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver BCM5464S_driver = {
+       .name = "Broadcom BCM5464S",
+       .uid = 0x2060b0,
+       .mask = 0xfffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &bcm5461_config,
+       .startup = &bcm54xx_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver BCM5482S_driver = {
+       .name = "Broadcom BCM5482S",
+       .uid = 0x143bcb0,
+       .mask = 0xffffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &bcm5482_config,
+       .startup = &bcm5482_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+int phy_broadcom_init(void)
+{
+       phy_register(&BCM5482S_driver);
+       phy_register(&BCM5464S_driver);
+       phy_register(&BCM5461S_driver);
+
+       return 0;
+}
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
new file mode 100644 (file)
index 0000000..e96a4af
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Davicom PHY drivers
+ *
+ * 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
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#include <phy.h>
+
+#define MIIM_DM9161_SCR                0x10
+#define MIIM_DM9161_SCR_INIT   0x0610
+
+/* DM9161 Specified Configuration and Status Register */
+#define MIIM_DM9161_SCSR       0x11
+#define MIIM_DM9161_SCSR_100F  0x8000
+#define MIIM_DM9161_SCSR_100H  0x4000
+#define MIIM_DM9161_SCSR_10F   0x2000
+#define MIIM_DM9161_SCSR_10H   0x1000
+
+/* DM9161 10BT Configuration/Status */
+#define MIIM_DM9161_10BTCSR    0x12
+#define MIIM_DM9161_10BTCSR_INIT       0x7800
+
+
+/* Davicom DM9161E */
+static int dm9161_config(struct phy_device *phydev)
+{
+       phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_ISOLATE);
+       /* Do not bypass the scrambler/descrambler */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_DM9161_SCR,
+                       MIIM_DM9161_SCR_INIT);
+       /* Clear 10BTCSR to default */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_DM9161_10BTCSR,
+                       MIIM_DM9161_10BTCSR_INIT);
+
+       genphy_config_aneg(phydev);
+
+       return 0;
+}
+
+static int dm9161_parse_status(struct phy_device *phydev)
+{
+       int mii_reg;
+
+       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_DM9161_SCSR);
+
+       if (mii_reg & (MIIM_DM9161_SCSR_100F | MIIM_DM9161_SCSR_100H))
+               phydev->speed = SPEED_100;
+       else
+               phydev->speed = SPEED_10;
+
+       if (mii_reg & (MIIM_DM9161_SCSR_100F | MIIM_DM9161_SCSR_10F))
+               phydev->duplex = DUPLEX_FULL;
+       else
+               phydev->duplex = DUPLEX_HALF;
+
+       return 0;
+}
+
+static int dm9161_startup(struct phy_device *phydev)
+{
+       genphy_update_link(phydev);
+       dm9161_parse_status(phydev);
+
+       return 0;
+}
+
+static struct phy_driver DM9161_driver = {
+       .name = "Davicom DM9161E",
+       .uid = 0x181b880,
+       .mask = 0xffffff0,
+       .features = PHY_BASIC_FEATURES,
+       .config = &dm9161_config,
+       .startup = &dm9161_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+int phy_davicom_init(void)
+{
+       phy_register(&DM9161_driver);
+
+       return 0;
+}
diff --git a/drivers/net/phy/generic_10g.c b/drivers/net/phy/generic_10g.c
new file mode 100644 (file)
index 0000000..315c508
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Generic PHY Management code
+ *
+ * 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
+ *
+ *
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ * Based loosely off of Linux's PHY Lib
+ */
+
+#include <config.h>
+#include <common.h>
+#include <miiphy.h>
+#include <phy.h>
+
+int gen10g_shutdown(struct phy_device *phydev)
+{
+       return 0;
+}
+
+int gen10g_startup(struct phy_device *phydev)
+{
+       int devad, reg;
+       u32 mmd_mask = phydev->mmds;
+
+       phydev->link = 1;
+
+       /* For now just lie and say it's 10G all the time */
+       phydev->speed = SPEED_10000;
+       phydev->duplex = DUPLEX_FULL;
+
+       for (devad = 0; mmd_mask; devad++, mmd_mask = mmd_mask >> 1) {
+               if (!mmd_mask & 1)
+                       continue;
+
+               /* Read twice because link state is latched and a
+                * read moves the current state into the register */
+               phy_read(phydev, devad, MDIO_STAT1);
+               reg = phy_read(phydev, devad, MDIO_STAT1);
+               if (reg < 0 || !(reg & MDIO_STAT1_LSTATUS))
+                       phydev->link = 0;
+       }
+
+       return 0;
+}
+
+int gen10g_discover_mmds(struct phy_device *phydev)
+{
+       int mmd, stat2, devs1, devs2;
+
+       /* Assume PHY must have at least one of PMA/PMD, WIS, PCS, PHY
+        * XS or DTE XS; give up if none is present. */
+       for (mmd = 1; mmd <= 5; mmd++) {
+               /* Is this MMD present? */
+               stat2 = phy_read(phydev, mmd, MDIO_STAT2);
+               if (stat2 < 0 ||
+                       (stat2 & MDIO_STAT2_DEVPRST) != MDIO_STAT2_DEVPRST_VAL)
+                       continue;
+
+               /* It should tell us about all the other MMDs */
+               devs1 = phy_read(phydev, mmd, MDIO_DEVS1);
+               devs2 = phy_read(phydev, mmd, MDIO_DEVS2);
+               if (devs1 < 0 || devs2 < 0)
+                       continue;
+
+               phydev->mmds = devs1 | (devs2 << 16);
+               return 0;
+       }
+
+       return 0;
+}
+
+int gen10g_config(struct phy_device *phydev)
+{
+       /* For now, assume 10000baseT. Fill in later */
+       phydev->supported = phydev->advertising = SUPPORTED_10000baseT_Full;
+
+       return gen10g_discover_mmds(phydev);
+}
+
+struct phy_driver gen10g_driver = {
+       .uid            = 0xffffffff,
+       .mask           = 0xffffffff,
+       .name           = "Generic 10G PHY",
+       .features       = 0,
+       .config         = gen10g_config,
+       .startup        = gen10g_startup,
+       .shutdown       = gen10g_shutdown,
+};
+
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
new file mode 100644 (file)
index 0000000..d67bbdd
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * LXT PHY drivers
+ *
+ * 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
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#include <phy.h>
+
+/* LXT971 Status 2 registers */
+#define MIIM_LXT971_SR2                     0x11  /* Status Register 2  */
+#define MIIM_LXT971_SR2_SPEED_MASK 0x4200
+#define MIIM_LXT971_SR2_10HDX     0x0000  /*  10 Mbit half duplex selected */
+#define MIIM_LXT971_SR2_10FDX     0x0200  /*  10 Mbit full duplex selected */
+#define MIIM_LXT971_SR2_100HDX    0x4000  /* 100 Mbit half duplex selected */
+#define MIIM_LXT971_SR2_100FDX    0x4200  /* 100 Mbit full duplex selected */
+
+
+/* LXT971 */
+static int lxt971_parse_status(struct phy_device *phydev)
+{
+       int mii_reg;
+       int speed;
+
+       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_LXT971_SR2);
+       speed = mii_reg & MIIM_LXT971_SR2_SPEED_MASK;
+
+       switch (speed) {
+       case MIIM_LXT971_SR2_10HDX:
+               phydev->speed = SPEED_10;
+               phydev->duplex = DUPLEX_HALF;
+               break;
+       case MIIM_LXT971_SR2_10FDX:
+               phydev->speed = SPEED_10;
+               phydev->duplex = DUPLEX_FULL;
+               break;
+       case MIIM_LXT971_SR2_100HDX:
+               phydev->speed = SPEED_100;
+               phydev->duplex = DUPLEX_HALF;
+               break;
+       default:
+               phydev->speed = SPEED_100;
+               phydev->duplex = DUPLEX_FULL;
+       }
+
+       return 0;
+}
+
+static int lxt971_startup(struct phy_device *phydev)
+{
+       genphy_update_link(phydev);
+       lxt971_parse_status(phydev);
+
+       return 0;
+}
+
+static struct phy_driver LXT971_driver = {
+       .name = "LXT971",
+       .uid = 0x1378e0,
+       .mask = 0xfffff0,
+       .features = PHY_BASIC_FEATURES,
+       .config = &genphy_config_aneg,
+       .startup = &lxt971_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+int phy_lxt_init(void)
+{
+       phy_register(&LXT971_driver);
+
+       return 0;
+}
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
new file mode 100644 (file)
index 0000000..bd1cdc4
--- /dev/null
@@ -0,0 +1,367 @@
+/*
+ * Marvell PHY drivers
+ *
+ * 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
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#include <config.h>
+#include <common.h>
+#include <phy.h>
+
+#define PHY_AUTONEGOTIATE_TIMEOUT 5000
+
+/* 88E1011 PHY Status Register */
+#define MIIM_88E1xxx_PHY_STATUS                0x11
+#define MIIM_88E1xxx_PHYSTAT_SPEED     0xc000
+#define MIIM_88E1xxx_PHYSTAT_GBIT      0x8000
+#define MIIM_88E1xxx_PHYSTAT_100       0x4000
+#define MIIM_88E1xxx_PHYSTAT_DUPLEX    0x2000
+#define MIIM_88E1xxx_PHYSTAT_SPDDONE   0x0800
+#define MIIM_88E1xxx_PHYSTAT_LINK      0x0400
+
+#define MIIM_88E1xxx_PHY_SCR           0x10
+#define MIIM_88E1xxx_PHY_MDI_X_AUTO    0x0060
+
+/* 88E1111 PHY LED Control Register */
+#define MIIM_88E1111_PHY_LED_CONTROL   24
+#define MIIM_88E1111_PHY_LED_DIRECT    0x4100
+#define MIIM_88E1111_PHY_LED_COMBINE   0x411C
+
+/* 88E1118 PHY defines */
+#define MIIM_88E1118_PHY_PAGE          22
+#define MIIM_88E1118_PHY_LED_PAGE      3
+
+/* 88E1121 PHY LED Control Register */
+#define MIIM_88E1121_PHY_LED_CTRL      16
+#define MIIM_88E1121_PHY_LED_PAGE      3
+#define MIIM_88E1121_PHY_LED_DEF       0x0030
+
+/* 88E1121 PHY IRQ Enable/Status Register */
+#define MIIM_88E1121_PHY_IRQ_EN                18
+#define MIIM_88E1121_PHY_IRQ_STATUS    19
+
+#define MIIM_88E1121_PHY_PAGE          22
+
+/* 88E1145 Extended PHY Specific Control Register */
+#define MIIM_88E1145_PHY_EXT_CR 20
+#define MIIM_M88E1145_RGMII_RX_DELAY   0x0080
+#define MIIM_M88E1145_RGMII_TX_DELAY   0x0002
+
+#define MIIM_88E1145_PHY_LED_CONTROL   24
+#define MIIM_88E1145_PHY_LED_DIRECT    0x4100
+
+#define MIIM_88E1145_PHY_PAGE  29
+#define MIIM_88E1145_PHY_CAL_OV 30
+
+#define MIIM_88E1149_PHY_PAGE  29
+
+/* Marvell 88E1011S */
+static int m88e1011s_config(struct phy_device *phydev)
+{
+       /* Reset and configure the PHY */
+       phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET);
+
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x1f);
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x200c);
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x5);
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0);
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100);
+
+       phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET);
+
+       genphy_config_aneg(phydev);
+
+       return 0;
+}
+
+/* Parse the 88E1011's status register for speed and duplex
+ * information
+ */
+static uint m88e1xxx_parse_status(struct phy_device *phydev)
+{
+       unsigned int speed;
+       unsigned int mii_reg;
+
+       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_88E1xxx_PHY_STATUS);
+
+       if ((mii_reg & MIIM_88E1xxx_PHYSTAT_LINK) &&
+               !(mii_reg & MIIM_88E1xxx_PHYSTAT_SPDDONE)) {
+               int i = 0;
+
+               puts("Waiting for PHY realtime link");
+               while (!(mii_reg & MIIM_88E1xxx_PHYSTAT_SPDDONE)) {
+                       /* Timeout reached ? */
+                       if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
+                               puts(" TIMEOUT !\n");
+                               phydev->link = 0;
+                               break;
+                       }
+
+                       if ((i++ % 1000) == 0)
+                               putc('.');
+                       udelay(1000);
+                       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE,
+                                       MIIM_88E1xxx_PHY_STATUS);
+               }
+               puts(" done\n");
+               udelay(500000); /* another 500 ms (results in faster booting) */
+       } else {
+               if (mii_reg & MIIM_88E1xxx_PHYSTAT_LINK)
+                       phydev->link = 1;
+               else
+                       phydev->link = 0;
+       }
+
+       if (mii_reg & MIIM_88E1xxx_PHYSTAT_DUPLEX)
+               phydev->duplex = DUPLEX_FULL;
+       else
+               phydev->duplex = DUPLEX_HALF;
+
+       speed = mii_reg & MIIM_88E1xxx_PHYSTAT_SPEED;
+
+       switch (speed) {
+       case MIIM_88E1xxx_PHYSTAT_GBIT:
+               phydev->speed = SPEED_1000;
+               break;
+       case MIIM_88E1xxx_PHYSTAT_100:
+               phydev->speed = SPEED_100;
+               break;
+       default:
+               phydev->speed = SPEED_10;
+               break;
+       }
+
+       return 0;
+}
+
+static int m88e1011s_startup(struct phy_device *phydev)
+{
+       genphy_update_link(phydev);
+       m88e1xxx_parse_status(phydev);
+
+       return 0;
+}
+
+/* Marvell 88E1111S */
+static int m88e1111s_config(struct phy_device *phydev)
+{
+       int reg;
+
+       if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
+                       (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
+                       (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
+                       (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
+               reg = phy_read(phydev, MDIO_DEVAD_NONE, 0x1b);
+               reg = (reg & 0xfff0) | 0xb;
+               phy_write(phydev, MDIO_DEVAD_NONE, 0x1b, reg);
+       } else {
+               phy_write(phydev, MDIO_DEVAD_NONE, 0x1b, 0x1f);
+       }
+
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x14, 0x0cd2);
+
+       genphy_config_aneg(phydev);
+
+       phy_reset(phydev);
+
+       return 0;
+}
+
+/* Marvell 88E1118 */
+static int m88e1118_config(struct phy_device *phydev)
+{
+       /* Change Page Number */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1118_PHY_PAGE, 0x0002);
+       /* Delay RGMII TX and RX */
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x15, 0x1070);
+       /* Change Page Number */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1118_PHY_PAGE, 0x0003);
+       /* Adjust LED control */
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x10, 0x021e);
+       /* Change Page Number */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1118_PHY_PAGE, 0x0000);
+
+       genphy_config_aneg(phydev);
+
+       phy_reset(phydev);
+
+       return 0;
+}
+
+static int m88e1118_startup(struct phy_device *phydev)
+{
+       /* Change Page Number */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1118_PHY_PAGE, 0x0000);
+
+       genphy_update_link(phydev);
+       m88e1xxx_parse_status(phydev);
+
+       return 0;
+}
+
+/* Marvell 88E1121R */
+static int m88e1121_config(struct phy_device *phydev)
+{
+       int pg;
+
+       /* Configure the PHY */
+       genphy_config_aneg(phydev);
+
+       /* Switch the page to access the led register */
+       pg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_88E1121_PHY_PAGE);
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1121_PHY_PAGE,
+                       MIIM_88E1121_PHY_LED_PAGE);
+       /* Configure leds */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1121_PHY_LED_CTRL,
+                       MIIM_88E1121_PHY_LED_DEF);
+       /* Restore the page pointer */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1121_PHY_PAGE, pg);
+
+       /* Disable IRQs and de-assert interrupt */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1121_PHY_IRQ_EN, 0);
+       phy_read(phydev, MDIO_DEVAD_NONE, MIIM_88E1121_PHY_IRQ_STATUS);
+
+       return 0;
+}
+
+/* Marvell 88E1145 */
+static int m88e1145_config(struct phy_device *phydev)
+{
+       int reg;
+
+       /* Errata E0, E1 */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1145_PHY_PAGE, 0x001b);
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1145_PHY_CAL_OV, 0x418f);
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1145_PHY_PAGE, 0x0016);
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1145_PHY_CAL_OV, 0xa2da);
+
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1xxx_PHY_SCR,
+                       MIIM_88E1xxx_PHY_MDI_X_AUTO);
+
+       reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_88E1145_PHY_EXT_CR);
+       if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+               reg |= MIIM_M88E1145_RGMII_RX_DELAY |
+                       MIIM_M88E1145_RGMII_TX_DELAY;
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1145_PHY_EXT_CR, reg);
+
+       genphy_config_aneg(phydev);
+
+       phy_reset(phydev);
+
+       return 0;
+}
+
+static int m88e1145_startup(struct phy_device *phydev)
+{
+       genphy_update_link(phydev);
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1145_PHY_LED_CONTROL,
+                       MIIM_88E1145_PHY_LED_DIRECT);
+       m88e1xxx_parse_status(phydev);
+
+       return 0;
+}
+
+/* Marvell 88E1149S */
+static int m88e1149_config(struct phy_device *phydev)
+{
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1149_PHY_PAGE, 0x1f);
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x200c);
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1149_PHY_PAGE, 0x5);
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x0);
+       phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100);
+
+       genphy_config_aneg(phydev);
+
+       phy_reset(phydev);
+
+       return 0;
+}
+
+
+static struct phy_driver M88E1011S_driver = {
+       .name = "Marvell 88E1011S",
+       .uid = 0x1410c60,
+       .mask = 0xffffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &m88e1011s_config,
+       .startup = &m88e1011s_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver M88E1111S_driver = {
+       .name = "Marvell 88E1111S",
+       .uid = 0x1410cc0,
+       .mask = 0xffffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &m88e1111s_config,
+       .startup = &m88e1011s_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver M88E1118_driver = {
+       .name = "Marvell 88E1118",
+       .uid = 0x1410e10,
+       .mask = 0xffffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &m88e1118_config,
+       .startup = &m88e1118_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver M88E1121R_driver = {
+       .name = "Marvell 88E1121R",
+       .uid = 0x1410cb0,
+       .mask = 0xffffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &m88e1121_config,
+       .startup = &genphy_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver M88E1145_driver = {
+       .name = "Marvell 88E1145",
+       .uid = 0x1410cd0,
+       .mask = 0xffffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &m88e1145_config,
+       .startup = &m88e1145_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver M88E1149S_driver = {
+       .name = "Marvell 88E1149S",
+       .uid = 0x1410ca0,
+       .mask = 0xffffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &m88e1149_config,
+       .startup = &m88e1011s_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+int phy_marvell_init(void)
+{
+       phy_register(&M88E1149S_driver);
+       phy_register(&M88E1145_driver);
+       phy_register(&M88E1121R_driver);
+       phy_register(&M88E1118_driver);
+       phy_register(&M88E1111S_driver);
+       phy_register(&M88E1011S_driver);
+
+       return 0;
+}
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
new file mode 100644 (file)
index 0000000..47064a1
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Micrel PHY drivers
+ *
+ * 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
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#include <phy.h>
+
+static struct phy_driver KSZ804_driver = {
+       .name = "Micrel KSZ804",
+       .uid = 0x221510,
+       .mask = 0xfffff0,
+       .features = PHY_BASIC_FEATURES,
+       .config = &genphy_config,
+       .startup = &genphy_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+int phy_micrel_init(void)
+{
+       phy_register(&KSZ804_driver);
+
+       return 0;
+}
diff --git a/drivers/net/phy/natsemi.c b/drivers/net/phy/natsemi.c
new file mode 100644 (file)
index 0000000..ea60ac1
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * National Semiconductor PHY drivers
+ *
+ * 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
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#include <phy.h>
+
+/* DP83865 Link and Auto-Neg Status Register */
+#define MIIM_DP83865_LANR      0x11
+#define MIIM_DP83865_SPD_MASK  0x0018
+#define MIIM_DP83865_SPD_1000  0x0010
+#define MIIM_DP83865_SPD_100   0x0008
+#define MIIM_DP83865_DPX_FULL  0x0002
+
+
+/* NatSemi DP83865 */
+static int dp83865_config(struct phy_device *phydev)
+{
+       phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET);
+       genphy_config_aneg(phydev);
+
+       return 0;
+}
+
+static int dp83865_parse_status(struct phy_device *phydev)
+{
+       int mii_reg;
+
+       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_DP83865_LANR);
+
+       switch (mii_reg & MIIM_DP83865_SPD_MASK) {
+
+       case MIIM_DP83865_SPD_1000:
+               phydev->speed = SPEED_1000;
+               break;
+
+       case MIIM_DP83865_SPD_100:
+               phydev->speed = SPEED_100;
+               break;
+
+       default:
+               phydev->speed = SPEED_10;
+               break;
+
+       }
+
+       if (mii_reg & MIIM_DP83865_DPX_FULL)
+               phydev->duplex = DUPLEX_FULL;
+       else
+               phydev->duplex = DUPLEX_HALF;
+
+       return 0;
+}
+
+static int dp83865_startup(struct phy_device *phydev)
+{
+       genphy_update_link(phydev);
+       dp83865_parse_status(phydev);
+
+       return 0;
+}
+
+
+static struct phy_driver DP83865_driver = {
+       .name = "NatSemi DP83865",
+       .uid = 0x20005c70,
+       .mask = 0xfffffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &dp83865_config,
+       .startup = &dp83865_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+int phy_natsemi_init(void)
+{
+       phy_register(&DP83865_driver);
+
+       return 0;
+}
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
new file mode 100644 (file)
index 0000000..c7edcc0
--- /dev/null
@@ -0,0 +1,755 @@
+/*
+ * Generic PHY Management code
+ *
+ * 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
+ *
+ *
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ * Based loosely off of Linux's PHY Lib
+ */
+
+#include <config.h>
+#include <common.h>
+#include <malloc.h>
+#include <net.h>
+#include <command.h>
+#include <miiphy.h>
+#include <phy.h>
+#include <errno.h>
+
+/* Generic PHY support and helper functions */
+
+/**
+ * genphy_config_advert - sanitize and advertise auto-negotation parameters
+ * @phydev: target phy_device struct
+ *
+ * Description: Writes MII_ADVERTISE with the appropriate values,
+ *   after sanitizing the values to make sure we only advertise
+ *   what is supported.  Returns < 0 on error, 0 if the PHY's advertisement
+ *   hasn't changed, and > 0 if it has changed.
+ */
+int genphy_config_advert(struct phy_device *phydev)
+{
+       u32 advertise;
+       int oldadv, adv;
+       int err, changed = 0;
+
+       /* Only allow advertising what
+        * this PHY supports */
+       phydev->advertising &= phydev->supported;
+       advertise = phydev->advertising;
+
+       /* Setup standard advertisement */
+       oldadv = adv = phy_read(phydev, MDIO_DEVAD_NONE, MII_ADVERTISE);
+
+       if (adv < 0)
+               return adv;
+
+       adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4 | ADVERTISE_PAUSE_CAP |
+                ADVERTISE_PAUSE_ASYM);
+       if (advertise & ADVERTISED_10baseT_Half)
+               adv |= ADVERTISE_10HALF;
+       if (advertise & ADVERTISED_10baseT_Full)
+               adv |= ADVERTISE_10FULL;
+       if (advertise & ADVERTISED_100baseT_Half)
+               adv |= ADVERTISE_100HALF;
+       if (advertise & ADVERTISED_100baseT_Full)
+               adv |= ADVERTISE_100FULL;
+       if (advertise & ADVERTISED_Pause)
+               adv |= ADVERTISE_PAUSE_CAP;
+       if (advertise & ADVERTISED_Asym_Pause)
+               adv |= ADVERTISE_PAUSE_ASYM;
+
+       if (adv != oldadv) {
+               err = phy_write(phydev, MDIO_DEVAD_NONE, MII_ADVERTISE, adv);
+
+               if (err < 0)
+                       return err;
+               changed = 1;
+       }
+
+       /* Configure gigabit if it's supported */
+       if (phydev->supported & (SUPPORTED_1000baseT_Half |
+                               SUPPORTED_1000baseT_Full)) {
+               oldadv = adv = phy_read(phydev, MDIO_DEVAD_NONE, MII_CTRL1000);
+
+               if (adv < 0)
+                       return adv;
+
+               adv &= ~(ADVERTISE_1000FULL | ADVERTISE_1000HALF);
+               if (advertise & SUPPORTED_1000baseT_Half)
+                       adv |= ADVERTISE_1000HALF;
+               if (advertise & SUPPORTED_1000baseT_Full)
+                       adv |= ADVERTISE_1000FULL;
+
+               if (adv != oldadv) {
+                       err = phy_write(phydev, MDIO_DEVAD_NONE, MII_CTRL1000,
+                                       adv);
+
+                       if (err < 0)
+                               return err;
+                       changed = 1;
+               }
+       }
+
+       return changed;
+}
+
+
+/**
+ * genphy_setup_forced - configures/forces speed/duplex from @phydev
+ * @phydev: target phy_device struct
+ *
+ * Description: Configures MII_BMCR to force speed/duplex
+ *   to the values in phydev. Assumes that the values are valid.
+ */
+int genphy_setup_forced(struct phy_device *phydev)
+{
+       int err;
+       int ctl = 0;
+
+       phydev->pause = phydev->asym_pause = 0;
+
+       if (SPEED_1000 == phydev->speed)
+               ctl |= BMCR_SPEED1000;
+       else if (SPEED_100 == phydev->speed)
+               ctl |= BMCR_SPEED100;
+
+       if (DUPLEX_FULL == phydev->duplex)
+               ctl |= BMCR_FULLDPLX;
+
+       err = phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, ctl);
+
+       return err;
+}
+
+
+/**
+ * genphy_restart_aneg - Enable and Restart Autonegotiation
+ * @phydev: target phy_device struct
+ */
+int genphy_restart_aneg(struct phy_device *phydev)
+{
+       int ctl;
+
+       ctl = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR);
+
+       if (ctl < 0)
+               return ctl;
+
+       ctl |= (BMCR_ANENABLE | BMCR_ANRESTART);
+
+       /* Don't isolate the PHY if we're negotiating */
+       ctl &= ~(BMCR_ISOLATE);
+
+       ctl = phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, ctl);
+
+       return ctl;
+}
+
+
+/**
+ * genphy_config_aneg - restart auto-negotiation or write BMCR
+ * @phydev: target phy_device struct
+ *
+ * Description: If auto-negotiation is enabled, we configure the
+ *   advertising, and then restart auto-negotiation.  If it is not
+ *   enabled, then we write the BMCR.
+ */
+int genphy_config_aneg(struct phy_device *phydev)
+{
+       int result;
+
+       if (AUTONEG_ENABLE != phydev->autoneg)
+               return genphy_setup_forced(phydev);
+
+       result = genphy_config_advert(phydev);
+
+       if (result < 0) /* error */
+               return result;
+
+       if (result == 0) {
+               /* Advertisment hasn't changed, but maybe aneg was never on to
+                * begin with?  Or maybe phy was isolated? */
+               int ctl = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR);
+
+               if (ctl < 0)
+                       return ctl;
+
+               if (!(ctl & BMCR_ANENABLE) || (ctl & BMCR_ISOLATE))
+                       result = 1; /* do restart aneg */
+       }
+
+       /* Only restart aneg if we are advertising something different
+        * than we were before.  */
+       if (result > 0)
+               result = genphy_restart_aneg(phydev);
+
+       return result;
+}
+
+/**
+ * genphy_update_link - update link status in @phydev
+ * @phydev: target phy_device struct
+ *
+ * Description: Update the value in phydev->link to reflect the
+ *   current link value.  In order to do this, we need to read
+ *   the status register twice, keeping the second value.
+ */
+int genphy_update_link(struct phy_device *phydev)
+{
+       unsigned int mii_reg;
+
+       /*
+        * Wait if the link is up, and autonegotiation is in progress
+        * (ie - we're capable and it's not done)
+        */
+       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);
+
+       /*
+        * If we already saw the link up, and it hasn't gone down, then
+        * we don't need to wait for autoneg again
+        */
+       if (phydev->link && mii_reg & BMSR_LSTATUS)
+               return 0;
+
+       if ((mii_reg & BMSR_ANEGCAPABLE) && !(mii_reg & BMSR_ANEGCOMPLETE)) {
+               int i = 0;
+
+               printf("%s Waiting for PHY auto negotiation to complete",
+                       phydev->dev->name);
+               while (!(mii_reg & BMSR_ANEGCOMPLETE)) {
+                       /*
+                        * Timeout reached ?
+                        */
+                       if (i > PHY_ANEG_TIMEOUT) {
+                               printf(" TIMEOUT !\n");
+                               phydev->link = 0;
+                               return 0;
+                       }
+
+                       if (ctrlc()) {
+                               puts("user interrupt!\n");
+                               phydev->link = 0;
+                               return -EINTR;
+                       }
+
+                       if ((i++ % 500) == 0)
+                               printf(".");
+
+                       udelay(1000);   /* 1 ms */
+                       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);
+               }
+               printf(" done\n");
+               phydev->link = 1;
+       } else {
+               /* Read the link a second time to clear the latched state */
+               mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);
+
+               if (mii_reg & BMSR_LSTATUS)
+                       phydev->link = 1;
+               else
+                       phydev->link = 0;
+       }
+
+       return 0;
+}
+
+/*
+ * Generic function which updates the speed and duplex.  If
+ * autonegotiation is enabled, it uses the AND of the link
+ * partner's advertised capabilities and our advertised
+ * capabilities.  If autonegotiation is disabled, we use the
+ * appropriate bits in the control register.
+ *
+ * Stolen from Linux's mii.c and phy_device.c
+ */
+static int genphy_parse_link(struct phy_device *phydev)
+{
+       int mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);
+
+       /* We're using autonegotiation */
+       if (mii_reg & BMSR_ANEGCAPABLE) {
+               u32 lpa = 0;
+               u32 gblpa = 0;
+
+               /* Check for gigabit capability */
+               if (mii_reg & BMSR_ERCAP) {
+                       /* We want a list of states supported by
+                        * both PHYs in the link
+                        */
+                       gblpa = phy_read(phydev, MDIO_DEVAD_NONE, MII_STAT1000);
+                       gblpa &= phy_read(phydev,
+                                       MDIO_DEVAD_NONE, MII_CTRL1000) << 2;
+               }
+
+               /* Set the baseline so we only have to set them
+                * if they're different
+                */
+               phydev->speed = SPEED_10;
+               phydev->duplex = DUPLEX_HALF;
+
+               /* Check the gigabit fields */
+               if (gblpa & (PHY_1000BTSR_1000FD | PHY_1000BTSR_1000HD)) {
+                       phydev->speed = SPEED_1000;
+
+                       if (gblpa & PHY_1000BTSR_1000FD)
+                               phydev->duplex = DUPLEX_FULL;
+
+                       /* We're done! */
+                       return 0;
+               }
+
+               lpa = phy_read(phydev, MDIO_DEVAD_NONE, MII_ADVERTISE);
+               lpa &= phy_read(phydev, MDIO_DEVAD_NONE, MII_LPA);
+
+               if (lpa & (LPA_100FULL | LPA_100HALF)) {
+                       phydev->speed = SPEED_100;
+
+                       if (lpa & LPA_100FULL)
+                               phydev->duplex = DUPLEX_FULL;
+
+               } else if (lpa & LPA_10FULL)
+                       phydev->duplex = DUPLEX_FULL;
+       } else {
+               u32 bmcr = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR);
+
+               phydev->speed = SPEED_10;
+               phydev->duplex = DUPLEX_HALF;
+
+               if (bmcr & BMCR_FULLDPLX)
+                       phydev->duplex = DUPLEX_FULL;
+
+               if (bmcr & BMCR_SPEED1000)
+                       phydev->speed = SPEED_1000;
+               else if (bmcr & BMCR_SPEED100)
+                       phydev->speed = SPEED_100;
+       }
+
+       return 0;
+}
+
+int genphy_config(struct phy_device *phydev)
+{
+       int val;
+       u32 features;
+
+       /* For now, I'll claim that the generic driver supports
+        * all possible port types */
+       features = (SUPPORTED_TP | SUPPORTED_MII
+                       | SUPPORTED_AUI | SUPPORTED_FIBRE |
+                       SUPPORTED_BNC);
+
+       /* Do we support autonegotiation? */
+       val = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);
+
+       if (val < 0)
+               return val;
+
+       if (val & BMSR_ANEGCAPABLE)
+               features |= SUPPORTED_Autoneg;
+
+       if (val & BMSR_100FULL)
+               features |= SUPPORTED_100baseT_Full;
+       if (val & BMSR_100HALF)
+               features |= SUPPORTED_100baseT_Half;
+       if (val & BMSR_10FULL)
+               features |= SUPPORTED_10baseT_Full;
+       if (val & BMSR_10HALF)
+               features |= SUPPORTED_10baseT_Half;
+
+       if (val & BMSR_ESTATEN) {
+               val = phy_read(phydev, MDIO_DEVAD_NONE, MII_ESTATUS);
+
+               if (val < 0)
+                       return val;
+
+               if (val & ESTATUS_1000_TFULL)
+                       features |= SUPPORTED_1000baseT_Full;
+               if (val & ESTATUS_1000_THALF)
+                       features |= SUPPORTED_1000baseT_Half;
+       }
+
+       phydev->supported = features;
+       phydev->advertising = features;
+
+       genphy_config_aneg(phydev);
+
+       return 0;
+}
+
+int genphy_startup(struct phy_device *phydev)
+{
+       genphy_update_link(phydev);
+       genphy_parse_link(phydev);
+
+       return 0;
+}
+
+int genphy_shutdown(struct phy_device *phydev)
+{
+       return 0;
+}
+
+static struct phy_driver genphy_driver = {
+       .uid            = 0xffffffff,
+       .mask           = 0xffffffff,
+       .name           = "Generic PHY",
+       .features       = 0,
+       .config         = genphy_config,
+       .startup        = genphy_startup,
+       .shutdown       = genphy_shutdown,
+};
+
+static LIST_HEAD(phy_drivers);
+
+int phy_init(void)
+{
+#ifdef CONFIG_PHY_ATHEROS
+       phy_atheros_init();
+#endif
+#ifdef CONFIG_PHY_BROADCOM
+       phy_broadcom_init();
+#endif
+#ifdef CONFIG_PHY_DAVICOM
+       phy_davicom_init();
+#endif
+#ifdef CONFIG_PHY_LXT
+       phy_lxt_init();
+#endif
+#ifdef CONFIG_PHY_MARVELL
+       phy_marvell_init();
+#endif
+#ifdef CONFIG_PHY_MICREL
+       phy_micrel_init();
+#endif
+#ifdef CONFIG_PHY_NATSEMI
+       phy_natsemi_init();
+#endif
+#ifdef CONFIG_PHY_REALTEK
+       phy_realtek_init();
+#endif
+#ifdef CONFIG_PHY_TERANETICS
+       phy_teranetics_init();
+#endif
+#ifdef CONFIG_PHY_VITESSE
+       phy_vitesse_init();
+#endif
+
+       return 0;
+}
+
+int phy_register(struct phy_driver *drv)
+{
+       INIT_LIST_HEAD(&drv->list);
+       list_add_tail(&drv->list, &phy_drivers);
+
+       return 0;
+}
+
+int phy_probe(struct phy_device *phydev)
+{
+       int err = 0;
+
+       phydev->advertising = phydev->supported = phydev->drv->features;
+       phydev->mmds = phydev->drv->mmds;
+
+       if (phydev->drv->probe)
+               err = phydev->drv->probe(phydev);
+
+       return err;
+}
+
+static struct phy_driver *generic_for_interface(phy_interface_t interface)
+{
+#ifdef CONFIG_PHYLIB_10G
+       if (is_10g_interface(interface))
+               return &gen10g_driver;
+#endif
+
+       return &genphy_driver;
+}
+
+struct phy_driver *get_phy_driver(struct phy_device *phydev,
+                               phy_interface_t interface)
+{
+       struct list_head *entry;
+       int phy_id = phydev->phy_id;
+       struct phy_driver *drv = NULL;
+
+       list_for_each(entry, &phy_drivers) {
+               drv = list_entry(entry, struct phy_driver, list);
+               if ((drv->uid & drv->mask) == (phy_id & drv->mask))
+                       return drv;
+       }
+
+       /* If we made it here, there's no driver for this PHY */
+       return generic_for_interface(interface);
+}
+
+struct phy_device *phy_device_create(struct mii_dev *bus, int addr, int phy_id,
+                                       phy_interface_t interface)
+{
+       struct phy_device *dev;
+
+       /* We allocate the device, and initialize the
+        * default values */
+       dev = malloc(sizeof(*dev));
+       if (!dev) {
+               printf("Failed to allocate PHY device for %s:%d\n",
+                       bus->name, addr);
+               return NULL;
+       }
+
+       memset(dev, 0, sizeof(*dev));
+
+       dev->duplex = -1;
+       dev->link = 1;
+       dev->interface = interface;
+
+       dev->autoneg = AUTONEG_ENABLE;
+
+       dev->addr = addr;
+       dev->phy_id = phy_id;
+       dev->bus = bus;
+
+       dev->drv = get_phy_driver(dev, interface);
+
+       phy_probe(dev);
+
+       bus->phymap[addr] = dev;
+
+       return dev;
+}
+
+/**
+ * get_phy_id - reads the specified addr for its ID.
+ * @bus: the target MII bus
+ * @addr: PHY address on the MII bus
+ * @phy_id: where to store the ID retrieved.
+ *
+ * Description: Reads the ID registers of the PHY at @addr on the
+ *   @bus, stores it in @phy_id and returns zero on success.
+ */
+int get_phy_id(struct mii_dev *bus, int addr, int devad, u32 *phy_id)
+{
+       int phy_reg;
+
+       /* Grab the bits from PHYIR1, and put them
+        * in the upper half */
+       phy_reg = bus->read(bus, addr, devad, MII_PHYSID1);
+
+       if (phy_reg < 0)
+               return -EIO;
+
+       *phy_id = (phy_reg & 0xffff) << 16;
+
+       /* Grab the bits from PHYIR2, and put them in the lower half */
+       phy_reg = bus->read(bus, addr, devad, MII_PHYSID2);
+
+       if (phy_reg < 0)
+               return -EIO;
+
+       *phy_id |= (phy_reg & 0xffff);
+
+       return 0;
+}
+
+/**
+ * get_phy_device - reads the specified PHY device and returns its @phy_device struct
+ * @bus: the target MII bus
+ * @addr: PHY address on the MII bus
+ *
+ * Description: Reads the ID registers of the PHY at @addr on the
+ *   @bus, then allocates and returns the phy_device to represent it.
+ */
+struct phy_device *get_phy_device(struct mii_dev *bus, int addr,
+                               phy_interface_t interface)
+{
+       u32 phy_id = 0x1fffffff;
+       int i;
+       int r;
+
+       /* If we have one, return the existing device, with new interface */
+       if (bus->phymap[addr]) {
+               bus->phymap[addr]->interface = interface;
+
+               return bus->phymap[addr];
+       }
+
+       /* Try Standard (ie Clause 22) access */
+       r = get_phy_id(bus, addr, MDIO_DEVAD_NONE, &phy_id);
+       if (r)
+               return NULL;
+
+       /* If the PHY ID is mostly f's, we didn't find anything */
+       if ((phy_id & 0x1fffffff) != 0x1fffffff)
+               return phy_device_create(bus, addr, phy_id, interface);
+
+       /* Otherwise we have to try Clause 45 */
+       for (i = 1; i < 5; i++) {
+               r = get_phy_id(bus, addr, i, &phy_id);
+               if (r)
+                       return NULL;
+
+               /* If the phy_id is mostly Fs, there is no device there */
+               if ((phy_id & 0x1fffffff) != 0x1fffffff)
+                       break;
+       }
+
+       return phy_device_create(bus, addr, phy_id, interface);
+}
+
+int phy_reset(struct phy_device *phydev)
+{
+       int reg;
+       int timeout = 500;
+       int devad = MDIO_DEVAD_NONE;
+
+#ifdef CONFIG_PHYLIB_10G
+       /* If it's 10G, we need to issue reset through one of the MMDs */
+       if (is_10g_interface(phydev->interface)) {
+               if (!phydev->mmds)
+                       gen10g_discover_mmds(phydev);
+
+               devad = ffs(phydev->mmds) - 1;
+       }
+#endif
+
+       reg = phy_read(phydev, devad, MII_BMCR);
+       if (reg < 0) {
+               debug("PHY status read failed\n");
+               return -1;
+       }
+
+       reg |= BMCR_RESET;
+
+       if (phy_write(phydev, devad, MII_BMCR, reg) < 0) {
+               debug("PHY reset failed\n");
+               return -1;
+       }
+
+#ifdef CONFIG_PHY_RESET_DELAY
+       udelay(CONFIG_PHY_RESET_DELAY); /* Intel LXT971A needs this */
+#endif
+       /*
+        * Poll the control register for the reset bit to go to 0 (it is
+        * auto-clearing).  This should happen within 0.5 seconds per the
+        * IEEE spec.
+        */
+       while ((reg & BMCR_RESET) && timeout--) {
+               reg = phy_read(phydev, devad, MII_BMCR);
+
+               if (reg < 0) {
+                       debug("PHY status read failed\n");
+                       return -1;
+               }
+               udelay(1000);
+       }
+
+       if (reg & BMCR_RESET) {
+               puts("PHY reset timed out\n");
+               return -1;
+       }
+
+       return 0;
+}
+
+int miiphy_reset(const char *devname, unsigned char addr)
+{
+       struct mii_dev *bus = miiphy_get_dev_by_name(devname);
+       struct phy_device *phydev;
+
+       /*
+        * miiphy_reset was only used on standard PHYs, so we'll fake it here.
+        * If later code tries to connect with the right interface, this will
+        * be corrected by get_phy_device in phy_connect()
+        */
+       phydev = get_phy_device(bus, addr, PHY_INTERFACE_MODE_MII);
+
+       return phy_reset(phydev);
+}
+
+struct phy_device *phy_connect(struct mii_dev *bus, int addr,
+                               struct eth_device *dev,
+                               phy_interface_t interface)
+{
+       struct phy_device *phydev;
+
+       /* Reset the bus */
+       bus->reset(bus);
+
+       /* Wait 15ms to make sure the PHY has come out of hard reset */
+       udelay(15000);
+
+       phydev = get_phy_device(bus, addr, interface);
+
+       if (!phydev) {
+               printf("Could not get PHY for %s:%d\n", bus->name, addr);
+
+               return NULL;
+       }
+
+       /* Soft Reset the PHY */
+       phy_reset(phydev);
+
+       if (phydev->dev)
+               printf("%s:%d is connected to %s.  Reconnecting to %s\n",
+                       bus->name, addr, phydev->dev->name, dev->name);
+
+       phydev->dev = dev;
+
+       printf("%s connected to %s\n", dev->name, phydev->drv->name);
+
+       return phydev;
+}
+
+int phy_startup(struct phy_device *phydev)
+{
+       if (phydev->drv->startup)
+               phydev->drv->startup(phydev);
+
+       return 0;
+}
+
+static int __board_phy_config(struct phy_device *phydev)
+{
+       return 0;
+}
+
+int board_phy_config(struct phy_device *phydev)
+       __attribute__((weak, alias("__board_phy_config")));
+
+int phy_config(struct phy_device *phydev)
+{
+       if (phydev->drv->config)
+               phydev->drv->config(phydev);
+
+       /* Invoke an optional board-specific helper */
+       board_phy_config(phydev);
+
+       return 0;
+}
+
+int phy_shutdown(struct phy_device *phydev)
+{
+       if (phydev->drv->shutdown)
+               phydev->drv->shutdown(phydev);
+
+       return 0;
+}
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
new file mode 100644 (file)
index 0000000..b7e2753
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * RealTek PHY drivers
+ *
+ * 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
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#include <config.h>
+#include <common.h>
+#include <phy.h>
+
+#define PHY_AUTONEGOTIATE_TIMEOUT 5000
+
+/* RTL8211B PHY Status Register */
+#define MIIM_RTL8211B_PHY_STATUS       0x11
+#define MIIM_RTL8211B_PHYSTAT_SPEED    0xc000
+#define MIIM_RTL8211B_PHYSTAT_GBIT     0x8000
+#define MIIM_RTL8211B_PHYSTAT_100      0x4000
+#define MIIM_RTL8211B_PHYSTAT_DUPLEX   0x2000
+#define MIIM_RTL8211B_PHYSTAT_SPDDONE  0x0800
+#define MIIM_RTL8211B_PHYSTAT_LINK     0x0400
+
+
+/* RealTek RTL8211B */
+static int rtl8211b_config(struct phy_device *phydev)
+{
+       phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET);
+
+       genphy_config_aneg(phydev);
+
+       return 0;
+}
+
+static int rtl8211b_parse_status(struct phy_device *phydev)
+{
+       unsigned int speed;
+       unsigned int mii_reg;
+
+       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211B_PHY_STATUS);
+
+       if (!(mii_reg & MIIM_RTL8211B_PHYSTAT_SPDDONE)) {
+               int i = 0;
+
+               /* in case of timeout ->link is cleared */
+               phydev->link = 1;
+               puts("Waiting for PHY realtime link");
+               while (!(mii_reg & MIIM_RTL8211B_PHYSTAT_SPDDONE)) {
+                       /* Timeout reached ? */
+                       if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
+                               puts(" TIMEOUT !\n");
+                               phydev->link = 0;
+                               break;
+                       }
+
+                       if ((i++ % 1000) == 0)
+                               putc('.');
+                       udelay(1000);   /* 1 ms */
+                       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE,
+                                       MIIM_RTL8211B_PHY_STATUS);
+               }
+               puts(" done\n");
+               udelay(500000); /* another 500 ms (results in faster booting) */
+       } else {
+               if (mii_reg & MIIM_RTL8211B_PHYSTAT_LINK)
+                       phydev->link = 1;
+               else
+                       phydev->link = 0;
+       }
+
+       if (mii_reg & MIIM_RTL8211B_PHYSTAT_DUPLEX)
+               phydev->duplex = DUPLEX_FULL;
+       else
+               phydev->duplex = DUPLEX_HALF;
+
+       speed = (mii_reg & MIIM_RTL8211B_PHYSTAT_SPEED);
+
+       switch (speed) {
+       case MIIM_RTL8211B_PHYSTAT_GBIT:
+               phydev->speed = SPEED_1000;
+               break;
+       case MIIM_RTL8211B_PHYSTAT_100:
+               phydev->speed = SPEED_100;
+               break;
+       default:
+               phydev->speed = SPEED_10;
+       }
+
+       return 0;
+}
+
+static int rtl8211b_startup(struct phy_device *phydev)
+{
+       /* Read the Status (2x to make sure link is right) */
+       genphy_update_link(phydev);
+       rtl8211b_parse_status(phydev);
+
+       return 0;
+}
+
+static struct phy_driver RTL8211B_driver = {
+       .name = "RealTek RTL8211B",
+       .uid = 0x1cc910,
+       .mask = 0xfffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &rtl8211b_config,
+       .startup = &rtl8211b_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+int phy_realtek_init(void)
+{
+       phy_register(&RTL8211B_driver);
+
+       return 0;
+}
diff --git a/drivers/net/phy/teranetics.c b/drivers/net/phy/teranetics.c
new file mode 100644 (file)
index 0000000..a771791
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Teranetics PHY drivers
+ *
+ * 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
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#include <config.h>
+#include <phy.h>
+
+#ifndef CONFIG_PHYLIB_10G
+#error The Teranetics PHY needs 10G support
+#endif
+
+int tn2020_config(struct phy_device *phydev)
+{
+       if (phydev->port == PORT_FIBRE) {
+               unsigned short restart_an = (MDIO_AN_CTRL1_RESTART |
+                                               MDIO_AN_CTRL1_ENABLE |
+                                               MDIO_AN_CTRL1_XNP);
+
+               phy_write(phydev, 30, 93, 2);
+               phy_write(phydev, MDIO_MMD_AN, MDIO_CTRL1, restart_an);
+       }
+
+       return 0;
+}
+
+struct phy_driver tn2020_driver = {
+       .name = "Teranetics TN2020",
+       .uid = 0x00a19410,
+       .mask = 0xfffffff0,
+       .features = PHY_10G_FEATURES,
+       .mmds = (MDIO_DEVS_PMAPMD | MDIO_DEVS_PCS |
+                       MDIO_DEVS_PHYXS | MDIO_DEVS_AN |
+                       MDIO_DEVS_VEND1 | MDIO_DEVS_VEND2),
+       .config = &tn2020_config,
+       .startup = &gen10g_startup,
+       .shutdown = &gen10g_shutdown,
+};
+
+int phy_teranetics_init(void)
+{
+       phy_register(&tn2020_driver);
+
+       return 0;
+}
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
new file mode 100644 (file)
index 0000000..d48d4fe
--- /dev/null
@@ -0,0 +1,242 @@
+/*
+ * Vitesse PHY drivers
+ *
+ * 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
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#include <miiphy.h>
+
+/* Cicada Auxiliary Control/Status Register */
+#define MIIM_CIS82xx_AUX_CONSTAT       0x1c
+#define MIIM_CIS82xx_AUXCONSTAT_INIT   0x0004
+#define MIIM_CIS82xx_AUXCONSTAT_DUPLEX 0x0020
+#define MIIM_CIS82xx_AUXCONSTAT_SPEED  0x0018
+#define MIIM_CIS82xx_AUXCONSTAT_GBIT   0x0010
+#define MIIM_CIS82xx_AUXCONSTAT_100    0x0008
+
+/* Cicada Extended Control Register 1 */
+#define MIIM_CIS82xx_EXT_CON1          0x17
+#define MIIM_CIS8201_EXTCON1_INIT      0x0000
+
+/* Cicada 8204 Extended PHY Control Register 1 */
+#define MIIM_CIS8204_EPHY_CON          0x17
+#define MIIM_CIS8204_EPHYCON_INIT      0x0006
+#define MIIM_CIS8204_EPHYCON_RGMII     0x1100
+
+/* Cicada 8204 Serial LED Control Register */
+#define MIIM_CIS8204_SLED_CON          0x1b
+#define MIIM_CIS8204_SLEDCON_INIT      0x1115
+
+/* Vitesse VSC8601 Extended PHY Control Register 1 */
+#define MIIM_VSC8601_EPHY_CON          0x17
+#define MIIM_VSC8601_EPHY_CON_INIT_SKEW        0x1120
+#define MIIM_VSC8601_SKEW_CTRL         0x1c
+
+#define PHY_EXT_PAGE_ACCESS    0x1f
+
+/* CIS8201 */
+static int vitesse_config(struct phy_device *phydev)
+{
+       /* Override PHY config settings */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_CIS82xx_AUX_CONSTAT,
+                       MIIM_CIS82xx_AUXCONSTAT_INIT);
+       /* Set up the interface mode */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_CIS82xx_EXT_CON1,
+                       MIIM_CIS8201_EXTCON1_INIT);
+
+       genphy_config_aneg(phydev);
+
+       return 0;
+}
+
+static int vitesse_parse_status(struct phy_device *phydev)
+{
+       int speed;
+       int mii_reg;
+
+       mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_CIS82xx_AUX_CONSTAT);
+
+       if (mii_reg & MIIM_CIS82xx_AUXCONSTAT_DUPLEX)
+               phydev->duplex = DUPLEX_FULL;
+       else
+               phydev->duplex = DUPLEX_HALF;
+
+       speed = mii_reg & MIIM_CIS82xx_AUXCONSTAT_SPEED;
+       switch (speed) {
+       case MIIM_CIS82xx_AUXCONSTAT_GBIT:
+               phydev->speed = SPEED_1000;
+               break;
+       case MIIM_CIS82xx_AUXCONSTAT_100:
+               phydev->speed = SPEED_100;
+               break;
+       default:
+               phydev->speed = SPEED_10;
+               break;
+       }
+
+       return 0;
+}
+
+static int vitesse_startup(struct phy_device *phydev)
+{
+       genphy_update_link(phydev);
+       vitesse_parse_status(phydev);
+
+       return 0;
+}
+
+static int cis8204_config(struct phy_device *phydev)
+{
+       /* Override PHY config settings */
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_CIS82xx_AUX_CONSTAT,
+                       MIIM_CIS82xx_AUXCONSTAT_INIT);
+
+       genphy_config_aneg(phydev);
+
+       if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
+                       (phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
+                       (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) ||
+                       (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID))
+               phy_write(phydev, MDIO_DEVAD_NONE, MIIM_CIS8204_EPHY_CON,
+                               MIIM_CIS8204_EPHYCON_INIT |
+                               MIIM_CIS8204_EPHYCON_RGMII);
+       else
+               phy_write(phydev, MDIO_DEVAD_NONE, MIIM_CIS8204_EPHY_CON,
+                               MIIM_CIS8204_EPHYCON_INIT);
+
+       return 0;
+}
+
+/* Vitesse VSC8601 */
+int vsc8601_config(struct phy_device *phydev)
+{
+       /* Configure some basic stuff */
+#ifdef CONFIG_SYS_VSC8601_SKEWFIX
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_VSC8601_EPHY_CON,
+                       MIIM_VSC8601_EPHY_CON_INIT_SKEW);
+#if defined(CONFIG_SYS_VSC8601_SKEW_TX) && defined(CONFIG_SYS_VSC8601_SKEW_RX)
+       phy_write(phydev, MDIO_DEVAD_NONE, PHY_EXT_PAGE_ACCESS, 1);
+#define VSC8101_SKEW \
+       ((CONFIG_SYS_VSC8601_SKEW_TX << 14) \
+       | (CONFIG_SYS_VSC8601_SKEW_RX << 12))
+       phy_write(phydev, MDIO_DEVAD_NONE, MIIM_VSC8601_SKEW_CTRL,
+                       VSC8101_SKEW);
+       phy_write(phydev, MDIO_DEVAD_NONE, PHY_EXT_PAGE_ACCESS, 0);
+#endif
+#endif
+
+       genphy_config_aneg(phydev);
+
+       return 0;
+}
+
+static struct phy_driver VSC8211_driver = {
+       .name   = "Vitesse VSC8211",
+       .uid    = 0xfc4b0,
+       .mask   = 0xffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &vitesse_config,
+       .startup = &vitesse_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver VSC8221_driver = {
+       .name = "Vitesse VSC8221",
+       .uid = 0xfc550,
+       .mask = 0xffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &genphy_config_aneg,
+       .startup = &vitesse_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver VSC8244_driver = {
+       .name = "Vitesse VSC8244",
+       .uid = 0xfc6c0,
+       .mask = 0xffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &genphy_config_aneg,
+       .startup = &vitesse_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver VSC8234_driver = {
+       .name = "Vitesse VSC8234",
+       .uid = 0xfc620,
+       .mask = 0xffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &genphy_config_aneg,
+       .startup = &vitesse_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver VSC8601_driver = {
+       .name = "Vitesse VSC8601",
+       .uid = 0x70420,
+       .mask = 0xffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &vsc8601_config,
+       .startup = &vitesse_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver VSC8641_driver = {
+       .name = "Vitesse VSC8641",
+       .uid = 0x70430,
+       .mask = 0xffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &genphy_config_aneg,
+       .startup = &vitesse_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+/* Vitesse bought Cicada, so we'll put these here */
+static struct phy_driver cis8201_driver = {
+       .name = "CIS8201",
+       .uid = 0xfc410,
+       .mask = 0xffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &vitesse_config,
+       .startup = &vitesse_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver cis8204_driver = {
+       .name = "Cicada Cis8204",
+       .uid = 0xfc440,
+       .mask = 0xffff0,
+       .features = PHY_GBIT_FEATURES,
+       .config = &cis8204_config,
+       .startup = &vitesse_startup,
+       .shutdown = &genphy_shutdown,
+};
+
+int phy_vitesse_init(void)
+{
+       phy_register(&VSC8641_driver);
+       phy_register(&VSC8601_driver);
+       phy_register(&VSC8234_driver);
+       phy_register(&VSC8244_driver);
+       phy_register(&VSC8211_driver);
+       phy_register(&VSC8221_driver);
+       phy_register(&cis8201_driver);
+       phy_register(&cis8204_driver);
+
+       return 0;
+}
index 9c8fe6244191db15ccb282a110e09450237b4c98..06e5834a94ca32cb6798e2a51db47d3ab9ef27c1 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the GNU Public License, Version 2, incorporated
  * herein by reference.
  *
- * Copyright 2004-2010 Freescale Semiconductor, Inc.
+ * Copyright 2004-2011 Freescale Semiconductor, Inc.
  * (C) Copyright 2003, Motorola, Inc.
  * author Andy Fleming
  *
 #include <net.h>
 #include <command.h>
 #include <tsec.h>
+#include <fsl_mdio.h>
 #include <asm/errno.h>
 
-#include "miiphy.h"
-
 DECLARE_GLOBAL_DATA_PTR;
 
 #define TX_BUF_CNT             2
@@ -44,31 +43,6 @@ static RTXBD rtx __attribute__ ((aligned(8)));
 #error "rtx must be 64-bit aligned"
 #endif
 
-static int tsec_send(struct eth_device *dev,
-                    volatile void *packet, int length);
-static int tsec_recv(struct eth_device *dev);
-static int tsec_init(struct eth_device *dev, bd_t * bd);
-static int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info);
-static void tsec_halt(struct eth_device *dev);
-static void init_registers(volatile tsec_t * regs);
-static void startup_tsec(struct eth_device *dev);
-static int init_phy(struct eth_device *dev);
-void write_phy_reg(struct tsec_private *priv, uint regnum, uint value);
-uint read_phy_reg(struct tsec_private *priv, uint regnum);
-static struct phy_info *get_phy_info(struct eth_device *dev);
-static void phy_run_commands(struct tsec_private *priv, struct phy_cmd *cmd);
-static void adjust_link(struct eth_device *dev);
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
-       && !defined(BITBANGMII)
-static int tsec_miiphy_write(const char *devname, unsigned char addr,
-                            unsigned char reg, unsigned short value);
-static int tsec_miiphy_read(const char *devname, unsigned char addr,
-                           unsigned char reg, unsigned short *value);
-#endif
-#ifdef CONFIG_MCAST_TFTP
-static int tsec_mcast_addr (struct eth_device *dev, u8 mcast_mac, u8 set);
-#endif
-
 /* Default initializations for TSEC controllers. */
 
 static struct tsec_info_struct tsec_info[] = {
@@ -81,10 +55,10 @@ static struct tsec_info_struct tsec_info[] = {
 #ifdef CONFIG_MPC85XX_FEC
        {
                .regs = (tsec_t *)(TSEC_BASE_ADDR + 0x2000),
-               .miiregs = (tsec_mdio_t *)(MDIO_BASE_ADDR),
                .devname = CONFIG_MPC85XX_FEC_NAME,
                .phyaddr = FEC_PHY_ADDR,
-               .flags = FEC_FLAGS
+               .flags = FEC_FLAGS,
+               .mii_devname = DEFAULT_MII_NAME
        },                      /* FEC */
 #endif
 #ifdef CONFIG_TSEC3
@@ -95,195 +69,6 @@ static struct tsec_info_struct tsec_info[] = {
 #endif
 };
 
-/*
- * Initialize all the TSEC devices
- *
- * Returns the number of TSEC devices that were initialized
- */
-int tsec_eth_init(bd_t *bis, struct tsec_info_struct *tsecs, int num)
-{
-       int i;
-       int ret, count = 0;
-
-       for (i = 0; i < num; i++) {
-               ret = tsec_initialize(bis, &tsecs[i]);
-               if (ret > 0)
-                       count += ret;
-       }
-
-       return count;
-}
-
-int tsec_standard_init(bd_t *bis)
-{
-       return tsec_eth_init(bis, tsec_info, ARRAY_SIZE(tsec_info));
-}
-
-/* Initialize device structure. Returns success if PHY
- * initialization succeeded (i.e. if it recognizes the PHY)
- */
-static int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info)
-{
-       struct eth_device *dev;
-       int i;
-       struct tsec_private *priv;
-
-       dev = (struct eth_device *)malloc(sizeof *dev);
-
-       if (NULL == dev)
-               return 0;
-
-       memset(dev, 0, sizeof *dev);
-
-       priv = (struct tsec_private *)malloc(sizeof(*priv));
-
-       if (NULL == priv)
-               return 0;
-
-       privlist[num_tsecs++] = priv;
-       priv->regs = tsec_info->regs;
-       priv->phyregs = tsec_info->miiregs;
-       priv->phyregs_sgmii = tsec_info->miiregs_sgmii;
-
-       priv->phyaddr = tsec_info->phyaddr;
-       priv->flags = tsec_info->flags;
-
-       sprintf(dev->name, tsec_info->devname);
-       dev->iobase = 0;
-       dev->priv = priv;
-       dev->init = tsec_init;
-       dev->halt = tsec_halt;
-       dev->send = tsec_send;
-       dev->recv = tsec_recv;
-#ifdef CONFIG_MCAST_TFTP
-       dev->mcast = tsec_mcast_addr;
-#endif
-
-       /* Tell u-boot to get the addr from the env */
-       for (i = 0; i < 6; i++)
-               dev->enetaddr[i] = 0;
-
-       eth_register(dev);
-
-       /* Reset the MAC */
-       priv->regs->maccfg1 |= MACCFG1_SOFT_RESET;
-       udelay(2);  /* Soft Reset must be asserted for 3 TX clocks */
-       priv->regs->maccfg1 &= ~(MACCFG1_SOFT_RESET);
-
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
-       && !defined(BITBANGMII)
-       miiphy_register(dev->name, tsec_miiphy_read, tsec_miiphy_write);
-#endif
-
-       /* Try to initialize PHY here, and return */
-       return init_phy(dev);
-}
-
-/* Initializes data structures and registers for the controller,
- * and brings the interface up.         Returns the link status, meaning
- * that it returns success if the link is up, failure otherwise.
- * This allows u-boot to find the first active controller.
- */
-static int tsec_init(struct eth_device *dev, bd_t * bd)
-{
-       uint tempval;
-       char tmpbuf[MAC_ADDR_LEN];
-       int i;
-       struct tsec_private *priv = (struct tsec_private *)dev->priv;
-       volatile tsec_t *regs = priv->regs;
-
-       /* Make sure the controller is stopped */
-       tsec_halt(dev);
-
-       /* Init MACCFG2.  Defaults to GMII */
-       regs->maccfg2 = MACCFG2_INIT_SETTINGS;
-
-       /* Init ECNTRL */
-       regs->ecntrl = ECNTRL_INIT_SETTINGS;
-
-       /* Copy the station address into the address registers.
-        * Backwards, because little endian MACS are dumb */
-       for (i = 0; i < MAC_ADDR_LEN; i++) {
-               tmpbuf[MAC_ADDR_LEN - 1 - i] = dev->enetaddr[i];
-       }
-       tempval = (tmpbuf[0] << 24) | (tmpbuf[1] << 16) | (tmpbuf[2] << 8) |
-                 tmpbuf[3];
-
-       regs->macstnaddr1 = tempval;
-
-       tempval = *((uint *) (tmpbuf + 4));
-
-       regs->macstnaddr2 = tempval;
-
-       /* reset the indices to zero */
-       rxIdx = 0;
-       txIdx = 0;
-
-       /* Clear out (for the most part) the other registers */
-       init_registers(regs);
-
-       /* Ready the device for tx/rx */
-       startup_tsec(dev);
-
-       /* If there's no link, fail */
-       return (priv->link ? 0 : -1);
-}
-
-/* Writes the given phy's reg with value, using the specified MDIO regs */
-static void tsec_local_mdio_write(volatile tsec_mdio_t *phyregs, uint addr,
-               uint reg, uint value)
-{
-       int timeout = 1000000;
-
-       phyregs->miimadd = (addr << 8) | reg;
-       phyregs->miimcon = value;
-       asm("sync");
-
-       timeout = 1000000;
-       while ((phyregs->miimind & MIIMIND_BUSY) && timeout--) ;
-}
-
-
-/* Provide the default behavior of writing the PHY of this ethernet device */
-#define write_phy_reg(priv, regnum, value) \
-       tsec_local_mdio_write(priv->phyregs,priv->phyaddr,regnum,value)
-
-/* Reads register regnum on the device's PHY through the
- * specified registers.         It lowers and raises the read
- * command, and waits for the data to become valid (miimind
- * notvalid bit cleared), and the bus to cease activity (miimind
- * busy bit cleared), and then returns the value
- */
-static uint tsec_local_mdio_read(volatile tsec_mdio_t *phyregs,
-                               uint phyid, uint regnum)
-{
-       uint value;
-
-       /* Put the address of the phy, and the register
-        * number into MIIMADD */
-       phyregs->miimadd = (phyid << 8) | regnum;
-
-       /* Clear the command register, and wait */
-       phyregs->miimcom = 0;
-       asm("sync");
-
-       /* Initiate a read command, and wait */
-       phyregs->miimcom = MIIM_READ_COMMAND;
-       asm("sync");
-
-       /* Wait for the the indication that the read is done */
-       while ((phyregs->miimind & (MIIMIND_NOTVALID | MIIMIND_BUSY))) ;
-
-       /* Grab the value read from the PHY */
-       value = phyregs->miimstat;
-
-       return value;
-}
-
-/* #define to provide old read_phy_reg functionality without duplicating code */
-#define read_phy_reg(priv,regnum) \
-       tsec_local_mdio_read(priv->phyregs,priv->phyaddr,regnum)
-
 #define TBIANA_SETTINGS ( \
                TBIANA_ASYMMETRIC_PAUSE \
                | TBIANA_SYMMETRIC_PAUSE \
@@ -305,661 +90,150 @@ static void tsec_configure_serdes(struct tsec_private *priv)
 {
        /* Access TBI PHY registers at given TSEC register offset as opposed
         * to the register offset used for external PHY accesses */
-       tsec_local_mdio_write(priv->phyregs_sgmii, priv->regs->tbipa, TBI_ANA,
-                       TBIANA_SETTINGS);
-       tsec_local_mdio_write(priv->phyregs_sgmii, priv->regs->tbipa, TBI_TBICON,
-                       TBICON_CLK_SELECT);
-       tsec_local_mdio_write(priv->phyregs_sgmii, priv->regs->tbipa, TBI_CR,
-                       CONFIG_TSEC_TBICR_SETTINGS);
-}
-
-/* Discover which PHY is attached to the device, and configure it
- * properly.  If the PHY is not recognized, then return 0
- * (failure).  Otherwise, return 1
- */
-static int init_phy(struct eth_device *dev)
-{
-       struct tsec_private *priv = (struct tsec_private *)dev->priv;
-       struct phy_info *curphy;
-       volatile tsec_t *regs = priv->regs;
-
-       /* Assign a Physical address to the TBI */
-       regs->tbipa = CONFIG_SYS_TBIPA_VALUE;
-       asm("sync");
-
-       /* Reset MII (due to new addresses) */
-       priv->phyregs->miimcfg = MIIMCFG_RESET;
-       asm("sync");
-       priv->phyregs->miimcfg = MIIMCFG_INIT_VALUE;
-       asm("sync");
-       while (priv->phyregs->miimind & MIIMIND_BUSY) ;
-
-       /* Get the cmd structure corresponding to the attached
-        * PHY */
-       curphy = get_phy_info(dev);
-
-       if (curphy == NULL) {
-               priv->phyinfo = NULL;
-               printf("%s: No PHY found\n", dev->name);
-
-               return 0;
-       }
-
-       if (regs->ecntrl & ECNTRL_SGMII_MODE)
-               tsec_configure_serdes(priv);
-
-       priv->phyinfo = curphy;
-
-       phy_run_commands(priv, priv->phyinfo->config);
-
-       return 1;
+       tsec_local_mdio_write(priv->phyregs_sgmii, in_be32(&priv->regs->tbipa),
+                       0, TBI_ANA, TBIANA_SETTINGS);
+       tsec_local_mdio_write(priv->phyregs_sgmii, in_be32(&priv->regs->tbipa),
+                       0, TBI_TBICON, TBICON_CLK_SELECT);
+       tsec_local_mdio_write(priv->phyregs_sgmii, in_be32(&priv->regs->tbipa),
+                       0, TBI_CR, CONFIG_TSEC_TBICR_SETTINGS);
 }
 
-/*
- * Returns which value to write to the control register.
- * For 10/100, the value is slightly different
- */
-static uint mii_cr_init(uint mii_reg, struct tsec_private * priv)
-{
-       if (priv->flags & TSEC_GIGABIT)
-               return MIIM_CONTROL_INIT;
-       else
-               return MIIM_CR_INIT;
-}
-
-/*
- * Wait for auto-negotiation to complete, then determine link
- */
-static uint mii_parse_sr(uint mii_reg, struct tsec_private * priv)
-{
-       /*
-        * Wait if the link is up, and autonegotiation is in progress
-        * (ie - we're capable and it's not done)
-        */
-       mii_reg = read_phy_reg(priv, MIIM_STATUS);
-       if ((mii_reg & BMSR_ANEGCAPABLE) && !(mii_reg & BMSR_ANEGCOMPLETE)) {
-               int i = 0;
-
-               puts("Waiting for PHY auto negotiation to complete");
-               while (!(mii_reg & BMSR_ANEGCOMPLETE)) {
-                       /*
-                        * Timeout reached ?
-                        */
-                       if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
-                               puts(" TIMEOUT !\n");
-                               priv->link = 0;
-                               return 0;
-                       }
-
-                       if (ctrlc()) {
-                               puts("user interrupt!\n");
-                               priv->link = 0;
-                               return -EINTR;
-                       }
-
-                       if ((i++ % 1000) == 0) {
-                               putc('.');
-                       }
-                       udelay(1000);   /* 1 ms */
-                       mii_reg = read_phy_reg(priv, MIIM_STATUS);
-               }
-               puts(" done\n");
-
-               /* Link status bit is latched low, read it again */
-               mii_reg = read_phy_reg(priv, MIIM_STATUS);
-
-               udelay(500000); /* another 500 ms (results in faster booting) */
-       }
-
-       priv->link = mii_reg & MIIM_STATUS_LINK ? 1 : 0;
-
-       return 0;
-}
-
-/* Generic function which updates the speed and duplex.  If
- * autonegotiation is enabled, it uses the AND of the link
- * partner's advertised capabilities and our advertised
- * capabilities.  If autonegotiation is disabled, we use the
- * appropriate bits in the control register.
- *
- * Stolen from Linux's mii.c and phy_device.c
- */
-static uint mii_parse_link(uint mii_reg, struct tsec_private *priv)
-{
-       /* We're using autonegotiation */
-       if (mii_reg & BMSR_ANEGCAPABLE) {
-               uint lpa = 0;
-               uint gblpa = 0;
-
-               /* Check for gigabit capability */
-               if (mii_reg & BMSR_ERCAP) {
-                       /* We want a list of states supported by
-                        * both PHYs in the link
-                        */
-                       gblpa = read_phy_reg(priv, MII_STAT1000);
-                       gblpa &= read_phy_reg(priv, MII_CTRL1000) << 2;
-               }
-
-               /* Set the baseline so we only have to set them
-                * if they're different
-                */
-               priv->speed = 10;
-               priv->duplexity = 0;
-
-               /* Check the gigabit fields */
-               if (gblpa & (PHY_1000BTSR_1000FD | PHY_1000BTSR_1000HD)) {
-                       priv->speed = 1000;
-
-                       if (gblpa & PHY_1000BTSR_1000FD)
-                               priv->duplexity = 1;
-
-                       /* We're done! */
-                       return 0;
-               }
-
-               lpa = read_phy_reg(priv, MII_ADVERTISE);
-               lpa &= read_phy_reg(priv, MII_LPA);
-
-               if (lpa & (LPA_100FULL | LPA_100HALF)) {
-                       priv->speed = 100;
-
-                       if (lpa & LPA_100FULL)
-                               priv->duplexity = 1;
-
-               } else if (lpa & LPA_10FULL)
-                       priv->duplexity = 1;
-       } else {
-               uint bmcr = read_phy_reg(priv, MII_BMCR);
-
-               priv->speed = 10;
-               priv->duplexity = 0;
-
-               if (bmcr & BMCR_FULLDPLX)
-                       priv->duplexity = 1;
-
-               if (bmcr & BMCR_SPEED1000)
-                       priv->speed = 1000;
-               else if (bmcr & BMCR_SPEED100)
-                       priv->speed = 100;
-       }
-
-       return 0;
-}
-
-/*
- * "Ethernet@Wirespeed" needs to be enabled to achieve link in certain
- * circumstances.  eg a gigabit TSEC connected to a gigabit switch with
- * a 4-wire ethernet cable.  Both ends advertise gigabit, but can't
- * link.  "Ethernet@Wirespeed" reduces advertised speed until link
- * can be achieved.
- */
-static uint mii_BCM54xx_wirespeed(uint mii_reg, struct tsec_private *priv)
-{
-       return (read_phy_reg(priv, mii_reg) & 0x8FFF) | 0x8010;
-}
-
-/*
- * Parse the BCM54xx status register for speed and duplex information.
- * The linux sungem_phy has this information, but in a table format.
- */
-static uint mii_parse_BCM54xx_sr(uint mii_reg, struct tsec_private *priv)
-{
-       /* If there is no link, speed and duplex don't matter */
-       if (!priv->link)
-               return 0;
-
-       switch ((mii_reg & MIIM_BCM54xx_AUXSTATUS_LINKMODE_MASK) >>
-               MIIM_BCM54xx_AUXSTATUS_LINKMODE_SHIFT) {
-       case 1:
-               priv->duplexity = 0;
-               priv->speed = 10;
-               break;
-       case 2:
-               priv->duplexity = 1;
-               priv->speed = 10;
-               break;
-       case 3:
-               priv->duplexity = 0;
-               priv->speed = 100;
-               break;
-       case 5:
-               priv->duplexity = 1;
-               priv->speed = 100;
-               break;
-       case 6:
-               priv->duplexity = 0;
-               priv->speed = 1000;
-               break;
-       case 7:
-               priv->duplexity = 1;
-               priv->speed = 1000;
-               break;
-       default:
-               printf("Auto-neg error, defaulting to 10BT/HD\n");
-               priv->duplexity = 0;
-               priv->speed = 10;
-               break;
-       }
-
-       return 0;
-}
-
-/*
- * Find out if PHY is in copper or serdes mode by looking at Expansion Reg
- * 0x42 - "Operating Mode Status Register"
- */
-static int BCM8482_is_serdes(struct tsec_private *priv)
-{
-       u16 val;
-       int serdes = 0;
-
-       write_phy_reg(priv, MIIM_BCM54XX_EXP_SEL, MIIM_BCM54XX_EXP_SEL_ER | 0x42);
-       val = read_phy_reg(priv, MIIM_BCM54XX_EXP_DATA);
-
-       switch (val & 0x1f) {
-       case 0x0d:      /* RGMII-to-100Base-FX */
-       case 0x0e:      /* RGMII-to-SGMII */
-       case 0x0f:      /* RGMII-to-SerDes */
-       case 0x12:      /* SGMII-to-SerDes */
-       case 0x13:      /* SGMII-to-100Base-FX */
-       case 0x16:      /* SerDes-to-Serdes */
-               serdes = 1;
-               break;
-       case 0x6:       /* RGMII-to-Copper */
-       case 0x14:      /* SGMII-to-Copper */
-       case 0x17:      /* SerDes-to-Copper */
-               break;
-       default:
-               printf("ERROR, invalid PHY mode (0x%x\n)", val);
-               break;
-       }
-
-       return serdes;
-}
-
-/*
- * Determine SerDes link speed and duplex from Expansion reg 0x42 "Operating
- * Mode Status Register"
- */
-uint mii_parse_BCM5482_serdes_sr(struct tsec_private *priv)
-{
-       u16 val;
-       int i = 0;
-
-       /* Wait 1s for link - Clause 37 autonegotiation happens very fast */
-       while (1) {
-               write_phy_reg(priv, MIIM_BCM54XX_EXP_SEL,
-                               MIIM_BCM54XX_EXP_SEL_ER | 0x42);
-               val = read_phy_reg(priv, MIIM_BCM54XX_EXP_DATA);
-
-               if (val & 0x8000)
-                       break;
-
-               if (i++ > 1000) {
-                       priv->link = 0;
-                       return 1;
-               }
-
-               udelay(1000);   /* 1 ms */
-       }
-
-       priv->link = 1;
-       switch ((val >> 13) & 0x3) {
-       case (0x00):
-               priv->speed = 10;
-               break;
-       case (0x01):
-               priv->speed = 100;
-               break;
-       case (0x02):
-               priv->speed = 1000;
-               break;
-       }
-
-       priv->duplexity = (val & 0x1000) == 0x1000;
-
-       return 0;
-}
-
-/*
- * Figure out if BCM5482 is in serdes or copper mode and determine link
- * configuration accordingly
- */
-static uint mii_parse_BCM5482_sr(uint mii_reg, struct tsec_private *priv)
-{
-       if (BCM8482_is_serdes(priv)) {
-               mii_parse_BCM5482_serdes_sr(priv);
-               priv->flags |= TSEC_FIBER;
-       } else {
-               /* Wait for auto-negotiation to complete or fail */
-               mii_parse_sr(mii_reg, priv);
-
-               /* Parse BCM54xx copper aux status register */
-               mii_reg = read_phy_reg(priv, MIIM_BCM54xx_AUXSTATUS);
-               mii_parse_BCM54xx_sr(mii_reg, priv);
-       }
-
-       return 0;
-}
-
-/* Parse the 88E1011's status register for speed and duplex
- * information
- */
-static uint mii_parse_88E1011_psr(uint mii_reg, struct tsec_private * priv)
-{
-       uint speed;
-
-       mii_reg = read_phy_reg(priv, MIIM_88E1011_PHY_STATUS);
-
-       if ((mii_reg & MIIM_88E1011_PHYSTAT_LINK) &&
-               !(mii_reg & MIIM_88E1011_PHYSTAT_SPDDONE)) {
-               int i = 0;
-
-               puts("Waiting for PHY realtime link");
-               while (!(mii_reg & MIIM_88E1011_PHYSTAT_SPDDONE)) {
-                       /* Timeout reached ? */
-                       if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
-                               puts(" TIMEOUT !\n");
-                               priv->link = 0;
-                               break;
-                       }
-
-                       if ((i++ % 1000) == 0) {
-                               putc('.');
-                       }
-                       udelay(1000);   /* 1 ms */
-                       mii_reg = read_phy_reg(priv, MIIM_88E1011_PHY_STATUS);
-               }
-               puts(" done\n");
-               udelay(500000); /* another 500 ms (results in faster booting) */
-       } else {
-               if (mii_reg & MIIM_88E1011_PHYSTAT_LINK)
-                       priv->link = 1;
-               else
-                       priv->link = 0;
-       }
-
-       if (mii_reg & MIIM_88E1011_PHYSTAT_DUPLEX)
-               priv->duplexity = 1;
-       else
-               priv->duplexity = 0;
-
-       speed = (mii_reg & MIIM_88E1011_PHYSTAT_SPEED);
-
-       switch (speed) {
-       case MIIM_88E1011_PHYSTAT_GBIT:
-               priv->speed = 1000;
-               break;
-       case MIIM_88E1011_PHYSTAT_100:
-               priv->speed = 100;
-               break;
-       default:
-               priv->speed = 10;
-       }
-
-       return 0;
-}
-
-/* Parse the RTL8211B's status register for speed and duplex
- * information
- */
-static uint mii_parse_RTL8211B_sr(uint mii_reg, struct tsec_private * priv)
-{
-       uint speed;
-
-       mii_reg = read_phy_reg(priv, MIIM_RTL8211B_PHY_STATUS);
-       if (!(mii_reg & MIIM_RTL8211B_PHYSTAT_SPDDONE)) {
-               int i = 0;
-
-               /* in case of timeout ->link is cleared */
-               priv->link = 1;
-               puts("Waiting for PHY realtime link");
-               while (!(mii_reg & MIIM_RTL8211B_PHYSTAT_SPDDONE)) {
-                       /* Timeout reached ? */
-                       if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
-                               puts(" TIMEOUT !\n");
-                               priv->link = 0;
-                               break;
-                       }
-
-                       if ((i++ % 1000) == 0) {
-                               putc('.');
-                       }
-                       udelay(1000);   /* 1 ms */
-                       mii_reg = read_phy_reg(priv, MIIM_RTL8211B_PHY_STATUS);
-               }
-               puts(" done\n");
-               udelay(500000); /* another 500 ms (results in faster booting) */
-       } else {
-               if (mii_reg & MIIM_RTL8211B_PHYSTAT_LINK)
-                       priv->link = 1;
-               else
-                       priv->link = 0;
-       }
-
-       if (mii_reg & MIIM_RTL8211B_PHYSTAT_DUPLEX)
-               priv->duplexity = 1;
-       else
-               priv->duplexity = 0;
-
-       speed = (mii_reg & MIIM_RTL8211B_PHYSTAT_SPEED);
-
-       switch (speed) {
-       case MIIM_RTL8211B_PHYSTAT_GBIT:
-               priv->speed = 1000;
-               break;
-       case MIIM_RTL8211B_PHYSTAT_100:
-               priv->speed = 100;
-               break;
-       default:
-               priv->speed = 10;
-       }
-
-       return 0;
-}
-
-/* Parse the cis8201's status register for speed and duplex
- * information
- */
-static uint mii_parse_cis8201(uint mii_reg, struct tsec_private * priv)
-{
-       uint speed;
-
-       if (mii_reg & MIIM_CIS8201_AUXCONSTAT_DUPLEX)
-               priv->duplexity = 1;
-       else
-               priv->duplexity = 0;
-
-       speed = mii_reg & MIIM_CIS8201_AUXCONSTAT_SPEED;
-       switch (speed) {
-       case MIIM_CIS8201_AUXCONSTAT_GBIT:
-               priv->speed = 1000;
-               break;
-       case MIIM_CIS8201_AUXCONSTAT_100:
-               priv->speed = 100;
-               break;
-       default:
-               priv->speed = 10;
-               break;
-       }
-
-       return 0;
-}
-
-/* Parse the vsc8244's status register for speed and duplex
- * information
- */
-static uint mii_parse_vsc8244(uint mii_reg, struct tsec_private * priv)
-{
-       uint speed;
-
-       if (mii_reg & MIIM_VSC8244_AUXCONSTAT_DUPLEX)
-               priv->duplexity = 1;
-       else
-               priv->duplexity = 0;
-
-       speed = mii_reg & MIIM_VSC8244_AUXCONSTAT_SPEED;
-       switch (speed) {
-       case MIIM_VSC8244_AUXCONSTAT_GBIT:
-               priv->speed = 1000;
-               break;
-       case MIIM_VSC8244_AUXCONSTAT_100:
-               priv->speed = 100;
-               break;
-       default:
-               priv->speed = 10;
-               break;
-       }
-
-       return 0;
-}
-
-/* Parse the DM9161's status register for speed and duplex
- * information
- */
-static uint mii_parse_dm9161_scsr(uint mii_reg, struct tsec_private * priv)
-{
-       if (mii_reg & (MIIM_DM9161_SCSR_100F | MIIM_DM9161_SCSR_100H))
-               priv->speed = 100;
-       else
-               priv->speed = 10;
+#ifdef CONFIG_MCAST_TFTP
 
-       if (mii_reg & (MIIM_DM9161_SCSR_100F | MIIM_DM9161_SCSR_10F))
-               priv->duplexity = 1;
-       else
-               priv->duplexity = 0;
+/* CREDITS: linux gianfar driver, slightly adjusted... thanx. */
 
-       return 0;
-}
+/* Set the appropriate hash bit for the given addr */
 
-/*
- * Hack to write all 4 PHYs with the LED values
- */
-static uint mii_cis8204_fixled(uint mii_reg, struct tsec_private * priv)
+/* The algorithm works like so:
+ * 1) Take the Destination Address (ie the multicast address), and
+ * do a CRC on it (little endian), and reverse the bits of the
+ * result.
+ * 2) Use the 8 most significant bits as a hash into a 256-entry
+ * table.  The table is controlled through 8 32-bit registers:
+ * gaddr0-7.  gaddr0's MSB is entry 0, and gaddr7's LSB is
+ * gaddr7.  This means that the 3 most significant bits in the
+ * hash index which gaddr register to use, and the 5 other bits
+ * indicate which bit (assuming an IBM numbering scheme, which
+ * for PowerPC (tm) is usually the case) in the tregister holds
+ * the entry. */
+static int
+tsec_mcast_addr (struct eth_device *dev, u8 mcast_mac, u8 set)
 {
-       uint phyid;
-       volatile tsec_mdio_t *regbase = priv->phyregs;
-       int timeout = 1000000;
-
-       for (phyid = 0; phyid < 4; phyid++) {
-               regbase->miimadd = (phyid << 8) | mii_reg;
-               regbase->miimcon = MIIM_CIS8204_SLEDCON_INIT;
-               asm("sync");
-
-               timeout = 1000000;
-               while ((regbase->miimind & MIIMIND_BUSY) && timeout--) ;
-       }
-
-       return MIIM_CIS8204_SLEDCON_INIT;
-}
+       struct tsec_private *priv = privlist[1];
+       volatile tsec_t *regs = priv->regs;
+       volatile u32  *reg_array, value;
+       u8 result, whichbit, whichreg;
 
-static uint mii_cis8204_setmode(uint mii_reg, struct tsec_private * priv)
-{
-       if (priv->flags & TSEC_REDUCED)
-               return MIIM_CIS8204_EPHYCON_INIT | MIIM_CIS8204_EPHYCON_RGMII;
-       else
-               return MIIM_CIS8204_EPHYCON_INIT;
-}
+       result = (u8)((ether_crc(MAC_ADDR_LEN,mcast_mac) >> 24) & 0xff);
+       whichbit = result & 0x1f;       /* the 5 LSB = which bit to set */
+       whichreg = result >> 5;         /* the 3 MSB = which reg to set it in */
+       value = (1 << (31-whichbit));
 
-static uint mii_m88e1111s_setmode(uint mii_reg, struct tsec_private *priv)
-{
-       uint mii_data = read_phy_reg(priv, mii_reg);
+       reg_array = &(regs->hash.gaddr0);
 
-       if (priv->flags & TSEC_REDUCED)
-               mii_data = (mii_data & 0xfff0) | 0x000b;
-       return mii_data;
+       if (set) {
+               reg_array[whichreg] |= value;
+       } else {
+               reg_array[whichreg] &= ~value;
+       }
+       return 0;
 }
+#endif /* Multicast TFTP ? */
 
 /* Initialized required registers to appropriate values, zeroing
  * those we don't care about (unless zero is bad, in which case,
  * choose a more appropriate value)
  */
-static void init_registers(volatile tsec_t * regs)
+static void init_registers(tsec_t *regs)
 {
        /* Clear IEVENT */
-       regs->ievent = IEVENT_INIT_CLEAR;
-
-       regs->imask = IMASK_INIT_CLEAR;
-
-       regs->hash.iaddr0 = 0;
-       regs->hash.iaddr1 = 0;
-       regs->hash.iaddr2 = 0;
-       regs->hash.iaddr3 = 0;
-       regs->hash.iaddr4 = 0;
-       regs->hash.iaddr5 = 0;
-       regs->hash.iaddr6 = 0;
-       regs->hash.iaddr7 = 0;
-
-       regs->hash.gaddr0 = 0;
-       regs->hash.gaddr1 = 0;
-       regs->hash.gaddr2 = 0;
-       regs->hash.gaddr3 = 0;
-       regs->hash.gaddr4 = 0;
-       regs->hash.gaddr5 = 0;
-       regs->hash.gaddr6 = 0;
-       regs->hash.gaddr7 = 0;
-
-       regs->rctrl = 0x00000000;
+       out_be32(&regs->ievent, IEVENT_INIT_CLEAR);
+
+       out_be32(&regs->imask, IMASK_INIT_CLEAR);
+
+       out_be32(&regs->hash.iaddr0, 0);
+       out_be32(&regs->hash.iaddr1, 0);
+       out_be32(&regs->hash.iaddr2, 0);
+       out_be32(&regs->hash.iaddr3, 0);
+       out_be32(&regs->hash.iaddr4, 0);
+       out_be32(&regs->hash.iaddr5, 0);
+       out_be32(&regs->hash.iaddr6, 0);
+       out_be32(&regs->hash.iaddr7, 0);
+
+       out_be32(&regs->hash.gaddr0, 0);
+       out_be32(&regs->hash.gaddr1, 0);
+       out_be32(&regs->hash.gaddr2, 0);
+       out_be32(&regs->hash.gaddr3, 0);
+       out_be32(&regs->hash.gaddr4, 0);
+       out_be32(&regs->hash.gaddr5, 0);
+       out_be32(&regs->hash.gaddr6, 0);
+       out_be32(&regs->hash.gaddr7, 0);
+
+       out_be32(&regs->rctrl, 0x00000000);
 
        /* Init RMON mib registers */
        memset((void *)&(regs->rmon), 0, sizeof(rmon_mib_t));
 
-       regs->rmon.cam1 = 0xffffffff;
-       regs->rmon.cam2 = 0xffffffff;
+       out_be32(&regs->rmon.cam1, 0xffffffff);
+       out_be32(&regs->rmon.cam2, 0xffffffff);
 
-       regs->mrblr = MRBLR_INIT_SETTINGS;
+       out_be32(&regs->mrblr, MRBLR_INIT_SETTINGS);
 
-       regs->minflr = MINFLR_INIT_SETTINGS;
+       out_be32(&regs->minflr, MINFLR_INIT_SETTINGS);
 
-       regs->attr = ATTR_INIT_SETTINGS;
-       regs->attreli = ATTRELI_INIT_SETTINGS;
+       out_be32(&regs->attr, ATTR_INIT_SETTINGS);
+       out_be32(&regs->attreli, ATTRELI_INIT_SETTINGS);
 
 }
 
 /* Configure maccfg2 based on negotiated speed and duplex
  * reported by PHY handling code
  */
-static void adjust_link(struct eth_device *dev)
+static void adjust_link(struct tsec_private *priv, struct phy_device *phydev)
 {
-       struct tsec_private *priv = (struct tsec_private *)dev->priv;
-       volatile tsec_t *regs = priv->regs;
+       tsec_t *regs = priv->regs;
+       u32 ecntrl, maccfg2;
 
-       if (priv->link) {
-               if (priv->duplexity != 0)
-                       regs->maccfg2 |= MACCFG2_FULL_DUPLEX;
-               else
-                       regs->maccfg2 &= ~(MACCFG2_FULL_DUPLEX);
-
-               switch (priv->speed) {
-               case 1000:
-                       regs->maccfg2 = ((regs->maccfg2 & ~(MACCFG2_IF))
-                                        | MACCFG2_GMII);
-                       break;
-               case 100:
-               case 10:
-                       regs->maccfg2 = ((regs->maccfg2 & ~(MACCFG2_IF))
-                                        | MACCFG2_MII);
-
-                       /* Set R100 bit in all modes although
-                        * it is only used in RGMII mode
-                        */
-                       if (priv->speed == 100)
-                               regs->ecntrl |= ECNTRL_R100;
-                       else
-                               regs->ecntrl &= ~(ECNTRL_R100);
-                       break;
-               default:
-                       printf("%s: Speed was bad\n", dev->name);
-                       break;
-               }
+       if (!phydev->link) {
+               printf("%s: No link.\n", phydev->dev->name);
+               return;
+       }
 
-               printf("Speed: %d, %s duplex%s\n", priv->speed,
-                      (priv->duplexity) ? "full" : "half",
-                      (priv->flags & TSEC_FIBER) ? ", fiber mode" : "");
+       /* clear all bits relative with interface mode */
+       ecntrl = in_be32(&regs->ecntrl);
+       ecntrl &= ~ECNTRL_R100;
 
-       } else {
-               printf("%s: No link.\n", dev->name);
+       maccfg2 = in_be32(&regs->maccfg2);
+       maccfg2 &= ~(MACCFG2_IF | MACCFG2_FULL_DUPLEX);
+
+       if (phydev->duplex)
+               maccfg2 |= MACCFG2_FULL_DUPLEX;
+
+       switch (phydev->speed) {
+       case 1000:
+               maccfg2 |= MACCFG2_GMII;
+               break;
+       case 100:
+       case 10:
+               maccfg2 |= MACCFG2_MII;
+
+               /* Set R100 bit in all modes although
+                * it is only used in RGMII mode
+                */
+               if (phydev->speed == 100)
+                       ecntrl |= ECNTRL_R100;
+               break;
+       default:
+               printf("%s: Speed was bad\n", phydev->dev->name);
+               break;
        }
+
+       out_be32(&regs->ecntrl, ecntrl);
+       out_be32(&regs->maccfg2, maccfg2);
+
+       printf("Speed: %d, %s duplex%s\n", phydev->speed,
+                       (phydev->duplex) ? "full" : "half",
+                       (phydev->port == PORT_FIBRE) ? ", fiber mode" : "");
 }
 
 /* Set up the buffers and their descriptors, and bring up the
@@ -969,11 +243,15 @@ static void startup_tsec(struct eth_device *dev)
 {
        int i;
        struct tsec_private *priv = (struct tsec_private *)dev->priv;
-       volatile tsec_t *regs = priv->regs;
+       tsec_t *regs = priv->regs;
+
+       /* reset the indices to zero */
+       rxIdx = 0;
+       txIdx = 0;
 
        /* Point to the buffer descriptors */
-       regs->tbase = (unsigned int)(&rtx.txbd[txIdx]);
-       regs->rbase = (unsigned int)(&rtx.rxbd[rxIdx]);
+       out_be32(&regs->tbase, (unsigned int)(&rtx.txbd[txIdx]));
+       out_be32(&regs->rbase, (unsigned int)(&rtx.rxbd[rxIdx]));
 
        /* Initialize the Rx Buffer descriptors */
        for (i = 0; i < PKTBUFSRX; i++) {
@@ -991,20 +269,14 @@ static void startup_tsec(struct eth_device *dev)
        }
        rtx.txbd[TX_BUF_CNT - 1].status |= TXBD_WRAP;
 
-       /* Start up the PHY */
-       if(priv->phyinfo)
-               phy_run_commands(priv, priv->phyinfo->startup);
-
-       adjust_link(dev);
-
        /* Enable Transmit and Receive */
-       regs->maccfg1 |= (MACCFG1_RX_EN | MACCFG1_TX_EN);
+       setbits_be32(&regs->maccfg1, MACCFG1_RX_EN | MACCFG1_TX_EN);
 
        /* Tell the DMA it is clear to go */
-       regs->dmactrl |= DMACTRL_INIT_SETTINGS;
-       regs->tstat = TSTAT_CLEAR_THALT;
-       regs->rstat = RSTAT_CLEAR_RHALT;
-       regs->dmactrl &= ~(DMACTRL_GRS | DMACTRL_GTS);
+       setbits_be32(&regs->dmactrl, DMACTRL_INIT_SETTINGS);
+       out_be32(&regs->tstat, TSTAT_CLEAR_THALT);
+       out_be32(&regs->rstat, RSTAT_CLEAR_RHALT);
+       clrbits_be32(&regs->dmactrl, DMACTRL_GRS | DMACTRL_GTS);
 }
 
 /* This returns the status bits of the device. The return value
@@ -1017,7 +289,7 @@ static int tsec_send(struct eth_device *dev, volatile void *packet, int length)
        int i;
        int result = 0;
        struct tsec_private *priv = (struct tsec_private *)dev->priv;
-       volatile tsec_t *regs = priv->regs;
+       tsec_t *regs = priv->regs;
 
        /* Find an empty buffer descriptor */
        for (i = 0; rtx.txbd[txIdx].status & TXBD_READY; i++) {
@@ -1033,7 +305,7 @@ static int tsec_send(struct eth_device *dev, volatile void *packet, int length)
            (TXBD_READY | TXBD_LAST | TXBD_CRC | TXBD_INTERRUPT);
 
        /* Tell the DMA to go */
-       regs->tstat = TSTAT_CLEAR_THALT;
+       out_be32(&regs->tstat, TSTAT_CLEAR_THALT);
 
        /* Wait for buffer to be transmitted */
        for (i = 0; rtx.txbd[txIdx].status & TXBD_READY; i++) {
@@ -1053,7 +325,7 @@ static int tsec_recv(struct eth_device *dev)
 {
        int length;
        struct tsec_private *priv = (struct tsec_private *)dev->priv;
-       volatile tsec_t *regs = priv->regs;
+       tsec_t *regs = priv->regs;
 
        while (!(rtx.rxbd[rxIdx].status & RXBD_EMPTY)) {
 
@@ -1076,9 +348,9 @@ static int tsec_recv(struct eth_device *dev)
                rxIdx = (rxIdx + 1) % PKTBUFSRX;
        }
 
-       if (regs->ievent & IEVENT_BSY) {
-               regs->ievent = IEVENT_BSY;
-               regs->rstat = RSTAT_CLEAR_RHALT;
+       if (in_be32(&regs->ievent) & IEVENT_BSY) {
+               out_be32(&regs->ievent, IEVENT_BSY);
+               out_be32(&regs->rstat, RSTAT_CLEAR_RHALT);
        }
 
        return -1;
@@ -1089,913 +361,236 @@ static int tsec_recv(struct eth_device *dev)
 static void tsec_halt(struct eth_device *dev)
 {
        struct tsec_private *priv = (struct tsec_private *)dev->priv;
-       volatile tsec_t *regs = priv->regs;
+       tsec_t *regs = priv->regs;
 
-       regs->dmactrl &= ~(DMACTRL_GRS | DMACTRL_GTS);
-       regs->dmactrl |= (DMACTRL_GRS | DMACTRL_GTS);
+       clrbits_be32(&regs->dmactrl, DMACTRL_GRS | DMACTRL_GTS);
+       setbits_be32(&regs->dmactrl, DMACTRL_GRS | DMACTRL_GTS);
 
-       while ((regs->ievent & (IEVENT_GRSC | IEVENT_GTSC))
-               != (IEVENT_GRSC | IEVENT_GTSC)) ;
+       while ((in_be32(&regs->ievent) & (IEVENT_GRSC | IEVENT_GTSC))
+                       != (IEVENT_GRSC | IEVENT_GTSC))
+               ;
 
-       regs->maccfg1 &= ~(MACCFG1_TX_EN | MACCFG1_RX_EN);
+       clrbits_be32(&regs->maccfg1, MACCFG1_TX_EN | MACCFG1_RX_EN);
 
        /* Shut down the PHY, as needed */
-       if(priv->phyinfo)
-               phy_run_commands(priv, priv->phyinfo->shutdown);
+       phy_shutdown(priv->phydev);
 }
 
-static struct phy_info phy_info_M88E1149S = {
-       0x1410ca,
-       "Marvell 88E1149S",
-       4,
-       (struct phy_cmd[]) {     /* config */
-               /* Reset and configure the PHY */
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {0x1d, 0x1f, NULL},
-               {0x1e, 0x200c, NULL},
-               {0x1d, 0x5, NULL},
-               {0x1e, 0x0, NULL},
-               {0x1e, 0x100, NULL},
-               {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
-               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {     /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_88E1011_PHY_STATUS, miim_read, &mii_parse_88E1011_psr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {     /* shutdown */
-               {miim_end,}
-       },
-};
-
-/* The 5411 id is 0x206070, the 5421 is 0x2060e0 */
-static struct phy_info phy_info_BCM5461S = {
-       0x02060c1,      /* 5461 ID */
-       "Broadcom BCM5461S",
-       0, /* not clear to me what minor revisions we can shift away */
-       (struct phy_cmd[]) { /* config */
-               /* Reset and configure the PHY */
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
-               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_BCM54xx_AUXSTATUS, miim_read, &mii_parse_BCM54xx_sr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* shutdown */
-               {miim_end,}
-       },
-};
-
-static struct phy_info phy_info_BCM5464S = {
-       0x02060b1,      /* 5464 ID */
-       "Broadcom BCM5464S",
-       0, /* not clear to me what minor revisions we can shift away */
-       (struct phy_cmd[]) { /* config */
-               /* Reset and configure the PHY */
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
-               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_BCM54xx_AUXSTATUS, miim_read, &mii_parse_BCM54xx_sr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* shutdown */
-               {miim_end,}
-       },
-};
-
-static struct phy_info phy_info_BCM5482S =  {
-       0x0143bcb,
-       "Broadcom BCM5482S",
-       4,
-       (struct phy_cmd[]) { /* config */
-               /* Reset and configure the PHY */
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               /* Setup read from auxilary control shadow register 7 */
-               {MIIM_BCM54xx_AUXCNTL, MIIM_BCM54xx_AUXCNTL_ENCODE(7), NULL},
-               /* Read Misc Control register and or in Ethernet@Wirespeed */
-               {MIIM_BCM54xx_AUXCNTL, 0, &mii_BCM54xx_wirespeed},
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               /* Initial config/enable of secondary SerDes interface */
-               {MIIM_BCM54XX_SHD, MIIM_BCM54XX_SHD_WR_ENCODE(0x14, 0xf), NULL},
-               /* Write intial value to secondary SerDes Contol */
-               {MIIM_BCM54XX_EXP_SEL, MIIM_BCM54XX_EXP_SEL_SSD | 0, NULL},
-               {MIIM_BCM54XX_EXP_DATA, MIIM_CONTROL_RESTART, NULL},
-               /* Enable copper/fiber auto-detect */
-               {MIIM_BCM54XX_SHD, MIIM_BCM54XX_SHD_WR_ENCODE(0x1e, 0x201)},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Determine copper/fiber, auto-negotiate, and read the result */
-               {MIIM_STATUS, miim_read, &mii_parse_BCM5482_sr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* shutdown */
-               {miim_end,}
-       },
-};
-
-static struct phy_info phy_info_M88E1011S = {
-       0x01410c6,
-       "Marvell 88E1011S",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               /* Reset and configure the PHY */
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {0x1d, 0x1f, NULL},
-               {0x1e, 0x200c, NULL},
-               {0x1d, 0x5, NULL},
-               {0x1e, 0x0, NULL},
-               {0x1e, 0x100, NULL},
-               {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
-               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_88E1011_PHY_STATUS, miim_read, &mii_parse_88E1011_psr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
-
-static struct phy_info phy_info_M88E1111S = {
-       0x01410cc,
-       "Marvell 88E1111S",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               /* Reset and configure the PHY */
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {0x1b, 0x848f, &mii_m88e1111s_setmode},
-               {0x14, 0x0cd2, NULL}, /* Delay RGMII TX and RX */
-               {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
-               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_88E1011_PHY_STATUS, miim_read, &mii_parse_88E1011_psr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
-
-static struct phy_info phy_info_M88E1118 = {
-       0x01410e1,
-       "Marvell 88E1118",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               /* Reset and configure the PHY */
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {0x16, 0x0002, NULL}, /* Change Page Number */
-               {0x15, 0x1070, NULL}, /* Delay RGMII TX and RX */
-               {0x16, 0x0003, NULL}, /* Change Page Number */
-               {0x10, 0x021e, NULL}, /* Adjust LED control */
-               {0x16, 0x0000, NULL}, /* Change Page Number */
-               {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
-               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               {0x16, 0x0000, NULL}, /* Change Page Number */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_88E1011_PHY_STATUS, miim_read,
-                &mii_parse_88E1011_psr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
-
-/*
- *  Since to access LED register we need do switch the page, we
- * do LED configuring in the miim_read-like function as follows
+/* Initializes data structures and registers for the controller,
+ * and brings the interface up.         Returns the link status, meaning
+ * that it returns success if the link is up, failure otherwise.
+ * This allows u-boot to find the first active controller.
  */
-static uint mii_88E1121_set_led (uint mii_reg, struct tsec_private *priv)
+static int tsec_init(struct eth_device *dev, bd_t * bd)
 {
-       uint pg;
+       uint tempval;
+       char tmpbuf[MAC_ADDR_LEN];
+       int i;
+       struct tsec_private *priv = (struct tsec_private *)dev->priv;
+       tsec_t *regs = priv->regs;
 
-       /* Switch the page to access the led register */
-       pg = read_phy_reg(priv, MIIM_88E1121_PHY_PAGE);
-       write_phy_reg(priv, MIIM_88E1121_PHY_PAGE, MIIM_88E1121_PHY_LED_PAGE);
+       /* Make sure the controller is stopped */
+       tsec_halt(dev);
 
-       /* Configure leds */
-       write_phy_reg(priv, MIIM_88E1121_PHY_LED_CTRL,
-                     MIIM_88E1121_PHY_LED_DEF);
+       /* Init MACCFG2.  Defaults to GMII */
+       out_be32(&regs->maccfg2, MACCFG2_INIT_SETTINGS);
 
-       /* Restore the page pointer */
-       write_phy_reg(priv, MIIM_88E1121_PHY_PAGE, pg);
-       return 0;
-}
+       /* Init ECNTRL */
+       out_be32(&regs->ecntrl, ECNTRL_INIT_SETTINGS);
 
-static struct phy_info phy_info_M88E1121R = {
-       0x01410cb,
-       "Marvell 88E1121R",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               /* Reset and configure the PHY */
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
-               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-               /* Configure leds */
-               {MIIM_88E1121_PHY_LED_CTRL, miim_read, &mii_88E1121_set_led},
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               /* Disable IRQs and de-assert interrupt */
-               {MIIM_88E1121_PHY_IRQ_EN, 0, NULL},
-               {MIIM_88E1121_PHY_IRQ_STATUS, miim_read, NULL},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               {MIIM_STATUS, miim_read, &mii_parse_link},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
+       /* Copy the station address into the address registers.
+        * Backwards, because little endian MACS are dumb */
+       for (i = 0; i < MAC_ADDR_LEN; i++)
+               tmpbuf[MAC_ADDR_LEN - 1 - i] = dev->enetaddr[i];
 
-static unsigned int m88e1145_setmode(uint mii_reg, struct tsec_private *priv)
-{
-       uint mii_data = read_phy_reg(priv, mii_reg);
-
-       /* Setting MIIM_88E1145_PHY_EXT_CR */
-       if (priv->flags & TSEC_REDUCED)
-               return mii_data |
-                   MIIM_M88E1145_RGMII_RX_DELAY | MIIM_M88E1145_RGMII_TX_DELAY;
-       else
-               return mii_data;
-}
+       tempval = (tmpbuf[0] << 24) | (tmpbuf[1] << 16) | (tmpbuf[2] << 8) |
+                 tmpbuf[3];
 
-static struct phy_info phy_info_M88E1145 = {
-       0x01410cd,
-       "Marvell 88E1145",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               /* Reset the PHY */
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-
-               /* Errata E0, E1 */
-               {29, 0x001b, NULL},
-               {30, 0x418f, NULL},
-               {29, 0x0016, NULL},
-               {30, 0xa2da, NULL},
-
-               /* Configure the PHY */
-               {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
-               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-               {MIIM_88E1011_PHY_SCR, MIIM_88E1011_PHY_MDI_X_AUTO, NULL},
-               {MIIM_88E1145_PHY_EXT_CR, 0, &m88e1145_setmode},
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, NULL},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               {MIIM_88E1111_PHY_LED_CONTROL, MIIM_88E1111_PHY_LED_DIRECT, NULL},
-               /* Read the Status */
-               {MIIM_88E1011_PHY_STATUS, miim_read, &mii_parse_88E1011_psr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
+       out_be32(&regs->macstnaddr1, tempval);
 
-static struct phy_info phy_info_cis8204 = {
-       0x3f11,
-       "Cicada Cis8204",
-       6,
-       (struct phy_cmd[]) {    /* config */
-               /* Override PHY config settings */
-               {MIIM_CIS8201_AUX_CONSTAT, MIIM_CIS8201_AUXCONSTAT_INIT, NULL},
-               /* Configure some basic stuff */
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {MIIM_CIS8204_SLED_CON, MIIM_CIS8204_SLEDCON_INIT,
-                &mii_cis8204_fixled},
-               {MIIM_CIS8204_EPHY_CON, MIIM_CIS8204_EPHYCON_INIT,
-                &mii_cis8204_setmode},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Read the Status (2x to make sure link is right) */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_CIS8201_AUX_CONSTAT, miim_read, &mii_parse_cis8201},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
+       tempval = *((uint *) (tmpbuf + 4));
 
-/* Cicada 8201 */
-static struct phy_info phy_info_cis8201 = {
-       0xfc41,
-       "CIS8201",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               /* Override PHY config settings */
-               {MIIM_CIS8201_AUX_CONSTAT, MIIM_CIS8201_AUXCONSTAT_INIT, NULL},
-               /* Set up the interface mode */
-               {MIIM_CIS8201_EXT_CON1, MIIM_CIS8201_EXTCON1_INIT, NULL},
-               /* Configure some basic stuff */
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Read the Status (2x to make sure link is right) */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_CIS8201_AUX_CONSTAT, miim_read, &mii_parse_cis8201},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
+       out_be32(&regs->macstnaddr2, tempval);
 
-static struct phy_info phy_info_VSC8211 = {
-       0xfc4b,
-       "Vitesse VSC8211",
-       4,
-       (struct phy_cmd[]) { /* config */
-               /* Override PHY config settings */
-               {MIIM_CIS8201_AUX_CONSTAT, MIIM_CIS8201_AUXCONSTAT_INIT, NULL},
-               /* Set up the interface mode */
-               {MIIM_CIS8201_EXT_CON1, MIIM_CIS8201_EXTCON1_INIT, NULL},
-               /* Configure some basic stuff */
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* startup */
-               /* Read the Status (2x to make sure link is right) */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_CIS8201_AUX_CONSTAT, miim_read, &mii_parse_cis8201},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* shutdown */
-               {miim_end,}
-       },
-};
+       /* Clear out (for the most part) the other registers */
+       init_registers(regs);
 
-static struct phy_info phy_info_VSC8244 = {
-       0x3f1b,
-       "Vitesse VSC8244",
-       6,
-       (struct phy_cmd[]) {    /* config */
-               /* Override PHY config settings */
-               /* Configure some basic stuff */
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Read the Status (2x to make sure link is right) */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_VSC8244_AUX_CONSTAT, miim_read, &mii_parse_vsc8244},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
+       /* Ready the device for tx/rx */
+       startup_tsec(dev);
 
-static struct phy_info phy_info_VSC8641 = {
-       0x7043,
-       "Vitesse VSC8641",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               /* Configure some basic stuff */
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Read the Status (2x to make sure link is right) */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_VSC8244_AUX_CONSTAT, miim_read, &mii_parse_vsc8244},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
+       /* Start up the PHY */
+       phy_startup(priv->phydev);
 
-static struct phy_info phy_info_VSC8221 = {
-       0xfc55,
-       "Vitesse VSC8221",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               /* Configure some basic stuff */
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Read the Status (2x to make sure link is right) */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_VSC8244_AUX_CONSTAT, miim_read, &mii_parse_vsc8244},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
+       adjust_link(priv, priv->phydev);
 
-static struct phy_info phy_info_VSC8601 = {
-       0x00007042,
-       "Vitesse VSC8601",
-       4,
-       (struct phy_cmd[]) {     /* config */
-               /* Override PHY config settings */
-               /* Configure some basic stuff */
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-#ifdef CONFIG_SYS_VSC8601_SKEWFIX
-               {MIIM_VSC8601_EPHY_CON,MIIM_VSC8601_EPHY_CON_INIT_SKEW,NULL},
-#if defined(CONFIG_SYS_VSC8601_SKEW_TX) && defined(CONFIG_SYS_VSC8601_SKEW_RX)
-               {MIIM_EXT_PAGE_ACCESS,1,NULL},
-#define VSC8101_SKEW \
-       (CONFIG_SYS_VSC8601_SKEW_TX << 14) | (CONFIG_SYS_VSC8601_SKEW_RX << 12)
-               {MIIM_VSC8601_SKEW_CTRL,VSC8101_SKEW,NULL},
-               {MIIM_EXT_PAGE_ACCESS,0,NULL},
-#endif
-#endif
-               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_RESTART, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {     /* startup */
-               /* Read the Status (2x to make sure link is right) */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_VSC8244_AUX_CONSTAT, miim_read, &mii_parse_vsc8244},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {     /* shutdown */
-               {miim_end,}
-       },
-};
+       /* If there's no link, fail */
+       return priv->phydev->link ? 0 : -1;
+}
 
-static struct phy_info phy_info_dm9161 = {
-       0x0181b88,
-       "Davicom DM9161E",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               {MIIM_CONTROL, MIIM_DM9161_CR_STOP, NULL},
-               /* Do not bypass the scrambler/descrambler */
-               {MIIM_DM9161_SCR, MIIM_DM9161_SCR_INIT, NULL},
-               /* Clear 10BTCSR to default */
-               {MIIM_DM9161_10BTCSR, MIIM_DM9161_10BTCSR_INIT, NULL},
-               /* Configure some basic stuff */
-               {MIIM_CONTROL, MIIM_CR_INIT, NULL},
-               /* Restart Auto Negotiation */
-               {MIIM_CONTROL, MIIM_DM9161_CR_RSTAN, NULL},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_DM9161_SCSR, miim_read, &mii_parse_dm9161_scsr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
+static phy_interface_t tsec_get_interface(struct tsec_private *priv)
+{
+       tsec_t *regs = priv->regs;
+       u32 ecntrl;
 
-/* micrel KSZ804  */
-static struct phy_info phy_info_ksz804 =  {
-       0x0022151,
-       "Micrel KSZ804 PHY",
-       4,
-       (struct phy_cmd[]) { /* config */
-               {MII_BMCR, BMCR_RESET, NULL},
-               {MII_BMCR, BMCR_ANENABLE|BMCR_ANRESTART, NULL},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* startup */
-               {MII_BMSR, miim_read, NULL},
-               {MII_BMSR, miim_read, &mii_parse_sr},
-               {MII_BMSR, miim_read, &mii_parse_link},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* shutdown */
-               {miim_end,}
-       }
-};
+       ecntrl = in_be32(&regs->ecntrl);
+
+       if (ecntrl & ECNTRL_SGMII_MODE)
+               return PHY_INTERFACE_MODE_SGMII;
 
-/* a generic flavor.  */
-static struct phy_info phy_info_generic =  {
-       0,
-       "Unknown/Generic PHY",
-       32,
-       (struct phy_cmd[]) { /* config */
-               {MII_BMCR, BMCR_RESET, NULL},
-               {MII_BMCR, BMCR_ANENABLE|BMCR_ANRESTART, NULL},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* startup */
-               {MII_BMSR, miim_read, NULL},
-               {MII_BMSR, miim_read, &mii_parse_sr},
-               {MII_BMSR, miim_read, &mii_parse_link},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) { /* shutdown */
-               {miim_end,}
+       if (ecntrl & ECNTRL_TBI_MODE) {
+               if (ecntrl & ECNTRL_REDUCED_MODE)
+                       return PHY_INTERFACE_MODE_RTBI;
+               else
+                       return PHY_INTERFACE_MODE_TBI;
        }
-};
 
-static uint mii_parse_lxt971_sr2(uint mii_reg, struct tsec_private *priv)
-{
-       unsigned int speed;
-       if (priv->link) {
-               speed = mii_reg & MIIM_LXT971_SR2_SPEED_MASK;
-
-               switch (speed) {
-               case MIIM_LXT971_SR2_10HDX:
-                       priv->speed = 10;
-                       priv->duplexity = 0;
-                       break;
-               case MIIM_LXT971_SR2_10FDX:
-                       priv->speed = 10;
-                       priv->duplexity = 1;
-                       break;
-               case MIIM_LXT971_SR2_100HDX:
-                       priv->speed = 100;
-                       priv->duplexity = 0;
-                       break;
-               default:
-                       priv->speed = 100;
-                       priv->duplexity = 1;
+       if (ecntrl & ECNTRL_REDUCED_MODE) {
+               if (ecntrl & ECNTRL_REDUCED_MII_MODE)
+                       return PHY_INTERFACE_MODE_RMII;
+               else {
+                       phy_interface_t interface = priv->interface;
+
+                       /*
+                        * This isn't autodetected, so it must
+                        * be set by the platform code.
+                        */
+                       if ((interface == PHY_INTERFACE_MODE_RGMII_ID) ||
+                                (interface == PHY_INTERFACE_MODE_RGMII_TXID) ||
+                                (interface == PHY_INTERFACE_MODE_RGMII_RXID))
+                               return interface;
+
+                       return PHY_INTERFACE_MODE_RGMII;
                }
-       } else {
-               priv->speed = 0;
-               priv->duplexity = 0;
        }
 
-       return 0;
+       if (priv->flags & TSEC_GIGABIT)
+               return PHY_INTERFACE_MODE_GMII;
+
+       return PHY_INTERFACE_MODE_MII;
 }
 
-static struct phy_info phy_info_lxt971 = {
-       0x0001378e,
-       "LXT971",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               {MIIM_CR, MIIM_CR_INIT, mii_cr_init},   /* autonegotiate */
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup - enable interrupts */
-               /* { 0x12, 0x00f2, NULL }, */
-               {MIIM_STATUS, miim_read, NULL},
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               {MIIM_LXT971_SR2, miim_read, &mii_parse_lxt971_sr2},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown - disable interrupts */
-               {miim_end,}
-       },
-};
 
-/* Parse the DP83865's link and auto-neg status register for speed and duplex
- * information
+/* Discover which PHY is attached to the device, and configure it
+ * properly.  If the PHY is not recognized, then return 0
+ * (failure).  Otherwise, return 1
  */
-static uint mii_parse_dp83865_lanr(uint mii_reg, struct tsec_private *priv)
+static int init_phy(struct eth_device *dev)
 {
-       switch (mii_reg & MIIM_DP83865_SPD_MASK) {
-
-       case MIIM_DP83865_SPD_1000:
-               priv->speed = 1000;
-               break;
-
-       case MIIM_DP83865_SPD_100:
-               priv->speed = 100;
-               break;
-
-       default:
-               priv->speed = 10;
-               break;
+       struct tsec_private *priv = (struct tsec_private *)dev->priv;
+       struct phy_device *phydev;
+       tsec_t *regs = priv->regs;
+       u32 supported = (SUPPORTED_10baseT_Half |
+                       SUPPORTED_10baseT_Full |
+                       SUPPORTED_100baseT_Half |
+                       SUPPORTED_100baseT_Full);
 
-       }
+       if (priv->flags & TSEC_GIGABIT)
+               supported |= SUPPORTED_1000baseT_Full;
 
-       if (mii_reg & MIIM_DP83865_DPX_FULL)
-               priv->duplexity = 1;
-       else
-               priv->duplexity = 0;
+       /* Assign a Physical address to the TBI */
+       out_be32(&regs->tbipa, CONFIG_SYS_TBIPA_VALUE);
 
-       return 0;
-}
+       priv->interface = tsec_get_interface(priv);
 
-static struct phy_info phy_info_dp83865 = {
-       0x20005c7,
-       "NatSemi DP83865",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               {MIIM_CONTROL, MIIM_DP83865_CR_INIT, NULL},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the link and auto-neg status */
-               {MIIM_DP83865_LANR, miim_read, &mii_parse_dp83865_lanr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
+       if (priv->interface == PHY_INTERFACE_MODE_SGMII)
+               tsec_configure_serdes(priv);
 
-static struct phy_info phy_info_rtl8211b = {
-       0x001cc91,
-       "RealTek RTL8211B",
-       4,
-       (struct phy_cmd[]) {    /* config */
-               /* Reset and configure the PHY */
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
-               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* startup */
-               /* Status is read once to clear old link state */
-               {MIIM_STATUS, miim_read, NULL},
-               /* Auto-negotiate */
-               {MIIM_STATUS, miim_read, &mii_parse_sr},
-               /* Read the status */
-               {MIIM_RTL8211B_PHY_STATUS, miim_read, &mii_parse_RTL8211B_sr},
-               {miim_end,}
-       },
-       (struct phy_cmd[]) {    /* shutdown */
-               {miim_end,}
-       },
-};
+       phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface);
 
-static struct phy_info *phy_info[] = {
-       &phy_info_cis8204,
-       &phy_info_cis8201,
-       &phy_info_BCM5461S,
-       &phy_info_BCM5464S,
-       &phy_info_BCM5482S,
-       &phy_info_M88E1011S,
-       &phy_info_M88E1111S,
-       &phy_info_M88E1118,
-       &phy_info_M88E1121R,
-       &phy_info_M88E1145,
-       &phy_info_M88E1149S,
-       &phy_info_dm9161,
-       &phy_info_ksz804,
-       &phy_info_lxt971,
-       &phy_info_VSC8211,
-       &phy_info_VSC8244,
-       &phy_info_VSC8601,
-       &phy_info_VSC8641,
-       &phy_info_VSC8221,
-       &phy_info_dp83865,
-       &phy_info_rtl8211b,
-       &phy_info_generic,      /* must be last; has ID 0 and 32 bit mask */
-       NULL
-};
+       phydev->supported &= supported;
+       phydev->advertising = phydev->supported;
 
-/* Grab the identifier of the device's PHY, and search through
- * all of the known PHYs to see if one matches.         If so, return
- * it, if not, return NULL
- */
-static struct phy_info *get_phy_info(struct eth_device *dev)
-{
-       struct tsec_private *priv = (struct tsec_private *)dev->priv;
-       uint phy_reg, phy_ID;
-       int i;
-       struct phy_info *theInfo = NULL;
-
-       /* Grab the bits from PHYIR1, and put them in the upper half */
-       phy_reg = read_phy_reg(priv, MIIM_PHYIR1);
-       phy_ID = (phy_reg & 0xffff) << 16;
-
-       /* Grab the bits from PHYIR2, and put them in the lower half */
-       phy_reg = read_phy_reg(priv, MIIM_PHYIR2);
-       phy_ID |= (phy_reg & 0xffff);
-
-       /* loop through all the known PHY types, and find one that */
-       /* matches the ID we read from the PHY. */
-       for (i = 0; phy_info[i]; i++) {
-               if (phy_info[i]->id == (phy_ID >> phy_info[i]->shift)) {
-                       theInfo = phy_info[i];
-                       break;
-               }
-       }
+       priv->phydev = phydev;
 
-       if (theInfo == &phy_info_generic) {
-               printf("%s: No support for PHY id %x; assuming generic\n",
-                       dev->name, phy_ID);
-       } else {
-               debug("%s: PHY is %s (%x)\n", dev->name, theInfo->name, phy_ID);
-       }
+       phy_config(phydev);
 
-       return theInfo;
+       return 1;
 }
 
-/* Execute the given series of commands on the given device's
- * PHY, running functions as necessary
+/* Initialize device structure. Returns success if PHY
+ * initialization succeeded (i.e. if it recognizes the PHY)
  */
-static void phy_run_commands(struct tsec_private *priv, struct phy_cmd *cmd)
+static int tsec_initialize(bd_t *bis, struct tsec_info_struct *tsec_info)
 {
+       struct eth_device *dev;
        int i;
-       uint result;
-       volatile tsec_mdio_t *phyregs = priv->phyregs;
-
-       phyregs->miimcfg = MIIMCFG_RESET;
+       struct tsec_private *priv;
 
-       phyregs->miimcfg = MIIMCFG_INIT_VALUE;
+       dev = (struct eth_device *)malloc(sizeof *dev);
 
-       while (phyregs->miimind & MIIMIND_BUSY) ;
+       if (NULL == dev)
+               return 0;
 
-       for (i = 0; cmd->mii_reg != miim_end; i++) {
-               if (cmd->mii_data == miim_read) {
-                       result = read_phy_reg(priv, cmd->mii_reg);
+       memset(dev, 0, sizeof *dev);
 
-                       if (cmd->funct != NULL)
-                               (*(cmd->funct)) (result, priv);
+       priv = (struct tsec_private *)malloc(sizeof(*priv));
 
-               } else {
-                       if (cmd->funct != NULL)
-                               result = (*(cmd->funct)) (cmd->mii_reg, priv);
-                       else
-                               result = cmd->mii_data;
+       if (NULL == priv)
+               return 0;
 
-                       write_phy_reg(priv, cmd->mii_reg, result);
+       privlist[num_tsecs++] = priv;
+       priv->regs = tsec_info->regs;
+       priv->phyregs_sgmii = tsec_info->miiregs_sgmii;
 
-               }
-               cmd++;
-       }
-}
+       priv->phyaddr = tsec_info->phyaddr;
+       priv->flags = tsec_info->flags;
 
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
-       && !defined(BITBANGMII)
+       sprintf(dev->name, tsec_info->devname);
+       priv->interface = tsec_info->interface;
+       priv->bus = miiphy_get_dev_by_name(tsec_info->mii_devname);
+       dev->iobase = 0;
+       dev->priv = priv;
+       dev->init = tsec_init;
+       dev->halt = tsec_halt;
+       dev->send = tsec_send;
+       dev->recv = tsec_recv;
+#ifdef CONFIG_MCAST_TFTP
+       dev->mcast = tsec_mcast_addr;
+#endif
 
-/*
- * Read a MII PHY register.
- *
- * Returns:
- *  0 on success
- */
-static int tsec_miiphy_read(const char *devname, unsigned char addr,
-                           unsigned char reg, unsigned short *value)
-{
-       unsigned short ret;
-       struct tsec_private *priv = privlist[0];
+       /* Tell u-boot to get the addr from the env */
+       for (i = 0; i < 6; i++)
+               dev->enetaddr[i] = 0;
 
-       if (NULL == priv) {
-               printf("Can't read PHY at address %d\n", addr);
-               return -1;
-       }
+       eth_register(dev);
 
-       ret = (unsigned short)tsec_local_mdio_read(priv->phyregs, addr, reg);
-       *value = ret;
+       /* Reset the MAC */
+       setbits_be32(&priv->regs->maccfg1, MACCFG1_SOFT_RESET);
+       udelay(2);  /* Soft Reset must be asserted for 3 TX clocks */
+       clrbits_be32(&priv->regs->maccfg1, MACCFG1_SOFT_RESET);
 
-       return 0;
+       /* Try to initialize PHY here, and return */
+       return init_phy(dev);
 }
 
 /*
- * Write a MII PHY register.
+ * Initialize all the TSEC devices
  *
- * Returns:
- *  0 on success
+ * Returns the number of TSEC devices that were initialized
  */
-static int tsec_miiphy_write(const char *devname, unsigned char addr,
-                            unsigned char reg, unsigned short value)
+int tsec_eth_init(bd_t *bis, struct tsec_info_struct *tsecs, int num)
 {
-       struct tsec_private *priv = privlist[0];
+       int i;
+       int ret, count = 0;
 
-       if (NULL == priv) {
-               printf("Can't write PHY at address %d\n", addr);
-               return -1;
+       for (i = 0; i < num; i++) {
+               ret = tsec_initialize(bis, &tsecs[i]);
+               if (ret > 0)
+                       count += ret;
        }
 
-       tsec_local_mdio_write(priv->phyregs, addr, reg, value);
-
-       return 0;
+       return count;
 }
 
-#endif
-
-#ifdef CONFIG_MCAST_TFTP
-
-/* CREDITS: linux gianfar driver, slightly adjusted... thanx. */
-
-/* Set the appropriate hash bit for the given addr */
-
-/* The algorithm works like so:
- * 1) Take the Destination Address (ie the multicast address), and
- * do a CRC on it (little endian), and reverse the bits of the
- * result.
- * 2) Use the 8 most significant bits as a hash into a 256-entry
- * table.  The table is controlled through 8 32-bit registers:
- * gaddr0-7.  gaddr0's MSB is entry 0, and gaddr7's LSB is
- * gaddr7.  This means that the 3 most significant bits in the
- * hash index which gaddr register to use, and the 5 other bits
- * indicate which bit (assuming an IBM numbering scheme, which
- * for PowerPC (tm) is usually the case) in the tregister holds
- * the entry. */
-static int
-tsec_mcast_addr (struct eth_device *dev, u8 mcast_mac, u8 set)
+int tsec_standard_init(bd_t *bis)
 {
-       struct tsec_private *priv = privlist[1];
-       volatile tsec_t *regs = priv->regs;
-       volatile u32  *reg_array, value;
-       u8 result, whichbit, whichreg;
+       struct fsl_pq_mdio_info info;
 
-       result = (u8)((ether_crc(MAC_ADDR_LEN,mcast_mac) >> 24) & 0xff);
-       whichbit = result & 0x1f;       /* the 5 LSB = which bit to set */
-       whichreg = result >> 5;         /* the 3 MSB = which reg to set it in */
-       value = (1 << (31-whichbit));
+       info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       info.name = DEFAULT_MII_NAME;
 
-       reg_array = &(regs->hash.gaddr0);
+       fsl_pq_mdio_init(bis, &info);
 
-       if (set) {
-               reg_array[whichreg] |= value;
-       } else {
-               reg_array[whichreg] &= ~value;
-       }
-       return 0;
+       return tsec_eth_init(bis, tsec_info, ARRAY_SIZE(tsec_info));
 }
-#endif /* Multicast TFTP ? */
+
index a4624e1734df9977fe210eb57e13dcf7a6698ad8..5933bddce54861d94b7500967cafff998fd2b94f 100644 (file)
@@ -175,9 +175,9 @@ static u16 read_srom_word(long, int);
 static void uli526x_descriptor_init(struct uli526x_board_info *, unsigned long);
 static void allocate_rx_buffer(struct uli526x_board_info *);
 static void update_cr6(u32, unsigned long);
-static u16 phy_read(unsigned long, u8, u8, u32);
+static u16 uli_phy_read(unsigned long, u8, u8, u32);
 static u16 phy_readby_cr10(unsigned long, u8, u8);
-static void phy_write(unsigned long, u8, u8, u16, u32);
+static void uli_phy_write(unsigned long, u8, u8, u16, u32);
 static void phy_writeby_cr10(unsigned long, u8, u8, u16);
 static void phy_write_1bit(unsigned long, u32, u32);
 static u16 phy_read_1bit(unsigned long, u32);
@@ -349,7 +349,7 @@ static void uli526x_disable(struct eth_device *dev)
                /* Reset & stop ULI526X board */
                outl(ULI526X_RESET, db->ioaddr + DCR0);
                udelay(5);
-               phy_write(db->ioaddr, db->phy_addr, 0, 0x8000, db->chip_id);
+               uli_phy_write(db->ioaddr, db->phy_addr, 0, 0x8000, db->chip_id);
 
                /* reset the board */
                db->cr6_data &= ~(CR6_RXSC | CR6_TXSC); /* Disable Tx/Rx */
@@ -385,7 +385,7 @@ static void uli526x_init(struct eth_device *dev)
        db->tx_packet_cnt = 0;
        for (phy_tmp = 0; phy_tmp < 32; phy_tmp++) {
                /* peer add */
-               phy_value = phy_read(db->ioaddr, phy_tmp, 3, db->chip_id);
+               phy_value = uli_phy_read(db->ioaddr, phy_tmp, 3, db->chip_id);
                if (phy_value != 0xffff && phy_value != 0) {
                        db->phy_addr = phy_tmp;
                        break;
@@ -404,10 +404,10 @@ static void uli526x_init(struct eth_device *dev)
 
        if (!(inl(db->ioaddr + DCR12) & 0x8)) {
                /* Phyxcer capability setting */
-               phy_reg_reset = phy_read(db->ioaddr,
+               phy_reg_reset = uli_phy_read(db->ioaddr,
                        db->phy_addr, 0, db->chip_id);
                phy_reg_reset = (phy_reg_reset | 0x8000);
-               phy_write(db->ioaddr, db->phy_addr, 0,
+               uli_phy_write(db->ioaddr, db->phy_addr, 0,
                        phy_reg_reset, db->chip_id);
                udelay(500);
 
@@ -781,7 +781,8 @@ static void uli526x_set_phyxcer(struct uli526x_board_info *db)
        u16 phy_reg;
 
        /* Phyxcer capability setting */
-       phy_reg = phy_read(db->ioaddr, db->phy_addr, 4, db->chip_id) & ~0x01e0;
+       phy_reg = uli_phy_read(db->ioaddr,
+                       db->phy_addr, 4, db->chip_id) & ~0x01e0;
 
        if (db->media_mode & ULI526X_AUTO) {
                /* AUTO Mode */
@@ -802,10 +803,10 @@ static void uli526x_set_phyxcer(struct uli526x_board_info *db)
                phy_reg |= db->PHY_reg4;
                db->media_mode |= ULI526X_AUTO;
        }
-       phy_write(db->ioaddr, db->phy_addr, 4, phy_reg, db->chip_id);
+       uli_phy_write(db->ioaddr, db->phy_addr, 4, phy_reg, db->chip_id);
 
        /* Restart Auto-Negotiation */
-       phy_write(db->ioaddr, db->phy_addr, 0, 0x1200, db->chip_id);
+       uli_phy_write(db->ioaddr, db->phy_addr, 0, 0x1200, db->chip_id);
        udelay(50);
 }
 
@@ -813,7 +814,7 @@ static void uli526x_set_phyxcer(struct uli526x_board_info *db)
  *     Write a word to Phy register
  */
 
-static void phy_write(unsigned long iobase, u8 phy_addr, u8 offset,
+static void uli_phy_write(unsigned long iobase, u8 phy_addr, u8 offset,
        u16 phy_data, u32 chip_id)
 {
        u16 i;
@@ -862,7 +863,8 @@ static void phy_write(unsigned long iobase, u8 phy_addr, u8 offset,
  *     Read a word data from phy register
  */
 
-static u16 phy_read(unsigned long iobase, u8 phy_addr, u8 offset, u32 chip_id)
+static u16 uli_phy_read(unsigned long iobase, u8 phy_addr, u8 offset,
+                       u32 chip_id)
 {
        int i;
        u16 phy_data;
index dc34bd666938f74079008bdd41d0ee202a74fb19..ab461b45ac11810f98474e498c0bff042068fb2c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2010 Freescale Semiconductor, Inc.
+ * Copyright 2007-2011 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
@@ -223,6 +223,7 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info)
        u32 cfg_data = (u32)&((ccsr_fsl_pci_t *)pci_info->regs)->cfg_data;
        u16 temp16;
        u32 temp32;
+       u32 block_rev;
        int enabled, r, inbound = 0;
        u16 ltssm;
        u8 temp8, pcie_cap;
@@ -232,13 +233,20 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info)
 
        /* Initialize ATMU registers based on hose regions and flags */
        volatile pot_t *po = &pci->pot[1];      /* skip 0 */
-       volatile pit_t *pi = &pci->pit[2];      /* ranges from: 3 to 1 */
+       volatile pit_t *pi;
 
        u64 out_hi = 0, out_lo = -1ULL;
        u32 pcicsrbar, pcicsrbar_sz;
 
        pci_setup_indirect(hose, cfg_addr, cfg_data);
 
+       block_rev = in_be32(&pci->block_rev1);
+       if (PEX_IP_BLK_REV_2_2 <= block_rev) {
+               pi = &pci->pit[2];      /* 0xDC0 */
+       } else {
+               pi = &pci->pit[3];      /* 0xDE0 */
+       }
+
        /* Handle setup of outbound windows first */
        for (r = 0; r < hose->region_count; r++) {
                unsigned long flags = hose->regions[r].flags;
index 7924ac101ca3e5d81a34fcb6dae1d4c073990aa2..df99dfa73f72651654a2e29a57a9d630ded1216f 100644 (file)
 
 #include <common.h>
 #include <asm/io.h>
-#include "ftpmu010.h"
-
-static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
+#include <faraday/ftpmu010.h>
 
+/* OSCC: OSC Control Register */
 void ftpmu010_32768osc_enable(void)
 {
+       static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
        unsigned int oscc;
 
        /* enable the 32768Hz oscillator */
@@ -46,8 +46,31 @@ void ftpmu010_32768osc_enable(void)
        writel(oscc, &pmu->OSCC);
 }
 
+/* MFPSR: Multi-Function Port Setting Register */
+void ftpmu010_mfpsr_select_dev(unsigned int dev)
+{
+       static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
+       unsigned int mfpsr;
+
+       mfpsr = readl(&pmu->MFPSR);
+       mfpsr |= dev;
+       writel(mfpsr, &pmu->MFPSR);
+}
+
+void ftpmu010_mfpsr_diselect_dev(unsigned int dev)
+{
+       static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
+       unsigned int mfpsr;
+
+       mfpsr = readl(&pmu->MFPSR);
+       mfpsr &= ~dev;
+       writel(mfpsr, &pmu->MFPSR);
+}
+
+/* PDLLCR0: PLL/DLL Control Register 0 */
 void ftpmu010_dlldis_disable(void)
 {
+       static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
        unsigned int pdllcr0;
 
        pdllcr0 = readl(&pmu->PDLLCR0);
@@ -57,9 +80,21 @@ void ftpmu010_dlldis_disable(void)
 
 void ftpmu010_sdram_clk_disable(unsigned int cr0)
 {
+       static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
        unsigned int pdllcr0;
 
        pdllcr0 = readl(&pmu->PDLLCR0);
        pdllcr0 |= FTPMU010_PDLLCR0_HCLKOUTDIS(cr0);
        writel(pdllcr0, &pmu->PDLLCR0);
 }
+
+/* SDRAMHTC: SDRAM Signal Hold Time Control */
+void ftpmu010_sdramhtc_set(unsigned int val)
+{
+       static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
+       unsigned int sdramhtc;
+
+       sdramhtc = readl(&pmu->SDRAMHTC);
+       sdramhtc |= val;
+       writel(sdramhtc, &pmu->SDRAMHTC);
+}
index 282ab237516d89876d5b07a9526bcecd2f25b24a..1ecb1379a5c92ed80c61d0fdea47e4600b246471 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2010 Freescale Semiconductor, Inc.
+ * Copyright (C) 2006-2011 Freescale Semiconductor, Inc.
  *
  * Dave Liu <daveliu@freescale.com>
  *
@@ -30,6 +30,7 @@
 #include "uec.h"
 #include "uec_phy.h"
 #include "miiphy.h"
+#include <phy.h>
 
 /* Default UTBIPAR SMI address */
 #ifndef CONFIG_UTBIPAR_INIT_TBIPA
@@ -67,9 +68,6 @@ static uec_info_t uec_info[] = {
 
 static struct eth_device *devlist[MAXCONTROLLERS];
 
-u16 phy_read (struct uec_mii_info *mii_info, u16 regnum);
-void phy_write (struct uec_mii_info *mii_info, u16 regnum, u16 val);
-
 static int uec_mac_enable(uec_private_t *uec, comm_dir_e mode)
 {
        uec_t           *uec_regs;
@@ -324,9 +322,9 @@ static int uec_set_mac_duplex(uec_private_t *uec, int duplex)
 }
 
 static int uec_set_mac_if_mode(uec_private_t *uec,
-               enum fsl_phy_enet_if if_mode, int speed)
+               phy_interface_t if_mode, int speed)
 {
-       enum fsl_phy_enet_if    enet_if_mode;
+       phy_interface_t         enet_if_mode;
        uec_info_t              *uec_info;
        uec_t                   *uec_regs;
        u32                     upsmr;
@@ -348,15 +346,15 @@ static int uec_set_mac_if_mode(uec_private_t *uec,
        upsmr &= ~(UPSMR_RPM | UPSMR_TBIM | UPSMR_R10M | UPSMR_RMM);
 
        switch (speed) {
-               case 10:
+               case SPEED_10:
                        maccfg2 |= MACCFG2_INTERFACE_MODE_NIBBLE;
                        switch (enet_if_mode) {
-                               case MII:
+                               case PHY_INTERFACE_MODE_MII:
                                        break;
-                               case RGMII:
+                               case PHY_INTERFACE_MODE_RGMII:
                                        upsmr |= (UPSMR_RPM | UPSMR_R10M);
                                        break;
-                               case RMII:
+                               case PHY_INTERFACE_MODE_RMII:
                                        upsmr |= (UPSMR_R10M | UPSMR_RMM);
                                        break;
                                default:
@@ -364,15 +362,15 @@ static int uec_set_mac_if_mode(uec_private_t *uec,
                                        break;
                        }
                        break;
-               case 100:
+               case SPEED_100:
                        maccfg2 |= MACCFG2_INTERFACE_MODE_NIBBLE;
                        switch (enet_if_mode) {
-                               case MII:
+                               case PHY_INTERFACE_MODE_MII:
                                        break;
-                               case RGMII:
+                               case PHY_INTERFACE_MODE_RGMII:
                                        upsmr |= UPSMR_RPM;
                                        break;
-                               case RMII:
+                               case PHY_INTERFACE_MODE_RMII:
                                        upsmr |= UPSMR_RMM;
                                        break;
                                default:
@@ -380,23 +378,24 @@ static int uec_set_mac_if_mode(uec_private_t *uec,
                                        break;
                        }
                        break;
-               case 1000:
+               case SPEED_1000:
                        maccfg2 |= MACCFG2_INTERFACE_MODE_BYTE;
                        switch (enet_if_mode) {
-                               case GMII:
+                               case PHY_INTERFACE_MODE_GMII:
                                        break;
-                               case TBI:
+                               case PHY_INTERFACE_MODE_TBI:
                                        upsmr |= UPSMR_TBIM;
                                        break;
-                               case RTBI:
+                               case PHY_INTERFACE_MODE_RTBI:
                                        upsmr |= (UPSMR_RPM | UPSMR_TBIM);
                                        break;
-                               case RGMII_RXID:
-                               case RGMII_ID:
-                               case RGMII:
+                               case PHY_INTERFACE_MODE_RGMII_RXID:
+                               case PHY_INTERFACE_MODE_RGMII_TXID:
+                               case PHY_INTERFACE_MODE_RGMII_ID:
+                               case PHY_INTERFACE_MODE_RGMII:
                                        upsmr |= UPSMR_RPM;
                                        break;
-                               case SGMII:
+                               case PHY_INTERFACE_MODE_SGMII:
                                        upsmr |= UPSMR_SGMM;
                                        break;
                                default:
@@ -521,7 +520,7 @@ static void adjust_link(struct eth_device *dev)
        struct uec_mii_info     *mii_info = uec->mii_info;
 
        extern void change_phy_interface_mode(struct eth_device *dev,
-                                enum fsl_phy_enet_if mode, int speed);
+                                phy_interface_t mode, int speed);
        uec_regs = uec->uec_regs;
 
        if (mii_info->link) {
@@ -539,19 +538,19 @@ static void adjust_link(struct eth_device *dev)
                }
 
                if (mii_info->speed != uec->oldspeed) {
-                       enum fsl_phy_enet_if    mode = \
+                       phy_interface_t mode =
                                uec->uec_info->enet_interface_type;
                        if (uec->uec_info->uf_info.eth_type == GIGA_ETH) {
                                switch (mii_info->speed) {
-                               case 1000:
+                               case SPEED_1000:
                                        break;
-                               case 100:
+                               case SPEED_100:
                                        printf ("switching to rgmii 100\n");
-                                       mode = RGMII;
+                                       mode = PHY_INTERFACE_MODE_RGMII;
                                        break;
-                               case 10:
+                               case SPEED_10:
                                        printf ("switching to rgmii 10\n");
-                                       mode = RGMII;
+                                       mode = PHY_INTERFACE_MODE_RGMII;
                                        break;
                                default:
                                        printf("%s: Ack,Speed(%d)is illegal\n",
@@ -588,9 +587,27 @@ static void phy_change(struct eth_device *dev)
 {
        uec_private_t   *uec = (uec_private_t *)dev->priv;
 
+#if defined(CONFIG_P1012) || defined(CONFIG_P1016) || \
+    defined(CONFIG_P1021) || defined(CONFIG_P1025)
+       ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+       /* QE9 and QE12 need to be set for enabling QE MII managment signals */
+       setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_QE9);
+       setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_QE12);
+#endif
+
        /* Update the link, speed, duplex */
        uec->mii_info->phyinfo->read_status(uec->mii_info);
 
+#if defined(CONFIG_P1012) || defined(CONFIG_P1016) || \
+    defined(CONFIG_P1021) || defined(CONFIG_P1025)
+       /*
+        * QE12 is muxed with LBCTL, it needs to be released for enabling
+        * LBCTL signal for LBC usage.
+        */
+       clrbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_QE12);
+#endif
+
        /* Adjust the interface according to speed */
        adjust_link(dev);
 }
@@ -1097,8 +1114,8 @@ static int uec_startup(uec_private_t *uec)
        out_be32(&uec_regs->utbipar, utbipar);
 
        /* Configure the TBI for SGMII operation */
-       if ((uec->uec_info->enet_interface_type == SGMII) &&
-          (uec->uec_info->speed == 1000)) {
+       if ((uec->uec_info->enet_interface_type == PHY_INTERFACE_MODE_SGMII) &&
+          (uec->uec_info->speed == SPEED_1000)) {
                uec_write_phy_reg(uec->dev, uec_regs->utbipar,
                        ENET_TBI_MII_ANA, TBIANA_SETTINGS);
 
@@ -1198,10 +1215,21 @@ static int uec_init(struct eth_device* dev, bd_t *bd)
        uec_private_t           *uec;
        int                     err, i;
        struct phy_info         *curphy;
+#if defined(CONFIG_P1012) || defined(CONFIG_P1016) || \
+    defined(CONFIG_P1021) || defined(CONFIG_P1025)
+       ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+#endif
 
        uec = (uec_private_t *)dev->priv;
 
        if (uec->the_first_run == 0) {
+#if defined(CONFIG_P1012) || defined(CONFIG_P1016) || \
+    defined(CONFIG_P1021) || defined(CONFIG_P1025)
+       /* QE9 and QE12 need to be set for enabling QE MII managment signals */
+       setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_QE9);
+       setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_QE12);
+#endif
+
                err = init_phy(dev);
                if (err) {
                        printf("%s: Cannot initialize PHY, aborting.\n",
@@ -1228,6 +1256,12 @@ static int uec_init(struct eth_device* dev, bd_t *bd)
                        udelay(100000);
                } while (1);
 
+#if defined(CONFIG_P1012) || defined(CONFIG_P1016) || \
+    defined(CONFIG_P1021) || defined(CONFIG_P1025)
+               /* QE12 needs to be released for enabling LBCTL signal*/
+               clrbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_QE12);
+#endif
+
                if (err || i <= 0)
                        printf("warning: %s: timeout on PHY link\n", dev->name);
 
index 94eb9a26d7f95d8c9cf2111f0119d4c19a6569d0..e63bf3a65220d55f34a970a92fb5278a8178d215 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "qe.h"
 #include "uccf.h"
+#include <phy.h>
 #include <asm/fsl_enet.h>
 
 #define MAX_TX_THREADS                         8
@@ -691,7 +692,7 @@ typedef struct uec_info {
        u16                             rx_bd_ring_len;
        u16                             tx_bd_ring_len;
        u8                              phy_address;
-       enum fsl_phy_enet_if            enet_interface_type;
+       phy_interface_t                 enet_interface_type;
        int                             speed;
 } uec_info_t;
 
index 55c262294299e57d547d80fa298f6800f231e119..e26218be88afc64e41d35c0fd99b0927bf33824f 100644 (file)
@@ -25,6 +25,7 @@
 #include "uec.h"
 #include "uec_phy.h"
 #include "miiphy.h"
+#include <phy.h>
 
 #define ugphy_printk(format, arg...)  \
        printf(format "\n", ## arg)
@@ -121,8 +122,8 @@ static int gbit_config_aneg (struct uec_mii_info *mii_info);
 static int genmii_config_aneg (struct uec_mii_info *mii_info);
 static int genmii_update_link (struct uec_mii_info *mii_info);
 static int genmii_read_status (struct uec_mii_info *mii_info);
-u16 phy_read (struct uec_mii_info *mii_info, u16 regnum);
-void phy_write (struct uec_mii_info *mii_info, u16 regnum, u16 val);
+u16 uec_phy_read(struct uec_mii_info *mii_info, u16 regnum);
+void uec_phy_write(struct uec_mii_info *mii_info, u16 regnum, u16 val);
 
 /* Write value to the PHY for this device to the register at regnum, */
 /* waiting until the write is done before it returns.  All PHY */
@@ -242,7 +243,7 @@ static void config_genmii_advert (struct uec_mii_info *mii_info)
        advertise = mii_info->advertising;
 
        /* Setup standard advertisement */
-       adv = phy_read (mii_info, MII_ADVERTISE);
+       adv = uec_phy_read(mii_info, MII_ADVERTISE);
        adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
        if (advertise & ADVERTISED_10baseT_Half)
                adv |= ADVERTISE_10HALF;
@@ -252,7 +253,7 @@ static void config_genmii_advert (struct uec_mii_info *mii_info)
                adv |= ADVERTISE_100HALF;
        if (advertise & ADVERTISED_100baseT_Full)
                adv |= ADVERTISE_100FULL;
-       phy_write (mii_info, MII_ADVERTISE, adv);
+       uec_phy_write(mii_info, MII_ADVERTISE, adv);
 }
 
 static void genmii_setup_forced (struct uec_mii_info *mii_info)
@@ -260,7 +261,7 @@ static void genmii_setup_forced (struct uec_mii_info *mii_info)
        u16 ctrl;
        u32 features = mii_info->phyinfo->features;
 
-       ctrl = phy_read (mii_info, MII_BMCR);
+       ctrl = uec_phy_read(mii_info, MII_BMCR);
 
        ctrl &= ~(BMCR_FULLDPLX | BMCR_SPEED100 |
                  BMCR_SPEED1000 | BMCR_ANENABLE);
@@ -290,7 +291,7 @@ static void genmii_setup_forced (struct uec_mii_info *mii_info)
                break;
        }
 
-       phy_write (mii_info, MII_BMCR, ctrl);
+       uec_phy_write(mii_info, MII_BMCR, ctrl);
 }
 
 /* Enable and Restart Autonegotiation */
@@ -298,9 +299,9 @@ static void genmii_restart_aneg (struct uec_mii_info *mii_info)
 {
        u16 ctl;
 
-       ctl = phy_read (mii_info, MII_BMCR);
+       ctl = uec_phy_read(mii_info, MII_BMCR);
        ctl |= (BMCR_ANENABLE | BMCR_ANRESTART);
-       phy_write (mii_info, MII_BMCR, ctl);
+       uec_phy_write(mii_info, MII_BMCR, ctl);
 }
 
 static int gbit_config_aneg (struct uec_mii_info *mii_info)
@@ -313,14 +314,14 @@ static int gbit_config_aneg (struct uec_mii_info *mii_info)
                config_genmii_advert (mii_info);
                advertise = mii_info->advertising;
 
-               adv = phy_read (mii_info, MII_CTRL1000);
+               adv = uec_phy_read(mii_info, MII_CTRL1000);
                adv &= ~(ADVERTISE_1000FULL |
                         ADVERTISE_1000HALF);
                if (advertise & SUPPORTED_1000baseT_Half)
                        adv |= ADVERTISE_1000HALF;
                if (advertise & SUPPORTED_1000baseT_Full)
                        adv |= ADVERTISE_1000FULL;
-               phy_write (mii_info, MII_CTRL1000, adv);
+               uec_phy_write(mii_info, MII_CTRL1000, adv);
 
                /* Start/Restart aneg */
                genmii_restart_aneg (mii_info);
@@ -335,13 +336,13 @@ static int marvell_config_aneg (struct uec_mii_info *mii_info)
        /* The Marvell PHY has an errata which requires
         * that certain registers get written in order
         * to restart autonegotiation */
-       phy_write (mii_info, MII_BMCR, BMCR_RESET);
+       uec_phy_write(mii_info, MII_BMCR, BMCR_RESET);
 
-       phy_write (mii_info, 0x1d, 0x1f);
-       phy_write (mii_info, 0x1e, 0x200c);
-       phy_write (mii_info, 0x1d, 0x5);
-       phy_write (mii_info, 0x1e, 0);
-       phy_write (mii_info, 0x1e, 0x100);
+       uec_phy_write(mii_info, 0x1d, 0x1f);
+       uec_phy_write(mii_info, 0x1e, 0x200c);
+       uec_phy_write(mii_info, 0x1d, 0x5);
+       uec_phy_write(mii_info, 0x1e, 0);
+       uec_phy_write(mii_info, 0x1e, 0x100);
 
        gbit_config_aneg (mii_info);
 
@@ -373,13 +374,13 @@ static int genmii_update_link (struct uec_mii_info *mii_info)
        u16 status;
 
        /* Status is read once to clear old link state */
-       phy_read (mii_info, MII_BMSR);
+       uec_phy_read(mii_info, MII_BMSR);
 
        /*
         * Wait if the link is up, and autonegotiation is in progress
         * (ie - we're capable and it's not done)
         */
-       status = phy_read(mii_info, MII_BMSR);
+       status = uec_phy_read(mii_info, MII_BMSR);
        if ((status & BMSR_LSTATUS) && (status & BMSR_ANEGCAPABLE)
            && !(status & BMSR_ANEGCOMPLETE)) {
                int i = 0;
@@ -395,7 +396,7 @@ static int genmii_update_link (struct uec_mii_info *mii_info)
 
                        i++;
                        udelay(1000);   /* 1 ms */
-                       status = phy_read(mii_info, MII_BMSR);
+                       status = uec_phy_read(mii_info, MII_BMSR);
                }
                mii_info->link = 1;
        } else {
@@ -420,7 +421,7 @@ static int genmii_read_status (struct uec_mii_info *mii_info)
                return err;
 
        if (mii_info->autoneg) {
-               status = phy_read(mii_info, MII_STAT1000);
+               status = uec_phy_read(mii_info, MII_STAT1000);
 
                if (status & (LPA_1000FULL | LPA_1000HALF)) {
                        mii_info->speed = SPEED_1000;
@@ -429,7 +430,7 @@ static int genmii_read_status (struct uec_mii_info *mii_info)
                        else
                                mii_info->duplex = DUPLEX_HALF;
                } else {
-                       status = phy_read(mii_info, MII_LPA);
+                       status = uec_phy_read(mii_info, MII_LPA);
 
                        if (status & (LPA_10FULL | LPA_100FULL))
                                mii_info->duplex = DUPLEX_FULL;
@@ -456,62 +457,63 @@ static int bcm_init(struct uec_mii_info *mii_info)
 
        gbit_config_aneg(mii_info);
 
-       if ((uec->uec_info->enet_interface_type == RGMII_RXID) &&
-          (uec->uec_info->speed == 1000)) {
+       if ((uec->uec_info->enet_interface_type ==
+                               PHY_INTERFACE_MODE_RGMII_RXID) &&
+                       (uec->uec_info->speed == SPEED_1000)) {
                u16 val;
                int cnt = 50;
 
                /* Wait for aneg to complete. */
                do
-                       val = phy_read(mii_info, MII_BMSR);
+                       val = uec_phy_read(mii_info, MII_BMSR);
                while (--cnt && !(val & BMSR_ANEGCOMPLETE));
 
                /* Set RDX clk delay. */
-               phy_write(mii_info, 0x18, 0x7 | (7 << 12));
+               uec_phy_write(mii_info, 0x18, 0x7 | (7 << 12));
 
-               val = phy_read(mii_info, 0x18);
+               val = uec_phy_read(mii_info, 0x18);
                /* Set RDX-RXC skew. */
                val |= (1 << 8);
                val |= (7 | (7 << 12));
                /* Write bits 14:0. */
                val |= (1 << 15);
-               phy_write(mii_info, 0x18, val);
+               uec_phy_write(mii_info, 0x18, val);
        }
 
         return 0;
 }
 
-static int marvell_init(struct uec_mii_info *mii_info)
+static int uec_marvell_init(struct uec_mii_info *mii_info)
 {
        struct eth_device *edev = mii_info->dev;
        uec_private_t *uec = edev->priv;
-       enum fsl_phy_enet_if iface = uec->uec_info->enet_interface_type;
+       phy_interface_t iface = uec->uec_info->enet_interface_type;
        int     speed = uec->uec_info->speed;
 
-       if ((speed == 1000) &&
-          (iface == RGMII_ID ||
-           iface == RGMII_RXID ||
-           iface == RGMII_TXID)) {
+       if ((speed == SPEED_1000) &&
+          (iface == PHY_INTERFACE_MODE_RGMII_ID ||
+           iface == PHY_INTERFACE_MODE_RGMII_RXID ||
+           iface == PHY_INTERFACE_MODE_RGMII_TXID)) {
                int temp;
 
-               temp = phy_read(mii_info, MII_M1111_PHY_EXT_CR);
-               if (iface == RGMII_ID) {
+               temp = uec_phy_read(mii_info, MII_M1111_PHY_EXT_CR);
+               if (iface == PHY_INTERFACE_MODE_RGMII_ID) {
                        temp |= MII_M1111_RX_DELAY | MII_M1111_TX_DELAY;
-               } else if (iface == RGMII_RXID) {
+               } else if (iface == PHY_INTERFACE_MODE_RGMII_RXID) {
                        temp &= ~MII_M1111_TX_DELAY;
                        temp |= MII_M1111_RX_DELAY;
-               } else if (iface == RGMII_TXID) {
+               } else if (iface == PHY_INTERFACE_MODE_RGMII_TXID) {
                        temp &= ~MII_M1111_RX_DELAY;
                        temp |= MII_M1111_TX_DELAY;
                }
-               phy_write(mii_info, MII_M1111_PHY_EXT_CR, temp);
+               uec_phy_write(mii_info, MII_M1111_PHY_EXT_CR, temp);
 
-               temp = phy_read(mii_info, MII_M1111_PHY_EXT_SR);
+               temp = uec_phy_read(mii_info, MII_M1111_PHY_EXT_SR);
                temp &= ~MII_M1111_HWCFG_MODE_MASK;
                temp |= MII_M1111_HWCFG_MODE_RGMII;
-               phy_write(mii_info, MII_M1111_PHY_EXT_SR, temp);
+               uec_phy_write(mii_info, MII_M1111_PHY_EXT_SR, temp);
 
-               phy_write(mii_info, MII_BMCR, BMCR_RESET);
+               uec_phy_write(mii_info, MII_BMCR, BMCR_RESET);
        }
 
        return 0;
@@ -534,7 +536,7 @@ static int marvell_read_status (struct uec_mii_info *mii_info)
        if (mii_info->autoneg && mii_info->link) {
                int speed;
 
-               status = phy_read (mii_info, MII_M1011_PHY_SPEC_STATUS);
+               status = uec_phy_read(mii_info, MII_M1011_PHY_SPEC_STATUS);
 
                /* Get the duplexity */
                if (status & MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX)
@@ -564,7 +566,7 @@ static int marvell_read_status (struct uec_mii_info *mii_info)
 static int marvell_ack_interrupt (struct uec_mii_info *mii_info)
 {
        /* Clear the interrupts by reading the reg */
-       phy_read (mii_info, MII_M1011_IEVENT);
+       uec_phy_read(mii_info, MII_M1011_IEVENT);
 
        return 0;
 }
@@ -572,9 +574,10 @@ static int marvell_ack_interrupt (struct uec_mii_info *mii_info)
 static int marvell_config_intr (struct uec_mii_info *mii_info)
 {
        if (mii_info->interrupts == MII_INTERRUPT_ENABLED)
-               phy_write (mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT);
+               uec_phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT);
        else
-               phy_write (mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR);
+               uec_phy_write(mii_info, MII_M1011_IMASK,
+                               MII_M1011_IMASK_CLEAR);
 
        return 0;
 }
@@ -582,13 +585,13 @@ static int marvell_config_intr (struct uec_mii_info *mii_info)
 static int dm9161_init (struct uec_mii_info *mii_info)
 {
        /* Reset the PHY */
-       phy_write (mii_info, MII_BMCR, phy_read (mii_info, MII_BMCR) |
+       uec_phy_write(mii_info, MII_BMCR, uec_phy_read(mii_info, MII_BMCR) |
                   BMCR_RESET);
        /* PHY and MAC connect */
-       phy_write (mii_info, MII_BMCR, phy_read (mii_info, MII_BMCR) &
+       uec_phy_write(mii_info, MII_BMCR, uec_phy_read(mii_info, MII_BMCR) &
                   ~BMCR_ISOLATE);
 
-       phy_write (mii_info, MII_DM9161_SCR, MII_DM9161_SCR_INIT);
+       uec_phy_write(mii_info, MII_DM9161_SCR, MII_DM9161_SCR_INIT);
 
        config_genmii_advert (mii_info);
        /* Start/restart aneg */
@@ -614,7 +617,7 @@ static int dm9161_read_status (struct uec_mii_info *mii_info)
        /* If the link is up, read the speed and duplex
           If we aren't autonegotiating assume speeds are as set */
        if (mii_info->autoneg && mii_info->link) {
-               status = phy_read (mii_info, MII_DM9161_SCSR);
+               status = uec_phy_read(mii_info, MII_DM9161_SCSR);
                if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_100H))
                        mii_info->speed = SPEED_100;
                else
@@ -632,7 +635,7 @@ static int dm9161_read_status (struct uec_mii_info *mii_info)
 static int dm9161_ack_interrupt (struct uec_mii_info *mii_info)
 {
        /* Clear the interrupt by reading the reg */
-       phy_read (mii_info, MII_DM9161_INTR);
+       uec_phy_read(mii_info, MII_DM9161_INTR);
 
        return 0;
 }
@@ -640,9 +643,9 @@ static int dm9161_ack_interrupt (struct uec_mii_info *mii_info)
 static int dm9161_config_intr (struct uec_mii_info *mii_info)
 {
        if (mii_info->interrupts == MII_INTERRUPT_ENABLED)
-               phy_write (mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT);
+               uec_phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT);
        else
-               phy_write (mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP);
+               uec_phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP);
 
        return 0;
 }
@@ -696,7 +699,7 @@ static int smsc_read_status (struct uec_mii_info *mii_info)
        if (mii_info->autoneg && mii_info->link) {
                int     val;
 
-               status = phy_read (mii_info, 0x1f);
+               status = uec_phy_read(mii_info, 0x1f);
                val = (status & 0x1c) >> 2;
 
                switch (val) {
@@ -751,7 +754,7 @@ static struct phy_info phy_info_marvell = {
        .phy_id_mask = 0xffffff00,
        .name = "Marvell 88E11x1",
        .features = MII_GBIT_FEATURES,
-       .init = &marvell_init,
+       .init = &uec_marvell_init,
        .config_aneg = &marvell_config_aneg,
        .read_status = &marvell_read_status,
        .ack_interrupt = &marvell_ack_interrupt,
@@ -804,12 +807,12 @@ static struct phy_info *phy_info[] = {
        NULL
 };
 
-u16 phy_read (struct uec_mii_info *mii_info, u16 regnum)
+u16 uec_phy_read(struct uec_mii_info *mii_info, u16 regnum)
 {
        return mii_info->mdio_read (mii_info->dev, mii_info->mii_id, regnum);
 }
 
-void phy_write (struct uec_mii_info *mii_info, u16 regnum, u16 val)
+void uec_phy_write(struct uec_mii_info *mii_info, u16 regnum, u16 val)
 {
        mii_info->mdio_write (mii_info->dev, mii_info->mii_id, regnum, val);
 }
@@ -825,11 +828,11 @@ struct phy_info *uec_get_phy_info (struct uec_mii_info *mii_info)
        struct phy_info *theInfo = NULL;
 
        /* Grab the bits from PHYIR1, and put them in the upper half */
-       phy_reg = phy_read (mii_info, MII_PHYSID1);
+       phy_reg = uec_phy_read(mii_info, MII_PHYSID1);
        phy_ID = (phy_reg & 0xffff) << 16;
 
        /* Grab the bits from PHYIR2, and put them in the lower half */
-       phy_reg = phy_read (mii_info, MII_PHYSID2);
+       phy_reg = uec_phy_read(mii_info, MII_PHYSID2);
        phy_ID |= (phy_reg & 0xffff);
 
        /* loop through all the known PHY types, and find one that */
@@ -852,10 +855,8 @@ struct phy_info *uec_get_phy_info (struct uec_mii_info *mii_info)
        return theInfo;
 }
 
-void marvell_phy_interface_mode (struct eth_device *dev,
-                                enum fsl_phy_enet_if type,
-                                int speed
-                               )
+void marvell_phy_interface_mode(struct eth_device *dev, phy_interface_t type,
+               int speed)
 {
        uec_private_t *uec = (uec_private_t *) dev->priv;
        struct uec_mii_info *mii_info;
@@ -867,47 +868,47 @@ void marvell_phy_interface_mode (struct eth_device *dev,
        }
        mii_info = uec->mii_info;
 
-       if (type == RGMII) {
-               if (speed == 100) {
-                       phy_write (mii_info, 0x00, 0x9140);
-                       phy_write (mii_info, 0x1d, 0x001f);
-                       phy_write (mii_info, 0x1e, 0x200c);
-                       phy_write (mii_info, 0x1d, 0x0005);
-                       phy_write (mii_info, 0x1e, 0x0000);
-                       phy_write (mii_info, 0x1e, 0x0100);
-                       phy_write (mii_info, 0x09, 0x0e00);
-                       phy_write (mii_info, 0x04, 0x01e1);
-                       phy_write (mii_info, 0x00, 0x9140);
-                       phy_write (mii_info, 0x00, 0x1000);
+       if (type == PHY_INTERFACE_MODE_RGMII) {
+               if (speed == SPEED_100) {
+                       uec_phy_write(mii_info, 0x00, 0x9140);
+                       uec_phy_write(mii_info, 0x1d, 0x001f);
+                       uec_phy_write(mii_info, 0x1e, 0x200c);
+                       uec_phy_write(mii_info, 0x1d, 0x0005);
+                       uec_phy_write(mii_info, 0x1e, 0x0000);
+                       uec_phy_write(mii_info, 0x1e, 0x0100);
+                       uec_phy_write(mii_info, 0x09, 0x0e00);
+                       uec_phy_write(mii_info, 0x04, 0x01e1);
+                       uec_phy_write(mii_info, 0x00, 0x9140);
+                       uec_phy_write(mii_info, 0x00, 0x1000);
                        udelay (100000);
-                       phy_write (mii_info, 0x00, 0x2900);
-                       phy_write (mii_info, 0x14, 0x0cd2);
-                       phy_write (mii_info, 0x00, 0xa100);
-                       phy_write (mii_info, 0x09, 0x0000);
-                       phy_write (mii_info, 0x1b, 0x800b);
-                       phy_write (mii_info, 0x04, 0x05e1);
-                       phy_write (mii_info, 0x00, 0xa100);
-                       phy_write (mii_info, 0x00, 0x2100);
+                       uec_phy_write(mii_info, 0x00, 0x2900);
+                       uec_phy_write(mii_info, 0x14, 0x0cd2);
+                       uec_phy_write(mii_info, 0x00, 0xa100);
+                       uec_phy_write(mii_info, 0x09, 0x0000);
+                       uec_phy_write(mii_info, 0x1b, 0x800b);
+                       uec_phy_write(mii_info, 0x04, 0x05e1);
+                       uec_phy_write(mii_info, 0x00, 0xa100);
+                       uec_phy_write(mii_info, 0x00, 0x2100);
                        udelay (1000000);
-               } else if (speed == 10) {
-                       phy_write (mii_info, 0x14, 0x8e40);
-                       phy_write (mii_info, 0x1b, 0x800b);
-                       phy_write (mii_info, 0x14, 0x0c82);
-                       phy_write (mii_info, 0x00, 0x8100);
+               } else if (speed == SPEED_10) {
+                       uec_phy_write(mii_info, 0x14, 0x8e40);
+                       uec_phy_write(mii_info, 0x1b, 0x800b);
+                       uec_phy_write(mii_info, 0x14, 0x0c82);
+                       uec_phy_write(mii_info, 0x00, 0x8100);
                        udelay (1000000);
                }
        }
 
        /* handle 88e1111 rev.B2 erratum 5.6 */
        if (mii_info->autoneg) {
-               status = phy_read (mii_info, MII_BMCR);
-               phy_write (mii_info, MII_BMCR, status | BMCR_ANENABLE);
+               status = uec_phy_read(mii_info, MII_BMCR);
+               uec_phy_write(mii_info, MII_BMCR, status | BMCR_ANENABLE);
        }
        /* now the B2 will correctly report autoneg completion status */
 }
 
 void change_phy_interface_mode (struct eth_device *dev,
-                               enum fsl_phy_enet_if type, int speed)
+                               phy_interface_t type, int speed)
 {
 #ifdef CONFIG_PHY_MODE_NEED_CHANGE
        marvell_phy_interface_mode (dev, type, speed);
index 3ebc76887465db606f458ebabc65ae16f3da1239..e01216844ad2f282186dd78ae4ea4594f559ab6e 100644 (file)
 #include <i2c.h>
 #include <rtc.h>
 
+#define RTC_RV3029_CTRL1       0x00
+#define RTC_RV3029_CTRL1_EERE  (1 << 3)
+
+#define RTC_RV3029_CTRL_STATUS 0x03
+#define RTC_RV3029_CTRLS_EEBUSY        (1 << 7)
+
 #define RTC_RV3029_CTRL_RESET  0x04
 #define RTC_RV3029_CTRL_SYS_R  (1 << 4)
 
 #define RV3029C2_REG_HR_12_24          (1 << 6)  /* 24h/12h mode */
 #define RV3029C2_REG_HR_PM             (1 << 5)  /* PM/AM bit in 12h mode */
 
+#define RTC_RV3029_EEPROM_CTRL 0x30
+#define RTC_RV3029_TRICKLE_1K  (1 << 4)
+#define RTC_RV3029_TRICKLE_5K  (1 << 5)
+#define RTC_RV3029_TRICKLE_20K (1 << 6)
+#define RTC_RV3029_TRICKLE_80K (1 << 7)
+
 int rtc_get( struct rtc_time *tmp )
 {
        int     ret;
@@ -113,6 +125,41 @@ int rtc_set( struct rtc_time *tmp )
        return 0;
 }
 
+/* sets EERE-Bit  (automatic EEPROM refresh) */
+static void set_eere_bit(int state)
+{
+       int ret;
+       unsigned char reg_ctrl1;
+
+       ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL1, 1,
+                       &reg_ctrl1, 1);
+
+       if (state)
+               reg_ctrl1 |= RTC_RV3029_CTRL1_EERE;
+       else
+               reg_ctrl1 &= (~RTC_RV3029_CTRL1_EERE);
+
+       ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL1, 1,
+               &reg_ctrl1, 1);
+}
+
+/* waits until EEPROM page is no longer busy (times out after 10ms*loops) */
+static int wait_eebusy(int loops)
+{
+       int i, ret;
+       unsigned char ctrl_status;
+
+       for (i = 0; i < loops; i++) {
+               ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL_STATUS,
+                       1, &ctrl_status, 1);
+
+               if ((ctrl_status & RTC_RV3029_CTRLS_EEBUSY) == 0)
+                       break;
+               udelay(10000);
+       }
+       return i;
+}
+
 void rtc_reset (void)
 {
        int     ret;
@@ -121,4 +168,44 @@ void rtc_reset (void)
        buf[0] = RTC_RV3029_CTRL_SYS_R;
        ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL_RESET, 1,
                        buf, 1);
+
+#if defined(CONFIG_SYS_RV3029_TCR)
+       /*
+        * because EEPROM_CTRL register is in EEPROM page it is necessary to
+        * disable automatic EEPROM refresh and check if EEPROM is busy
+        * before EEPORM_CTRL register may be accessed
+        */
+       set_eere_bit(0);
+       wait_eebusy(100);
+       /* read current trickle charger setting */
+       ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_EEPROM_CTRL,
+                       1, buf, 1);
+       /* enable automatic EEPROM refresh again */
+       set_eere_bit(1);
+
+       /*
+        * to minimize EEPROM access write trickle charger setting only if it
+        * differs from current value
+        */
+       if ((buf[0] & 0xF0) != CONFIG_SYS_RV3029_TCR) {
+               buf[0] = (buf[0] & 0x0F) | CONFIG_SYS_RV3029_TCR;
+               /*
+                * write trickle charger setting (disable autom. EEPROM
+                * refresh and wait until EEPROM is idle)
+                */
+               set_eere_bit(0);
+               wait_eebusy(100);
+               ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR,
+                               RTC_RV3029_EEPROM_CTRL, 1, buf, 1);
+               /*
+                * it is necessary to wait 10ms before EEBUSY-Bit may be read
+                * (this is not documented in the data sheet yet, but the
+                * manufacturer recommends it)
+                */
+               udelay(10000);
+               /* wait until EEPROM write access is finished */
+               wait_eebusy(100);
+               set_eere_bit(1);
+       }
+#endif
 }
index b9cf9de740b8854d8093e42c2183c2d7ff829f5f..dcb4bd16d812fc6a5155431c8a2fba0c037d7060 100644 (file)
 
 #include <common.h>
 #include <watchdog.h>
-#ifdef CONFIG_MX31
-#include <asm/arch/mx31.h>
-#else
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
-#endif
 
 #define __REG(x)     (*((volatile u32 *)(x)))
 
index d582fbbb17feb63e244866a8f3d6186147c64323..a9b1ca4c13db03b8915163451b18e6e4eac10f61 100644 (file)
@@ -35,9 +35,11 @@ COBJS-$(CONFIG_KIRKWOOD_SPI) += kirkwood_spi.o
 COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o
 COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
+COBJS-$(CONFIG_OC_TINY_SPI) += oc_tiny_spi.o
 COBJS-$(CONFIG_OMAP3_SPI) += omap3_spi.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
 COBJS-$(CONFIG_SH_SPI) += sh_spi.o
+COBJS-$(CONFIG_FSL_ESPI) += fsl_espi.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
index d7e14749dded5f04b6ade6742d80c42e9d043847..213e79281aca3ddb8f24841927c4a890a3181aaa 100644 (file)
@@ -138,13 +138,29 @@ static const unsigned short cs_pins[][7] = {
 #endif
 };
 
+void spi_set_speed(struct spi_slave *slave, uint hz)
+{
+       struct bfin_spi_slave *bss = to_bfin_spi_slave(slave);
+       ulong sclk;
+       u32 baud;
+
+       sclk = get_sclk();
+       baud = sclk / (2 * hz);
+       /* baud should be rounded up */
+       if (sclk % (2 * hz))
+               baud += 1;
+       if (baud < 2)
+               baud = 2;
+       else if (baud > (u16)-1)
+               baud = -1;
+       bss->baud = baud;
+}
+
 struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
                unsigned int max_hz, unsigned int mode)
 {
        struct bfin_spi_slave *bss;
-       ulong sclk;
        u32 mmr_base;
-       u32 baud;
 
        if (!spi_cs_is_valid(bus, cs))
                return NULL;
@@ -166,16 +182,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
                default: return NULL;
        }
 
-       sclk = get_sclk();
-       baud = sclk / (2 * max_hz);
-       /* baud should be rounded up */
-       if (sclk % (2 * max_hz))
-               baud += 1;
-       if (baud < 2)
-               baud = 2;
-       else if (baud > (u16)-1)
-               baud = -1;
-
        bss = malloc(sizeof(*bss));
        if (!bss)
                return NULL;
@@ -187,8 +193,8 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        if (mode & SPI_CPHA) bss->ctl |= CPHA;
        if (mode & SPI_CPOL) bss->ctl |= CPOL;
        if (mode & SPI_LSB_FIRST) bss->ctl |= LSBF;
-       bss->baud = baud;
        bss->flg = mode & SPI_CS_HIGH ? 1 : 0;
+       spi_set_speed(&bss->slave, max_hz);
 
        debug("%s: bus:%i cs:%i mmr:%x ctl:%x baud:%i flg:%i\n", __func__,
                bus, cs, mmr_base, bss->ctl, baud, bss->flg);
@@ -248,6 +254,8 @@ void spi_release_bus(struct spi_slave *slave)
 #elif defined(__ADSPBF537__) || defined(__ADSPBF536__) || defined(__ADSPBF534__) || \
       defined(__ADSPBF52x__) || defined(__ADSPBF51x__)
 # define SPI_DMA_BASE DMA7_NEXT_DESC_PTR
+# elif defined(__ADSPBF50x__)
+# define SPI_DMA_BASE DMA6_NEXT_DESC_PTR
 #else
 # error "Please provide SPI DMA channel defines"
 #endif
index 722aafc73c35ab1d733338aa3df548d374e50a7f..a883da93688a1bc056b569ab859bdb6dae263dfa 100644 (file)
@@ -49,6 +49,14 @@ extern void cfspi_release_bus(uint bus, uint cs);
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifndef CONFIG_SPI_IDLE_VAL
+#if defined(CONFIG_SPI_MMC)
+#define CONFIG_SPI_IDLE_VAL    0xFFFF
+#else
+#define CONFIG_SPI_IDLE_VAL    0x0
+#endif
+#endif
+
 #if defined(CONFIG_CF_DSPI)
 /* DSPI specific mode */
 #define SPI_MODE_MOD   0x00200000
@@ -145,7 +153,7 @@ int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
                        }
 
                        if (din != NULL) {
-                               cfspi_tx(ctrl, 0);
+                               cfspi_tx(ctrl, CONFIG_SPI_IDLE_VAL);
                                if (cfslave->charbit == 16)
                                        *spi_rd16++ = cfspi_rx();
                                else
@@ -169,7 +177,7 @@ int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
                }
 
                if (din != NULL) {
-                       cfspi_tx(ctrl, 0);
+                       cfspi_tx(ctrl, CONFIG_SPI_IDLE_VAL);
                        if (cfslave->charbit == 16)
                                *spi_rd16 = cfspi_rx();
                        else
@@ -177,7 +185,7 @@ int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
                }
        } else {
                /* dummy read */
-               cfspi_tx(ctrl, 0);
+               cfspi_tx(ctrl, CONFIG_SPI_IDLE_VAL);
                cfspi_rx();
        }
 
diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
new file mode 100644 (file)
index 0000000..f872cd8
--- /dev/null
@@ -0,0 +1,334 @@
+/*
+ * eSPI controller driver.
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * Author: Mingkai Hu (Mingkai.hu@freescale.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 <common.h>
+
+#include <malloc.h>
+#include <spi.h>
+#include <asm/immap_85xx.h>
+
+struct fsl_spi_slave {
+       struct spi_slave slave;
+       unsigned int    div16;
+       unsigned int    pm;
+       unsigned int    mode;
+       size_t          cmd_len;
+       u8              cmd_buf[16];
+       size_t          data_len;
+       unsigned int    max_transfer_length;
+};
+
+#define to_fsl_spi_slave(s) container_of(s, struct fsl_spi_slave, slave)
+
+#define ESPI_MAX_CS_NUM                4
+
+#define ESPI_EV_RNE            (1 << 9)
+#define ESPI_EV_TNF            (1 << 8)
+
+#define ESPI_MODE_EN           (1 << 31)       /* Enable interface */
+#define ESPI_MODE_TXTHR(x)     ((x) << 8)      /* Tx FIFO threshold */
+#define ESPI_MODE_RXTHR(x)     ((x) << 0)      /* Rx FIFO threshold */
+
+#define ESPI_COM_CS(x)         ((x) << 30)
+#define ESPI_COM_TRANLEN(x)    ((x) << 0)
+
+#define ESPI_CSMODE_CI_INACTIVEHIGH    (1 << 31)
+#define ESPI_CSMODE_CP_BEGIN_EDGCLK    (1 << 30)
+#define ESPI_CSMODE_REV_MSB_FIRST      (1 << 29)
+#define ESPI_CSMODE_DIV16              (1 << 28)
+#define ESPI_CSMODE_PM(x)              ((x) << 24)
+#define ESPI_CSMODE_POL_ASSERTED_LOW   (1 << 20)
+#define ESPI_CSMODE_LEN(x)             ((x) << 16)
+#define ESPI_CSMODE_CSBEF(x)           ((x) << 12)
+#define ESPI_CSMODE_CSAFT(x)           ((x) << 8)
+#define ESPI_CSMODE_CSCG(x)            ((x) << 3)
+
+#define ESPI_CSMODE_INIT_VAL (ESPI_CSMODE_POL_ASSERTED_LOW | \
+               ESPI_CSMODE_CSBEF(0) | ESPI_CSMODE_CSAFT(0) | \
+               ESPI_CSMODE_CSCG(1))
+
+#define ESPI_MAX_DATA_TRANSFER_LEN 0xFFF0
+
+struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
+               unsigned int max_hz, unsigned int mode)
+{
+       struct fsl_spi_slave *fsl;
+       sys_info_t sysinfo;
+       unsigned long spibrg = 0;
+       unsigned char pm = 0;
+
+       if (!spi_cs_is_valid(bus, cs))
+               return NULL;
+
+       fsl = malloc(sizeof(struct fsl_spi_slave));
+       if (!fsl)
+               return NULL;
+
+       fsl->slave.bus = bus;
+       fsl->slave.cs = cs;
+       fsl->mode = mode;
+       fsl->max_transfer_length = ESPI_MAX_DATA_TRANSFER_LEN;
+
+       /* Set eSPI BRG clock source */
+       get_sys_info(&sysinfo);
+       spibrg = sysinfo.freqSystemBus / 2;
+       fsl->div16 = 0;
+       if ((spibrg / max_hz) > 32) {
+               fsl->div16 = ESPI_CSMODE_DIV16;
+               pm = spibrg / (max_hz * 16 * 2);
+               if (pm > 16) {
+                       pm = 16;
+                       debug("Requested speed is too low: %d Hz, "
+                               "%d Hz is used.\n", max_hz, spibrg / (32 * 16));
+               }
+       } else
+               pm = spibrg / (max_hz * 2);
+       if (pm)
+               pm--;
+       fsl->pm = pm;
+
+       return &fsl->slave;
+}
+
+void spi_free_slave(struct spi_slave *slave)
+{
+       struct fsl_spi_slave *fsl = to_fsl_spi_slave(slave);
+       free(fsl);
+}
+
+void spi_init(void)
+{
+
+}
+
+int spi_claim_bus(struct spi_slave *slave)
+{
+       struct fsl_spi_slave *fsl = to_fsl_spi_slave(slave);
+       ccsr_espi_t *espi = (void *)(CONFIG_SYS_MPC85xx_ESPI_ADDR);
+       unsigned char pm = fsl->pm;
+       unsigned int cs = slave->cs;
+       unsigned int mode =  fsl->mode;
+       unsigned int div16 = fsl->div16;
+       int i;
+
+       debug("%s: bus:%i cs:%i\n", __func__, slave->bus, cs);
+
+       /* Enable eSPI interface */
+       out_be32(&espi->mode, ESPI_MODE_RXTHR(3)
+                       | ESPI_MODE_TXTHR(4) | ESPI_MODE_EN);
+
+       out_be32(&espi->event, 0xffffffff); /* Clear all eSPI events */
+       out_be32(&espi->mask, 0x00000000); /* Mask  all eSPI interrupts */
+
+       /* Init CS mode interface */
+       for (i = 0; i < ESPI_MAX_CS_NUM; i++)
+               out_be32(&espi->csmode[i], ESPI_CSMODE_INIT_VAL);
+
+       out_be32(&espi->csmode[cs], in_be32(&espi->csmode[cs]) &
+               ~(ESPI_CSMODE_PM(0xF) | ESPI_CSMODE_DIV16
+               | ESPI_CSMODE_CI_INACTIVEHIGH | ESPI_CSMODE_CP_BEGIN_EDGCLK
+               | ESPI_CSMODE_REV_MSB_FIRST | ESPI_CSMODE_LEN(0xF)));
+
+       /* Set eSPI BRG clock source */
+       out_be32(&espi->csmode[cs], in_be32(&espi->csmode[cs])
+               | ESPI_CSMODE_PM(pm) | div16);
+
+       /* Set eSPI mode */
+       if (mode & SPI_CPHA)
+               out_be32(&espi->csmode[cs], in_be32(&espi->csmode[cs])
+                       | ESPI_CSMODE_CP_BEGIN_EDGCLK);
+       if (mode & SPI_CPOL)
+               out_be32(&espi->csmode[cs], in_be32(&espi->csmode[cs])
+                       | ESPI_CSMODE_CI_INACTIVEHIGH);
+
+       /* Character bit order: msb first */
+       out_be32(&espi->csmode[cs], in_be32(&espi->csmode[cs])
+               | ESPI_CSMODE_REV_MSB_FIRST);
+
+       /* Character length in bits, between 0x3~0xf, i.e. 4bits~16bits */
+       out_be32(&espi->csmode[cs], in_be32(&espi->csmode[cs])
+               | ESPI_CSMODE_LEN(7));
+
+       return 0;
+}
+
+void spi_release_bus(struct spi_slave *slave)
+{
+
+}
+
+int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
+               void *data_in, unsigned long flags)
+{
+       struct fsl_spi_slave *fsl = to_fsl_spi_slave(slave);
+       ccsr_espi_t *espi = (void *)(CONFIG_SYS_MPC85xx_ESPI_ADDR);
+       unsigned int tmpdout, tmpdin, event;
+       const void *dout = NULL;
+       void *din = NULL;
+       int len = 0;
+       int num_blks, num_chunks, max_tran_len, tran_len;
+       int num_bytes;
+       unsigned char *ch;
+       unsigned char *buffer = NULL;
+       size_t buf_len;
+       u8 *cmd_buf = fsl->cmd_buf;
+       size_t cmd_len = fsl->cmd_len;
+       size_t data_len = bitlen / 8;
+       size_t rx_offset = 0;
+
+       max_tran_len = fsl->max_transfer_length;
+       switch (flags) {
+       case SPI_XFER_BEGIN:
+               cmd_len = fsl->cmd_len = data_len;
+               memcpy(cmd_buf, data_out, cmd_len);
+               return 0;
+       case 0:
+       case SPI_XFER_END:
+               if (bitlen == 0) {
+                       spi_cs_deactivate(slave);
+                       return 0;
+               }
+               buf_len = 2 * cmd_len + min(data_len, max_tran_len);
+               len = cmd_len + data_len;
+               rx_offset = cmd_len;
+               buffer = (unsigned char *)malloc(buf_len);
+               if (!buffer) {
+                       debug("SF: Failed to malloc memory.\n");
+                       return 1;
+               }
+               memcpy(buffer, cmd_buf, cmd_len);
+               if (cmd_len != 1) {
+                       if (data_in == NULL)
+                               memcpy(buffer + cmd_len, data_out, data_len);
+               }
+               break;
+       case SPI_XFER_BEGIN | SPI_XFER_END:
+               len = data_len;
+               buffer = (unsigned char *)malloc(len * 2);
+               if (!buffer) {
+                       debug("SF: Failed to malloc memory.\n");
+                       return 1;
+               }
+               memcpy(buffer, data_out, len);
+               rx_offset = len;
+               cmd_len = 0;
+               break;
+       }
+
+       debug("spi_xfer: slave %u:%u dout %08X(%08x) din %08X(%08x) len %u\n",
+             slave->bus, slave->cs, *(uint *) dout,
+             dout, *(uint *) din, din, len);
+
+       num_chunks = data_len / max_tran_len +
+               (data_len % max_tran_len ? 1 : 0);
+       while (num_chunks--) {
+               if (data_in)
+                       din = buffer + rx_offset;
+               dout = buffer;
+               tran_len = min(data_len , max_tran_len);
+               num_blks = (tran_len + cmd_len) / 4 +
+                       ((tran_len + cmd_len) % 4 ? 1 : 0);
+               num_bytes = (tran_len + cmd_len) % 4;
+               fsl->data_len = tran_len + cmd_len;
+               spi_cs_activate(slave);
+
+               /* Clear all eSPI events */
+               out_be32(&espi->event , 0xffffffff);
+               /* handle data in 32-bit chunks */
+               while (num_blks--) {
+
+                       event = in_be32(&espi->event);
+                       if (event & ESPI_EV_TNF) {
+                               tmpdout = *(u32 *)dout;
+
+                               /* Set up the next iteration */
+                               if (len > 4) {
+                                       len -= 4;
+                                       dout += 4;
+                               }
+
+                               out_be32(&espi->tx, tmpdout);
+                               out_be32(&espi->event, ESPI_EV_TNF);
+                               debug("***spi_xfer:...%08x written\n", tmpdout);
+                       }
+
+                       /* Wait for eSPI transmit to get out */
+                       udelay(80);
+
+                       event = in_be32(&espi->event);
+                       if (event & ESPI_EV_RNE) {
+                               tmpdin = in_be32(&espi->rx);
+                               if (num_blks == 0 && num_bytes != 0) {
+                                       ch = (unsigned char *)&tmpdin;
+                                       while (num_bytes--)
+                                               *(unsigned char *)din++ = *ch++;
+                               } else {
+                                       *(u32 *) din = tmpdin;
+                                       din += 4;
+                               }
+
+                               out_be32(&espi->event, in_be32(&espi->event)
+                                               | ESPI_EV_RNE);
+                               debug("***spi_xfer:...%08x readed\n", tmpdin);
+                       }
+               }
+               if (data_in) {
+                       memcpy(data_in, buffer + 2 * cmd_len, tran_len);
+                       if (*buffer == 0x0b) {
+                               data_in += tran_len;
+                               data_len -= tran_len;
+                               *(int *)buffer += tran_len;
+                       }
+               }
+               spi_cs_deactivate(slave);
+       }
+
+       free(buffer);
+       return 0;
+}
+
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+       return bus == 0 && cs < ESPI_MAX_CS_NUM;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+       struct fsl_spi_slave *fsl = to_fsl_spi_slave(slave);
+       ccsr_espi_t *espi = (void *)(CONFIG_SYS_MPC85xx_ESPI_ADDR);
+       unsigned int com = 0;
+       size_t data_len = fsl->data_len;
+
+       com &= ~(ESPI_COM_CS(0x3) | ESPI_COM_TRANLEN(0xFFFF));
+       com |= ESPI_COM_CS(slave->cs);
+       com |= ESPI_COM_TRANLEN(data_len - 1);
+       out_be32(&espi->com, com);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+       ccsr_espi_t *espi = (void *)(CONFIG_SYS_MPC85xx_ESPI_ADDR);
+
+       /* clear the RXCNT and TXCNT */
+       out_be32(&espi->mode, in_be32(&espi->mode) & (~ESPI_MODE_EN));
+       out_be32(&espi->mode, in_be32(&espi->mode) | ESPI_MODE_EN);
+}
index 6474eb802d694d3db0f42023a9200ccd90cbcd91..f909e076ea5eac35bd9a0baaee9856a4a9bafaa1 100644 (file)
@@ -24,6 +24,8 @@
 #include <asm/errno.h>
 #include <asm/io.h>
 #include <mxc_gpio.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/clock.h>
 
 #ifdef CONFIG_MX27
 /* i.MX27 has a completely wrong register layout and register definitions in the
@@ -34,8 +36,6 @@
 
 #elif defined(CONFIG_MX31)
 
-#include <asm/arch/mx31.h>
-
 #define MXC_CSPICTRL_EN                (1 << 0)
 #define MXC_CSPICTRL_MODE      (1 << 1)
 #define MXC_CSPICTRL_XCH       (1 << 2)
@@ -63,8 +63,6 @@ static unsigned long spi_bases[] = {
 #define mxc_get_clock(x)       mx31_get_ipg_clk()
 
 #elif defined(CONFIG_MX51)
-#include <asm/arch/imx-regs.h>
-#include <asm/arch/clock.h>
 
 #define MXC_CSPICTRL_EN                (1 << 0)
 #define MXC_CSPICTRL_MODE      (1 << 1)
@@ -97,9 +95,6 @@ static unsigned long spi_bases[] = {
 
 #elif defined(CONFIG_MX35)
 
-#include <asm/arch/imx-regs.h>
-#include <asm/arch/clock.h>
-
 #define MXC_CSPICTRL_EN                (1 << 0)
 #define MXC_CSPICTRL_MODE      (1 << 1)
 #define MXC_CSPICTRL_XCH       (1 << 2)
diff --git a/drivers/spi/oc_tiny_spi.c b/drivers/spi/oc_tiny_spi.c
new file mode 100644 (file)
index 0000000..fc01fb8
--- /dev/null
@@ -0,0 +1,248 @@
+/*
+ * Opencore tiny_spi driver
+ *
+ * http://opencores.org/project,tiny_spi
+ *
+ * based on bfin_spi.c
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <malloc.h>
+#include <spi.h>
+#include <asm/gpio.h>
+
+#define TINY_SPI_STATUS_TXE 0x1
+#define TINY_SPI_STATUS_TXR 0x2
+
+struct tiny_spi_regs {
+       unsigned rxdata;        /* Rx data reg */
+       unsigned txdata;        /* Tx data reg */
+       unsigned status;        /* Status reg */
+       unsigned control;       /* Control reg */
+       unsigned baud;          /* Baud reg */
+};
+
+struct tiny_spi_host {
+       uint base;
+       uint freq;
+       uint baudwidth;
+};
+static const struct tiny_spi_host tiny_spi_host_list[] =
+       CONFIG_SYS_TINY_SPI_LIST;
+
+struct tiny_spi_slave {
+       struct spi_slave slave;
+       const struct tiny_spi_host *host;
+       uint mode;
+       uint baud;
+       uint flg;
+};
+#define to_tiny_spi_slave(s) container_of(s, struct tiny_spi_slave, slave)
+
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+       return bus < ARRAY_SIZE(tiny_spi_host_list) && gpio_is_valid(cs);
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+       struct tiny_spi_slave *tiny_spi = to_tiny_spi_slave(slave);
+       unsigned int cs = slave->cs;
+
+       gpio_set_value(cs, tiny_spi->flg);
+       debug("%s: SPI_CS_GPIO:%x\n", __func__, gpio_get_value(cs));
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+       struct tiny_spi_slave *tiny_spi = to_tiny_spi_slave(slave);
+       unsigned int cs = slave->cs;
+
+       gpio_set_value(cs, !tiny_spi->flg);
+       debug("%s: SPI_CS_GPIO:%x\n", __func__, gpio_get_value(cs));
+}
+
+void spi_set_speed(struct spi_slave *slave, uint hz)
+{
+       struct tiny_spi_slave *tiny_spi = to_tiny_spi_slave(slave);
+       const struct tiny_spi_host *host = tiny_spi->host;
+
+       tiny_spi->baud = min(DIV_ROUND_UP(host->freq, hz * 2),
+                            (1 << host->baudwidth)) - 1;
+       debug("%s: speed %u actual %u\n", __func__, hz,
+             host->freq / ((tiny_spi->baud + 1) * 2));
+}
+
+void spi_init(void)
+{
+}
+
+struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
+                                 unsigned int hz, unsigned int mode)
+{
+       struct tiny_spi_slave *tiny_spi;
+
+       if (!spi_cs_is_valid(bus, cs) || gpio_request(cs, "tiny_spi"))
+               return NULL;
+
+       tiny_spi = malloc(sizeof(*tiny_spi));
+       if (!tiny_spi)
+               return NULL;
+       memset(tiny_spi, 0, sizeof(*tiny_spi));
+
+       tiny_spi->slave.bus = bus;
+       tiny_spi->slave.cs = cs;
+       tiny_spi->host = &tiny_spi_host_list[bus];
+       tiny_spi->mode = mode & (SPI_CPOL | SPI_CPHA);
+       tiny_spi->flg = mode & SPI_CS_HIGH ? 1 : 0;
+       spi_set_speed(&tiny_spi->slave, hz);
+
+       debug("%s: bus:%i cs:%i base:%lx\n", __func__,
+               bus, cs, tiny_spi->host->base);
+       return &tiny_spi->slave;
+}
+
+void spi_free_slave(struct spi_slave *slave)
+{
+       struct tiny_spi_slave *tiny_spi = to_tiny_spi_slave(slave);
+
+       gpio_free(slave->cs);
+       free(tiny_spi);
+}
+
+int spi_claim_bus(struct spi_slave *slave)
+{
+       struct tiny_spi_slave *tiny_spi = to_tiny_spi_slave(slave);
+       struct tiny_spi_regs *regs = (void *)tiny_spi->host->base;
+
+       debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);
+       gpio_direction_output(slave->cs, !tiny_spi->flg);
+       writel(tiny_spi->mode, &regs->control);
+       writel(tiny_spi->baud, &regs->baud);
+       return 0;
+}
+
+void spi_release_bus(struct spi_slave *slave)
+{
+       debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);
+}
+
+#ifndef CONFIG_TINY_SPI_IDLE_VAL
+# define CONFIG_TINY_SPI_IDLE_VAL 0xff
+#endif
+
+int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
+            void *din, unsigned long flags)
+{
+       struct tiny_spi_slave *tiny_spi = to_tiny_spi_slave(slave);
+       struct tiny_spi_regs *regs = (void *)tiny_spi->host->base;
+       const u8 *txp = dout;
+       u8 *rxp = din;
+       uint bytes = bitlen / 8;
+       uint i;
+
+       debug("%s: bus:%i cs:%i bitlen:%i bytes:%i flags:%lx\n", __func__,
+               slave->bus, slave->cs, bitlen, bytes, flags);
+       if (bitlen == 0)
+               goto done;
+
+       /* assume to do 8 bits transfers */
+       if (bitlen % 8) {
+               flags |= SPI_XFER_END;
+               goto done;
+       }
+
+       if (flags & SPI_XFER_BEGIN)
+               spi_cs_activate(slave);
+
+       /* we need to tighten the transfer loop */
+       if (txp && rxp) {
+               writeb(*txp++, &regs->txdata);
+               if (bytes > 1) {
+                       writeb(*txp++, &regs->txdata);
+                       for (i = 2; i < bytes; i++) {
+                               u8 rx, tx = *txp++;
+                               while (!(readb(&regs->status) &
+                                        TINY_SPI_STATUS_TXR))
+                                       ;
+                               rx = readb(&regs->txdata);
+                               writeb(tx, &regs->txdata);
+                               *rxp++ = rx;
+                       }
+                       while (!(readb(&regs->status) &
+                                TINY_SPI_STATUS_TXR))
+                               ;
+                       *rxp++ = readb(&regs->txdata);
+               }
+               while (!(readb(&regs->status) &
+                        TINY_SPI_STATUS_TXE))
+                       ;
+               *rxp++ = readb(&regs->rxdata);
+       } else if (rxp) {
+               writeb(CONFIG_TINY_SPI_IDLE_VAL, &regs->txdata);
+               if (bytes > 1) {
+                       writeb(CONFIG_TINY_SPI_IDLE_VAL,
+                              &regs->txdata);
+                       for (i = 2; i < bytes; i++) {
+                               u8 rx;
+                               while (!(readb(&regs->status) &
+                                        TINY_SPI_STATUS_TXR))
+                                       ;
+                               rx = readb(&regs->txdata);
+                               writeb(CONFIG_TINY_SPI_IDLE_VAL,
+                                      &regs->txdata);
+                               *rxp++ = rx;
+                       }
+                       while (!(readb(&regs->status) &
+                                TINY_SPI_STATUS_TXR))
+                               ;
+                       *rxp++ = readb(&regs->txdata);
+               }
+               while (!(readb(&regs->status) &
+                        TINY_SPI_STATUS_TXE))
+                       ;
+               *rxp++ = readb(&regs->rxdata);
+       } else if (txp) {
+               writeb(*txp++, &regs->txdata);
+               if (bytes > 1) {
+                       writeb(*txp++, &regs->txdata);
+                       for (i = 2; i < bytes; i++) {
+                               u8 tx = *txp++;
+                               while (!(readb(&regs->status) &
+                                        TINY_SPI_STATUS_TXR))
+                                       ;
+                               writeb(tx, &regs->txdata);
+                       }
+               }
+               while (!(readb(&regs->status) &
+                        TINY_SPI_STATUS_TXE))
+                       ;
+       } else {
+               writeb(CONFIG_TINY_SPI_IDLE_VAL, &regs->txdata);
+               if (bytes > 1) {
+                       writeb(CONFIG_TINY_SPI_IDLE_VAL,
+                              &regs->txdata);
+                       for (i = 2; i < bytes; i++) {
+                               while (!(readb(&regs->status) &
+                                        TINY_SPI_STATUS_TXR))
+                                       ;
+                               writeb(CONFIG_TINY_SPI_IDLE_VAL,
+                                      &regs->txdata);
+                       }
+               }
+               while (!(readb(&regs->status) &
+                        TINY_SPI_STATUS_TXE))
+                       ;
+       }
+
+ done:
+       if (flags & SPI_XFER_END)
+               spi_cs_deactivate(slave);
+
+       return 0;
+}
index 8d7b3804fab4d91d2c7bc864ba4d484bed9215bc..6af35aba5f60a439f00f86e13598af7b8372c648 100644 (file)
@@ -20,7 +20,7 @@
 #include <common.h>
 #include <usb.h>
 #include <asm/io.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 #include <usb/ehci-fsl.h>
 #include <errno.h>
 
index cff34389295c5d13ce12d8988bdad47ab8c64c0a..4abe5e3b59a56946515ee1fff790d713d3973f3b 100644 (file)
@@ -28,7 +28,9 @@
 #ifdef CONFIG_PCI_EHCI_DEVICE
 static struct pci_device_id ehci_pci_ids[] = {
        /* Please add supported PCI EHCI controller ids here */
-       {0x1033, 0x00E0},
+       {0x1033, 0x00E0},       /* NEC */
+       {0x10B9, 0x5239},       /* ULI1575 PCI EHCI module ids */
+       {0x12D8, 0x400F},       /* Pericom */
        {0, 0}
 };
 #endif
index 38aceb2e93d32a2a0d49dee2076d0eb55fae2b1f..35268ba58ef00b1c18e18ccecd7f0b0c85e3f0b9 100644 (file)
 
 #include "musb_core.h"
 
+#ifndef CONFIG_USB_BLACKFIN_CLKIN
+#define CONFIG_USB_BLACKFIN_CLKIN 24
+#endif
+
 /* MUSB platform configuration */
 struct musb_config musb_cfg = {
        .regs       = (struct musb_regs *)USB_FADDR,
@@ -93,10 +97,25 @@ static void __def_musb_init(void)
 }
 void board_musb_init(void) __attribute__((weak, alias("__def_musb_init")));
 
-int musb_platform_init(void)
+static void bfin_anomaly_init(void)
 {
-       /* board specific initialization */
-       board_musb_init();
+       u32 revid;
+
+       if (!ANOMALY_05000346 && !ANOMALY_05000347)
+               return;
+
+       revid = bfin_revid();
+
+#ifdef __ADSPBF54x__
+       if (revid > 0)
+               return;
+#endif
+#ifdef __ADSPBF52x__
+       if (ANOMALY_BF526 && revid > 0)
+               return;
+       if (ANOMALY_BF527 && revid > 1)
+               return;
+#endif
 
        if (ANOMALY_05000346) {
                bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value);
@@ -107,9 +126,18 @@ int musb_platform_init(void)
                bfin_write_USB_APHY_CNTRL(0x0);
                SSYNC();
        }
+}
+
+int musb_platform_init(void)
+{
+       /* board specific initialization */
+       board_musb_init();
+
+       bfin_anomaly_init();
 
        /* Configure PLL oscillator register */
-       bfin_write_USB_PLLOSC_CTRL(0x30a8);
+       bfin_write_USB_PLLOSC_CTRL(0x3080 |
+               ((480 / CONFIG_USB_BLACKFIN_CLKIN) << 1));
        SSYNC();
 
        bfin_write_USB_SRP_CLKDIV((get_sclk()/1000) / 32 - 1);
index 2c53a6f3e33f2248be94041f1c8d56c19a53d848..086dc0538341ab7333ccd122abfa095263cd8787 100644 (file)
@@ -28,7 +28,7 @@ LIB   := $(obj)libvideo.o
 COBJS-$(CONFIG_ATI_RADEON_FB) += ati_radeon_fb.o videomodes.o
 COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
 COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o
-COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o
+COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o
 COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
 COBJS-$(CONFIG_VIDEO_AMBA) += amba.o
 COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o
index dd849c2dc13207bae02c8a6479bfabe8085fe8f6..b427c84877c5fee9b3fbc925b0acaed3887f3e65 100644 (file)
@@ -882,6 +882,8 @@ static int display_rle8_bitmap (bmp_image_t *img, int xoff, int yoff,
        struct palette p[256];
        bmp_color_table_entry_t cte;
        int green_shift, red_off;
+       int limit = VIDEO_COLS * VIDEO_ROWS;
+       int pixels = 0;
 
        x = 0;
        y = __le32_to_cpu(img->header.height) - 1;
@@ -962,6 +964,10 @@ static int display_rle8_bitmap (bmp_image_t *img, int xoff, int yoff,
                                /* unencoded run */
                                cnt = bm[1];
                                runlen = cnt;
+                               pixels += cnt;
+                               if (pixels > limit)
+                                       goto error;
+
                                bm += 2;
                                if (y < height) {
                                        if (x >= width) {
@@ -970,7 +976,6 @@ static int display_rle8_bitmap (bmp_image_t *img, int xoff, int yoff,
                                        }
                                        if (x + runlen > width)
                                                cnt = width - x;
-
                                        draw_bitmap (&fbp, bm, p, cnt, 0);
                                        x += runlen;
                                }
@@ -982,9 +987,13 @@ next_run:
                        break;
                default:
                        /* encoded run */
+                       cnt = bm[0];
+                       runlen = cnt;
+                       pixels += cnt;
+                       if (pixels > limit)
+                               goto error;
+
                        if (y < height) { /* only draw into visible area */
-                               cnt = bm[0];
-                               runlen = cnt;
                                if (x >= width) {
                                        x += runlen;
                                        bm += 2;
@@ -992,7 +1001,6 @@ next_run:
                                }
                                if (x + runlen > width)
                                        cnt = width - x;
-
                                draw_bitmap (&fbp, bm, p, cnt, 1);
                                x += runlen;
                        }
@@ -1001,6 +1009,9 @@ next_run:
                }
        }
        return 0;
+error:
+       printf("Error: Too much encoded pixel data, validate your bitmap\n");
+       return -1;
 }
 #endif
 
index 35ed938befb5e30d28d40172fe1e176931a26cff..0709849048fafd399787231b95aec1fdcc8270e4 100644 (file)
@@ -1,6 +1,7 @@
 /*
- * Copyright 2007, 2010 Freescale Semiconductor, Inc.
- * York Sun <yorksun@freescale.com>
+ * Copyright 2007, 2010-2011 Freescale Semiconductor, Inc.
+ * Authors: York Sun <yorksun@freescale.com>
+ *          Timur Tabi <timur@freescale.com>
  *
  * FSL DIU Framebuffer driver
  *
  */
 
 #include <common.h>
-#include <i2c.h>
 #include <malloc.h>
 #include <asm/io.h>
 
+#include "videomodes.h"
+#include <video_fb.h>
 #include <fsl_diu_fb.h>
 
+struct fb_var_screeninfo {
+       unsigned int xres;              /* visible resolution           */
+       unsigned int yres;
+
+       unsigned int bits_per_pixel;    /* guess what                   */
+
+       /* Timing: All values in pixclocks, except pixclock (of course) */
+       unsigned int pixclock;          /* pixel clock in ps (pico seconds) */
+       unsigned int left_margin;       /* time from sync to picture    */
+       unsigned int right_margin;      /* time from picture to sync    */
+       unsigned int upper_margin;      /* time from sync to picture    */
+       unsigned int lower_margin;
+       unsigned int hsync_len;         /* length of horizontal sync    */
+       unsigned int vsync_len;         /* length of vertical sync      */
+       unsigned int sync;              /* see FB_SYNC_*                */
+       unsigned int vmode;             /* see FB_VMODE_*               */
+       unsigned int rotate;            /* angle we rotate counter clockwise */
+};
+
+struct fb_info {
+       struct fb_var_screeninfo var;   /* Current var */
+       unsigned int smem_len;          /* Length of frame buffer mem */
+       unsigned int type;              /* see FB_TYPE_*                */
+       unsigned int line_length;       /* length of a line in bytes    */
+
+       void *screen_base;
+       unsigned long screen_size;
+};
+
 struct fb_videomode {
        const char *name;       /* optional */
        unsigned int refresh;           /* optional */
@@ -53,6 +84,7 @@ struct fb_videomode {
 
 /* This setting is used for the ifm pdm360ng with PRIMEVIEW PM070WL3 */
 static struct fb_videomode fsl_diu_mode_800 = {
+       .name           = "800x600-60",
        .refresh        = 60,
        .xres           = 800,
        .yres           = 480,
@@ -74,6 +106,7 @@ static struct fb_videomode fsl_diu_mode_800 = {
  * hsync 31.5kHz, vsync 60Hz
  */
 static struct fb_videomode fsl_diu_mode_1024 = {
+       .name           = "1024x768-60",
        .refresh        = 60,
        .xres           = 1024,
        .yres           = 768,
@@ -109,120 +142,137 @@ static struct fb_videomode fsl_diu_mode_1280 = {
  */
 struct diu_ad {
        /* Word 0(32-bit) in DDR memory */
-       unsigned int pix_fmt; /* hard coding pixel format */
+       __le32 pix_fmt; /* hard coding pixel format */
        /* Word 1(32-bit) in DDR memory */
-       unsigned int addr;
+       __le32 addr;
        /* Word 2(32-bit) in DDR memory */
-       unsigned int src_size_g_alpha;
+       __le32 src_size_g_alpha;
        /* Word 3(32-bit) in DDR memory */
-       unsigned int aoi_size;
+       __le32 aoi_size;
        /* Word 4(32-bit) in DDR memory */
-       unsigned int offset_xyi;
+       __le32 offset_xyi;
        /* Word 5(32-bit) in DDR memory */
-       unsigned int offset_xyd;
+       __le32 offset_xyd;
        /* Word 6(32-bit) in DDR memory */
-       unsigned int ckmax_r:8;
-       unsigned int ckmax_g:8;
-       unsigned int ckmax_b:8;
-       unsigned int res9:8;
+       __le32 ckmax_r:8;
+       __le32 ckmax_g:8;
+       __le32 ckmax_b:8;
+       __le32 res9:8;
        /* Word 7(32-bit) in DDR memory */
-       unsigned int ckmin_r:8;
-       unsigned int ckmin_g:8;
-       unsigned int ckmin_b:8;
-       unsigned int res10:8;
+       __le32 ckmin_r:8;
+       __le32 ckmin_g:8;
+       __le32 ckmin_b:8;
+       __le32 res10:8;
        /* Word 8(32-bit) in DDR memory */
-       unsigned int next_ad;
+       __le32 next_ad;
        /* Word 9(32-bit) in DDR memory, just for 64-bit aligned */
-       unsigned int res1;
-       unsigned int res2;
-       unsigned int res3;
-}__attribute__ ((packed));
+       __le32 res[3];
+} __attribute__ ((packed));
 
 /*
  * DIU register map
  */
 struct diu {
-       unsigned int desc[3];
-       unsigned int gamma;
-       unsigned int pallete;
-       unsigned int cursor;
-       unsigned int curs_pos;
-       unsigned int diu_mode;
-       unsigned int bgnd;
-       unsigned int bgnd_wb;
-       unsigned int disp_size;
-       unsigned int wb_size;
-       unsigned int wb_mem_addr;
-       unsigned int hsyn_para;
-       unsigned int vsyn_para;
-       unsigned int syn_pol;
-       unsigned int thresholds;
-       unsigned int int_status;
-       unsigned int int_mask;
-       unsigned int colorbar[8];
-       unsigned int filling;
-       unsigned int plut;
+       __be32 desc[3];
+       __be32 gamma;
+       __be32 pallete;
+       __be32 cursor;
+       __be32 curs_pos;
+       __be32 diu_mode;
+       __be32 bgnd;
+       __be32 bgnd_wb;
+       __be32 disp_size;
+       __be32 wb_size;
+       __be32 wb_mem_addr;
+       __be32 hsyn_para;
+       __be32 vsyn_para;
+       __be32 syn_pol;
+       __be32 thresholds;
+       __be32 int_status;
+       __be32 int_mask;
+       __be32 colorbar[8];
+       __be32 filling;
+       __be32 plut;
 } __attribute__ ((packed));
 
-struct diu_hw {
-       struct diu *diu_reg;
-       volatile unsigned int mode;             /* DIU operation mode */
-};
-
 struct diu_addr {
-       unsigned char  *  paddr;        /* Virtual address */
-       unsigned int       offset;
+       void *vaddr;            /* Virtual address */
+       u32 paddr;              /* 32-bit physical address */
+       unsigned int offset;    /* Alignment offset */
 };
 
+static struct fb_info info;
+
 /*
- * Modes of operation of DIU
+ * Align to 64-bit(8-byte), 32-byte, etc.
  */
-#define MFB_MODE0      0       /* DIU off */
-#define MFB_MODE1      1       /* All three planes output to display */
-#define MFB_MODE2      2       /* Plane 1 to display,
-                                * planes 2+3 written back to memory */
-#define MFB_MODE3      3       /* All three planes written back to memory */
-#define MFB_MODE4      4       /* Color bar generation */
-
-#define MAX_CURS               32
-
-static struct fb_info fsl_fb_info;
-static struct diu_addr gamma, cursor;
-static struct diu_ad fsl_diu_fb_ad __attribute__ ((aligned(32)));
-static struct diu_ad dummy_ad __attribute__ ((aligned(32)));
-static unsigned char *dummy_fb;
-static struct diu_hw dr = {
-       .mode = MFB_MODE1,
-};
+static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align)
+{
+       u32 offset, ssize;
+       u32 mask;
 
-int fb_enabled = 0;
-int fb_initialized = 0;
-const int default_xres = 1280;
-const int default_pixel_format = 0x88882317;
+       ssize = size + bytes_align;
+       buf->vaddr = malloc(ssize);
+       if (!buf->vaddr)
+               return -1;
 
-static int map_video_memory(struct fb_info *info, unsigned long bytes_align);
-static void enable_lcdc(void);
-static void disable_lcdc(void);
-static int fsl_diu_enable_panel(struct fb_info *info);
-static int fsl_diu_disable_panel(struct fb_info *info);
-static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align);
-void diu_set_pixel_clock(unsigned int pixclock);
+       memset(buf->vaddr, 0, ssize);
+       mask = bytes_align - 1;
+       offset = (u32)buf->vaddr & mask;
+       if (offset) {
+               buf->offset = bytes_align - offset;
+               buf->vaddr += offset;
+       } else
+               buf->offset = 0;
 
-int fsl_diu_init(int xres, unsigned int pixel_format, int gamma_fix)
+       buf->paddr = virt_to_phys(buf->vaddr);
+       return 0;
+}
+
+/*
+ * Allocate a framebuffer and an Area Descriptor that points to it.  Both
+ * are created in the same memory block.  The Area Descriptor is updated to
+ * point to the framebuffer memory. Memory is aligned as needed.
+ */
+static struct diu_ad *allocate_fb(unsigned int xres, unsigned int yres,
+                                 unsigned int depth, void **fb)
 {
-       struct fb_videomode *fsl_diu_mode_db;
-       struct diu_ad *ad = &fsl_diu_fb_ad;
-       struct diu *hw;
-       struct fb_info *info = &fsl_fb_info;
-       struct fb_var_screeninfo *var = &info->var;
-       unsigned char *gamma_table_base;
-       unsigned int i, j;
+       unsigned long size = xres * yres * depth;
+       struct diu_addr addr;
+       struct diu_ad *ad;
+       size_t ad_size = roundup(sizeof(struct diu_ad), 32);
+
+       /*
+        * Allocate a memory block that holds the Area Descriptor and the
+        * frame buffer right behind it.  To keep the code simple, everything
+        * is aligned on a 32-byte address.
+        */
+       if (allocate_buf(&addr, ad_size + size, 32) < 0)
+               return NULL;
 
-       debug("Enter fsl_diu_init\n");
-       dr.diu_reg = (struct diu *) (CONFIG_SYS_DIU_ADDR);
-       hw = (struct diu *) dr.diu_reg;
+       ad = addr.vaddr;
+       ad->addr = cpu_to_le32(addr.paddr + ad_size);
+       ad->aoi_size = cpu_to_le32((yres << 16) | xres);
+       ad->src_size_g_alpha = cpu_to_le32((yres << 12) | xres);
+       ad->offset_xyi = 0;
+       ad->offset_xyd = 0;
 
-       disable_lcdc();
+       if (fb)
+               *fb = addr.vaddr + ad_size;
+
+       return ad;
+}
+
+int fsl_diu_init(int xres, u32 pixel_format, int gamma_fix)
+{
+       struct fb_videomode *fsl_diu_mode_db;
+       struct diu_ad *ad;
+       struct diu *hw = (struct diu *)CONFIG_SYS_DIU_ADDR;
+       u8 *gamma_table_base;
+       unsigned int i, j;
+       struct diu_ad *dummy_ad;
+       struct diu_addr gamma;
+       struct diu_addr cursor;
 
        switch (xres) {
        case 800:
@@ -235,65 +285,40 @@ int fsl_diu_init(int xres, unsigned int pixel_format, int gamma_fix)
                fsl_diu_mode_db = &fsl_diu_mode_1024;
        }
 
-       if (0 == fb_initialized) {
-               allocate_buf(&gamma, 768, 32);
-               debug("gamma is allocated @ 0x%x\n",
-                       (unsigned int)gamma.paddr);
-               allocate_buf(&cursor, MAX_CURS * MAX_CURS * 2, 32);
-               debug("curosr is allocated @ 0x%x\n",
-                       (unsigned int)cursor.paddr);
-
-               /* create a dummy fb and dummy ad */
-               dummy_fb = malloc(64);
-               if (NULL == dummy_fb) {
-                       printf("Cannot allocate dummy fb\n");
-                       return -1;
-               }
-               dummy_ad.addr = cpu_to_le32((unsigned int)dummy_fb);
-               dummy_ad.pix_fmt = 0x88882317;
-               dummy_ad.src_size_g_alpha = 0x04400000; /* alpha = 0 */
-               dummy_ad.aoi_size = 0x02000400;
-               dummy_ad.offset_xyi = 0;
-               dummy_ad.offset_xyd = 0;
-               dummy_ad.next_ad = 0;
-               /* Memory allocation for framebuffer */
-               if (map_video_memory(info, 32)) {
-                       printf("Unable to allocate fb memory 1\n");
-                       return -1;
-               }
+       /* The AD struct for the dummy framebuffer and the FB itself */
+       dummy_ad = allocate_fb(2, 4, 4, NULL);
+       if (!dummy_ad) {
+               printf("DIU:   Out of memory\n");
+               return -1;
        }
-
-       memset(info->screen_base, 0, info->smem_len);
-
-       out_be32(&dr.diu_reg->desc[0], (int)&dummy_ad);
-       out_be32(&dr.diu_reg->desc[1], (int)&dummy_ad);
-       out_be32(&dr.diu_reg->desc[2], (int)&dummy_ad);
-       debug("dummy dr.diu_reg->desc[0] = 0x%x\n", dr.diu_reg->desc[0]);
-       debug("dummy desc[0] = 0x%x\n", hw->desc[0]);
+       dummy_ad->pix_fmt = 0x88883316;
 
        /* read mode info */
-       var->xres = fsl_diu_mode_db->xres;
-       var->yres = fsl_diu_mode_db->yres;
-       var->bits_per_pixel = 32;
-       var->pixclock = fsl_diu_mode_db->pixclock;
-       var->left_margin = fsl_diu_mode_db->left_margin;
-       var->right_margin = fsl_diu_mode_db->right_margin;
-       var->upper_margin = fsl_diu_mode_db->upper_margin;
-       var->lower_margin = fsl_diu_mode_db->lower_margin;
-       var->hsync_len = fsl_diu_mode_db->hsync_len;
-       var->vsync_len = fsl_diu_mode_db->vsync_len;
-       var->sync = fsl_diu_mode_db->sync;
-       var->vmode = fsl_diu_mode_db->vmode;
-       info->line_length = var->xres * var->bits_per_pixel / 8;
+       info.var.xres = fsl_diu_mode_db->xres;
+       info.var.yres = fsl_diu_mode_db->yres;
+       info.var.bits_per_pixel = 32;
+       info.var.pixclock = fsl_diu_mode_db->pixclock;
+       info.var.left_margin = fsl_diu_mode_db->left_margin;
+       info.var.right_margin = fsl_diu_mode_db->right_margin;
+       info.var.upper_margin = fsl_diu_mode_db->upper_margin;
+       info.var.lower_margin = fsl_diu_mode_db->lower_margin;
+       info.var.hsync_len = fsl_diu_mode_db->hsync_len;
+       info.var.vsync_len = fsl_diu_mode_db->vsync_len;
+       info.var.sync = fsl_diu_mode_db->sync;
+       info.var.vmode = fsl_diu_mode_db->vmode;
+       info.line_length = info.var.xres * info.var.bits_per_pixel / 8;
+
+       /* Memory allocation for framebuffer */
+       info.smem_len =
+               info.var.xres * info.var.yres * (info.var.bits_per_pixel / 8);
+       ad = allocate_fb(info.var.xres, info.var.yres,
+                        info.var.bits_per_pixel / 8, &info.screen_base);
+       if (!ad) {
+               printf("DIU:   Out of memory\n");
+               return -1;
+       }
 
        ad->pix_fmt = pixel_format;
-       ad->addr    = cpu_to_le32((unsigned int)info->screen_base);
-       ad->src_size_g_alpha
-                       = cpu_to_le32((var->yres << 12) | var->xres);
-       /* fix me. AOI should not be greater than display size */
-       ad->aoi_size    = cpu_to_le32(( var->yres << 16) |  var->xres);
-       ad->offset_xyi = 0;
-       ad->offset_xyd = 0;
 
        /* Disable chroma keying function */
        ad->ckmax_r = 0;
@@ -304,195 +329,91 @@ int fsl_diu_init(int xres, unsigned int pixel_format, int gamma_fix)
        ad->ckmin_g = 255;
        ad->ckmin_b = 255;
 
-       gamma_table_base = gamma.paddr;
-       debug("gamma_table_base is allocated @ 0x%x\n",
-               (unsigned int)gamma_table_base);
-
-       /* Prep for DIU init  - gamma table */
-
+       /* Initialize the gamma table */
+       if (allocate_buf(&gamma, 256 * 3, 32) < 0) {
+               printf("DIU:   Out of memory\n");
+               return -1;
+       }
+       gamma_table_base = gamma.vaddr;
        for (i = 0; i <= 2; i++)
-               for (j = 0; j <= 255; j++)
+               for (j = 0; j < 256; j++)
                        *gamma_table_base++ = j;
 
        if (gamma_fix == 1) {   /* fix the gamma */
-               debug("Fix gamma table\n");
-               gamma_table_base = gamma.paddr;
-               for (i = 0; i < 256*3; i++) {
+               gamma_table_base = gamma.vaddr;
+               for (i = 0; i < 256 * 3; i++) {
                        gamma_table_base[i] = (gamma_table_base[i] << 2)
                                | ((gamma_table_base[i] >> 6) & 0x03);
                }
        }
 
-       debug("update-lcdc: HW - %p\n Disabling DIU\n", hw);
+       /* Initialize the cursor */
+       if (allocate_buf(&cursor, 32 * 32 * 2, 32) < 0) {
+               printf("DIU:   Can't alloc cursor data\n");
+               return -1;
+       }
 
        /* Program DIU registers */
+       out_be32(&hw->diu_mode, 0);     /* Temporarily disable the DIU */
 
-       out_be32(&hw->gamma, (int)gamma.paddr);
-       out_be32(&hw->cursor, (int)cursor.paddr);
+       out_be32(&hw->gamma, gamma.paddr);
+       out_be32(&hw->cursor, cursor.paddr);
        out_be32(&hw->bgnd, 0x007F7F7F);
-       out_be32(&hw->bgnd_wb, 0);                              /* BGND_WB */
-       out_be32(&hw->disp_size, var->yres << 16 | var->xres);  /* DISP SIZE */
-       out_be32(&hw->wb_size, 0);                              /* WB SIZE */
-       out_be32(&hw->wb_mem_addr, 0);                          /* WB MEM ADDR */
-       out_be32(&hw->hsyn_para, var->left_margin << 22 |       /* BP_H */
-                       var->hsync_len << 11   |        /* PW_H */
-                       var->right_margin);             /* FP_H */
-
-       out_be32(&hw->vsyn_para, var->upper_margin << 22 |      /* BP_V */
-                       var->vsync_len << 11    |       /* PW_V  */
-                       var->lower_margin);             /* FP_V  */
-
-       out_be32(&hw->syn_pol, 0);                      /* SYNC SIGNALS POLARITY */
-       out_be32(&hw->thresholds, 0x00037800);          /* The Thresholds */
-       out_be32(&hw->int_status, 0);                   /* INTERRUPT STATUS */
-       out_be32(&hw->int_mask, 0);                     /* INT MASK */
+       out_be32(&hw->bgnd_wb, 0);
+       out_be32(&hw->disp_size, info.var.yres << 16 | info.var.xres);
+       out_be32(&hw->wb_size, 0);
+       out_be32(&hw->wb_mem_addr, 0);
+       out_be32(&hw->hsyn_para, info.var.left_margin << 22 |
+                       info.var.hsync_len << 11 |
+                       info.var.right_margin);
+
+       out_be32(&hw->vsyn_para, info.var.upper_margin << 22 |
+                       info.var.vsync_len << 11 |
+                       info.var.lower_margin);
+
+       out_be32(&hw->syn_pol, 0);
+       out_be32(&hw->thresholds, 0x00037800);
+       out_be32(&hw->int_status, 0);
+       out_be32(&hw->int_mask, 0);
        out_be32(&hw->plut, 0x01F5F666);
        /* Pixel Clock configuration */
-       debug("DIU pixclock in ps - %d\n", var->pixclock);
-       diu_set_pixel_clock(var->pixclock);
-
-       fb_initialized = 1;
-
-       /* Enable the DIU */
-       fsl_diu_enable_panel(info);
-       enable_lcdc();
-
-       return 0;
-}
-
-char *fsl_fb_open(struct fb_info **info)
-{
-       *info = &fsl_fb_info;
-       return fsl_fb_info.screen_base;
-}
-
-void fsl_diu_close(void)
-{
-       struct fb_info *info = &fsl_fb_info;
-       fsl_diu_disable_panel(info);
-}
+       diu_set_pixel_clock(info.var.pixclock);
 
-static int fsl_diu_enable_panel(struct fb_info *info)
-{
-       struct diu *hw = dr.diu_reg;
-       struct diu_ad *ad = &fsl_diu_fb_ad;
-
-       debug("Entered: enable_panel\n");
-       if (in_be32(&hw->desc[0]) != (unsigned)ad)
-               out_be32(&hw->desc[0], (unsigned)ad);
-       debug("desc[0] = 0x%x\n", hw->desc[0]);
-       return 0;
-}
+       /* Set the frame buffers */
+       out_be32(&hw->desc[0], virt_to_phys(ad));
+       out_be32(&hw->desc[1], virt_to_phys(dummy_ad));
+       out_be32(&hw->desc[2], virt_to_phys(dummy_ad));
 
-static int fsl_diu_disable_panel(struct fb_info *info)
-{
-       struct diu *hw = dr.diu_reg;
+       /* Enable the DIU, set display to all three planes */
+       out_be32(&hw->diu_mode, 1);
 
-       debug("Entered: disable_panel\n");
-       if (in_be32(&hw->desc[0]) != (unsigned)&dummy_ad)
-               out_be32(&hw->desc[0], (unsigned)&dummy_ad);
        return 0;
 }
 
-static int map_video_memory(struct fb_info *info, unsigned long bytes_align)
-{
-       unsigned long offset;
-       unsigned long mask;
-
-       debug("Entered: map_video_memory\n");
-       /* allocate maximum 1280*1024 with 32bpp */
-       info->smem_len = 1280 * 4 *1024 + bytes_align;
-       debug("MAP_VIDEO_MEMORY: smem_len = %d\n", info->smem_len);
-       info->screen_base = malloc(info->smem_len);
-       if (info->screen_base == NULL) {
-               printf("Unable to allocate fb memory\n");
-               return -1;
-       }
-       info->smem_start = (unsigned int) info->screen_base;
-       mask = bytes_align - 1;
-       offset = (unsigned long)info->screen_base & mask;
-       if (offset) {
-               info->screen_base += (bytes_align - offset);
-               info->smem_len = info->smem_len - (bytes_align - offset);
-       } else
-               info->smem_len = info->smem_len - bytes_align;
-
-       info->screen_size = info->smem_len;
-
-       debug("Allocated fb @ 0x%08lx, size=%d.\n",
-               info->smem_start, info->smem_len);
-
-       return 0;
-}
-
-static void enable_lcdc(void)
-{
-       struct diu *hw = dr.diu_reg;
-
-       debug("Entered: enable_lcdc, fb_enabled = %d\n", fb_enabled);
-       if (!fb_enabled) {
-               out_be32(&hw->diu_mode, dr.mode);
-               fb_enabled++;
-       }
-       debug("diu_mode = %d\n", hw->diu_mode);
-}
-
-static void disable_lcdc(void)
-{
-       struct diu *hw = dr.diu_reg;
-
-       debug("Entered: disable_lcdc, fb_enabled = %d\n", fb_enabled);
-       if (fb_enabled) {
-               out_be32(&hw->diu_mode, 0);
-               fb_enabled = 0;
-       }
-}
-
-/*
- * Align to 64-bit(8-byte), 32-byte, etc.
- */
-static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align)
+void *video_hw_init(void)
 {
-       u32 offset, ssize;
-       u32 mask;
-
-       debug("Entered: allocate_buf\n");
-       ssize = size + bytes_align;
-       buf->paddr = malloc(ssize);
-       if (!buf->paddr)
-               return -1;
-
-       memset(buf->paddr, 0, ssize);
-       mask = bytes_align - 1;
-       offset = (u32)buf->paddr & mask;
-       if (offset) {
-               buf->offset = bytes_align - offset;
-               buf->paddr = (unsigned char *) ((u32)buf->paddr + offset);
-       } else
-               buf->offset = 0;
-       return 0;
-}
+       static GraphicDevice ctfb;
+       const char *options;
+       unsigned int depth = 0, freq = 0;
 
-#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
-#include <stdio_dev.h>
-#include <video_fb.h>
-/*
- * The Graphic Device
- */
-static GraphicDevice ctfb;
+       if (!video_get_video_mode(&ctfb.winSizeX, &ctfb.winSizeY, &depth, &freq,
+                                 &options))
+               return NULL;
 
-void *video_hw_init(void)
-{
-       struct fb_info *info;
+       /* Find the monitor port, which is a required option */
+       if (!options)
+               return NULL;
+       if (strncmp(options, "monitor=", 8) != 0)
+               return NULL;
 
-       if (platform_diu_init(&ctfb.winSizeX, &ctfb.winSizeY) < 0)
+       if (platform_diu_init(ctfb.winSizeX, ctfb.winSizeY, options + 8) < 0)
                return NULL;
 
        /* fill in Graphic device struct */
        sprintf(ctfb.modeIdent, "%ix%ix%i %ikHz %iHz",
-               ctfb.winSizeX, ctfb.winSizeY, 32, 64, 60);
+               ctfb.winSizeX, ctfb.winSizeY, depth, 64, freq);
 
-       ctfb.frameAdrs = (unsigned int)fsl_fb_open(&info);
+       ctfb.frameAdrs = (unsigned int)info.screen_base;
        ctfb.plnSizeX = ctfb.winSizeX;
        ctfb.plnSizeY = ctfb.winSizeY;
 
@@ -501,7 +422,7 @@ void *video_hw_init(void)
 
        ctfb.isaBase = 0;
        ctfb.pciBase = 0;
-       ctfb.memSize = info->screen_size;
+       ctfb.memSize = info.screen_size;
 
        /* Cursor Start Address */
        ctfb.dprBase = 0;
@@ -510,4 +431,3 @@ void *video_hw_init(void)
 
        return &ctfb;
 }
-#endif /* defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE) */
index 6dd952cbbeaffddf6480a813adb0a7625f7712a3..0c925a03f39c423d07344fbafda3d2ba7cc22ce0 100644 (file)
@@ -22,8 +22,8 @@
  */
 #include <common.h>
 #include <lcd.h>
-#include <asm/arch/mx31.h>
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/imx-regs.h>
 #include <asm/errno.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -192,7 +192,7 @@ enum ipu_panel {
 };
 
 /* IPU Common registers */
-/* IPU_CONF and its bits already defined in mx31-regs.h */
+/* IPU_CONF and its bits already defined in imx-regs.h */
 #define IPU_CHA_BUF0_RDY       (0x04 + IPU_BASE)
 #define IPU_CHA_BUF1_RDY       (0x08 + IPU_BASE)
 #define IPU_CHA_DB_MODE_SEL    (0x0C + IPU_BASE)
index d27ce1d2cd2a45c400df753233be499583c92774..6fe5811aec92ba4aa377f92f6c56aee2e8b8ffe8 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * (C) Copyright 2004
  * Pierre Aubert, Staubli Faverges , <p.aubert@staubli.com>
+ * Copyright 2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -73,6 +74,8 @@
 ****************************************************************************/
 
 #include <common.h>
+#include <linux/ctype.h>
+
 #include "videomodes.h"
 
 const struct ctfb_vesa_modes vesa_modes[VESA_MODES_COUNT] = {
@@ -206,3 +209,64 @@ int video_get_params (struct ctfb_res_modes *pPar, char *penv)
        }
        return bpp;
 }
+
+/*
+ * Parse the 'video-mode' environment variable
+ *
+ * Example: "video-mode=fslfb:1280x1024-32@60,monitor=dvi".  See
+ * doc/README.video for more information on how to set the variable.
+ *
+ * @xres: returned value of X-resolution
+ * @yres: returned value of Y-resolution
+ * @depth: returned value of color depth
+ * @freq: returned value of monitor frequency
+ * @options: pointer to any remaining options, or NULL
+ *
+ * Returns 1 if valid values were found, 0 otherwise
+ */
+int video_get_video_mode(unsigned int *xres, unsigned int *yres,
+       unsigned int *depth, unsigned int *freq, const char **options)
+{
+       char *p = getenv("video-mode");
+       if (!p)
+               return 0;
+
+       /* Skip over the driver name, which we don't care about. */
+       p = strchr(p, ':');
+       if (!p)
+               return 0;
+
+       /* Get the X-resolution*/
+       while (*p && !isdigit(*p))
+               p++;
+       *xres = simple_strtoul(p, &p, 10);
+       if (!*xres)
+               return 0;
+
+       /* Get the Y-resolution */
+       while (*p && !isdigit(*p))
+               p++;
+       *yres = simple_strtoul(p, &p, 10);
+       if (!*yres)
+               return 0;
+
+       /* Get the depth */
+       while (*p && !isdigit(*p))
+               p++;
+       *depth = simple_strtoul(p, &p, 10);
+       if (!*depth)
+               return 0;
+
+       /* Get the frequency */
+       while (*p && !isdigit(*p))
+               p++;
+       *freq = simple_strtoul(p, &p, 10);
+       if (!*freq)
+               return 0;
+
+       /* Find the extra options, if any */
+       p = strchr(p, ',');
+       *options = p ? p + 1 : NULL;
+
+       return 1;
+}
index 0d7c335410ca7ca675a38fe313371d31daa98311..e546ab44f17f93ffc110ca365662fadcb2ade89e 100644 (file)
@@ -86,3 +86,6 @@ extern const struct ctfb_vesa_modes vesa_modes[];
 extern const struct ctfb_res_modes res_mode_init[];
 
 int video_get_params (struct ctfb_res_modes *pPar, char *penv);
+
+int video_get_video_mode(unsigned int *xres, unsigned int *yres,
+       unsigned int *depth, unsigned int *freq, const char **options);
index 6ab4d52d9c652372215ff31a6ab2b6e93bbe12df..5579bf2f1416a1a2b847b2bc038a3ac58f6f0c42 100644 (file)
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB    := $(obj)libwatchdog.o
 
 COBJS-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
+COBJS-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/watchdog/ftwdt010_wdt.c b/drivers/watchdog/ftwdt010_wdt.c
new file mode 100644 (file)
index 0000000..c9cb53e
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Watchdog driver for the FTWDT010 Watch Dog Driver
+ *
+ * (c) Copyright 2004 Faraday Technology Corp. (www.faraday-tech.com)
+ * Based on sa1100_wdt.c by Oleg Drokin <green@crimea.edu>
+ * Based on SoftDog driver by Alan Cox <alan@redhat.com>
+ *
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * 27/11/2004 Initial release, Faraday.
+ * 12/01/2011 Port to u-boot, Macpaul Lin.
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <asm/io.h>
+#include <faraday/ftwdt010_wdt.h>
+
+/*
+ * Set the watchdog time interval.
+ * Counter is 32 bit.
+ */
+int ftwdt010_wdt_settimeout(unsigned int timeout)
+{
+       unsigned int reg;
+
+       struct ftwdt010_wdt *wd = (struct ftwdt010_wdt *)CONFIG_FTWDT010_BASE;
+
+       debug("Activating WDT..\n");
+
+       /* Check if disabled */
+       if (readl(&wd->wdcr) & ~FTWDT010_WDCR_ENABLE) {
+               printf("sorry, watchdog is disabled\n");
+               return -1;
+       }
+
+       /*
+        * In a 66MHz system,
+        * if you set WDLOAD as 0x03EF1480 (66000000)
+        * the reset timer is 1 second.
+        */
+       reg = FTWDT010_WDLOAD(timeout * FTWDT010_TIMEOUT_FACTOR);
+
+       writel(reg, &wd->wdload);
+
+       return 0;
+}
+
+void ftwdt010_wdt_reset(void)
+{
+       struct ftwdt010_wdt *wd = (struct ftwdt010_wdt *)CONFIG_FTWDT010_BASE;
+
+       /* clear control register */
+       writel(0, &wd->wdcr);
+
+       /* Write Magic number */
+       writel(FTWDT010_WDRESTART_MAGIC, &wd->wdrestart);
+
+       /* Enable WDT */
+       writel((FTWDT010_WDCR_RST | FTWDT010_WDCR_ENABLE), &wd->wdcr);
+}
+
+void ftwdt010_wdt_disable(void)
+{
+       struct ftwdt010_wdt *wd = (struct ftwdt010_wdt *)CONFIG_FTWDT010_BASE;
+
+       debug("Deactivating WDT..\n");
+
+       /*
+        * It was defined with CONFIG_WATCHDOG_NOWAYOUT in Linux
+        *
+        * Shut off the timer.
+        * Lock it in if it's a module and we defined ...NOWAYOUT
+        */
+       writel(0, &wd->wdcr);
+}
+
+#if defined(CONFIG_HW_WATCHDOG)
+void hw_watchdog_reset(void)
+{
+       ftwdt010_wdt_reset();
+}
+
+void hw_watchdog_init(void)
+{
+       /* set timer in ms */
+       ftwdt010_wdt_settimeout(CONFIG_FTWDT010_HW_TIMEOUT * 1000);
+}
+#endif
index c1dfdce581d8f1823754ab8089ac1b304c52eb58..66b5d24f032b812fac4ac65a080277ab47cd385b 100644 (file)
@@ -95,7 +95,7 @@ $(LIB):       $(obj).depend $(LIBOBJS)
 
 $(ELF):
 $(obj)%:       $(obj)%.o $(LIB)
-               $(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) \
+               $(LD) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \
                        -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
                        -L$(gcclibdir) -lgcc
 
index 2d2e7098b7b3cb701ea8de9460483afb66fa0230..507d38ceaf94b1d900f5c8e3e0b1ded5c47e907e 100644 (file)
@@ -4,7 +4,7 @@
 #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
 #endif /* GCC_VERSION */
 
-#if defined(CONFIG_I386)
+#if defined(CONFIG_X86)
 /*
  * x86 does not have a dedicated register to store the pointer to
  * the global_data. Thus the jump table address is stored in a
@@ -198,7 +198,7 @@ void app_startup(char * const *argv)
                *cp++ = 0;
        }
 
-#if defined(CONFIG_I386)
+#if defined(CONFIG_X86)
        /* x86 does not have a dedicated register for passing global_data */
        global_data = (gd_t *)argv[-1];
        jt = global_data->jt;
index a75e4f258aa1ec768f28d3fe3f8ac2a1bcc9a87d..c450bf6924431ba5d399ec3423fb854b2a4a64ea 100644 (file)
@@ -209,7 +209,7 @@ static __u32 get_fatent (fsdata *mydata, __u32 entry)
 
        /* Read a new block of FAT entries into the cache. */
        if (bufnum != mydata->fatbufnum) {
-               int getsize = FATBUFSIZE / FS_BLOCK_SIZE;
+               __u32 getsize = FATBUFSIZE / FS_BLOCK_SIZE;
                __u8 *bufptr = mydata->fatbuf;
                __u32 fatlength = mydata->fatlength;
                __u32 startblock = bufnum * FATBUFBLOCKS;
@@ -279,7 +279,7 @@ static int
 get_cluster (fsdata *mydata, __u32 clustnum, __u8 *buffer,
             unsigned long size)
 {
-       int idx = 0;
+       __u32 idx = 0;
        __u32 startsect;
 
        if (clustnum > 0) {
@@ -767,12 +767,13 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
        dir_entry *dentptr;
        __u16 prevcksum = 0xffff;
        char *subname = "";
-       int cursect;
+       __u32 cursect;
        int idx, isdir = 0;
        int files = 0, dirs = 0;
        long ret = 0;
        int firsttime;
-       int root_cluster;
+       __u32 root_cluster;
+       int rootdir_size = 0;
        int j;
 
        if (read_bootsectandvi(&bs, &volinfo, &mydata->fatsize)) {
@@ -798,8 +799,6 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
                mydata->data_begin = mydata->rootdir_sect -
                                        (mydata->clust_size * 2);
        } else {
-               int rootdir_size;
-
                rootdir_size = ((bs.dir_entries[1]  * (int)256 +
                                 bs.dir_entries[0]) *
                                 sizeof(dir_entry)) /
@@ -1006,20 +1005,18 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
                 * root directory clusters when a cluster has been
                 * completely processed.
                 */
-               if ((mydata->fatsize == 32) && (++j == mydata->clust_size)) {
-                       int nxtsect;
-                       int nxt_clust;
+               ++j;
+               int fat32_end = 0;
+               if ((mydata->fatsize == 32) && (j == mydata->clust_size)) {
+                       int nxtsect = 0;
+                       int nxt_clust = 0;
 
                        nxt_clust = get_fatent(mydata, root_cluster);
+                       fat32_end = CHECK_CLUST(nxt_clust, 32);
 
                        nxtsect = mydata->data_begin +
                                (nxt_clust * mydata->clust_size);
 
-                       debug("END LOOP: sect=%d, root_clust=%d, "
-                             "n_sect=%d, n_clust=%d\n",
-                             cursect, root_cluster,
-                             nxtsect, nxt_clust);
-
                        root_cluster = nxt_clust;
 
                        cursect = nxtsect;
@@ -1027,6 +1024,18 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
                } else {
                        cursect++;
                }
+
+               /* If end of rootdir reached */
+               if ((mydata->fatsize == 32 && fat32_end) ||
+                   (mydata->fatsize != 32 && j == rootdir_size)) {
+                       if (dols == LS_ROOT) {
+                               printf("\n%d file(s), %d dir(s)\n\n",
+                                      files, dirs);
+                               return 0;
+                       } else {
+                               return -1;
+                       }
+               }
        }
 rootdir_done:
 
index c4f7445221dde92205ad574e1fdffbf709b48a9e..5ddc2b93710fbeb0166d13d984d931643cc526f1 100644 (file)
@@ -794,7 +794,7 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest)
 #endif
                                default:
                                        /* unknown */
-                                       putLabeledWord("UNKOWN COMPRESSION METHOD = ", jNode->compr);
+                                       putLabeledWord("UNKNOWN COMPRESSION METHOD = ", jNode->compr);
                                        put_fl_mem(jNode, pL->readbuf);
                                        return -1;
                                        break;
index 3982003a4215d0c3902f6e1c9665af9b07f8ac81..740f787dd23a384c79124707cf0efdd0ffb22c48 100644 (file)
@@ -350,7 +350,7 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 ino, char *dest,
 #endif
                        default:
                                /* unknown */
-                               putLabeledWord("UNKOWN COMPRESSION METHOD = ", inode->compr);
+                               putLabeledWord("UNKNOWN COMPRESSION METHOD = ", inode->compr);
                                return -1;
                        }
                }
index 893af5cc10eaf011466901a754c1440262dfe29b..00e266ed6fe23e84a5cc7bf24eab309ade40d765 100644 (file)
@@ -180,11 +180,13 @@ typedef void (interrupt_handler_t)(void *);
  * General Purpose Utilities
  */
 #define min(X, Y)                              \
-       ({ typeof (X) __x = (X), __y = (Y);     \
+       ({ typeof (X) __x = (X);                \
+               typeof (Y) __y = (Y);           \
                (__x < __y) ? __x : __y; })
 
 #define max(X, Y)                              \
-       ({ typeof (X) __x = (X), __y = (Y);     \
+       ({ typeof (X) __x = (X);                \
+               typeof (Y) __y = (Y);           \
                (__x > __y) ? __x : __y; })
 
 #define MIN(x, y)  min(x, y)
@@ -270,9 +272,9 @@ int setenv       (char *, char *);
 # include <asm/setup.h>
 # include <asm/u-boot-arm.h>   /* ARM version to be fixed! */
 #endif /* CONFIG_ARM */
-#ifdef CONFIG_I386             /* x86 version to be fixed! */
-# include <asm/u-boot-i386.h>
-#endif /* CONFIG_I386 */
+#ifdef CONFIG_X86              /* x86 version to be fixed! */
+# include <asm/u-boot-x86.h>
+#endif /* CONFIG_X86 */
 
 #ifdef CONFIG_AUTO_COMPLETE
 int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf);
@@ -447,6 +449,11 @@ void               out16(unsigned int, unsigned short value);
 #if defined (CONFIG_MPC83xx)
 void           ppcDWload(unsigned int *addr, unsigned int *ret);
 void           ppcDWstore(unsigned int *addr, unsigned int *value);
+void disable_addr_trans(void);
+void enable_addr_trans(void);
+#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
+void ddr_enable_ecc(unsigned int dram_size);
+#endif
 #endif
 
 /* $(CPU)/cpu.c */
@@ -538,6 +545,10 @@ ulong      get_ddr_freq  (ulong);
 #if defined(CONFIG_MPC86xx)
 typedef MPC86xx_SYS_INFO sys_info_t;
 void   get_sys_info  ( sys_info_t * );
+static inline ulong get_ddr_freq(ulong dummy)
+{
+       return get_bus_freq(dummy);
+}
 #endif
 
 #if defined(CONFIG_4xx) || defined(CONFIG_IOP480)
index 9283daa3d26a5c2cd1a0aeb816dcc55ee3e90c7d..a55b268b9b37c71fd730416d426602777912d0d1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * config_cmd_defaults.h - sane defaults for everyone
  *
- * Copyright (c) 2010 Analog Devices Inc.
+ * Copyright (c) 2010-2011 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  */
@@ -10,5 +10,9 @@
 #define _CONFIG_CMD_DEFAULTS_H_
 
 #define CONFIG_CMD_BOOTM 1
+#define CONFIG_CMD_CRC32 1
+#define CONFIG_CMD_EXPORTENV 1
+#define CONFIG_CMD_GO 1
+#define CONFIG_CMD_IMPORTENV 1
 
 #endif
index abdf3beb0c139fdcf6b25dcaf6047e7022031b56..0337163c2a21529a9d76639c51fe65bf40b4bada 100644 (file)
@@ -12,7 +12,6 @@
 /* Support bootm-ing different OSes */
 #define CONFIG_BOOTM_LINUX 1
 #define CONFIG_BOOTM_NETBSD 1
-#define CONFIG_BOOTM_OSE 1
 #define CONFIG_BOOTM_RTEMS 1
 
 #define CONFIG_GZIP 1
diff --git a/include/config_phylib_all_drivers.h b/include/config_phylib_all_drivers.h
new file mode 100644 (file)
index 0000000..903c7a7
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Enable all PHYs
+ *
+ * This software may be used and distributed according to the
+ * terms of the GNU Public License, Version 2, incorporated
+ * herein by reference.
+ *
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * author Andy Fleming
+ *
+ */
+#ifndef _CONFIG_PHYLIB_ALL_H
+#define _CONFIG_PHYLIB_ALL_H
+
+#ifdef CONFIG_PHYLIB
+
+#define CONFIG_PHY_VITESSE
+#define CONFIG_PHY_MARVELL
+#define CONFIG_PHY_MICREL
+#define CONFIG_PHY_BROADCOM
+#define CONFIG_PHY_DAVICOM
+#define CONFIG_PHY_REALTEK
+#define CONFIG_PHY_NATSEMI
+#define CONFIG_PHY_LXT
+
+#ifdef CONFIG_PHYLIB_10G
+#define CONFIG_PHY_TERANETICS
+#endif /* CONFIG_PHYLIB_10G */
+
+#endif /* CONFIG_PHYLIB */
+
+#endif /*_CONFIG_PHYLIB_ALL_H */
index 1191eea106c00dcfd66a6db22060ae0e948b6a00..e25d5acc13641907f03ec372f678470ccfc68ee7 100644 (file)
 #define CONFIG_SYS_UEC1_TX_CLK         QE_CLK10
 #define CONFIG_SYS_UEC1_ETH_TYPE       FAST_ETH
 #define CONFIG_SYS_UEC1_PHY_ADDR       4
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE MII
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
 #define CONFIG_SYS_UEC1_INTERFACE_SPEED        100
 #endif
 
 #define CONFIG_SYS_UEC2_TX_CLK         QE_CLK3
 #define CONFIG_SYS_UEC2_ETH_TYPE       FAST_ETH
 #define CONFIG_SYS_UEC2_PHY_ADDR       0
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE MII
+#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
 #define CONFIG_SYS_UEC2_INTERFACE_SPEED        100
 #endif
 
index affa3a9cf8dacf3e5dc00ccfd6104f7c42e669e0..f136a8e16a0832ed12d192292853e9c123b012cf 100644 (file)
 #define CONFIG_SYS_UEC1_TX_CLK         QE_CLK10
 #define CONFIG_SYS_UEC1_ETH_TYPE       FAST_ETH
 #define CONFIG_SYS_UEC1_PHY_ADDR       3
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE MII
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
 #define CONFIG_SYS_UEC1_INTERFACE_SPEED        100
 #endif
 
 #define CONFIG_SYS_UEC2_TX_CLK         QE_CLK8
 #define CONFIG_SYS_UEC2_ETH_TYPE       FAST_ETH
 #define CONFIG_SYS_UEC2_PHY_ADDR       4
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE MII
+#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
 #define CONFIG_SYS_UEC2_INTERFACE_SPEED        100
 #endif
 
index a9599405dd2e51260230f32dd06aa4d5b110b56f..49d64a55eb88e9bc73934e6271ba073f65986938 100644 (file)
 #define CONFIG_SYS_UEC1_TX_CLK         QE_CLK9
 #define CONFIG_SYS_UEC1_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC1_PHY_ADDR       0
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE RGMII_ID
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_ID
 #define CONFIG_SYS_UEC1_INTERFACE_SPEED 1000
 #endif
 
 #define CONFIG_SYS_UEC2_TX_CLK         QE_CLK4
 #define CONFIG_SYS_UEC2_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC2_PHY_ADDR       1
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE RGMII_ID
+#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_ID
 #define CONFIG_SYS_UEC2_INTERFACE_SPEED 1000
 #endif
 
index b0cdc02c1dea4f344dd4f081cdc0c75ad6541af0..a4f42cf22dd8cc1b95fc9a93e4a3a6403ad3d525 100644 (file)
 #define CONFIG_SYS_UEC1_TX_CLK         QE_CLK9
 #define CONFIG_SYS_UEC1_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC1_PHY_ADDR       2
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE RGMII_RXID
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_RXID
 #define CONFIG_SYS_UEC1_INTERFACE_SPEED 1000
 #endif
 
 #define CONFIG_SYS_UEC2_TX_CLK         QE_CLK4
 #define CONFIG_SYS_UEC2_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC2_PHY_ADDR       4
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE RGMII_RXID
+#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_RXID
 #define CONFIG_SYS_UEC2_INTERFACE_SPEED 1000
 #endif
 
index 13300de3eac1dcfb4161cbb03dac3852e1b2455a..7f7ff9f4e1f42e03406a1eb51183c441bc0c99e2 100644 (file)
@@ -40,6 +40,7 @@
 #define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
 #else
+#define CONFIG_SYS_LDSCRIPT $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
 #define CONFIG_SYS_TEXT_BASE   0xf8f82000
 #endif /* CONFIG_NAND_SPL */
 #endif
 #define CONFIG_SYS_NAND_U_BOOT_RELOC_SP ((CONFIG_SYS_INIT_L2_END - 1) & ~0xF)
 
 /* NAND flash config */
-#define CONFIG_NAND_BR_PRELIM \
+#define CONFIG_SYS_NAND_BR_PRELIM \
                (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
                | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                | BR_PS_8               /* Port Size = 8 bit */ \
                | BR_MS_FCM             /* MSEL = FCM */ \
                | BR_V)                 /* valid */
-#define CONFIG_NAND_OR_PRELIM  (0xFFFC0000     /* length 256K */ \
+#define CONFIG_SYS_NAND_OR_PRELIM      (0xFFFC0000     /* length 256K */ \
                | OR_FCM_PGS            /* Large Page*/ \
                | OR_FCM_CSCT \
                | OR_FCM_CST \
                | OR_FCM_EHTR)
 
 #ifdef CONFIG_RAMBOOT_NAND
-#define CONFIG_SYS_BR0_PRELIM  CONFIG_NAND_BR_PRELIM   /* NAND Base Address */
-#define CONFIG_SYS_OR0_PRELIM  CONFIG_NAND_OR_PRELIM   /* NAND Options */
+#define CONFIG_SYS_BR0_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
+#define CONFIG_SYS_OR0_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 #define CONFIG_SYS_BR2_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
 #define CONFIG_SYS_OR2_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
 #else
 #define CONFIG_SYS_BR0_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
 #define CONFIG_SYS_OR0_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
-#define CONFIG_SYS_BR2_PRELIM  CONFIG_NAND_BR_PRELIM   /* NAND Base Address */
-#define CONFIG_SYS_OR2_PRELIM  CONFIG_NAND_OR_PRELIM   /* NAND Options */
+#define CONFIG_SYS_BR2_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
+#define CONFIG_SYS_OR2_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 #endif
 
 #define CONFIG_SYS_BR4_PRELIM \
                | BR_PS_8               /* Port Size = 8 bit */ \
                | BR_MS_FCM             /* MSEL = FCM */ \
                | BR_V)                 /* valid */
-#define CONFIG_SYS_OR4_PRELIM  CONFIG_NAND_OR_PRELIM   /* NAND Options */
+#define CONFIG_SYS_OR4_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 #define CONFIG_SYS_BR5_PRELIM \
                (BR_PHYS_ADDR((CONFIG_SYS_NAND_BASE_PHYS + 0x80000)) \
                | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                | BR_PS_8               /* Port Size = 8 bit */ \
                | BR_MS_FCM             /* MSEL = FCM */ \
                | BR_V)                 /* valid */
-#define CONFIG_SYS_OR5_PRELIM  CONFIG_NAND_OR_PRELIM   /* NAND Options */
+#define CONFIG_SYS_OR5_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 
 #define CONFIG_SYS_BR6_PRELIM \
                (BR_PHYS_ADDR((CONFIG_SYS_NAND_BASE_PHYS + 0xc0000)) \
                | BR_PS_8               /* Port Size = 8 bit */ \
                | BR_MS_FCM             /* MSEL = FCM */ \
                | BR_V)                 /* valid */
-#define CONFIG_SYS_OR6_PRELIM  CONFIG_NAND_OR_PRELIM   /* NAND Options */
+#define CONFIG_SYS_OR6_PRELIM  CONFIG_SYS_NAND_OR_PRELIM       /* NAND Options */
 
 /* Serial Port - controlled on board with jumper J8
  * open - index 2
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20) /* Initial Memory map for Linux */
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20) /* Initial Memory map for Linux */
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index 8b3aff8e0668dd7225ed2a68bbf301cf94493b35..e1d933ec49bf816a78ebb885fc847fc1fc6ee951 100644 (file)
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index 7101230e54f83f204b4a70594bef111872b3fa9f..5918e644d16804a3fde2c9ef5b22817e4f808322 100644 (file)
@@ -432,11 +432,11 @@ extern unsigned long get_clock_freq(void);
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index 62bac6d64f3f17f4fdf09ab7c56f68f8c08c93f9..b25fb55a463a73e9aa70b073b6dadcd118cbbdcf 100644 (file)
@@ -452,11 +452,11 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index 43e2c2eb17c627aac49c1ccf96bdaa76aaee6560..0c0ae0289015effbdb7bd5613eaf72568c6ab8c2 100644 (file)
@@ -491,11 +491,11 @@ extern unsigned long get_clock_freq(void);
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index 106034db4232c37ee90ff2b79c14569f149e4156..4c580a37e317a2060c05deebc74665bcf48c2c89 100644 (file)
@@ -430,11 +430,11 @@ extern unsigned long get_clock_freq(void);
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index 15ebb6f16744efbdb60899894e0ed4d56a8981b7..f55ef9d79616473db78299ead7e8be81f92fb0c8 100644 (file)
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index 3674e495c5c23997b90fa06ac312c66e6d238d52..f7df7f0388000c654df8dcea38c4846c674b3126 100644 (file)
@@ -334,7 +334,7 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_UEC1_TX_CLK         QE_CLK16
 #define CONFIG_SYS_UEC1_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC1_PHY_ADDR       7
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE RGMII_ID
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_ID
 #define CONFIG_SYS_UEC1_INTERFACE_SPEED 1000
 #endif
 
@@ -346,7 +346,7 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_UEC2_TX_CLK         QE_CLK16
 #define CONFIG_SYS_UEC2_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC2_PHY_ADDR       1
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE RGMII_ID
+#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_ID
 #define CONFIG_SYS_UEC2_INTERFACE_SPEED 1000
 #endif
 #endif /* CONFIG_QE */
@@ -451,11 +451,11 @@ extern unsigned long get_clock_freq(void);
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index 9e24e1290721e74fb6faa64fd82c487f176d3eec..fa626bb977a60ea043e5d2c070c1de9c5866e1a7 100644 (file)
@@ -72,6 +72,7 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
 #else
+#define CONFIG_SYS_LDSCRIPT $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
 #define CONFIG_SYS_TEXT_BASE   0xf8f82000
 #endif
 #endif
@@ -138,8 +139,7 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_CHIP_SELECTS_PER_CTRL   (2 * CONFIG_DIMM_SLOTS_PER_CTLR)
 
 /* I2C addresses of SPD EEPROMs */
-#define SPD_EEPROM_ADDRESS1    0x51    /* CTLR 0 DIMM 0 */
-#define SPD_EEPROM_ADDRESS2    0x52    /* CTLR 1 DIMM 0 */
+#define SPD_EEPROM_ADDRESS    0x51    /* CTLR 0 DIMM 0 */
 
 /* These are used when DDR doesn't use SPD.  */
 #define CONFIG_SYS_SDRAM_SIZE           1024           /* DDR is 1024MB */
@@ -240,12 +240,12 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_CMD_NAND                        1
 #define CONFIG_NAND_FSL_ELBC           1
 #define CONFIG_SYS_NAND_BLOCK_SIZE     (128 * 1024)
-#define CONFIG_NAND_BR_PRELIM  (CONFIG_SYS_NAND_BASE_PHYS \
+#define CONFIG_SYS_NAND_BR_PRELIM      (CONFIG_SYS_NAND_BASE_PHYS \
                                | (2<<BR_DECC_SHIFT) /* Use HW ECC */ \
                                | BR_PS_8            /* Port Size = 8 bit */ \
                                | BR_MS_FCM          /* MSEL = FCM */ \
                                | BR_V)              /* valid */
-#define CONFIG_NAND_OR_PRELIM  (0xFFFC0000          /* length 256K */ \
+#define CONFIG_SYS_NAND_OR_PRELIM      (0xFFFC0000          /* length 256K */ \
                                | OR_FCM_CSCT \
                                | OR_FCM_CST \
                                | OR_FCM_CHT \
@@ -254,15 +254,15 @@ extern unsigned long get_clock_freq(void);
                                | OR_FCM_EHTR)
 
 #ifdef CONFIG_RAMBOOT_NAND
-#define CONFIG_SYS_BR0_PRELIM  CONFIG_NAND_BR_PRELIM   /* NAND Base Address */
-#define CONFIG_SYS_OR0_PRELIM  CONFIG_NAND_OR_PRELIM   /* NAND Options */
+#define CONFIG_SYS_BR0_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
+#define CONFIG_SYS_OR0_PRELIM  CONFIG_SYS_NAND_OR_PRELIM/* NAND Options */
 #define CONFIG_SYS_BR3_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
 #define CONFIG_SYS_OR3_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
 #else
 #define CONFIG_SYS_BR0_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
 #define CONFIG_SYS_OR0_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
-#define CONFIG_SYS_BR3_PRELIM  CONFIG_NAND_BR_PRELIM /* NAND Base Address */
-#define CONFIG_SYS_OR3_PRELIM  CONFIG_NAND_OR_PRELIM /* NAND Options */
+#define CONFIG_SYS_BR3_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
+#define CONFIG_SYS_OR3_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 #endif
 
 #define CONFIG_SYS_LBC_LCRR    0x00000004      /* LB clock ratio reg */
@@ -385,13 +385,13 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_UEC1_TX_CLK         QE_CLK12
 #define CONFIG_SYS_UEC1_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC1_PHY_ADDR       7
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE RGMII_ID
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_ID
 #define CONFIG_SYS_UEC1_INTERFACE_SPEED 1000
 #elif defined(CONFIG_SYS_UCC_RMII_MODE)
 #define CONFIG_SYS_UEC1_TX_CLK         QE_CLK16        /* CLK16 for RMII */
 #define CONFIG_SYS_UEC1_ETH_TYPE       FAST_ETH
 #define CONFIG_SYS_UEC1_PHY_ADDR       8       /* 0x8 for RMII */
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE RMII
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
 #define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
 #endif /* CONFIG_SYS_UCC_RGMII_MODE */
 #endif /* CONFIG_UEC_ETH1 */
@@ -406,13 +406,13 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_UEC2_TX_CLK         QE_CLK17
 #define CONFIG_SYS_UEC2_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC2_PHY_ADDR       1
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE RGMII_ID
+#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_ID
 #define CONFIG_SYS_UEC2_INTERFACE_SPEED 1000
 #elif defined(CONFIG_SYS_UCC_RMII_MODE)
 #define CONFIG_SYS_UEC2_TX_CLK         QE_CLK16        /* CLK 16 for RMII */
 #define CONFIG_SYS_UEC2_ETH_TYPE       FAST_ETH
 #define CONFIG_SYS_UEC2_PHY_ADDR       0x9     /* 0x9 for RMII */
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE RMII
+#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
 #define CONFIG_SYS_UEC2_INTERFACE_SPEED 100
 #endif /* CONFIG_SYS_UCC_RGMII_MODE */
 #endif /* CONFIG_UEC_ETH2 */
@@ -427,13 +427,13 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_UEC3_TX_CLK         QE_CLK12
 #define CONFIG_SYS_UEC3_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC3_PHY_ADDR       2
-#define CONFIG_SYS_UEC3_INTERFACE_TYPE RGMII_ID
+#define CONFIG_SYS_UEC3_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_ID
 #define CONFIG_SYS_UEC3_INTERFACE_SPEED 1000
 #elif defined(CONFIG_SYS_UCC_RMII_MODE)
 #define CONFIG_SYS_UEC3_TX_CLK         QE_CLK16 /* CLK_16 for RMII */
 #define CONFIG_SYS_UEC3_ETH_TYPE       FAST_ETH
 #define CONFIG_SYS_UEC3_PHY_ADDR       0xA     /* 0xA for RMII */
-#define CONFIG_SYS_UEC3_INTERFACE_TYPE RMII
+#define CONFIG_SYS_UEC3_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
 #define CONFIG_SYS_UEC3_INTERFACE_SPEED 100
 #endif /* CONFIG_SYS_UCC_RGMII_MODE */
 #endif /* CONFIG_UEC_ETH3 */
@@ -448,13 +448,13 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_UEC4_TX_CLK         QE_CLK17
 #define CONFIG_SYS_UEC4_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC4_PHY_ADDR       3
-#define CONFIG_SYS_UEC4_INTERFACE_TYPE RGMII_ID
+#define CONFIG_SYS_UEC4_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_ID
 #define CONFIG_SYS_UEC4_INTERFACE_SPEED 1000
 #elif defined(CONFIG_SYS_UCC_RMII_MODE)
 #define CONFIG_SYS_UEC4_TX_CLK         QE_CLK16 /* CLK16 for RMII */
 #define CONFIG_SYS_UEC4_ETH_TYPE       FAST_ETH
 #define CONFIG_SYS_UEC4_PHY_ADDR       0xB     /* 0xB for RMII */
-#define CONFIG_SYS_UEC4_INTERFACE_TYPE RMII
+#define CONFIG_SYS_UEC4_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
 #define CONFIG_SYS_UEC4_INTERFACE_SPEED 100
 #endif /* CONFIG_SYS_UCC_RGMII_MODE */
 #endif /* CONFIG_UEC_ETH4 */
@@ -468,7 +468,7 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_UEC6_TX_CLK         QE_CLK_NONE
 #define CONFIG_SYS_UEC6_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC6_PHY_ADDR       4
-#define CONFIG_SYS_UEC6_INTERFACE_TYPE SGMII
+#define CONFIG_SYS_UEC6_INTERFACE_TYPE PHY_INTERFACE_MODE_SGMII
 #define CONFIG_SYS_UEC6_INTERFACE_SPEED 1000
 #endif /* CONFIG_UEC_ETH6 */
 
@@ -481,7 +481,7 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_UEC8_TX_CLK         QE_CLK_NONE
 #define CONFIG_SYS_UEC8_ETH_TYPE       GIGA_ETH
 #define CONFIG_SYS_UEC8_PHY_ADDR       6
-#define CONFIG_SYS_UEC8_INTERFACE_TYPE SGMII
+#define CONFIG_SYS_UEC8_INTERFACE_TYPE PHY_INTERFACE_MODE_SGMII
 #define CONFIG_SYS_UEC8_INTERFACE_SPEED 1000
 #endif /* CONFIG_UEC_ETH8 */
 
@@ -590,11 +590,11 @@ extern unsigned long get_clock_freq(void);
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20) /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20) /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index bf2fdd668207e8209ee543aaf39aa7b7459a86fd..bb8fb669c3d84b69848ef8ac97a3fc38754f0966 100644 (file)
@@ -40,6 +40,7 @@
 #define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
 #else
+#define CONFIG_SYS_LDSCRIPT $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
 #define CONFIG_SYS_TEXT_BASE   0xf8f82000
 #endif /* CONFIG_NAND_SPL */
 #endif
 
 
 /* NAND flash config */
-#define CONFIG_NAND_BR_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
+#define CONFIG_SYS_NAND_BR_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                               | BR_PS_8               /* Port Size = 8 bit */ \
                               | BR_MS_FCM             /* MSEL = FCM */ \
                               | BR_V)                 /* valid */
-#define CONFIG_NAND_OR_PRELIM  (0xFFFC0000           /* length 256K */ \
+#define CONFIG_SYS_NAND_OR_PRELIM  (0xFFFC0000       /* length 256K */ \
                               | OR_FCM_PGS            /* Large Page*/ \
                               | OR_FCM_CSCT \
                               | OR_FCM_CST \
                               | OR_FCM_EHTR)
 
 #ifdef CONFIG_RAMBOOT_NAND
-#define CONFIG_SYS_BR0_PRELIM  CONFIG_NAND_BR_PRELIM   /* NAND Base Address */
-#define CONFIG_SYS_OR0_PRELIM  CONFIG_NAND_OR_PRELIM   /* NAND Options */
+#define CONFIG_SYS_BR0_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
+#define CONFIG_SYS_OR0_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 #define CONFIG_SYS_BR2_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
 #define CONFIG_SYS_OR2_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
 #else
 #define CONFIG_SYS_BR0_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
 #define CONFIG_SYS_OR0_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
-#define CONFIG_SYS_BR2_PRELIM  CONFIG_NAND_BR_PRELIM  /* NAND Base Address */
-#define CONFIG_SYS_OR2_PRELIM  CONFIG_NAND_OR_PRELIM  /* NAND Options */
+#define CONFIG_SYS_BR2_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
+#define CONFIG_SYS_OR2_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 #endif
 #define CONFIG_SYS_BR4_PRELIM  (BR_PHYS_ADDR((CONFIG_SYS_NAND_BASE_PHYS + 0x40000))\
                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                               | BR_PS_8               /* Port Size = 8 bit */ \
                               | BR_MS_FCM             /* MSEL = FCM */ \
                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR4_PRELIM  CONFIG_NAND_OR_PRELIM    /* NAND Options */
+#define CONFIG_SYS_OR4_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 #define CONFIG_SYS_BR5_PRELIM  (BR_PHYS_ADDR((CONFIG_SYS_NAND_BASE_PHYS + 0x80000))\
                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                               | BR_PS_8               /* Port Size = 8 bit */ \
                               | BR_MS_FCM             /* MSEL = FCM */ \
                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR5_PRELIM  CONFIG_NAND_OR_PRELIM    /* NAND Options */
+#define CONFIG_SYS_OR5_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 
 #define CONFIG_SYS_BR6_PRELIM  (BR_PHYS_ADDR((CONFIG_SYS_NAND_BASE_PHYS + 0xc0000))\
                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                               | BR_PS_8               /* Port Size = 8 bit */ \
                               | BR_MS_FCM             /* MSEL = FCM */ \
                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR6_PRELIM  CONFIG_NAND_OR_PRELIM    /* NAND Options */
+#define CONFIG_SYS_OR6_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 
 
 /* Serial Port - controlled on board with jumper J8
 #define CONFIG_CMD_EXT2
 #endif
 
+/*
+ * USB
+ */
+#define CONFIG_USB_EHCI
+
+#ifdef CONFIG_USB_EHCI
+#define CONFIG_CMD_USB
+#define CONFIG_USB_EHCI_PCI
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
+#define CONFIG_USB_STORAGE
+#define CONFIG_PCI_EHCI_DEVICE                 0
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS     2
+#endif
+
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
 /*
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_BAUDRATE        115200
 
 #define        CONFIG_EXTRA_ENV_SETTINGS                               \
- "memctl_intlv_ctl=2\0"                                                \
+ "hwconfig=fsl_ddr:ctlr_intlv=bank,ecc=off\0"                  \
  "netdev=eth0\0"                                               \
  "uboot=" MK_STR(CONFIG_UBOOTPATH) "\0"                                \
  "tftpflash=tftpboot $loadaddr $uboot; "                       \
index 03ee394b3988ffb5da842a1fdbfcfc86f50716d1..31dbc3b7d92912f6d8abf9501113731825897195 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007, 2010 Freescale Semiconductor, Inc.
+ * Copyright 2007-2011 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
 
 #define        CONFIG_SYS_TEXT_BASE    0xfff00000
 
-#define CONFIG_FSL_DIU_FB      1       /* FSL DIU */
 
 /* video */
-#undef CONFIG_VIDEO
+#define CONFIG_FSL_DIU_FB
 
-#ifdef CONFIG_VIDEO
+#ifdef CONFIG_FSL_DIU_FB
+#define CONFIG_SYS_DIU_ADDR    (CONFIG_SYS_CCSRBAR + 0x2c000)
+#define CONFIG_VIDEO
 #define CONFIG_CMD_BMP
 #define CONFIG_CFB_CONSOLE
+#define CONFIG_VIDEO_SW_CURSOR
 #define CONFIG_VGA_AS_SINGLE_DEVICE
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
@@ -88,8 +90,6 @@
 #define CONFIG_SYS_CCSRBAR_PHYS_HIGH   0x0
 #define CONFIG_SYS_CCSRBAR_PHYS                CONFIG_SYS_CCSRBAR_PHYS_LOW
 
-#define CONFIG_SYS_DIU_ADDR            (CONFIG_SYS_CCSRBAR+0x2c000)
-
 /* DDR Setup */
 #define CONFIG_FSL_DDR2
 #undef CONFIG_FSL_DDR_INTERACTIVE
 #define CONFIG_DIMM_SLOTS_PER_CTLR     1
 #define CONFIG_CHIP_SELECTS_PER_CTRL   (2 * CONFIG_DIMM_SLOTS_PER_CTLR)
 
-#define SPD_EEPROM_ADDRESS1    0x51    /* CTLR 0 DIMM 0 */
+#define SPD_EEPROM_ADDRESS     0x51    /* CTLR 0 DIMM 0 */
 
 /* These are used when DDR doesn't use SPD.  */
 #define CONFIG_SYS_SDRAM_SIZE  256             /* DDR is 256MB */
 #define CONFIG_WATCHDOG                        /* watchdog enabled */
 #define CONFIG_SYS_WATCHDOG_FREQ       5000    /* Feed interval, 5s */
 
-/*DIU Configuration*/
-#define DIU_CONNECT_TO_DVI             /* DIU controller connects to DVI encoder*/
-
 /*
  * Miscellaneous configurable options
  */
  "diuregs=md e002c000 1d\0" \
  "dium=mw e002c01c\0" \
  "diuerr=md e002c014 1\0" \
- "othbootargs=diufb=15M video=fslfb:1280x1024-32@60,monitor=0 debug\0" \
- "monitor=0-DVI\0" \
  "pmregs=md e00e1000 2b\0" \
  "lawregs=md e0000c08 4b\0" \
  "lbcregs=md e0005000 36\0" \
  "ramdiskfile=8610hpcd/ramdisk.uboot\0"                         \
  "fdtaddr=c00000\0"                                             \
  "fdtfile=8610hpcd/mpc8610_hpcd.dtb\0"                          \
- "bdev=sda3\0"                                                 \
- "othbootargs=diufb=15M video=fslfb:1280x1024-32@60,monitor=0\0"\
- "monitor=0-DVI\0"
+ "bdev=sda3\0"
 #endif
 
 #define CONFIG_NFSBOOTCOMMAND                                  \
index 0cca603ff7518566c3b0bfd5d25431d117955ae5..0ddb76f868ff1fd343949767a1a330ce0c9a4bba 100644 (file)
@@ -90,8 +90,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_CLK_FREQ    get_board_sys_clk(0)
 #endif
 
-#define CONFIG_BOARD_EARLY_INIT_F      1       /* Call board_pre_init */
-
 #define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest region */
 #define CONFIG_SYS_MEMTEST_END         0x00400000
 
index 84b7e1d22eb98f5308f4521a991dce68ab69a46c..a11897552806ea4836b32979aa09aecd1d9b1166 100644 (file)
 
 #include "../board/freescale/common/ics307_clk.h"
 
+#ifdef CONFIG_36BIT
+#define CONFIG_PHYS_64BIT
+#endif
+
 /* High Level Configuration Options */
 #define CONFIG_BOOKE                   /* BOOKE */
 #define CONFIG_E500                    /* BOOKE e500 family */
 #define CONFIG_FSL_PCIE_RESET          /* need PCIe reset errata */
 #define CONFIG_SYS_PCI_64BIT           /* enable 64-bit PCI resources */
 
-#define CONFIG_PHYS_64BIT
+#ifdef CONFIG_PHYS_64BIT
 #define CONFIG_ENABLE_36BIT_PHYS
 #define CONFIG_ADDR_MAP
 #define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
+#endif
 
 #define CONFIG_FSL_LAW                 /* Use common FSL init code */
 
  */
 #define CONFIG_SYS_CCSRBAR_DEFAULT     0xff700000      /* CCSRBAR Default */
 #define CONFIG_SYS_CCSRBAR             0xffe00000      /* relocated CCSRBAR */
+#ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_CCSRBAR_PHYS                0xfffe00000ull
+#else
+#define CONFIG_SYS_CCSRBAR_PHYS                CONFIG_SYS_CCSRBAR
+#endif
 #define CONFIG_SYS_IMMR                        CONFIG_SYS_CCSRBAR
 
 /* DDR Setup */
@@ -87,7 +96,7 @@
 
 /* I2C addresses of SPD EEPROMs */
 #define CONFIG_SYS_SPD_BUS_NUM         1
-#define SPD_EEPROM_ADDRESS1            0x51    /* CTLR 0 DIMM 0 */
+#define SPD_EEPROM_ADDRESS             0x51    /* CTLR 0 DIMM 0 */
 
 /*
  * Memory map
  * Local Bus Definitions
  */
 #define CONFIG_SYS_FLASH_BASE          0xe0000000 /* start of FLASH 128M */
+#ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_FLASH_BASE_PHYS     0xfe0000000ull
+#else
+#define CONFIG_SYS_FLASH_BASE_PHYS     CONFIG_SYS_FLASH_BASE
+#endif
 
 #define CONFIG_FLASH_BR_PRELIM  \
        (BR_PHYS_ADDR((CONFIG_SYS_FLASH_BASE_PHYS + 0x8000000)) | BR_PS_16 | BR_V)
 
 #define CONFIG_FSL_NGPIXIS
 #define PIXIS_BASE             0xffdf0000      /* PIXIS registers */
+#ifdef CONFIG_PHYS_64BIT
 #define PIXIS_BASE_PHYS                0xfffdf0000ull
+#else
+#define PIXIS_BASE_PHYS                PIXIS_BASE
+#endif
 
 #define CONFIG_SYS_BR2_PRELIM  (BR_PHYS_ADDR(PIXIS_BASE_PHYS) | BR_PS_8 | BR_V)
 #define CONFIG_SYS_OR2_PRELIM  (OR_AM_32KB | 0x6ff7)
 #define PIXIS_LBMAP_SWITCH     7
 #define PIXIS_LBMAP_MASK       0xF0
 #define PIXIS_LBMAP_ALTBANK    0x20
+#define PIXIS_ELBC_SPI_MASK    0xc0
+#define PIXIS_SPI              0x80
 
 #define CONFIG_SYS_INIT_RAM_LOCK
 #define CONFIG_SYS_INIT_RAM_ADDR       0xffd00000 /* Initial L1 address */
 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
 
 /* Video */
-#undef CONFIG_FSL_DIU_FB
+#define CONFIG_FSL_DIU_FB
 
 #ifdef CONFIG_FSL_DIU_FB
 #define CONFIG_SYS_DIU_ADDR    (CONFIG_SYS_CCSRBAR + 0x10000)
 #define CONFIG_VIDEO
 #define CONFIG_CMD_BMP
 #define CONFIG_CFB_CONSOLE
+#define CONFIG_VIDEO_SW_CURSOR
 #define CONFIG_VGA_AS_SINGLE_DEVICE
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #undef CONFIG_SYS_FLASH_EMPTY_INFO
 #endif
 
+#ifndef CONFIG_FSL_DIU_FB
+#define CONFIG_ATI
+#endif
+
+#ifdef CONFIG_ATI
+#define VIDEO_IO_OFFSET                CONFIG_SYS_PCIE1_IO_VIRT
+#define CONFIG_VIDEO
+#define CONFIG_BIOSEMU
+#define CONFIG_VIDEO_SW_CURSOR
+#define CONFIG_ATI_RADEON_FB
+#define CONFIG_VIDEO_LOGO
+#define CONFIG_SYS_ISA_IO_BASE_ADDRESS VIDEO_IO_OFFSET
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VGA_AS_SINGLE_DEVICE
+#endif
+
 /*
  * Pass open firmware flat tree
  */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_BUS_NUM      1
 
+/*
+ * eSPI - Enhanced SPI
+ */
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SPANSION
+
+#define CONFIG_HARD_SPI
+#define CONFIG_FSL_ESPI
+
+#define CONFIG_CMD_SF
+#define CONFIG_SF_DEFAULT_SPEED                10000000
+#define CONFIG_SF_DEFAULT_MODE         0
+
 /*
  * General PCI
  * Memory space is mapped 1-1, but I/O space must start from 0.
 
 /* controller 1, Slot 2, tgtid 1, Base address a000 */
 #define CONFIG_SYS_PCIE1_MEM_VIRT      0xc0000000
+#ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_PCIE1_MEM_BUS       0xe0000000
 #define CONFIG_SYS_PCIE1_MEM_PHYS      0xc40000000ull
+#else
+#define CONFIG_SYS_PCIE1_MEM_BUS       0xc0000000
+#define CONFIG_SYS_PCIE1_MEM_PHYS      0xc0000000
+#endif
 #define CONFIG_SYS_PCIE1_MEM_SIZE      0x20000000      /* 512M */
 #define CONFIG_SYS_PCIE1_IO_VIRT       0xffc20000
 #define CONFIG_SYS_PCIE1_IO_BUS                0x00000000
+#ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_PCIE1_IO_PHYS       0xfffc20000ull
+#else
+#define CONFIG_SYS_PCIE1_IO_PHYS       0xffc20000
+#endif
 #define CONFIG_SYS_PCIE1_IO_SIZE       0x00010000      /* 64k */
 
 /* controller 2, direct to uli, tgtid 2, Base address 9000 */
 #define CONFIG_SYS_PCIE2_MEM_VIRT      0xa0000000
+#ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_PCIE2_MEM_BUS       0xe0000000
 #define CONFIG_SYS_PCIE2_MEM_PHYS      0xc20000000ull
+#else
+#define CONFIG_SYS_PCIE2_MEM_BUS       0xa0000000
+#define CONFIG_SYS_PCIE2_MEM_PHYS      0xa0000000
+#endif
 #define CONFIG_SYS_PCIE2_MEM_SIZE      0x20000000      /* 512M */
 #define CONFIG_SYS_PCIE2_IO_VIRT       0xffc10000
 #define CONFIG_SYS_PCIE2_IO_BUS                0x00000000
+#ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_PCIE2_IO_PHYS       0xfffc10000ull
+#else
+#define CONFIG_SYS_PCIE2_IO_PHYS       0xffc10000
+#endif
 #define CONFIG_SYS_PCIE2_IO_SIZE       0x00010000      /* 64k */
 
 /* controller 3, Slot 1, tgtid 3, Base address b000 */
 #define CONFIG_SYS_PCIE3_MEM_VIRT      0x80000000
+#ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_PCIE3_MEM_BUS       0xe0000000
 #define CONFIG_SYS_PCIE3_MEM_PHYS      0xc00000000ull
+#else
+#define CONFIG_SYS_PCIE3_MEM_BUS       0x80000000
+#define CONFIG_SYS_PCIE3_MEM_PHYS      0x80000000
+#endif
 #define CONFIG_SYS_PCIE3_MEM_SIZE      0x20000000      /* 512M */
 #define CONFIG_SYS_PCIE3_IO_VIRT       0xffc00000
 #define CONFIG_SYS_PCIE3_IO_BUS                0x00000000
+#ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_PCIE3_IO_PHYS       0xfffc00000ull
+#else
+#define CONFIG_SYS_PCIE3_IO_PHYS       0xffc00000
+#endif
 #define CONFIG_SYS_PCIE3_IO_SIZE       0x00010000      /* 64k */
 
 #ifdef CONFIG_PCI
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
        "diuregs=md e002c000 1d\0"                                      \
        "dium=mw e002c01c\0"                                            \
        "diuerr=md e002c014 1\0"                                        \
-       "othbootargs=diufb=15M video=fslfb:1280x1024-32@60,monitor=0 tty0\0" \
-       "monitor=0-DVI\0"
+       "hwconfig=esdhc;audclk:12\0"
 
 #define CONFIG_HDBOOT                                  \
        "setenv bootargs root=/dev/$bdev rw "           \
index 95b85e3f6578f74b106e43b315897815b68ccd10..59f975546c0ab93f43a4fbb1e3af4ae7aa359a5a 100644 (file)
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#ifdef CONFIG_36BIT
+#define CONFIG_PHYS_64BIT
+#endif
+
 #ifdef CONFIG_P1011RDB
 #define CONFIG_P1011
 #endif
 #define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
 #else
+#define CONFIG_SYS_LDSCRIPT $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
 #define CONFIG_SYS_TEXT_BASE           0xf8f82000
 #endif /* CONFIG_NAND_SPL */
 #endif
 
 #ifdef CONFIG_SDCARD
 #define CONFIG_RAMBOOT_SDCARD          1
-#define CONFIG_SYS_TEXT_BASE           0xf8f80000
-#define CONFIG_RESET_VECTOR_ADDRESS    0xf8fffffc
+#define CONFIG_SYS_TEXT_BASE           0x11000000
+#define CONFIG_RESET_VECTOR_ADDRESS    0x1107fffc
 #endif
 
 #ifdef CONFIG_SPIFLASH
 #define CONFIG_RAMBOOT_SPIFLASH                1
-#define CONFIG_SYS_TEXT_BASE           0xf8f80000
-#define CONFIG_RESET_VECTOR_ADDRESS    0xf8fffffc
+#define CONFIG_SYS_TEXT_BASE           0x11000000
+#define CONFIG_RESET_VECTOR_ADDRESS    0x1107fffc
 #endif
 
 #ifndef CONFIG_SYS_TEXT_BASE
@@ -122,6 +127,11 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 #define CONFIG_ENABLE_36BIT_PHYS       1
 
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_ADDR_MAP                        1
+#define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
+#endif
+
 #define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest works on */
 #define CONFIG_SYS_MEMTEST_END         0x1fffffff
 #define CONFIG_PANIC_HANG      /* do not reset board on panic */
@@ -143,7 +153,11 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
  * actual resources get mapped (not physical addresses)
  */
 #define CONFIG_SYS_CCSRBAR             0xffe00000      /* relocated CCSRBAR */
-#define CONFIG_SYS_CCSRBAR_PHYS        CONFIG_SYS_CCSRBAR      /* physical addr of */
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_CCSRBAR_PHYS        0xfffe00000ull
+#else
+#define CONFIG_SYS_CCSRBAR_PHYS        CONFIG_SYS_CCSRBAR
+#endif
                                                        /* CCSRBAR */
 #define CONFIG_SYS_IMMR                CONFIG_SYS_CCSRBAR      /* PQII uses */
                                                        /* CONFIG_SYS_IMMR */
@@ -196,13 +210,17 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
  */
 #define CONFIG_SYS_FLASH_BASE          0xef000000      /* start of FLASH 16M */
 
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_FLASH_BASE_PHYS     0xfef000000ull
+#else
 #define CONFIG_SYS_FLASH_BASE_PHYS     CONFIG_SYS_FLASH_BASE
+#endif
 
 #define CONFIG_FLASH_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \
                                        BR_PS_16 | BR_V)
 #define CONFIG_FLASH_OR_PRELIM         0xff000ff7
 
-#define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_FLASH_BASE}
+#define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_FLASH_BASE_PHYS}
 #define CONFIG_SYS_FLASH_QUIET_TEST
 #define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
 
@@ -226,10 +244,23 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_FLASH_AMD_CHECK_DQ7
 
 #define CONFIG_BOARD_EARLY_INIT_R      /* call board_early_init_r function */
+#define CONFIG_MISC_INIT_R
 #define CONFIG_HWCONFIG
 
 #define CONFIG_SYS_INIT_RAM_LOCK       1
 #define CONFIG_SYS_INIT_RAM_ADDR      0xffd00000       /* stack in RAM */
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0xf
+#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW CONFIG_SYS_INIT_RAM_ADDR
+/* The assembler doesn't like typecast */
+#define CONFIG_SYS_INIT_RAM_ADDR_PHYS \
+       ((CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH * 1ull << 32) | \
+         CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW)
+#else
+#define CONFIG_SYS_INIT_RAM_ADDR_PHYS  CONFIG_SYS_INIT_RAM_ADDR /* Initial L1 address */
+#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0
+#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW CONFIG_SYS_INIT_RAM_ADDR_PHYS
+#endif
 #define CONFIG_SYS_INIT_RAM_SIZE       0x00004000      /* Size of used area in RAM */
 
 #define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE \
@@ -241,10 +272,20 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 #ifndef CONFIG_NAND_SPL
 #define CONFIG_SYS_NAND_BASE           0xffa00000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_NAND_BASE_PHYS      0xfffa00000ull
 #else
-#define CONFIG_SYS_NAND_BASE           0xfff00000
+#define CONFIG_SYS_NAND_BASE_PHYS      CONFIG_SYS_NAND_BASE
 #endif
+#else
+#define CONFIG_SYS_NAND_BASE           0xfff00000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_NAND_BASE_PHYS      0xffff00000ull
+#else
 #define CONFIG_SYS_NAND_BASE_PHYS      CONFIG_SYS_NAND_BASE
+#endif
+#endif
+
 #define CONFIG_SYS_NAND_BASE_LIST      {CONFIG_SYS_NAND_BASE}
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
 #define NAND_MAX_CHIPS                 1
@@ -263,13 +304,13 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_NAND_U_BOOT_RELOC_SP                ((CONFIG_SYS_INIT_L2_END - 1) & ~0xF)
 
 /* NAND flash config */
-#define CONFIG_NAND_BR_PRELIM  (CONFIG_SYS_NAND_BASE_PHYS \
+#define CONFIG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
                                | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                                | BR_PS_8       /* Port Size = 8 bit */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
                                | BR_V)                 /* valid */
 
-#define CONFIG_NAND_OR_PRELIM  (0xFFF80000             /* length 32K */ \
+#define CONFIG_SYS_NAND_OR_PRELIM      (0xFFF80000     /* length 32K */ \
                                | OR_FCM_CSCT \
                                | OR_FCM_CST \
                                | OR_FCM_CHT \
@@ -278,22 +319,27 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
                                | OR_FCM_EHTR)
 
 #ifdef CONFIG_RAMBOOT_NAND
-#define CONFIG_SYS_BR0_PRELIM  CONFIG_NAND_BR_PRELIM  /* NAND Base Address */
-#define CONFIG_SYS_OR0_PRELIM  CONFIG_NAND_OR_PRELIM  /* NAND Options */
+#define CONFIG_SYS_BR0_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
+#define CONFIG_SYS_OR0_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 #define CONFIG_SYS_BR1_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
 #define CONFIG_SYS_OR1_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
 #else
 #define CONFIG_SYS_BR0_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
 #define CONFIG_SYS_OR0_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
-#define CONFIG_SYS_BR1_PRELIM  CONFIG_NAND_BR_PRELIM  /* NAND Base Address */
-#define CONFIG_SYS_OR1_PRELIM  CONFIG_NAND_OR_PRELIM  /* NAND Options */
+#define CONFIG_SYS_BR1_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
+#define CONFIG_SYS_OR1_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
 #endif
 
 #define CONFIG_SYS_VSC7385_BASE        0xffb00000
 
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_VSC7385_BASE_PHYS   0xfffb00000ull
+#else
 #define CONFIG_SYS_VSC7385_BASE_PHYS   CONFIG_SYS_VSC7385_BASE
+#endif
 
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_VSC7385_BASE | BR_PS_8 | BR_V)
+#define CONFIG_SYS_BR2_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_VSC7385_BASE) \
+                                                       | BR_PS_8 | BR_V)
 #define CONFIG_SYS_OR2_PRELIM  (OR_AM_128KB | OR_GPCM_CSNT | OR_GPCM_XACS | \
                                OR_GPCM_SCY_15 | OR_GPCM_SETA | OR_GPCM_TRLX | \
                                OR_GPCM_EHTR | OR_GPCM_EAD)
@@ -360,9 +406,20 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_BUS_NUM      1
 
+#define CONFIG_SYS_I2C_PCA9557_ADDR    0x18
+
 #define CONFIG_RTC_DS1337
 #define CONFIG_SYS_RTC_DS1337_NOOSC
 #define CONFIG_SYS_I2C_RTC_ADDR                0x68
+
+/* eSPI - Enhanced SPI */
+#define CONFIG_FSL_ESPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SPANSION
+#define CONFIG_CMD_SF
+#define CONFIG_SF_DEFAULT_SPEED                10000000
+#define CONFIG_SF_DEFAULT_MODE         SPI_MODE_0
+
 /*
  * General PCI
  * Memory space is mapped 1-1, but I/O space must start from 0.
@@ -372,23 +429,41 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 /* controller 2, Slot 2, tgtid 2, Base address 9000 */
 #define CONFIG_SYS_PCIE2_NAME          "Slot 1"
 #define CONFIG_SYS_PCIE2_MEM_VIRT      0xa0000000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_PCIE2_MEM_BUS       0xc0000000
+#define CONFIG_SYS_PCIE2_MEM_PHYS      0xc20000000ull
+#else
 #define CONFIG_SYS_PCIE2_MEM_BUS       0xa0000000
 #define CONFIG_SYS_PCIE2_MEM_PHYS      0xa0000000
+#endif
 #define CONFIG_SYS_PCIE2_MEM_SIZE      0x20000000      /* 512M */
 #define CONFIG_SYS_PCIE2_IO_VIRT       0xffc10000
 #define CONFIG_SYS_PCIE2_IO_BUS                0x00000000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_PCIE2_IO_PHYS       0xfffc10000ull
+#else
 #define CONFIG_SYS_PCIE2_IO_PHYS       0xffc10000
+#endif
 #define CONFIG_SYS_PCIE2_IO_SIZE       0x00010000      /* 64k */
 
 /* controller 1, Slot 1, tgtid 1, Base address a000 */
 #define CONFIG_SYS_PCIE1_NAME          "Slot 2"
 #define CONFIG_SYS_PCIE1_MEM_VIRT      0x80000000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_PCIE1_MEM_BUS       0x80000000
+#define CONFIG_SYS_PCIE1_MEM_PHYS      0xc00000000ull
+#else
 #define CONFIG_SYS_PCIE1_MEM_BUS       0x80000000
 #define CONFIG_SYS_PCIE1_MEM_PHYS      0x80000000
+#endif
 #define CONFIG_SYS_PCIE1_MEM_SIZE      0x20000000      /* 512M */
 #define CONFIG_SYS_PCIE1_IO_VIRT       0xffc00000
 #define CONFIG_SYS_PCIE1_IO_BUS                0x00000000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_PCIE1_IO_PHYS       0xfffc00000ull
+#else
 #define CONFIG_SYS_PCIE1_IO_PHYS       0xffc00000
+#endif
 #define CONFIG_SYS_PCIE1_IO_SIZE       0x00010000      /* 64k */
 
 #define CONFIG_PCI_PNP                 /* do pci plug-and-play */
@@ -456,9 +531,18 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
        #define CONFIG_ENV_IS_IN_NAND   1
        #define CONFIG_ENV_SIZE         CONFIG_SYS_NAND_BLOCK_SIZE
        #define CONFIG_ENV_OFFSET       ((512 * 1024) + CONFIG_SYS_NAND_BLOCK_SIZE)
-#elif defined(CONFIG_RAMBOOT_SDCARD) || defined(CONFIG_RAMBOOT_SPIFLASH)
-       #define CONFIG_ENV_IS_NOWHERE   1       /* Store ENV in memory only */
-       #define CONFIG_ENV_ADDR         (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#elif defined(CONFIG_RAMBOOT_SDCARD)
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_ENV_SIZE                        0x2000
+#define CONFIG_SYS_MMC_ENV_DEV         0
+#elif defined(CONFIG_RAMBOOT_SPIFLASH)
+       #define CONFIG_ENV_IS_IN_SPI_FLASH
+       #define CONFIG_ENV_SPI_BUS      0
+       #define CONFIG_ENV_SPI_CS       0
+       #define CONFIG_ENV_SPI_MAX_HZ   10000000
+       #define CONFIG_ENV_SPI_MODE     0
+       #define CONFIG_ENV_OFFSET       0x100000        /* 1MB */
+       #define CONFIG_ENV_SECT_SIZE    0x10000
        #define CONFIG_ENV_SIZE         0x2000
 #endif
 #else
@@ -546,11 +630,11 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)/* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)/* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index b32a9976f61a9f66c2083b889257a6ccffbf0d5d..b5db0b3c24b3b9c20f047e860a389b98ac51f995 100644 (file)
 #define CONFIG_PHYS_64BIT
 #endif
 
+#ifdef CONFIG_SDCARD
+#define CONFIG_SYS_RAMBOOT
+#define CONFIG_SYS_EXTRA_ENV_RELOC
+#define CONFIG_SYS_TEXT_BASE           0xf8f80000
+#define CONFIG_RESET_VECTOR_ADDRESS    0xf8fffffc
+#endif
+
+#ifdef CONFIG_SPIFLASH
+#define CONFIG_SYS_RAMBOOT
+#define CONFIG_SYS_EXTRA_ENV_RELOC
+#define CONFIG_SYS_TEXT_BASE           0xf8f80000
+#define CONFIG_RESET_VECTOR_ADDRESS    0xf8fffffc
+#endif
+
 /* High Level Configuration Options */
 #define CONFIG_BOOKE           1       /* BOOKE */
 #define CONFIG_E500            1       /* BOOKE e500 family */
@@ -78,6 +92,8 @@
 #define CONFIG_L2_CACHE                        /* toggle L2 cache */
 #define CONFIG_BTB                     /* toggle branch predition */
 
+#define CONFIG_BOARD_EARLY_INIT_F      /* Call board_pre_init */
+
 #define CONFIG_ENABLE_36BIT_PHYS       1
 
 #ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_MEMTEST_END         0x00400000
 #define CONFIG_PANIC_HANG      /* do not reset board on panic */
 
+/*
+ * Config the L2 Cache
+ */
+#define CONFIG_SYS_INIT_L2_ADDR                0xf8f80000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_INIT_L2_ADDR_PHYS   0xff8f80000ull
+#else
+#define CONFIG_SYS_INIT_L2_ADDR_PHYS   CONFIG_SYS_INIT_L2_ADDR
+#endif
+#define CONFIG_SYS_L2_SIZE             (512 << 10)
+#define CONFIG_SYS_INIT_L2_END (CONFIG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
+
 /*
  * Base addresses -- Note these are effective addresses where the
  * actual resources get mapped (not physical addresses)
 /* I2C addresses of SPD EEPROMs */
 #define CONFIG_DDR_SPD
 #define CONFIG_SYS_SPD_BUS_NUM         0       /* SPD EEPROM located on I2C bus 0 */
-#define SPD_EEPROM_ADDRESS1    0x51    /* CTLR 0 DIMM 0 */
+#define SPD_EEPROM_ADDRESS     0x51    /* CTLR 0 DIMM 0 */
 
 /* These are used when DDR doesn't use SPD.  */
 #define CONFIG_SYS_SDRAM_SIZE          1024            /* DDR is 1GB */
 #define CONFIG_SYS_NAND_BLOCK_SIZE     (128 * 1024)
 
 /* NAND flash config */
-#define CONFIG_NAND_BR_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
+#define CONFIG_SYS_NAND_BR_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
                                | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                                | BR_PS_8               /* Port Size = 8bit */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
                                | BR_V)                 /* valid */
-#define CONFIG_NAND_OR_PRELIM  (0xFFFC0000             /* length 256K */ \
+#define CONFIG_SYS_NAND_OR_PRELIM  (0xFFFC0000         /* length 256K */ \
                                | OR_FCM_PGS            /* Large Page*/ \
                                | OR_FCM_CSCT \
                                | OR_FCM_CST \
 
 #define CONFIG_SYS_BR0_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
 #define CONFIG_SYS_OR0_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
-#define CONFIG_SYS_BR2_PRELIM  CONFIG_NAND_BR_PRELIM  /* NAND Base Address */
-#define CONFIG_SYS_OR2_PRELIM  CONFIG_NAND_OR_PRELIM  /* NAND Options */
+#define CONFIG_SYS_BR2_PRELIM  CONFIG_SYS_NAND_BR_PRELIM  /* NAND Base Address */
+#define CONFIG_SYS_OR2_PRELIM  CONFIG_SYS_NAND_OR_PRELIM  /* NAND Options */
 
 #define CONFIG_SYS_BR4_PRELIM  (BR_PHYS_ADDR((CONFIG_SYS_NAND_BASE_PHYS + 0x40000))\
                                | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                                | BR_PS_8               /* Port Size = 8bit */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
                                | BR_V)                 /* valid */
-#define CONFIG_SYS_OR4_PRELIM  CONFIG_NAND_OR_PRELIM   /* NAND Options */
+#define CONFIG_SYS_OR4_PRELIM  CONFIG_SYS_NAND_OR_PRELIM       /* NAND Options */
 #define CONFIG_SYS_BR5_PRELIM  (BR_PHYS_ADDR((CONFIG_SYS_NAND_BASE_PHYS + 0x80000))\
                                | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                                | BR_PS_8               /* Port Size = 8bit */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
                                | BR_V)                 /* valid */
-#define CONFIG_SYS_OR5_PRELIM  CONFIG_NAND_OR_PRELIM   /* NAND Options */
+#define CONFIG_SYS_OR5_PRELIM  CONFIG_SYS_NAND_OR_PRELIM       /* NAND Options */
 
 #define CONFIG_SYS_BR6_PRELIM  (BR_PHYS_ADDR((CONFIG_SYS_NAND_BASE_PHYS + 0xc0000))\
                                | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
                                | BR_PS_8               /* Port Size = 8bit */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
                                | BR_V)                 /* valid */
-#define CONFIG_SYS_OR6_PRELIM  CONFIG_NAND_OR_PRELIM   /* NAND Options */
+#define CONFIG_SYS_OR6_PRELIM  CONFIG_SYS_NAND_OR_PRELIM       /* NAND Options */
 
 /* Serial Port - controlled on board with jumper J8
  * open - index 2
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_BUS_NUM      0
 
+/*
+ * eSPI - Enhanced SPI
+ */
+#define CONFIG_FSL_ESPI
+
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SPANSION
+
+#define CONFIG_CMD_SF
+#define CONFIG_SF_DEFAULT_SPEED                10000000
+#define CONFIG_SF_DEFAULT_MODE         SPI_MODE_0
+
 /*
  * General PCI
  * Memory space is mapped 1-1, but I/O space must start from 0.
 /*
  * Environment
  */
+#if defined(CONFIG_SDCARD)
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_ENV_SIZE                        0x2000
+#define CONFIG_SYS_MMC_ENV_DEV         0
+#elif defined(CONFIG_SPIFLASH)
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_SPI_BUS             0
+#define CONFIG_ENV_SPI_CS              0
+#define CONFIG_ENV_SPI_MAX_HZ          10000000
+#define CONFIG_ENV_SPI_MODE            0
+#define CONFIG_ENV_SIZE                        0x2000          /* 8KB */
+#define CONFIG_ENV_OFFSET              0x100000        /* 1MB */
+#define CONFIG_ENV_SECT_SIZE           0x10000
+#else
 #define CONFIG_ENV_IS_IN_FLASH 1
 #if CONFIG_SYS_MONITOR_BASE > 0xfff80000
 #define CONFIG_ENV_ADDR                0xfff80000
 #endif
 #define CONFIG_ENV_SIZE                0x2000
 #define CONFIG_ENV_SECT_SIZE   0x20000 /* 128K (one sector) */
+#endif
 
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CONFIG_SYS_LOADS_BAUD_CHANGE   1       /* allow baudrate change */
 /*
  * USB
  */
+#define CONFIG_USB_EHCI
+
+#ifdef CONFIG_USB_EHCI
 #define CONFIG_CMD_USB
 #define CONFIG_USB_STORAGE
-#define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_FSL
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
+#endif
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
+/*
+ * SDHC/MMC
+ */
+#define CONFIG_MMC
+
+#ifdef CONFIG_MMC
+#define CONFIG_FSL_ESDHC
+#define CONFIG_SYS_FSL_ESDHC_ADDR      CONFIG_SYS_MPC85xx_ESDHC_ADDR
+#define CONFIG_CMD_MMC
+#define CONFIG_GENERIC_MMC
+#endif
+
+#if defined(CONFIG_MMC) || defined(CONFIG_USB_EHCI)
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_DOS_PARTITION
+#endif
+
 /*
  * Miscellaneous configurable options
  */
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 /* The mac addresses for all ethernet interface */
 #if defined(CONFIG_TSEC_ENET)
 #define CONFIG_HAS_ETH0
-#define CONFIG_ETHADDR 00:E0:0C:02:00:FD
 #define CONFIG_HAS_ETH1
-#define CONFIG_ETH1ADDR        00:E0:0C:02:01:FD
 #define CONFIG_HAS_ETH2
-#define CONFIG_ETH2ADDR        00:E0:0C:02:02:FD
-#define CONFIG_HAS_ETH3
-#define CONFIG_ETH3ADDR        00:E0:0C:02:03:FD
 #endif
 
 #define CONFIG_IPADDR          192.168.1.254
 #define CONFIG_BAUDRATE        115200
 
 #define        CONFIG_EXTRA_ENV_SETTINGS                               \
- "perf_mode=stable\0"                  \
- "memctl_intlv_ctl=2\0"                                                \
+ "perf_mode=performance\0"                     \
+ "hwconfig=fsl_ddr:ctlr_intlv=bank,bank_intlv=cs0_cs1\0"       \
  "netdev=eth0\0"                                               \
  "uboot=" MK_STR(CONFIG_UBOOTPATH) "\0"                                \
  "tftpflash=tftpboot $loadaddr $uboot; "                       \
        "cp.b $loadaddr " MK_STR(CONFIG_SYS_TEXT_BASE) " $filesize; "   \
        "protect on " MK_STR(CONFIG_SYS_TEXT_BASE) " +$filesize; "              \
        "cmp.b $loadaddr " MK_STR(CONFIG_SYS_TEXT_BASE) " $filesize\0"  \
+ "satabootcmd=setenv bootargs root=/dev/$bdev rw "     \
+       "console=$consoledev,$baudrate $othbootargs;"   \
+       "tftp $loadaddr $bootfile;"                     \
+       "tftp $fdtaddr $fdtfile;"                       \
+       "bootm $loadaddr - $fdtaddr"                    \
  "consoledev=ttyS0\0"                          \
  "ramdiskaddr=2000000\0"                       \
  "ramdiskfile=p2020ds/ramdisk.uboot\0"         \
  "fdtaddr=c00000\0"                            \
+ "othbootargs=cache-sram-size=0x10000\0"       \
  "fdtfile=p2020ds/p2020ds.dtb\0"               \
- "bdev=sda3\0"
+ "bdev=sda3\0"                                 \
+ "partition=scsi 0:0\0"
 
 #define CONFIG_HDBOOT                          \
  "setenv bootargs root=/dev/$bdev rw "         \
  "console=$consoledev,$baudrate $othbootargs;" \
- "tftp $loadaddr $bootfile;"                   \
- "tftp $fdtaddr $fdtfile;"                     \
+ "ext2load $partition $loadaddr $bootfile;"    \
+ "ext2load $partition $fdtaddr $fdtfile;"      \
  "bootm $loadaddr - $fdtaddr"
 
 #define CONFIG_NFSBOOTCOMMAND          \
diff --git a/include/configs/P3041DS.h b/include/configs/P3041DS.h
new file mode 100644 (file)
index 0000000..46f91cc
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/*
+ * P3041 DS board configuration file
+ *
+ */
+#define CONFIG_P3041DS
+#define CONFIG_PHYS_64BIT
+#define CONFIG_PPC_P3041
+
+#define CONFIG_FSL_SATA_V2
+#define CONFIG_PCIE4
+
+#define CONFIG_ICS307_REFCLK_HZ                25000000  /* ICS307 ref clk freq */
+
+#include "corenet_ds.h"
+
diff --git a/include/configs/P5020DS.h b/include/configs/P5020DS.h
new file mode 100644 (file)
index 0000000..6d279b3
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2009-2011 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/*
+ * P5020 DS board configuration file
+ *
+ */
+#define CONFIG_P5020DS
+#define CONFIG_PHYS_64BIT
+#define CONFIG_PPC_P5020
+
+#define CONFIG_FSL_SATA_V2
+#define CONFIG_PCIE4
+
+#define CONFIG_ICS307_REFCLK_HZ                25000000  /* ICS307 ref clk freq */
+
+#include "corenet_ds.h"
+
index 27f137f06d8ec39044a80cba116e4bde28ec7960..05278220f01ff3fbf6001ddb532267e2653c2051 100644 (file)
 
 #undef CONFIG_SKIP_LOWLEVEL_INIT
 
+/*-----------------------------------------------------------------------
+ * Power Management Unit
+ */
+#define CONFIG_FTPMU010_POWER
+
 /*-----------------------------------------------------------------------
  * Timer
  */
  * Static memory controller configuration
  */
 
-#include <asm/arch/ftsmc020.h>
+#define CONFIG_FTSMC020
+#include <faraday/ftsmc020.h>
 
 #define FTSMC020_BANK0_CONFIG  (FTSMC020_BANK_ENABLE             |     \
                                 FTSMC020_BANK_BASE(PHYS_FLASH_1) |     \
diff --git a/include/configs/am3517_crane.h b/include/configs/am3517_crane.h
new file mode 100644 (file)
index 0000000..09cb951
--- /dev/null
@@ -0,0 +1,332 @@
+/*
+ * am3517_crane.h - Default configuration for AM3517 CraneBoard.
+ *
+ * Author: Srinath.R <srinath@mistralsolutions.com>
+ *
+ * Based on include/configs/am3517evm.h
+ *
+ * Copyright (C) 2011 Mistral Solutions pvt 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.
+ *
+ * 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.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_ARMV7           1       /* This is an ARM V7 CPU core */
+#define CONFIG_OMAP            1       /* in a TI OMAP core */
+#define CONFIG_OMAP34XX                1       /* which is a 34XX */
+#define CONFIG_OMAP3_AM3517CRANE       1       /* working with CRANEBOARD */
+
+#define CONFIG_EMIF4   /* The chip has EMIF4 controller */
+
+#include <asm/arch/cpu.h>              /* get chip and board defs */
+#include <asm/arch/omap3.h>
+
+/*
+ * Display CPU and Board information
+ */
+#define CONFIG_DISPLAY_CPUINFO         1
+#define CONFIG_DISPLAY_BOARDINFO       1
+
+/* Clock Defines */
+#define V_OSCK                 26000000        /* Clock output from T2 */
+#define V_SCLK                 (V_OSCK >> 1)
+
+#undef CONFIG_USE_IRQ                          /* no support for IRQs */
+#define CONFIG_MISC_INIT_R
+
+#define CONFIG_CMDLINE_TAG             1       /* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS       1
+#define CONFIG_INITRD_TAG              1
+#define CONFIG_REVISION_TAG            1
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_ENV_SIZE                        (128 << 10)     /* 128 KiB sector */
+#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (128 << 10))
+                                               /* initial data */
+/*
+ * DDR related
+ */
+#define CONFIG_OMAP3_MICRON_DDR                1       /* Micron DDR */
+#define CONFIG_SYS_CS0_SIZE            (256 * 1024 * 1024)
+
+/*
+ * Hardware drivers
+ */
+
+/*
+ * NS16550 Configuration
+ */
+#define V_NS16550_CLK                  48000000        /* 48MHz (APLL96/2) */
+
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE    (-4)
+#define CONFIG_SYS_NS16550_CLK         V_NS16550_CLK
+
+/*
+ * select serial console configuration
+ */
+#define CONFIG_CONS_INDEX              3
+#define CONFIG_SYS_NS16550_COM3                OMAP34XX_UART3
+#define CONFIG_SERIAL3                 3       /* UART3 on CRANEBOARD */
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_BAUDRATE                        115200
+#define CONFIG_SYS_BAUDRATE_TABLE      {4800, 9600, 19200, 38400, 57600,\
+                                       115200}
+#define CONFIG_MMC                     1
+#define CONFIG_OMAP3_MMC               1
+#define CONFIG_DOS_PARTITION           1
+
+/*
+ * USB configuration
+ * Enable CONFIG_MUSB_HCD for Host functionalities MSC, keyboard
+ * Enable CONFIG_MUSB_UDC for Device functionalities.
+ */
+#define CONFIG_USB_AM35X               1
+#define CONFIG_MUSB_HCD                        1
+
+#ifdef CONFIG_USB_AM35X
+
+#ifdef CONFIG_MUSB_HCD
+#define CONFIG_CMD_USB
+
+#define CONFIG_USB_STORAGE
+#define CONGIG_CMD_STORAGE
+#define CONFIG_CMD_FAT
+
+#ifdef CONFIG_USB_KEYBOARD
+#define CONFIG_SYS_USB_EVENT_POLL
+#define CONFIG_PREBOOT "usb start"
+#endif /* CONFIG_USB_KEYBOARD */
+
+#endif /* CONFIG_MUSB_HCD */
+
+#ifdef CONFIG_MUSB_UDC
+/* USB device configuration */
+#define CONFIG_USB_DEVICE              1
+#define CONFIG_USB_TTY                 1
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
+/* Change these to suit your needs */
+#define CONFIG_USBD_VENDORID           0x0451
+#define CONFIG_USBD_PRODUCTID          0x5678
+#define CONFIG_USBD_MANUFACTURER       "Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME       "AM3517CRANE"
+#endif /* CONFIG_MUSB_UDC */
+
+#endif /* CONFIG_USB_AM35X */
+
+/* commands to include */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_EXT2                /* EXT2 Support                 */
+#define CONFIG_CMD_FAT         /* FAT support                  */
+#define CONFIG_CMD_JFFS2       /* JFFS2 Support                */
+
+#define CONFIG_CMD_I2C         /* I2C serial bus support       */
+#define CONFIG_CMD_MMC         /* MMC support                  */
+#define CONFIG_CMD_NAND                /* NAND support                 */
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+
+#undef CONFIG_CMD_FLASH                /* flinfo, erase, protect       */
+#undef CONFIG_CMD_FPGA         /* FPGA configuration Support   */
+#undef CONFIG_CMD_IMI          /* iminfo                       */
+#undef CONFIG_CMD_IMLS         /* List all found images        */
+
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_HARD_I2C                        1
+#define CONFIG_SYS_I2C_SPEED           100000
+#define CONFIG_SYS_I2C_SLAVE           1
+#define CONFIG_SYS_I2C_BUS             0
+#define CONFIG_SYS_I2C_BUS_SELECT      1
+#define CONFIG_DRIVER_OMAP34XX_I2C     1
+
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+/*
+ * Board NAND Info.
+ */
+#define CONFIG_SYS_NAND_ADDR           NAND_BASE       /* physical address */
+                                                       /* to access nand */
+#define CONFIG_SYS_NAND_BASE           NAND_BASE       /* physical address */
+                                                       /* to access */
+                                                       /* nand at CS0 */
+
+#define CONFIG_SYS_MAX_NAND_DEVICE     1               /* Max number of */
+                                                       /* NAND devices */
+#define CONFIG_SYS_64BIT_VSPRINTF              /* needed for nand_util.c */
+
+#define CONFIG_JFFS2_NAND
+/* nand device jffs2 lives on */
+#define CONFIG_JFFS2_DEV               "nand0"
+/* start of jffs2 partition */
+#define CONFIG_JFFS2_PART_OFFSET       0x680000
+#define CONFIG_JFFS2_PART_SIZE         0xf980000       /* sz of jffs2 part */
+
+/* Environment information */
+#define CONFIG_BOOTDELAY       10
+
+#define CONFIG_BOOTFILE                uImage
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "loadaddr=0x82000000\0" \
+       "console=ttyS2,115200n8\0" \
+       "mmcargs=setenv bootargs console=${console} " \
+               "root=/dev/mmcblk0p2 rw " \
+               "rootfstype=ext3 rootwait\0" \
+       "nandargs=setenv bootargs console=${console} " \
+               "root=/dev/mtdblock4 rw " \
+               "rootfstype=jffs2\0" \
+       "loadbootscript=fatload mmc 0 ${loadaddr} boot.scr\0" \
+       "bootscript=echo Running bootscript from mmc ...; " \
+               "source ${loadaddr}\0" \
+       "loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
+       "mmcboot=echo Booting from mmc ...; " \
+               "run mmcargs; " \
+               "bootm ${loadaddr}\0" \
+       "nandboot=echo Booting from nand ...; " \
+               "run nandargs; " \
+               "nand read ${loadaddr} 280000 400000; " \
+               "bootm ${loadaddr}\0" \
+
+#define CONFIG_BOOTCOMMAND \
+       "if mmc init; then " \
+               "if run loadbootscript; then " \
+                       "run bootscript; " \
+               "else " \
+                       "if run loaduimage; then " \
+                               "run mmcboot; " \
+                       "else run nandboot; " \
+                       "fi; " \
+               "fi; " \
+       "else run nandboot; fi"
+
+#define CONFIG_AUTO_COMPLETE   1
+/*
+ * Miscellaneous configurable options
+ */
+#define V_PROMPT                       "AM3517_CRANE # "
+
+#define CONFIG_SYS_LONGHELP            /* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+#define CONFIG_SYS_PROMPT              V_PROMPT
+#define CONFIG_SYS_CBSIZE              512     /* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
+                                       sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS             32      /* max number of command */
+                                               /* args */
+/* Boot Argument Buffer Size */
+#define CONFIG_SYS_BARGSIZE            (CONFIG_SYS_CBSIZE)
+/* memtest works on */
+#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)
+#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
+                                       0x01F00000) /* 31MB */
+
+#define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0) /* default load */
+                                                               /* address */
+
+/*
+ * AM3517 has 12 GP timers, they can be driven by the system clock
+ * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
+ * This rate is divided by a local divisor.
+ */
+#define CONFIG_SYS_TIMERBASE           OMAP34XX_GPT2
+#define CONFIG_SYS_PTV                 2       /* Divisor: 2^(PTV+1) => 8 */
+#define CONFIG_SYS_HZ                  1000
+
+/*-----------------------------------------------------------------------
+ * Stack sizes
+ *
+ * The stack sizes are set up in start.S using the settings below
+ */
+#define CONFIG_STACKSIZE       (128 << 10)     /* regular stack 128 KiB */
+#ifdef CONFIG_USE_IRQ
+#define CONFIG_STACKSIZE_IRQ   (4 << 10)       /* IRQ stack 4 KiB */
+#define CONFIG_STACKSIZE_FIQ   (4 << 10)       /* FIQ stack 4 KiB */
+#endif
+
+/*-----------------------------------------------------------------------
+ * Physical Memory Map
+ */
+#define CONFIG_NR_DRAM_BANKS   2       /* CS1 may or may not be populated */
+#define PHYS_SDRAM_1           OMAP34XX_SDRC_CS0
+#define PHYS_SDRAM_1_SIZE      (32 << 20)      /* at least 32 MiB */
+#define PHYS_SDRAM_2           OMAP34XX_SDRC_CS1
+
+/* SDRAM Bank Allocation method */
+#define SDRC_R_B_C             1
+
+/*-----------------------------------------------------------------------
+ * FLASH and environment organization
+ */
+
+/* **** PISMO SUPPORT *** */
+
+/* Configure the PISMO */
+#define PISMO1_NAND_SIZE               GPMC_SIZE_128M
+#define PISMO1_ONEN_SIZE               GPMC_SIZE_128M
+
+#define CONFIG_SYS_MAX_FLASH_SECT      520     /* max number of sectors */
+                                               /* on one chip */
+#define CONFIG_SYS_MAX_FLASH_BANKS     2       /* max number of flash banks */
+#define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
+
+#define CONFIG_SYS_FLASH_BASE          PISMO1_NAND_BASE
+
+/* Monitor at start of flash */
+#define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
+
+#define CONFIG_NAND_OMAP_GPMC
+#define GPMC_NAND_ECC_LP_x16_LAYOUT    1
+#define CONFIG_ENV_IS_IN_NAND          1
+#define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
+
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB sector */
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
+#define CONFIG_ENV_ADDR                        SMNAND_ENV_OFFSET
+
+/*-----------------------------------------------------------------------
+ * CFI FLASH driver setup
+ */
+/* timeout values are in ticks */
+#define CONFIG_SYS_FLASH_ERASE_TOUT    (100 * CONFIG_SYS_HZ)
+#define CONFIG_SYS_FLASH_WRITE_TOUT    (100 * CONFIG_SYS_HZ)
+
+/* Flash banks JFFS2 should use */
+#define CONFIG_SYS_MAX_MTD_BANKS       (CONFIG_SYS_MAX_FLASH_BANKS + \
+                                       CONFIG_SYS_MAX_NAND_DEVICE)
+#define CONFIG_SYS_JFFS2_MEM_NAND
+/* use flash_info[2] */
+#define CONFIG_SYS_JFFS2_FIRST_BANK    CONFIG_SYS_MAX_FLASH_BANKS
+#define CONFIG_SYS_JFFS2_NUM_BANKS     1
+
+#define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_RAM_ADDR       0x4020f800
+#define CONFIG_SYS_INIT_RAM_SIZE       0x800
+#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_INIT_RAM_ADDR + \
+                                        CONFIG_SYS_INIT_RAM_SIZE - \
+                                        GENERATED_GBL_DATA_SIZE)
+#endif /* __CONFIG_H */
index 70e8f07ba79280f561e066056e826ddb5d5fd630..f5d582157f9cb4ace9909893ba9a677ccfa60624 100644 (file)
 #define CONFIG_SYS_MAX_FLASH_BANKS     2       /* max number of flash banks */
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
 
-#define CONFIG_SYS_FLASH_BASE          boot_flash_base
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_SYS_FLASH_BASE          PISMO1_NAND_BASE
+#endif
 
 /* Monitor at start of flash */
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
 #define CONFIG_ENV_IS_IN_NAND          1
 #define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
 
-#define CONFIG_SYS_ENV_SECT_SIZE       boot_flash_sec
-#define CONFIG_ENV_OFFSET              boot_flash_off
-#define CONFIG_ENV_ADDR                        boot_flash_env_addr
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
+#define CONFIG_ENV_ADDR                        SMNAND_ENV_OFFSET
 
 /*-----------------------------------------------------------------------
  * CFI FLASH driver setup
 #define CONFIG_SYS_JFFS2_FIRST_BANK    CONFIG_SYS_MAX_FLASH_BANKS
 #define CONFIG_SYS_JFFS2_NUM_BANKS     1
 
-#ifndef __ASSEMBLY__
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
-
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
 #define CONFIG_SYS_INIT_RAM_ADDR       0x4020f800
 #define CONFIG_SYS_INIT_RAM_SIZE       0x800
index fd35f3e11674fcc7829876715beaf728cc28345e..1619db5b277d8d1b800bfa575a04dbb5a9fe73b0 100644 (file)
@@ -52,6 +52,7 @@
  */
 #define CONFIG_SYS_NO_FLASH            /* Declare no flash (NOR/SPI) */
 #include <config_cmd_default.h>
+#define CONFIG_CMD_I2C
 #define CONFIG_CMD_AUTOSCRIPT
 #undef CONFIG_CMD_NET
 #undef CONFIG_CMD_NFS
index fa72c7f10f3fcb72affbd7997a16bd3ce2dc091d..a55e1786dd54ba2654c3e3baa6aad58d482e64b1 100644 (file)
@@ -11,7 +11,8 @@
 /*
  * Processor Settings
  */
-#define CONFIG_BFIN_BOOT_MODE      BFIN_BOOT_BYPASS
+#define CONFIG_BFIN_CPU             bf536-0.3
+#define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
 /*
diff --git a/include/configs/bf506f-ezkit.h b/include/configs/bf506f-ezkit.h
new file mode 100644 (file)
index 0000000..77b6735
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * U-boot - Configuration file for BF506F EZ-Kit board
+ */
+
+#ifndef __CONFIG_BF506F_EZKIT_H__
+#define __CONFIG_BF506F_EZKIT_H__
+
+#include <asm/config-pre.h>
+
+
+/*
+ * Processor Settings
+ */
+#define CONFIG_BFIN_CPU             bf506-0.0
+#define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_PARA
+
+
+/*
+ * Clock Settings
+ *     CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
+ *     SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
+ */
+/* CONFIG_CLKIN_HZ is any value in Hz                                  */
+#define CONFIG_CLKIN_HZ                        25000000
+/* CLKIN_HALF controls the DF bit in PLL_CTL      0 = CLKIN            */
+/*                                                1 = CLKIN / 2                */
+#define CONFIG_CLKIN_HALF              0
+/* PLL_BYPASS controls the BYPASS bit in PLL_CTL  0 = do not bypass    */
+/*                                                1 = bypass PLL       */
+#define CONFIG_PLL_BYPASS              0
+/* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL             */
+/* Values can range from 0-63 (where 0 means 64)                       */
+#define CONFIG_VCO_MULT                        16
+/* CCLK_DIV controls the core clock divider                            */
+/* Values can be 1, 2, 4, or 8 ONLY                                    */
+#define CONFIG_CCLK_DIV                        1
+/* SCLK_DIV controls the system clock divider                          */
+/* Values can range from 1-15                                          */
+#define CONFIG_SCLK_DIV                        5
+
+
+/*
+ * Memory Settings
+ */
+#define CONFIG_MEM_SIZE                0
+
+#define CONFIG_EBIU_AMGCTL_VAL (AMCKEN | AMBEN_ALL)
+#define CONFIG_EBIU_AMBCTL0_VAL        0xffc2ffc2
+#define CONFIG_EBIU_AMBCTL1_VAL        0xffc2ffc2
+
+#define CONFIG_SYS_MONITOR_BASE (L1_DATA_A_SRAM_END)
+#define CONFIG_SYS_MONITOR_LEN (4 * 1024)
+#define CONFIG_SYS_MALLOC_LEN  (4 * 1024)
+
+
+/*
+ * Flash Settings
+ */
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_SYS_FLASH_BASE          0x20000000
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_SYS_MAX_FLASH_BANKS     1
+#define CONFIG_SYS_MAX_FLASH_SECT      71
+#define CONFIG_CMD_FLASH
+#define CONFIG_MONITOR_IS_IN_RAM
+
+
+/*
+ * SPI Settings
+ */
+#define CONFIG_BFIN_SPI
+#define CONFIG_ENV_SPI_MAX_HZ  30000000
+#define CONFIG_SF_DEFAULT_SPEED        30000000
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_SPI
+
+
+/*
+ * Env Storage Settings
+ */
+#define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_ENV_SIZE 0x400
+#undef CONFIG_CMD_EXPORTENV
+#undef CONFIG_CMD_IMPORTENV
+
+
+/*
+ * Misc Settings
+ */
+#define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_ICACHE_OFF
+#define CONFIG_DCACHE_OFF
+#define CONFIG_UART_CONSOLE    0
+#define CONFIG_BAUDRATE 115200
+
+#define CONFIG_CMD_MEMORY
+#undef CONFIG_GZIP
+#undef CONFIG_ZLIB
+#undef CONFIG_CMD_BOOTM
+#undef CONFIG_BOOTM_RTEMS
+#undef CONFIG_BOOTM_LINUX
+
+#endif
index 64ca9ed43935fa2676b0467b80f8af52d5ca1863..6eec1c91a7e870c9a731ee497e1d13ef44d51e95 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf518-0.0
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_PARA
 
 
diff --git a/include/configs/bf525-ucr2.h b/include/configs/bf525-ucr2.h
new file mode 100644 (file)
index 0000000..1f65130
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * U-boot - Configuration file for bf525-ucr2 board
+ * The board includes ADSP-BF525 rev. 0.2,
+ * 32-bit SDRAM (SAMSUNG K4S561632H-UC75),
+ * USB 2.0 High Speed OTG USB WIFI,
+ * SPI flash (cFeon EN25Q128 16 MB),
+ * Support PPI and ITU-R656,
+ * See http://www.ucrobotics.com/?q=cn/ucr2
+ */
+
+#ifndef __CONFIG_BF525_UCR2_H__
+#define __CONFIG_BF525_UCR2_H__
+
+#include <asm/config-pre.h>
+
+/*
+ * Processor Settings
+ */
+#define CONFIG_BFIN_CPU             bf525-0.2
+#define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_SPI_MASTER
+
+/*
+ * Clock Settings
+ *     CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
+ *     SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
+ */
+/* CONFIG_CLKIN_HZ is any value in Hz                                  */
+#define CONFIG_CLKIN_HZ                        24000000
+/* CLKIN_HALF controls the DF bit in PLL_CTL      0 = CLKIN            */
+/*                                                1 = CLKIN / 2                */
+#define CONFIG_CLKIN_HALF              0
+/* PLL_BYPASS controls the BYPASS bit in PLL_CTL  0 = do not bypass    */
+/*                                                1 = bypass PLL       */
+#define CONFIG_PLL_BYPASS              0
+/* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL             */
+/* Values can range from 0-63 (where 0 means 64)                       */
+#define CONFIG_VCO_MULT                        20
+/* CCLK_DIV controls the core clock divider                            */
+/* Values can be 1, 2, 4, or 8 ONLY                                    */
+#define CONFIG_CCLK_DIV                        1
+/* SCLK_DIV controls the system clock divider                          */
+/* Values can range from 1-15                                          */
+#define CONFIG_SCLK_DIV                        4
+
+/*
+ * Memory Settings
+ */
+#define CONFIG_MEM_ADD_WDTH    9
+#define CONFIG_MEM_SIZE                32
+
+/*
+ * SDRAM reference page
+ * http://docs.blackfin.uclinux.org/doku.php?id=bfin:sdram
+ */
+#define CONFIG_EBIU_SDRRC_VAL   0x3f8
+#define CONFIG_EBIU_SDGCTL_VAL  0x9111cd
+
+#define CONFIG_EBIU_AMGCTL_VAL  (AMBEN_ALL)
+#define CONFIG_EBIU_AMBCTL0_VAL (B1WAT_7 | B1RAT_11 | B1HT_2 | B1ST_3 | B0WAT_7 | B0RAT_11 | B0HT_2 | B0ST_3)
+#define CONFIG_EBIU_AMBCTL1_VAL (B3WAT_7 | B3RAT_11 | B3HT_2 | B3ST_3 | B2WAT_7 | B2RAT_11 | B2HT_2 | B2ST_3)
+
+#define CONFIG_SYS_MONITOR_LEN (320 * 1024)
+#define CONFIG_SYS_MALLOC_LEN  (320 * 1024)
+
+/* We don't have a parallel flash chip */
+#define CONFIG_SYS_NO_FLASH
+
+/* support for serial flash */
+#define CONFIG_BFIN_SPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_CMD_SF
+#define CONFIG_SF_DEFAULT_HZ   30000000
+#define CONFIG_SPI_FLASH_EON
+
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_SPI_MAX_HZ  30000000
+#define CONFIG_ENV_OFFSET      0x10000
+#define CONFIG_ENV_SIZE                0x10000
+#define CONFIG_ENV_SECT_SIZE   0x10000
+#define CONFIG_ENV_OVERWRITE   1
+
+/*
+ * Misc Settings
+ */
+#define CONFIG_UART_CONSOLE    0
+
+#define CONFIG_BAUDRATE                115200
+#define CONFIG_BOOTARGS                "root=/dev/mtdblock0 rw"
+#define CONFIG_BOOTCOMMAND     "run sfboot"
+#define CONFIG_BOOTDELAY       5
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "sfboot=sf probe 1;" \
+               "sf read 0x1000000 0x20000 0x300000;" \
+               "bootm 0x1000000\0"
+
+/* this sets up the default list of enabled commands */
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_NET  /* bootp, tftpboot, rarpboot */
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_IMLS
+
+#endif
index 4c30c25392dac2df3d57e399d754f634c1507e63..c28f86712ceeaefdef9a9344617d21f91a03333a 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf526-0.0
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_PARA
 
 
index 14ade1b1e641bd1f4bf001942955c2b3150cc805..9c35f2d0b7808ba50debcbc52eef77b0897eac9a 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf527-0.2
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_SPI_MASTER
 
 
  * SPI_MMC Settings
  */
 #define CONFIG_MMC
-#define CONFIG_CMD_EXT2
-#define CONFIG_SPI_MMC
-#define CONFIG_SPI_MMC_DEFAULT_CS (MAX_CTRL_CS + GPIO_PH3)
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MMC_SPI
 
 
 /*
index fa9053b618596f9ee75317083eabf0c6027eb3fe..22a5639e5626a29a9840daf0b12312cb974e6636 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf527-0.0
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_PARA
 
 
index 358284619c71b1c0da4d41e6fd868d0b96bb6c4d..c0e8b5adc8816133c5ede9be238450c1fab58b95 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf527-0.2
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_PARA
 
 
index e1bb594438888867669d6492af6ba7fb73d5f156..95d3afa85cc5faaf8ff4c82b6c00640dd4eb07be 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf533-0.3
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
index bf0f063dc010bd29ff9a1ca90a6212de7f56b865..cb37ee797c6e1cd3a87c3b35d9513623b8a41f07 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf533-0.3
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
index 0ba29bc0cd8b53de94825ae8b8213310af767ddf..11929c77bf9ade844061003c7c815dad166cfb3c 100644 (file)
@@ -24,6 +24,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf537-0.2
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_SPI_MASTER
 
 
 # define CONFIG_CMD_PING
 #else
 # undef CONFIG_CMD_NET
+# undef CONFIG_CMD_NFS
 #endif
 
 #define CONFIG_CMD_BOOTLDR
index da4f2f2f52ef3c0eb2534845d657ab87e211d429..0913ce4e6916593e4d3286ea0c573cb3f79d6c5d 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf537-0.2
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_SPI_MASTER
 
 
index 559428f4845fe85a2473ccb5f6c9042b1cad04b0..e8024d7a2c03be391ef9097b4f68a1571225723f 100644 (file)
@@ -24,6 +24,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf537-0.2
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_SPI_MASTER
 
 
 # define CONFIG_CMD_PING
 #else
 # undef CONFIG_CMD_NET
+# undef CONFIG_CMD_NFS
 #endif
 
 #define CONFIG_CMD_BOOTLDR
index 2d1930c3665e367a996ba1521b905ac4ab0ad030..c31e914f86fff3a7d4d176331ebcd91b39d98376 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf537-0.2
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
  * SPI_MMC Settings
  */
 #define CONFIG_MMC
-#define CONFIG_SPI_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MMC_SPI
 
 
 /*
index 2469c6a0f2228a4e38e988c21614134200ff5765..717a35a81f155ac4a01e639525d4ba4a34b5a53a 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf538-0.4
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
index 1c035cfcadad70948244e0ba5851a0048de5d51e..4d7d87705fb0f3aeb8e4bc8185489521930977ba 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf548-0.0
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_PARA
 
 
 #define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #elif (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND)
 #define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET      0x40000
+#define CONFIG_ENV_OFFSET      0x60000
 #define CONFIG_ENV_SIZE                0x20000
 #else
 #define CONFIG_ENV_IS_IN_FLASH 1
index 2b12c3fbe11c31c9fb8790a781eb2482acf877b3..1490b2f9839e94b3515711bd4ccfc68ec0a2d4a3 100644 (file)
@@ -12,7 +12,8 @@
 /*
  * Processor Settings
  */
-#define CONFIG_BFIN_BOOT_MODE          BFIN_BOOT_BYPASS
+#define CONFIG_BFIN_CPU             bf561-0.5
+#define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
 /*
index 7b020e67fec91b5a38d6b796745e4b9975a36499..33c7e1874810b1e15077d1c880efe5d8ac4fa089 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf561-0.3
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
@@ -79,8 +80,8 @@
 #define CONFIG_SYS_MAX_FLASH_SECT      135
 /* The BF561-EZKIT uses a top boot flash */
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_ADDR                0x20004000
-#define CONFIG_ENV_OFFSET      (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)
+#define CONFIG_ENV_OFFSET      0x4000
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
 #define CONFIG_ENV_SIZE                0x2000
 #define CONFIG_ENV_SECT_SIZE   0x10000
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
index 03c64339d624026e00530500dc8543781ed646c5..3312681e825f79bbf92b35bbcbf5473e8d0fe18e 100644 (file)
 #  define CONFIG_DOS_PARTITION
 # endif
 # ifdef CONFIG_MMC
+#  define CONFIG_CMD_EXT2
 #  define CONFIG_CMD_FAT
 #  define CONFIG_CMD_MMC
 #  define CONFIG_DOS_PARTITION
 # endif
+# ifdef CONFIG_MMC_SPI
+#  define CONFIG_CMD_MMC_SPI
+# endif
 # ifdef CONFIG_USB
 #  define CONFIG_CMD_EXT2
 #  define CONFIG_CMD_FAT
@@ -85,9 +89,9 @@
 # define CONFIG_CMD_CACHE
 # define CONFIG_CMD_CPLBINFO
 # define CONFIG_CMD_ELF
-# define CONFIG_ELF_SIMPLE_LOAD
 # define CONFIG_CMD_GPIO
 # define CONFIG_CMD_KGDB
+# define CONFIG_CMD_LDRINFO
 # define CONFIG_CMD_REGINFO
 # define CONFIG_CMD_STRINGS
 # if defined(__ADSPBF51x__) || defined(__ADSPBF52x__) || defined(__ADSPBF54x__)
  */
 #ifdef CONFIG_SPI_FLASH_ALL
 # define CONFIG_SPI_FLASH_ATMEL
+# define CONFIG_SPI_FLASH_EON
 # define CONFIG_SPI_FLASH_MACRONIX
 # define CONFIG_SPI_FLASH_SPANSION
 # define CONFIG_SPI_FLASH_SST
 #endif
 #define CONFIG_BFIN_SPI_GPIO_CS /* Only matters if BFIN_SPI is enabled */
 #define CONFIG_LZMA
+#define CONFIG_MONITOR_IS_IN_RAM
 
 #endif
index 3f5c95917d00f3cb413106bcc25a331ff15c13f2..85f08ea88804dfa1d1bcaa3fdcd64173ee93f07c 100644 (file)
@@ -24,6 +24,7 @@
 /* CPU Options
  * Be sure to set the Silicon Revision Correctly
  */
+#define CONFIG_BFIN_CPU                bf532-0.5
 #define CONFIG_BFIN_BOOT_MODE  BFIN_BOOT_SPI_MASTER
 
 /*
index e4688a27b4a81c791fec1bbc7e9e7e313bdd6736..9950e44f5207becddeec97519af1f93b02c88241 100644 (file)
@@ -23,7 +23,8 @@
 #define CONFIG_PANIC_HANG 0
 
 /* CPU Options */
-#define CONFIG_BFIN_BOOT_MODE  BFIN_BOOT_SPI_MASTER
+#define CONFIG_BFIN_CPU        bf561-0.5
+#define CONFIG_BFIN_BOOT_MODE  BFIN_BOOT_SPI_MASTER
 
 /*
  *             CLOCK SETTINGS CAVEAT
index 63f003db23f25215cff161d6c2db8311bc005fc8..7f8324915ccc7f97a0d7ed15265cd95e4f1493b9 100644 (file)
@@ -30,6 +30,7 @@
 /* Board info register */
 #define SYS_ID                         0x10000000
 #define CONFIG_REVISION_TAG            1
+#define CONFIG_SYS_TEXT_BASE           0x60800000
 
 /* High Level Configuration Options */
 #define CONFIG_ARMV7                   1
@@ -43,6 +44,8 @@
 #define CONFIG_L2_OFF                  1
 #define CONFIG_INITRD_TAG              1
 
+#define CONFIG_OF_LIBFDT               1
+
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 128 * 1024)
 
 #define CONFIG_MMC                     1
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
+#define CONFIG_ARM_PL180_MMCI
+#define CONFIG_ARM_PL180_MMCI_BASE     0x10005000
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT   127
+#define CONFIG_ARM_PL180_MMCI_CLOCK_FREQ 6250000
 
 /* BOOTP options */
 #define CONFIG_BOOTP_BOOTFILESIZE
index 84c93099ce97ae2d292e63631dc7e3f9dc13568d..e0c6d53b2c7abf7273b5e303c68eba718dc203c9 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf527-0.0
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_PARA
 
 
index dbc4a5b1002a22dcd8bda33279e51a9f4b576ca2..75152964b61d8c358971630357199d80f866a953 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf533-0.3
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
index c3de96a38065807e3af86e280bc571fb8613985e..934b74b579d43c6bee9f7bc88201d3b348054a10 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf537-0.2
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
index e60ebf20f0a18de3849836f13ed7ca240fa3f446..c274c20ff5c8c114ae2b2430b332f767d4d6eb68 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf537-0.2
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
index 27b1cc519ccfd4ef9bbfd85aefd406892d51de5a..fa62a8e9c1da26bec526e475af39cd853e8f2e0d 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf548-0.0
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_PARA
 
 
index 8c350bc2639957332ea81843349b1531a574e813..c60401c8fecb3a33058b720820f58e9fed837f2d 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf561-0.3
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_PARA
 
 
index 510c6d47ffd3a4761ef1d3edac17446882d5ac44..e07e8b329efa06e90e1593748966d7d84ed5e44a 100644 (file)
@@ -1,7 +1,8 @@
 /*
- * (C) Copyright 2010
+ * (C) Copyright 2011
  * CompuLab, Ltd.
  * Mike Rapoport <mike@compulab.co.il>
+ * Igor Grinberg <grinberg@compulab.co.il>
  *
  * Based on omap3_beagle.h
  * (C) Copyright 2006-2008
@@ -9,7 +10,7 @@
  * Richard Woodruff <r-woodruff2@ti.com>
  * Syed Mohammed Khasim <x0khasim@ti.com>
  *
- * Configuration settings for the CompuLab CM-T35 board
+ * Configuration settings for the CompuLab CM-T35 and CM-T3730 boards
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -26,8 +27,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
+ * Foundation, Inc.
  */
 
 #ifndef __CONFIG_H
@@ -40,7 +40,7 @@
 #define CONFIG_OMAP            1       /* in a TI OMAP core */
 #define CONFIG_OMAP34XX                1       /* which is a 34XX */
 #define CONFIG_OMAP3430                1       /* which is in a 3430 */
-#define CONFIG_CM_T35          1       /* working with CM-T35 */
+#define CONFIG_CM_T3X          1       /* working with CM-T35 and CM-T3730 */
 
 #define CONFIG_SYS_TEXT_BASE   0x80008000
 
 #define CONFIG_BAUDRATE                        115200
 #define CONFIG_SYS_BAUDRATE_TABLE      {4800, 9600, 19200, 38400, 57600,\
                                        115200}
-#define CONFIG_GENERIC_MMC             1
 #define CONFIG_MMC                     1
-#define CONFIG_OMAP_HSMMC              1
+#define CONFIG_OMAP3_MMC               1
 #define CONFIG_DOS_PARTITION           1
 
 /* DDR - I use Micron DDR */
                "fi; " \
        "else run nandboot; fi"
 
-#define CONFIG_AUTO_COMPLETE           1
 /*
  * Miscellaneous configurable options
  */
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_TIMESTAMP
+#define CONFIG_SYS_AUTOLOAD     "no"
 #define CONFIG_SYS_LONGHELP            /* undef to save memory */
 #define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
 #define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
-#define CONFIG_SYS_PROMPT              "CM-T35 # "
+#define CONFIG_SYS_PROMPT              "CM-T3x # "
 #define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size */
 /* Print Buffer Size */
 #define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
 
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
 
-#define CONFIG_SYS_FLASH_BASE          boot_flash_base
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_SYS_FLASH_BASE          PISMO1_NAND_BASE
+#endif
 
 /* Monitor at start of flash */
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
 #define ONENAND_ENV_OFFSET             0x260000 /* environment starts here */
 #define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
 
-#define CONFIG_SYS_ENV_SECT_SIZE       boot_flash_sec
-#define CONFIG_ENV_OFFSET              boot_flash_off
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR                        SMNAND_ENV_OFFSET
 
-#ifndef __ASSEMBLY__
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
-
 #if defined(CONFIG_CMD_NET)
 #define CONFIG_NET_MULTI
 #define CONFIG_SMC911X
 #define CONFIG_SMC911X_32_BIT
-#define CM_T35_SMC911X_BASE    0x2C000000
-#define SB_T35_SMC911X_BASE    (CM_T35_SMC911X_BASE + (16 << 20))
-#define CONFIG_SMC911X_BASE    CM_T35_SMC911X_BASE
+#define CM_T3X_SMC911X_BASE    0x2C000000
+#define SB_T35_SMC911X_BASE    (CM_T3X_SMC911X_BASE + (16 << 20))
+#define CONFIG_SMC911X_BASE    CM_T3X_SMC911X_BASE
 #endif /* (CONFIG_CMD_NET) */
 
 /* additions for new relocation code, must be added to all boards */
@@ -349,4 +345,19 @@ extern unsigned int boot_flash_type;
                                         CONFIG_SYS_INIT_RAM_SIZE -     \
                                         GENERATED_GBL_DATA_SIZE)
 
+/* Status LED */
+#define CONFIG_STATUS_LED              1 /* Status LED enabled */
+#define CONFIG_BOARD_SPECIFIC_LED      1
+#define STATUS_LED_GREEN               0
+#define STATUS_LED_BIT                 STATUS_LED_GREEN
+#define STATUS_LED_STATE               STATUS_LED_ON
+#define STATUS_LED_PERIOD              (CONFIG_SYS_HZ / 2)
+#define STATUS_LED_BOOT                        STATUS_LED_BIT
+#define GREEN_LED_GPIO                 186 /* CM-T35 Green LED is GPIO186 */
+
+/* GPIO banks */
+#ifdef CONFIG_STATUS_LED
+#define CONFIG_OMAP3_GPIO_6            1 /* GPIO186 is in GPIO bank 6  */
+#endif
+
 #endif /* __CONFIG_H */
index bff212e40d71e658cd837b3801b5e0756bfc7f6f..d1cda151d8df8dab77f4cf9fc5c67ce68c84d505 100644 (file)
 
 #include "../board/freescale/common/ics307_clk.h"
 
+#ifdef CONFIG_RAMBOOT_PBL
+#define CONFIG_RAMBOOT_TEXT_BASE       CONFIG_SYS_TEXT_BASE
+#define CONFIG_RESET_VECTOR_ADDRESS    0xfffffffc
+#endif
+
 /* High Level Configuration Options */
 #define CONFIG_BOOKE
 #define CONFIG_E500                    /* BOOKE e500 family */
 
 #define CONFIG_ENV_OVERWRITE
 
+#if defined(CONFIG_RAMBOOT_PBL)
+       #define CONFIG_SYS_NO_FLASH     /* Store ENV in memory only */
+#endif
+
 #ifdef CONFIG_SYS_NO_FLASH
 #define CONFIG_ENV_IS_NOWHERE
 #else
 #define CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_FLASH_CFI_DRIVER
 #define CONFIG_SYS_FLASH_CFI
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
 #endif
 
 #define CONFIG_SYS_CLK_FREQ    get_board_sys_clk() /* sysclk for MPC85xx */
 #define CONFIG_SYS_ALT_MEMTEST
 #define CONFIG_PANIC_HANG      /* do not reset board on panic */
 
+/*
+ *  Config the L3 Cache as L3 SRAM
+ */
+#define CONFIG_SYS_INIT_L3_ADDR                CONFIG_RAMBOOT_TEXT_BASE
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_INIT_L3_ADDR_PHYS   (0xf00000000ull | CONFIG_RAMBOOT_TEXT_BASE)
+#else
+#define CONFIG_SYS_INIT_L3_ADDR_PHYS   CONFIG_SYS_INIT_L3_ADDR
+#endif
+#define CONFIG_SYS_L3_SIZE             (1024 << 10)
+#define CONFIG_SYS_INIT_L3_END (CONFIG_SYS_INIT_L3_ADDR + CONFIG_SYS_L3_SIZE)
+
 /*
  * Base addresses -- Note these are effective addresses where the
  * actual resources get mapped (not physical addresses)
 #define CONFIG_SYS_SPD_BUS_NUM 1
 #define SPD_EEPROM_ADDRESS1    0x51
 #define SPD_EEPROM_ADDRESS2    0x52
+#define SPD_EEPROM_ADDRESS     SPD_EEPROM_ADDRESS1     /* for p3041/p5010 */
 #define CONFIG_SYS_SDRAM_SIZE  4096    /* for fixed parameter use */
 
 /*
 
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_TEXT_BASE    /* start of monitor */
 
+#if defined(CONFIG_RAMBOOT_PBL)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Nand Flash */
+#if defined(CONFIG_P3041DS) || defined(CONFIG_P5020DS)
+#define CONFIG_NAND_FSL_ELBC
+#ifdef CONFIG_NAND_FSL_ELBC
+#define CONFIG_SYS_NAND_BASE           0xffa00000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_NAND_BASE_PHYS      0xfffa00000ull
+#else
+#define CONFIG_SYS_NAND_BASE_PHYS      CONFIG_SYS_NAND_BASE
+#endif
+
+#define CONFIG_SYS_NAND_BASE_LIST     {CONFIG_SYS_NAND_BASE}
+#define CONFIG_SYS_MAX_NAND_DEVICE     1
+#define CONFIG_MTD_NAND_VERIFY_WRITE
+#define CONFIG_CMD_NAND
+#define CONFIG_SYS_NAND_BLOCK_SIZE    (128 * 1024)
+
+/* NAND flash config */
+#define CONFIG_SYS_NAND_BR_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
+                              | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
+                              | BR_PS_8               /* Port Size = 8 bit */ \
+                              | BR_MS_FCM             /* MSEL = FCM */ \
+                              | BR_V)                 /* valid */
+#define CONFIG_SYS_NAND_OR_PRELIM  (0xFFFC0000       /* length 256K */ \
+                              | OR_FCM_PGS            /* Large Page*/ \
+                              | OR_FCM_CSCT \
+                              | OR_FCM_CST \
+                              | OR_FCM_CHT \
+                              | OR_FCM_SCY_1 \
+                              | OR_FCM_TRLX \
+                              | OR_FCM_EHTR)
+
+#define CONFIG_SYS_BR2_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
+#define CONFIG_SYS_OR2_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
+#endif /* CONFIG_NAND_FSL_ELBC */
+#endif
+
 #define CONFIG_SYS_FLASH_EMPTY_INFO
 #define CONFIG_SYS_FLASH_AMD_CHECK_DQ7
 #define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_FLASH_BASE_PHYS + 0x8000000, CONFIG_SYS_FLASH_BASE_PHYS}
 #define CONFIG_SYS_PCIE2_IO_SIZE       0x00010000      /* 64k */
 
 /* controller 3, Slot 1, tgtid 1, Base address 202000 */
-#define CONFIG_SYS_PCIE3_MEM_VIRT      0xe0000000
+#define CONFIG_SYS_PCIE3_MEM_VIRT      0xc0000000
 #ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_PCIE3_MEM_BUS       0xe0000000
 #define CONFIG_SYS_PCIE3_MEM_PHYS      0xc40000000ull
 #define CONFIG_SYS_PCIE4_IO_SIZE       0x00010000      /* 64k */
 
 /* Qman/Bman */
+#define CONFIG_SYS_DPAA_QBMAN          /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS    10
 #define CONFIG_SYS_BMAN_MEM_BASE       0xf4000000
 #ifdef CONFIG_PHYS_64BIT
 #endif
 
 #ifdef CONFIG_PCI
-
-/*PCIE video card used*/
-#define VIDEO_IO_OFFSET                CONFIG_SYS_PCIE1_IO_VIRT
-
-/* video */
-#define CONFIG_VIDEO
-
-#ifdef CONFIG_VIDEO
-#define CONFIG_BIOSEMU
-#define CONFIG_CFB_CONSOLE
-#define CONFIG_VIDEO_SW_CURSOR
-#define CONFIG_VGA_AS_SINGLE_DEVICE
-#define CONFIG_ATI_RADEON_FB
-#define CONFIG_VIDEO_LOGO
-#define CONFIG_SYS_ISA_IO_BASE_ADDRESS VIDEO_IO_OFFSET
-#endif
-
 #define CONFIG_NET_MULTI
 #define CONFIG_PCI_PNP                 /* do pci plug-and-play */
 #define CONFIG_E1000
 
-#ifndef CONFIG_PCI_PNP
-#define PCI_ENET0_IOADDR               CONFIG_SYS_PCI1_IO_BUS
-#define PCI_ENET0_MEMADDR              CONFIG_SYS_PCI1_IO_BUS
-#define PCI_IDSEL_NUMBER               0x11    /* IDSEL = AD11 */
-#endif
-
 #define CONFIG_PCI_SCAN_SHOW           /* show pci devices on startup */
 #define CONFIG_DOS_PARTITION
 #endif /* CONFIG_PCI */
 /*
  * Environment
  */
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
 #define CONFIG_ENV_SIZE                0x2000
 #define CONFIG_ENV_SECT_SIZE   0x20000 /* 128K (one sector) */
 
  */
 #include <config_cmd_default.h>
 
+#define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
+#define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_SETEXPR
-#define CONFIG_CMD_DHCP
 
 #ifdef CONFIG_PCI
 #define CONFIG_CMD_PCI
 
 /*
  * For booting Linux, the board info and command line data
- * have to be in the first 16 MB of memory, since this is
+ * have to be in the first 64 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define CONFIG_SYS_BOOTMAPSZ   (16 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (16 << 20)      /* Increase max gunzip size */
+#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
index d2394235f193f109340c76a63f5ad5b8780f9ee2..a8ada2d418ba0246c28f303fc70beb55fc777c3e 100644 (file)
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#define CONFIG_AT91_LEGACY
-
-#define CONFIG_DISPLAY_CPUINFO 1
+/* to be removed once maemory-map.h is fixed */
+#define AT91_BASE_SYS  0xffffe800
+#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)
 
 #define CONFIG_SYS_AT91_MAIN_CLOCK     18432000
 #define CONFIG_SYS_HZ          1000
 
-#define CONFIG_ARM926EJS       1
-
-#if defined(CONFIG_CPU9260_128M) || defined(CONFIG_CPU9260)
-#define CONFIG_CPU9260         1
-#elif defined(CONFIG_CPU9G20_128M) || defined(CONFIG_CPU9G20)
-#define CONFIG_CPU9G20         1
-#endif
+#define CONFIG_ARM926EJS
 
 #if defined(CONFIG_CPU9G20)
-#define CONFIG_AT91SAM9G20     1
+#define CONFIG_AT91SAM9G20
 #elif defined(CONFIG_CPU9260)
-#define CONFIG_AT91SAM9260     1
+#define CONFIG_AT91SAM9260
 #else
 #error "Unknown board"
 #endif
 
+#define CONFIG_AT91FAMILY
 #define CONFIG_ARCH_CPU_INIT
 #undef CONFIG_USE_IRQ
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_BOARD_EARLY_INIT_F
 
-#define CONFIG_CMDLINE_TAG             1
-#define CONFIG_SETUP_MEMORY_TAGS       1
-#define CONFIG_INITRD_TAG              1
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+
+#if defined(CONFIG_NANDBOOT)
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SYS_TEXT_BASE           0x23f00000
+#else
+#define CONFIG_SYS_TEXT_BASE           0x00000000
+#endif
 
 /* clocks */
 #if defined(CONFIG_CPU9G20)
 
 /* EBI_CSA, 3.3V, no pull-ups for D[15:0], CS1 SDRAM, CS3 NAND Flash */
 #define CONFIG_SYS_MATRIX_EBICSA_VAL           \
-       (AT91_MATRIX_DBPUC | AT91_MATRIX_CS1A_SDRAMC |\
-       AT91_MATRIX_CS3A_SMC_SMARTMEDIA | AT91_MATRIX_VDDIOMSEL)
+               (AT91_MATRIX_CSA_DBPUC | AT91_MATRIX_CSA_EBI_CS1A | \
+               AT91_MATRIX_CSA_EBI_CS3A | AT91_MATRIX_CSA_VDDIOMSEL_3_3V)
 
 /* SDRAM */
 /* SDRAMC_MR Mode register */
 /* setup SMC0, CS0 (NOR Flash) - 16-bit */
 #if defined(CONFIG_CPU9G20)
 #define CONFIG_SYS_SMC0_SETUP0_VAL                                     \
-               (AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0) |     \
-                AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0))
+               (AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) |     \
+                AT91_SMC_SETUP_NRD(0) | AT91_SMC_SETUP_NCS_RD(0))
 #define CONFIG_SYS_SMC0_PULSE0_VAL                                     \
-               (AT91_SMC_NWEPULSE_(8) | AT91_SMC_NCS_WRPULSE_(8) |     \
-                AT91_SMC_NRDPULSE_(14) | AT91_SMC_NCS_RDPULSE_(14))
+               (AT91_SMC_PULSE_NWE(8) | AT91_SMC_PULSE_NCS_WR(8) |     \
+                AT91_SMC_PULSE_NRD(14) | AT91_SMC_PULSE_NCS_RD(14))
 #define CONFIG_SYS_SMC0_CYCLE0_VAL     \
-               (AT91_SMC_NWECYCLE_(8) | AT91_SMC_NRDCYCLE_(14))
+               (AT91_SMC_CYCLE_NWE(8) | AT91_SMC_CYCLE_NRD(14))
 #define CONFIG_SYS_SMC0_MODE0_VAL                              \
-               (AT91_SMC_READMODE | AT91_SMC_WRITEMODE |       \
-                AT91_SMC_DBW_16 |                              \
-                AT91_SMC_TDFMODE |                             \
-                AT91_SMC_TDF_(3))
+               (AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |  \
+                AT91_SMC_MODE_DBW_16 |                         \
+                AT91_SMC_MODE_TDF |                            \
+                AT91_SMC_MODE_TDF_CYCLE(3))
 #elif defined(CONFIG_CPU9260)
 #define CONFIG_SYS_SMC0_SETUP0_VAL                                     \
-               (AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0) |     \
-                AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0))
+               (AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) |     \
+                AT91_SMC_SETUP_NRD(0) | AT91_SMC_SETUP_NCS_RD(0))
 #define CONFIG_SYS_SMC0_PULSE0_VAL                                     \
-               (AT91_SMC_NWEPULSE_(6) | AT91_SMC_NCS_WRPULSE_(6) |     \
-                AT91_SMC_NRDPULSE_(10) | AT91_SMC_NCS_RDPULSE_(10))
+               (AT91_SMC_PULSE_NWE(6) | AT91_SMC_PULSE_NCS_WR(6) |     \
+                AT91_SMC_PULSE_NRD(10) | AT91_SMC_PULSE_NCS_RD(10))
 #define CONFIG_SYS_SMC0_CYCLE0_VAL     \
-               (AT91_SMC_NWECYCLE_(6) | AT91_SMC_NRDCYCLE_(10))
+               (AT91_SMC_CYCLE_NWE(6) | AT91_SMC_CYCLE_NRD(10))
 #define CONFIG_SYS_SMC0_MODE0_VAL                              \
-               (AT91_SMC_READMODE | AT91_SMC_WRITEMODE |       \
-                AT91_SMC_DBW_16 |                              \
-                AT91_SMC_TDFMODE |                             \
-                AT91_SMC_TDF_(2))
+               (AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |  \
+                AT91_SMC_MODE_DBW_16 |                         \
+                AT91_SMC_MODE_TDF |                            \
+                AT91_SMC_MODE_TDF_CYCLE(2))
 #endif
 
 /* user reset enable */
 #define CONFIG_SYS_RSTC_RMR_VAL                        \
                (AT91_RSTC_KEY |                \
-               AT91_RSTC_PROCRST |             \
-               AT91_RSTC_RSTTYP_WAKEUP |       \
-               AT91_RSTC_RSTTYP_WATCHDOG)
+               AT91_RSTC_CR_PROCRST |          \
+               AT91_RSTC_MR_ERSTL(1) | \
+               AT91_RSTC_MR_ERSTL(2))
 
 /* Disable Watchdog */
 #define CONFIG_SYS_WDTC_WDMR_VAL                               \
-               (AT91_WDT_WDIDLEHLT | AT91_WDT_WDDBGHLT |       \
-                AT91_WDT_WDV |                                 \
-                AT91_WDT_WDDIS |                               \
-                AT91_WDT_WDD)
+               (AT91_WDT_MR_WDIDLEHLT | AT91_WDT_MR_WDDBGHLT | \
+                AT91_WDT_MR_WDV(0xfff) |                       \
+                AT91_WDT_MR_WDDIS |                            \
+                AT91_WDT_MR_WDD(0xfff))
 
 /*
  * Hardware drivers
  */
-#define CONFIG_AT91_GPIO       1
-#define CONFIG_ATMEL_USART     1
+#define CONFIG_AT91SAM9_WATCHDOG
+#define CONFIG_AT91_GPIO
+#define CONFIG_ATMEL_USART
 #undef CONFIG_USART0
 #undef CONFIG_USART1
 #undef CONFIG_USART2
-#define CONFIG_USART3          1       /* USART 3 is DBGU */
+#define CONFIG_USART3
 
 #define CONFIG_BOOTDELAY       3
 
 /*
  * BOOTP options
  */
-#define CONFIG_BOOTP_BOOTFILESIZE      1
-#define CONFIG_BOOTP_BOOTPATH          1
-#define CONFIG_BOOTP_GATEWAY           1
-#define CONFIG_BOOTP_HOSTNAME          1
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
 /*
  * Command line configuration.
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_IMLS
 
-#define CONFIG_CMD_PING                1
-#define CONFIG_CMD_DHCP                1
-#define CONFIG_CMD_NAND                1
-#define CONFIG_CMD_USB         1
-#define CONFIG_CMD_FAT         1
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_MII
 
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS   1
-#define PHYS_SDRAM             0x20000000
+#define CONFIG_SYS_SDRAM_BASE          0x20000000
 #if defined(CONFIG_CPU9260_128M) || defined(CONFIG_CPU9G20_128M)
-#define PHYS_SDRAM_SIZE                0x08000000      /* 128 MB */
+#define CONFIG_SYS_SDRAM_SIZE          (128 * 1024 * 1024)
 #define CONFIG_SYS_SDRC_CR_VAL CONFIG_SYS_SDRC_CR_VAL_128MB
 #else
-#define PHYS_SDRAM_SIZE                0x04000000      /* 64 MB */
+#define CONFIG_SYS_SDRAM_SIZE          (64 * 1024 * 1024)
 #define CONFIG_SYS_SDRC_CR_VAL CONFIG_SYS_SDRC_CR_VAL_64MB
 #endif
 
 /* NAND flash */
-#define CONFIG_NAND_ATMEL                      1
+#define CONFIG_NAND_ATMEL
 #define NAND_MAX_CHIPS                         1
 #define CONFIG_SYS_MAX_NAND_DEVICE             1
 #define CONFIG_SYS_NAND_BASE                   0x40000000
 #define CONFIG_SYS_NAND_DBW_8                  1
-#define CONFIG_SYS_NAND_READY_PIN              AT91_PIN_PC13
-#define CONFIG_SYS_NAND_ENABLE_PIN             AT91_PIN_PC14
+#define CONFIG_SYS_NAND_READY_PIN              AT91_PIO_PORTC, 13
+#define CONFIG_SYS_NAND_ENABLE_PIN             AT91_PIO_PORTC, 14
 #define CONFIG_SYS_NAND_MASK_ALE               (1 << 21)
 #define CONFIG_SYS_NAND_MASK_CLE               (1 << 22)
 
 /* NOR flash */
-#define CONFIG_SYS_FLASH_CFI                   1
-#define CONFIG_FLASH_CFI_DRIVER                        1
+#if defined(CONFIG_NANDBOOT)
+#define CONFIG_SYS_NO_FLASH
+#else
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
 #define PHYS_FLASH_1                           0x10000000
 #define PHYS_FLASH_2                           0x12000000
 #define CONFIG_SYS_FLASH_BANKS_LIST            \
 #define CONFIG_SYS_MAX_FLASH_SECT              (255+4)
 #define CONFIG_SYS_MAX_FLASH_BANKS             2
 #define CONFIG_SYS_FLASH_CFI_WIDTH             FLASH_CFI_16BIT
-#define CONFIG_SYS_FLASH_EMPTY_INFO            1
-#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE      1
-#define CONFIG_SYS_FLASH_PROTECTION            1
+#define CONFIG_SYS_FLASH_EMPTY_INFO
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+#define CONFIG_SYS_FLASH_PROTECTION
 #define CONFIG_SYS_MONITOR_BASE                        PHYS_FLASH_1
+#endif
 
 /* Ethernet */
-#define CONFIG_MACB                            1
-#define CONFIG_RMII                            1
-#define CONFIG_RESET_PHY_R                     1
-#define CONFIG_NET_MULTI                       1
+#define CONFIG_MACB
+#define CONFIG_RMII
+#define CONFIG_NET_MULTI
 #define CONFIG_NET_RETRY_COUNT                 20
-#define CONFIG_MACB_SEARCH_PHY                 1
+#define CONFIG_MACB_SEARCH_PHY
 
 /* LEDS */
 /* Status LED */
-#define CONFIG_STATUS_LED                      1 /* Status LED enabled */
-#define CONFIG_BOARD_SPECIFIC_LED              1
+#define CONFIG_STATUS_LED
+#define CONFIG_BOARD_SPECIFIC_LED
 #define STATUS_LED_RED                         0
 #define STATUS_LED_GREEN                       1
 #define STATUS_LED_YELLOW                      2
 /* Optional value */
 #define STATUS_LED_BOOT                                STATUS_LED_BIT
 
-#define CONFIG_RED_LED                         AT91_PIN_PC11
-#define CONFIG_GREEN_LED                       AT91_PIN_PC12
-#define CONFIG_YELLOW_LED                      AT91_PIN_PC7
-#define CONFIG_BLUE_LED                                AT91_PIN_PC9
+#define CONFIG_RED_LED                         AT91_PIO_PORTC, 11
+#define CONFIG_GREEN_LED                       AT91_PIO_PORTC, 12
+#define CONFIG_YELLOW_LED                      AT91_PIO_PORTC, 7
+#define CONFIG_BLUE_LED                                AT91_PIO_PORTC, 9
 
 /* USB */
-#define CONFIG_USB_ATMEL                       1
-#define CONFIG_USB_OHCI_NEW                    1
-#define CONFIG_DOS_PARTITION                   1
-#define CONFIG_SYS_USB_OHCI_CPU_INIT           1
+#define CONFIG_USB_ATMEL
+#define CONFIG_USB_OHCI_NEW
+#define CONFIG_DOS_PARTITION
+#define CONFIG_SYS_USB_OHCI_CPU_INIT
 #define CONFIG_SYS_USB_OHCI_REGS_BASE          0x00500000
+#if defined(CONFIG_CPU9G20)
+#define CONFIG_SYS_USB_OHCI_SLOT_NAME          "at91sam9g20"
+#elif defined(CONFIG_CPU9260)
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME          "at91sam9260"
+#endif
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS     2
-#define CONFIG_USB_STORAGE                     1
+#define CONFIG_USB_STORAGE
 
 #define CONFIG_SYS_LOAD_ADDR                   0x21000000
+#define CONFIG_LOADADDR                                CONFIG_SYS_LOAD_ADDR
 
-#define CONFIG_SYS_MEMTEST_START               PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END                 0x21e00000
+#define CONFIG_SYS_MEMTEST_START               CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END                 \
+       (CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - 512 * 1024)
 
+#if defined(CONFIG_NANDBOOT)
+#define CONFIG_SYS_USE_NANDFLASH
+#undef CONFIG_SYS_USE_FLASH
+#else
+#define CONFIG_SYS_USE_FLASH
 #undef CONFIG_SYS_USE_NANDFLASH
-#define CONFIG_SYS_USE_FLASH                   1
+#endif
+
+#if defined(CONFIG_CPU9G20)
+#define CONFIG_SYS_BASEDIR     "cpu9G20"
+#elif defined(CONFIG_CPU9260)
+#define CONFIG_SYS_BASEDIR     "cpu9260"
+#endif
 
 #if defined(CONFIG_SYS_USE_FLASH)
-#define CONFIG_ENV_IS_IN_FLASH         1
+#define CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_ENV_OFFSET              0x40000
 #define CONFIG_ENV_SECT_SIZE           0x20000
 #define        CONFIG_ENV_SIZE                 0x20000
-#define CONFIG_ENV_OVERWRITE           1
+#define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_BOOTCOMMAND             "run flashboot"
 
-#define MTDIDS_DEFAULT         "nor0=physmap-flash.0,nand0=atmel_nand"
+#define MTDIDS_DEFAULT         "nor0=physmap-flash.0,nand0=atmel_nand"
 #define MTDPARTS_DEFAULT               \
        "mtdparts=physmap-flash.0:"     \
                "256k(u-boot)ro,"       \
 
 #define CONFIG_BOOTARGS "root=/dev/mtdblock3 rootfstype=jffs2 "
 
-#if defined(CONFIG_CPU9G20)
-#define CONFIG_SYS_BASEDIR     "cpu9G20"
-#elif defined(CONFIG_CPU9260)
-#define CONFIG_SYS_BASEDIR     "cpu9260"
-#endif
-
 #define CONFIG_EXTRA_ENV_SETTINGS                              \
        "mtdids=" MTDIDS_DEFAULT "\0"                           \
        "mtdparts=" MTDPARTS_DEFAULT "\0"                       \
        "partition=nand0,0\0"                                   \
        "ramargs=setenv bootargs $(bootargs) $(mtdparts)\0"     \
-       "ramboot=tftpboot 0x22000000 cpu9260/uImage;"           \
+       "ramboot=tftpboot 0x22000000 $(basedir)/uImage;"        \
                "run ramargs;bootm 22000000\0"                  \
        "flashboot=run ramargs;bootm 0x10060000\0"              \
        "basedir=" CONFIG_SYS_BASEDIR "\0"                      \
                "0x10220000 0x13ffffff;cp.b 0x24000000 "        \
                "0x10220000 $(filesize)\0" \
        ""
+#elif defined(CONFIG_NANDBOOT)
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET              0x60000
+#define CONFIG_ENV_OFFSET_REDUND       0x80000
+#define CONFIG_ENV_SECT_SIZE           0x20000
+#define        CONFIG_ENV_SIZE                 0x20000
+#define CONFIG_ENV_SIZE_REDUND         (CONFIG_ENV_SIZE)
+#define CONFIG_ENV_OVERWRITE
+
+#define CONFIG_BOOTCOMMAND             "run flashboot"
+
+#define MTDIDS_DEFAULT         "nand0=atmel_nand"
+#define MTDPARTS_DEFAULT               \
+       "mtdparts=atmel_nand:"          \
+               "128k(bootstrap)ro,"    \
+               "256k(u-boot)ro,"       \
+               "128k(u-boot-env)ro,"   \
+               "128k(u-boot-env2)ro,"  \
+               "2M(kernel),"   \
+               "-(rootfs)"
+
+#define CONFIG_BOOTARGS "root=ubi0:eukrea-cpu9260-rootfs "     \
+       "ubi.mtd=5 rootfstype=ubifs at91sam9_wdt.heartbeat=60"
+
+#define CONFIG_EXTRA_ENV_SETTINGS                              \
+       "mtdids=" MTDIDS_DEFAULT "\0"                           \
+       "mtdparts=" MTDPARTS_DEFAULT "\0"                       \
+       "partition=nand0,5\0"                                   \
+       "ramargs=setenv bootargs $(bootargs) $(mtdparts)\0"     \
+       "ramboot=tftpboot 0x22000000 $(basedir)/uImage;"        \
+               "run ramargs;bootm 22000000\0"                  \
+       "flashboot=run ramargs; nand read 0x22000000 0xA0000 "  \
+               "0x200000; bootm 0x22000000\0"                  \
+       "basedir=" CONFIG_SYS_BASEDIR "\0"                      \
+       "u-boot=u-boot-eukrea-cpu9260.bin\0"                    \
+       "kernel=uImage-eukrea-cpu9260.bin\0"                    \
+       "rootfs=image-eukrea-cpu9260.ubi\0"                     \
+       "updtub=tftp ${loadaddr} $(basedir)/${u-boot}; "        \
+               "nand erase 20000 40000; "                      \
+               "nand write ${loadaddr} 20000 40000\0"          \
+       "updtui=tftp ${loadaddr} $(basedir)/${kernel}; "        \
+               "nand erase a0000 200000; "                     \
+               "nand write ${loadaddr} a0000 200000\0"         \
+       "updtrfs=tftp ${loadaddr} $(basedir)/${rootfs}; "       \
+               "nand erase  2a0000 fd60000; "                  \
+               "nand write ${loadaddr} 2a0000 ${filesize}\0"
 #endif
 
 #define CONFIG_BAUDRATE                        115200
 #define CONFIG_SYS_MAXARGS             16
 #define CONFIG_SYS_PBSIZE              \
                (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
-#define CONFIG_SYS_LONGHELP            1
-#define CONFIG_CMDLINE_EDITING         1
-#define CONFIG_SILENT_CONSOLE          1
-#define CONFIG_NETCONSOLE              1
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_SILENT_CONSOLE
+#define CONFIG_NETCONSOLE
 
 /*
  * Size of malloc() pool
 #define CONFIG_SYS_MALLOC_LEN          \
                ROUND(3 * CONFIG_ENV_SIZE + 128 * 1024, 0x1000)
 
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - \
+                               GENERATED_GBL_DATA_SIZE)
+
 #define CONFIG_STACKSIZE               (32 * 1024)
 
 #if defined(CONFIG_USE_IRQ)
index f31081dbf37b25d76674e8eaad3fe0e1114225e3..cfaef15cbd6ebb850de378cb8df61d692add5c15 100644 (file)
 #ifndef _CONFIG_CPUAT91_H
 #define _CONFIG_CPUAT91_H
 
-#ifdef CONFIG_CPUAT91_RAM
-#define CONFIG_SKIP_LOWLEVEL_INIT      1
+#include <asm/sizes.h>
+
+#ifdef CONFIG_RAMBOOT
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SYS_TEXT_BASE           0x21F00000
 #else
 #define CONFIG_BOOTDELAY               1
+#define CONFIG_SYS_TEXT_BASE           0
 #endif
 
-#define AT91C_MAIN_CLOCK               179712000
-#define AT91C_MASTER_CLOCK             59904000
-
-#define AT91_SLOW_CLOCK                        32768
+#define AT91C_XTAL_CLOCK               18432000
+#define AT91C_MAIN_CLOCK               ((AT91C_XTAL_CLOCK / 4) * 39)
+#define AT91C_MASTER_CLOCK             (AT91C_MAIN_CLOCK / 3)
+#define CONFIG_SYS_HZ_CLOCK            (AT91C_MASTER_CLOCK / 2)
+#define CONFIG_SYS_HZ                  1000
 
-#define CONFIG_ARM920T                 1
-#define CONFIG_AT91RM9200              1
-#define CONFIG_CPUAT91                 1
+#define CONFIG_ARM920T
+#define CONFIG_AT91RM9200
+#define CONFIG_CPUAT91
+#define CONFIG_AT91FAMILY
 
 #undef CONFIG_USE_IRQ
-#define USE_920T_MMU                   1
+#define USE_920T_MMU
 
-#define CONFIG_CMDLINE_TAG             1
-#define CONFIG_SETUP_MEMORY_TAGS       1
-#define CONFIG_INITRD_TAG              1
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
-#define CONFIG_SYS_USE_MAIN_OSCILLATOR 1
+#define CONFIG_SYS_USE_MAIN_OSCILLATOR
 /* flash */
 #define CONFIG_SYS_MC_PUIA_VAL 0x00000000
 #define CONFIG_SYS_MC_PUP_VAL  0x00000000
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
 
 /* define one of these to choose the DBGU, USART0 or USART1 as console */
-#define CONFIG_AT91RM9200_USART                1
-#define CONFIG_DBGU                    1
-#undef CONFIG_USART0
-#undef CONFIG_USART1
+#define CONFIG_AT91RM9200_USART
+#define CONFIG_DBGU
 
 #undef CONFIG_HARD_I2C
-#define CONFIG_SOFT_I2C                        1
+#undef CONFIG_SOFT_I2C
 #define AT91_PIN_SDA                   (1<<25)
 #define AT91_PIN_SCL                   (1<<26)
 
-#define CONFIG_SYS_I2C_INIT_BOARD      1
+#define CONFIG_SYS_I2C_INIT_BOARD
 #define        CONFIG_SYS_I2C_SPEED            50000
 #define CONFIG_SYS_I2C_SLAVE           0
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW    1
 #define        CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS   10
 
-#define CONFIG_BOOTP_BOOTFILESIZE      1
-#define CONFIG_BOOTP_BOOTPATH          1
-#define CONFIG_BOOTP_GATEWAY           1
-#define CONFIG_BOOTP_HOSTNAME          1
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
 #include <config_cmd_default.h>
 
-#define CONFIG_CMD_DHCP                        1
-#define CONFIG_CMD_PING                        1
-#define CONFIG_CMD_MII                 1
-#define CONFIG_CMD_CACHE               1
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_CACHE
 #undef CONFIG_CMD_USB
 #undef CONFIG_CMD_FPGA
 #undef CONFIG_CMD_IMI
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_DHCP
 
-#define CONFIG_CMD_EEPROM              1
-#define CONFIG_CMD_I2C                 1
+#ifdef CONFIG_SOFT_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#endif
 
 #define CONFIG_NR_DRAM_BANKS                   1
-#define PHYS_SDRAM                             0x20000000
-#define PHYS_SDRAM_SIZE                                0x02000000
+#define CONFIG_SYS_SDRAM_BASE                  0x20000000
+#define CONFIG_SYS_SDRAM_SIZE                  (32 * 1024 * 1024)
 
-#define CONFIG_SYS_MEMTEST_START               PHYS_SDRAM
+#define CONFIG_SYS_MEMTEST_START               CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_END                 \
-       (CONFIG_SYS_MEMTEST_START + PHYS_SDRAM_SIZE - 512 * 1024)
+       (CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - 512 * 1024)
 
-#define CONFIG_NET_MULTI               1
-#define CONFIG_DRIVER_AT91EMAC         1
-#define CONFIG_SYS_RX_ETH_BUFFER       8
-#define CONFIG_RMII                    1
-#define CONFIG_MII                     1
+#define CONFIG_NET_MULTI
+#define CONFIG_DRIVER_AT91EMAC
+#define CONFIG_SYS_RX_ETH_BUFFER       16
+#define CONFIG_RMII
+#define CONFIG_MII
 #define CONFIG_DRIVER_AT91EMAC_PHYADDR 1
 #define CONFIG_NET_RETRY_COUNT                 20
-#define CONFIG_KS8721_PHY                      1
+#define CONFIG_KS8721_PHY
 
-#define CONFIG_SYS_FLASH_CFI                   1
-#define CONFIG_FLASH_CFI_DRIVER                        1
-#define CONFIG_SYS_FLASH_EMPTY_INFO            1
-#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE      1
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_SYS_FLASH_EMPTY_INFO
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
 #define CONFIG_SYS_MAX_FLASH_BANKS             1
-#define CONFIG_SYS_FLASH_PROTECTION            1
+#define CONFIG_SYS_FLASH_PROTECTION
 #define PHYS_FLASH_1                           0x10000000
 #define CONFIG_SYS_FLASH_BASE                  PHYS_FLASH_1
 #define CONFIG_SYS_MAX_FLASH_SECT              128
 #define CONFIG_SYS_FLASH_CFI_WIDTH             FLASH_CFI_16BIT
+#define CONFIG_SYS_MONITOR_BASE                        PHYS_FLASH_1
+#define PHYS_FLASH_SIZE                                (16 * 1024 * 1024)
+#define CONFIG_SYS_FLASH_BANKS_LIST            \
+               { PHYS_FLASH_1 }
 
 #if defined(CONFIG_CMD_USB)
-#define CONFIG_USB_OHCI_NEW                    1
-#define CONFIG_USB_STORAGE                     1
-#define CONFIG_DOS_PARTITION                   1
-#define CONFIG_AT91C_PQFP_UHPBU                        1
+#define CONFIG_USB_ATMEL
+#define CONFIG_USB_OHCI_NEW
+#define CONFIG_USB_STORAGE
+#define CONFIG_DOS_PARTITION
+#define CONFIG_AT91C_PQFP_UHPBU
 #undef CONFIG_SYS_USB_OHCI_BOARD_INIT
-#define CONFIG_SYS_USB_OHCI_CPU_INIT           1
+#define CONFIG_SYS_USB_OHCI_CPU_INIT
 #define CONFIG_SYS_USB_OHCI_REGS_BASE          AT91_USB_HOST_BASE
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME          "at91rm9200"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS     15
 #endif
 
-#define CONFIG_ENV_IS_IN_FLASH         1
-#define CONFIG_ENV_ADDR                        (PHYS_FLASH_1 + 0x20000)
-#define CONFIG_ENV_SIZE                        0x20000
-#define CONFIG_ENV_SECT_SIZE           0x20000
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_ADDR                                (PHYS_FLASH_1 + 128 * 1024)
+#define CONFIG_ENV_SIZE                                (128 * 1024)
+#define CONFIG_ENV_SECT_SIZE           (128 * 1024)
 
 #define CONFIG_SYS_LOAD_ADDR           0x21000000
 
 #define CONFIG_SYS_MAXARGS             32
 #define CONFIG_SYS_PBSIZE              \
        (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
-#define CONFIG_CMDLINE_EDITING         1
-#define CONFIG_SYS_LONGHELP            1
+#define CONFIG_CMDLINE_EDITING
 
-#define CONFIG_SYS_HZ                  1000
-#define CONFIG_SYS_HZ_CLOCK            (AT91C_MASTER_CLOCK / 2)
+#define CONFIG_SYS_MALLOC_LEN          \
+                       ROUND(3 * CONFIG_ENV_SIZE + 128 * 1024, 4 * 1024)
+
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - \
+                               GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 128 * 1024)
 #define CONFIG_STACKSIZE               (32 * 1024)
+#define CONFIG_STACKSIZE_IRQ           (4 * 1024)
+#define CONFIG_STACKSIZE_FIQ           (4 * 1024)
+
 
 #if defined(CONFIG_USE_IRQ)
 #error CONFIG_USE_IRQ not supported
 #endif
 
-#define CONFIG_DEVICE_NULLDEV          1
-#define CONFIG_SILENT_CONSOLE          1
+#define CONFIG_DEVICE_NULLDEV
+#define CONFIG_SILENT_CONSOLE
 
-#define CONFIG_AUTOBOOT_KEYED          1
+#define CONFIG_AUTOBOOT_KEYED
 #define CONFIG_AUTOBOOT_PROMPT         \
        "Press SPACE to abort autoboot\n"
 #define CONFIG_AUTOBOOT_STOP_STR       " "
 #define CONFIG_AUTOBOOT_DELAY_STR      "d"
 
-#define CONFIG_VERSION_VARIABLE                1
+#define CONFIG_VERSION_VARIABLE
 
 #define MTDIDS_DEFAULT                 "nor0=physmap-flash.0"
 #define MTDPARTS_DEFAULT               \
index d898b777a76ef920a0f9e854663305e8bbb94b3a..e02793dd500a05b4c895fcbf7605f447ed835fdf 100644 (file)
@@ -61,6 +61,8 @@
 #define CONFIG_INITRD_TAG              1
 #define CONFIG_REVISION_TAG            1
 
+#define CONFIG_OF_LIBFDT               1
+
 /* Size of malloc() pool */
 #define CONFIG_ENV_SIZE                        (128 << 10)     /* 128 KiB */
                                                /* Sector */
 #define CONFIG_ENV_IS_IN_NAND          1
 #define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
 
-#define CONFIG_ENV_OFFSET              boot_flash_off
-
-#ifndef __ASSEMBLY__
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
 
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
 #define CONFIG_SYS_INIT_RAM_ADDR        0x4020f800
diff --git a/include/configs/dig297.h b/include/configs/dig297.h
new file mode 100644 (file)
index 0000000..7aeb24e
--- /dev/null
@@ -0,0 +1,311 @@
+/*
+ * (C) Copyright 2011 Comelit Group SpA
+ * Luca Ceresoli <luca.ceresoli@comelit.it>
+ *
+ * Based on omap3_beagle.h:
+ * (C) Copyright 2006-2008
+ * Texas Instruments.
+ * Richard Woodruff <r-woodruff2@ti.com>
+ * Syed Mohammed Khasim <x0khasim@ti.com>
+ *
+ * Configuration settings for the Comelit DIG297 board.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_ARMV7           /* This is an ARM V7 CPU core */
+#define CONFIG_OMAP            /* in a TI OMAP core */
+#define CONFIG_OMAP34XX                /* which is a 34XX */
+#define CONFIG_OMAP3430                /* which is in a 3430 */
+
+#define CONFIG_SYS_TEXT_BASE   0x80008000
+
+#define CONFIG_SDRC    /* The chip has SDRC controller */
+
+#include <asm/arch/cpu.h>              /* get chip and board defs */
+#include <asm/arch/omap3.h>
+
+/*
+ * Display CPU and Board information
+ */
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Clock Defines */
+#define V_OSCK                 26000000        /* Clock output from T2 */
+#define V_SCLK                 (V_OSCK >> 1)
+
+#undef CONFIG_USE_IRQ                          /* no support for IRQs */
+#define CONFIG_MISC_INIT_R
+
+#define CONFIG_CMDLINE_TAG                     /* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_ENV_SIZE                        (128 << 10)     /* 128 KiB */
+                                               /* Sector */
+#define CONFIG_SYS_MALLOC_LEN          (1024 << 10) /* UBI needs >= 512 kB */
+
+/*
+ * Hardware drivers
+ */
+
+/*
+ * NS16550 Configuration
+ */
+#define V_NS16550_CLK                  48000000        /* 48MHz (APLL96/2) */
+
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE    (-4)
+#define CONFIG_SYS_NS16550_CLK         V_NS16550_CLK
+
+/*
+ * select serial console configuration: UART3 (ttyO2)
+ */
+#define CONFIG_CONS_INDEX              3
+#define CONFIG_SYS_NS16550_COM3                OMAP34XX_UART3
+#define CONFIG_SERIAL3                 3
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_BAUDRATE                        115200
+#define CONFIG_SYS_BAUDRATE_TABLE      {4800, 9600, 19200, 38400, 57600,\
+                                       115200}
+#define CONFIG_MMC
+#define CONFIG_OMAP3_MMC
+#define CONFIG_DOS_PARTITION
+
+/* DDR - I use Micron DDR */
+#define CONFIG_OMAP3_MICRON_DDR
+
+/* library portions to compile in */
+#define CONFIG_RBTREE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_LZO
+
+/* commands to include */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_FAT         /* FAT support                  */
+#define CONFIG_CMD_UBI         /* UBI Support                  */
+#define CONFIG_CMD_UBIFS       /* UBIFS Support                */
+#define CONFIG_CMD_MTDPARTS    /* Enable MTD parts commands    */
+#define CONFIG_MTD_DEVICE      /* needed for mtdparts commands */
+#define MTDIDS_DEFAULT         "nand0=omap2-nand.0"
+#define MTDPARTS_DEFAULT       "mtdparts=omap2-nand.0:896k(uboot),"\
+                               "128k(uboot-env),3m(kernel),252m(ubi)"
+
+#define CONFIG_CMD_I2C         /* I2C serial bus support       */
+#define CONFIG_CMD_MMC         /* MMC support                  */
+#define CONFIG_CMD_NAND                /* NAND support                 */
+
+#undef CONFIG_CMD_FLASH                /* flinfo, erase, protect       */
+#undef CONFIG_CMD_FPGA         /* FPGA configuration Support   */
+#undef CONFIG_CMD_IMI          /* iminfo                       */
+#undef CONFIG_CMD_IMLS         /* List all found images        */
+#define CONFIG_CMD_NET         /* bootp, tftpboot, rarpboot    */
+#undef CONFIG_CMD_NFS          /* NFS support                  */
+
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_HARD_I2C
+#define CONFIG_SYS_I2C_SPEED           100000
+#define CONFIG_SYS_I2C_SLAVE           1
+#define CONFIG_SYS_I2C_BUS             0
+#define CONFIG_SYS_I2C_BUS_SELECT      1
+#define CONFIG_DRIVER_OMAP34XX_I2C     1
+
+/*
+ * TWL4030
+ */
+#define CONFIG_TWL4030_POWER
+#define CONFIG_TWL4030_LED
+
+/*
+ * Board NAND Info.
+ */
+#define CONFIG_NAND_OMAP_GPMC
+#define CONFIG_SYS_NAND_ADDR           NAND_BASE       /* physical address */
+                                                       /* to access nand */
+#define CONFIG_SYS_NAND_BASE           NAND_BASE       /* physical address */
+                                                       /* to access nand at */
+                                                       /* CS0 */
+#define GPMC_NAND_ECC_LP_x16_LAYOUT
+
+#define CONFIG_SYS_MAX_NAND_DEVICE     1               /* Max number of NAND */
+
+#if defined(CONFIG_CMD_NET)
+/*
+ * SMSC9220 Ethernet
+ */
+
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE     0x2C000000
+
+#endif /* (CONFIG_CMD_NET) */
+
+/* Environment information */
+#define CONFIG_BOOTDELAY               1
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "loadaddr=0x82000000\0" \
+       "console=ttyO2,115200n8\0" \
+       "mtdids=" MTDIDS_DEFAULT "\0" \
+       "mtdparts=" MTDPARTS_DEFAULT "\0" \
+       "partition=nand0,3\0"\
+       "mmcroot=/dev/mmcblk0p2 rw\0" \
+       "mmcrootfstype=ext3 rootwait\0" \
+       "nandroot=ubi0:rootfs ro\0" \
+       "nandrootfstype=ubifs\0" \
+       "nfspath=/srv/nfs\0" \
+       "tftpfilename=uImage\0" \
+       "gatewayip=0.0.0.0\0" \
+       "mmcargs=setenv bootargs console=${console} " \
+               "${mtdparts} " \
+               "root=${mmcroot} " \
+               "rootfstype=${mmcrootfstype} " \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:" \
+                       "${netmask}:${hostname}::off\0" \
+       "nandargs=setenv bootargs console=${console} " \
+               "${mtdparts} " \
+               "ubi.mtd=3 " \
+               "root=${nandroot} " \
+               "rootfstype=${nandrootfstype} " \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:" \
+                       "${netmask}:${hostname}::off\0" \
+       "netargs=setenv bootargs console=${console} " \
+               "${mtdparts} " \
+               "root=/dev/nfs rw " \
+               "nfsroot=${serverip}:${nfspath} " \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:" \
+                       "${netmask}:${hostname}::off\0" \
+       "mmcboot=echo Booting from mmc ...; " \
+               "run mmcargs; " \
+               "bootm ${loadaddr}\0" \
+       "nandboot=echo Booting from nand ...; " \
+               "run nandargs; " \
+               "nand read ${loadaddr} 100000 300000; " \
+               "bootm ${loadaddr}\0" \
+       "netboot=echo Booting from network ...; " \
+               "run netargs; " \
+               "tftp ${loadaddr} ${serverip}:${tftpfilename}; " \
+               "bootm ${loadaddr}\0" \
+       "resetenv=nand erase e0000 20000\0"\
+
+#define CONFIG_BOOTCOMMAND \
+       "run nandboot"
+
+#define CONFIG_AUTO_COMPLETE
+/*
+ * Miscellaneous configurable options
+ */
+#define CONFIG_SYS_LONGHELP            /* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+#define CONFIG_SYS_PROMPT              "DIG297# "
+#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
+                                       sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS             16      /* max number of command args */
+/* Boot Argument Buffer Size */
+#define CONFIG_SYS_BARGSIZE            (CONFIG_SYS_CBSIZE)
+
+#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)     /* memtest */
+                                                               /* works on */
+#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
+                                       0x01F00000) /* 31MB */
+
+#define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0)     /* default */
+                                                       /* load address */
+
+/*
+ * OMAP3 has 12 GP timers, they can be driven by the system clock
+ * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
+ * This rate is divided by a local divisor.
+ */
+#define CONFIG_SYS_TIMERBASE           (OMAP34XX_GPT2)
+#define CONFIG_SYS_PTV                 2       /* Divisor: 2^(PTV+1) => 8 */
+#define CONFIG_SYS_HZ                  1000
+
+/*-----------------------------------------------------------------------
+ * Stack sizes
+ *
+ * The stack sizes are set up in start.S using the settings below
+ */
+#define CONFIG_STACKSIZE       (128 << 10)     /* regular stack 128 KiB */
+#ifdef CONFIG_USE_IRQ
+#define CONFIG_STACKSIZE_IRQ   (4 << 10)       /* IRQ stack 4 KiB */
+#define CONFIG_STACKSIZE_FIQ   (4 << 10)       /* FIQ stack 4 KiB */
+#endif
+
+/*-----------------------------------------------------------------------
+ * Physical Memory Map
+ */
+#define CONFIG_NR_DRAM_BANKS   2       /* CS1 may or may not be populated */
+#define PHYS_SDRAM_1           OMAP34XX_SDRC_CS0
+#define PHYS_SDRAM_1_SIZE      (32 << 20)      /* at least 32 MiB */
+#define PHYS_SDRAM_2           OMAP34XX_SDRC_CS1
+
+/* SDRAM Bank Allocation method */
+#define SDRC_R_B_C             1
+
+/*-----------------------------------------------------------------------
+ * FLASH and environment organization
+ */
+
+/* **** PISMO SUPPORT *** */
+
+/* Configure the PISMO */
+#define PISMO1_NAND_SIZE               GPMC_SIZE_128M
+
+#define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
+
+#define CONFIG_SYS_FLASH_BASE          boot_flash_base
+
+/* Monitor at start of flash */
+#define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
+
+#define CONFIG_ENV_IS_IN_NAND
+#define SMNAND_ENV_OFFSET              0x0E0000 /* environment starts here */
+
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
+#define CONFIG_ENV_ADDR                        SMNAND_ENV_OFFSET
+
+#define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_RAM_ADDR       0x4020f800
+#define CONFIG_SYS_INIT_RAM_SIZE       0x800
+#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_INIT_RAM_ADDR + \
+                                        CONFIG_SYS_INIT_RAM_SIZE - \
+                                        GENERATED_GBL_DATA_SIZE)
+
+#endif /* __CONFIG_H */
index e7fd0f7f9c4f248ab05d479ceb4908fef902789c..c738b3ab4444d1833328692738da6d4c9d5728a1 100644 (file)
 #if defined(CONFIG_DIGSY_REV5)
 #define CONFIG_SYS_I2C_RTC_ADDR        0x56
 #define CONFIG_RTC_RV3029
+/* Enable 5k Ohm trickle charge resistor */
+#define CONFIG_SYS_RV3029_TCR  0x20
 #else
 #define CONFIG_RTC_DS1337
 #define CONFIG_SYS_I2C_RTC_ADDR        0x68
  */
 #define CONFIG_MPC5xxx_FEC     1
 #define CONFIG_MPC5xxx_FEC_MII100
+#if defined(CONFIG_DIGSY_REV5)
+#define CONFIG_PHY_ADDR                0x01
+#else
 #define CONFIG_PHY_ADDR                0x00
+#endif
 #define CONFIG_PHY_RESET_DELAY 1000
 
 #define CONFIG_NETCONSOLE              /* include NetConsole support   */
index 638af5e33e1ab51c800f27860f0596b9c278b4a1..b400d0acf9cb5b26f36a8c8fd67694e30340da52 100644 (file)
@@ -47,6 +47,7 @@
 #define CONFIG_SYS_NO_FLASH            /* Declare no flash (NOR/SPI) */
 #include <config_cmd_default.h>
 #define CONFIG_CMD_AUTOSCRIPT
+#define CONFIG_CMD_I2C
 #undef CONFIG_CMD_NET
 #undef CONFIG_CMD_NFS
 /*
@@ -56,6 +57,7 @@
 #include "mv-common.h"
 
 #undef CONFIG_ARCH_MISC_INIT
+
 /*
  * Environment variables configurations
  */
index f7609d71a95d3adb57b3645e13ae7ed597a8d950..4fc5262bc17ea86b33af686c6c60b6b8426e4c41 100644 (file)
 
 #define CONFIG_SYS_CLK_FREQ    33333333 /* external frequency to pll   */
 
+#undef CONFIG_ZERO_BOOTDELAY_CHECK     /* ignore keypress on bootdelay==0 */
+#define CONFIG_AUTOBOOT_KEYED          /* use key strings to stop autoboot */
+#define CONFIG_AUTOBOOT_STOP_STR " "
+
 /*
  * Configure PLL
  */
 
 /* Temp sensor/hwmon/dtt */
 #define CONFIG_DTT_LM63                1       /* National LM63        */
-#define CONFIG_DTT_SENSORS     { 0 }   /* Sensor addresses     */
+#define CONFIG_DTT_SENSORS     { 0x4c, 0x4e }  /* Sensor addresses     */
 #define CONFIG_DTT_PWM_LOOKUPTABLE     \
-               { { 40, 10 }, { 50, 20 }, { 60, 40 } }
+               { { 40, 10 }, { 43, 13 }, { 46, 16 },  \
+                 { 50, 20 }, { 53, 27 }, { 56, 34 }, { 60, 40 } }
 #define CONFIG_DTT_TACH_LIMIT  0xa10
 
 /* EBC peripherals */
 #define CONFIG_SYS_LATCH1_RESET                0xffcf
 #define CONFIG_SYS_LATCH1_BOOT         0xffff
 
+#define CONFIG_SYS_FPGA_NO_RFL_HI
+
 /*
  * FLASH organization
  */
  * OSD Setup
  */
 #define CONFIG_SYS_ICS8N3QV01
+#define CONFIG_SYS_MPC92469AC
 #define CONFIG_SYS_SIL1178
 #define CONFIG_SYS_OSD_SCREENS         CONFIG_SYS_FPGA_COUNT
 
diff --git a/include/configs/dnp5370.h b/include/configs/dnp5370.h
new file mode 100644 (file)
index 0000000..6b328a5
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * U-boot - Configuration file for SSV DNP5370 board
+ */
+
+#ifndef __CONFIG_DNP5370_H__
+#define __CONFIG_DNP5370_H__
+
+/* this must come first */
+#include <asm/config-pre.h>
+
+/*
+ * Processor Settings
+ */
+#define CONFIG_BFIN_CPU       bf537-0.3
+#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
+
+/*
+ * Clock Settings
+ *     CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
+ *     SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
+ */
+#define CONFIG_CLKIN_HZ                 25000000
+#define CONFIG_CLKIN_HALF               0
+#define CONFIG_PLL_BYPASS               0
+#define CONFIG_VCO_MULT                 24
+#define CONFIG_CCLK_DIV                 1
+#define CONFIG_SCLK_DIV                 5
+
+/*
+ * Memory Settings
+ */
+#define CONFIG_MEM_ADD_WDTH     9
+#define CONFIG_MEM_SIZE         32
+
+#define CONFIG_EBIU_SDRRC_VAL   0x03a0
+#define CONFIG_EBIU_SDBCTL_VAL  0x0013
+#define CONFIG_EBIU_SDGCTL_VAL  0x8091998d
+
+#define CONFIG_EBIU_AMGCTL_VAL  0xF7
+#define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0
+#define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0
+
+#define CONFIG_SYS_MONITOR_LEN  (256 * 1024)
+#define CONFIG_SYS_MALLOC_LEN   (128 * 1024)
+
+/*
+ * Network Settings
+ */
+#ifndef __ADSPBF534__
+#define CONFIG_ROOTPATH        /romfs
+
+#define CONFIG_NET_MULTI        1
+#define CONFIG_BFIN_MAC         1
+#define CONFIG_PHY_ADDR         0
+#define CONFIG_RMII             1
+
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#endif
+
+/*
+ * Flash Settings
+ *
+ * Only 3 MB of the 4 MB NOR flash are addressable.
+ * But limiting the flash size does not seem to work.
+ * It seems the CFI detection has precedence.
+ */
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_SYS_FLASH_BASE       0x20000000
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_MAX_FLASH_BANKS  1
+#define CONFIG_SYS_MAX_FLASH_SECT   71 /* (M29W320EB) */
+
+/* 512k reserved for u-boot */
+#define CONFIG_SYS_JFFS2_FIRST_SECTOR 15
+
+/*
+ * Env Storage Settings
+ */
+#define CONFIG_ENV_IS_IN_FLASH     1
+#define CONFIG_ENV_ADDR       0x20004000
+#define CONFIG_ENV_SIZE       0x00002000
+#define CONFIG_ENV_SECT_SIZE  0x00002000 /* Total Size of Environment Sector */
+#define CONFIG_ENV_OFFSET     0x00004000 /* (CONFIG_ENV_ADDR - CONFIG_FLASH_BASE) */
+
+#define ENV_IS_EMBEDDED
+#define LDS_BOARD_TEXT \
+       arch/blackfin/lib/libblackfin.o (.text*); \
+       arch/blackfin/cpu/libblackfin.o (.text*); \
+       . = DEFINED(env_offset) ? env_offset : .; \
+       common/env_embedded.o (.text*);
+
+/*
+ * Misc Settings
+ */
+#define CONFIG_CMD_GPIO
+#define CONFIG_CMD_STRINGS
+#define CONFIG_MISC_INIT_R
+#define CONFIG_RTC_BFIN
+#define CONFIG_SYS_LONGHELP
+
+/* This disables the hardware watchdog (not inside the bfin) */
+#define CONFIG_DNP5370_EXT_WD_DISABLE 1
+
+#define CONFIG_UART_CONSOLE 0
+#define CONFIG_BAUDRATE     115200
+#define CONFIG_BOOTCOMMAND  "bootm 0x20030000"
+#define CONFIG_BOOTARGS     "console=ttyBF0,115200 root=/dev/mtdblock3 rootfstype=ext2"
+
+/* Convenience commands to update Linux in NOR flash */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "fetchme=tftpboot 0x01000000 uImage;" \
+               "iminfo\0" \
+       "flashme=protect off 0x20030000 0x2003ffff;" \
+               "erase 0x20030000 0x202effff;" \
+               "cp.b 0x01000000 0x20030000 0x2c0000\0" \
+       "runme=bootm 0x01000000\0"
+
+/* this sets up the default list of enabled commands */
+#include <config_cmd_default.h>
+
+#ifndef CONFIG_BFIN_MAC
+# undef CONFIG_CMD_NET
+# undef CONFIG_CMD_NFS
+#endif
+
+#endif
index 34a9d6866ffaf0ae2508f57c41949d6cd9422984..548d52c6a00fa2141412c2d5c490c16ab1a8c0dc 100644 (file)
@@ -33,7 +33,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_X86
 #define CONFIG_SYS_SC520
 #define CONFIG_SYS_SC520_SSI
 #define CONFIG_SHOW_BOOT_PROGRESS
 /*-----------------------------------------------------------------------
  * Memory organization:
  * 32kB Stack
+ * 16kB Cache-As-RAM @ 0x19200000
  * 256kB Monitor
+ * (128kB + Environment Sector Size) malloc pool
  */
-#define CONFIG_SYS_STACK_SIZE                  0x8000
+#define CONFIG_SYS_STACK_SIZE                  (32 * 1024)
 #define CONFIG_SYS_CAR_ADDR                    0x19200000
-#define CONFIG_SYS_CAR_SIZE                    0x00004000
+#define CONFIG_SYS_CAR_SIZE                    (16 * 1024)
 #define CONFIG_SYS_INIT_SP_ADDR                        (CONFIG_SYS_CAR_ADDR + \
                                                 CONFIG_SYS_CAR_SIZE)
 #define CONFIG_SYS_MONITOR_BASE                        CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_MONITOR_LEN                 (256 * 1024)
-#define CONFIG_SYS_MALLOC_LEN                  (CONFIG_ENV_SIZE + 128*1024)
+#define CONFIG_SYS_MALLOC_LEN                  (CONFIG_ENV_SECT_SIZE + \
+                                                128*1024)
 /* Address of temporary Global Data */
 #define CONFIG_SYS_INIT_GD_ADDR                        CONFIG_SYS_CAR_ADDR
 
 #define CONFIG_SYS_FLASH_LEGACY_512Kx8
 #define CONFIG_SYS_FLASH_ERASE_TOUT            2000    /* ms */
 #define CONFIG_SYS_FLASH_WRITE_TOUT            2000    /* ms */
+
 /*-----------------------------------------------------------------------
  * Environment configuration
+ * - Boot flash is 512kB with 64kB sectors
+ * - StrataFlash is 32MB with 128kB sectors
+ * - Redundant embedded environment is 25% of the Boot flash
+ * - Redundant StrataFlash environment is <1% of the StrataFlash
+ * - Environment is therefore located in StrataFlash
+ * - Primary copy is located in first sector of first flash
+ * - Redundant copy is located in second sector of first flash
+ * - Stack is only 32kB, so environment size is limited to 4kB
  */
 #define CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_ENV_SECT_SIZE                   0x20000
-#define CONFIG_ENV_SIZE                                CONFIG_ENV_SECT_SIZE
+#define CONFIG_ENV_SIZE                                0x01000
 #define CONFIG_ENV_ADDR                                CONFIG_SYS_FLASH_BASE_1
-/* Redundant Copy */
 #define CONFIG_ENV_ADDR_REDUND                 (CONFIG_SYS_FLASH_BASE_1 + \
                                                 CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND                 CONFIG_ENV_SECT_SIZE
+#define CONFIG_ENV_SIZE_REDUND                 CONFIG_ENV_SIZE
 
 /*-----------------------------------------------------------------------
  * PCI configuration
index a75f06aa5950d7c940a933b92d4c3511476332cd..19b654444ccdd72b91a66df7ee432a56969f8eb3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Albert ARIBAUD <albert.aribaud@free.fr>
+ * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
  *
  * Based on original Kirkwood support which is
  * (C) Copyright 2009
index 1424347aad84cbcd3d419c54773a7871564f22af..571c3cb729da1847579f8c02fe2d1e050f1e9bee 100644 (file)
@@ -66,6 +66,8 @@
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
 
+#define CONFIG_OF_LIBFDT               1
+
 /*
  * Size of malloc() pool
  */
index d004f319da81ada1c831269d701afb20c43da0d3..34bd899174b3a61cff43891d6458edf55f05c043 100644 (file)
@@ -46,4 +46,5 @@
 #define CONFIG_MACH_TYPE               MACH_TYPE_HARMONY
 #define CONFIG_SYS_BOARD_ODMDATA       0x300d8011 /* lp1, 1GB */
 
+#define CONFIG_BOARD_EARLY_INIT_F
 #endif /* __CONFIG_H */
index e2dbbb151b8ef4f8711462ae2887b9c83deb71b0..055f8a0f4ec8d588d5e934c73c1c9504ea562f65 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf561-0.5
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
@@ -79,8 +80,8 @@
 #define CONFIG_SYS_MAX_FLASH_SECT      135     /* max number of sectors on one chip */
 /* The BF561-EZKIT uses a top boot flash */
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_ADDR                0x20004000
-#define CONFIG_ENV_OFFSET              (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)
+#define CONFIG_ENV_OFFSET              0x4000
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
 #define CONFIG_ENV_SIZE                0x2000
 #define CONFIG_ENV_SECT_SIZE   0x10000 /* Total Size of Environment Sector */
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
index c19ecc0e4b298571318689b230a5626a967538dc..5af9bec8f4435e8816f7ddd6ddeb84a362f3f85e 100644 (file)
@@ -53,6 +53,8 @@
 #define CONFIG_INITRD_TAG              1
 #define CONFIG_REVISION_TAG            1
 
+#define CONFIG_OF_LIBFDT               1
+
 /*
  * NS16550 Configuration
  */
  */
 #define CONFIG_TWL4030_POWER           1
 
-/* Environment information */
-#define CONFIG_BOOTCOMMAND \
-       "mmc init 0 ; fatload mmc 0 0x80000000 setup.ini ; source \0"
-
 #define CONFIG_BOOTDELAY               3
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-       "usbtty=cdc_acm\0"
+       "usbtty=cdc_acm\0" \
+       "loadaddr=0x82000000\0" \
+       "usbtty=cdc_acm\0" \
+       "console=ttyS2,115200n8\0" \
+       "mpurate=500\0" \
+       "vram=12M\0" \
+       "dvimode=1024x768MR-16@60\0" \
+       "defaultdisplay=dvi\0" \
+       "mmcdev=0\0" \
+       "mmcroot=/dev/mmcblk0p2 rw\0" \
+       "mmcrootfstype=ext3 rootwait\0" \
+       "nandroot=/dev/mtdblock4 rw\0" \
+       "nandrootfstype=jffs2\0" \
+       "mmcargs=setenv bootargs console=${console} " \
+               "mpurate=${mpurate} " \
+               "vram=${vram} " \
+               "omapfb.mode=dvi:${dvimode} " \
+               "omapfb.debug=y " \
+               "omapdss.def_disp=${defaultdisplay} " \
+               "root=${mmcroot} " \
+               "rootfstype=${mmcrootfstype}\0" \
+       "nandargs=setenv bootargs console=${console} " \
+               "mpurate=${mpurate} " \
+               "vram=${vram} " \
+               "omapfb.mode=dvi:${dvimode} " \
+               "omapfb.debug=y " \
+               "omapdss.def_disp=${defaultdisplay} " \
+               "root=${nandroot} " \
+               "rootfstype=${nandrootfstype}\0" \
+       "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+       "bootscript=echo Running bootscript from mmc ...; " \
+               "source ${loadaddr}\0" \
+       "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+       "mmcboot=echo Booting from mmc ...; " \
+               "run mmcargs; " \
+               "bootm ${loadaddr}\0" \
+       "nandboot=echo Booting from onenand ...; " \
+               "run nandargs; " \
+               "onenand read ${loadaddr} 280000 400000; " \
+               "bootm ${loadaddr}\0" \
+
+#define CONFIG_BOOTCOMMAND \
+       "if mmc rescan ${mmcdev}; then " \
+               "if run loadbootscript; then " \
+                       "run bootscript; " \
+               "else " \
+                       "if run loaduimage; then " \
+                               "run mmcboot; " \
+                       "else run nandboot; " \
+                       "fi; " \
+               "fi; " \
+       "else run nandboot; fi"
 
 #define CONFIG_AUTO_COMPLETE           1
 
index 1325bfa0177147cdaa2252ee4163f767fce37e74..92144af93c4fe1d8a9a7b29837723e9b9b15c98e 100644 (file)
@@ -53,6 +53,8 @@
 #define CONFIG_INITRD_TAG              1
 #define CONFIG_REVISION_TAG            1
 
+#define CONFIG_OF_LIBFDT               1
+
 /*
  * NS16550 Configuration
  */
  */
 #define CONFIG_TWL4030_POWER           1
 
-/* Environment information */
-#define CONFIG_BOOTCOMMAND \
-       "mmc init 0 ; fatload mmc 0 0x80000000 setup.ini ; source \0"
-
 #define CONFIG_BOOTDELAY               3
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-       "usbtty=cdc_acm\0"
+       "usbtty=cdc_acm\0" \
+       "loadaddr=0x82000000\0" \
+       "usbtty=cdc_acm\0" \
+       "console=ttyS2,115200n8\0" \
+       "mpurate=500\0" \
+       "vram=12M\0" \
+       "dvimode=1024x768MR-16@60\0" \
+       "defaultdisplay=dvi\0" \
+       "mmcdev=0\0" \
+       "mmcroot=/dev/mmcblk0p2 rw\0" \
+       "mmcrootfstype=ext3 rootwait\0" \
+       "nandroot=/dev/mtdblock4 rw\0" \
+       "nandrootfstype=jffs2\0" \
+       "mmcargs=setenv bootargs console=${console} " \
+               "mpurate=${mpurate} " \
+               "vram=${vram} " \
+               "omapfb.mode=dvi:${dvimode} " \
+               "omapfb.debug=y " \
+               "omapdss.def_disp=${defaultdisplay} " \
+               "root=${mmcroot} " \
+               "rootfstype=${mmcrootfstype}\0" \
+       "nandargs=setenv bootargs console=${console} " \
+               "mpurate=${mpurate} " \
+               "vram=${vram} " \
+               "omapfb.mode=dvi:${dvimode} " \
+               "omapfb.debug=y " \
+               "omapdss.def_disp=${defaultdisplay} " \
+               "root=${nandroot} " \
+               "rootfstype=${nandrootfstype}\0" \
+       "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+       "bootscript=echo Running bootscript from mmc ...; " \
+               "source ${loadaddr}\0" \
+       "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+       "mmcboot=echo Booting from mmc ...; " \
+               "run mmcargs; " \
+               "bootm ${loadaddr}\0" \
+       "nandboot=echo Booting from onenand ...; " \
+               "run nandargs; " \
+               "onenand read ${loadaddr} 280000 400000; " \
+               "bootm ${loadaddr}\0" \
+
+#define CONFIG_BOOTCOMMAND \
+       "if mmc rescan ${mmcdev}; then " \
+               "if run loadbootscript; then " \
+                       "run bootscript; " \
+               "else " \
+                       "if run loaduimage; then " \
+                               "run mmcboot; " \
+                       "else run nandboot; " \
+                       "fi; " \
+               "fi; " \
+       "else run nandboot; fi"
 
 #define CONFIG_AUTO_COMPLETE           1
 
index 50236380704236b079baef9f4fdd1689b22a1c11..9405f562c4b34a78dc234fca76147972e9cd88b9 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 
  /* High Level Configuration Options */
 #define CONFIG_ARM1136         1    /* This is an arm1136 CPU core */
index d8fcbdb42199f3a5ec520b12935a22b6cde7609e..744d65c6e4d6e898c6402311d3d8c0128951d00a 100644 (file)
 /*
  * I2C bus
  */
+#define CONFIG_I2C_MV                  1
+#define CONFIG_MV_I2C_REG              0x40301680
 #define CONFIG_HARD_I2C                        1
 #define CONFIG_SYS_I2C_SPEED                   50000
 #define CONFIG_SYS_I2C_SLAVE                   0xfe
index 528363c6b492adb48d139e47b98d7a703cc29b6f..c024d78c18ac8a2bc972019a5e8f364be6774da2 100644 (file)
@@ -20,6 +20,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf532-0.5
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_NAND
 
 
index e3bd264a80bab29e20264d2a64f93cf267890bab..cb6d0fb6c8d8d67abacbae011b53a2af0e1520b6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2008
+ * (C) Copyright 2008-2011
  * Heiko Schocher, DENX Software Engineering, hs@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -25,7 +25,8 @@
 #define __CONFIG_KEYMILE_H
 
 /* Do boardspecific init for all boards */
-#define CONFIG_BOARD_EARLY_INIT_R       1
+#define CONFIG_BOARD_EARLY_INIT_R
+#define CONFIG_LAST_STAGE_INIT
 
 #define CONFIG_BOOTCOUNT_LIMIT
 
 #define        CONFIG_SYS_KWD_CONFIG   $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
 #endif /* CONFIG_SYS_KWD_CONFIG */
 
-/*
- * CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if needed
- */
-#ifndef CONFIG_SYS_TEXT_BASE
-#define        CONFIG_SYS_TEXT_BASE    0x00400000
-#endif /* CONFIG_SYS_TEXT_BASE */
-
 /*
  * Command line configuration.
  */
 #define CONFIG_CMD_IMMAP
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
-#define CONFIG_CMD_DTT
 #define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_JFFS2
-#define CONFIG_JFFS2_CMDLINE
 #define CONFIG_CMD_MTDPARTS
+#define CONFIG_CMD_SETEXPR
 
-#undef CONFIG_WATCHDOG                 /* disable platform specific watchdog */
+#undef CONFIG_WATCHDOG         /* disable platform specific watchdog */
 
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
-#undef CONFIG_BOOTARGS                 /* the boot command will set bootargs */
+#define CONFIG_BOOTDELAY       2 /* autoboot after 2 seconds */
+#undef CONFIG_BOOTARGS         /* the boot command will set bootargs */
 
 /*
  * Miscellaneous configurable options
  */
 #define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory     */
-#define CONFIG_SYS_PROMPT              "=> "   /* Monitor Command Prompt   */
+#define CONFIG_SYS_LONGHELP                    /* undef to save memory   */
+#define CONFIG_SYS_PROMPT              "=> "   /* Monitor Command Prompt */
 #if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size  */
+#define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size */
 #else
-#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size  */
+#define CONFIG_SYS_CBSIZE              512     /* Console I/O Buffer Size  */
 #endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)     /* Print Buffer Size  */
-#define CONFIG_SYS_MAXARGS             16      /* max number of command args */
-#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE       /* Boot Argument Buffer Size  */
-#define CONFIG_CMDLINE_EDITING         1       /* add command line history     */
-#define CONFIG_AUTO_COMPLETE           /* add autocompletion support   */
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
+#define CONFIG_SYS_MAXARGS             32 /* max number of command args */
+#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_AUTO_COMPLETE
 
-#define CONFIG_HUSH_INIT_VAR   1
+#define CONFIG_HUSH_INIT_VAR
 
 #define CONFIG_SYS_ALT_MEMTEST         /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00100000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00f00000      /* 1 ... 15 MB in DRAM  */
-
-#define CONFIG_SYS_LOAD_ADDR           0x100000        /* default load address */
 
-#define CONFIG_SYS_HZ                  1000    /* decrementer freq: 1 ms ticks */
+#define CONFIG_SYS_HZ                  1000    /* decr. freq: 1 ms ticks */
 
-#define CONFIG_BAUDRATE                115200
+#define CONFIG_BAUDRATE                        115200
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
 
-#define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   1       /* allow baudrate change */
+#define CONFIG_LOADS_ECHO
+#define CONFIG_SYS_LOADS_BAUD_CHANGE
 #define CONFIG_SYS_BOARD_DRAM_INIT     /* Used board specific dram_init */
 
 /*
  * to modify in a centralized location.  This is used in the HDLC
  * driver to set the MAC.
 */
-#define CONFIG_CHECK_ETHERNET_PRESENT  1
-#define CONFIG_SYS_SLOT_ID_BASE                CONFIG_SYS_PIGGY_BASE
+#define CONFIG_CHECK_ETHERNET_PRESENT
+#define CONFIG_SYS_SLOT_ID_BASE                CONFIG_SYS_KMBEC_FPGA_BASE
 #define CONFIG_SYS_SLOT_ID_OFF         (0x07)  /* register offset */
 #define CONFIG_SYS_SLOT_ID_MASK                (0x3f)  /* mask for slot ID bits */
 
-#define CONFIG_I2C_MULTI_BUS   1
+#define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_MAX_I2C_BUS         1
-#define CONFIG_SYS_I2C_INIT_BOARD      1
-#define CONFIG_I2C_MUX         1
+#define CONFIG_SYS_I2C_INIT_BOARD
+#define CONFIG_I2C_MUX
 
 /* EEprom support */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS   1
+#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      3
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10
 
 /* Support the IVM EEprom */
 #define        CONFIG_SYS_IVM_EEPROM_ADR       0x50
 #define CONFIG_SYS_IVM_EEPROM_MAX_LEN  0x400
 #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
 
-#define        CONFIG_SYS_FLASH_PROTECTION 1
+#define        CONFIG_SYS_FLASH_PROTECTION
 
 /*
  * BOOTP options
 #define CONFIG_BOOTP_GATEWAY
 #define CONFIG_BOOTP_HOSTNAME
 
-#define CONFIG_ENV_SIZE                0x04000 /* Size of Environment */
-
-#define CONFIG_SYS_MALLOC_LEN  (4 * 1024 * 1024)
+#define CONFIG_SYS_MALLOC_LEN          (4 * 1024 * 1024)
 
 /* UBI Support for all Keymile boards */
 #define CONFIG_CMD_UBI
 #define CONFIG_RBTREE
 #define CONFIG_MTD_PARTITIONS
-#define CONFIG_FLASH_CFI_MTD
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_CONCAT
 
-/* define this to use the keymile's io muxing feature */
-/*#define CONFIG_IO_MUXING */
-
-#ifdef CONFIG_IO_MUXING
-#define        CONFIG_KM_DEF_ENV_IOMUX \
-       "nc=setenv ethact HDLC \0" \
-       "nce=setenv ethact SCC \0"      \
-       "stderr=serial,nc \0"   \
-       "stdin=serial,nc \0" \
-       "stdout=serial,nc \0" \
-       "tftpsrcp=69 \0" \
-       "tftpdstp=69 \0"
-#else
-#define        CONFIG_KM_DEF_ENV_IOMUX \
-       "stderr=serial \0" \
-       "stdin=serial \0"        \
-       "stdout=serial \0"
+/* common powerpc specific env settings */
+#ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
+#define CONFIG_KM_DEF_ENV_BOOTPARAMS \
+       "bootparams=empty\0"    \
+       "initial_boot_bank=0\0"
 #endif
 
-#ifndef CONFIG_KM_DEF_ENV_PRIVATE
-#define        CONFIG_KM_DEF_ENV_PRIVATE \
-       "kmprivate=empty\0"
+#ifndef CONFIG_KM_DEF_NETDEV
+#define CONFIG_KM_DEF_NETDEV   \
+       "netdev=eth0\0"
+#endif
+
+#ifndef CONFIG_KM_UBI_PARTITION_NAME
+#define CONFIG_KM_UBI_PARTITION_NAME   "ubi0"
+#endif
+#ifndef CONFIG_KM_UBI_LINUX_MTD_NAME
+#define CONFIG_KM_UBI_LINUX_MTD_NAME   "ubi0"
 #endif
 
 #define xstr(s)        str(s)
 #define str(s) #s
 
+/*
+ * bootrunner
+ * - run all commands in 'subbootcmds'
+ * - on error, stop running the remaing commands
+ */
+#define CONFIG_KM_DEF_ENV_BOOTRUNNER                                   \
+       "bootrunner="                                                   \
+               "break=0; "                                             \
+               "for subbootcmd in ${subbootcmds}; do "                 \
+               "if test ${break} -eq 0; then; "                        \
+               "echo \"[INFO] running \\c\"; "                         \
+               "print ${subbootcmd}; "                                 \
+               "run ${subbootcmd} || break=1; "                        \
+               "if test ${break} -eq 1; then; "                        \
+               "echo \"[ERR] failed \\c\"; "                           \
+               "print ${subbootcmd}; "                                 \
+               "fi; "                                                  \
+               "fi; "                                                  \
+               "done\0"                                                \
+       ""
+
+/*
+ * boottargets
+ * - set 'subbootcmds' for the bootrunner
+ * - set 'bootcmd' and 'altbootcmd'
+ * available targets:
+ * - 'release': for a standalone system                kernel/rootfs from flash
+ * - 'develop': for development                        kernel(tftp)/rootfs(NFS)
+ * - 'ramfs': rootfilesystem in RAM            kernel(tftp)/rootfs(RAM)
+ *
+ * - 'commonargs': bootargs common to all targets
+ */
+#define CONFIG_KM_DEF_ENV_BOOTTARGETS                                  \
+       "commonargs="                                                   \
+               "addip "                                                \
+               "addtty "                                               \
+               "addmem "                                               \
+               "addinit "                                              \
+               "addvar "                                               \
+               "addmtdparts "                                          \
+               "addbootcount "                                         \
+               "\0"                                                    \
+       "develop="                                                      \
+               "setenv subbootcmds \""                                 \
+               "tftpfdt tftpkernel "                                   \
+               "nfsargs ${commonargs} "                                \
+               "printbootargs boot "                                   \
+               "\" && "                                                \
+               "setenv bootcmd \'"                                     \
+               "run bootrunner"                                        \
+               "\' && "                                                \
+               "setenv altbootcmd \'"                                  \
+               "run bootcmd"                                           \
+               "\' && "                                                \
+               "run setboardid && "                                    \
+               "saveenv && "                                           \
+               "reset\0"                                               \
+       "ramfs="                                                        \
+               "setenv actual_bank -1 && "                             \
+               "setenv subbootcmds \""                                 \
+               "tftpfdt tftpkernel "                                   \
+               "setrootfsaddr tftpramfs "                              \
+               "flashargs ${commonargs} "                              \
+               "addpanic addramfs "                                    \
+               "printbootargs boot "                                   \
+               "\" && "                                                \
+               "setenv bootcmd \'"                                     \
+               "run bootrunner"                                        \
+               "\' && "                                                \
+               "setenv altbootcmd \'"                                  \
+               "run bootcmd"                                           \
+               "\' && "                                                \
+               "run setboardid && "                                    \
+               "run setramfspram && "                                  \
+               "saveenv && "                                           \
+               "reset\0"                                               \
+       "release="                                                      \
+               "setenv actual_bank ${initial_boot_bank} && "           \
+               "setenv subbootcmds \""                                 \
+               "checkboardidlist "                                     \
+               "checkboardid "                                         \
+               "ubiattach ubicopy "                                    \
+               "cramfsloadfdt cramfsloadkernel "                       \
+               "flashargs ${commonargs} "                              \
+               "addpanic "                                             \
+               "printbootargs boot "                                   \
+               "\" && "                                                \
+               "setenv bootcmd \'"                                     \
+               "run bootrunner; reset"                                 \
+               "\' && "                                                \
+               "setenv altbootcmd \'"                                  \
+               "run actual0 bootcmd; reset"                            \
+               "\' && "                                                \
+               "saveenv && "                                           \
+               "reset\0"                                               \
+       ""
+
+/*
+ * bootargs
+ * - modify 'bootargs'
+ *
+ * - 'addip': add ip configuration
+ * - 'addmem': limit kernel memory mem=
+ * - 'addpanic': add kernel panic options
+ * - 'addramfs': add phram device for the rootfilesysten in ram
+ * - 'addtty': add console=...
+ * - 'addvar': add phram device for /var
+ * - 'nfsargs': default arguments for nfs boot
+ * - 'flashargs': defaults arguments for flash base boot
+ *
+ * processor specific settings
+ * - 'addbootcount': add boot counter
+ * - 'addmtdparts': add mtd partition information
+ */
+#define CONFIG_KM_DEF_ENV_BOOTARGS                                     \
+       "addinit="                                                      \
+               "setenv bootargs ${bootargs} init=${init}\0"            \
+       "addip="                                                        \
+               "setenv bootargs ${bootargs} "                          \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
+               ":${hostname}:${netdev}:off\0"                          \
+       "addmem="                                                       \
+               "setenv bootargs ${bootargs} mem=0x${pnvramaddr}\0"     \
+       "addpanic="                                                     \
+               "setenv bootargs ${bootargs} "                          \
+               "panic=1 panic_on_oops=1\0"                             \
+       "addramfs="                                                     \
+               "setenv bootargs \""                                    \
+               "${bootargs} phram.phram="                              \
+               "rootfs${actual_bank},${rootfsaddr},${rootfssize}\"\0"  \
+       "addtty="                                                       \
+               "setenv bootargs ${bootargs}"                           \
+               " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}\0"      \
+       "addvar="                                                       \
+               "setenv bootargs ${bootargs} phram.phram=phvar,"        \
+               "${varaddr},0x" xstr(CONFIG_KM_PHRAM) "\0"              \
+       "nfsargs="                                                      \
+               "setenv bootargs "                                      \
+               "ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " "             \
+               "root=/dev/nfs rw "                                     \
+               "nfsroot=${serverip}:${rootpath}\0"                     \
+       "flashargs="                                                    \
+               "setenv bootargs "                                      \
+               "ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " "             \
+               "root=mtdblock:rootfs${actual_bank} "                   \
+               "rootfstype=squashfs ro\0"                              \
+       ""
+
+/*
+ * compute_addr
+ * - compute addresses and sizes
+ * - addresses are calculated form the end of memory 'memsize'
+ *
+ * - 'setramfspram': compute PRAM size for ramfs target
+ * - 'setrootfsaddr': compute rootfilesystem address for phram
+ */
+#define CONFIG_KM_DEF_ENV_COMPUTE_ADDR                                 \
+       "setboardid="                                                   \
+               "if test \"x${boardId}\" = \"x\"; then; "               \
+               "setenv boardId ${IVM_BoardId} && "                     \
+               "setenv hwKey ${IVM_HWKey}; "                           \
+               "else; "                                                \
+               "echo \\\\c; "                                          \
+               "fi\0"                                                  \
+       "setramfspram="                                                 \
+               "setexpr value ${rootfssize} / 0x400 && "               \
+               "setexpr value 0x${value} + ${pram} && "                \
+               "setenv pram 0x${value}\0"                              \
+       "setrootfsaddr="                                                \
+               "setexpr value ${pnvramaddr} - ${rootfssize} && "       \
+               "setenv rootfsaddr 0x${value}\0"                        \
+       ""
+
+/*
+ * flash_boot
+ * - commands for booting from flash
+ *
+ * - 'cramfsaddr': address to the cramfs (in ram)
+ * - 'cramfsloadkernel': copy kernel from a cramfs to ram
+ * - 'ubiattach': attach ubi partition
+ * - 'ubicopy': copy ubi volume to ram
+ *              - volume names: bootfs0, bootfs1, bootfs2, ...
+ * - 'ubiparition': mtd parition name for ubi
+ *
+ * processor specific settings
+ * - 'cramfsloadfdt': copy fdt from a cramfs to ram
+ */
+#define CONFIG_KM_DEF_ENV_FLASH_BOOT                                   \
+       "cramfsaddr="xstr(CONFIG_KM_CRAMFS_ADDR) "\0"                   \
+       "cramfsloadkernel="                                             \
+               "cramfsload ${kernel_addr_r} uImage && "                \
+               "setenv actual_kernel_addr ${kernel_addr_r}\0"          \
+       "ubiattach=ubi part ${ubipartition}\0"                          \
+       "ubicopy=ubi read ${cramfsaddr} bootfs${actual_bank}\0"         \
+       "ubipartition=" CONFIG_KM_UBI_PARTITION_NAME "\0"               \
+       ""
+
+/*
+ * net_boot
+ * - commands for booting over the network
+ *
+ * - 'tftpkernel': load a kernel with tftp into ram
+ * - 'tftpramfs': load rootfs with tftp into ram
+ *
+ * processor specific settings
+ * - 'tftpfdt': load fdt with tftp into ram
+ */
+#define CONFIG_KM_DEF_ENV_NET_BOOT                                     \
+       "tftpkernel="                                                   \
+               "tftpboot ${kernel_addr_r} ${kernel_file} && "          \
+               "setenv actual_kernel_addr ${kernel_addr_r}\0"          \
+       "tftpramfs="                                                    \
+               "tftpboot ${rootfsaddr} \"\\\"${rootfsfile}\\\"\" && "  \
+               "setenv loadaddr\0"                                     \
+       ""
+
+/*
+ * constants
+ * - KM specific constants and commands
+ *
+ * - 'default': setup default environment
+ */
+#define CONFIG_KM_DEF_ENV_CONSTANTS                                    \
+       "actual=setenv actual_bank ${initial_boot_bank}\0"              \
+       "actual0=setenv actual_bank 0\0"                                \
+       "actual_bank=${initial_boot_bank}\0"                            \
+       "default="                                                      \
+               "setenv default 'run newenv; reset' &&  "               \
+               "run release && saveenv; reset\0"                       \
+       "checkboardidlist="                                             \
+               "if test \"x${boardIdListHex}\" != \"x\"; then "        \
+               "IVMbidhwk=${IVM_BoardId}_${IVM_HWKey}; "               \
+               "found=0; "                                             \
+               "for bidhwk in \"${boardIdListHex}\"; do "              \
+               "echo trying $bidhwk ...; "                             \
+               "if test \"x$bidhwk\" = \"x$IVMbidhwk\"; then "         \
+               "found=1; "                                             \
+               "echo match found for $bidhwk; "                        \
+               "if test \"x$bidhwk\" != \"x${boardId}_${hwKey}\";then "\
+                       "setenv boardid ${IVM_BoardId}; "               \
+                       "setenv boardId ${IVM_BoardId}; "               \
+                       "setenv hwkey ${IVM_HWKey}; "                   \
+                       "setenv hwKey ${IVM_HWKey}; "                   \
+                       "echo \"boardId set to ${boardId}\"; "          \
+                       "echo \"hwKey   set to ${hwKey}\"; "            \
+                       "saveenv; "                                     \
+               "fi; "                                                  \
+               "fi; "                                                  \
+               "done; "                                                \
+               "else "                                                 \
+                       "echo \"boardIdListHex not set, not checked\"; "\
+                       "found=1; "                                     \
+               "fi; "                                                  \
+               "test \"$found\" = 1 \0"                                \
+       "checkboardid="                                                 \
+               "test \"x${boardId}\" = \"x${IVM_BoardId}\" && "        \
+               "test \"x${hwKey}\" = \"x${IVM_HWKey}\"\0"              \
+       "printbootargs=print bootargs\0"                                \
+       "rootfsfile="xstr(CONFIG_HOSTNAME) "/rootfsImage\0"             \
+       ""
+
 #ifndef CONFIG_KM_DEF_ENV
 #define CONFIG_KM_DEF_ENV      \
-       "netdev=eth0\0"                                                 \
-       "u-boot_addr_r=100000\0"                                        \
-       "kernel_addr_r=200000\0"                                        \
-       "fdt_addr_r=600000\0"                                           \
-       "ram_ws=800000 \0"                                              \
-       "script_ws=780000 \0"                                           \
-       "fdt_file=" xstr(CONFIG_HOSTNAME) "/"                           \
-               xstr(CONFIG_HOSTNAME) ".dtb\0"                          \
-       "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.bin \0"                \
-       "kernel_file=" xstr(CONFIG_HOSTNAME) "/uImage \0"               \
-       "load=tftp ${u-boot_addr_r} ${u-boot}\0"                        \
-       "update=protect off " xstr(BOOTFLASH_START) " +${filesize};"    \
-               "erase " xstr(BOOTFLASH_START) "  +${filesize};"        \
-               "cp.b ${u-boot_addr_r} " xstr(BOOTFLASH_START)          \
-               "  ${filesize};"                                        \
-               "protect on " xstr(BOOTFLASH_START) "  +${filesize}\0"  \
-       "load_fdt=tftp ${fdt_addr_r} ${fdt_file}; "                     \
-               "setenv actual_fdt_addr ${fdt_addr_r} \0"               \
-       "load_kernel=tftp ${kernel_addr_r} ${kernel_file}; "            \
-               "setenv actual_kernel_addr ${kernel_addr_r} \0"         \
-       "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
-       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
-               "nfsroot=${serverip}:${rootpath}\0"                     \
-       "mtdargs=setenv bootargs root=${actual_rootfs} rw "             \
-               "rootfstype=jffs2 \0"                                   \
-       "altmtdargs=setenv bootargs root=${backup_rootfs} rw "          \
-               "rootfstype=jffs2 \0"                                   \
-       "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"              \
-       "addip=setenv bootargs ${bootargs} "                            \
-               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
-               ":${hostname}:${netdev}:off panic=1\0"                  \
-       "addboardid=setenv bootargs ${bootargs} "                       \
-               "hwKey=${IVM_HWKey} boardId=0x${IVM_BoardId} \0"        \
-       "addpram=setenv bootargs ${bootargs} "                          \
-               "mem=${mem} pram=${pram}\0"                             \
-       "pram=" xstr(CONFIG_PRAM) "k\0"                                 \
-       "net_nfs=tftp ${kernel_addr_r} ${kernel_file}; "                \
-               "tftp ${fdt_addr_r} ${fdt_file}; "                      \
-               "run nfsargs addip addcon addboardid addpram;"          \
-               "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
-       "net_self=tftp ${kernel_addr_r} ${kernel_file}; "               \
-               "tftp ${fdt_addr_r} ${fdt_file}; "                      \
-               "tftp ${ramdisk_addr} ${ramdisk_file}; "                \
-               "run ramargs addip addboardid addpram; "                \
-               "bootm ${kernel_addr_r} ${ramdisk_addr} ${fdt_addr_r}\0"\
-       "flash_nfs=run nfsargs addip addcon;"                           \
-               "bootm ${kernel_addr} - ${fdt_addr}\0"                  \
-       "flash_self=run ramargs addip addcon addboardid addpram;"       \
-               "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"    \
-       "bootcmd=run mtdargs addip addcon addboardid addpram; "         \
-               "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \0"   \
-       "altbootcmd=run altmtdargs addip addcon addboardid addpram; "   \
-               "bootm ${backup_kernel_addr} - ${backup_fdt_addr} \0"   \
-       "actual0=setenv actual_bank 0; setenv actual_kernel_addr "      \
-               "${bank0_kernel_addr}; "                                \
-               "setenv actual_fdt_addr ${bank0_fdt_addr}; "            \
-               "setenv actual_rootfs ${bank0_rootfs} \0"               \
-       "actual1=setenv actual_bank 1; setenv actual_kernel_addr "      \
-               "${bank1_kernel_addr}; "                                \
-               "setenv actual_fdt_addr ${bank1_fdt_addr}; "            \
-               "setenv actual_rootfs ${bank1_rootfs} \0"               \
-       "backup0=setenv backup_bank 0; setenv backup_kernel_addr "      \
-               "${bank0_kernel_addr}; "                                \
-               "setenv backup_fdt_addr ${bank0_fdt_addr}; "            \
-               "setenv backup_rootfs ${bank0_rootfs} \0"               \
-       "backup1=setenv backup_bank 1; setenv backup_kernel_addr "      \
-               "${bank1_kernel_addr}; "                                \
-               "setenv backup_fdt_addr ${bank1_fdt_addr}; "            \
-               "setenv backup_rootfs ${bank1_rootfs} \0"               \
-       "setbank0=run actual0 backup1 \0"                               \
-       "setbank1=run actual1 backup0 \0"                               \
-       "release=setenv bootcmd "                                       \
-               "\'run mtdargs addip addcon addboardid addpram;"        \
-               "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \
-               "saveenv \0"                                            \
-       "develop=setenv bootcmd "                                       \
-               "\'run nfsargs addip addcon addboardid addpram;"        \
-               "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \
-               "saveenv \0"                                            \
-       "developall=setenv bootcmd "                                    \
-               "\'run load_fdt load_kernel nfsargs "                   \
-               "addip addcon addboardid addpram; "                     \
-               "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \
-               "saveenv \0"                                            \
-       "set_new_esw_script=setenv new_esw_script "                     \
-               "new_esw_0x${IVM_BoardId}_0x${IVM_HWKey}.scr \0"        \
-       "new_esw=run set_new_esw_script; "                              \
-               "tftp ${script_ws} ${new_esw_script}; "                 \
-               "iminfo ${script_ws}; source ${script_ws} \0"           \
-       "bootlimit=0 \0"                                                \
-       CONFIG_KM_DEF_ENV_IOMUX                                         \
-       CONFIG_KM_DEF_ENV_PRIVATE                                       \
+       CONFIG_KM_DEF_ENV_BOOTPARAMS                                    \
+       CONFIG_KM_DEF_NETDEV                                            \
+       CONFIG_KM_DEF_ENV_CPU                                           \
+       CONFIG_KM_DEF_ENV_BOOTRUNNER                                    \
+       CONFIG_KM_DEF_ENV_BOOTTARGETS                                   \
+       CONFIG_KM_DEF_ENV_BOOTARGS                                      \
+       CONFIG_KM_DEF_ENV_COMPUTE_ADDR                                  \
+       CONFIG_KM_DEF_ENV_FLASH_BOOT                                    \
+       CONFIG_KM_DEF_ENV_NET_BOOT                                      \
+       CONFIG_KM_DEF_ENV_CONSTANTS                                     \
+       "altbootcmd=run bootcmd\0"                                      \
+       "bootcmd=run default\0"                                         \
+       "bootlimit=2\0"                                                 \
+       "init=/sbin/init-overlay.sh\0"                                  \
+       "kernel_addr_r="xstr(CONFIG_KM_KERNEL_ADDR) "\0"                \
+       "kernel_file="xstr(CONFIG_HOSTNAME) "/uImage\0"                 \
+       "kernel_name=uImage\0"                                          \
+       "load=tftpboot ${u-boot_addr_r} ${u-boot}\0"                    \
+       "mtdids=" MTDIDS_DEFAULT "\0"                                   \
+       "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
+       "stderr=serial\0"                                               \
+       "stdin=serial\0"                                                \
+       "stdout=serial\0"                                               \
+       "u-boot="xstr(CONFIG_HOSTNAME) "/u-boot.bin\0"                  \
+       "u-boot_addr_r="xstr(CONFIG_KM_KERNEL_ADDR) "\0"                \
        ""
 #endif /* CONFIG_KM_DEF_ENV */
 
diff --git a/include/configs/km-powerpc.h b/include/configs/km-powerpc.h
new file mode 100644 (file)
index 0000000..3351609
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * (C) Copyright 2011
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 __CONFIG_KEYMILE_POWERPC_H
+#define __CONFIG_KEYMILE_POWERPC_H
+
+#define CONFIG_BOOTCOUNT_LIMIT
+
+#define CONFIG_CMD_DTT
+#define CONFIG_JFFS2_CMDLINE
+
+#define CONFIG_ENV_SIZE                0x04000         /* Size of Environment */
+#define CONFIG_FLASH_CFI_MTD
+
+#define CONFIG_SYS_MEMTEST_START 0x00100000    /* memtest works on */
+
+#define CONFIG_SYS_MEMTEST_END 0x00f00000      /* 1 ... 15 MB in DRAM  */
+
+#define CONFIG_SYS_LOAD_ADDR   0x100000        /* default load address */
+
+/******************************************************************************
+ * (PRAM usage)
+ * ... -------------------------------------------------------
+ * ... |ROOTFSSIZE | PNVRAM |PHRAM |RESERVED_PRAM | END_OF_RAM
+ * ... |<------------------- pram -------------------------->|
+ * ... -------------------------------------------------------
+ * @END_OF_RAM:
+ * @CONFIG_KM_RESERVED_PRAM: reserved pram for special purpose
+ * @CONFIG_KM_PHRAM: address for /var
+ * @CONFIG_KM_PNVRAM: address for PNVRAM (for the application)
+ * @CONFIG_KM_ROOTFSSIZE: address for rootfilesystem in RAM
+ */
+
+/* size of rootfs in RAM */
+#define CONFIG_KM_ROOTFSSIZE   0x0
+/* pseudo-non volatile RAM [hex] */
+#define CONFIG_KM_PNVRAM       0x80000
+/* physical RAM MTD size [hex] */
+#define CONFIG_KM_PHRAM                0x100000
+/* resereved pram area at the end of memroy [hex] */
+#define CONFIG_KM_RESERVED_PRAM        0x0
+/* enable protected RAM */
+#define CONFIG_PRAM            0
+
+#define CONFIG_KM_CRAMFS_ADDR  0x800000
+#define CONFIG_KM_KERNEL_ADDR  0x400000        /* 3968Kbytes */
+#define CONFIG_KM_FDT_ADDR     0x7E0000        /* 128Kbytes */
+
+#define CONFIG_KM_DEF_ENV_CPU                                          \
+       "addbootcount=echo \\\\c\0"                                     \
+       "addmtdparts=echo \\\\c\0"                                      \
+       "boot=bootm ${actual_kernel_addr} - ${actual_fdt_addr}\0"       \
+       "cramfsloadfdt="                                                \
+               "cramfsload ${fdt_addr_r} "                             \
+               "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb && "           \
+               "setenv actual_fdt_addr ${fdt_addr_r}\0"                \
+       "fdt_addr_r=" xstr(CONFIG_KM_FDT_ADDR) "\0"                     \
+       "fdt_file="                                                     \
+               xstr(CONFIG_HOSTNAME) "/"                               \
+               xstr(CONFIG_HOSTNAME) ".dtb\0"                          \
+       "tftpfdt="                                                      \
+               "tftpboot ${fdt_addr_r} ${fdt_file} && "                \
+               "setenv actual_fdt_addr ${fdt_addr_r} \0"               \
+       "update="                                                       \
+               "protect off " xstr(BOOTFLASH_START) " +${filesize} && "\
+               "erase " xstr(BOOTFLASH_START) "  +${filesize} && "     \
+               "cp.b ${u-boot_addr_r} " xstr(BOOTFLASH_START)          \
+               "  ${filesize} && "                                     \
+               "protect on " xstr(BOOTFLASH_START) "  +${filesize}\0"  \
+       ""
+
+#endif /* __CONFIG_KEYMILE_POWERPC_H */
diff --git a/include/configs/km82xx-common.h b/include/configs/km82xx-common.h
new file mode 100644 (file)
index 0000000..345212c
--- /dev/null
@@ -0,0 +1,336 @@
+/*
+ * (C) Copyright 2007-2010
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 __KM82XX_COMMON
+#define __KM82XX_COMMON
+
+/*
+ * Select serial console configuration
+ *
+ * If either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
+ * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
+ * for SCC).
+ */
+#define        CONFIG_CONS_ON_SMC              /* Console is on SMC         */
+#undef  CONFIG_CONS_ON_SCC             /* It's not on SCC           */
+#undef CONFIG_CONS_NONE                /* It's not on external UART */
+#define CONFIG_CONS_INDEX      2       /* SMC2 is used for console  */
+#define CONFIG_SYS_SMC_RXBUFLEN        128
+#define CONFIG_SYS_MAXIDLE     10
+
+/*
+ * Select ethernet configuration
+ *
+ * If either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected,
+ * then CONFIG_ETHER_INDEX must be set to the channel number (1-4 for
+ * SCC, 1-3 for FCC)
+ *
+ * If CONFIG_ETHER_NONE is defined, then either the ethernet routines
+ * must be defined elsewhere (as for the console), or CONFIG_CMD_NET
+ * must be unset.
+ */
+#define        CONFIG_ETHER_ON_SCC             /* Ethernet is on SCC */
+#undef CONFIG_ETHER_ON_FCC             /* Ethernet is not on FCC     */
+#undef CONFIG_ETHER_NONE               /* No external Ethernet   */
+#define CONFIG_NET_MULTI
+
+#define CONFIG_ETHER_INDEX     4
+#define CONFIG_HAS_ETH0
+#define CONFIG_SYS_SCC_TOUT_LOOP       10000000
+
+#define CONFIG_SYS_CMXSCR_VALUE        (CMXSCR_RS4CS_CLK7 | CMXSCR_TS4CS_CLK8)
+
+#ifndef CONFIG_8260_CLKIN
+#define CONFIG_8260_CLKIN      66000000        /* in Hz */
+#endif
+
+#define BOOTFLASH_START                0xFE000000
+
+#define CONFIG_KM_CONSOLE_TTY  "ttyCPM0"
+
+#define MTDPARTS_DEFAULT       "mtdparts="                             \
+       "app:"                                                          \
+               "768k(u-boot),"                                         \
+               "128k(env),"                                            \
+               "128k(envred),"                                         \
+               "3072k(free),"                                          \
+               "-(" CONFIG_KM_UBI_PARTITION_NAME ")"
+
+/*
+ * Default environment settings
+ */
+#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+       CONFIG_KM_DEF_ENV                                               \
+       "EEprom_ivm=pca9544a:70:4 \0"                                   \
+       "unlock=yes\0"                                                  \
+       "newenv="                                                       \
+               "prot off 0xFE0C0000 +0x40000 && "                      \
+               "era 0xFE0C0000 +0x40000\0"                             \
+       "rootpath=/opt/eldk/ppc_82xx\0"                                 \
+       ""
+
+#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+#define CONFIG_SYS_MONITOR_LEN         (768 << 10)
+
+#define CONFIG_ENV_IS_IN_FLASH
+
+#ifdef CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_SECT_SIZE   0x20000
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE + \
+                                       CONFIG_SYS_MONITOR_LEN)
+#define CONFIG_ENV_OFFSET      CONFIG_SYS_MONITOR_LEN
+
+/* Address and size of Redundant Environment Sector    */
+#define CONFIG_ENV_OFFSET_REDUND       (CONFIG_ENV_OFFSET + \
+                                               CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND         (CONFIG_ENV_SIZE)
+#endif /* CONFIG_ENV_IS_IN_FLASH */
+
+/* enable I2C and select the hardware/software driver */
+#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
+#define        CONFIG_SOFT_I2C                 /* I2C bit-banged               */
+#define CONFIG_SYS_I2C_SPEED           50000   /* I2C speed */
+#define CONFIG_SYS_I2C_SLAVE           0x7F    /* I2C slave address */
+
+/*
+ * Software (bit-bang) I2C driver configuration
+ */
+
+#define I2C_PORT       3               /* Port A=0, B=1, C=2, D=3 */
+#define I2C_ACTIVE     (iop->pdir |=  0x00010000)
+#define I2C_TRISTATE   (iop->pdir &= ~0x00010000)
+#define I2C_READ       ((iop->pdat & 0x00010000) != 0)
+#define I2C_SDA(bit)   do { \
+                               if (bit) \
+                                       iop->pdat |=  0x00010000; \
+                               else \
+                                       iop->pdat &= ~0x00010000; \
+                       } while (0)
+#define I2C_SCL(bit)   do { \
+                               if (bit) \
+                                       iop->pdat |=  0x00020000; \
+                               else \
+                                       iop->pdat &= ~0x00020000; \
+                       } while (0)
+#define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
+
+/* I2C SYSMON (LM75, AD7414 is almost compatible)                      */
+#define CONFIG_DTT_LM75                        /* ON Semi's LM75               */
+#define CONFIG_DTT_SENSORS     {0}     /* Sensor addresses             */
+#define CONFIG_SYS_DTT_MAX_TEMP        70
+#define CONFIG_SYS_DTT_LOW_TEMP        -30
+#define CONFIG_SYS_DTT_HYSTERESIS      3
+#define CONFIG_SYS_DTT_BUS_NUM         (CONFIG_SYS_MAX_I2C_BUS)
+
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+#define CONFIG_SYS_IMMR                0xF0000000
+
+#define CONFIG_SYS_INIT_RAM_ADDR       CONFIG_SYS_IMMR
+#define CONFIG_SYS_INIT_RAM_SIZE       0x2000 /* used size in DPRAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - \
+                                               GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
+
+/* Hard reset configuration word */
+#define CONFIG_SYS_HRCW_MASTER         0x0604b211
+
+/* No slaves */
+#define CONFIG_SYS_HRCW_SLAVE1         0
+#define CONFIG_SYS_HRCW_SLAVE2         0
+#define CONFIG_SYS_HRCW_SLAVE3         0
+#define CONFIG_SYS_HRCW_SLAVE4         0
+#define CONFIG_SYS_HRCW_SLAVE5         0
+#define CONFIG_SYS_HRCW_SLAVE6         0
+#define CONFIG_SYS_HRCW_SLAVE7         0
+
+/* Initial Memory map for Linux */
+#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)
+
+#define CONFIG_SYS_CACHELINE_SIZE      32      /* For MPC8260 CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CONFIG_SYS_CACHELINE_SHIFT   5 /* log base 2 of the above value */
+#endif
+
+#define CONFIG_SYS_HID0_INIT           0
+#define CONFIG_SYS_HID0_FINAL          (HID0_ICE | HID0_IFEM | HID0_ABE)
+
+#define CONFIG_SYS_HID2                0
+
+#define CONFIG_SYS_SIUMCR              0x4020c200
+#define CONFIG_SYS_SYPCR               0xFFFFFFC3
+#define CONFIG_SYS_BCR                 0x10000000
+#define CONFIG_SYS_SCCR                (SCCR_PCI_MODE | SCCR_PCI_MODCK)
+
+/*
+ *-----------------------------------------------------------------------
+ * RMR - Reset Mode Register                                     5-5
+ *-----------------------------------------------------------------------
+ * turn on Checkstop Reset Enable
+ */
+#define CONFIG_SYS_RMR         0
+
+/*
+ *-----------------------------------------------------------------------
+ * TMCNTSC - Time Counter Status and Control                     4-40
+ *-----------------------------------------------------------------------
+ * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
+ * and enable Time Counter
+ */
+#define CONFIG_SYS_TMCNTSC     (TMCNTSC_SEC|TMCNTSC_ALR|TMCNTSC_TCF|TMCNTSC_TCE)
+
+/*
+ *-----------------------------------------------------------------------
+ * PISCR - Periodic Interrupt Status and Control                 4-42
+ *-----------------------------------------------------------------------
+ * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
+ * Periodic timer
+ */
+#define CONFIG_SYS_PISCR       (PISCR_PS|PISCR_PTF|PISCR_PTE)
+
+/*
+ *-----------------------------------------------------------------------
+ * RCCR - RISC Controller Configuration                         13-7
+ *-----------------------------------------------------------------------
+ */
+#define CONFIG_SYS_RCCR        0
+
+/*
+ * Init Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Device
+ * ---- ---     ------- ------  ------
+ *  0   60x     GPCM     8 bit  FLASH
+ *  1   60x     SDRAM   32 bit  SDRAM
+ *  3   60x     GPCM     8 bit  GPIO/PIGGY
+ *  5   60x     GPCM    16 bit  CFG-Flash
+ *
+ */
+/* Bank 0 - FLASH
+ */
+#define CONFIG_SYS_BR0_PRELIM  ((CONFIG_SYS_FLASH_BASE & BRx_BA_MSK)   |\
+                        BRx_PS_8                       |\
+                        BRx_MS_GPCM_P                  |\
+                        BRx_V)
+
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE)       |\
+                        ORxG_CSNT                      |\
+                        ORxG_ACS_DIV2                  |\
+                        ORxG_SCY_5_CLK                 |\
+                        ORxG_TRLX)
+
+
+/*
+ * Bank 1 - 60x bus SDRAM
+ */
+#define SDRAM_MAX_SIZE 0x08000000      /* max. 128 MB          */
+#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT  (256 << 20)     /* less than 256 MB */
+
+#define CONFIG_SYS_MPTPR       0x1800
+
+/*
+ *-----------------------------------------------------------------------------
+ * Address for Mode Register Set (MRS) command
+ *-----------------------------------------------------------------------------
+ */
+#define CONFIG_SYS_MRS_OFFS    0x00000110
+#define CONFIG_SYS_PSRT        0x0e
+
+#define CONFIG_SYS_BR1_PRELIM ((CONFIG_SYS_SDRAM_BASE & BRx_BA_MSK) |\
+                        BRx_PS_64              |\
+                        BRx_MS_SDRAM_P         |\
+                        BRx_V)
+
+#define CONFIG_SYS_OR1_PRELIM  CONFIG_SYS_OR1
+
+/*
+ *  SDRAM initialization values
+ */
+
+#define CONFIG_SYS_OR1 ((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & ORxS_SDAM_MSK) |\
+                        ORxS_BPD_8                     |\
+                        ORxS_ROWST_PBI0_A7             |\
+                        ORxS_NUMR_13)
+
+#define CONFIG_SYS_PSDMR (PSDMR_SDAM_A14_IS_A5 |\
+                        PSDMR_BSMA_A14_A16     |\
+                        PSDMR_SDA10_PBI0_A9    |\
+                        PSDMR_RFRC_5_CLK       |\
+                        PSDMR_PRETOACT_2W      |\
+                        PSDMR_ACTTORW_2W       |\
+                        PSDMR_LDOTOPRE_1C      |\
+                        PSDMR_WRC_1C           |\
+                        PSDMR_CL_2)
+
+/*
+ * UPIO FPGA (GPIO/PIGGY) on CS3 initialization values
+ */
+#define CONFIG_SYS_KMBEC_FPGA_BASE     0x30000000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE     128
+
+#define CONFIG_SYS_BR3_PRELIM  ((CONFIG_SYS_KMBEC_FPGA_BASE & BRx_BA_MSK) |\
+                        BRx_PS_8 | BRx_MS_GPCM_P | BRx_V)
+
+#define CONFIG_SYS_OR3_PRELIM  (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) |\
+                        ORxG_CSNT | ORxG_ACS_DIV2 |\
+                        ORxG_SCY_3_CLK | ORxG_TRLX)
+
+/*
+ * BFTICU board FPGA on CS4 initialization values
+ */
+#define CONFIG_SYS_FPGA_BASE   0x40000000
+#define CONFIG_SYS_FPGA_SIZE   1 /*1KB*/
+
+#define CONFIG_SYS_BR4_PRELIM ((CONFIG_SYS_FPGA_BASE & BRx_BA_MSK) |\
+                       BRx_PS_8 | BRx_MS_GPCM_P | BRx_V)
+
+#define CONFIG_SYS_OR4_PRELIM (P2SZ_TO_AM(CONFIG_SYS_FPGA_SIZE << 10) |\
+                        ORxG_CSNT | ORxG_ACS_DIV2 |\
+                        ORxG_SCY_3_CLK | ORxG_TRLX)
+
+/*
+ * CFG-Flash on CS5 initialization values
+ */
+#define CONFIG_SYS_BR5_PRELIM  ((CONFIG_SYS_FLASH_BASE_1 & BRx_BA_MSK) |\
+                        BRx_PS_16 | BRx_MS_GPCM_P | BRx_V)
+
+#define CONFIG_SYS_OR5_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE_1 + \
+                                CONFIG_SYS_FLASH_SIZE_2) |\
+                                ORxG_CSNT | ORxG_ACS_DIV2 |\
+                                ORxG_SCY_5_CLK | ORxG_TRLX)
+
+#define        CONFIG_SYS_RESET_ADDRESS 0xFDFFFFFC     /* "bad" address */
+
+/* pass open firmware flat tree */
+#define CONFIG_FIT             1
+#define CONFIG_OF_LIBFDT       1
+#define CONFIG_OF_BOARD_SETUP  1
+
+#define OF_TBCLK               (bd->bi_busfreq / 4)
+#define OF_STDOUT_PATH         "/soc/cpm/serial@11a90"
+
+#endif /* __KM82XX_COMMON */
diff --git a/include/configs/km8321-common.h b/include/configs/km8321-common.h
new file mode 100644 (file)
index 0000000..6fab45e
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <daveliu@freescale.com>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <peterb@logicpd.com>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ * (C) Copyright 2010
+ * Lukas Roggli, KEYMILE Ltd, lukas.roggli@keymile.com
+ *
+ * (C) Copyright 2010-2011
+ * Thomas Reufer, KEYMILE Ltd, thomas.reufer@keymile.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __CONFIG_KM8321_COMMON_H
+#define __CONFIG_KM8321_COMMON_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE      /* Has QE */
+#define CONFIG_MPC832x /* MPC832x CPU specific */
+#define CONFIG_KM8321  /* Keymile PBEC8321 board specific */
+
+#define CONFIG_KM_DEF_ROOTPATH         \
+       "rootpath=/opt/eldk/ppc_8xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+#define CONFIG_MISC_INIT_R
+
+/*
+ * System IO Config
+ */
+#define CONFIG_SYS_SICRL       SICRL_IRQ_CKS
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+       HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+       HRCWL_DDR_TO_SCB_CLK_2X1 | \
+       HRCWL_CSB_TO_CLKIN_2X1 | \
+       HRCWL_CORE_TO_CSB_2_5X1 | \
+       HRCWL_CE_PLL_VCO_DIV_2 | \
+       HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+       HRCWH_PCI_AGENT | \
+       HRCWH_PCI_ARBITER_DISABLE | \
+       HRCWH_CORE_ENABLE | \
+       HRCWH_FROM_0X00000100 | \
+       HRCWH_BOOTSEQ_DISABLE | \
+       HRCWH_SW_WATCHDOG_DISABLE | \
+       HRCWH_ROM_LOC_LOCAL_16BIT | \
+       HRCWH_BIG_ENDIAN | \
+       HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDR_CS0_BNDS                0x0000007f
+#define CONFIG_SYS_DDR_SDRAM_CFG       (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+                                        SDRAM_CFG_32_BE | \
+                                        SDRAM_CFG_SREN)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2      0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL                (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL        ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+                                (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG      (CSCONFIG_EN | CSCONFIG_AP | \
+                                        CSCONFIG_ODT_WR_CFG | \
+                                        CSCONFIG_ROW_BIT_13 | \
+                                        CSCONFIG_COL_BIT_10)
+
+#define CONFIG_SYS_DDR_MODE    0x47860252
+#define CONFIG_SYS_DDR_MODE2   0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0        ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+                                (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+                                (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+                                (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+                                (0 << TIMING_CFG0_WWT_SHIFT) | \
+                                (0 << TIMING_CFG0_RRT_SHIFT) | \
+                                (0 << TIMING_CFG0_WRT_SHIFT) | \
+                                (0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1        ((TIMING_CFG1_CASLAT_50) | \
+                                (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+                                (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+                                (2 << TIMING_CFG1_WRREC_SHIFT) | \
+                                (6 << TIMING_CFG1_REFREC_SHIFT) | \
+                                (2 << TIMING_CFG1_ACTTORW_SHIFT) | \
+                                (6 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+                                (2 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2        ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+                                (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+                                (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+                                (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+                                (4 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+                                (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
+                                (5 << TIMING_CFG2_CPO_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_3        0x00000000
+
+#define CONFIG_SYS_KMBEC_FPGA_BASE     0xE8000000
+#define        CONFIG_SYS_KMBEC_FPGA_SIZE      128
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR                (LCRR_DBYP | LCRR_EADC_1 | LCRR_CLKDIV_2)
+#define CONFIG_SYS_LBC_LBCR    0x00000000
+
+/*
+ * MMU Setup
+ */
+#define CONFIG_SYS_IBAT7L      (0)
+#define CONFIG_SYS_IBAT7U      (0)
+#define CONFIG_SYS_DBAT7L      CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U      CONFIG_SYS_IBAT7U
+
+#endif /* __CONFIG_KM8321_COMMON_H */
diff --git a/include/configs/km83xx-common.h b/include/configs/km83xx-common.h
new file mode 100644 (file)
index 0000000..85b6ed2
--- /dev/null
@@ -0,0 +1,325 @@
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, hs@denx.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; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __CONFIG_KM83XX_H
+#define __CONFIG_KM83XX_H
+
+/* include common defines/options for all Keymile boards */
+#include "keymile-common.h"
+#include "km-powerpc.h"
+
+#define MTDIDS_DEFAULT         "nor0=boot"
+#define MTDPARTS_DEFAULT       "mtdparts="                     \
+       "boot:"                                                 \
+               "768k(u-boot),"                                 \
+               "128k(env),"                                    \
+               "128k(envred),"                                 \
+               "-(" CONFIG_KM_UBI_PARTITION_NAME ")"
+
+#define CONFIG_MISC_INIT_R
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN              66000000
+#define CONFIG_SYS_CLK_FREQ            66000000
+#define CONFIG_83XX_PCICLK             66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR                0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE            0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE          CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_BASE      CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL  (DDR_SDRAM_CLK_CNTL_SS_EN | \
+                                       DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE            2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE          0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN         (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR       0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE       0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_SIZE       0x100 /* num bytes initial data */
+#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - \
+                                               GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI           /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER                /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE          256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM     0x8000001b /* 256MB window size */
+
+#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE | \
+                               (2 << BR_PS_SHIFT) | /* 16 bit port size */ \
+                               BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+                               OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+                               OR_GPCM_SCY_5 | \
+                               OR_GPCM_TRLX | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS     1   /* max num of flash banks   */
+#define CONFIG_SYS_MAX_FLASH_SECT      512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000001A /* 128MB window size */
+
+#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_KMBEC_FPGA_BASE | \
+                               (1 << BR_PS_SHIFT) | /* 8 bit port size */ \
+                               BR_V)
+#define CONFIG_SYS_OR1_PRELIM  (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+                               OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+                               OR_GPCM_SCY_2 | \
+                               OR_GPCM_TRLX | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_CONS_INDEX      1
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE    1
+#define CONFIG_SYS_NS16550_CLK         get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_IMMR+0x4600)
+
+/* Pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT
+#define CONFIG_OF_BOARD_SETUP
+#define CONFIG_OF_STDOUT_VIA_ALIAS
+
+#ifndef CONFIG_NET_MULTI
+#define CONFIG_NET_MULTI
+#endif
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME                "UEC0"
+
+#define CONFIG_UEC_ETH1                /* GETH1 */
+#define UEC_VERBOSE_DEBUG      1
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM        3       /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK         QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK         QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE       FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR       0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED        100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE + \
+                                       CONFIG_SYS_MONITOR_LEN)
+#define CONFIG_ENV_SECT_SIZE   0x20000 /* 128K(one sector) for env */
+#define CONFIG_ENV_OFFSET      (CONFIG_SYS_MONITOR_LEN)
+
+/* Address and size of Redundant Environment Sector    */
+#define CONFIG_ENV_OFFSET_REDUND       (CONFIG_ENV_OFFSET + \
+                                               CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_SYS_NO_FLASH            /* Flash is not usable now */
+#define CONFIG_ENV_IS_NOWHERE          /* Store ENV in memory only */
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE                0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_HARD_I2C                /* I2C with hardware support */
+#define CONFIG_FSL_I2C
+#define CONFIG_SYS_I2C_SPEED   200000  /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_SLAVE   0x7F
+#define CONFIG_SYS_I2C_OFFSET  0x3000
+
+/* I2C SYSMON (LM75, AD7414 is almost compatible) */
+#define CONFIG_DTT_LM75                /* ON Semi's LM75 */
+#define CONFIG_DTT_SENSORS     {0, 1, 2, 3}    /* Sensor addresses */
+#define CONFIG_SYS_DTT_MAX_TEMP        70
+#define CONFIG_SYS_DTT_LOW_TEMP        -30
+#define CONFIG_SYS_DTT_HYSTERESIS      3
+#define CONFIG_SYS_DTT_BUS_NUM         (CONFIG_SYS_MAX_I2C_BUS)
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE     1
+#define CONFIG_SYS_NAND_BASE           CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
+
+#if defined(CONFIG_PCI)
+#define CONFIG_CMD_PCI
+#endif
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT           0x000000000
+#define CONFIG_SYS_HID0_FINAL          (HID0_ENABLE_MACHINE_CHECK | \
+                                        HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2                        HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS       1       /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L      (CONFIG_SYS_SDRAM_BASE | BATL_PP_10 | \
+                               BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U      (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+                                       BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L      CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U      CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L      (CONFIG_SYS_IMMR | BATL_PP_10 | \
+                               BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U      (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+                                       | BATU_VP)
+#define CONFIG_SYS_DBAT1L      CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U      CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L      (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_10 | \
+                               BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U      (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+                               BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L      (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_10 | \
+                                BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U      CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L      (CONFIG_SYS_FLASH_BASE | BATL_PP_10 | \
+                                       BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U      (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+                                       BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L      (CONFIG_SYS_FLASH_BASE | BATL_PP_10 | \
+                                BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U      CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L      (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_10)
+#define CONFIG_SYS_IBAT4U      (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+                                       BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L      CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U      CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ *
+ * Boot Flags
+ */
+#define BOOTFLAG_COLD  0x01 /* Normal Power-On: Boot from FLASH */
+#define BOOTFLAG_WARM  0x02 /* Software reboot */
+
+#define BOOTFLASH_START        0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY  "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#ifndef CONFIG_KM_DEF_ENV              /* if not set by keymile-common.h */
+#define CONFIG_KM_DEF_ENV "km-common=empty\0"
+#endif
+
+#ifndef CONFIG_KM_DEF_ROOTPATH
+#define CONFIG_KM_DEF_ROOTPATH         \
+       "rootpath=/opt/eldk/ppc_82xx\0"
+#endif
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       CONFIG_KM_DEF_ENV                                               \
+       CONFIG_KM_DEF_ROOTPATH                                          \
+       "dtt_bus=pca9547:70:a\0"                                        \
+       "EEprom_ivm=pca9547:70:9\0"                                     \
+       "newenv="                                                       \
+               "prot off 0xF00C0000 +0x40000 && "                      \
+               "era 0xF00C0000 +0x40000\0"                             \
+       "unlock=yes\0"                                                  \
+       ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
+
+#endif /* __CONFIG_KM83XX_H */
index bf77cc0542600ee59172e2d57311e65a59c47d99..70113d449d62f4d69f432387c4164181bb44b20a 100644 (file)
@@ -6,6 +6,9 @@
  * (C) Copyright 2009
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
+ * (C) Copyright 2010-2011
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
  * MA 02110-1301 USA
  */
 
-/* for linking errors see http://lists.denx.de/pipermail/u-boot/2009-July/057350.html */
+/*
+ * for linking errors see
+ * http://lists.denx.de/pipermail/u-boot/2009-July/057350.html
+ */
 
 #ifndef _CONFIG_KM_ARM_H
 #define _CONFIG_KM_ARM_H
 #define CONFIG_FEROCEON_88FR131                /* CPU Core subversion */
 #define CONFIG_KIRKWOOD                        /* SOC Family Name */
 #define CONFIG_KW88F6281               /* SOC Name */
-#define CONFIG_MACH_SUEN3              /* Machine type */
+#define CONFIG_MACH_KM_KIRKWOOD                /* Machine type */
 
 /* include common defines/options for all Keymile boards */
 #include "keymile-common.h"
-#undef CONFIG_CMD_DTT
-#undef CONFIG_BOOTCOUNT_LIMIT
+
+#define CONFIG_SYS_TEXT_BASE   0x04000000      /* code address after reloc */
+#define CONFIG_ENV_SIZE                (128 << 10)     /* NAND chip block size */
+#define CONFIG_SYS_MEMTEST_START 0x00400000    /* 4M */
+#define CONFIG_SYS_MEMTEST_END 0x007fffff      /*(_8M -1) */
+#define CONFIG_SYS_LOAD_ADDR   0x00800000      /* default load adr- 8M */
+
+/* pseudo-non volatile RAM [hex] */
+#define CONFIG_KM_PNVRAM       0x80000
+/* physical RAM MTD size [hex] */
+#define CONFIG_KM_PHRAM                0x17F000
+
+#define CONFIG_KM_CRAMFS_ADDR  0x2400000
+#define CONFIG_KM_KERNEL_ADDR  0x2000000       /* 4096KBytes */
+
+#define CONFIG_KM_DEF_ENV_CPU                                          \
+       "addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0"         \
+       "boot=bootm ${actual_kernel_addr} - -\0"                        \
+       "cramfsloadfdt=echo \\\\c\0"                                    \
+       "tftpfdt=echo \\\\c\0"                                          \
+       CONFIG_KM_DEF_ENV_UPDATE                                        \
+       ""
+
+
 
 #define CONFIG_MD5     /* get_random_hex on krikwood needs MD5 support */
 #define CONFIG_SKIP_LOWLEVEL_INIT      /* disable board lowlevel_init */
@@ -152,15 +180,15 @@ void set_sda (int state);
 void set_scl (int state);
 int get_sda (void);
 int get_scl (void);
-#define SUEN3_SDA_PIN  8
-#define SUEN3_SCL_PIN  9
-#define SUEN3_ENV_WP   38
-
-#define I2C_ACTIVE     __set_direction(SUEN3_SDA_PIN, 0)
-#define I2C_TRISTATE   __set_direction(SUEN3_SDA_PIN, 1)
-#define I2C_READ       (kw_gpio_get_value(SUEN3_SDA_PIN) ? 1 : 0)
-#define I2C_SDA(bit)   kw_gpio_set_value(SUEN3_SDA_PIN, bit);
-#define I2C_SCL(bit)   kw_gpio_set_value(SUEN3_SCL_PIN, bit);
+#define KM_KIRKWOOD_SDA_PIN    8
+#define KM_KIRKWOOD_SCL_PIN    9
+#define KM_KIRKWOOD_ENV_WP     38
+
+#define I2C_ACTIVE     __set_direction(KM_KIRKWOOD_SDA_PIN, 0)
+#define I2C_TRISTATE   __set_direction(KM_KIRKWOOD_SDA_PIN, 1)
+#define I2C_READ       (kw_gpio_get_value(KM_KIRKWOOD_SDA_PIN) ? 1 : 0)
+#define I2C_SDA(bit)   kw_gpio_set_value(KM_KIRKWOOD_SDA_PIN, bit)
+#define I2C_SCL(bit)   kw_gpio_set_value(KM_KIRKWOOD_SCL_PIN, bit)
 #endif
 
 #define I2C_DELAY      udelay(3)       /* 1/4 I2C clock duration */
@@ -173,6 +201,47 @@ int get_scl (void);
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
 
+/*
+ *  Environment variables configurations
+ */
+#define CONFIG_ENV_IS_IN_EEPROM                /* use EEPROM for environment vars */
+#define CONFIG_SYS_DEF_EEPROM_ADDR     0x50
+#define CONFIG_ENV_EEPROM_IS_ON_I2C
+#define CONFIG_SYS_EEPROM_WREN
+#define CONFIG_ENV_OFFSET              0x0 /* no bracets! */
+#undef CONFIG_ENV_SIZE
+#define CONFIG_ENV_SIZE                        (0x2000 - CONFIG_ENV_OFFSET)
+#define CONFIG_I2C_ENV_EEPROM_BUS      "pca9547:70:d\0"
+
+/* offset redund: (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) */
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#define CONFIG_ENV_OFFSET_REDUND       0x2000 /* no bracets! */
+#define CONFIG_ENV_SIZE_REDUND         (CONFIG_ENV_SIZE)
+
+#define CONFIG_CMD_SF
+
+#define CONFIG_SPI_FLASH
+#define CONFIG_HARD_SPI
+#define CONFIG_KIRKWOOD_SPI
+#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_ENV_SPI_BUS             0
+#define CONFIG_ENV_SPI_CS              0
+#define CONFIG_ENV_SPI_MAX_HZ          50000000        /* 50Mhz */
+
+#define FLASH_GPIO_PIN                 0x00010000
+
+#define MTDIDS_DEFAULT         "nand0=orion_nand"
+/* test-only: partitioning needs some tuning, this is just for tests */
+#define MTDPARTS_DEFAULT       "mtdparts="                             \
+       "orion_nand:"                                                   \
+               "-(" CONFIG_KM_UBI_PARTITION_NAME ")"
+
+#define        CONFIG_KM_DEF_ENV_UPDATE                                        \
+       "update="                                                       \
+               "spi on;sf probe 0;sf erase 0 50000;"                   \
+               "sf write ${u-boot_addr_r} 0 ${filesize};"              \
+               "spi off\0"
+
 #if defined(CONFIG_SYS_NO_FLASH)
 #define CONFIG_KM_UBI_PARTITION_NAME   "ubi0"
 #undef CONFIG_FLASH_CFI_MTD
@@ -185,4 +254,13 @@ int get_scl (void);
 #define CONFIG_SYS_INIT_SP_ADDR                0xC8012000
 /* Do early setups now in board_init_f() */
 #define CONFIG_BOARD_EARLY_INIT_F
+
+/*
+ * resereved pram area at the end of memroy [hex]
+ * 8Mbytes for switch + 4Kbytes for bootcount
+ */
+#define CONFIG_KM_RESERVED_PRAM 0x801000
+/* address for the bootcount (taken from end of RAM) */
+#define BOOTCOUNT_ADDR          (CONFIG_KM_RESERVED_PRAM)
+
 #endif /* _CONFIG_KM_ARM_H */
index 8fcadfee50603c68217d580578416591beed6814..2fcecaf88f2c4aeb4070da081b4e0c8bf85a4583 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright (C) 2007 MontaVista Software, Inc.
  *                    Anton Vorontsov <avorontsov@ru.mvista.com>
  *
- * (C) Copyright 2008
+ * (C) Copyright 2008-2011
  * Heiko Schocher, DENX Software Engineering, hs@denx.de.
  *
  * This program is free software; you can redistribute it and/or
 /*
  * High Level Configuration Options
  */
-#define CONFIG_E300            1 /* E300 family */
-#define CONFIG_QE              1 /* Has QE */
-#define CONFIG_MPC83xx         1 /* MPC83xx family */
-#define CONFIG_MPC8360         1 /* MPC8360 CPU specific */
-#define CONFIG_KMETER1         1 /* KMETER1 board specific */
+#define CONFIG_QE              /* Has QE */
+#define CONFIG_MPC8360         /* MPC8360 CPU specific */
+#define CONFIG_KMETER1         /* KMETER1 board specific */
 #define CONFIG_HOSTNAME                kmeter1
+#define CONFIG_KM_BOARD_NAME   "kmeter1"
 
 #define        CONFIG_SYS_TEXT_BASE    0xF0000000
+#define CONFIG_KM_DEF_NETDEV   \
+       "netdev=eth2\0"         \
 
-/* include common defines/options for all Keymile boards */
-#include "keymile-common.h"
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
 
-#define CONFIG_KM_UBI_PARTITION_NAME   "ubi0"
-
-#define MTDIDS_DEFAULT         "nor0=boot"
-#define MTDPARTS_DEFAULT       \
-       "mtdparts=boot:768k(u-boot),128k(env),128k(envred),"    \
-       "-(" CONFIG_KM_UBI_PARTITION_NAME ")"
-
-#define CONFIG_MISC_INIT_R     1
+#define CONFIG_MISC_INIT_R
 /*
- * System Clock Setup
+ * System IO Setup
  */
-#define CONFIG_83XX_CLKIN              66000000
-#define CONFIG_SYS_CLK_FREQ            66000000
-#define CONFIG_83XX_PCICLK             66000000
+#define CONFIG_SYS_SICRH               (SICRH_UC1EOBI | SICRH_UC2E1OBI)
 
 /*
  * Hardware Reset Configuration Word
        HRCWH_LALE_EARLY | \
        HRCWH_LDP_CLEAR )
 
-/*
- * System IO Config
- */
-#define CONFIG_SYS_SICRH               0x00000006
-#define CONFIG_SYS_SICRL               0x00000000
-
-/*
- * IMMR new address
- */
-#define CONFIG_SYS_IMMR                0xE0000000
-
-/*
- * Bus Arbitration Configuration Register (ACR)
- */
-#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
-#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
-#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
-#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
-
-/*
- * DDR Setup
- */
-#define CONFIG_SYS_DDR_BASE            0x00000000 /* DDR is system memory */
-#define CONFIG_SYS_SDRAM_BASE          CONFIG_SYS_DDR_BASE
-#define CONFIG_SYS_DDR_SDRAM_BASE      CONFIG_SYS_DDR_BASE
-#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL  (DDR_SDRAM_CLK_CNTL_SS_EN | \
-                                       DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
-
-#define CFG_83XX_DDR_USES_CS0
-
-#undef CONFIG_DDR_ECC
-
-/*
- * DDRCDR - DDR Control Driver Register
- */
-
-#undef CONFIG_SPD_EEPROM       /* Do not use SPD EEPROM for DDR setup */
-
-/*
- * Manually set up DDR parameters
- */
-#define CONFIG_DDR_II
-#define CONFIG_SYS_DDR_SIZE            2048 /* MB */
 #define CONFIG_SYS_DDR_CS0_BNDS                0x0000007f
-#define CONFIG_SYS_DDR_CS0_CONFIG      (CSCONFIG_EN | CSCONFIG_AP | \
-                                        CSCONFIG_ROW_BIT_13 | \
-                                        CSCONFIG_COL_BIT_10 | CSCONFIG_ODT_WR_ACS)
-
 #define CONFIG_SYS_DDR_SDRAM_CFG       (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
                                         SDRAM_CFG_SREN)
 #define CONFIG_SYS_DDR_SDRAM_CFG2      0x00401000
 #define CONFIG_SYS_DDR_INTERVAL        ((0x080 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
                                 (0x3cf << SDRAM_INTERVAL_REFINT_SHIFT))
 
+#define CONFIG_SYS_DDR_CS0_CONFIG      (CSCONFIG_EN | CSCONFIG_AP | \
+                                        CSCONFIG_ROW_BIT_13 | \
+                                        CSCONFIG_COL_BIT_10 | \
+                                        CSCONFIG_ODT_WR_ACS)
+
 #define        CONFIG_SYS_DDRCDR               0x40000001
 #define CONFIG_SYS_DDR_MODE            0x47860452
 #define CONFIG_SYS_DDR_MODE2           0x8080c000
                                 (0 << TIMING_CFG0_WRT_SHIFT) | \
                                 (0 << TIMING_CFG0_RWT_SHIFT))
 
-#define CONFIG_SYS_DDR_TIMING_1        ((      TIMING_CFG1_CASLAT_50) | \
-                                ( 2 << TIMING_CFG1_WRTORD_SHIFT) | \
-                                ( 2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
-                                ( 3 << TIMING_CFG1_WRREC_SHIFT) | \
-                                ( 7 << TIMING_CFG1_REFREC_SHIFT) | \
-                                ( 3 << TIMING_CFG1_ACTTORW_SHIFT) | \
-                                ( 8 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
-                                ( 3 << TIMING_CFG1_PRETOACT_SHIFT))
+#define CONFIG_SYS_DDR_TIMING_1        ((TIMING_CFG1_CASLAT_50) | \
+                                (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+                                (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+                                (3 << TIMING_CFG1_WRREC_SHIFT) | \
+                                (7 << TIMING_CFG1_REFREC_SHIFT) | \
+                                (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+                                (8 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+                                (3 << TIMING_CFG1_PRETOACT_SHIFT))
 
 #define CONFIG_SYS_DDR_TIMING_2        ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
                                 (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
 
 #define CONFIG_SYS_DDR_TIMING_3        0x00000000
 
-/*
- * The reserved memory
- */
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE /* start of monitor */
-#define CONFIG_SYS_FLASH_BASE          0xF0000000
-#define CONFIG_SYS_PIGGY_BASE          0xE8000000
-#define        CONFIG_SYS_PIGGY_SIZE           128
-#define CONFIG_SYS_PAXE_BASE           0xA0000000
+/* PRIO FPGA */
+#define        CONFIG_SYS_KMBEC_FPGA_BASE      0xE8000000
+#define        CONFIG_SYS_KMBEC_FPGA_SIZE      128
+/* PAXE FPGA */
+#define        CONFIG_SYS_PAXE_BASE            0xA0000000
 #define        CONFIG_SYS_PAXE_SIZE            512
 
-#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
-#define CONFIG_SYS_RAMBOOT
-#else
-#undef CONFIG_SYS_RAMBOOT
-#endif
-
-#define CONFIG_SYS_MONITOR_LEN         (384 * 1024) /* Reserve 384 kB for Mon */
-
-/*
- * Initial RAM Base Address Setup
- */
-#define CONFIG_SYS_INIT_RAM_LOCK       1
-#define CONFIG_SYS_INIT_RAM_ADDR       0xE6000000 /* Initial RAM address */
-#define CONFIG_SYS_INIT_RAM_SIZE       0x1000 /* Size of used area in RAM */
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
 
 /*
  * Local Bus Configuration & Clock Setup
  *
  * Bank Bus     Machine PortSz  Size  Device
  * ---- ---     ------- ------  -----  ------
- *  0   Local   GPCM    16 bit  256MB FLASH
- *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
  *  3   Local   GPCM     8 bit  512MB PAXE
  *
  */
-/*
- * FLASH on the Local Bus
- */
-#define CONFIG_SYS_FLASH_CFI           /* use the Common Flash Interface */
-#define CONFIG_FLASH_CFI_DRIVER                /* use the CFI driver */
-#define CONFIG_SYS_FLASH_SIZE          256 /* max FLASH size is 256M */
-#define CONFIG_SYS_FLASH_PROTECTION    1
-#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE      1
-
-#define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE /* Window base at flash base */
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x8000001b /* 256MB window size */
-
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE | \
-                               (2 << BR_PS_SHIFT) | /* 16 bit port size */ \
-                               BR_V)
-
-#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
-                               OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
-                               OR_GPCM_SCY_5 | \
-                               OR_GPCM_TRLX | OR_GPCM_EAD)
-
-#define CONFIG_SYS_MAX_FLASH_BANKS     1       /* max num of flash banks       */
-#define CONFIG_SYS_MAX_FLASH_SECT      512     /* max num of sects on one chip */
-#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
-
-#undef CONFIG_SYS_FLASH_CHECKSUM
-
-/*
- * PRIO1/PIGGY on the local bus CS1
- */
-#define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_PIGGY_BASE /* Window base at flash base */
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000001A /* 128MB window size */
-
-#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_PIGGY_BASE | \
-                               (1 << BR_PS_SHIFT) | /* 8 bit port size */ \
-                               BR_V)
-#define CONFIG_SYS_OR1_PRELIM          (MEG_TO_AM(CONFIG_SYS_PIGGY_SIZE) | /* 128MB */ \
-                               OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
-                               OR_GPCM_SCY_2 | \
-                               OR_GPCM_TRLX | OR_GPCM_EAD)
 
 /*
  * PAXE on the local bus CS3
  */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM    CONFIG_SYS_PAXE_BASE /* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM    CONFIG_SYS_PAXE_BASE
 #define CONFIG_SYS_LBLAWAR3_PRELIM     0x8000001C /* 512MB window size */
 
 #define CONFIG_SYS_BR3_PRELIM  (CONFIG_SYS_PAXE_BASE | \
                                OR_GPCM_SCY_2 | \
                                OR_GPCM_TRLX | OR_GPCM_EAD)
 
-/*
- * Serial Port
- */
-#define CONFIG_CONS_INDEX      1
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         get_bus_freq(0)
-
-#define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_IMMR+0x4500)
-#define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_IMMR+0x4600)
-
-/* Pass open firmware flat tree */
-#define CONFIG_OF_LIBFDT       1
-#define CONFIG_OF_BOARD_SETUP  1
-#define CONFIG_OF_STDOUT_VIA_ALIAS
-
-/*
- * General PCI
- * Addresses are mapped 1-1.
- */
-#undef CONFIG_PCI              /* No PCI */
-
-#ifndef CONFIG_NET_MULTI
-#define CONFIG_NET_MULTI       1
-#endif
-/*
- * QE UEC ethernet configuration
- */
-#define CONFIG_UEC_ETH
-#define CONFIG_ETHPRIME                "UEC0"
-
-#define CONFIG_UEC_ETH1                /* GETH1 */
-#define UEC_VERBOSE_DEBUG      1
-
-#ifdef CONFIG_UEC_ETH1
-#define CONFIG_SYS_UEC1_UCC_NUM        3       /* UCC4 */
-#define CONFIG_SYS_UEC1_RX_CLK         QE_CLK_NONE     /* not used in RMII Mode */
-#define CONFIG_SYS_UEC1_TX_CLK         QE_CLK17
-#define CONFIG_SYS_UEC1_ETH_TYPE       FAST_ETH
-#define CONFIG_SYS_UEC1_PHY_ADDR       0
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE RMII
-#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
-#endif
-
-/*
- * Environment
- */
-
-#ifndef CONFIG_SYS_RAMBOOT
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
-#define CONFIG_ENV_SECT_SIZE   0x20000 /* 128K(one sector) for env */
-#define CONFIG_ENV_OFFSET      (CONFIG_SYS_MONITOR_LEN)
-
-/* Address and size of Redundant Environment Sector    */
-#define CONFIG_ENV_OFFSET_REDUND       (CONFIG_ENV_OFFSET+CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
-
-#else /* CFG_RAMBOOT */
-#define CONFIG_SYS_NO_FLASH            1       /* Flash is not usable now */
-#define CONFIG_ENV_IS_NOWHERE  1       /* Store ENV in memory only */
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE - 0x1000)
-#define CONFIG_ENV_SIZE                0x2000
-#endif /* CFG_RAMBOOT */
-
-/* I2C */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
-#define CONFIG_FSL_I2C
-#define CONFIG_SYS_I2C_SPEED   200000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE   0x7F
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_I2C_MULTI_BUS   1
-#define CONFIG_I2C_MUX         1
-
-/* EEprom support */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
-
-/* I2C SYSMON (LM75, AD7414 is almost compatible)                      */
-#define CONFIG_DTT_LM75                1       /* ON Semi's LM75               */
-#define CONFIG_DTT_SENSORS     {0, 1, 2, 3}    /* Sensor addresses             */
-#define CONFIG_SYS_DTT_MAX_TEMP        70
-#define CONFIG_SYS_DTT_LOW_TEMP        -30
-#define CONFIG_SYS_DTT_HYSTERESIS      3
-#define CONFIG_SYS_DTT_BUS_NUM         (CONFIG_SYS_MAX_I2C_BUS)
-
-#if defined(CONFIG_CMD_NAND)
-#define CONFIG_NAND_KMETER1
-#define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define CONFIG_SYS_NAND_BASE           CONFIG_SYS_PIGGY_BASE
-#endif
-
-#if defined(CONFIG_PCI)
-#define CONFIG_CMD_PCI
-#endif
-
-#if defined(CFG_RAMBOOT)
-#undef CONFIG_CMD_SAVEENV
-#undef CONFIG_CMD_LOADS
-#endif
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 256 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ           (256 << 20) /* Initial Memory map for Linux */
-
-/*
- * Core HID Setup
- */
-#define CONFIG_SYS_HID0_INIT           0x000000000
-#define CONFIG_SYS_HID0_FINAL          (HID0_ENABLE_MACHINE_CHECK | \
-                                        HID0_ENABLE_INSTRUCTION_CACHE)
-#define CONFIG_SYS_HID2                        HID2_HBE
-
 /*
  * MMU Setup
  */
 
-#define CONFIG_HIGH_BATS       1       /* High BATs supported */
-
-/* DDR: cache cacheable */
-#define CONFIG_SYS_IBAT0L      (CONFIG_SYS_SDRAM_BASE | BATL_PP_10 | \
-                               BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_IBAT0U      (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT0L      CONFIG_SYS_IBAT0L
-#define CONFIG_SYS_DBAT0U      CONFIG_SYS_IBAT0U
-
-/* IMMRBAR & PCI IO: cache-inhibit and guarded */
-#define CONFIG_SYS_IBAT1L      (CONFIG_SYS_IMMR | BATL_PP_10 | \
-                               BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_IBAT1U      (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT1L      CONFIG_SYS_IBAT1L
-#define CONFIG_SYS_DBAT1U      CONFIG_SYS_IBAT1U
-
-/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
-#define CONFIG_SYS_IBAT2L      (CONFIG_SYS_PIGGY_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT2U      (CONFIG_SYS_PIGGY_BASE | BATU_BL_128M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT2L      (CONFIG_SYS_PIGGY_BASE | BATL_PP_10 | \
-                                BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT2U      CONFIG_SYS_IBAT2U
-
-/* FLASH: icache cacheable, but dcache-inhibit and guarded */
-#define CONFIG_SYS_IBAT3L      (CONFIG_SYS_FLASH_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT3U      (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT3L      (CONFIG_SYS_FLASH_BASE | BATL_PP_10 | \
-                                BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT3U      CONFIG_SYS_IBAT3U
-
-/* Stack in dcache: cacheable, no memory coherence */
-#define CONFIG_SYS_IBAT4L      (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_10)
-#define CONFIG_SYS_IBAT4U      (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT4L      CONFIG_SYS_IBAT4L
-#define CONFIG_SYS_DBAT4U      CONFIG_SYS_IBAT4U
-
 /* PAXE:  icache cacheable, but dcache-inhibit and guarded */
-#define CONFIG_SYS_IBAT5L      (CONFIG_SYS_PAXE_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT5U      (CONFIG_SYS_PAXE_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
+#define CONFIG_SYS_IBAT5L      (CONFIG_SYS_PAXE_BASE | BATL_PP_10 | \
+                                BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT5U      (CONFIG_SYS_PAXE_BASE | BATU_BL_256M | \
+                                BATU_VS | BATU_VP)
 #define CONFIG_SYS_DBAT5L      (CONFIG_SYS_PAXE_BASE | BATL_PP_10 | \
                                 BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT5U      CONFIG_SYS_IBAT5U
 #define CONFIG_SYS_DBAT7U      CONFIG_SYS_IBAT7U
 #endif /* CONFIG_PCI */
 
-#define BOOTFLASH_START        F0000000
-
-#define CONFIG_PRAM    512     /* protected RAM [KBytes] */
-
-/*
- * Environment Configuration
- */
-#define CONFIG_ENV_OVERWRITE
-#ifndef CONFIG_KM_DEF_ENV              /* if not set by keymile-common.h */
-#define CONFIG_KM_DEF_ENV "km-common=empty\0"
-#endif
-
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       CONFIG_KM_DEF_ENV                                               \
-       "rootpath=/opt/eldk/ppc_82xx\0"                                 \
-       "addcon=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
-       "ramdisk_file=/tftpboot/kmeter1/uRamdisk\0"                     \
-       "loadram=tftp ${ramdisk_addr_r} ${ramdisk_file}\0"              \
-       "loadfdt=tftp ${fdt_addr_r} ${fdt_file}\0"                      \
-       "loadkernel=tftp ${kernel_addr_r} ${bootfile}\0"                \
-       "unlock=yes\0"                                                  \
-       "fdt_addr=F0080000\0"                                           \
-       "kernel_addr=F00a0000\0"                                        \
-       "ramdisk_addr=F03a0000\0"                                       \
-       "ramdisk_addr_r=F10000\0"                                       \
-       "EEprom_ivm=pca9547:70:9\0"                                     \
-       "dtt_bus=pca9547:70:a\0"                                        \
-       "mtdids=nor0=app \0"                                            \
-       "mtdparts=" MK_STR(MTDPARTS_DEFAULT) "\0"                       \
-   ""
-
-#if defined(CONFIG_UEC_ETH)
-#define CONFIG_HAS_ETH0
-#endif
-
 #endif /* __CONFIG_H */
diff --git a/include/configs/kmsupx5.h b/include/configs/kmsupx5.h
new file mode 100644 (file)
index 0000000..55ed3f6
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <daveliu@freescale.com>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <peterb@logicpd.com>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ * (C) Copyright 2010
+ * Lukas Roggli, KEYMILE Ltd, lukas.roggli@keymile.com
+ *
+ * (C) Copyright 2010-2011
+ * Thomas Reufer, KEYMILE Ltd, thomas.reufer@keymile.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_KMSUPX5         1 /* Keymile PBEC8321 board specific */
+#define CONFIG_HOSTNAME                supx5
+#define CONFIG_KM_BOARD_NAME   "supx5"
+
+#define        CONFIG_SYS_TEXT_BASE    0xF0000000
+
+/* include common defines/options for all 8321 Keymile boards */
+#include "km8321-common.h"
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  2   Local   GPCM    8 bit  256MB   LPXF
+ *  3   Local   not used
+ *
+ */
+
+/*
+ * LPXF on the local bus CS2
+ * Window base at flash base
+ * Window size: 256 MB
+ */
+
+#define        CONFIG_SYS_LPXF_BASE            0xA0000000    /* LPXF */
+#define        CONFIG_SYS_LPXF_SIZE            256 /* Megabytes */
+
+#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_LPXF_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_LPXF_BASE | \
+                                BR_PS_8 | \
+                                BR_MS_GPCM | \
+                                BR_V)
+
+#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_LPXF_SIZE) | \
+                                OR_GPCM_CSNT | \
+                                OR_GPCM_ACS_DIV4 | \
+                                OR_GPCM_SCY_2 | \
+                                (OR_GPCM_TRLX & \
+                                (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
+                                OR_GPCM_EAD)
+
+/* LPXF:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L      (CONFIG_SYS_LPXF_BASE | BATL_PP_10 | \
+                                BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT5U      (CONFIG_SYS_LPXF_BASE | BATU_BL_256M | \
+                                BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT5L      (CONFIG_SYS_LPXF_BASE | BATL_PP_10 | \
+                                BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U      CONFIG_SYS_IBAT5U
+
+/* Bank 3 not used */
+#define CONFIG_SYS_IBAT6L       (0)
+#define CONFIG_SYS_IBAT6U       (0)
+#define CONFIG_SYS_DBAT6L       CONFIG_SYS_IBAT6L
+#define CONFIG_SYS_DBAT6U       CONFIG_SYS_IBAT6U
+
+#endif /* __CONFIG_H */
index 6dec0ee7403565d767548cd50a1e352915fea79b..dcde76c86f201ffb2cbc679f749acc5baa23bcb9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007
+ * (C) Copyright 2007-2011
  * Heiko Schocher, DENX Software Engineering, hs@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
  * (easy to change)
  */
 
-#define CONFIG_MPC8247         1
-#define CONFIG_MPC8272_FAMILY   1
-#define CONFIG_MGCOGE          1
+#define CONFIG_MPC8247
+#define CONFIG_MGCOGE
 #define CONFIG_HOSTNAME                mgcoge
 
 #define        CONFIG_SYS_TEXT_BASE    0xFE000000
 
-#define CONFIG_CPM2            1       /* Has a CPM2 */
-
 /* include common defines/options for all Keymile boards */
 #include "keymile-common.h"
-
-/*
- * Select serial console configuration
- *
- * If either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
- * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
- * for SCC).
- */
-#define        CONFIG_CONS_ON_SMC              /* Console is on SMC         */
-#undef  CONFIG_CONS_ON_SCC             /* It's not on SCC           */
-#undef CONFIG_CONS_NONE                /* It's not on external UART */
-#define CONFIG_CONS_INDEX      2       /* SMC2 is used for console  */
-#define CONFIG_SYS_SMC_RXBUFLEN        128
-#define CONFIG_SYS_MAXIDLE     10
-
-/*
- * Select ethernet configuration
- *
- * If either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected,
- * then CONFIG_ETHER_INDEX must be set to the channel number (1-4 for
- * SCC, 1-3 for FCC)
- *
- * If CONFIG_ETHER_NONE is defined, then either the ethernet routines
- * must be defined elsewhere (as for the console), or CONFIG_CMD_NET
- * must be unset.
- */
-#define        CONFIG_ETHER_ON_SCC             /* Ethernet is on SCC */
-#undef CONFIG_ETHER_ON_FCC             /* Ethernet is not on FCC     */
-#undef CONFIG_ETHER_NONE               /* No external Ethernet   */
-#define CONFIG_NET_MULTI       1
-
-#define CONFIG_ETHER_INDEX     4
-#define CONFIG_HAS_ETH0
-#define CONFIG_SYS_SCC_TOUT_LOOP       10000000
-
-# define CONFIG_SYS_CMXSCR_VALUE       (CMXSCR_RS4CS_CLK7 | CMXSCR_TS4CS_CLK8)
-
-#ifndef CONFIG_8260_CLKIN
-#define CONFIG_8260_CLKIN      66000000        /* in Hz */
-#endif
-
-#define BOOTFLASH_START        FE000000
-#define CONFIG_PRAM    512     /* protected RAM [KBytes] */
-
-#define MTDIDS_DEFAULT         "nor0=boot,nor1=app"
-#define MTDPARTS_DEFAULT       \
-       "mtdparts=boot:384k(u-boot),128k(env),128k(envred),3456k(free);" \
-       "app:3m(esw0),10m(rootfs0),3m(esw1),10m(rootfs1),1m(var),5m(cfg)"
-
-#ifndef CONFIG_KM_DEF_ENV              /* if not set by keymile-common.h */
-#define CONFIG_KM_DEF_ENV "km-common=empty\0"
-#endif
-/*
- * Default environment settings
- */
-#define        CONFIG_EXTRA_ENV_SETTINGS       \
-       CONFIG_KM_DEF_ENV                                               \
-       "rootpath=/opt/eldk/ppc_82xx\0"                                 \
-       "addcon=setenv bootargs ${bootargs} "                           \
-               "console=ttyCPM0,${baudrate}\0"                         \
-       "mtdids=nor0=boot,nor1=app \0"                                  \
-       "partition=nor1,5 \0"                                           \
-       "new_env=prot off FE060000 FE09FFFF; era FE060000 FE09FFFF \0"  \
-       "EEprom_ivm=pca9544a:70:4 \0"                                   \
-       "mtdparts=" MK_STR(MTDPARTS_DEFAULT) "\0"                       \
-       "unlock=yes\0"                                                  \
-       ""
+#include "km-powerpc.h"
 
 #define CONFIG_SYS_SDRAM_BASE          0x00000000
 #define CONFIG_SYS_FLASH_BASE          0xFE000000
 #define CONFIG_SYS_FLASH_SIZE          32
 #define CONFIG_SYS_FLASH_CFI
 #define CONFIG_FLASH_CFI_DRIVER
-#define CONFIG_SYS_MAX_FLASH_BANKS     3       /* max num of flash banks       */
-#define CONFIG_SYS_MAX_FLASH_SECT      512     /* max num of sects on one chip */
+#define CONFIG_SYS_MAX_FLASH_BANKS     3
+/* max num of sects on one chip */
+#define CONFIG_SYS_MAX_FLASH_SECT      512
 
 #define CONFIG_SYS_FLASH_BASE_1        0x50000000
 #define CONFIG_SYS_FLASH_SIZE_1        32
 #define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE, \
                                        CONFIG_SYS_FLASH_BASE_1, \
                                        CONFIG_SYS_FLASH_BASE_2 }
+#define MTDIDS_DEFAULT         "nor3=app"
 
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE
-#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
-#define CONFIG_SYS_RAMBOOT
-#endif
-
-#define CONFIG_SYS_MONITOR_LEN         (384 << 10)     /* Reserve 384KB for Monitor */
-
-#define CONFIG_ENV_IS_IN_FLASH
-
-#ifdef CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_SECT_SIZE   0x20000
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
-#define CONFIG_ENV_OFFSET      CONFIG_SYS_MONITOR_LEN
-
-/* Address and size of Redundant Environment Sector    */
-#define CONFIG_ENV_OFFSET_REDUND       (CONFIG_ENV_OFFSET + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND         (CONFIG_ENV_SIZE)
-#endif /* CONFIG_ENV_IS_IN_FLASH */
-#define CONFIG_ENV_BUFFER_PRINT                1
-
-/* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define        CONFIG_SOFT_I2C         1       /* I2C bit-banged               */
-#define CONFIG_SYS_I2C_SPEED           50000   /* I2C speed and slave address  */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-
-/*
- * Software (bit-bang) I2C driver configuration
- */
-
-#define I2C_PORT       3               /* Port A=0, B=1, C=2, D=3 */
-#define I2C_ACTIVE     (iop->pdir |=  0x00010000)
-#define I2C_TRISTATE   (iop->pdir &= ~0x00010000)
-#define I2C_READ       ((iop->pdat & 0x00010000) != 0)
-#define I2C_SDA(bit)   if(bit) iop->pdat |=  0x00010000; \
-                       else    iop->pdat &= ~0x00010000
-#define I2C_SCL(bit)   if(bit) iop->pdat |=  0x00020000; \
-                       else    iop->pdat &= ~0x00020000
-#define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
-
-/* I2C SYSMON (LM75, AD7414 is almost compatible)                      */
-#define CONFIG_DTT_LM75                1       /* ON Semi's LM75               */
-#define CONFIG_DTT_SENSORS     {0}     /* Sensor addresses             */
-#define CONFIG_SYS_DTT_MAX_TEMP        70
-#define CONFIG_SYS_DTT_LOW_TEMP        -30
-#define CONFIG_SYS_DTT_HYSTERESIS      3
-#define CONFIG_SYS_DTT_BUS_NUM         (CONFIG_SYS_MAX_I2C_BUS)
-
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-
-#define CONFIG_SYS_IMMR                0xF0000000
-
-#define CONFIG_SYS_INIT_RAM_ADDR       CONFIG_SYS_IMMR
-#define CONFIG_SYS_INIT_RAM_SIZE       0x2000  /* Size of used area in DPRAM   */
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-/* Hard reset configuration word */
-#define CONFIG_SYS_HRCW_MASTER         0x0604b211
-
-/* No slaves */
-#define CONFIG_SYS_HRCW_SLAVE1         0
-#define CONFIG_SYS_HRCW_SLAVE2         0
-#define CONFIG_SYS_HRCW_SLAVE3         0
-#define CONFIG_SYS_HRCW_SLAVE4         0
-#define CONFIG_SYS_HRCW_SLAVE5         0
-#define CONFIG_SYS_HRCW_SLAVE6         0
-#define CONFIG_SYS_HRCW_SLAVE7         0
-
-#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
-
-#define CONFIG_SYS_CACHELINE_SIZE      32      /* For MPC8260 CPUs */
-#if defined(CONFIG_CMD_KGDB)
-#  define CONFIG_SYS_CACHELINE_SHIFT   5       /* log base 2 of the above value */
-#endif
-
-#define CONFIG_SYS_HID0_INIT           0
-#define CONFIG_SYS_HID0_FINAL          (HID0_ICE | HID0_IFEM | HID0_ABE)
-
-#define CONFIG_SYS_HID2                0
-
-#define CONFIG_SYS_SIUMCR              0x4020c200
-#define CONFIG_SYS_SYPCR               0xFFFFFFC3
-#define CONFIG_SYS_BCR                 0x10000000
-#define CONFIG_SYS_SCCR                (SCCR_PCI_MODE | SCCR_PCI_MODCK)
-
-/*-----------------------------------------------------------------------
- * RMR - Reset Mode Register                                     5-5
- *-----------------------------------------------------------------------
- * turn on Checkstop Reset Enable
- */
-#define CONFIG_SYS_RMR         0
-
-/*-----------------------------------------------------------------------
- * TMCNTSC - Time Counter Status and Control                     4-40
- *-----------------------------------------------------------------------
- * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
- * and enable Time Counter
- */
-#define CONFIG_SYS_TMCNTSC     (TMCNTSC_SEC|TMCNTSC_ALR|TMCNTSC_TCF|TMCNTSC_TCE)
-
-/*-----------------------------------------------------------------------
- * PISCR - Periodic Interrupt Status and Control                 4-42
- *-----------------------------------------------------------------------
- * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
- * Periodic timer
- */
-#define CONFIG_SYS_PISCR       (PISCR_PS|PISCR_PTF|PISCR_PTE)
-
-/*-----------------------------------------------------------------------
- * RCCR - RISC Controller Configuration                         13-7
- *-----------------------------------------------------------------------
- */
-#define CONFIG_SYS_RCCR        0
-
-/*
- * Init Memory Controller:
- *
- * Bank Bus     Machine PortSz  Device
- * ---- ---     ------- ------  ------
- *  0   60x     GPCM     8 bit  FLASH
- *  1   60x     SDRAM   32 bit  SDRAM
- *  3   60x     GPCM     8 bit  GPIO/PIGGY
- *  5   60x     GPCM    16 bit  CFG-Flash
- *
- */
-/* Bank 0 - FLASH
- */
-#define CONFIG_SYS_BR0_PRELIM  ((CONFIG_SYS_FLASH_BASE & BRx_BA_MSK)   |\
-                        BRx_PS_8                       |\
-                        BRx_MS_GPCM_P                  |\
-                        BRx_V)
-
-#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE)       |\
-                        ORxG_CSNT                      |\
-                        ORxG_ACS_DIV2                  |\
-                        ORxG_SCY_5_CLK                 |\
-                        ORxG_TRLX )
-
-
-/* Bank 1 - 60x bus SDRAM
- */
-#define SDRAM_MAX_SIZE 0x08000000      /* max. 128 MB          */
-#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT  (256 << 20)     /* less than 256 MB */
-
-#define CONFIG_SYS_MPTPR       0x1800
-
-/*-----------------------------------------------------------------------------
- * Address for Mode Register Set (MRS) command
- *-----------------------------------------------------------------------------
- */
-#define CONFIG_SYS_MRS_OFFS    0x00000110
-#define CONFIG_SYS_PSRT        0x0e
-
-#define CONFIG_SYS_BR1_PRELIM  ((CONFIG_SYS_SDRAM_BASE & BRx_BA_MSK)  |\
-                        BRx_PS_64                      |\
-                        BRx_MS_SDRAM_P                 |\
-                        BRx_V)
-
-#define CONFIG_SYS_OR1_PRELIM  CONFIG_SYS_OR1
-
-/* SDRAM initialization values
-*/
-
-#define CONFIG_SYS_OR1    ((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & ORxS_SDAM_MSK) |\
-                        ORxS_BPD_8                     |\
-                        ORxS_ROWST_PBI0_A7             |\
-                        ORxS_NUMR_13)
-
-#define CONFIG_SYS_PSDMR  (PSDMR_SDAM_A14_IS_A5 |\
-                        PSDMR_BSMA_A14_A16           |\
-                        PSDMR_SDA10_PBI0_A9            |\
-                        PSDMR_RFRC_5_CLK               |\
-                        PSDMR_PRETOACT_2W              |\
-                        PSDMR_ACTTORW_2W               |\
-                        PSDMR_LDOTOPRE_1C              |\
-                        PSDMR_WRC_1C                   |\
-                        PSDMR_CL_2)
-
-/* GPIO/PIGGY on CS3 initialization values
-*/
-#define CONFIG_SYS_PIGGY_BASE  0x30000000
-#define CONFIG_SYS_PIGGY_SIZE  128
-
-#define CONFIG_SYS_BR3_PRELIM  ((CONFIG_SYS_PIGGY_BASE & BRx_BA_MSK) |\
-                        BRx_PS_8 | BRx_MS_GPCM_P | BRx_V)
-
-#define CONFIG_SYS_OR3_PRELIM  (MEG_TO_AM(CONFIG_SYS_PIGGY_SIZE) |\
-                        ORxG_CSNT | ORxG_ACS_DIV2 |\
-                        ORxG_SCY_3_CLK | ORxG_TRLX )
-
-/* Board FPGA on CS4 initialization values
-*/
-#define CONFIG_SYS_FPGA_BASE   0x40000000
-#define CONFIG_SYS_FPGA_SIZE   1 /*1KB*/
-
-#define CONFIG_SYS_BR4_PRELIM ((CONFIG_SYS_FPGA_BASE & BRx_BA_MSK) |\
-                       BRx_PS_8 | BRx_MS_GPCM_P | BRx_V)
-
-#define CONFIG_SYS_OR4_PRELIM (P2SZ_TO_AM(CONFIG_SYS_FPGA_SIZE << 10) |\
-                        ORxG_CSNT | ORxG_ACS_DIV2 |\
-                        ORxG_SCY_3_CLK | ORxG_TRLX )
-
-/* CFG-Flash on CS5 initialization values
-*/
-#define CONFIG_SYS_BR5_PRELIM  ((CONFIG_SYS_FLASH_BASE_1 & BRx_BA_MSK) |\
-                        BRx_PS_16 | BRx_MS_GPCM_P | BRx_V)
-
-#define CONFIG_SYS_OR5_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE_1 + \
-                                CONFIG_SYS_FLASH_SIZE_2) |\
-                                ORxG_CSNT | ORxG_ACS_DIV2 |\
-                                ORxG_SCY_5_CLK | ORxG_TRLX )
-
-#define        CONFIG_SYS_RESET_ADDRESS 0xFDFFFFFC     /* "bad" address                */
-
-/* pass open firmware flat tree */
-#define CONFIG_FIT             1
-#define CONFIG_OF_LIBFDT       1
-#define CONFIG_OF_BOARD_SETUP  1
+/* include further common stuff for all keymile 82xx boards */
+#include "km82xx-common.h"
 
-#define OF_TBCLK               (bd->bi_busfreq / 4)
-#define OF_STDOUT_PATH         "/soc/cpm/serial@11a90"
+/* bfticu address */
+#define CONFIG_SYS_BFTICU_BASE          0x40000000
 
 #endif /* __CONFIG_H */
diff --git a/include/configs/mgcoge2ne.h b/include/configs/mgcoge2ne.h
new file mode 100644 (file)
index 0000000..287b717
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * (C) Copyright 2007-2010
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 __MGCOGE2NE
+#define __MGCOGE2NE
+
+/*
+ * High Level Configuration Options
+ * (easy to change)
+ */
+#define CONFIG_MPC8247
+#define CONFIG_MGCOGE
+#define CONFIG_HOSTNAME                mgcoge2ne
+
+#define        CONFIG_SYS_TEXT_BASE    0xFE000000
+
+/* include common defines/options for all Keymile boards */
+#include "keymile-common.h"
+#include "km-powerpc.h"
+
+#define CONFIG_SYS_SDRAM_BASE          0x00000000
+#define CONFIG_SYS_FLASH_BASE          0xFE000000
+#define CONFIG_SYS_FLASH_SIZE          32
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_SYS_MAX_FLASH_BANKS     3       /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT      512     /*
+                                                * max num of sects on one
+                                                * chip
+                                                */
+
+#define CONFIG_SYS_FLASH_BASE_1        0x50000000
+#define CONFIG_SYS_FLASH_SIZE_1        64
+#define CONFIG_SYS_FLASH_SIZE_2        0
+
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE, \
+                                       CONFIG_SYS_FLASH_BASE_1 }
+
+#define MTDIDS_DEFAULT         "nor2=app"
+
+/* include further common stuff for all keymile 82xx boards */
+#include "km82xx-common.h"
+
+#endif /* __MGCOGE2NE */
diff --git a/include/configs/mgcoge2un.h b/include/configs/mgcoge2un.h
new file mode 100644 (file)
index 0000000..d3c7bdc
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Prafulla Wadaskar <prafulla@marvell.com>
+ *
+ * (C) Copyright 2009
+ * Stefan Roese, DENX Software Engineering, sr@denx.de.
+ *
+ * (C) Copyright 2010-2011
+ * Holger Brunck, Keymile GmbH Hannover, holger.brunck@keymile.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/* for linking errors see
+ * http://lists.denx.de/pipermail/u-boot/2009-July/057350.html */
+
+#ifndef _CONFIG_MGCOGE2UN_H
+#define _CONFIG_MGCOGE2UN_H
+
+/* include common defines/options for all arm based Keymile boards */
+#include "km_arm.h"
+
+/*
+ * Version number information
+ */
+#define CONFIG_IDENT_STRING    "\nKeymile MGCOGE2UN"
+
+#define CONFIG_HOSTNAME                        mgcoge2un
+
+#define KM_IVM_BUS     "pca9547:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_ENV_BUS     "pca9547:70:d" /* I2C2 (Mux-Port 5)*/
+
+/*
+ * Default environment variables
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS                                      \
+       CONFIG_KM_DEF_ENV                                               \
+       "newenv=setenv addr 0x100000 && "                               \
+               "i2c dev 1; mw.b ${addr} 0 4 && "                       \
+               "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
+               " ${addr} " xstr(CONFIG_ENV_OFFSET) " 4 && "            \
+               "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
+               " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0"       \
+       "rootpath=/opt/eldk/arm\0"                                      \
+       "EEprom_ivm=" KM_IVM_BUS "\0"                                   \
+       ""
+
+#endif /* _CONFIG_MGCOGE2UN_H */
diff --git a/include/configs/mp2usb.h b/include/configs/mp2usb.h
deleted file mode 100644 (file)
index 8e398d7..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * 2004-2005 Gary Jennejohn <garyj@denx.de>
- *
- * Modified for the MP2USB by (C) Copyright 2005 Eric Benard
- * ebenard@eukrea.com
- *
- * Configuration settings for the MP2USB board.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 __CONFIG_H
-#define __CONFIG_H
-
-#define CONFIG_AT91_LEGACY
-
-/* ARM asynchronous clock */
-#define AT91C_MAIN_CLOCK       179712000       /* from 18.432 MHz crystal (18432000 / 4 * 45) */
-#define AT91C_MASTER_CLOCK     (AT91C_MAIN_CLOCK/3)    /* peripheral clock */
-
-#define AT91_SLOW_CLOCK                32768   /* slow clock */
-
-#define CONFIG_ARM920T         1       /* This is an ARM920T Core      */
-#define CONFIG_AT91RM9200      1       /* It's an Atmel AT91RM9200 SoC */
-#define CONFIG_AT91RM9200DK    1       /* on an AT91RM9200DK Board     */
-#define CONFIG_MP2USB          1       /* on an MP2USB Board           */
-#undef  CONFIG_USE_IRQ                 /* we don't need IRQ/FIQ stuff  */
-#define USE_920T_MMU           1
-
-#define CONFIG_CMDLINE_TAG     1       /* enable passing of ATAGs      */
-#define CONFIG_SETUP_MEMORY_TAGS 1
-#define CONFIG_INITRD_TAG      1
-
-#define CONFIG_SYS_ATMEL_PLL_INIT_BUG  1
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
-#define CONFIG_SYS_USE_MAIN_OSCILLATOR 1
-/* flash */
-#define CONFIG_SYS_EBI_CFGR_VAL        0x00000000
-#define CONFIG_SYS_SMC_CSR0_VAL        0x00003084 /* 16bit, 2 TDF, 4 WS */
-
-/* clocks */
-#define CONFIG_SYS_PLLAR_VAL   0x20263E04 /* 180 MHz for PCK */
-#define CONFIG_SYS_PLLBR_VAL   0x1048bE0E /* 48 MHz (divider by 2 for USB) */
-#define CONFIG_SYS_MCKR_VAL    0x00000202 /* PCK/3 = MCK Master Clock = 60MHz from PLLA */
-
-/* sdram */
-#define CONFIG_SYS_PIOC_ASR_VAL        0xFFFF0000 /* Configure PIOC as peripheral (D16/D31) */
-#define CONFIG_SYS_PIOC_BSR_VAL        0x00000000
-#define CONFIG_SYS_PIOC_PDR_VAL        0xFFFF0000
-#define CONFIG_SYS_EBI_CSA_VAL 0x00000002 /* CS1=CONFIG_SYS_SDRAM */
-#define CONFIG_SYS_SDRC_CR_VAL 0x3211295A /* set up the CONFIG_SYS_SDRAM */
-#define CONFIG_SYS_SDRAM       0x20000000 /* address of the CONFIG_SYS_SDRAM */
-#define CONFIG_SYS_SDRAM1      0x20000020 /* address of the CONFIG_SYS_SDRAM */
-#define CONFIG_SYS_SDRAM_VAL   0x00000000 /* value written to CONFIG_SYS_SDRAM */
-#define CONFIG_SYS_SDRC_MR_VAL 0x00000002 /* Precharge All */
-#define CONFIG_SYS_SDRC_MR_VAL1        0x00000004 /* refresh */
-#define CONFIG_SYS_SDRC_MR_VAL2        0x00000003 /* Load Mode Register */
-#define CONFIG_SYS_SDRC_MR_VAL3        0x00000000 /* Normal Mode */
-#define CONFIG_SYS_SDRC_TR_VAL 0x000002E0 /* Write refresh rate */
-#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
-
-/*
- * Size of malloc() pool
- */
-#define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + 128*1024)
-
-#define CONFIG_BAUDRATE                115200
-
-#define CONFIG_SYS_AT91C_BRGR_DIVISOR  33      /* hardcode so no __divsi3 : AT91C_MASTER_CLOCK /(baudrate * 16) */
-
-/*
- * Hardware drivers
- */
-
-/* define one of these to choose the DBGU, USART0  or USART1 as console */
-#define CONFIG_AT91RM9200_USART
-#define CONFIG_DBGU
-#undef CONFIG_USART0
-#undef CONFIG_USART1
-
-#undef CONFIG_HWFLOW                   /* don't include RTS/CTS flow control support   */
-
-#undef CONFIG_MODEM_SUPPORT            /* disable modem initialization stuff */
-
-#define CONFIG_USB_OHCI_NEW    1
-#define CONFIG_USB_KEYBOARD    1
-#define CONFIG_USB_STORAGE     1
-#define CONFIG_DOS_PARTITION   1
-#define CONFIG_AT91C_PQFP_UHPBUG 1
-
-#undef CONFIG_SYS_USB_OHCI_BOARD_INIT
-#define CONFIG_SYS_USB_OHCI_CPU_INIT           1
-#define CONFIG_SYS_USB_OHCI_REGS_BASE          AT91_USB_HOST_BASE
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME          "at91rm9200"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS     15
-
-#undef CONFIG_HARD_I2C
-
-#ifdef CONFIG_HARD_I2C
-#define CONFIG_SYS_I2C_SPEED           0       /* not used */
-#define CONFIG_SYS_I2C_SLAVE           0       /* not used */
-#define CONFIG_RTC_RS5C372A            /* RICOH I2C RTC */
-#define CONFIG_SYS_I2C_RTC_ADDR        0x32
-#define CONFIG_SYS_I2C_EEPROM_ADDR     0x50
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
-#endif
-/* still about 20 kB free with this defined */
-#define CONFIG_SYS_LONGHELP
-
-#define CONFIG_BOOTDELAY      3
-
-#if !defined(CONFIG_HARD_I2C)
-#define CONFIG_TIMESTAMP
-#endif
-
-
-/*
- * BOOTP options
- */
-#define CONFIG_BOOTP_BOOTFILESIZE
-#define CONFIG_BOOTP_BOOTPATH
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_HOSTNAME
-
-
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_NFS
-#define CONFIG_CMD_SNTP
-
-#if defined(CONFIG_HARD_I2C)
-
-    #define CONFIG_CMD_DATE
-    #define CONFIG_CMD_EEPROM
-    #define CONFIG_CMD_I2C
-    #define CONFIG_CMD_MISC
-
-#else
-
-    #define CONFIG_CMD_CACHE
-    #define CONFIG_CMD_USB
-
-    #undef CONFIG_CMD_BDI
-    #undef CONFIG_CMD_FPGA
-    #undef CONFIG_CMD_IMI
-    #undef CONFIG_CMD_LOADS
-    #undef CONFIG_CMD_MISC
-    #undef CONFIG_CMD_SOURCE
-
-#endif
-
-
-#define CONFIG_SYS_LONGHELP
-
-#define CONFIG_NR_DRAM_BANKS   1
-#define PHYS_SDRAM             0x20000000
-#define PHYS_SDRAM_SIZE                0x08000000      /* 128 megs */
-
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END         CONFIG_SYS_MEMTEST_START + PHYS_SDRAM_SIZE - 262144
-
-#define CONFIG_NET_MULTI               1
-#ifdef CONFIG_NET_MULTI
-#define CONFIG_DRIVER_AT91EMAC         1
-#define CONFIG_SYS_RX_ETH_BUFFER       8
-#else
-#define CONFIG_DRIVER_ETHER            1
-#endif
-#define CONFIG_NET_RETRY_COUNT         20
-#undef CONFIG_AT91C_USE_RMII
-
-#define PHYS_FLASH_1                   0x10000000
-#define PHYS_FLASH_SIZE                        0x1000000  /* 16 megs main flash */
-#define CONFIG_SYS_FLASH_BASE                  PHYS_FLASH_1
-#define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_MAX_FLASH_BANKS             1
-#define CONFIG_SYS_MAX_FLASH_SECT              256
-#define CONFIG_SYS_FLASH_ERASE_TOUT            (2 * CONFIG_SYS_HZ)     /* Timeout for Flash Erase */
-#define CONFIG_SYS_FLASH_WRITE_TOUT            (2 * CONFIG_SYS_HZ)     /* Timeout for Flash Write */
-#define CONFIG_SYS_FLASH_LOCK_TOUT             (10*CONFIG_SYS_HZ)      /* Timeout for Flash Set Lock Bit */
-#define CONFIG_SYS_FLASH_UNLOCK_TOUT           (10*CONFIG_SYS_HZ)      /* Timeout for Flash Clear Lock Bits */
-#define CONFIG_SYS_FLASH_PROTECTION                            /* "Real" (hardware) sectors protection */
-
-#define CONFIG_ENV_IS_IN_FLASH         1
-#define CONFIG_ENV_OFFSET                      0x20000         /* after u-boot.bin */
-#define CONFIG_ENV_ADDR                        (CONFIG_SYS_FLASH_BASE+CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE                        0x20000
-
-#define CONFIG_SYS_LOAD_ADDR           0x21000000  /* default load address */
-
-#define CONFIG_SYS_BAUDRATE_TABLE      { 115200, 57600, 38400, 19200, 9600 }
-
-#define CONFIG_SYS_PROMPT              "=> "           /* Monitor Command Prompt */
-#define CONFIG_SYS_CBSIZE              256             /* Console I/O Buffer Size */
-#define CONFIG_SYS_MAXARGS             32              /* max number of command args */
-#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
-
-#define CONFIG_SYS_STDIO_DEREGISTER           /* needs stdio_deregister */
-
-#define CONFIG_SYS_HZ 1000
-#define CONFIG_SYS_HZ_CLOCK (AT91C_MASTER_CLOCK/2)     /* AT91C_TC0_CMR is implicitly set to */
-                                               /* AT91C_TC_TIMER_DIV1_CLOCK */
-
-#define CONFIG_STACKSIZE       (32*1024)       /* regular stack */
-
-#ifdef CONFIG_USE_IRQ
-#error CONFIG_USE_IRQ not supported
-#endif
-
-#define CONFIG_SYS_DEVICE_NULLDEV       1      /* enble null device            */
-#undef CONFIG_SILENT_CONSOLE           /* enable silent startup        */
-
-#define CONFIG_AUTOBOOT_KEYED
-#define CONFIG_AUTOBOOT_PROMPT \
-       "Press SPACE to abort autoboot in %d seconds\n", bootdelay
-#define CONFIG_AUTOBOOT_STOP_STR " "
-#define CONFIG_AUTOBOOT_DELAY_STR "d"
-
-#define CONFIG_VERSION_VARIABLE        1       /* include version env variable */
-
-#endif /* __CONFIG_H */
index f966325a8e2859a4e59cabb3300cb8104ebeddff..e7ef29809a90114fbe45d58f2ef7cbf9e65ad6d3 100644 (file)
  */
 #define CONFIG_E300            1       /* E300 Family */
 #define CONFIG_MPC512X         1       /* MPC512X family */
-#define CONFIG_FSL_DIU_FB      1       /* FSL DIU */
 
 #define        CONFIG_SYS_TEXT_BASE    0xFFF00000
 
 /* video */
-#undef CONFIG_VIDEO
-
-#ifdef CONFIG_VIDEO
+#ifdef CONFIG_FSL_DIU_FB
+#define CONFIG_SYS_DIU_ADDR    (CONFIG_SYS_IMMR + 0x2100)
+#define CONFIG_VIDEO
 #define CONFIG_CMD_BMP
 #define CONFIG_CFB_CONSOLE
+#define CONFIG_VIDEO_SW_CURSOR
 #define CONFIG_VGA_AS_SINGLE_DEVICE
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
@@ -74,7 +74,6 @@
 #define CONFIG_MISC_INIT_R
 
 #define CONFIG_SYS_IMMR                0x80000000
-#define CONFIG_SYS_DIU_ADDR            (CONFIG_SYS_IMMR+0x2100)
 
 #define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest region */
 #define CONFIG_SYS_MEMTEST_END         0x00400000
index d2798e974bf07b83ab316d7380668e10f44b76f7..5ea59b4ab7a79299322f72066c251710d62681dc 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 
  /* High Level Configuration Options */
 #define CONFIG_ARM1136         1               /* This is an arm1136 CPU core */
index 86c758f2ae76a81268e1f891cbfb6e3372281487..d4c6d16102f19a1c18a4605b5799e9cd9ec949b4 100644 (file)
@@ -30,7 +30,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 
 /* High Level Configuration Options */
 #define CONFIG_ARM1136         1       /* This is an arm1136 CPU core */
index 591d6e1a922edda9fceef6141258cec6cb4d7def..6a785f8b2025b588762d77b290ce41dc17758dff 100644 (file)
@@ -33,6 +33,8 @@
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
+#define CONFIG_SYS_TEXT_BASE   0x97800000
+
 #define CONFIG_L2_OFF
 
 #include <asm/arch/imx-regs.h>
@@ -46,6 +48,8 @@
 #define CONFIG_SETUP_MEMORY_TAGS       1
 #define CONFIG_INITRD_TAG              1
 
+#define CONFIG_OF_LIBFDT               1
+
 /*
  * Size of malloc() pool
  */
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 
+#define CONFIG_OF_LIBFDT
+#define CONFIG_SYS_BOOTMAPSZ   0x800000
+
 #endif
index f2a5752750ef6bcbdc0431e076c2bdbc81c984e7..5749a0866afe26c3ebffa8fc3eae66d31ce1c0df 100644 (file)
@@ -38,6 +38,8 @@
 #define CONFIG_SETUP_MEMORY_TAGS       1
 #define CONFIG_INITRD_TAG              1
 
+#define CONFIG_OF_LIBFDT               1
+
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 
+#define CONFIG_OF_LIBFDT
+#define CONFIG_SYS_BOOTMAPSZ   0x800000
+
 #endif                         /* __CONFIG_H */
index 49a16ab2066082c05a2fa2fe4d0903913685ef4d..758f19dc49d045cb90b6e75449275c14ec08aa9d 100644 (file)
 #define PHYS_SDRAM_1_SIZE      0x04000000      /* 64 MB */
 #define PHYS_SDRAM_2           0x08000000      /* SDR-SDRAM BANK #2*/
 #define PHYS_SDRAM_2_SIZE      0x04000000      /* 64 MB */
+#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
+#define CONFIG_SYS_SDRAM_SIZE  (PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE)
+/* The IPL loads us at 0, tell so to u-boot. Put stack pointer 1M into RAM */
+#define CONFIG_SYS_TEXT_BASE    0x00000000
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE + (1<<20))
 
 #define CONFIG_STACKSIZE       (128 * 1024)    /* regular stack */
 #ifdef CONFIG_USE_IRQ
index 7161ab18ca38167794172040799f7afbc9ef7893..2888c7bfbc6f6143467db80aae11f5fe901d95c4 100644 (file)
@@ -38,6 +38,8 @@
 /*#define CONFIG_APTIX           1    #* define if on APTIX test chip */
 /*#define CONFIG_VIRTIO          1    #* Using Virtio simulator */
 
+#define CONFIG_STANDALONE_LOAD_ADDR    0x80300000
+
 /* Clock config to target*/
 #define PRCM_CONFIG_II 1
 /* #define PRCM_CONFIG_III             1 */
index 5cfa4cb69a8b040f2f14591dad378c1237e1b893..bc3c45b754780de7e073a8ed1b3543e3fcc039ee 100644 (file)
 #define CONFIG_MISC_INIT_R
 
 #define CONFIG_OF_LIBFDT               1
-/*
- * The early kernel mapping on ARM currently only maps from the base of DRAM
- * to the end of the kernel image.  The kernel is loaded at DRAM base + 0x8000.
- * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
- * so that leaves DRAM base to DRAM base + 0x4000 available.
- */
-#define CONFIG_SYS_BOOTMAPSZ           0x4000
 
 #define CONFIG_CMDLINE_TAG             1       /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS       1
 #define CONFIG_OMAP_HSMMC              1
 #define CONFIG_DOS_PARTITION           1
 
+/* Status LED */
+#define CONFIG_STATUS_LED              1
+#define CONFIG_BOARD_SPECIFIC_LED      1
+#define STATUS_LED_BIT                 0x01
+#define STATUS_LED_STATE               STATUS_LED_ON
+#define STATUS_LED_PERIOD              (CONFIG_SYS_HZ / 2)
+#define STATUS_LED_BIT1                        0x02
+#define STATUS_LED_STATE1              STATUS_LED_ON
+#define STATUS_LED_PERIOD1             (CONFIG_SYS_HZ / 2)
+#define STATUS_LED_BOOT                        STATUS_LED_BIT
+#define STATUS_LED_GREEN               STATUS_LED_BIT1
+
 /* DDR - I use Micron DDR */
 #define CONFIG_OMAP3_MICRON_DDR                1
 
 #define CONFIG_USB_TTY                 1
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
 
+/* USB EHCI */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_EHCI
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
+
 /* commands to include */
 #include <config_cmd_default.h>
 
 
 #define CONFIG_CMD_I2C         /* I2C serial bus support       */
 #define CONFIG_CMD_MMC         /* MMC support                  */
+#define CONFIG_USB_STORAGE     /* USB storage support          */
 #define CONFIG_CMD_NAND                /* NAND support                 */
+#define CONFIG_CMD_LED         /* LED support                  */
 
 #undef CONFIG_CMD_FLASH                /* flinfo, erase, protect       */
 #undef CONFIG_CMD_FPGA         /* FPGA configuration Support   */
        "loadaddr=0x82000000\0" \
        "usbtty=cdc_acm\0" \
        "console=ttyS2,115200n8\0" \
-       "mpurate=500\0" \
+       "mpurate=auto\0" \
        "vram=12M\0" \
        "dvimode=1024x768MR-16@60\0" \
        "defaultdisplay=dvi\0" \
                "omapdss.def_disp=${defaultdisplay} " \
                "root=${nandroot} " \
                "rootfstype=${nandrootfstype}\0" \
-       "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
-       "bootscript=echo Running bootscript from mmc ...; " \
-               "source ${loadaddr}\0" \
+       "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
+       "importbootenv=echo Importing environment from mmc ...; " \
+               "env import -t $loadaddr $filesize\0" \
        "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
        "mmcboot=echo Booting from mmc ...; " \
                "run mmcargs; " \
 
 #define CONFIG_BOOTCOMMAND \
        "if mmc rescan ${mmcdev}; then " \
-               "if run loadbootscript; then " \
-                       "run bootscript; " \
-               "else " \
-                       "if run loaduimage; then " \
-                               "run mmcboot; " \
-                       "else run nandboot; " \
-                       "fi; " \
-               "fi; " \
-       "else run nandboot; fi"
+               "echo SD/MMC found on device ${mmcdev};" \
+               "if run loadbootenv; then " \
+                       "run importbootenv;" \
+               "fi;" \
+               "if test -n $uenvcmd; then " \
+                       "echo Running uenvcmd ...;" \
+                       "run uenvcmd;" \
+               "fi;" \
+               "if run loaduimage; then " \
+                       "run mmcboot;" \
+               "fi;" \
+       "fi;" \
+       "run nandboot;" \
 
 #define CONFIG_AUTO_COMPLETE           1
 /*
 
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
 
-#define CONFIG_SYS_FLASH_BASE          boot_flash_base
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_SYS_FLASH_BASE          PISMO1_NAND_BASE
+#endif
 
 /* Monitor at start of flash */
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
 #define ONENAND_ENV_OFFSET             0x260000 /* environment starts here */
 #define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
 
-#define CONFIG_SYS_ENV_SECT_SIZE       boot_flash_sec
-#define CONFIG_ENV_OFFSET              boot_flash_off
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR                        SMNAND_ENV_OFFSET
 
-#ifndef __ASSEMBLY__
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
-
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
 #define CONFIG_SYS_INIT_RAM_ADDR       0x4020f800
 #define CONFIG_SYS_INIT_RAM_SIZE       0x800
index 5bdb3fd9ed9efa61d6339b649f8fffd061d55b97..5ec079c2412ad7e81b20dd02e9e4001a465f4721 100644 (file)
 
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
 
-#define CONFIG_SYS_FLASH_BASE          boot_flash_base
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_SYS_FLASH_BASE          PISMO1_NAND_BASE
+#elif defined(CONFIG_CMD_ONENAND)
+#define CONFIG_SYS_FLASH_BASE          PISMO1_ONEN_BASE
+#endif
 
 /* Monitor at start of flash */
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_ONENAND_BASE                ONENAND_MAP
 
+#define ONENAND_ENV_OFFSET             0x260000 /* environment starts here */
+#define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
+
 #if defined(CONFIG_CMD_NAND)
 #define CONFIG_NAND_OMAP_GPMC
 #define GPMC_NAND_ECC_LP_x16_LAYOUT    1
 #define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
 #elif defined(CONFIG_CMD_ONENAND)
 #define CONFIG_ENV_IS_IN_ONENAND       1
+#define CONFIG_ENV_OFFSET              ONENAND_ENV_OFFSET
 #endif
-#define ONENAND_ENV_OFFSET             0x260000 /* environment starts here */
-#define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
 
-#define CONFIG_SYS_ENV_SECT_SIZE       boot_flash_sec
-#define CONFIG_ENV_OFFSET              boot_flash_off
-#define CONFIG_ENV_ADDR                        boot_flash_env_addr
-
-#ifndef __ASSEMBLY__
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_ADDR                        CONFIG_ENV_OFFSET
 
 /*
  * Support for relocation
index 1b3d43979d9c987bfc6c9aa6f58aa13ff1513553..c5e997c87af1ff69013f94bc0820c22de4162bae 100644 (file)
@@ -52,6 +52,8 @@
 #define CONFIG_INITRD_TAG              1
 #define CONFIG_REVISION_TAG            1
 
+#define CONFIG_OF_LIBFDT               1
+
 /*
  * Size of malloc() pool
  */
 
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
 
-#define CONFIG_SYS_FLASH_BASE          boot_flash_base
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_SYS_FLASH_BASE          PISMO1_NAND_BASE
+#endif
 
 /* Monitor at start of flash */
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
 #define ONENAND_ENV_OFFSET             0x240000 /* environment starts here */
 #define SMNAND_ENV_OFFSET              0x240000 /* environment starts here */
 
-#define CONFIG_SYS_ENV_SECT_SIZE       boot_flash_sec
-#define CONFIG_ENV_OFFSET              boot_flash_off
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR                        SMNAND_ENV_OFFSET
 
-#ifndef __ASSEMBLY__
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
-
 #if defined(CONFIG_CMD_NET)
 /*----------------------------------------------------------------------------
  * SMSC9211 Ethernet from SMSC9118 family
index 72b0cc223b47c72fe4496cd23678d2e599d28ea6..39c87a8a181aeaf58c9676669a64d0f0e7e92012 100644 (file)
@@ -55,6 +55,8 @@
 #define CONFIG_INITRD_TAG              1
 #define CONFIG_REVISION_TAG            1
 
+#define CONFIG_OF_LIBFDT               1
+
 /*
  * Size of malloc() pool
  */
 
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
 
-#define CONFIG_SYS_FLASH_BASE          boot_flash_base
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_SYS_FLASH_BASE          PISMO1_NAND_BASE
+#endif
 
 /* Monitor at start of flash */
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
 #define CONFIG_ENV_IS_IN_NAND          1
 #define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
 
-#define CONFIG_SYS_ENV_SECT_SIZE       boot_flash_sec
-#define CONFIG_ENV_OFFSET              boot_flash_off
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR                        SMNAND_ENV_OFFSET
 
-#ifndef __ASSEMBLY__
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
-
 #endif                         /* __CONFIG_H */
index 470898152e6bced67d017e2ed7cd8459630d73e5..1d6ba7f4a75a68e73cd89905c4127d2960c19b18 100644 (file)
@@ -71,6 +71,8 @@
 #define CONFIG_INITRD_TAG              1
 #define CONFIG_REVISION_TAG            1
 
+#define CONFIG_OF_LIBFDT               1
+
 /*
  * Size of malloc() pool
  * Total Size Environment - 256k
  *  - rest for filesystem
  */
 
-/*--------------------------------------------------------------------------*/
-
-#ifndef __ASSEMBLY__
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
-
 #endif                         /* __CONFIG_H */
index f7d06521e39fe4b50a605eafcfb9b8ad75e1ffed..5adffb5b4ea318d9b20bb68429e43c13a592255e 100644 (file)
@@ -61,6 +61,8 @@
 #define CONFIG_INITRD_TAG              1
 #define CONFIG_REVISION_TAG            1
 
+#define CONFIG_OF_LIBFDT               1
+
 /*
  * Size of malloc() pool
  */
 
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
 
-#define CONFIG_SYS_FLASH_BASE          boot_flash_base
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_SYS_FLASH_BASE          PISMO1_NAND_BASE
+#endif
 
 /* Monitor at start of flash */
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
 #define ONENAND_ENV_OFFSET             0x260000 /* environment starts here */
 #define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
 
-#define CONFIG_SYS_ENV_SECT_SIZE       boot_flash_sec
-#define CONFIG_ENV_OFFSET              boot_flash_off
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR                        SMNAND_ENV_OFFSET
 
-#ifndef __ASSEMBLY__
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
-
 #endif                         /* __CONFIG_H */
index 73779331ce98def3e53b5c9c7f96a0a5acdbf43a..747c69de3f33a2a55712ba221ca6ea6b816c6305 100644 (file)
@@ -62,6 +62,8 @@
 #define CONFIG_INITRD_TAG              1
 #define CONFIG_REVISION_TAG            1
 
+#define CONFIG_OF_LIBFDT               1
+
 /*
  * Size of malloc() pool
  */
 
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
 
-#define CONFIG_SYS_FLASH_BASE          boot_flash_base
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_SYS_FLASH_BASE          PISMO1_NAND_BASE
+#endif
 
 /* Monitor at start of flash */
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
 #define CONFIG_ENV_IS_IN_NAND          1
 #define SMNAND_ENV_OFFSET              0x0c0000 /* environment starts here */
 
-#define CONFIG_SYS_ENV_SECT_SIZE       boot_flash_sec
-#define CONFIG_ENV_OFFSET              boot_flash_off
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR                        SMNAND_ENV_OFFSET
 
-#ifndef __ASSEMBLY__
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
-
 #endif /* __CONFIG_H */
index 2b03b0f2b629b7b1a300eab2c4919514c0f0831b..ffcc9aa04dcadbd9ca85ff4be8ba1a29d50a9998 100644 (file)
@@ -60,6 +60,8 @@
 #define CONFIG_INITRD_TAG              1
 #define CONFIG_REVISION_TAG            1
 
+#define CONFIG_OF_LIBFDT               1
+
 /*
  * Size of malloc() pool
  * Total Size Environment - 256k
index 9a8bb7334ceb4f8f2d82f92781de2ab28e468c04..8d04d0740630427cee0834580f0229da0ef78ac3 100644 (file)
@@ -56,6 +56,8 @@
 #undef CONFIG_USE_IRQ                          /* no support for IRQs */
 #define CONFIG_MISC_INIT_R
 
+#define CONFIG_OF_LIBFDT               1
+
 #define CONFIG_CMDLINE_TAG             1       /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS       1
 #define CONFIG_INITRD_TAG              1
index 37a22a7c4b8f4a6846e7cd4d1696cd8e7e8fc0be..831af6a7d251123eefcaa76215b0482270fed38b 100644 (file)
@@ -64,8 +64,6 @@
 #define CONFIG_SPLASH_SCREEN
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_VIDEO_XRES      800
-#define CONFIG_VIDEO_YRES      480
 #endif
 
 #define CONFIG_SYS_MPC512X_CLKIN       33333333        /* in Hz */
diff --git a/include/configs/purple.h b/include/configs/purple.h
deleted file mode 100644 (file)
index 25d8ebe..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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
- */
-
-/*
- * This file contains the configuration parameters for the PURPLE board.
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#define CONFIG_MIPS32          1       /* MIPS 5Kc CPU core    */
-#define CONFIG_PURPLE          1       /* on a PURPLE Board    */
-
-#define CPU_CLOCK_RATE 125000000   /* 125 MHz clock for the MIPS core */
-#define ASC_CLOCK_RATE  62500000   /* 62.5 MHz ASC clock              */
-
-#define INFINEON_EBU_BOOTCFG   0xE0CC
-
-#define CONFIG_STACKSIZE       (128 * 1024)
-
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
-
-#define CONFIG_BAUDRATE                19200
-
-/* valid baudrates */
-#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
-
-#define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
-
-#define CONFIG_PREBOOT "echo;" \
-       "echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;" \
-       "echo"
-
-#undef CONFIG_BOOTARGS
-
-#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
-       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
-               "nfsroot=${serverip}:${rootpath}\0"                     \
-       "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
-       "addip=setenv bootargs ${bootargs} "                            \
-               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
-               ":${hostname}:${netdev}:off\0"                          \
-       "addmisc=setenv bootargs ${bootargs} "                          \
-               "console=ttyS0,${baudrate} "                            \
-               "ethaddr=${ethaddr} "                                   \
-               "panic=1\0"                                             \
-       "flash_nfs=run nfsargs addip addmisc;"                          \
-               "bootm ${kernel_addr}\0"                                \
-       "flash_self=run ramargs addip addmisc;"                         \
-               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
-       "net_nfs=tftp 80500000 ${bootfile};"                            \
-               "run nfsargs addip addmisc;bootm\0"                     \
-       "rootpath=/opt/eldk/mips_5KC\0"                                 \
-       "bootfile=/tftpboot/purple/uImage\0"                            \
-       "kernel_addr=B0040000\0"                                        \
-       "ramdisk_addr=B0100000\0"                                       \
-       "u-boot=/tftpboot/purple/u-boot.bin\0"                          \
-       "load=tftp 80500000 ${u-boot}\0"                                \
-       "update=protect off 1:0-4;era 1:0-4;"                           \
-               "cp.b 80500000 B0000000 ${filesize}\0"                  \
-       ""
-#define CONFIG_BOOTCOMMAND     "run flash_self"
-
-
-/*
- * BOOTP options
- */
-#define CONFIG_BOOTP_BOOTFILESIZE
-#define CONFIG_BOOTP_BOOTPATH
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_HOSTNAME
-
-
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_ELF
-
-
-#define CONFIG_SYS_SDRAM_BASE          0x80000000
-
-#define CONFIG_SYS_INIT_SP_OFFSET      0x400000
-
-#define CONFIG_SYS_MALLOC_LEN          128*1024
-
-#define CONFIG_SYS_BOOTPARAMS_LEN      128*1024
-
-/*
- * Miscellaneous configurable options
- */
-#define        CONFIG_SYS_LONGHELP                             /* undef to save memory      */
-#define        CONFIG_SYS_PROMPT               "PURPLE # "     /* Monitor Command Prompt    */
-#define        CONFIG_SYS_CBSIZE               256             /* Console I/O Buffer Size   */
-#define        CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)  /* Print Buffer Size */
-#define CONFIG_SYS_MIPS_TIMER_FREQ     (CPU_CLOCK_RATE/2)
-#define CONFIG_SYS_HZ                  1000
-#define        CONFIG_SYS_MAXARGS              16              /* max number of command args*/
-
-#define        CONFIG_SYS_LOAD_ADDR            0x80500000      /* default load address */
-
-#define CONFIG_SYS_MEMTEST_START       0x80200000
-#define CONFIG_SYS_MEMTEST_END         0x80800000
-
-#define        CONFIG_MISC_INIT_R
-
-/*-----------------------------------------------------------------------
- * FLASH and environment organization
- */
-#define CONFIG_SYS_MAX_FLASH_BANKS     1       /* max number of memory banks */
-#define CONFIG_SYS_MAX_FLASH_SECT      (35)    /* max number of sectors on one chip */
-
-#define PHYS_FLASH_1           0xb0000000 /* Flash Bank #1 */
-
-/* The following #defines are needed to get flash environment right */
-#define        CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
-#define        CONFIG_SYS_MONITOR_LEN          (192 << 10)
-
-#define CONFIG_SYS_FLASH_BASE          PHYS_FLASH_1
-
-/* timeout values are in ticks */
-#define CONFIG_SYS_FLASH_ERASE_TOUT    (6 * CONFIG_SYS_HZ) /* Timeout for Flash Erase */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    (6 * CONFIG_SYS_HZ) /* Timeout for Flash Write */
-
-#define        CONFIG_ENV_IS_IN_FLASH  1
-
-/* Address and size of Primary Environment Sector      */
-#define CONFIG_ENV_ADDR                0xB0008000
-#define CONFIG_ENV_SIZE                0x4000
-
-#define CONFIG_FLASH_32BIT
-#define CONFIG_NR_DRAM_BANKS   1
-
-#define CONFIG_PLB2800_ETHER
-#define CONFIG_NET_MULTI
-
-/*-----------------------------------------------------------------------
- * Cache Configuration
- */
-#define CONFIG_SYS_DCACHE_SIZE         16384
-#define CONFIG_SYS_ICACHE_SIZE         16384
-#define CONFIG_SYS_CACHELINE_SIZE      32
-
-/*
- * Temporary buffer for serial data until the real serial driver
- * is initialised (memtest will destroy this buffer)
- */
-#define CONFIG_SYS_SCONSOLE_ADDR     (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_INIT_SP_OFFSET - \
-                              CONFIG_SYS_DCACHE_SIZE / 2)
-#define CONFIG_SYS_SCONSOLE_SIZE     (CONFIG_SYS_DCACHE_SIZE / 4)
-
-#endif /* __CONFIG_H */
index e2f7a5e9f9fc13f5e61b3024bdb5dadc63ee97ff..c61a689e576fbe48c522f05c105b3fd68f1089b2 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <asm/arch/mx31-regs.h>
+#include <asm/arch/imx-regs.h>
 
  /* High Level Configuration Options */
 #define CONFIG_ARM1136         1       /* This is an arm1136 CPU core */
@@ -52,6 +52,7 @@
 #define CONFIG_SYS_MX31_UART1  1
 
 #define CONFIG_MXC_GPIO
+#define CONFIG_HW_WATCHDOG
 
 #define CONFIG_MXC_SPI
 #define CONFIG_DEFAULT_SPI_BUS 1
index 59eef5658f44a9b8227186c69d32e9ca4eeacb9a..06ce3e2b7c88d969cce0cd6baaed06f0c2fed15c 100644 (file)
@@ -40,4 +40,5 @@
 #define CONFIG_MACH_TYPE               MACH_TYPE_SEABOARD
 #define CONFIG_SYS_BOARD_ODMDATA       0x300d8011 /* lp1, 1GB */
 
+#define CONFIG_BOARD_EARLY_INIT_F
 #endif /* __CONFIG_H */
index b2730a3cecc6d3250cacf54aae6f71662b122c3f..2b6f19ee0c9d22d894629908254c5a6a82dc4c1c 100644 (file)
 
 #define CONFIG_HOSTNAME                        suen3
 
-/*
- *  Environment variables configurations
- */
-#define CONFIG_ENV_IS_IN_EEPROM                /* use EEPROM for environment vars */
-#define CONFIG_SYS_DEF_EEPROM_ADDR     0x50
-#define CONFIG_ENV_EEPROM_IS_ON_I2C    1
-#define CONFIG_SYS_EEPROM_WREN         1
-#define CONFIG_ENV_OFFSET              0x0 /* no bracets! */
-#undef CONFIG_ENV_SIZE
-#define CONFIG_ENV_SIZE                        (0x2000 - CONFIG_ENV_OFFSET)
-#define CONFIG_I2C_ENV_EEPROM_BUS      "pca9547:70:d\0"
-
-/* offset redund: (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) */
-#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
-#define CONFIG_ENV_OFFSET_REDUND       0x2000 /* no bracets! */
-#define CONFIG_ENV_SIZE_REDUND         (CONFIG_ENV_SIZE)
-
-#define CONFIG_CMD_SF
-
-#define CONFIG_SPI_FLASH
-#define CONFIG_HARD_SPI
-#define CONFIG_KIRKWOOD_SPI
-#define CONFIG_SPI_FLASH_STMICRO
-#define CONFIG_ENV_SPI_BUS             0
-#define CONFIG_ENV_SPI_CS              0
-#define CONFIG_ENV_SPI_MAX_HZ          50000000        /* 50Mhz */
-
-#define FLASH_GPIO_PIN                 0x00010000
-
-#define MTDIDS_DEFAULT         "nand0=orion_nand"
-/* test-only: partitioning needs some tuning, this is just for tests */
-#define MTDPARTS_DEFAULT       "mtdparts="                             \
-       "orion_nand:"                                                   \
-               "-(" CONFIG_KM_UBI_PARTITION_NAME ")"
-
-#define        CONFIG_KM_DEF_ENV_UPDATE                                        \
-       "update="                                                       \
-               "spi on;sf probe 0;sf erase 0 50000;"                   \
-               "sf write ${u-boot_addr_r} 0 ${filesize};"              \
-               "spi off\0"
+#define KM_IVM_BUS     "pca9544a:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_ENV_BUS     "pca9544a:70:d" /* I2C2 (Mux-Port 5)*/
 
 /*
  * Default environment variables
  */
 #define CONFIG_EXTRA_ENV_SETTINGS                                      \
        CONFIG_KM_DEF_ENV                                               \
-       "memsize=0x8000000\0"                                           \
        "newenv=setenv addr 0x100000 && "                               \
                "i2c dev 1; mw.b ${addr} 0 4 && "                       \
                "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
@@ -97,7 +58,7 @@
                "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
                " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0"       \
        "rootpath=/opt/eldk/arm\0"                                      \
-       "EEprom_ivm=pca9544a:70:9\0"                                    \
+       "EEprom_ivm=" KM_IVM_BUS "\0"                                   \
        ""
 
 #endif /* _CONFIG_SUEN3_H */
diff --git a/include/configs/suen8.h b/include/configs/suen8.h
new file mode 100644 (file)
index 0000000..3f60bc3
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Prafulla Wadaskar <prafulla@marvell.com>
+ *
+ * (C) Copyright 2009
+ * Stefan Roese, DENX Software Engineering, sr@denx.de.
+ *
+ * (C) Copyright 2010-2011
+ * Holger Brunck, Keymile GmbH Hannover, holger.brunck@keymile.com.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/* for linking errors see
+ * http://lists.denx.de/pipermail/u-boot/2009-July/057350.html */
+
+#ifndef _CONFIG_SUEN8_H
+#define _CONFIG_SUEN8_H
+
+/* include common defines/options for all arm based Keymile boards */
+#include "km_arm.h"
+
+/*
+ * Version number information
+ */
+#define CONFIG_IDENT_STRING    "\nKeymile SUEN8"
+
+#define CONFIG_HOSTNAME                        suen8
+
+#define KM_IVM_BUS     "pca9544a:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_ENV_BUS     "pca9544a:70:d" /* I2C2 (Mux-Port 5)*/
+
+/*
+ * Default environment variables
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS                                      \
+       CONFIG_KM_DEF_ENV                                               \
+       "newenv=setenv addr 0x100000 && "                               \
+               "i2c dev 1; mw.b ${addr} 0 4 && "                       \
+               "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
+               " ${addr} " xstr(CONFIG_ENV_OFFSET) " 4 && "            \
+               "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
+               " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0"       \
+       "rootpath=/opt/eldk/arm\0"                                      \
+       "EEprom_ivm=" KM_IVM_BUS "\0"                                   \
+       ""
+
+#endif /* _CONFIG_SUEN8_H */
diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h
new file mode 100644 (file)
index 0000000..d9eb201
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <daveliu@freescale.com>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <peterb@logicpd.com>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, hs@denx.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; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_SUVD3           /* SUVD3 board specific */
+#define CONFIG_HOSTNAME                suvd3
+#define CONFIG_KM_BOARD_NAME   "suvd3"
+
+#define        CONFIG_SYS_TEXT_BASE    0xF0000000
+
+/* include common defines/options for all 8321 Keymile boards */
+#include "km8321-common.h"
+
+#define CONFIG_SYS_APP1_BASE           0xA0000000
+#define        CONFIG_SYS_APP1_SIZE            256 /* Megabytes */
+#define CONFIG_SYS_APP2_BASE           0xB0000000
+#define        CONFIG_SYS_APP2_SIZE            256 /* Megabytes */
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  2   Local   UPMA    16 bit  256MB APP1
+ *  3   Local   GPCM    16 bit  256MB APP2
+ *
+ */
+
+/*
+ * APP1 on the local bus CS2
+ */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
+                                BR_PS_16 | \
+                                BR_MS_UPMA | \
+                                BR_V)
+#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE))
+
+#define CONFIG_SYS_BR3_PRELIM  (CONFIG_SYS_APP2_BASE | \
+                                BR_PS_16 | \
+                                BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+                                OR_GPCM_CSNT | \
+                                OR_GPCM_ACS_DIV4 | \
+                                OR_GPCM_SCY_3 | \
+                                OR_GPCM_TRLX)
+
+#define CONFIG_SYS_MAMR        (MxMR_GPL_x4DIS | \
+                        0x0000c000 | \
+                        MxMR_WLFx_2X)
+
+#define CONFIG_SYS_LBLAWBAR3_PRELIM    CONFIG_SYS_APP2_BASE
+#define CONFIG_SYS_LBLAWAR3_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+
+/*
+ * MMU Setup
+ */
+
+
+/* APP1:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L      (CONFIG_SYS_APP1_BASE | BATL_PP_10 | \
+                                BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT5U      (CONFIG_SYS_APP1_BASE | BATU_BL_256M | \
+                                BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT5L      (CONFIG_SYS_APP1_BASE | BATL_PP_10 | \
+                                BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U      CONFIG_SYS_IBAT5U
+
+#define CONFIG_SYS_IBAT6L      (CONFIG_SYS_APP2_BASE | BATL_PP_10 | \
+                                BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT6U      (CONFIG_SYS_APP2_BASE | BATU_BL_256M | \
+                                BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT6L      (CONFIG_SYS_APP2_BASE | BATL_PP_10 | \
+                                BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT6U      CONFIG_SYS_IBAT6U
+
+#endif /* __CONFIG_H */
index 042d78915c81f58260edc573db66db45cc941cde..52055e80dcbd03fb6b34800aedcf2228c54fbdc8 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf518-0.0
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_PARA
 
 
index 9036ce34186ea0219f45bf416100dd1cd28668bf..8ded17583c6685e62db40d1a8223baf79304c926 100644 (file)
@@ -11,6 +11,7 @@
 /*
  * Processor Settings
  */
+#define CONFIG_BFIN_CPU             bf537-0.2
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
 
index 4f4374a74bae012bf121a3532278e856fa44da6b..febce35ac1e4546b1ed9a9f9a0dcbc3830bae0b6 100644 (file)
@@ -33,6 +33,8 @@
 #define CONFIG_MACH_TEGRA_GENERIC      /* which is a Tegra generic machine */
 #define CONFIG_L2_OFF                  /* No L2 cache */
 
+#define CONFIG_ENABLE_CORTEXA9         /* enable CPU (A9 complex) */
+
 #include <asm/arch/tegra2.h>           /* get chip and board defs */
 
 /*
@@ -45,6 +47,7 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
 #define CONFIG_CMDLINE_TAG             /* enable passing of ATAGs */
+#define CONFIG_OF_LIBFDT               /* enable passing of devicetree */
 
 /* Environment */
 #define CONFIG_ENV_IS_NOWHERE
diff --git a/include/configs/tuda1.h b/include/configs/tuda1.h
new file mode 100644 (file)
index 0000000..1c0b3e0
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <daveliu@freescale.com>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <peterb@logicpd.com>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ * (C) Copyright 2010-2011
+ * Lukas Roggli, KEYMILE Ltd, lukas.roggli@keymile.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_TUDA1           /* TUDA1 board specific */
+#define CONFIG_HOSTNAME                tuda1
+#define CONFIG_KM_BOARD_NAME   "tuda1"
+
+#define        CONFIG_SYS_TEXT_BASE    0xF0000000
+
+/* include common defines/options for all 8321 Keymile boards */
+#include "km8321-common.h"
+
+#define CONFIG_SYS_APP1_BASE   0xA0000000    /* PAXG */
+#define        CONFIG_SYS_APP1_SIZE    256 /* Megabytes */
+#define CONFIG_SYS_APP2_BASE   0xB0000000    /* PINC3 */
+#define        CONFIG_SYS_APP2_SIZE    256 /* Megabytes */
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR                (LCRR_DBYP | LCRR_EADC_1 | LCRR_CLKDIV_2)
+#define CONFIG_SYS_LBC_LBCR    0x00000000
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  2   Local   GPCM    8 bit  256MB   PAXG
+ *  3   Local   GPCM    8 bit  256MB   PINC3
+ *
+ */
+
+/*
+ * PAXG on the local bus CS2
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
+/* Window size: 256 MB */
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
+                                BR_PS_8 | \
+                                BR_MS_GPCM | \
+                                BR_V)
+
+#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
+                                OR_GPCM_CSNT | \
+                                OR_GPCM_ACS_DIV4 | \
+                                OR_GPCM_SCY_2 | \
+                                (OR_GPCM_TRLX & \
+                                (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
+                                OR_GPCM_EAD)
+/*
+ * PINC3 on the local bus CS3
+ */
+/* Access window base at PINC3 base */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM    CONFIG_SYS_APP2_BASE
+/* Window size: 256 MB */
+#define CONFIG_SYS_LBLAWAR3_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR3_PRELIM  (CONFIG_SYS_APP2_BASE | \
+                                BR_PS_8 |              \
+                                BR_MS_GPCM |           \
+                                BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+                                OR_GPCM_CSNT | \
+                                (OR_GPCM_ACS_DIV2 & /* ACS = 11 */\
+                                (~OR_GPCM_XACS)) |  /* XACS = 0 */\
+                                (OR_GPCM_SCY_2 & \
+                                (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
+                                OR_GPCM_TRLX)
+
+#define CONFIG_SYS_MAMR                (MxMR_GPL_x4DIS | \
+                                0x0000c000 | \
+                                MxMR_WLFx_2X)
+
+/*
+ * MMU Setup
+ */
+/* PAXG:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L      (CONFIG_SYS_APP1_BASE | \
+                                BATL_PP_10 | \
+                                BATL_MEMCOHERENCE)
+/* 512M should also include APP2... */
+#define CONFIG_SYS_IBAT5U      (CONFIG_SYS_APP1_BASE | \
+                                BATU_BL_256M | \
+                                BATU_VS | \
+                                BATU_VP)
+#define CONFIG_SYS_DBAT5L      (CONFIG_SYS_APP1_BASE | \
+                                BATL_PP_10 | \
+                                BATL_CACHEINHIBIT | \
+                                BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U      CONFIG_SYS_IBAT5U
+
+/* PINC3:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT6L      (CONFIG_SYS_APP2_BASE | \
+                                BATL_PP_10 | \
+                                BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT6U      (CONFIG_SYS_APP2_BASE | \
+                                BATU_BL_256M | \
+                                BATU_VS | \
+                                BATU_VP)
+#define CONFIG_SYS_DBAT6L      (CONFIG_SYS_APP2_BASE | \
+                                BATL_PP_10 | \
+                                BATL_CACHEINHIBIT | \
+                                BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT6U      CONFIG_SYS_IBAT6U
+
+#define CONFIG_SYS_IBAT7L      (0)
+#define CONFIG_SYS_IBAT7U      (0)
+#define CONFIG_SYS_DBAT7L      CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U      CONFIG_SYS_IBAT7U
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/tuxa1.h b/include/configs/tuxa1.h
new file mode 100644 (file)
index 0000000..012db96
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <daveliu@freescale.com>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <peterb@logicpd.com>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ * (C) Copyright 2010
+ * Yan Bin, Lukas Roggli, KEYMILE Ltd, lukas.roggli@keymile.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_TUXA1           /* TUXA1 board specific */
+#define CONFIG_HOSTNAME                tuxa1
+#define CONFIG_KM_BOARD_NAME   "tuxa1"
+
+#define        CONFIG_SYS_TEXT_BASE    0xF0000000
+
+/* include common defines/options for all 8321 Keymile boards */
+#include "km8321-common.h"
+
+#define        CONFIG_SYS_LPXF_BASE            0xA0000000    /* LPXF */
+#define        CONFIG_SYS_LPXF_SIZE            256 /* Megabytes */
+#define        CONFIG_SYS_PINC2_BASE           0xB0000000    /* PINC2 */
+#define        CONFIG_SYS_PINC2_SIZE           256 /* Megabytes */
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  2   Local   GPCM    8 bit  256MB   LPXF
+ *  3   Local   GPCM    8 bit  256MB   PINC2
+ *
+ */
+
+/*
+ * LPXF on the local bus CS2
+ * Window base at flash base
+ * Window size: 256 MB
+ */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_LPXF_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM       (CONFIG_SYS_LPXF_BASE | \
+                               BR_PS_8 | \
+                               BR_MS_GPCM | \
+                               BR_V)
+
+#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_LPXF_SIZE) | \
+                                OR_GPCM_CSNT | \
+                                OR_GPCM_ACS_DIV4 | \
+                                OR_GPCM_SCY_2 | \
+                                (OR_GPCM_TRLX & \
+                                (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
+                                OR_GPCM_EAD)
+/*
+ * PINC2 on the local bus CS3
+ * Access window base at PINC2 base
+ * Window size: 256 MB
+ */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM    CONFIG_SYS_PINC2_BASE
+#define CONFIG_SYS_LBLAWAR3_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR3_PRELIM  (CONFIG_SYS_PINC2_BASE | \
+                                BR_PS_8 | \
+                                BR_MS_GPCM | \
+                                BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM  (MEG_TO_AM(CONFIG_SYS_PINC2_SIZE) | \
+                                OR_GPCM_CSNT | \
+                                (OR_GPCM_ACS_DIV2 & /* ACS = 11 */ \
+                                (~OR_GPCM_XACS)) |  /* XACS = 0 */ \
+                                (OR_GPCM_SCY_2 & \
+                                (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
+                                OR_GPCM_TRLX)
+
+#define CONFIG_SYS_MAMR                (MxMR_GPL_x4DIS | \
+                                0x0000c000 | \
+                                MxMR_WLFx_2X)
+
+/*
+ * MMU Setup
+ */
+/* LPXF:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L      (CONFIG_SYS_LPXF_BASE | BATL_PP_10 | \
+                                BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT5U      (CONFIG_SYS_LPXF_BASE | BATU_BL_256M | \
+                                BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT5L      (CONFIG_SYS_LPXF_BASE | BATL_PP_10 | \
+                                BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U      CONFIG_SYS_IBAT5U
+
+/* PINC2:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT6L      (CONFIG_SYS_PINC2_BASE | BATL_PP_10 | \
+                                BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT6U      (CONFIG_SYS_PINC2_BASE | BATU_BL_256M | \
+                                BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT6L      (CONFIG_SYS_PINC2_BASE | BATL_PP_10 | \
+                                BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT6U      CONFIG_SYS_IBAT6U
+
+#define CONFIG_SYS_IBAT7L      (0)
+#define CONFIG_SYS_IBAT7U      (0)
+#define CONFIG_SYS_DBAT7L      CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U      CONFIG_SYS_IBAT7U
+
+#endif /* __CONFIG_H */
index 497cb9198f8e7c33afdd1456572103ad9e39eed3..232baf36199260f70eb7bac47cbfde704275144a 100644 (file)
@@ -61,6 +61,8 @@
 /*
  * I2C bus
  */
+#define CONFIG_I2C_MV                  1
+#define CONFIG_MV_I2C_REG              0x40301680
 #define CONFIG_HARD_I2C                        1
 #define CONFIG_SYS_I2C_SPEED                   50000
 #define CONFIG_SYS_I2C_SLAVE                   0xfe
index a051913ffb27694c1033138176b26449f5fd40a6..17aab5a7bbf0f57c014564eb4f37b5f4dd13d018 100644 (file)
@@ -67,7 +67,7 @@
 #define CONFIG_SPD_EEPROM              /* Use SPD EEPROM for DDR setup */
 #define CONFIG_DDR_SPD
 #define CONFIG_MEM_INIT_VALUE          0xdeadbeef
-#define SPD_EEPROM_ADDRESS1                    0x54
+#define SPD_EEPROM_ADDRESS                     0x54
 #define SPD_EEPROM_OFFSET              0x200   /* OFFSET of SPD in EEPROM */
 #define CONFIG_NUM_DDR_CONTROLLERS     1
 #define CONFIG_DIMM_SLOTS_PER_CTLR     1
index 710e5289c730d92707de2b4589611298799e1306..e895d615a8d53ea12df765676e9b649213fac01e 100644 (file)
@@ -304,14 +304,24 @@ extern unsigned int ddr3_spd_check(const ddr3_spd_eeprom_t *spd);
 #define SPD_MEMTYPE_DDR2_FBDIMM_PROBE  (0x0A)
 #define SPD_MEMTYPE_DDR3       (0x0B)
 
-/*
- * Byte 3 Key Byte / Module Type for DDR3 SPD
- */
-#define SPD_MODULETYPE_RDIMM           (0x01)
-#define SPD_MODULETYPE_UDIMM           (0x02)
-#define SPD_MODULETYPE_SODIMM          (0x03)
-#define SPD_MODULETYPE_MICRODIMM       (0x04)
-#define SPD_MODULETYPE_MINIRDIMM       (0x05)
-#define SPD_MODULETYPE_MINIUDIMM       (0x06)
+/* DIMM Type for DDR2 SPD (according to v1.3) */
+#define DDR2_SPD_DIMMTYPE_UNDEFINED    (0x00)
+#define DDR2_SPD_DIMMTYPE_RDIMM                (0x01)
+#define DDR2_SPD_DIMMTYPE_UDIMM                (0x02)
+#define DDR2_SPD_DIMMTYPE_SO_DIMM      (0x04)
+#define DDR2_SPD_DIMMTYPE_72B_SO_CDIMM (0x06)
+#define DDR2_SPD_DIMMTYPE_72B_SO_RDIMM (0x07)
+#define DDR2_SPD_DIMMTYPE_MICRO_DIMM   (0x08)
+#define DDR2_SPD_DIMMTYPE_MINI_RDIMM   (0x10)
+#define DDR2_SPD_DIMMTYPE_MINI_UDIMM   (0x20)
+
+/* Byte 3 Key Byte / Module Type for DDR3 SPD */
+#define DDR3_SPD_MODULETYPE_MASK       (0x0f)
+#define DDR3_SPD_MODULETYPE_RDIMM      (0x01)
+#define DDR3_SPD_MODULETYPE_UDIMM      (0x02)
+#define DDR3_SPD_MODULETYPE_SO_DIMM    (0x03)
+#define DDR3_SPD_MODULETYPE_MICRO_DIMM (0x04)
+#define DDR3_SPD_MODULETYPE_MINI_RDIMM (0x05)
+#define DDR3_SPD_MODULETYPE_MINI_UDIMM (0x06)
 
 #endif /* _DDR_SPD_H_ */
index 638231166277a65869b0af97b0d47d0d12fe2a11..ddd1bf494605d65f78224daa89684c56f62cf1c0 100644 (file)
@@ -45,7 +45,7 @@ enum {
 
 #define XF_VERSION     6
 
-#if defined(CONFIG_I386)
+#if defined(CONFIG_X86)
 extern gd_t *global_data;
 #endif
 
similarity index 56%
rename from drivers/power/ftpmu010.h
rename to include/faraday/ftpmu010.h
index 8ef7a37148ce1e969a53d21fd8671d0956d18055..77c29a9983debcd175a7c9975219ea93aa2bad9a 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef __FTPMU010_H
 #define __FTPMU010_H
 
+#ifndef __ASSEMBLY__
 struct ftpmu010 {
        unsigned int    IDNMBR0;        /* 0x00 */
        unsigned int    reserved0;      /* 0x04 */
@@ -80,6 +81,7 @@ struct ftpmu010 {
        unsigned int    ED0_RACC;       /* 0xD4 */
        unsigned int    ED1_RACC;       /* 0xD8 */
 };
+#endif /* __ASSEMBLY__ */
 
 /*
  * ID Number 0 Register
@@ -126,21 +128,117 @@ struct ftpmu010 {
 /*
  * Multi-Function Port Setting Register
  */
+#define FTPMU010_MFPSR_DEBUGSEL                (1 << 17)
+#define FTPMU010_MFPSR_DMA0PINSEL      (1 << 16)
+#define FTPMU010_MFPSR_DMA1PINSEL      (1 << 15)
 #define FTPMU010_MFPSR_MODEMPINSEL     (1 << 14)
 #define FTPMU010_MFPSR_AC97CLKOUTSEL   (1 << 13)
+#define FTPMU010_MFPSR_PWM1PINSEL      (1 << 11)
+#define FTPMU010_MFPSR_PWM0PINSEL      (1 << 10)
+#define FTPMU010_MFPSR_IRDACLKSEL      (1 << 9)
+#define FTPMU010_MFPSR_UARTCLKSEL      (1 << 8)
+#define FTPMU010_MFPSR_SSPCLKSEL       (1 << 6)
+#define FTPMU010_MFPSR_I2SCLKSEL       (1 << 5)
+#define FTPMU010_MFPSR_AC97CLKSEL      (1 << 4)
 #define FTPMU010_MFPSR_AC97PINSEL      (1 << 3)
+#define FTPMU010_MFPSR_TRIAHBDIS       (1 << 1)
+#define FTPMU010_MFPSR_TRIAHBDBG       (1 << 0)
 
 /*
  * PLL/DLL Control Register 0
+ * Note:
+ *  1. FTPMU010_PDLLCR0_HCLKOUTDIS:
+ *     Datasheet indicated it starts at bit #21 which was wrong.
+ *  2. FTPMU010_PDLLCR0_DLLFRAG:
+ *     Datasheet indicated it has 2 bit which was wrong.
  */
-#define FTPMU010_PDLLCR0_HCLKOUTDIS(cr0)       (((cr0) >> 20) & 0xf)
-#define FTPMU010_PDLLCR0_DLLFRAG               (1 << 19)
+#define FTPMU010_PDLLCR0_HCLKOUTDIS(cr0)       (((cr0) & 0xf) << 20)
+#define FTPMU010_PDLLCR0_DLLFRAG(cr0)          (1 << 19)
 #define FTPMU010_PDLLCR0_DLLSTSEL              (1 << 18)
 #define FTPMU010_PDLLCR0_DLLSTABLE             (1 << 17)
 #define FTPMU010_PDLLCR0_DLLDIS                        (1 << 16)
-#define FTPMU010_PDLLCR0_PLL1NS(cr0)           (((cr0) >> 3) & 0x1ff)
+#define FTPMU010_PDLLCR0_PLL1FRANG(cr0)                (((cr0) & 0x3) << 12)
+#define FTPMU010_PDLLCR0_PLL1NS(cr0)           (((cr0) & 0x1ff) << 3)
 #define FTPMU010_PDLLCR0_PLL1STSEL             (1 << 2)
 #define FTPMU010_PDLLCR0_PLL1STABLE            (1 << 1)
 #define FTPMU010_PDLLCR0_PLL1DIS               (1 << 0)
 
+/*
+ * SDRAM Signal Hold Time Control Register
+ */
+#define FTPMU010_SDRAMHTC_RCLK_DLY(x)          (((x) & 0xf) << 28)
+#define FTPMU010_SDRAMHTC_CTL_WCLK_DLY(x)      (((x) & 0xf) << 24)
+#define FTPMU010_SDRAMHTC_DAT_WCLK_DLY(x)      (((x) & 0xf) << 20)
+#define FTPMU010_SDRAMHTC_EBICTRL_DCSR         (1 << 18)
+#define FTPMU010_SDRAMHTC_EBIDATA_DCSR         (1 << 17)
+#define FTPMU010_SDRAMHTC_SDRAMCS_DCSR         (1 << 16)
+#define FTPMU010_SDRAMHTC_SDRAMCTL_DCSR                (1 << 15)
+#define FTPMU010_SDRAMHTC_CKE_DCSR             (1 << 14)
+#define FTPMU010_SDRAMHTC_DQM_DCSR             (1 << 13)
+#define FTPMU010_SDRAMHTC_SDCLK_DCSR           (1 << 12)
+
+#ifndef __ASSEMBLY__
+void ftpmu010_32768osc_enable(void);
+void ftpmu010_dlldis_disable(void);
+void ftpmu010_sdram_clk_disable(unsigned int cr0);
+#endif
+
+#ifdef __ASSEMBLY__
+#define FTPMU010_IDNMBR0       0x00
+#define FTPMU010_reserved0     0x04
+#define FTPMU010_OSCC          0x08
+#define FTPMU010_PMODE         0x0C
+#define FTPMU010_PMCR          0x10
+#define FTPMU010_PED           0x14
+#define FTPMU010_PEDSR         0x18
+#define FTPMU010_reserved1     0x1C
+#define FTPMU010_PMSR          0x20
+#define FTPMU010_PGSR          0x24
+#define FTPMU010_MFPSR         0x28
+#define FTPMU010_MISC          0x2C
+#define FTPMU010_PDLLCR0       0x30
+#define FTPMU010_PDLLCR1       0x34
+#define FTPMU010_AHBMCLKOFF    0x38
+#define FTPMU010_APBMCLKOFF    0x3C
+#define FTPMU010_DCSRCR0       0x40
+#define FTPMU010_DCSRCR1       0x44
+#define FTPMU010_DCSRCR2       0x48
+#define FTPMU010_SDRAMHTC      0x4C
+#define FTPMU010_PSPR0         0x50
+#define FTPMU010_PSPR1         0x54
+#define FTPMU010_PSPR2         0x58
+#define FTPMU010_PSPR3         0x5C
+#define FTPMU010_PSPR4         0x60
+#define FTPMU010_PSPR5         0x64
+#define FTPMU010_PSPR6         0x68
+#define FTPMU010_PSPR7         0x6C
+#define FTPMU010_PSPR8         0x70
+#define FTPMU010_PSPR9         0x74
+#define FTPMU010_PSPR10                0x78
+#define FTPMU010_PSPR11                0x7C
+#define FTPMU010_PSPR12                0x80
+#define FTPMU010_PSPR13                0x84
+#define FTPMU010_PSPR14                0x88
+#define FTPMU010_PSPR15                0x8C
+#define FTPMU010_AHBDMA_RACCS  0x90
+#define FTPMU010_reserved2     0x94
+#define FTPMU010_reserved3     0x98
+#define FTPMU010_JSS           0x9C
+#define FTPMU010_CFC_RACC      0xA0
+#define FTPMU010_SSP1_RACC     0xA4
+#define FTPMU010_UART1TX_RACC  0xA8
+#define FTPMU010_UART1RX_RACC  0xAC
+#define FTPMU010_UART2TX_RACC  0xB0
+#define FTPMU010_UART2RX_RACC  0xB4
+#define FTPMU010_SDC_RACC      0xB8
+#define FTPMU010_I2SAC97_RACC  0xBC
+#define FTPMU010_IRDATX_RACC   0xC0
+#define FTPMU010_reserved4     0xC4
+#define FTPMU010_USBD_RACC     0xC8
+#define FTPMU010_IRDARX_RACC   0xCC
+#define FTPMU010_IRDA_RACC     0xD0
+#define FTPMU010_ED0_RACC      0xD4
+#define FTPMU010_ED1_RACC      0xD8
+#endif /* __ASSEMBLY__ */
+
 #endif /* __FTPMU010_H */
diff --git a/include/faraday/ftwdt010_wdt.h b/include/faraday/ftwdt010_wdt.h
new file mode 100644 (file)
index 0000000..31ca768
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Watchdog driver for the FTWDT010 Watch Dog Driver
+ *
+ * (c) Copyright 2004 Faraday Technology Corp. (www.faraday-tech.com)
+ * Based on sa1100_wdt.c by Oleg Drokin <green@crimea.edu>
+ * Based on SoftDog driver by Alan Cox <alan@redhat.com>
+ *
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * 27/11/2004 Initial release, Faraday.
+ * 12/01/2011 Port to u-boot, Macpaul Lin.
+ */
+
+#ifndef __FTWDT010_H
+#define __FTWDT010_H
+
+struct ftwdt010_wdt {
+       unsigned int    wdcounter;      /* Counter Reg          - 0x00 */
+       unsigned int    wdload;         /* Counter Auto Reload Reg - 0x04 */
+       unsigned int    wdrestart;      /* Counter Restart Reg  - 0x08 */
+       unsigned int    wdcr;           /* Control Reg          - 0x0c */
+       unsigned int    wdstatus;       /* Status Reg           - 0x10 */
+       unsigned int    wdclear;        /* Timer Clear          - 0x14 */
+       unsigned int    wdintrlen;      /* Interrupt Length     - 0x18 */
+};
+
+/*
+ * WDLOAD - Counter Auto Reload Register
+ *   The Auto Reload Register is set to 0x03EF1480 (66Mhz) by default.
+ *   Which means in a 66MHz system, the period of Watch Dog timer reset is
+ *   one second.
+ */
+#define FTWDT010_WDLOAD(x)             ((x) & 0xffffffff)
+
+/*
+ * WDRESTART - Watch Dog Timer Counter Restart Register
+ *   If writing 0x5AB9 to WDRESTART register, Watch Dog timer will
+ *   automatically reload WDLOAD to WDCOUNTER and restart counting.
+ */
+#define FTWDT010_WDRESTART_MAGIC       0x5AB9
+
+/* WDCR - Watch Dog Timer Control Register */
+#define FTWDT010_WDCR_ENABLE           (1 << 0)
+#define FTWDT010_WDCR_RST              (1 << 1)
+#define FTWDT010_WDCR_INTR             (1 << 2)
+/* FTWDT010_WDCR_EXT bit: Watch Dog Timer External Signal Enable */
+#define FTWDT010_WDCR_EXT              (1 << 3)
+/* FTWDT010_WDCR_CLOCK bit: Clock Source: 0: PCLK, 1: EXTCLK.
+ *  The clock source PCLK cannot be gated when system sleeps, even if
+ *  WDCLOCK bit is turned on.
+ *
+ *  Faraday's Watch Dog timer can be driven by an external clock. The
+ *  programmer just needs to write one to WdCR[WdClock] bit.
+ *
+ *  Note: There is a limitation between EXTCLK and PCLK:
+ *  EXTCLK cycle time / PCLK cycle time > 2.
+ *  If the system does not need an external clock,
+ *  just keep WdCR[WdClock] bit in its default value.
+ */
+#define FTWDT010_WDCR_CLOCK            (1 << 4)
+
+/*
+ * WDSTATUS - Watch Dog Timer Status Register
+ *   This bit is set when the counter reaches Zero
+ */
+#define FTWDT010_WDSTATUS(x)           ((x) & 0x1)
+
+/*
+ * WDCLEAR - Watch Dog Timer Clear Register
+ *   Writing one to this register will clear WDSTATUS.
+ */
+#define FTWDT010_WDCLEAR               (1 << 0)
+
+/*
+ * WDINTRLEN - Watch Dog Timer Interrupt Length
+ *   This register controls the duration length of wd_rst, wd_intr and wd_ext.
+ *   The default value is 0xFF.
+ */
+#define FTWDT010_WDINTRLEN(x)          ((x) & 0xff)
+
+/*
+ * Variable timeout should be set in ms.
+ * (CONFIG_SYS_CLK_FREQ/1000) equals 1 ms.
+ * WDLOAD = timeout * TIMEOUT_FACTOR.
+ */
+#define FTWDT010_TIMEOUT_FACTOR                (CONFIG_SYS_CLK_FREQ / 1000) /* 1 ms */
+
+void ftwdt010_wdt_reset(void);
+void ftwdt010_wdt_disable(void);
+
+#endif /* __FTWDT010_H */
index 1b6821a0e91c30522bcbdc170d056d85fbeb0f7f..0ca70d9c9cc632bb87e0d3d2e02669d0598c87e5 100644 (file)
@@ -92,6 +92,7 @@ typedef unsigned long flash_sect_t;
 /* Prototypes */
 
 extern unsigned long flash_init (void);
+extern void flash_protect_default(void);
 extern void flash_print_info (flash_info_t *);
 extern int flash_erase (flash_info_t *, int, int);
 extern int flash_sect_erase (ulong addr_first, ulong addr_last);
index 87443e10c26bf835ae29175a4145eafb0edd00bb..4c89f4b8b7d9f12506504cba29cfeee00d95ad83 100644 (file)
@@ -1,6 +1,7 @@
 /*
- * Copyright 2007 Freescale Semiconductor, Inc.
- * York Sun <yorksun@freescale.com>
+ * Copyright 2007, 2011 Freescale Semiconductor, Inc.
+ * Authors: York Sun <yorksun@freescale.com>
+ *          Timur Tabi <timur@freescale.com>
  *
  * FSL DIU Framebuffer driver
  *
  * MA 02111-1307 USA
  */
 
-struct fb_var_screeninfo {
-       unsigned int xres;              /* visible resolution           */
-       unsigned int yres;
+int fsl_diu_init(int xres, u32 pixel_format, int gamma_fix);
 
-       unsigned int bits_per_pixel;    /* guess what                   */
-
-       /* Timing: All values in pixclocks, except pixclock (of course) */
-       unsigned int pixclock;          /* pixel clock in ps (pico seconds) */
-       unsigned int left_margin;       /* time from sync to picture    */
-       unsigned int right_margin;      /* time from picture to sync    */
-       unsigned int upper_margin;      /* time from sync to picture    */
-       unsigned int lower_margin;
-       unsigned int hsync_len;         /* length of horizontal sync    */
-       unsigned int vsync_len;         /* length of vertical sync      */
-       unsigned int sync;              /* see FB_SYNC_*                */
-       unsigned int vmode;             /* see FB_VMODE_*               */
-       unsigned int rotate;            /* angle we rotate counter clockwise */
-};
-
-struct fb_info {
-       struct fb_var_screeninfo var;   /* Current var */
-       unsigned long smem_start;       /* Start of frame buffer mem */
-                                       /* (physical address) */
-       unsigned int smem_len;          /* Length of frame buffer mem */
-       unsigned int type;              /* see FB_TYPE_*                */
-       unsigned int line_length;       /* length of a line in bytes    */
-
-       char *screen_base;
-       unsigned long screen_size;
-};
-
-
-extern char *fsl_fb_open(struct fb_info **info);
-int fsl_diu_init(int xres, unsigned int pixel_format, int gamma_fix);
-int platform_diu_init(unsigned int *xres, unsigned int *yres);
+/* Prototypes for external board-specific functions */
+int platform_diu_init(unsigned int xres, unsigned int yres, const char *port);
+void diu_set_pixel_clock(unsigned int pixclock);
index 477bbd792e81f4066c4f6d0b4239d798f82afc28..8418bf7f47aa177af9bcd029276646c5525e15b9 100644 (file)
@@ -2,7 +2,7 @@
  * FSL SD/MMC Defines
  *-------------------------------------------------------------------
  *
- * Copyright 2007-2008,2010 Freescale Semiconductor, Inc
+ * Copyright 2007-2008,2010-2011 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
 
 #define WML            0x2e044
 #define WML_WRITE      0x00010000
+#ifdef CONFIG_FSL_SDHC_V2_3
+#define WML_RD_WML_MAX         0x80
+#define WML_WR_WML_MAX         0x80
+#define WML_RD_WML_MAX_VAL     0x0
+#define WML_WR_WML_MAX_VAL     0x0
+#define WML_RD_WML_MASK                0x7f
+#define WML_WR_WML_MASK                0x7f0000
+#else
+#define WML_RD_WML_MAX         0x10
+#define WML_WR_WML_MAX         0x80
+#define WML_RD_WML_MAX_VAL     0x10
+#define WML_WR_WML_MAX_VAL     0x80
 #define WML_RD_WML_MASK        0xff
 #define WML_WR_WML_MASK        0xff0000
+#endif
 
 #define BLKATTR                0x2e004
 #define BLKATTR_CNT(x) ((x & 0xffff) << 16)
diff --git a/include/fsl_mdio.h b/include/fsl_mdio.h
new file mode 100644 (file)
index 0000000..17ca79c
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2009-2010 Freescale Semiconductor, Inc.
+ *     Jun-jie Zhang <b18070@freescale.com>
+ *     Mingkai Hu <Mingkai.hu@freescale.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#ifndef __FSL_PHY_H__
+#define __FSL_PHY_H__
+
+#include <net.h>
+#include <miiphy.h>
+#include <asm/fsl_enet.h>
+
+/* PHY register offsets */
+#define PHY_EXT_PAGE_ACCESS    0x1f
+
+/* MII Management Configuration Register */
+#define MIIMCFG_RESET_MGMT          0x80000000
+#define MIIMCFG_MGMT_CLOCK_SELECT   0x00000007
+#define MIIMCFG_INIT_VALUE         0x00000003
+
+/* MII Management Command Register */
+#define MIIMCOM_READ_CYCLE     0x00000001
+#define MIIMCOM_SCAN_CYCLE     0x00000002
+
+/* MII Management Address Register */
+#define MIIMADD_PHY_ADDR_SHIFT 8
+
+/* MII Management Indicator Register */
+#define MIIMIND_BUSY           0x00000001
+#define MIIMIND_NOTVALID       0x00000004
+
+void tsec_local_mdio_write(struct tsec_mii_mng *phyregs, int port_addr,
+               int dev_addr, int reg, int value);
+int tsec_local_mdio_read(struct tsec_mii_mng *phyregs, int port_addr,
+               int dev_addr, int regnum);
+int tsec_phy_read(struct mii_dev *bus, int addr, int dev_addr, int regnum);
+int tsec_phy_write(struct mii_dev *bus, int addr, int dev_addr, int regnum,
+               u16 value);
+
+struct fsl_pq_mdio_info {
+       struct tsec_mii_mng *regs;
+       char *name;
+};
+int fsl_pq_mdio_init(bd_t *bis, struct fsl_pq_mdio_info *info);
+
+#endif /* __FSL_PHY_H__ */
+
index 1fccd27cc02f16ffa93532b45be1533b0868e49a..c0b1b5c3d74a6876ecd7da9da34677fcb554b09e 100644 (file)
@@ -50,6 +50,9 @@ typedef struct ihs_osd {
        u16 features;
        u16 control;
        u16 xy_size;
+       u16 xy_scale;
+       u16 x_pos;
+       u16 y_pos;
 } ihs_osd_t;
 
 #ifdef CONFIG_IO
@@ -79,7 +82,7 @@ typedef struct ihs_fpga {
        u16 reserved_2[93];     /* 0x0044 */
        u16 reflection_high;    /* 0x00fe */
        ihs_osd_t osd;          /* 0x0100 */
-       u16 reserved_3[892];    /* 0x0108 */
+       u16 reserved_3[88];     /* 0x010e */
        u16 videomem;           /* 0x0800 */
 } ihs_fpga_t;
 #endif
@@ -94,13 +97,13 @@ typedef struct ihs_fpga {
        u16 extended_interrupt; /* 0x001c */
        u16 reserved_1[9];      /* 0x001e */
        ihs_i2c_t i2c;          /* 0x0030 */
-       u16 reserved_2[35];     /* 0x0038 */
-       u16 reflection_high;    /* 0x007e */
-       u16 reserved_3[15];     /* 0x0080 */
+       u16 reserved_2[16];     /* 0x0038 */
+       u16 mpc3w_control;      /* 0x0058 */
+       u16 reserved_3[34];     /* 0x005a */
        u16 videocontrol;       /* 0x009e */
        u16 reserved_4[176];    /* 0x00a0 */
        ihs_osd_t osd;          /* 0x0200 */
-       u16 reserved_5[764];    /* 0x0208 */
+       u16 reserved_5[761];    /* 0x020e */
        u16 videomem;           /* 0x0800 */
 } ihs_fpga_t;
 #endif
index cd23c8ac124cd38075d0330ad4a6a212a4bbcd49..8ceb4c852149425c91377dc2a8d56e2bfd7c6c5a 100644 (file)
  * repeatedly to change the speed and slave addresses.
  */
 void i2c_init(int speed, int slaveaddr);
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
 void i2c_init_board(void);
-#endif
 #ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT
 void i2c_board_late_init(void);
 #endif
index 6a1b7ae844f34529e6dfa4d18ae7887c9f068ea6..8ecc9dd3a53d49a4c6f5227a120ea591e55f752e 100644 (file)
@@ -52,9 +52,16 @@ typedef ulong lbaint_t;
 
 void ide_init(void);
 ulong ide_read(int device, lbaint_t blknr, ulong blkcnt, void *buffer);
-ulong ide_write(int device, lbaint_t blknr, ulong blkcnt, void *buffer);
+ulong ide_write(int device, lbaint_t blknr, ulong blkcnt, const void *buffer);
 
 #if defined(CONFIG_OF_IDE_FIXUP)
 int ide_device_present(int dev);
 #endif
+
+#if defined(CONFIG_IDE_AHB)
+unsigned char ide_read_register(int dev, unsigned int port);
+void ide_write_register(int dev, unsigned int port, unsigned char val);
+void ide_read_data(int dev, ulong *sect_buf, int words);
+void ide_write_data(int dev, ulong *sect_buf, int words);
+#endif
 #endif /* _IDE_H */
index 005e0d24e4d99ac592d823f2a51dbf8dd2e51ecb..c31e862d32252da2bb2356e0f8e6d3f32af0344a 100644 (file)
@@ -336,8 +336,8 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
 #ifdef CONFIG_OF_LIBFDT
 int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *images,
                char **of_flat_tree, ulong *of_size);
-int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
-               char **of_flat_tree, ulong *of_size);
+void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob);
+int boot_relocate_fdt (struct lmb *lmb, char **of_flat_tree, ulong *of_size);
 #endif
 
 #ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
@@ -345,11 +345,10 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
                  ulong *initrd_start, ulong *initrd_end);
 #endif /* CONFIG_SYS_BOOT_RAMDISK_HIGH */
 #ifdef CONFIG_SYS_BOOT_GET_CMDLINE
-int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
-                       ulong bootmap_base);
+int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end);
 #endif /* CONFIG_SYS_BOOT_GET_CMDLINE */
 #ifdef CONFIG_SYS_BOOT_GET_KBD
-int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base);
+int boot_get_kbd (struct lmb *lmb, bd_t **kbd);
 #endif /* CONFIG_SYS_BOOT_GET_KBD */
 #endif /* !USE_HOSTCC */
 
@@ -453,6 +452,7 @@ int image_check_dcrc (const image_header_t *hdr);
 int getenv_yesno (char *var);
 ulong getenv_bootm_low(void);
 phys_size_t getenv_bootm_size(void);
+phys_size_t getenv_bootm_mapsize(void);
 void memmove_wd (void *to, void *from, size_t len, ulong chunksz);
 #endif
 
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
new file mode 100644 (file)
index 0000000..fcb20fe
--- /dev/null
@@ -0,0 +1,721 @@
+/*
+ * ethtool.h: Defines for Linux ethtool.
+ *
+ * Copyright (C) 1998 David S. Miller (davem@redhat.com)
+ * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
+ * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
+ * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
+ *                                christopher.leech@intel.com,
+ *                                scott.feldman@intel.com)
+ * Portions Copyright (C) Sun Microsystems 2008
+ */
+
+#ifndef _LINUX_ETHTOOL_H
+#define _LINUX_ETHTOOL_H
+
+#include <linux/types.h>
+
+/* This should work for both 32 and 64 bit userland. */
+struct ethtool_cmd {
+       __u32   cmd;
+       __u32   supported;      /* Features this interface supports */
+       __u32   advertising;    /* Features this interface advertises */
+       __u16   speed;          /* The forced speed, 10Mb, 100Mb, gigabit */
+       __u8    duplex;         /* Duplex, half or full */
+       __u8    port;           /* Which connector port */
+       __u8    phy_address;
+       __u8    transceiver;    /* Which transceiver to use */
+       __u8    autoneg;        /* Enable or disable autonegotiation */
+       __u8    mdio_support;
+       __u32   maxtxpkt;       /* Tx pkts before generating tx int */
+       __u32   maxrxpkt;       /* Rx pkts before generating rx int */
+       __u16   speed_hi;
+       __u8    eth_tp_mdix;
+       __u8    reserved2;
+       __u32   lp_advertising; /* Features the link partner advertises */
+       __u32   reserved[2];
+};
+
+static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
+                                               __u32 speed)
+{
+
+       ep->speed = (__u16)speed;
+       ep->speed_hi = (__u16)(speed >> 16);
+}
+
+static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
+{
+       return (ep->speed_hi << 16) | ep->speed;
+}
+
+#define ETHTOOL_FWVERS_LEN     32
+#define ETHTOOL_BUSINFO_LEN    32
+/* these strings are set to whatever the driver author decides... */
+struct ethtool_drvinfo {
+       __u32   cmd;
+       char    driver[32];     /* driver short name, "tulip", "eepro100" */
+       char    version[32];    /* driver version string */
+       char    fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
+       char    bus_info[ETHTOOL_BUSINFO_LEN];  /* Bus info for this IF. */
+                               /* For PCI devices, use pci_name(pci_dev). */
+       char    reserved1[32];
+       char    reserved2[12];
+                               /*
+                                * Some struct members below are filled in
+                                * using ops->get_sset_count().  Obtaining
+                                * this info from ethtool_drvinfo is now
+                                * deprecated; Use ETHTOOL_GSSET_INFO
+                                * instead.
+                                */
+       __u32   n_priv_flags;   /* number of flags valid in ETHTOOL_GPFLAGS */
+       __u32   n_stats;        /* number of u64's from ETHTOOL_GSTATS */
+       __u32   testinfo_len;
+       __u32   eedump_len;     /* Size of data from ETHTOOL_GEEPROM (bytes) */
+       __u32   regdump_len;    /* Size of data from ETHTOOL_GREGS (bytes) */
+};
+
+#define SOPASS_MAX     6
+/* wake-on-lan settings */
+struct ethtool_wolinfo {
+       __u32   cmd;
+       __u32   supported;
+       __u32   wolopts;
+       __u8    sopass[SOPASS_MAX]; /* SecureOn(tm) password */
+};
+
+/* for passing single values */
+struct ethtool_value {
+       __u32   cmd;
+       __u32   data;
+};
+
+/* for passing big chunks of data */
+struct ethtool_regs {
+       __u32   cmd;
+       __u32   version; /* driver-specific, indicates different chips/revs */
+       __u32   len; /* bytes */
+       __u8    data[0];
+};
+
+/* for passing EEPROM chunks */
+struct ethtool_eeprom {
+       __u32   cmd;
+       __u32   magic;
+       __u32   offset; /* in bytes */
+       __u32   len; /* in bytes */
+       __u8    data[0];
+};
+
+/* for configuring coalescing parameters of chip */
+struct ethtool_coalesce {
+       __u32   cmd;    /* ETHTOOL_{G,S}COALESCE */
+
+       /* How many usecs to delay an RX interrupt after
+        * a packet arrives.  If 0, only rx_max_coalesced_frames
+        * is used.
+        */
+       __u32   rx_coalesce_usecs;
+
+       /* How many packets to delay an RX interrupt after
+        * a packet arrives.  If 0, only rx_coalesce_usecs is
+        * used.  It is illegal to set both usecs and max frames
+        * to zero as this would cause RX interrupts to never be
+        * generated.
+        */
+       __u32   rx_max_coalesced_frames;
+
+       /* Same as above two parameters, except that these values
+        * apply while an IRQ is being serviced by the host.  Not
+        * all cards support this feature and the values are ignored
+        * in that case.
+        */
+       __u32   rx_coalesce_usecs_irq;
+       __u32   rx_max_coalesced_frames_irq;
+
+       /* How many usecs to delay a TX interrupt after
+        * a packet is sent.  If 0, only tx_max_coalesced_frames
+        * is used.
+        */
+       __u32   tx_coalesce_usecs;
+
+       /* How many packets to delay a TX interrupt after
+        * a packet is sent.  If 0, only tx_coalesce_usecs is
+        * used.  It is illegal to set both usecs and max frames
+        * to zero as this would cause TX interrupts to never be
+        * generated.
+        */
+       __u32   tx_max_coalesced_frames;
+
+       /* Same as above two parameters, except that these values
+        * apply while an IRQ is being serviced by the host.  Not
+        * all cards support this feature and the values are ignored
+        * in that case.
+        */
+       __u32   tx_coalesce_usecs_irq;
+       __u32   tx_max_coalesced_frames_irq;
+
+       /* How many usecs to delay in-memory statistics
+        * block updates.  Some drivers do not have an in-memory
+        * statistic block, and in such cases this value is ignored.
+        * This value must not be zero.
+        */
+       __u32   stats_block_coalesce_usecs;
+
+       /* Adaptive RX/TX coalescing is an algorithm implemented by
+        * some drivers to improve latency under low packet rates and
+        * improve throughput under high packet rates.  Some drivers
+        * only implement one of RX or TX adaptive coalescing.  Anything
+        * not implemented by the driver causes these values to be
+        * silently ignored.
+        */
+       __u32   use_adaptive_rx_coalesce;
+       __u32   use_adaptive_tx_coalesce;
+
+       /* When the packet rate (measured in packets per second)
+        * is below pkt_rate_low, the {rx,tx}_*_low parameters are
+        * used.
+        */
+       __u32   pkt_rate_low;
+       __u32   rx_coalesce_usecs_low;
+       __u32   rx_max_coalesced_frames_low;
+       __u32   tx_coalesce_usecs_low;
+       __u32   tx_max_coalesced_frames_low;
+
+       /* When the packet rate is below pkt_rate_high but above
+        * pkt_rate_low (both measured in packets per second) the
+        * normal {rx,tx}_* coalescing parameters are used.
+        */
+
+       /* When the packet rate is (measured in packets per second)
+        * is above pkt_rate_high, the {rx,tx}_*_high parameters are
+        * used.
+        */
+       __u32   pkt_rate_high;
+       __u32   rx_coalesce_usecs_high;
+       __u32   rx_max_coalesced_frames_high;
+       __u32   tx_coalesce_usecs_high;
+       __u32   tx_max_coalesced_frames_high;
+
+       /* How often to do adaptive coalescing packet rate sampling,
+        * measured in seconds.  Must not be zero.
+        */
+       __u32   rate_sample_interval;
+};
+
+/* for configuring RX/TX ring parameters */
+struct ethtool_ringparam {
+       __u32   cmd;    /* ETHTOOL_{G,S}RINGPARAM */
+
+       /* Read only attributes.  These indicate the maximum number
+        * of pending RX/TX ring entries the driver will allow the
+        * user to set.
+        */
+       __u32   rx_max_pending;
+       __u32   rx_mini_max_pending;
+       __u32   rx_jumbo_max_pending;
+       __u32   tx_max_pending;
+
+       /* Values changeable by the user.  The valid values are
+        * in the range 1 to the "*_max_pending" counterpart above.
+        */
+       __u32   rx_pending;
+       __u32   rx_mini_pending;
+       __u32   rx_jumbo_pending;
+       __u32   tx_pending;
+};
+
+/* for configuring link flow control parameters */
+struct ethtool_pauseparam {
+       __u32   cmd;    /* ETHTOOL_{G,S}PAUSEPARAM */
+
+       /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
+        * being true) the user may set 'autonet' here non-zero to have the
+        * pause parameters be auto-negotiated too.  In such a case, the
+        * {rx,tx}_pause values below determine what capabilities are
+        * advertised.
+        *
+        * If 'autoneg' is zero or the link is not being auto-negotiated,
+        * then {rx,tx}_pause force the driver to use/not-use pause
+        * flow control.
+        */
+       __u32   autoneg;
+       __u32   rx_pause;
+       __u32   tx_pause;
+};
+
+#define ETH_GSTRING_LEN                32
+enum ethtool_stringset {
+       ETH_SS_TEST             = 0,
+       ETH_SS_STATS,
+       ETH_SS_PRIV_FLAGS,
+       ETH_SS_NTUPLE_FILTERS,
+       ETH_SS_FEATURES,
+};
+
+/* for passing string sets for data tagging */
+struct ethtool_gstrings {
+       __u32   cmd;            /* ETHTOOL_GSTRINGS */
+       __u32   string_set;     /* string set id e.c. ETH_SS_TEST, etc*/
+       __u32   len;            /* number of strings in the string set */
+       __u8    data[0];
+};
+
+struct ethtool_sset_info {
+       __u32   cmd;            /* ETHTOOL_GSSET_INFO */
+       __u32   reserved;
+       __u64   sset_mask;      /* input: each bit selects an sset to query */
+                               /* output: each bit a returned sset */
+       __u32   data[0];        /* ETH_SS_xxx count, in order, based on bits
+                                  in sset_mask.  One bit implies one
+                                  __u32, two bits implies two
+                                  __u32's, etc. */
+};
+
+enum ethtool_test_flags {
+       ETH_TEST_FL_OFFLINE     = (1 << 0),     /* online / offline */
+       ETH_TEST_FL_FAILED      = (1 << 1),     /* test passed / failed */
+};
+
+/* for requesting NIC test and getting results*/
+struct ethtool_test {
+       __u32   cmd;            /* ETHTOOL_TEST */
+       __u32   flags;          /* ETH_TEST_FL_xxx */
+       __u32   reserved;
+       __u32   len;            /* result length, in number of u64 elements */
+       __u64   data[0];
+};
+
+/* for dumping NIC-specific statistics */
+struct ethtool_stats {
+       __u32   cmd;            /* ETHTOOL_GSTATS */
+       __u32   n_stats;        /* number of u64's being returned */
+       __u64   data[0];
+};
+
+struct ethtool_perm_addr {
+       __u32   cmd;            /* ETHTOOL_GPERMADDR */
+       __u32   size;
+       __u8    data[0];
+};
+
+/* boolean flags controlling per-interface behavior characteristics.
+ * When reading, the flag indicates whether or not a certain behavior
+ * is enabled/present.  When writing, the flag indicates whether
+ * or not the driver should turn on (set) or off (clear) a behavior.
+ *
+ * Some behaviors may read-only (unconditionally absent or present).
+ * If such is the case, return EINVAL in the set-flags operation if the
+ * flag differs from the read-only value.
+ */
+enum ethtool_flags {
+       ETH_FLAG_TXVLAN         = (1 << 7),     /* TX VLAN offload enabled */
+       ETH_FLAG_RXVLAN         = (1 << 8),     /* RX VLAN offload enabled */
+       ETH_FLAG_LRO            = (1 << 15),    /* LRO is enabled */
+       ETH_FLAG_NTUPLE         = (1 << 27),    /* N-tuple filters enabled */
+       ETH_FLAG_RXHASH         = (1 << 28),
+};
+
+/* The following structures are for supporting RX network flow
+ * classification and RX n-tuple configuration. Note, all multibyte
+ * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
+ * be in network byte order.
+ */
+
+/**
+ * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
+ * @ip4src: Source host
+ * @ip4dst: Destination host
+ * @psrc: Source port
+ * @pdst: Destination port
+ * @tos: Type-of-service
+ *
+ * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
+ */
+struct ethtool_tcpip4_spec {
+       __be32  ip4src;
+       __be32  ip4dst;
+       __be16  psrc;
+       __be16  pdst;
+       __u8    tos;
+};
+
+/**
+ * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
+ * @ip4src: Source host
+ * @ip4dst: Destination host
+ * @spi: Security parameters index
+ * @tos: Type-of-service
+ *
+ * This can be used to specify an IPsec transport or tunnel over IPv4.
+ */
+struct ethtool_ah_espip4_spec {
+       __be32  ip4src;
+       __be32  ip4dst;
+       __be32  spi;
+       __u8    tos;
+};
+
+#define        ETH_RX_NFC_IP4  1
+
+/**
+ * struct ethtool_usrip4_spec - general flow specification for IPv4
+ * @ip4src: Source host
+ * @ip4dst: Destination host
+ * @l4_4_bytes: First 4 bytes of transport (layer 4) header
+ * @tos: Type-of-service
+ * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
+ * @proto: Transport protocol number; mask must be 0
+ */
+struct ethtool_usrip4_spec {
+       __be32  ip4src;
+       __be32  ip4dst;
+       __be32  l4_4_bytes;
+       __u8    tos;
+       __u8    ip_ver;
+       __u8    proto;
+};
+
+
+/**
+ * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
+ * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
+ * @size: On entry, the array size of the user buffer.  On return from
+ *     %ETHTOOL_GRXFHINDIR, the array size of the hardware indirection table.
+ * @ring_index: RX ring/queue index for each hash value
+ */
+struct ethtool_rxfh_indir {
+       __u32   cmd;
+       __u32   size;
+       __u32   ring_index[0];
+};
+
+#define ETHTOOL_FLASH_MAX_FILENAME     128
+enum ethtool_flash_op_type {
+       ETHTOOL_FLASH_ALL_REGIONS       = 0,
+};
+
+/* for passing firmware flashing related parameters */
+struct ethtool_flash {
+       __u32   cmd;
+       __u32   region;
+       char    data[ETHTOOL_FLASH_MAX_FILENAME];
+};
+
+/* for returning and changing feature sets */
+
+/**
+ * struct ethtool_get_features_block - block with state of 32 features
+ * @available: mask of changeable features
+ * @requested: mask of features requested to be enabled if possible
+ * @active: mask of currently enabled features
+ * @never_changed: mask of features not changeable for any device
+ */
+struct ethtool_get_features_block {
+       __u32   available;
+       __u32   requested;
+       __u32   active;
+       __u32   never_changed;
+};
+
+/**
+ * struct ethtool_gfeatures - command to get state of device's features
+ * @cmd: command number = %ETHTOOL_GFEATURES
+ * @size: in: number of elements in the features[] array;
+ *       out: number of elements in features[] needed to hold all features
+ * @features: state of features
+ */
+struct ethtool_gfeatures {
+       __u32   cmd;
+       __u32   size;
+       struct ethtool_get_features_block features[0];
+};
+
+/**
+ * struct ethtool_set_features_block - block with request for 32 features
+ * @valid: mask of features to be changed
+ * @requested: values of features to be changed
+ */
+struct ethtool_set_features_block {
+       __u32   valid;
+       __u32   requested;
+};
+
+/**
+ * struct ethtool_sfeatures - command to request change in device's features
+ * @cmd: command number = %ETHTOOL_SFEATURES
+ * @size: array size of the features[] array
+ * @features: feature change masks
+ */
+struct ethtool_sfeatures {
+       __u32   cmd;
+       __u32   size;
+       struct ethtool_set_features_block features[0];
+};
+
+/*
+ * %ETHTOOL_SFEATURES changes features present in features[].valid to the
+ * values of corresponding bits in features[].requested. Bits in .requested
+ * not set in .valid or not changeable are ignored.
+ *
+ * Returns %EINVAL when .valid contains undefined or never-changable bits
+ * or size is not equal to required number of features words (32-bit blocks).
+ * Returns >= 0 if request was completed; bits set in the value mean:
+ *   %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
+ *     changeable (not present in %ETHTOOL_GFEATURES' features[].available)
+ *     those bits were ignored.
+ *   %ETHTOOL_F_WISH - some or all changes requested were recorded but the
+ *      resulting state of bits masked by .valid is not equal to .requested.
+ *      Probably there are other device-specific constraints on some features
+ *      in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
+ *      here as though ignored bits were cleared.
+ *   %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
+ *      compatibility functions. Requested offload state cannot be properly
+ *      managed by kernel.
+ *
+ * Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
+ * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
+ * for ETH_SS_FEATURES string set. First entry in the table corresponds to least
+ * significant bit in features[0] fields. Empty strings mark undefined features.
+ */
+enum ethtool_sfeatures_retval_bits {
+       ETHTOOL_F_UNSUPPORTED__BIT,
+       ETHTOOL_F_WISH__BIT,
+       ETHTOOL_F_COMPAT__BIT,
+};
+
+#define ETHTOOL_F_UNSUPPORTED   (1 << ETHTOOL_F_UNSUPPORTED__BIT)
+#define ETHTOOL_F_WISH          (1 << ETHTOOL_F_WISH__BIT)
+#define ETHTOOL_F_COMPAT        (1 << ETHTOOL_F_COMPAT__BIT)
+
+/* CMDs currently supported */
+#define ETHTOOL_GSET           0x00000001 /* Get settings. */
+#define ETHTOOL_SSET           0x00000002 /* Set settings. */
+#define ETHTOOL_GDRVINFO       0x00000003 /* Get driver info. */
+#define ETHTOOL_GREGS          0x00000004 /* Get NIC registers. */
+#define ETHTOOL_GWOL           0x00000005 /* Get wake-on-lan options. */
+#define ETHTOOL_SWOL           0x00000006 /* Set wake-on-lan options. */
+#define ETHTOOL_GMSGLVL                0x00000007 /* Get driver message level */
+#define ETHTOOL_SMSGLVL                0x00000008 /* Set driver msg level. */
+#define ETHTOOL_NWAY_RST       0x00000009 /* Restart autonegotiation. */
+/* Get link status for host, i.e. whether the interface *and* the
+ * physical port (if there is one) are up (ethtool_value). */
+#define ETHTOOL_GLINK          0x0000000a
+#define ETHTOOL_GEEPROM                0x0000000b /* Get EEPROM data */
+#define ETHTOOL_SEEPROM                0x0000000c /* Set EEPROM data. */
+#define ETHTOOL_GCOALESCE      0x0000000e /* Get coalesce config */
+#define ETHTOOL_SCOALESCE      0x0000000f /* Set coalesce config. */
+#define ETHTOOL_GRINGPARAM     0x00000010 /* Get ring parameters */
+#define ETHTOOL_SRINGPARAM     0x00000011 /* Set ring parameters. */
+#define ETHTOOL_GPAUSEPARAM    0x00000012 /* Get pause parameters */
+#define ETHTOOL_SPAUSEPARAM    0x00000013 /* Set pause parameters. */
+#define ETHTOOL_GRXCSUM                0x00000014 /* Get RX hw csum enable (ethtool_value) */
+#define ETHTOOL_SRXCSUM                0x00000015 /* Set RX hw csum enable (ethtool_value) */
+#define ETHTOOL_GTXCSUM                0x00000016 /* Get TX hw csum enable (ethtool_value) */
+#define ETHTOOL_STXCSUM                0x00000017 /* Set TX hw csum enable (ethtool_value) */
+#define ETHTOOL_GSG            0x00000018 /* Get scatter-gather enable
+                                           * (ethtool_value) */
+#define ETHTOOL_SSG            0x00000019 /* Set scatter-gather enable
+                                           * (ethtool_value). */
+#define ETHTOOL_TEST           0x0000001a /* execute NIC self-test. */
+#define ETHTOOL_GSTRINGS       0x0000001b /* get specified string set */
+#define ETHTOOL_PHYS_ID                0x0000001c /* identify the NIC */
+#define ETHTOOL_GSTATS         0x0000001d /* get NIC-specific statistics */
+#define ETHTOOL_GTSO           0x0000001e /* Get TSO enable (ethtool_value) */
+#define ETHTOOL_STSO           0x0000001f /* Set TSO enable (ethtool_value) */
+#define ETHTOOL_GPERMADDR      0x00000020 /* Get permanent hardware address */
+#define ETHTOOL_GUFO           0x00000021 /* Get UFO enable (ethtool_value) */
+#define ETHTOOL_SUFO           0x00000022 /* Set UFO enable (ethtool_value) */
+#define ETHTOOL_GGSO           0x00000023 /* Get GSO enable (ethtool_value) */
+#define ETHTOOL_SGSO           0x00000024 /* Set GSO enable (ethtool_value) */
+#define ETHTOOL_GFLAGS         0x00000025 /* Get flags bitmap(ethtool_value) */
+#define ETHTOOL_SFLAGS         0x00000026 /* Set flags bitmap(ethtool_value) */
+#define ETHTOOL_GPFLAGS                0x00000027 /* Get driver-private flags bitmap */
+#define ETHTOOL_SPFLAGS                0x00000028 /* Set driver-private flags bitmap */
+
+#define ETHTOOL_GRXFH          0x00000029 /* Get RX flow hash configuration */
+#define ETHTOOL_SRXFH          0x0000002a /* Set RX flow hash configuration */
+#define ETHTOOL_GGRO           0x0000002b /* Get GRO enable (ethtool_value) */
+#define ETHTOOL_SGRO           0x0000002c /* Set GRO enable (ethtool_value) */
+#define ETHTOOL_GRXRINGS       0x0000002d /* Get RX rings available for LB */
+#define ETHTOOL_GRXCLSRLCNT    0x0000002e /* Get RX class rule count */
+#define ETHTOOL_GRXCLSRULE     0x0000002f /* Get RX classification rule */
+#define ETHTOOL_GRXCLSRLALL    0x00000030 /* Get all RX classification rule */
+#define ETHTOOL_SRXCLSRLDEL    0x00000031 /* Delete RX classification rule */
+#define ETHTOOL_SRXCLSRLINS    0x00000032 /* Insert RX classification rule */
+#define ETHTOOL_FLASHDEV       0x00000033 /* Flash firmware to device */
+#define ETHTOOL_RESET          0x00000034 /* Reset hardware */
+#define ETHTOOL_SRXNTUPLE      0x00000035 /* Add an n-tuple filter to device */
+#define ETHTOOL_GRXNTUPLE      0x00000036 /* Get n-tuple filters from device */
+#define ETHTOOL_GSSET_INFO     0x00000037 /* Get string set info */
+#define ETHTOOL_GRXFHINDIR     0x00000038 /* Get RX flow hash indir'n table */
+#define ETHTOOL_SRXFHINDIR     0x00000039 /* Set RX flow hash indir'n table */
+
+#define ETHTOOL_GFEATURES      0x0000003a /* Get device offload settings */
+#define ETHTOOL_SFEATURES      0x0000003b /* Change device offload settings */
+
+/* compatibility with older code */
+#define SPARC_ETH_GSET         ETHTOOL_GSET
+#define SPARC_ETH_SSET         ETHTOOL_SSET
+
+/* Indicates what features are supported by the interface. */
+#define SUPPORTED_10baseT_Half         (1 << 0)
+#define SUPPORTED_10baseT_Full         (1 << 1)
+#define SUPPORTED_100baseT_Half                (1 << 2)
+#define SUPPORTED_100baseT_Full                (1 << 3)
+#define SUPPORTED_1000baseT_Half       (1 << 4)
+#define SUPPORTED_1000baseT_Full       (1 << 5)
+#define SUPPORTED_Autoneg              (1 << 6)
+#define SUPPORTED_TP                   (1 << 7)
+#define SUPPORTED_AUI                  (1 << 8)
+#define SUPPORTED_MII                  (1 << 9)
+#define SUPPORTED_FIBRE                        (1 << 10)
+#define SUPPORTED_BNC                  (1 << 11)
+#define SUPPORTED_10000baseT_Full      (1 << 12)
+#define SUPPORTED_Pause                        (1 << 13)
+#define SUPPORTED_Asym_Pause           (1 << 14)
+#define SUPPORTED_2500baseX_Full       (1 << 15)
+#define SUPPORTED_Backplane            (1 << 16)
+#define SUPPORTED_1000baseKX_Full      (1 << 17)
+#define SUPPORTED_10000baseKX4_Full    (1 << 18)
+#define SUPPORTED_10000baseKR_Full     (1 << 19)
+#define SUPPORTED_10000baseR_FEC       (1 << 20)
+
+/* Indicates what features are advertised by the interface. */
+#define ADVERTISED_10baseT_Half                (1 << 0)
+#define ADVERTISED_10baseT_Full                (1 << 1)
+#define ADVERTISED_100baseT_Half       (1 << 2)
+#define ADVERTISED_100baseT_Full       (1 << 3)
+#define ADVERTISED_1000baseT_Half      (1 << 4)
+#define ADVERTISED_1000baseT_Full      (1 << 5)
+#define ADVERTISED_Autoneg             (1 << 6)
+#define ADVERTISED_TP                  (1 << 7)
+#define ADVERTISED_AUI                 (1 << 8)
+#define ADVERTISED_MII                 (1 << 9)
+#define ADVERTISED_FIBRE               (1 << 10)
+#define ADVERTISED_BNC                 (1 << 11)
+#define ADVERTISED_10000baseT_Full     (1 << 12)
+#define ADVERTISED_Pause               (1 << 13)
+#define ADVERTISED_Asym_Pause          (1 << 14)
+#define ADVERTISED_2500baseX_Full      (1 << 15)
+#define ADVERTISED_Backplane           (1 << 16)
+#define ADVERTISED_1000baseKX_Full     (1 << 17)
+#define ADVERTISED_10000baseKX4_Full   (1 << 18)
+#define ADVERTISED_10000baseKR_Full    (1 << 19)
+#define ADVERTISED_10000baseR_FEC      (1 << 20)
+
+/* The following are all involved in forcing a particular link
+ * mode for the device for setting things.  When getting the
+ * devices settings, these indicate the current mode and whether
+ * it was foced up into this mode or autonegotiated.
+ */
+
+/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
+#define SPEED_10               10
+#define SPEED_100              100
+#define SPEED_1000             1000
+#define SPEED_2500             2500
+#define SPEED_10000            10000
+
+/* Duplex, half or full. */
+#define DUPLEX_HALF            0x00
+#define DUPLEX_FULL            0x01
+
+/* Which connector port. */
+#define PORT_TP                        0x00
+#define PORT_AUI               0x01
+#define PORT_MII               0x02
+#define PORT_FIBRE             0x03
+#define PORT_BNC               0x04
+#define PORT_DA                        0x05
+#define PORT_NONE              0xef
+#define PORT_OTHER             0xff
+
+/* Which transceiver to use. */
+#define XCVR_INTERNAL          0x00
+#define XCVR_EXTERNAL          0x01
+#define XCVR_DUMMY1            0x02
+#define XCVR_DUMMY2            0x03
+#define XCVR_DUMMY3            0x04
+
+/* Enable or disable autonegotiation.  If this is set to enable,
+ * the forced link modes above are completely ignored.
+ */
+#define AUTONEG_DISABLE                0x00
+#define AUTONEG_ENABLE         0x01
+
+/* Mode MDI or MDI-X */
+#define ETH_TP_MDI_INVALID     0x00
+#define ETH_TP_MDI             0x01
+#define ETH_TP_MDI_X           0x02
+
+/* Wake-On-Lan options. */
+#define WAKE_PHY               (1 << 0)
+#define WAKE_UCAST             (1 << 1)
+#define WAKE_MCAST             (1 << 2)
+#define WAKE_BCAST             (1 << 3)
+#define WAKE_ARP               (1 << 4)
+#define WAKE_MAGIC             (1 << 5)
+#define WAKE_MAGICSECURE       (1 << 6) /* only meaningful if WAKE_MAGIC */
+
+/* L2-L4 network traffic flow types */
+#define        TCP_V4_FLOW     0x01    /* hash or spec (tcp_ip4_spec) */
+#define        UDP_V4_FLOW     0x02    /* hash or spec (udp_ip4_spec) */
+#define        SCTP_V4_FLOW    0x03    /* hash or spec (sctp_ip4_spec) */
+#define        AH_ESP_V4_FLOW  0x04    /* hash only */
+#define        TCP_V6_FLOW     0x05    /* hash only */
+#define        UDP_V6_FLOW     0x06    /* hash only */
+#define        SCTP_V6_FLOW    0x07    /* hash only */
+#define        AH_ESP_V6_FLOW  0x08    /* hash only */
+#define        AH_V4_FLOW      0x09    /* hash or spec (ah_ip4_spec) */
+#define        ESP_V4_FLOW     0x0a    /* hash or spec (esp_ip4_spec) */
+#define        AH_V6_FLOW      0x0b    /* hash only */
+#define        ESP_V6_FLOW     0x0c    /* hash only */
+#define        IP_USER_FLOW    0x0d    /* spec only (usr_ip4_spec) */
+#define        IPV4_FLOW       0x10    /* hash only */
+#define        IPV6_FLOW       0x11    /* hash only */
+#define        ETHER_FLOW      0x12    /* spec only (ether_spec) */
+
+/* L3-L4 network traffic flow hash options */
+#define        RXH_L2DA        (1 << 1)
+#define        RXH_VLAN        (1 << 2)
+#define        RXH_L3_PROTO    (1 << 3)
+#define        RXH_IP_SRC      (1 << 4)
+#define        RXH_IP_DST      (1 << 5)
+#define        RXH_L4_B_0_1    (1 << 6) /* src port in case of TCP/UDP/SCTP */
+#define        RXH_L4_B_2_3    (1 << 7) /* dst port in case of TCP/UDP/SCTP */
+#define        RXH_DISCARD     (1 << 31)
+
+#define        RX_CLS_FLOW_DISC        0xffffffffffffffffULL
+
+/* Reset flags */
+/* The reset() operation must clear the flags for the components which
+ * were actually reset.  On successful return, the flags indicate the
+ * components which were not reset, either because they do not exist
+ * in the hardware or because they cannot be reset independently.  The
+ * driver must never reset any components that were not requested.
+ */
+enum ethtool_reset_flags {
+       /* These flags represent components dedicated to the interface
+        * the command is addressed to.  Shift any flag left by
+        * ETH_RESET_SHARED_SHIFT to reset a shared component of the
+        * same type.
+        */
+       ETH_RESET_MGMT          = 1 << 0,       /* Management processor */
+       ETH_RESET_IRQ           = 1 << 1,       /* Interrupt requester */
+       ETH_RESET_DMA           = 1 << 2,       /* DMA engine */
+       ETH_RESET_FILTER        = 1 << 3,       /* Filtering/flow direction */
+       ETH_RESET_OFFLOAD       = 1 << 4,       /* Protocol offload */
+       ETH_RESET_MAC           = 1 << 5,       /* Media access controller */
+       ETH_RESET_PHY           = 1 << 6,       /* Transceiver/PHY */
+       ETH_RESET_RAM           = 1 << 7,       /* RAM shared between
+                                                * multiple components */
+
+       ETH_RESET_DEDICATED     = 0x0000ffff,   /* All components dedicated to
+                                                * this interface */
+       ETH_RESET_ALL           = 0xffffffff,   /* All components used by this
+                                                * interface, even if shared */
+};
+#define ETH_RESET_SHARED_SHIFT 16
+
+#endif /* _LINUX_ETHTOOL_H */
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
new file mode 100644 (file)
index 0000000..022d772
--- /dev/null
@@ -0,0 +1,278 @@
+/*
+ * linux/mdio.h: definitions for MDIO (clause 45) transceivers
+ * Copyright 2006-2009 Solarflare Communications 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, incorporated herein by reference.
+ */
+
+#ifndef __LINUX_MDIO_H__
+#define __LINUX_MDIO_H__
+
+#include <linux/mii.h>
+
+/* MDIO Manageable Devices (MMDs). */
+#define MDIO_MMD_PMAPMD                1       /* Physical Medium Attachment/
+                                        * Physical Medium Dependent */
+#define MDIO_MMD_WIS           2       /* WAN Interface Sublayer */
+#define MDIO_MMD_PCS           3       /* Physical Coding Sublayer */
+#define MDIO_MMD_PHYXS         4       /* PHY Extender Sublayer */
+#define MDIO_MMD_DTEXS         5       /* DTE Extender Sublayer */
+#define MDIO_MMD_TC            6       /* Transmission Convergence */
+#define MDIO_MMD_AN            7       /* Auto-Negotiation */
+#define MDIO_MMD_C22EXT                29      /* Clause 22 extension */
+#define MDIO_MMD_VEND1         30      /* Vendor specific 1 */
+#define MDIO_MMD_VEND2         31      /* Vendor specific 2 */
+
+/* Generic MDIO registers. */
+#define MDIO_CTRL1             MII_BMCR
+#define MDIO_STAT1             MII_BMSR
+#define MDIO_DEVID1            MII_PHYSID1
+#define MDIO_DEVID2            MII_PHYSID2
+#define MDIO_SPEED             4       /* Speed ability */
+#define MDIO_DEVS1             5       /* Devices in package */
+#define MDIO_DEVS2             6
+#define MDIO_CTRL2             7       /* 10G control 2 */
+#define MDIO_STAT2             8       /* 10G status 2 */
+#define MDIO_PMA_TXDIS         9       /* 10G PMA/PMD transmit disable */
+#define MDIO_PMA_RXDET         10      /* 10G PMA/PMD receive signal detect */
+#define MDIO_PMA_EXTABLE       11      /* 10G PMA/PMD extended ability */
+#define MDIO_PKGID1            14      /* Package identifier */
+#define MDIO_PKGID2            15
+#define MDIO_AN_ADVERTISE      16      /* AN advertising (base page) */
+#define MDIO_AN_LPA            19      /* AN LP abilities (base page) */
+#define MDIO_PHYXS_LNSTAT      24      /* PHY XGXS lane state */
+
+/* Media-dependent registers. */
+#define MDIO_PMA_10GBT_SWAPPOL 130     /* 10GBASE-T pair swap & polarity */
+#define MDIO_PMA_10GBT_TXPWR   131     /* 10GBASE-T TX power control */
+#define MDIO_PMA_10GBT_SNR     133     /* 10GBASE-T SNR margin, lane A.
+                                        * Lanes B-D are numbered 134-136. */
+#define MDIO_PMA_10GBR_FECABLE 170     /* 10GBASE-R FEC ability */
+#define MDIO_PCS_10GBX_STAT1   24      /* 10GBASE-X PCS status 1 */
+#define MDIO_PCS_10GBRT_STAT1  32      /* 10GBASE-R/-T PCS status 1 */
+#define MDIO_PCS_10GBRT_STAT2  33      /* 10GBASE-R/-T PCS status 2 */
+#define MDIO_AN_10GBT_CTRL     32      /* 10GBASE-T auto-negotiation control */
+#define MDIO_AN_10GBT_STAT     33      /* 10GBASE-T auto-negotiation status */
+#define MDIO_AN_EEE_ADV                60      /* EEE advertisement */
+
+/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
+#define MDIO_PMA_LASI_RXCTRL   0x9000  /* RX_ALARM control */
+#define MDIO_PMA_LASI_TXCTRL   0x9001  /* TX_ALARM control */
+#define MDIO_PMA_LASI_CTRL     0x9002  /* LASI control */
+#define MDIO_PMA_LASI_RXSTAT   0x9003  /* RX_ALARM status */
+#define MDIO_PMA_LASI_TXSTAT   0x9004  /* TX_ALARM status */
+#define MDIO_PMA_LASI_STAT     0x9005  /* LASI status */
+
+/* Control register 1. */
+/* Enable extended speed selection */
+#define MDIO_CTRL1_SPEEDSELEXT         (BMCR_SPEED1000 | BMCR_SPEED100)
+/* All speed selection bits */
+#define MDIO_CTRL1_SPEEDSEL            (MDIO_CTRL1_SPEEDSELEXT | 0x003c)
+#define MDIO_CTRL1_FULLDPLX            BMCR_FULLDPLX
+#define MDIO_CTRL1_LPOWER              BMCR_PDOWN
+#define MDIO_CTRL1_RESET               BMCR_RESET
+#define MDIO_PMA_CTRL1_LOOPBACK                0x0001
+#define MDIO_PMA_CTRL1_SPEED1000       BMCR_SPEED1000
+#define MDIO_PMA_CTRL1_SPEED100                BMCR_SPEED100
+#define MDIO_PCS_CTRL1_LOOPBACK                BMCR_LOOPBACK
+#define MDIO_PHYXS_CTRL1_LOOPBACK      BMCR_LOOPBACK
+#define MDIO_AN_CTRL1_RESTART          BMCR_ANRESTART
+#define MDIO_AN_CTRL1_ENABLE           BMCR_ANENABLE
+#define MDIO_AN_CTRL1_XNP              0x2000  /* Enable extended next page */
+
+/* 10 Gb/s */
+#define MDIO_CTRL1_SPEED10G            (MDIO_CTRL1_SPEEDSELEXT | 0x00)
+/* 10PASS-TS/2BASE-TL */
+#define MDIO_CTRL1_SPEED10P2B          (MDIO_CTRL1_SPEEDSELEXT | 0x04)
+
+/* Status register 1. */
+#define MDIO_STAT1_LPOWERABLE          0x0002  /* Low-power ability */
+#define MDIO_STAT1_LSTATUS             BMSR_LSTATUS
+#define MDIO_STAT1_FAULT               0x0080  /* Fault */
+#define MDIO_AN_STAT1_LPABLE           0x0001  /* Link partner AN ability */
+#define MDIO_AN_STAT1_ABLE             BMSR_ANEGCAPABLE
+#define MDIO_AN_STAT1_RFAULT           BMSR_RFAULT
+#define MDIO_AN_STAT1_COMPLETE         BMSR_ANEGCOMPLETE
+#define MDIO_AN_STAT1_PAGE             0x0040  /* Page received */
+#define MDIO_AN_STAT1_XNP              0x0080  /* Extended next page status */
+
+/* Speed register. */
+#define MDIO_SPEED_10G                 0x0001  /* 10G capable */
+#define MDIO_PMA_SPEED_2B              0x0002  /* 2BASE-TL capable */
+#define MDIO_PMA_SPEED_10P             0x0004  /* 10PASS-TS capable */
+#define MDIO_PMA_SPEED_1000            0x0010  /* 1000M capable */
+#define MDIO_PMA_SPEED_100             0x0020  /* 100M capable */
+#define MDIO_PMA_SPEED_10              0x0040  /* 10M capable */
+#define MDIO_PCS_SPEED_10P2B           0x0002  /* 10PASS-TS/2BASE-TL capable */
+
+/* Device present registers. */
+#define MDIO_DEVS_PRESENT(devad)       (1 << (devad))
+#define MDIO_DEVS_PMAPMD               MDIO_DEVS_PRESENT(MDIO_MMD_PMAPMD)
+#define MDIO_DEVS_WIS                  MDIO_DEVS_PRESENT(MDIO_MMD_WIS)
+#define MDIO_DEVS_PCS                  MDIO_DEVS_PRESENT(MDIO_MMD_PCS)
+#define MDIO_DEVS_PHYXS                        MDIO_DEVS_PRESENT(MDIO_MMD_PHYXS)
+#define MDIO_DEVS_DTEXS                        MDIO_DEVS_PRESENT(MDIO_MMD_DTEXS)
+#define MDIO_DEVS_TC                   MDIO_DEVS_PRESENT(MDIO_MMD_TC)
+#define MDIO_DEVS_AN                   MDIO_DEVS_PRESENT(MDIO_MMD_AN)
+#define MDIO_DEVS_C22EXT               MDIO_DEVS_PRESENT(MDIO_MMD_C22EXT)
+#define MDIO_DEVS_VEND1                        MDIO_DEVS_PRESENT(MDIO_MMD_VEND1)
+#define MDIO_DEVS_VEND2                        MDIO_DEVS_PRESENT(MDIO_MMD_VEND2)
+
+
+/* Control register 2. */
+#define MDIO_PMA_CTRL2_TYPE            0x000f  /* PMA/PMD type selection */
+#define MDIO_PMA_CTRL2_10GBCX4         0x0000  /* 10GBASE-CX4 type */
+#define MDIO_PMA_CTRL2_10GBEW          0x0001  /* 10GBASE-EW type */
+#define MDIO_PMA_CTRL2_10GBLW          0x0002  /* 10GBASE-LW type */
+#define MDIO_PMA_CTRL2_10GBSW          0x0003  /* 10GBASE-SW type */
+#define MDIO_PMA_CTRL2_10GBLX4         0x0004  /* 10GBASE-LX4 type */
+#define MDIO_PMA_CTRL2_10GBER          0x0005  /* 10GBASE-ER type */
+#define MDIO_PMA_CTRL2_10GBLR          0x0006  /* 10GBASE-LR type */
+#define MDIO_PMA_CTRL2_10GBSR          0x0007  /* 10GBASE-SR type */
+#define MDIO_PMA_CTRL2_10GBLRM         0x0008  /* 10GBASE-LRM type */
+#define MDIO_PMA_CTRL2_10GBT           0x0009  /* 10GBASE-T type */
+#define MDIO_PMA_CTRL2_10GBKX4         0x000a  /* 10GBASE-KX4 type */
+#define MDIO_PMA_CTRL2_10GBKR          0x000b  /* 10GBASE-KR type */
+#define MDIO_PMA_CTRL2_1000BT          0x000c  /* 1000BASE-T type */
+#define MDIO_PMA_CTRL2_1000BKX         0x000d  /* 1000BASE-KX type */
+#define MDIO_PMA_CTRL2_100BTX          0x000e  /* 100BASE-TX type */
+#define MDIO_PMA_CTRL2_10BT            0x000f  /* 10BASE-T type */
+#define MDIO_PCS_CTRL2_TYPE            0x0003  /* PCS type selection */
+#define MDIO_PCS_CTRL2_10GBR           0x0000  /* 10GBASE-R type */
+#define MDIO_PCS_CTRL2_10GBX           0x0001  /* 10GBASE-X type */
+#define MDIO_PCS_CTRL2_10GBW           0x0002  /* 10GBASE-W type */
+#define MDIO_PCS_CTRL2_10GBT           0x0003  /* 10GBASE-T type */
+
+/* Status register 2. */
+#define MDIO_STAT2_RXFAULT             0x0400  /* Receive fault */
+#define MDIO_STAT2_TXFAULT             0x0800  /* Transmit fault */
+#define MDIO_STAT2_DEVPRST             0xc000  /* Device present */
+#define MDIO_STAT2_DEVPRST_VAL         0x8000  /* Device present value */
+#define MDIO_PMA_STAT2_LBABLE          0x0001  /* PMA loopback ability */
+#define MDIO_PMA_STAT2_10GBEW          0x0002  /* 10GBASE-EW ability */
+#define MDIO_PMA_STAT2_10GBLW          0x0004  /* 10GBASE-LW ability */
+#define MDIO_PMA_STAT2_10GBSW          0x0008  /* 10GBASE-SW ability */
+#define MDIO_PMA_STAT2_10GBLX4         0x0010  /* 10GBASE-LX4 ability */
+#define MDIO_PMA_STAT2_10GBER          0x0020  /* 10GBASE-ER ability */
+#define MDIO_PMA_STAT2_10GBLR          0x0040  /* 10GBASE-LR ability */
+#define MDIO_PMA_STAT2_10GBSR          0x0080  /* 10GBASE-SR ability */
+#define MDIO_PMD_STAT2_TXDISAB         0x0100  /* PMD TX disable ability */
+#define MDIO_PMA_STAT2_EXTABLE         0x0200  /* Extended abilities */
+#define MDIO_PMA_STAT2_RXFLTABLE       0x1000  /* Receive fault ability */
+#define MDIO_PMA_STAT2_TXFLTABLE       0x2000  /* Transmit fault ability */
+#define MDIO_PCS_STAT2_10GBR           0x0001  /* 10GBASE-R capable */
+#define MDIO_PCS_STAT2_10GBX           0x0002  /* 10GBASE-X capable */
+#define MDIO_PCS_STAT2_10GBW           0x0004  /* 10GBASE-W capable */
+#define MDIO_PCS_STAT2_RXFLTABLE       0x1000  /* Receive fault ability */
+#define MDIO_PCS_STAT2_TXFLTABLE       0x2000  /* Transmit fault ability */
+
+/* Transmit disable register. */
+#define MDIO_PMD_TXDIS_GLOBAL          0x0001  /* Global PMD TX disable */
+#define MDIO_PMD_TXDIS_0               0x0002  /* PMD TX disable 0 */
+#define MDIO_PMD_TXDIS_1               0x0004  /* PMD TX disable 1 */
+#define MDIO_PMD_TXDIS_2               0x0008  /* PMD TX disable 2 */
+#define MDIO_PMD_TXDIS_3               0x0010  /* PMD TX disable 3 */
+
+/* Receive signal detect register. */
+#define MDIO_PMD_RXDET_GLOBAL          0x0001  /* Global PMD RX signal detect */
+#define MDIO_PMD_RXDET_0               0x0002  /* PMD RX signal detect 0 */
+#define MDIO_PMD_RXDET_1               0x0004  /* PMD RX signal detect 1 */
+#define MDIO_PMD_RXDET_2               0x0008  /* PMD RX signal detect 2 */
+#define MDIO_PMD_RXDET_3               0x0010  /* PMD RX signal detect 3 */
+
+/* Extended abilities register. */
+#define MDIO_PMA_EXTABLE_10GCX4                0x0001  /* 10GBASE-CX4 ability */
+#define MDIO_PMA_EXTABLE_10GBLRM       0x0002  /* 10GBASE-LRM ability */
+#define MDIO_PMA_EXTABLE_10GBT         0x0004  /* 10GBASE-T ability */
+#define MDIO_PMA_EXTABLE_10GBKX4       0x0008  /* 10GBASE-KX4 ability */
+#define MDIO_PMA_EXTABLE_10GBKR                0x0010  /* 10GBASE-KR ability */
+#define MDIO_PMA_EXTABLE_1000BT                0x0020  /* 1000BASE-T ability */
+#define MDIO_PMA_EXTABLE_1000BKX       0x0040  /* 1000BASE-KX ability */
+#define MDIO_PMA_EXTABLE_100BTX                0x0080  /* 100BASE-TX ability */
+#define MDIO_PMA_EXTABLE_10BT          0x0100  /* 10BASE-T ability */
+
+/* PHY XGXS lane state register. */
+#define MDIO_PHYXS_LNSTAT_SYNC0                0x0001
+#define MDIO_PHYXS_LNSTAT_SYNC1                0x0002
+#define MDIO_PHYXS_LNSTAT_SYNC2                0x0004
+#define MDIO_PHYXS_LNSTAT_SYNC3                0x0008
+#define MDIO_PHYXS_LNSTAT_ALIGN                0x1000
+
+/* PMA 10GBASE-T pair swap & polarity */
+#define MDIO_PMA_10GBT_SWAPPOL_ABNX    0x0001  /* Pair A/B uncrossed */
+#define MDIO_PMA_10GBT_SWAPPOL_CDNX    0x0002  /* Pair C/D uncrossed */
+#define MDIO_PMA_10GBT_SWAPPOL_AREV    0x0100  /* Pair A polarity reversed */
+#define MDIO_PMA_10GBT_SWAPPOL_BREV    0x0200  /* Pair B polarity reversed */
+#define MDIO_PMA_10GBT_SWAPPOL_CREV    0x0400  /* Pair C polarity reversed */
+#define MDIO_PMA_10GBT_SWAPPOL_DREV    0x0800  /* Pair D polarity reversed */
+
+/* PMA 10GBASE-T TX power register. */
+#define MDIO_PMA_10GBT_TXPWR_SHORT     0x0001  /* Short-reach mode */
+
+/* PMA 10GBASE-T SNR registers. */
+/* Value is SNR margin in dB, clamped to range [-127, 127], plus 0x8000. */
+#define MDIO_PMA_10GBT_SNR_BIAS                0x8000
+#define MDIO_PMA_10GBT_SNR_MAX         127
+
+/* PMA 10GBASE-R FEC ability register. */
+#define MDIO_PMA_10GBR_FECABLE_ABLE    0x0001  /* FEC ability */
+#define MDIO_PMA_10GBR_FECABLE_ERRABLE 0x0002  /* FEC error indic. ability */
+
+/* PCS 10GBASE-R/-T status register 1. */
+#define MDIO_PCS_10GBRT_STAT1_BLKLK    0x0001  /* Block lock attained */
+
+/* PCS 10GBASE-R/-T status register 2. */
+#define MDIO_PCS_10GBRT_STAT2_ERR      0x00ff
+#define MDIO_PCS_10GBRT_STAT2_BER      0x3f00
+
+/* AN 10GBASE-T control register. */
+#define MDIO_AN_10GBT_CTRL_ADV10G      0x1000  /* Advertise 10GBASE-T */
+
+/* AN 10GBASE-T status register. */
+#define MDIO_AN_10GBT_STAT_LPTRR       0x0200  /* LP training reset req. */
+#define MDIO_AN_10GBT_STAT_LPLTABLE    0x0400  /* LP loop timing ability */
+#define MDIO_AN_10GBT_STAT_LP10G       0x0800  /* LP is 10GBT capable */
+#define MDIO_AN_10GBT_STAT_REMOK       0x1000  /* Remote OK */
+#define MDIO_AN_10GBT_STAT_LOCOK       0x2000  /* Local OK */
+#define MDIO_AN_10GBT_STAT_MS          0x4000  /* Master/slave config */
+#define MDIO_AN_10GBT_STAT_MSFLT       0x8000  /* Master/slave config fault */
+
+/* AN EEE Advertisement register. */
+#define MDIO_AN_EEE_ADV_100TX          0x0002  /* Advertise 100TX EEE cap */
+#define MDIO_AN_EEE_ADV_1000T          0x0004  /* Advertise 1000T EEE cap */
+
+/* LASI RX_ALARM control/status registers. */
+#define MDIO_PMA_LASI_RX_PHYXSLFLT     0x0001  /* PHY XS RX local fault */
+#define MDIO_PMA_LASI_RX_PCSLFLT       0x0008  /* PCS RX local fault */
+#define MDIO_PMA_LASI_RX_PMALFLT       0x0010  /* PMA/PMD RX local fault */
+#define MDIO_PMA_LASI_RX_OPTICPOWERFLT 0x0020  /* RX optical power fault */
+#define MDIO_PMA_LASI_RX_WISLFLT       0x0200  /* WIS local fault */
+
+/* LASI TX_ALARM control/status registers. */
+#define MDIO_PMA_LASI_TX_PHYXSLFLT     0x0001  /* PHY XS TX local fault */
+#define MDIO_PMA_LASI_TX_PCSLFLT       0x0008  /* PCS TX local fault */
+#define MDIO_PMA_LASI_TX_PMALFLT       0x0010  /* PMA/PMD TX local fault */
+#define MDIO_PMA_LASI_TX_LASERPOWERFLT 0x0080  /* Laser output power fault */
+#define MDIO_PMA_LASI_TX_LASERTEMPFLT  0x0100  /* Laser temperature fault */
+#define MDIO_PMA_LASI_TX_LASERBICURRFLT        0x0200  /* Laser bias current fault */
+
+/* LASI control/status registers. */
+#define MDIO_PMA_LASI_LSALARM          0x0001  /* LS_ALARM enable/status */
+#define MDIO_PMA_LASI_TXALARM          0x0002  /* TX_ALARM enable/status */
+#define MDIO_PMA_LASI_RXALARM          0x0004  /* RX_ALARM enable/status */
+
+/* Mapping between MDIO PRTAD/DEVAD and mii_ioctl_data::phy_id */
+
+#define MDIO_PHY_ID_C45                        0x8000
+#define MDIO_PHY_ID_PRTAD              0x03e0
+#define MDIO_PHY_ID_DEVAD              0x001f
+#define MDIO_PHY_ID_C45_MASK                                           \
+       (MDIO_PHY_ID_C45 | MDIO_PHY_ID_PRTAD | MDIO_PHY_ID_DEVAD)
+
+#define MDIO_PRTAD_NONE                        (-1)
+#define MDIO_DEVAD_NONE                        (-1)
+#define MDIO_EMULATE_C22               4
+
+#endif /* __LINUX_MDIO_H__ */
index 42dc12715cd54ccb9690b1d62c139b84d5072f17..7e70cf81e4d3d49e7a171c8af50ed39cb93e0da6 100644 (file)
 #ifndef _miiphy_h_
 #define _miiphy_h_
 
+#include <common.h>
 #include <linux/mii.h>
+#include <linux/list.h>
 #include <net.h>
+#include <phy.h>
 
-int miiphy_read (const char *devname, unsigned char addr, unsigned char reg,
+struct legacy_mii_dev {
+       int (*read)(const char *devname, unsigned char addr,
+                    unsigned char reg, unsigned short *value);
+       int (*write)(const char *devname, unsigned char addr,
+                     unsigned char reg, unsigned short value);
+};
+
+int miiphy_read(const char *devname, unsigned char addr, unsigned char reg,
                 unsigned short *value);
-int miiphy_write (const char *devname, unsigned char addr, unsigned char reg,
+int miiphy_write(const char *devname, unsigned char addr, unsigned char reg,
                  unsigned short value);
-int miiphy_info (const char *devname, unsigned char addr, unsigned int *oui,
+int miiphy_info(const char *devname, unsigned char addr, unsigned int *oui,
                 unsigned char *model, unsigned char *rev);
-int miiphy_reset (const char *devname, unsigned char addr);
-int miiphy_speed (const char *devname, unsigned char addr);
-int miiphy_duplex (const char *devname, unsigned char addr);
-int miiphy_is_1000base_x (const char *devname, unsigned char addr);
+int miiphy_reset(const char *devname, unsigned char addr);
+int miiphy_speed(const char *devname, unsigned char addr);
+int miiphy_duplex(const char *devname, unsigned char addr);
+int miiphy_is_1000base_x(const char *devname, unsigned char addr);
 #ifdef CONFIG_SYS_FAULT_ECHO_LINK_DOWN
-int miiphy_link (const char *devname, unsigned char addr);
+int miiphy_link(const char *devname, unsigned char addr);
 #endif
 
-void miiphy_init (void);
+void miiphy_init(void);
 
-void miiphy_register (const char *devname,
-                     int (*read) (const char *devname, unsigned char addr,
+void miiphy_register(const char *devname,
+                     int (*read)(const char *devname, unsigned char addr,
                                   unsigned char reg, unsigned short *value),
-                     int (*write) (const char *devname, unsigned char addr,
+                     int (*write)(const char *devname, unsigned char addr,
                                    unsigned char reg, unsigned short value));
 
-int miiphy_set_current_dev (const char *devname);
-const char *miiphy_get_current_dev (void);
+int miiphy_set_current_dev(const char *devname);
+const char *miiphy_get_current_dev(void);
+struct mii_dev *mdio_get_current_dev(void);
+struct mii_dev *miiphy_get_dev_by_name(const char *devname);
+struct phy_device *mdio_phydev_for_ethname(const char *devname);
+
+void miiphy_listdev(void);
 
-void miiphy_listdev (void);
+struct mii_dev *mdio_alloc(void);
+int mdio_register(struct mii_dev *bus);
+void mdio_list_devices(void);
 
 #ifdef CONFIG_BITBANGMII
 
@@ -85,10 +102,10 @@ struct bb_miiphy_bus {
 extern struct bb_miiphy_bus bb_miiphy_buses[];
 extern int bb_miiphy_buses_num;
 
-void bb_miiphy_init (void);
-int bb_miiphy_read (const char *devname, unsigned char addr,
+void bb_miiphy_init(void);
+int bb_miiphy_read(const char *devname, unsigned char addr,
                    unsigned char reg, unsigned short *value);
-int bb_miiphy_write (const char *devname, unsigned char addr,
+int bb_miiphy_write(const char *devname, unsigned char addr,
                     unsigned char reg, unsigned short value);
 #endif
 
index fcd0fd1de572c2cf7a54fc0ad1a5414c38c0c549..f7f2286981d3c0c1532d1f1aaa44c712b65c0402 100644 (file)
@@ -14,7 +14,7 @@
  *
  * 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
+ * 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
@@ -44,6 +44,7 @@
 #define MMC_MODE_HS_52MHz      0x010
 #define MMC_MODE_4BIT          0x100
 #define MMC_MODE_8BIT          0x200
+#define MMC_MODE_SPI           0x400
 
 #define SD_DATA_4BIT   0x00040000
 
@@ -75,6 +76,8 @@
 #define MMC_CMD_WRITE_SINGLE_BLOCK     24
 #define MMC_CMD_WRITE_MULTIPLE_BLOCK   25
 #define MMC_CMD_APP_CMD                        55
+#define MMC_CMD_SPI_READ_OCR           58
+#define MMC_CMD_SPI_CRC_ON_OFF         59
 
 #define SD_CMD_SEND_RELATIVE_ADDR      3
 #define SD_CMD_SWITCH_FUNC             6
 #define MMC_HS_TIMING          0x00000100
 #define MMC_HS_52MHZ           0x2
 
-#define OCR_BUSY       0x80000000
-#define OCR_HCS                0x40000000
+#define OCR_BUSY               0x80000000
+#define OCR_HCS                        0x40000000
+#define OCR_VOLTAGE_MASK       0x007FFF80
+#define OCR_ACCESS_MODE                0x60000000
+
+#define MMC_STATUS_MASK                (~0x0206BF7F)
+#define MMC_STATUS_RDY_FOR_DATA (1 << 8)
+#define MMC_STATUS_CURR_STATE  (0xf << 9)
 
 #define MMC_VDD_165_195                0x00000080      /* VDD voltage 1.65 - 1.95 */
 #define MMC_VDD_20_21          0x00000100      /* VDD voltage 2.0 ~ 2.1 */
  * EXT_CSD field definitions
  */
 
-#define EXT_CSD_CMD_SET_NORMAL         (1<<0)
-#define EXT_CSD_CMD_SET_SECURE         (1<<1)
-#define EXT_CSD_CMD_SET_CPSECURE       (1<<2)
+#define EXT_CSD_CMD_SET_NORMAL         (1 << 0)
+#define EXT_CSD_CMD_SET_SECURE         (1 << 1)
+#define EXT_CSD_CMD_SET_CPSECURE       (1 << 2)
 
-#define EXT_CSD_CARD_TYPE_26   (1<<0)  /* Card can run at 26MHz */
-#define EXT_CSD_CARD_TYPE_52   (1<<1)  /* Card can run at 52MHz */
+#define EXT_CSD_CARD_TYPE_26   (1 << 0)        /* Card can run at 26MHz */
+#define EXT_CSD_CARD_TYPE_52   (1 << 1)        /* Card can run at 52MHz */
 
 #define EXT_CSD_BUS_WIDTH_1    0       /* Card is in 1 bit mode */
 #define EXT_CSD_BUS_WIDTH_4    1       /* Card is in 4 bit mode */
 #define R1_APP_CMD                     (1 << 5)
 
 #define MMC_RSP_PRESENT (1 << 0)
-#define MMC_RSP_136     (1 << 1)                /* 136 bit response */
-#define MMC_RSP_CRC     (1 << 2)                /* expect valid crc */
-#define MMC_RSP_BUSY    (1 << 3)                /* card may send busy */
-#define MMC_RSP_OPCODE  (1 << 4)                /* response contains opcode */
+#define MMC_RSP_136    (1 << 1)                /* 136 bit response */
+#define MMC_RSP_CRC    (1 << 2)                /* expect valid crc */
+#define MMC_RSP_BUSY   (1 << 3)                /* card may send busy */
+#define MMC_RSP_OPCODE (1 << 4)                /* response contains opcode */
 
-#define MMC_RSP_NONE    (0)
-#define MMC_RSP_R1      (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
+#define MMC_RSP_NONE   (0)
+#define MMC_RSP_R1     (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
 #define MMC_RSP_R1b    (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE| \
                        MMC_RSP_BUSY)
-#define MMC_RSP_R2      (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
-#define MMC_RSP_R3      (MMC_RSP_PRESENT)
-#define MMC_RSP_R4      (MMC_RSP_PRESENT)
-#define MMC_RSP_R5      (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
-#define MMC_RSP_R6      (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
-#define MMC_RSP_R7      (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
+#define MMC_RSP_R2     (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
+#define MMC_RSP_R3     (MMC_RSP_PRESENT)
+#define MMC_RSP_R4     (MMC_RSP_PRESENT)
+#define MMC_RSP_R5     (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
+#define MMC_RSP_R6     (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
+#define MMC_RSP_R7     (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
 
 
 struct mmc_cid {
@@ -274,9 +283,7 @@ struct mmc {
                        struct mmc_cmd *cmd, struct mmc_data *data);
        void (*set_ios)(struct mmc *mmc);
        int (*init)(struct mmc *mmc);
-#ifdef CONFIG_MMC_MBLOCK
        uint b_max;
-#endif
 };
 
 int mmc_register(struct mmc *mmc);
@@ -291,6 +298,8 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc);
 
 #ifdef CONFIG_GENERIC_MMC
 int atmel_mci_init(void *regs);
+#define mmc_host_is_spi(mmc)   ((mmc)->host_caps & MMC_MODE_SPI)
+struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode);
 #else
 int mmc_legacy_init(int verbose);
 #endif
index cb8398d2c00cd7bb8194959f5aee95874f35a185..02a6c6e074c6a3660922ef1bef5d1fd7aa2fd540 100644 (file)
 #define PCI_DEVICE_ID_INTEL_82573E              0x108B
 #define PCI_DEVICE_ID_INTEL_82573E_IAMT         0x108C
 #define PCI_DEVICE_ID_INTEL_82573L              0x109A
+#define PCI_DEVICE_ID_INTEL_82574L              0x10D3
 #define PCI_DEVICE_ID_INTEL_82546GB_QUAD_COPPER_KSP3 0x10B5
 #define PCI_DEVICE_ID_INTEL_80003ES2LAN_COPPER_DPT     0x1096
 #define PCI_DEVICE_ID_INTEL_80003ES2LAN_SERDES_DPT     0x1098
diff --git a/include/phy.h b/include/phy.h
new file mode 100644 (file)
index 0000000..d5817bf
--- /dev/null
@@ -0,0 +1,229 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *     Andy Fleming <afleming@freescale.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
+ *
+ * This file pretty much stolen from Linux's mii.h/ethtool.h/phy.h
+ */
+
+#ifndef _PHY_H
+#define _PHY_H
+
+#include <linux/list.h>
+#include <linux/mii.h>
+#include <linux/ethtool.h>
+#include <linux/mdio.h>
+
+#define PHY_MAX_ADDR 32
+
+#define PHY_BASIC_FEATURES     (SUPPORTED_10baseT_Half | \
+                                SUPPORTED_10baseT_Full | \
+                                SUPPORTED_100baseT_Half | \
+                                SUPPORTED_100baseT_Full | \
+                                SUPPORTED_Autoneg | \
+                                SUPPORTED_TP | \
+                                SUPPORTED_MII)
+
+#define PHY_GBIT_FEATURES      (PHY_BASIC_FEATURES | \
+                                SUPPORTED_1000baseT_Half | \
+                                SUPPORTED_1000baseT_Full)
+
+#define PHY_10G_FEATURES       (PHY_GBIT_FEATURES | \
+                               SUPPORTED_10000baseT_Full)
+
+#define PHY_ANEG_TIMEOUT       4000
+
+
+typedef enum {
+       PHY_INTERFACE_MODE_MII,
+       PHY_INTERFACE_MODE_GMII,
+       PHY_INTERFACE_MODE_SGMII,
+       PHY_INTERFACE_MODE_TBI,
+       PHY_INTERFACE_MODE_RMII,
+       PHY_INTERFACE_MODE_RGMII,
+       PHY_INTERFACE_MODE_RGMII_ID,
+       PHY_INTERFACE_MODE_RGMII_RXID,
+       PHY_INTERFACE_MODE_RGMII_TXID,
+       PHY_INTERFACE_MODE_RTBI,
+       PHY_INTERFACE_MODE_XGMII,
+       PHY_INTERFACE_MODE_NONE /* Must be last */
+} phy_interface_t;
+
+static const char *phy_interface_strings[] = {
+       [PHY_INTERFACE_MODE_MII]                = "mii",
+       [PHY_INTERFACE_MODE_GMII]               = "gmii",
+       [PHY_INTERFACE_MODE_SGMII]              = "sgmii",
+       [PHY_INTERFACE_MODE_TBI]                = "tbi",
+       [PHY_INTERFACE_MODE_RMII]               = "rmii",
+       [PHY_INTERFACE_MODE_RGMII]              = "rgmii",
+       [PHY_INTERFACE_MODE_RGMII_ID]           = "rgmii-id",
+       [PHY_INTERFACE_MODE_RGMII_RXID]         = "rgmii-rxid",
+       [PHY_INTERFACE_MODE_RGMII_TXID]         = "rgmii-txid",
+       [PHY_INTERFACE_MODE_RTBI]               = "rtbi",
+       [PHY_INTERFACE_MODE_XGMII]              = "xgmii",
+       [PHY_INTERFACE_MODE_NONE]               = "",
+};
+
+static inline const char *phy_string_for_interface(phy_interface_t i)
+{
+       /* Default to unknown */
+       if (i > PHY_INTERFACE_MODE_NONE)
+               i = PHY_INTERFACE_MODE_NONE;
+
+       return phy_interface_strings[i];
+}
+
+
+struct phy_device;
+
+#define MDIO_NAME_LEN 32
+
+struct mii_dev {
+       struct list_head link;
+       char name[MDIO_NAME_LEN];
+       void *priv;
+       int (*read)(struct mii_dev *bus, int addr, int devad, int reg);
+       int (*write)(struct mii_dev *bus, int addr, int devad, int reg,
+                       u16 val);
+       int (*reset)(struct mii_dev *bus);
+       struct phy_device *phymap[PHY_MAX_ADDR];
+       u32 phy_mask;
+};
+
+/* struct phy_driver: a structure which defines PHY behavior
+ *
+ * uid will contain a number which represents the PHY.  During
+ * startup, the driver will poll the PHY to find out what its
+ * UID--as defined by registers 2 and 3--is.  The 32-bit result
+ * gotten from the PHY will be masked to
+ * discard any bits which may change based on revision numbers
+ * unimportant to functionality
+ *
+ */
+struct phy_driver {
+       char *name;
+       unsigned int uid;
+       unsigned int mask;
+       unsigned int mmds;
+
+       u32 features;
+
+       /* Called to do any driver startup necessities */
+       /* Will be called during phy_connect */
+       int (*probe)(struct phy_device *phydev);
+
+       /* Called to configure the PHY, and modify the controller
+        * based on the results.  Should be called after phy_connect */
+       int (*config)(struct phy_device *phydev);
+
+       /* Called when starting up the controller */
+       int (*startup)(struct phy_device *phydev);
+
+       /* Called when bringing down the controller */
+       int (*shutdown)(struct phy_device *phydev);
+
+       struct list_head list;
+};
+
+struct phy_device {
+       /* Information about the PHY type */
+       /* And management functions */
+       struct mii_dev *bus;
+       struct phy_driver *drv;
+       void *priv;
+
+       struct eth_device *dev;
+
+       /* forced speed & duplex (no autoneg)
+        * partner speed & duplex & pause (autoneg)
+        */
+       int speed;
+       int duplex;
+
+       /* The most recently read link state */
+       int link;
+       int port;
+       phy_interface_t interface;
+
+       u32 advertising;
+       u32 supported;
+       u32 mmds;
+
+       int autoneg;
+       int addr;
+       int pause;
+       int asym_pause;
+       u32 phy_id;
+       u32 flags;
+};
+
+static inline int phy_read(struct phy_device *phydev, int devad, int regnum)
+{
+       struct mii_dev *bus = phydev->bus;
+
+       return bus->read(bus, phydev->addr, devad, regnum);
+}
+
+static inline int phy_write(struct phy_device *phydev, int devad, int regnum,
+                       u16 val)
+{
+       struct mii_dev *bus = phydev->bus;
+
+       return bus->write(bus, phydev->addr, devad, regnum, val);
+}
+
+#ifdef CONFIG_PHYLIB_10G
+extern struct phy_driver gen10g_driver;
+
+/* For now, XGMII is the only 10G interface */
+static inline int is_10g_interface(phy_interface_t interface)
+{
+       return interface == PHY_INTERFACE_MODE_XGMII;
+}
+
+#endif
+
+int phy_init(void);
+int phy_reset(struct phy_device *phydev);
+struct phy_device *phy_connect(struct mii_dev *bus, int addr,
+                               struct eth_device *dev,
+                               phy_interface_t interface);
+int phy_startup(struct phy_device *phydev);
+int phy_config(struct phy_device *phydev);
+int phy_shutdown(struct phy_device *phydev);
+int phy_register(struct phy_driver *drv);
+int genphy_config_aneg(struct phy_device *phydev);
+int genphy_update_link(struct phy_device *phydev);
+int genphy_config(struct phy_device *phydev);
+int genphy_startup(struct phy_device *phydev);
+int genphy_shutdown(struct phy_device *phydev);
+int gen10g_config(struct phy_device *phydev);
+int gen10g_startup(struct phy_device *phydev);
+int gen10g_shutdown(struct phy_device *phydev);
+int gen10g_discover_mmds(struct phy_device *phydev);
+
+int phy_atheros_init(void);
+int phy_broadcom_init(void);
+int phy_davicom_init(void);
+int phy_lxt_init(void);
+int phy_marvell_init(void);
+int phy_micrel_init(void);
+int phy_natsemi_init(void);
+int phy_realtek_init(void);
+int phy_teranetics_init(void);
+int phy_vitesse_init(void);
+#endif
index a7c129377092c260e78006ffc495ca5f54a21879..c827d4dbee946f3ffa39a2499a4b2da9dcbf350c 100644 (file)
@@ -80,6 +80,12 @@ extern int hsearch_r(ENTRY __item, ACTION __action, ENTRY ** __retval,
  */
 extern int hmatch_r(const char *__match, int __last_idx, ENTRY ** __retval,
                    struct hsearch_data *__htab);
+/*
+ * Search for an entry whose key or data contains `MATCH'.  Otherwise,
+ * Same semantics as hsearch_r().
+ */
+extern int hstrstr_r(const char *__match, int __last_idx, ENTRY ** __retval,
+                   struct hsearch_data *__htab);
 
 /* Search and delete entry matching ITEM.key in internal hash table. */
 extern int hdelete_r(const char *__key, struct hsearch_data *__htab);
index 320e50e5296ca1914cc30c36c882cf576abdd4a5..60e85db9a46e052c97b638c58bb93114a378e3b7 100644 (file)
 
 /* Controller-specific definitions: */
 
-/* CONFIG_HARD_SPI triggers SPI bus initialization in PowerPC */
-#ifdef CONFIG_MPC8XXX_SPI
-# ifndef CONFIG_HARD_SPI
-#  define CONFIG_HARD_SPI
-# endif
-#endif
-
 /* SPI mode flags */
 #define        SPI_CPHA        0x01                    /* clock phase */
 #define        SPI_CPOL        0x02                    /* clock polarity */
@@ -175,6 +168,14 @@ void spi_cs_activate(struct spi_slave *slave);
  */
 void spi_cs_deactivate(struct spi_slave *slave);
 
+/*-----------------------------------------------------------------------
+ * Set transfer speed.
+ * This sets a new speed to be applied for next spi_xfer().
+ *   slave:    The SPI slave
+ *   hz:       The transfer speed
+ */
+void spi_set_speed(struct spi_slave *slave, uint hz);
+
 /*-----------------------------------------------------------------------
  * Write 8 bits, then read 8 bits.
  *   slave:    The SPI slave we're communicating with
index 1f8ba2987ef00f10346b15f7cbfdb47fc9798567..a384071fbee4b908eff02cd86db82f15677e0d2d 100644 (file)
 #include <spi.h>
 #include <linux/types.h>
 
-struct spi_flash_region {
-       unsigned int    count;
-       unsigned int    size;
-};
-
 struct spi_flash {
        struct spi_slave *spi;
 
@@ -38,6 +33,8 @@ struct spi_flash {
 
        u32             size;
 
+       u32             sector_size;
+
        int             (*read)(struct spi_flash *flash, u32 offset,
                                size_t len, void *buf);
        int             (*write)(struct spi_flash *flash, u32 offset,
index d56ec2cd0c5fce8caf79f9bd582924c6f7c00622..f0f3d4d59b54ceba1a270e1c5f2a5bdc3c8f8302 100644 (file)
@@ -7,7 +7,7 @@
  *  terms of the GNU Public License, Version 2, incorporated
  *  herein by reference.
  *
- * Copyright 2004, 2007, 2009  Freescale Semiconductor, Inc.
+ * Copyright 2004, 2007, 2009, 2011  Freescale Semiconductor, Inc.
  * (C) Copyright 2003, Motorola, Inc.
  * maintained by Xianghua Xiao (x.xiao@motorola.com)
  * author Andy Fleming
 
 #include <net.h>
 #include <config.h>
+#include <phy.h>
+#include <asm/fsl_enet.h>
 
 #define TSEC_SIZE              0x01000
 #define TSEC_MDIO_OFFSET       0x01000
 
+#define CONFIG_SYS_MDIO_BASE_ADDR (MDIO_BASE_ADDR + 0x520)
+
+#define DEFAULT_MII_NAME "FSL_MDIO"
+
 #define STD_TSEC_INFO(num) \
 {                      \
        .regs = (tsec_t *)(TSEC_BASE_ADDR + ((num - 1) * TSEC_SIZE)), \
-       .miiregs = (tsec_mdio_t *)(MDIO_BASE_ADDR), \
-       .miiregs_sgmii = (tsec_mdio_t *)(MDIO_BASE_ADDR \
+       .miiregs_sgmii = (struct tsec_mii_mng *)(CONFIG_SYS_MDIO_BASE_ADDR \
                                         + (num - 1) * TSEC_MDIO_OFFSET), \
        .devname = CONFIG_TSEC##num##_NAME, \
        .phyaddr = TSEC##num##_PHY_ADDR, \
-       .flags = TSEC##num##_FLAGS \
+       .flags = TSEC##num##_FLAGS, \
+       .mii_devname = DEFAULT_MII_NAME \
 }
 
 #define SET_STD_TSEC_INFO(x, num) \
 {                      \
        x.regs = (tsec_t *)(TSEC_BASE_ADDR + ((num - 1) * TSEC_SIZE)); \
-       x.miiregs = (tsec_mdio_t *)(MDIO_BASE_ADDR); \
-       x.miiregs_sgmii = (tsec_mdio_t *)(MDIO_BASE_ADDR \
+       x.miiregs_sgmii = (struct tsec_mii_mng *)(CONFIG_SYS_MDIO_BASE_ADDR \
                                          + (num - 1) * TSEC_MDIO_OFFSET); \
        x.devname = CONFIG_TSEC##num##_NAME; \
        x.phyaddr = TSEC##num##_PHY_ADDR; \
        x.flags = TSEC##num##_FLAGS;\
+       x.mii_devname = DEFAULT_MII_NAME;\
 }
 
 #define MAC_ADDR_LEN 6
@@ -51,8 +57,6 @@
 #define TSEC_TIMEOUT 1000
 #define TOUT_LOOP      1000000
 
-#define PHY_AUTONEGOTIATE_TIMEOUT      5000 /* in ms */
-
 /* TBI register addresses */
 #define TBI_CR                 0x00
 #define TBI_SR                 0x01
 
 #define ECNTRL_INIT_SETTINGS   0x00001000
 #define ECNTRL_TBI_MODE                0x00000020
+#define ECNTRL_REDUCED_MODE    0x00000010
 #define ECNTRL_R100            0x00000008
+#define ECNTRL_REDUCED_MII_MODE        0x00000004
 #define ECNTRL_SGMII_MODE      0x00000002
 
-#define miim_end -2
-#define miim_read -1
-
 #ifndef CONFIG_SYS_TBIPA_VALUE
     #define CONFIG_SYS_TBIPA_VALUE     0x1f
 #endif
-#define MIIMCFG_INIT_VALUE     0x00000003
-#define MIIMCFG_RESET          0x80000000
-
-#define MIIMIND_BUSY           0x00000001
-#define MIIMIND_NOTVALID       0x00000004
-
-#define MIIM_CONTROL           0x00
-#define MIIM_CONTROL_RESET     0x00009140
-#define MIIM_CONTROL_INIT      0x00001140
-#define MIIM_CONTROL_RESTART   0x00001340
-#define MIIM_ANEN              0x00001000
-
-#define MIIM_CR                        0x00
-#define MIIM_CR_RST            0x00008000
-#define MIIM_CR_INIT           0x00001000
-
-#define MIIM_STATUS            0x1
-#define MIIM_STATUS_AN_DONE    0x00000020
-#define MIIM_STATUS_LINK       0x0004
-
-#define MIIM_PHYIR1            0x2
-#define MIIM_PHYIR2            0x3
-
-#define MIIM_ANAR              0x4
-#define MIIM_ANAR_INIT         0x1e1
-
-#define MIIM_TBI_ANLPBPA       0x5
-#define MIIM_TBI_ANLPBPA_HALF  0x00000040
-#define MIIM_TBI_ANLPBPA_FULL  0x00000020
-
-#define MIIM_TBI_ANEX          0x6
-#define MIIM_TBI_ANEX_NP       0x00000004
-#define MIIM_TBI_ANEX_PRX      0x00000002
-
-#define MIIM_GBIT_CONTROL      0x9
-#define MIIM_GBIT_CONTROL_INIT 0xe00
-
-#define MIIM_EXT_PAGE_ACCESS   0x1f
-
-/* Broadcom BCM54xx -- taken from linux sungem_phy */
-#define MIIM_BCM54xx_AUXCNTL                   0x18
-#define MIIM_BCM54xx_AUXCNTL_ENCODE(val)       ((val & 0x7) << 12)|(val & 0x7)
-#define MIIM_BCM54xx_AUXSTATUS                 0x19
-#define MIIM_BCM54xx_AUXSTATUS_LINKMODE_MASK   0x0700
-#define MIIM_BCM54xx_AUXSTATUS_LINKMODE_SHIFT  8
-
-#define MIIM_BCM54XX_SHD       0x1c    /* 0x1c shadow registers */
-#define MIIM_BCM54XX_SHD_WRITE 0x8000
-#define MIIM_BCM54XX_SHD_VAL(x)        ((x & 0x1f) << 10)
-#define MIIM_BCM54XX_SHD_DATA(x)       ((x & 0x3ff) << 0)
-#define MIIM_BCM54XX_SHD_WR_ENCODE(val, data)  \
-       (MIIM_BCM54XX_SHD_WRITE | MIIM_BCM54XX_SHD_VAL(val) | \
-        MIIM_BCM54XX_SHD_DATA(data))
-
-#define MIIM_BCM54XX_EXP_DATA  0x15    /* Expansion register data */
-#define MIIM_BCM54XX_EXP_SEL   0x17    /* Expansion register select */
-#define MIIM_BCM54XX_EXP_SEL_SSD       0x0e00  /* Secondary SerDes select */
-#define MIIM_BCM54XX_EXP_SEL_ER        0x0f00  /* Expansion register select */
-
-/* Cicada Auxiliary Control/Status Register */
-#define MIIM_CIS8201_AUX_CONSTAT       0x1c
-#define MIIM_CIS8201_AUXCONSTAT_INIT   0x0004
-#define MIIM_CIS8201_AUXCONSTAT_DUPLEX 0x0020
-#define MIIM_CIS8201_AUXCONSTAT_SPEED  0x0018
-#define MIIM_CIS8201_AUXCONSTAT_GBIT   0x0010
-#define MIIM_CIS8201_AUXCONSTAT_100    0x0008
-
-/* Cicada Extended Control Register 1 */
-#define MIIM_CIS8201_EXT_CON1          0x17
-#define MIIM_CIS8201_EXTCON1_INIT      0x0000
-
-/* Cicada 8204 Extended PHY Control Register 1 */
-#define MIIM_CIS8204_EPHY_CON          0x17
-#define MIIM_CIS8204_EPHYCON_INIT      0x0006
-#define MIIM_CIS8204_EPHYCON_RGMII     0x1100
-
-/* Cicada 8204 Serial LED Control Register */
-#define MIIM_CIS8204_SLED_CON          0x1b
-#define MIIM_CIS8204_SLEDCON_INIT      0x1115
-
-#define MIIM_GBIT_CON          0x09
-#define MIIM_GBIT_CON_ADVERT   0x0e00
-
-/* Entry for Vitesse VSC8244 regs starts here */
-/* Vitesse VSC8244 Auxiliary Control/Status Register */
-#define MIIM_VSC8244_AUX_CONSTAT       0x1c
-#define MIIM_VSC8244_AUXCONSTAT_INIT   0x0000
-#define MIIM_VSC8244_AUXCONSTAT_DUPLEX 0x0020
-#define MIIM_VSC8244_AUXCONSTAT_SPEED  0x0018
-#define MIIM_VSC8244_AUXCONSTAT_GBIT   0x0010
-#define MIIM_VSC8244_AUXCONSTAT_100    0x0008
-#define MIIM_CONTROL_INIT_LOOPBACK     0x4000
-
-/* Vitesse VSC8244 Extended PHY Control Register 1 */
-#define MIIM_VSC8244_EPHY_CON          0x17
-#define MIIM_VSC8244_EPHYCON_INIT      0x0006
-
-/* Vitesse VSC8244 Serial LED Control Register */
-#define MIIM_VSC8244_LED_CON           0x1b
-#define MIIM_VSC8244_LEDCON_INIT       0xF011
-
-/* Entry for Vitesse VSC8601 regs starts here (Not complete) */
-/* Vitesse VSC8601 Extended PHY Control Register 1 */
-#define MIIM_VSC8601_EPHY_CON          0x17
-#define MIIM_VSC8601_EPHY_CON_INIT_SKEW        0x1120
-#define MIIM_VSC8601_SKEW_CTRL         0x1c
-
-/* 88E1011 PHY Status Register */
-#define MIIM_88E1011_PHY_STATUS                0x11
-#define MIIM_88E1011_PHYSTAT_SPEED     0xc000
-#define MIIM_88E1011_PHYSTAT_GBIT      0x8000
-#define MIIM_88E1011_PHYSTAT_100       0x4000
-#define MIIM_88E1011_PHYSTAT_DUPLEX    0x2000
-#define MIIM_88E1011_PHYSTAT_SPDDONE   0x0800
-#define MIIM_88E1011_PHYSTAT_LINK      0x0400
-
-#define MIIM_88E1011_PHY_SCR           0x10
-#define MIIM_88E1011_PHY_MDI_X_AUTO    0x0060
-
-/* 88E1111 PHY LED Control Register */
-#define MIIM_88E1111_PHY_LED_CONTROL   24
-#define MIIM_88E1111_PHY_LED_DIRECT    0x4100
-#define MIIM_88E1111_PHY_LED_COMBINE   0x411C
-
-/* 88E1121 PHY LED Control Register */
-#define MIIM_88E1121_PHY_LED_CTRL      16
-#define MIIM_88E1121_PHY_LED_PAGE      3
-#define MIIM_88E1121_PHY_LED_DEF       0x0030
-
-/* 88E1121 PHY IRQ Enable/Status Register */
-#define MIIM_88E1121_PHY_IRQ_EN                18
-#define MIIM_88E1121_PHY_IRQ_STATUS    19
-
-#define MIIM_88E1121_PHY_PAGE          22
-
-/* 88E1145 Extended PHY Specific Control Register */
-#define MIIM_88E1145_PHY_EXT_CR 20
-#define MIIM_M88E1145_RGMII_RX_DELAY   0x0080
-#define MIIM_M88E1145_RGMII_TX_DELAY   0x0002
-
-#define MIIM_88E1145_PHY_PAGE  29
-#define MIIM_88E1145_PHY_CAL_OV 30
-
-/* RTL8211B PHY Status Register */
-#define MIIM_RTL8211B_PHY_STATUS       0x11
-#define MIIM_RTL8211B_PHYSTAT_SPEED    0xc000
-#define MIIM_RTL8211B_PHYSTAT_GBIT     0x8000
-#define MIIM_RTL8211B_PHYSTAT_100      0x4000
-#define MIIM_RTL8211B_PHYSTAT_DUPLEX   0x2000
-#define MIIM_RTL8211B_PHYSTAT_SPDDONE  0x0800
-#define MIIM_RTL8211B_PHYSTAT_LINK     0x0400
-
-/* DM9161 Control register values */
-#define MIIM_DM9161_CR_STOP    0x0400
-#define MIIM_DM9161_CR_RSTAN   0x1200
-
-#define MIIM_DM9161_SCR                0x10
-#define MIIM_DM9161_SCR_INIT   0x0610
-
-/* DM9161 Specified Configuration and Status Register */
-#define MIIM_DM9161_SCSR       0x11
-#define MIIM_DM9161_SCSR_100F  0x8000
-#define MIIM_DM9161_SCSR_100H  0x4000
-#define MIIM_DM9161_SCSR_10F   0x2000
-#define MIIM_DM9161_SCSR_10H   0x1000
-
-/* DM9161 10BT Configuration/Status */
-#define MIIM_DM9161_10BTCSR    0x12
-#define MIIM_DM9161_10BTCSR_INIT       0x7800
-
-/* LXT971 Status 2 registers */
-#define MIIM_LXT971_SR2                     0x11  /* Status Register 2  */
-#define MIIM_LXT971_SR2_SPEED_MASK 0x4200
-#define MIIM_LXT971_SR2_10HDX     0x0000  /*  10 Mbit half duplex selected */
-#define MIIM_LXT971_SR2_10FDX     0x0200  /*  10 Mbit full duplex selected */
-#define MIIM_LXT971_SR2_100HDX    0x4000  /* 100 Mbit half duplex selected */
-#define MIIM_LXT971_SR2_100FDX    0x4200  /* 100 Mbit full duplex selected */
-
-/* DP83865 Control register values */
-#define MIIM_DP83865_CR_INIT   0x9200
-
-/* DP83865 Link and Auto-Neg Status Register */
-#define MIIM_DP83865_LANR      0x11
-#define MIIM_DP83865_SPD_MASK  0x0018
-#define MIIM_DP83865_SPD_1000  0x0010
-#define MIIM_DP83865_SPD_100   0x0008
-#define MIIM_DP83865_DPX_FULL  0x0002
-
-#define MIIM_READ_COMMAND      0x00000001
 
 #define MRBLR_INIT_SETTINGS    PKTSIZE_ALIGN
 
@@ -467,22 +281,6 @@ typedef struct tsec_hash_regs
        uint    res2[24];
 } tsec_hash_t;
 
-typedef struct tsec_mdio {
-       uint    res1[4];
-       uint    ieventm;
-       uint    imaskm;
-       uint    res2;
-       uint    emapm;
-       uint    res3[320];
-       uint    miimcfg;        /* MII Management: Configuration */
-       uint    miimcom;        /* MII Management: Command */
-       uint    miimadd;        /* MII Management: Address */
-       uint    miimcon;        /* MII Management: Control */
-       uint    miimstat;       /* MII Management: Status */
-       uint    miimind;        /* MII Management: Indicators */
-       uint    res4[690];
-} tsec_mdio_t;
-
 typedef struct tsec
 {
        /* General Control and Status Registers (0x2_n000) */
@@ -578,79 +376,29 @@ typedef struct tsec
        uint    resc00[256];
 } tsec_t;
 
-#define TSEC_GIGABIT (1)
+#define TSEC_GIGABIT (1 << 0)
 
-/* This flag currently only has
- * meaning if we're using the eTSEC */
+/* These flags currently only have meaning if we're using the eTSEC */
 #define TSEC_REDUCED   (1 << 1)        /* MAC-PHY interface uses RGMII */
 #define TSEC_SGMII     (1 << 2)        /* MAC-PHY interface uses SGMII */
-#define TSEC_FIBER     (1 << 3)        /* PHY uses fiber, eg 1000 Base-X */
 
 struct tsec_private {
-       volatile tsec_t *regs;
-       volatile tsec_mdio_t *phyregs;
-       volatile tsec_mdio_t *phyregs_sgmii;
-       struct phy_info *phyinfo;
+       tsec_t *regs;
+       struct tsec_mii_mng *phyregs_sgmii;
+       struct phy_device *phydev;
+       phy_interface_t interface;
+       struct mii_dev *bus;
        uint phyaddr;
+       char mii_devname[16];
        u32 flags;
-       uint link;
-       uint duplexity;
-       uint speed;
-};
-
-
-/*
- * struct phy_cmd:  A command for reading or writing a PHY register
- *
- * mii_reg:  The register to read or write
- *
- * mii_data:  For writes, the value to put in the register.
- *     A value of -1 indicates this is a read.
- *
- * funct: A function pointer which is invoked for each command.
- *     For reads, this function will be passed the value read
- *     from the PHY, and process it.
- *     For writes, the result of this function will be written
- *     to the PHY register
- */
-struct phy_cmd {
-       uint mii_reg;
-       uint mii_data;
-       uint (*funct) (uint mii_reg, struct tsec_private * priv);
-};
-
-/* struct phy_info: a structure which defines attributes for a PHY
- *
- * id will contain a number which represents the PHY.  During
- * startup, the driver will poll the PHY to find out what its
- * UID--as defined by registers 2 and 3--is.  The 32-bit result
- * gotten from the PHY will be shifted right by "shift" bits to
- * discard any bits which may change based on revision numbers
- * unimportant to functionality
- *
- * The struct phy_cmd entries represent pointers to an arrays of
- * commands which tell the driver what to do to the PHY.
- */
-struct phy_info {
-       uint id;
-       char *name;
-       uint shift;
-       /* Called to configure the PHY, and modify the controller
-        * based on the results */
-       struct phy_cmd *config;
-
-       /* Called when starting up the controller */
-       struct phy_cmd *startup;
-
-       /* Called when bringing down the controller */
-       struct phy_cmd *shutdown;
 };
 
 struct tsec_info_struct {
        tsec_t *regs;
-       tsec_mdio_t *miiregs;
-       tsec_mdio_t *miiregs_sgmii;
+       struct tsec_mii_mng *miiregs_sgmii;
        char *devname;
+       char *mii_devname;
+       phy_interface_t interface;
        unsigned int phyaddr;
        u32 flags;
 };
index fcfe35104259127685ce42c11628df83a4d60991..afa6914e1be26c9eef396db00ab42d3f87fe59b8 100644 (file)
@@ -52,7 +52,6 @@ COBJS-y += string.o
 COBJS-y        += strmhz.o
 COBJS-y += time.o
 COBJS-y += vsprintf.o
-COBJS-$(CONFIG_ZLIB) += zlib.o
 COBJS-$(CONFIG_RBTREE) += rbtree.o
 
 COBJS  := $(COBJS-y)
index 482a4768a3f9afd9fa4d24b8927c615e892c561f..8b16b2495fbec50956ff027c5e49803435034592 100644 (file)
@@ -106,12 +106,16 @@ int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
        s.avail_in = *lenp - offset;
        s.next_out = dst;
        s.avail_out = dstlen;
-       r = inflate(&s, Z_FINISH);
-       if ((r != Z_STREAM_END) && (stoponerr==1)) {
-               printf ("Error: inflate() returned %d\n", r);
-               inflateEnd(&s);
-               return (-1);
-       }
+       do {
+               r = inflate(&s, Z_FINISH);
+               if (r != Z_STREAM_END && r != Z_BUF_ERROR && stoponerr == 1) {
+                       printf("Error: inflate() returned %d\n", r);
+                       inflateEnd(&s);
+                       return -1;
+               }
+               s.avail_in = *lenp - offset - (int)(s.next_out - (unsigned char*)dst);
+               s.avail_out = dstlen;
+       } while (r == Z_BUF_ERROR);
        *lenp = s.next_out - (unsigned char *) dst;
        inflateEnd(&s);
 
index fcdb53cd469b8ba97c9030c8756ca788d4387be8..19d5b158eeff52bf74606d17e391901ddeb226d3 100644 (file)
@@ -202,6 +202,29 @@ void hdestroy_r(struct hsearch_data *htab)
  *   example for functions like hdelete().
  */
 
+/*
+ * hstrstr_r - return index to entry whose key and/or data contains match
+ */
+int hstrstr_r(const char *match, int last_idx, ENTRY ** retval,
+             struct hsearch_data *htab)
+{
+       unsigned int idx;
+
+       for (idx = last_idx + 1; idx < htab->size; ++idx) {
+               if (htab->table[idx].used <= 0)
+                       continue;
+               if (strstr(htab->table[idx].entry.key, match) ||
+                   strstr(htab->table[idx].entry.data, match)) {
+                       *retval = &htab->table[idx].entry;
+                       return idx;
+               }
+       }
+
+       __set_errno(ESRCH);
+       *retval = NULL;
+       return 0;
+}
+
 int hmatch_r(const char *match, int last_idx, ENTRY ** retval,
             struct hsearch_data *htab)
 {
@@ -209,7 +232,7 @@ int hmatch_r(const char *match, int last_idx, ENTRY ** retval,
        size_t key_len = strlen(match);
 
        for (idx = last_idx + 1; idx < htab->size; ++idx) {
-               if (htab->table[idx].used > 0)
+               if (htab->table[idx].used <= 0)
                        continue;
                if (!strncmp(match, htab->table[idx].entry.key, key_len)) {
                        *retval = &htab->table[idx].entry;
diff --git a/lib/zlib.c b/lib/zlib.c
deleted file mode 100644 (file)
index e19484a..0000000
+++ /dev/null
@@ -1,2218 +0,0 @@
-/*
- * This file is derived from various .h and .c files from the zlib-1.2.3
- * distribution by Jean-loup Gailly and Mark Adler, with some additions
- * by Paul Mackerras to aid in implementing Deflate compression and
- * decompression for PPP packets.  See zlib.h for conditions of
- * distribution and use.
- *
- * Changes that have been made include:
- * - changed functions not used outside this file to "local"
- * - added minCompression parameter to deflateInit2
- * - added Z_PACKET_FLUSH (see zlib.h for details)
- * - added inflateIncomp
- */
-
-/*+++++*/
-/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-#define ZUTIL_H
-#define ZLIB_INTERNAL
-
-#include <common.h>
-#include <compiler.h>
-#include <asm/unaligned.h>
-#include <watchdog.h>
-#include "u-boot/zlib.h"
-#undef OFF                             /* avoid conflicts */
-
-/* To avoid a build time warning */
-#ifdef STDC
-#include <malloc.h>
-#endif
-
-#ifndef local
-#define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-typedef unsigned char uch;
-typedef uch FAR uchf;
-typedef unsigned short ush;
-typedef ush FAR ushf;
-typedef unsigned long ulg;
-
-#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
-#define ERR_RETURN(strm,err) return (strm->msg = (char*)ERR_MSG(err), (err))
-/* To be used only when the state is known to be valid */
-
-#ifndef NULL
-#define NULL   ((void *) 0)
-#endif
-
-       /* common constants */
-
-#ifndef DEF_WBITS
-#define DEF_WBITS MAX_WBITS
-#endif
-/* default windowBits for decompression. MAX_WBITS is for compression only */
-
-#if MAX_MEM_LEVEL >= 8
-#define DEF_MEM_LEVEL 8
-#else
-#define DEF_MEM_LEVEL  MAX_MEM_LEVEL
-#endif
-/* default memLevel */
-
-#define STORED_BLOCK 0
-#define STATIC_TREES 1
-#define DYN_TREES    2
-/* The three kinds of block type */
-
-#define MIN_MATCH 3
-#define MAX_MATCH 258
-/* The minimum and maximum match lengths */
-
-        /* functions */
-
-#include <linux/string.h>
-#define zmemcpy memcpy
-#define zmemcmp memcmp
-#define zmemzero(dest, len) memset(dest, 0, len)
-
-/* Diagnostic functions */
-#ifdef DEBUG
-       extern int z_verbose;
-       extern void z_error    OF((char *m));
-#define Assert(cond,msg) {if(!(cond)) z_error(msg);}
-#define fprintf(fp,...)        printf(__VA_ARGS__)
-#define Trace(x) {if (z_verbose>=0) fprintf x ;}
-#define Tracev(x) {if (z_verbose>0) fprintf x ;}
-#define Tracevv(x) {if (z_verbose>1) fprintf x ;}
-#define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
-#define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
-#else
-#define Assert(cond,msg)
-#define Trace(x)
-#define Tracev(x)
-#define Tracevv(x)
-#define Tracec(c,x)
-#define Tracecv(c,x)
-#endif
-
-voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
-void zcfree  OF((voidpf opaque, voidpf ptr, unsigned size));
-
-#define ZALLOC(strm, items, size) \
-       (*((strm)->zalloc))((strm)->opaque, (items), (size))
-#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr), 0)
-
-/*+++++*/
-/* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-2005 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-/* Structure for decoding tables.  Each entry provides either the
-   information needed to do the operation requested by the code that
-   indexed that table entry, or it provides a pointer to another
-   table that indexes more bits of the code.  op indicates whether
-   the entry is a pointer to another table, a literal, a length or
-   distance, an end-of-block, or an invalid code.  For a table
-   pointer, the low four bits of op is the number of index bits of
-   that table.  For a length or distance, the low four bits of op
-   is the number of extra bits to get after the code.  bits is
-   the number of bits in this code or part of the code to drop off
-   of the bit buffer.  val is the actual byte to output in the case
-   of a literal, the base length or distance, or the offset from
-   the current table to the next table.  Each entry is four bytes. */
-
-typedef struct {
-       unsigned char op;           /* operation, extra bits, table bits */
-       unsigned char bits;         /* bits in this part of the code */
-       unsigned short val;         /* offset in table or code value */
-} code;
-
-/* Maximum size of dynamic tree.  The maximum found in a long but non-
-   exhaustive search was 1444 code structures (852 for length/literals
-   and 592 for distances, the latter actually the result of an
-   exhaustive search).  The true maximum is not known, but the value
-   below is more than safe. */
-#define ENOUGH 2048
-#define MAXD 592
-
-/* Type of code to build for inftable() */
-typedef enum {
-       CODES,
-       LENS,
-       DISTS
-} codetype;
-
-extern int inflate_table OF((codetype type, unsigned short FAR *lens,
-                               unsigned codes, code FAR * FAR *table,
-                               unsigned FAR *bits, unsigned short FAR *work));
-/*+++++*/
-/* inflate.h -- internal inflate state definition
- * Copyright (C) 1995-2004 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-#define GUNZIP
-
-/* Possible inflate modes between inflate() calls */
-typedef enum {
-       HEAD, /* i: waiting for magic header */
-       FLAGS, /* i: waiting for method and flags (gzip) */
-       TIME, /* i: waiting for modification time (gzip) */
-       OS, /* i: waiting for extra flags and operating system (gzip) */
-       EXLEN, /* i: waiting for extra length (gzip) */
-       EXTRA, /* i: waiting for extra bytes (gzip) */
-       NAME, /* i: waiting for end of file name (gzip) */
-       COMMENT, /* i: waiting for end of comment (gzip) */
-       HCRC, /* i: waiting for header crc (gzip) */
-       DICTID, /* i: waiting for dictionary check value */
-       DICT, /* waiting for inflateSetDictionary() call */
-       TYPE, /* i: waiting for type bits, including last-flag bit */
-       TYPEDO, /* i: same, but skip check to exit inflate on new block */
-       STORED, /* i: waiting for stored size (length and complement) */
-       COPY, /* i/o: waiting for input or output to copy stored block */
-       TABLE, /* i: waiting for dynamic block table lengths */
-       LENLENS, /* i: waiting for code length code lengths */
-       CODELENS, /* i: waiting for length/lit and distance code lengths */
-       LEN, /* i: waiting for length/lit code */
-       LENEXT, /* i: waiting for length extra bits */
-       DIST, /* i: waiting for distance code */
-       DISTEXT, /* i: waiting for distance extra bits */
-       MATCH, /* o: waiting for output space to copy string */
-       LIT, /* o: waiting for output space to write literal */
-       CHECK, /* i: waiting for 32-bit check value */
-       LENGTH, /* i: waiting for 32-bit length (gzip) */
-       DONE, /* finished check, done -- remain here until reset */
-       BAD, /* got a data error -- remain here until reset */
-       MEM, /* got an inflate() memory error -- remain here until reset */
-       SYNC, /* looking for synchronization bytes to restart inflate() */
-       START,
-       WASH,
-       END,
-       BADCODE
-} inflate_mode;
-
-/*
-    State transitions between above modes -
-
-    (most modes can go to the BAD or MEM mode -- not shown for clarity)
-
-    Process header:
-        HEAD -> (gzip) or (zlib)
-        (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME
-        NAME -> COMMENT -> HCRC -> TYPE
-        (zlib) -> DICTID or TYPE
-        DICTID -> DICT -> TYPE
-    Read deflate blocks:
-            TYPE -> STORED or TABLE or LEN or CHECK
-            STORED -> COPY -> TYPE
-            TABLE -> LENLENS -> CODELENS -> LEN
-    Read deflate codes:
-                LEN -> LENEXT or LIT or TYPE
-                LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
-                LIT -> LEN
-    Process trailer:
-        CHECK -> LENGTH -> DONE
- */
-
-/* state maintained between inflate() calls.  Approximately 7K bytes. */
-struct inflate_state {
-       inflate_mode mode; /* current inflate mode */
-       int last; /* true if processing last block */
-       int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
-       int havedict; /* true if dictionary provided */
-       int flags; /* gzip header method and flags (0 if zlib) */
-       unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
-       unsigned long check; /* protected copy of check value */
-       unsigned long total; /* protected copy of output count */
-       gz_headerp head; /* where to save gzip header information */
-        /* sliding window */
-       unsigned wbits; /* log base 2 of requested window size */
-       unsigned wsize; /* window size or zero if not using window */
-       unsigned whave; /* valid bytes in the window */
-       unsigned write; /* window write index */
-       unsigned char FAR *window; /* allocated sliding window, if needed */
-        /* bit accumulator */
-       unsigned long hold; /* input bit accumulator */
-       unsigned bits; /* number of bits in "in" */
-        /* for string and stored block copying */
-       unsigned length; /* literal or length of data to copy */
-       unsigned offset; /* distance back to copy string from */
-        /* for table and code decoding */
-       unsigned extra; /* extra bits needed */
-        /* fixed and dynamic code tables */
-       code const FAR *lencode; /* starting table for length/literal codes */
-       code const FAR *distcode; /* starting table for distance codes */
-       unsigned lenbits; /* index bits for lencode */
-       unsigned distbits; /* index bits for distcode */
-        /* dynamic table building */
-       unsigned ncode; /* number of code length code lengths */
-       unsigned nlen; /* number of length code lengths */
-       unsigned ndist; /* number of distance code lengths */
-       unsigned have; /* number of code lengths in lens[] */
-       code FAR *next; /* next available space in codes[] */
-       unsigned short lens[320]; /* temporary storage for code lengths */
-       unsigned short work[288]; /* work area for code table building */
-       code codes[ENOUGH]; /* space for code tables */
-};
-
-/*+++++*/
-/* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-2003 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-void inflate_fast OF((z_streamp strm, unsigned start));
-/*+++++*/
-    /* inffixed.h -- table for decoding fixed codes
-     * Generated automatically by makefixed().
-     */
-
-    /* WARNING: this file should *not* be used by applications. It
-       is part of the implementation of the compression library and
-       is subject to change. Applications should only use zlib.h.
-     */
-
-       static const code lenfix[512] = {
-       {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
-       {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
-       {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
-       {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
-       {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
-       {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
-       {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
-       {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
-       {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
-       {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
-       {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
-       {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
-       {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
-       {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
-       {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
-       {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
-       {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
-       {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
-       {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
-       {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
-       {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
-       {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
-       {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
-       {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
-       {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
-       {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
-       {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
-       {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
-       {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
-       {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
-       {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
-       {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
-       {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
-       {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
-       {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
-       {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
-       {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
-       {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
-       {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
-       {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
-       {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
-       {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
-       {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
-       {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
-       {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
-       {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
-       {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
-       {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
-       {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
-       {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
-       {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
-       {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
-       {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
-       {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
-       {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
-       {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
-       {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
-       {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
-       {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
-       {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
-       {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
-       {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
-       {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
-       {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
-       {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
-       {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
-       {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
-       {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
-       {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
-       {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
-       {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
-       {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
-       {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
-       {0,9,255}
-       };
-
-       static const code distfix[32] = {
-       {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
-       {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
-       {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
-       {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
-       {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
-       {22,5,193},{64,5,0}
-       };
-
-/*+++++*/
-/* inffast.c -- fast decoding
- * Copyright (C) 1995-2004 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* Allow machine dependent optimization for post-increment or pre-increment.
-   Based on testing to date,
-   Pre-increment preferred for:
-   - PowerPC G3 (Adler)
-   - MIPS R5000 (Randers-Pehrson)
-   Post-increment preferred for:
-   - none
-   No measurable difference:
-   - Pentium III (Anderson)
-   - M68060 (Nikl)
- */
-#define OFF 1
-#define PUP(a) *++(a)
-#define UP_UNALIGNED(a) get_unaligned(++(a))
-
-/*
-   Decode literal, length, and distance codes and write out the resulting
-   literal and match bytes until either not enough input or output is
-   available, an end-of-block is encountered, or a data error is encountered.
-   When large enough input and output buffers are supplied to inflate(), for
-   example, a 16K input buffer and a 64K output buffer, more than 95% of the
-   inflate execution time is spent in this routine.
-
-   Entry assumptions:
-
-        state->mode == LEN
-        strm->avail_in >= 6
-        strm->avail_out >= 258
-        start >= strm->avail_out
-        state->bits < 8
-
-   On return, state->mode is one of:
-
-        LEN -- ran out of enough output space or enough available input
-        TYPE -- reached end of block code, inflate() to interpret next block
-        BAD -- error in block data
-
-   Notes:
-
-    - The maximum input bits used by a length/distance pair is 15 bits for the
-      length code, 5 bits for the length extra, 15 bits for the distance code,
-      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
-      Therefore if strm->avail_in >= 6, then there is enough input to avoid
-      checking for available input while decoding.
-
-    - The maximum bytes that a single length/distance pair can output is 258
-      bytes, which is the maximum length that can be coded.  inflate_fast()
-      requires strm->avail_out >= 258 for each loop to avoid checking for
-      output space.
- */
-void inflate_fast(strm, start)
-z_streamp strm;
-unsigned start;         /* inflate()'s starting value for strm->avail_out */
-{
-    struct inflate_state FAR *state;
-    unsigned char FAR *in;      /* local strm->next_in */
-    unsigned char FAR *last;    /* while in < last, enough input available */
-    unsigned char FAR *out;     /* local strm->next_out */
-    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
-    unsigned char FAR *end;     /* while out < end, enough space available */
-#ifdef INFLATE_STRICT
-    unsigned dmax;              /* maximum distance from zlib header */
-#endif
-    unsigned wsize;             /* window size or zero if not using window */
-    unsigned whave;             /* valid bytes in the window */
-    unsigned write;             /* window write index */
-    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
-    unsigned long hold;         /* local strm->hold */
-    unsigned bits;              /* local strm->bits */
-    code const FAR *lcode;      /* local strm->lencode */
-    code const FAR *dcode;      /* local strm->distcode */
-    unsigned lmask;             /* mask for first level of length codes */
-    unsigned dmask;             /* mask for first level of distance codes */
-    code this;                  /* retrieved table entry */
-    unsigned op;                /* code bits, operation, extra bits, or */
-                                /*  window position, window bytes to copy */
-    unsigned len;               /* match length, unused bytes */
-    unsigned dist;              /* match distance */
-    unsigned char FAR *from;    /* where to copy match from */
-
-    /* copy state to local variables */
-    state = (struct inflate_state FAR *)strm->state;
-    in = strm->next_in - OFF;
-    last = in + (strm->avail_in - 5);
-    out = strm->next_out - OFF;
-    beg = out - (start - strm->avail_out);
-    end = out + (strm->avail_out - 257);
-#ifdef INFLATE_STRICT
-    dmax = state->dmax;
-#endif
-    wsize = state->wsize;
-    whave = state->whave;
-    write = state->write;
-    window = state->window;
-    hold = state->hold;
-    bits = state->bits;
-    lcode = state->lencode;
-    dcode = state->distcode;
-    lmask = (1U << state->lenbits) - 1;
-    dmask = (1U << state->distbits) - 1;
-
-    /* decode literals and length/distances until end-of-block or not enough
-       input data or output space */
-    do {
-        if (bits < 15) {
-            hold += (unsigned long)(PUP(in)) << bits;
-            bits += 8;
-            hold += (unsigned long)(PUP(in)) << bits;
-            bits += 8;
-        }
-        this = lcode[hold & lmask];
-      dolen:
-        op = (unsigned)(this.bits);
-        hold >>= op;
-        bits -= op;
-        op = (unsigned)(this.op);
-        if (op == 0) {                          /* literal */
-            Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
-                    "inflate:         literal '%c'\n" :
-                    "inflate:         literal 0x%02x\n", this.val));
-            PUP(out) = (unsigned char)(this.val);
-        }
-        else if (op & 16) {                     /* length base */
-            len = (unsigned)(this.val);
-            op &= 15;                           /* number of extra bits */
-            if (op) {
-                if (bits < op) {
-                    hold += (unsigned long)(PUP(in)) << bits;
-                    bits += 8;
-                }
-                len += (unsigned)hold & ((1U << op) - 1);
-                hold >>= op;
-                bits -= op;
-            }
-            Tracevv((stderr, "inflate:         length %u\n", len));
-            if (bits < 15) {
-                hold += (unsigned long)(PUP(in)) << bits;
-                bits += 8;
-                hold += (unsigned long)(PUP(in)) << bits;
-                bits += 8;
-            }
-            this = dcode[hold & dmask];
-          dodist:
-            op = (unsigned)(this.bits);
-            hold >>= op;
-            bits -= op;
-            op = (unsigned)(this.op);
-            if (op & 16) {                      /* distance base */
-                dist = (unsigned)(this.val);
-                op &= 15;                       /* number of extra bits */
-                if (bits < op) {
-                    hold += (unsigned long)(PUP(in)) << bits;
-                    bits += 8;
-                    if (bits < op) {
-                        hold += (unsigned long)(PUP(in)) << bits;
-                        bits += 8;
-                    }
-                }
-                dist += (unsigned)hold & ((1U << op) - 1);
-#ifdef INFLATE_STRICT
-                if (dist > dmax) {
-                    strm->msg = (char *)"invalid distance too far back";
-                    state->mode = BAD;
-                    break;
-                }
-#endif
-                hold >>= op;
-                bits -= op;
-                Tracevv((stderr, "inflate:         distance %u\n", dist));
-                op = (unsigned)(out - beg);     /* max distance in output */
-                if (dist > op) {                /* see if copy from window */
-                    op = dist - op;             /* distance back in window */
-                    if (op > whave) {
-                        strm->msg = (char *)"invalid distance too far back";
-                        state->mode = BAD;
-                        break;
-                    }
-                    from = window - OFF;
-                    if (write == 0) {           /* very common case */
-                        from += wsize - op;
-                        if (op < len) {         /* some from window */
-                            len -= op;
-                            do {
-                                PUP(out) = PUP(from);
-                            } while (--op);
-                            from = out - dist;  /* rest from output */
-                        }
-                    }
-                    else if (write < op) {      /* wrap around window */
-                        from += wsize + write - op;
-                        op -= write;
-                        if (op < len) {         /* some from end of window */
-                            len -= op;
-                            do {
-                                PUP(out) = PUP(from);
-                            } while (--op);
-                            from = window - OFF;
-                            if (write < len) {  /* some from start of window */
-                                op = write;
-                                len -= op;
-                                do {
-                                    PUP(out) = PUP(from);
-                                } while (--op);
-                                from = out - dist;      /* rest from output */
-                            }
-                        }
-                    }
-                    else {                      /* contiguous in window */
-                        from += write - op;
-                        if (op < len) {         /* some from window */
-                            len -= op;
-                            do {
-                                PUP(out) = PUP(from);
-                            } while (--op);
-                            from = out - dist;  /* rest from output */
-                        }
-                    }
-                    while (len > 2) {
-                        PUP(out) = PUP(from);
-                        PUP(out) = PUP(from);
-                        PUP(out) = PUP(from);
-                        len -= 3;
-                    }
-                    if (len) {
-                        PUP(out) = PUP(from);
-                        if (len > 1)
-                            PUP(out) = PUP(from);
-                    }
-                }
-                else {
-                   unsigned short *sout;
-                   unsigned long loops;
-
-                    from = out - dist;          /* copy direct from output */
-                    /* minimum length is three */
-                   /* Align out addr */
-                   if (!((long)(out - 1 + OFF) & 1)) {
-                       PUP(out) = PUP(from);
-                       len--;
-                   }
-                   sout = (unsigned short *)(out - OFF);
-                   if (dist > 2 ) {
-                       unsigned short *sfrom;
-
-                       sfrom = (unsigned short *)(from - OFF);
-                       loops = len >> 1;
-                       do
-                           PUP(sout) = UP_UNALIGNED(sfrom);
-                       while (--loops);
-                       out = (unsigned char *)sout + OFF;
-                       from = (unsigned char *)sfrom + OFF;
-                   } else { /* dist == 1 or dist == 2 */
-                       unsigned short pat16;
-
-                       pat16 = *(sout-2+2*OFF);
-                       if (dist == 1)
-#if defined(__BIG_ENDIAN)
-                           pat16 = (pat16 & 0xff) | ((pat16 & 0xff ) << 8);
-#elif defined(__LITTLE_ENDIAN)
-                           pat16 = (pat16 & 0xff00) | ((pat16 & 0xff00 ) >> 8);
-#else
-#error __BIG_ENDIAN nor __LITTLE_ENDIAN is defined
-#endif
-                       loops = len >> 1;
-                       do
-                           PUP(sout) = pat16;
-                       while (--loops);
-                       out = (unsigned char *)sout + OFF;
-                   }
-                   if (len & 1)
-                       PUP(out) = PUP(from);
-                }
-            }
-            else if ((op & 64) == 0) {          /* 2nd level distance code */
-                this = dcode[this.val + (hold & ((1U << op) - 1))];
-                goto dodist;
-            }
-            else {
-                strm->msg = (char *)"invalid distance code";
-                state->mode = BAD;
-                break;
-            }
-        }
-        else if ((op & 64) == 0) {              /* 2nd level length code */
-            this = lcode[this.val + (hold & ((1U << op) - 1))];
-            goto dolen;
-        }
-        else if (op & 32) {                     /* end-of-block */
-            Tracevv((stderr, "inflate:         end of block\n"));
-            state->mode = TYPE;
-            break;
-        }
-        else {
-            strm->msg = (char *)"invalid literal/length code";
-            state->mode = BAD;
-            break;
-        }
-    } while (in < last && out < end);
-
-    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
-    len = bits >> 3;
-    in -= len;
-    bits -= len << 3;
-    hold &= (1U << bits) - 1;
-
-    /* update state and return */
-    strm->next_in = in + OFF;
-    strm->next_out = out + OFF;
-    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
-    strm->avail_out = (unsigned)(out < end ?
-                                 257 + (end - out) : 257 - (out - end));
-    state->hold = hold;
-    state->bits = bits;
-    return;
-}
-
-/*
-   inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
-   - Using bit fields for code structure
-   - Different op definition to avoid & for extra bits (do & for table bits)
-   - Three separate decoding do-loops for direct, window, and write == 0
-   - Special case for distance > 1 copies to do overlapped load and store copy
-   - Explicit branch predictions (based on measured branch probabilities)
-   - Deferring match copy and interspersed it with decoding subsequent codes
-   - Swapping literal/length else
-   - Swapping window/direct else
-   - Larger unrolled copy loops (three is about right)
-   - Moving len -= 3 statement into middle of loop
- */
-
-/*+++++*/
-/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2005 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#define MAXBITS 15
-/*
-  If you use the zlib library in a product, an acknowledgment is welcome
-  in the documentation of your product. If for some reason you cannot
-  include such an acknowledgment, I would appreciate that you keep this
-  copyright string in the executable of your product.
- */
-
-/*
-   Build a set of tables to decode the provided canonical Huffman code.
-   The code lengths are lens[0..codes-1].  The result starts at *table,
-   whose indices are 0..2^bits-1.  work is a writable array of at least
-   lens shorts, which is used as a work area.  type is the type of code
-   to be generated, CODES, LENS, or DISTS.  On return, zero is success,
-   -1 is an invalid code, and +1 means that ENOUGH isn't enough.  table
-   on return points to the next available entry's address.  bits is the
-   requested root table index bits, and on return it is the actual root
-   table index bits.  It will differ if the request is greater than the
-   longest code or if it is less than the shortest code.
- */
-int inflate_table(type, lens, codes, table, bits, work)
-codetype type;
-unsigned short FAR *lens;
-unsigned codes;
-code FAR * FAR *table;
-unsigned FAR *bits;
-unsigned short FAR *work;
-{
-    unsigned len;               /* a code's length in bits */
-    unsigned sym;               /* index of code symbols */
-    unsigned min, max;          /* minimum and maximum code lengths */
-    unsigned root;              /* number of index bits for root table */
-    unsigned curr;              /* number of index bits for current table */
-    unsigned drop;              /* code bits to drop for sub-table */
-    int left;                   /* number of prefix codes available */
-    unsigned used;              /* code entries in table used */
-    unsigned huff;              /* Huffman code */
-    unsigned incr;              /* for incrementing code, index */
-    unsigned fill;              /* index for replicating entries */
-    unsigned low;               /* low bits for current root entry */
-    unsigned mask;              /* mask for low root bits */
-    code this;                  /* table entry for duplication */
-    code FAR *next;             /* next available space in table */
-    const unsigned short FAR *base;     /* base value table to use */
-    const unsigned short FAR *extra;    /* extra bits table to use */
-    int end;                    /* use base and extra for symbol > end */
-    unsigned short count[MAXBITS+1];    /* number of codes of each length */
-    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
-    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
-        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
-        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
-    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
-        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
-        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196};
-    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
-        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
-        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
-        8193, 12289, 16385, 24577, 0, 0};
-    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
-        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
-        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
-        28, 28, 29, 29, 64, 64};
-
-    /*
-       Process a set of code lengths to create a canonical Huffman code.  The
-       code lengths are lens[0..codes-1].  Each length corresponds to the
-       symbols 0..codes-1.  The Huffman code is generated by first sorting the
-       symbols by length from short to long, and retaining the symbol order
-       for codes with equal lengths.  Then the code starts with all zero bits
-       for the first code of the shortest length, and the codes are integer
-       increments for the same length, and zeros are appended as the length
-       increases.  For the deflate format, these bits are stored backwards
-       from their more natural integer increment ordering, and so when the
-       decoding tables are built in the large loop below, the integer codes
-       are incremented backwards.
-
-       This routine assumes, but does not check, that all of the entries in
-       lens[] are in the range 0..MAXBITS.  The caller must assure this.
-       1..MAXBITS is interpreted as that code length.  zero means that that
-       symbol does not occur in this code.
-
-       The codes are sorted by computing a count of codes for each length,
-       creating from that a table of starting indices for each length in the
-       sorted table, and then entering the symbols in order in the sorted
-       table.  The sorted table is work[], with that space being provided by
-       the caller.
-
-       The length counts are used for other purposes as well, i.e. finding
-       the minimum and maximum length codes, determining if there are any
-       codes at all, checking for a valid set of lengths, and looking ahead
-       at length counts to determine sub-table sizes when building the
-       decoding tables.
-     */
-
-    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
-    for (len = 0; len <= MAXBITS; len++)
-        count[len] = 0;
-    for (sym = 0; sym < codes; sym++)
-        count[lens[sym]]++;
-
-    /* bound code lengths, force root to be within code lengths */
-    root = *bits;
-    for (max = MAXBITS; max >= 1; max--)
-        if (count[max] != 0) break;
-    if (root > max) root = max;
-    if (max == 0) {                     /* no symbols to code at all */
-        this.op = (unsigned char)64;    /* invalid code marker */
-        this.bits = (unsigned char)1;
-        this.val = (unsigned short)0;
-        *(*table)++ = this;             /* make a table to force an error */
-        *(*table)++ = this;
-        *bits = 1;
-        return 0;     /* no symbols, but wait for decoding to report error */
-    }
-    for (min = 1; min <= MAXBITS; min++)
-        if (count[min] != 0) break;
-    if (root < min) root = min;
-
-    /* check for an over-subscribed or incomplete set of lengths */
-    left = 1;
-    for (len = 1; len <= MAXBITS; len++) {
-        left <<= 1;
-        left -= count[len];
-        if (left < 0) return -1;        /* over-subscribed */
-    }
-    if (left > 0 && (type == CODES || max != 1))
-        return -1;                      /* incomplete set */
-
-    /* generate offsets into symbol table for each length for sorting */
-    offs[1] = 0;
-    for (len = 1; len < MAXBITS; len++)
-        offs[len + 1] = offs[len] + count[len];
-
-    /* sort symbols by length, by symbol order within each length */
-    for (sym = 0; sym < codes; sym++)
-        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
-
-    /*
-       Create and fill in decoding tables.  In this loop, the table being
-       filled is at next and has curr index bits.  The code being used is huff
-       with length len.  That code is converted to an index by dropping drop
-       bits off of the bottom.  For codes where len is less than drop + curr,
-       those top drop + curr - len bits are incremented through all values to
-       fill the table with replicated entries.
-
-       root is the number of index bits for the root table.  When len exceeds
-       root, sub-tables are created pointed to by the root entry with an index
-       of the low root bits of huff.  This is saved in low to check for when a
-       new sub-table should be started.  drop is zero when the root table is
-       being filled, and drop is root when sub-tables are being filled.
-
-       When a new sub-table is needed, it is necessary to look ahead in the
-       code lengths to determine what size sub-table is needed.  The length
-       counts are used for this, and so count[] is decremented as codes are
-       entered in the tables.
-
-       used keeps track of how many table entries have been allocated from the
-       provided *table space.  It is checked when a LENS table is being made
-       against the space in *table, ENOUGH, minus the maximum space needed by
-       the worst case distance code, MAXD.  This should never happen, but the
-       sufficiency of ENOUGH has not been proven exhaustively, hence the check.
-       This assumes that when type == LENS, bits == 9.
-
-       sym increments through all symbols, and the loop terminates when
-       all codes of length max, i.e. all codes, have been processed.  This
-       routine permits incomplete codes, so another loop after this one fills
-       in the rest of the decoding tables with invalid code markers.
-     */
-
-    /* set up for code type */
-    switch (type) {
-    case CODES:
-        base = extra = work;    /* dummy value--not used */
-        end = 19;
-        break;
-    case LENS:
-        base = lbase;
-        base -= 257;
-        extra = lext;
-        extra -= 257;
-        end = 256;
-        break;
-    default:            /* DISTS */
-        base = dbase;
-        extra = dext;
-        end = -1;
-    }
-
-    /* initialize state for loop */
-    huff = 0;                   /* starting code */
-    sym = 0;                    /* starting code symbol */
-    len = min;                  /* starting code length */
-    next = *table;              /* current table to fill in */
-    curr = root;                /* current table index bits */
-    drop = 0;                   /* current bits to drop from code for index */
-    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
-    used = 1U << root;          /* use root table entries */
-    mask = used - 1;            /* mask for comparing low */
-
-    /* check available table space */
-    if (type == LENS && used >= ENOUGH - MAXD)
-        return 1;
-
-    /* process all codes and make table entries */
-    for (;;) {
-        /* create table entry */
-        this.bits = (unsigned char)(len - drop);
-        if ((int)(work[sym]) < end) {
-            this.op = (unsigned char)0;
-            this.val = work[sym];
-        }
-        else if ((int)(work[sym]) > end) {
-            this.op = (unsigned char)(extra[work[sym]]);
-            this.val = base[work[sym]];
-        }
-        else {
-            this.op = (unsigned char)(32 + 64);         /* end of block */
-            this.val = 0;
-        }
-
-        /* replicate for those indices with low len bits equal to huff */
-        incr = 1U << (len - drop);
-        fill = 1U << curr;
-        min = fill;                 /* save offset to next table */
-        do {
-            fill -= incr;
-            next[(huff >> drop) + fill] = this;
-        } while (fill != 0);
-
-        /* backwards increment the len-bit code huff */
-        incr = 1U << (len - 1);
-        while (huff & incr)
-            incr >>= 1;
-        if (incr != 0) {
-            huff &= incr - 1;
-            huff += incr;
-        }
-        else
-            huff = 0;
-
-        /* go to next symbol, update count, len */
-        sym++;
-        if (--(count[len]) == 0) {
-            if (len == max) break;
-            len = lens[work[sym]];
-        }
-
-        /* create new sub-table if needed */
-        if (len > root && (huff & mask) != low) {
-            /* if first time, transition to sub-tables */
-            if (drop == 0)
-                drop = root;
-
-            /* increment past last table */
-            next += min;            /* here min is 1 << curr */
-
-            /* determine length of next table */
-            curr = len - drop;
-            left = (int)(1 << curr);
-            while (curr + drop < max) {
-                left -= count[curr + drop];
-                if (left <= 0) break;
-                curr++;
-                left <<= 1;
-            }
-
-            /* check for enough space */
-            used += 1U << curr;
-            if (type == LENS && used >= ENOUGH - MAXD)
-                return 1;
-
-            /* point entry in root table to sub-table */
-            low = huff & mask;
-            (*table)[low].op = (unsigned char)curr;
-            (*table)[low].bits = (unsigned char)root;
-            (*table)[low].val = (unsigned short)(next - *table);
-        }
-    }
-
-    /*
-       Fill in rest of table for incomplete codes.  This loop is similar to the
-       loop above in incrementing huff for table indices.  It is assumed that
-       len is equal to curr + drop, so there is no loop needed to increment
-       through high index bits.  When the current sub-table is filled, the loop
-       drops back to the root table to fill in any remaining entries there.
-     */
-    this.op = (unsigned char)64;                /* invalid code marker */
-    this.bits = (unsigned char)(len - drop);
-    this.val = (unsigned short)0;
-    while (huff != 0) {
-        /* when done with sub-table, drop back to root table */
-        if (drop != 0 && (huff & mask) != low) {
-            drop = 0;
-            len = root;
-            next = *table;
-            this.bits = (unsigned char)len;
-        }
-
-        /* put invalid code marker in table */
-        next[huff >> drop] = this;
-
-        /* backwards increment the len-bit code huff */
-        incr = 1U << (len - 1);
-        while (huff & incr)
-            incr >>= 1;
-        if (incr != 0) {
-            huff &= incr - 1;
-            huff += incr;
-        }
-        else
-            huff = 0;
-    }
-
-    /* set return parameters */
-    *table += used;
-    *bits = root;
-    return 0;
-}
-
-/*+++++*/
-/* inflate.c -- zlib decompression
- * Copyright (C) 1995-2005 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-local void fixedtables OF((struct inflate_state FAR *state));
-local int updatewindow OF((z_streamp strm, unsigned out));
-
-int ZEXPORT inflateReset(strm)
-z_streamp strm;
-{
-    struct inflate_state FAR *state;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    strm->total_in = strm->total_out = state->total = 0;
-    strm->msg = Z_NULL;
-    strm->adler = 1;        /* to support ill-conceived Java test suite */
-    state->mode = HEAD;
-    state->last = 0;
-    state->havedict = 0;
-    state->dmax = 32768U;
-    state->head = Z_NULL;
-    state->wsize = 0;
-    state->whave = 0;
-    state->write = 0;
-    state->hold = 0;
-    state->bits = 0;
-    state->lencode = state->distcode = state->next = state->codes;
-    WATCHDOG_RESET();
-    Tracev((stderr, "inflate: reset\n"));
-    return Z_OK;
-}
-
-int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
-z_streamp strm;
-int windowBits;
-const char *version;
-int stream_size;
-{
-    struct inflate_state FAR *state;
-
-    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
-        stream_size != (int)(sizeof(z_stream)))
-        return Z_VERSION_ERROR;
-    if (strm == Z_NULL) return Z_STREAM_ERROR;
-    strm->msg = Z_NULL;                 /* in case we return an error */
-    if (strm->zalloc == (alloc_func)0) {
-        strm->zalloc = zcalloc;
-        strm->opaque = (voidpf)0;
-    }
-    if (strm->zfree == (free_func)0) strm->zfree = zcfree;
-    state = (struct inflate_state FAR *)
-            ZALLOC(strm, 1, sizeof(struct inflate_state));
-    if (state == Z_NULL) return Z_MEM_ERROR;
-    Tracev((stderr, "inflate: allocated\n"));
-    strm->state = (struct internal_state FAR *)state;
-    if (windowBits < 0) {
-        state->wrap = 0;
-        windowBits = -windowBits;
-    }
-    else {
-        state->wrap = (windowBits >> 4) + 1;
-#ifdef GUNZIP
-        if (windowBits < 48) windowBits &= 15;
-#endif
-    }
-    if (windowBits < 8 || windowBits > 15) {
-        ZFREE(strm, state);
-        strm->state = Z_NULL;
-        return Z_STREAM_ERROR;
-    }
-    state->wbits = (unsigned)windowBits;
-    state->window = Z_NULL;
-    return inflateReset(strm);
-}
-
-int ZEXPORT inflateInit_(strm, version, stream_size)
-z_streamp strm;
-const char *version;
-int stream_size;
-{
-    return inflateInit2_(strm, DEF_WBITS, version, stream_size);
-}
-
-local void fixedtables(state)
-struct inflate_state FAR *state;
-{
-    state->lencode = lenfix;
-    state->lenbits = 9;
-    state->distcode = distfix;
-    state->distbits = 5;
-}
-
-/*
-   Update the window with the last wsize (normally 32K) bytes written before
-   returning.  If window does not exist yet, create it.  This is only called
-   when a window is already in use, or when output has been written during this
-   inflate call, but the end of the deflate stream has not been reached yet.
-   It is also called to create a window for dictionary data when a dictionary
-   is loaded.
-
-   Providing output buffers larger than 32K to inflate() should provide a speed
-   advantage, since only the last 32K of output is copied to the sliding window
-   upon return from inflate(), and since all distances after the first 32K of
-   output will fall in the output data, making match copies simpler and faster.
-   The advantage may be dependent on the size of the processor's data caches.
- */
-local int updatewindow(strm, out)
-z_streamp strm;
-unsigned out;
-{
-    struct inflate_state FAR *state;
-    unsigned copy, dist;
-
-    state = (struct inflate_state FAR *)strm->state;
-
-    /* if it hasn't been done already, allocate space for the window */
-    if (state->window == Z_NULL) {
-        state->window = (unsigned char FAR *)
-                        ZALLOC(strm, 1U << state->wbits,
-                               sizeof(unsigned char));
-        if (state->window == Z_NULL) return 1;
-    }
-
-    /* if window not in use yet, initialize */
-    if (state->wsize == 0) {
-        state->wsize = 1U << state->wbits;
-        state->write = 0;
-        state->whave = 0;
-    }
-
-    /* copy state->wsize or less output bytes into the circular window */
-    copy = out - strm->avail_out;
-    if (copy >= state->wsize) {
-        zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
-        state->write = 0;
-        state->whave = state->wsize;
-    }
-    else {
-        dist = state->wsize - state->write;
-        if (dist > copy) dist = copy;
-        zmemcpy(state->window + state->write, strm->next_out - copy, dist);
-        copy -= dist;
-        if (copy) {
-            zmemcpy(state->window, strm->next_out - copy, copy);
-            state->write = copy;
-            state->whave = state->wsize;
-        }
-        else {
-            state->write += dist;
-            if (state->write == state->wsize) state->write = 0;
-            if (state->whave < state->wsize) state->whave += dist;
-        }
-    }
-    return 0;
-}
-
-/* Macros for inflate(): */
-
-/* check function to use adler32() for zlib or crc32() for gzip */
-#define UPDATE(check, buf, len) \
-       (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
-
-/* check macros for header crc */
-#define CRC2(check, word) \
-       do { \
-               hbuf[0] = (unsigned char)(word); \
-               hbuf[1] = (unsigned char)((word) >> 8); \
-               check = crc32(check, hbuf, 2); \
-       } while (0)
-
-#define CRC4(check, word) \
-       do { \
-               hbuf[0] = (unsigned char)(word); \
-               hbuf[1] = (unsigned char)((word) >> 8); \
-               hbuf[2] = (unsigned char)((word) >> 16); \
-               hbuf[3] = (unsigned char)((word) >> 24); \
-               check = crc32(check, hbuf, 4); \
-       } while (0)
-
-/* Load registers with state in inflate() for speed */
-#define LOAD() \
-       do { \
-               put = strm->next_out; \
-               left = strm->avail_out; \
-               next = strm->next_in; \
-               have = strm->avail_in; \
-               hold = state->hold; \
-               bits = state->bits; \
-       } while (0)
-
-/* Restore state from registers in inflate() */
-#define RESTORE() \
-       do { \
-               strm->next_out = put; \
-               strm->avail_out = left; \
-               strm->next_in = next; \
-               strm->avail_in = have; \
-               state->hold = hold; \
-               state->bits = bits; \
-       } while (0)
-
-/* Clear the input bit accumulator */
-#define INITBITS() \
-       do { \
-               hold = 0; \
-               bits = 0; \
-       } while (0)
-
-/* Get a byte of input into the bit accumulator, or return from inflate()
-   if there is no input available. */
-#define PULLBYTE() \
-       do { \
-               if (have == 0) goto inf_leave; \
-               have--; \
-               hold += (unsigned long)(*next++) << bits; \
-               bits += 8; \
-       } while (0)
-
-/* Assure that there are at least n bits in the bit accumulator.  If there is
-   not enough available input to do that, then return from inflate(). */
-#define NEEDBITS(n) \
-       do { \
-               while (bits < (unsigned)(n)) \
-                       PULLBYTE(); \
-       } while (0)
-
-/* Return the low n bits of the bit accumulator (n < 16) */
-#define BITS(n) \
-       ((unsigned)hold & ((1U << (n)) - 1))
-
-/* Remove n bits from the bit accumulator */
-#define DROPBITS(n) \
-       do { \
-               hold >>= (n); \
-               bits -= (unsigned)(n); \
-       } while (0)
-
-/* Remove zero to seven bits as needed to go to a byte boundary */
-#define BYTEBITS() \
-       do { \
-               hold >>= bits & 7; \
-               bits -= bits & 7; \
-       } while (0)
-
-/* Reverse the bytes in a 32-bit value */
-#define REVERSE(q) \
-       ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
-               (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
-
-/*
-   inflate() uses a state machine to process as much input data and generate as
-   much output data as possible before returning.  The state machine is
-   structured roughly as follows:
-
-    for (;;) switch (state) {
-    ...
-    case STATEn:
-        if (not enough input data or output space to make progress)
-            return;
-        ... make progress ...
-        state = STATEm;
-        break;
-    ...
-    }
-
-   so when inflate() is called again, the same case is attempted again, and
-   if the appropriate resources are provided, the machine proceeds to the
-   next state.  The NEEDBITS() macro is usually the way the state evaluates
-   whether it can proceed or should return.  NEEDBITS() does the return if
-   the requested bits are not available.  The typical use of the BITS macros
-   is:
-
-        NEEDBITS(n);
-        ... do something with BITS(n) ...
-        DROPBITS(n);
-
-   where NEEDBITS(n) either returns from inflate() if there isn't enough
-   input left to load n bits into the accumulator, or it continues.  BITS(n)
-   gives the low n bits in the accumulator.  When done, DROPBITS(n) drops
-   the low n bits off the accumulator.  INITBITS() clears the accumulator
-   and sets the number of available bits to zero.  BYTEBITS() discards just
-   enough bits to put the accumulator on a byte boundary.  After BYTEBITS()
-   and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
-
-   NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
-   if there is no input available.  The decoding of variable length codes uses
-   PULLBYTE() directly in order to pull just enough bytes to decode the next
-   code, and no more.
-
-   Some states loop until they get enough input, making sure that enough
-   state information is maintained to continue the loop where it left off
-   if NEEDBITS() returns in the loop.  For example, want, need, and keep
-   would all have to actually be part of the saved state in case NEEDBITS()
-   returns:
-
-    case STATEw:
-        while (want < need) {
-            NEEDBITS(n);
-            keep[want++] = BITS(n);
-            DROPBITS(n);
-        }
-        state = STATEx;
-    case STATEx:
-
-   As shown above, if the next state is also the next case, then the break
-   is omitted.
-
-   A state may also return if there is not enough output space available to
-   complete that state.  Those states are copying stored data, writing a
-   literal byte, and copying a matching string.
-
-   When returning, a "goto inf_leave" is used to update the total counters,
-   update the check value, and determine whether any progress has been made
-   during that inflate() call in order to return the proper return code.
-   Progress is defined as a change in either strm->avail_in or strm->avail_out.
-   When there is a window, goto inf_leave will update the window with the last
-   output written.  If a goto inf_leave occurs in the middle of decompression
-   and there is no window currently, goto inf_leave will create one and copy
-   output to the window for the next call of inflate().
-
-   In this implementation, the flush parameter of inflate() only affects the
-   return code (per zlib.h).  inflate() always writes as much as possible to
-   strm->next_out, given the space available and the provided input--the effect
-   documented in zlib.h of Z_SYNC_FLUSH.  Furthermore, inflate() always defers
-   the allocation of and copying into a sliding window until necessary, which
-   provides the effect documented in zlib.h for Z_FINISH when the entire input
-   stream available.  So the only thing the flush parameter actually does is:
-   when flush is set to Z_FINISH, inflate() cannot return Z_OK.  Instead it
-   will return Z_BUF_ERROR if it has not reached the end of the stream.
- */
-int ZEXPORT inflate(strm, flush)
-z_streamp strm;
-int flush;
-{
-    struct inflate_state FAR *state;
-    unsigned char FAR *next;    /* next input */
-    unsigned char FAR *put;     /* next output */
-    unsigned have, left;        /* available input and output */
-    unsigned long hold;         /* bit buffer */
-    unsigned bits;              /* bits in bit buffer */
-    unsigned in, out;           /* save starting available input and output */
-    unsigned copy;              /* number of stored or match bytes to copy */
-    unsigned char FAR *from;    /* where to copy match bytes from */
-    code this;                  /* current decoding table entry */
-    code last;                  /* parent table entry */
-    unsigned len;               /* length to copy for repeats, bits to drop */
-    int ret;                    /* return code */
-#ifdef GUNZIP
-    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
-#endif
-    static const unsigned short order[19] = /* permutation of code lengths */
-        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
-
-    if (strm == Z_NULL || strm->state == Z_NULL ||
-        (strm->next_in == Z_NULL && strm->avail_in != 0))
-        return Z_STREAM_ERROR;
-
-    state = (struct inflate_state FAR *)strm->state;
-    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
-    LOAD();
-    in = have;
-    out = left;
-    ret = Z_OK;
-    for (;;)
-        switch (state->mode) {
-        case HEAD:
-            if (state->wrap == 0) {
-                state->mode = TYPEDO;
-                break;
-            }
-            NEEDBITS(16);
-#ifdef GUNZIP
-            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
-                state->check = crc32(0L, Z_NULL, 0);
-                CRC2(state->check, hold);
-                INITBITS();
-                state->mode = FLAGS;
-                break;
-            }
-            state->flags = 0;           /* expect zlib header */
-            if (state->head != Z_NULL)
-                state->head->done = -1;
-            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
-#else
-            if (
-#endif
-                ((BITS(8) << 8) + (hold >> 8)) % 31) {
-                strm->msg = (char *)"incorrect header check";
-                state->mode = BAD;
-                break;
-            }
-            if (BITS(4) != Z_DEFLATED) {
-                strm->msg = (char *)"unknown compression method";
-                state->mode = BAD;
-                break;
-            }
-            DROPBITS(4);
-            len = BITS(4) + 8;
-            if (len > state->wbits) {
-                strm->msg = (char *)"invalid window size";
-                state->mode = BAD;
-                break;
-            }
-            state->dmax = 1U << len;
-            Tracev((stderr, "inflate:   zlib header ok\n"));
-            strm->adler = state->check = adler32(0L, Z_NULL, 0);
-            state->mode = hold & 0x200 ? DICTID : TYPE;
-            INITBITS();
-            break;
-#ifdef GUNZIP
-        case FLAGS:
-            NEEDBITS(16);
-            state->flags = (int)(hold);
-            if ((state->flags & 0xff) != Z_DEFLATED) {
-                strm->msg = (char *)"unknown compression method";
-                state->mode = BAD;
-                break;
-            }
-            if (state->flags & 0xe000) {
-                strm->msg = (char *)"unknown header flags set";
-                state->mode = BAD;
-                break;
-            }
-            if (state->head != Z_NULL)
-                state->head->text = (int)((hold >> 8) & 1);
-            if (state->flags & 0x0200) CRC2(state->check, hold);
-            INITBITS();
-            state->mode = TIME;
-        case TIME:
-            NEEDBITS(32);
-            if (state->head != Z_NULL)
-                state->head->time = hold;
-            if (state->flags & 0x0200) CRC4(state->check, hold);
-            INITBITS();
-            state->mode = OS;
-        case OS:
-            NEEDBITS(16);
-            if (state->head != Z_NULL) {
-                state->head->xflags = (int)(hold & 0xff);
-                state->head->os = (int)(hold >> 8);
-            }
-            if (state->flags & 0x0200) CRC2(state->check, hold);
-            INITBITS();
-            state->mode = EXLEN;
-        case EXLEN:
-            if (state->flags & 0x0400) {
-                NEEDBITS(16);
-                state->length = (unsigned)(hold);
-                if (state->head != Z_NULL)
-                    state->head->extra_len = (unsigned)hold;
-                if (state->flags & 0x0200) CRC2(state->check, hold);
-                INITBITS();
-            }
-            else if (state->head != Z_NULL)
-                state->head->extra = Z_NULL;
-            state->mode = EXTRA;
-        case EXTRA:
-            if (state->flags & 0x0400) {
-                copy = state->length;
-                if (copy > have) copy = have;
-                if (copy) {
-                    if (state->head != Z_NULL &&
-                        state->head->extra != Z_NULL) {
-                        len = state->head->extra_len - state->length;
-                        zmemcpy(state->head->extra + len, next,
-                                len + copy > state->head->extra_max ?
-                                state->head->extra_max - len : copy);
-                    }
-                    if (state->flags & 0x0200)
-                        state->check = crc32(state->check, next, copy);
-                    have -= copy;
-                    next += copy;
-                    state->length -= copy;
-                }
-                if (state->length) goto inf_leave;
-            }
-            state->length = 0;
-            state->mode = NAME;
-        case NAME:
-            if (state->flags & 0x0800) {
-                if (have == 0) goto inf_leave;
-                copy = 0;
-                do {
-                    len = (unsigned)(next[copy++]);
-                    if (state->head != Z_NULL &&
-                            state->head->name != Z_NULL &&
-                            state->length < state->head->name_max)
-                        state->head->name[state->length++] = len;
-                } while (len && copy < have);
-                if (state->flags & 0x0200)
-                    state->check = crc32(state->check, next, copy);
-                have -= copy;
-                next += copy;
-                if (len) goto inf_leave;
-            }
-            else if (state->head != Z_NULL)
-                state->head->name = Z_NULL;
-            state->length = 0;
-            state->mode = COMMENT;
-        case COMMENT:
-            if (state->flags & 0x1000) {
-                if (have == 0) goto inf_leave;
-                copy = 0;
-                do {
-                    len = (unsigned)(next[copy++]);
-                    if (state->head != Z_NULL &&
-                            state->head->comment != Z_NULL &&
-                            state->length < state->head->comm_max)
-                        state->head->comment[state->length++] = len;
-                } while (len && copy < have);
-                if (state->flags & 0x0200)
-                    state->check = crc32(state->check, next, copy);
-                have -= copy;
-                next += copy;
-                if (len) goto inf_leave;
-            }
-            else if (state->head != Z_NULL)
-                state->head->comment = Z_NULL;
-            state->mode = HCRC;
-        case HCRC:
-            if (state->flags & 0x0200) {
-                NEEDBITS(16);
-                if (hold != (state->check & 0xffff)) {
-                    strm->msg = (char *)"header crc mismatch";
-                    state->mode = BAD;
-                    break;
-                }
-                INITBITS();
-            }
-            if (state->head != Z_NULL) {
-                state->head->hcrc = (int)((state->flags >> 9) & 1);
-                state->head->done = 1;
-            }
-            strm->adler = state->check = crc32(0L, Z_NULL, 0);
-            state->mode = TYPE;
-            break;
-#endif
-        case DICTID:
-            NEEDBITS(32);
-            strm->adler = state->check = REVERSE(hold);
-            INITBITS();
-            state->mode = DICT;
-        case DICT:
-            if (state->havedict == 0) {
-                RESTORE();
-                return Z_NEED_DICT;
-            }
-            strm->adler = state->check = adler32(0L, Z_NULL, 0);
-            state->mode = TYPE;
-        case TYPE:
-           WATCHDOG_RESET();
-            if (flush == Z_BLOCK) goto inf_leave;
-        case TYPEDO:
-            if (state->last) {
-                BYTEBITS();
-                state->mode = CHECK;
-                break;
-            }
-            NEEDBITS(3);
-            state->last = BITS(1);
-            DROPBITS(1);
-            switch (BITS(2)) {
-            case 0:                             /* stored block */
-                Tracev((stderr, "inflate:     stored block%s\n",
-                        state->last ? " (last)" : ""));
-                state->mode = STORED;
-                break;
-            case 1:                             /* fixed block */
-                fixedtables(state);
-                Tracev((stderr, "inflate:     fixed codes block%s\n",
-                        state->last ? " (last)" : ""));
-                state->mode = LEN;              /* decode codes */
-                break;
-            case 2:                             /* dynamic block */
-                Tracev((stderr, "inflate:     dynamic codes block%s\n",
-                        state->last ? " (last)" : ""));
-                state->mode = TABLE;
-                break;
-            case 3:
-                strm->msg = (char *)"invalid block type";
-                state->mode = BAD;
-            }
-            DROPBITS(2);
-            break;
-        case STORED:
-            BYTEBITS();                         /* go to byte boundary */
-            NEEDBITS(32);
-            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
-                strm->msg = (char *)"invalid stored block lengths";
-                state->mode = BAD;
-                break;
-            }
-            state->length = (unsigned)hold & 0xffff;
-            Tracev((stderr, "inflate:       stored length %u\n",
-                    state->length));
-            INITBITS();
-            state->mode = COPY;
-        case COPY:
-            copy = state->length;
-            if (copy) {
-                if (copy > have) copy = have;
-                if (copy > left) copy = left;
-                if (copy == 0) goto inf_leave;
-                zmemcpy(put, next, copy);
-                have -= copy;
-                next += copy;
-                left -= copy;
-                put += copy;
-                state->length -= copy;
-                break;
-            }
-            Tracev((stderr, "inflate:       stored end\n"));
-            state->mode = TYPE;
-            break;
-        case TABLE:
-            NEEDBITS(14);
-            state->nlen = BITS(5) + 257;
-            DROPBITS(5);
-            state->ndist = BITS(5) + 1;
-            DROPBITS(5);
-            state->ncode = BITS(4) + 4;
-            DROPBITS(4);
-#ifndef PKZIP_BUG_WORKAROUND
-            if (state->nlen > 286 || state->ndist > 30) {
-                strm->msg = (char *)"too many length or distance symbols";
-                state->mode = BAD;
-                break;
-            }
-#endif
-            Tracev((stderr, "inflate:       table sizes ok\n"));
-            state->have = 0;
-            state->mode = LENLENS;
-        case LENLENS:
-            while (state->have < state->ncode) {
-                NEEDBITS(3);
-                state->lens[order[state->have++]] = (unsigned short)BITS(3);
-                DROPBITS(3);
-            }
-            while (state->have < 19)
-                state->lens[order[state->have++]] = 0;
-            state->next = state->codes;
-            state->lencode = (code const FAR *)(state->next);
-            state->lenbits = 7;
-            ret = inflate_table(CODES, state->lens, 19, &(state->next),
-                                &(state->lenbits), state->work);
-            if (ret) {
-                strm->msg = (char *)"invalid code lengths set";
-                state->mode = BAD;
-                break;
-            }
-            Tracev((stderr, "inflate:       code lengths ok\n"));
-            state->have = 0;
-            state->mode = CODELENS;
-        case CODELENS:
-            while (state->have < state->nlen + state->ndist) {
-                for (;;) {
-                    this = state->lencode[BITS(state->lenbits)];
-                    if ((unsigned)(this.bits) <= bits) break;
-                    PULLBYTE();
-                }
-                if (this.val < 16) {
-                    NEEDBITS(this.bits);
-                    DROPBITS(this.bits);
-                    state->lens[state->have++] = this.val;
-                }
-                else {
-                    if (this.val == 16) {
-                        NEEDBITS(this.bits + 2);
-                        DROPBITS(this.bits);
-                        if (state->have == 0) {
-                            strm->msg = (char *)"invalid bit length repeat";
-                            state->mode = BAD;
-                            break;
-                        }
-                        len = state->lens[state->have - 1];
-                        copy = 3 + BITS(2);
-                        DROPBITS(2);
-                    }
-                    else if (this.val == 17) {
-                        NEEDBITS(this.bits + 3);
-                        DROPBITS(this.bits);
-                        len = 0;
-                        copy = 3 + BITS(3);
-                        DROPBITS(3);
-                    }
-                    else {
-                        NEEDBITS(this.bits + 7);
-                        DROPBITS(this.bits);
-                        len = 0;
-                        copy = 11 + BITS(7);
-                        DROPBITS(7);
-                    }
-                    if (state->have + copy > state->nlen + state->ndist) {
-                        strm->msg = (char *)"invalid bit length repeat";
-                        state->mode = BAD;
-                        break;
-                    }
-                    while (copy--)
-                        state->lens[state->have++] = (unsigned short)len;
-                }
-            }
-
-            /* handle error breaks in while */
-            if (state->mode == BAD) break;
-
-            /* build code tables */
-            state->next = state->codes;
-            state->lencode = (code const FAR *)(state->next);
-            state->lenbits = 9;
-            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
-                                &(state->lenbits), state->work);
-            if (ret) {
-                strm->msg = (char *)"invalid literal/lengths set";
-                state->mode = BAD;
-                break;
-            }
-            state->distcode = (code const FAR *)(state->next);
-            state->distbits = 6;
-            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
-                            &(state->next), &(state->distbits), state->work);
-            if (ret) {
-                strm->msg = (char *)"invalid distances set";
-                state->mode = BAD;
-                break;
-            }
-            Tracev((stderr, "inflate:       codes ok\n"));
-            state->mode = LEN;
-        case LEN:
-           WATCHDOG_RESET();
-            if (have >= 6 && left >= 258) {
-                RESTORE();
-                inflate_fast(strm, out);
-                LOAD();
-                break;
-            }
-            for (;;) {
-                this = state->lencode[BITS(state->lenbits)];
-                if ((unsigned)(this.bits) <= bits) break;
-                PULLBYTE();
-            }
-            if (this.op && (this.op & 0xf0) == 0) {
-                last = this;
-                for (;;) {
-                    this = state->lencode[last.val +
-                            (BITS(last.bits + last.op) >> last.bits)];
-                    if ((unsigned)(last.bits + this.bits) <= bits) break;
-                    PULLBYTE();
-                }
-                DROPBITS(last.bits);
-            }
-            DROPBITS(this.bits);
-            state->length = (unsigned)this.val;
-            if ((int)(this.op) == 0) {
-                Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
-                        "inflate:         literal '%c'\n" :
-                        "inflate:         literal 0x%02x\n", this.val));
-                state->mode = LIT;
-                break;
-            }
-            if (this.op & 32) {
-                Tracevv((stderr, "inflate:         end of block\n"));
-                state->mode = TYPE;
-                break;
-            }
-            if (this.op & 64) {
-                strm->msg = (char *)"invalid literal/length code";
-                state->mode = BAD;
-                break;
-            }
-            state->extra = (unsigned)(this.op) & 15;
-            state->mode = LENEXT;
-        case LENEXT:
-            if (state->extra) {
-                NEEDBITS(state->extra);
-                state->length += BITS(state->extra);
-                DROPBITS(state->extra);
-            }
-            Tracevv((stderr, "inflate:         length %u\n", state->length));
-            state->mode = DIST;
-        case DIST:
-            for (;;) {
-                this = state->distcode[BITS(state->distbits)];
-                if ((unsigned)(this.bits) <= bits) break;
-                PULLBYTE();
-            }
-            if ((this.op & 0xf0) == 0) {
-                last = this;
-                for (;;) {
-                    this = state->distcode[last.val +
-                            (BITS(last.bits + last.op) >> last.bits)];
-                    if ((unsigned)(last.bits + this.bits) <= bits) break;
-                    PULLBYTE();
-                }
-                DROPBITS(last.bits);
-            }
-            DROPBITS(this.bits);
-            if (this.op & 64) {
-                strm->msg = (char *)"invalid distance code";
-                state->mode = BAD;
-                break;
-            }
-            state->offset = (unsigned)this.val;
-            state->extra = (unsigned)(this.op) & 15;
-            state->mode = DISTEXT;
-        case DISTEXT:
-            if (state->extra) {
-                NEEDBITS(state->extra);
-                state->offset += BITS(state->extra);
-                DROPBITS(state->extra);
-            }
-#ifdef INFLATE_STRICT
-            if (state->offset > state->dmax) {
-                strm->msg = (char *)"invalid distance too far back";
-                state->mode = BAD;
-                break;
-            }
-#endif
-            if (state->offset > state->whave + out - left) {
-                strm->msg = (char *)"invalid distance too far back";
-                state->mode = BAD;
-                break;
-            }
-            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
-            state->mode = MATCH;
-        case MATCH:
-            if (left == 0) goto inf_leave;
-            copy = out - left;
-            if (state->offset > copy) {         /* copy from window */
-                copy = state->offset - copy;
-                if (copy > state->write) {
-                    copy -= state->write;
-                    from = state->window + (state->wsize - copy);
-                }
-                else
-                    from = state->window + (state->write - copy);
-                if (copy > state->length) copy = state->length;
-            }
-            else {                              /* copy from output */
-                from = put - state->offset;
-                copy = state->length;
-            }
-            if (copy > left) copy = left;
-            left -= copy;
-            state->length -= copy;
-            do {
-                *put++ = *from++;
-            } while (--copy);
-            if (state->length == 0) state->mode = LEN;
-            break;
-        case LIT:
-            if (left == 0) goto inf_leave;
-            *put++ = (unsigned char)(state->length);
-            left--;
-            state->mode = LEN;
-            break;
-        case CHECK:
-            if (state->wrap) {
-                NEEDBITS(32);
-                out -= left;
-                strm->total_out += out;
-                state->total += out;
-                if (out)
-                    strm->adler = state->check =
-                        UPDATE(state->check, put - out, out);
-                out = left;
-                if ((
-#ifdef GUNZIP
-                     state->flags ? hold :
-#endif
-                     REVERSE(hold)) != state->check) {
-                    strm->msg = (char *)"incorrect data check";
-                    state->mode = BAD;
-                    break;
-                }
-                INITBITS();
-                Tracev((stderr, "inflate:   check matches trailer\n"));
-            }
-#ifdef GUNZIP
-            state->mode = LENGTH;
-        case LENGTH:
-            if (state->wrap && state->flags) {
-                NEEDBITS(32);
-                if (hold != (state->total & 0xffffffffUL)) {
-                    strm->msg = (char *)"incorrect length check";
-                    state->mode = BAD;
-                    break;
-                }
-                INITBITS();
-                Tracev((stderr, "inflate:   length matches trailer\n"));
-            }
-#endif
-            state->mode = DONE;
-        case DONE:
-            ret = Z_STREAM_END;
-            goto inf_leave;
-        case BAD:
-            ret = Z_DATA_ERROR;
-            goto inf_leave;
-        case MEM:
-            return Z_MEM_ERROR;
-        case SYNC:
-        default:
-            return Z_STREAM_ERROR;
-        }
-
-    /*
-       Return from inflate(), updating the total counts and the check value.
-       If there was no progress during the inflate() call, return a buffer
-       error.  Call updatewindow() to create and/or update the window state.
-       Note: a memory error from inflate() is non-recoverable.
-     */
-  inf_leave:
-    RESTORE();
-    if (state->wsize || (state->mode < CHECK && out != strm->avail_out))
-        if (updatewindow(strm, out)) {
-            state->mode = MEM;
-            return Z_MEM_ERROR;
-        }
-    in -= strm->avail_in;
-    out -= strm->avail_out;
-    strm->total_in += in;
-    strm->total_out += out;
-    state->total += out;
-    if (state->wrap && out)
-        strm->adler = state->check =
-            UPDATE(state->check, strm->next_out - out, out);
-    strm->data_type = state->bits + (state->last ? 64 : 0) +
-                      (state->mode == TYPE ? 128 : 0);
-    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
-        ret = Z_BUF_ERROR;
-    return ret;
-}
-
-int ZEXPORT inflateEnd(strm)
-z_streamp strm;
-{
-    struct inflate_state FAR *state;
-    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
-        return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    if (state->window != Z_NULL) {
-       WATCHDOG_RESET();
-       ZFREE(strm, state->window);
-    }
-    ZFREE(strm, strm->state);
-    strm->state = Z_NULL;
-    Tracev((stderr, "inflate: end\n"));
-    return Z_OK;
-}
-
-/*+++++*/
-/* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef NO_DUMMY_DECL
-struct internal_state  {int dummy;}; /* for buggy compilers */
-#endif
-
-const char * const z_errmsg[10] = {
-"need dictionary",     /* Z_NEED_DICT       2  */
-"stream end",          /* Z_STREAM_END      1  */
-"",                    /* Z_OK              0  */
-"file error",          /* Z_ERRNO         (-1) */
-"stream error",        /* Z_STREAM_ERROR  (-2) */
-"data error",          /* Z_DATA_ERROR    (-3) */
-"insufficient memory", /* Z_MEM_ERROR     (-4) */
-"buffer error",        /* Z_BUF_ERROR     (-5) */
-"incompatible version",/* Z_VERSION_ERROR (-6) */
-""};
-
-#ifdef DEBUG
-
-#ifndef verbose
-#define verbose 0
-#endif
-int z_verbose = verbose;
-
-void z_error (m)
-    char *m;
-{
-       fprintf(stderr, "%s\n", m);
-       hang ();
-}
-#endif
-
-/* exported to allow conversion of error code to string for compress() and
- * uncompress()
- */
-#ifndef MY_ZCALLOC /* Any system without a special alloc function */
-
-#ifndef STDC
-extern voidp    malloc OF((uInt size));
-extern voidp    calloc OF((uInt items, uInt size));
-extern void     free   OF((voidpf ptr));
-#endif
-
-voidpf zcalloc (opaque, items, size)
-       voidpf opaque;
-       unsigned items;
-       unsigned size;
-{
-       if (opaque)
-               items += size - size; /* make compiler happy */
-       return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
-               (voidpf)calloc(items, size);
-}
-
-void  zcfree (opaque, ptr, nb)
-       voidpf opaque;
-       voidpf ptr;
-       unsigned nb;
-{
-       free(ptr);
-       if (opaque)
-               return; /* make compiler happy */
-}
-
-#endif /* MY_ZCALLOC */
-/*+++++*/
-/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2004 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#define BASE 65521UL    /* largest prime smaller than 65536 */
-#define NMAX 5552
-/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
-
-#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
-#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
-#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
-#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
-#define DO16(buf)   DO8(buf,0); DO8(buf,8);
-
-/* use NO_DIVIDE if your processor does not do division in hardware */
-#ifdef NO_DIVIDE
-#define MOD(a) \
-       do { \
-               if (a >= (BASE << 16)) \
-                       a -= (BASE << 16); \
-               if (a >= (BASE << 15)) \
-                       a -= (BASE << 15); \
-               if (a >= (BASE << 14)) \
-                       a -= (BASE << 14); \
-               if (a >= (BASE << 13)) \
-                       a -= (BASE << 13); \
-               if (a >= (BASE << 12)) \
-                       a -= (BASE << 12); \
-               if (a >= (BASE << 11)) \
-                       a -= (BASE << 11); \
-               if (a >= (BASE << 10)) \
-                       a -= (BASE << 10); \
-               if (a >= (BASE << 9)) \
-                       a -= (BASE << 9); \
-               if (a >= (BASE << 8)) \
-                       a -= (BASE << 8); \
-               if (a >= (BASE << 7)) \
-                       a -= (BASE << 7); \
-               if (a >= (BASE << 6)) \
-                       a -= (BASE << 6); \
-               if (a >= (BASE << 5)) \
-                       a -= (BASE << 5); \
-               if (a >= (BASE << 4)) \
-                       a -= (BASE << 4); \
-               if (a >= (BASE << 3)) \
-                       a -= (BASE << 3); \
-               if (a >= (BASE << 2)) \
-                       a -= (BASE << 2); \
-               if (a >= (BASE << 1)) \
-                       a -= (BASE << 1); \
-               if (a >= BASE) \
-                       a -= BASE; \
-       } while (0)
-#define MOD4(a) \
-       do { \
-               if (a >= (BASE << 4)) \
-                       a -= (BASE << 4); \
-               if (a >= (BASE << 3)) \
-                       a -= (BASE << 3); \
-               if (a >= (BASE << 2)) \
-                       a -= (BASE << 2); \
-               if (a >= (BASE << 1)) \
-                       a -= (BASE << 1); \
-               if (a >= BASE) \
-                       a -= BASE; \
-       } while (0)
-#else
-#define MOD(a) a %= BASE
-#define MOD4(a) a %= BASE
-#endif
-
-/* ========================================================================= */
-uLong ZEXPORT adler32(adler, buf, len)
-    uLong adler;
-    const Bytef *buf;
-    uInt len;
-{
-    unsigned long sum2;
-    unsigned n;
-
-    /* split Adler-32 into component sums */
-    sum2 = (adler >> 16) & 0xffff;
-    adler &= 0xffff;
-
-    /* in case user likes doing a byte at a time, keep it fast */
-    if (len == 1) {
-        adler += buf[0];
-        if (adler >= BASE)
-            adler -= BASE;
-        sum2 += adler;
-        if (sum2 >= BASE)
-            sum2 -= BASE;
-        return adler | (sum2 << 16);
-    }
-
-    /* initial Adler-32 value (deferred check for len == 1 speed) */
-    if (buf == Z_NULL)
-        return 1L;
-
-    /* in case short lengths are provided, keep it somewhat fast */
-    if (len < 16) {
-        while (len--) {
-            adler += *buf++;
-            sum2 += adler;
-        }
-        if (adler >= BASE)
-            adler -= BASE;
-        MOD4(sum2);             /* only added so many BASE's */
-        return adler | (sum2 << 16);
-    }
-
-    /* do length NMAX blocks -- requires just one modulo operation */
-    while (len >= NMAX) {
-        len -= NMAX;
-        n = NMAX / 16;          /* NMAX is divisible by 16 */
-        do {
-            DO16(buf);          /* 16 sums unrolled */
-            buf += 16;
-        } while (--n);
-        MOD(adler);
-        MOD(sum2);
-    }
-
-    /* do remaining bytes (less than NMAX, still just one modulo) */
-    if (len) {                  /* avoid modulos if none remaining */
-        while (len >= 16) {
-            len -= 16;
-            DO16(buf);
-            buf += 16;
-        }
-        while (len--) {
-            adler += *buf++;
-            sum2 += adler;
-        }
-        MOD(adler);
-        MOD(sum2);
-    }
-
-    /* return recombined sums */
-    return adler | (sum2 << 16);
-}
diff --git a/lib/zlib/Makefile b/lib/zlib/Makefile
new file mode 100644 (file)
index 0000000..1596302
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB    = $(obj)libz.o
+
+COBJS-$(CONFIG_ZLIB) += zlib.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/lib/zlib/adler32.c b/lib/zlib/adler32.c
new file mode 100644 (file)
index 0000000..dc9480d
--- /dev/null
@@ -0,0 +1,125 @@
+/* adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-2004 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+#define BASE 65521UL    /* largest prime smaller than 65536 */
+#define NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
+#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf)   DO8(buf,0); DO8(buf,8);
+
+/* use NO_DIVIDE if your processor does not do division in hardware */
+#ifdef NO_DIVIDE
+#  define MOD(a) \
+    do { \
+        if (a >= (BASE << 16)) a -= (BASE << 16); \
+        if (a >= (BASE << 15)) a -= (BASE << 15); \
+        if (a >= (BASE << 14)) a -= (BASE << 14); \
+        if (a >= (BASE << 13)) a -= (BASE << 13); \
+        if (a >= (BASE << 12)) a -= (BASE << 12); \
+        if (a >= (BASE << 11)) a -= (BASE << 11); \
+        if (a >= (BASE << 10)) a -= (BASE << 10); \
+        if (a >= (BASE << 9)) a -= (BASE << 9); \
+        if (a >= (BASE << 8)) a -= (BASE << 8); \
+        if (a >= (BASE << 7)) a -= (BASE << 7); \
+        if (a >= (BASE << 6)) a -= (BASE << 6); \
+        if (a >= (BASE << 5)) a -= (BASE << 5); \
+        if (a >= (BASE << 4)) a -= (BASE << 4); \
+        if (a >= (BASE << 3)) a -= (BASE << 3); \
+        if (a >= (BASE << 2)) a -= (BASE << 2); \
+        if (a >= (BASE << 1)) a -= (BASE << 1); \
+        if (a >= BASE) a -= BASE; \
+    } while (0)
+#  define MOD4(a) \
+    do { \
+        if (a >= (BASE << 4)) a -= (BASE << 4); \
+        if (a >= (BASE << 3)) a -= (BASE << 3); \
+        if (a >= (BASE << 2)) a -= (BASE << 2); \
+        if (a >= (BASE << 1)) a -= (BASE << 1); \
+        if (a >= BASE) a -= BASE; \
+    } while (0)
+#else
+#  define MOD(a) a %= BASE
+#  define MOD4(a) a %= BASE
+#endif
+
+/* ========================================================================= */
+uLong ZEXPORT adler32(adler, buf, len)
+    uLong adler;
+    const Bytef *buf;
+    uInt len;
+{
+    unsigned long sum2;
+    unsigned n;
+
+    /* split Adler-32 into component sums */
+    sum2 = (adler >> 16) & 0xffff;
+    adler &= 0xffff;
+
+    /* in case user likes doing a byte at a time, keep it fast */
+    if (len == 1) {
+        adler += buf[0];
+        if (adler >= BASE)
+            adler -= BASE;
+        sum2 += adler;
+        if (sum2 >= BASE)
+            sum2 -= BASE;
+        return adler | (sum2 << 16);
+    }
+
+    /* initial Adler-32 value (deferred check for len == 1 speed) */
+    if (buf == Z_NULL)
+        return 1L;
+
+    /* in case short lengths are provided, keep it somewhat fast */
+    if (len < 16) {
+        while (len--) {
+            adler += *buf++;
+            sum2 += adler;
+        }
+        if (adler >= BASE)
+            adler -= BASE;
+        MOD4(sum2);             /* only added so many BASE's */
+        return adler | (sum2 << 16);
+    }
+
+    /* do length NMAX blocks -- requires just one modulo operation */
+    while (len >= NMAX) {
+        len -= NMAX;
+        n = NMAX / 16;          /* NMAX is divisible by 16 */
+        do {
+            DO16(buf);          /* 16 sums unrolled */
+            buf += 16;
+        } while (--n);
+        MOD(adler);
+        MOD(sum2);
+    }
+
+    /* do remaining bytes (less than NMAX, still just one modulo) */
+    if (len) {                  /* avoid modulos if none remaining */
+        while (len >= 16) {
+            len -= 16;
+            DO16(buf);
+            buf += 16;
+        }
+        while (len--) {
+            adler += *buf++;
+            sum2 += adler;
+        }
+        MOD(adler);
+        MOD(sum2);
+    }
+
+    /* return recombined sums */
+    return adler | (sum2 << 16);
+}
diff --git a/lib/zlib/inffast.c b/lib/zlib/inffast.c
new file mode 100644 (file)
index 0000000..8e823df
--- /dev/null
@@ -0,0 +1,349 @@
+/* inffast.c -- fast decoding
+ * Copyright (C) 1995-2004 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* U-boot: we already included these
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+*/
+
+#ifndef ASMINF
+
+/* Allow machine dependent optimization for post-increment or pre-increment.
+   Based on testing to date,
+   Pre-increment preferred for:
+   - PowerPC G3 (Adler)
+   - MIPS R5000 (Randers-Pehrson)
+   Post-increment preferred for:
+   - none
+   No measurable difference:
+   - Pentium III (Anderson)
+   - M68060 (Nikl)
+ */
+#ifdef POSTINC
+#  define OFF 0
+#  define PUP(a) *(a)++
+#else
+#  define OFF 1
+#  define PUP(a) *++(a)
+#endif
+
+/*
+   Decode literal, length, and distance codes and write out the resulting
+   literal and match bytes until either not enough input or output is
+   available, an end-of-block is encountered, or a data error is encountered.
+   When large enough input and output buffers are supplied to inflate(), for
+   example, a 16K input buffer and a 64K output buffer, more than 95% of the
+   inflate execution time is spent in this routine.
+
+   Entry assumptions:
+
+        state->mode == LEN
+        strm->avail_in >= 6
+        strm->avail_out >= 258
+        start >= strm->avail_out
+        state->bits < 8
+
+   On return, state->mode is one of:
+
+        LEN -- ran out of enough output space or enough available input
+        TYPE -- reached end of block code, inflate() to interpret next block
+        BAD -- error in block data
+
+   Notes:
+
+    - The maximum input bits used by a length/distance pair is 15 bits for the
+      length code, 5 bits for the length extra, 15 bits for the distance code,
+      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
+      Therefore if strm->avail_in >= 6, then there is enough input to avoid
+      checking for available input while decoding.
+
+    - The maximum bytes that a single length/distance pair can output is 258
+      bytes, which is the maximum length that can be coded.  inflate_fast()
+      requires strm->avail_out >= 258 for each loop to avoid checking for
+      output space.
+ */
+void inflate_fast(strm, start)
+z_streamp strm;
+unsigned start;         /* inflate()'s starting value for strm->avail_out */
+{
+    struct inflate_state FAR *state;
+    unsigned char FAR *in;      /* local strm->next_in */
+    unsigned char FAR *last;    /* while in < last, enough input available */
+    unsigned char FAR *out;     /* local strm->next_out */
+    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
+    unsigned char FAR *end;     /* while out < end, enough space available */
+#ifdef INFLATE_STRICT
+    unsigned dmax;              /* maximum distance from zlib header */
+#endif
+    unsigned wsize;             /* window size or zero if not using window */
+    unsigned whave;             /* valid bytes in the window */
+    unsigned write;             /* window write index */
+    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
+    unsigned long hold;         /* local strm->hold */
+    unsigned bits;              /* local strm->bits */
+    code const FAR *lcode;      /* local strm->lencode */
+    code const FAR *dcode;      /* local strm->distcode */
+    unsigned lmask;             /* mask for first level of length codes */
+    unsigned dmask;             /* mask for first level of distance codes */
+    code this;                  /* retrieved table entry */
+    unsigned op;                /* code bits, operation, extra bits, or */
+                                /*  window position, window bytes to copy */
+    unsigned len;               /* match length, unused bytes */
+    unsigned dist;              /* match distance */
+    unsigned char FAR *from;    /* where to copy match from */
+
+    /* copy state to local variables */
+    state = (struct inflate_state FAR *)strm->state;
+    in = strm->next_in - OFF;
+    last = in + (strm->avail_in - 5);
+    out = strm->next_out - OFF;
+    beg = out - (start - strm->avail_out);
+    end = out + (strm->avail_out - 257);
+#ifdef INFLATE_STRICT
+    dmax = state->dmax;
+#endif
+    wsize = state->wsize;
+    whave = state->whave;
+    write = state->write;
+    window = state->window;
+    hold = state->hold;
+    bits = state->bits;
+    lcode = state->lencode;
+    dcode = state->distcode;
+    lmask = (1U << state->lenbits) - 1;
+    dmask = (1U << state->distbits) - 1;
+
+    /* decode literals and length/distances until end-of-block or not enough
+       input data or output space */
+    do {
+        if (bits < 15) {
+            hold += (unsigned long)(PUP(in)) << bits;
+            bits += 8;
+            hold += (unsigned long)(PUP(in)) << bits;
+            bits += 8;
+        }
+        this = lcode[hold & lmask];
+      dolen:
+        op = (unsigned)(this.bits);
+        hold >>= op;
+        bits -= op;
+        op = (unsigned)(this.op);
+        if (op == 0) {                          /* literal */
+            Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
+                    "inflate:         literal '%c'\n" :
+                    "inflate:         literal 0x%02x\n", this.val));
+            PUP(out) = (unsigned char)(this.val);
+        }
+        else if (op & 16) {                     /* length base */
+            len = (unsigned)(this.val);
+            op &= 15;                           /* number of extra bits */
+            if (op) {
+                if (bits < op) {
+                    hold += (unsigned long)(PUP(in)) << bits;
+                    bits += 8;
+                }
+                len += (unsigned)hold & ((1U << op) - 1);
+                hold >>= op;
+                bits -= op;
+            }
+            Tracevv((stderr, "inflate:         length %u\n", len));
+            if (bits < 15) {
+                hold += (unsigned long)(PUP(in)) << bits;
+                bits += 8;
+                hold += (unsigned long)(PUP(in)) << bits;
+                bits += 8;
+            }
+            this = dcode[hold & dmask];
+          dodist:
+            op = (unsigned)(this.bits);
+            hold >>= op;
+            bits -= op;
+            op = (unsigned)(this.op);
+            if (op & 16) {                      /* distance base */
+                dist = (unsigned)(this.val);
+                op &= 15;                       /* number of extra bits */
+                if (bits < op) {
+                    hold += (unsigned long)(PUP(in)) << bits;
+                    bits += 8;
+                    if (bits < op) {
+                        hold += (unsigned long)(PUP(in)) << bits;
+                        bits += 8;
+                    }
+                }
+                dist += (unsigned)hold & ((1U << op) - 1);
+#ifdef INFLATE_STRICT
+                if (dist > dmax) {
+                    strm->msg = (char *)"invalid distance too far back";
+                    state->mode = BAD;
+                    break;
+                }
+#endif
+                hold >>= op;
+                bits -= op;
+                Tracevv((stderr, "inflate:         distance %u\n", dist));
+                op = (unsigned)(out - beg);     /* max distance in output */
+                if (dist > op) {                /* see if copy from window */
+                    op = dist - op;             /* distance back in window */
+                    if (op > whave) {
+                        strm->msg = (char *)"invalid distance too far back";
+                        state->mode = BAD;
+                        break;
+                    }
+                    from = window - OFF;
+                    if (write == 0) {           /* very common case */
+                        from += wsize - op;
+                        if (op < len) {         /* some from window */
+                            len -= op;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--op);
+                            from = out - dist;  /* rest from output */
+                        }
+                    }
+                    else if (write < op) {      /* wrap around window */
+                        from += wsize + write - op;
+                        op -= write;
+                        if (op < len) {         /* some from end of window */
+                            len -= op;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--op);
+                            from = window - OFF;
+                            if (write < len) {  /* some from start of window */
+                                op = write;
+                                len -= op;
+                                do {
+                                    PUP(out) = PUP(from);
+                                } while (--op);
+                                from = out - dist;      /* rest from output */
+                            }
+                        }
+                    }
+                    else {                      /* contiguous in window */
+                        from += write - op;
+                        if (op < len) {         /* some from window */
+                            len -= op;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--op);
+                            from = out - dist;  /* rest from output */
+                        }
+                    }
+                    while (len > 2) {
+                        PUP(out) = PUP(from);
+                        PUP(out) = PUP(from);
+                        PUP(out) = PUP(from);
+                        len -= 3;
+                    }
+                    if (len) {
+                        PUP(out) = PUP(from);
+                        if (len > 1)
+                            PUP(out) = PUP(from);
+                    }
+                }
+                else {
+                   unsigned short *sout;
+                   unsigned long loops;
+
+                    from = out - dist;          /* copy direct from output */
+                    /* minimum length is three */
+                   /* Align out addr */
+                   if (!((long)(out - 1 + OFF) & 1)) {
+                       PUP(out) = PUP(from);
+                       len--;
+                   }
+                   sout = (unsigned short *)(out - OFF);
+                   if (dist > 2 ) {
+                       unsigned short *sfrom;
+
+                       sfrom = (unsigned short *)(from - OFF);
+                       loops = len >> 1;
+                       do
+                           PUP(sout) = get_unaligned(++sfrom);
+                       while (--loops);
+                       out = (unsigned char *)sout + OFF;
+                       from = (unsigned char *)sfrom + OFF;
+                   } else { /* dist == 1 or dist == 2 */
+                       unsigned short pat16;
+
+                       pat16 = *(sout-2+2*OFF);
+                       if (dist == 1)
+#if defined(__BIG_ENDIAN)
+                           pat16 = (pat16 & 0xff) | ((pat16 & 0xff ) << 8);
+#elif defined(__LITTLE_ENDIAN)
+                           pat16 = (pat16 & 0xff00) | ((pat16 & 0xff00 ) >> 8);
+#else
+#error __BIG_ENDIAN nor __LITTLE_ENDIAN is defined
+#endif
+                       loops = len >> 1;
+                       do
+                           PUP(sout) = pat16;
+                       while (--loops);
+                       out = (unsigned char *)sout + OFF;
+                   }
+                   if (len & 1)
+                       PUP(out) = PUP(from);
+                }
+            }
+            else if ((op & 64) == 0) {          /* 2nd level distance code */
+                this = dcode[this.val + (hold & ((1U << op) - 1))];
+                goto dodist;
+            }
+            else {
+                strm->msg = (char *)"invalid distance code";
+                state->mode = BAD;
+                break;
+            }
+        }
+        else if ((op & 64) == 0) {              /* 2nd level length code */
+            this = lcode[this.val + (hold & ((1U << op) - 1))];
+            goto dolen;
+        }
+        else if (op & 32) {                     /* end-of-block */
+            Tracevv((stderr, "inflate:         end of block\n"));
+            state->mode = TYPE;
+            break;
+        }
+        else {
+            strm->msg = (char *)"invalid literal/length code";
+            state->mode = BAD;
+            break;
+        }
+    } while (in < last && out < end);
+
+    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+    len = bits >> 3;
+    in -= len;
+    bits -= len << 3;
+    hold &= (1U << bits) - 1;
+
+    /* update state and return */
+    strm->next_in = in + OFF;
+    strm->next_out = out + OFF;
+    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
+    strm->avail_out = (unsigned)(out < end ?
+                                 257 + (end - out) : 257 - (out - end));
+    state->hold = hold;
+    state->bits = bits;
+    return;
+}
+
+/*
+   inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
+   - Using bit fields for code structure
+   - Different op definition to avoid & for extra bits (do & for table bits)
+   - Three separate decoding do-loops for direct, window, and write == 0
+   - Special case for distance > 1 copies to do overlapped load and store copy
+   - Explicit branch predictions (based on measured branch probabilities)
+   - Deferring match copy and interspersed it with decoding subsequent codes
+   - Swapping literal/length else
+   - Swapping window/direct else
+   - Larger unrolled copy loops (three is about right)
+   - Moving len -= 3 statement into middle of loop
+ */
+
+#endif /* !ASMINF */
diff --git a/lib/zlib/inffast.h b/lib/zlib/inffast.h
new file mode 100644 (file)
index 0000000..1e88d2d
--- /dev/null
@@ -0,0 +1,11 @@
+/* inffast.h -- header to use inffast.c
+ * Copyright (C) 1995-2003 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+void inflate_fast OF((z_streamp strm, unsigned start));
diff --git a/lib/zlib/inffixed.h b/lib/zlib/inffixed.h
new file mode 100644 (file)
index 0000000..75ed4b5
--- /dev/null
@@ -0,0 +1,94 @@
+    /* inffixed.h -- table for decoding fixed codes
+     * Generated automatically by makefixed().
+     */
+
+    /* WARNING: this file should *not* be used by applications. It
+       is part of the implementation of the compression library and
+       is subject to change. Applications should only use zlib.h.
+     */
+
+    static const code lenfix[512] = {
+        {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
+        {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
+        {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
+        {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
+        {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
+        {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
+        {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
+        {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
+        {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
+        {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
+        {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
+        {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
+        {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
+        {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
+        {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
+        {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
+        {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
+        {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
+        {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
+        {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
+        {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
+        {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
+        {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
+        {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
+        {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
+        {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
+        {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
+        {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
+        {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
+        {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
+        {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
+        {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
+        {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
+        {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
+        {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
+        {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
+        {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
+        {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
+        {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
+        {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
+        {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
+        {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
+        {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
+        {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
+        {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
+        {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
+        {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
+        {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
+        {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
+        {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
+        {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
+        {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
+        {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
+        {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
+        {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
+        {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
+        {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
+        {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
+        {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
+        {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
+        {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
+        {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
+        {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
+        {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
+        {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
+        {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
+        {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
+        {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
+        {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
+        {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
+        {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
+        {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
+        {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
+        {0,9,255}
+    };
+
+    static const code distfix[32] = {
+        {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
+        {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
+        {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
+        {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
+        {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
+        {22,5,193},{64,5,0}
+    };
diff --git a/lib/zlib/inflate.c b/lib/zlib/inflate.c
new file mode 100644 (file)
index 0000000..1eef609
--- /dev/null
@@ -0,0 +1,956 @@
+/* inflate.c -- zlib decompression
+ * Copyright (C) 1995-2005 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+local void fixedtables OF((struct inflate_state FAR *state));
+local int updatewindow OF((z_streamp strm, unsigned out));
+
+int ZEXPORT inflateReset(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    strm->total_in = strm->total_out = state->total = 0;
+    strm->msg = Z_NULL;
+    strm->adler = 1;        /* to support ill-conceived Java test suite */
+    state->mode = HEAD;
+    state->last = 0;
+    state->havedict = 0;
+    state->dmax = 32768U;
+    state->head = Z_NULL;
+    state->wsize = 0;
+    state->whave = 0;
+    state->write = 0;
+    state->hold = 0;
+    state->bits = 0;
+    state->lencode = state->distcode = state->next = state->codes;
+    WATCHDOG_RESET();
+    Tracev((stderr, "inflate: reset\n"));
+    return Z_OK;
+}
+
+int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
+z_streamp strm;
+int windowBits;
+const char *version;
+int stream_size;
+{
+    struct inflate_state FAR *state;
+
+    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+        stream_size != (int)(sizeof(z_stream)))
+        return Z_VERSION_ERROR;
+    if (strm == Z_NULL) return Z_STREAM_ERROR;
+    strm->msg = Z_NULL;                 /* in case we return an error */
+    if (strm->zalloc == (alloc_func)0) {
+        strm->zalloc = zcalloc;
+        strm->opaque = (voidpf)0;
+    }
+    if (strm->zfree == (free_func)0) strm->zfree = zcfree;
+    state = (struct inflate_state FAR *)
+            ZALLOC(strm, 1, sizeof(struct inflate_state));
+    if (state == Z_NULL) return Z_MEM_ERROR;
+    Tracev((stderr, "inflate: allocated\n"));
+    strm->state = (struct internal_state FAR *)state;
+    if (windowBits < 0) {
+        state->wrap = 0;
+        windowBits = -windowBits;
+    }
+    else {
+        state->wrap = (windowBits >> 4) + 1;
+#ifdef GUNZIP
+        if (windowBits < 48) windowBits &= 15;
+#endif
+    }
+    if (windowBits < 8 || windowBits > 15) {
+        ZFREE(strm, state);
+        strm->state = Z_NULL;
+        return Z_STREAM_ERROR;
+    }
+    state->wbits = (unsigned)windowBits;
+    state->window = Z_NULL;
+    return inflateReset(strm);
+}
+
+int ZEXPORT inflateInit_(strm, version, stream_size)
+z_streamp strm;
+const char *version;
+int stream_size;
+{
+    return inflateInit2_(strm, DEF_WBITS, version, stream_size);
+}
+
+local void fixedtables(state)
+struct inflate_state FAR *state;
+{
+    state->lencode = lenfix;
+    state->lenbits = 9;
+    state->distcode = distfix;
+    state->distbits = 5;
+}
+
+/*
+   Update the window with the last wsize (normally 32K) bytes written before
+   returning.  If window does not exist yet, create it.  This is only called
+   when a window is already in use, or when output has been written during this
+   inflate call, but the end of the deflate stream has not been reached yet.
+   It is also called to create a window for dictionary data when a dictionary
+   is loaded.
+
+   Providing output buffers larger than 32K to inflate() should provide a speed
+   advantage, since only the last 32K of output is copied to the sliding window
+   upon return from inflate(), and since all distances after the first 32K of
+   output will fall in the output data, making match copies simpler and faster.
+   The advantage may be dependent on the size of the processor's data caches.
+ */
+local int updatewindow(strm, out)
+z_streamp strm;
+unsigned out;
+{
+    struct inflate_state FAR *state;
+    unsigned copy, dist;
+
+    state = (struct inflate_state FAR *)strm->state;
+
+    /* if it hasn't been done already, allocate space for the window */
+    if (state->window == Z_NULL) {
+        state->window = (unsigned char FAR *)
+                        ZALLOC(strm, 1U << state->wbits,
+                               sizeof(unsigned char));
+        if (state->window == Z_NULL) return 1;
+    }
+
+    /* if window not in use yet, initialize */
+    if (state->wsize == 0) {
+        state->wsize = 1U << state->wbits;
+        state->write = 0;
+        state->whave = 0;
+    }
+
+    /* copy state->wsize or less output bytes into the circular window */
+    copy = out - strm->avail_out;
+    if (copy >= state->wsize) {
+        zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
+        state->write = 0;
+        state->whave = state->wsize;
+    }
+    else {
+        dist = state->wsize - state->write;
+        if (dist > copy) dist = copy;
+        zmemcpy(state->window + state->write, strm->next_out - copy, dist);
+        copy -= dist;
+        if (copy) {
+            zmemcpy(state->window, strm->next_out - copy, copy);
+            state->write = copy;
+            state->whave = state->wsize;
+        }
+        else {
+            state->write += dist;
+            if (state->write == state->wsize) state->write = 0;
+            if (state->whave < state->wsize) state->whave += dist;
+        }
+    }
+    return 0;
+}
+
+/* Macros for inflate(): */
+
+/* check function to use adler32() for zlib or crc32() for gzip */
+#ifdef GUNZIP
+#  define UPDATE(check, buf, len) \
+    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
+#else
+#  define UPDATE(check, buf, len) adler32(check, buf, len)
+#endif
+
+/* check macros for header crc */
+#ifdef GUNZIP
+#  define CRC2(check, word) \
+    do { \
+        hbuf[0] = (unsigned char)(word); \
+        hbuf[1] = (unsigned char)((word) >> 8); \
+        check = crc32(check, hbuf, 2); \
+    } while (0)
+
+#  define CRC4(check, word) \
+    do { \
+        hbuf[0] = (unsigned char)(word); \
+        hbuf[1] = (unsigned char)((word) >> 8); \
+        hbuf[2] = (unsigned char)((word) >> 16); \
+        hbuf[3] = (unsigned char)((word) >> 24); \
+        check = crc32(check, hbuf, 4); \
+    } while (0)
+#endif
+
+/* Load registers with state in inflate() for speed */
+#define LOAD() \
+    do { \
+        put = strm->next_out; \
+        left = strm->avail_out; \
+        next = strm->next_in; \
+        have = strm->avail_in; \
+        hold = state->hold; \
+        bits = state->bits; \
+    } while (0)
+
+/* Restore state from registers in inflate() */
+#define RESTORE() \
+    do { \
+        strm->next_out = put; \
+        strm->avail_out = left; \
+        strm->next_in = next; \
+        strm->avail_in = have; \
+        state->hold = hold; \
+        state->bits = bits; \
+    } while (0)
+
+/* Clear the input bit accumulator */
+#define INITBITS() \
+    do { \
+        hold = 0; \
+        bits = 0; \
+    } while (0)
+
+/* Get a byte of input into the bit accumulator, or return from inflate()
+   if there is no input available. */
+#define PULLBYTE() \
+    do { \
+        if (have == 0) goto inf_leave; \
+        have--; \
+        hold += (unsigned long)(*next++) << bits; \
+        bits += 8; \
+    } while (0)
+
+/* Assure that there are at least n bits in the bit accumulator.  If there is
+   not enough available input to do that, then return from inflate(). */
+#define NEEDBITS(n) \
+    do { \
+        while (bits < (unsigned)(n)) \
+            PULLBYTE(); \
+    } while (0)
+
+/* Return the low n bits of the bit accumulator (n < 16) */
+#define BITS(n) \
+    ((unsigned)hold & ((1U << (n)) - 1))
+
+/* Remove n bits from the bit accumulator */
+#define DROPBITS(n) \
+    do { \
+        hold >>= (n); \
+        bits -= (unsigned)(n); \
+    } while (0)
+
+/* Remove zero to seven bits as needed to go to a byte boundary */
+#define BYTEBITS() \
+    do { \
+        hold >>= bits & 7; \
+        bits -= bits & 7; \
+    } while (0)
+
+/* Reverse the bytes in a 32-bit value */
+#define REVERSE(q) \
+    ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
+     (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
+
+/*
+   inflate() uses a state machine to process as much input data and generate as
+   much output data as possible before returning.  The state machine is
+   structured roughly as follows:
+
+    for (;;) switch (state) {
+    ...
+    case STATEn:
+        if (not enough input data or output space to make progress)
+            return;
+        ... make progress ...
+        state = STATEm;
+        break;
+    ...
+    }
+
+   so when inflate() is called again, the same case is attempted again, and
+   if the appropriate resources are provided, the machine proceeds to the
+   next state.  The NEEDBITS() macro is usually the way the state evaluates
+   whether it can proceed or should return.  NEEDBITS() does the return if
+   the requested bits are not available.  The typical use of the BITS macros
+   is:
+
+        NEEDBITS(n);
+        ... do something with BITS(n) ...
+        DROPBITS(n);
+
+   where NEEDBITS(n) either returns from inflate() if there isn't enough
+   input left to load n bits into the accumulator, or it continues.  BITS(n)
+   gives the low n bits in the accumulator.  When done, DROPBITS(n) drops
+   the low n bits off the accumulator.  INITBITS() clears the accumulator
+   and sets the number of available bits to zero.  BYTEBITS() discards just
+   enough bits to put the accumulator on a byte boundary.  After BYTEBITS()
+   and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
+
+   NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
+   if there is no input available.  The decoding of variable length codes uses
+   PULLBYTE() directly in order to pull just enough bytes to decode the next
+   code, and no more.
+
+   Some states loop until they get enough input, making sure that enough
+   state information is maintained to continue the loop where it left off
+   if NEEDBITS() returns in the loop.  For example, want, need, and keep
+   would all have to actually be part of the saved state in case NEEDBITS()
+   returns:
+
+    case STATEw:
+        while (want < need) {
+            NEEDBITS(n);
+            keep[want++] = BITS(n);
+            DROPBITS(n);
+        }
+        state = STATEx;
+    case STATEx:
+
+   As shown above, if the next state is also the next case, then the break
+   is omitted.
+
+   A state may also return if there is not enough output space available to
+   complete that state.  Those states are copying stored data, writing a
+   literal byte, and copying a matching string.
+
+   When returning, a "goto inf_leave" is used to update the total counters,
+   update the check value, and determine whether any progress has been made
+   during that inflate() call in order to return the proper return code.
+   Progress is defined as a change in either strm->avail_in or strm->avail_out.
+   When there is a window, goto inf_leave will update the window with the last
+   output written.  If a goto inf_leave occurs in the middle of decompression
+   and there is no window currently, goto inf_leave will create one and copy
+   output to the window for the next call of inflate().
+
+   In this implementation, the flush parameter of inflate() only affects the
+   return code (per zlib.h).  inflate() always writes as much as possible to
+   strm->next_out, given the space available and the provided input--the effect
+   documented in zlib.h of Z_SYNC_FLUSH.  Furthermore, inflate() always defers
+   the allocation of and copying into a sliding window until necessary, which
+   provides the effect documented in zlib.h for Z_FINISH when the entire input
+   stream available.  So the only thing the flush parameter actually does is:
+   when flush is set to Z_FINISH, inflate() cannot return Z_OK.  Instead it
+   will return Z_BUF_ERROR if it has not reached the end of the stream.
+ */
+int ZEXPORT inflate(strm, flush)
+z_streamp strm;
+int flush;
+{
+    struct inflate_state FAR *state;
+    unsigned char FAR *next;    /* next input */
+    unsigned char FAR *put;     /* next output */
+    unsigned have, left;        /* available input and output */
+    unsigned long hold;         /* bit buffer */
+    unsigned bits;              /* bits in bit buffer */
+    unsigned in, out;           /* save starting available input and output */
+    unsigned copy;              /* number of stored or match bytes to copy */
+    unsigned char FAR *from;    /* where to copy match bytes from */
+    code this;                  /* current decoding table entry */
+    code last;                  /* parent table entry */
+    unsigned len;               /* length to copy for repeats, bits to drop */
+    int ret;                    /* return code */
+#ifdef GUNZIP
+    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
+#endif
+    static const unsigned short order[19] = /* permutation of code lengths */
+        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+    if (strm == Z_NULL || strm->state == Z_NULL ||
+        (strm->next_in == Z_NULL && strm->avail_in != 0))
+        return Z_STREAM_ERROR;
+
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
+    LOAD();
+    in = have;
+    out = left;
+    ret = Z_OK;
+    for (;;)
+        switch (state->mode) {
+        case HEAD:
+            if (state->wrap == 0) {
+                state->mode = TYPEDO;
+                break;
+            }
+            NEEDBITS(16);
+#ifdef GUNZIP
+            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
+                state->check = crc32(0L, Z_NULL, 0);
+                CRC2(state->check, hold);
+                INITBITS();
+                state->mode = FLAGS;
+                break;
+            }
+            state->flags = 0;           /* expect zlib header */
+            if (state->head != Z_NULL)
+                state->head->done = -1;
+            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
+#else
+            if (
+#endif
+                ((BITS(8) << 8) + (hold >> 8)) % 31) {
+                strm->msg = (char *)"incorrect header check";
+                state->mode = BAD;
+                break;
+            }
+            if (BITS(4) != Z_DEFLATED) {
+                strm->msg = (char *)"unknown compression method";
+                state->mode = BAD;
+                break;
+            }
+            DROPBITS(4);
+            len = BITS(4) + 8;
+            if (len > state->wbits) {
+                strm->msg = (char *)"invalid window size";
+                state->mode = BAD;
+                break;
+            }
+            state->dmax = 1U << len;
+            Tracev((stderr, "inflate:   zlib header ok\n"));
+            strm->adler = state->check = adler32(0L, Z_NULL, 0);
+            state->mode = hold & 0x200 ? DICTID : TYPE;
+            INITBITS();
+            break;
+#ifdef GUNZIP
+        case FLAGS:
+            NEEDBITS(16);
+            state->flags = (int)(hold);
+            if ((state->flags & 0xff) != Z_DEFLATED) {
+                strm->msg = (char *)"unknown compression method";
+                state->mode = BAD;
+                break;
+            }
+            if (state->flags & 0xe000) {
+                strm->msg = (char *)"unknown header flags set";
+                state->mode = BAD;
+                break;
+            }
+            if (state->head != Z_NULL)
+                state->head->text = (int)((hold >> 8) & 1);
+            if (state->flags & 0x0200) CRC2(state->check, hold);
+            INITBITS();
+            state->mode = TIME;
+        case TIME:
+            NEEDBITS(32);
+            if (state->head != Z_NULL)
+                state->head->time = hold;
+            if (state->flags & 0x0200) CRC4(state->check, hold);
+            INITBITS();
+            state->mode = OS;
+        case OS:
+            NEEDBITS(16);
+            if (state->head != Z_NULL) {
+                state->head->xflags = (int)(hold & 0xff);
+                state->head->os = (int)(hold >> 8);
+            }
+            if (state->flags & 0x0200) CRC2(state->check, hold);
+            INITBITS();
+            state->mode = EXLEN;
+        case EXLEN:
+            if (state->flags & 0x0400) {
+                NEEDBITS(16);
+                state->length = (unsigned)(hold);
+                if (state->head != Z_NULL)
+                    state->head->extra_len = (unsigned)hold;
+                if (state->flags & 0x0200) CRC2(state->check, hold);
+                INITBITS();
+            }
+            else if (state->head != Z_NULL)
+                state->head->extra = Z_NULL;
+            state->mode = EXTRA;
+        case EXTRA:
+            if (state->flags & 0x0400) {
+                copy = state->length;
+                if (copy > have) copy = have;
+                if (copy) {
+                    if (state->head != Z_NULL &&
+                        state->head->extra != Z_NULL) {
+                        len = state->head->extra_len - state->length;
+                        zmemcpy(state->head->extra + len, next,
+                                len + copy > state->head->extra_max ?
+                                state->head->extra_max - len : copy);
+                    }
+                    if (state->flags & 0x0200)
+                        state->check = crc32(state->check, next, copy);
+                    have -= copy;
+                    next += copy;
+                    state->length -= copy;
+                }
+                if (state->length) goto inf_leave;
+            }
+            state->length = 0;
+            state->mode = NAME;
+        case NAME:
+            if (state->flags & 0x0800) {
+                if (have == 0) goto inf_leave;
+                copy = 0;
+                do {
+                    len = (unsigned)(next[copy++]);
+                    if (state->head != Z_NULL &&
+                            state->head->name != Z_NULL &&
+                            state->length < state->head->name_max)
+                        state->head->name[state->length++] = len;
+                } while (len && copy < have);
+                if (state->flags & 0x0200)
+                    state->check = crc32(state->check, next, copy);
+                have -= copy;
+                next += copy;
+                if (len) goto inf_leave;
+            }
+            else if (state->head != Z_NULL)
+                state->head->name = Z_NULL;
+            state->length = 0;
+            state->mode = COMMENT;
+        case COMMENT:
+            if (state->flags & 0x1000) {
+                if (have == 0) goto inf_leave;
+                copy = 0;
+                do {
+                    len = (unsigned)(next[copy++]);
+                    if (state->head != Z_NULL &&
+                            state->head->comment != Z_NULL &&
+                            state->length < state->head->comm_max)
+                        state->head->comment[state->length++] = len;
+                } while (len && copy < have);
+                if (state->flags & 0x0200)
+                    state->check = crc32(state->check, next, copy);
+                have -= copy;
+                next += copy;
+                if (len) goto inf_leave;
+            }
+            else if (state->head != Z_NULL)
+                state->head->comment = Z_NULL;
+            state->mode = HCRC;
+        case HCRC:
+            if (state->flags & 0x0200) {
+                NEEDBITS(16);
+                if (hold != (state->check & 0xffff)) {
+                    strm->msg = (char *)"header crc mismatch";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+            }
+            if (state->head != Z_NULL) {
+                state->head->hcrc = (int)((state->flags >> 9) & 1);
+                state->head->done = 1;
+            }
+            strm->adler = state->check = crc32(0L, Z_NULL, 0);
+            state->mode = TYPE;
+            break;
+#endif
+        case DICTID:
+            NEEDBITS(32);
+            strm->adler = state->check = REVERSE(hold);
+            INITBITS();
+            state->mode = DICT;
+        case DICT:
+            if (state->havedict == 0) {
+                RESTORE();
+                return Z_NEED_DICT;
+            }
+            strm->adler = state->check = adler32(0L, Z_NULL, 0);
+            state->mode = TYPE;
+        case TYPE:
+           WATCHDOG_RESET();
+            if (flush == Z_BLOCK) goto inf_leave;
+        case TYPEDO:
+            if (state->last) {
+                BYTEBITS();
+                state->mode = CHECK;
+                break;
+            }
+            NEEDBITS(3);
+            state->last = BITS(1);
+            DROPBITS(1);
+            switch (BITS(2)) {
+            case 0:                             /* stored block */
+                Tracev((stderr, "inflate:     stored block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = STORED;
+                break;
+            case 1:                             /* fixed block */
+                fixedtables(state);
+                Tracev((stderr, "inflate:     fixed codes block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = LEN;              /* decode codes */
+                break;
+            case 2:                             /* dynamic block */
+                Tracev((stderr, "inflate:     dynamic codes block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = TABLE;
+                break;
+            case 3:
+                strm->msg = (char *)"invalid block type";
+                state->mode = BAD;
+            }
+            DROPBITS(2);
+            break;
+        case STORED:
+            BYTEBITS();                         /* go to byte boundary */
+            NEEDBITS(32);
+            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+                strm->msg = (char *)"invalid stored block lengths";
+                state->mode = BAD;
+                break;
+            }
+            state->length = (unsigned)hold & 0xffff;
+            Tracev((stderr, "inflate:       stored length %u\n",
+                    state->length));
+            INITBITS();
+            state->mode = COPY;
+        case COPY:
+            copy = state->length;
+            if (copy) {
+                if (copy > have) copy = have;
+                if (copy > left) copy = left;
+                if (copy == 0) goto inf_leave;
+                zmemcpy(put, next, copy);
+                have -= copy;
+                next += copy;
+                left -= copy;
+                put += copy;
+                state->length -= copy;
+                break;
+            }
+            Tracev((stderr, "inflate:       stored end\n"));
+            state->mode = TYPE;
+            break;
+        case TABLE:
+            NEEDBITS(14);
+            state->nlen = BITS(5) + 257;
+            DROPBITS(5);
+            state->ndist = BITS(5) + 1;
+            DROPBITS(5);
+            state->ncode = BITS(4) + 4;
+            DROPBITS(4);
+#ifndef PKZIP_BUG_WORKAROUND
+            if (state->nlen > 286 || state->ndist > 30) {
+                strm->msg = (char *)"too many length or distance symbols";
+                state->mode = BAD;
+                break;
+            }
+#endif
+            Tracev((stderr, "inflate:       table sizes ok\n"));
+            state->have = 0;
+            state->mode = LENLENS;
+        case LENLENS:
+            while (state->have < state->ncode) {
+                NEEDBITS(3);
+                state->lens[order[state->have++]] = (unsigned short)BITS(3);
+                DROPBITS(3);
+            }
+            while (state->have < 19)
+                state->lens[order[state->have++]] = 0;
+            state->next = state->codes;
+            state->lencode = (code const FAR *)(state->next);
+            state->lenbits = 7;
+            ret = inflate_table(CODES, state->lens, 19, &(state->next),
+                                &(state->lenbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid code lengths set";
+                state->mode = BAD;
+                break;
+            }
+            Tracev((stderr, "inflate:       code lengths ok\n"));
+            state->have = 0;
+            state->mode = CODELENS;
+        case CODELENS:
+            while (state->have < state->nlen + state->ndist) {
+                for (;;) {
+                    this = state->lencode[BITS(state->lenbits)];
+                    if ((unsigned)(this.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                if (this.val < 16) {
+                    NEEDBITS(this.bits);
+                    DROPBITS(this.bits);
+                    state->lens[state->have++] = this.val;
+                }
+                else {
+                    if (this.val == 16) {
+                        NEEDBITS(this.bits + 2);
+                        DROPBITS(this.bits);
+                        if (state->have == 0) {
+                            strm->msg = (char *)"invalid bit length repeat";
+                            state->mode = BAD;
+                            break;
+                        }
+                        len = state->lens[state->have - 1];
+                        copy = 3 + BITS(2);
+                        DROPBITS(2);
+                    }
+                    else if (this.val == 17) {
+                        NEEDBITS(this.bits + 3);
+                        DROPBITS(this.bits);
+                        len = 0;
+                        copy = 3 + BITS(3);
+                        DROPBITS(3);
+                    }
+                    else {
+                        NEEDBITS(this.bits + 7);
+                        DROPBITS(this.bits);
+                        len = 0;
+                        copy = 11 + BITS(7);
+                        DROPBITS(7);
+                    }
+                    if (state->have + copy > state->nlen + state->ndist) {
+                        strm->msg = (char *)"invalid bit length repeat";
+                        state->mode = BAD;
+                        break;
+                    }
+                    while (copy--)
+                        state->lens[state->have++] = (unsigned short)len;
+                }
+            }
+
+            /* handle error breaks in while */
+            if (state->mode == BAD) break;
+
+            /* build code tables */
+            state->next = state->codes;
+            state->lencode = (code const FAR *)(state->next);
+            state->lenbits = 9;
+            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+                                &(state->lenbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid literal/lengths set";
+                state->mode = BAD;
+                break;
+            }
+            state->distcode = (code const FAR *)(state->next);
+            state->distbits = 6;
+            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+                            &(state->next), &(state->distbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid distances set";
+                state->mode = BAD;
+                break;
+            }
+            Tracev((stderr, "inflate:       codes ok\n"));
+            state->mode = LEN;
+        case LEN:
+           WATCHDOG_RESET();
+            if (have >= 6 && left >= 258) {
+                RESTORE();
+                inflate_fast(strm, out);
+                LOAD();
+                break;
+            }
+            for (;;) {
+                this = state->lencode[BITS(state->lenbits)];
+                if ((unsigned)(this.bits) <= bits) break;
+                PULLBYTE();
+            }
+            if (this.op && (this.op & 0xf0) == 0) {
+                last = this;
+                for (;;) {
+                    this = state->lencode[last.val +
+                            (BITS(last.bits + last.op) >> last.bits)];
+                    if ((unsigned)(last.bits + this.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                DROPBITS(last.bits);
+            }
+            DROPBITS(this.bits);
+            state->length = (unsigned)this.val;
+            if ((int)(this.op) == 0) {
+                Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
+                        "inflate:         literal '%c'\n" :
+                        "inflate:         literal 0x%02x\n", this.val));
+                state->mode = LIT;
+                break;
+            }
+            if (this.op & 32) {
+                Tracevv((stderr, "inflate:         end of block\n"));
+                state->mode = TYPE;
+                break;
+            }
+            if (this.op & 64) {
+                strm->msg = (char *)"invalid literal/length code";
+                state->mode = BAD;
+                break;
+            }
+            state->extra = (unsigned)(this.op) & 15;
+            state->mode = LENEXT;
+        case LENEXT:
+            if (state->extra) {
+                NEEDBITS(state->extra);
+                state->length += BITS(state->extra);
+                DROPBITS(state->extra);
+            }
+            Tracevv((stderr, "inflate:         length %u\n", state->length));
+            state->mode = DIST;
+        case DIST:
+            for (;;) {
+                this = state->distcode[BITS(state->distbits)];
+                if ((unsigned)(this.bits) <= bits) break;
+                PULLBYTE();
+            }
+            if ((this.op & 0xf0) == 0) {
+                last = this;
+                for (;;) {
+                    this = state->distcode[last.val +
+                            (BITS(last.bits + last.op) >> last.bits)];
+                    if ((unsigned)(last.bits + this.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                DROPBITS(last.bits);
+            }
+            DROPBITS(this.bits);
+            if (this.op & 64) {
+                strm->msg = (char *)"invalid distance code";
+                state->mode = BAD;
+                break;
+            }
+            state->offset = (unsigned)this.val;
+            state->extra = (unsigned)(this.op) & 15;
+            state->mode = DISTEXT;
+        case DISTEXT:
+            if (state->extra) {
+                NEEDBITS(state->extra);
+                state->offset += BITS(state->extra);
+                DROPBITS(state->extra);
+            }
+#ifdef INFLATE_STRICT
+            if (state->offset > state->dmax) {
+                strm->msg = (char *)"invalid distance too far back";
+                state->mode = BAD;
+                break;
+            }
+#endif
+            if (state->offset > state->whave + out - left) {
+                strm->msg = (char *)"invalid distance too far back";
+                state->mode = BAD;
+                break;
+            }
+            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
+            state->mode = MATCH;
+        case MATCH:
+            if (left == 0) goto inf_leave;
+            copy = out - left;
+            if (state->offset > copy) {         /* copy from window */
+                copy = state->offset - copy;
+                if (copy > state->write) {
+                    copy -= state->write;
+                    from = state->window + (state->wsize - copy);
+                }
+                else
+                    from = state->window + (state->write - copy);
+                if (copy > state->length) copy = state->length;
+            }
+            else {                              /* copy from output */
+                from = put - state->offset;
+                copy = state->length;
+            }
+            if (copy > left) copy = left;
+            left -= copy;
+            state->length -= copy;
+            do {
+                *put++ = *from++;
+            } while (--copy);
+            if (state->length == 0) state->mode = LEN;
+            break;
+        case LIT:
+            if (left == 0) goto inf_leave;
+            *put++ = (unsigned char)(state->length);
+            left--;
+            state->mode = LEN;
+            break;
+        case CHECK:
+            if (state->wrap) {
+                NEEDBITS(32);
+                out -= left;
+                strm->total_out += out;
+                state->total += out;
+                if (out)
+                    strm->adler = state->check =
+                        UPDATE(state->check, put - out, out);
+                out = left;
+                if ((
+#ifdef GUNZIP
+                     state->flags ? hold :
+#endif
+                     REVERSE(hold)) != state->check) {
+                    strm->msg = (char *)"incorrect data check";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+                Tracev((stderr, "inflate:   check matches trailer\n"));
+            }
+#ifdef GUNZIP
+            state->mode = LENGTH;
+        case LENGTH:
+            if (state->wrap && state->flags) {
+                NEEDBITS(32);
+                if (hold != (state->total & 0xffffffffUL)) {
+                    strm->msg = (char *)"incorrect length check";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+                Tracev((stderr, "inflate:   length matches trailer\n"));
+            }
+#endif
+            state->mode = DONE;
+        case DONE:
+            ret = Z_STREAM_END;
+            goto inf_leave;
+        case BAD:
+            ret = Z_DATA_ERROR;
+            goto inf_leave;
+        case MEM:
+            return Z_MEM_ERROR;
+        case SYNC:
+        default:
+            return Z_STREAM_ERROR;
+        }
+
+    /*
+       Return from inflate(), updating the total counts and the check value.
+       If there was no progress during the inflate() call, return a buffer
+       error.  Call updatewindow() to create and/or update the window state.
+       Note: a memory error from inflate() is non-recoverable.
+     */
+  inf_leave:
+    RESTORE();
+    if (state->wsize || (state->mode < CHECK && out != strm->avail_out))
+        if (updatewindow(strm, out)) {
+            state->mode = MEM;
+            return Z_MEM_ERROR;
+        }
+    in -= strm->avail_in;
+    out -= strm->avail_out;
+    strm->total_in += in;
+    strm->total_out += out;
+    state->total += out;
+    if (state->wrap && out)
+        strm->adler = state->check =
+            UPDATE(state->check, strm->next_out - out, out);
+    strm->data_type = state->bits + (state->last ? 64 : 0) +
+                      (state->mode == TYPE ? 128 : 0);
+    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
+        ret = Z_BUF_ERROR;
+    return ret;
+}
+
+int ZEXPORT inflateEnd(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+        return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->window != Z_NULL) {
+       WATCHDOG_RESET();
+       ZFREE(strm, state->window);
+    }
+    ZFREE(strm, strm->state);
+    strm->state = Z_NULL;
+    Tracev((stderr, "inflate: end\n"));
+    return Z_OK;
+}
diff --git a/lib/zlib/inflate.h b/lib/zlib/inflate.h
new file mode 100644 (file)
index 0000000..07bd3e7
--- /dev/null
@@ -0,0 +1,115 @@
+/* inflate.h -- internal inflate state definition
+ * Copyright (C) 1995-2004 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* define NO_GZIP when compiling if you want to disable gzip header and
+   trailer decoding by inflate().  NO_GZIP would be used to avoid linking in
+   the crc code when it is not needed.  For shared libraries, gzip decoding
+   should be left enabled. */
+#ifndef NO_GZIP
+#  define GUNZIP
+#endif
+
+/* Possible inflate modes between inflate() calls */
+typedef enum {
+    HEAD,       /* i: waiting for magic header */
+    FLAGS,      /* i: waiting for method and flags (gzip) */
+    TIME,       /* i: waiting for modification time (gzip) */
+    OS,         /* i: waiting for extra flags and operating system (gzip) */
+    EXLEN,      /* i: waiting for extra length (gzip) */
+    EXTRA,      /* i: waiting for extra bytes (gzip) */
+    NAME,       /* i: waiting for end of file name (gzip) */
+    COMMENT,    /* i: waiting for end of comment (gzip) */
+    HCRC,       /* i: waiting for header crc (gzip) */
+    DICTID,     /* i: waiting for dictionary check value */
+    DICT,       /* waiting for inflateSetDictionary() call */
+        TYPE,       /* i: waiting for type bits, including last-flag bit */
+        TYPEDO,     /* i: same, but skip check to exit inflate on new block */
+        STORED,     /* i: waiting for stored size (length and complement) */
+        COPY,       /* i/o: waiting for input or output to copy stored block */
+        TABLE,      /* i: waiting for dynamic block table lengths */
+        LENLENS,    /* i: waiting for code length code lengths */
+        CODELENS,   /* i: waiting for length/lit and distance code lengths */
+            LEN,        /* i: waiting for length/lit code */
+            LENEXT,     /* i: waiting for length extra bits */
+            DIST,       /* i: waiting for distance code */
+            DISTEXT,    /* i: waiting for distance extra bits */
+            MATCH,      /* o: waiting for output space to copy string */
+            LIT,        /* o: waiting for output space to write literal */
+    CHECK,      /* i: waiting for 32-bit check value */
+    LENGTH,     /* i: waiting for 32-bit length (gzip) */
+    DONE,       /* finished check, done -- remain here until reset */
+    BAD,        /* got a data error -- remain here until reset */
+    MEM,        /* got an inflate() memory error -- remain here until reset */
+    SYNC        /* looking for synchronization bytes to restart inflate() */
+} inflate_mode;
+
+/*
+    State transitions between above modes -
+
+    (most modes can go to the BAD or MEM mode -- not shown for clarity)
+
+    Process header:
+        HEAD -> (gzip) or (zlib)
+        (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME
+        NAME -> COMMENT -> HCRC -> TYPE
+        (zlib) -> DICTID or TYPE
+        DICTID -> DICT -> TYPE
+    Read deflate blocks:
+            TYPE -> STORED or TABLE or LEN or CHECK
+            STORED -> COPY -> TYPE
+            TABLE -> LENLENS -> CODELENS -> LEN
+    Read deflate codes:
+                LEN -> LENEXT or LIT or TYPE
+                LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
+                LIT -> LEN
+    Process trailer:
+        CHECK -> LENGTH -> DONE
+ */
+
+/* state maintained between inflate() calls.  Approximately 7K bytes. */
+struct inflate_state {
+    inflate_mode mode;          /* current inflate mode */
+    int last;                   /* true if processing last block */
+    int wrap;                   /* bit 0 true for zlib, bit 1 true for gzip */
+    int havedict;               /* true if dictionary provided */
+    int flags;                  /* gzip header method and flags (0 if zlib) */
+    unsigned dmax;              /* zlib header max distance (INFLATE_STRICT) */
+    unsigned long check;        /* protected copy of check value */
+    unsigned long total;        /* protected copy of output count */
+    gz_headerp head;            /* where to save gzip header information */
+        /* sliding window */
+    unsigned wbits;             /* log base 2 of requested window size */
+    unsigned wsize;             /* window size or zero if not using window */
+    unsigned whave;             /* valid bytes in the window */
+    unsigned write;             /* window write index */
+    unsigned char FAR *window;  /* allocated sliding window, if needed */
+        /* bit accumulator */
+    unsigned long hold;         /* input bit accumulator */
+    unsigned bits;              /* number of bits in "in" */
+        /* for string and stored block copying */
+    unsigned length;            /* literal or length of data to copy */
+    unsigned offset;            /* distance back to copy string from */
+        /* for table and code decoding */
+    unsigned extra;             /* extra bits needed */
+        /* fixed and dynamic code tables */
+    code const FAR *lencode;    /* starting table for length/literal codes */
+    code const FAR *distcode;   /* starting table for distance codes */
+    unsigned lenbits;           /* index bits for lencode */
+    unsigned distbits;          /* index bits for distcode */
+        /* dynamic table building */
+    unsigned ncode;             /* number of code length code lengths */
+    unsigned nlen;              /* number of length code lengths */
+    unsigned ndist;             /* number of distance code lengths */
+    unsigned have;              /* number of code lengths in lens[] */
+    code FAR *next;             /* next available space in codes[] */
+    unsigned short lens[320];   /* temporary storage for code lengths */
+    unsigned short work[288];   /* work area for code table building */
+    code codes[ENOUGH];         /* space for code tables */
+};
diff --git a/lib/zlib/inftrees.c b/lib/zlib/inftrees.c
new file mode 100644 (file)
index 0000000..c6d4c03
--- /dev/null
@@ -0,0 +1,329 @@
+/* inftrees.c -- generate Huffman trees for efficient decoding
+ * Copyright (C) 1995-2005 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* U-boot: we already included these
+#include "zutil.h"
+#include "inftrees.h"
+*/
+
+#define MAXBITS 15
+
+/*
+  If you use the zlib library in a product, an acknowledgment is welcome
+  in the documentation of your product. If for some reason you cannot
+  include such an acknowledgment, I would appreciate that you keep this
+  copyright string in the executable of your product.
+ */
+
+/*
+   Build a set of tables to decode the provided canonical Huffman code.
+   The code lengths are lens[0..codes-1].  The result starts at *table,
+   whose indices are 0..2^bits-1.  work is a writable array of at least
+   lens shorts, which is used as a work area.  type is the type of code
+   to be generated, CODES, LENS, or DISTS.  On return, zero is success,
+   -1 is an invalid code, and +1 means that ENOUGH isn't enough.  table
+   on return points to the next available entry's address.  bits is the
+   requested root table index bits, and on return it is the actual root
+   table index bits.  It will differ if the request is greater than the
+   longest code or if it is less than the shortest code.
+ */
+int inflate_table(type, lens, codes, table, bits, work)
+codetype type;
+unsigned short FAR *lens;
+unsigned codes;
+code FAR * FAR *table;
+unsigned FAR *bits;
+unsigned short FAR *work;
+{
+    unsigned len;               /* a code's length in bits */
+    unsigned sym;               /* index of code symbols */
+    unsigned min, max;          /* minimum and maximum code lengths */
+    unsigned root;              /* number of index bits for root table */
+    unsigned curr;              /* number of index bits for current table */
+    unsigned drop;              /* code bits to drop for sub-table */
+    int left;                   /* number of prefix codes available */
+    unsigned used;              /* code entries in table used */
+    unsigned huff;              /* Huffman code */
+    unsigned incr;              /* for incrementing code, index */
+    unsigned fill;              /* index for replicating entries */
+    unsigned low;               /* low bits for current root entry */
+    unsigned mask;              /* mask for low root bits */
+    code this;                  /* table entry for duplication */
+    code FAR *next;             /* next available space in table */
+    const unsigned short FAR *base;     /* base value table to use */
+    const unsigned short FAR *extra;    /* extra bits table to use */
+    int end;                    /* use base and extra for symbol > end */
+    unsigned short count[MAXBITS+1];    /* number of codes of each length */
+    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
+    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
+        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
+        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196};
+    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
+        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+        8193, 12289, 16385, 24577, 0, 0};
+    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
+        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
+        28, 28, 29, 29, 64, 64};
+
+    /*
+       Process a set of code lengths to create a canonical Huffman code.  The
+       code lengths are lens[0..codes-1].  Each length corresponds to the
+       symbols 0..codes-1.  The Huffman code is generated by first sorting the
+       symbols by length from short to long, and retaining the symbol order
+       for codes with equal lengths.  Then the code starts with all zero bits
+       for the first code of the shortest length, and the codes are integer
+       increments for the same length, and zeros are appended as the length
+       increases.  For the deflate format, these bits are stored backwards
+       from their more natural integer increment ordering, and so when the
+       decoding tables are built in the large loop below, the integer codes
+       are incremented backwards.
+
+       This routine assumes, but does not check, that all of the entries in
+       lens[] are in the range 0..MAXBITS.  The caller must assure this.
+       1..MAXBITS is interpreted as that code length.  zero means that that
+       symbol does not occur in this code.
+
+       The codes are sorted by computing a count of codes for each length,
+       creating from that a table of starting indices for each length in the
+       sorted table, and then entering the symbols in order in the sorted
+       table.  The sorted table is work[], with that space being provided by
+       the caller.
+
+       The length counts are used for other purposes as well, i.e. finding
+       the minimum and maximum length codes, determining if there are any
+       codes at all, checking for a valid set of lengths, and looking ahead
+       at length counts to determine sub-table sizes when building the
+       decoding tables.
+     */
+
+    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
+    for (len = 0; len <= MAXBITS; len++)
+        count[len] = 0;
+    for (sym = 0; sym < codes; sym++)
+        count[lens[sym]]++;
+
+    /* bound code lengths, force root to be within code lengths */
+    root = *bits;
+    for (max = MAXBITS; max >= 1; max--)
+        if (count[max] != 0) break;
+    if (root > max) root = max;
+    if (max == 0) {                     /* no symbols to code at all */
+        this.op = (unsigned char)64;    /* invalid code marker */
+        this.bits = (unsigned char)1;
+        this.val = (unsigned short)0;
+        *(*table)++ = this;             /* make a table to force an error */
+        *(*table)++ = this;
+        *bits = 1;
+        return 0;     /* no symbols, but wait for decoding to report error */
+    }
+    for (min = 1; min <= MAXBITS; min++)
+        if (count[min] != 0) break;
+    if (root < min) root = min;
+
+    /* check for an over-subscribed or incomplete set of lengths */
+    left = 1;
+    for (len = 1; len <= MAXBITS; len++) {
+        left <<= 1;
+        left -= count[len];
+        if (left < 0) return -1;        /* over-subscribed */
+    }
+    if (left > 0 && (type == CODES || max != 1))
+        return -1;                      /* incomplete set */
+
+    /* generate offsets into symbol table for each length for sorting */
+    offs[1] = 0;
+    for (len = 1; len < MAXBITS; len++)
+        offs[len + 1] = offs[len] + count[len];
+
+    /* sort symbols by length, by symbol order within each length */
+    for (sym = 0; sym < codes; sym++)
+        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
+
+    /*
+       Create and fill in decoding tables.  In this loop, the table being
+       filled is at next and has curr index bits.  The code being used is huff
+       with length len.  That code is converted to an index by dropping drop
+       bits off of the bottom.  For codes where len is less than drop + curr,
+       those top drop + curr - len bits are incremented through all values to
+       fill the table with replicated entries.
+
+       root is the number of index bits for the root table.  When len exceeds
+       root, sub-tables are created pointed to by the root entry with an index
+       of the low root bits of huff.  This is saved in low to check for when a
+       new sub-table should be started.  drop is zero when the root table is
+       being filled, and drop is root when sub-tables are being filled.
+
+       When a new sub-table is needed, it is necessary to look ahead in the
+       code lengths to determine what size sub-table is needed.  The length
+       counts are used for this, and so count[] is decremented as codes are
+       entered in the tables.
+
+       used keeps track of how many table entries have been allocated from the
+       provided *table space.  It is checked when a LENS table is being made
+       against the space in *table, ENOUGH, minus the maximum space needed by
+       the worst case distance code, MAXD.  This should never happen, but the
+       sufficiency of ENOUGH has not been proven exhaustively, hence the check.
+       This assumes that when type == LENS, bits == 9.
+
+       sym increments through all symbols, and the loop terminates when
+       all codes of length max, i.e. all codes, have been processed.  This
+       routine permits incomplete codes, so another loop after this one fills
+       in the rest of the decoding tables with invalid code markers.
+     */
+
+    /* set up for code type */
+    switch (type) {
+    case CODES:
+        base = extra = work;    /* dummy value--not used */
+        end = 19;
+        break;
+    case LENS:
+        base = lbase;
+        base -= 257;
+        extra = lext;
+        extra -= 257;
+        end = 256;
+        break;
+    default:            /* DISTS */
+        base = dbase;
+        extra = dext;
+        end = -1;
+    }
+
+    /* initialize state for loop */
+    huff = 0;                   /* starting code */
+    sym = 0;                    /* starting code symbol */
+    len = min;                  /* starting code length */
+    next = *table;              /* current table to fill in */
+    curr = root;                /* current table index bits */
+    drop = 0;                   /* current bits to drop from code for index */
+    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
+    used = 1U << root;          /* use root table entries */
+    mask = used - 1;            /* mask for comparing low */
+
+    /* check available table space */
+    if (type == LENS && used >= ENOUGH - MAXD)
+        return 1;
+
+    /* process all codes and make table entries */
+    for (;;) {
+        /* create table entry */
+        this.bits = (unsigned char)(len - drop);
+        if ((int)(work[sym]) < end) {
+            this.op = (unsigned char)0;
+            this.val = work[sym];
+        }
+        else if ((int)(work[sym]) > end) {
+            this.op = (unsigned char)(extra[work[sym]]);
+            this.val = base[work[sym]];
+        }
+        else {
+            this.op = (unsigned char)(32 + 64);         /* end of block */
+            this.val = 0;
+        }
+
+        /* replicate for those indices with low len bits equal to huff */
+        incr = 1U << (len - drop);
+        fill = 1U << curr;
+        min = fill;                 /* save offset to next table */
+        do {
+            fill -= incr;
+            next[(huff >> drop) + fill] = this;
+        } while (fill != 0);
+
+        /* backwards increment the len-bit code huff */
+        incr = 1U << (len - 1);
+        while (huff & incr)
+            incr >>= 1;
+        if (incr != 0) {
+            huff &= incr - 1;
+            huff += incr;
+        }
+        else
+            huff = 0;
+
+        /* go to next symbol, update count, len */
+        sym++;
+        if (--(count[len]) == 0) {
+            if (len == max) break;
+            len = lens[work[sym]];
+        }
+
+        /* create new sub-table if needed */
+        if (len > root && (huff & mask) != low) {
+            /* if first time, transition to sub-tables */
+            if (drop == 0)
+                drop = root;
+
+            /* increment past last table */
+            next += min;            /* here min is 1 << curr */
+
+            /* determine length of next table */
+            curr = len - drop;
+            left = (int)(1 << curr);
+            while (curr + drop < max) {
+                left -= count[curr + drop];
+                if (left <= 0) break;
+                curr++;
+                left <<= 1;
+            }
+
+            /* check for enough space */
+            used += 1U << curr;
+            if (type == LENS && used >= ENOUGH - MAXD)
+                return 1;
+
+            /* point entry in root table to sub-table */
+            low = huff & mask;
+            (*table)[low].op = (unsigned char)curr;
+            (*table)[low].bits = (unsigned char)root;
+            (*table)[low].val = (unsigned short)(next - *table);
+        }
+    }
+
+    /*
+       Fill in rest of table for incomplete codes.  This loop is similar to the
+       loop above in incrementing huff for table indices.  It is assumed that
+       len is equal to curr + drop, so there is no loop needed to increment
+       through high index bits.  When the current sub-table is filled, the loop
+       drops back to the root table to fill in any remaining entries there.
+     */
+    this.op = (unsigned char)64;                /* invalid code marker */
+    this.bits = (unsigned char)(len - drop);
+    this.val = (unsigned short)0;
+    while (huff != 0) {
+        /* when done with sub-table, drop back to root table */
+        if (drop != 0 && (huff & mask) != low) {
+            drop = 0;
+            len = root;
+            next = *table;
+            this.bits = (unsigned char)len;
+        }
+
+        /* put invalid code marker in table */
+        next[huff >> drop] = this;
+
+        /* backwards increment the len-bit code huff */
+        incr = 1U << (len - 1);
+        while (huff & incr)
+            incr >>= 1;
+        if (incr != 0) {
+            huff &= incr - 1;
+            huff += incr;
+        }
+        else
+            huff = 0;
+    }
+
+    /* set return parameters */
+    *table += used;
+    *bits = root;
+    return 0;
+}
diff --git a/lib/zlib/inftrees.h b/lib/zlib/inftrees.h
new file mode 100644 (file)
index 0000000..b1104c8
--- /dev/null
@@ -0,0 +1,55 @@
+/* inftrees.h -- header to use inftrees.c
+ * Copyright (C) 1995-2005 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* Structure for decoding tables.  Each entry provides either the
+   information needed to do the operation requested by the code that
+   indexed that table entry, or it provides a pointer to another
+   table that indexes more bits of the code.  op indicates whether
+   the entry is a pointer to another table, a literal, a length or
+   distance, an end-of-block, or an invalid code.  For a table
+   pointer, the low four bits of op is the number of index bits of
+   that table.  For a length or distance, the low four bits of op
+   is the number of extra bits to get after the code.  bits is
+   the number of bits in this code or part of the code to drop off
+   of the bit buffer.  val is the actual byte to output in the case
+   of a literal, the base length or distance, or the offset from
+   the current table to the next table.  Each entry is four bytes. */
+typedef struct {
+    unsigned char op;           /* operation, extra bits, table bits */
+    unsigned char bits;         /* bits in this part of the code */
+    unsigned short val;         /* offset in table or code value */
+} code;
+
+/* op values as set by inflate_table():
+    00000000 - literal
+    0000tttt - table link, tttt != 0 is the number of table index bits
+    0001eeee - length or distance, eeee is the number of extra bits
+    01100000 - end of block
+    01000000 - invalid code
+ */
+
+/* Maximum size of dynamic tree.  The maximum found in a long but non-
+   exhaustive search was 1444 code structures (852 for length/literals
+   and 592 for distances, the latter actually the result of an
+   exhaustive search).  The true maximum is not known, but the value
+   below is more than safe. */
+#define ENOUGH 2048
+#define MAXD 592
+
+/* Type of code to build for inftable() */
+typedef enum {
+    CODES,
+    LENS,
+    DISTS
+} codetype;
+
+extern int inflate_table OF((codetype type, unsigned short FAR *lens,
+                             unsigned codes, code FAR * FAR *table,
+                             unsigned FAR *bits, unsigned short FAR *work));
diff --git a/lib/zlib/zlib.c b/lib/zlib/zlib.c
new file mode 100644 (file)
index 0000000..230d0df
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * This file is derived from various .h and .c files from the zlib-1.2.3
+ * distribution by Jean-loup Gailly and Mark Adler, with some additions
+ * by Paul Mackerras to aid in implementing Deflate compression and
+ * decompression for PPP packets.  See zlib.h for conditions of
+ * distribution and use.
+ *
+ * Changes that have been made include:
+ * - changed functions not used outside this file to "local"
+ * - added minCompression parameter to deflateInit2
+ * - added Z_PACKET_FLUSH (see zlib.h for details)
+ * - added inflateIncomp
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+#include "inffixed.h"
+#include "inffast.c"
+#include "inftrees.c"
+#include "inflate.c"
+#include "zutil.c"
+#include "adler32.c"
diff --git a/lib/zlib/zlib.h b/lib/zlib/zlib.h
new file mode 100644 (file)
index 0000000..556be32
--- /dev/null
@@ -0,0 +1,20 @@
+/* Glue between u-boot and upstream zlib */
+#ifndef __GLUE_ZLIB_H__
+#define __GLUE_ZLIB_H__
+
+#include <common.h>
+#include <compiler.h>
+#include <asm/unaligned.h>
+#include <watchdog.h>
+#include "u-boot/zlib.h"
+
+/* avoid conflicts */
+#undef OFF
+#undef ASMINF
+#undef POSTINC
+#undef NO_GZIP
+#define GUNZIP
+#undef STDC
+#undef NO_ERRNO_H
+
+#endif
diff --git a/lib/zlib/zutil.c b/lib/zlib/zutil.c
new file mode 100644 (file)
index 0000000..65f9554
--- /dev/null
@@ -0,0 +1,73 @@
+/* zutil.c -- target dependent utility functions for the compression library
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include "zutil.h"
+
+#ifndef NO_DUMMY_DECL
+struct internal_state      {int dummy;}; /* for buggy compilers */
+#endif
+
+const char * const z_errmsg[10] = {
+"need dictionary",     /* Z_NEED_DICT       2  */
+"stream end",          /* Z_STREAM_END      1  */
+"",                    /* Z_OK              0  */
+"file error",          /* Z_ERRNO         (-1) */
+"stream error",        /* Z_STREAM_ERROR  (-2) */
+"data error",          /* Z_DATA_ERROR    (-3) */
+"insufficient memory", /* Z_MEM_ERROR     (-4) */
+"buffer error",        /* Z_BUF_ERROR     (-5) */
+"incompatible version",/* Z_VERSION_ERROR (-6) */
+""};
+
+#ifdef DEBUG
+
+#ifndef verbose
+#define verbose 0
+#endif
+int z_verbose = verbose;
+
+void z_error (m)
+    char *m;
+{
+       fprintf(stderr, "%s\n", m);
+       hang ();
+}
+#endif
+
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+
+#ifndef STDC
+extern voidp    malloc OF((uInt size));
+extern voidp    calloc OF((uInt items, uInt size));
+extern void     free   OF((voidpf ptr));
+#endif
+
+voidpf zcalloc (opaque, items, size)
+       voidpf opaque;
+       unsigned items;
+       unsigned size;
+{
+       if (opaque)
+               items += size - size; /* make compiler happy */
+       return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
+               (voidpf)calloc(items, size);
+}
+
+void  zcfree (opaque, ptr, nb)
+       voidpf opaque;
+       voidpf ptr;
+       unsigned nb;
+{
+       free(ptr);
+       if (opaque)
+               return; /* make compiler happy */
+}
+
+#endif /* MY_ZCALLOC */
diff --git a/lib/zlib/zutil.h b/lib/zlib/zutil.h
new file mode 100644 (file)
index 0000000..46522c8
--- /dev/null
@@ -0,0 +1,121 @@
+/* zutil.h -- internal interface and configuration of the compression library
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZUTIL_H
+#define ZUTIL_H
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+#ifdef STDC
+#  ifndef _WIN32_WCE
+#    include <stddef.h>
+#  endif
+#  include <string.h>
+#  include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+#   ifdef _WIN32_WCE
+      /* The Microsoft C Run-Time Library for Windows CE doesn't have
+       * errno.  We define it as a global variable to simplify porting.
+       * Its value is always 0 and should not be used.  We rename it to
+       * avoid conflict with other libraries that use the same workaround.
+       */
+#     define errno z_errno
+#   endif
+    extern int errno;
+#else
+#  ifndef _WIN32_WCE
+#    include <errno.h>
+#  endif
+#endif
+
+#ifndef local
+#  define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+typedef unsigned char  uch;
+typedef uch FAR uchf;
+typedef unsigned short ush;
+typedef ush FAR ushf;
+typedef unsigned long  ulg;
+
+extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+/* (size given to avoid silly warnings with Visual C++) */
+
+#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+
+#define ERR_RETURN(strm,err) \
+  return (strm->msg = (char*)ERR_MSG(err), (err))
+/* To be used only when the state is known to be valid */
+
+        /* common constants */
+
+#ifndef DEF_WBITS
+#  define DEF_WBITS MAX_WBITS
+#endif
+/* default windowBits for decompression. MAX_WBITS is for compression only */
+
+#if MAX_MEM_LEVEL >= 8
+#  define DEF_MEM_LEVEL 8
+#else
+#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
+#endif
+/* default memLevel */
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES    2
+/* The three kinds of block type */
+
+#define MIN_MATCH  3
+#define MAX_MATCH  258
+/* The minimum and maximum match lengths */
+
+        /* functions */
+
+#include <linux/string.h>
+#define zmemcpy memcpy
+#define zmemcmp memcmp
+#define zmemzero(dest, len) memset(dest, 0, len)
+
+/* Diagnostic functions */
+#ifdef DEBUG
+#  include <stdio.h>
+   extern int z_verbose;
+   extern void z_error    OF((char *m));
+#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+#  define Trace(x) {if (z_verbose>=0) fprintf x ;}
+#  define Tracev(x) {if (z_verbose>0) fprintf x ;}
+#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
+#else
+#  define Assert(cond,msg)
+#  define Trace(x)
+#  define Tracev(x)
+#  define Tracevv(x)
+#  define Tracec(c,x)
+#  define Tracecv(c,x)
+#endif
+
+
+voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
+void   zcfree  OF((voidpf opaque, voidpf ptr, unsigned size));
+
+#define ZALLOC(strm, items, size) \
+           (*((strm)->zalloc))((strm)->opaque, (items), (size))
+#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr), 0)
+#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
+#endif /* ZUTIL_H */
index c86117b9d6392ceb4eba2ffa64c0f321bfeab29b..638ffd931b8b6bcb49dfe165e46c142f40073dd4 100644 (file)
@@ -68,6 +68,8 @@ SECTIONS
 
        __got_end = .;
 
+       _end = .;
+
        . = ALIGN(4);
        __bss_start = .;
        .bss : { *(.bss) }
index a0e1455e3730569063186fce23cf5335c45fc724..43da3df15743902d15f3c17a6579bcb8558f294c 100644 (file)
@@ -2,7 +2,7 @@
 # (C) Copyright 2007
 # Stefan Roese, DENX Software Engineering, sr@denx.de.
 #
-# Copyright 2009 Freescale Semiconductor, Inc.
+# Copyright 2009-2011 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -32,8 +32,8 @@ include $(TOPDIR)/config.mk
 nandobj        := $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
-LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
-          $(LDFLAGS_FINAL)
+LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
+               $(LDFLAGS) $(LDFLAGS_FINAL)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 
@@ -56,11 +56,14 @@ $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
 $(nandobj)u-boot-spl.bin:      $(nandobj)u-boot-spl
        $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
-$(nandobj)u-boot-spl:  $(OBJS)
+$(nandobj)u-boot-spl:  $(OBJS) $(nandobj)u-boot-nand_spl.lds
        cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
                -Map $(nandobj)u-boot-spl.map \
                -o $(nandobj)u-boot-spl
 
+$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
+       $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+
 # create symbolic links for common files
 
 $(obj)cache.c:
index a0e1455e3730569063186fce23cf5335c45fc724..43da3df15743902d15f3c17a6579bcb8558f294c 100644 (file)
@@ -2,7 +2,7 @@
 # (C) Copyright 2007
 # Stefan Roese, DENX Software Engineering, sr@denx.de.
 #
-# Copyright 2009 Freescale Semiconductor, Inc.
+# Copyright 2009-2011 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -32,8 +32,8 @@ include $(TOPDIR)/config.mk
 nandobj        := $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
-LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
-          $(LDFLAGS_FINAL)
+LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
+               $(LDFLAGS) $(LDFLAGS_FINAL)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 
@@ -56,11 +56,14 @@ $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
 $(nandobj)u-boot-spl.bin:      $(nandobj)u-boot-spl
        $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
-$(nandobj)u-boot-spl:  $(OBJS)
+$(nandobj)u-boot-spl:  $(OBJS) $(nandobj)u-boot-nand_spl.lds
        cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
                -Map $(nandobj)u-boot-spl.map \
                -o $(nandobj)u-boot-spl
 
+$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
+       $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+
 # create symbolic links for common files
 
 $(obj)cache.c:
index 092ce143ef71d69d812a5f136f34c011f00fb7e8..43da3df15743902d15f3c17a6579bcb8558f294c 100644 (file)
@@ -2,7 +2,7 @@
 # (C) Copyright 2007
 # Stefan Roese, DENX Software Engineering, sr@denx.de.
 #
-# Copyright 2009-2010 Freescale Semiconductor, Inc.
+# Copyright 2009-2011 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -32,8 +32,8 @@ include $(TOPDIR)/config.mk
 nandobj        := $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
-LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
-          $(LDFLAGS_FINAL)
+LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
+               $(LDFLAGS) $(LDFLAGS_FINAL)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 
@@ -56,11 +56,14 @@ $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
 $(nandobj)u-boot-spl.bin:      $(nandobj)u-boot-spl
        $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
-$(nandobj)u-boot-spl:  $(OBJS)
+$(nandobj)u-boot-spl:  $(OBJS) $(nandobj)u-boot-nand_spl.lds
        cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
                -Map $(nandobj)u-boot-spl.map \
                -o $(nandobj)u-boot-spl
 
+$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
+       $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+
 # create symbolic links for common files
 
 $(obj)cache.c:
index 324a932fb22300a61d9e429a1b4542b396b178be..d2b08f60c59c7597299ebab1c3002e02ebbdf6e8 100644 (file)
@@ -63,6 +63,8 @@ SECTIONS
                *(.dynsym)
        }
 
+       _end = .;
+
        .bss __rel_dyn_start (OVERLAY) : {
                __bss_start = .;
                *(.bss)
index a0e1455e3730569063186fce23cf5335c45fc724..43da3df15743902d15f3c17a6579bcb8558f294c 100644 (file)
@@ -2,7 +2,7 @@
 # (C) Copyright 2007
 # Stefan Roese, DENX Software Engineering, sr@denx.de.
 #
-# Copyright 2009 Freescale Semiconductor, Inc.
+# Copyright 2009-2011 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -32,8 +32,8 @@ include $(TOPDIR)/config.mk
 nandobj        := $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
-LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
-          $(LDFLAGS_FINAL)
+LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
+               $(LDFLAGS) $(LDFLAGS_FINAL)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 
@@ -56,11 +56,14 @@ $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
 $(nandobj)u-boot-spl.bin:      $(nandobj)u-boot-spl
        $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
-$(nandobj)u-boot-spl:  $(OBJS)
+$(nandobj)u-boot-spl:  $(OBJS) $(nandobj)u-boot-nand_spl.lds
        cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
                -Map $(nandobj)u-boot-spl.map \
                -o $(nandobj)u-boot-spl
 
+$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
+       $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+
 # create symbolic links for common files
 
 $(obj)cache.c:
index 324a932fb22300a61d9e429a1b4542b396b178be..d2b08f60c59c7597299ebab1c3002e02ebbdf6e8 100644 (file)
@@ -63,6 +63,8 @@ SECTIONS
                *(.dynsym)
        }
 
+       _end = .;
+
        .bss __rel_dyn_start (OVERLAY) : {
                __bss_start = .;
                *(.bss)
index 76b8566fb2a95c45a2732f5bb88319efb52f338a..4a968784e757798992499f99387a04d11e36cf35 100644 (file)
@@ -90,6 +90,10 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8
                cmd = NAND_CMD_READ0;
        }
 
+       /* Shift the offset from byte addressing to word addressing. */
+       if (this->options & NAND_BUSWIDTH_16)
+               offs >>= 1;
+
        /* Begin command latch cycle */
        this->cmd_ctrl(mtd, cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
        /* Set ALE and clear CLE to start address cycle */
index 9547d44238885fbd36e23eda1403f5c79f5d6b79..502605b1d5cc00ddf13c6763282b83783cc47222 100644 (file)
@@ -51,11 +51,11 @@ static void nand_load(unsigned int offs, int uboot_size, uchar *dst)
 {
        fsl_lbc_t *regs = LBC_BASE_ADDR;
        uchar *buf = (uchar *)CONFIG_SYS_NAND_BASE;
-       int large = in_be32(&regs->bank[0].or) & OR_FCM_PGS;
-       int block_shift = large ? 17 : 14;
-       int block_size = 1 << block_shift;
-       int page_size = large ? 2048 : 512;
-       int bad_marker = large ? page_size + 0 : page_size + 5;
+       const int large = CONFIG_SYS_NAND_OR_PRELIM & OR_FCM_PGS;
+       const int block_shift = large ? 17 : 14;
+       const int block_size = 1 << block_shift;
+       const int page_size = large ? 2048 : 512;
+       const int bad_marker = large ? page_size + 0 : page_size + 5;
        int fmr = (15 << FMR_CWTO_SHIFT) | (2 << FMR_AL_SHIFT) | 2;
        int pos = 0;
 
index a3f0f6ba51add514801f9ed84f33fac484258f50..d6b0d9b6d10502c7d570c360a14fc7a015308329 100644 (file)
 
 #include <common.h>
 #include <nand.h>
-#ifdef CONFIG_MX31
-#include <asm/arch/mx31-regs.h>
-#else
 #include <asm/arch/imx-regs.h>
-#endif
 #include <asm/io.h>
 #include <fsl_nfc.h>
 
index 1a717867d48885b479050909b43d1cba0b372fe7..87b027e8fa65b03e126992a3a44971e7842c24ba 100644 (file)
@@ -464,7 +464,7 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R
 
        /* Pad to minimal length */
 #ifdef CONFIG_DHCP_MIN_EXT_LEN
-       while ((e - start) <= CONFIG_DHCP_MIN_EXT_LEN)
+       while ((e - start) < CONFIG_DHCP_MIN_EXT_LEN)
                *e++ = 0;
 #endif
 
index 3a7ff50bf3905c1602f4ab3ea705ebb7a2bfbf7d..65238340601bc5a984b2eef59e18f86977b639b7 100644 (file)
--- a/net/eth.c
+++ b/net/eth.c
@@ -25,6 +25,7 @@
 #include <command.h>
 #include <net.h>
 #include <miiphy.h>
+#include <phy.h>
 
 void eth_parse_enetaddr(const char *addr, uchar *enetaddr)
 {
@@ -217,6 +218,11 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
        miiphy_init();
 #endif
+
+#ifdef CONFIG_PHYLIB
+       phy_init();
+#endif
+
        /*
         * If board-specific initialization exists, call it.
         * If not, call a CPU-specific one
index a6096324126ada55e2f30afe023d376f6720ff16..e50bdf17be13e4481fa797aafe26b273435d55b5 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -1724,7 +1724,8 @@ static int net_check_prereq (proto_t protocol)
                        puts ("*** ERROR: `serverip' not set\n");
                        return (1);
                }
-#if defined(CONFIG_CMD_PING) || defined(CONFIG_CMD_SNTP)
+#if defined(CONFIG_CMD_PING) || defined(CONFIG_CMD_SNTP) || \
+    defined(CONFIG_CMD_DNS)
     common:
 #endif
 
index 91e679a3247b974b9ad8459ae50b62fcdd80fcd3..d5f228f27d8a3d6df9470c77f3b09a0d6091cd96 100644 (file)
@@ -2,6 +2,12 @@
 This is a demo implementation of a Linux command line tool to access
 the U-Boot's environment variables.
 
+In the current version, there is an issue in cross-compilation.
+In order to cross-compile fw_printenv, run
+    make HOSTCC=<your CC cross-compiler> env
+in the root directory of the U-Boot distribution. For example,
+    make HOSTCC=arm-linux-gcc env
+
 For the run-time utiltity configuration uncomment the line
 #define CONFIG_FILE  "/etc/fw_env.config"
 in fw_env.h.
index 8ff70522430dee31f776a6f31c8eae7442df83de..ed6b53f4814c057fe279b05dabd12e2033f8bac4 100644 (file)
@@ -674,11 +674,7 @@ static int flash_read_buf (int dev, int fd, void *buf, size_t count,
                                   MEMGETBADBLOCK needs 64 bits */
        int rc;
 
-       /*
-        * Start of the first block to be read, relies on the fact, that
-        * erase sector size is always a power of 2
-        */
-       blockstart = offset & ~(DEVESIZE (dev) - 1);
+       blockstart = (offset / DEVESIZE (dev)) * DEVESIZE (dev);
 
        /* Offset inside a block */
        block_seek = offset - blockstart;
@@ -694,8 +690,8 @@ static int flash_read_buf (int dev, int fd, void *buf, size_t count,
                 * To calculate the top of the range, we have to use the
                 * global DEVOFFSET (dev), which can be different from offset
                 */
-               top_of_range = (DEVOFFSET (dev) & ~(blocklen - 1)) +
-                       ENVSECTORS (dev) * blocklen;
+               top_of_range = ((DEVOFFSET(dev) / blocklen) +
+                               ENVSECTORS (dev)) * blocklen;
 
                /* Limit to one block for the first read */
                if (readlen > blocklen - block_seek)
@@ -749,9 +745,9 @@ static int flash_read_buf (int dev, int fd, void *buf, size_t count,
 }
 
 /*
- * Write count bytes at offset, but stay within ENVSETCORS (dev) sectors of
- * DEVOFFSET (dev). Similar to the read case above, on NOR we erase and write
- * the whole data at once.
+ * Write count bytes at offset, but stay within ENVSECTORS (dev) sectors of
+ * DEVOFFSET (dev). Similar to the read case above, on NOR and dataflash we
+ * erase and write the whole data at once.
  */
 static int flash_write_buf (int dev, int fd, void *buf, size_t count,
                            off_t offset, uint8_t mtd_type)
@@ -764,7 +760,7 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
        size_t erasesize;       /* erase / write length - one block on NAND,
                                   whole area on NOR */
        size_t processed = 0;   /* progress counter */
-       size_t write_total;     /* total size to actually write - excludinig
+       size_t write_total;     /* total size to actually write - excluding
                                   bad blocks */
        off_t erase_offset;     /* offset to the first erase block (aligned)
                                   below offset */
@@ -777,11 +773,10 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
 
        blocklen = DEVESIZE (dev);
 
-       /* Erase sector size is always a power of 2 */
-       top_of_range = (DEVOFFSET (dev) & ~(blocklen - 1)) +
-               ENVSECTORS (dev) * blocklen;
+       top_of_range = ((DEVOFFSET(dev) / blocklen) +
+                                       ENVSECTORS (dev)) * blocklen;
 
-       erase_offset = offset & ~(blocklen - 1);
+       erase_offset = (offset / blocklen) * blocklen;
 
        /* Maximum area we may use */
        erase_len = top_of_range - erase_offset;
@@ -795,7 +790,8 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
         * to the start of the data, then count bytes of data, and to the
         * end of the block
         */
-       write_total = (block_seek + count + blocklen - 1) & ~(blocklen - 1);
+       write_total = ((block_seek + count + blocklen - 1) /
+                                               blocklen) * blocklen;
 
        /*
         * Support data anywhere within erase sectors: read out the complete
@@ -838,7 +834,7 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
 
        erase.length = erasesize;
 
-       /* This only runs once on NOR flash */
+       /* This only runs once on NOR flash and SPI-dataflash */
        while (processed < write_total) {
                rc = flash_bad_block (fd, mtd_type, &blockstart);
                if (rc < 0)             /* block test failed */
@@ -857,12 +853,14 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
                erase.start = blockstart;
                ioctl (fd, MEMUNLOCK, &erase);
 
-               if (ioctl (fd, MEMERASE, &erase) != 0) {
-                       fprintf (stderr, "MTD erase error on %s: %s\n",
-                                DEVNAME (dev),
-                                strerror (errno));
-                       return -1;
-               }
+               /* Dataflash does not need an explicit erase cycle */
+               if (mtd_type != MTD_DATAFLASH)
+                       if (ioctl (fd, MEMERASE, &erase) != 0) {
+                               fprintf (stderr, "MTD erase error on %s: %s\n",
+                                        DEVNAME (dev),
+                                        strerror (errno));
+                               return -1;
+                       }
 
                if (lseek (fd, blockstart, SEEK_SET) == -1) {
                        fprintf (stderr,
@@ -973,7 +971,9 @@ static int flash_read (int fd)
                return -1;
        }
 
-       if (mtdinfo.type != MTD_NORFLASH && mtdinfo.type != MTD_NANDFLASH) {
+       if (mtdinfo.type != MTD_NORFLASH &&
+           mtdinfo.type != MTD_NANDFLASH &&
+           mtdinfo.type != MTD_DATAFLASH) {
                fprintf (stderr, "Unsupported flash type %u\n", mtdinfo.type);
                return -1;
        }
@@ -1067,11 +1067,11 @@ static char *envmatch (char * s1, char * s2)
 int fw_env_open(void)
 {
        int crc0, crc0_ok;
-       char flag0;
+       unsigned char flag0;
        void *addr0;
 
        int crc1, crc1_ok;
-       char flag1;
+       unsigned char flag1;
        void *addr1;
 
        struct env_image_single *single;
@@ -1143,6 +1143,9 @@ int fw_env_open(void)
                } else if (DEVTYPE(dev_current) == MTD_NANDFLASH &&
                           DEVTYPE(!dev_current) == MTD_NANDFLASH) {
                        environment.flag_scheme = FLAG_INCREMENTAL;
+               } else if (DEVTYPE(dev_current) == MTD_DATAFLASH &&
+                          DEVTYPE(!dev_current) == MTD_DATAFLASH) {
+                       environment.flag_scheme = FLAG_BOOLEAN;
                } else {
                        fprintf (stderr, "Incompatible flash types!\n");
                        return -1;
@@ -1182,14 +1185,13 @@ int fw_env_open(void)
                                }
                                break;
                        case FLAG_INCREMENTAL:
-                               if ((flag0 == 255 && flag1 == 0) ||
-                                   flag1 > flag0)
+                               if (flag0 == 255 && flag1 == 0)
                                        dev_current = 1;
                                else if ((flag1 == 255 && flag0 == 0) ||
-                                        flag0 > flag1)
-                                       dev_current = 0;
-                               else /* flags are equal - almost impossible */
+                                        flag0 >= flag1)
                                        dev_current = 0;
+                               else /* flag1 > flag0 */
+                                       dev_current = 1;
                                break;
                        default:
                                fprintf (stderr, "Unknown flag scheme %u \n",
@@ -1234,14 +1236,29 @@ static int parse_config ()
        strcpy (DEVNAME (0), DEVICE1_NAME);
        DEVOFFSET (0) = DEVICE1_OFFSET;
        ENVSIZE (0) = ENV1_SIZE;
+       /* Default values are: erase-size=env-size, #sectors=1 */
+       DEVESIZE (0) = ENVSIZE (0);
+       ENVSECTORS (0) = 1;
+#ifdef DEVICE1_ESIZE
        DEVESIZE (0) = DEVICE1_ESIZE;
+#endif
+#ifdef DEVICE1_ENVSECTORS
        ENVSECTORS (0) = DEVICE1_ENVSECTORS;
+#endif
+
 #ifdef HAVE_REDUND
        strcpy (DEVNAME (1), DEVICE2_NAME);
        DEVOFFSET (1) = DEVICE2_OFFSET;
        ENVSIZE (1) = ENV2_SIZE;
+       /* Default values are: erase-size=env-size, #sectors=1 */
+       DEVESIZE (1) = ENVSIZE (1);
+       ENVSECTORS (1) = 1;
+#ifdef DEVICE2_ESIZE
        DEVESIZE (1) = DEVICE2_ESIZE;
+#endif
+#ifdef DEVICE2_ENVSECTORS
        ENVSECTORS (1) = DEVICE2_ENVSECTORS;
+#endif
        HaveRedundEnv = 1;
 #endif
 #endif
@@ -1285,9 +1302,13 @@ static int get_config (char *fname)
                             &DEVESIZE (i),
                             &ENVSECTORS (i));
 
-               if (rc < 4)
+               if (rc < 3)
                        continue;
 
+               if (rc < 4)
+                       /* Assume the erase size is the same as the env-size */
+                       DEVESIZE(i) = ENVSIZE(i);
+
                if (rc < 5)
                        /* Default - 1 sector */
                        ENVSECTORS (i) = 1;
index c8f12cf0afe7ad27eee549c2c55ce86f059c1888..8e21d5a5ab3e35b7d81ea9f9f714acbc15716cfc 100644 (file)
@@ -1,11 +1,19 @@
 # Configuration file for fw_(printenv/saveenv) utility.
 # Up to two entries are valid, in this case the redundant
 # environment sector is assumed present.
-# Notice, that the "Number of sectors" is ignored on NOR.
+# Notice, that the "Number of sectors" is ignored on NOR and SPI-dataflash.
+# Futhermore, if the Flash sector size is ommitted, this value is assumed to
+# be the same as the Environment size, which is valid for NOR and SPI-dataflash
 
+# NOR example
 # MTD device name      Device offset   Env. size       Flash sector size       Number of sectors
 /dev/mtd1              0x0000          0x4000          0x4000
 /dev/mtd2              0x0000          0x4000          0x4000
 
+# MTD SPI-dataflash example
+# MTD device name      Device offset   Env. size       Flash sector size       Number of sectors
+#/dev/mtd5             0x4200          0x4200
+#/dev/mtd6             0x4200          0x4200
+
 # NAND example
 #/dev/mtd0             0x4000          0x4000          0x20000                 2
index 8130fa150c56424e79dd97c07f81828be322c0c5..c83d6089b74d91486c6096f2d6f155abf5d822be 100644 (file)
 #define DEVICE2_NAME      "/dev/mtd2"
 #define DEVICE1_OFFSET    0x0000
 #define ENV1_SIZE         0x4000
-#define DEVICE1_ESIZE     0x4000
 #define DEVICE2_OFFSET    0x0000
 #define ENV2_SIZE         0x4000
-#define DEVICE2_ESIZE     0x4000
 
 #define CONFIG_BAUDRATE                115200
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
index 38ca6be1f4844b6aeb19b1cf5da431e2f505a5ae..d126a46a73c032766e53d24f787db64118e72921 100644 (file)
@@ -24,8 +24,6 @@
 #ifndef _IMXIMAGE_H_
 #define _IMXIMAGE_H_
 
-#include <config.h>
-
 #define MAX_HW_CFG_SIZE_V2 121 /* Max number of registers imx can set for v2 */
 #define MAX_HW_CFG_SIZE_V1 60  /* Max number of registers imx can set for v1 */
 #define APP_CODE_BARKER        0xB1
index f5859d77642152a78751d4b7ce79255c485e6e5b..60f726303c4f356b4873b4b148f7ebc15f4024f9 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "mkimage.h"
 #include <image.h>
+#include <version.h>
 
 static void copy_file(int, const char *, int);
 static void usage(void);
@@ -246,6 +247,9 @@ main (int argc, char **argv)
                        case 'v':
                                params.vflag++;
                                break;
+                       case 'V':
+                               printf("mkimage version %s\n", PLAIN_VERSION);
+                               exit(EXIT_SUCCESS);
                        case 'x':
                                params.xflag++;
                                break;
@@ -590,6 +594,8 @@ usage ()
                params.cmdname);
        fprintf (stderr, "       %s [-D dtc_options] -f fit-image.its fit-image\n",
                params.cmdname);
+       fprintf (stderr, "       %s -V ==> print version information and exit\n",
+               params.cmdname);
 
        exit (EXIT_FAILURE);
 }